From e7f61a6c6e86e29ed963f0c7277a52438b203d15 Mon Sep 17 00:00:00 2001 From: eken Date: Mon, 7 Sep 2026 12:02:35 +0800 Subject: [PATCH] init --- Dockerfile | 34 + Dockerfile_fastest | 24 + Makefile | 62 + README.md | 3 + asset/ads/ads_dev.json | 892 + asset/ads/ads_prod.json | 22 + asset/campaign/fission_lang.json | 4794 ++ asset/campaign/lang/ar.json | 761 + asset/campaign/lang/cs.json | 1 + asset/campaign/lang/de.json | 1 + asset/campaign/lang/en.json | 761 + asset/campaign/lang/es.json | 1 + asset/campaign/lang/fr.json | 1 + asset/campaign/lang/hu.json | 1 + asset/campaign/lang/id.json | 1 + asset/campaign/lang/it.json | 1 + asset/campaign/lang/ja.json | 1 + asset/campaign/lang/ko.json | 1 + asset/campaign/lang/lang_test.go | 234 + asset/campaign/lang/nl.json | 761 + asset/campaign/lang/pt.json | 1 + asset/campaign/lang/ru.json | 1 + asset/campaign/lang/th.json | 1 + asset/campaign/lang/tr.json | 1 + asset/campaign/lang/vi.json | 1 + asset/campaign/lang/zh-TW.json | 1 + asset/campaign/lang/zh.json | 761 + asset/campaign/mark.yaml | 22 + asset/taskcenter/ar.json | 40 + asset/taskcenter/cs.json | 40 + asset/taskcenter/de.json | 40 + asset/taskcenter/en.json | 40 + asset/taskcenter/es.json | 40 + asset/taskcenter/fr.json | 40 + asset/taskcenter/hu.json | 40 + asset/taskcenter/id.json | 40 + asset/taskcenter/it.json | 40 + asset/taskcenter/ja.json | 40 + asset/taskcenter/ko.json | 40 + asset/taskcenter/lang_test.go | 297 + asset/taskcenter/nl.json | 40 + asset/taskcenter/pt.json | 40 + asset/taskcenter/ru.json | 40 + asset/taskcenter/th.json | 40 + asset/taskcenter/tr.json | 40 + asset/taskcenter/vi.json | 40 + asset/taskcenter/zh-TW.json | 40 + asset/taskcenter/zh.json | 40 + cmd/joybuywork/joybuywork.go | 36 + etc/config-dev.yaml | 49 + etc/config-prod.yaml | 51 + etc/config-test.yaml | 49 + etc/etc.yaml | 32 + go.mod | 136 + internal/app/ads.go | 242 + internal/app/database_gen.go | 26 + internal/app/etcd.go | 56 + internal/app/feishu_gen.go | 66 + internal/app/kafka_gen.go | 20 + internal/app/lang_data.go | 155 + internal/app/listener.go | 108 + internal/app/logger_gen.go | 43 + internal/app/micro.go | 169 + internal/app/pprof_collector.go | 159 + internal/app/redis_expend.go | 67 + internal/app/redis_gen.go | 21 + internal/app/snowflake.go | 72 + internal/app/thread.go | 59 + internal/boot/boot.go | 148 + internal/boot/listen.go | 180 + internal/config/config.go | 121 + internal/consts/ckey/ckey.go | 54 + internal/consts/ckey/company.go | 17 + internal/consts/ckey/cron.go | 115 + internal/consts/ckey/data_cache.go | 14 + internal/consts/ckey/delay.go | 11 + internal/consts/ckey/fission.go | 615 + internal/consts/ckey/game.go | 37 + internal/consts/ckey/mall.go | 15 + internal/consts/ckey/project.go | 32 + internal/consts/ckey/project_user.go | 22 + internal/consts/ckey/task.go | 22 + internal/consts/ckey/user.go | 12 + internal/consts/consts.go | 114 + internal/consts/currency.go | 67 + internal/consts/fission.go | 747 + internal/consts/games.go | 69 + internal/consts/share.go | 279 + internal/consts/struct.go | 8 + internal/consts/type.go | 21 + internal/consts/vars.go | 22 + internal/handler/w_campaign.go | 405 + internal/handler/w_campaign_stat.go | 173 + internal/handler/w_campaign_user.go | 864 + internal/handler/w_coin.go | 27 + internal/handler/w_common.go | 81 + internal/handler/w_fission.go | 99 + internal/handler/w_fission_web.go | 63 + internal/handler/w_games.go | 90 + internal/handler/w_library.go | 108 + internal/handler/w_mall.go | 126 + internal/handler/w_open_platform.go | 36 + internal/handler/w_project.go | 162 + internal/handler/w_project_user.go | 27 + internal/handler/w_register.go | 18 + internal/handler/w_reward.go | 198 + internal/handler/w_script.go | 108 + internal/handler/w_user.go | 72 + internal/plugins/certs/certs.go | 11 + internal/plugins/certs/tools.go | 51 + internal/plugins/certs/user.go | 72 + internal/plugins/certs/user_test.go | 36 + internal/plugins/encrypt/encrypt.go | 59 + internal/plugins/encrypt/encrypt_test.go | 20 + internal/plugins/export/csv/csv.go | 116 + internal/plugins/export/csv/csv_test.go | 114 + internal/plugins/export/csv/task.go | 78 + .../plugins/export/csv/tmp/export/.gitignore | 2 + internal/plugins/export/export.go | 90 + internal/plugins/export/format.go | 28 + internal/plugins/export/option.go | 52 + internal/plugins/export/redis_part.go | 40 + internal/plugins/export/task.go | 276 + internal/plugins/export/xlsx/option.go | 70 + internal/plugins/export/xlsx/task.go | 87 + .../plugins/export/xlsx/tmp/export/.gitignore | 2 + internal/plugins/export/xlsx/xlsx.go | 299 + internal/plugins/export/xlsx/xlsx_test.go | 165 + internal/plugins/hashid/dbid.go | 65 + internal/plugins/hashid/hash_id.go | 22 + internal/plugins/hashid/hash_id_test.go | 19 + internal/plugins/jsonm/jsonm.go | 115 + internal/plugins/jsonm/jsonm_test.go | 37 + internal/plugins/lucky/logger.go | 14 + internal/plugins/lucky/lucky.go | 1 + internal/plugins/printer/option.go | 9 + internal/plugins/printer/printer.go | 22 + internal/plugins/printer/slow_log.go | 114 + internal/repository/cache/cache.go | 320 + internal/repository/cache/cache_test.go | 60 + internal/repository/cache/campaign.go | 86 + internal/repository/cache/campaign_ballot.go | 61 + internal/repository/cache/campaign_blind.go | 61 + internal/repository/cache/campaign_cash.go | 61 + internal/repository/cache/campaign_channel.go | 92 + internal/repository/cache/campaign_chat.go | 61 + internal/repository/cache/campaign_child.go | 61 + internal/repository/cache/campaign_chop.go | 61 + internal/repository/cache/campaign_coin.go | 61 + internal/repository/cache/campaign_cond.go | 61 + internal/repository/cache/campaign_config.go | 61 + internal/repository/cache/campaign_dice.go | 61 + internal/repository/cache/campaign_evnet.go | 61 + internal/repository/cache/campaign_flip.go | 61 + .../repository/cache/campaign_gashapon.go | 61 + internal/repository/cache/campaign_gold.go | 61 + internal/repository/cache/campaign_grid.go | 61 + internal/repository/cache/campaign_keep.go | 61 + internal/repository/cache/campaign_lang.go | 62 + .../repository/cache/campaign_points_use.go | 61 + internal/repository/cache/campaign_qa.go | 61 + internal/repository/cache/campaign_quiz.go | 61 + .../repository/cache/campaign_referral.go | 61 + .../repository/cache/campaign_reward_rule.go | 61 + internal/repository/cache/campaign_sign.go | 61 + internal/repository/cache/campaign_slot.go | 61 + internal/repository/cache/campaign_style.go | 61 + internal/repository/cache/campaign_ticket.go | 86 + internal/repository/cache/campaign_uno.go | 61 + internal/repository/cache/campaign_vs.go | 61 + internal/repository/cache/campaign_wheel.go | 61 + internal/repository/cache/campaign_win.go | 61 + internal/repository/cache/company_made.go | 61 + internal/repository/cache/fission_chat.go | 75 + .../repository/cache/fission_child_user.go | 61 + internal/repository/cache/fission_config.go | 61 + .../repository/cache/fission_custom_btn.go | 61 + internal/repository/cache/fission_temp.go | 86 + .../repository/cache/fission_temp_group.go | 61 + internal/repository/cache/fission_total.go | 64 + internal/repository/cache/fission_user.go | 146 + .../repository/cache/fission_user_attr.go | 61 + .../cache/fission_user_attr_total.go | 64 + .../repository/cache/fission_user_jattr.go | 61 + .../repository/cache/fission_user_level.go | 86 + internal/repository/cache/fission_web_user.go | 118 + internal/repository/cache/form.go | 61 + internal/repository/cache/game_total.go | 64 + internal/repository/cache/game_total_date.go | 64 + internal/repository/cache/library_qa_group.go | 86 + internal/repository/cache/notify_url.go | 61 + internal/repository/cache/option.go | 24 + internal/repository/cache/project.go | 93 + internal/repository/cache/project_ad.go | 61 + internal/repository/cache/project_user.go | 86 + internal/repository/cache/redeem_mall.go | 61 + internal/repository/cache/redeem_mall_item.go | 61 + .../repository/cache/redistable/option.go | 12 + .../cache/redistable/redis_table.go | 74 + .../redistable/tables/fission_user_notify.go | 7 + internal/repository/cache/reward.go | 116 + internal/repository/cache/t_coin.go | 86 + internal/repository/cache/user.go | 86 + internal/repository/dao/company.gen.go | 369 + internal/repository/dao/company_made.gen.go | 351 + internal/repository/dao/cron_log.gen.go | 365 + internal/repository/dao/err_log.gen.go | 349 + internal/repository/dao/export_task.gen.go | 371 + internal/repository/dao/fission_action.gen.go | 359 + .../dao/fission_archive_task.gen.go | 355 + internal/repository/dao/fission_ballot.gen.go | 363 + .../repository/dao/fission_ballot_log.gen.go | 359 + .../repository/dao/fission_behavior.gen.go | 355 + internal/repository/dao/fission_blind.gen.go | 371 + .../repository/dao/fission_blind_log.gen.go | 359 + .../repository/dao/fission_campaign.gen.go | 423 + .../dao/fission_campaign_ballot.gen.go | 351 + .../dao/fission_campaign_blind.gen.go | 367 + .../dao/fission_campaign_cash.gen.go | 367 + .../dao/fission_campaign_channel.gen.go | 371 + .../dao/fission_campaign_chat.gen.go | 355 + .../dao/fission_campaign_child.gen.go | 351 + .../dao/fission_campaign_chop.gen.go | 351 + .../dao/fission_campaign_coin.gen.go | 395 + .../dao/fission_campaign_cond.gen.go | 463 + .../dao/fission_campaign_config.gen.go | 611 + .../dao/fission_campaign_dice.gen.go | 411 + .../dao/fission_campaign_event.gen.go | 355 + .../dao/fission_campaign_flip.gen.go | 359 + .../dao/fission_campaign_gashapon.gen.go | 355 + .../dao/fission_campaign_gold.gen.go | 367 + .../dao/fission_campaign_grid.gen.go | 367 + .../dao/fission_campaign_grow.gen.go | 375 + .../dao/fission_campaign_grow_step.gen.go | 355 + .../dao/fission_campaign_keep.gen.go | 411 + .../dao/fission_campaign_keep_step.gen.go | 367 + .../dao/fission_campaign_lang.gen.go | 475 + .../dao/fission_campaign_long_img.gen.go | 383 + .../dao/fission_campaign_long_img_zone.gen.go | 389 + .../dao/fission_campaign_points_use.gen.go | 363 + .../dao/fission_campaign_push.gen.go | 355 + .../repository/dao/fission_campaign_qa.gen.go | 379 + .../dao/fission_campaign_qa_option.gen.go | 355 + .../dao/fission_campaign_qa_question.gen.go | 365 + .../dao/fission_campaign_quiz.gen.go | 375 + .../dao/fission_campaign_quiz_option.gen.go | 365 + .../dao/fission_campaign_referral.gen.go | 371 + .../dao/fission_campaign_reward.gen.go | 463 + .../dao/fission_campaign_reward_add.gen.go | 371 + .../fission_campaign_reward_add_log.gen.go | 357 + .../dao/fission_campaign_reward_rule.gen.go | 353 + .../dao/fission_campaign_sign.gen.go | 375 + .../dao/fission_campaign_slot.gen.go | 367 + .../dao/fission_campaign_style.gen.go | 471 + .../dao/fission_campaign_task.gen.go | 423 + .../dao/fission_campaign_ticket.gen.go | 371 + .../dao/fission_campaign_uno.gen.go | 351 + .../dao/fission_campaign_uno_card.gen.go | 371 + .../dao/fission_campaign_uno_group.gen.go | 367 + .../repository/dao/fission_campaign_vs.gen.go | 387 + .../dao/fission_campaign_vs_schedule.gen.go | 405 + .../dao/fission_campaign_vs_team.gen.go | 351 + .../dao/fission_campaign_wheel.gen.go | 367 + .../dao/fission_campaign_win.gen.go | 367 + internal/repository/dao/fission_cash.gen.go | 375 + .../repository/dao/fission_cash_record.gen.go | 359 + internal/repository/dao/fission_chat.gen.go | 355 + .../repository/dao/fission_chat_msg.gen.go | 359 + .../repository/dao/fission_child_user.gen.go | 391 + .../dao/fission_child_user_record.gen.go | 363 + internal/repository/dao/fission_chop.gen.go | 351 + .../repository/dao/fission_chop_help.gen.go | 363 + .../repository/dao/fission_chop_reward.gen.go | 363 + .../dao/fission_client_reward.gen.go | 355 + internal/repository/dao/fission_coin.gen.go | 371 + .../repository/dao/fission_coin_log.gen.go | 363 + .../repository/dao/fission_coin_scene.gen.go | 387 + internal/repository/dao/fission_config.gen.go | 359 + .../repository/dao/fission_custom_btn.gen.go | 343 + internal/repository/dao/fission_dice.gen.go | 379 + .../dao/fission_dice_collect.gen.go | 367 + .../repository/dao/fission_dice_map.gen.go | 359 + .../dao/fission_dice_map_group.gen.go | 355 + .../repository/dao/fission_dice_props.gen.go | 359 + .../repository/dao/fission_dice_record.gen.go | 351 + .../repository/dao/fission_dice_run.gen.go | 363 + internal/repository/dao/fission_flip.gen.go | 367 + .../repository/dao/fission_flip_log.gen.go | 359 + .../repository/dao/fission_gashapon.gen.go | 367 + .../dao/fission_gashapon_log.gen.go | 359 + internal/repository/dao/fission_gold.gen.go | 379 + .../repository/dao/fission_gold_log.gen.go | 363 + internal/repository/dao/fission_grid.gen.go | 371 + .../repository/dao/fission_grid_log.gen.go | 359 + internal/repository/dao/fission_grow.gen.go | 363 + .../repository/dao/fission_grow_life.gen.go | 379 + .../repository/dao/fission_grow_record.gen.go | 355 + internal/repository/dao/fission_keep.gen.go | 407 + .../repository/dao/fission_keep_log.gen.go | 367 + .../repository/dao/fission_lang_module.gen.go | 351 + internal/repository/dao/fission_notify.gen.go | 387 + .../repository/dao/fission_notify_resp.gen.go | 347 + .../repository/dao/fission_notify_task.gen.go | 343 + .../dao/fission_point_deduct.gen.go | 343 + .../repository/dao/fission_points_log.gen.go | 395 + .../repository/dao/fission_prize_wheel.gen.go | 371 + .../dao/fission_prize_wheel_log.gen.go | 359 + internal/repository/dao/fission_qa.gen.go | 367 + internal/repository/dao/fission_qa_log.gen.go | 359 + internal/repository/dao/fission_quiz.gen.go | 367 + .../repository/dao/fission_quiz_log.gen.go | 359 + .../repository/dao/fission_referral.gen.go | 371 + .../dao/fission_reward_record.gen.go | 423 + .../dao/fission_reward_record_form.gen.go | 355 + internal/repository/dao/fission_sign.gen.go | 383 + .../repository/dao/fission_sign_day.gen.go | 359 + .../repository/dao/fission_sign_log.gen.go | 359 + internal/repository/dao/fission_slot.gen.go | 371 + .../repository/dao/fission_slot_log.gen.go | 359 + .../dao/fission_target_record.gen.go | 351 + internal/repository/dao/fission_temp.gen.go | 363 + .../repository/dao/fission_temp_group.gen.go | 371 + .../dao/fission_temp_group_lang.gen.go | 355 + .../repository/dao/fission_temp_image.gen.go | 359 + .../repository/dao/fission_temp_lang.gen.go | 359 + internal/repository/dao/fission_total.gen.go | 359 + .../repository/dao/fission_total_cycle.gen.go | 367 + .../dao/fission_unlock_reward.gen.go | 347 + internal/repository/dao/fission_uno.gen.go | 371 + .../repository/dao/fission_uno_collect.gen.go | 371 + .../repository/dao/fission_uno_log.gen.go | 359 + internal/repository/dao/fission_user.gen.go | 443 + .../repository/dao/fission_user_active.gen.go | 351 + .../repository/dao/fission_user_attr.gen.go | 359 + .../dao/fission_user_attr_total.gen.go | 355 + .../repository/dao/fission_user_cond.gen.go | 367 + .../dao/fission_user_cond_record.gen.go | 363 + .../repository/dao/fission_user_ctlink.gen.go | 363 + .../repository/dao/fission_user_dylink.gen.go | 363 + .../repository/dao/fission_user_event.gen.go | 351 + .../repository/dao/fission_user_jattr.gen.go | 359 + .../repository/dao/fission_user_level.gen.go | 355 + .../dao/fission_user_level_related.gen.go | 355 + .../dao/fission_user_pre_cond.gen.go | 355 + .../repository/dao/fission_user_stat.gen.go | 395 + .../dao/fission_user_task_record.gen.go | 363 + .../dao/fission_user_task_reward.gen.go | 359 + .../dao/fission_user_task_valid.gen.go | 355 + internal/repository/dao/fission_vs.gen.go | 369 + internal/repository/dao/fission_vs_log.gen.go | 359 + .../repository/dao/fission_vs_vote.gen.go | 375 + .../dao/fission_vs_vote_settlement.gen.go | 371 + .../repository/dao/fission_web_user.gen.go | 375 + internal/repository/dao/fission_win.gen.go | 371 + internal/repository/dao/form.gen.go | 353 + internal/repository/dao/game_action.gen.go | 359 + internal/repository/dao/game_link.gen.go | 361 + internal/repository/dao/game_total.gen.go | 363 + .../repository/dao/game_total_date.gen.go | 367 + internal/repository/dao/game_user.gen.go | 373 + internal/repository/dao/gen.go | 1671 + internal/repository/dao/lang.gen.go | 349 + internal/repository/dao/lang_text_mark.gen.go | 347 + internal/repository/dao/library_qa.gen.go | 383 + .../repository/dao/library_qa_group.gen.go | 355 + .../repository/dao/library_qa_option.gen.go | 359 + internal/repository/dao/lv_api_log.gen.go | 381 + internal/repository/dao/material.gen.go | 353 + .../dao/module_statistics_eventflow.gen.go | 397 + internal/repository/dao/notify_url.gen.go | 367 + internal/repository/dao/operate_log.gen.go | 359 + internal/repository/dao/project.gen.go | 409 + internal/repository/dao/project_ad.gen.go | 371 + internal/repository/dao/project_secret.gen.go | 355 + internal/repository/dao/project_user.gen.go | 343 + .../repository/dao/project_user_coin.gen.go | 379 + .../dao/project_user_coin_deduct.gen.go | 359 + .../dao/project_user_coin_expired.gen.go | 355 + .../dao/project_user_coin_log.gen.go | 395 + .../dao/project_user_coin_record.gen.go | 367 + .../dao/project_user_coin_use.gen.go | 359 + .../dao/project_user_info_log.gen.go | 383 + internal/repository/dao/redeem_mall.gen.go | 355 + .../repository/dao/redeem_mall_item.gen.go | 407 + .../dao/redeem_mall_item_task.gen.go | 347 + .../repository/dao/redeem_mall_record.gen.go | 371 + .../repository/dao/redeem_mall_relate.gen.go | 359 + internal/repository/dao/register.gen.go | 373 + internal/repository/dao/register_audit.gen.go | 359 + internal/repository/dao/reward.gen.go | 389 + internal/repository/dao/reward_lang.gen.go | 387 + internal/repository/dao/reward_push.gen.go | 391 + .../repository/dao/reward_push_log.gen.go | 375 + .../repository/dao/reward_push_task.gen.go | 343 + internal/repository/dao/reward_related.gen.go | 355 + .../repository/dao/server_whitelist.gen.go | 335 + internal/repository/dao/slow_log.gen.go | 353 + internal/repository/dao/sub_table.go | 19 + internal/repository/dao/t_coin.gen.go | 353 + internal/repository/dao/t_coin_lang.gen.go | 363 + internal/repository/dao/user.gen.go | 369 + internal/repository/dao/user_behavior.gen.go | 371 + .../repository/dao/user_project_relate.gen.go | 351 + internal/repository/dbcheck/db_check.go | 27 + internal/repository/dbcheck/db_check_test.go | 15 + internal/repository/finder/finder.go | 98 + internal/repository/finder/fuser_layer.go | 216 + internal/repository/model/company.gen.go | 27 + internal/repository/model/company_made.gen.go | 22 + internal/repository/model/company_made.go | 14 + internal/repository/model/cron_log.gen.go | 26 + internal/repository/model/err_log.gen.go | 22 + internal/repository/model/export_task.gen.go | 27 + .../repository/model/fission_action.gen.go | 24 + internal/repository/model/fission_action.go | 15 + .../model/fission_archive_task.gen.go | 23 + .../repository/model/fission_ballot.gen.go | 25 + .../model/fission_ballot_log.gen.go | 24 + .../repository/model/fission_behavior.gen.go | 23 + .../repository/model/fission_blind.gen.go | 27 + .../repository/model/fission_blind_log.gen.go | 24 + .../repository/model/fission_blind_log.go | 15 + .../model/fission_blind_lucky.gen.go | 28 + .../repository/model/fission_campaign.gen.go | 40 + internal/repository/model/fission_campaign.go | 39 + .../model/fission_campaign_ballot.gen.go | 22 + .../model/fission_campaign_blind.gen.go | 26 + .../fission_campaign_blind_reward.gen.go | 31 + .../model/fission_campaign_cash.gen.go | 26 + .../model/fission_campaign_channel.gen.go | 27 + .../model/fission_campaign_chat.gen.go | 23 + .../model/fission_campaign_child.gen.go | 22 + .../model/fission_campaign_chop.gen.go | 22 + .../model/fission_campaign_coin.gen.go | 33 + .../repository/model/fission_campaign_coin.go | 14 + .../model/fission_campaign_cond.gen.go | 50 + .../model/fission_campaign_config.gen.go | 85 + .../model/fission_campaign_config.go | 41 + .../model/fission_campaign_dice.gen.go | 37 + .../repository/model/fission_campaign_dice.go | 15 + .../model/fission_campaign_event.gen.go | 23 + .../model/fission_campaign_event.go | 15 + .../model/fission_campaign_flip.gen.go | 24 + .../model/fission_campaign_gashapon.gen.go | 23 + .../model/fission_campaign_gold.gen.go | 26 + .../model/fission_campaign_grid.gen.go | 26 + .../model/fission_campaign_grid_reward.gen.go | 31 + .../model/fission_campaign_grow.gen.go | 28 + .../model/fission_campaign_grow_step.gen.go | 23 + .../model/fission_campaign_keep.gen.go | 37 + .../repository/model/fission_campaign_keep.go | 24 + .../model/fission_campaign_keep_step.gen.go | 26 + .../model/fission_campaign_lang.gen.go | 53 + .../repository/model/fission_campaign_lang.go | 101 + .../model/fission_campaign_long_img.gen.go | 30 + .../fission_campaign_long_img_zone.gen.go | 31 + .../model/fission_campaign_points_use.gen.go | 25 + .../model/fission_campaign_push.gen.go | 23 + .../repository/model/fission_campaign_push.go | 15 + .../model/fission_campaign_qa.gen.go | 29 + .../model/fission_campaign_qa_option.gen.go | 23 + .../model/fission_campaign_qa_question.gen.go | 25 + .../model/fission_campaign_qa_reward.gen.go | 31 + .../model/fission_campaign_quiz.gen.go | 28 + .../model/fission_campaign_quiz_option.gen.go | 25 + .../model/fission_campaign_quiz_reward.gen.go | 25 + .../model/fission_campaign_referral.gen.go | 27 + .../fission_campaign_referral_reward.gen.go | 27 + .../model/fission_campaign_reward.gen.go | 50 + .../model/fission_campaign_reward.go | 50 + .../model/fission_campaign_reward_add.gen.go | 27 + .../fission_campaign_reward_add_log.gen.go | 23 + .../model/fission_campaign_reward_help.gen.go | 25 + .../model/fission_campaign_reward_rule.gen.go | 22 + .../model/fission_campaign_sign.gen.go | 28 + .../model/fission_campaign_slot.gen.go | 26 + .../model/fission_campaign_slot_reward.gen.go | 31 + .../model/fission_campaign_style.gen.go | 52 + .../model/fission_campaign_style.go | 60 + .../model/fission_campaign_task.gen.go | 40 + .../repository/model/fission_campaign_task.go | 23 + .../model/fission_campaign_ticket.gen.go | 26 + .../model/fission_campaign_ticket.go | 9 + .../model/fission_campaign_uno.gen.go | 22 + .../repository/model/fission_campaign_uno.go | 14 + .../model/fission_campaign_uno_card.gen.go | 27 + .../model/fission_campaign_uno_group.gen.go | 26 + .../model/fission_campaign_uno_group.go | 15 + .../model/fission_campaign_vs.gen.go | 31 + .../model/fission_campaign_vs_schedule.gen.go | 35 + .../model/fission_campaign_vs_schedule.go | 93 + .../model/fission_campaign_vs_team.gen.go | 22 + .../model/fission_campaign_wheel.gen.go | 26 + .../fission_campaign_wheel_reward.gen.go | 31 + .../model/fission_campaign_win.gen.go | 26 + .../model/fission_campaign_win_reward.gen.go | 27 + internal/repository/model/fission_cash.gen.go | 28 + .../model/fission_cash_record.gen.go | 24 + .../repository/model/fission_cash_record.go | 42 + .../model/fission_channel_behavior.gen.go | 23 + internal/repository/model/fission_chat.gen.go | 23 + .../repository/model/fission_chat_msg.gen.go | 24 + internal/repository/model/fission_chat_msg.go | 16 + .../model/fission_child_user.gen.go | 32 + .../repository/model/fission_child_user.go | 14 + .../model/fission_child_user_record.gen.go | 25 + internal/repository/model/fission_chop.gen.go | 22 + .../repository/model/fission_chop_help.gen.go | 25 + .../model/fission_chop_reward.gen.go | 25 + .../model/fission_client_reward.gen.go | 23 + internal/repository/model/fission_coin.gen.go | 27 + .../repository/model/fission_coin_log.gen.go | 25 + internal/repository/model/fission_coin_log.go | 23 + .../model/fission_coin_scene.gen.go | 31 + .../repository/model/fission_config.gen.go | 24 + .../model/fission_custom_btn.gen.go | 20 + internal/repository/model/fission_dice.gen.go | 29 + .../model/fission_dice_collect.gen.go | 26 + .../repository/model/fission_dice_map.gen.go | 24 + .../model/fission_dice_map_group.gen.go | 23 + .../model/fission_dice_props.gen.go | 24 + .../model/fission_dice_props_record.gen.go | 23 + .../model/fission_dice_record.gen.go | 22 + .../repository/model/fission_dice_record.go | 15 + .../repository/model/fission_dice_run.gen.go | 25 + internal/repository/model/fission_flip.gen.go | 26 + .../repository/model/fission_flip_log.gen.go | 24 + internal/repository/model/fission_flip_log.go | 15 + .../repository/model/fission_gashapon.gen.go | 26 + .../model/fission_gashapon_log.gen.go | 24 + .../repository/model/fission_gashapon_log.go | 15 + internal/repository/model/fission_gold.gen.go | 29 + .../repository/model/fission_gold_log.gen.go | 25 + internal/repository/model/fission_gold_log.go | 15 + internal/repository/model/fission_grid.gen.go | 27 + .../repository/model/fission_grid_log.gen.go | 24 + internal/repository/model/fission_grid_log.go | 15 + .../model/fission_grid_lucky.gen.go | 28 + internal/repository/model/fission_grow.gen.go | 25 + .../repository/model/fission_grow_life.gen.go | 29 + .../model/fission_grow_record.gen.go | 23 + .../repository/model/fission_grow_record.go | 15 + internal/repository/model/fission_keep.gen.go | 36 + .../repository/model/fission_keep_log.gen.go | 26 + .../model/fission_lang_module.gen.go | 22 + .../repository/model/fission_lang_module.go | 11 + .../repository/model/fission_notify.gen.go | 31 + internal/repository/model/fission_notify.go | 15 + .../model/fission_notify_resp.gen.go | 21 + .../model/fission_notify_task.gen.go | 20 + .../model/fission_point_deduct.gen.go | 20 + .../model/fission_points_log.gen.go | 33 + .../repository/model/fission_points_log.go | 24 + .../model/fission_prize_wheel.gen.go | 27 + .../model/fission_prize_wheel_log.gen.go | 24 + .../model/fission_prize_wheel_log.go | 15 + .../model/fission_prize_wheel_lucky.gen.go | 28 + internal/repository/model/fission_qa.gen.go | 26 + .../repository/model/fission_qa_answer.gen.go | 29 + .../repository/model/fission_qa_log.gen.go | 24 + internal/repository/model/fission_quiz.gen.go | 26 + .../repository/model/fission_quiz_log.gen.go | 24 + .../model/fission_quiz_reward.gen.go | 25 + .../repository/model/fission_referral.gen.go | 27 + .../model/fission_referral_reward.gen.go | 28 + .../model/fission_reward_record.gen.go | 40 + .../repository/model/fission_reward_record.go | 15 + .../model/fission_reward_record_form.gen.go | 23 + .../model/fission_reward_record_form.go | 15 + internal/repository/model/fission_sign.gen.go | 30 + .../repository/model/fission_sign_day.gen.go | 24 + internal/repository/model/fission_sign_day.go | 26 + .../repository/model/fission_sign_log.gen.go | 24 + internal/repository/model/fission_slot.gen.go | 27 + .../repository/model/fission_slot_log.gen.go | 24 + internal/repository/model/fission_slot_log.go | 15 + .../model/fission_slot_lucky.gen.go | 28 + .../model/fission_stat_channel.gen.go | 28 + .../model/fission_stat_cycle.gen.go | 36 + .../model/fission_stat_media.gen.go | 23 + .../model/fission_stat_other.gen.go | 22 + .../model/fission_stat_summary.gen.go | 36 + .../model/fission_target_record.gen.go | 22 + internal/repository/model/fission_temp.gen.go | 25 + .../model/fission_temp_group.gen.go | 27 + .../model/fission_temp_group_lang.gen.go | 23 + .../model/fission_temp_image.gen.go | 24 + .../repository/model/fission_temp_lang.gen.go | 24 + .../repository/model/fission_total.gen.go | 24 + .../model/fission_total_cycle.gen.go | 26 + .../model/fission_unlock_reward.gen.go | 21 + internal/repository/model/fission_uno.gen.go | 27 + .../model/fission_uno_collect.gen.go | 27 + .../model/fission_uno_collect_log.go | 14 + .../repository/model/fission_uno_log.gen.go | 24 + internal/repository/model/fission_uno_log.go | 15 + internal/repository/model/fission_user.gen.go | 45 + internal/repository/model/fission_user.go | 14 + .../model/fission_user_active.gen.go | 22 + .../repository/model/fission_user_attr.gen.go | 24 + .../repository/model/fission_user_attr.go | 16 + .../model/fission_user_attr_total.gen.go | 23 + .../repository/model/fission_user_cond.gen.go | 26 + .../model/fission_user_cond_record.gen.go | 25 + .../model/fission_user_cond_record.go | 15 + .../model/fission_user_ctlink.gen.go | 25 + .../model/fission_user_dylink.gen.go | 25 + .../repository/model/fission_user_dylink.go | 15 + .../model/fission_user_event.gen.go | 22 + .../model/fission_user_jattr.gen.go | 24 + .../repository/model/fission_user_jattr.go | 15 + .../model/fission_user_level.gen.go | 23 + .../model/fission_user_level_related.gen.go | 23 + .../model/fission_user_pre_cond.gen.go | 23 + .../repository/model/fission_user_stat.gen.go | 33 + .../repository/model/fission_user_tag.gen.go | 22 + .../model/fission_user_task_record.gen.go | 25 + .../model/fission_user_task_reward.gen.go | 24 + .../model/fission_user_task_valid.gen.go | 23 + .../model/fission_user_task_valid.go | 21 + internal/repository/model/fission_vs.gen.go | 27 + .../repository/model/fission_vs_log.gen.go | 24 + .../repository/model/fission_vs_vote.gen.go | 28 + .../model/fission_vs_vote_settlement.gen.go | 27 + .../model/fission_vs_vote_settlement.go | 14 + .../repository/model/fission_web_user.gen.go | 28 + internal/repository/model/fission_win.gen.go | 27 + .../model/fission_win_reward.gen.go | 27 + internal/repository/model/form.gen.go | 23 + internal/repository/model/form.go | 15 + internal/repository/model/game_action.gen.go | 24 + internal/repository/model/game_action.go | 15 + internal/repository/model/game_link.gen.go | 25 + internal/repository/model/game_total.gen.go | 25 + .../repository/model/game_total_date.gen.go | 26 + internal/repository/model/game_user.gen.go | 28 + internal/repository/model/lang.gen.go | 22 + .../repository/model/lang_text_mark.gen.go | 21 + internal/repository/model/library_qa.gen.go | 30 + .../repository/model/library_qa_group.gen.go | 23 + .../repository/model/library_qa_option.gen.go | 24 + internal/repository/model/lv_api_log.gen.go | 30 + internal/repository/model/lv_api_log.go | 15 + internal/repository/model/material.gen.go | 23 + .../model/module_statistics_eventflow.gen.go | 33 + internal/repository/model/notify_url.gen.go | 26 + internal/repository/model/notify_url.go | 15 + internal/repository/model/operate_log.gen.go | 24 + internal/repository/model/permission.gen.go | 24 + internal/repository/model/project.gen.go | 37 + internal/repository/model/project_ad.gen.go | 27 + .../repository/model/project_secret.gen.go | 23 + internal/repository/model/project_user.gen.go | 20 + .../repository/model/project_user_coin.gen.go | 29 + .../repository/model/project_user_coin.go | 9 + .../model/project_user_coin_deduct.gen.go | 24 + .../model/project_user_coin_expired.gen.go | 23 + .../model/project_user_coin_log.gen.go | 33 + .../repository/model/project_user_coin_log.go | 24 + .../model/project_user_coin_record.gen.go | 26 + .../model/project_user_coin_use.gen.go | 24 + .../repository/model/project_user_coin_use.go | 14 + .../model/project_user_info_log.gen.go | 30 + .../repository/model/project_user_info_log.go | 15 + internal/repository/model/redeem_mall.gen.go | 23 + .../repository/model/redeem_mall_item.gen.go | 36 + internal/repository/model/redeem_mall_item.go | 57 + .../model/redeem_mall_item_task.gen.go | 21 + .../model/redeem_mall_record.gen.go | 27 + .../model/redeem_mall_relate.gen.go | 24 + internal/repository/model/register.gen.go | 28 + .../repository/model/register_audit.gen.go | 24 + internal/repository/model/reward.gen.go | 32 + internal/repository/model/reward.go | 20 + internal/repository/model/reward_lang.gen.go | 31 + internal/repository/model/reward_push.gen.go | 32 + internal/repository/model/reward_push.go | 15 + .../repository/model/reward_push_log.gen.go | 28 + internal/repository/model/reward_push_log.go | 15 + .../repository/model/reward_push_task.gen.go | 20 + .../repository/model/reward_related.gen.go | 23 + .../repository/model/server_whitelist.gen.go | 18 + internal/repository/model/slow_log.gen.go | 23 + internal/repository/model/t_coin.gen.go | 23 + internal/repository/model/t_coin.go | 14 + internal/repository/model/t_coin_lang.gen.go | 25 + internal/repository/model/user.gen.go | 27 + .../repository/model/user_behavior.gen.go | 27 + .../model/user_project_relate.gen.go | 22 + internal/repository/mtype/map.go | 233 + internal/repository/mtype/mtype.go | 1102 + internal/repository/mtype/struct.go | 607 + .../repository/withdefault/with_default.go | 1693 + internal/server/depend/micro.go | 7 + internal/server/server.go | 126 + internal/server/wrapper.go | 102 + internal/service/cmm/cmm.go | 658 + internal/service/cmm/data_cache.go | 85 + internal/service/cmm/first_create.go | 302 + internal/service/containers/c_test.go | 433 + .../service/containers/campaign/ads_show.go | 196 + .../service/containers/campaign/ads_store.go | 347 + .../service/containers/campaign/ads_update.go | 353 + .../service/containers/campaign/barrage.go | 670 + .../service/containers/campaign/c_test.go | 67 + .../containers/campaign/channel_create.go | 245 + .../service/containers/campaign/child_show.go | 183 + .../containers/campaign/child_store.go | 226 + .../containers/campaign/child_update.go | 460 + internal/service/containers/campaign/langs.go | 1517 + internal/service/containers/campaign/list.go | 570 + .../containers/campaign/reward_detail.go | 1155 + .../service/containers/campaign/save_lang.go | 514 + internal/service/containers/campaign/show.go | 2480 + .../containers/campaign/show_reward.go | 223 + internal/service/containers/campaign/store.go | 3510 ++ .../service/containers/campaign/update.go | 6814 +++ .../containers/campaign/vs_settlement.go | 199 + .../containers/campaignstat/ads_reward.go | 184 + .../containers/campaignstat/ads_summary.go | 205 + .../containers/campaignstat/ads_table.go | 194 + .../service/containers/campaignstat/c_test.go | 57 + .../containers/campaignstat/campaign.go | 331 + .../containers/campaignstat/dem_title.go | 936 + .../containers/campaignstat/related.go | 261 + .../containers/campaignstat/report_info.go | 240 + .../service/containers/campaignstat/stat.go | 148 + .../containers/campaignstat/stat_event.go | 289 + .../containers/campaignstat/summary.go | 339 + .../containers/campaignstat/top_ten.go | 422 + .../containers/campaignstat/user_cycle.go | 203 + .../service/containers/campaignuser/answer.go | 123 + .../service/containers/campaignuser/c_test.go | 243 + .../service/containers/campaignuser/chat.go | 248 + .../containers/campaignuser/chat_list.go | 175 + .../service/containers/campaignuser/child.go | 642 + .../containers/campaignuser/child_active.go | 566 + .../containers/campaignuser/child_list.go | 247 + .../service/containers/campaignuser/dice.go | 647 + .../containers/campaignuser/dice_record.go | 330 + .../containers/campaignuser/dynamic_link.go | 259 + .../containers/campaignuser/exchange.go | 294 + .../service/containers/campaignuser/feed.go | 321 + .../service/containers/campaignuser/list.go | 1164 + .../containers/campaignuser/lottery.go | 271 + .../containers/campaignuser/lottery_log.go | 527 + .../containers/campaignuser/mall_list.go | 164 + .../containers/campaignuser/mix_reward.go | 222 + .../service/containers/campaignuser/play.go | 1428 + .../service/containers/campaignuser/reward.go | 368 + .../containers/campaignuser/reward_form.go | 151 + .../containers/campaignuser/reward_user.go | 149 + .../service/containers/campaignuser/task.go | 984 + .../containers/campaignuser/uno_rand_card.go | 113 + .../service/containers/campaignuser/visit.go | 441 + .../service/containers/campaignuser/vote.go | 114 + internal/service/containers/coin_save.go | 209 + .../containers/fission_create_temp_group.go | 190 + .../containers/fission_template_info.go | 346 + .../containers/fission_update_temp_group.go | 240 + .../containers/fission_web_asd_user.go | 156 + .../containers/fission_web_bind_web.go | 201 + .../containers/fission_web_web_reward.go | 285 + internal/service/containers/games/trace.go | 84 + internal/service/containers/games/visit.go | 287 + .../service/containers/library_qa_rand.go | 238 + internal/service/containers/mall/c_test.go | 25 + .../service/containers/mall/exchange_item.go | 292 + internal/service/containers/mall/item_list.go | 119 + .../service/containers/mall/item_status.go | 190 + .../service/containers/mall/item_store.go | 99 + .../service/containers/mall/item_update.go | 153 + internal/service/containers/mall/list.go | 273 + .../service/containers/mall/user_item_list.go | 103 + .../containers/openplatform/campaign_info.go | 125 + .../service/containers/openplatform/player.go | 143 + .../containers/openplatform/user_list.go | 368 + internal/service/containers/project_list.go | 176 + .../containers/project_save_ads_config.go | 151 + internal/service/containers/project_store.go | 161 + internal/service/containers/project_update.go | 164 + .../service/containers/projectuser/point.go | 81 + internal/service/containers/register_store.go | 121 + internal/service/containers/reward_list.go | 237 + internal/service/containers/user_login.go | 160 + internal/service/crons/action/action.go | 169 + internal/service/crons/action/action_test.go | 60 + internal/service/crons/action/campaign.go | 840 + .../action/containers/campaign_quiz_open.go | 380 + .../crons/action/containers/push_notify.go | 333 + internal/service/crons/action/mall.go | 192 + internal/service/crons/action/notify.go | 180 + internal/service/crons/action/stat.go | 502 + internal/service/crons/action/z_clear.go | 226 + internal/service/crons/crons.go | 71 + internal/service/notify/notify.go | 111 + internal/service/notify/notify_test.go | 29 + internal/service/notify/reward.go | 421 + .../provider/award/award_iss_verify.go | 250 + .../service/provider/award/award_reawrd.go | 370 + internal/service/provider/c_test.go | 13 + .../provider/cachecurd/coin_scene.hmap.go | 76 + internal/service/provider/cachecurd/hmap.go | 208 + .../service/provider/cachecurd/hmap_option.go | 66 + .../cachecurd/keep_reward_select.hmap.go | 58 + internal/service/provider/cachecurd/rank.go | 162 + .../service/provider/cachecurd/stock.hmap.go | 218 + .../service/provider/campaign_timezone.go | 133 + internal/service/provider/company_made.go | 164 + .../provider/fission_behavior_total.go | 501 + internal/service/provider/fission_clue.go | 160 + internal/service/provider/fission_config.go | 149 + internal/service/provider/fission_user.go | 891 + .../service/provider/fission_user_attr.go | 538 + .../service/provider/fissionaction/README.md | 1 + .../provider/fissionaction/action_list.go | 268 + .../service/provider/fissionaction/c_test.go | 25 + .../provider/fissionaction/dimension.go | 358 + .../provider/fissionaction/mark_point.go | 835 + .../service/provider/fissionaction/option.go | 362 + .../provider/fissionaction/z_action_list.json | 486 + .../provider/fissionaction/z_dimension.json | 288 + .../fissionaction/z_dimension_key.json | 200 + internal/service/provider/lang_title.go | 121 + internal/service/provider/malls/mall.go | 175 + internal/service/provider/malls/relate.go | 147 + .../provider/operatelog/operate_log.go | 181 + .../service/provider/operatelog/option.go | 9 + internal/service/provider/players/ballot.go | 292 + internal/service/provider/players/blind.go | 370 + internal/service/provider/players/cash.go | 742 + internal/service/provider/players/chop.go | 968 + internal/service/provider/players/coin.go | 624 + .../service/provider/players/coin_test.go | 55 + internal/service/provider/players/dice.go | 1469 + internal/service/provider/players/flip.go | 376 + internal/service/provider/players/gashapon.go | 419 + .../service/provider/players/gashapon_test.go | 121 + internal/service/provider/players/gold.go | 579 + .../service/provider/players/gold_test.go | 31 + internal/service/provider/players/grid.go | 370 + internal/service/provider/players/keep_dog.go | 1980 + .../service/provider/players/keep_dog_test.go | 66 + internal/service/provider/players/option.go | 20 + internal/service/provider/players/player.go | 670 + internal/service/provider/players/qa.go | 717 + internal/service/provider/players/qa_test.go | 28 + internal/service/provider/players/quiz.go | 347 + internal/service/provider/players/sign.go | 1678 + .../service/provider/players/sign_test.go | 57 + internal/service/provider/players/slot.go | 376 + internal/service/provider/players/uno.go | 1059 + internal/service/provider/players/vs.go | 1145 + internal/service/provider/players/vs_test.go | 32 + internal/service/provider/players/wheel.go | 421 + .../service/provider/projectuser/option.go | 36 + .../provider/projectuser/project_user.go | 359 + internal/service/provider/pusher/option.go | 1 + .../service/provider/pusher/push_group.go | 55 + internal/service/provider/pusher/pusher.go | 375 + .../service/provider/pusher/pusher_test.go | 55 + internal/service/provider/rewards.go | 621 + internal/service/provider/s2s/lv_api.go | 118 + internal/service/provider/s2s/option.go | 13 + .../service/provider/s2s/point_change_test.go | 29 + .../service/provider/s2s/points_change.go | 153 + internal/service/provider/s2s/reward.go | 312 + internal/service/provider/s2s/s2s.go | 169 + .../service/provider/s2s/user_coin_change.go | 122 + internal/service/provider/s2s/user_info.go | 109 + internal/service/provider/stocks/c_test.go | 16 + internal/service/provider/stocks/campaign.go | 41 + .../provider/stocks/campaign_reward.go | 36 + .../provider/stocks/campaign_reward_select.go | 36 + internal/service/provider/stocks/cleaner.go | 73 + .../service/provider/stocks/mall_reward.go | 36 + internal/service/provider/stocks/stocks.go | 161 + internal/service/provider/traces/fn_timer.go | 58 + internal/service/queue/consumer/action.go | 69 + .../queue/consumer/campaignnotice/behavior.go | 156 + .../consumer/campaignnotice/child_invite.go | 151 + .../consumer/campaignnotice/cond_stat.go | 72 + .../queue/consumer/campaignnotice/consume.go | 385 + .../queue/consumer/campaignnotice/dice_map.go | 192 + .../campaignnotice/export/ads_table.go | 178 + .../consumer/campaignnotice/export/base.go | 56 + .../consumer/campaignnotice/export/c_test.go | 53 + .../campaignnotice/export/campaign_report.go | 295 + .../campaignnotice/export/child_list.go | 272 + .../campaignnotice/export/coin_record.go | 210 + .../consumer/campaignnotice/export/export.go | 115 + .../export/fission_reward_record.go | 328 + .../campaignnotice/export/fission_user.go | 277 + .../export/fission_user_stat.go | 889 + .../campaignnotice/export/new_user_list.go | 1140 + .../consumer/campaignnotice/game_action.go | 345 + .../consumer/campaignnotice/logic_test.go | 304 + .../queue/consumer/campaignnotice/notice.go | 1606 + .../consumer/campaignnotice/other_stat.go | 103 + .../consumer/campaignnotice/project_user.go | 26 + .../project_user_coin_deduct.go | 158 + .../queue/consumer/campaignnotice/pub_test.go | 118 + .../campaignnotice/reward_limit_up.go | 423 + .../consumer/campaignnotice/reward_notify.go | 304 + .../campaignnotice/settlement_reward.go | 47 + .../consumer/campaignnotice/target_stat.go | 189 + .../campaignnotice/validevents/ballot.go | 5 + .../campaignnotice/validevents/base.go | 592 + .../campaignnotice/validevents/blind.go | 79 + .../campaignnotice/validevents/cash.go | 91 + .../campaignnotice/validevents/chop.go | 58 + .../campaignnotice/validevents/coin.go | 28 + .../campaignnotice/validevents/dice.go | 87 + .../campaignnotice/validevents/event.go | 1507 + .../campaignnotice/validevents/flip.go | 79 + .../campaignnotice/validevents/gashapon.go | 79 + .../campaignnotice/validevents/gold.go | 79 + .../campaignnotice/validevents/grid.go | 79 + .../campaignnotice/validevents/grow.go | 231 + .../campaignnotice/validevents/keep.go | 79 + .../campaignnotice/validevents/prize_wheel.go | 79 + .../consumer/campaignnotice/validevents/qa.go | 79 + .../campaignnotice/validevents/quiz.go | 79 + .../campaignnotice/validevents/referral.go | 491 + .../campaignnotice/validevents/sign.go | 55 + .../campaignnotice/validevents/slot.go | 79 + .../campaignnotice/validevents/uno.go | 80 + .../validevents/valid_events.go | 456 + .../consumer/campaignnotice/validevents/vs.go | 79 + .../campaignnotice/validevents/win.go | 604 + .../consumer/campaignnotice/vs_settlement.go | 115 + internal/service/queue/consumer/consumer.go | 114 + .../service/queue/consumer/group_handler.go | 60 + .../queue/consumer/statcampaign/logic.go | 467 + .../queue/consumer/statcampaign/logic_test.go | 511 + .../consumer/statcampaign/stat_campaign.go | 171 + internal/service/queue/consumer/task.go | 18 + internal/service/queue/delay/action.go | 72 + internal/service/queue/delay/delay.go | 148 + .../service/queue/delay/global_reward_push.go | 63 + internal/service/queue/delay/reward_push.go | 72 + .../service/queue/producer/campaign_notice.go | 82 + .../service/queue/producer/delay_common.go | 62 + .../queue/producer/fissionbi_receiver.go | 22 + .../queue/producer/joybuywork_notify.go | 30 + .../service/queue/producer/oplatform_other.go | 36 + internal/service/queue/producer/option.go | 14 + internal/service/queue/producer/producer.go | 116 + internal/service/queue/producer/pub_test.go | 249 + .../service/queue/producer/stat_campaign.go | 22 + .../service/queue/types/campaign_notice.go | 204 + internal/service/queue/types/consts.go | 28 + internal/service/queue/types/delay_comon.go | 28 + .../service/queue/types/fissionbi_receiver.go | 41 + .../service/queue/types/joybuywork_notify.go | 35 + .../service/queue/types/oplatform_other.go | 71 + internal/service/queue/types/stat_campaign.go | 64 + internal/service/script/boot.go | 464 + internal/service/script/forever.go | 1268 + internal/service/script/script_test.go | 222 + internal/service/script/test_api.go | 145 + internal/service/service.go | 107 + internal/service/w_campaign.go | 2010 + internal/service/w_campaign_stat.go | 571 + internal/service/w_campaign_user.go | 5394 ++ internal/service/w_coin.go | 75 + internal/service/w_common.go | 256 + internal/service/w_fission.go | 448 + internal/service/w_fission_web.go | 299 + internal/service/w_games.go | 390 + internal/service/w_library.go | 645 + internal/service/w_mall.go | 282 + internal/service/w_open_platform.go | 53 + internal/service/w_project.go | 507 + internal/service/w_project_user.go | 63 + internal/service/w_register.go | 35 + internal/service/w_reward.go | 1380 + internal/service/w_script.go | 611 + internal/service/w_user.go | 358 + internal/utils/arr/arr.go | 28 + internal/utils/blink/ads_jump.go | 56 + internal/utils/blink/ads_link.go | 65 + internal/utils/blink/campaign_link.go | 142 + internal/utils/blink/game_link.go | 54 + internal/utils/blink/link.go | 56 + internal/utils/blink/option.go | 105 + internal/utils/decimal/decimal.go | 39 + internal/utils/decimal/helper.go | 108 + internal/utils/decimal/helper_test.go | 25 + internal/utils/decimal/types.go | 8 + internal/utils/ept/ept.go | 45 + internal/utils/helper.go | 112 + internal/utils/lockdo/lock_do.go | 140 + internal/utils/logic/context.go | 139 + internal/utils/logic/logic.go | 258 + internal/utils/logic/option.go | 78 + internal/utils/logic/run.go | 32 + internal/utils/merr/business_error.go | 77 + internal/utils/randext/rand_ext_test.go | 14 + internal/utils/randext/rand_str.go | 37 + internal/utils/timez/str_parse.go | 39 + internal/utils/timez/timez.go | 114 + internal/utils/timez/timez_test.go | 50 + internal/utils/upload/oss_test.go | 194 + internal/utils/upload/policy_token.go | 67 + internal/utils/upload/policy_token_test.go | 26 + internal/utils/upload/upload.go | 39 + internal/utils/utils.go | 376 + internal/utils/utils_test.go | 78 + internal/utils/verify/integer.go | 77 + internal/utils/verify/slices.go | 19 + internal/utils/verify/string.go | 10 + microg.toml | 319 + proto/go_proto/go.mod | 28 + proto/go_proto/w_campaign/w_campaign.pb.go | 47812 ++++++++++++++++ .../w_campaign/w_campaign.pb.micro.go | 906 + .../w_campaign_stat/w_campaign_stat.pb.go | 6792 +++ .../w_campaign_stat.pb.micro.go | 412 + .../w_campaign_user/w_campaign_user.pb.go | 32547 +++++++++++ .../w_campaign_user.pb.micro.go | 1875 + proto/go_proto/w_coin/w_coin.pb.go | 614 + proto/go_proto/w_coin/w_coin.pb.micro.go | 108 + proto/go_proto/w_common/w_common.pb.go | 2521 + proto/go_proto/w_common/w_common.pb.micro.go | 222 + proto/go_proto/w_fission/w_fission.pb.go | 2871 + .../go_proto/w_fission/w_fission.pb.micro.go | 260 + .../w_fission_web/w_fission_web.pb.go | 1339 + .../w_fission_web/w_fission_web.pb.micro.go | 184 + proto/go_proto/w_games/w_games.pb.go | 1995 + proto/go_proto/w_games/w_games.pb.micro.go | 241 + proto/go_proto/w_library/w_library.pb.go | 2861 + .../go_proto/w_library/w_library.pb.micro.go | 279 + proto/go_proto/w_mall/w_mall.pb.go | 3273 ++ proto/go_proto/w_mall/w_mall.pb.micro.go | 317 + .../w_open_platform/w_open_platform.pb.go | 1209 + .../w_open_platform.pb.micro.go | 127 + proto/go_proto/w_project/w_project.pb.go | 3308 ++ .../go_proto/w_project/w_project.pb.micro.go | 393 + .../w_project_user/w_project_user.pb.go | 555 + .../w_project_user/w_project_user.pb.micro.go | 108 + proto/go_proto/w_register/w_register.pb.go | 259 + .../w_register/w_register.pb.micro.go | 89 + proto/go_proto/w_reward/w_reward.pb.go | 6543 +++ proto/go_proto/w_reward/w_reward.pb.micro.go | 469 + proto/go_proto/w_script/w_script.pb.go | 2380 + proto/go_proto/w_script/w_script.pb.micro.go | 279 + proto/go_proto/w_user/w_user.pb.go | 1523 + proto/go_proto/w_user/w_user.pb.micro.go | 203 + proto/go_proto/workerr/1_user.go | 13 + proto/go_proto/workerr/2_project.go | 11 + proto/go_proto/workerr/3_campaign.go | 30 + proto/go_proto/workerr/4_reward.go | 11 + proto/go_proto/workerr/work_err.go | 67 + proto/proto/w_campaign.proto | 3573 ++ proto/proto/w_campaign_stat.proto | 526 + proto/proto/w_campaign_user.proto | 2504 + proto/proto/w_coin.proto | 51 + proto/proto/w_common.proto | 194 + proto/proto/w_fission.proto | 215 + proto/proto/w_fission_web.proto | 111 + proto/proto/w_games.proto | 159 + proto/proto/w_library.proto | 225 + proto/proto/w_mall.proto | 265 + proto/proto/w_open_platform.proto | 96 + proto/proto/w_project.proto | 264 + proto/proto/w_project_user.proto | 47 + proto/proto/w_register.proto | 25 + proto/proto/w_reward.proto | 498 + proto/proto/w_script.proto | 190 + proto/proto/w_user.proto | 125 + proto/toml/w_campaign.toml | 4499 ++ proto/toml/w_campaign_stat.toml | 628 + proto/toml/w_campaign_user.toml | 3117 + proto/toml/w_coin.toml | 54 + proto/toml/w_common.toml | 237 + proto/toml/w_fission.toml | 259 + proto/toml/w_fission_web.toml | 131 + proto/toml/w_games.toml | 184 + proto/toml/w_library.toml | 268 + proto/toml/w_mall.toml | 312 + proto/toml/w_open_platform.toml | 111 + proto/toml/w_project.toml | 265 + proto/toml/w_project_user.toml | 50 + proto/toml/w_register.toml | 20 + proto/toml/w_reward.toml | 625 + proto/toml/w_script.toml | 220 + proto/toml/w_user.toml | 110 + test/do_test.go | 425 + test/finder_test.go | 105 + test/rpc_test.go | 100 + test/test.go | 101 + tools/bqueue/main.go | 242 + 1092 files changed, 361124 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerfile_fastest create mode 100644 Makefile create mode 100644 README.md create mode 100644 asset/ads/ads_dev.json create mode 100644 asset/ads/ads_prod.json create mode 100644 asset/campaign/fission_lang.json create mode 100644 asset/campaign/lang/ar.json create mode 100644 asset/campaign/lang/cs.json create mode 100644 asset/campaign/lang/de.json create mode 100644 asset/campaign/lang/en.json create mode 100644 asset/campaign/lang/es.json create mode 100644 asset/campaign/lang/fr.json create mode 100644 asset/campaign/lang/hu.json create mode 100644 asset/campaign/lang/id.json create mode 100644 asset/campaign/lang/it.json create mode 100644 asset/campaign/lang/ja.json create mode 100644 asset/campaign/lang/ko.json create mode 100644 asset/campaign/lang/lang_test.go create mode 100644 asset/campaign/lang/nl.json create mode 100644 asset/campaign/lang/pt.json create mode 100644 asset/campaign/lang/ru.json create mode 100644 asset/campaign/lang/th.json create mode 100644 asset/campaign/lang/tr.json create mode 100644 asset/campaign/lang/vi.json create mode 100644 asset/campaign/lang/zh-TW.json create mode 100644 asset/campaign/lang/zh.json create mode 100644 asset/campaign/mark.yaml create mode 100644 asset/taskcenter/ar.json create mode 100644 asset/taskcenter/cs.json create mode 100644 asset/taskcenter/de.json create mode 100644 asset/taskcenter/en.json create mode 100644 asset/taskcenter/es.json create mode 100644 asset/taskcenter/fr.json create mode 100644 asset/taskcenter/hu.json create mode 100644 asset/taskcenter/id.json create mode 100644 asset/taskcenter/it.json create mode 100644 asset/taskcenter/ja.json create mode 100644 asset/taskcenter/ko.json create mode 100644 asset/taskcenter/lang_test.go create mode 100644 asset/taskcenter/nl.json create mode 100644 asset/taskcenter/pt.json create mode 100644 asset/taskcenter/ru.json create mode 100644 asset/taskcenter/th.json create mode 100644 asset/taskcenter/tr.json create mode 100644 asset/taskcenter/vi.json create mode 100644 asset/taskcenter/zh-TW.json create mode 100644 asset/taskcenter/zh.json create mode 100644 cmd/joybuywork/joybuywork.go create mode 100644 etc/config-dev.yaml create mode 100644 etc/config-prod.yaml create mode 100644 etc/config-test.yaml create mode 100755 etc/etc.yaml create mode 100644 go.mod create mode 100644 internal/app/ads.go create mode 100644 internal/app/database_gen.go create mode 100644 internal/app/etcd.go create mode 100644 internal/app/feishu_gen.go create mode 100644 internal/app/kafka_gen.go create mode 100644 internal/app/lang_data.go create mode 100644 internal/app/listener.go create mode 100644 internal/app/logger_gen.go create mode 100644 internal/app/micro.go create mode 100644 internal/app/pprof_collector.go create mode 100644 internal/app/redis_expend.go create mode 100644 internal/app/redis_gen.go create mode 100644 internal/app/snowflake.go create mode 100644 internal/app/thread.go create mode 100644 internal/boot/boot.go create mode 100644 internal/boot/listen.go create mode 100644 internal/config/config.go create mode 100644 internal/consts/ckey/ckey.go create mode 100644 internal/consts/ckey/company.go create mode 100644 internal/consts/ckey/cron.go create mode 100644 internal/consts/ckey/data_cache.go create mode 100644 internal/consts/ckey/delay.go create mode 100644 internal/consts/ckey/fission.go create mode 100644 internal/consts/ckey/game.go create mode 100644 internal/consts/ckey/mall.go create mode 100644 internal/consts/ckey/project.go create mode 100644 internal/consts/ckey/project_user.go create mode 100644 internal/consts/ckey/task.go create mode 100644 internal/consts/ckey/user.go create mode 100644 internal/consts/consts.go create mode 100644 internal/consts/currency.go create mode 100644 internal/consts/fission.go create mode 100644 internal/consts/games.go create mode 100644 internal/consts/share.go create mode 100644 internal/consts/struct.go create mode 100644 internal/consts/type.go create mode 100644 internal/consts/vars.go create mode 100644 internal/handler/w_campaign.go create mode 100644 internal/handler/w_campaign_stat.go create mode 100644 internal/handler/w_campaign_user.go create mode 100644 internal/handler/w_coin.go create mode 100644 internal/handler/w_common.go create mode 100644 internal/handler/w_fission.go create mode 100644 internal/handler/w_fission_web.go create mode 100644 internal/handler/w_games.go create mode 100644 internal/handler/w_library.go create mode 100644 internal/handler/w_mall.go create mode 100644 internal/handler/w_open_platform.go create mode 100644 internal/handler/w_project.go create mode 100644 internal/handler/w_project_user.go create mode 100644 internal/handler/w_register.go create mode 100644 internal/handler/w_reward.go create mode 100644 internal/handler/w_script.go create mode 100644 internal/handler/w_user.go create mode 100644 internal/plugins/certs/certs.go create mode 100644 internal/plugins/certs/tools.go create mode 100644 internal/plugins/certs/user.go create mode 100644 internal/plugins/certs/user_test.go create mode 100644 internal/plugins/encrypt/encrypt.go create mode 100644 internal/plugins/encrypt/encrypt_test.go create mode 100644 internal/plugins/export/csv/csv.go create mode 100644 internal/plugins/export/csv/csv_test.go create mode 100644 internal/plugins/export/csv/task.go create mode 100644 internal/plugins/export/csv/tmp/export/.gitignore create mode 100644 internal/plugins/export/export.go create mode 100644 internal/plugins/export/format.go create mode 100644 internal/plugins/export/option.go create mode 100644 internal/plugins/export/redis_part.go create mode 100644 internal/plugins/export/task.go create mode 100644 internal/plugins/export/xlsx/option.go create mode 100644 internal/plugins/export/xlsx/task.go create mode 100644 internal/plugins/export/xlsx/tmp/export/.gitignore create mode 100644 internal/plugins/export/xlsx/xlsx.go create mode 100644 internal/plugins/export/xlsx/xlsx_test.go create mode 100644 internal/plugins/hashid/dbid.go create mode 100644 internal/plugins/hashid/hash_id.go create mode 100644 internal/plugins/hashid/hash_id_test.go create mode 100644 internal/plugins/jsonm/jsonm.go create mode 100644 internal/plugins/jsonm/jsonm_test.go create mode 100644 internal/plugins/lucky/logger.go create mode 100644 internal/plugins/lucky/lucky.go create mode 100644 internal/plugins/printer/option.go create mode 100644 internal/plugins/printer/printer.go create mode 100644 internal/plugins/printer/slow_log.go create mode 100644 internal/repository/cache/cache.go create mode 100644 internal/repository/cache/cache_test.go create mode 100644 internal/repository/cache/campaign.go create mode 100644 internal/repository/cache/campaign_ballot.go create mode 100644 internal/repository/cache/campaign_blind.go create mode 100644 internal/repository/cache/campaign_cash.go create mode 100644 internal/repository/cache/campaign_channel.go create mode 100644 internal/repository/cache/campaign_chat.go create mode 100644 internal/repository/cache/campaign_child.go create mode 100644 internal/repository/cache/campaign_chop.go create mode 100644 internal/repository/cache/campaign_coin.go create mode 100644 internal/repository/cache/campaign_cond.go create mode 100644 internal/repository/cache/campaign_config.go create mode 100644 internal/repository/cache/campaign_dice.go create mode 100644 internal/repository/cache/campaign_evnet.go create mode 100644 internal/repository/cache/campaign_flip.go create mode 100644 internal/repository/cache/campaign_gashapon.go create mode 100644 internal/repository/cache/campaign_gold.go create mode 100644 internal/repository/cache/campaign_grid.go create mode 100644 internal/repository/cache/campaign_keep.go create mode 100644 internal/repository/cache/campaign_lang.go create mode 100644 internal/repository/cache/campaign_points_use.go create mode 100644 internal/repository/cache/campaign_qa.go create mode 100644 internal/repository/cache/campaign_quiz.go create mode 100644 internal/repository/cache/campaign_referral.go create mode 100644 internal/repository/cache/campaign_reward_rule.go create mode 100644 internal/repository/cache/campaign_sign.go create mode 100644 internal/repository/cache/campaign_slot.go create mode 100644 internal/repository/cache/campaign_style.go create mode 100644 internal/repository/cache/campaign_ticket.go create mode 100644 internal/repository/cache/campaign_uno.go create mode 100644 internal/repository/cache/campaign_vs.go create mode 100644 internal/repository/cache/campaign_wheel.go create mode 100644 internal/repository/cache/campaign_win.go create mode 100644 internal/repository/cache/company_made.go create mode 100644 internal/repository/cache/fission_chat.go create mode 100644 internal/repository/cache/fission_child_user.go create mode 100644 internal/repository/cache/fission_config.go create mode 100644 internal/repository/cache/fission_custom_btn.go create mode 100644 internal/repository/cache/fission_temp.go create mode 100644 internal/repository/cache/fission_temp_group.go create mode 100644 internal/repository/cache/fission_total.go create mode 100644 internal/repository/cache/fission_user.go create mode 100644 internal/repository/cache/fission_user_attr.go create mode 100644 internal/repository/cache/fission_user_attr_total.go create mode 100644 internal/repository/cache/fission_user_jattr.go create mode 100644 internal/repository/cache/fission_user_level.go create mode 100644 internal/repository/cache/fission_web_user.go create mode 100644 internal/repository/cache/form.go create mode 100644 internal/repository/cache/game_total.go create mode 100644 internal/repository/cache/game_total_date.go create mode 100644 internal/repository/cache/library_qa_group.go create mode 100644 internal/repository/cache/notify_url.go create mode 100644 internal/repository/cache/option.go create mode 100644 internal/repository/cache/project.go create mode 100644 internal/repository/cache/project_ad.go create mode 100644 internal/repository/cache/project_user.go create mode 100644 internal/repository/cache/redeem_mall.go create mode 100644 internal/repository/cache/redeem_mall_item.go create mode 100644 internal/repository/cache/redistable/option.go create mode 100644 internal/repository/cache/redistable/redis_table.go create mode 100644 internal/repository/cache/redistable/tables/fission_user_notify.go create mode 100644 internal/repository/cache/reward.go create mode 100644 internal/repository/cache/t_coin.go create mode 100644 internal/repository/cache/user.go create mode 100644 internal/repository/dao/company.gen.go create mode 100644 internal/repository/dao/company_made.gen.go create mode 100644 internal/repository/dao/cron_log.gen.go create mode 100644 internal/repository/dao/err_log.gen.go create mode 100644 internal/repository/dao/export_task.gen.go create mode 100644 internal/repository/dao/fission_action.gen.go create mode 100644 internal/repository/dao/fission_archive_task.gen.go create mode 100644 internal/repository/dao/fission_ballot.gen.go create mode 100644 internal/repository/dao/fission_ballot_log.gen.go create mode 100644 internal/repository/dao/fission_behavior.gen.go create mode 100644 internal/repository/dao/fission_blind.gen.go create mode 100644 internal/repository/dao/fission_blind_log.gen.go create mode 100644 internal/repository/dao/fission_campaign.gen.go create mode 100644 internal/repository/dao/fission_campaign_ballot.gen.go create mode 100644 internal/repository/dao/fission_campaign_blind.gen.go create mode 100644 internal/repository/dao/fission_campaign_cash.gen.go create mode 100644 internal/repository/dao/fission_campaign_channel.gen.go create mode 100644 internal/repository/dao/fission_campaign_chat.gen.go create mode 100644 internal/repository/dao/fission_campaign_child.gen.go create mode 100644 internal/repository/dao/fission_campaign_chop.gen.go create mode 100644 internal/repository/dao/fission_campaign_coin.gen.go create mode 100644 internal/repository/dao/fission_campaign_cond.gen.go create mode 100644 internal/repository/dao/fission_campaign_config.gen.go create mode 100644 internal/repository/dao/fission_campaign_dice.gen.go create mode 100644 internal/repository/dao/fission_campaign_event.gen.go create mode 100644 internal/repository/dao/fission_campaign_flip.gen.go create mode 100644 internal/repository/dao/fission_campaign_gashapon.gen.go create mode 100644 internal/repository/dao/fission_campaign_gold.gen.go create mode 100644 internal/repository/dao/fission_campaign_grid.gen.go create mode 100644 internal/repository/dao/fission_campaign_grow.gen.go create mode 100644 internal/repository/dao/fission_campaign_grow_step.gen.go create mode 100644 internal/repository/dao/fission_campaign_keep.gen.go create mode 100644 internal/repository/dao/fission_campaign_keep_step.gen.go create mode 100644 internal/repository/dao/fission_campaign_lang.gen.go create mode 100644 internal/repository/dao/fission_campaign_long_img.gen.go create mode 100644 internal/repository/dao/fission_campaign_long_img_zone.gen.go create mode 100644 internal/repository/dao/fission_campaign_points_use.gen.go create mode 100644 internal/repository/dao/fission_campaign_push.gen.go create mode 100644 internal/repository/dao/fission_campaign_qa.gen.go create mode 100644 internal/repository/dao/fission_campaign_qa_option.gen.go create mode 100644 internal/repository/dao/fission_campaign_qa_question.gen.go create mode 100644 internal/repository/dao/fission_campaign_quiz.gen.go create mode 100644 internal/repository/dao/fission_campaign_quiz_option.gen.go create mode 100644 internal/repository/dao/fission_campaign_referral.gen.go create mode 100644 internal/repository/dao/fission_campaign_reward.gen.go create mode 100644 internal/repository/dao/fission_campaign_reward_add.gen.go create mode 100644 internal/repository/dao/fission_campaign_reward_add_log.gen.go create mode 100644 internal/repository/dao/fission_campaign_reward_rule.gen.go create mode 100644 internal/repository/dao/fission_campaign_sign.gen.go create mode 100644 internal/repository/dao/fission_campaign_slot.gen.go create mode 100644 internal/repository/dao/fission_campaign_style.gen.go create mode 100644 internal/repository/dao/fission_campaign_task.gen.go create mode 100644 internal/repository/dao/fission_campaign_ticket.gen.go create mode 100644 internal/repository/dao/fission_campaign_uno.gen.go create mode 100644 internal/repository/dao/fission_campaign_uno_card.gen.go create mode 100644 internal/repository/dao/fission_campaign_uno_group.gen.go create mode 100644 internal/repository/dao/fission_campaign_vs.gen.go create mode 100644 internal/repository/dao/fission_campaign_vs_schedule.gen.go create mode 100644 internal/repository/dao/fission_campaign_vs_team.gen.go create mode 100644 internal/repository/dao/fission_campaign_wheel.gen.go create mode 100644 internal/repository/dao/fission_campaign_win.gen.go create mode 100644 internal/repository/dao/fission_cash.gen.go create mode 100644 internal/repository/dao/fission_cash_record.gen.go create mode 100644 internal/repository/dao/fission_chat.gen.go create mode 100644 internal/repository/dao/fission_chat_msg.gen.go create mode 100644 internal/repository/dao/fission_child_user.gen.go create mode 100644 internal/repository/dao/fission_child_user_record.gen.go create mode 100644 internal/repository/dao/fission_chop.gen.go create mode 100644 internal/repository/dao/fission_chop_help.gen.go create mode 100644 internal/repository/dao/fission_chop_reward.gen.go create mode 100644 internal/repository/dao/fission_client_reward.gen.go create mode 100644 internal/repository/dao/fission_coin.gen.go create mode 100644 internal/repository/dao/fission_coin_log.gen.go create mode 100644 internal/repository/dao/fission_coin_scene.gen.go create mode 100644 internal/repository/dao/fission_config.gen.go create mode 100644 internal/repository/dao/fission_custom_btn.gen.go create mode 100644 internal/repository/dao/fission_dice.gen.go create mode 100644 internal/repository/dao/fission_dice_collect.gen.go create mode 100644 internal/repository/dao/fission_dice_map.gen.go create mode 100644 internal/repository/dao/fission_dice_map_group.gen.go create mode 100644 internal/repository/dao/fission_dice_props.gen.go create mode 100644 internal/repository/dao/fission_dice_record.gen.go create mode 100644 internal/repository/dao/fission_dice_run.gen.go create mode 100644 internal/repository/dao/fission_flip.gen.go create mode 100644 internal/repository/dao/fission_flip_log.gen.go create mode 100644 internal/repository/dao/fission_gashapon.gen.go create mode 100644 internal/repository/dao/fission_gashapon_log.gen.go create mode 100644 internal/repository/dao/fission_gold.gen.go create mode 100644 internal/repository/dao/fission_gold_log.gen.go create mode 100644 internal/repository/dao/fission_grid.gen.go create mode 100644 internal/repository/dao/fission_grid_log.gen.go create mode 100644 internal/repository/dao/fission_grow.gen.go create mode 100644 internal/repository/dao/fission_grow_life.gen.go create mode 100644 internal/repository/dao/fission_grow_record.gen.go create mode 100644 internal/repository/dao/fission_keep.gen.go create mode 100644 internal/repository/dao/fission_keep_log.gen.go create mode 100644 internal/repository/dao/fission_lang_module.gen.go create mode 100644 internal/repository/dao/fission_notify.gen.go create mode 100644 internal/repository/dao/fission_notify_resp.gen.go create mode 100644 internal/repository/dao/fission_notify_task.gen.go create mode 100644 internal/repository/dao/fission_point_deduct.gen.go create mode 100644 internal/repository/dao/fission_points_log.gen.go create mode 100644 internal/repository/dao/fission_prize_wheel.gen.go create mode 100644 internal/repository/dao/fission_prize_wheel_log.gen.go create mode 100644 internal/repository/dao/fission_qa.gen.go create mode 100644 internal/repository/dao/fission_qa_log.gen.go create mode 100644 internal/repository/dao/fission_quiz.gen.go create mode 100644 internal/repository/dao/fission_quiz_log.gen.go create mode 100644 internal/repository/dao/fission_referral.gen.go create mode 100644 internal/repository/dao/fission_reward_record.gen.go create mode 100644 internal/repository/dao/fission_reward_record_form.gen.go create mode 100644 internal/repository/dao/fission_sign.gen.go create mode 100644 internal/repository/dao/fission_sign_day.gen.go create mode 100644 internal/repository/dao/fission_sign_log.gen.go create mode 100644 internal/repository/dao/fission_slot.gen.go create mode 100644 internal/repository/dao/fission_slot_log.gen.go create mode 100644 internal/repository/dao/fission_target_record.gen.go create mode 100644 internal/repository/dao/fission_temp.gen.go create mode 100644 internal/repository/dao/fission_temp_group.gen.go create mode 100644 internal/repository/dao/fission_temp_group_lang.gen.go create mode 100644 internal/repository/dao/fission_temp_image.gen.go create mode 100644 internal/repository/dao/fission_temp_lang.gen.go create mode 100644 internal/repository/dao/fission_total.gen.go create mode 100644 internal/repository/dao/fission_total_cycle.gen.go create mode 100644 internal/repository/dao/fission_unlock_reward.gen.go create mode 100644 internal/repository/dao/fission_uno.gen.go create mode 100644 internal/repository/dao/fission_uno_collect.gen.go create mode 100644 internal/repository/dao/fission_uno_log.gen.go create mode 100644 internal/repository/dao/fission_user.gen.go create mode 100644 internal/repository/dao/fission_user_active.gen.go create mode 100644 internal/repository/dao/fission_user_attr.gen.go create mode 100644 internal/repository/dao/fission_user_attr_total.gen.go create mode 100644 internal/repository/dao/fission_user_cond.gen.go create mode 100644 internal/repository/dao/fission_user_cond_record.gen.go create mode 100644 internal/repository/dao/fission_user_ctlink.gen.go create mode 100644 internal/repository/dao/fission_user_dylink.gen.go create mode 100644 internal/repository/dao/fission_user_event.gen.go create mode 100644 internal/repository/dao/fission_user_jattr.gen.go create mode 100644 internal/repository/dao/fission_user_level.gen.go create mode 100644 internal/repository/dao/fission_user_level_related.gen.go create mode 100644 internal/repository/dao/fission_user_pre_cond.gen.go create mode 100644 internal/repository/dao/fission_user_stat.gen.go create mode 100644 internal/repository/dao/fission_user_task_record.gen.go create mode 100644 internal/repository/dao/fission_user_task_reward.gen.go create mode 100644 internal/repository/dao/fission_user_task_valid.gen.go create mode 100644 internal/repository/dao/fission_vs.gen.go create mode 100644 internal/repository/dao/fission_vs_log.gen.go create mode 100644 internal/repository/dao/fission_vs_vote.gen.go create mode 100644 internal/repository/dao/fission_vs_vote_settlement.gen.go create mode 100644 internal/repository/dao/fission_web_user.gen.go create mode 100644 internal/repository/dao/fission_win.gen.go create mode 100644 internal/repository/dao/form.gen.go create mode 100644 internal/repository/dao/game_action.gen.go create mode 100644 internal/repository/dao/game_link.gen.go create mode 100644 internal/repository/dao/game_total.gen.go create mode 100644 internal/repository/dao/game_total_date.gen.go create mode 100644 internal/repository/dao/game_user.gen.go create mode 100644 internal/repository/dao/gen.go create mode 100644 internal/repository/dao/lang.gen.go create mode 100644 internal/repository/dao/lang_text_mark.gen.go create mode 100644 internal/repository/dao/library_qa.gen.go create mode 100644 internal/repository/dao/library_qa_group.gen.go create mode 100644 internal/repository/dao/library_qa_option.gen.go create mode 100644 internal/repository/dao/lv_api_log.gen.go create mode 100644 internal/repository/dao/material.gen.go create mode 100644 internal/repository/dao/module_statistics_eventflow.gen.go create mode 100644 internal/repository/dao/notify_url.gen.go create mode 100644 internal/repository/dao/operate_log.gen.go create mode 100644 internal/repository/dao/project.gen.go create mode 100644 internal/repository/dao/project_ad.gen.go create mode 100644 internal/repository/dao/project_secret.gen.go create mode 100644 internal/repository/dao/project_user.gen.go create mode 100644 internal/repository/dao/project_user_coin.gen.go create mode 100644 internal/repository/dao/project_user_coin_deduct.gen.go create mode 100644 internal/repository/dao/project_user_coin_expired.gen.go create mode 100644 internal/repository/dao/project_user_coin_log.gen.go create mode 100644 internal/repository/dao/project_user_coin_record.gen.go create mode 100644 internal/repository/dao/project_user_coin_use.gen.go create mode 100644 internal/repository/dao/project_user_info_log.gen.go create mode 100644 internal/repository/dao/redeem_mall.gen.go create mode 100644 internal/repository/dao/redeem_mall_item.gen.go create mode 100644 internal/repository/dao/redeem_mall_item_task.gen.go create mode 100644 internal/repository/dao/redeem_mall_record.gen.go create mode 100644 internal/repository/dao/redeem_mall_relate.gen.go create mode 100644 internal/repository/dao/register.gen.go create mode 100644 internal/repository/dao/register_audit.gen.go create mode 100644 internal/repository/dao/reward.gen.go create mode 100644 internal/repository/dao/reward_lang.gen.go create mode 100644 internal/repository/dao/reward_push.gen.go create mode 100644 internal/repository/dao/reward_push_log.gen.go create mode 100644 internal/repository/dao/reward_push_task.gen.go create mode 100644 internal/repository/dao/reward_related.gen.go create mode 100644 internal/repository/dao/server_whitelist.gen.go create mode 100644 internal/repository/dao/slow_log.gen.go create mode 100644 internal/repository/dao/sub_table.go create mode 100644 internal/repository/dao/t_coin.gen.go create mode 100644 internal/repository/dao/t_coin_lang.gen.go create mode 100644 internal/repository/dao/user.gen.go create mode 100644 internal/repository/dao/user_behavior.gen.go create mode 100644 internal/repository/dao/user_project_relate.gen.go create mode 100644 internal/repository/dbcheck/db_check.go create mode 100644 internal/repository/dbcheck/db_check_test.go create mode 100644 internal/repository/finder/finder.go create mode 100644 internal/repository/finder/fuser_layer.go create mode 100644 internal/repository/model/company.gen.go create mode 100644 internal/repository/model/company_made.gen.go create mode 100644 internal/repository/model/company_made.go create mode 100644 internal/repository/model/cron_log.gen.go create mode 100644 internal/repository/model/err_log.gen.go create mode 100644 internal/repository/model/export_task.gen.go create mode 100644 internal/repository/model/fission_action.gen.go create mode 100644 internal/repository/model/fission_action.go create mode 100644 internal/repository/model/fission_archive_task.gen.go create mode 100644 internal/repository/model/fission_ballot.gen.go create mode 100644 internal/repository/model/fission_ballot_log.gen.go create mode 100644 internal/repository/model/fission_behavior.gen.go create mode 100644 internal/repository/model/fission_blind.gen.go create mode 100644 internal/repository/model/fission_blind_log.gen.go create mode 100644 internal/repository/model/fission_blind_log.go create mode 100644 internal/repository/model/fission_blind_lucky.gen.go create mode 100644 internal/repository/model/fission_campaign.gen.go create mode 100644 internal/repository/model/fission_campaign.go create mode 100644 internal/repository/model/fission_campaign_ballot.gen.go create mode 100644 internal/repository/model/fission_campaign_blind.gen.go create mode 100644 internal/repository/model/fission_campaign_blind_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_cash.gen.go create mode 100644 internal/repository/model/fission_campaign_channel.gen.go create mode 100644 internal/repository/model/fission_campaign_chat.gen.go create mode 100644 internal/repository/model/fission_campaign_child.gen.go create mode 100644 internal/repository/model/fission_campaign_chop.gen.go create mode 100644 internal/repository/model/fission_campaign_coin.gen.go create mode 100644 internal/repository/model/fission_campaign_coin.go create mode 100644 internal/repository/model/fission_campaign_cond.gen.go create mode 100644 internal/repository/model/fission_campaign_config.gen.go create mode 100644 internal/repository/model/fission_campaign_config.go create mode 100644 internal/repository/model/fission_campaign_dice.gen.go create mode 100644 internal/repository/model/fission_campaign_dice.go create mode 100644 internal/repository/model/fission_campaign_event.gen.go create mode 100644 internal/repository/model/fission_campaign_event.go create mode 100644 internal/repository/model/fission_campaign_flip.gen.go create mode 100644 internal/repository/model/fission_campaign_gashapon.gen.go create mode 100644 internal/repository/model/fission_campaign_gold.gen.go create mode 100644 internal/repository/model/fission_campaign_grid.gen.go create mode 100644 internal/repository/model/fission_campaign_grid_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_grow.gen.go create mode 100644 internal/repository/model/fission_campaign_grow_step.gen.go create mode 100644 internal/repository/model/fission_campaign_keep.gen.go create mode 100644 internal/repository/model/fission_campaign_keep.go create mode 100644 internal/repository/model/fission_campaign_keep_step.gen.go create mode 100644 internal/repository/model/fission_campaign_lang.gen.go create mode 100644 internal/repository/model/fission_campaign_lang.go create mode 100644 internal/repository/model/fission_campaign_long_img.gen.go create mode 100644 internal/repository/model/fission_campaign_long_img_zone.gen.go create mode 100644 internal/repository/model/fission_campaign_points_use.gen.go create mode 100644 internal/repository/model/fission_campaign_push.gen.go create mode 100644 internal/repository/model/fission_campaign_push.go create mode 100644 internal/repository/model/fission_campaign_qa.gen.go create mode 100644 internal/repository/model/fission_campaign_qa_option.gen.go create mode 100644 internal/repository/model/fission_campaign_qa_question.gen.go create mode 100644 internal/repository/model/fission_campaign_qa_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_quiz.gen.go create mode 100644 internal/repository/model/fission_campaign_quiz_option.gen.go create mode 100644 internal/repository/model/fission_campaign_quiz_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_referral.gen.go create mode 100644 internal/repository/model/fission_campaign_referral_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_reward.go create mode 100644 internal/repository/model/fission_campaign_reward_add.gen.go create mode 100644 internal/repository/model/fission_campaign_reward_add_log.gen.go create mode 100644 internal/repository/model/fission_campaign_reward_help.gen.go create mode 100644 internal/repository/model/fission_campaign_reward_rule.gen.go create mode 100644 internal/repository/model/fission_campaign_sign.gen.go create mode 100644 internal/repository/model/fission_campaign_slot.gen.go create mode 100644 internal/repository/model/fission_campaign_slot_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_style.gen.go create mode 100644 internal/repository/model/fission_campaign_style.go create mode 100644 internal/repository/model/fission_campaign_task.gen.go create mode 100644 internal/repository/model/fission_campaign_task.go create mode 100644 internal/repository/model/fission_campaign_ticket.gen.go create mode 100644 internal/repository/model/fission_campaign_ticket.go create mode 100644 internal/repository/model/fission_campaign_uno.gen.go create mode 100644 internal/repository/model/fission_campaign_uno.go create mode 100644 internal/repository/model/fission_campaign_uno_card.gen.go create mode 100644 internal/repository/model/fission_campaign_uno_group.gen.go create mode 100644 internal/repository/model/fission_campaign_uno_group.go create mode 100644 internal/repository/model/fission_campaign_vs.gen.go create mode 100644 internal/repository/model/fission_campaign_vs_schedule.gen.go create mode 100644 internal/repository/model/fission_campaign_vs_schedule.go create mode 100644 internal/repository/model/fission_campaign_vs_team.gen.go create mode 100644 internal/repository/model/fission_campaign_wheel.gen.go create mode 100644 internal/repository/model/fission_campaign_wheel_reward.gen.go create mode 100644 internal/repository/model/fission_campaign_win.gen.go create mode 100644 internal/repository/model/fission_campaign_win_reward.gen.go create mode 100644 internal/repository/model/fission_cash.gen.go create mode 100644 internal/repository/model/fission_cash_record.gen.go create mode 100644 internal/repository/model/fission_cash_record.go create mode 100644 internal/repository/model/fission_channel_behavior.gen.go create mode 100644 internal/repository/model/fission_chat.gen.go create mode 100644 internal/repository/model/fission_chat_msg.gen.go create mode 100644 internal/repository/model/fission_chat_msg.go create mode 100644 internal/repository/model/fission_child_user.gen.go create mode 100644 internal/repository/model/fission_child_user.go create mode 100644 internal/repository/model/fission_child_user_record.gen.go create mode 100644 internal/repository/model/fission_chop.gen.go create mode 100644 internal/repository/model/fission_chop_help.gen.go create mode 100644 internal/repository/model/fission_chop_reward.gen.go create mode 100644 internal/repository/model/fission_client_reward.gen.go create mode 100644 internal/repository/model/fission_coin.gen.go create mode 100644 internal/repository/model/fission_coin_log.gen.go create mode 100644 internal/repository/model/fission_coin_log.go create mode 100644 internal/repository/model/fission_coin_scene.gen.go create mode 100644 internal/repository/model/fission_config.gen.go create mode 100644 internal/repository/model/fission_custom_btn.gen.go create mode 100644 internal/repository/model/fission_dice.gen.go create mode 100644 internal/repository/model/fission_dice_collect.gen.go create mode 100644 internal/repository/model/fission_dice_map.gen.go create mode 100644 internal/repository/model/fission_dice_map_group.gen.go create mode 100644 internal/repository/model/fission_dice_props.gen.go create mode 100644 internal/repository/model/fission_dice_props_record.gen.go create mode 100644 internal/repository/model/fission_dice_record.gen.go create mode 100644 internal/repository/model/fission_dice_record.go create mode 100644 internal/repository/model/fission_dice_run.gen.go create mode 100644 internal/repository/model/fission_flip.gen.go create mode 100644 internal/repository/model/fission_flip_log.gen.go create mode 100644 internal/repository/model/fission_flip_log.go create mode 100644 internal/repository/model/fission_gashapon.gen.go create mode 100644 internal/repository/model/fission_gashapon_log.gen.go create mode 100644 internal/repository/model/fission_gashapon_log.go create mode 100644 internal/repository/model/fission_gold.gen.go create mode 100644 internal/repository/model/fission_gold_log.gen.go create mode 100644 internal/repository/model/fission_gold_log.go create mode 100644 internal/repository/model/fission_grid.gen.go create mode 100644 internal/repository/model/fission_grid_log.gen.go create mode 100644 internal/repository/model/fission_grid_log.go create mode 100644 internal/repository/model/fission_grid_lucky.gen.go create mode 100644 internal/repository/model/fission_grow.gen.go create mode 100644 internal/repository/model/fission_grow_life.gen.go create mode 100644 internal/repository/model/fission_grow_record.gen.go create mode 100644 internal/repository/model/fission_grow_record.go create mode 100644 internal/repository/model/fission_keep.gen.go create mode 100644 internal/repository/model/fission_keep_log.gen.go create mode 100644 internal/repository/model/fission_lang_module.gen.go create mode 100644 internal/repository/model/fission_lang_module.go create mode 100644 internal/repository/model/fission_notify.gen.go create mode 100644 internal/repository/model/fission_notify.go create mode 100644 internal/repository/model/fission_notify_resp.gen.go create mode 100644 internal/repository/model/fission_notify_task.gen.go create mode 100644 internal/repository/model/fission_point_deduct.gen.go create mode 100644 internal/repository/model/fission_points_log.gen.go create mode 100644 internal/repository/model/fission_points_log.go create mode 100644 internal/repository/model/fission_prize_wheel.gen.go create mode 100644 internal/repository/model/fission_prize_wheel_log.gen.go create mode 100644 internal/repository/model/fission_prize_wheel_log.go create mode 100644 internal/repository/model/fission_prize_wheel_lucky.gen.go create mode 100644 internal/repository/model/fission_qa.gen.go create mode 100644 internal/repository/model/fission_qa_answer.gen.go create mode 100644 internal/repository/model/fission_qa_log.gen.go create mode 100644 internal/repository/model/fission_quiz.gen.go create mode 100644 internal/repository/model/fission_quiz_log.gen.go create mode 100644 internal/repository/model/fission_quiz_reward.gen.go create mode 100644 internal/repository/model/fission_referral.gen.go create mode 100644 internal/repository/model/fission_referral_reward.gen.go create mode 100644 internal/repository/model/fission_reward_record.gen.go create mode 100644 internal/repository/model/fission_reward_record.go create mode 100644 internal/repository/model/fission_reward_record_form.gen.go create mode 100644 internal/repository/model/fission_reward_record_form.go create mode 100644 internal/repository/model/fission_sign.gen.go create mode 100644 internal/repository/model/fission_sign_day.gen.go create mode 100644 internal/repository/model/fission_sign_day.go create mode 100644 internal/repository/model/fission_sign_log.gen.go create mode 100644 internal/repository/model/fission_slot.gen.go create mode 100644 internal/repository/model/fission_slot_log.gen.go create mode 100644 internal/repository/model/fission_slot_log.go create mode 100644 internal/repository/model/fission_slot_lucky.gen.go create mode 100644 internal/repository/model/fission_stat_channel.gen.go create mode 100644 internal/repository/model/fission_stat_cycle.gen.go create mode 100644 internal/repository/model/fission_stat_media.gen.go create mode 100644 internal/repository/model/fission_stat_other.gen.go create mode 100644 internal/repository/model/fission_stat_summary.gen.go create mode 100644 internal/repository/model/fission_target_record.gen.go create mode 100644 internal/repository/model/fission_temp.gen.go create mode 100644 internal/repository/model/fission_temp_group.gen.go create mode 100644 internal/repository/model/fission_temp_group_lang.gen.go create mode 100644 internal/repository/model/fission_temp_image.gen.go create mode 100644 internal/repository/model/fission_temp_lang.gen.go create mode 100644 internal/repository/model/fission_total.gen.go create mode 100644 internal/repository/model/fission_total_cycle.gen.go create mode 100644 internal/repository/model/fission_unlock_reward.gen.go create mode 100644 internal/repository/model/fission_uno.gen.go create mode 100644 internal/repository/model/fission_uno_collect.gen.go create mode 100644 internal/repository/model/fission_uno_collect_log.go create mode 100644 internal/repository/model/fission_uno_log.gen.go create mode 100644 internal/repository/model/fission_uno_log.go create mode 100644 internal/repository/model/fission_user.gen.go create mode 100644 internal/repository/model/fission_user.go create mode 100644 internal/repository/model/fission_user_active.gen.go create mode 100644 internal/repository/model/fission_user_attr.gen.go create mode 100644 internal/repository/model/fission_user_attr.go create mode 100644 internal/repository/model/fission_user_attr_total.gen.go create mode 100644 internal/repository/model/fission_user_cond.gen.go create mode 100644 internal/repository/model/fission_user_cond_record.gen.go create mode 100644 internal/repository/model/fission_user_cond_record.go create mode 100644 internal/repository/model/fission_user_ctlink.gen.go create mode 100644 internal/repository/model/fission_user_dylink.gen.go create mode 100644 internal/repository/model/fission_user_dylink.go create mode 100644 internal/repository/model/fission_user_event.gen.go create mode 100644 internal/repository/model/fission_user_jattr.gen.go create mode 100644 internal/repository/model/fission_user_jattr.go create mode 100644 internal/repository/model/fission_user_level.gen.go create mode 100644 internal/repository/model/fission_user_level_related.gen.go create mode 100644 internal/repository/model/fission_user_pre_cond.gen.go create mode 100644 internal/repository/model/fission_user_stat.gen.go create mode 100644 internal/repository/model/fission_user_tag.gen.go create mode 100644 internal/repository/model/fission_user_task_record.gen.go create mode 100644 internal/repository/model/fission_user_task_reward.gen.go create mode 100644 internal/repository/model/fission_user_task_valid.gen.go create mode 100644 internal/repository/model/fission_user_task_valid.go create mode 100644 internal/repository/model/fission_vs.gen.go create mode 100644 internal/repository/model/fission_vs_log.gen.go create mode 100644 internal/repository/model/fission_vs_vote.gen.go create mode 100644 internal/repository/model/fission_vs_vote_settlement.gen.go create mode 100644 internal/repository/model/fission_vs_vote_settlement.go create mode 100644 internal/repository/model/fission_web_user.gen.go create mode 100644 internal/repository/model/fission_win.gen.go create mode 100644 internal/repository/model/fission_win_reward.gen.go create mode 100644 internal/repository/model/form.gen.go create mode 100644 internal/repository/model/form.go create mode 100644 internal/repository/model/game_action.gen.go create mode 100644 internal/repository/model/game_action.go create mode 100644 internal/repository/model/game_link.gen.go create mode 100644 internal/repository/model/game_total.gen.go create mode 100644 internal/repository/model/game_total_date.gen.go create mode 100644 internal/repository/model/game_user.gen.go create mode 100644 internal/repository/model/lang.gen.go create mode 100644 internal/repository/model/lang_text_mark.gen.go create mode 100644 internal/repository/model/library_qa.gen.go create mode 100644 internal/repository/model/library_qa_group.gen.go create mode 100644 internal/repository/model/library_qa_option.gen.go create mode 100644 internal/repository/model/lv_api_log.gen.go create mode 100644 internal/repository/model/lv_api_log.go create mode 100644 internal/repository/model/material.gen.go create mode 100644 internal/repository/model/module_statistics_eventflow.gen.go create mode 100644 internal/repository/model/notify_url.gen.go create mode 100644 internal/repository/model/notify_url.go create mode 100644 internal/repository/model/operate_log.gen.go create mode 100644 internal/repository/model/permission.gen.go create mode 100644 internal/repository/model/project.gen.go create mode 100644 internal/repository/model/project_ad.gen.go create mode 100644 internal/repository/model/project_secret.gen.go create mode 100644 internal/repository/model/project_user.gen.go create mode 100644 internal/repository/model/project_user_coin.gen.go create mode 100644 internal/repository/model/project_user_coin.go create mode 100644 internal/repository/model/project_user_coin_deduct.gen.go create mode 100644 internal/repository/model/project_user_coin_expired.gen.go create mode 100644 internal/repository/model/project_user_coin_log.gen.go create mode 100644 internal/repository/model/project_user_coin_log.go create mode 100644 internal/repository/model/project_user_coin_record.gen.go create mode 100644 internal/repository/model/project_user_coin_use.gen.go create mode 100644 internal/repository/model/project_user_coin_use.go create mode 100644 internal/repository/model/project_user_info_log.gen.go create mode 100644 internal/repository/model/project_user_info_log.go create mode 100644 internal/repository/model/redeem_mall.gen.go create mode 100644 internal/repository/model/redeem_mall_item.gen.go create mode 100644 internal/repository/model/redeem_mall_item.go create mode 100644 internal/repository/model/redeem_mall_item_task.gen.go create mode 100644 internal/repository/model/redeem_mall_record.gen.go create mode 100644 internal/repository/model/redeem_mall_relate.gen.go create mode 100644 internal/repository/model/register.gen.go create mode 100644 internal/repository/model/register_audit.gen.go create mode 100644 internal/repository/model/reward.gen.go create mode 100644 internal/repository/model/reward.go create mode 100644 internal/repository/model/reward_lang.gen.go create mode 100644 internal/repository/model/reward_push.gen.go create mode 100644 internal/repository/model/reward_push.go create mode 100644 internal/repository/model/reward_push_log.gen.go create mode 100644 internal/repository/model/reward_push_log.go create mode 100644 internal/repository/model/reward_push_task.gen.go create mode 100644 internal/repository/model/reward_related.gen.go create mode 100644 internal/repository/model/server_whitelist.gen.go create mode 100644 internal/repository/model/slow_log.gen.go create mode 100644 internal/repository/model/t_coin.gen.go create mode 100644 internal/repository/model/t_coin.go create mode 100644 internal/repository/model/t_coin_lang.gen.go create mode 100644 internal/repository/model/user.gen.go create mode 100644 internal/repository/model/user_behavior.gen.go create mode 100644 internal/repository/model/user_project_relate.gen.go create mode 100644 internal/repository/mtype/map.go create mode 100644 internal/repository/mtype/mtype.go create mode 100644 internal/repository/mtype/struct.go create mode 100644 internal/repository/withdefault/with_default.go create mode 100644 internal/server/depend/micro.go create mode 100644 internal/server/server.go create mode 100644 internal/server/wrapper.go create mode 100644 internal/service/cmm/cmm.go create mode 100644 internal/service/cmm/data_cache.go create mode 100644 internal/service/cmm/first_create.go create mode 100644 internal/service/containers/c_test.go create mode 100644 internal/service/containers/campaign/ads_show.go create mode 100644 internal/service/containers/campaign/ads_store.go create mode 100644 internal/service/containers/campaign/ads_update.go create mode 100644 internal/service/containers/campaign/barrage.go create mode 100644 internal/service/containers/campaign/c_test.go create mode 100644 internal/service/containers/campaign/channel_create.go create mode 100644 internal/service/containers/campaign/child_show.go create mode 100644 internal/service/containers/campaign/child_store.go create mode 100644 internal/service/containers/campaign/child_update.go create mode 100644 internal/service/containers/campaign/langs.go create mode 100644 internal/service/containers/campaign/list.go create mode 100644 internal/service/containers/campaign/reward_detail.go create mode 100644 internal/service/containers/campaign/save_lang.go create mode 100644 internal/service/containers/campaign/show.go create mode 100644 internal/service/containers/campaign/show_reward.go create mode 100644 internal/service/containers/campaign/store.go create mode 100644 internal/service/containers/campaign/update.go create mode 100644 internal/service/containers/campaign/vs_settlement.go create mode 100644 internal/service/containers/campaignstat/ads_reward.go create mode 100644 internal/service/containers/campaignstat/ads_summary.go create mode 100644 internal/service/containers/campaignstat/ads_table.go create mode 100644 internal/service/containers/campaignstat/c_test.go create mode 100644 internal/service/containers/campaignstat/campaign.go create mode 100644 internal/service/containers/campaignstat/dem_title.go create mode 100644 internal/service/containers/campaignstat/related.go create mode 100644 internal/service/containers/campaignstat/report_info.go create mode 100644 internal/service/containers/campaignstat/stat.go create mode 100644 internal/service/containers/campaignstat/stat_event.go create mode 100644 internal/service/containers/campaignstat/summary.go create mode 100644 internal/service/containers/campaignstat/top_ten.go create mode 100644 internal/service/containers/campaignstat/user_cycle.go create mode 100644 internal/service/containers/campaignuser/answer.go create mode 100644 internal/service/containers/campaignuser/c_test.go create mode 100644 internal/service/containers/campaignuser/chat.go create mode 100644 internal/service/containers/campaignuser/chat_list.go create mode 100644 internal/service/containers/campaignuser/child.go create mode 100644 internal/service/containers/campaignuser/child_active.go create mode 100644 internal/service/containers/campaignuser/child_list.go create mode 100644 internal/service/containers/campaignuser/dice.go create mode 100644 internal/service/containers/campaignuser/dice_record.go create mode 100644 internal/service/containers/campaignuser/dynamic_link.go create mode 100644 internal/service/containers/campaignuser/exchange.go create mode 100644 internal/service/containers/campaignuser/feed.go create mode 100644 internal/service/containers/campaignuser/list.go create mode 100644 internal/service/containers/campaignuser/lottery.go create mode 100644 internal/service/containers/campaignuser/lottery_log.go create mode 100644 internal/service/containers/campaignuser/mall_list.go create mode 100644 internal/service/containers/campaignuser/mix_reward.go create mode 100644 internal/service/containers/campaignuser/play.go create mode 100644 internal/service/containers/campaignuser/reward.go create mode 100644 internal/service/containers/campaignuser/reward_form.go create mode 100644 internal/service/containers/campaignuser/reward_user.go create mode 100644 internal/service/containers/campaignuser/task.go create mode 100644 internal/service/containers/campaignuser/uno_rand_card.go create mode 100644 internal/service/containers/campaignuser/visit.go create mode 100644 internal/service/containers/campaignuser/vote.go create mode 100644 internal/service/containers/coin_save.go create mode 100644 internal/service/containers/fission_create_temp_group.go create mode 100644 internal/service/containers/fission_template_info.go create mode 100644 internal/service/containers/fission_update_temp_group.go create mode 100644 internal/service/containers/fission_web_asd_user.go create mode 100644 internal/service/containers/fission_web_bind_web.go create mode 100644 internal/service/containers/fission_web_web_reward.go create mode 100644 internal/service/containers/games/trace.go create mode 100644 internal/service/containers/games/visit.go create mode 100644 internal/service/containers/library_qa_rand.go create mode 100644 internal/service/containers/mall/c_test.go create mode 100644 internal/service/containers/mall/exchange_item.go create mode 100644 internal/service/containers/mall/item_list.go create mode 100644 internal/service/containers/mall/item_status.go create mode 100644 internal/service/containers/mall/item_store.go create mode 100644 internal/service/containers/mall/item_update.go create mode 100644 internal/service/containers/mall/list.go create mode 100644 internal/service/containers/mall/user_item_list.go create mode 100644 internal/service/containers/openplatform/campaign_info.go create mode 100644 internal/service/containers/openplatform/player.go create mode 100644 internal/service/containers/openplatform/user_list.go create mode 100644 internal/service/containers/project_list.go create mode 100644 internal/service/containers/project_save_ads_config.go create mode 100644 internal/service/containers/project_store.go create mode 100644 internal/service/containers/project_update.go create mode 100644 internal/service/containers/projectuser/point.go create mode 100644 internal/service/containers/register_store.go create mode 100644 internal/service/containers/reward_list.go create mode 100644 internal/service/containers/user_login.go create mode 100644 internal/service/crons/action/action.go create mode 100644 internal/service/crons/action/action_test.go create mode 100644 internal/service/crons/action/campaign.go create mode 100644 internal/service/crons/action/containers/campaign_quiz_open.go create mode 100644 internal/service/crons/action/containers/push_notify.go create mode 100644 internal/service/crons/action/mall.go create mode 100644 internal/service/crons/action/notify.go create mode 100644 internal/service/crons/action/stat.go create mode 100644 internal/service/crons/action/z_clear.go create mode 100644 internal/service/crons/crons.go create mode 100644 internal/service/notify/notify.go create mode 100644 internal/service/notify/notify_test.go create mode 100644 internal/service/notify/reward.go create mode 100644 internal/service/provider/award/award_iss_verify.go create mode 100644 internal/service/provider/award/award_reawrd.go create mode 100644 internal/service/provider/c_test.go create mode 100644 internal/service/provider/cachecurd/coin_scene.hmap.go create mode 100644 internal/service/provider/cachecurd/hmap.go create mode 100644 internal/service/provider/cachecurd/hmap_option.go create mode 100644 internal/service/provider/cachecurd/keep_reward_select.hmap.go create mode 100644 internal/service/provider/cachecurd/rank.go create mode 100644 internal/service/provider/cachecurd/stock.hmap.go create mode 100644 internal/service/provider/campaign_timezone.go create mode 100644 internal/service/provider/company_made.go create mode 100644 internal/service/provider/fission_behavior_total.go create mode 100644 internal/service/provider/fission_clue.go create mode 100644 internal/service/provider/fission_config.go create mode 100644 internal/service/provider/fission_user.go create mode 100644 internal/service/provider/fission_user_attr.go create mode 100644 internal/service/provider/fissionaction/README.md create mode 100644 internal/service/provider/fissionaction/action_list.go create mode 100644 internal/service/provider/fissionaction/c_test.go create mode 100644 internal/service/provider/fissionaction/dimension.go create mode 100644 internal/service/provider/fissionaction/mark_point.go create mode 100644 internal/service/provider/fissionaction/option.go create mode 100644 internal/service/provider/fissionaction/z_action_list.json create mode 100644 internal/service/provider/fissionaction/z_dimension.json create mode 100644 internal/service/provider/fissionaction/z_dimension_key.json create mode 100644 internal/service/provider/lang_title.go create mode 100644 internal/service/provider/malls/mall.go create mode 100644 internal/service/provider/malls/relate.go create mode 100644 internal/service/provider/operatelog/operate_log.go create mode 100644 internal/service/provider/operatelog/option.go create mode 100644 internal/service/provider/players/ballot.go create mode 100644 internal/service/provider/players/blind.go create mode 100644 internal/service/provider/players/cash.go create mode 100644 internal/service/provider/players/chop.go create mode 100644 internal/service/provider/players/coin.go create mode 100644 internal/service/provider/players/coin_test.go create mode 100644 internal/service/provider/players/dice.go create mode 100644 internal/service/provider/players/flip.go create mode 100644 internal/service/provider/players/gashapon.go create mode 100644 internal/service/provider/players/gashapon_test.go create mode 100644 internal/service/provider/players/gold.go create mode 100644 internal/service/provider/players/gold_test.go create mode 100644 internal/service/provider/players/grid.go create mode 100644 internal/service/provider/players/keep_dog.go create mode 100644 internal/service/provider/players/keep_dog_test.go create mode 100644 internal/service/provider/players/option.go create mode 100644 internal/service/provider/players/player.go create mode 100644 internal/service/provider/players/qa.go create mode 100644 internal/service/provider/players/qa_test.go create mode 100644 internal/service/provider/players/quiz.go create mode 100644 internal/service/provider/players/sign.go create mode 100644 internal/service/provider/players/sign_test.go create mode 100644 internal/service/provider/players/slot.go create mode 100644 internal/service/provider/players/uno.go create mode 100644 internal/service/provider/players/vs.go create mode 100644 internal/service/provider/players/vs_test.go create mode 100644 internal/service/provider/players/wheel.go create mode 100644 internal/service/provider/projectuser/option.go create mode 100644 internal/service/provider/projectuser/project_user.go create mode 100644 internal/service/provider/pusher/option.go create mode 100644 internal/service/provider/pusher/push_group.go create mode 100644 internal/service/provider/pusher/pusher.go create mode 100644 internal/service/provider/pusher/pusher_test.go create mode 100644 internal/service/provider/rewards.go create mode 100644 internal/service/provider/s2s/lv_api.go create mode 100644 internal/service/provider/s2s/option.go create mode 100644 internal/service/provider/s2s/point_change_test.go create mode 100644 internal/service/provider/s2s/points_change.go create mode 100644 internal/service/provider/s2s/reward.go create mode 100644 internal/service/provider/s2s/s2s.go create mode 100644 internal/service/provider/s2s/user_coin_change.go create mode 100644 internal/service/provider/s2s/user_info.go create mode 100644 internal/service/provider/stocks/c_test.go create mode 100644 internal/service/provider/stocks/campaign.go create mode 100644 internal/service/provider/stocks/campaign_reward.go create mode 100644 internal/service/provider/stocks/campaign_reward_select.go create mode 100644 internal/service/provider/stocks/cleaner.go create mode 100644 internal/service/provider/stocks/mall_reward.go create mode 100644 internal/service/provider/stocks/stocks.go create mode 100644 internal/service/provider/traces/fn_timer.go create mode 100644 internal/service/queue/consumer/action.go create mode 100644 internal/service/queue/consumer/campaignnotice/behavior.go create mode 100644 internal/service/queue/consumer/campaignnotice/child_invite.go create mode 100644 internal/service/queue/consumer/campaignnotice/cond_stat.go create mode 100644 internal/service/queue/consumer/campaignnotice/consume.go create mode 100644 internal/service/queue/consumer/campaignnotice/dice_map.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/ads_table.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/base.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/c_test.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/campaign_report.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/child_list.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/coin_record.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/export.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/fission_reward_record.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/fission_user.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/fission_user_stat.go create mode 100644 internal/service/queue/consumer/campaignnotice/export/new_user_list.go create mode 100644 internal/service/queue/consumer/campaignnotice/game_action.go create mode 100644 internal/service/queue/consumer/campaignnotice/logic_test.go create mode 100644 internal/service/queue/consumer/campaignnotice/notice.go create mode 100644 internal/service/queue/consumer/campaignnotice/other_stat.go create mode 100644 internal/service/queue/consumer/campaignnotice/project_user.go create mode 100644 internal/service/queue/consumer/campaignnotice/project_user_coin_deduct.go create mode 100644 internal/service/queue/consumer/campaignnotice/pub_test.go create mode 100755 internal/service/queue/consumer/campaignnotice/reward_limit_up.go create mode 100644 internal/service/queue/consumer/campaignnotice/reward_notify.go create mode 100644 internal/service/queue/consumer/campaignnotice/settlement_reward.go create mode 100644 internal/service/queue/consumer/campaignnotice/target_stat.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/ballot.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/base.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/blind.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/cash.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/chop.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/coin.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/dice.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/event.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/flip.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/gashapon.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/gold.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/grid.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/grow.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/keep.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/prize_wheel.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/qa.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/quiz.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/referral.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/sign.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/slot.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/uno.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/valid_events.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/vs.go create mode 100644 internal/service/queue/consumer/campaignnotice/validevents/win.go create mode 100644 internal/service/queue/consumer/campaignnotice/vs_settlement.go create mode 100644 internal/service/queue/consumer/consumer.go create mode 100644 internal/service/queue/consumer/group_handler.go create mode 100644 internal/service/queue/consumer/statcampaign/logic.go create mode 100644 internal/service/queue/consumer/statcampaign/logic_test.go create mode 100644 internal/service/queue/consumer/statcampaign/stat_campaign.go create mode 100644 internal/service/queue/consumer/task.go create mode 100644 internal/service/queue/delay/action.go create mode 100644 internal/service/queue/delay/delay.go create mode 100644 internal/service/queue/delay/global_reward_push.go create mode 100644 internal/service/queue/delay/reward_push.go create mode 100644 internal/service/queue/producer/campaign_notice.go create mode 100644 internal/service/queue/producer/delay_common.go create mode 100644 internal/service/queue/producer/fissionbi_receiver.go create mode 100644 internal/service/queue/producer/joybuywork_notify.go create mode 100644 internal/service/queue/producer/oplatform_other.go create mode 100644 internal/service/queue/producer/option.go create mode 100644 internal/service/queue/producer/producer.go create mode 100644 internal/service/queue/producer/pub_test.go create mode 100644 internal/service/queue/producer/stat_campaign.go create mode 100644 internal/service/queue/types/campaign_notice.go create mode 100644 internal/service/queue/types/consts.go create mode 100644 internal/service/queue/types/delay_comon.go create mode 100644 internal/service/queue/types/fissionbi_receiver.go create mode 100644 internal/service/queue/types/joybuywork_notify.go create mode 100644 internal/service/queue/types/oplatform_other.go create mode 100644 internal/service/queue/types/stat_campaign.go create mode 100644 internal/service/script/boot.go create mode 100644 internal/service/script/forever.go create mode 100644 internal/service/script/script_test.go create mode 100644 internal/service/script/test_api.go create mode 100644 internal/service/service.go create mode 100644 internal/service/w_campaign.go create mode 100644 internal/service/w_campaign_stat.go create mode 100644 internal/service/w_campaign_user.go create mode 100644 internal/service/w_coin.go create mode 100644 internal/service/w_common.go create mode 100644 internal/service/w_fission.go create mode 100644 internal/service/w_fission_web.go create mode 100644 internal/service/w_games.go create mode 100644 internal/service/w_library.go create mode 100644 internal/service/w_mall.go create mode 100644 internal/service/w_open_platform.go create mode 100644 internal/service/w_project.go create mode 100644 internal/service/w_project_user.go create mode 100644 internal/service/w_register.go create mode 100644 internal/service/w_reward.go create mode 100644 internal/service/w_script.go create mode 100644 internal/service/w_user.go create mode 100644 internal/utils/arr/arr.go create mode 100644 internal/utils/blink/ads_jump.go create mode 100644 internal/utils/blink/ads_link.go create mode 100644 internal/utils/blink/campaign_link.go create mode 100644 internal/utils/blink/game_link.go create mode 100644 internal/utils/blink/link.go create mode 100644 internal/utils/blink/option.go create mode 100644 internal/utils/decimal/decimal.go create mode 100644 internal/utils/decimal/helper.go create mode 100644 internal/utils/decimal/helper_test.go create mode 100644 internal/utils/decimal/types.go create mode 100644 internal/utils/ept/ept.go create mode 100644 internal/utils/helper.go create mode 100644 internal/utils/lockdo/lock_do.go create mode 100644 internal/utils/logic/context.go create mode 100644 internal/utils/logic/logic.go create mode 100644 internal/utils/logic/option.go create mode 100644 internal/utils/logic/run.go create mode 100644 internal/utils/merr/business_error.go create mode 100644 internal/utils/randext/rand_ext_test.go create mode 100644 internal/utils/randext/rand_str.go create mode 100644 internal/utils/timez/str_parse.go create mode 100644 internal/utils/timez/timez.go create mode 100644 internal/utils/timez/timez_test.go create mode 100644 internal/utils/upload/oss_test.go create mode 100644 internal/utils/upload/policy_token.go create mode 100644 internal/utils/upload/policy_token_test.go create mode 100644 internal/utils/upload/upload.go create mode 100644 internal/utils/utils.go create mode 100644 internal/utils/utils_test.go create mode 100644 internal/utils/verify/integer.go create mode 100644 internal/utils/verify/slices.go create mode 100644 internal/utils/verify/string.go create mode 100755 microg.toml create mode 100644 proto/go_proto/go.mod create mode 100644 proto/go_proto/w_campaign/w_campaign.pb.go create mode 100644 proto/go_proto/w_campaign/w_campaign.pb.micro.go create mode 100644 proto/go_proto/w_campaign_stat/w_campaign_stat.pb.go create mode 100644 proto/go_proto/w_campaign_stat/w_campaign_stat.pb.micro.go create mode 100644 proto/go_proto/w_campaign_user/w_campaign_user.pb.go create mode 100644 proto/go_proto/w_campaign_user/w_campaign_user.pb.micro.go create mode 100644 proto/go_proto/w_coin/w_coin.pb.go create mode 100644 proto/go_proto/w_coin/w_coin.pb.micro.go create mode 100644 proto/go_proto/w_common/w_common.pb.go create mode 100644 proto/go_proto/w_common/w_common.pb.micro.go create mode 100644 proto/go_proto/w_fission/w_fission.pb.go create mode 100644 proto/go_proto/w_fission/w_fission.pb.micro.go create mode 100644 proto/go_proto/w_fission_web/w_fission_web.pb.go create mode 100644 proto/go_proto/w_fission_web/w_fission_web.pb.micro.go create mode 100644 proto/go_proto/w_games/w_games.pb.go create mode 100644 proto/go_proto/w_games/w_games.pb.micro.go create mode 100644 proto/go_proto/w_library/w_library.pb.go create mode 100644 proto/go_proto/w_library/w_library.pb.micro.go create mode 100644 proto/go_proto/w_mall/w_mall.pb.go create mode 100644 proto/go_proto/w_mall/w_mall.pb.micro.go create mode 100644 proto/go_proto/w_open_platform/w_open_platform.pb.go create mode 100644 proto/go_proto/w_open_platform/w_open_platform.pb.micro.go create mode 100644 proto/go_proto/w_project/w_project.pb.go create mode 100644 proto/go_proto/w_project/w_project.pb.micro.go create mode 100644 proto/go_proto/w_project_user/w_project_user.pb.go create mode 100644 proto/go_proto/w_project_user/w_project_user.pb.micro.go create mode 100644 proto/go_proto/w_register/w_register.pb.go create mode 100644 proto/go_proto/w_register/w_register.pb.micro.go create mode 100644 proto/go_proto/w_reward/w_reward.pb.go create mode 100644 proto/go_proto/w_reward/w_reward.pb.micro.go create mode 100644 proto/go_proto/w_script/w_script.pb.go create mode 100644 proto/go_proto/w_script/w_script.pb.micro.go create mode 100644 proto/go_proto/w_user/w_user.pb.go create mode 100644 proto/go_proto/w_user/w_user.pb.micro.go create mode 100644 proto/go_proto/workerr/1_user.go create mode 100644 proto/go_proto/workerr/2_project.go create mode 100644 proto/go_proto/workerr/3_campaign.go create mode 100644 proto/go_proto/workerr/4_reward.go create mode 100644 proto/go_proto/workerr/work_err.go create mode 100644 proto/proto/w_campaign.proto create mode 100644 proto/proto/w_campaign_stat.proto create mode 100644 proto/proto/w_campaign_user.proto create mode 100644 proto/proto/w_coin.proto create mode 100644 proto/proto/w_common.proto create mode 100644 proto/proto/w_fission.proto create mode 100644 proto/proto/w_fission_web.proto create mode 100644 proto/proto/w_games.proto create mode 100644 proto/proto/w_library.proto create mode 100644 proto/proto/w_mall.proto create mode 100644 proto/proto/w_open_platform.proto create mode 100644 proto/proto/w_project.proto create mode 100644 proto/proto/w_project_user.proto create mode 100644 proto/proto/w_register.proto create mode 100644 proto/proto/w_reward.proto create mode 100644 proto/proto/w_script.proto create mode 100644 proto/proto/w_user.proto create mode 100644 proto/toml/w_campaign.toml create mode 100644 proto/toml/w_campaign_stat.toml create mode 100644 proto/toml/w_campaign_user.toml create mode 100644 proto/toml/w_coin.toml create mode 100644 proto/toml/w_common.toml create mode 100644 proto/toml/w_fission.toml create mode 100644 proto/toml/w_fission_web.toml create mode 100644 proto/toml/w_games.toml create mode 100644 proto/toml/w_library.toml create mode 100644 proto/toml/w_mall.toml create mode 100644 proto/toml/w_open_platform.toml create mode 100644 proto/toml/w_project.toml create mode 100644 proto/toml/w_project_user.toml create mode 100644 proto/toml/w_register.toml create mode 100644 proto/toml/w_reward.toml create mode 100644 proto/toml/w_script.toml create mode 100644 proto/toml/w_user.toml create mode 100644 test/do_test.go create mode 100644 test/finder_test.go create mode 100644 test/rpc_test.go create mode 100644 test/test.go create mode 100644 tools/bqueue/main.go diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5cf06a6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM golang:1.20-alpine as build + +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + +RUN apk --no-cache add tzdata \ + && apk --no-cache add ca-certificates \ + && update-ca-certificates + +#设置 GO 环境变量 +ENV CGO_ENABLED=0 +ENV GO111MODULE=on +ENV GOPROXY=https://mirrors.aliyun.com/goproxy/ +ENV GOPRIVATE=gits.branchcn.com/backend + +WORKDIR /joybuywork + +COPY . . + +RUN go build -o joybuywork ./cmd/joybuywork/joybuywork.go + +FROM scratch as final + +# 设置时区为上海 +COPY --from=build /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai +ENV TZ=Asia/Shanghai + +COPY --from=build /joybuywork/joybuywork / +COPY --from=build /joybuywork/asset/ /asset/ +COPY --from=build /joybuywork/etc/ /etc/ +COPY --from=build /joybuywork/tmp/ /tmp/ +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +ENTRYPOINT [ "/joybuywork", "-env" ] +CMD ["prod"] diff --git a/Dockerfile_fastest b/Dockerfile_fastest new file mode 100644 index 0000000..0f5a6ff --- /dev/null +++ b/Dockerfile_fastest @@ -0,0 +1,24 @@ +# 构建 +FROM go_base_image:latest as build + +# 设置工作目录 +WORKDIR /joybuywork + +COPY . . + +RUN go build -o joybuywork ./cmd/joybuywork/joybuywork.go + +FROM scratch as final + +# 设置时区为上海 +COPY --from=build /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai +ENV TZ=Asia/Shanghai + +COPY --from=build /joybuywork/joybuywork / +COPY --from=build /joybuywork/asset/ /asset/ +COPY --from=build /joybuywork/etc/ /etc/ +COPY --from=build /joybuywork/tmp/ /tmp/ +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +ENTRYPOINT [ "/joybuywork", "-env" ] +CMD ["prod"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d115bcb --- /dev/null +++ b/Makefile @@ -0,0 +1,62 @@ +gopath:=$(shell go env gopath) + +.phony: all +all: + @echo "hello world!" + +.phony: microg +microg: + go install gits.branchcn.com/backend/microcode/microg@upgrade + +#启动环境 +.phony: run +run: + @go run cmd/joybuywork/joybuywork.go -env=dev + +#启动环境 +.phony: build +build: + @go build -o main ./cmd/joybuywork/joybuywork.go + +#启动环境 +.phony: vet +vet: + @go vet cmd/joybuywork/joybuywork.go + +.phony: docker-run +docker-run: + docker build -f dockerfile-local -t joybuywork/v1 . && docker run --name joybuywork -d joybuywork/v1 + +.phony: pkg +pkg: + @go get gits.branchcn.com/backend/microcode/plugins + +.phony: deeplink +deeplink: + @go get gits.branchcn.com/backend/deeplink/proto/go_proto + +.phony: ct +ct: + @go get gits.branchcn.com/backend/certified/proto/go_proto + +.phony: bi +bi: + @echo go get gits.branchcn.com/backend/fissionbi/proto/go_proto + @go get gits.branchcn.com/backend/fissionbi/proto/go_proto + +.phony: bq +bq: + @echo go run tools/bqueue/main.go -t=$(t) -k=$(k) + @go run tools/bqueue/main.go -t=$(t) -k=$(k) + +.phony: op +op: + go get gits.branchcn.com/backend/oplatform/proto/go_proto + +.phony: ai +ai: + @go get gits.branchcn.com/backend/deepai/proto/go_proto + +.phony: tc +tc: + go get gits.branchcn.com/backend/taskcenter/proto/go_proto diff --git a/README.md b/README.md new file mode 100644 index 0000000..89f4f30 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# joybuywork + +系统业务工作服 \ No newline at end of file diff --git a/asset/ads/ads_dev.json b/asset/ads/ads_dev.json new file mode 100644 index 0000000..4c2c92a --- /dev/null +++ b/asset/ads/ads_dev.json @@ -0,0 +1,892 @@ +{ + "accounts": { + "test": "ca-pub-2821871715805907", + "prod": "ca-pub-2821871715805907" + }, + "webs": [ + { + "host": "https://moads-test.allapp.link", + "uris": [ + { + "uri": "/article/bloober-team-reveals-how-long-it-will-take-to-beat-silent-hill-2-remake" + }, + { + "uri": "/article/dc-chronicles-black-canarys-toughest-battle-ever-in-best-of-the-best" + }, + { + "uri": "/article/disney-tweets-then-deletes-video-featuring-first-looks-at-daredevil-red-hulk-ironheart-and-more" + }, + { + "uri": "/article/exclusive-amazon-games-boss-says-lord-of-the-rings-mmo-still-early-calls-tomb-raider-a-huge-huge-task" + }, + { + "uri": "/article/former-zelda-directorled-open-world-dress-up-rpg-infinity-nikki-hits-12-million-preregistrations" + }, + { + "uri": "/article/george-rr-martin-asked-what-hed-change-about-game-of-thrones-books-id-have-them-finished" + }, + { + "uri": "/article/guillermo-del-toro-is-livetweeting-his-beef-with-a-ghost-in-a-haunted-hotel-in-scotland" + }, + { + "uri": "/article/how-datamining-has-changed-the-landscape-of-video-game-puzzle-and-secret-design" + }, + { + "uri": "/article/how-teenage-mutant-ninja-turtles-x-naruto-combines-two-legendary-ninja-universes" + }, + { + "uri": "/article/how-the-lord-of-the-rings-the-war-of-the-rohirrim-connects-to-the-other-movies" + }, + { + "uri": "/article/how-to-follow-the-complete-dragon-age-timeline" + }, + { + "uri": "/article/ign-plus-games-claim-a-free-weapon-of-choice-dx-steam-key" + }, + { + "uri": "/article/in-black-myth-wukong-you-can-summon-one-boss-to-beat-another-boss-while-basically-doing-nothing" + }, + { + "uri": "/article/jack-black-and-paul-rudd-in-talks-to-star-in-a-new-anaconda-movie-report" + }, + { + "uri": "/article/joker-director-todd-phillips-says-hulk-hogan-biopic-with-chris-hemsworth-no-longer-happening" + }, + { + "uri": "/article/legacy-of-kain-soul-reaver-the-dead-shall-rise-reveals-official-trailer" + }, + { + "uri": "/article/microsoft-announces-october-release-date-for-alldigital-xbox-series-x" + }, + { + "uri": "/article/microsoft-expands-on-xbox-adaptive-controller-with-new-joystick-peripheral" + }, + { + "uri": "/article/new-tomb-raider-statue-captures-lara-croft-in-action" + }, + { + "uri": "/article/power-rangers-prime-is-a-new-beginning-for-the-franchise" + }, + { + "uri": "/article/sid-meiers-civilization-7-heres-what-comes-in-each-edition" + }, + { + "uri": "/article/the-art-of-dragon-age-the-veilguard-revealed-by-dark-horse" + }, + { + "uri": "/article/the-deathadder-v3-hyperspeed-proves-why-razers-flagship-mouse-still-rules" + }, + { + "uri": "/article/the-golem-of-venice-beach-unites-superstar-comic-book-artists-for-explosive-finale" + }, + { + "uri": "/article/the-lord-of-the-rings-the-war-of-the-rohirrim-animated-movie-reveals-first-trailer" + }, + { + "uri": "/business/amazon-games-ceo-thinks-genai-can-help-make-better-ideas-for-games" + }, + { + "uri": "/business/animal-crossing-pocket-camp-is-shutting-down-in-november-then-reopening-as-a-paid-game" + }, + { + "uri": "/business/atari-ceo-wants-infogrames-to-become-the-ultimate-preservationist-publisher" + }, + { + "uri": "/business/backyard-sports-is-back-after-an-extended-offseason-via-playground-productions" + }, + { + "uri": "/business/behind-the-gdc-scenes-with-beth-elderkin-and-sam-warnke-game-developer-podcast-ep-43" + }, + { + "uri": "/business/black-myth-wukong-has-sold-10-million-copies-worldwide" + }, + { + "uri": "/business/black-myth-wukong-opens-to-22-million-steam-players" + }, + { + "uri": "/business/cma-closes-yearslong-investigation-into-apples-inapp-payments" + }, + { + "uri": "/business/call-of-duty-uncouples-warzone-from-annual-schedule-with-platform-overhaul" + }, + { + "uri": "/business/cyberpunk-and-phantom-liberty-remain-big-drivers-behind-cd-projekts-revenue-growth" + }, + { + "uri": "/business/embracer-appoints-thomas-kœgler-as-the-ceo-of-asmodee" + }, + { + "uri": "/business/embracer-boss-says-volatile-pc-and-console-business-is-the-bad-guy" + }, + { + "uri": "/business/helldivers-2-and-dead-island-2-support-studio-toadman-interactive-confirms-layoffs" + }, + { + "uri": "/business/how-to-build-a-team-and-start-developing-a-game-by-being-a-simple-manager" + }, + { + "uri": "/business/hunt-showdown-sees-new-concurrent-player-high-with-1896-update" + }, + { + "uri": "/business/iron-galaxy-coceo-adam-boyes-to-exit-after-8year-stint" + }, + { + "uri": "/business/kwalee-releases-arabic-version-of-mobile-game-platform-for-mena-devs" + }, + { + "uri": "/business/mad-crusader-puts-30-million-toward-doublea-games-reopens-transmedia-incubation-program" + }, + { + "uri": "/business/mental-health-in-games-charity-take-this-is-facing-extinction" + }, + { + "uri": "/business/microsoft-really-wants-you-to-know-day-one-releases-no-longer-standard-on-xbox-game-pass" + }, + { + "uri": "/business/new-steam-tweaks-let-devs-highlight-related-games-and-dlc-on-store-pages" + }, + { + "uri": "/business/nightmare-porting-process-drove-haak-developer-blingame-to-cancel-xbox-version" + }, + { + "uri": "/business/nintendo-ends-new-3ds-repair-support-after-draining-parts-supply" + }, + { + "uri": "/business/north-beach-games-opens-prague-studio-to-support-itself-and-smaller-devs" + }, + { + "uri": "/business/obituary-atsuko-tanaka-game-and-anime-voice-actor-dies-at-age-61" + }, + { + "uri": "/business/pantaloon-helps-out-indie-devs-with-free-resource-hub" + }, + { + "uri": "/business/patch-notes-1-dispatches-from-amaze-sheffield" + }, + { + "uri": "/business/patch-notes-2-how-does-the-game-industry-survive-beyond-2025" + }, + { + "uri": "/business/phil-spencer-indiana-jones-ps5-jump-good-for-xboxs-health" + }, + { + "uri": "/business/physical-games-can-help-drive-digital-sales-says-maximum-entertainment-ceo" + }, + { + "uri": "/business/playstation-launches-incubator-project-for-mena-developers" + }, + { + "uri": "/business/quantic-dream-writer-adam-williams-departs-to-start-up-his-own-studio" + }, + { + "uri": "/business/randy-pitchford-borderlands-4s-steam-release-isnt-the-end-of-the-pc-store-wars" + }, + { + "uri": "/business/reforged-studios-does-a-double-acquisition-buys-ground-shatter-and-extra-mile" + }, + { + "uri": "/business/reikon-games-ruiner-to-receive-film-adaptation-by-universal-pictures" + }, + { + "uri": "/business/remedy-partners-with-annapurna-to-finance-control-2-and-develop-transmedia-projects" + }, + { + "uri": "/business/report-bungie-fired-veteran-director-after-misconduct-allegations" + }, + { + "uri": "/business/report-netease-cutting-jobs-at-ouka-studios-ahead-of-potential-closure" + }, + { + "uri": "/business/report-until-dawn-remake-developer-ballistic-moon-is-making-layoffs" + }, + { + "uri": "/business/roblox-will-let-creators-list-item-bundles-to-grow-their-earnings" + }, + { + "uri": "/business/rogue-snail-decouples-freetoplay-mechanics-from-relic-hunters-legend-after-gearbox-split" + }, + { + "uri": "/business/square-enix-eyes-bigger-xbox-focus-after-pretty-good-final-fantasy-xiv-response" + }, + { + "uri": "/business/steam-reviews-now-reflect-if-a-game-was-played-on-steam-deck" + }, + { + "uri": "/business/survey-spotty-preservation-efforts-risk-significant-loss-for-australian-game-industry" + }, + { + "uri": "/business/survey-reveals-devs-consider-genai-doubleedged-sword-in-game-development" + }, + { + "uri": "/business/the-epic-games-store-debuts-on-altstore-android-and-ios-devices" + }, + { + "uri": "/business/turns-out-dying-light-the-beast-started-out-as-leaked-dying-light-2-dlc" + }, + { + "uri": "/business/ubisoft-cuts-45-jobs-across-cary-and-san-francisco-teams" + }, + { + "uri": "/business/virtuos-acquires-codeveloper-third-kind-studios" + }, + { + "uri": "/business/visual-concepts-lays-off-staff-at-lego-2k-drive-south-studio" + }, + { + "uri": "/design/a-rising-tide-floats-all-boats-xbox-on-the-universal-benefits-of-accessible-design" + }, + { + "uri": "/design/astro-bot-makes-the-tech-demo-mascot-into-leading-bot-material" + }, + { + "uri": "/design/better-together-making-sense-of-the-frenetic-floating-fleets-in-flock" + }, + { + "uri": "/design/book-excerpt-animal-crossing-tracks-the-rise-of-the-original-cozy-life-sim" + }, + { + "uri": "/design/bridging-history-and-gameplay-lessons-from-historiographical-video-game-design" + }, + { + "uri": "/design/call-for-submissions-lets-talk-about-photography-games" + }, + { + "uri": "/design/categories-of-games-by-player-numbers" + }, + { + "uri": "/design/classic-postmortem-the-development-of-the-original-psychonauts-was-a-fraught-experience" + }, + { + "uri": "/design/conjuring-a-gestural-spellcasting-system-for-vr" + }, + { + "uri": "/design/deprioritizing-skillbased-matchmaking-turned-call-of-duty-into-the-bad-place" + }, + { + "uri": "/design/exploring-ancient-mexica-culture-through-cooking-in-cacao-cafe" + }, + { + "uri": "/design/firaxis-big-swing-with-civilization-vii-convincing-players-to-actually-finish-their-games" + }, + { + "uri": "/design/from-monopolies-to-tiny-tools-by-solo-devs" + }, + { + "uri": "/design/game-ui-database-relaunches-with-new-features-video-support-and-over-55000-screenshots" + }, + { + "uri": "/design/getting-under-the-hood-of-racing-games" + }, + { + "uri": "/design/how-the-team-behind-reus-2-nurtured-a-studio-and-ip-back-to-life" + }, + { + "uri": "/design/humor-is-all-weve-really-got-championing-absurdity-in-thank-goodness-youre-here" + }, + { + "uri": "/design/igf-2024-winners-on-creating-venba-rhythm-doctor-and-more" + }, + { + "uri": "/design/jordan-mechner-recounts-the-tale-of-creating-karateka-from-home" + }, + { + "uri": "/design/leading-the-charge-what-makes-nikkes-titular-gals-narratively-and-mechanically-compelling" + }, + { + "uri": "/design/lessons-on-small-scale-strategy-with-the-xcom-files" + }, + { + "uri": "/design/lets-compare-the-narrative-design-of-tactical-breach-wizards-and-into-the-breach" + }, + { + "uri": "/design/letting-apex-legends-players-go-guns-akimbo-was-harder-than-you-might-think" + }, + { + "uri": "/design/making-a-splash-how-wuthering-waves-characters-draw-players-into-its-world" + }, + { + "uri": "/design/making-the-bloodborne-kart-racer-come-to-life-with-nightmare-kart" + }, + { + "uri": "/design/player-stunts-in-breath-of-the-wild-gave-nintendo-confidence-to-push-boundaries-in-tears-of-the-kingdom" + }, + { + "uri": "/design/preserving-the-past-with-charles-cecil-game-developer-podcast-ep-46" + }, + { + "uri": "/design/ranked-four-tiny-screens-to-power-your-tiny-alt-ctrl-dreams" + }, + { + "uri": "/design/road-to-the-igf-2024-with-joel-couture-game-developer-podcast-ep-41" + }, + { + "uri": "/design/star-wars-outlaws-creative-director-says-swedish-pride-in-craftsmanship-was-key-to-development-progress" + }, + { + "uri": "/design/studio-imugi-is-ditching-oatmeal-narrative-design-with-bonapartea-mechanized-revolution" + }, + { + "uri": "/design/supporting-game-design-with-evolutionary-algorithms" + }, + { + "uri": "/design/tactical-breach-wizards-shows-how-strategy-games-can-tickle-the-funny-bone" + }, + { + "uri": "/design/the-garden-paths-savviest-design-decision-connecting-to-the-cosmos" + }, + { + "uri": "/design/the-unrealized-potential-of-cooking-in-games" + }, + { + "uri": "/design/the-concerns-of-covering-gacha-games" + }, + { + "uri": "/design/touch-can-bring-people-together-like-nothing-else-sparking-connections-through-video-game-intimacy" + }, + { + "uri": "/design/training-the-game-designers-of-tomorrow-part-3-of-5" + }, + { + "uri": "/design/upcoming-acmi-interactive-exhibition-welcomes-back-a-horrible-goose" + }, + { + "uri": "/design/vampire-survivors-development-sounds-like-an-open-sourcefueled-fever-dream" + }, + { + "uri": "/design/war-never-changes-why-innovation-in-game-development-is-still-vital" + }, + { + "uri": "/design/were-currently-choking-to-death-glow-golf-developer-alex-johansson-says-the-industry-must-engage-new-audiences" + }, + { + "uri": "/design/what-makes-the-survival-of-survival-horror-the-difference-between-scares-and-shooting" + }, + { + "uri": "/design/what-exactly-is-a-gamer-and-why-does-it-matter" + }, + { + "uri": "/design/why-fuck-around-and-find-out-became-the-backbone-of-arcos-combat" + }, + { + "uri": "/design/why-is-black-hair-so-difficult-for-video-games-to-get-right-this-3d-artist-explains" + }, + { + "uri": "/finance/as-strength-training-gets-more-popular-peloton-and-planet-fitness-shift-focus" + }, + { + "uri": "/finance/bitcoin-rally-helps-create-more-than-84000-new-crypto-millionaires-in-a-year" + }, + { + "uri": "/finance/boeing-starliner-returning-empty-as-nasa-turns-to-spacex-to-bring-astronauts-back-from-iss" + }, + { + "uri": "/finance/bronfmans-paramount-bid-could-keep-shari-redstone-involved-at-the-company" + }, + { + "uri": "/finance/cava-earnings-beat-estimates-as-restaurant-traffic-climbs-nearly-10" + }, + { + "uri": "/finance/classic-car-sales-stall-in-monterey-auctions-as-new-generation-takes-charge" + }, + { + "uri": "/finance/delta-chief-operations-officer-departing-for-another-company-after-just-over-a-year-on-the-job" + }, + { + "uri": "/finance/eli-lilly-releases-new-form-of-weight-loss-drug-zepbound-for-half-the-price-to-boost-access-supply" + }, + { + "uri": "/finance/fda-approves-updated-pfizer-moderna-covid-vaccines-as-virus-surges-shots-to-be-available-within-days" + }, + { + "uri": "/finance/foot-locker-shares-drop-10-despite-first-comparable-sales-growth-in-six-quarters" + }, + { + "uri": "/finance/ford-delays-new-ev-plant-cancels-electric-threerow-suv-as-it-shifts-strategy" + }, + { + "uri": "/finance/ford-joins-list-of-companies-walking-back-dei-policies" + }, + { + "uri": "/finance/home-prices-hit-record-high-in-june-on-sp-caseshiller-index" + }, + { + "uri": "/finance/home-sales-rose-in-july-for-the-first-time-in-five-months" + }, + { + "uri": "/finance/lego-revenue-jumps-13-in-first-half-of-2024-boosted-by-lego-fortnite-and-diverse-brick-sets" + }, + { + "uri": "/finance/macys-cuts-sales-forecast-as-department-stores-struggle-to-draw-shoppers" + }, + { + "uri": "/finance/mavericks-pelicans-games-are-leaving-their-local-sports-networks-ahead-of-nba-season" + }, + { + "uri": "/finance/nfl-owners-vote-in-favor-of-private-equity-investment-select-firms-commit-12-billion" + }, + { + "uri": "/finance/nfl-wants-a-cut-of-private-equity-investment-profits" + }, + { + "uri": "/finance/nwsl-eliminates-draft-grants-unrestricted-free-agency-to-players" + }, + { + "uri": "/finance/nordstrom-shares-climb-5-as-earnings-top-estimates-but-retailer-issues-cautious-guidance" + }, + { + "uri": "/finance/nvidia-announces-50-billion-stock-buyback" + }, + { + "uri": "/finance/nvidia-reports-122-revenue-growth-on-surging-demand-for-data-center-chips" + }, + { + "uri": "/finance/nvidias-earnings-report-shows-the-problem-of-being-priced-for-perfection" + }, + { + "uri": "/finance/paramount-special-committee-extends-skydance-go-shop-period-as-it-reviews-bronfman-offer" + }, + { + "uri": "/finance/peloton-shares-soar-35-as-turnaround-plan-takes-hold-losses-shrink" + }, + { + "uri": "/finance/peloton-to-start-charging-subscribers-with-used-equipment-95-activation-fee" + }, + { + "uri": "/finance/restaurants-fight-back-against-the-ftc-crackdown-on-junk-fees-as-diners-balk-at-new-charges" + }, + { + "uri": "/finance/shares-of-abercrombie-fitch-plunge-15-after-ceo-warns-of-increasingly-uncertain-environment" + }, + { + "uri": "/finance/tj-maxx-owner-raises-fullyear-guidance-posts-56-sales-gain-for-the-most-recent-quarter" + }, + { + "uri": "/finance/target-ceo-addresses-price-gouging-accusations-in-retail" + }, + { + "uri": "/finance/target-shares-spike-as-profits-rise-despite-cautious-sales-outlook" + }, + { + "uri": "/finance/us-will-again-offer-free-athome-covid-tests-starting-in-late-september" + }, + { + "uri": "/finance/walmart-adds-a-burger-king-benefit-to-its-membership-program" + }, + { + "uri": "/finance/washington-commanders-strike-stadium-naming-rights-deal-with-northwest-federal-credit-union" + }, + { + "uri": "/finance/why-ford-believes-its-19-billion-shift-in-ev-strategy-is-the-right-choice-for-the-company-investors" + }, + { + "uri": "/finance/yes-network-msg-networks-to-launch-combined-new-york-regional-sports-app" + }, + { + "uri": "/news/borderlands-4-announced-with-teaser-trailer-at-opening-night-live-gamescom-2024" + }, + { + "uri": "/news/civilization-7-interview-firaxis-answers-all-of-our-questions-about-the-anticipated-sequel-gamescom-2024" + }, + { + "uri": "/news/crimson-desert-is-like-god-of-war-and-dragons-dogma-had-a-baby-gamescom-2024" + }, + { + "uri": "/news/ign-uk-podcast-762-the-best-of-gamescom-2024" + }, + { + "uri": "/news/indiana-jones-and-the-great-circle-finally-gets-a-release-date-for-xboxand-playstation-gamescom-2024" + }, + { + "uri": "/news/secret-level-every-video-game-in-the-new-gamescom-trailer" + }, + { + "uri": "/programming/book-excerpt-game-ai-uncovered-volume-one" + }, + { + "uri": "/programming/chipwits-the-game-that-taught-a-generation-how-to-code-is-back" + }, + { + "uri": "/programming/creating-a-spatial-query-system" + }, + { + "uri": "/programming/deep-dive-conquering-hardware-hurdles-to-port-kingdom-come-deliverance-to-switch" + }, + { + "uri": "/programming/deep-dive-console-crossplay-and-how-we-made-it-work-in-insurgency" + }, + { + "uri": "/programming/deep-dive-cooking-up-a-palatable-food-prep-experience-in-fruitbus" + }, + { + "uri": "/programming/deep-dive-how-owlchemy-adapted-its-vr-titles-for-the-apple-vision-pro" + }, + { + "uri": "/programming/deep-dive-the-design-and-implementation-of-object-pools" + }, + { + "uri": "/programming/demystifying-3d-character-rigging-for-games" + }, + { + "uri": "/programming/finding-a-new-balance-between-ai-and-beneficial-bugs" + }, + { + "uri": "/programming/how-nintendo-did-the-impossible-with-tears-of-the-kingdoms-physics-system" + }, + { + "uri": "/programming/how-to-implement-ai-workflows-that-your-artists-will-actually-want-to-use" + }, + { + "uri": "/programming/how-to-get-better-fps-on-pc-while-porting-games-to-consoles" + }, + { + "uri": "/programming/populating-the-citybuilder-of-the-future-a-deep-dive-into-character-diversity-in-cities-skylines-ii" + }, + { + "uri": "/programming/square-enix-is-testing-aidriven-fictional-language-generation" + }, + { + "uri": "/programming/the-rise-of-generative-ai-in-revolutionizing-game-development" + }, + { + "uri": "/programming/unity-sees-webgpu-as-a-growing-market-for-game-development" + }, + { + "uri": "/programming/what-is-game-programming-and-how-do-you-become-a-game-programmer" + }, + { + "uri": "/programming/what-to-do-about-game-engines-with-rez-graham-and-bryant-francis-game-developer-podcast-ep-42" + }, + { + "uri": "/review/5-ways-star-wars-outlaws-connects-to-the-larger-franchise" + }, + { + "uri": "/review/amd-ryzen-9-9900x-review" + }, + { + "uri": "/review/amd-ryzen-9-9950x-review" + }, + { + "uri": "/review/adam-sandler-love-you-review" + }, + { + "uri": "/review/afraid-review" + }, + { + "uri": "/review/alien-romulus-review" + }, + { + "uri": "/review/asus-rog-ally-x-review" + }, + { + "uri": "/review/asus-zenbook-s-16-review" + }, + { + "uri": "/review/atomfall-isnt-british-fallout-its-something-much-more-interesting" + }, + { + "uri": "/review/avowed-has-big-stealth-archer-potential" + }, + { + "uri": "/review/bad-monkey-season-1-review" + }, + { + "uri": "/review/baldurs-gate-3-patch-7-arrives-this-week" + }, + { + "uri": "/review/batman-caped-crusader-season-1-review" + }, + { + "uri": "/review/batman-wont-appear-in-the-penguin-spinoff-show" + }, + { + "uri": "/review/beetlejuice-beetlejuice-review" + }, + { + "uri": "/review/best-gsync-monitors-2024" + }, + { + "uri": "/review/best-ipad-accessories-2024-what-should-you-pair-with-your-tablet" + }, + { + "uri": "/review/black-myth-wukong-review" + }, + { + "uri": "/review/black-state-inceptioninspired-bullettime-action" + }, + { + "uri": "/review/blink-twice-review" + }, + { + "uri": "/review/borderlands-review" + }, + { + "uri": "/review/cascadero-board-game-review" + }, + { + "uri": "/review/clair-obscur-expedition-33-the-first-preview" + }, + { + "uri": "/review/concord-is-estimated-to-have-sold-only-25000-units-heres-why-analysts-think-its-failing" + }, + { + "uri": "/review/concord-review" + }, + { + "uri": "/review/cuckoo-review" + }, + { + "uri": "/review/dark-and-darker-mobile-combines-genres-to-give-players-a-unique-experience" + }, + { + "uri": "/review/ducktales-returns-in-new-comic-book-series-from-dynamite-entertainment" + }, + { + "uri": "/review/dustborn-review" + }, + { + "uri": "/review/everything-we-know-about-the-iphone-16-so-far" + }, + { + "uri": "/review/fallout-london-review" + }, + { + "uri": "/review/famed-dragons-dogma-and-devil-may-cry-director-hideaki-itsuno-leaves-capcom-after-30-years" + }, + { + "uri": "/review/final-fantasy-creator-reveals-which-entry-he-thinks-is-most-complete-and-its-not-final-fantasy-7" + }, + { + "uri": "/review/final-fantasy-xiv-ttrpg-starter-set-board-game-review" + }, + { + "uri": "/review/gandalf-to-appear-in-lord-of-the-rings-the-hunt-for-gollum-ian-mckellen-asked-to-return" + }, + { + "uri": "/review/gigabyte-aorus-16x-review" + }, + { + "uri": "/review/gigabyte-gs27q-review" + }, + { + "uri": "/review/google-pixel-9-pro-review" + }, + { + "uri": "/review/google-pixel-9-review" + }, + { + "uri": "/review/hisense-u8n-review" + }, + { + "uri": "/review/house-of-the-dragon-season-2-review" + }, + { + "uri": "/review/industry-season-3-review" + }, + { + "uri": "/review/is-avengers-doomsday-secretly-an-avengers-vs-xmen-movie" + }, + { + "uri": "/review/jackpot-review" + }, + { + "uri": "/review/kaos-review" + }, + { + "uri": "/review/labor-day-2024-the-best-sales-weve-found-today" + }, + { + "uri": "/review/madden-nfl-25-review" + }, + { + "uri": "/review/manny-jacinto-says-making-star-wars-the-acolyte-season-2-is-his-life-goal" + }, + { + "uri": "/review/melgeek-made68-pro-review" + }, + { + "uri": "/review/metaphor-refantazio-is-a-brilliant-evolution-of-persona-and-smt" + }, + { + "uri": "/review/monster-jam-showdown-review" + }, + { + "uri": "/review/nintendo-suggests-breath-of-the-wild-and-tears-of-the-kingdom-are-part-of-a-new-zelda-timeline" + }, + { + "uri": "/review/one-year-later-larian-reflects-on-baldurs-gate-3s-success-future-plans-and-canceling-dlc-ever-since-weve-felt-better" + }, + { + "uri": "/review/oneplus-pad-2-review" + }, + { + "uri": "/review/only-murders-in-the-building-season-4-episodes-17-review" + }, + { + "uri": "/review/pachinko-season-2-review" + }, + { + "uri": "/review/reddit-is-currently-down-platform-says-issue-is-being-investigated-update" + }, + { + "uri": "/review/rick-and-morty-the-anime-episodes-12-review" + }, + { + "uri": "/review/rick-and-morty-the-anime-review-episodes-12-review" + }, + { + "uri": "/review/rocksteady-reportedly-lays-off-staff-following-suicide-squad-kill-the-justice-league-flop" + }, + { + "uri": "/review/samsung-galaxy-z-fold-6-review" + }, + { + "uri": "/review/save-on-hit-manga-box-sets-at-amazon-this-weekend-for-labor-day" + }, + { + "uri": "/review/save-on-mario-switch-games-at-walmart-for-labor-day-2024" + }, + { + "uri": "/review/scuf-nomad-mobile-controller-review" + }, + { + "uri": "/review/see-pinocchio-completely-reimagined-by-hellboy-creator-mike-mignola" + }, + { + "uri": "/review/skin-police-preview-the-hyperviolent-scifi-dystopia-from-oni-press" + }, + { + "uri": "/review/skincare-review" + }, + { + "uri": "/review/slay-the-spire-the-board-game-review" + }, + { + "uri": "/review/squirrel-with-a-gun-review" + }, + { + "uri": "/review/star-wars-outlaws-review" + }, + { + "uri": "/review/steamworld-heist-2-review" + }, + { + "uri": "/review/stormgate-early-access-review" + }, + { + "uri": "/review/tactical-breach-wizards-review" + }, + { + "uri": "/review/tales-of-the-teenage-mutant-ninja-turtles-episodes-16-review" + }, + { + "uri": "/review/terminator-zero-review" + }, + { + "uri": "/review/the-10-best-bluetooth-record-players-for-2024" + }, + { + "uri": "/review/the-best-apple-watch-deals-right-now-september-2024" + }, + { + "uri": "/review/the-best-nintendo-game-youve-never-heard-of-and-its-2024-sequel" + }, + { + "uri": "/review/the-crow-review" + }, + { + "uri": "/review/the-deliverance-review" + }, + { + "uri": "/review/the-instigators-review" + }, + { + "uri": "/review/the-killer-review" + }, + { + "uri": "/review/the-lg-g4-is-as-close-to-perfect-as-a-tv-can-be-in-2024" + }, + { + "uri": "/review/the-lord-of-the-rings-the-rings-of-power-season-2-premiere-review" + }, + { + "uri": "/review/the-lord-of-the-rings-the-rings-of-power-season-2-review" + }, + { + "uri": "/review/the-scott-pilgrim-20th-anniversary-hardcover-box-set-gets-a-big-discount" + }, + { + "uri": "/review/the-secretlab-black-friday-in-august-sale-kicks-off-up-to-100-off-gaming-chairs-and-desks" + }, + { + "uri": "/review/the-sims-4-review-2024" + }, + { + "uri": "/review/the-umbrella-academy-season-4-review" + }, + { + "uri": "/review/the-union-review" + }, + { + "uri": "/review/the-victrix-gambit-prime-is-a-prostyle-controller-worth-considering" + }, + { + "uri": "/review/until-dawn-remake-developer-ballistic-moon-lays-off-several-staff" + }, + { + "uri": "/review/visions-of-mana-review" + }, + { + "uri": "/review/voice-acting-legend-jennifer-hale-on-video-game-strikes-ai-is-coming-for-all-of-us" + }, + { + "uri": "/review/volgarr-the-viking-2-review" + }, + { + "uri": "/review/wwe-fans-mourn-sid-vicious-after-wrestling-legend-dies-at-63-following-battle-with-cancer" + }, + { + "uri": "/review/watchmen-chapter-1-review" + }, + { + "uri": "/review/we-build-lego-great-deku-tree-the-first-legend-of-zelda-set-in-lego-history" + }, + { + "uri": "/review/wolfs-review" + }, + { + "uri": "/tech/amazon-games-boss-says-label-will-put-games-on-nintendo-switch-2-praises-switch-as-a-great-device" + }, + { + "uri": "/tech/best-240hz-gaming-monitor-2024" + }, + { + "uri": "/tech/best-gaming-monitors-for-2024" + }, + { + "uri": "/tech/best-racing-wheels-2024-top-steering-wheels-for-gaming" + }, + { + "uri": "/tech/gaming-headsets-dont-get-much-better-than-the-beyerdynamic-mmx-300-pro" + }, + { + "uri": "/tech/samsung-galaxy-z-fold-6-review" + }, + { + "uri": "/tech/the-asus-rog-tessen-is-a-peak-for-mobile-gaming-controllers" + }, + { + "uri": "/tech/the-best-apple-watch-deals-right-now-august-2024" + }, + { + "uri": "/tech/the-best-budget-gaming-monitors-for-all-gamer-types" + }, + { + "uri": "/tech/the-best-ipad-deals-today-august-2024" + }, + { + "uri": "/tech/the-lg-g4-is-as-close-to-perfect-as-a-tv-can-be-in-2024" + } + ] + } + ] +} \ No newline at end of file diff --git a/asset/ads/ads_prod.json b/asset/ads/ads_prod.json new file mode 100644 index 0000000..3ba24ce --- /dev/null +++ b/asset/ads/ads_prod.json @@ -0,0 +1,22 @@ +{ + "accounts": { + "test": "ca-pub-2821871715805907", + "prod": "ca-pub-2821871715805907" + }, + "webs": [ + { + "host": "https://moads-prod.allapp.link", + "uris": [ + { + "uri": "/business/new-steam-tweaks-let-devs-highlight-related-games-and-dlc-on-store-pages/" + }, + { + "uri": "/programming/book-excerpt-game-ai-uncovered-volume-one/" + }, + { + "uri": "/programming/the-rise-of-generative-ai-in-revolutionizing-game-development/" + } + ] + } + ] +} \ No newline at end of file diff --git a/asset/campaign/fission_lang.json b/asset/campaign/fission_lang.json new file mode 100644 index 0000000..d0aee86 --- /dev/null +++ b/asset/campaign/fission_lang.json @@ -0,0 +1,4794 @@ +{ + "points_use": { + "parts": [ + { + "key": "points_use:ok", + "value": "points_use_ok", + "desc": "积分消耗-成功" + }, + { + "key": "points_use:lack", + "value": "points_use_lack", + "desc": "积分消耗-不足" + }, + { + "key": "points_use:close", + "value": "points_use_close", + "desc": "积分消耗-关闭" + }, + { + "key": "points_use:day_limit", + "value": "points_use_day_limit", + "desc": "积分消耗-每日上限" + }, + { + "key": "points_use:limit", + "value": "points_use_limit", + "desc": "积分消耗-上限" + }, + { + "key": "points_use:dice", + "value": "points_use_dice", + "desc": "积分消耗-消耗获得骰子" + }, + { + "key": "points_use:lottery", + "value": "points_use_lottery", + "desc": "积分消耗-消耗获得抽奖机会" + }, + { + "key": "points_use:one_dice", + "value": "dice", + "desc": "积分消耗-骰子" + }, + { + "key": "points_use:one_times", + "value": "one_spin", + "desc": "积分消耗-次数" + } + ], + "desc": "积分消耗" + }, + "rule": { + "parts": [ + { + "key": "home:rule", + "value": "activity_rules", + "desc": "首页-活动规则" + }, + { + "key": "rule:end", + "value": "end_time", + "desc": "规则-活动结束时间" + }, + { + "key": "rule:start", + "value": "start_time", + "desc": "规则-活动开始时间" + }, + { + "key": "rule:time", + "value": "activity_time", + "desc": "规则-活动时间" + }, + { + "key": "rule:title", + "value": "activity_rules", + "desc": "规则-标题" + } + ], + "desc": "活动规则按钮弹窗" + }, + "invite_record": { + "parts": [ + { + "key": "invite:title", + "value": "invite_record", + "desc": "邀请记录-标题" + }, + { + "key": "invite:user_id", + "value": "user_id", + "desc": "邀请记录-user id" + }, + { + "key": "invite:time", + "value": "invite_time", + "desc": "邀请记录-邀请时间" + }, + { + "key": "invite:no_record", + "value": "invite_no_record", + "desc": "邀请记录-没有数据文案" + }, + { + "key": "invite:help_success", + "value": "help_success", + "desc": "邀请记录-助力成功文案" + }, + { + "key": "invite:help_fail", + "value": "help_fail", + "desc": "邀请记录-助力失败文案" + }, + { + "key": "invite:help_wait", + "value": "help_wait", + "desc": "邀请记录-助力中文案" + } + ], + "desc": "邀请记录弹窗" + }, + "my_task": { + "parts": [ + { + "key": "target_rule:title", + "value": "my_task", + "desc": "我的任务-标题" + }, + { + "key": "target_rule:cond_all", + "value": "install_and_finish_all_cond", + "desc": "达标规则-满足所有条件文案" + }, + { + "key": "target_rule:cond_one", + "value": "install_and_finish_one_cond", + "desc": "达标规则-满足任一条件文案" + }, + { + "key": "target_rule:status_ok", + "value": "completed", + "desc": "达标规则-已达标状态" + }, + { + "key": "target_rule:status_wait", + "value": "undone", + "desc": "达标规则-未达标状态" + }, + { + "key": "target_rule:task_0", + "value": "task_1", + "desc": "达标规则-任务一文案" + }, + { + "key": "target_rule:task_1", + "value": "task_2", + "desc": "达标规则-任务二文案" + }, + { + "key": "target_rule:task_2", + "value": "task_3", + "desc": "达标规则-任务三文案" + }, + { + "key": "target_rule:cond_0", + "value": "target_cond_1", + "desc": "达标规则-达标条件一文案" + }, + { + "key": "target_rule:cond_1", + "value": "target_cond_2", + "desc": "达标规则-达标条件二文案" + }, + { + "key": "target_rule:cond_2", + "value": "target_cond_3", + "desc": "达标规则-达标条件三文案" + }, + { + "key": "target_rule:fans_record", + "value": "friend_record", + "desc": "达标规则-好友记录" + }, + { + "key": "target_rule:fans_no_record", + "value": "no_record", + "desc": "达标规则-暂无好友记录" + }, + { + "key": "target_rule:task_index", + "value": "task_index", + "desc": "达标规则-任务文案" + } + ], + "desc": "邀请记录弹窗" + }, + "lottery_target_rule": { + "parts": [ + { + "key": "target_rule:finish_all", + "value": "all_tasks_to_draw", + "desc": "达标规则-完成所有任务获得抽奖次数文案" + }, + { + "key": "target_rule:finish_one", + "value": "one_tasks_to_draw", + "desc": "达标规则-完成一个任务获得抽奖次数文案" + } + ], + "desc": "抽奖类的事件驱动的文案" + }, + "invite_reward_rule": { + "parts": [ + { + "key": "home:reward_rule", + "value": "bonus_rules", + "desc": "首页-奖励规则" + }, + { + "key": "reward_rule:cond", + "value": "reward_cond", + "desc": "奖品规则-奖励条件" + }, + { + "key": "reward_rule:connect", + "value": "target_receive_prizes", + "desc": "奖品规则-发奖联系方式" + }, + { + "key": "reward_rule:connect_copy", + "value": "copy", + "desc": "奖品规则-发奖联系方式复制" + }, + { + "key": "reward_rule:reward", + "value": "bonus_content", + "desc": "奖品规则-奖励" + }, + { + "key": "reward_rule:normal", + "value": "regular_rewards", + "desc": "奖品规则-常规奖励表头文案" + }, + { + "key": "reward_rule:extra", + "value": "extra_rewards", + "desc": "奖品规则-额外奖励表头文案" + }, + { + "key": "reward_rule:num", + "value": "quantity", + "desc": "奖品规则-可获得奖品数量" + }, + { + "key": "reward_rule:prize", + "value": "prize", + "desc": "奖品规则-奖品名称表头" + }, + { + "key": "reward_rule:cond_normal", + "value": "download_for_each_friend", + "desc": "奖品规则-常规奖励条件文案" + }, + { + "key": "reward_rule:cond_extra", + "value": "accumulate_friend_downloads", + "desc": "奖品规则-额外奖励条件文案" + }, + { + "key": "reward_rule:max_invite", + "value": "max_invite_friend", + "desc": "奖品规则-最多可邀请好友限制文案" + }, + { + "key": "reward_rule:cond_normal_reg", + "value": "register_for_each_friend", + "desc": "奖品规则-常规奖励条件注册类型文案" + }, + { + "key": "reward_rule:cond_extra_reg", + "value": "accumulate_friend_register", + "desc": "奖品规则-额外奖励条件注册类型文案" + } + ], + "desc": "邀请类奖品规则弹窗" + }, + "tip": { + "parts": [ + { + "key": "tip:service_err", + "value": "operation_failed", + "desc": "提示-服务出错" + }, + { + "key": "home:copy_success", + "value": "copy_success", + "desc": "首页-复制链接成功" + }, + { + "key": "tip:no_reward_get", + "value": "no_reward_get", + "desc": "提示-复制链接成功" + }, + { + "key": "tip:reward_lack", + "value": "reward_lack_contact_customer_service", + "desc": "提示-奖品没有库存提示" + }, + { + "key": "tip:click_contact_tip", + "value": "click_contact_tip", + "desc": "提示-联系客服提示文案" + }, + { + "key": "tip:select", + "value": "please_choose", + "desc": "提示-请选择文案" + }, + { + "key": "tip:draw_none", + "value": "draws_none", + "desc": "提示-抽奖次数不足" + }, + { + "key": "tip:task_done", + "value": "task_done", + "desc": "提示-任务已完成" + }, + { + "key": "tip:task_none", + "value": "task_none", + "desc": "提示-没有任务可完成" + }, + { + "key": "tip:success", + "value": "success", + "desc": "提示-成功文案" + }, + { + "key": "tip:task_none", + "value": "task_none", + "desc": "提示-没有任务可完成" + }, + { + "key": "tip:insufficient_points", + "value": "insufficient_points", + "desc": "提示-积分不足" + } + ], + "desc": "公用提示" + }, + "common": { + "parts": [ + { + "key": "default:share_text", + "value": "invite_share_text", + "desc": "默认-分享文案" + }, + { + "key": "home:end_tip", + "value": "activity_end_text", + "desc": "首页-活动结束文案" + }, + { + "key": "tip:please_login", + "value": "please_login", + "desc": "提示-请登陆" + }, + { + "key": "btn:copy", + "value": "copy", + "desc": "按钮-复制文案" + }, + { + "key": "btn:buy_more", + "value": "buy_more", + "desc": "按钮-购买更多" + }, + { + "key": "home:connect_get", + "value": "contact_customer_service", + "desc": "奖品-联系客服文案" + }, + { + "key": "common:congratulation", + "value": "congratulation", + "desc": "通用-恭喜你文案" + }, + { + "key": "common:reward_to_use", + "value": "go_to", + "desc": "通用-奖品去使用文案" + }, + { + "key": "common:contact", + "value": "contact", + "desc": "通用-联系客服简短文案" + }, + { + "key": "common:contact_information", + "value": "contact_information", + "desc": "通用-联系方式文案" + }, + { + "key": "common:to_use", + "value": "use", + "desc": "通用-去使用按钮文案" + }, + { + "key": "common:get_and_use", + "value": "get_and_use", + "desc": "通用-领取并使用按钮文案" + }, + { + "key": "common:sure", + "value": "sure", + "desc": "通用-确认按钮文案" + }, + { + "key": "common:cancel", + "value": "cancel", + "desc": "通用-取消按钮文案" + }, + { + "key": "record:no_record", + "value": "no_record", + "desc": "通用-没有记录文案" + }, + { + "key": "tip:tip", + "value": "tip", + "desc": "提示-提示文案" + }, + { + "key": "common:expired_in", + "value": "expires_in", + "desc": "通用-过期时间" + }, + { + "key": "common:tomorrow", + "value": "tomorrow", + "desc": "通用-明天" + }, + { + "key": "common:do_task", + "value": "do_task", + "desc": "通用-做任务" + }, + { + "key": "common:in_progress", + "value": "in_progress", + "desc": "通用-进行中" + }, + { + "key": "common:all", + "value": "all", + "desc": "通用-全部" + }, + { + "key": "common:confirm", + "value": "confirm_", + "desc": "通用-confirm确认" + } + ], + "desc": "公用文案" + }, + "form": { + "parts": [ + { + "key": "form:title", + "value": "fill_in", + "desc": "表单组件-填写表单标题" + }, + { + "key": "form:submit", + "value": "submit", + "desc": "表单组件-提交按钮文案" + }, + { + "key": "form:submitted", + "value": "submitted", + "desc": "表单组件-已提交按钮文案" + }, + { + "key": "form:complete_form", + "value": "please_complete_the_form", + "desc": "表单组件-请完善表单文案" + }, + { + "key": "form:submit_success", + "value": "submit_success", + "desc": "表单组件-提交成功文案" + }, + { + "key": "form:submit_repeated", + "value": "please_do_not_submit_repeatedly", + "desc": "表单组件-不能重复提交文案" + }, + { + "key": "form:receive", + "value": "receive", + "desc": "表单组件-奖品为填写表单的领取文案" + } + ], + "desc": "表单组件" + }, + "reward_show": { + "parts": [ + { + "key": "reward_show:view", + "value": "view", + "desc": "奖品展示-查看" + }, + { + "key": "home:copy_success", + "value": "copy_success", + "desc": "奖品展示-复制成功" + }, + { + "key": "reward_show:title", + "value": "prize_details", + "desc": "奖品展示-奖品标题" + }, + { + "key": "reward_show:sold_out", + "value": "sold_out", + "desc": "奖品展示-库存不足" + }, + { + "key": "reward_show:distributing", + "value": "distributing", + "desc": "奖品展示-发放中文案" + }, + { + "key": "reward_show:distribution_failed", + "value": "distribution_failed", + "desc": "奖品展示-发放失败文案" + }, + { + "key": "reward_show:reward_record", + "value": "reward_record", + "desc": "奖品展示-奖励记录" + } + ], + "desc": "查看单个奖品的信息" + }, + "media": { + "parts": [ + { + "key": "btn:close", + "value": "close", + "desc": "按钮-取消" + }, + { + "key": "home:copy_link", + "value": "copy_link", + "desc": "首页-复制链接" + }, + { + "key": "home:share", + "value": "invite_friend_", + "desc": "首页-分享应用" + }, + { + "key": "media:no_install", + "value": "no_install_prompt", + "desc": "社媒-没有安装社媒提示" + }, + { + "key": "media:click_icon", + "value": "click_icon", + "desc": "社媒-点击社媒提示文案" + }, + { + "key": "media:paste_to_media", + "value": "paste_to_media", + "desc": "社媒-粘贴社媒提示文案" + }, + { + "key": "media:win", + "value": "win", + "desc": "社媒-赢提示文案" + }, + { + "key": "media:get_prize", + "value": "get_prize", + "desc": "社媒-获取奖品提示文案" + }, + { + "key": "media:copy_success", + "value": "copy_success_paste_to_media", + "desc": "社媒-复制分享链接成功文案" + }, + { + "key": "media:click_copy_link", + "value": "click_copy_link", + "desc": "社媒-点击复制链接" + }, + { + "key": "media:title", + "value": "invite_friends_to_earn_reward", + "desc": "社媒-邀请好友赢取奖励" + } + ], + "desc": "社媒组件" + }, + "countdown": { + "parts": [ + { + "key": "ct:day", + "value": "day", + "desc": "倒计时-天" + }, + { + "key": "ct:hour", + "value": "hour_f", + "desc": "倒计时-小时" + }, + { + "key": "ct:min", + "value": "minute_f", + "desc": "倒计时-分钟" + }, + { + "key": "ct:sec", + "value": "second_f", + "desc": "倒计时-秒" + }, + { + "key": "ct:title", + "value": "countdown", + "desc": "倒计时-标题" + }, + { + "key": "ct:end", + "value": "end", + "desc": "倒计时-结束标题" + } + ], + "desc": "倒计时组件" + }, + "icon": { + "parts": [ + { + "key": "icon:reward", + "value": "prize_list", + "desc": "图标-奖品列表图标文案" + }, + { + "key": "icon:target", + "value": "my_task", + "desc": "图标-我的任务图标文案" + }, + { + "key": "icon:invite", + "value": "invite_friend", + "desc": "首页-邀请好友图标文案" + }, + { + "key": "icon:invite_record", + "value": "invite_record", + "desc": "首页-邀请记录图标文案" + }, + { + "key": "icon:reward_record", + "value": "reward_record", + "desc": "首页-奖励记录图标文案" + } + ], + "desc": "固定挂件图标组件" + }, + "task": { + "parts": [ + { + "key": "task:title", + "value": "my_task", + "desc": "我的任务-标题" + }, + { + "key": "task:task_0", + "value": "task_1", + "desc": "我的任务-任务一文案" + }, + { + "key": "task:task_1", + "value": "task_2", + "desc": "我的任务-任务二文案" + }, + { + "key": "task:task_2", + "value": "task_3", + "desc": "我的任务-任务三文案" + }, + { + "key": "task:to_complete", + "value": "to_complete", + "desc": "我的任务-去完成按钮文案" + }, + { + "key": "task:to_complete_ok", + "value": "completed", + "desc": "我的任务-已完成按钮文案" + }, + { + "key": "task:completed", + "value": "completed_num", + "desc": "我的任务-已完成次数" + }, + { + "key": "task:completed_times", + "value": "completed_times", + "desc": "我的任务-完成次数" + }, + { + "key": "task:got", + "value": "got_num", + "desc": "我的任务-已获得次数" + }, + { + "key": "task:day_limit", + "value": "refresh_tomorrow", + "desc": "我的任务-明天刷新任务文案" + }, + { + "key": "task:next_week_do", + "value": "next_week_do", + "desc": "我的任务-下周刷新任务文案" + }, + { + "key": "task:week_do_1", + "value": "week_do_1", + "desc": "我的任务-周1刷新任务文案" + }, + { + "key": "task:week_do_2", + "value": "week_do_2", + "desc": "我的任务-周2刷新任务文案" + }, + { + "key": "task:week_do_3", + "value": "week_do_3", + "desc": "我的任务-周3刷新任务文案" + }, + { + "key": "task:week_do_4", + "value": "week_do_4", + "desc": "我的任务-周4刷新任务文案" + }, + { + "key": "task:week_do_5", + "value": "week_do_5", + "desc": "我的任务-周5刷新任务文案" + }, + { + "key": "task:week_do_6", + "value": "week_do_6", + "desc": "我的任务-周6刷新任务文案" + }, + { + "key": "task:week_do_7", + "value": "week_do_7", + "desc": "我的任务-周天刷新任务文案" + }, + { + "key": "task:install_title", + "value": "invite_friend_download", + "desc": "我的任务-安装事件任务名称" + }, + { + "key": "task:register_title", + "value": "invite_friend_register", + "desc": "我的任务-注册事件任务名称" + }, + { + "key": "task:help_task_title", + "value": "help_task", + "desc": "我的任务-助力任务标题" + }, + { + "key": "task:help_task_one", + "value": "finish_one_task_help_parent", + "desc": "我的任务-助力任务任意助力" + }, + { + "key": "task:help_task_all", + "value": "finish_all_task_help_parent", + "desc": "我的任务-助力任务所有助力" + }, + { + "key": "task:common_task_cond_one", + "value": "task_cond_one", + "desc": "我的任务-通用完成任意任务文案" + }, + { + "key": "task:common_task_cond_all", + "value": "task_cond_all", + "desc": "我的任务-通用完成所有任务文案" + }, + { + "key": "task:reward_task_title", + "value": "complete_tasks_to_earn_reward", + "desc": "我的任务-任务标题说领取奖励的文案" + }, + { + "key": "task:records", + "value": "records", + "desc": "我的任务-任务记录文案" + }, + { + "key": "task:task_list", + "value": "tasks", + "desc": "我的任务-任务列表文案" + }, + { + "key": "task:earn_num", + "value": "finish_task_earn_num", + "desc": "我的任务-完成任务可以获得某种东西的数量(如获得金币数量)" + }, + { + "key": "task:reward_receive", + "value": "receive", + "desc": "我的任务-领取奖励文案" + } + ], + "desc": "任务组件" + }, + "lottery_task": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_lottery_chance", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_lottery_chance_limit", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_lottery_chance", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_lottery_chance_limit", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "lottery_task_finish", + "desc": "我的任务-完成可获得骰子数文案" + }, + { + "key": "task:chance_limit", + "value": "lottery_task_finish_limit", + "desc": "我的任务-完成可获得抽奖机会有限制文案" + }, + { + "key": "task:chance_short", + "value": "lottery_chance_done", + "desc": "我的任务-完成可获得抽奖机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "lottery_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + }, + { + "key": "task:chance_total", + "value": "lottery_task_num", + "desc": "我的任务-已获得的抽奖机会" + }, + { + "key": "task:cond_one", + "value": "lottery_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多抽奖机会" + }, + { + "key": "task:cond_all", + "value": "lottery_task_cond_all", + "desc": "我的任务-完成所有任务可以获得抽奖机会文案" + }, + { + "key": "task:cond_all_limit", + "value": "lottery_task_cond_all_limit", + "desc": "我的任务-完成所有任务可以获得抽奖机会有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_lottery", + "desc": "我的任务-新版抽奖类玩法任务标题" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_lottery", + "desc": "我的任务-新版抽奖类玩法签到文案" + } + ], + "desc": "抽奖类任务条件" + }, + "grow_task": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_grow", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_grow_limit", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_grow", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_grow_limit", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "grow_task_finish", + "desc": "我的任务-完成可获得骰子数文案" + }, + { + "key": "task:chance_limit", + "value": "grow_task_finish_limit", + "desc": "我的任务-完成可获得成长道具有限制文案" + }, + { + "key": "task:chance_short", + "value": "grow_chance_done", + "desc": "我的任务-完成可获得抽奖机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "grow_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + }, + { + "key": "task:cond_one", + "value": "grow_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多成长道具" + }, + { + "key": "task:cond_all", + "value": "grow_task_cond_all", + "desc": "我的任务-完成所有任务可以获得成长道具文案" + }, + { + "key": "task:cond_all_limit", + "value": "grow_task_cond_all_limit", + "desc": "我的任务-完成所有任务可以获得抽奖机会有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_grow", + "desc": "我的任务-新版成长类玩法任务标题" + } + ], + "desc": "成长类任务条件" + }, + "gold_task": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_gold", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_gold_limit", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_gold", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_gold_limit", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "gold_task_finish", + "desc": "我的任务-完成可获得金币数文案" + }, + { + "key": "task:chance_limit", + "value": "gold_task_finish_limit", + "desc": "我的任务-完成可获得金币有限制文案" + }, + { + "key": "task:cond_one", + "value": "gold_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多金币" + }, + { + "key": "task:cond_all", + "value": "gold_task_cond_all", + "desc": "我的任务-完成所有任务可以获得金币文案" + }, + { + "key": "task:cond_all_limit", + "value": "gold_task_cond_all_limit", + "desc": "我的任务-完成所有任务可以获得金币有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_gold", + "desc": "我的任务-新版金币类玩法任务标题" + } + ], + "desc": "金币类任务条件" + }, + "qa_task": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_qa", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_qa_limit", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_qa", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_qa_limit", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "qa_task_finish", + "desc": "我的任务-完成可获得骰子数文案" + }, + { + "key": "task:chance_limit", + "value": "qa_task_finish_limit", + "desc": "我的任务-完成可获得抽奖机会有限制文案" + }, + { + "key": "task:cond_one", + "value": "qa_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多抽奖机会" + }, + { + "key": "task:cond_all", + "value": "qa_task_cond_all", + "desc": "我的任务-完成所有任务可以获得抽奖机会文案" + }, + { + "key": "task:cond_all_limit", + "value": "qa_task_cond_all_limit", + "desc": "我的任务-完成所有任务可以获得抽奖机会有限制文案" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_qa", + "desc": "我的任务-新版答题类玩法签到文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_qa", + "desc": "我的任务-新版答题类玩法任务标题" + }, + { + "key": "task:chance_short", + "value": "qa_chance_done", + "desc": "我的任务-完成可获得抽奖机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "qa_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + } + ], + "desc": "答题类任务条件" + }, + "qa_task_v2": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_qa_v2", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_qa_limit_v2", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_qa_v2", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_qa_limit_v2", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "qa_task_finish_v2", + "desc": "我的任务-完成可获得抽奖机会文案" + }, + { + "key": "task:chance_limit", + "value": "qa_task_finish_limit_v2", + "desc": "我的任务-完成可获得抽奖机会有限制文案" + }, + { + "key": "task:chance_short", + "value": "qa_chance_done", + "desc": "我的任务-完成可获得抽奖机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "qa_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + }, + { + "key": "task:chance_total", + "value": "qa_task_num", + "desc": "我的任务-已获得的抽奖机会" + }, + { + "key": "task:cond_one", + "value": "qa_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多抽奖机会" + }, + { + "key": "task:cond_all", + "value": "qa_task_cond_all_v2", + "desc": "我的任务-完成所有任务可以获得抽奖机会文案" + }, + { + "key": "task:cond_all_limit", + "value": "qa_task_cond_all_limit_v2", + "desc": "我的任务-完成所有任务可以获得抽奖机会有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_qa", + "desc": "我的任务-新版抽奖类玩法任务标题" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_qa_v2", + "desc": "我的任务-新版抽奖类玩法签到文案" + }, + { + "key": "task:reward_task_title", + "value": "complete_tasks_to_earn_reward", + "desc": "我的任务-任务标题说领取奖励的文案" + } + ], + "desc": "抽奖类任务条件(数字有变色)" + }, + "vote_task": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_vote_chance", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_vote_chance_limit", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_vote_chance", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_vote_chance_limit", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "vote_task_finish", + "desc": "我的任务-完成可获得投票机会文案" + }, + { + "key": "task:chance_limit", + "value": "vote_task_finish_limit", + "desc": "我的任务-完成可获得投票机会有限制文案" + }, + { + "key": "task:chance_short", + "value": "vote_chance_done", + "desc": "我的任务-完成可获得投票机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "vote_chance_done_limit", + "desc": "我的任务-完成可获得投票机会有限制断短文案" + }, + { + "key": "task:chance_total", + "value": "vote_task_num", + "desc": "我的任务-已获得的投票机会" + }, + { + "key": "task:cond_one", + "value": "vote_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多投票机会" + }, + { + "key": "task:cond_all", + "value": "vote_task_cond_all", + "desc": "我的任务-完成所有任务可以获得投票机会文案" + }, + { + "key": "task:cond_all_limit", + "value": "vote_task_cond_all_limit", + "desc": "我的任务-完成所有任务可以获得投票机会有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_vote", + "desc": "我的任务-新版投票类玩法任务标题" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_vote", + "desc": "我的任务-新版投票类玩法签到文案" + } + ], + "desc": "投票类任务条件" + }, + "vote_task_v2": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_vote_chance_v2", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_vote_chance_limit_v2", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_vote_chance_v2", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_vote_chance_limit_v2", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "vote_task_finish_v2", + "desc": "我的任务-完成可获得投票机会文案" + }, + { + "key": "task:chance_limit", + "value": "vote_task_finish_limit_v2", + "desc": "我的任务-完成可获得投票机会有限制文案" + }, + { + "key": "task:chance_short", + "value": "vote_chance_done", + "desc": "我的任务-完成可获得投票机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "vote_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + }, + { + "key": "task:chance_total", + "value": "vote_task_num", + "desc": "我的任务-已获得的投票机会" + }, + { + "key": "task:cond_one", + "value": "vote_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多投票机会" + }, + { + "key": "task:cond_all", + "value": "vote_task_cond_all_v2", + "desc": "我的任务-完成所有任务可以获得投票机会文案" + }, + { + "key": "task:cond_all_limit", + "value": "vote_task_cond_all_limit_v2", + "desc": "我的任务-完成所有任务可以获得投票机会有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_vote", + "desc": "我的任务-新版投票类玩法任务标题" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_vote", + "desc": "我的任务-新版投票类玩法签到文案" + }, + { + "key": "task:reward_task_title", + "value": "complete_tasks_to_earn_reward", + "desc": "我的任务-任务标题说领取奖励的文案" + }, + { + "key": "task:raffle_num_add", + "value": "vote_num_add", + "desc": "我的任务-投票机会次数增加" + } + ], + "desc": "投票类任务条件(数字有变色)" + }, + "dice": { + "parts": [ + { + "key": "tip:roll_lack", + "value": "no_more_dice", + "desc": "道具-骰子不足提示文案" + }, + { + "key": "prop:fixed_roll", + "value": "fixed_roll_none", + "desc": "道具-固定骰子安装事件获取文案" + }, + { + "key": "prop:fixed_roll_limit", + "value": "fixed_roll_none_limit", + "desc": "道具-固定骰子有限制安装事件获取文案" + }, + { + "key": "prop:fixed_roll_register", + "value": "fixed_roll_none_register", + "desc": "道具-固定骰子注册事件获取文案" + }, + { + "key": "prop:fixed_roll_register_limit", + "value": "fixed_roll_none_register_limit", + "desc": "道具-固定骰子有限制注册事件获取文案" + }, + { + "key": "task:install", + "value": "invite_friend_install_get_roll_chance", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_roll_chance_limit", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_roll_chance", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_roll_chance_limit", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "dice_task_finish", + "desc": "我的任务-完成可获得骰子数文案" + }, + { + "key": "task:chance_limit", + "value": "dice_task_finish_limit", + "desc": "我的任务-完成可获得骰子数有限制文案" + }, + { + "key": "task:chance_short", + "value": "dice_chance_done", + "desc": "我的任务-完成可获得抽奖机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "dice_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + }, + { + "key": "task:chance_total", + "value": "dice_task_num", + "desc": "我的任务-已获得的骰子数" + }, + { + "key": "task:cond_one", + "value": "dice_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多骰子" + }, + { + "key": "task:cond_all", + "value": "dice_task_cond_all", + "desc": "我的任务-完成所有任务可以获得骰子文案" + }, + { + "key": "task:cond_all_limit", + "value": "dice_task_cond_all_limit", + "desc": "我的任务-完成所有任务可以获得骰子有限制文案" + }, + { + "key": "record:dice_record", + "value": "dice_record", + "desc": "记录-骰子记录标题" + }, + { + "key": "record:roll_dice_number", + "value": "roll_dice_number", + "desc": "记录-骰子点数文案" + }, + { + "key": "record:lucky_dice_number", + "value": "lucky_dice_number", + "desc": "记录-幸运骰点数文案" + }, + { + "key": "record:day_sign", + "value": "day_sign", + "desc": "记录-每日签到文案" + }, + { + "key": "record:finish_all_task", + "value": "finish_all_task", + "desc": "记录-完成所有任务文案" + }, + { + "key": "record:finish_one_task", + "value": "finish_one_task", + "desc": "记录-完成单个任务文案" + }, + { + "key": "record:points_use", + "value": "points_use", + "desc": "记录-消耗积分兑换骰子文案" + }, + { + "key": "record:no_record", + "value": "no_record", + "desc": "记录-没有记录文案" + }, + { + "key": "record:no_more_record", + "value": "no_more_record", + "desc": "记录-没有更多记录文案" + }, + { + "key": "record:finish_friend_register", + "value": "finish_friend_register", + "desc": "记录-注册任务文案" + }, + { + "key": "record:finish_friend_install", + "value": "finish_friend_install", + "desc": "记录-安装任务文案" + }, + { + "key": "record:finish_lucky_dice_task", + "value": "finish_lucky_dice_task", + "desc": "记录-获得幸运骰子文案" + }, + { + "key": "home:click", + "value": "click", + "desc": "记录-点击文案" + }, + { + "key": "home:fragment", + "value": "fragment", + "desc": "记录-碎片文案" + }, + { + "key": "home:craft_fragments", + "value": "craft_fragments", + "desc": "记录-合成碎片文案" + }, + { + "key": "home:collect_tip", + "value": "collect_fragment_compare_reward", + "desc": "记录-收集提示文案" + }, + { + "key": "record:join", + "value": "join_in_campaign", + "desc": "记录-参与活动文案" + }, + { + "key": "record:reward_all", + "value": "all", + "desc": "记录-奖品记录全部文案" + }, + { + "key": "record:reward_fragment", + "value": "fragment", + "desc": "记录-奖品记录全部文案" + }, + { + "key": "record:reward_one", + "value": "prize", + "desc": "记录-奖品记录全部文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_dice", + "desc": "我的任务-新版大富翁任务标题" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_dice", + "desc": "我的任务-大富翁每日签到文案" + } + ], + "desc": "大富翁特有组件" + }, + "cash": { + "parts": [ + { + "key": "home:spin_now", + "value": "spin_now", + "desc": "首页-立即抽奖按钮文案" + }, + { + "key": "windows:spinning", + "value": "spinning", + "desc": "弹层-转盘按钮文案" + }, + { + "key": "home:expires_in", + "value": "expires_in", + "desc": "首页-任务过期时间" + }, + { + "key": "home:my_invite", + "value": "my_invite", + "desc": "首页-我的邀请记录" + }, + { + "key": "home:records", + "value": "records", + "desc": "首页-记录列表" + }, + { + "key": "windows:luck_you", + "value": "luck_you", + "desc": "弹层-非常幸运文案" + }, + { + "key": "windows:extra", + "value": "get_extra_reward", + "desc": "弹层-获得额外奖励" + }, + { + "key": "windows:share_get", + "value": "share_get", + "desc": "弹层-分享后可获得" + }, + { + "key": "windows:upgrade_reward", + "value": "upgrade_reward", + "desc": "弹层-奖励升级" + }, + { + "key": "windows:super_upgrade", + "value": "super_upgrade", + "desc": "弹层-超级升级" + }, + { + "key": "home:pre_spin", + "value": "preparation", + "desc": "首页-转盘中心预备文案" + }, + { + "key": "windows:get_energy", + "value": "invite_get_energy", + "desc": "弹层-完成邀请获得能量文案" + }, + { + "key": "windows:win_left_energy", + "value": "win_left_energy", + "desc": "弹层-还差多少即可赢得奖励文案" + }, + { + "key": "share:get_energy", + "value": "invite_friend_get_energy", + "desc": "分享-邀请好友获得能量文案" + }, + { + "key": "share:up_to", + "value": "up_to", + "desc": "分享-最多升至" + }, + { + "key": "share:progress_spin", + "value": "spin", + "desc": "分享-进度条抽" + }, + { + "key": "share:progress_away", + "value": "away", + "desc": "分享-还差多少个" + }, + { + "key": "windows:congrats", + "value": "congratulation", + "desc": "弹层-恭喜你" + }, + { + "key": "windows:enjoy_credit", + "value": "enjoy_credit", + "desc": "弹层-金额增加文案" + }, + { + "key": "windows:auto_spin", + "value": "auto_spin", + "desc": "弹层-自动抽奖文案" + }, + { + "key": "record:no_invite", + "value": "invite_no_record_reward", + "desc": "记录-没有邀请记录文案" + }, + { + "key": "record:no_record", + "value": "no_record", + "desc": "记录-没有记录文案" + }, + { + "key": "record:spin_reward", + "value": "spin_reward", + "desc": "记录-转转盘标题" + }, + { + "key": "record:share_reward", + "value": "share_reward", + "desc": "记录-分享标题" + }, + { + "key": "record:start_reward", + "value": "start_reward", + "desc": "记录-开箱奖标题" + }, + { + "key": "record:no_more_record", + "value": "no_more_record", + "desc": "记录-没有更多记录文案" + }, + { + "key": "home:left_get_reward", + "value": "left_cash_get_reward", + "desc": "首页-还差多少金额就可以领奖" + }, + { + "key": "windows:share_tip", + "value": "guarantee_to", + "desc": "弹窗-分享奖品文案" + }, + { + "key": "windows:box_banner_top", + "value": "surprise_for_you", + "desc": "弹窗-盒子横幅文案上面一行" + }, + { + "key": "windows:box_banner_bottom", + "value": "get_money_reward", + "desc": "弹窗-盒子横幅文案下面一行" + }, + { + "key": "windows:box_tip", + "value": "select_box", + "desc": "弹窗-盒子提示文案" + }, + { + "key": "windows:box_btn", + "value": "open", + "desc": "弹窗-盒子按钮文案" + }, + { + "key": "windows:card_money_reward", + "value": "money_reward", + "desc": "弹窗-卡片标题" + }, + { + "key": "windows:jackpot", + "value": "jackpot_best_prize", + "desc": "弹窗-大奖文案" + }, + { + "key": "windows:best_prize", + "value": "best_prize", + "desc": "弹窗-最好奖品文案" + }, + { + "key": "windows:almost_reward", + "value": "almost_reward", + "desc": "弹窗-马上可以领取提示文案" + }, + { + "key": "barrage:victory_tip", + "value": "victory_tip", + "desc": "弹幕-声援文案" + }, + { + "key": "barrage:min_won_barrage", + "value": "min_won_barrage", + "desc": "弹幕-分钟前有人赢奖文案" + }, + { + "key": "barrage:won_barrage", + "value": "won_barrage", + "desc": "弹幕-有人赢奖文案" + }, + { + "key": "barrage:closer_to_prize", + "value": "closer_to_prize", + "desc": "弹幕-越来越近文案" + }, + { + "key": "barrage:shine_arrived", + "value": "shine_arrived", + "desc": "弹幕-闪耀提示文案" + }, + { + "key": "windows:pass_on_energy", + "value": "pass_on_energy", + "desc": "弹幕-发放能量文案" + }, + { + "key": "windows:auto_select", + "value": "auto_select", + "desc": "弹层-自动选择文案" + }, + { + "key": "windows:over_people", + "value": "claimed_reward", + "desc": "弹层-超过多少人领奖文案" + }, + { + "key": "windows:last_spin_win", + "value": "last_spin_win", + "desc": "弹层-距离领奖只差1次抽奖文案" + }, + { + "key": "record:rewards", + "value": "rewards", + "desc": "记录-奖励记录文案" + }, + { + "key": "record:energy", + "value": "energy", + "desc": "记录-能力记录文案" + }, + { + "key": "record:token", + "value": "token", + "desc": "记录-金额记录文案" + }, + { + "key": "record:help_success", + "value": "help_success", + "desc": "记录-助力成功文案" + }, + { + "key": "record:help_fail", + "value": "help_fail", + "desc": "记录-助力失败文案" + }, + { + "key": "record:help_wait", + "value": "help_wait", + "desc": "记录-助力中文案" + }, + { + "key": "reward:your_reward", + "value": "your_reward", + "desc": "奖品-你的奖励" + }, + { + "key": "reward:go_to", + "value": "go_to", + "desc": "奖品-前往使用" + }, + { + "key": "reward:click_contact", + "value": "click_contact", + "desc": "奖品-点击联系客服" + }, + { + "key": "reward:reward_in_your_account", + "value": "reward_send_your_account", + "desc": "奖品-奖品已发放到您的账户中" + }, + { + "key": "reward:click_contact_tip", + "value": "click_contact_tip", + "desc": "奖品-点击联系客服提示" + }, + { + "key": "reward:see_reward", + "value": "see_reward", + "desc": "奖品-查看奖品" + }, + { + "key": "reward:prize_gone", + "value": "prize_gone", + "desc": "奖品-奖品发完了" + }, + { + "key": "reward:play_again", + "value": "play_again", + "desc": "奖品-再玩一次按钮文案" + } + ], + "desc": "现金抽奖特有组件" + }, + "ads_wheel": { + "parts": [ + { + "key": "home:wheel_title", + "value": "you_got_the_best_prize", + "desc": "首页-活动转盘标题" + }, + { + "key": "home:bottom_tip", + "value": "get_reward_after_play", + "desc": "首页-转盘下面的提示" + }, + { + "key": "home:top_tip", + "value": "play_and_win", + "desc": "首页-转盘上面的提示" + }, + { + "key": "home:play", + "value": "play", + "desc": "首页-转盘玩按钮" + }, + { + "key": "reward:title", + "value": "congratulation", + "desc": "奖品-获得弹窗标题" + }, + { + "key": "reward:top_tip", + "value": "won_free_gift", + "desc": "奖品-奖品上方文案提示" + }, + { + "key": "reward:text", + "value": "congratulation", + "desc": "奖品-奖品标题" + }, + { + "key": "reward:bottom_tip", + "value": "download_app_get_gift", + "desc": "奖品-奖品下方文案提示" + }, + { + "key": "reward:download", + "value": "download", + "desc": "奖品-下载app按钮" + }, + { + "key": "reward:window_title", + "value": "jackpot", + "desc": "奖品-奖品框内标题" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + } + ], + "desc": "广告转盘ads_wheel模板语言包" + }, + "ads_wheel_pps": { + "parts": [ + { + "key": "home:spin_now", + "value": "spin_now", + "desc": "首页-未点击前开始按钮文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + }, + { + "key": "home:spinning", + "value": "spinning", + "desc": "首页-点击后开始按钮文案" + }, + { + "key": "home:title", + "value": "unlock_your_luck", + "desc": "首页-转盘标题" + }, + { + "key": "home:title_bottom", + "value": "spin_and_win", + "desc": "首页-标题下面文案" + }, + { + "key": "reward:title", + "value": "congratulation", + "desc": "奖品-获得弹窗标题" + }, + { + "key": "reward:bottom_tip", + "value": "download_app_get_gift", + "desc": "奖品-奖品下方文案提示" + }, + { + "key": "reward:yours_reward", + "value": "your_reward", + "desc": "奖品-你的奖励" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + } + ], + "desc": "广告转盘ads_wheel_pps模板语言包" + }, + "ads_wheel_half": { + "parts": [ + { + "key": "home:wheel_title", + "value": "you_got_the_best_prize", + "desc": "首页-活动转盘标题" + }, + { + "key": "home:bottom_tip", + "value": "get_reward_after_play", + "desc": "首页-转盘下面的提示" + }, + { + "key": "home:top_tip", + "value": "play_to_win_prize", + "desc": "首页-转盘上面的提示" + }, + { + "key": "reward:bottom_tip", + "value": "download_app_get_gift", + "desc": "奖品-奖品下方文案提示" + }, + { + "key": "reward:window_title", + "value": "jackpot", + "desc": "奖品-奖品框内标题" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + } + ], + "desc": "广告转盘ads_wheel_half模板语言包" + }, + "ads_wheel_print": { + "parts": [ + { + "key": "home:title", + "value": "unlock_your_luck", + "desc": "首页-转盘标题" + }, + { + "key": "home:title_bottom", + "value": "spin_and_win", + "desc": "首页-标题下面文案" + }, + { + "key": "home:spin", + "value": "spin", + "desc": "首页-抽奖按钮文案" + }, + { + "key": "reward:title", + "value": "best_prize_!", + "desc": "奖品-奖品下方文案提示" + }, + { + "key": "reward:reward_top", + "value": "download_to_get", + "desc": "奖品-奖品上面的文案" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + }, + { + "key": "reward:ends_in", + "value": "ends_in", + "desc": "奖品-结束于文案" + } + ], + "desc": "广告转盘ads_wheel_print模板语言包" + }, + "ads_wheel_space": { + "parts": [ + { + "key": "home:title", + "value": "try_your_luck_first_upper", + "desc": "首页-转盘标题" + }, + { + "key": "home:play_btn", + "value": "spin_now", + "desc": "首页-玩的按钮文案" + }, + { + "key": "home:jackpot", + "value": "jackpot", + "desc": "首页-抽奖按钮文案" + }, + { + "key": "reward:reward_top", + "value": "download_to_get", + "desc": "奖品-奖品上面的文案" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + }, + { + "key": "home:spinning", + "value": "spinning", + "desc": "首页-点击后开始按钮文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + } + ], + "desc": "广告转盘ads_wheel_space模板语言包" + }, + "ads_wheel_purple": { + "parts": [ + { + "key": "home:title", + "value": "welcome_gifts", + "desc": "首页-转盘标题" + }, + { + "key": "home:play_btn", + "value": "spin_to_win", + "desc": "首页-玩的按钮文案" + }, + { + "key": "home:jackpot", + "value": "jackpot", + "desc": "首页-抽奖按钮文案" + }, + { + "key": "reward:reward_top", + "value": "download_app_get_gift", + "desc": "奖品-奖品上面的文案" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + }, + { + "key": "home:spinning", + "value": "spinning", + "desc": "首页-点击后开始按钮文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + } + ], + "desc": "广告转盘ads_wheel_purple模板语言包" + }, + "blind": { + "parts": [ + { + "key": "home:chance", + "value": "raffle_chances", + "desc": "首页-抽奖剩余机会" + }, + { + "key": "window:title", + "value": "wow_you_got", + "desc": "弹窗-恭喜你获奖文案" + } + ] + }, + "slot": { + "parts": [ + { + "key": "home:chance", + "value": "raffle_chances", + "desc": "首页-抽奖剩余机会" + }, + { + "key": "window:title", + "value": "wow_you_got", + "desc": "弹窗-恭喜你获奖文案" + } + ] + }, + "grid": { + "parts": [ + { + "key": "home:chance", + "value": "raffle_chances", + "desc": "首页-抽奖剩余机会" + }, + { + "key": "window:title", + "value": "wow_you_got", + "desc": "弹窗-恭喜你获奖文案" + } + ] + }, + "grid_palm": { + "parts": [ + { + "key": "home:remain_chance", + "value": "remaining_raffle_chances", + "desc": "首页-剩余抽奖次数" + }, + { + "key": "home:chance", + "value": "raffle_chances", + "desc": "首页-抽奖剩余机会" + }, + { + "key": "home:task_title", + "value": "my_task", + "desc": "首页-外线任务标题" + }, + { + "key": "home:chance_prefix", + "value": "raffle_chances", + "desc": "首页-任务外显抽奖次数" + }, + { + "key": "home:completed_times", + "value": "completed_times", + "desc": "首页-任务外显完成次数" + }, + { + "key": "window:lottery_again", + "value": "lottery_again", + "desc": "弹窗-再抽一次按钮文案" + }, + { + "key": "window:use", + "value": "use_immediately", + "desc": "弹窗-立即使用按钮文案" + }, + { + "key": "window:title", + "value": "wow_you_got", + "desc": "弹窗-恭喜你获奖文案" + }, + { + "key": "window:title_fail", + "value": "next_time", + "desc": "弹窗-没中奖文案" + } + ], + "desc": "九宫格grid_palm模板组语言包" + }, + "ads_grid_bluestar": { + "parts": [ + { + "key": "home:title", + "value": "easy_mode", + "desc": "首页-格子盘标题文案" + }, + { + "key": "home:prize_left", + "value": "prize", + "desc": "首页-剩余奖品文案" + }, + { + "key": "home:play", + "value": "play", + "desc": "首页-转盘玩按钮" + }, + { + "key": "reward:title", + "value": "congratulation", + "desc": "奖品-获得弹窗标题" + }, + { + "key": "reward:bottom_tip", + "value": "download_app_get_gift", + "desc": "奖品-奖品下方文案提示" + }, + { + "key": "reward:download", + "value": "download", + "desc": "奖品-下载app按钮" + }, + { + "key": "reward:window_title", + "value": "jackpot", + "desc": "奖品-奖品框内标题" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + }, + { + "key": "barrage:min", + "value": "mins_ago", + "desc": "弹幕-分钟前文案" + }, + { + "key": "barrage:reward_text", + "value": "barrage_got_reward", + "desc": "弹幕-获得奖品文案" + } + ], + "desc": "广告转盘ads_wheel模板语言包" + }, + "flip": { + "parts": [ + { + "key": "home:chance_num", + "value": "raffle_num", + "desc": "首页-抽奖次数" + }, + { + "key": "home:chance", + "value": "raffle_chances", + "desc": "首页-抽奖机会" + }, + { + "key": "window:title", + "value": "won_get", + "desc": "弹窗-恭喜你获奖文案" + }, + { + "key": "window:title_fail", + "value": "next_time", + "desc": "弹窗-没中奖文案" + }, + { + "key": "window:open", + "value": "open", + "desc": "弹窗-打开按钮文案" + }, + { + "key": "window:chance_lack", + "value": "raffle_chances_lack", + "desc": "弹窗-机会不足文案" + }, + { + "key": "window:chance_lack_tip", + "value": "raffle_chances_lack_tip", + "desc": "弹窗-机会不足提示文案" + }, + { + "key": "home:get_more_chance", + "value": "get_more_chance", + "desc": "首页-获得更多机会文案" + }, + { + "key": "home:win_record", + "value": "winning_record", + "desc": "首页-中奖记录文案" + }, + { + "key": "home:flip", + "value": "flip_now", + "desc": "首页-立即翻牌" + }, + { + "key": "home:select_card", + "value": "select_card", + "desc": "首页-选取卡牌" + }, + { + "key": "home:to_flip", + "value": "to_flip", + "desc": "首页-去抽卡" + }, + { + "key": "barrage:get_reward", + "value": "has_got_style", + "desc": "弹幕-获得奖品" + } + ], + "desc": "幸运翻牌flip模板语言包" + }, + "ads_wheel_orange": { + "parts": [ + { + "key": "home:spin", + "value": "spin", + "desc": "首页-抽奖按钮文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + }, + { + "key": "reward:reward_top", + "value": "download_to_get", + "desc": "奖品-奖品上面的文案" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + } + ], + "desc": "广告转盘ads_wheel_print模板语言包" + }, + "win": { + "parts": [ + { + "key": "home:finish_newcomer_task", + "value": "finish_newcomer_task", + "desc": "首页-完成任务获得奖品文案" + }, + { + "key": "home:done_newcomer_task", + "value": "done_newcomer_task", + "desc": "首页-完成新人任务奖按钮文案" + }, + { + "key": "task:to_complete", + "value": "to_complete", + "desc": "我的任务-去完成按钮文案" + } + ], + "desc": "一起赢奖励win模板语言包" + }, + "chop": { + "parts": [ + { + "key": "get_reward:reselect", + "value": "continue_free_get", + "desc": "领取奖品-继续免费领" + }, + { + "key": "help_rule:title", + "value": "activity_rules", + "desc": "助力规则-安装助力文案" + }, + { + "key": "help_rule:register_text", + "value": "register_help_text", + "desc": "助力规则-注册助力文案" + }, + { + "key": "help_rule:install_text", + "value": "install_help_text", + "desc": "助力规则-安装助力文案" + }, + { + "key": "help_rule:open_text", + "value": "open_help_text", + "desc": "助力规则-打开助力文案" + }, + { + "key": "help_rule:click_text", + "value": "click_help_text", + "desc": "助力规则-点击助力文案" + }, + { + "key": "select:title", + "value": "a_gift_to_you", + "desc": "选择页-标题" + }, + { + "key": "select:button", + "value": "choose_it", + "desc": "选择页-提交按钮" + }, + { + "key": "select:nice_choice", + "value": "nice_choice", + "desc": "选择页-奖品选择成功后标题" + }, + { + "key": "barrage:help_install", + "value": "help_install", + "desc": "弹幕-安装助力文案" + }, + { + "key": "barrage:help_register", + "value": "help_register", + "desc": "弹幕-注册助力文案" + }, + { + "key": "barrage:help_open", + "value": "help_open", + "desc": "弹幕-拉日活助力文案" + }, + { + "key": "barrage:help_click", + "value": "help_click", + "desc": "弹幕-点击助力文案" + }, + { + "key": "barrage:get_reward", + "value": "finish_help_get_reward", + "desc": "弹幕-完成助力获得奖品" + }, + { + "key": "home:left_percent", + "value": "left_percent_get_reward", + "desc": "主页-还差多少进度获取奖品文案" + }, + { + "key": "home:invite_friend", + "value": "invite", + "desc": "主页-获取助力值文案" + }, + { + "key": "window:help_title", + "value": "won_get", + "desc": "弹窗-恭喜获得助力弹窗的标题文案" + }, + { + "key": "window:lucky_title", + "value": "lucky", + "desc": "弹窗-恭喜获得初始进度标题" + }, + { + "key": "window:lucky_text", + "value": "percent_progress_for_you", + "desc": "弹窗-恭喜获得初始进度文案" + }, + { + "key": "window:get_reward_title", + "value": "won_get", + "desc": "弹窗-恭喜获得奖品的标题文案" + }, + { + "key": "window:ensure_select", + "value": "ensure_select_reward", + "desc": "弹窗-确认选择文案" + }, + { + "key": "record:help_record", + "value": "invite_record", + "desc": "记录-助力记录" + }, + { + "key": "record:no_record", + "value": "no_record", + "desc": "记录-没有助力记录文案" + }, + { + "key": "record:no_more_record", + "value": "no_more_record", + "desc": "记录-没有更多记录文案" + }, + { + "key": "record:help_click", + "value": "click_help_record", + "desc": "助力记录-点击助力文案" + }, + { + "key": "record:help_open", + "value": "open_help_record", + "desc": "助力记录-打开助力文案" + }, + { + "key": "record:help_install", + "value": "install_help_record", + "desc": "助力记录-安装助力文案" + }, + { + "key": "record:help_register", + "value": "register_help_record", + "desc": "助力记录-注册助力文案" + }, + { + "key": "home:see_reward", + "value": "see_reward", + "desc": "首页-获得奖品后,邀请好友按钮提示的文案" + }, + { + "key": "home:reward_obtained", + "value": "reward_obtained", + "desc": "主页-获得奖品后,还差进度变更的文案" + } + ], + "desc": "砍一刀chop模板语言包" + }, + "grow": { + "parts": [ + { + "key": "home:die", + "value": "timeout_tree_die", + "desc": "首页-死亡文案" + }, + { + "key": "home:regrow", + "value": "plant_new_tree", + "desc": "首页-重新种一棵文案" + }, + { + "key": "home:revive", + "value": "tree_revive", + "desc": "首页-复活小树文案" + } + ], + "desc": "养成类grow模板语言包" + }, + "grow_dog": { + "parts": [ + { + "key": "home:die", + "value": "timeout_dog_go", + "desc": "首页-死亡文案" + }, + { + "key": "home:regrow", + "value": "plant_new_dog", + "desc": "首页-重新领养" + }, + { + "key": "home:revive", + "value": "rescue_puppy", + "desc": "首页-挽回小狗" + } + ], + "desc": "养成类grow模板语言包" + }, + "ads_flip": { + "parts": [ + { + "key": "home:select_card", + "value": "select_card", + "desc": "首页-选取卡牌" + }, + { + "key": "home:open", + "value": "open", + "desc": "首页-打开按钮文案" + }, + { + "key": "home:auto_spin", + "value": "auto_spin", + "desc": "首页-自动抽奖提示文案" + }, + { + "key": "reward:bottom_tip", + "value": "download_app_get_gift", + "desc": "奖品-奖品下方文案提示" + }, + { + "key": "reward:title", + "value": "congratulation", + "desc": "奖品-获得弹窗标题" + }, + { + "key": "reward:receive", + "value": "receive", + "desc": "奖品-领取按钮" + }, + { + "key": "reward:ineligible", + "value": "install_ineligible", + "desc": "奖品-非新安装用户无法领奖" + }, + { + "key": "reward:claimed", + "value": "claimed", + "desc": "奖品-已经领取奖品" + }, + { + "key": "reward:no_prizes", + "value": "no_prizes_to_claim", + "desc": "奖品-没有查询到奖品文案" + } + ], + "desc": "广告翻牌ads_flip模板语言包" + }, + "keep_dog": { + "parts": [ + { + "key": "select:free_gift", + "value": "raise_pet_to_get_free_gift", + "desc": "奖品选择-阶段框标题" + }, + { + "key": "select:step", + "value": "step", + "desc": "奖品选择-阶段" + }, + { + "key": "select:pick_item", + "value": "pick_item", + "desc": "奖品选择-阶段一文案" + }, + { + "key": "select:raise_pet", + "value": "raise_pet", + "desc": "奖品选择-阶段二文案" + }, + { + "key": "select:get_free_gift", + "value": "get_free_gift", + "desc": "奖品选择-阶段三文案" + }, + { + "key": "barrage:get_reward", + "value": "has_got", + "desc": "弹幕-获得奖品" + }, + { + "key": "select:reward_title", + "value": "more_unexpected_gifts", + "desc": "奖品选择-奖品部分标题" + }, + { + "key": "select:pick_it", + "value": "pick_it", + "desc": "奖品选择-选择奖品按钮" + }, + { + "key": "select:picked", + "value": "picked", + "desc": "奖品选择-多少人选择了奖品" + }, + { + "key": "select:confirm", + "value": "confirm", + "desc": "奖品选择-确认按钮" + }, + { + "key": "select:free", + "value": "free", + "desc": "奖品选择-免费文案" + }, + { + "key": "select:confirm_title", + "value": "your_gift_confirm", + "desc": "奖品选择-确认框标题文案" + }, + { + "key": "select:nice_choice", + "value": "nice_choice", + "desc": "奖品选择-奖品选择成功后标题" + }, + { + "key": "select:tip", + "value": "raise_the_dog_to_get_your", + "desc": "奖品选择-选择奖品后的普通提示" + }, + { + "key": "select:tip_super", + "value": "free_gift", + "desc": "奖品选择-选择奖品后的特别的提示" + }, + { + "key": "top_reward:expired_in", + "value": "expires_in_day", + "desc": "首页顶部奖品-过期天数文案" + }, + { + "key": "top_reward:collect_more_love", + "value": "collect_more_love", + "desc": "首页顶部奖品-收集更多爱心" + }, + { + "key": "dog_home:collect", + "value": "collect", + "desc": "养狗首页-收集文案" + }, + { + "key": "dog_home:claim_now", + "value": "claim_now", + "desc": "养狗首页-立即领取狗粮机文案" + }, + { + "key": "dog_home:in_product", + "value": "in_production", + "desc": "养狗首页-生产中" + }, + { + "key": "dog_home:offline_num", + "value": "dog_food_num", + "desc": "养狗首页-生产中" + }, + { + "key": "dog_home:feed_more_times", + "value": "feed_more_times", + "desc": "养狗首页-喂养次数领取狗粮文案" + }, + { + "key": "dog_home:invite", + "value": "invite", + "desc": "养狗首页-邀请icon文案" + }, + { + "key": "dog_home:get_more", + "value": "get_more", + "desc": "养狗首页-获得更多icon文案" + }, + { + "key": "first_invite:tip_title", + "value": "first_referral_bonus", + "desc": "首次邀请奖励-提示标题" + }, + { + "key": "first_invite:tip", + "value": "get_rewards_first_time", + "desc": "首次邀请奖励-提示" + }, + { + "key": "first_invite:food_title", + "value": "first_invite_receive", + "desc": "首次邀请奖励-狗粮页面提示标题文案" + }, + { + "key": "first_invite:food_tip", + "value": "invite_now", + "desc": "首次邀请奖励-立即邀请" + }, + { + "key": "first_invite:invite_now", + "value": "invite_now", + "desc": "首次邀请奖励-立即邀请" + }, + { + "key": "first_invite:invite_title", + "value": "invite_get_dog_foods", + "desc": "首次邀请奖励-邀请页标题" + }, + { + "key": "first_invite:invite_first_extra", + "value": "invite_new_user_extra_get", + "desc": "首次邀请奖励-邀请页首次邀请额外奖励文案" + }, + { + "key": "first_invite:invite_step_1", + "value": "invite_friends", + "desc": "首次邀请奖励-步骤一文案" + }, + { + "key": "first_invite:invite_step_2", + "value": "pick_a_gift", + "desc": "首次邀请奖励-步骤二文案" + }, + { + "key": "first_invite:invite_step_3", + "value": "feed_3_times", + "desc": "首次邀请奖励-步骤三文案" + }, + { + "key": "dog_task:dog_food", + "value": "dog_food", + "desc": "养狗任务-狗粮文案" + }, + { + "key": "dog_task:super", + "value": "super", + "desc": "养狗任务-超级文案" + }, + { + "key": "dog_task:super_benefit", + "value": "super_benefit", + "desc": "养狗任务-超级利益文案" + }, + { + "key": "super_task:reward_upgraded", + "value": "reward_upgraded", + "desc": "超级腾雾-奖励升级" + }, + { + "key": "super_task:reward_upgraded_tip", + "value": "reward_for_you", + "desc": "超级腾雾-奖励升级提示" + }, + { + "key": "reward_expired:title", + "value": "time_s_up", + "desc": "奖品过期-标题" + }, + { + "key": "reward_expired:round_expired", + "value": "round_expired", + "desc": "奖品过期-过期印章" + }, + { + "key": "reward_expired:tip", + "value": "try_again_to_claim", + "desc": "奖品过期-提示文案" + }, + { + "key": "reward:again", + "value": "play_again", + "desc": "奖品过期-提示文案" + }, + { + "key": "reward:congrats", + "value": "congrats", + "desc": "奖品-中奖标题文案" + }, + { + "key": "reward:congrats_tip", + "value": "enjoy_your", + "desc": "奖品-中奖提示文案" + }, + { + "key": "love_record:collect", + "value": "collect_love", + "desc": "爱心记录-收集爱心" + }, + { + "key": "food_record:init_get", + "value": "join_in_campaign", + "desc": "狗粮记录-参与活动赠送" + }, + { + "key": "food_record:child_invite", + "value": "rank_reward", + "desc": "狗粮记录-排名奖励" + }, + { + "key": "food_record:child_sign", + "value": "sign_reward", + "desc": "狗粮记录-签到奖励" + }, + { + "key": "food_record:child_blind", + "value": "blind_reward", + "desc": "狗粮记录-签到奖励" + }, + { + "key": "food_record:child_lucky", + "value": "lucky_reward", + "desc": "狗粮记录-签到奖励" + }, + { + "key": "food_record:step", + "value": "finish_step", + "desc": "狗粮记录-完成阶段任务赠送" + }, + { + "key": "food_record:feed_prop", + "value": "finish_many_feed", + "desc": "狗粮记录-喂养任务" + }, + { + "key": "food_record:third_feed", + "value": "friend_third_feed", + "desc": "狗粮记录-好友喂养三次" + }, + { + "key": "food_record:day_first_third_feed", + "value": "friend_first_third_feed", + "desc": "狗粮记录-每日第一个邀请喂养三次" + }, + { + "key": "food_record:select_reward", + "value": "friend_select_reward", + "desc": "狗粮记录-好友选择了奖品" + }, + { + "key": "food_record:day_first_select_reward", + "value": "friend_first_select_reward", + "desc": "狗粮记录-每日第一个邀请好友选择了奖品" + }, + { + "key": "food_record:effect_invite", + "value": "effect_invite", + "desc": "狗粮记录-成功邀请一个好友" + }, + { + "key": "food_record:day_first_effect_invite", + "value": "day_first_effect_invite", + "desc": "狗粮记录-当日首次成功邀请好友" + }, + { + "key": "food_record:machine", + "value": "collect_machine", + "desc": "狗粮记录-狗粮机领取" + }, + { + "key": "food_record:machine_offline", + "value": "collect_machine", + "desc": "狗粮记录-狗粮机领取" + }, + { + "key": "food_record:finish_task", + "value": "finish_one_task", + "desc": "狗粮记录-完成任务" + }, + { + "key": "dog_record:my_invite", + "value": "my_invite", + "desc": "养狗记录-我的邀请" + }, + { + "key": "dog_record:rewards", + "value": "rewards", + "desc": "养狗记录-我的奖励" + }, + { + "key": "dog_record:dog_food", + "value": "dog_food", + "desc": "养狗记录-狗粮记录" + }, + { + "key": "dog_record:love_points", + "value": "love_points", + "desc": "养狗记录-爱心点数" + }, + { + "key": "dog_tip:dog_food_lack", + "value": "dog_food_lack", + "desc": "提示-狗粮不足" + }, + { + "key": "dog_tip:max_grow", + "value": "max_grow", + "desc": "提示-最大领养次数" + }, + { + "key": "dog_tip:please_collect_love", + "value": "please_collect_love", + "desc": "提示-请先收集爱心" + }, + { + "key": "dog_tip:continue_grow", + "value": "continue_grow", + "desc": "提示-当前宠物还能养" + }, + { + "key": "dog_tip:machine_running", + "value": "dog_food_machine_running", + "desc": "提示-狗粮生产中" + }, + { + "key": "dog_tip:reward_remove", + "value": "reward_remove", + "desc": "提示-奖品下架" + }, + { + "key": "dog_tip:reward_get_max", + "value": "reward_get_max", + "desc": "提示-超过获取最大上限" + }, + { + "key": "dog_tip:reward_lack", + "value": "sold_out", + "desc": "提示-奖品不足" + }, + { + "key": "dog_text:hungry", + "value": "i_am_hungry", + "desc": "养狗话术-我饿了" + }, + { + "key": "dog_tip:get_food", + "value": "congrats_for_getting", + "desc": "提示-获得狗粮" + }, + { + "key": "dog_tip:max", + "value": "reached_the_max", + "desc": "提示-达到最大值" + } + ], + "desc": "激励养成keep_dog模板语言包" + }, + "child": { + "parts": [ + { + "key": "child_sign:signed_title", + "value": "signed_title", + "desc": "签到子活动-icon名称" + }, + { + "key": "child_sign:today_title", + "value": "daily_rewards", + "desc": "签到子活动-今日领奖标题" + }, + { + "key": "child_sign:tomorrow_title", + "value": "come_back_tomorrow_for_more_rewards", + "desc": "签到子活动-明日领奖标题" + }, + { + "key": "child_sign:today_get", + "value": "claim_today_reward", + "desc": "签到子活动-今日领奖按钮文案" + }, + { + "key": "child_sign:day", + "value": "day_num", + "desc": "签到子活动-天" + }, + { + "key": "child_sign:today", + "value": "today", + "desc": "签到子活动-今天" + }, + { + "key": "child_sign:tomorrow_get", + "value": "come_back_tomorrow", + "desc": "签到子活动-明日领奖按钮文案" + }, + { + "key": "child_sign:signed_in", + "value": "signed_in", + "desc": "签到子活动-签到成功" + }, + { + "key": "child_sign:continue_tip", + "value": "fail_to_sign_progress_reset", + "desc": "签到子活动-连续签到提示" + }, + { + "key": "child_blind:title", + "value": "blind_box", + "desc": "盲盒子活动-icon名称" + }, + { + "key": "child_blind:congrats", + "value": "congrats", + "desc": "盲盒子活动-盲盒恭喜标题" + }, + { + "key": "child_blind:congrats", + "value": "congrats", + "desc": "盲盒子活动-盲盒恭喜标题" + }, + { + "key": "child_blind:got_box", + "value": "you_got_the_gift_box", + "desc": "盲盒子活动-领取盒子提示" + }, + { + "key": "child_blind:got_food", + "value": "you_got_dog_food", + "desc": "盲盒子活动-领到狗粮" + }, + { + "key": "child_blind:got_reward", + "value": "you_got_reward", + "desc": "盲盒子活动-领到奖品" + }, + { + "key": "child_blind:use_it", + "value": "use_it", + "desc": "盲盒子活动-使用它" + }, + { + "key": "child_invite:invite_contest", + "value": "invite_contest", + "desc": "邀请子活动-邀新竞赛标题" + }, + { + "key": "child_invite:invite_tip", + "value": "rewards_earned_to_your_account", + "desc": "邀请子活动-邀请获取提示" + }, + { + "key": "child_invite:invite_btn", + "value": "invite_more_friends", + "desc": "邀请子活动-邀请更多好友" + }, + { + "key": "child_invite:invited", + "value": "invited", + "desc": "邀请子活动-已邀请" + }, + { + "key": "child_invite:rank_end", + "value": "rank_end", + "desc": "邀请子活动-排名结束" + }, + { + "key": "child_invite:you", + "value": "you", + "desc": "邀请子活动-已邀请" + }, + { + "key": "child_invite:title", + "value": "win_reward", + "desc": "邀请子活动-icon名称" + }, + { + "key": "child_lucky:title", + "value": "daily_fortune_draw", + "desc": "抽奖子活动-标题" + }, + { + "key": "child_lucky:tip", + "value": "win_free_gift_every_day", + "desc": "抽奖子活动-提示" + }, + { + "key": "child_lucky:prizes_left", + "value": "rewards", + "desc": "抽奖子活动-还剩多少文案" + }, + { + "key": "child_lucky:btn", + "value": "draw_now", + "desc": "抽奖子活动-按钮文案" + }, + { + "key": "child_lucky:icon_title", + "value": "daily_draw", + "desc": "抽奖子活动-icon名称" + }, + { + "key": "child_lucky:jackpot", + "value": "jackpot", + "desc": "抽奖子活动-jackpot文案" + } + ], + "desc": "子活动语言包" + }, + "wheel": { + "parts": [ + { + "key": "home:chance_num", + "value": "raffle_num", + "desc": "首页-抽奖次数" + }, + { + "key": "home:chance", + "value": "raffle_chances", + "desc": "首页-抽奖剩余机会" + }, + { + "key": "window:title", + "value": "wow_you_got", + "desc": "弹窗-恭喜你获奖文案" + }, + { + "key": "window:title_fail", + "value": "next_time", + "desc": "弹窗-没中奖文案" + }, + { + "key": "window:open", + "value": "open", + "desc": "弹窗-打开按钮文案" + }, + { + "key": "window:chance_lack", + "value": "raffle_chances_lack", + "desc": "弹窗-机会不足文案" + }, + { + "key": "window:chance_lack_tip", + "value": "raffle_chances_lack_tip", + "desc": "弹窗-机会不足提示文案" + }, + { + "key": "home:win_record", + "value": "winning_record", + "desc": "首页-中奖记录文案" + }, + { + "key": "window:lottery_again", + "value": "lottery_again", + "desc": "弹窗-再抽一次按钮文案" + } + ], + "desc": "大转盘wheel模板语言包" + }, + "task_v2": { + "parts": [ + { + "key": "task:title", + "value": "my_task", + "desc": "我的任务-标题" + }, + { + "key": "task:to_complete", + "value": "to_complete", + "desc": "我的任务-去完成按钮文案" + }, + { + "key": "task:to_complete_ok", + "value": "completed", + "desc": "我的任务-已完成按钮文案" + }, + { + "key": "task:completed", + "value": "completed_num", + "desc": "我的任务-已完成次数" + }, + { + "key": "task:completed_times", + "value": "completed_times", + "desc": "我的任务-完成次数" + }, + { + "key": "task:got", + "value": "got_num", + "desc": "我的任务-已获得次数" + }, + { + "key": "task:day_limit", + "value": "refresh_tomorrow", + "desc": "我的任务-明天刷新任务文案" + }, + { + "key": "task:next_week_do", + "value": "next_week_do", + "desc": "我的任务-下周刷新任务文案" + }, + { + "key": "task:week_do_1", + "value": "week_do_1", + "desc": "我的任务-周1刷新任务文案" + }, + { + "key": "task:week_do_2", + "value": "week_do_2", + "desc": "我的任务-周2刷新任务文案" + }, + { + "key": "task:week_do_3", + "value": "week_do_3", + "desc": "我的任务-周3刷新任务文案" + }, + { + "key": "task:week_do_4", + "value": "week_do_4", + "desc": "我的任务-周4刷新任务文案" + }, + { + "key": "task:week_do_5", + "value": "week_do_5", + "desc": "我的任务-周5刷新任务文案" + }, + { + "key": "task:week_do_6", + "value": "week_do_6", + "desc": "我的任务-周6刷新任务文案" + }, + { + "key": "task:week_do_7", + "value": "week_do_7", + "desc": "我的任务-周天刷新任务文案" + }, + { + "key": "task:install_title", + "value": "invite_friend_download_app", + "desc": "我的任务-安装事件任务名称" + }, + { + "key": "task:register_title", + "value": "invite_friend_register_app", + "desc": "我的任务-注册事件任务名称" + }, + { + "key": "task:reward_receive", + "value": "receive", + "desc": "我的任务-领取奖励文案" + }, + { + "key": "task:common_task_cond_one", + "value": "task_cond_one", + "desc": "我的任务-通用完成任意任务文案" + }, + { + "key": "task:common_task_cond_all", + "value": "task_cond_all", + "desc": "我的任务-通用完成所有任务文案" + } + ], + "desc": "任务组件v2(数字有变色)" + }, + "lottery_task_v2": { + "parts": [ + { + "key": "task:install", + "value": "invite_friend_install_get_lottery_chance_v2", + "desc": "我的任务-下载安装任务文案" + }, + { + "key": "task:install_limit", + "value": "invite_friend_install_get_lottery_chance_limit_v2", + "desc": "我的任务-下载安装有限制任务文案" + }, + { + "key": "task:register", + "value": "invite_friend_register_get_lottery_chance_v2", + "desc": "我的任务-注册任务文案" + }, + { + "key": "task:register_limit", + "value": "invite_friend_register_get_lottery_chance_limit_v2", + "desc": "我的任务-注册有限制任务文案" + }, + { + "key": "task:chance", + "value": "lottery_task_finish_v2", + "desc": "我的任务-完成可获得抽奖机会文案" + }, + { + "key": "task:chance_limit", + "value": "lottery_task_finish_limit_v2", + "desc": "我的任务-完成可获得抽奖机会有限制文案" + }, + { + "key": "task:chance_short", + "value": "lottery_chance_done", + "desc": "我的任务-完成可获得抽奖机会短文案" + }, + { + "key": "task:chance_limit_short", + "value": "lottery_chance_done_limit", + "desc": "我的任务-完成可获得抽奖机会有限制断短文案" + }, + { + "key": "task:chance_total", + "value": "lottery_task_num", + "desc": "我的任务-已获得的抽奖机会" + }, + { + "key": "task:cond_one", + "value": "lottery_task_cond_one", + "desc": "我的任务-完成任意任务可获得更多抽奖机会" + }, + { + "key": "task:cond_all", + "value": "lottery_task_cond_all_v2", + "desc": "我的任务-完成所有任务可以获得抽奖机会文案" + }, + { + "key": "task:cond_all_limit", + "value": "lottery_task_cond_all_limit_v2", + "desc": "我的任务-完成所有任务可以获得抽奖机会有限制文案" + }, + { + "key": "task:title_v2", + "value": "do_task_get_lottery", + "desc": "我的任务-新版抽奖类玩法任务标题" + }, + { + "key": "task:day_chance", + "value": "sign_in_every_day_can_get_lottery", + "desc": "我的任务-新版抽奖类玩法签到文案" + }, + { + "key": "task:reward_task_title", + "value": "complete_tasks_to_earn_reward", + "desc": "我的任务-任务标题说领取奖励的文案" + }, + { + "key": "task:raffle_num_add", + "value": "raffle_num_add", + "desc": "我的任务-抽奖机会次数增加" + } + ], + "desc": "抽奖类任务条件(数字有变色)" + }, + "gold": { + "parts": [ + { + "key": "home:spin_now", + "value": "spin_now", + "desc": "首页-立即抽奖按钮文案" + }, + { + "key": "windows:spinning", + "value": "spinning", + "desc": "弹层-转盘按钮文案" + }, + { + "key": "home:expires_in", + "value": "expires_in", + "desc": "首页-任务过期时间" + }, + { + "key": "home:get_energy_btn", + "value": "get_energy", + "desc": "首页-按钮获得能量文案" + }, + { + "key": "windows:luck_you", + "value": "luck_you", + "desc": "弹层-非常幸运文案" + }, + { + "key": "windows:extra", + "value": "get_extra_reward", + "desc": "弹层-获得额外奖励" + }, + { + "key": "windows:share_get", + "value": "share_get", + "desc": "弹层-分享后可获得" + }, + { + "key": "windows:upgrade_reward", + "value": "upgrade_reward", + "desc": "弹层-奖励升级" + }, + { + "key": "windows:super_upgrade", + "value": "super_upgrade", + "desc": "弹层-超级升级" + }, + { + "key": "home:pre_spin", + "value": "preparation", + "desc": "首页-转盘中心预备文案" + }, + { + "key": "windows:get_energy", + "value": "do_task_get_energy", + "desc": "弹层-完成任务获得能量文案" + }, + { + "key": "windows:win_left_energy", + "value": "win_left_energy", + "desc": "弹层-还差多少即可赢得奖励文案" + }, + { + "key": "share:task_coins", + "value": "click_button_and_get_coins", + "desc": "分享-完成任务获得金币文案" + }, + { + "key": "share:num_coins", + "value": "coins", + "desc": "分享-进度条显示的tip金币数" + }, + { + "key": "share:get_tasks", + "value": "get_tasks", + "desc": "分享-领取任务按钮文案" + }, + { + "key": "share:progress_spin", + "value": "spin", + "desc": "分享-进度条抽" + }, + { + "key": "share:progress_away", + "value": "away", + "desc": "分享-还差多少个" + }, + { + "key": "windows:congrats", + "value": "congratulation", + "desc": "弹层-恭喜你" + }, + { + "key": "windows:enjoy_credit", + "value": "enjoy_credit", + "desc": "弹层-金额增加文案" + }, + { + "key": "windows:auto_spin", + "value": "auto_spin", + "desc": "弹层-自动抽奖文案" + }, + { + "key": "home:left_get_reward", + "value": "left_cash_get_reward", + "desc": "首页-还差多少金额就可以领奖" + }, + { + "key": "windows:share_tip", + "value": "guarantee_to", + "desc": "弹窗-分享奖品文案" + }, + { + "key": "windows:box_banner_top", + "value": "surprise_for_you", + "desc": "弹窗-盒子横幅文案上面一行" + }, + { + "key": "windows:box_banner_bottom", + "value": "get_money_reward", + "desc": "弹窗-盒子横幅文案下面一行" + }, + { + "key": "windows:box_tip", + "value": "select_box", + "desc": "弹窗-盒子提示文案" + }, + { + "key": "windows:box_btn", + "value": "open", + "desc": "弹窗-盒子按钮文案" + }, + { + "key": "windows:card_money_reward", + "value": "money_reward", + "desc": "弹窗-卡片标题" + }, + { + "key": "windows:jackpot", + "value": "jackpot_best_prize", + "desc": "弹窗-大奖文案" + }, + { + "key": "windows:best_prize", + "value": "best_prize", + "desc": "弹窗-最好奖品文案" + }, + { + "key": "windows:almost_reward", + "value": "almost_reward", + "desc": "弹窗-马上可以领取提示文案" + }, + { + "key": "barrage:victory_tip", + "value": "victory_tip", + "desc": "弹幕-声援文案" + }, + { + "key": "barrage:min_won_barrage", + "value": "min_won_barrage", + "desc": "弹幕-分钟前有人赢奖文案" + }, + { + "key": "barrage:won_barrage", + "value": "won_barrage", + "desc": "弹幕-有人赢奖文案" + }, + { + "key": "barrage:closer_to_prize", + "value": "closer_to_prize", + "desc": "弹幕-越来越近文案" + }, + { + "key": "barrage:shine_arrived", + "value": "shine_arrived", + "desc": "弹幕-闪耀提示文案" + }, + { + "key": "windows:pass_on_energy", + "value": "pass_on_energy", + "desc": "弹幕-发放能量文案" + }, + { + "key": "windows:auto_select", + "value": "auto_select", + "desc": "弹层-自动选择文案" + }, + { + "key": "windows:over_people", + "value": "claimed_reward", + "desc": "弹层-超过多少人领奖文案" + }, + { + "key": "windows:last_spin_win", + "value": "last_spin_win", + "desc": "弹层-距离领奖只差1次抽奖文案" + }, + { + "key": "reward:your_reward", + "value": "your_reward", + "desc": "奖品-你的奖励" + }, + { + "key": "reward:go_to", + "value": "go_to", + "desc": "奖品-前往使用" + }, + { + "key": "reward:click_contact", + "value": "click_contact", + "desc": "奖品-点击联系客服" + }, + { + "key": "reward:reward_in_your_account", + "value": "reward_send_your_account", + "desc": "奖品-奖品已发放到您的账户中" + }, + { + "key": "reward:click_contact_tip", + "value": "click_contact_tip", + "desc": "奖品-点击联系客服提示" + }, + { + "key": "reward:see_reward", + "value": "see_reward", + "desc": "奖品-查看奖品" + }, + { + "key": "reward:prize_gone", + "value": "prize_gone", + "desc": "奖品-奖品发完了" + }, + { + "key": "task_window:next", + "value": "next", + "desc": "任务弹窗-下一个" + }, + { + "key": "record:no_more_record", + "value": "no_more_record", + "desc": "记录-没有更多记录文案" + }, + { + "key": "record:completed_task", + "value": "finish_task_title", + "desc": "记录-完成某个任务" + }, + { + "key": "record:completed_task_none", + "value": "finish_one_task", + "desc": "记录-完成某个任务,但是任务被删除了" + }, + { + "key": "record:completed_invite_task", + "value": "finish_invite_task", + "desc": "记录-完成邀请任务" + } + ], + "desc": "金币任务特有组件" + }, + "answer": { + "parts": [ + { + "key": "tip:answer_none", + "value": "answer_none", + "desc": "提示-答题次数用完了" + }, + { + "key": "tip:qa_loading", + "value": "qa_loading", + "desc": "提示-答题中,请稍后试" + }, + { + "key": "answer_tip:day_chance", + "value": "answer_tomorrow_get_chance", + "desc": "提示-每日答题次数提示" + }, + { + "key": "answer:starting", + "value": "quiz_starting", + "desc": "答题-开始答题" + }, + { + "key": "answer:ready", + "value": "quiz_ready", + "desc": "答题-准备" + }, + { + "key": "answer:go", + "value": "start", + "desc": "答题-开始" + }, + { + "key": "answer:oops", + "value": "quiz_oops", + "desc": "答题-答错提示" + }, + { + "key": "answer:next", + "value": "quiz_next", + "desc": "答题-下一题" + }, + { + "key": "answer:question_progress", + "value": "quiz_question_progress", + "desc": "答题-题目进度" + }, + { + "key": "answer:correct", + "value": "quiz_correct", + "desc": "答题-正确" + }, + { + "key": "answer:hint", + "value": "tip", + "desc": "答题-提示" + }, + { + "key": "answer:back", + "value": "quiz_back", + "desc": "答题-返回答题" + }, + { + "key": "answer:review_answers", + "value": "quiz_review_answers", + "desc": "答题-查看答案" + }, + { + "key": "answer:question", + "value": "quiz_question", + "desc": "答题-题目" + }, + { + "key": "answer:time_up", + "value": "time_s_up", + "desc": "答题-时间结束" + }, + { + "key": "answer:round_complete", + "value": "quiz_round_complete", + "desc": "答题-本轮完成" + }, + { + "key": "answer:no_answer_submitted", + "value": "quiz_no_answer_submitted", + "desc": "答题-未提交答案" + }, + { + "key": "answer:perfect_score", + "value": "quiz_perfect_score", + "desc": "答题-满分提示" + }, + { + "key": "answer:correct_count", + "value": "quiz_correct_count", + "desc": "答题-答对题数" + }, + { + "key": "answer:good_job", + "value": "quiz_good_job", + "desc": "答题-完成鼓励" + }, + { + "key": "answer:home", + "value": "quiz_home", + "desc": "答题-首页" + }, + { + "key": "answer:try_again", + "value": "play_again", + "desc": "答题-再试一次" + }, + { + "key": "answer:share", + "value": "share", + "desc": "答题-分享" + }, + { + "key": "answer:claim_it_now", + "value": "claim_it_now", + "desc": "答题-立即领取" + }, + { + "key": "home:chance", + "value": "quiz_chances", + "desc": "首页-答题剩余机会" + }, + { + "key": "window:title", + "value": "wow_you_got", + "desc": "弹窗-恭喜你获奖文案" + } + ], + "desc": "答题特有组件" + }, + "coin": { + "parts": [ + { + "key": "home:coin_total", + "value": "current_total_prize_pool", + "desc": "首页-当前奖池总金额" + }, + { + "key": "home:more", + "value": "more", + "desc": "首页-更多icon图标文案" + }, + { + "key": "home:day", + "value": "day", + "desc": "首页-天的文案" + }, + { + "key": "home:play", + "value": "join_coin", + "desc": "首页-参与瓜分按钮文案" + }, + { + "key": "home:claim", + "value": "claim", + "desc": "首页-领取按钮文案" + }, + { + "key": "home:play_tip", + "value": "coin_per_use", + "desc": "首页-参与瓜分按钮提示" + }, + { + "key": "home:expected_coin", + "value": "expected_to_receive_coin", + "desc": "首页-预计获得金币" + }, + { + "key": "home:collect_coin", + "value": "collect_coin", + "desc": "首页-收集收集金币文案" + }, + { + "key": "barrage:get_coin", + "value": "get_coin", + "desc": "弹幕-获得的金币数" + }, + { + "key": "barrage:join_coin_num", + "value": "join_coin_num", + "desc": "弹幕-参与次数" + }, + { + "key": "coin_tip:confirm_play", + "value": "use_gold_coins_to_play", + "desc": "金币池tip-确认是否消耗金币玩游戏" + }, + { + "key": "coin_tip:not_reached", + "value": "claim_time_not_reached", + "desc": "金币池tip-领取时间还没到的文案" + }, + { + "key": "coin_tip:too_late", + "value": "too_late_reward_expired", + "desc": "金币池tip-奖励过期点击领取文案" + }, + { + "key": "coin_tip:use_limit", + "value": "play_limit_next_round", + "desc": "金币池tip-已经达到玩的次数上限文案" + }, + { + "key": "coin_tip:lack", + "value": "insufficient_balance_grab_gold", + "desc": "金币池tip-余额不足文案" + }, + { + "key": "coin_tip:scene_end", + "value": "this_round_has_ended", + "desc": "金币池tip-场次已经结束文案" + }, + { + "key": "coin_tip:tomorrow_get", + "value": "expected_to_be_available_tomorrow", + "desc": "金币池tip-明天可领取文案" + }, + { + "key": "coin_tip:day_get", + "value": "expected_to_be_available_in_day", + "desc": "金币池tip-N天后可领取文案" + }, + { + "key": "coin_tip:coin_num", + "value": "num_gold_coins", + "desc": "金币池tip-金币数量" + }, + { + "key": "coin_tip:duplicate_claims ", + "value": "no_duplicate_claims", + "desc": "金币池tip-重复领取奖励文案" + }, + { + "key": "coin_tip:gain_fail", + "value": "claim_failed", + "desc": "金币池tip-领取失败文案" + }, + { + "key": "coin_tab:rewards", + "value": "rewards", + "desc": "金币池tab-奖励" + }, + { + "key": "coin_tab:records", + "value": "records", + "desc": "金币池tab-投放记录" + }, + { + "key": "record:put_in", + "value": "join_coin", + "desc": "记录-参与瓜分扣除金币文案" + }, + { + "key": "record:get_ok", + "value": "gold_coins_deposited", + "desc": "记录-成功领取文案" + }, + { + "key": "record:get_expired", + "value": "timeout_and_no_collection", + "desc": "记录-过期未领取说明文案" + }, + { + "key": "record:expired", + "value": "expired", + "desc": "记录-已过期标识" + } + ], + "desc": "金币池特有组件" + }, + "sign": { + "parts": [ + { + "key": "home:play_btn", + "value": "check_in_now", + "desc": "首页-立即签到按钮文案" + }, + { + "key": "home:play_tomorrow", + "value": "refresh_tomorrow", + "desc": "首页-明天再来按钮文案" + }, + { + "key": "home:check_in_reward", + "value": "complete_daily_check_ins_for_prizes", + "desc": "首页-奖励规则下面的签到领奖描述" + }, + { + "key": "home:check_in_days", + "value": "check_in_days", + "desc": "首页-签到天数前缀" + } + ], + "desc": "签到特有组件" + }, + "pet": { + "parts": [ + { + "key": "select:free_gift", + "value": "raise_pet_to_get_free_gift", + "desc": "奖品选择-阶段框标题" + }, + { + "key": "select:step", + "value": "step", + "desc": "奖品选择-阶段" + }, + { + "key": "select:pick_item", + "value": "pick_item", + "desc": "奖品选择-阶段一文案" + }, + { + "key": "select:raise_pet", + "value": "raise_pet", + "desc": "奖品选择-阶段二文案" + }, + { + "key": "select:get_free_gift", + "value": "get_free_gift", + "desc": "奖品选择-阶段三文案" + }, + { + "key": "barrage:get_reward", + "value": "has_got", + "desc": "弹幕-获得奖品" + }, + { + "key": "select:reward_title", + "value": "more_unexpected_gifts", + "desc": "奖品选择-奖品部分标题" + }, + { + "key": "select:pick_it", + "value": "pick_it", + "desc": "奖品选择-选择奖品按钮" + }, + { + "key": "select:picked", + "value": "picked", + "desc": "奖品选择-多少人选择了奖品" + }, + { + "key": "select:confirm", + "value": "confirm", + "desc": "奖品选择-确认按钮" + }, + { + "key": "select:free", + "value": "free", + "desc": "奖品选择-免费文案" + }, + { + "key": "select:confirm_title", + "value": "your_gift_confirm", + "desc": "奖品选择-确认框标题文案" + }, + { + "key": "select:nice_choice", + "value": "nice_choice", + "desc": "奖品选择-奖品选择成功后标题" + }, + { + "key": "select:tip", + "value": "raise_the_pet_to_get_your", + "desc": "奖品选择-选择奖品后的普通提示" + }, + { + "key": "select:tip_super", + "value": "free_gift", + "desc": "奖品选择-选择奖品后的特别的提示" + }, + { + "key": "top_reward:expired_in", + "value": "expires_in_day", + "desc": "首页顶部奖品-过期天数文案" + }, + { + "key": "top_reward:collect_more_love", + "value": "collect_more_love", + "desc": "首页顶部奖品-收集更多爱心" + }, + { + "key": "dog_home:collect", + "value": "collect", + "desc": "宠物首页-收集文案" + }, + { + "key": "dog_home:claim_now", + "value": "claim_now", + "desc": "宠物首页-立即领取宠粮机文案" + }, + { + "key": "dog_home:in_product", + "value": "in_production", + "desc": "宠物首页-生产中" + }, + { + "key": "dog_home:offline_num", + "value": "pet_food_num", + "desc": "宠物首页-宠粮数量" + }, + { + "key": "dog_home:feed_more_times", + "value": "feed_more_times", + "desc": "宠物首页-喂养次数领取狗粮文案" + }, + { + "key": "dog_home:invite", + "value": "invite", + "desc": "宠物首页-邀请icon文案" + }, + { + "key": "dog_home:get_more", + "value": "get_more", + "desc": "宠物首页-获得更多icon文案" + }, + { + "key": "first_invite:tip_title", + "value": "first_referral_bonus", + "desc": "首次邀请奖励-提示标题" + }, + { + "key": "first_invite:tip", + "value": "get_rewards_first_time", + "desc": "首次邀请奖励-提示" + }, + { + "key": "first_invite:food_title", + "value": "first_invite_receive", + "desc": "首次邀请奖励-狗粮页面提示标题文案" + }, + { + "key": "first_invite:food_tip", + "value": "invite_now", + "desc": "首次邀请奖励-立即邀请" + }, + { + "key": "first_invite:invite_now", + "value": "invite_now", + "desc": "首次邀请奖励-立即邀请" + }, + { + "key": "first_invite:invite_title", + "value": "invite_get_dog_foods", + "desc": "首次邀请奖励-邀请页标题" + }, + { + "key": "first_invite:invite_first_extra", + "value": "invite_new_user_extra_get", + "desc": "首次邀请奖励-邀请页首次邀请额外奖励文案" + }, + { + "key": "first_invite:invite_step_1", + "value": "invite_friends", + "desc": "首次邀请奖励-步骤一文案" + }, + { + "key": "first_invite:invite_step_2", + "value": "pick_a_gift", + "desc": "首次邀请奖励-步骤二文案" + }, + { + "key": "first_invite:invite_step_3", + "value": "feed_3_times", + "desc": "首次邀请奖励-步骤三文案" + }, + { + "key": "dog_task:dog_food", + "value": "pet_food", + "desc": "宠物任务-宠粮文案" + }, + { + "key": "dog_task:super", + "value": "super", + "desc": "宠物任务-超级文案" + }, + { + "key": "dog_task:super_benefit", + "value": "super_benefit", + "desc": "宠物任务-超级利益文案" + }, + { + "key": "super_task:reward_upgraded", + "value": "reward_upgraded", + "desc": "超级腾雾-奖励升级" + }, + { + "key": "super_task:reward_upgraded_tip", + "value": "reward_for_you", + "desc": "超级腾雾-奖励升级提示" + }, + { + "key": "reward_expired:title", + "value": "time_s_up", + "desc": "奖品过期-标题" + }, + { + "key": "reward_expired:round_expired", + "value": "round_expired", + "desc": "奖品过期-过期印章" + }, + { + "key": "reward_expired:tip", + "value": "try_again_to_claim", + "desc": "奖品过期-提示文案" + }, + { + "key": "reward:again", + "value": "play_again", + "desc": "奖品过期-提示文案" + }, + { + "key": "reward:congrats", + "value": "congrats", + "desc": "奖品-中奖标题文案" + }, + { + "key": "reward:congrats_tip", + "value": "enjoy_your", + "desc": "奖品-中奖提示文案" + }, + { + "key": "love_record:collect", + "value": "collect_love", + "desc": "爱心记录-收集爱心" + }, + { + "key": "food_record:init_get", + "value": "join_in_campaign", + "desc": "宠粮记录-参与活动赠送" + }, + { + "key": "food_record:child_invite", + "value": "rank_reward", + "desc": "宠粮记录-排名奖励" + }, + { + "key": "food_record:child_sign", + "value": "sign_reward", + "desc": "宠粮记录-签到奖励" + }, + { + "key": "food_record:child_blind", + "value": "blind_reward", + "desc": "宠粮记录-签到奖励" + }, + { + "key": "food_record:child_lucky", + "value": "lucky_reward", + "desc": "宠粮记录-签到奖励" + }, + { + "key": "food_record:step", + "value": "finish_step", + "desc": "宠粮记录-完成阶段任务赠送" + }, + { + "key": "food_record:feed_prop", + "value": "finish_many_feed", + "desc": "宠粮记录-喂养任务" + }, + { + "key": "food_record:third_feed", + "value": "friend_third_feed_pet", + "desc": "宠粮记录-好友喂养三次" + }, + { + "key": "food_record:day_first_third_feed", + "value": "friend_first_third_feed_pet", + "desc": "宠粮记录-每日第一个邀请喂养三次" + }, + { + "key": "food_record:select_reward", + "value": "friend_select_reward", + "desc": "宠粮记录-好友选择了奖品" + }, + { + "key": "food_record:day_first_select_reward", + "value": "friend_first_select_reward", + "desc": "宠粮记录-每日第一个邀请好友选择了奖品" + }, + { + "key": "food_record:effect_invite", + "value": "effect_invite", + "desc": "宠粮记录-成功邀请一个好友" + }, + { + "key": "food_record:day_first_effect_invite", + "value": "day_first_effect_invite", + "desc": "宠粮记录-当日首次成功邀请好友" + }, + { + "key": "food_record:machine", + "value": "collect_machine_food", + "desc": "宠粮记录-狗粮机领取" + }, + { + "key": "food_record:machine_offline", + "value": "collect_machine_food", + "desc": "宠粮记录-狗粮机领取" + }, + { + "key": "food_record:finish_task", + "value": "finish_one_task", + "desc": "宠粮记录-完成任务" + }, + { + "key": "dog_record:my_invite", + "value": "my_invite", + "desc": "宠物记录-我的邀请" + }, + { + "key": "dog_record:rewards", + "value": "rewards", + "desc": "宠物记录-我的奖励" + }, + { + "key": "dog_record:dog_food", + "value": "pet_food", + "desc": "宠物记录-宠粮记录" + }, + { + "key": "dog_record:love_points", + "value": "love_points", + "desc": "宠物记录-爱心点数" + }, + { + "key": "dog_tip:dog_food_lack", + "value": "pet_food_lack", + "desc": "提示-狗粮不足" + }, + { + "key": "dog_tip:max_grow", + "value": "max_grow", + "desc": "提示-最大领养次数" + }, + { + "key": "dog_tip:please_collect_love", + "value": "please_collect_love", + "desc": "提示-请先收集爱心" + }, + { + "key": "dog_tip:continue_grow", + "value": "continue_grow", + "desc": "提示-当前宠物还能养" + }, + { + "key": "dog_tip:machine_running", + "value": "pet_food_machine_running", + "desc": "提示-宠粮生产中" + }, + { + "key": "dog_tip:reward_remove", + "value": "reward_remove", + "desc": "提示-奖品下架" + }, + { + "key": "dog_tip:reward_get_max", + "value": "reward_get_max", + "desc": "提示-超过获取最大上限" + }, + { + "key": "dog_tip:reward_lack", + "value": "sold_out", + "desc": "提示-奖品不足" + }, + { + "key": "dog_text:hungry", + "value": "i_am_hungry", + "desc": "养狗话术-我饿了" + }, + { + "key": "dog_tip:get_food", + "value": "congrats_for_getting", + "desc": "提示-获得狗粮" + }, + { + "key": "dog_tip:max", + "value": "reached_the_max", + "desc": "提示-达到最大值" + } + ], + "desc": "宠物养成模板通用语言包" + }, + "chat": { + "parts": [ + { + "key": "chat:token_limit", + "value": "chat_token_limit", + "desc": "对话-token不足" + }, + { + "key": "chat:day_limit", + "value": "chat_day_limit", + "desc": "对话-每日限制" + }, + { + "key": "chat:chat", + "value": "chat", + "desc": "对话-每日限制" + }, + { + "key": "chat:min_ago", + "value": "mins_ago", + "desc": "对话-分钟前" + }, + { + "key": "chat:hour_ago", + "value": "hours_ago", + "desc": "对话-小时前" + }, + { + "key": "chat:sys_guide", + "value": "conversation_and_chat", + "desc": "对话-系统消息" + } + ], + "desc": "签到特有组件" + }, + "vs": { + "parts": [ + { + "key": "vs:prize", + "value": "prize", + "desc": "对战-首页赛程奖励" + }, + { + "key": "vs:your_choice", + "value": "your_choice", + "desc": "对战-你的选择" + }, + { + "key": "vs:win", + "value": "cap_win", + "desc": "对战-赢" + }, + { + "key": "vs:draw", + "value": "cap_draw", + "desc": "对战-平局" + }, + { + "key": "vs:blue_team", + "value": "blue_team", + "desc": "对战-蓝队" + }, + { + "key": "vs:red_team", + "value": "red_team", + "desc": "对战-红队" + }, + { + "key": "vs:coin_vote_team", + "value": "spend_coin_to_vote_team", + "desc": "对战-花费积分投队伍" + }, + { + "key": "vs:vote_team", + "value": "vote_team", + "desc": "对战-投队伍" + }, + { + "key": "vs:vote_sure", + "value": "vote_sure", + "desc": "对战-投票确认" + }, + { + "key": "vs:no_scheduled", + "value": "no_scheduled", + "desc": "对战-暂无赛程" + }, + { + "key": "vs:schedule", + "value": "schedule", + "desc": "对战-赛程" + }, + { + "key": "vs:participated", + "value": "participated", + "desc": "对战-已参加" + }, + { + "key": "vs:vote_soon", + "value": "vote_soon", + "desc": "对战-即将投票" + }, + { + "key": "vs:vote", + "value": "vote", + "desc": "对战-投票" + }, + { + "key": "vs:pending", + "value": "pending", + "desc": "对战-待结算" + }, + { + "key": "vs:settled", + "value": "settled", + "desc": "对战-已结算" + }, + { + "key": "vs:congrats", + "value": "congrats", + "desc": "对战-恭喜你" + }, + { + "key": "vs_tip:vote_success", + "value": "vote_success", + "desc": "对战-投票成功" + }, + { + "key": "vs_tip:non_voting_hours", + "value": "non_voting_hours", + "desc": "对战-非投票时段无法投票" + }, + { + "key": "vs_tip:vote_chance_lack", + "value": "vote_chance_lack", + "desc": "对战-投票机会不足" + }, + { + "key": "vs_tip:vote_limit", + "value": "vote_limit", + "desc": "对战-投票已达上限" + }, + { + "key": "vs_tip:vote_failed", + "value": "vote_failed", + "desc": "对战-投票失败" + }, + { + "key": "vs:odds", + "value": "prize", + "desc": "对战-赔率" + }, + { + "key": "vs:playing", + "value": "playing", + "desc": "对战-比赛中" + }, + { + "key": "vs:vote_chances", + "value": "vote_chances", + "desc": "对战-投票机会" + } + ], + "desc": "赛事竞猜特有组件" + }, + "mall": { + "parts": [ + { + "key": "mall:redeem_reward", + "value": "spend_coin_redeem_reward", + "desc": "商城-兑换奖品确认" + }, + { + "key": "mall:redeem_sure", + "value": "redeem_sure", + "desc": "商城-兑换确认" + }, + { + "key": "mall:redeem", + "value": "redeem", + "desc": "商城-兑换" + }, + { + "key": "mall_tip:prize_restocking", + "value": "prize_restocking", + "desc": "商城-补货中" + } + ], + "desc": "兑换商城组件" + }, + "uno": { + "parts": [ + { + "key": "uno_tip:chance_lack", + "value": "card_chance_lack", + "desc": "uno卡牌提示-抽卡机会不足" + }, + { + "key": "uno_tip:props_lack", + "value": "props_lack", + "desc": "uno卡牌提示-道具不足" + }, + { + "key": "uno_tip:props_none", + "value": "props_lack", + "desc": "uno卡牌提示-道具不存在" + }, + { + "key": "uno:chance", + "value": "raffle_num", + "desc": "uno卡牌-抽卡机会" + }, + { + "key": "uno:use", + "value": "use", + "desc": "uno卡牌-使用" + }, + { + "key": "uno:get_color_card", + "value": "get_color_card", + "desc": "uno卡牌-获得指定颜色的1张牌" + }, + { + "key": "uno:get_three_card", + "value": "get_three_card", + "desc": "uno卡牌-获得任意颜色的3张牌" + }, + { + "key": "uno:get_five_card", + "value": "get_five_card", + "desc": "uno卡牌-获得任意颜色的5张牌" + }, + { + "key": "uno:action_card", + "value": "action_card", + "desc": "uno卡牌-功能牌" + }, + { + "key": "uno:next", + "value": "next", + "desc": "uno卡牌-下一张" + }, + { + "key": "uno:congratulation", + "value": "congratulation", + "desc": "uno卡牌-恭喜你" + }, + { + "key": "uno:you_got_reward", + "value": "you_got_reward", + "desc": "uno卡牌-获得奖励" + }, + { + "key": "uno:choose_a_color", + "value": "choose_a_color", + "desc": "uno卡牌-请选择颜色" + }, + { + "key": "uno:got_a_new_card", + "value": "got_a_new_card", + "desc": "uno卡牌-获得一张新卡牌" + }, + { + "key": "uno:collect", + "value": "collect", + "desc": "uno卡牌-收集" + }, + { + "key": "uno:action_card_unlocked", + "value": "action_card_unlocked", + "desc": "uno卡牌-功能牌已解锁" + }, + { + "key": "uno:claim_prize", + "value": "claim_prize", + "desc": "uno卡牌-领取奖励" + } + ], + "desc": "uno卡牌特有组件" + }, + "coin_log": { + "parts": [ + { + "key": "coin_log:mall", + "value": "coin_log_mall", + "desc": "积分日志-积分兑换" + }, + { + "key": "coin_log:vote", + "value": "coin_log_vote", + "desc": "积分日志-活动投票" + }, + { + "key": "coin_log:expired", + "value": "coin_log_expired", + "desc": "积分日志-积分过期" + }, + { + "key": "coin_log:reward", + "value": "coin_log_reward", + "desc": "积分日志-活动奖励" + }, + { + "key": "coin_log:task", + "value": "coin_log_task", + "desc": "积分日志-任务奖励" + }, + { + "key": "coin_log:title", + "value": "coin_log_title", + "desc": "积分日志-积分记录" + }, + { + "key": "coin_log:all", + "value": "all", + "desc": "积分日志-全部" + }, + { + "key": "coin_log:add", + "value": "got", + "desc": "积分日志-获得" + }, + { + "key": "coin_log:der", + "value": "deduct", + "desc": "积分日志-扣除" + } + ], + "desc": "系统积分日志" + } +} diff --git a/asset/campaign/lang/ar.json b/asset/campaign/lang/ar.json new file mode 100644 index 0000000..aa989f7 --- /dev/null +++ b/asset/campaign/lang/ar.json @@ -0,0 +1,761 @@ +{ + "close": "إغلاق", + "invite_share_text": "اضغط للعرض", + "copy_link": "نسخ الرابط", + "copy_success": "تم نسخ الرابط بنجاح", + "invite_friend": "دعوة الأصدقاء", + "invite_friend_": "مشاركة عبر", + "total_get": "يمكن الحصول على", + "can_get": "يمكن الحصول على", + "my_invite": "سجل الدعوة", + "invite_record": "سجل الدعوة", + "need_invite": "ما زال يحتاج للدعوة", + "bonus_rules": "قواعد المكافآت", + "activity_rules": "قواعد النشاط", + "invite_no_record": "لا توجد سجلات دعوة حتى الآن", + "invite_time": "وقت الدعوة", + "user_id": "الايدي المستخدم", + "reward_cond": "مكافآت منتظمة", + "target_receive_prizes": "بعد تحقيق الشروط، طريقة استلام المكافأة", + "receive_prizes": "طريقة استلام الجوائز", + "copy": "نسخ الوصلة", + "bonus_content": "شروط المكافأة", + "prize_details": "تفاصيل الجائزة", + "end_time": ":وقت الانتهاء", + "start_time": ":وقت البدء", + "activity_time": "وقت النشاط", + "extra_prizes": "مكافآت إضافية", + "quantity": "كمية", + "prize": "الجائزة", + "download_for_each_friend": "من الأصدقاء للتنزيل{{num}}في كل مرة تتم دعوة", + "accumulate_friend_downloads": "الأصدقاء بشكل تراكمي للتنزيل{{num}}تم بدعوة ", + "max_invite_friend": "يمكن لكل مستخدم إحالة حد أقصى من {{num}} صديق(أصدقاء).", + "register_for_each_friend": "كل {{num}} تسجيل", + "accumulate_friend_register": "التسجيل التراكمي {{num}", + "my_task": "مهامي", + "fans": "حكم", + "target_fans": "تحقيق", + "install_and_finish_all_cond": "يجب على خط الند للتنزيل واستكمال جميع المهام للتأهل.", + "install_and_finish_one_cond": "يجب على خط الند للتنزيل واستكمال مهمة واحدة للتأهل.", + "completed": "تم", + "undone": "للقيام به", + "friend_record": "دعوة الأصدقاء", + "task_1": "المهمة 1", + "task_2": "المهمة 2", + "task_3": "المهمة 3", + "invite_friends_to_register": "كل {{num}} تسجيل", + "invite_friends_to_install": "من الأصدقاء للتنزيل{{num}}في كل مرة تتم دعوة", + "no_record": "لا يوجد سجل حتى الآن", + "invite_friends_to_target": "دعوة {{num}} صديق(أصدقاء) لإكمال المهمة", + "target_for_each_friend": "كل {{num}} إحالة تكمل المهمة", + "accumulate_friend_target": "إحالات التراكمية {{num}} تكمل المهمة", + "prize_list": "قائمة المكافآت", + "regular_rewards": "مكافآت منتظمة", + "extra_rewards": "مكافآت إضافية", + "activity_end_text": "لقد انتهى هذا الحدث@ شكرًا لانضمامك إلينا@ أتمنى رؤيتك مرة أخرى!", + "receive": "احصل", + "contact_customer_service": "يرجى التواصل مع خدمة العملاء للاستلام", + "lottery": "دوران", + "draws_num": "دورات", + "better_luck_next_time": "حاول حظك في المرة القادمة", + "no_winning_record": "لا يوجد سجل حتى الآن", + "prize_name": "مكافأة", + "lottery_service_err": "خطأ في الخدمة، يرجى المحاولة مرة أخرى في وقت لاحق", + "draws_none": "انتهت اليانصيب", + "confirm": "حسنًا", + "try_your_luck": "اشعر بالحظ السعيد", + "get_prize_to_app": "قم بتنزيل التطبيق لاستلام جائزتك الآن", + "target_cond_1": "المهمة 1", + "target_cond_2": "المهمة 2", + "target_cond_3": "المهمة 3", + "all_tasks_to_draw": "يجب على فريقك تنزيل وإكمال جميع المهام للحصول على {{num}} سحب(سحوبات)", + "one_tasks_to_draw": "يجب على فريقك تنزيل وإكمال مهمة واحدة للحصول على {{num}} سحب(سحوبات)", + "draws_obtained": "سحبي/سحوباتي:", + "reward_record": "سجلات المكافآت", + "to_complete": "لإكمال", + "completed_times": "مرات الاكتمال", + "winning_record": "سجلات المكافآت", + "Winning_time": "تاريخ", + "thank": "المرة القادمة", + "no_receive_record": "لا يوجد سجل حتى الآن", + "week_0": "الأحد", + "week_1": "الاثنين", + "week_2": "الثلاثاء", + "week_3": "الأربعاء", + "week_4": "الخميس", + "week_5": "الجمعة", + "week_6": "السبت", + "invite_friend_install_get_sign": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق وستتلقى بطاقة مكياج واحدة.", + "invite_num": "الإحالات: {{num}}", + "sign_day_num": "تسجيل الوصول في {{num}} يوم(أيام)", + "continue_day_num": "تم تسجيل الوصول بشكل مت连续 لمدة {{num}} يوم(أيام)", + "day": "يوم", + "sign_card": "استرداد يوم فائت", + "invite_friend_get_sign_card_text": "فاتك يوم؟ ادعُ أصدقائك لتنزيل التطبيق واحصل على بطاقة تعويض!", + "obtain": "احصل", + "use_sign_card": "استخدم بطاقة التعويض", + "confirm_use_sign_card": "هل أنت متأكد من استخدامه في {{m}}/{{d}}؟ ", + "sign_success": "تسجيل الوصول", + "you_got": "لديك ", + "i_see": "فهمت", + "done_sign_day_num": "تم تسجيل الوصول لمدة {{num}} يوم(أيام)", + "done_continue_day_num": "تم تسجيل الوصول بشكل مت连续 لمدة {{num}} يوم(أيام)", + "sign_ok": "تسجيل الوصول", + "card_sign_ok": "تحقيق النجاح", + "continue_sign_ok": "تسجيل الوصول", + "continue_sign_get_reward_text": "صلابة النجاح للفوز بالمكافآت", + "sign_get_reward_text": "سجل الحضور يوميًا للفوز بالمكافآت!", + "sign_card_lack": "نقص بطاقة الماكياج", + "sign_fail": "فشلت عملية تسجيل الدخول، يرجى تحديث الصفحة", + "best_fan": "أعلى المعجبين", + "top_fans": "أعلى المعجبين", + "invite_num_title": "إحالة", + "no_rank_record": "لا يوجد سجل حتى الآن", + "vote_none": "انتهت المدة الزمنية للتصويت", + "vote_service_err": "خطأ في الخدمة، يرجى المحاولة مرة أخرى في وقت لاحق", + "hour": "س", + "minute": "د", + "second": "ث", + "hour_f": "الساعة", + "minute_f": "الدقيقة", + "second_f": "الثانية", + "vote_num": "هناك حاليًا {{num}} أصوات متاحة", + "here_is_the_quiz_title": "هنا يتم عرض عنوان الاختبار", + "option": "خيار", + "countdown": "العد التنازلي", + "end": "نهاية", + "click_image_select": " انقر على الصورة لتحديدها", + "wait_reward_reward": "يرجى العودة لاحقًا للحصول على النتائج", + "sure": "حسنًا", + "submit": "إرسال", + "next_qa": "التالي", + "right": "صحيح", + "error": "خطأ", + "right_answer": "الإجابة الصحيحة:", + "explain": "تفسير", + "home": "الصفحة الرئيسية", + "share": "مشاركة", + "download_app_qa": "حمّل التطبيق للانضمام إلى الاختبار", + "qa_service_err": "خطأ في الخدمة، يرجى المحاولة مرة أخرى في وقت لاحق", + "qa_none": "ليس لديك أي فرص للإجابة حتى الآن. @يرجى دعوة أصدقائك للحصول على فرص أكثر.", + "start": "بدء", + "challenge_failed": "فشل", + "qa_right": "صحيح ", + "keep_try": "استمر في المحاولة", + "congratulation": "مبروك!", + "please_choose": "اختر", + "qa_loading": "التحميل", + "grow_big": "نما {{name}}", + "click_receive": "احصل", + "after_receive": "الحصول على", + "tree_grow_can_get": "ازرع الشجرة وستحصل عليها.", + "fertilize_standard_text": "فقط قم بتطبيق {{num}}٪ من السماد إضافي، وستحقق الهدف!", + "fertilize": "سماد", + "fertilizer": "سماد", + "need_nutrients_will_die": "أحتاج إلى {{num}} جرام من السماد للحفاظ على صحتي.", + "get_new_tree": "احصل على شتلة جديدة", + "tree_grow_max_text": "شجرتك نمت، ها هدية صغيرة لك.", + "little_tree": "شجرتي", + "fertilize_num": "أسمد {{num}} جرام", + "some_withered": "{{name}} يشيب", + "some_revive": "{{name}} عاد إلى الحياة", + "grow_big_and_get_reward": "{{name}} نمت، لقد حصلت للتو على {{reward_title}}", + "get_grow": "احصل على {{name}}", + "props_lack": "لا يوجد ما يكفي من الملحقات.", + "cannot_lv_up": "لقد وصلت إلى أعلى مستوى.", + "invite_friend_install_get_fertilizer": "ادعو {{num}} من الأصدقاء لتحميل التطبيق، وستحصل على {{grow_num}} من السماد.", + "received_sapling": "لقد تلقيت شتلة.", + "pick_name": "اختر اسمًا", + "growth_manual": "دليل النمو", + "get_nourishment": "احصل على سماد", + "plant_new_tree": "ازرع شجرة", + "tree_revive": "انقذ شجرتك", + "timeout_tree_die": "بسبب نقص التسميد لفترة طويلة، يكون شجرتك قد ذبلت", + "invite_friend_install_revive_tree": "ادعُ {{num}} من الأصدقاء لتحميل التطبيق ويمكنك إنقاذ شجرتك", + "dog_grow_can_get": "اصطحب الجرو وستتلقاه", + "feed_standard_text": "ما عليك سوى إطعام {{num}}٪ إضافية لتحقيق الهدف!", + "feed": "تغذية", + "dog_food": "طعام الكلاب", + "need_dog_food_will_leave": "أحتاج إلى {{num}} غرامًا من الطعام، أو قد يتعين علي الخروج في مغامرة صغيرة خارج منزلنا المريح. ووف!", + "get_new_dog": "تبنّى جروًا", + "dog_grow_max_text": "لقد نمت جروك، هذه هدية صغيرة لك", + "little_dog": "جرو صغير", + "feed_num": "أطعم {{num}} غرامًا من الطعام", + "some_leave": "{{name}} ترك", + "some_come": "{{name}} عاد", + "invite_friend_install_get_dog_food": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق، وستتلقى {{grow_num}} جرام من الطعام", + "received_dog": "أنت تتبنى جروًا", + "get_dog_food": "احصل على طعام", + "plant_new_dog": "تبني كلبًا", + "rescue_puppy": "إنقاذ الجرو", + "timeout_dog_go": "بسبب أنه لم يشعر بالحب والطعام لفترة طويلة، هرب جروك من المنزل", + "invite_friend_install_rescue_puppy": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق ويمكنك إنقاذ جروك.", + "get_collect_num": "لقد تلقيت قطعة واحدة من {{reward_title}}", + "fixed_point": "عدد محدد", + "this_props_lack": "لا يوجد لديك هذا العنصر بعد", + "help_record": "سجل الدعوات", + "no_help_record": "لا يوجد سجل حتى الآن", + "install_help_record": "صديق قام بتنزيل التطبيق", + "open_help_record": "صديق فتح التطبيق", + "click_help_record": "صديق نقر على الرابط", + "service_err": "خطأ في الخدمة، يرجى المحاولة مرة أخرى في وقت لاحق", + "select_reward": "اختر مكافأة", + "view_help_rule": "تحقق من القواعد", + "help_rule": "قواعد الدعوة", + "install_help": "قم بتنزيل التطبيق للتعزيز", + "install_help_text": "كل صديق قام بتنزيل التطبيق، التقدم [[+{{num}}%]]", + "open_help": "افتح التطبيق للتعزيز", + "open_help_text": "كل صديق فتح التطبيق، التقدم [[+{{num}}%]]، يمكن الحصول على {{limit_num}}%", + "click_help": "انقر على الرابط للتعزيز", + "click_help_text": "كل صديق نقر على رابط الدعوة، التقدم [[+{{num}}%]]، يمكن الحصول على {{limit_num}}%", + "invite_friends_receive_free_gifts": "ادعو أصدقاءك للحصول على مكافآت مجانية!", + "get_prizes": "احصل على هذا المكافأة", + "help_success": "نجاح", + "also_get_free": "يمكنك أيضًا الحصول عليه مجانًا", + "install_get_free_reward": "قم بتنزيل التطبيق للحصول على مكافآت مجانية", + "install_get_reward": "احصل على التطبيق، وفتح الجوائز", + "received_success": "نجاح", + "ballot_record": "سجل المكافآت", + "no_ballot_record": "لا يوجد سجل حتى الآن", + "ballot_none": "ليس لديك أي فرص حتى الآن. يرجى دعوة أصدقائك للحصول على مزيد من الفرص", + "share_good_luck": "شارك الحظ", + "ballot": "فهمت", + "answer_record": "سجل المكافآت", + "challenge_results": "مكافأة", + "challenge_time": "تــــاريــــخ", + "no_answer_record": "لا يوجد سجل حتى الآن", + "answer_none": "انتهت الاختبارات", + "please_choose_answer": "يرجى اختيار إجابة", + "answer_countdown": "العد العكسي", + "got_prizes": "الفوز:", + "continue_free_get": "استمر في التخفيض", + "finish_help": "اكتمل", + "reward_send_your_account": "تم إرسال المكافأة إلى حسابك", + "no_reward_record": "لا يوجد سجل حتى الآن", + "download_app_ballot": "قم بتنزيل التطبيق للانضمام إلى الحملة", + "yesterday": "أمس", + "today": "اليوم", + "prize_record": "سجل المكافآت", + "get_reward_time": "تاريخ", + "no_sign_card": "لم أوقع بطاقة بديلة بعد", + "get_more_knowledge": "حاول حظك في المرة القادمة", + "qa_very_hard": "من هو الرجل الذكي؟", + "num": "اختبار", + "contact_customer_service_var": "يرجى التواصل مع ({{contact}})", + "like_share_people_lucky": "الأشخاص المشتركون لديهم حظ أفضل. شارك الآن!", + "my_reward": "جائزتي", + "no_install_prompt": "لم يتم تثبيت منصة وسائل التواصل الاجتماعي هذه بعد", + "please_login": "الرجاء تسجيل الدخول", + "got_num": "(حصل على {{num}} مرات)", + "completed_num": "(أنجز {{num}} مرات)", + "fixed_roll_none": "لا تمتلك نرد محظوظة بعد. دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق والحصول على 1 نرد محظوظ.", + "fixed_roll_none_limit": "لا يوجد نرد محظوظ بعد. دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق للحصول على نرد محظوظ واحد، بحد أقصى {{limit}} نرد محظوظ.", + "invite_friend_install_get_roll_chance": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق والحصول على {{chance}} نرد محظوظ(محظوظة).", + "invite_friend_install_get_roll_chance_limit": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق والحصول على {{chance}} نرد(نردات)، بحد أقصى {{limit}} نرد.", + "invite_friend_register_get_roll_chance": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل للحصول على {{chance}} نرد(نردات).", + "invite_friend_register_get_roll_chance_limit": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل للحصول على {{chance}} نرد(نردات)، بحد أقصى {{limit}} نرد.", + "dice_task_finish": "أكمل للحصول على {{chance}} نرد(نردات)", + "dice_task_finish_limit": "أكمل للحصول على {{chance}} نرد(نردات)، بحد أقصى {{limit}} إكمالات.", + "dice_task_num": "إجمالي النرد المحصل من المهام:", + "dice_task_cond_one": "أكمل أي مهمة للحصول على المزيد من النرد.", + "dice_task_cond_all": "أكمل جميع المهام للحصول على {{chance}} نرد(نردات).", + "dice_task_cond_all_limit": "أكمل جميع المهام للحصول على {{chance}} نرد(نردات)، بحد أقصى {{limit}} مرة(مرات). لقد حصلت على {{num}} مرة(مرات) حتى الآن.", + "spin_now": "دور الآن", + "spinning": "في دوران", + "expires_in": "ينتهي في", + "records": "سجلات", + "luck_you": "حظ سعيد لك", + "get_extra_reward": "مكافأة إضافية لك!", + "share_get": "شارك للحصول على", + "upgrade_reward": "ترقية الجائزة", + "super_upgrade": "مفاجأة! ترقية خارقة!", + "preparation": "لكل دورة", + "invite_get_energy": "دعوة للحصول على طاقة", + "invite_friend_get_energy": "ادعو الأصدقاء للحصول على الطاقة", + "up_to": "حتى", + "spin": "دورة", + "away": "{{num}} بعيداً", + "win_left_energy": "اربح {{cash}} مع مجرد {{num}} دورة", + "enjoy_credit": "استمتع برصيدك", + "invite_no_record_reward": "لم تقم بدعوة أي شخص حتى الآن. قم بدعوة أصدقائك لتحصل على مكافآت!", + "spin_reward": "مكافأة الدوران", + "share_reward": "مكافأة المشاركة", + "start_reward": "بدء الحوافز", + "left_cash_get_reward": "تبقى {{left}} فقط للحصول على مكافأة بقيمة {{cash}}", + "auto_spin": "الدوران تلقائيًا في [[{{second}}]] ثانية", + "guarantee_to": "ضمان الفوز ب {{cash}} مع دوران واحد فقط!", + "auto_select": "التحديد تلقائيًا في [[{{second}}]] ثانية", + "open": "افتح", + "select_box": "اختر صندوق هدايا واحد لترى كم سيكون مكافأة المال الخاصة بك", + "money_reward": "المكافأة المالية", + "jackpot_best_prize": "جائزة كبرى! أفضل جائزة", + "best_prize": "أفضل&&جائزة", + "almost_reward": "على وشك الوصول إلى المكافأة!", + "claimed_reward": "أكثر من [[10000+]] شخصًا ادعوا المكافأة", + "pass_on_energy": "لقد أرسلوا الطاقة إليك!", + "victory_tip": "النصر في متناول يدك، [[انتهزه]]", + "min_won_barrage": "{{name}} فاز [[{{cash}}]] قبل {{min}} دقيقة! رائع!", + "closer_to_prize": "أنت تقترب أكثر من الجائزة الكبيرة", + "shine_arrived": "حان وقتك للتألق، اغتنمه", + "won_barrage": "[[{{name}}]] قد تقدم بمطالبة [[{{cash}}]]", + "get_money_reward": "الحصول على مكافأة نقدية", + "surprise_for_you": "مفاجأة لك", + "last_spin_win": "دفعة واحدة أخيرة للفوز!", + "energy": "طاقة", + "token": "رمز", + "your_reward": "مكافأتك", + "go_to": "لاستخدام", + "click_contact": "اتصل بخدمة العملاء", + "click_contact_tip": "تم نسخ معلومات الاتصال\nالرجاء الاتصال بنا", + "see_reward": "عرض الجوائز", + "prize_gone": "الجوائز ذهبت", + "no_reward_get": "لقد تأخرت كثيرًا ، لقد تم توزيع جميع الجوائز!", + "no_more_record": "لا توجد سجلات أكثر", + "help_fail": "فشل", + "grand_opening": "افتتاح كبير", + "get_reward_after_play": "سيحصل الجميع على مكافأة بعد لعب اللعبة!", + "play_and_get_prize": "العب وانتظر جائزتك!", + "won_free_gift": "فزت بالهدية المجانية!", + "download_app_get_gift": "نزّل التطبيق للحصول على جائزتك!", + "download": "تحميل", + "jackpot": "جائزة كبرى", + "play": "لعب", + "install_ineligible": "غير مؤهل (ليس تثبيتًا جديدًا)", + "unlock_your_luck": "افتح حظك", + "spin_and_win": "دوران والفوز", + "play_to_win_prize": "العب للفوز بجائزة!", + "you_got_the_best_prize": "لقد حصلت على أفضل الجوائز", + "play_and_win": "العب وانتصر", + "download_to_get": "حمّل للحصول على", + "best_prize_!": "الجائزة الأفضل!", + "roll_dice_number": "رمي النرد، النتيجة {{point}}", + "lucky_dice_number": "استخدام النرد الحظ ، العدد {{point}}", + "day_sign": "تسجيل الدخول اليومي", + "dice_record": "السجلات", + "finish_friend_register": "إكمال مهمة تسجيل الأصدقاء", + "finish_friend_install": " إكمال مهمة تحميل التطبيق الموصى به", + "finish_lucky_dice_task": "إكمال مهمة الحصول على نرد الحظ", + "fragment": "كسر", + "click": "انقر", + "collect_fragment_compare_reward": "اجمع {{num}} كسور لتكوين الجائزة", + "craft_fragments": "صنع الرقائق", + "reward_lack_contact_customer_service": "نفد المخزون. الرجاء الاتصال بخدمة العملاء للمساعدة", + "join_in_campaign": "انضم إلى الحملة", + "contact": "اتصال", + "all": "الجميع", + "contact_information": "طرق الاتصال", + "no_more_dice": "لا مزيد من النرجيلة", + "try_your_luck_first_upper": "جرب حظك", + "fill_in": "املء", + "submit_success": "نجاح", + "please_do_not_submit_repeatedly": "من فضلك لا ترسل مرارًا", + "submitted": "تم تقديمه", + "please_complete_the_form": "من فضلك أكمل النموذج", + "welcome_gifts": "هدايا الترحيب", + "spin_to_win": "دوّر للفوز", + "view": "عرض", + "use": "الاستخدام", + "get_and_use": "استلام والاستخدام", + "invite_friend_install_get_lottery_chance": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق، وستحصل على {{chance}} فرصة(فرص).", + "invite_friend_install_get_lottery_chance_limit": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق، وستحصل على {{chance}} فرصة(فرص)، بحد أقصى {{limit}} فرصة(فرص).", + "invite_friend_register_get_lottery_chance": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل، وستحصل على {{chance}} فرصة(فرص).", + "invite_friend_register_get_lottery_chance_limit": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل، وستحصل على {{chance}} فرصة(فرص)، بحد أقصى {{limit}} فرصة(فرص).", + "lottery_task_finish": "ستحصل على {{chance}} فرصة(فرص) عند الإكمال", + "lottery_task_finish_limit": "ستحصل على {{chance}} فرصة(فرص) عند الإكمال، بحد أقصى {{limit}} مرة(مرات)", + "lottery_task_num": "إجمالي فرص السحب التي تم الحصول عليها من المهام", + "lottery_task_cond_one": "إنجاز أي مهمة يمكن أن يؤدي إلى الحصول على المزيد من فرص السحب", + "lottery_task_cond_all": "إكمال جميع المهام يمكن أن يؤدي إلى الحصول على {{chance}} فرصة(فرص)", + "lottery_task_cond_all_limit": "إكمال جميع المهام يمكن أن يؤدي إلى الحصول على {{chance}} فرصة(فرص)، بحد أقصى {{limit}} مرة(مرات)، وقد تم الحصول على {{num}} مرة(مرات).", + "raffle_chances": "فرص السحب", + "quiz_chances": "فرص الإجابة", + "get_lottery_chances": "الحصول على فرص السحب", + "remaining_raffle_chances": "أوقات السحب المتبقية", + "lottery_again": "مرة أخرى", + "use_immediately": "لاستخدام", + "wow_you_got": "وأنت تستحق التهنئة!", + "next_time": "في المرة القادمة", + "finish_all_task": "المهام منجزة", + "finish_one_task": "تم المهمة", + "sign_in_every_day_can_get_dice": "قم بتسجيل الدخول كل يوم، يمكنك الحصول على {{num}} نرد(نردات).", + "do_task_get_dice": "نفّذ المهام واحصل على النرد", + "do_task_get_lottery": "نفّذ المهام واحصل على الفرصة", + "refresh_tomorrow": "سيتم التحديث غدًا", + "click_icon": "انقر الأيقونة", + "paste_to_media": "الصق في الوسائط", + "get_prize": "احصل على الجوائز", + "copy_success_paste_to_media": "تم النسخ بنجاح ، يرجى اللصق على وسائل التواصل الاجتماعي", + "invite_friend_install_get_grow": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق والحصول على {{chance}} عنصر(عناصر) نمو.", + "invite_friend_install_get_grow_limit": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق والحصول على {{chance}} عنصر(عناصر) نمو، بحد أقصى {{limit}} عنصر(عناصر) نمو.", + "invite_friend_register_get_grow": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل والحصول على {{chance}} عنصر(عناصر) نمو.", + "invite_friend_register_get_grow_limit": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل والحصول على {{chance}} عنصر(عناصر) نمو، بحد أقصى {{limit}} عنصر(عناصر) نمو.", + "grow_task_finish": "أكمل للحصول على {{chance}} عناصر نمو", + "grow_task_finish_limit": "اكمل للحصول على {{chance}} عنصر(عناصر) نمو، يمكن إكمالها حتى {{limit}} مرة(مرات).", + "grow_task_cond_one": "أكمل أي مهمة للحصول على عناصر نمو", + "grow_task_cond_all": "أكمل جميع المهام للحصول على {{chance}} عناصر نمو", + "grow_task_cond_all_limit": "أكمل جميع المهام للحصول على {{chance}} عنصر(عناصر) نمو، حتى {{limit}} مرة(مرات)، وقد تم الحصول على {{num}} مرة(مرات).", + "do_task_get_grow": "أكمل المهام للحصول على عناصر النمو", + "easy_mode": "الوضع السهل", + "mins_ago": "{{min}} دقائق مضت", + "barrage_got_reward": "حصل على [[{{title}}]] من خلال سحب الحظ.", + "sold_out": "نفد", + "task_done": "تم المهمة", + "click_copy_link": "اضغط على \"نسخ الرابط\"", + "select_card": "اختيار بطاقة", + "raffle_chances_lack": "الفرص غير كافية", + "raffle_chances_lack_tip": "فرصتك في السحب غير كافية، اذهب إلى أسفل الصفحة وأكمل المهام للحصول على فرص جديدة للسحب.", + "get_more_chance": "احصل على المزيد من الفرص", + "flip_now": "اقلب الآن", + "raffle_num": "فرص السحب", + "win": "فوز", + "next_week_do": "الأسبوع المقبل", + "week_do_1": "تحديث الإثنين", + "week_do_2": "تحديث الثلاثاء", + "week_do_3": "تحديث الأربعاء", + "week_do_4": "تحديث الخميس", + "week_do_5": "تحديث الجمعة", + "week_do_6": "تحديث السبت", + "week_do_7": "تحديث الأحد", + "to_flip": "اذهب لسحب بطاقة", + "won_get": "مبروك", + "invite_friend_download": "دعوة {{num}} صديق(أصدقاء) لتحميل التطبيق", + "invite_friend_register": "دعوة {{num}} صديق(أصدقاء) للتسجيل", + "fixed_roll_none_register": "لا توجد نردات محظوظة بعد. دعوة {{num}} صديق(أصدقاء) للتسجيل واحصل على 1 نرد محظوظ.", + "fixed_roll_none_register_limit": "لا توجد نردات محظوظة حتى الآن. دعوة {{num}} صديق(أصدقاء) للتسجيل واحصل على 1 نرد محظوظ، بحد أقصى {{limit}} نردات محظوظة.", + "sign_in_every_day_can_get_lottery": "قم بتسجيل الدخول كل يوم للحصول على {{num}} فرصة(فرص) للفوز بجائزة.", + "finish_newcomer_task": "[[المبتدئ]] أكمل المهام للحصول على [[{{reward_title}}]]", + "done_newcomer_task": "مهام المبتدئين", + "register_help_record": "صديق قد أكمل التسجيل", + "register_help_text": "كل صديق أكمل التسجيل، التقدم [[+{{num}}%]]", + "register_help": "دعم التسجيل", + "invite_friend_install_get_qa": "دعوة {{num}} صديق(أصدقاء) لتنزيل التطبيق، يمكنك الحصول على {{chance}} فرصة للإجابة على الأسئلة.", + "invite_friend_install_get_qa_limit": "دعوة {{num}} صديق(أصدقاء) لتنزيل التطبيق، يمكنك الحصول على {{chance}} فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} فرصة.", + "invite_friend_register_get_qa": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل، يمكنك الحصول على {{chance}} فرصة للإجابة على الأسئلة.", + "invite_friend_register_get_qa_limit": "دعوة {{num}} صديق(أصدقاء) لإكمال التسجيل، يمكنك الحصول على {{chance}} فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} فرصة.", + "qa_task_finish": "عند الإكمال، يمكنك الحصول على {{chance}} فرصة للإجابة على الأسئلة.", + "qa_task_finish_limit": "عند الإكمال، يمكنك الحصول على {{chance}} فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} مرة.", + "qa_task_cond_one": "إكمال أي مهمة سيمكنك من الحصول على فرصة للإجابة على الأسئلة", + "qa_task_cond_all": "إكمال جميع المهام سيمكنك من الحصول على {{chance}} فرصة للإجابة على الأسئلة", + "qa_task_cond_all_limit": "إكمال جميع المهام سيمكنك من الحصول على {{chance}} فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} فرصة، وقد حصلت على {{num}} فرصة", + "sign_in_every_day_can_get_qa": "كل يوم ستحصل على {{num}} فرصة للإجابة على الأسئلة.", + "do_task_get_qa": "قم بإنجاز المهام للحصول على فرص للإجابة على الأسئلة", + "help_install": "حصل [[{{name}}]] على [[تعزيز التثبيت]]", + "help_register": "حصل [[{{name}}]] على [[تعزيز التسجيل]]", + "help_open": "حصل [[{{name}}]] على [[تعزيز الزيارة اليومية]]", + "help_click": "حصل [[{{name}}]] على [[تعزيز النقر]]", + "finish_help_get_reward": "[[{{name}}]] أكمل مهمة الدعم، وحصل على [[{{reward_title}}]]", + "a_gift_to_you": "هدية لك", + "choose_it": "اختره", + "nice_choice": "خيار رائع!", + "tip": "نصيحة", + "left_percent_get_reward": "فقط [[{{left}}%]] متبقية للحصول على المكافأة", + "ensure_select_reward": "هل تأكدت من اختيار [[{{reward_title}}]]؟", + "reward_obtained": "تم الحصول على المكافأة", + "lucky": "محظوظ", + "percent_progress_for_you": "لقد حصلت على دعم مجاني [[{{percent}}%]]!", + "invite": "دعوة", + "help_task": "مهمة الدعم", + "finish_all_task_help_parent": "أكمل جميع المهام التالية لدعم أصدقائك", + "finish_one_task_help_parent": "أكمل أي من المهام التالية لدعم أصدقائك", + "task_index": "المهمة {{index}}", + "raise_pet_to_get_free_gift": "اعتنِ بحيوانك الأليف للحصول على هدايا مجانية", + "step": "خطوة", + "pick_item": "اختر العنصر", + "raise_pet": "تربية حيوان أليف", + "get_free_gift": "احصل على هدية مجانية", + "has_got": "{{name}} حصل على {{reward_title}}", + "more_unexpected_gifts": "المزيد من الهدايا غير المتوقعة أثناء تربية حيوانك الأليف", + "pick_it": "اختره", + "picked": "اختار", + "your_gift_confirm": "يرجى تأكيد هديتك", + "free": "مجاني", + "raise_the_dog_to_get_your": "ارفع الكلب للحصول على خاصتك", + "free_gift": "هدية مجانية!", + "expires_in_day": "تنتهي صلاحيتها بعد {{day}} يومًا", + "collect_more_love": "اجمع [[{{num}}]] نقطة حب إضافية للحصول على هدية مجانية", + "collect": "جمع", + "claim_now": "قم بالمطالبة الآن", + "feed_more_times": "أضف {{num}} مرة أخرى", + "get_more": "احصل على المزيد", + "first_referral_bonus": "مكافأة الإحالة الأولى!", + "get_rewards_first_time": "احصل على مكافآت من خلال دعوة الأصدقاء للمرة الأولى", + "first_invite_receive": "ستتلقى الدعوة الأولى لمستخدم جديد [[{{num}}]]", + "invite_now": "الدعوة الآن", + "invite_get_dog_foods": "دعوة الأصدقاء لكسب الطعام", + "invite_friends": "دعوة الأصدقاء", + "pick_a_gift": "اختر هدية مجانية واحدة", + "feed_3_times": "إطعام 3 مرات", + "invite_new_user_extra_get": "دعوة مستخدم جديد لأول مرة يمكن أن يحصل على [[{{num}}]] إضافية", + "reward_upgraded": "ترقية المكافأة", + "reward_for_you": "[[{{reward_title}}]] لك", + "time_s_up": "انتهى الوقت!", + "play_again": "العب مرة أخرى", + "complete_tasks_to_earn_reward": "أكمل المهام لكسب المكافأة", + "super": "خارق", + "super_benefit": "الفوائد الفائقة", + "task_cond_one": "أكمل أي مهمة للحصول على [[جائزة]]", + "task_cond_all": "أكمل جميع المهام للحصول على {{reward_title}}[[+{{num}}]]", + "congrats": "مبروك!", + "enjoy_your": "استمتع ب", + "try_again_to_claim": "حاول مرة أخرى للمطالبة بهديتك", + "collect_love": "اجمع الحب", + "finish_step": "أكملت مهمة المرحلة", + "finish_feed": "أكملت مهمة التغذية", + "friend_third_feed": "الصديق أكمل إطعام 3 مرات طعام الكلاب", + "friend_first_third_feed": "دعوة الأصدقاء لإطعام 3 مرات طعام الكلاب يوميًا", + "friend_select_reward": "الصديق اختار الجائزة", + "friend_first_select_reward": "دعوة الأصدقاء لاختيار الجائزة يوميًا", + "rewards": "جوائز", + "round_expired": "انتهت الجولة", + "love_points": "نقاط الحب", + "dog_food_lack": "يرجى الحصول على المزيد من طعام الكلاب", + "collect_machine": "تم استلام آلة طعام الكلاب", + "max_grow": "تجاوز الحد الأقصى لعدد التطورات", + "please_collect_love": "يرجى جمع الحب أولاً", + "continue_grow": "يمكن الاستمرار في تربية الحيوان الأليف الحالي", + "dog_food_machine_running": "يتم إنتاج طعام الكلاب", + "reward_remove": "الجائزة قد أزيلت", + "reward_get_max": "الجائزة قد تجاوزت الحد الأقصى للمكافآت", + "i_am_hungry": "أنا جائع!", + "effect_invite": "تمت دعوة صديق بنجاح", + "day_first_effect_invite": "الدعوة الناجحة الأولى لصديق في نفس اليوم", + "finish_many_feed": "تم إكمال عدة عمليات إطعام", + "daily_rewards": "المكافآت اليومية", + "come_back_tomorrow_for_more_rewards": "عد غدًا للحصول على المزيد من المكافآت!", + "claim_today_reward": "احصل على مكافأتك اليوم!", + "come_back_tomorrow": "عد غدًا!", + "fail_to_sign_progress_reset": "إذا لم تتمكن من تسجيل الدخول بشكل مستمر، سيتم إعادة تعيين تقدمك", + "signed_in": "تم تسجيل الدخول", + "signed_title": "تسجيل الدخول", + "you_got_the_gift_box": "لقد حصلت على صندوق الهدايا", + "use_it": "استخدمه", + "you_got_dog_food": "لقد حصلت على {{num}} من طعام الكلاب", + "you_got_reward": "لقد حصلت على {{reward_title}}", + "invite_contest": "دعوة المسابقة", + "rewards_earned_to_your_account": "ستذهب المكافآت المكتسبة [[مباشرة إلى]] حسابك", + "invite_more_friends": "دعوة المزيد من الأصدقاء", + "invited": "تمت دعوة {{num}}", + "daily_fortune_draw": "سحب الحظ اليومي", + "win_free_gift_every_day": "اربح هدية مجانية كل يوم!", + "draw_now": "اسحب الآن", + "day_num": "اليوم {{num}}", + "you": "أنت", + "blind_box": "صندوق أعمى", + "daily_draw": "سحب يومي", + "rankings": "التصنيفات", + "rank_reward": "جوائز التصنيف", + "sign_reward": "جوائز تسجيل الوصول", + "blind_reward": "جوائز صناديق المفاجآت", + "lucky_reward": "جوائز السحب", + "tomorrow": "غدًا", + "win_reward": "اربح[[{{title}}]]", + "rank_end": "انتهى الوقت", + "congrats_for_getting": "تهانينا على الحصول على", + "ends_in": "ينتهي بـ", + "invite_friend_download_app": "دعوة [[{{num}}]] صديق(أصدقاء) لتنزيل التطبيق", + "invite_friend_register_app": "دعوة [[{{num}}]] صديق(أصدقاء) للتسجيل", + "invite_friend_install_get_lottery_chance_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لتنزيل التطبيق، وستحصل على [[{{chance}}]] فرصة(فرص).", + "invite_friend_install_get_lottery_chance_limit_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لتنزيل التطبيق، وستحصل على [[{{chance}}]] فرصة(فرص)، بحد أقصى {{limit}} فرصة(فرص).", + "invite_friend_register_get_lottery_chance_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لإكمال التسجيل، وستحصل على [[{{chance}}]] فرصة(فرص).", + "invite_friend_register_get_lottery_chance_limit_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لإكمال التسجيل، وستحصل على [[{{chance}}]] فرصة(فرص)، بحد أقصى {{limit}} فرصة(فرص).", + "lottery_task_finish_v2": "ستحصل على [[{{chance}}]] فرصة(فرص) عند الإكمال", + "lottery_task_finish_limit_v2": "ستحصل على [[{{chance}}]] فرصة(فرص) عند الإكمال، بحد أقصى {{limit}} مرة(مرات)", + "lottery_task_cond_all_v2": "إكمال جميع المهام يمكن أن يؤدي إلى الحصول على [[{{chance}}]] فرصة(فرص)", + "lottery_task_cond_all_limit_v2": "إكمال جميع المهام يمكن أن يؤدي إلى الحصول على [[{{chance}}]] فرصة(فرص)، بحد أقصى {{limit}} مرة(مرات)، وقد تم الحصول على [[{{num}}]] مرة(مرات).", + "sign_in_every_day_can_get_lottery_v2": "قم بتسجيل الدخول كل يوم للحصول على [[{{num}}]] فرصة(فرص) للفوز بجائزة.", + "invite_friends_to_earn_reward": "دعُ الأصدقاء للفوز بالمكافأة", + "raffle_num_add": "فرصة [[+{{num}}]]", + "click_button_and_get_coins": "انقر على الزر لإكمال المهمة والحصول على المزيد من العملات", + "do_task_get_energy": "أكمل المهام لكسب الطاقة", + "coins": "{{num}} عملة", + "get_tasks": "احصل على المهام", + "next": "التالي", + "finish_task_title": "أكمل \"{{title}}\"", + "get_energy": "احصل على الطاقة", + "tasks": "المهام", + "invite_friend_install_get_gold": "ادعُ {{num}} من الأصدقاء لتحميل التطبيق، يمكنك الحصول على {{chance}} عملة.", + "invite_friend_install_get_gold_limit": "ادعُ {{num}} من الأصدقاء لتحميل التطبيق، يمكنك الحصول على {{chance}} عملة، بحد أقصى {{limit}} عملة.", + "invite_friend_register_get_gold": "ادعُ {{num}} من الأصدقاء لإكمال التسجيل، يمكنك الحصول على {{chance}} عملة.", + "invite_friend_register_get_gold_limit": "ادعُ {{num}} من الأصدقاء لإكمال التسجيل، يمكنك الحصول على {{chance}} عملة، بحد أقصى {{limit}} عملة.", + "gold_task_finish": "إكمال يمكنك الحصول على {{chance}} عملة", + "gold_task_finish_limit": "إكمال يمكنك الحصول على {{chance}} عملة، بحد أقصى {{limit}} مرة", + "gold_task_cond_one": "إكمال أي مهمة يمكنك من الحصول على عملة", + "gold_task_cond_all": "إكمال جميع المهام يمكنك من الحصول على {{chance}} عملة", + "gold_task_cond_all_limit": "إكمال جميع المهام يمكنك من الحصول على {{chance}} عملة، بحد أقصى {{limit}} مرة، وقد حصلت على {{num}} مرات", + "do_task_get_gold": "القيام بالمهام للحصول على عملة", + "task_none": "لا توجد مهام يمكن إكمالها", + "finish_task_earn_num": "إكمال المهمة يمكنك من الحصول على [[+{{num}}]]", + "reached_the_max": "وصلت إلى الحد الأقصى", + "has_got_style": "[[{{name}}]] حصل على [[{{reward_title}}]]", + "dog_food_num": "{{num}}غ طعام", + "in_production": "قيد الإنتاج", + "active_talk": "لم تزورني منذ وقت طويل. تعال أكثر للحصول على المزيد من المكافآت.", + "task_reset_talk": "إحدى جوائزك على وشك الانتهاء، تعال وتحقق منها.", + "dog_offline_talk": "لقد استلمت حصة من طعام الحيوانات الأليفة، يرجى الذهاب لاستلامها.", + "complete_task_talk": "لقد أكملت المهمة، تهانينا على الحصول على جائزة، تعال واستلمها.", + "current_total_prize_pool": "إجمالي الجوائز الحالية", + "get_coin": "[[{{name}}]] حصل على [[{{num}}]] عملة", + "join_coin_num": "[[{{name}}]] احصل على الذهب [[*{{num}}]]", + "join_coin": "امسك الذهب", + "coin_per_use": "{{num}} عملة ذهبية لكل استخدام", + "expected_to_receive_coin": "من المتوقع استلام [[{{num}}]] عملة ذهبية", + "collect_coin": "يمكن جمع [[{{num}}]] عملة ذهبية", + "more": "المزيد", + "expired": "منتهي الصلاحية", + "gold_coins_deposited": "وصلت العملات الذهبية", + "timeout_and_no_collection": "انتهى الوقت ولم يتم الاستلام", + "use_gold_coins_to_play": "استخدام [[{{num}}]] عملة ذهبية للعب؟", + "cancel": "إلغاء", + "play_limit_next_round": "لقد وصلت إلى حد اللعب! عد في الجولة التالية!", + "insufficient_balance_grab_gold": "رصيد غير كافٍ. لا يمكن المشاركة", + "do_task": "قم بالمهام", + "this_round_has_ended": "انتهت هذه الجولة", + "claim": "المطالبة", + "claim_it_now": "احصل عليه الآن!", + "claim_time_not_reached": "لم يصل وقت المطالبة", + "success": "نجاح", + "too_late_reward_expired": "لقد فات الأوان! انتهت المكافأة", + "no_duplicate_claims": "لا يُسمح بالمطالبات المكررة", + "buy_more": "اشترِ المزيد", + "operation_failed": "فشلت العملية، يرجى إعادة المحاولة لاحقًا", + "expected_to_be_available_tomorrow": "من المتوقع استلامه غدًا", + "expected_to_be_available_in_day": "من المتوقع استلامه بعد {{day}} يومًا", + "num_gold_coins": "[[{{num}}]] عملة", + "check_in_now": "تسجيل الدخول الآن", + "complete_daily_check_ins_for_prizes": "أكمل تسجيل الدخول اليومي للحصول على الجوائز", + "check_in_days": "أيام تسجيل الوصول", + "lottery_chance_done": "الفرصة [[+{{chance}}]] (تم: [[{{num}}]])", + "lottery_chance_done_limit": "فرصة [[+{{chance}}]] (تم: [[{{num}}]]/{{limit}})", + "claim_failed": "فشل الاستلام، يرجى التواصل مع خدمة العملاء", + "answer_tomorrow_get_chance": "غدًا يمكنك الحصول على {{chance}} فرصة للإجابة", + "finish_invite_task": "تم إكمال مهمة الدعوة", + "dice_chance_done": "النرد [[+{{chance}}]] (تم: [[{{num}}]])", + "dice_chance_done_limit": "النرد [[+{{chance}}]] (تم: [[{{num}}]]/{{limit}})", + "grow_chance_done": "عناصر النمو [[+{{chance}}]] (تم: [[{{num}}]])", + "grow_chance_done_limit": "عناصر النمو [[+{{chance}}]] (تم: [[{{num}}]]/{{limit}})", + "qa_chance_done": "فرصة الاختبار [[+{{chance}}]] (تم: [[{{num}}]])", + "qa_chance_done_limit": "فرصة الاختبار [[+{{chance}}]] (تم: [[{{num}}]]/{{limit}})", + "help_wait": "جارٍ", + "distributing": "جارٍ التوزيع", + "distribution_failed": "فشل", + "claimed": "تم الاستلام", + "no_prizes_to_claim": "لم يتم العثور على جوائز تحتاج إلى استلامها", + "points_use": "استخدم {{num}} نقطة", + "points_use_ok": "تم التبادل بنجاح", + "points_use_lack": "النقاط غير كافية", + "points_use_close": "وظيفة التبادل مغلقة", + "points_use_day_limit": "تم الوصول إلى حد تبادل النقاط اليومية", + "points_use_limit": "تم الوصول إلى حد عدد التبادلات", + "points_use_dice": "استخدم [[{{num}}]]، تبادل مقابل [[{{chance}}]] زهرات؟", + "points_use_lottery": "استخدم [[{{num}}]]، تبادل مقابل [[{{chance}}]] فرصة؟", + "times": "مرات", + "dice": "نرد", + "one_spin": "دورة واحدة", + "raise_the_pet_to_get_your": "تربية حيوانات أليفة للحصول على الخاص بك", + "pet_food_num": "{{num}}غ طعام الحيوانات الأليفة", + "pet_food": "طعام الحيوانات الأليفة", + "friend_third_feed_pet": "الصديق الذي أكمل إطعام الحيوانات الأليفة 3 مرات", + "friend_first_third_feed_pet": "دعوة أصدقائك لإطعام الحيوانات الأليفة 3 مرات يوميًا", + "collect_machine_food": "تم استلام آلة طعام الحيوانات الأليفة", + "pet_food_lack": "يرجى الذهاب للحصول على المزيد من طعام الحيوانات الأليفة", + "pet_food_machine_running": "يتم إنتاج طعام الحيوانات الأليفة", + "chat_day_limit": "اليوم أشعر بالتعب قليلاً", + "chat_token_limit": "أنا متعب جداً", + "chat": "دردشة", + "hours_ago": "منذ {{hour}} ساعة", + "conversation_and_chat": "يمكنك بدء محادثة والدردشة مع حيواناتك الأليفة", + "invite_friend_install_get_vote_chance": "دعوة {{num}} أصدقاء لتنزيل التطبيق ، يمكنك الحصول على {{chance}} فرصة للتصويت.", + "invite_friend_install_get_vote_chance_limit": "دعوة {{num}} أصدقاء لتنزيل التطبيق، يمكنك الحصول على {{chance}} فرصة للتصويت، بحد أقصى {{limit}} فرص.", + "invite_friend_register_get_vote_chance": "دعوة {{num}} أصدقاء للتسجيل، يمكنك الحصول على {{chance}} فرصة للتصويت.", + "invite_friend_register_get_vote_chance_limit": "دعوة {{num}} أصدقاء لإكمال التسجيل، يمكنك الحصول على {{chance}} فرصة للتصويت، بحد أقصى {{limit}} فرص.", + "vote_task_finish": "إكمال يمنحك {{chance}} فرصة للتصويت", + "vote_task_finish_limit": "أكمل لتحصل على {{chance}} فرصة تصويت، بحد أقصى {{limit}} مرة", + "vote_task_num": "فرص التصويت المكتسبة من إكمال المهام", + "vote_task_cond_one": "أكمل أي مهمة للحصول على فرص التصويت", + "vote_task_cond_all": "أكمل جميع المهام للحصول على {{chance}} فرصة تصويت", + "vote_task_cond_all_limit": "أكمل جميع المهام لتحصل على {{chance}} فرصة تصويت، الحد الأقصى {{limit}}، تم الحصول على {{num}}", + "do_task_get_vote": "احصل على فرص التصويت من خلال القيام بالمهام", + "sign_in_every_day_can_get_vote": "تعال يومياً لتحصل على {{num}} فرصة تصويت", + "your_choice": "اختيارك", + "cap_win": "اربح", + "cap_draw": "تعادل", + "blue_team": "أزرق", + "red_team": "أحمر", + "spend_coin_to_vote_team": "هل أنت متأكد من رغبتك في إنفاق [[{{coin}}]] للتصويت لـ <<{{title}}>>؟", + "vote_team": "هل أنت متأكد من رغبتك في التصويت لـ [[{{title}}]]؟", + "vote_sure": "تأكيد التصويت؟", + "no_scheduled": "لا توجد مباريات مجدولة", + "schedule": "الجدول", + "in_progress": "قيد التنفيذ", + "participated": "تم المشاركة", + "vote_soon": "سيتم التصويت قريبًا", + "vote": "تصويت", + "pending": "معلق", + "settled": "تم التسوية", + "spend_coin_redeem_reward": "هل أنت متأكد من رغبتك في إنفاق [[{{coin}}]] لاستبدال <<{{title}}>>؟", + "redeem_sure": "تأكيد الاستبدال؟", + "prize_restocking": "جاري إعادة تخزين الجوائز...", + "redeem": "استبدال", + "invite_friend_install_get_vote_chance_v2": "قم بدعوة [[{{num}}]] من الأصدقاء لتحميل التطبيق لتحصل على [[{{chance}}]] فرصة تصويت.", + "invite_friend_install_get_vote_chance_limit_v2": "قم بدعوة [[{{num}}]] من الأصدقاء لتحميل التطبيق لتحصل على [[{{chance}}]] فرصة تصويت، بحد أقصى {{limit}} فرصة تصويت.", + "invite_friend_register_get_vote_chance_v2": "قم بدعوة [[{{num}}]] من الأصدقاء لإكمال التسجيل لتحصل على [[{{chance}}]] فرصة تصويت.", + "invite_friend_register_get_vote_chance_limit_v2": "قم بدعوة [[{{num}}]] من الأصدقاء لإكمال التسجيل لتحصل على [[{{chance}}]] فرصة تصويت، بحد أقصى {{limit}} فرصة تصويت.", + "vote_task_finish_v2": "أكمل لتحصل على [[{{chance}}]] فرصة تصويت", + "vote_task_finish_limit_v2": "أكمل لتحصل على [[{{chance}}]] فرصة تصويت، بحد أقصى {{limit}} مرة", + "vote_task_cond_all_v2": "أكمل جميع المهام لتحصل على [[{{chance}}]] فرصة تصويت会", + "vote_task_cond_all_limit_v2": "أكمل جميع المهام لتحصل على [[{{chance}}]] فرصة تصويت، الحد الأقصى {{limit}}، تم الحصول على [[{{num}}]]", + "sign_in_every_day_can_get_vote_v2": "تعال يوميًا وستحصل على [[{{num}}]] فرصة تصويت", + "vote_num_add": "فرص التصويت [[+{{num}}]]", + "confirm_": "تأكيد", + "vote_chance_done": "فرص التصويت [[+{{chance}}]] (تم الإنجاز: [[{{num}}]])", + "vote_chance_done_limit": "فرص التصويت [[+{{chance}}]] (تم الإنجاز: [[{{num}}]]/{{limit}})", + "vote_success": "التصويت ناجح", + "non_voting_hours": "لا يمكنك التصويت خارج ساعات التصويت", + "vote_chance_lack": "فرص التصويت غير كافية", + "insufficient_points": "نقاط غير كافية", + "vote_limit": "فقد وصل التصويت إلى الحد الأقصى", + "vote_failed": "فشل التصويت", + "odds": "احتمالات", + "playing": "يلعب", + "card_chance_lack": "فرص السحب غير كافية", + "get_color_card": "احصل على بطاقة واحدة من اللون المحدد", + "get_three_card": "احصل على 3 بطاقة من أي لون", + "get_five_card": "احصل على 5 بطاقة من أي لون", + "action_card": "بطاقة الحركة", + "choose_a_color": "الرجاء اختيار لون", + "got_a_new_card": "لقد حصلت على بطاقة جديدة.", + "action_card_unlocked": "تم فتح بطاقة الحركة!", + "claim_prize": "استلام الجائزة", + "vote_chances": "تذاكر", + "coin_log_mall": "استبدال النقاط", + "coin_log_vote": "التصويت في الفعالية", + "coin_log_expired": "انتهاء صلاحية النقاط", + "coin_log_reward": "مكافآت الفعالية", + "coin_log_task": "مكافآت المهام", + "coin_log_title": "نقاط", + "got": "تم الحصول على", + "deduct": "خصم", + "invite_friend_install_get_qa_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لتنزيل التطبيق، يمكنك الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة.", + "invite_friend_install_get_qa_limit_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لتنزيل التطبيق، يمكنك الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} فرصة.", + "invite_friend_register_get_qa_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لإكمال التسجيل، يمكنك الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة.", + "invite_friend_register_get_qa_limit_v2": "دعوة [[{{num}}]] صديق(أصدقاء) لإكمال التسجيل، يمكنك الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} فرصة.", + "qa_task_finish_v2": "عند الإكمال، يمكنك الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة.", + "qa_task_finish_limit_v2": "عند الإكمال، يمكنك الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} مرة.", + "qa_task_cond_all_v2": "إكمال جميع المهام سيمكنك من الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة", + "qa_task_cond_all_limit_v2": "إكمال جميع المهام سيمكنك من الحصول على [[{{chance}}]] فرصة للإجابة على الأسئلة، بحد أقصى {{limit}} فرصة، وقد حصلت على [[{{num}}]] فرصة", + "sign_in_every_day_can_get_qa_v2": "كل يوم ستحصل على [[{{num}}]] فرصة للإجابة على الأسئلة.", + "quiz_starting": "جارٍ بدء الاختبار...", + "quiz_ready": "استعد...", + "quiz_oops": "عذرًا!", + "quiz_question_progress": "السؤال [[{{num}}]] من [[{{x}}]]", + "quiz_back": "العودة إلى الاختبار", + "quiz_review_answers": "مراجعة الإجابات", + "quiz_question": "السؤال", + "quiz_no_answer_submitted": "لم يتم إرسال أي إجابة", + "quiz_perfect_score": "درجة كاملة!", + "quiz_correct_count": "أجبت بشكل صحيح عن [[{{num}}]] من أصل [[{{x}}]]!", + "quiz_good_job": "أحسنت!", + "quiz_round_complete": "اكتملت الجولة", + "quiz_correct": "صحيح", + "quiz_next": "التالي", + "quiz_home": "الرئيسية" +} diff --git a/asset/campaign/lang/cs.json b/asset/campaign/lang/cs.json new file mode 100644 index 0000000..3c1b2ad --- /dev/null +++ b/asset/campaign/lang/cs.json @@ -0,0 +1 @@ +{"deduct":"Odečíst","quiz_correct":"Správně","quiz_correct_count":"Správně jste odpověděli na [[{{num}}]] z [[{{x}}]]!","quiz_home":"Domů","quiz_next":"Další","quiz_question_progress":"Otázka [[{{num}}]] z [[{{x}}]]","quiz_round_complete":"Kolo dokončeno","quiz_chances":"Pokusy v kvízu","claim_it_now":"Získejte to hned!"} diff --git a/asset/campaign/lang/de.json b/asset/campaign/lang/de.json new file mode 100644 index 0000000..469c220 --- /dev/null +++ b/asset/campaign/lang/de.json @@ -0,0 +1 @@ +{"deduct":"Abziehen","quiz_correct":"Richtig","quiz_correct_count":"Du hast [[{{num}}]] von [[{{x}}]] richtig!","quiz_home":"Startseite","quiz_next":"Weiter","quiz_question_progress":"Frage [[{{num}}]] von [[{{x}}]]","quiz_round_complete":"Runde abgeschlossen","quiz_chances":"Quiz-Versuche","claim_it_now":"Jetzt abholen!"} diff --git a/asset/campaign/lang/en.json b/asset/campaign/lang/en.json new file mode 100644 index 0000000..db8f530 --- /dev/null +++ b/asset/campaign/lang/en.json @@ -0,0 +1,761 @@ +{ + "close": "Close", + "invite_share_text": "Join me to win rewards", + "copy_link": "Copy link", + "copy_success": "Copy successful", + "invite_friend": "Referral", + "invite_friend_": "SHARE", + "total_get": "Reward(s)", + "can_get": "Reward(s)", + "my_invite": "Invitation", + "invite_record": "Invitation Records", + "need_invite": "Next level", + "bonus_rules": "Reward rules", + "activity_rules": "Rules", + "invite_no_record": "No invitation records yet", + "invite_time": "Date", + "user_id": "User ID", + "reward_cond": "Rules", + "target_receive_prizes": "Contact us to claim your reward", + "receive_prizes": "Prize collection method", + "copy": "Copy", + "bonus_content": "Reward", + "prize_details": "Rewards", + "end_time": "END: ", + "start_time": "START: ", + "activity_time": "Event Time", + "extra_prizes": "Extra", + "quantity": "Qty", + "prize": "Reward", + "download_for_each_friend": "Every {{num}} Install", + "accumulate_friend_downloads": "Cumulative {{num}} Install", + "max_invite_friend": "Each user can refer maximum {{num}} friend(s)", + "register_for_each_friend": "Every {{num}} Register", + "accumulate_friend_register": "Cumulative {{num}} Register", + "my_task": "My Tasks", + "fans": "Referee", + "target_fans": "Achieved", + "install_and_finish_all_cond": "Your downline have to download and complete all tasks to qualify.", + "install_and_finish_one_cond": "Your downline have to download and complete a task to qualify.", + "completed": "Done", + "undone": "to do", + "friend_record": "Invitation Records", + "task_1": "Task 1", + "task_2": "Task 2", + "task_3": "Task 3", + "invite_friends_to_register": "Every {{num}} Register", + "invite_friends_to_install": "Every {{num}} Install", + "no_record": "No record yet", + "invite_friends_to_target": "Invite {{num}} friend(s) to complete the task", + "target_for_each_friend": "Every {{num}} referral(s) completes the task", + "accumulate_friend_target": "Cumulative {{num}} referrals complete the task", + "prize_list": "Reward List", + "regular_rewards": "Regular", + "extra_rewards": "Extra", + "activity_end_text": "This event has ended@Thank you for joining us@Hope see you again!", + "receive": "Redeem", + "contact_customer_service": "Please contact customer service to pick up", + "lottery": "Spin", + "draws_num": "Spins", + "better_luck_next_time": "Try your luck next time.", + "no_winning_record": "No record yet", + "prize_name": "Reward", + "lottery_service_err": "Service error, please try again later", + "draws_none": "The lottery has run out", + "confirm": "OK", + "try_your_luck": "FEEL LUCKY", + "get_prize_to_app": "Download the app to claim your prize now", + "target_cond_1": "Task 1", + "target_cond_2": "Task 2", + "target_cond_3": "Task 3", + "all_tasks_to_draw": "Your downline must download and complete all tasks to receive {{num}} draw(s)", + "one_tasks_to_draw": "Your downline must download and complete a task to receive {{num}} draw(s)", + "draws_obtained": "My Draw(s):", + "reward_record": "Reward Records", + "to_complete": "Go", + "completed_times": "Completed times", + "winning_record": "Reward Records", + "Winning_time": "Date", + "thank": "NEXT TIME", + "no_receive_record": "No record yet", + "week_0": "Sun", + "week_1": "Mon", + "week_2": "Tue", + "week_3": "Wed", + "week_4": "Thu", + "week_5": "Fri", + "week_6": "Sat", + "invite_friend_install_get_sign": "Invite {{num}} friend(s) to download the app and you will receive one makeup card.", + "invite_num": "Referrals: {{num}}", + "sign_day_num": "Check in {{num}} day(s)", + "continue_day_num": "Checked-in consecutively for {{num}} Day(s)", + "day": "Day", + "sign_card": "Make up for a missed day", + "invite_friend_get_sign_card_text": "Missed a day? Invite friends to download and earn a makeup card!", + "obtain": "Get", + "use_sign_card": "Use a makeup card", + "confirm_use_sign_card": "Are you sure to use it on {{m}}/{{d}}?", + "sign_success": "Checked-in", + "you_got": "You've got ", + "i_see": "Got it", + "done_sign_day_num": "Checked in {{num}} day(s)", + "done_continue_day_num": "Checked-in consecutively for {{num}} day(s)", + "sign_ok": "Checked in", + "card_sign_ok": "Make-up success", + "continue_sign_ok": "Checked in", + "continue_sign_get_reward_text": "Hit the Streak to win rewards", + "sign_get_reward_text": "Check-in daily to win rewards!", + "sign_card_lack": "Lack of makeup card", + "sign_fail": "Check in failed, please refresh the page", + "best_fan": "Top Fans", + "top_fans": "Top Fans", + "invite_num_title": "Referral", + "no_rank_record": "No record yet", + "vote_none": "The vote has run out", + "vote_service_err": "Service error, please try again later", + "hour": "h", + "minute": "min", + "second": "s", + "hour_f": "HOUR", + "minute_f": "MINUTE", + "second_f": "SECOND", + "vote_num": "There are currently {{num}} votes available", + "here_is_the_quiz_title": "The quiz title is shown here", + "option": "option", + "countdown": "COUNT DOWN", + "end": "END", + "click_image_select": "Click image to select", + "wait_reward_reward": "Please come back later for results", + "sure": "OK", + "submit": "SUBMIT", + "next_qa": "NEXT", + "right": "CORRECT", + "error": "WRONG", + "right_answer": "Correct answer:", + "explain": "Explanation", + "home": "HOME", + "share": "Share", + "download_app_qa": "Download app to join the quiz", + "qa_service_err": "Service error, please try again later", + "qa_none": "You don't have any answering opportunities yet. @Please invite friends to get more chances.", + "start": "START", + "challenge_failed": "FAILED", + "qa_right": "Correct ", + "keep_try": "KEEP TRYING", + "congratulation": "CONGRATS!", + "please_choose": "SELECT", + "qa_loading": "loading...", + "grow_big": "{{name}} has grown up", + "click_receive": "GET", + "after_receive": "to get", + "tree_grow_can_get": "Plant the tree and you will receive it.", + "fertilize_standard_text": "Just apply {{num}}% more fertilizer, and you will meet the goal!", + "fertilize": "Fertilize", + "fertilizer": "Fertilizer", + "need_nutrients_will_die": "I need {{num}}g fertilizer to keep me healthy.", + "get_new_tree": "Get a new sapling.", + "tree_grow_max_text": "Your tree has grown, here's a little gift for you.", + "little_tree": "my tree", + "fertilize_num": "Fertilize {{num}}g", + "some_withered": "{{name}} is withered", + "some_revive": "{{name}} is back to life.", + "grow_big_and_get_reward": "{{name}} has grown up, you just get {{reward_title}", + "get_grow": "Get {{name}}", + "props_lack": "Not enough props.", + "cannot_lv_up": "You've reached the highest level.", + "invite_friend_install_get_fertilizer": "Invite {{num}} friend to download App, you will receive {{grow_num}} fertilizer.", + "received_sapling": "You have received a sapling.", + "pick_name": "Choose a name", + "growth_manual": "Guide to Growth", + "get_nourishment": "Get fertilizer", + "plant_new_tree": "Plant a tree", + "tree_revive": "Save your tree", + "timeout_tree_die": "Due to a lack of fertilization for a long time, your tree has withered", + "invite_friend_install_revive_tree": "Invite {{num}} friends to download the app and you can save your tree", + "dog_grow_can_get": "Raise the puppy and you will receive it", + "feed_standard_text": "Just feed {{num}}% more to meet the goal!", + "feed": "Feed", + "dog_food": "Dog food", + "need_dog_food_will_leave": "I need {{num}}g food, or I might have to go on a little adventure outside our cozy home. Woof!", + "get_new_dog": "Adopt a puppy", + "dog_grow_max_text": "Your puppy has grown up, here's a little gift for you", + "little_dog": "Puppy", + "feed_num": "Feed {{num}}g food", + "some_leave": "{{name}} has left", + "some_come": "{{name}} is back", + "invite_friend_install_get_dog_food": "Invite {{num}} friend(s) to download App, you will receive {{grow_num}}g food", + "received_dog": "You adopt a puppy", + "get_dog_food": "Get food", + "plant_new_dog": "Adopt a dog", + "rescue_puppy": "Save the puppy", + "timeout_dog_go": "Because it hasn't felt love and food for a long time, your puppy has run away from home", + "invite_friend_install_rescue_puppy": "Invite {{num}} friend(s) to download the app and you can save your puppy.", + "get_collect_num": "You have received 1 piece of {{reward_title}}.", + "fixed_point": "Specified Number", + "this_props_lack": "You don't have this item yet.", + "help_record": "Invitation Records", + "no_help_record": "No record yet", + "install_help_record": "A friend downloaded the app", + "open_help_record": "A friend opened the app", + "click_help_record": "A friend clicked the link", + "service_err": "Service error, please try again later", + "select_reward": "Select Reward", + "view_help_rule": "Check Rules", + "help_rule": "Invite Rules", + "install_help": "Download App to Boost", + "install_help_text": "Each friend downloaded the app, progress [[+{{num}}%]]", + "open_help": "Open App to Boost", + "open_help_text": "Each friend opened the app, progress [[+{{num}}%]], up to {{limit_num}}%", + "click_help": "Click Link to Boost", + "click_help_text": "Each friend clicked the invitation link, progress [[+{{num}}%]], up to {{limit_num}}%", + "invite_friends_receive_free_gifts": "Invite friends to get free rewards!", + "get_prizes": "Get this reward", + "help_success": "SUCCESS", + "also_get_free": "You can also get it for free", + "install_get_free_reward": "Download the app to get free rewards", + "install_get_reward": "Get the App, Unlock Prizes", + "received_success": "success", + "ballot_record": "REWARD RECORD", + "no_ballot_record": "No record yet", + "ballot_none": "You don't have any opportunities yet. Please invite friends to get more chances.", + "share_good_luck": "Share the luck", + "ballot": "GOT IT", + "answer_record": "REWARD RECORD", + "challenge_results": "REWARD", + "challenge_time": "DATE", + "no_answer_record": "No record yet", + "answer_none": "The quiz has run out.", + "please_choose_answer": "Please select an answer", + "answer_countdown": "COUNTDOWN", + "got_prizes": "WIN:", + "continue_free_get": "Continue slashing", + "finish_help": "Complete", + "reward_send_your_account": "The reward has been sent to your account", + "no_reward_record": "No record yet", + "download_app_ballot": "Download the app to join the campaign", + "yesterday": "Yesterday", + "today": "Today", + "prize_record": "REWARD RECORD", + "get_reward_time": "DATE", + "no_sign_card": "I haven't signed a replacement card yet", + "get_more_knowledge": "TRY YOUR LUCK NEXT TIME", + "qa_very_hard": "WHO IS THE SMART MAN?", + "num": "QUIZ", + "contact_customer_service_var": "Please contact ({{contact}})", + "like_share_people_lucky": "Shared people have better luck. Share now!", + "my_reward": "My prize", + "no_install_prompt": "That social media platform is not installed.", + "please_login": "Please login", + "got_num": "(Obtained {{num}} times)", + "completed_num": "(Done {{num}})", + "fixed_roll_none": "You don't have a lucky dice yet. Invite {{num}} friend(s) to download the app and get 1 lucky dice.", + "fixed_roll_none_limit": "No lucky dice yet. Invite {{num}} friend(s) to download the App to get 1 lucky dice, up to a maximum of {{limit}} lucky dice(s).", + "invite_friend_install_get_roll_chance": "Invite {{num}} friend(s) to download the app and get {{chance}} lucky dice(s).", + "invite_friend_install_get_roll_chance_limit": "Invite {{num}} friend(s) to download the App and get {{chance}} dice(s), up to a maximum of {{limit}} dice(s).", + "invite_friend_register_get_roll_chance": "Invite {{num}} friend(s) to complete registration to receive {{chance}} dice(s).", + "invite_friend_register_get_roll_chance_limit": "Invite {{num}} friend(s) to complete registration to receive {{chance}} dice(s), up to a maximum of {{limit}} dice(s).", + "dice_task_finish": "Complete to receive {{chance}} dice(s)", + "dice_task_finish_limit": "Complete to receive {{chance}} dice(s), up to {{limit}} completion(s).", + "dice_task_num": "Total dice obtained from tasks:", + "dice_task_cond_one": "Complete any task to get more dice.", + "dice_task_cond_all": "Complete all tasks to get {{chance}} dice(s).", + "dice_task_cond_all_limit": "Complete all tasks to get {{chance}} dice(s), up to a maximum of {{limit}} time(s). You have obtained {{num}} time(s) so far.", + "spin_now": "Spin now", + "spinning": "Spinning", + "expires_in": "Expires In", + "records": "Records", + "luck_you": "Lucky you", + "get_extra_reward": "Extra bonus for you!", + "share_get": "Share to get your", + "upgrade_reward": "upgrade reward", + "super_upgrade": "Surprise! Super upgrade!", + "preparation": "Per spin", + "invite_get_energy": "Invite to get Energy", + "invite_friend_get_energy": "Invite friends to get energy", + "up_to": "Up To", + "spin": "Spin", + "away": "{{num}} away", + "win_left_energy": "win {{cash}} with just {{num}} spin", + "enjoy_credit": "Enjoy your credit", + "invite_no_record_reward": "You haven’t invited anyone yet, Invite friends to receive rewards!", + "spin_reward": "Spin reward", + "share_reward": "Share reward", + "start_reward": "Start incentive", + "left_cash_get_reward": "Only {{left}} left to get {{cash}} reward", + "auto_spin": "Spin automatically in [[{{second}}]] s", + "guarantee_to": "Guarantee to win {{cash}} with just 1 spin!", + "auto_select": "Select automatically in [[{{second}}]] s", + "open": "Open", + "select_box": "Pick 1 gift box to see how much Money Reward will you get", + "money_reward": "Money Reward", + "jackpot_best_prize": "Jackpot!Best Prize", + "best_prize": "Best&&Prize", + "almost_reward": "Almost to the reward!", + "claimed_reward": "Over [[10000+]] people have claimed Reward", + "pass_on_energy": "They passed on Energy to you!", + "victory_tip": "victory is within your reach, [[seize it]]", + "min_won_barrage": "{{name}} Won [[{{cash}}]] {{min}} mins ago Great!", + "closer_to_prize": "you are getting closer to the big prize", + "shine_arrived": "your moment to shine hash arrived grab it", + "get_money_reward": "Get Money Reward", + "won_barrage": "[[{{name}}]] has claimed [[{{cash}}]]", + "surprise_for_you": "Surprise for you", + "last_spin_win": "Just 1 last spin to win!", + "energy": "Energy", + "token": "Token", + "your_reward": "YOUR REWARD", + "go_to": "To Use", + "click_contact": "Contact Customer Service", + "click_contact_tip": "Contact information has been copied\nPlease contact us", + "see_reward": "View Prizes", + "prize_gone": "Prizes are gone", + "no_reward_get": "You're too late, all the prizes have been given out!", + "no_more_record": "No more records", + "help_fail": "FAILED", + "grand_opening": "Grand Opening", + "get_reward_after_play": "Everyone will receive a reward after playing the game!", + "play_and_get_prize": "Play to get your prize!", + "won_free_gift": "You won the free gift!", + "download_app_get_gift": "Download App to get your prize!", + "download": "Download", + "jackpot": "JACKPOT", + "play": "Play", + "install_ineligible": "Ineligible (Not new install)", + "unlock_your_luck": "Unlock Your Luck", + "spin_and_win": "Spin and Win", + "play_to_win_prize": "Play to win a prize!", + "you_got_the_best_prize": "You Got The Best Prize", + "play_and_win": "Play and Win", + "download_to_get": "download to get", + "best_prize_!": "BEST PRIZE!", + "roll_dice_number": "Roll dice, number {{point}}", + "lucky_dice_number": "Use lucky dice, number {{point}}", + "day_sign": "Daily check-in", + "dice_record": "Records", + "finish_friend_register": "Complete friend registration task", + "finish_friend_install": " Complete the recommended app download task", + "finish_lucky_dice_task": "Complete the lucky dice task", + "fragment": "Fragment", + "click": "click", + "collect_fragment_compare_reward": "Collect {{num}} fragments to craft the prize", + "craft_fragments": "Craft Fragments", + "reward_lack_contact_customer_service": "Out of stock. Please contact customer service for assistance.", + "join_in_campaign": "Join In Campaign", + "contact": "Contact", + "all": "All", + "contact_information": "Contact Information", + "no_more_dice": "No More Dice", + "try_your_luck_first_upper": "Try your luck", + "fill_in": "Fill In", + "submit_success": "Success", + "please_do_not_submit_repeatedly": "Please do not submit repeatedly", + "submitted": "SUBMITTED", + "please_complete_the_form": "Please complete the form", + "welcome_gifts": "Welcome gifts", + "spin_to_win": "Spin to win", + "view": "view", + "use": "Use", + "get_and_use": "Claim and Use", + "invite_friend_install_get_lottery_chance": "Invite {{num}} friend(s) to download the App, and you'll get {{chance}} chance(s).", + "invite_friend_install_get_lottery_chance_limit": "Invite {{num}} friend(s) to download the App, and you'll get {{chance}} chance(s), up to a maximum of {{limit}} chance(s).", + "invite_friend_register_get_lottery_chance": "Invite {{num}} friend(s) to complete registration, and you'll get {{chance}} chance(s).", + "invite_friend_register_get_lottery_chance_limit": "Invite {{num}} friend(s) to complete registration, and you'll get {{chance}} chance(s), up to a maximum of {{limit}} chance(s).", + "lottery_task_finish": "You'll get {{chance}} chance(s) upon completion", + "lottery_task_finish_limit": "You'll get {{chance}} chance(s) upon completion, up to a maximum of {{limit}} time(s)", + "lottery_task_num": "The total chances obtained from the tasks", + "lottery_task_cond_one": "Complete tasks to get chances", + "lottery_task_cond_all": "Completing all tasks can result in obtaining {{chance}} chance(s)", + "lottery_task_cond_all_limit": "Completing all tasks can result in obtaining {{chance}} chance(s), up to a maximum of {{limit}} time(s), and {{num}} time(s) have been obtained.", + "raffle_chances": "Chance", + "quiz_chances": "Quiz Chances", + "get_lottery_chances": "Get Lottery Chances", + "remaining_raffle_chances": "Remaining chances", + "lottery_again": "Again", + "use_immediately": "Use Now", + "wow_you_got": "Wow! You've got", + "next_time": "Next Time", + "finish_all_task": "Tasks Done", + "finish_one_task": "Task Done", + "sign_in_every_day_can_get_dice": "Sign in every day , you can get {{num}} dice(s).", + "do_task_get_dice": "Do Tasks And Get Dice", + "do_task_get_lottery": "Do Tasks And Get Chance", + "refresh_tomorrow": "Refresh Tomorrow", + "click_icon": "Click Icon", + "paste_to_media": "Paste To Media", + "get_prize": "Get Prizes", + "copy_success_paste_to_media": "Copied success, please paste to social media", + "invite_friend_install_get_grow": "Invite {{num}} friend(s) to download the App and receive {{chance}} growth items.", + "invite_friend_install_get_grow_limit": "Invite {{num}} friend(s) to download the App and receive {{chance}} growth items, up to a maximum of {{limit}} growth items.", + "invite_friend_register_get_grow": "Invite {{num}} friend(s) to complete registration and receive {{chance}} growth items.", + "invite_friend_register_get_grow_limit": "Invite {{num}} friend(s) to complete registration and receive {{chance}} growth items, up to a maximum of {{limit}} growth items.", + "grow_task_finish": "Complete to get {{chance}} growth items", + "grow_task_finish_limit": "Complete to get {{chance}} growth items, complete up to {{limit}} time(s)", + "grow_task_cond_one": "Complete any task to get growth items", + "grow_task_cond_all": "Complete all tasks to get {{chance}} growth items", + "grow_task_cond_all_limit": "Complete all tasks to get {{chance}} growth items, up to {{limit}} time(s), already got {{num}} time(s)", + "do_task_get_grow": "Complete tasks to get growth items", + "easy_mode": "Easy Mode", + "mins_ago": "{{min}} mins ago", + "barrage_got_reward": "has got [[{{title}}]] by playing lucky draw.", + "sold_out": "sold out", + "task_done": "Task Done", + "click_copy_link": "Click \"Copy Link\"", + "select_card": "Select a card", + "raffle_chances_lack": "Not enough opportunities", + "raffle_chances_lack_tip": "You do not have enough chances for the lucky draw. Go to the bottom of the page to complete tasks and earn more chances.", + "get_more_chance": "Get more opportunities", + "flip_now": "Flip Now", + "raffle_num": "Chance", + "win": "Win", + "next_week_do": "Next Week", + "week_do_1": "Refresh On Mon", + "week_do_2": "Refresh On Tue", + "week_do_3": "Refresh On Wed", + "week_do_4": "Refresh On Thu", + "week_do_5": "Refresh On Fri", + "week_do_6": "Refresh On Sat", + "week_do_7": "Refresh On Sun", + "to_flip": "Go draw a card", + "won_get": "Congratulations", + "invite_friend_download": "Invite {{num}} friend(s) to download the App", + "invite_friend_register": "Invite {{num}} friend(s) to register", + "fixed_roll_none_register": "No lucky dice yet. Invite {{num}} friend(s) to register and get 1 lucky dice.", + "fixed_roll_none_register_limit": "No lucky dice yet. Invite {{num}} friend(s) to register and get 1 lucky dice, up to a maximum of {{limit}} lucky dice(s).", + "sign_in_every_day_can_get_lottery": "Sign in every day to get {{num}} chance(s) to win a prize.", + "finish_newcomer_task": "[[Newcomer]] complete tasks to earn [[{{reward_title}}]]", + "done_newcomer_task": "Newcomer tasks", + "register_help_record": "A friend has completed the registration", + "register_help_text": "Each friend has completed the registration, progress [[+{{num}}%]]", + "register_help": "Registration Boost", + "invite_friend_install_get_qa": "Invite {{num}} friends to download the App and get {{chance}} chances to answer questions.", + "invite_friend_install_get_qa_limit": "Invite {{num}} friends to download the App and get {{chance}} chances to answer questions, with a maximum of {{limit}} chances.", + "invite_friend_register_get_qa": "Invite {{num}} friends to complete registration and get {{chance}} chances to answer questions.", + "invite_friend_register_get_qa_limit": "Invite {{num}} friends to complete registration and get {{chance}} chances to answer questions, with a maximum of {{limit}} chances.", + "qa_task_finish": "Completing it will earn you {{chance}} chances to answer questions.", + "qa_task_finish_limit": "Completing it will earn you {{chance}} chances to answer questions, with a maximum of {{limit}} completions.", + "qa_task_cond_one": "Completing any task will earn you a chance to answer questions", + "qa_task_cond_all": "Completing all tasks will earn you {{chance}} chances to answer questions", + "qa_task_cond_all_limit": "Completing all tasks will earn you {{chance}} chances to answer questions, with a maximum of {{limit}} chances, and you have already received {{num}} chances", + "sign_in_every_day_can_get_qa": "Every day you will receive {{num}} chances to answer questions.", + "do_task_get_qa": "Complete tasks to earn chances to answer questions", + "help_install": "[[{{name}}]] received [[installation support]]", + "help_register": "[[{{name}}]] received [[registration support]]", + "help_open": "[[{{name}}]] received [[daily visit boost]]", + "help_click": "[[{{name}}]] received [[click support]]", + "finish_help_get_reward": "[[{{name}}]] completed the support task and received [[{{reward_title}}]]", + "a_gift_to_you": "A Gift for You", + "choose_it": "Choose It", + "nice_choice": "Nice Choice!", + "tip": "Tip", + "left_percent_get_reward": "Only [[{{left}}%]] left to get reward", + "ensure_select_reward": "Confirm selection [[{{reward_title}}]]?", + "reward_obtained": "Reward obtained", + "lucky": "Lucky", + "percent_progress_for_you": "You've got a free [[{{percent}}%]] boost!", + "invite": "Invite", + "help_task": "Boost Task", + "finish_all_task_help_parent": "Complete all the following tasks to boost your friend", + "finish_one_task_help_parent": "Complete any of the following tasks to boost your friend", + "task_index": "Task {{index}}", + "raise_pet_to_get_free_gift": "Raise your pet to get free gifts", + "step": "STEP", + "pick_item": "Pick item", + "raise_pet": "Raise Pet", + "get_free_gift": "Get free gift", + "has_got": "{{name}} has got {{reward_title}}", + "more_unexpected_gifts": "More unexpected gifts during raising your pet", + "pick_it": "Pick it", + "picked": "picked", + "your_gift_confirm": "Please confirm your gift", + "free": "Free", + "raise_the_dog_to_get_your": "raise the dog to get your", + "free_gift": "FREE GIFT!", + "expires_in_day": "Expires in {{day}} days", + "collect_more_love": "Collect [[{{num}}]] more love points to get a FREE gift", + "collect": "Collect", + "claim_now": "Claim now", + "feed_more_times": "Feed {{num}} more times", + "get_more": "Get More", + "first_referral_bonus": "First referral bonus!", + "get_rewards_first_time": "Get rewards by inviting friends for the first time", + "first_invite_receive": "The first invitation to a new user will receive [[{{num}}]]", + "invite_now": "invite now", + "invite_get_dog_foods": "Invite friends to earn Food", + "invite_friends": "invite friends", + "pick_a_gift": "Pick 1 free gift", + "feed_3_times": "Feed 3 times", + "invite_new_user_extra_get": "Invite new user for the first times can get extra [[{{num}}]]", + "reward_upgraded": "Reward upgraded", + "reward_for_you": "[[{{reward_title}}]] for you", + "time_s_up": "Time’s up!", + "play_again": "Play Again", + "complete_tasks_to_earn_reward": "Complete tasks to earn Reward", + "super": "SUPER", + "super_benefit": "Super Benefit", + "task_cond_one": "Complete any task to receive a [[reward]]", + "task_cond_all": "Complete all tasks to earn {{reward_title}}[[+{{num}}]]", + "congrats": "Congrats!", + "enjoy_your": "Enjoy your", + "try_again_to_claim": "Try again to claim your gift", + "collect_love": "Collect love", + "finish_step": "Completed stage task", + "finish_feed": "Completed feeding task", + "friend_third_feed": "Friend completed feeding dog food 3 times", + "friend_first_third_feed": "Daily invite friends to complete feeding dog food 3 times", + "friend_select_reward": "Friend has chosen the prize", + "friend_first_select_reward": "Daily invite friends to choose the prize", + "rewards": "Rewards", + "round_expired": "Round Expired", + "love_points": "Love Points", + "dog_food_lack": "Please go get more dog food", + "collect_machine": "The dog food machine has been received", + "max_grow": "Exceeded the maximum development times", + "please_collect_love": "Please collect love first", + "continue_grow": "The current pet can still be kept", + "dog_food_machine_running": "Dog food is in production", + "reward_remove": "The prize has been taken down", + "reward_get_max": "The prize has exceeded the maximum limit of acquisition", + "i_am_hungry": "I'm hungry!", + "effect_invite": "Successfully invited a friend", + "day_first_effect_invite": "Successfully invited a friend for the first time on the same day", + "finish_many_feed": "Completed multiple feedings", + "daily_rewards": "Daily rewards", + "come_back_tomorrow_for_more_rewards": "Come back tomorrow for more rewards!", + "claim_today_reward": "Claim today's reward!", + "come_back_tomorrow": "Come back tomorrow!", + "fail_to_sign_progress_reset": "If you fail to sign in continuously, your progress will be reset", + "signed_in": "Signed in", + "signed_title": "Sign-in", + "you_got_the_gift_box": "You’ve got the gift box", + "use_it": "Use it", + "you_got_dog_food": "You’ve got {{num}} of dog food", + "you_got_reward": "You’ve got {{reward_title}}", + "invite_contest": "Invite contest", + "rewards_earned_to_your_account": "Rewards earned will [[go straight to]] your account", + "invite_more_friends": "Invite more friends", + "invited": "{{num}} Invited", + "daily_fortune_draw": "Daily fortune draw", + "win_free_gift_every_day": "Win free gift every day!", + "draw_now": "Draw now", + "day_num": "Day {{num}}", + "you": "You", + "blind_box": "Blind Box", + "daily_draw": "Daily Draw", + "rankings": "Rankings", + "rank_reward": "Ranking Rewards", + "sign_reward": "Sign-in Rewards", + "blind_reward": "Blind Box Rewards", + "lucky_reward": "Lottery Rewards", + "tomorrow": "Tomorrow", + "win_reward": "Win[[{{title}}]]", + "rank_end": "Time's up", + "congrats_for_getting": "Congrats for getting", + "ends_in": "Ends in", + "invite_friend_download_app": "Invite [[{{num}}]] friend(s) to download the App", + "invite_friend_register_app": "Invite [[{{num}}]] friend(s) to register", + "invite_friend_install_get_lottery_chance_v2": "Invite [[{{num}}]] friend(s) to download the App, and you'll get [[{{chance}}]] chance(s).", + "invite_friend_install_get_lottery_chance_limit_v2": "Invite [[{{num}}]] friend(s) to download the App, and you'll get [[{{chance}}]] chance(s), up to a maximum of {{limit}} chance(s).", + "invite_friend_register_get_lottery_chance_v2": "Invite [[{{num}}]] friend(s) to complete registration, and you'll get [[{{chance}}]] chance(s).", + "invite_friend_register_get_lottery_chance_limit_v2": "Invite [[{{num}}]] friend(s) to complete registration, and you'll get [[{{chance}}]] chance(s), up to a maximum of {{limit}} chance(s).", + "lottery_task_finish_v2": "You'll get [[{{chance}}]] chance(s) upon completion", + "lottery_task_finish_limit_v2": "You'll get [[{{chance}}]] chance(s) upon completion, up to a maximum of {{limit}} time(s)", + "lottery_task_cond_all_v2": "Completing all tasks can result in obtaining [[{{chance}}]] chance(s)", + "lottery_task_cond_all_limit_v2": "Completing all tasks can result in obtaining [[{{chance}}]] chance(s), up to a maximum of {{limit}} time(s), and [[{{num}}]] time(s) have been obtained.", + "sign_in_every_day_can_get_lottery_v2": "Sign in every day to get [[{{num}}]] chance(s) to win a prize.", + "invite_friends_to_earn_reward": "Invite friends to earn Reward", + "raffle_num_add": "Chance [[+{{num}}]]", + "click_button_and_get_coins": "Click button to complete the task and get more coins", + "do_task_get_energy": "Complete tasks to gain energy", + "coins": "{{num}} Coins", + "get_tasks": "Get Tasks", + "next": "Next", + "finish_task_title": "Completed \"{{title}}\"", + "get_energy": "Get Energy", + "tasks": "Tasks", + "invite_friend_install_get_gold": "Invite {{num}} friends to download the app to earn {{chance}} coins.", + "invite_friend_install_get_gold_limit": "Invite {{num}} friends to download the app to earn {{chance}} coins, with a maximum of {{limit}} coins.", + "invite_friend_register_get_gold": "Invite {{num}} friends to complete registration to earn {{chance}} coins.", + "invite_friend_register_get_gold_limit": "Invite {{num}} friends to complete registration to earn {{chance}} coins, with a maximum of {{limit}} coins.", + "gold_task_finish": "Complete to earn {{chance}} coins", + "gold_task_finish_limit": "Complete to earn {{chance}} coins, up to a maximum of {{limit}} times", + "gold_task_cond_one": "Complete any task to earn coins", + "gold_task_cond_all": "Complete all tasks to earn {{chance}} coins", + "gold_task_cond_all_limit": "Complete all tasks to earn {{chance}} coins, up to a maximum of {{limit}} times, you have received {{num}} times", + "do_task_get_gold": "Complete tasks to earn coins", + "task_none": "There are no tasks available to complete", + "finish_task_earn_num": "Complete the task to earn [[+{{num}}]]", + "reached_the_max": "Reached the max", + "has_got_style": "[[{{name}}]] has got [[{{reward_title}}]]", + "dog_food_num": "{{num}}g food", + "in_production": "In production", + "active_talk": "You haven't visited me for a long time. Come more often to get more rewards.", + "task_reset_talk": "One of your prizes is about to expire, come and check it out.", + "dog_offline_talk": "You have received a portion of pet food, please go and claim it.", + "complete_task_talk": "You have completed the task, congratulations on receiving a prize, come and claim it.", + "current_total_prize_pool": "Current Total Prize Pool", + "get_coin": "[[{{name}}]] Gained [[{{num}}]] coins", + "join_coin_num": "[[{{name}}]] Grab gold [[*{{num}}]]", + "join_coin": "Grab Gold", + "coin_per_use": "{{num}} gold coins per use", + "expected_to_receive_coin": "Expected to receive [[{{num}}]] gold coins", + "collect_coin": "[[{{num}}]] gold coins can be collected", + "expired": "Expired", + "gold_coins_deposited": "Gold coins deposited", + "timeout_and_no_collection": "Timeout and not claimed", + "use_gold_coins_to_play": "Use [[{{num}}]] gold coins to play?", + "more": "More", + "cancel": "Cancel", + "play_limit_next_round": "You’ve hit the play limit! Come back for the next round!", + "insufficient_balance_grab_gold": "Insufficient balance. Cannot Grab Gold", + "do_task": "Do Tasks", + "this_round_has_ended": "This round has ended", + "claim": "Claim", + "claim_it_now": "Claim it now!", + "claim_time_not_reached": "Claim time not reached", + "success": "Success", + "too_late_reward_expired": "Too late! Reward expired", + "no_duplicate_claims": "No duplicate claims", + "buy_more": "Buy More", + "operation_failed": "Operation failed. Please try again later", + "expected_to_be_available_tomorrow": "Expected to be available tomorrow", + "expected_to_be_available_in_day": "Expected to be available in {{day}} days", + "num_gold_coins": "[[{{num}}]] coins", + "check_in_now": "Check in now", + "complete_daily_check_ins_for_prizes": "Complete daily check-ins for prizes", + "check_in_days": "Check-in Days", + "lottery_chance_done": "Chance [[+{{chance}}]] (Done: [[{{num}}]])", + "lottery_chance_done_limit": "Chance [[+{{chance}}]] (Done: [[{{num}}]]/{{limit}})", + "claim_failed": "Claim Failed. Please contact customer support.", + "answer_tomorrow_get_chance": "Get {{chance}} more chances to answer tomorrow", + "finish_invite_task": "Invitation task completed", + "dice_chance_done": "Dice [[+{{chance}}]] (Done: [[{{num}}]])", + "dice_chance_done_limit": "Dice [[+{{chance}}]] (Done: [[{{num}}]]/{{limit}})", + "grow_chance_done": "Growth Items [[+{{chance}}]] (Done: [[{{num}}]])", + "grow_chance_done_limit": "Growth Items [[+{{chance}}]] (Done: [[{{num}}]]/{{limit}})", + "qa_chance_done": "Quiz Chance [[+{{chance}}]] (Done: [[{{num}}]])", + "qa_chance_done_limit": "Quiz Chance [[+{{chance}}]] (Done: [[{{num}}]]/{{limit}})", + "help_wait": "In progress", + "distributing": "Distributing", + "distribution_failed": "FAILED", + "claimed": "Claimed", + "no_prizes_to_claim": "No prizes available for you to claim", + "points_use": "Used {{num}} points", + "points_use_ok": "Exchange Successful", + "points_use_lack": "Insufficient points", + "points_use_close": "Exchange function is closed", + "points_use_day_limit": "Daily exchange limit reached", + "points_use_limit": "Exchange limit reached", + "points_use_dice": "Use [[{{num}}]], exchange for [[{{chance}}]] dice?", + "points_use_lottery": "Use [[{{num}}]], exchange for [[{{chance}}]] chance?", + "times": "Times", + "dice": "Dice", + "one_spin": "1 spin", + "raise_the_pet_to_get_your": "Raise pets to gain your", + "pet_food_num": "{{num}}g pet food", + "pet_food": "Pet food", + "friend_third_feed_pet": "Your friend has fed pets 3 times", + "friend_first_third_feed_pet": "Invite friends daily to feed pets 3 times", + "collect_machine_food": "The pet food machine has been received", + "pet_food_lack": "Please go to get more pet food", + "pet_food_machine_running": "Pet food is being produced", + "chat_day_limit": "I'm a bit tired today", + "chat_token_limit": "I'm very tired", + "chat": "Chat", + "hours_ago": "{{hour}} hours ago", + "conversation_and_chat": "You can start a conversation and chat with your pet", + "invite_friend_install_get_vote_chance": "Invite {{num}} friends to download the app to get {{chance}} voting chances.", + "invite_friend_install_get_vote_chance_limit": "Invite {{num}} friends to download the app to get {{chance}} voting chances, with a maximum of {{limit}} chances.", + "invite_friend_register_get_vote_chance": "Invite {{num}} friends to complete registration to get {{chance}} voting chances.", + "invite_friend_register_get_vote_chance_limit": "Invite {{num}} friends to complete registration to get {{chance}} voting chances, with a maximum of {{limit}} chances.", + "vote_task_finish": "Completing will give you {{chance}} voting chances", + "vote_task_finish_limit": "Complete to earn {{chance}} vote chances, max {{limit}} times", + "vote_task_num": "Vote chances earned from tasks", + "vote_task_cond_one": "Complete any task to earn vote chances", + "vote_task_cond_all": "Complete all tasks to get {{chance}} vote chances", + "vote_task_cond_all_limit": "Complete all tasks to get {{chance}} vote chances, max {{limit}}, already got {{num}}", + "do_task_get_vote": "Earn vote chances by doing tasks", + "sign_in_every_day_can_get_vote": "Come daily to receive {{num}} vote chances", + "your_choice": "Your Choice", + "cap_win": "WIN", + "cap_draw": "DRAW", + "blue_team": "Blue", + "red_team": "Red", + "spend_coin_to_vote_team": "Are you sure you want to spend [[{{coin}}]] to vote for <<{{title}}>>?", + "vote_team": "Are you sure you want to vote for [[{{title}}]]?", + "vote_sure": "Confirm vote?", + "no_scheduled": "No matches scheduled", + "schedule": "Schedule", + "in_progress": "In Progress", + "participated": "Participated", + "vote_soon": "Vote Soon", + "vote": "Vote", + "pending": "Pending", + "settled": "Settled", + "spend_coin_redeem_reward": "Are you sure you want to spend [[{{coin}}]] to redeem <<{{title}}>>?", + "redeem_sure": "Confirm redemption?", + "prize_restocking": "Prize restocking in progress...", + "redeem": "Redeem", + "invite_friend_install_get_vote_chance_v2": "Invite [[{{num}}]] friends to download the App to get [[{{chance}}]] vote chances.", + "invite_friend_install_get_vote_chance_limit_v2": "Invite [[{{num}}]] friends to download the App to get [[{{chance}}]] vote chances, up to {{limit}} vote chances.", + "invite_friend_register_get_vote_chance_v2": "Invite [[{{num}}]] friends to complete registration to get [[{{chance}}]] vote chances.", + "invite_friend_register_get_vote_chance_limit_v2": "Invite [[{{num}}]] friends to complete registration to get [[{{chance}}]] vote chances, up to {{limit}} vote chances.", + "vote_task_finish_v2": "Complete to get [[{{chance}}]] vote chances", + "vote_task_finish_limit_v2": "Complete to get [[{{chance}}]] vote chances, max {{limit}} times", + "vote_task_cond_all_v2": "Complete all tasks to get [[{{chance}}]] vote chances", + "vote_task_cond_all_limit_v2": "Complete all tasks to get [[{{chance}}]] vote chances, max {{limit}}, already got [[{{num}}]]", + "sign_in_every_day_can_get_vote_v2": "Come daily and get [[{{num}}]] vote chances", + "vote_num_add": "Vote chances [[+{{num}}]]", + "confirm_": "Confirm", + "vote_chance_done": "Vote chances [[+{{chance}}]] (Completed: [[{{num}}]])", + "vote_chance_done_limit": "Vote chances [[+{{chance}}]] (Completed: [[{{num}}]]/{{limit}})", + "vote_success": "Vote successful", + "non_voting_hours": "You cannot vote during non-voting hours", + "vote_chance_lack": "Insufficient voting opportunities", + "insufficient_points": "Insufficient points", + "vote_limit": "The voting has reached the maximum limit", + "vote_failed": "Vote failed", + "odds": "Odd", + "playing": "Playing", + "card_chance_lack": "Insufficient draw chances", + "get_color_card": "Get 1 card of the specified color", + "get_three_card": "Get 3 cards of any color", + "get_five_card": "Get 5 cards of any color", + "action_card": "Action Card", + "choose_a_color": "Please choose a color", + "got_a_new_card": "You got a new card.", + "action_card_unlocked": "ACTION CARD UNLOCKED!", + "claim_prize": "Claim Prize", + "vote_chances": "Tickets", + "coin_log_mall": "Points Redemption", + "coin_log_vote": "Event Voting", + "coin_log_expired": "Points Expiry", + "coin_log_reward": "Event Rewards", + "coin_log_task": "Task Rewards", + "coin_log_title": "Points", + "got": "Got", + "deduct": "Deduct", + "invite_friend_install_get_qa_v2": "Invite [[{{num}}]] friends to download the App and get [[{{chance}}]] chances to answer questions.", + "invite_friend_install_get_qa_limit_v2": "Invite [[{{num}}]] friends to download the App and get [[{{chance}}]] chances to answer questions, with a maximum of {{limit}} chances.", + "invite_friend_register_get_qa_v2": "Invite [[{{num}}]] friends to complete registration and get [[{{chance}}]] chances to answer questions.", + "invite_friend_register_get_qa_limit_v2": "Invite [[{{num}}]] friends to complete registration and get [[{{chance}}]] chances to answer questions, with a maximum of {{limit}} chances.", + "qa_task_finish_v2": "Completing it will earn you [[{{chance}}]] chances to answer questions.", + "qa_task_finish_limit_v2": "Completing it will earn you [[{{chance}}]] chances to answer questions, with a maximum of {{limit}} completions.", + "qa_task_cond_all_v2": "Completing all tasks will earn you [[{{chance}}]] chances to answer questions", + "qa_task_cond_all_limit_v2": "Completing all tasks will earn you [[{{chance}}]] chances to answer questions, with a maximum of {{limit}} chances, and you have already received [[{{num}}]] chances", + "sign_in_every_day_can_get_qa_v2": "Every day you will receive [[{{num}}]] chances to answer questions.", + "quiz_starting": "Starting the Quiz...", + "quiz_ready": "Ready...", + "quiz_oops": "Oops!", + "quiz_question_progress": "Question [[{{num}}]] of [[{{x}}]]", + "quiz_back": "Back to quiz", + "quiz_review_answers": "Review answers", + "quiz_question": "Question", + "quiz_no_answer_submitted": "No answer was submitted", + "quiz_perfect_score": "Perfect score!", + "quiz_correct_count": "You got [[{{num}}]] of [[{{x}}]] correct!", + "quiz_good_job": "Good job!", + "quiz_round_complete": "Round complete", + "quiz_correct": "Correct", + "quiz_next": "Next", + "quiz_home": "Home" +} diff --git a/asset/campaign/lang/es.json b/asset/campaign/lang/es.json new file mode 100644 index 0000000..8acfb54 --- /dev/null +++ b/asset/campaign/lang/es.json @@ -0,0 +1 @@ +{"deduct":"Deducir","quiz_correct":"Correcto","quiz_correct_count":"¡Acertaste [[{{num}}]] de [[{{x}}]]!","quiz_home":"Inicio","quiz_next":"Siguiente","quiz_question_progress":"Pregunta [[{{num}}]] de [[{{x}}]]","quiz_round_complete":"Ronda completada","quiz_chances":"Intentos de cuestionario","claim_it_now":"¡Reclámalo ahora!"} diff --git a/asset/campaign/lang/fr.json b/asset/campaign/lang/fr.json new file mode 100644 index 0000000..8bef9e8 --- /dev/null +++ b/asset/campaign/lang/fr.json @@ -0,0 +1 @@ +{"deduct":"Déduire","quiz_correct":"Correct","quiz_correct_count":"Vous avez [[{{num}}]] bonnes réponses sur [[{{x}}]] !","quiz_home":"Accueil","quiz_next":"Suivant","quiz_question_progress":"Question [[{{num}}]] sur [[{{x}}]]","quiz_round_complete":"Manche terminée","quiz_chances":"Tentatives de quiz","claim_it_now":"Récupérez-le maintenant !"} diff --git a/asset/campaign/lang/hu.json b/asset/campaign/lang/hu.json new file mode 100644 index 0000000..dc66d16 --- /dev/null +++ b/asset/campaign/lang/hu.json @@ -0,0 +1 @@ +{"deduct":"Levon","quiz_correct":"Helyes","quiz_correct_count":"[[{{num}}]] helyes válaszod lett [[{{x}}]] kérdésből!","quiz_home":"Kezdőlap","quiz_next":"Következő","quiz_question_progress":"[[{{num}}]]. kérdés, összesen [[{{x}}]]","quiz_round_complete":"A forduló befejeződött","quiz_chances":"Kvízlehetőségek","claim_it_now":"Szerezd meg most!"} diff --git a/asset/campaign/lang/id.json b/asset/campaign/lang/id.json new file mode 100644 index 0000000..c5a9afa --- /dev/null +++ b/asset/campaign/lang/id.json @@ -0,0 +1 @@ +{"deduct":"Kurangi","quiz_correct":"Benar","quiz_correct_count":"Kamu menjawab benar [[{{num}}]] dari [[{{x}}]]!","quiz_home":"Beranda","quiz_next":"Berikutnya","quiz_question_progress":"Pertanyaan [[{{num}}]] dari [[{{x}}]]","quiz_round_complete":"Ronde selesai","quiz_chances":"Kesempatan kuis","claim_it_now":"Klaim sekarang!"} diff --git a/asset/campaign/lang/it.json b/asset/campaign/lang/it.json new file mode 100644 index 0000000..7bf2816 --- /dev/null +++ b/asset/campaign/lang/it.json @@ -0,0 +1 @@ +{"deduct":"Dedurre","quiz_correct":"Corretto","quiz_correct_count":"Hai risposto correttamente a [[{{num}}]] domande su [[{{x}}]]!","quiz_home":"Home","quiz_next":"Avanti","quiz_question_progress":"Domanda [[{{num}}]] di [[{{x}}]]","quiz_round_complete":"Round completato","quiz_chances":"Tentativi del quiz","claim_it_now":"Richiedilo ora!"} diff --git a/asset/campaign/lang/ja.json b/asset/campaign/lang/ja.json new file mode 100644 index 0000000..cf9e17f --- /dev/null +++ b/asset/campaign/lang/ja.json @@ -0,0 +1 @@ +{"deduct":"控除","quiz_correct":"正解","quiz_correct_count":"[[{{x}}]]問中[[{{num}}]]問正解しました!","quiz_home":"ホーム","quiz_next":"次へ","quiz_question_progress":"第[[{{num}}]]問(全[[{{x}}]]問)","quiz_round_complete":"ラウンド完了","quiz_chances":"クイズ挑戦回数","claim_it_now":"今すぐ受け取る"} diff --git a/asset/campaign/lang/ko.json b/asset/campaign/lang/ko.json new file mode 100644 index 0000000..51ff292 --- /dev/null +++ b/asset/campaign/lang/ko.json @@ -0,0 +1 @@ +{"deduct":"차감","quiz_correct":"정답","quiz_correct_count":"[[{{x}}]]문제 중 [[{{num}}]]문제를 맞혔습니다!","quiz_home":"홈","quiz_next":"다음","quiz_question_progress":"총 [[{{x}}]]문제 중 [[{{num}}]]번","quiz_round_complete":"라운드 완료","quiz_chances":"퀴즈 기회","claim_it_now":"지금 받기"} diff --git a/asset/campaign/lang/lang_test.go b/asset/campaign/lang/lang_test.go new file mode 100644 index 0000000..ee4cfda --- /dev/null +++ b/asset/campaign/lang/lang_test.go @@ -0,0 +1,234 @@ +package lang + +import ( + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/verify" + "encoding/json" + "fmt" + "os" + "strings" + "testing" +) + +var aa = map[string]string{ + "德语": "de", + "英语": "en", + "西班牙语": "es", + "法语": "fr", + "印尼语": "id", + "意大利语": "it", + "日语": "ja", + "韩语": "ko", + "葡萄牙语": "pt", + "俄语": "ru", + "泰语": "th", + "土耳其语": "tr", + "中文": "zh", + "繁体中文": "zh-TW", + "越南语": "vi", + "匈牙利语": "hu", + "捷克语": "cs", + "荷兰语": "nl", + "波兰语": "pl", + "罗马尼亚语": "ro", +} + +func TestName(t *testing.T) { + var data = `德语: Abziehen +西班牙语: Deducir +法语: Déduire +印尼语: Kurangi +意大利语: Dedurre +日语: 控除 +韩语: 차감 +葡萄牙语: Deduzir +俄语: Вычесть +泰语: หัก +土耳其语: Düş +繁体中文: 扣除 +越南语: Khấu trừ +匈牙利语: Levon +捷克语: Odečíst` + + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + langData[mark] = ddd + } + + ak := "deduct" + var arr = strings.Split(data, "\n") + for _, v := range arr { + key, val, _ := strings.Cut(v, ":") + mark := aa[strings.TrimSpace(key)] + + if _, ok := langData[mark][ak]; !ok { + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + langData[mark][ak] = strings.TrimSpace(val) + adata, _ := json.Marshal(langData[mark]) + file.Write(adata) + file.Close() + + fmt.Printf("%s: %s->%s \n", key, ak, langData[mark][ak]) + } + } +} + +func TestRemoveKey(t *testing.T) { + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var keys = []string{"invite_friend_install_get_vote_chance_v2"} + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + + for _, key := range keys { + delete(ddd, key) + } + + langData[mark] = ddd + } + + for mark, data := range langData { + if verify.InArray(mark, "en", "zh", "ar") { + continue + } + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(data) + file.Write(adata) + file.Close() + } +} + +func TestCopyKey(t *testing.T) { + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var key = map[string]string{ + "help_fail": "distribution_failed", + } + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + + for cp, to := range key { + _, ok1 := ddd[cp] + if !ok1 { + t.Logf("[%s]没有[%s]", mark, cp) + continue + } + ddd[to] = ddd[cp] + } + + langData[mark] = ddd + } + + for mark, data := range langData { + if verify.InArray(mark, "en", "zh", "ar", "zh-TW") { + continue + } + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(data) + file.Write(adata) + file.Close() + } +} + +func TestUpdateKey(t *testing.T) { + var fname = "./es.json" + + b, err := os.ReadFile(fname) + if err != nil { + t.Log(err) + return + } + + var ddd = make(map[string]string) + _ = json.Unmarshal(b, &ddd) + + val := "Girar" + key := []string{"spin", "lottery"} + + var do bool + for _, v := range key { + old, ok := ddd[v] + if !ok || old == val { + continue + } + ddd[v] = val + do = true + + fmt.Printf("%s: %s->%s \n", v, old, val) + } + + if !do { + t.Log("not done ") + return + } + + file, _ := os.OpenFile(fname, os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(ddd) + file.Write(adata) + file.Close() +} diff --git a/asset/campaign/lang/nl.json b/asset/campaign/lang/nl.json new file mode 100644 index 0000000..ff78783 --- /dev/null +++ b/asset/campaign/lang/nl.json @@ -0,0 +1,761 @@ +{ + "close": "Sluiten", + "invite_share_text": "Doe mee om beloningen te winnen", + "copy_link": "Verwijzing kopiëren", + "copy_success": "Kopiëren succesvol", + "invite_friend": "Raadpleging", + "invite_friend_": "DELEN", + "total_get": "Beloning", + "can_get": "Beloning", + "my_invite": "Uitnodiging", + "invite_record": "Uitnodigingsrecords", + "need_invite": "Volgende niveau", + "bonus_rules": "Beloningsregels", + "activity_rules": "Regels", + "invite_no_record": "Nog geen uitnodigingsdossiers", + "invite_time": "Datum", + "user_id": "Gebruikers-ID", + "reward_cond": "Regels", + "target_receive_prizes": "Neem contact met ons op om uw beloning te claimen", + "receive_prizes": "Wijze van verzameling van de prijzen", + "copy": "Kopiëren", + "bonus_content": "Beloning", + "prize_details": "Beloningen", + "end_time": "END:", + "start_time": "START:", + "activity_time": "Gebeurtenistijd", + "extra_prizes": "Extra", + "quantity": "Aantal", + "prize": "Beloning", + "download_for_each_friend": "Elke {{num}} installatie", + "accumulate_friend_downloads": "Cumulatieve {{num}} installatie", + "max_invite_friend": "Elke gebruiker kan maximale {{num}} vriend(s) verwijzen", + "register_for_each_friend": "Elke {{num}} Registreer", + "accumulate_friend_register": "Cumulatieve {{num}}-register", + "my_task": "Mijn taken", + "fans": "Refee", + "target_fans": "Bereikt", + "install_and_finish_all_cond": "Je downline moet alle taken downloaden en voltooien om in aanmerking te komen.", + "install_and_finish_one_cond": "Je downline moet een taak downloaden en voltooien om in aanmerking te komen.", + "completed": "Klaar", + "undone": "te doen", + "friend_record": "Uitnodigingsrecords", + "task_1": "Taak 1", + "task_2": "Taak 2", + "task_3": "Taak 3", + "invite_friends_to_register": "Elke {{num}} Registreer", + "invite_friends_to_install": "Elke {{num}} installatie", + "no_record": "Nog geen record", + "invite_friends_to_target": "Nodig {{num}} vriend(s) uit om de taak te voltooien", + "target_for_each_friend": "Elke {{num}} referral(s) voltooit de taak", + "accumulate_friend_target": "Cumulatieve {{num}} verwijzingen voltooien de taak", + "prize_list": "Beloninglijst", + "regular_rewards": "Regelmatig", + "extra_rewards": "Extra", + "activity_end_text": "Dit evenement is afgelopen@Bedankt voor uw komst naar ons@Hope tot ziens!", + "receive": "Inwisselen", + "contact_customer_service": "Neem contact op met de klantenservice om op te halen", + "lottery": "Draaien", + "draws_num": "Draaiingen", + "better_luck_next_time": "Probeer je geluk de volgende keer.", + "no_winning_record": "Nog geen record", + "prize_name": "Beloning", + "lottery_service_err": "Servicefout, probeer het later opnieuw", + "draws_none": "De loterij is op.", + "confirm": "OK", + "try_your_luck": "Feel lucky", + "get_prize_to_app": "Download de app om nu uw prijs te claimen", + "target_cond_1": "Taak 1", + "target_cond_2": "Taak 2", + "target_cond_3": "Taak 3", + "all_tasks_to_draw": "Uw downline moet alle taken downloaden en voltooien om {{num}} draw(s) te ontvangen", + "one_tasks_to_draw": "Uw downline moet een taak downloaden en voltooien om {{num}} draw(s) te ontvangen", + "draws_obtained": "Mijn Draw(s):", + "reward_record": "Reward records", + "to_complete": "Ga.", + "completed_times": "Voltooid", + "winning_record": "Reward records", + "Winning_time": "Datum", + "thank": "Volgende tijd", + "no_receive_record": "Nog geen record", + "week_0": "Zon", + "week_1": "Ma", + "week_2": "Di", + "week_3": "wo", + "week_4": "do", + "week_5": "Vr", + "week_6": "Zat", + "invite_friend_install_get_sign": "Nodig {{num}} vriend(s) uit om de app te downloaden en je ontvangt één make-upkaart.", + "invite_num": "Verwijzingen: {{num}}", + "sign_day_num": "Check in {{num}} day(s)", + "continue_day_num": "Achter elkaar ingecheckt voor {{num}} Day(s)", + "day": "Dag", + "sign_card": "Maak een gemiste dag goed", + "invite_friend_get_sign_card_text": "Een dag gemist? Nodig vrienden uit om een make-upkaart te downloaden en te verdienen!", + "obtain": "Get", + "use_sign_card": "Gebruik een make-up kaart", + "confirm_use_sign_card": "Weet u zeker dat u het gebruikt op {{m}}/{{d}}?", + "sign_success": "Ingecheckt", + "you_got": "Je hebt", + "i_see": "Begrepen.", + "done_sign_day_num": "Gecheckt in {{num}} dag(s)", + "done_continue_day_num": "Achter elkaar ingecheckt voor {{num}} day(s)", + "sign_ok": "Ingecheckt", + "card_sign_ok": "Make-up succes", + "continue_sign_ok": "Ingecheckt", + "continue_sign_get_reward_text": "Hit the Streak om beloningen te winnen", + "sign_get_reward_text": "Check-in dagelijks om beloningen te winnen!", + "sign_card_lack": "Gebrek aan make-up kaart", + "sign_fail": "Inchecken mislukt, gelieve de pagina te vernieuwen", + "best_fan": "Topfans", + "top_fans": "Topfans", + "invite_num_title": "Raadpleging", + "no_rank_record": "Nog geen record", + "vote_none": "De stemming is voorbij.", + "vote_service_err": "Servicefout, probeer het later opnieuw", + "hour": "h", + "minute": "min", + "second": "s", + "hour_f": "UUR", + "minute_f": "MINUUT", + "second_f": "TWEEDE", + "vote_num": "Er zijn momenteel {{num}} stemmen beschikbaar", + "here_is_the_quiz_title": "De quiz titel wordt hier getoond", + "option": "optie", + "countdown": "Aantal", + "end": "Einde", + "click_image_select": "Klik op de afbeelding om te selecteren", + "wait_reward_reward": "Kom later terug voor resultaten.", + "sure": "OK", + "submit": "INDIENEN", + "next_qa": "Volgende", + "right": "JUIST", + "error": "Fout", + "right_answer": "Correct antwoord:", + "explain": "Toelichting", + "home": "Thuis", + "share": "Delen", + "download_app_qa": "Download app om mee te doen aan de quiz", + "qa_service_err": "Servicefout, probeer het later opnieuw", + "qa_none": "Je hebt nog geen antwoordmogelijkheden. @Please nodig vrienden uit om meer kansen te krijgen.", + "start": "START", + "challenge_failed": "NIET VERMIST", + "qa_right": "Correct", + "keep_try": "Blijf proberen.", + "congratulation": "Gefeliciteerd.", + "please_choose": "SELECTIE", + "qa_loading": "laden...", + "grow_big": "{{name}} is opgegroeid", + "click_receive": "ONTVANG", + "after_receive": "om te krijgen", + "tree_grow_can_get": "Plant de boom en je ontvangt hem.", + "fertilize_standard_text": "Pas {{num}}% meer meststof toe, en je zult het doel bereiken!", + "fertilize": "Mest", + "fertilizer": "Meststof", + "need_nutrients_will_die": "Ik heb {{num}}g meststof nodig om me gezond te houden.", + "get_new_tree": "Haal een nieuw sapling.", + "tree_grow_max_text": "Je boom is gegroeid, hier is een cadeautje voor je.", + "little_tree": "mijn boom", + "fertilize_num": "Bemest {{num}}g", + "some_withered": "{{name}} is verwelkt", + "some_revive": "{{name}} is weer tot leven gekomen.", + "grow_big_and_get_reward": "{{name}} is volwassen geworden, je krijgt gewoon {{beloning titel}", + "get_grow": "{{name}} ophalen", + "props_lack": "Niet genoeg rekwisieten.", + "cannot_lv_up": "Je hebt het hoogste niveau bereikt.", + "invite_friend_install_get_fertilizer": "Nodig {{num}} vriend uit om App te downloaden, u ontvangt {{grow_num}} meststof.", + "received_sapling": "Je hebt een sapling gekregen.", + "pick_name": "Kies een naam", + "growth_manual": "Groeigids", + "get_nourishment": "Krijg kunstmest", + "plant_new_tree": "Plant een boom", + "tree_revive": "Bewaar je boom", + "timeout_tree_die": "Door een gebrek aan bevruchting voor een lange tijd, uw boom is verdord", + "invite_friend_install_revive_tree": "Nodig {{num}} vrienden uit om de app te downloaden en u kunt uw boom opslaan", + "dog_grow_can_get": "Verhoog de puppy en je zult het ontvangen", + "feed_standard_text": "Voer gewoon {{num}}% meer om het doel te bereiken!", + "feed": "Feed", + "dog_food": "Hondenvoer", + "need_dog_food_will_leave": "Ik heb {{num}}g eten nodig, of ik moet misschien op avontuur buiten ons gezellige huis. Woef!", + "get_new_dog": "Een puppy goedkeuren", + "dog_grow_max_text": "Je puppy is volwassen geworden, hier is een cadeautje voor je.", + "little_dog": "Puppy", + "feed_num": "{{num}}g-voeding voeren", + "some_leave": "{{name}} is vertrokken", + "some_come": "{{name}} is terug", + "invite_friend_install_get_dog_food": "Nodig {{num}} vriend(s) uit om App te downloaden, u ontvangt {{grow_num}}g voedsel", + "received_dog": "Je adopteert een puppy", + "get_dog_food": "Haal voedsel.", + "plant_new_dog": "Adopteer een hond", + "rescue_puppy": "De puppy opslaan", + "timeout_dog_go": "Omdat het al lang geen liefde en voedsel meer heeft gevoeld, is je puppy weggelopen van huis.", + "invite_friend_install_rescue_puppy": "Nodig {{num}} vriend(s) uit om de app te downloaden en je kunt je puppy opslaan.", + "get_collect_num": "U heeft 1 stuk {{reward_title}} ontvangen.", + "fixed_point": "Gespecificeerd aantal", + "this_props_lack": "Je hebt dit item nog niet.", + "help_record": "Uitnodigingsrecords", + "no_help_record": "Nog geen record", + "install_help_record": "Een vriend downloadde de app", + "open_help_record": "Een vriend opende de app", + "click_help_record": "Een vriend klikte op de link", + "service_err": "Servicefout, probeer het later opnieuw", + "select_reward": "Selecteer Beloning", + "view_help_rule": "Controleregels", + "help_rule": "Regels uitnodigen", + "install_help": "App naar Boost downloaden", + "install_help_text": "Elke vriend downloadde de app, voortgang [[+{{num}}%]]", + "open_help": "App openen om te versterken", + "open_help_text": "Elke vriend opende de app, voortgang [[+{{num}}%]], tot {{limit_num}}%", + "click_help": "Klik op Link naar Boost", + "click_help_text": "Elke vriend klikte op de uitnodigingslink, voortgang [[+{{num}}%]], tot {{limit_num}}%", + "invite_friends_receive_free_gifts": "Nodig vrienden uit om gratis beloningen te krijgen!", + "get_prizes": "Krijg deze beloning", + "help_success": "SUCCES", + "also_get_free": "U kunt het ook gratis krijgen", + "install_get_free_reward": "Download de app om gratis beloningen te krijgen", + "install_get_reward": "Haal de App, ontgrendel prijzen", + "received_success": "succes", + "ballot_record": "HERHALING", + "no_ballot_record": "Nog geen record", + "ballot_none": "Je hebt nog geen kansen. Nodig vrienden uit om meer kansen te krijgen.", + "share_good_luck": "Deel het geluk", + "ballot": "Hebbes.", + "answer_record": "HERHALING", + "challenge_results": "WEERGAVE", + "challenge_time": "DATUM", + "no_answer_record": "Nog geen record", + "answer_none": "De quiz is op.", + "please_choose_answer": "Selecteer een antwoord", + "answer_countdown": "Aantal", + "got_prizes": "GEWONNEN:", + "continue_free_get": "Doorsnijden", + "finish_help": "Voltooid", + "reward_send_your_account": "De beloning is naar uw account gestuurd", + "no_reward_record": "Nog geen record", + "download_app_ballot": "Download de app om mee te doen aan de campagne", + "yesterday": "Gisteren", + "today": "Vandaag", + "prize_record": "HERHALING", + "get_reward_time": "DATUM", + "no_sign_card": "Ik heb nog geen vervangende kaart getekend.", + "get_more_knowledge": "Probeer je geluk volgende keer.", + "qa_very_hard": "Wie is de slimme man?", + "num": "QUIZ", + "contact_customer_service_var": "Neem contact op ({{contact}})", + "like_share_people_lucky": "Gedeelde mensen hebben meer geluk. Deel nu!", + "my_reward": "Mijn prijs", + "no_install_prompt": "Dat social media platform is niet geïnstalleerd.", + "please_login": "Aanmelden", + "got_num": "(Gebeurde {{num}} keer)", + "completed_num": "(Gedaan aan {{num}})", + "fixed_roll_none": "Je hebt nog geen geluk. Nodig {{num}} vriend(s) uit om de app te downloaden en krijg 1 geluks dobbelsteen.", + "fixed_roll_none_limit": "Nog geen geluk. Nodig {{num}} vriend(s) uit om de App te downloaden om 1 geluks dobbelsteen te krijgen, tot een maximum van {{limit}} lucky dobbelstenen(s).", + "invite_friend_install_get_roll_chance": "Nodig {{num}}-vriend(s) uit om de app te downloaden en {{chance}}-gelukkige dobbelstenen te krijgen.", + "invite_friend_install_get_roll_chance_limit": "Nodig {{num}} vriend(s) uit om de App te downloaden en {{chance}} dobbelstenen(s), tot een maximum van {{limit}} dobbelstenen(s).", + "invite_friend_register_get_roll_chance": "Nodig {{num}} vriend(s) uit om de registratie te voltooien om {{chance}} dobbelstenen te ontvangen.", + "invite_friend_register_get_roll_chance_limit": "Nodig {{num}} vriend(s) uit om de registratie te voltooien om {{chance}} dobbelstenen(s te ontvangen), tot een maximum van {{limit}} dobbelstenen(s).", + "dice_task_finish": "Compleet om {{chance}} dobbelstenen te ontvangen", + "dice_task_finish_limit": "Voltooid om {{chance}} dobbelstenen te ontvangen, tot {{limit}} voltooiing(s).", + "dice_task_num": "Totale dobbelstenen verkregen uit taken:", + "dice_task_cond_one": "Voltooi elke taak om meer dobbelstenen te krijgen.", + "dice_task_cond_all": "Voltooi alle taken om {{chance}} dobbelstenen(s).", + "dice_task_cond_all_limit": "Voltooi alle taken om {{chance}} dobbelstenen(s), tot een maximum van {{limit}} tijd(s). U heeft {{num}} time(s) tot nu toe verkregen.", + "spin_now": "Draai nu", + "spinning": "Draaien", + "expires_in": "Verloopt in", + "records": "Gegevens", + "luck_you": "Geluksvogel.", + "get_extra_reward": "Extra bonus voor u!", + "share_get": "Delen om uw", + "upgrade_reward": "upgrade beloning", + "super_upgrade": "Verrassing! Super upgrade!", + "preparation": "Per spin", + "invite_get_energy": "Uitnodigen om energie te krijgen", + "invite_friend_get_energy": "Nodig vrienden uit om energie te krijgen", + "up_to": "Tot", + "spin": "Draaien", + "away": "{{num}} weg", + "win_left_energy": "{{cash}} winnen met slechts {{num}} spin", + "enjoy_credit": "Geniet van je krediet", + "invite_no_record_reward": "Je hebt nog niemand uitgenodigd, Nodig vrienden uit om beloningen te ontvangen!", + "spin_reward": "Spin beloning", + "share_reward": "Gedeelde beloning", + "start_reward": "Startstimulans", + "left_cash_get_reward": "Alleen {{left}} nog over om {{cash}} beloning te krijgen", + "auto_spin": "Spin automatisch in [[{{second}}]] s", + "guarantee_to": "Garantie om te winnen {{cash}} met slechts 1 spin!", + "auto_select": "Selecteer automatisch in [[{{second}}]] s", + "open": "Open", + "select_box": "Kies 1 geschenkdoos om te zien hoeveel geld Beloning krijgt u", + "money_reward": "Geldbeloning", + "jackpot_best_prize": "Jackpot! Beste prijs", + "best_prize": "Best&&Prize", + "almost_reward": "Bijna tot de beloning!", + "claimed_reward": "Over [[10000+]] hebben mensen beloond", + "pass_on_energy": "Ze gaven Energie aan jou door!", + "victory_tip": "de overwinning ligt binnen jullie bereik, [[neem het]]", + "min_won_barrage": "{{name}} Won [[{{cash}}]] {{min}} mins ago Great!", + "closer_to_prize": "je komt dichter bij de grote prijs", + "shine_arrived": "je moment om te schitteren hash arrived pak het", + "get_money_reward": "Krijgen geld Beloning", + "won_barrage": "[[{{name}}]] heeft beweerd [[{{cash}}]]", + "surprise_for_you": "Verrassing voor jou", + "last_spin_win": "Slechts een laatste draai om te winnen!", + "energy": "Energie", + "token": "Token", + "your_reward": "UW GELD", + "go_to": "Te gebruiken", + "click_contact": "Contacteer Klantenservice", + "click_contact_tip": "Contactinformatie is gekopieerd\nNeem contact met ons op", + "see_reward": "Prijzen bekijken", + "prize_gone": "De prijzen zijn weg.", + "no_reward_get": "Je bent te laat, alle prijzen zijn uitgedeeld!", + "no_more_record": "Geen platen meer.", + "help_fail": "NIET VERMIST", + "grand_opening": "Grote opening", + "get_reward_after_play": "Iedereen krijgt een beloning na het spelen van het spel!", + "play_and_get_prize": "Speel om je prijs te krijgen!", + "won_free_gift": "Je hebt het gratis geschenk gewonnen!", + "download_app_get_gift": "Download App om uw prijs te krijgen!", + "download": "Downloaden", + "jackpot": "JACKPOT", + "play": "Afspelen", + "install_ineligible": "Niet in aanmerking komende (niet nieuwe installatie)", + "unlock_your_luck": "Ontgrendel je geluk", + "spin_and_win": "Spin en Win", + "play_to_win_prize": "Speel om een prijs te winnen!", + "you_got_the_best_prize": "Je hebt de beste prijs.", + "play_and_win": "Spelen en winnen", + "download_to_get": "downloaden om op te halen", + "best_prize_!": "Beste prijs!", + "roll_dice_number": "Rol dobbelstenen, nummer {{point}}", + "lucky_dice_number": "Gebruik geluks dobbelstenen, nummer {{point}}", + "day_sign": "Dagelijks inchecken", + "dice_record": "Gegevens", + "finish_friend_register": "Volledige vriend registratie taak", + "finish_friend_install": "Voltooi de aanbevolen app download taak", + "finish_lucky_dice_task": "Voltooi de gelukkige dobbelsteen taak", + "fragment": "Fragment", + "click": "klik", + "collect_fragment_compare_reward": "Verzamel {{num}} fragmenten om de prijs te maken", + "craft_fragments": "Fragmenten voor ambachten", + "reward_lack_contact_customer_service": "Uit voorraad. Neem contact op met de klantenservice voor assistentie.", + "join_in_campaign": "Deelnemen aan campagne", + "contact": "Contactpersoon", + "all": "Alles", + "contact_information": "Contactinformatie", + "no_more_dice": "Geen dobbelstenen meer", + "try_your_luck_first_upper": "Probeer je geluk.", + "fill_in": "Invullen", + "submit_success": "Succes", + "please_do_not_submit_repeatedly": "Gelieve niet herhaaldelijk in te dienen", + "submitted": "Overgedragen", + "please_complete_the_form": "Vul het formulier in", + "welcome_gifts": "Welkomstgeschenken", + "spin_to_win": "Draai om te winnen", + "view": "weergave", + "use": "Gebruik", + "get_and_use": "Claim en gebruik", + "invite_friend_install_get_lottery_chance": "Nodig {{num}} vriend(s) uit om de App te downloaden, en je krijgt {{chance}} kans(s).", + "invite_friend_install_get_lottery_chance_limit": "Nodig {{num}} vriend(s) uit om de App te downloaden, en je krijgt {{chance}} kans(s), tot een maximum van {{limit}} kans(s).", + "invite_friend_register_get_lottery_chance": "Nodig {{num}} vriend(s) uit om de registratie te voltooien, en je krijgt {{chance}} kans(s).", + "invite_friend_register_get_lottery_chance_limit": "Nodig {{num}} vriend(s) uit om de registratie te voltooien, en je krijgt {{chance}} kans(s), tot een maximum van {{limit}} kans(s).", + "lottery_task_finish": "Je krijgt {{chance}} kans(s) na voltooiing", + "lottery_task_finish_limit": "U krijgt {{chance}} kans(s) na voltooiing, tot een maximum van {{limit}} tijd(s)", + "lottery_task_num": "De totale kansen van de taken", + "lottery_task_cond_one": "Volledige taken om kansen te krijgen", + "lottery_task_cond_all": "Het voltooien van alle taken kan resulteren in het verkrijgen van {{chance}} kans(s)", + "lottery_task_cond_all_limit": "Het voltooien van alle taken kan resulteren in het verkrijgen van {{chance}} kans(s), tot een maximum van {{limit}} tijd(s), en {{num}} tijd(s) zijn verkregen.", + "raffle_chances": "Kans", + "quiz_chances": "Quiz-kans", + "get_lottery_chances": "Get Loterij Kansen", + "remaining_raffle_chances": "Resterende kansen", + "lottery_again": "Opnieuw", + "use_immediately": "Nu gebruiken", + "wow_you_got": "Wow! Je hebt", + "next_time": "Volgende keer", + "finish_all_task": "Taken voltooid", + "finish_one_task": "Taak voltooid", + "sign_in_every_day_can_get_dice": "Meld je aan elke dag , kunt u {{num}} dobbelstenen(s).", + "do_task_get_dice": "Doe taken en haal dobbelstenen", + "do_task_get_lottery": "Taken uitvoeren en kans krijgen", + "refresh_tomorrow": "Morgen vernieuwen", + "click_icon": "Klik op pictogram", + "paste_to_media": "Plakken naar media", + "get_prize": "Prijzen krijgen", + "copy_success_paste_to_media": "Gecopieerd succes, gelieve te plakken op social media", + "invite_friend_install_get_grow": "Nodig {{num}} vriend(s) uit om de App te downloaden en {{chance}} groei items te ontvangen.", + "invite_friend_install_get_grow_limit": "Nodig {{num}} vriend(s) uit om de App te downloaden en {{chance}} groei items te ontvangen, tot een maximum van {{limit}} groei items.", + "invite_friend_register_get_grow": "Nodig {{num}} vriend(s) uit om de registratie te voltooien en {{chance}} groei items te ontvangen.", + "invite_friend_register_get_grow_limit": "Nodig {{num}} vriend(s) uit om de registratie te voltooien en {{chance}} groei items te ontvangen, tot een maximum van {{limit}} groei items.", + "grow_task_finish": "Voltooien om {{chance}} groei items", + "grow_task_finish_limit": "Complete om {{chance}} groei items, voltooien tot {{limit}} tijd(s)", + "grow_task_cond_one": "Voltooi elke taak om groei items", + "grow_task_cond_all": "Voltooi alle taken om {{chance}} groei items", + "grow_task_cond_all_limit": "Voltooi alle taken om {{chance}} groei items, tot {{limit}} tijd(s), al kreeg {{num}} tijd(s)", + "do_task_get_grow": "Complete taken om groeipunten te krijgen", + "easy_mode": "Gemakkelijke modus", + "mins_ago": "{{min}} minuten geleden", + "barrage_got_reward": "heeft [[{{title}}]] door het spelen van lucky draw.", + "sold_out": "uitverkocht", + "task_done": "Taak voltooid", + "click_copy_link": "Klik op \"Copy Link\"", + "select_card": "Selecteer een kaart", + "raffle_chances_lack": "Niet genoeg mogelijkheden", + "raffle_chances_lack_tip": "Je hebt niet genoeg kansen voor de gelukstrekking. Ga naar de onderkant van de pagina om taken te voltooien en meer kansen te verdienen.", + "get_more_chance": "Meer kansen krijgen", + "flip_now": "Nu spiegelen", + "raffle_num": "Kans", + "win": "Win", + "next_week_do": "Volgende week", + "week_do_1": "Verversen op ma", + "week_do_2": "Verversen op di", + "week_do_3": "Verversen op wo", + "week_do_4": "Op do verversen", + "week_do_5": "Verversen op vr", + "week_do_6": "Verversen op za", + "week_do_7": "Verversen op de zon", + "to_flip": "Ga een kaart tekenen", + "won_get": "Gefeliciteerd.", + "invite_friend_download": "Nodig {{num}} vriend(s) uit om de App te downloaden", + "invite_friend_register": "Nodig {{num}} vriend(s) uit om te registreren", + "fixed_roll_none_register": "Nog geen geluk. Nodig {{num}} vriend(s) om te registreren en krijgen 1 geluk dobbelstenen.", + "fixed_roll_none_register_limit": "Nog geen geluk. Nodig {{num}} vriend(s) uit om te registreren en krijg 1 geluks dobbelsteen, tot een maximum van {{limit}} lucky dobbelstenen(s).", + "sign_in_every_day_can_get_lottery": "Meld je elke dag aan om {{num}} kans(s) te krijgen om een prijs te winnen.", + "finish_newcomer_task": "[[Nieuwkomer]] volledige taken te verdienen [[{{reward_title}}]]", + "done_newcomer_task": "Nieuwkomertaken", + "register_help_record": "Een vriend heeft de registratie voltooid.", + "register_help_text": "Elke vriend heeft de registratie voltooid, voortgang [[+{{num}}%]]", + "register_help": "Registratie Boost", + "invite_friend_install_get_qa": "Nodig {{num}} vrienden uit om de App te downloaden en krijg {{chance}} kansen om vragen te beantwoorden.", + "invite_friend_install_get_qa_limit": "Nodig {{num}} vrienden uit om de App te downloaden en krijg {{chance}} kansen om vragen te beantwoorden, met een maximum van {{limit}} kansen.", + "invite_friend_register_get_qa": "Nodig {{num}} vrienden uit om de registratie te voltooien en krijg {{chance}} kansen om vragen te beantwoorden.", + "invite_friend_register_get_qa_limit": "Nodig {{num}} vrienden uit om de registratie te voltooien en krijg {{chance}} kansen om vragen te beantwoorden, met een maximum van {{limit}} kansen.", + "qa_task_finish": "Het voltooien van het zal verdienen u {{chance}} kansen om vragen te beantwoorden.", + "qa_task_finish_limit": "Het voltooien van het zal verdienen u {{chance}} kansen om vragen te beantwoorden, met een maximum van {{limit}} voltooiingen.", + "qa_task_cond_one": "Het voltooien van elke taak zal u een kans om vragen te beantwoorden verdienen", + "qa_task_cond_all": "Het voltooien van alle taken zal verdienen u {{chance}} kansen om vragen te beantwoorden", + "qa_task_cond_all_limit": "Het voltooien van alle taken zal verdienen je {{chance}} kansen om vragen te beantwoorden, met een maximum van {{limit}} kansen, en je hebt al {{num}} kansen ontvangen", + "sign_in_every_day_can_get_qa": "Elke dag ontvangt u {{num}} kansen om vragen te beantwoorden.", + "do_task_get_qa": "Volledige taken om kansen te verdienen om vragen te beantwoorden", + "help_install": "[[{{name}}]] ontvangen [[installatiesteun]]", + "help_register": "[[{{name}}]] ontvangen [[registratiesteun]]", + "help_open": "[[{{name}}]] ontvangen [[dagelijks bezoek boost]]", + "help_click": "[[{{name}}]] ontvangen [[klik op ondersteuning]]", + "finish_help_get_reward": "[[{{name}}]] de ondersteunende taak voltooid en ontvangen [[{{reward_title}}]]", + "a_gift_to_you": "Een geschenk voor jou", + "choose_it": "Kies het", + "nice_choice": "Mooie keuze.", + "tip": "Tip", + "left_percent_get_reward": "Alleen [[{{left}}%]] over om beloning te krijgen", + "ensure_select_reward": "Selectie bevestigen [[{{reward_title}}]]?", + "reward_obtained": "Beloning verkregen", + "lucky": "Lucky", + "percent_progress_for_you": "Je hebt een gratis [[{{percent}}%]] boost!", + "invite": "Uitnodigen", + "help_task": "Taak versterken", + "finish_all_task_help_parent": "Voltooi alle volgende taken om uw vriend boost", + "finish_one_task_help_parent": "Voltooi een van de volgende taken om uw vriend boost", + "task_index": "Taak {{index}}", + "raise_pet_to_get_free_gift": "Verhoog uw huisdier om gratis geschenken te krijgen", + "step": "STAP", + "pick_item": "Kies item", + "raise_pet": "Huisdier verhogen", + "get_free_gift": "Krijg gratis geschenk", + "has_got": "{{name}} heeft {{reward_title}}", + "more_unexpected_gifts": "Meer onverwachte geschenken tijdens het opvoeden van uw huisdier", + "pick_it": "Kies het.", + "picked": "geplukt", + "your_gift_confirm": "Bevestig uw geschenk.", + "free": "Vrij", + "raise_the_dog_to_get_your": "voed de hond op om uw", + "free_gift": "Gratis geschenk!", + "expires_in_day": "Vervalt in {{day}} dagen", + "collect_more_love": "Verzamel [[{{num}}]] meer liefdespunten om een GRATIS geschenk te krijgen", + "collect": "Verzamelen", + "claim_now": "Claim nu", + "feed_more_times": "Feed {{num}} meer keer", + "get_more": "Meer informatie", + "first_referral_bonus": "Eerste verwijzing bonus!", + "get_rewards_first_time": "Ontvang beloningen door vrienden voor het eerst uit te nodigen", + "first_invite_receive": "De eerste uitnodiging voor een nieuwe gebruiker zal ontvangen [[{{num}}]]", + "invite_now": "Nodig nu uit", + "invite_get_dog_foods": "Nodig vrienden uit om voedsel te verdienen", + "invite_friends": "Nodig vrienden uit", + "pick_a_gift": "Kies 1 gratis geschenk", + "feed_3_times": "3 maal voeden", + "invite_new_user_extra_get": "Nodig nieuwe gebruiker voor de eerste keer kan krijgen extra [[{{num}}]]", + "reward_upgraded": "Beloning verbeterd", + "reward_for_you": "[[{{reward_title}}]] voor u", + "time_s_up": "Tijden om!", + "play_again": "Opnieuw afspelen", + "complete_tasks_to_earn_reward": "Volledige taken om Beloning te verdienen", + "super": "SUPER", + "super_benefit": "Supervoordeel", + "task_cond_one": "Voltooi elke taak om een [[beloning]] te ontvangen", + "task_cond_all": "Voltooi alle taken om {{reward_title}}[[+{{num}}]]", + "congrats": "Gefeliciteerd!", + "enjoy_your": "Geniet van je", + "try_again_to_claim": "Probeer opnieuw je gave op te eisen", + "collect_love": "Verzamel liefde", + "finish_step": "Afgedane fasetaak", + "finish_feed": "Voltooid voertaak", + "friend_third_feed": "Vriend voltooide het voeden van hondenvoer 3 keer", + "friend_first_third_feed": "Dagelijks uitnodigen vrienden om het voeden van honden voedsel 3 keer te voltooien", + "friend_select_reward": "Vriend heeft de prijs gekozen.", + "friend_first_select_reward": "Nodig dagelijks vrienden uit om de prijs te kiezen", + "rewards": "Beloningen", + "round_expired": "Ronde verlopen", + "love_points": "Love Points", + "dog_food_lack": "Ga alsjeblieft meer hondenvoer halen.", + "collect_machine": "De hondenvoermachine is ontvangen.", + "max_grow": "De maximale ontwikkelingstijden overschreden", + "please_collect_love": "Verzamel eerst liefde", + "continue_grow": "Het huidige huisdier kan nog steeds worden gehouden", + "dog_food_machine_running": "Hondenvoer is in productie", + "reward_remove": "De prijs is verlaagd.", + "reward_get_max": "De prijs heeft de maximumgrens van de verwerving overschreden", + "i_am_hungry": "Ik heb honger.", + "effect_invite": "Succesvol een vriend uitgenodigd", + "day_first_effect_invite": "Succesvol een vriend uitgenodigd voor de eerste keer op dezelfde dag", + "finish_many_feed": "Meerdere voedingen voltooid", + "daily_rewards": "Dagelijkse beloning", + "come_back_tomorrow_for_more_rewards": "Kom morgen terug voor meer beloningen!", + "claim_today_reward": "Claim de beloning van vandaag!", + "come_back_tomorrow": "Kom morgen terug!", + "fail_to_sign_progress_reset": "Als u zich niet continu aanmeldt, wordt uw voortgang hersteld.", + "signed_in": "Ondertekend in", + "signed_title": "Aanmelden", + "you_got_the_gift_box": "Je hebt de geschenkdoos.", + "use_it": "Gebruik het", + "you_got_dog_food": "Je hebt {{num}} hondenvoer", + "you_got_reward": "Je hebt {{reward_title}}", + "invite_contest": "Uitnodigingswedstrijd", + "rewards_earned_to_your_account": "Verdiende beloningen worden [[direct op]] je account bijgeschreven", + "invite_more_friends": "Nodig meer vrienden uit", + "invited": "{{num}} uitgenodigd", + "daily_fortune_draw": "Dagelijkse loting", + "win_free_gift_every_day": "Win gratis geschenk elke dag!", + "draw_now": "Nu tekenen", + "day_num": "Dag {{num}}", + "you": "Jij", + "blind_box": "Blinde doos", + "daily_draw": "Dagelijkse trekking", + "rankings": "Ranglijst", + "rank_reward": "Ranking Rewards", + "sign_reward": "Aanmeldvergoedingen", + "blind_reward": "Blind Box Rewards", + "lucky_reward": "Loterij Beloningen", + "tomorrow": "Morgen", + "win_reward": "Win[[{{title}}]]", + "rank_end": "De tijd is om.", + "congrats_for_getting": "Gefeliciteerd met het krijgen", + "ends_in": "eindigt in", + "invite_friend_download_app": "Nodig [[{{num}}]] vriend(s) uit om de App te downloaden", + "invite_friend_register_app": "Nodig [[{{num}}]] vriend(s) uit om te registreren", + "invite_friend_install_get_lottery_chance_v2": "Nodig [[{{num}}]] vriend(s) uit om de App te downloaden, en je krijgt [[{{chance}}]] kans(s).", + "invite_friend_install_get_lottery_chance_limit_v2": "Nodig [[{{num}}]] vriend(s) uit om de App te downloaden, en je krijgt [[{{chance}}]] kans(s), tot een maximum van {{limit}} kans(s).", + "invite_friend_register_get_lottery_chance_v2": "Nodig [[{{num}}]] vriend(s) uit om de registratie te voltooien, en je krijgt [[{{chance}}]] kans(s).", + "invite_friend_register_get_lottery_chance_limit_v2": "Nodig [[{{num}}]] vriend(s) uit om registratie te voltooien, en je krijgt [[{{chance}}]] kans(s), tot een maximum van {{limit}} kans(s).", + "lottery_task_finish_v2": "Je krijgt [[{{chance}}]] kans(s) na voltooiing", + "lottery_task_finish_limit_v2": "Je krijgt [[{{chance}}]] kans(s) na voltooiing, tot een maximum van {{limit}} tijd(s)", + "lottery_task_cond_all_v2": "Het voltooien van alle taken kan resulteren in het verkrijgen van [[{{chance}}]] kans(s)", + "lottery_task_cond_all_limit_v2": "Het voltooien van alle taken kan resulteren in het verkrijgen [[{{chance}}]] kans(s), tot een maximum van {{limit}} tijd(s), en [[{{num}}]] tijd(s) zijn verkregen.", + "sign_in_every_day_can_get_lottery_v2": "Meld je elke dag aan om [[{{num}}]] kans(s) te krijgen om een prijs te winnen.", + "invite_friends_to_earn_reward": "Nodig vrienden uit om Beloning te verdienen", + "raffle_num_add": "Kans [[+{{num}}]]", + "click_button_and_get_coins": "Klik op de knop om de taak te voltooien en meer munten te krijgen", + "do_task_get_energy": "Volledige taken om energie te winnen", + "coins": "{{num}} munten", + "get_tasks": "Taken ophalen", + "next": "Volgende", + "finish_task_title": "Voltooid \"{{title}}\"", + "get_energy": "Energie ophalen", + "tasks": "Taken", + "invite_friend_install_get_gold": "Nodig {{num}} vrienden uit om de app te downloaden om {{chance}} munten te verdienen.", + "invite_friend_install_get_gold_limit": "Nodig {{num}} vrienden uit om de app te downloaden om {{chance}} munten te verdienen, met een maximum van {{limit}} munten.", + "invite_friend_register_get_gold": "Nodig {{num}} vrienden uit om de registratie te voltooien om {{chance}} munten te verdienen.", + "invite_friend_register_get_gold_limit": "Nodig {{num}} vrienden uit om de registratie te voltooien om {{chance}} munten te verdienen, met een maximum van {{limit}} munten.", + "gold_task_finish": "Volledig te verdienen {{chance}} munten", + "gold_task_finish_limit": "Volledig te verdienen {{chance}} munten, tot een maximum van {{limit}} tijden", + "gold_task_cond_one": "Voltooi elke taak om munten te verdienen", + "gold_task_cond_all": "Voltooi alle taken om {{chance}} munten te verdienen", + "gold_task_cond_all_limit": "Voltooi alle taken om {{chance}} munten te verdienen, tot een maximum van {{limit}} keer, u hebt ontvangen {{num}} keer", + "do_task_get_gold": "Volledige taken om munten te verdienen", + "task_none": "Er zijn geen taken beschikbaar om te voltooien", + "finish_task_earn_num": "Voltooi de taak om te verdienen [[+{{num}}]]", + "reached_the_max": "Bereikt het maximum", + "has_got_style": "[[{{name}}]] heeft [[{{reward_title}}]]", + "dog_food_num": "{{num}}g voedsel", + "in_production": "In productie", + "active_talk": "Je hebt me lang niet bezocht. Kom vaker om meer beloningen te krijgen.", + "task_reset_talk": "Een van uw prijzen staat op het punt te vervallen, kom en bekijk het.", + "dog_offline_talk": "U hebt een deel van het voeder voor huisdieren ontvangen, ga het alstublieft claimen.", + "complete_task_talk": "U hebt de taak volbracht, gefeliciteerd met het ontvangen van een prijs, kom en claim het.", + "current_total_prize_pool": "Huidige totale prijspool", + "get_coin": "[[{{name}}]] Munten gewonnen [[{{num}}]]", + "join_coin_num": "[[{{name}}]] Grijp goud [[[*{{num}}]]", + "join_coin": "Goud grijpen", + "coin_per_use": "{{num}} gouden munten per gebruik", + "expected_to_receive_coin": "Verwacht om [[{{num}}]] gouden munten te ontvangen", + "collect_coin": "[[{{num}}]] gouden munten kunnen worden verzameld", + "expired": "Verlopen", + "gold_coins_deposited": "Gedeponeerde gouden munten", + "timeout_and_no_collection": "Timeout en niet geclaimd", + "use_gold_coins_to_play": "Gebruik [[{{num}}]] gouden munten om te spelen?", + "more": "Meer", + "cancel": "Annuleren", + "play_limit_next_round": "Je hebt de speellimiet bereikt! Kom terug voor de volgende ronde!", + "insufficient_balance_grab_gold": "Onvoldoende evenwicht. Kan goud niet grijpen", + "do_task": "Taken uitvoeren", + "this_round_has_ended": "Deze ronde is afgelopen.", + "claim": "Claim", + "claim_it_now": "Claim het nu!", + "claim_time_not_reached": "Claimtijd niet bereikt", + "success": "Succes", + "too_late_reward_expired": "Te laat! Beloning verlopen", + "no_duplicate_claims": "Geen dubbele claims", + "buy_more": "Koop meer", + "operation_failed": "Operatie mislukt. Probeer het later opnieuw", + "expected_to_be_available_tomorrow": "Verwacht wordt dat morgen beschikbaar zal zijn", + "expected_to_be_available_in_day": "Verwacht beschikbaar te zijn in {{day}} dagen", + "num_gold_coins": "[[{{num}}]] munten", + "check_in_now": "Check nu in", + "complete_daily_check_ins_for_prizes": "Volledige dagelijkse check-ins voor prijzen", + "check_in_days": "Incheckdagen", + "lottery_chance_done": "Kans [[+{{chance}}]] (Gedaan: [[{{num}}]])", + "lottery_chance_done_limit": "Kans [[+{{chance}}]] (Gedaan: [[{{num}}]]/{{limit}})", + "claim_failed": "Claim mislukt. Neem contact op met klantenservice.", + "answer_tomorrow_get_chance": "Haal {{chance}} meer kansen om morgen te antwoorden", + "finish_invite_task": "Uitnodigingstaak voltooid", + "dice_chance_done": "Dobbelstenen [[+{{chance}}]] (Gedaan: [[{{num}}]])", + "dice_chance_done_limit": "Dice [[+{{chance}}]] (Gedaan: [[{{num}}]]/{{limit}})", + "grow_chance_done": "Groeiposten [[+{{chance}}]] (Gedaan: [[{{num}}]])", + "grow_chance_done_limit": "Groeiposten [[+{{chance}}]] (Gedaan: [[{{num}}]]/{{limit}})", + "qa_chance_done": "Quiz Chance [[+{{chance}}]] (Gedaan: [[{{num}}]])", + "qa_chance_done_limit": "Quizkans [[+{{chance}}]] (Gedaan: [[{{num}}]]/{{limit}})", + "help_wait": "Aan de gang", + "distributing": "Verdeling", + "distribution_failed": "NIET VERMIST", + "claimed": "Opgevraagd", + "no_prizes_to_claim": "Geen prijzen beschikbaar voor u om te claimen", + "points_use": "Gebruikte {{num}}-punten", + "points_use_ok": "Uitwisseling succesvol", + "points_use_lack": "Onvoldoende punten", + "points_use_close": "Wisselfunctie is gesloten", + "points_use_day_limit": "Dagelijkse wisselkoerslimiet bereikt", + "points_use_limit": "Koerslimiet bereikt", + "points_use_dice": "Gebruik [[{{num}}]], ruil voor [[{{chance}}]] dobbelstenen?", + "points_use_lottery": "Gebruik [[{{num}}]], ruil voor [[{{chance}}]] kans?", + "times": "Tijden", + "dice": "Dobbelstenen", + "one_spin": "1 spin", + "raise_the_pet_to_get_your": "Verhoog huisdieren te krijgen uw", + "pet_food_num": "{{num}}g voeder voor gezelschapsdieren", + "pet_food": "Diervoeders", + "friend_third_feed_pet": "Uw vriend heeft huisdieren 3 keer gevoed", + "friend_first_third_feed_pet": "Nodig vrienden dagelijks uit om huisdieren 3 keer te voeden", + "collect_machine_food": "De petfood machine is ontvangen", + "pet_food_lack": "Ga alsjeblieft meer dierenvoer halen.", + "pet_food_machine_running": "Huisdiervoer wordt geproduceerd", + "chat_day_limit": "Ik ben een beetje moe vandaag.", + "chat_token_limit": "Ik ben erg moe.", + "chat": "Chat", + "hours_ago": "{{hour}} uren geleden", + "conversation_and_chat": "U kunt een gesprek beginnen en chatten met uw huisdier", + "invite_friend_install_get_vote_chance": "Nodig {{num}} vrienden uit om de app te downloaden om {{chance}} stemkansen te krijgen.", + "invite_friend_install_get_vote_chance_limit": "Nodig {{num}} vrienden uit om de app te downloaden om {{chance}} stemkansen te krijgen, met een maximum van {{limit}} kansen.", + "invite_friend_register_get_vote_chance": "Nodig {{num}} vrienden uit om de registratie te voltooien om {{chance}} stemkansen te krijgen.", + "invite_friend_register_get_vote_chance_limit": "Nodig {{num}} vrienden uit om de registratie te voltooien om {{chance}} stemkansen te krijgen, met een maximum van {{limit}} kansen.", + "vote_task_finish": "Voltooien geeft je {{chance}} stemkansen", + "vote_task_finish_limit": "Volledig om {{chance}} stemkansen te verdienen, max {{limit}} keer", + "vote_task_num": "Stem op kansen die uit taken worden verdiend", + "vote_task_cond_one": "Voltooi elke taak om stemkansen te verdienen", + "vote_task_cond_all": "Voltooi alle taken om {{chance}} stemkansen te krijgen", + "vote_task_cond_all_limit": "Voltooi alle taken om {{chance}} stemkansen, max {{limit}}, al {{num}}", + "do_task_get_vote": "Verdien stemkansen door taken te doen", + "sign_in_every_day_can_get_vote": "Kom dagelijks om {{num}} stemkansen te ontvangen", + "your_choice": "Uw keuze", + "cap_win": "WINST", + "cap_draw": "GELIJKSPEL", + "blue_team": "Blauw", + "red_team": "Rood", + "spend_coin_to_vote_team": "Weet u zeker dat u [[{{coin}}]] wilt besteden aan het stemmen voor <<{{title}}>>?", + "vote_team": "Weet u zeker dat u wilt stemmen op [[{{title}}]]?", + "vote_sure": "Stem bevestigen?", + "no_scheduled": "Geen overeenkomsten gepland", + "schedule": "Schema", + "in_progress": "In behandeling", + "participated": "Deelgenomen", + "vote_soon": "Stemming", + "vote": "Stemming", + "pending": "In afwachting", + "settled": "Ingesteld", + "spend_coin_redeem_reward": "Weet u zeker dat u [[{{coin}}]] wilt uitgeven om <<{{title}}>> te verzilveren?", + "redeem_sure": "Verlossing bevestigen?", + "prize_restocking": "Prijsuitreiking in uitvoering...", + "redeem": "Inwisselen", + "invite_friend_install_get_vote_chance_v2": "Nodig [[{{num}}]] vrienden uit om de App te downloaden om [[{{chance}}]] stemkansen te krijgen.", + "invite_friend_install_get_vote_chance_limit_v2": "Nodig [[{{num}}]] vrienden uit om de App te downloaden om [[{{chance}}]] stemkansen te krijgen, tot {{limit}} stemkansen.", + "invite_friend_register_get_vote_chance_v2": "Nodig [[{{num}}]] vrienden uit om de registratie te voltooien om [[{{chance}}]] stemkansen te krijgen.", + "invite_friend_register_get_vote_chance_limit_v2": "Nodig [[{{num}}]] vrienden uit om de registratie te voltooien om [[{{chance}}]] stemkansen te krijgen, tot {{limit}} stemkansen.", + "vote_task_finish_v2": "Voltooid om te krijgen [[{{chance}}]] stemkansen", + "vote_task_finish_limit_v2": "Voltooid om te krijgen [[{{chance}}]] stemkansen, max {{limit}} tijden", + "vote_task_cond_all_v2": "Voltooi alle taken om te krijgen [[{{chance}}]] stemkansen", + "vote_task_cond_all_limit_v2": "Voltooi alle taken om te krijgen [[{{chance}}]] stemkansen, max {{limit}}, al gekregen [[{{num}}]]", + "sign_in_every_day_can_get_vote_v2": "Kom dagelijks en krijg [[{{num}}]] stemkansen", + "vote_num_add": "Stem kansen [[+{{num}}]]", + "confirm_": "Bevestigen", + "vote_chance_done": "Stem kansen [[+{{chance}}]] (Voltooid: [[{{num}}]])", + "vote_chance_done_limit": "Stem kansen [[+{{chance}}]] (voltooid: [[{{num}}]]/{{limit}})", + "vote_success": "Stem succesvol", + "non_voting_hours": "U kunt niet stemmen tijdens niet-stemmingsuren", + "vote_chance_lack": "Onvoldoende stemmogelijkheden", + "insufficient_points": "Onvoldoende punten", + "vote_limit": "De stemming heeft het maximum bereikt.", + "vote_failed": "Stem mislukt", + "odds": "Vreemd", + "playing": "Afspelen", + "card_chance_lack": "Onvoldoende kansen", + "get_color_card": "Ontvang 1 kaart van de opgegeven kleur", + "get_three_card": "Krijg 3 kaarten van elke kleur", + "get_five_card": "Krijg 5 kaarten van elke kleur", + "action_card": "Actiekaart", + "choose_a_color": "Kies een kleur", + "got_a_new_card": "Je hebt een nieuwe kaart.", + "action_card_unlocked": "ACTIEKAART NIET VERBINDEN!", + "claim_prize": "Claimprijs", + "vote_chances": "Tickets", + "coin_log_mall": "Punten Aflossing", + "coin_log_vote": "Stemprocedure", + "coin_log_expired": "Punten verlopen", + "coin_log_reward": "Event Beloningen", + "coin_log_task": "Taakbeloningen", + "coin_log_title": "Punten", + "got": "Begrepen.", + "deduct": "Aftrekken", + "invite_friend_install_get_qa_v2": "Nodig [[{{num}}]] vrienden uit om de App te downloaden en krijg [[{{chance}}]] kansen om vragen te beantwoorden.", + "invite_friend_install_get_qa_limit_v2": "Nodig [[{{num}}]] vrienden uit om de App te downloaden en krijg [[{{chance}}]] kansen om vragen te beantwoorden, met een maximum van {{limit}} kansen.", + "invite_friend_register_get_qa_v2": "Nodig [[{{num}}]] vrienden uit om de registratie te voltooien en krijg [[{{chance}}]] kansen om vragen te beantwoorden.", + "invite_friend_register_get_qa_limit_v2": "Nodig [[{{num}}]] vrienden uit om de registratie te voltooien en krijg [[{{chance}}]] kansen om vragen te beantwoorden, met een maximum van {{limit}} kansen.", + "qa_task_finish_v2": "Het voltooien ervan zal je verdienen [[{{chance}}]] kansen om vragen te beantwoorden.", + "qa_task_finish_limit_v2": "Het voltooien van het zal je verdienen [[{{chance}}]] kansen om vragen te beantwoorden, met een maximum van {{limit}} voltooiingen.", + "qa_task_cond_all_v2": "Het voltooien van alle taken zal je verdienen [[{{chance}}]] kansen om vragen te beantwoorden", + "qa_task_cond_all_limit_v2": "Het voltooien van alle taken zal je verdienen [[{{chance}}]] kansen om vragen te beantwoorden, met een maximum van {{limit}} kansen, en je hebt al ontvangen [[{{num}}]] kansen", + "sign_in_every_day_can_get_qa_v2": "Elke dag ontvangt u [[{{num}}]] kansen om vragen te beantwoorden.", + "quiz_starting": "De Quiz starten...", + "quiz_ready": "Klaar.", + "quiz_oops": "Oeps!", + "quiz_question_progress": "Vraag [[{{num}}]] van [[{{x}}]]", + "quiz_back": "Terug naar de quiz", + "quiz_review_answers": "Antwoorden herzien", + "quiz_question": "Vraag", + "quiz_no_answer_submitted": "Er werd geen antwoord gegeven", + "quiz_perfect_score": "Perfecte score!", + "quiz_correct_count": "Je hebt [[{{num}}]] van [[{{x}}]] juist!", + "quiz_good_job": "Goed gedaan!", + "quiz_round_complete": "Rond voltooid", + "quiz_correct": "Correct", + "quiz_next": "Volgende", + "quiz_home": "Begin" +} diff --git a/asset/campaign/lang/pt.json b/asset/campaign/lang/pt.json new file mode 100644 index 0000000..f415995 --- /dev/null +++ b/asset/campaign/lang/pt.json @@ -0,0 +1 @@ +{"deduct":"Deduzir","quiz_correct":"Correto","quiz_correct_count":"Você acertou [[{{num}}]] de [[{{x}}]]!","quiz_home":"Início","quiz_next":"Próximo","quiz_question_progress":"Pergunta [[{{num}}]] de [[{{x}}]]","quiz_round_complete":"Rodada concluída","quiz_chances":"Tentativas do quiz","claim_it_now":"Resgate agora!"} diff --git a/asset/campaign/lang/ru.json b/asset/campaign/lang/ru.json new file mode 100644 index 0000000..68210a5 --- /dev/null +++ b/asset/campaign/lang/ru.json @@ -0,0 +1 @@ +{"deduct":"Вычесть","quiz_correct":"Верно","quiz_correct_count":"Правильных ответов: [[{{num}}]] из [[{{x}}]]!","quiz_home":"Главная","quiz_next":"Далее","quiz_question_progress":"Вопрос [[{{num}}]] из [[{{x}}]]","quiz_round_complete":"Раунд завершён","quiz_chances":"Попытки в викторине","claim_it_now":"Получить сейчас!"} diff --git a/asset/campaign/lang/th.json b/asset/campaign/lang/th.json new file mode 100644 index 0000000..d58832a --- /dev/null +++ b/asset/campaign/lang/th.json @@ -0,0 +1 @@ +{"deduct":"หัก","quiz_correct":"ถูกต้อง","quiz_correct_count":"คุณตอบถูก [[{{num}}]] จาก [[{{x}}]] ข้อ!","quiz_home":"หน้าหลัก","quiz_next":"ถัดไป","quiz_question_progress":"ข้อที่ [[{{num}}]] จาก [[{{x}}]]","quiz_round_complete":"จบรอบแล้ว","quiz_chances":"โอกาสตอบคำถาม","claim_it_now":"รับเลยตอนนี้!"} diff --git a/asset/campaign/lang/tr.json b/asset/campaign/lang/tr.json new file mode 100644 index 0000000..5f79eec --- /dev/null +++ b/asset/campaign/lang/tr.json @@ -0,0 +1 @@ +{"deduct":"Düş","quiz_correct":"Doğru","quiz_correct_count":"[[{{x}}]] sorudan [[{{num}}]] tanesini doğru bildin!","quiz_home":"Ana sayfa","quiz_next":"Sonraki","quiz_question_progress":"Soru [[{{num}}]] / [[{{x}}]]","quiz_round_complete":"Tur tamamlandı","quiz_chances":"Quiz hakkı","claim_it_now":"Şimdi al!"} diff --git a/asset/campaign/lang/vi.json b/asset/campaign/lang/vi.json new file mode 100644 index 0000000..89e8120 --- /dev/null +++ b/asset/campaign/lang/vi.json @@ -0,0 +1 @@ +{"deduct":"Khấu trừ","quiz_correct":"Đúng","quiz_correct_count":"Bạn đã trả lời đúng [[{{num}}]] trên [[{{x}}]] câu!","quiz_home":"Trang chủ","quiz_next":"Tiếp theo","quiz_question_progress":"Câu [[{{num}}]] trên [[{{x}}]]","quiz_round_complete":"Hoàn thành vòng","quiz_chances":"Lượt trả lời","claim_it_now":"Nhận ngay!"} diff --git a/asset/campaign/lang/zh-TW.json b/asset/campaign/lang/zh-TW.json new file mode 100644 index 0000000..7fa316a --- /dev/null +++ b/asset/campaign/lang/zh-TW.json @@ -0,0 +1 @@ +{"deduct":"扣除","quiz_correct":"正確","quiz_correct_count":"你答對了[[{{num}}]]題,共[[{{x}}]]題!","quiz_home":"首頁","quiz_next":"下一題","quiz_question_progress":"第[[{{num}}]]題,共[[{{x}}]]題","quiz_round_complete":"本輪完成","quiz_chances":"答題機會","claim_it_now":"立即領取"} diff --git a/asset/campaign/lang/zh.json b/asset/campaign/lang/zh.json new file mode 100644 index 0000000..b6a6097 --- /dev/null +++ b/asset/campaign/lang/zh.json @@ -0,0 +1,761 @@ +{ + "close": "关闭", + "invite_share_text": "邀请好友 一起赢奖励 点击链接为好友助力", + "copy_link": "复制链接", + "copy_success": "复制成功", + "invite_friend": "邀请好友", + "invite_friend_": "邀请好友_", + "total_get": "累计获得", + "can_get": "可获得", + "my_invite": "我的邀请", + "invite_record": "邀请记录", + "need_invite": "还需邀请", + "bonus_rules": "奖励规则", + "activity_rules": "活动规则", + "invite_no_record": "还没有邀请记录哦", + "invite_time": "邀请时间", + "user_id": "用户ID", + "reward_cond": "奖励条件", + "target_receive_prizes": "达标后,奖品领取方式", + "receive_prizes": "奖品领取方式", + "copy": "复制", + "bonus_content": "奖励内容", + "prize_details": "奖品详情", + "end_time": "结束时间:", + "start_time": "开始时间:", + "activity_time": "活动时间", + "extra_prizes": "额外奖品", + "quantity": "数量", + "prize": "奖品", + "download_for_each_friend": "每{{num}}个好友下载", + "accumulate_friend_downloads": "累积{{num}}个好友下载", + "max_invite_friend": "最多可邀请{{num}}(含)个好友", + "register_for_each_friend": "每{{num}}个好友注册", + "accumulate_friend_register": "累积{{num}}个好友注册", + "my_task": "我的任务", + "fans": "粉丝", + "target_fans": "已达标粉丝", + "install_and_finish_all_cond": "好友下载并完成所有任务即可达标", + "install_and_finish_one_cond": "好友下载并完成任一任务即可达标", + "completed": "已完成", + "undone": "未完成", + "friend_record": "好友记录", + "task_1": "任务1", + "task_2": "任务2", + "task_3": "任务3", + "invite_friends_to_register": "邀请{{num}}个好友注册", + "invite_friends_to_install": "邀请{{num}}个好友下载", + "no_record": "暂无记录", + "invite_friends_to_target": "邀请{{num}}个好友达标", + "target_for_each_friend": "每{{num}}个好友达标", + "accumulate_friend_target": "累积{{num}}个好友达标", + "prize_list": "奖品列表", + "regular_rewards": "常规奖励", + "extra_rewards": "额外奖励", + "activity_end_text": "活动已经结束啦@下次再来吧!", + "receive": "领取", + "contact_customer_service": "请联系客服领取", + "lottery": "抽奖", + "draws_num": "抽奖次数", + "better_luck_next_time": "下次运气会更好", + "no_winning_record": "还没有中奖记录哦", + "prize_name": "奖品名称", + "lottery_service_err": "服务出错了,稍后再来吧。您的抽奖机会还在,请放心", + "draws_none": "抽奖次数用完啦", + "confirm": "确认", + "try_your_luck": "试试手气", + "get_prize_to_app": "请前往APP内领取奖品", + "target_cond_1": "达标条件一", + "target_cond_2": "达标条件二", + "target_cond_3": "达标条件三", + "all_tasks_to_draw": "完成所有任务即可获得{{num}}次抽奖机会", + "one_tasks_to_draw": "完成一个任务即可获得{{num}}次抽奖机会", + "draws_obtained": "已获取的抽奖次数:", + "reward_record": "奖励记录", + "to_complete": "去完成", + "completed_times": "完成次数", + "winning_record": "中奖记录", + "Winning_time": "中奖时间", + "thank": "谢谢参与", + "no_receive_record": "还没有领取记录哦", + "week_0": "日", + "week_1": "一", + "week_2": "二", + "week_3": "三", + "week_4": "四", + "week_5": "五", + "week_6": "六", + "invite_friend_install_get_sign": "邀请{{num}}个好友下载App,即可获得1张补签卡。", + "invite_num": "已邀请{{num}}人", + "sign_day_num": "签到{{num}}天", + "continue_day_num": "连签{{num}}天", + "day": "天", + "sign_card": "补签卡", + "invite_friend_get_sign_card_text": "错过了一天?邀请朋友下载并获得补签卡!", + "obtain": "获取", + "use_sign_card": "使用一张补签卡", + "confirm_use_sign_card": "补签日期为{{m}}/{{d}},确认补签?", + "sign_success": "签到成功", + "you_got": "您获得了", + "i_see": "我知道了", + "done_sign_day_num": "已签{{num}}天", + "done_continue_day_num": "连续{{num}}天", + "sign_ok": "已签到", + "card_sign_ok": "补签成功", + "continue_sign_ok": "已连签", + "continue_sign_get_reward_text": "连续签到,即可赢取奖励", + "sign_get_reward_text": "累计签到天数达标,即可赢取奖励", + "sign_card_lack": "签到卡不足", + "sign_fail": "签到失败,请刷新页面", + "best_fan": "最佳粉丝", + "top_fans": "Top Fans", + "invite_num_title": "邀请数", + "no_rank_record": "还没有排行榜记录哦", + "vote_none": "投票次数用完啦", + "vote_service_err": "服务出错了,稍后再来吧。您的投票机会还在,请放心", + "hour": "小时", + "minute": "分钟", + "second": "秒", + "hour_f": "小时_", + "minute_f": "分钟_", + "second_f": "秒_", + "vote_num": "当前有{{num}}票可投", + "here_is_the_quiz_title": "这里显示的是竞猜标题", + "option": "选项", + "countdown": "倒计时", + "end": "已结束", + "click_image_select": "点击图片选择", + "wait_reward_reward": "开奖结果还未公布,请稍后再来", + "sure": "确定", + "submit": "提交", + "next_qa": "下一题", + "right": "正确", + "error": "错误", + "right_answer": "正确答案:", + "explain": "解析", + "home": "首页", + "share": "分享", + "download_app_qa": "下载app,参与答题", + "qa_service_err": "服务出错了,稍后再来吧。您的答题机会还在,请放心", + "qa_none": "还没有答题机会哦@邀请好友获取更多机会", + "start": "开始", + "challenge_failed": "挑战失败", + "qa_right": "答对 ", + "keep_try": "继续尝试", + "congratulation": "恭喜您", + "please_choose": "请选择", + "qa_loading": "题库载入中", + "grow_big": "{{name}}长大了", + "click_receive": "点击领取", + "after_receive": "后领取", + "tree_grow_can_get": "果树种成即可得", + "fertilize_standard_text": "在施肥{{num}}%就可以达标啦", + "fertilize": "施肥", + "fertilizer": "肥料", + "need_nutrients_will_die": "需要{{num}}g养料,不然我有可能会枯萎哦", + "get_new_tree": "获取新的小树苗", + "tree_grow_max_text": "您的果树长大了,送您一个小礼物", + "little_tree": "小树苗", + "fertilize_num": "施肥{{num}}g", + "some_withered": "{{name}}枯萎了", + "some_revive": "{{name}}复活了", + "grow_big_and_get_reward": "{{name}}长大了,奖励{{reward_title}}", + "get_grow": "获得了{{name}}", + "props_lack": "道具不足", + "cannot_lv_up": "不能继续升级", + "invite_friend_install_get_fertilizer": "邀请{{num}}个好友下载App,即可获取{{grow_num}}g肥料", + "received_sapling": "你已领取一颗小树苗", + "pick_name": "取一个名字吧", + "growth_manual": "成长手册", + "get_nourishment": "获取养料", + "plant_new_tree": "重新种一棵", + "tree_revive": "复活小树", + "timeout_tree_die": "由于长时间没有施肥,您的树已枯萎", + "invite_friend_install_revive_tree": "邀请{{num}}个好友下载App,即可复活你的小树", + "dog_grow_can_get": "小狗养成即可得", + "feed_standard_text": "在投喂{{num}}%就可以达标啦", + "feed": "投喂", + "dog_food": "狗粮", + "need_dog_food_will_leave": "需要{{num}}g狗粮,不然我有可能会离开哦", + "get_new_dog": "领取新小狗", + "dog_grow_max_text": "您的小狗长大了,送您一个小礼物", + "little_dog": "小狗", + "feed_num": "投喂{{num}}g", + "some_leave": "{{name}}离开了", + "some_come": "{{name}}回来了", + "invite_friend_install_get_dog_food": "邀请{{num}}个好友下载App,即可获取{{grow_num}}g狗粮", + "received_dog": "你已领取一只小狗", + "get_dog_food": "获取狗粮", + "plant_new_dog": "重新养一只", + "rescue_puppy": "挽回小狗", + "timeout_dog_go": "因为长时间没有感受到爱和食物你的小狗已离家出走了", + "invite_friend_install_rescue_puppy": "邀请{{num}}个好友下载App,即可挽回你的小狗", + "get_collect_num": "您获得了{{reward_title}}碎片", + "fixed_point": "指定点数", + "this_props_lack": "您还没有该道具", + "help_record": "助力记录", + "no_help_record": "还没有助力记录哦", + "install_help_record": "有好友下载了App", + "open_help_record": "有好友打开了App", + "click_help_record": "有好友点击了链接", + "service_err": "服务出错了,稍后再来吧。", + "select_reward": "选择奖品", + "view_help_rule": "查看助力规则", + "help_rule": "助力规则", + "install_help": "下载助力", + "install_help_text": "每个好友下载App,进度[[+{{num}}%]]", + "open_help": "打开App助力", + "open_help_text": "每个好友打开App,进度[[+{{num}}%]],最多获得{{limit_num}}%", + "click_help": "点击助力", + "click_help_text": "每个好友点击邀请链接,进度[[+{{num}}%]],最多获得{{limit_num}}%", + "invite_friends_receive_free_gifts": "邀请好友免费领礼品", + "get_prizes": "获取奖品", + "help_success": "助力成功", + "also_get_free": "你也可以免费领", + "install_get_free_reward": "下载app领取免费礼品", + "install_get_reward": "下载App立即领取奖品", + "received_success": "领取成功", + "ballot_record": "抽签记录", + "no_ballot_record": "还没有抽签记录哦", + "ballot_none": "还没有抽签机会哦", + "share_good_luck": "分享有好运", + "ballot": "我抽到了", + "answer_record": "答题记录", + "challenge_results": "挑战结果", + "challenge_time": "挑战时间", + "no_answer_record": "还没有答题记录哦", + "answer_none": "答题次数用完啦", + "please_choose_answer": "请选择答案", + "answer_countdown": "答题倒计时", + "got_prizes": "获得奖品:", + "continue_free_get": "继续免费领", + "finish_help": "完成助力", + "reward_send_your_account": "奖品已发放到您的账户中", + "no_reward_record": "还没有奖励记录哦", + "download_app_ballot": "下载app,参与抽签", + "yesterday": "昨天", + "today": "今天", + "prize_record": "奖品记录", + "get_reward_time": "获奖时间", + "no_sign_card": "还没有补签卡哦", + "get_more_knowledge": "加油!用更多的知识武装自己", + "qa_very_hard": "这些题难倒了99%的人", + "num": "次数", + "contact_customer_service_var": "请联系客服({{contact}})领取", + "like_share_people_lucky": "爱分享的人运气会变好,快去分享吧~", + "my_reward": "我的奖品", + "no_install_prompt": "该社媒平台还没有被安装。", + "please_login": "请登录", + "got_num": "(已获得{{num}}次)", + "completed_num": "(已完成{{num}}次)", + "fixed_roll_none": "还没有幸运骰,邀请{{num}}个好友下载App可获得1个幸运骰", + "fixed_roll_none_limit": "还没有幸运骰,邀请{{num}}个好友下载App可获得1个幸运骰,最多获得{{limit}}个", + "invite_friend_install_get_roll_chance": "邀请{{num}}个好友下载App,可获得{{chance}}个骰子。", + "invite_friend_install_get_roll_chance_limit": "邀请{{num}}个好友下载App,可获得{{chance}}个骰子,最多获得{{limit}}个骰子。", + "invite_friend_register_get_roll_chance": "邀请{{num}}个好友完成注册,可获得{{chance}}个骰子。", + "invite_friend_register_get_roll_chance_limit": "邀请{{num}}个好友完成注册,可获得{{chance}}个骰子,最多获得{{limit}}个骰子。", + "dice_task_finish": "完成可获得{{chance}}个骰子", + "dice_task_finish_limit": "完成可获得{{chance}}个骰子,最多完成{{limit}}次", + "dice_task_num": "任务总共获得的骰子:", + "dice_task_cond_one": "完成任意任务可获得更多骰子", + "dice_task_cond_all": "完成所有任务可以获得{{chance}}个骰子", + "dice_task_cond_all_limit": "完成所有任务可以获得{{chance}}个骰子,最多获得{{limit}}次,已获得{{num}}次", + "spin_now": "立即抽奖", + "spinning": "转起来", + "expires_in": "过期时间", + "records": "记录", + "luck_you": "太幸运了", + "get_extra_reward": "你获得了额外奖励", + "share_get": "分享后", + "upgrade_reward": "升级奖励", + "super_upgrade": "超级升级!", + "preparation": "预备", + "invite_get_energy": "完成邀请可获得能量", + "invite_friend_get_energy": "邀请好友获得能量", + "up_to": "最多升至", + "spin": "可抽", + "away": "还差{{num}}点能量", + "win_left_energy": "还差{{num}}次抽奖即可赢得{{cash}}", + "enjoy_credit": "代币增加", + "invite_no_record_reward": "你还没有邀请任何人哦,邀请好友来获得奖励吧~", + "spin_reward": "转盘抽奖", + "share_reward": "分享领奖", + "start_reward": "开箱有奖", + "left_cash_get_reward": "还差{{left}}获得{{cash}}奖励", + "auto_spin": "[[{{second}}]]秒后自动抽奖", + "guarantee_to": "只要完成最后一次抽奖即可[[赢得{{cash}}]]", + "auto_select": "[[{{second}}]]秒后自动选择", + "open": "打开", + "select_box": "选择1个礼盒看看能获得多少现金奖", + "money_reward": "现金奖励", + "jackpot_best_prize": "大奖!最高奖励", + "best_prize": "最高&&奖励", + "almost_reward": "马上可以领取奖励了!", + "claimed_reward": "已经有超过[[10000+]]的用户领取了奖励", + "pass_on_energy": "发放能量到您的账户", + "victory_tip": "胜利就在眼前,[[把握机会]]", + "min_won_barrage": "{{name}}在{{min}}分钟前获得了[[{{cash}}]]", + "closer_to_prize": "你离大奖越来越近啦", + "shine_arrived": "闪耀的时刻即将到来,抓住它", + "get_money_reward": "打开盒子获得现金奖品", + "won_barrage": "[[{{name}}]] 已经获得了 [[{{cash}}]]", + "surprise_for_you": "惊喜礼盒", + "last_spin_win": "距离领奖只差1次抽奖!", + "energy": "能量", + "token": "代币", + "your_reward": "您的奖励", + "go_to": "前往使用", + "click_contact": "点击联系客服", + "click_contact_tip": "已复制联系方式\n请前往联系", + "see_reward": "查看奖品", + "prize_gone": "奖品发完啦", + "no_reward_get": "你来得太晚啦,奖品已经全部发完啦~", + "no_more_record": "没有更多记录", + "help_fail": "助力失败", + "grand_opening": "盛大开幕", + "get_reward_after_play": "每个人在游戏后都会获得奖励!", + "play_and_get_prize": "玩游戏并赢取属于你的奖品!", + "won_free_gift": "你赢得了一个待领取奖品", + "download_app_get_gift": "下载App领取您的奖品", + "download": "下载", + "jackpot": "大奖", + "play": "开奖", + "install_ineligible": "无法领奖(非新安装用户)", + "unlock_your_luck": "奇迹再现", + "spin_and_win": "决定就是你了,皮卡丘", + "play_to_win_prize": "这些奖品您不拿一个走吗?", + "you_got_the_best_prize": "你获得了最好的奖品", + "play_and_win": "玩游戏并赢", + "download_to_get": "下载app即可领取", + "best_prize_!": "最高奖励!", + "roll_dice_number": "掷骰子,点数{{point}}", + "lucky_dice_number": "使用幸运骰子,点数{{point}}", + "day_sign": "每日签到", + "finish_all_task": "完成所有任务", + "finish_one_task": "完成任务", + "finish_friend_register": "完成好友注册任务", + "finish_friend_install": " 完成邀请App下载任务", + "finish_lucky_dice_task": "完成获取幸运骰子任务", + "fragment": "碎片", + "click": "点击", + "collect_fragment_compare_reward": "收集{{num}}个碎片即可合成奖品", + "craft_fragments": "合成碎片", + "reward_lack_contact_customer_service": "奖品售罄,如需帮助请联系客服", + "join_in_campaign": "参与活动", + "contact": "联系客服", + "all": "全部", + "contact_information": "联系方式", + "no_more_dice": "骰子不足", + "try_your_luck_first_upper": "看看你有多幸运", + "fill_in": "填写表单", + "submit_success": "提交成功", + "please_do_not_submit_repeatedly": "请勿重复提交", + "submitted": "已提交", + "please_complete_the_form": "请完善表单", + "welcome_gifts": "迎接礼物到来", + "spin_to_win": "旋转赢取", + "view": "查看", + "use": "使用", + "get_and_use": "领取并使用", + "invite_friend_install_get_lottery_chance": "邀请{{num}}个好友下载App,可获得{{chance}}次抽奖机会。", + "invite_friend_install_get_lottery_chance_limit": "邀请{{num}}个好友下载App,可获得{{chance}}次抽奖机会,最多获得{{limit}}次抽奖机会。", + "invite_friend_register_get_lottery_chance": "邀请{{num}}个好友完成注册,可获得{{chance}}次抽奖机会。", + "invite_friend_register_get_lottery_chance_limit": "邀请{{num}}个好友完成注册,可获得{{chance}}次抽奖机会,最多获得{{limit}}次抽奖机会。", + "lottery_task_finish": "完成可获得{{chance}}次抽奖机会", + "lottery_task_finish_limit": "完成可获得{{chance}}次抽奖机会,最多完成{{limit}}次", + "lottery_task_num": "完成任务获得的抽奖次数", + "lottery_task_cond_one": "完成任一任务即可获得抽奖机会", + "lottery_task_cond_all": "完成所有任务可以获得{{chance}}次抽奖机会", + "lottery_task_cond_all_limit": "完成所有任务可以获得{{chance}}次抽奖机会,最多获得{{limit}}次,已获得{{num}}次", + "raffle_chances": "抽奖机会", + "quiz_chances": "答题机会", + "get_lottery_chances": "获取抽奖机会", + "remaining_raffle_chances": "可用抽奖次数", + "lottery_again": "再抽一次", + "use_immediately": "立即使用", + "wow_you_got": "哇!恭喜你", + "next_time": "非常遗憾", + "dice_record": "骰子记录", + "sign_in_every_day_can_get_dice": "每天过来都会赠送{{num}}个骰子哦~", + "do_task_get_dice": "做任务获得骰子", + "do_task_get_lottery": "做任务获得抽奖机会", + "refresh_tomorrow": "明天再来", + "click_icon": "点击社媒ICON", + "paste_to_media": "社媒粘贴邀请", + "get_prize": "获得奖品", + "copy_success_paste_to_media": "复制成功,请粘贴至社交媒体", + "invite_friend_install_get_grow": "邀请{{num}}个好友下载App,可获得{{chance}}个成长道具。", + "invite_friend_install_get_grow_limit": "邀请{{num}}个好友下载App,可获得{{chance}}个成长道具,最多获得{{limit}}个成长道具。", + "invite_friend_register_get_grow": "邀请{{num}}个好友完成注册,可获得{{chance}}个成长道具。", + "invite_friend_register_get_grow_limit": "邀请{{num}}个好友完成注册,可获得{{chance}}个成长道具,最多获得{{limit}}个成长道具。", + "grow_task_finish": "完成可获得{{chance}}个成长道具", + "grow_task_finish_limit": "完成可获得{{chance}}个成长道具,最多完成{{limit}}次", + "grow_task_cond_one": "完成任一任务即可获得成长道具", + "grow_task_cond_all": "完成所有任务可以获得{{chance}}个成长道具", + "grow_task_cond_all_limit": "完成所有任务可以获得{{chance}}个成长道具,最多获得{{limit}}次,已获得{{num}}次", + "do_task_get_grow": "做任务获得成长道具", + "easy_mode": "简易模式", + "mins_ago": "{{min}}分钟前", + "barrage_got_reward": "通过参加幸运抽奖获得了[[{{title}}]]。", + "sold_out": "库存不足", + "task_done": "任务完成", + "click_copy_link": "点击“复制链接”", + "select_card": "选取卡牌", + "raffle_chances_lack": "机会不足", + "raffle_chances_lack_tip": "您的抽奖机会不足,快去页面下方完成任务获得抽奖机会吧", + "get_more_chance": "获得更多机会", + "flip_now": "立即翻牌", + "raffle_num": "抽奖次数_", + "win": "赢得", + "next_week_do": "下周再来", + "week_do_1": "周一再来", + "week_do_2": "周二再来", + "week_do_3": "周三再来", + "week_do_4": "周四再来", + "week_do_5": "周五再来", + "week_do_6": "周六再来", + "week_do_7": "周天再来", + "to_flip": "去抽卡", + "won_get": "恭喜获得", + "invite_friend_download": "邀请{{num}}位好友下载App", + "invite_friend_register": "邀请{{num}}位好友注册", + "fixed_roll_none_register": "还没有幸运骰,邀请{{num}}个好友注册可获得1个幸运骰", + "fixed_roll_none_register_limit": "还没有幸运骰,邀请{{num}}个好友注册可获得1个幸运骰,最多获得{{limit}}个", + "sign_in_every_day_can_get_lottery": "每天过来都会赠送{{num}}次抽奖机会哦~", + "finish_newcomer_task": "[[新人]]完成任务获得[[{{reward_title}}]]", + "done_newcomer_task": "新人任务", + "register_help_record": "有好友完成了注册", + "register_help_text": "每个好友完成注册,进度[[+{{num}}%]]", + "register_help": "注册助力", + "invite_friend_install_get_qa": "邀请{{num}}个好友下载App,可获得{{chance}}次答题机会。", + "invite_friend_install_get_qa_limit": "邀请{{num}}个好友下载App,可获得{{chance}}次答题机会,最多获得{{limit}}次答题机会。", + "invite_friend_register_get_qa": "邀请{{num}}个好友完成注册,可获得{{chance}}次答题机会。", + "invite_friend_register_get_qa_limit": "邀请{{num}}个好友完成注册,可获得{{chance}}次答题机会,最多获得{{limit}}次答题机会。", + "qa_task_finish": "完成可获得{{chance}}次答题机会", + "qa_task_finish_limit": "完成可获得{{chance}}次答题机会,最多完成{{limit}}次", + "qa_task_cond_one": "完成任一任务即可获得答题机会", + "qa_task_cond_all": "完成所有任务可以获得{{chance}}次答题机会", + "qa_task_cond_all_limit": "完成所有任务可以获得{{chance}}次答题机会,最多获得{{limit}}次,已获得{{num}}次", + "sign_in_every_day_can_get_qa": "每天过来都会赠送{{num}}次答题机会哦~", + "do_task_get_qa": "做任务获得答题机会", + "help_install": "[[{{name}}]]获得了[[安装助力]]", + "help_register": "[[{{name}}]]获得了[[注册助力]]", + "help_open": "[[{{name}}]]获得了[[拉日活助力]]", + "help_click": "[[{{name}}]]获得了[[点击助力]]", + "finish_help_get_reward": "[[{{name}}]]完成助力任务,获得[[{{reward_title}}]]", + "a_gift_to_you": "送给你的奖品", + "choose_it": "就要它", + "nice_choice": "很好的选择!", + "tip": "提示", + "left_percent_get_reward": "还差[[{{left}}%]]获得奖励", + "ensure_select_reward": "确认选择[[{{reward_title}}]]?", + "reward_obtained": "已获得奖励", + "lucky": "幸运", + "percent_progress_for_you": "你获得了一个免费的 [[{{percent}}%]]助力!", + "invite": "邀请好友___", + "help_task": "助力任务", + "finish_all_task_help_parent": "完成以下所有任务即可助力好友", + "finish_one_task_help_parent": "完成以下任意任务即可助力好友", + "task_index": "任务{{index}}", + "raise_pet_to_get_free_gift": "饲养宠物可获得免费礼物", + "step": "步骤", + "pick_item": "选择物品", + "raise_pet": "饲养宠物", + "get_free_gift": "获得免费礼物", + "has_got": "{{name}}获得了{{reward_title}}", + "more_unexpected_gifts": "饲养宠物期间的更多意想不到的礼物", + "pick_it": "选择它", + "picked": "人选择", + "your_gift_confirm": "您的礼物请确认", + "free": "免费", + "raise_the_dog_to_get_your": "养狗以获得你的", + "free_gift": "免费礼物!", + "expires_in_day": "{{day}} 天后过期", + "collect_more_love": "再收集[[{{num}}]]个爱心点数即可获得免费礼物", + "collect": "收集", + "claim_now": "立即领取", + "feed_more_times": "再喂 {{num}} 次", + "get_more": "获得更多", + "first_referral_bonus": "首次推荐奖励!", + "get_rewards_first_time": "首次邀请好友可获得奖励", + "first_invite_receive": "第一次邀请新用户将获得 [[{{num}}]]", + "invite_now": "立即邀请", + "invite_get_dog_foods": "邀请朋友赚取食品", + "invite_friends": "邀请好友__", + "pick_a_gift": "选择一个免费礼物", + "feed_3_times": "喂食3次", + "invite_new_user_extra_get": "邀请新用户首次可以获得额外 [[{{num}}]]", + "reward_upgraded": "奖励升级", + "reward_for_you": "给你[[{{reward_title}}]]", + "time_s_up": "时间到了!", + "play_again": "再玩一次", + "complete_tasks_to_earn_reward": "完成任务获得奖励", + "super": "超级", + "super_benefit": "超级福利", + "task_cond_one": "完成任意任务即可获得[[奖励]]", + "task_cond_all": "完成所有任务可以获得{{reward_title}}[[+{{num}}]]", + "congrats": "恭喜!", + "enjoy_your": "享受你的", + "try_again_to_claim": "再试一次以领取你的礼物", + "collect_love": "收集爱心", + "finish_step": "完成了阶段任务", + "finish_feed": "完成了喂养任务", + "friend_third_feed": "好友完成喂养3次狗粮", + "friend_first_third_feed": "每日首邀好友完成喂养3次狗粮", + "friend_select_reward": "好友选择了奖品", + "friend_first_select_reward": "每日首邀好友选择了奖品", + "rewards": "奖励", + "round_expired": "回合已结束", + "love_points": "爱心点数", + "dog_food_lack": "请去获得更多的狗粮", + "collect_machine": "领取了狗粮机", + "max_grow": "超过最大养成次数", + "please_collect_love": "请先收集爱心", + "continue_grow": "当前宠物还能继续养", + "dog_food_machine_running": "狗粮生产中", + "reward_remove": "奖品已下架", + "reward_get_max": "奖品已超过获得的最大上限", + "i_am_hungry": "我饿了!", + "effect_invite": "成功邀请一个好友", + "day_first_effect_invite": "当日首次成功邀请好友", + "finish_many_feed": "完成了多次喂养", + "daily_rewards": "每日奖励", + "come_back_tomorrow_for_more_rewards": "明天回来获得更多奖励!", + "claim_today_reward": "领取今天的奖励!", + "come_back_tomorrow": "明天再來!", + "fail_to_sign_progress_reset": "如果连续签到失败,你的进度将被重置", + "signed_in": "已签到_", + "signed_title": "签到", + "you_got_the_gift_box": "你拿到了礼物盒", + "use_it": "使用它", + "you_got_dog_food": "你获得了{{num}}份狗粮", + "you_got_reward": "您获得了{{reward_title}}", + "invite_contest": "邀请竞赛", + "rewards_earned_to_your_account": "获得的奖励将[[直接进入]]您的账户", + "invite_more_friends": "邀请更多好友", + "invited": "{{num}}已邀请", + "daily_fortune_draw": "每日幸运抽奖", + "win_free_gift_every_day": "每天赢取免费礼物!", + "draw_now": "立即抽奖_", + "day_num": "第{{num}}天", + "you": "你", + "blind_box": "幸运盒子", + "daily_draw": "每日抽奖", + "rankings": "排行榜", + "rank_reward": "排名活动奖励", + "sign_reward": "签到奖励", + "blind_reward": "盲盒奖励", + "lucky_reward": "抽奖奖励", + "tomorrow": "明天", + "win_reward": "赢得[[{{title}}]]", + "rank_end": "排名结束", + "congrats_for_getting": "恭喜获得_", + "ends_in": "结束于", + "invite_friend_download_app": "邀请[[{{num}}]]位好友下载App", + "invite_friend_register_app": "邀请[[{{num}}]]位好友注册", + "invite_friend_install_get_lottery_chance_v2": "邀请[[{{num}}]]个好友下载App,可获得[[{{chance}}]]次抽奖机会。", + "invite_friend_install_get_lottery_chance_limit_v2": "邀请[[{{num}}]]个好友下载App,可获得[[{{chance}}]]次抽奖机会,最多获得{{limit}}次抽奖机会。", + "invite_friend_register_get_lottery_chance_v2": "邀请[[{{num}}]]个好友完成注册,可获得[[{{chance}}]]次抽奖机会。", + "invite_friend_register_get_lottery_chance_limit_v2": "邀请[[{{num}}]]个好友完成注册,可获得[[{{chance}}]]次抽奖机会,最多获得{{limit}}次抽奖机会。", + "lottery_task_finish_v2": "完成可获得[[{{chance}}]]次抽奖机会", + "lottery_task_finish_limit_v2": "完成可获得[[{{chance}}]]次抽奖机会,最多完成{{limit}}次", + "lottery_task_cond_all_v2": "完成所有任务可以获得[[{{chance}}]]次抽奖机会", + "lottery_task_cond_all_limit_v2": "完成所有任务可以获得[[{{chance}}]]次抽奖机会,最多获得{{limit}}次,已获得[[{{num}}]]次", + "sign_in_every_day_can_get_lottery_v2": "每天过来都会赠送[[{{num}}]]次抽奖机会哦~", + "invite_friends_to_earn_reward": "邀请好友赢取奖励", + "raffle_num_add": "抽奖次数[[+{{num}}]]", + "click_button_and_get_coins": "点击按钮完成任务并获得更多金币", + "do_task_get_energy": "完成任务可获得能量", + "coins": "{{num}} 个金币", + "get_tasks": "获取任务", + "next": "下一个", + "finish_task_title": "完成了\"{{title}}\"", + "get_energy": "获取能量", + "tasks": "任务", + "invite_friend_install_get_gold": "邀请{{num}}个好友下载App,可获得{{chance}}个金币。", + "invite_friend_install_get_gold_limit": "邀请{{num}}个好友下载App,可获得{{chance}}个金币,最多获得{{limit}}个金币。", + "invite_friend_register_get_gold": "邀请{{num}}个好友完成注册,可获得{{chance}}个金币。", + "invite_friend_register_get_gold_limit": "邀请{{num}}个好友完成注册,可获得{{chance}}个金币,最多获得{{limit}}个金币。", + "gold_task_finish": "完成可获得{{chance}}个金币", + "gold_task_finish_limit": "完成可获得{{chance}}个金币,最多完成{{limit}}次", + "gold_task_cond_one": "完成任一任务即可获得金币", + "gold_task_cond_all": "完成所有任务可以获得{{chance}}个金币", + "gold_task_cond_all_limit": "完成所有任务可以获得{{chance}}个金币,最多获得{{limit}}次,已获得{{num}}次", + "do_task_get_gold": "做任务获得金币", + "task_none": "没有可完成的任务", + "finish_task_earn_num": "完成任务可获得 [[+{{num}}]]", + "reached_the_max": "达到最大值", + "has_got_style": "[[{{name}}]]获得了[[{{reward_title}}]]", + "dog_food_num": "{{num}}g狗粮", + "in_production": "生产中", + "active_talk": "你很久没有来看我了。多来几次以获得更多奖励。", + "task_reset_talk": "你的一个奖品即将过期,快来看看吧。", + "dog_offline_talk": "您有一份宠粮已到账,请前往领取。", + "complete_task_talk": "您完成任务啦,恭喜获得一份奖品,快来领取吧。", + "current_total_prize_pool": "当前奖池总金额", + "get_coin": "[[{{name}}]] 获得了 [[{{num}}]] 金币", + "join_coin_num": "[[{{name}}]] 参与瓜分 [[*{{num}}]]", + "join_coin": "瓜分金币", + "coin_per_use": "{{num}}金币/次", + "expected_to_receive_coin": "预计可获得[[{{num}}]]金币", + "collect_coin": "[[{{num}}]] 金币可领取", + "more": "更多", + "expired": "已过期", + "gold_coins_deposited": "金币到账", + "timeout_and_no_collection": "超时未领取", + "use_gold_coins_to_play": "请确定是否使用[[{{num}}]]金币参与游戏", + "cancel": "取消", + "play_limit_next_round": "您已达到游戏限制!请在下轮回来!", + "insufficient_balance_grab_gold": "余额不足,无法参与", + "do_task": "做任务", + "this_round_has_ended": "当前场次已经结束,无法参加", + "claim": "领取_", + "claim_it_now": "立即领取", + "claim_time_not_reached": "没到领奖时间", + "success": "成功", + "too_late_reward_expired": "太晚了!奖励已过期", + "no_duplicate_claims": "不允许重复领取", + "buy_more": "购买更多", + "operation_failed": "操作失败,请稍后重试", + "expected_to_be_available_tomorrow": "明天预计可领取", + "expected_to_be_available_in_day": "{{day}}天后预计可领取", + "num_gold_coins": "[[{{num}}]]金币", + "check_in_now": "立即签到", + "complete_daily_check_ins_for_prizes": "完成每日签到获取奖励", + "check_in_days": "签到天数", + "lottery_chance_done": "抽奖次数[[+{{chance}}]](已完成:[[{{num}}]])", + "lottery_chance_done_limit": "抽奖次数[[+{{chance}}]](已完成:[[{{num}}]]/{{limit}})", + "claim_failed": "领取失败,请联系客服", + "answer_tomorrow_get_chance": "明天还可以获得{{chance}}次答题机会", + "finish_invite_task": "完成了邀请任务", + "dice_chance_done": "骰子[[+{{chance}}]](已完成:[[{{num}}]])", + "dice_chance_done_limit": "骰子[[+{{chance}}]](已完成:[[{{num}}]]/{{limit}})", + "grow_chance_done": "成长道具[[+{{chance}}]](已完成:[[{{num}}]])", + "grow_chance_done_limit": "成长道具[[+{{chance}}]](已完成:[[{{num}}]]/{{limit}})", + "qa_chance_done": "答题机会[[+{{chance}}]](已完成:[[{{num}}]])", + "qa_chance_done_limit": "答题机会[[+{{chance}}]](已完成:[[{{num}}]]/{{limit}})", + "help_wait": "助力中", + "distributing": "发放中", + "distribution_failed": "发放失败", + "claimed": "已领取", + "no_prizes_to_claim": "未查询到您有需要领取的奖品", + "points_use": "消耗{{num}}积分", + "points_use_ok": "兑换成功", + "points_use_lack": "积分不足_", + "points_use_close": "兑换功能已关闭", + "points_use_day_limit": "已达到每日兑换次数上限", + "points_use_limit": "已达到兑换次数上限", + "points_use_dice": "消耗[[{{num}}]]兑换[[{{chance}}]]个骰子?", + "points_use_lottery": "消耗[[{{num}}]]兑换[[{{chance}}]]次抽奖机会?", + "times": "次", + "dice": "骰子", + "one_spin": "1次", + "raise_the_pet_to_get_your": "养宠物以获得你的", + "pet_food_num": "{{num}}g宠粮", + "pet_food": "宠粮", + "friend_third_feed_pet": "好友完成喂养3次宠物", + "friend_first_third_feed_pet": "每日首邀好友完成喂养3次宠物", + "collect_machine_food": "宠粮机已领取", + "pet_food_lack": "请去获得更多的宠粮", + "pet_food_machine_running": "宠粮生产中", + "chat_day_limit": "今天我有点累了", + "chat_token_limit": "我很累了", + "chat": "聊天", + "hours_ago": "{{hour}}小时前", + "conversation_and_chat": "您可以发起对话,和您的宠物聊天哟", + "invite_friend_install_get_vote_chance": "邀请{{num}}个好友下载App,可获得{{chance}}次投票机会。", + "invite_friend_install_get_vote_chance_limit": "邀请{{num}}个好友下载App,可获得{{chance}}次投票机会,最多获得{{limit}}次投票机会。", + "invite_friend_register_get_vote_chance": "邀请{{num}}个好友完成注册,可获得{{chance}}次投票机会。", + "invite_friend_register_get_vote_chance_limit": "邀请{{num}}个好友完成注册,可获得{{chance}}次投票机会,最多获得{{limit}}次投票机会。", + "vote_task_finish": "完成可获得{{chance}}次投票机会", + "vote_task_finish_limit": "完成可获得{{chance}}次投票机会,最多完成{{limit}}次", + "vote_task_num": "完成任务获得的投票机会", + "vote_task_cond_one": "完成任一任务即可获得投票机会", + "vote_task_cond_all": "完成所有任务可以获得{{chance}}次投票机会", + "vote_task_cond_all_limit": "完成所有任务可以获得{{chance}}次投票机会,最多获得{{limit}}次,已获得{{num}}次", + "do_task_get_vote": "做任务获得投票机会", + "sign_in_every_day_can_get_vote": "每天过来都会赠送{{num}}次投票机会哦~", + "your_choice": "你的选择", + "cap_win": "赢", + "cap_draw": "平局", + "blue_team": "蓝队", + "red_team": "红队", + "spend_coin_to_vote_team": "确定要花费[[{{coin}}]]为<<{{title}}>>投票吗?", + "vote_team": "确定为[[{{title}}]]投票吗?", + "vote_sure": "确认投票?", + "no_scheduled": "暂无赛程", + "schedule": "赛程", + "in_progress": "进行中", + "participated": "已参与", + "vote_soon": "即将投票", + "vote": "投票", + "pending": "待结算", + "settled": "已结算", + "spend_coin_redeem_reward": "确定要花费[[{{coin}}]]兑换<<{{title}}>>吗?", + "redeem_sure": "确认兑换?", + "prize_restocking": "奖品补货中...", + "redeem": "兑换", + "invite_friend_install_get_vote_chance_v2": "邀请[[{{num}}]]个好友下载App,可获得[[{{chance}}]]次投票机会。", + "invite_friend_install_get_vote_chance_limit_v2": "邀请[[{{num}}]]个好友下载App,可获得[[{{chance}}]]次投票机会,最多获得{{limit}}次投票机会。", + "invite_friend_register_get_vote_chance_v2": "邀请[[{{num}}]]个好友完成注册,可获得[[{{chance}}]]次投票机会。", + "invite_friend_register_get_vote_chance_limit_v2": "邀请[[{{num}}]]个好友完成注册,可获得[[{{chance}}]]次投票机会,最多获得{{limit}}次投票机会。", + "vote_task_finish_v2": "完成可获得[[{{chance}}]]次投票机会", + "vote_task_finish_limit_v2": "完成可获得[[{{chance}}]]次投票机会,最多完成{{limit}}次", + "vote_task_cond_all_v2": "完成所有任务可以获得[[{{chance}}]]次投票机会", + "vote_task_cond_all_limit_v2": "完成所有任务可以获得[[{{chance}}]]次投票机会,最多获得{{limit}}次,已获得[[{{num}}]]次", + "sign_in_every_day_can_get_vote_v2": "每天过来都会赠送[[{{num}}]]次投票机会哦~", + "vote_num_add": "投票次数[[+{{num}}]]", + "confirm_": "确认_", + "vote_chance_done": "投票次数[[+{{chance}}]](已完成:[[{{num}}]])", + "vote_chance_done_limit": "投票次数[[+{{chance}}]](已完成:[[{{num}}]]/{{limit}})", + "vote_success": "投票成功", + "non_voting_hours": "非投票时段无法投票", + "vote_chance_lack": "投票机会不足", + "insufficient_points": "积分不足", + "vote_limit": "投票已达上限", + "vote_failed": "投票失败", + "odds": "赔率", + "playing": "比赛中", + "card_chance_lack": "抽卡次数不足", + "get_color_card": "获得指定颜色的1张牌", + "get_three_card": "获得任意颜色的3张牌", + "get_five_card": "获得任意颜色的5张牌", + "action_card": "功能牌", + "choose_a_color": "请选择颜色", + "got_a_new_card": "你获得了一张新卡牌。", + "action_card_unlocked": "功能牌已解锁!", + "claim_prize": "领取奖励", + "vote_chances": "投票机会", + "coin_log_mall": "积分兑换", + "coin_log_vote": "活动投票", + "coin_log_expired": "积分过期", + "coin_log_reward": "活动奖励", + "coin_log_task": "任务奖励", + "coin_log_title": "积分记录", + "got": "获得", + "deduct": "扣除", + "invite_friend_install_get_qa_v2": "邀请[[{{num}}]]个好友下载App,可获得[[{{chance}}]]次答题机会。", + "invite_friend_install_get_qa_limit_v2": "邀请[[{{num}}]]个好友下载App,可获得[[{{chance}}]]次答题机会,最多获得{{limit}}次答题机会。", + "invite_friend_register_get_qa_v2": "邀请[[{{num}}]]个好友完成注册,可获得[[{{chance}}]]次答题机会。", + "invite_friend_register_get_qa_limit_v2": "邀请[[{{num}}]]个好友完成注册,可获得[[{{chance}}]]次答题机会,最多获得{{limit}}次答题机会。", + "qa_task_finish_v2": "完成可获得[[{{chance}}]]次答题机会", + "qa_task_finish_limit_v2": "完成可获得[[{{chance}}]]次答题机会,最多完成{{limit}}次", + "qa_task_cond_all_v2": "完成所有任务可以获得[[{{chance}}]]次答题机会", + "qa_task_cond_all_limit_v2": "完成所有任务可以获得[[{{chance}}]]次答题机会,最多获得{{limit}}次,已获得[[{{num}}]]次", + "sign_in_every_day_can_get_qa_v2": "每天过来都会赠送[[{{num}}]]次答题机会哦~", + "quiz_starting": "开始答题...", + "quiz_ready": "准备...", + "quiz_oops": "哎呀!", + "quiz_question_progress": "第[[{{num}}]]题,共[[{{x}}]]题", + "quiz_back": "返回答题", + "quiz_review_answers": "查看答案", + "quiz_question": "题目", + "quiz_no_answer_submitted": "未提交答案", + "quiz_perfect_score": "满分!", + "quiz_correct_count": "你答对了[[{{num}}]]题,共[[{{x}}]]题!", + "quiz_good_job": "做得好!", + "quiz_round_complete": "本轮完成", + "quiz_correct": "正确_", + "quiz_next": "下一题_", + "quiz_home": "首页_" +} diff --git a/asset/campaign/mark.yaml b/asset/campaign/mark.yaml new file mode 100644 index 0000000..3c37b2b --- /dev/null +++ b/asset/campaign/mark.yaml @@ -0,0 +1,22 @@ +## 阿拉伯语、德语、英语、西班牙语、法语、印尼语、意大利语、日语、韩语、葡萄牙语、俄语、泰语、土耳其语、越南语、中文、繁体中文、匈牙利语、捷克语、荷兰语、波兰语、罗马尼亚语 +阿拉伯语: ar +德语: de +英语: en +西班牙语: es +法语: fr +印尼语: id +意大利语: it +日语: ja +韩语: ko +葡萄牙语: pt +俄语: ru +泰语: th +土耳其语: tr +越南语: vi +中文: zh +繁体中文: zh-TW +匈牙利语: hu +捷克语: cs +荷兰语: nl +波兰语: pl +罗马尼亚语: ro diff --git a/asset/taskcenter/ar.json b/asset/taskcenter/ar.json new file mode 100644 index 0000000..d007d3b --- /dev/null +++ b/asset/taskcenter/ar.json @@ -0,0 +1,40 @@ +{ + "completed": "تم", + "congrats": "مبروك!", + "finish_task_get_reward": "إنهاء سيكسبك", + "next_week_do": "الأسبوع المقبل", + "ok": "حسنًا", + "receive": "احصل", + "refresh_tomorrow": "سيتم التحديث غدًا", + "remain_time_text": "الوقت المتبقي", + "step": "الخطوة {{num}}", + "time_d": "{{d}} يوم", + "time_d_h": "{{d}} يوم {{h}} ساعة", + "time_h": "{{h}} ساعة", + "time_h_m": "{{h}} ساعة {{m}} دقيقة", + "time_m": "{{m}} دقيقة", + "time_m_s": "{{m}} دقيقة {{s}} ثانية", + "time_s": "{{s}} ثانية", + "to_complete": "لإكمال", + "use": "الاستخدام", + "week_do_1": "تحديث الإثنين", + "week_do_2": "تحديث الثلاثاء", + "week_do_3": "تحديث الأربعاء", + "week_do_4": "تحديث الخميس", + "week_do_5": "تحديث الجمعة", + "week_do_6": "تحديث السبت", + "week_do_7": "تحديث الأحد", + "exchange": "استبدال", + "exchange_tips": "هل أنت متأكد من إنفاق [[{{coin}}]] لاستبدال <<{{title}}>>؟", + "confirm_exchange": "تأكيد الاستبدال؟", + "exchange_success": "تم الاستبدال بنجاح", + "cancel": "إلغاء", + "restock_tips": "المكافآت قيد التوريد...", + "sold_out": "نفدت الكمية", + "coming_soon": "قريبًا", + "discontinued": "تم إزالته", + "exchange_limit": "حد الاستبدال", + "points_lack": "نقاط غير كافية", + "exchange_middle": "جاري الاستبدال", + "exchange_failed": "فشل الاستبدال، يرجى المحاولة مرة أخرى لاحقًا" +} \ No newline at end of file diff --git a/asset/taskcenter/cs.json b/asset/taskcenter/cs.json new file mode 100644 index 0000000..3d8068a --- /dev/null +++ b/asset/taskcenter/cs.json @@ -0,0 +1,40 @@ +{ + "completed": "Dokončeno", + "congrats": "Gratulujeme!", + "finish_task_get_reward": "Dokončením získáte odměnu", + "next_week_do": "Návštěva příští týden", + "ok": "OK", + "receive": "Vyzvednout", + "refresh_tomorrow": "Zítra znovu", + "remain_time_text": "Zbývající čas", + "step": "Krok {{num}}", + "time_d": "{{d}} dnů", + "time_d_h": "{{d}} dnů {{h}} hodin", + "time_h": "{{h}} hodin", + "time_h_m": "{{h}} hodin {{m}} minut", + "time_m": "{{m}} minut", + "time_m_s": "{{m}} minut {{s}} vteřin", + "time_s": "{{s}} vteřin", + "to_complete": "Dokončit", + "use": "Použít", + "week_do_1": "Návštěva v pondělí", + "week_do_2": "Návštěva v úterý", + "week_do_3": "Návštěva ve středu", + "week_do_4": "Návštěva ve čtvrtek", + "week_do_5": "Návštěva v pátek", + "week_do_6": "Návštěva v sobotu", + "week_do_7": "Návštěva v neděli", + "exchange": "Výměna", + "exchange_tips": "Opravdu chcete utratit [[{{coin}}]] za výměnu „<<{{title}}>>“?", + "confirm_exchange": "Potvrdit výměnu?", + "exchange_success": "Výměna proběhla úspěšně", + "cancel": "Zrušit", + "restock_tips": "Doplnění ceny...", + "sold_out": "Vyprodáno", + "coming_soon": "Brzy k dispozici", + "discontinued": "Není v prodeji", + "exchange_limit": "Limit výměny", + "points_lack": "Nedostatečné body", + "exchange_middle": "Probíhá výměna", + "exchange_failed": "Výměna se nezdařila, zkuste to prosím později" +} \ No newline at end of file diff --git a/asset/taskcenter/de.json b/asset/taskcenter/de.json new file mode 100644 index 0000000..d93a069 --- /dev/null +++ b/asset/taskcenter/de.json @@ -0,0 +1,40 @@ +{ + "completed": "erledigt", + "congrats": "Herzlichen Glückwunsch!", + "finish_task_get_reward": "Durch Abschluss erhältst du", + "next_week_do": "Nächste Woche", + "ok": "OK", + "receive": "Einlösen", + "refresh_tomorrow": "Aktualisierung morgen", + "remain_time_text": "Verbleibende Zeit", + "step": "Schritt {{num}}", + "time_d": "{{d}} Tage", + "time_d_h": "{{d}} Tage {{h}} Stunden", + "time_h": "{{h}} Stunden", + "time_h_m": "{{h}} Stunden {{m}} Minuten", + "time_m": "{{m}} Minuten", + "time_m_s": "{{m}} Minuten {{s}} Sekunden", + "time_s": "{{s}} Sekunden", + "to_complete": "Gehen", + "use": "Benutzen", + "week_do_1": "Mo Aktualisieren", + "week_do_2": "Di. Aktualisieren", + "week_do_3": "Mi Aktualisieren", + "week_do_4": "Do Aktualisieren", + "week_do_5": "Fr Aktualisieren", + "week_do_6": "Sa Aktualisieren", + "week_do_7": "So Aktualisieren", + "exchange": "Einlösen", + "exchange_tips": "Möchtest du [[{{coin}}]] ausgeben, um <<{{title}}>> einzulösen?", + "confirm_exchange": "Einlösen bestätigen?", + "exchange_success": "Einlösung erfolgreich", + "cancel": "Abbrechen", + "restock_tips": "Preis wird nachgefüllt...", + "sold_out": "Ausverkauft", + "coming_soon": "Demnächst verfügbar", + "discontinued": "Nicht mehr verfügbar", + "exchange_limit": "Einlösungslimit", + "points_lack": "Nicht genügend Punkte", + "exchange_middle": "Wird eingelöst", + "exchange_failed": "Einlösen fehlgeschlagen, bitte versuchen Sie es später erneut" +} \ No newline at end of file diff --git a/asset/taskcenter/en.json b/asset/taskcenter/en.json new file mode 100644 index 0000000..a2f6a3e --- /dev/null +++ b/asset/taskcenter/en.json @@ -0,0 +1,40 @@ +{ + "completed": "Done", + "congrats": "CONGRATS!", + "finish_task_get_reward": "Completing earns", + "next_week_do": "Next Week", + "ok": "OK", + "receive": "Redeem", + "refresh_tomorrow": "Refresh Tomorrow", + "remain_time_text": "Remaining Time", + "step": "Step {{num}}", + "time_d": "{{d}} days", + "time_d_h": "{{d}} days {{h}} hours", + "time_h": "{{h}} hours", + "time_h_m": "{{h}} hours {{m}} minutes", + "time_m": "{{m}} minutes", + "time_m_s": "{{m}} minutes {{s}} seconds", + "time_s": "{{s}} seconds", + "to_complete": "Go", + "use": "Use", + "week_do_1": "Refresh On Mon", + "week_do_2": "Refresh On Tue", + "week_do_3": "Refresh On Wed", + "week_do_4": "Refresh On Thu", + "week_do_5": "Refresh On Fri", + "week_do_6": "Refresh On Sat", + "week_do_7": "Refresh On Sun", + "exchange": "Exchange", + "exchange_tips": "Spend [[{{coin}}]] to redeem <<{{title}}>>?", + "confirm_exchange": "Confirm exchange?", + "exchange_success": "Exchange successful", + "cancel": "Cancel", + "restock_tips": "Prize restocking...", + "sold_out": "Sold out", + "coming_soon": "Coming soon", + "discontinued": "Discontinued", + "exchange_limit": "Exchange limit", + "points_lack": "Insufficient points", + "exchange_middle": "Exchanging", + "exchange_failed": "Exchange failed, please try again later" +} \ No newline at end of file diff --git a/asset/taskcenter/es.json b/asset/taskcenter/es.json new file mode 100644 index 0000000..8d45e7e --- /dev/null +++ b/asset/taskcenter/es.json @@ -0,0 +1,40 @@ +{ + "completed": "hecho", + "congrats": "¡Felicidades!", + "finish_task_get_reward": "Completar te da", + "next_week_do": "La Próxima Semana", + "ok": "Está bien", + "receive": "Canjear", + "refresh_tomorrow": "Actualizar mañana", + "remain_time_text": "Tiempo restante", + "step": "Paso {{num}}", + "time_d": "{{d}} días", + "time_d_h": "{{d}} días {{h}} horas", + "time_h": "{{h}} horas", + "time_h_m": "{{h}} horas {{m}} minutos", + "time_m": "{{m}} minutos", + "time_m_s": "{{m}} minutos {{s}} segundos", + "time_s": "{{s}} segundos", + "to_complete": "Ir", + "use": "Usar", + "week_do_1": "Actualizar El Lun", + "week_do_2": "Actualizar El Mar", + "week_do_3": "Actualizar El Mié", + "week_do_4": "Actualizar El Jue", + "week_do_5": "Actualizar El Vie", + "week_do_6": "Actualizar El Sáb", + "week_do_7": "Actualizar El Dom", + "exchange": "Canjear", + "exchange_tips": "¿Estás seguro de gastar [[{{coin}}]] para canjear <<{{title}}>>?", + "confirm_exchange": "¿Confirmar canje?", + "exchange_success": "Canje exitoso", + "cancel": "Cancelar", + "restock_tips": "Reabasteciendo premio...", + "sold_out": "Agotado", + "coming_soon": "Próximamente", + "discontinued": "Descatalogado", + "exchange_limit": "Límite de canje", + "points_lack": "Puntos insuficientes", + "exchange_middle": "Canjeando", + "exchange_failed": "Canje fallido, inténtalo de nuevo más tarde" +} \ No newline at end of file diff --git a/asset/taskcenter/fr.json b/asset/taskcenter/fr.json new file mode 100644 index 0000000..ee097f0 --- /dev/null +++ b/asset/taskcenter/fr.json @@ -0,0 +1,40 @@ +{ + "completed": "fait", + "congrats": "Félicitations !", + "finish_task_get_reward": "Compléter vous rapporte", + "next_week_do": "La Semaine Prochaine", + "ok": "D'accord", + "receive": "Racheter", + "refresh_tomorrow": "Actualiser demain", + "remain_time_text": "Temps restant", + "step": "Étape {{num}}", + "time_d": "{{d}} jours", + "time_d_h": "{{d}} jours {{h}} heures", + "time_h": "{{h}} heures", + "time_h_m": "{{h}} heures {{m}} minutes", + "time_m": "{{m}} minutes", + "time_m_s": "{{m}} minutes {{s}} secondes", + "time_s": "{{s}} secondes", + "to_complete": "Aller", + "use": "Utiliser", + "week_do_1": "Actualiser Lun", + "week_do_2": "Actualiser Mar", + "week_do_3": "Actualiser Mer", + "week_do_4": "Actualiser Jeu", + "week_do_5": "Actualiser Ven", + "week_do_6": "Actualiser Sam", + "week_do_7": "Actualiser Dim", + "exchange": "Échanger", + "exchange_tips": "Voulez-vous dépenser [[{{coin}}]] pour échanger <<{{title}}>> ?", + "confirm_exchange": "Confirmer l'échange ?", + "exchange_success": "Échange réussi", + "cancel": "Annuler", + "restock_tips": "Réapprovisionnement du lot...", + "sold_out": "Épuisé", + "coming_soon": "Bientôt disponible", + "discontinued": "Retiré de la vente", + "exchange_limit": "Limite d'échange", + "points_lack": "Points insuffisants", + "exchange_middle": "En cours d'échange", + "exchange_failed": "Échange échoué, veuillez réessayer plus tard" +} \ No newline at end of file diff --git a/asset/taskcenter/hu.json b/asset/taskcenter/hu.json new file mode 100644 index 0000000..afa242b --- /dev/null +++ b/asset/taskcenter/hu.json @@ -0,0 +1,40 @@ +{ + "completed": "Kész", + "congrats": "Gratulálok!", + "finish_task_get_reward": "A befejezéssel -t kapsz", + "next_week_do": "Jövő hét", + "ok": "Rendben", + "receive": "Beváltás", + "refresh_tomorrow": "Frissítés holnap", + "remain_time_text": "Hátralévő idő", + "step": "{{num}}. lépés", + "time_d": "{{d}} nap", + "time_d_h": "{{d}} nap {{h}} óra", + "time_h": "{{h}} óra", + "time_h_m": "{{h}} óra {{m}} perc", + "time_m": "{{m}} perc", + "time_m_s": "{{m}} perc {{s}} másodperc", + "time_s": "{{s}} másodperc", + "to_complete": "Menj", + "use": "Használ", + "week_do_1": "Hétfőn frissül", + "week_do_2": "Kedden frissül", + "week_do_3": "Szerdán frissül", + "week_do_4": "Csütörtökön frissül", + "week_do_5": "Pénteken frissül", + "week_do_6": "Szombaton frissül", + "week_do_7": "Vasárnap frissül", + "exchange": "Beváltás", + "exchange_tips": "Biztosan elköltöd [[{{coin}}]]-t, hogy beváltsd <<{{title}}>>?", + "confirm_exchange": "Megerősíted a beváltást?", + "exchange_success": "Beváltás sikeres", + "cancel": "Mégse", + "restock_tips": "Nyeremény feltöltése...", + "sold_out": "Elfogyott", + "coming_soon": "Hamarosan", + "discontinued": "Kivonva", + "exchange_limit": "Beváltási korlát", + "points_lack": "Nem elegendő pont", + "exchange_middle": "Beváltás folyamatban", + "exchange_failed": "A beváltás sikertelen, próbálja újra később" +} \ No newline at end of file diff --git a/asset/taskcenter/id.json b/asset/taskcenter/id.json new file mode 100644 index 0000000..857fbee --- /dev/null +++ b/asset/taskcenter/id.json @@ -0,0 +1,40 @@ +{ + "completed": "selesai", + "congrats": "Selamat!", + "finish_task_get_reward": "Menyelesaikan akan memberi Anda", + "next_week_do": "Minggu Depan", + "ok": "Oke", + "receive": "Menebus", + "refresh_tomorrow": "Segarkan Besok", + "remain_time_text": "Waktu tersisa", + "step": "Langkah {{num}}", + "time_d": "{{d}} hari", + "time_d_h": "{{d}} hari {{h}} jam", + "time_h": "{{h}} jam", + "time_h_m": "{{h}} jam {{m}} menit", + "time_m": "{{m}} menit", + "time_m_s": "{{m}} menit {{s}} detik", + "time_s": "{{s}} detik", + "to_complete": "Pergi", + "use": "Gunakan", + "week_do_1": "Segarkan Pada Sen", + "week_do_2": "Segarkan Pada Sel", + "week_do_3": "Segarkan Pada Rab", + "week_do_4": "Segarkan Pada Kam", + "week_do_5": "Segarkan Pada Jum", + "week_do_6": "Segarkan Pada Sab", + "week_do_7": "Segarkan Pada Min", + "exchange": "Tukar", + "exchange_tips": "Yakin ingin mengeluarkan [[{{coin}}]] untuk menukar <<{{title}}>>?", + "confirm_exchange": "Konfirmasi penukaran?", + "exchange_success": "Penukaran berhasil", + "cancel": "Batal", + "restock_tips": "Hadiah sedang diisi ulang...", + "sold_out": "Habis", + "coming_soon": "Segera hadir", + "discontinued": "Dihentikan", + "exchange_limit": "Batas penukaran", + "points_lack": "Poin tidak mencukupi", + "exchange_middle": "Sedang menukar", + "exchange_failed": "Penukaran gagal, silakan coba lagi nanti" +} \ No newline at end of file diff --git a/asset/taskcenter/it.json b/asset/taskcenter/it.json new file mode 100644 index 0000000..f5d9009 --- /dev/null +++ b/asset/taskcenter/it.json @@ -0,0 +1,40 @@ +{ + "completed": "fatto", + "congrats": "Congratulazioni!", + "finish_task_get_reward": "Completare ti farà guadagnare", + "next_week_do": "La Prossima Settimana", + "ok": "Va bene", + "receive": "Riscattare", + "refresh_tomorrow": "Aggiorna domani", + "remain_time_text": "Tempo rimanente", + "step": "Passo {{num}}", + "time_d": "{{d}} giorni", + "time_d_h": "{{d}} giorni {{h}} ore", + "time_h": "{{h}} ore", + "time_h_m": "{{h}} ore {{m}} minuti", + "time_m": "{{m}} minuti", + "time_m_s": "{{m}} minuti {{s}} secondi", + "time_s": "{{s}} secondi", + "to_complete": "Andare", + "use": "Usare", + "week_do_1": "Aggiorna Lun", + "week_do_2": "Aggiorna Mar", + "week_do_3": "Aggiorna Mer", + "week_do_4": "Aggiorna Gio", + "week_do_5": "Aggiorna Ven", + "week_do_6": "Aggiorna Sab", + "week_do_7": "Aggiorna Dom", + "exchange": "Scambia", + "exchange_tips": "Sei sicuro di spendere [[{{coin}}]] per riscattare <<{{title}}>>?", + "confirm_exchange": "Confermare lo scambio?", + "exchange_success": "Riscatto riuscito", + "cancel": "Annulla", + "restock_tips": "Premio in riassortimento...", + "sold_out": "Esaurito", + "coming_soon": "In arrivo", + "discontinued": "Fuori produzione", + "exchange_limit": "Limite di riscatto", + "points_lack": "Punti insufficienti", + "exchange_middle": "Riscatto in corso", + "exchange_failed": "Riscatto fallito, riprova più tardi" +} \ No newline at end of file diff --git a/asset/taskcenter/ja.json b/asset/taskcenter/ja.json new file mode 100644 index 0000000..059e831 --- /dev/null +++ b/asset/taskcenter/ja.json @@ -0,0 +1,40 @@ +{ + "completed": "完了しました", + "congrats": "おめでとうございます!", + "finish_task_get_reward": "完了するとが得られます", + "next_week_do": "来週更新", + "ok": "OK", + "receive": "償還する", + "refresh_tomorrow": "明日更新", + "remain_time_text": "残り時間", + "step": "{{num}}ステップ", + "time_d": "{{d}} 日", + "time_d_h": "{{d}} 日 {{h}} 時間", + "time_h": "{{h}} 時間", + "time_h_m": "{{h}} 時間 {{m}} 分", + "time_m": "{{m}} 分", + "time_m_s": "{{m}} 分 {{s}} 秒", + "time_s": "{{s}} 秒", + "to_complete": "行く", + "use": "使用する", + "week_do_1": "月曜日に更新", + "week_do_2": "火曜日に更新", + "week_do_3": "水曜日に更新", + "week_do_4": "木曜日に更新", + "week_do_5": "金曜日に更新", + "week_do_6": "土曜日に更新", + "week_do_7": "日曜日に更新", + "exchange": "交換", + "exchange_tips": "[[{{coin}}]]を使って「<<{{title}}>>」を交換しますか?", + "confirm_exchange": "交換を確定しますか?", + "exchange_success": "交換成功", + "cancel": "キャンセル", + "restock_tips": "景品を補充しています...", + "sold_out": "売り切れ", + "coming_soon": "近日登場", + "discontinued": "販売終了", + "exchange_limit": "交換上限", + "points_lack": "ポイント不足", + "exchange_middle": "交換中", + "exchange_failed": "交換に失敗しました。後ほど再度お試しください" +} \ No newline at end of file diff --git a/asset/taskcenter/ko.json b/asset/taskcenter/ko.json new file mode 100644 index 0000000..596a6a6 --- /dev/null +++ b/asset/taskcenter/ko.json @@ -0,0 +1,40 @@ +{ + "completed": "완료됨", + "congrats": "축하합니다!", + "finish_task_get_reward": "완료하면 을(를) 얻습니다", + "next_week_do": "다음 주", + "ok": "좋아요", + "receive": "수령", + "refresh_tomorrow": "내일 새로 고침", + "remain_time_text": "남은 시간", + "step": "단계 {{num}}", + "time_d": "{{d}} 일", + "time_d_h": "{{d}} 일 {{h}} 시간", + "time_h": "{{h}} 시간", + "time_h_m": "{{h}} 시간 {{m}} 분", + "time_m": "{{m}} 분", + "time_m_s": "{{m}} 분 {{s}} 초", + "time_s": "{{s}} 초", + "to_complete": "가다", + "use": "사용하다", + "week_do_1": "월요일 새로 고침", + "week_do_2": "화요일 새로 고침", + "week_do_3": "수요일 새로 고침", + "week_do_4": "목요일 새로 고침", + "week_do_5": "금요일 새로 고침", + "week_do_6": "토요일 새로 고침", + "week_do_7": "일요일 새로 고침", + "exchange": "교환", + "exchange_tips": "[[{{coin}}]]을(를) 사용하여 <<{{title}}>> 을(를) 교환하시겠습니까?", + "confirm_exchange": "교환을 확인하시겠습니까?", + "exchange_success": "교환 성공", + "cancel": "취소", + "restock_tips": "상품을 재입고 중...", + "sold_out": "품절", + "coming_soon": "곧 출시", + "discontinued": "판매 중단", + "exchange_limit": "교환 한도", + "points_lack": "포인트 부족", + "exchange_middle": "교환 중", + "exchange_failed": "교환에 실패했습니다. 나중에 다시 시도해 주세요" +} \ No newline at end of file diff --git a/asset/taskcenter/lang_test.go b/asset/taskcenter/lang_test.go new file mode 100644 index 0000000..66337a1 --- /dev/null +++ b/asset/taskcenter/lang_test.go @@ -0,0 +1,297 @@ +package lang + +import ( + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/verify" + "encoding/json" + "fmt" + "os" + "strings" + "testing" +) + +var aa = map[string]string{ + "德语": "de", + "英语": "en", + "西班牙语": "es", + "法语": "fr", + "印尼语": "id", + "意大利语": "it", + "日语": "ja", + "韩语": "ko", + "葡萄牙语": "pt", + "俄语": "ru", + "泰语": "th", + "土耳其语": "tr", + "中文": "zh", + "繁体中文": "zh-TW", + "越南语": "vi", + "匈牙利语": "hu", + "荷兰语": "nl", + "波兰语": "pl", + "罗马尼亚语": "ro", +} + +func TestName(t *testing.T) { + var data = `德语: Herzlichen Glückwunsch! +西班牙语: ¡Felicidades! +法语: Félicitations ! +印尼语: Selamat! +意大利语: Congratulazioni! +日语: おめでとうございます! +韩语: 축하합니다! +葡萄牙语: Parabéns! +俄语: Поздравляю! +泰语: ขอแสดงความยินดี! +土耳其语: Tebrikler! +繁体中文: 恭喜! +越南语: Chúc mừng! +匈牙利语: Gratulálok!` + + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + langData[mark] = ddd + } + + ak := "congrats" + var arr = strings.Split(data, "\n") + for _, v := range arr { + key, val, _ := strings.Cut(v, ":") + mark := aa[strings.TrimSpace(key)] + + if _, ok := langData[mark][ak]; !ok { + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + langData[mark][ak] = strings.TrimSpace(val) + adata, _ := json.Marshal(langData[mark]) + file.Write(adata) + file.Close() + + fmt.Printf("%s: %s->%s \n", key, ak, langData[mark][ak]) + } + } +} + +func TestRemoveKey(t *testing.T) { + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var keys = []string{"help_wait"} + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + + for _, key := range keys { + delete(ddd, key) + } + + langData[mark] = ddd + } + + for mark, data := range langData { + if verify.InArray(mark, "en", "zh", "ar") { + continue + } + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(data) + file.Write(adata) + file.Close() + } +} + +func TestCopyKey(t *testing.T) { + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var key = map[string]string{ + "help_fail": "distribution_failed", + } + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + + for cp, to := range key { + _, ok1 := ddd[cp] + if !ok1 { + t.Logf("[%s]没有[%s]", mark, cp) + continue + } + ddd[to] = ddd[cp] + } + + langData[mark] = ddd + } + + for mark, data := range langData { + if verify.InArray(mark, "en", "zh", "ar", "zh-TW") { + continue + } + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(data) + file.Write(adata) + file.Close() + } +} + +func TestCopyCampaignKey(t *testing.T) { + entrys, err := os.ReadDir("./") + if err != nil { + return + } + + var key = map[string]string{ + "next_week_do": "next_week_do", + "week_do_1": "week_do_1", + "week_do_2": "week_do_2", + "week_do_3": "week_do_3", + "week_do_4": "week_do_4", + "week_do_5": "week_do_5", + "week_do_6": "week_do_6", + "week_do_7": "week_do_7", + } + var langData = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + + var source = make(map[string]string) + var sb []byte + sb, err = os.ReadFile(fmt.Sprintf("../campaign/lang/%s.json", mark)) + if err != nil { + return + } + + _ = json.Unmarshal(sb, &source) + + for cp, to := range key { + _, ok1 := source[cp] + if !ok1 { + t.Logf("[%s]没有[%s]", mark, cp) + continue + } + ddd[to] = source[cp] + } + + langData[mark] = ddd + } + + for mark, data := range langData { + file, _ := os.OpenFile(mark+".json", os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(data) + file.Write(adata) + file.Close() + } +} + +func TestUpdateKey(t *testing.T) { + var fname = "./es.json" + + b, err := os.ReadFile(fname) + if err != nil { + t.Log(err) + return + } + + var ddd = make(map[string]string) + _ = json.Unmarshal(b, &ddd) + + val := "Girar" + key := []string{"spin", "lottery"} + + var do bool + for _, v := range key { + old, ok := ddd[v] + if !ok || old == val { + continue + } + ddd[v] = val + do = true + + fmt.Printf("%s: %s->%s \n", v, old, val) + } + + if !do { + t.Log("not done ") + return + } + + file, _ := os.OpenFile(fname, os.O_RDWR|os.O_TRUNC, 0666) + adata, _ := json.Marshal(ddd) + file.Write(adata) + file.Close() +} diff --git a/asset/taskcenter/nl.json b/asset/taskcenter/nl.json new file mode 100644 index 0000000..75785ba --- /dev/null +++ b/asset/taskcenter/nl.json @@ -0,0 +1,40 @@ +{ + "completed": "Voltooid", + "congrats": "GEFELICITEERD!", + "finish_task_get_reward": "Voltooien levert op", + "next_week_do": "Volgende week", + "ok": "OK", + "receive": "Inwisselen", + "refresh_tomorrow": "Kom morgen terug", + "remain_time_text": "Resterende tijd", + "step": "Stap {{num}}", + "time_d": "{{d}} dagen", + "time_d_h": "{{d}} dagen {{h}} uur", + "time_h": "{{h}} uur", + "time_h_m": "{{h}} uur {{m}} minuten", + "time_m": "{{m}} minuten", + "time_m_s": "{{m}} minuten {{s}} seconden", + "time_s": "{{s}} seconden", + "to_complete": "Voltooien", + "use": "Gebruiken", + "week_do_1": "Kom maandag terug", + "week_do_2": "Kom dinsdag terug", + "week_do_3": "Kom woensdag terug", + "week_do_4": "Kom donderdag terug", + "week_do_5": "Kom vrijdag terug", + "week_do_6": "Kom zaterdag terug", + "week_do_7": "Kom zondag terug", + "exchange": "Inwisselen", + "exchange_tips": "[[{{coin}}]] uitgeven om <<{{title}}>> in te wisselen?", + "confirm_exchange": "Inwisseling bevestigen?", + "exchange_success": "Inwisseling geslaagd", + "cancel": "Annuleren", + "restock_tips": "Prijs wordt aangevuld...", + "sold_out": "Uitverkocht", + "coming_soon": "Binnenkort beschikbaar", + "discontinued": "Niet meer beschikbaar", + "exchange_limit": "Inwissellimiet", + "points_lack": "Onvoldoende punten", + "exchange_middle": "Bezig met inwisselen", + "exchange_failed": "Inwisselen mislukt, probeer het later opnieuw" +} diff --git a/asset/taskcenter/pt.json b/asset/taskcenter/pt.json new file mode 100644 index 0000000..1e72915 --- /dev/null +++ b/asset/taskcenter/pt.json @@ -0,0 +1,40 @@ +{ + "completed": "feito", + "congrats": "Parabéns!", + "finish_task_get_reward": "Completar ganha", + "next_week_do": "Na Próxima Semana", + "ok": "OK", + "receive": "Resgatar", + "refresh_tomorrow": "Atualizar amanhã", + "remain_time_text": "Tempo restante", + "step": "Etapa {{num}}", + "time_d": "{{d}} dias", + "time_d_h": "{{d}} dias {{h}} horas", + "time_h": "{{h}} horas", + "time_h_m": "{{h}} horas {{m}} minutos", + "time_m": "{{m}} minutos", + "time_m_s": "{{m}} minutos {{s}} segundos", + "time_s": "{{s}} segundos", + "to_complete": "Ir", + "use": "Usar", + "week_do_1": "Atualizar Na Seg", + "week_do_2": "Atualizar Na Ter", + "week_do_3": "Atualizar Na Qua", + "week_do_4": "Atualizar Na Qui", + "week_do_5": "Atualizar Na Sex", + "week_do_6": "Atualizar No Sáb", + "week_do_7": "Atualizar No Dom", + "exchange": "Trocar", + "exchange_tips": "Tem certeza de gastar [[{{coin}}]] para resgatar <<{{title}}>>?", + "confirm_exchange": "Confirmar troca?", + "exchange_success": "Troca bem-sucedida", + "cancel": "Cancelar", + "restock_tips": "Reabastecendo prêmio...", + "sold_out": "Esgotado", + "coming_soon": "Em breve", + "discontinued": "Descontinuado", + "exchange_limit": "Limite de troca", + "points_lack": "Pontos insuficientes", + "exchange_middle": "Trocando", + "exchange_failed": "Troca falhou, tente novamente mais tarde" +} \ No newline at end of file diff --git a/asset/taskcenter/ru.json b/asset/taskcenter/ru.json new file mode 100644 index 0000000..84fda5e --- /dev/null +++ b/asset/taskcenter/ru.json @@ -0,0 +1,40 @@ +{ + "completed": "сделано", + "congrats": "Поздравляю!", + "finish_task_get_reward": "Завершение приносит", + "next_week_do": "На Следующей Неделе", + "ok": "Хорошо", + "receive": "Погашать", + "refresh_tomorrow": "Обновить завтра", + "remain_time_text": "Оставшееся время", + "step": "Шаг {{num}}", + "time_d": "{{d}} дней", + "time_d_h": "{{d}} дней {{h}} часов", + "time_h": "{{h}} часов", + "time_h_m": "{{h}} часов {{m}} минут", + "time_m": "{{m}} минут", + "time_m_s": "{{m}} минут {{s}} секунд", + "time_s": "{{s}} секунд", + "to_complete": "Идти", + "use": "Использовать", + "week_do_1": "Обновление В Пн", + "week_do_2": "Обновление В Вт", + "week_do_3": "Обновление В Ср", + "week_do_4": "Обновление В Чт", + "week_do_5": "Обновление В Пт", + "week_do_6": "Обновление В Сб", + "week_do_7": "Обновление В Вс", + "exchange": "Обмен", + "exchange_tips": "Вы уверены, что хотите потратить [[{{coin}}]] чтобы обменять <<{{title}}>>?", + "confirm_exchange": "Подтвердить обмен?", + "exchange_success": "Обмен выполнен", + "cancel": "Отмена", + "restock_tips": "Пополнение приза...", + "sold_out": "Распродано", + "coming_soon": "Скоро", + "discontinued": "Снято с продаж", + "exchange_limit": "Лимит обмена", + "points_lack": "Недостаточно очков", + "exchange_middle": "Обмен в процессе", + "exchange_failed": "Обмен не удался, повторите попытку позже" +} \ No newline at end of file diff --git a/asset/taskcenter/th.json b/asset/taskcenter/th.json new file mode 100644 index 0000000..d4034c5 --- /dev/null +++ b/asset/taskcenter/th.json @@ -0,0 +1,40 @@ +{ + "completed": "เสร็จสิ้นแล้ว", + "congrats": "ขอแสดงความยินดี!", + "finish_task_get_reward": "การเสร็จสิ้นจะได้รับ", + "next_week_do": "สัปดาห์หน้า", + "ok": "ตกลง", + "receive": "รับ", + "refresh_tomorrow": "รีเฟรชพรุ่งนี้", + "remain_time_text": "เวลาที่เหลือ", + "step": "ขั้นตอน {{num}}", + "time_d": "{{d}} วัน", + "time_d_h": "{{d}} วัน {{h}} ชั่วโมง", + "time_h": "{{h}} ชั่วโมง", + "time_h_m": "{{h}} ชั่วโมง {{m}} นาที", + "time_m": "{{m}} นาที", + "time_m_s": "{{m}} นาที {{s}} วินาที", + "time_s": "{{s}} วินาที", + "to_complete": "ไป", + "use": "ใช้", + "week_do_1": "อัปเดตวันจันทร์", + "week_do_2": "อัปเดตวันอังคาร", + "week_do_3": "อัปเดตวันพุธ", + "week_do_4": "อัปเดตวันพฤหัสบดี", + "week_do_5": "อัปเดตวันศุกร์", + "week_do_6": "อัปเดตวันเสาร์", + "week_do_7": "อัปเดตวันอาทิตย์", + "exchange": "แลก", + "exchange_tips": "คุณแน่ใจหรือไม่ว่าจะใช้ [[{{coin}}]] เพื่อแลก <<{{title}}>>?", + "confirm_exchange": "ยืนยันการแลก?", + "exchange_success": "แลกสำเร็จ", + "cancel": "ยกเลิก", + "restock_tips": "กำลังเติมของรางวัล...", + "sold_out": "สินค้าหมด", + "coming_soon": "เร็วๆ นี้", + "discontinued": "ยกเลิกการวางจำหน่าย", + "exchange_limit": "ขีดจำกัดการแลก", + "points_lack": "คะแนนไม่เพียงพอ", + "exchange_middle": "กำลังแลก", + "exchange_failed": "การแลกล้มเหลว โปรดลองอีกครั้งในภายหลัง" +} \ No newline at end of file diff --git a/asset/taskcenter/tr.json b/asset/taskcenter/tr.json new file mode 100644 index 0000000..6d0efeb --- /dev/null +++ b/asset/taskcenter/tr.json @@ -0,0 +1,40 @@ +{ + "completed": "tamam", + "congrats": "Tebrikler!", + "finish_task_get_reward": "Tamamlama ile kazanırsınız", + "next_week_do": "Gelecek Hafta", + "ok": "Tamam", + "receive": "Kullanmak", + "refresh_tomorrow": "Yarın Yenile", + "remain_time_text": "Kalan süre", + "step": "Adım {{num}}", + "time_d": "{{d}} gün", + "time_d_h": "{{d}} gün {{h}} saat", + "time_h": "{{h}} saat", + "time_h_m": "{{h}} saat {{m}} dakika", + "time_m": "{{m}} dakika", + "time_m_s": "{{m}} dakika {{s}} saniye", + "time_s": "{{s}} saniye", + "to_complete": "Git", + "use": "Kullanmak", + "week_do_1": "Pazartesi Yenile", + "week_do_2": "Salı Yenile", + "week_do_3": "Çarşamba Yenile", + "week_do_4": "Perşembe Yenile", + "week_do_5": "Cuma Yenile", + "week_do_6": "Cumartesi Yenile", + "week_do_7": "Pazar Yenile", + "exchange": "Takas", + "exchange_tips": "<<{{title}}>> için [[{{coin}}]] harcamak istediğinize emin misiniz?", + "confirm_exchange": "Takası onaylıyor musunuz?", + "exchange_success": "Takas başarılı", + "cancel": "İptal", + "restock_tips": "Ödül yeniden stoklanıyor...", + "sold_out": "Tükendi", + "coming_soon": "Yakında", + "discontinued": "Satıştan kaldırıldı", + "exchange_limit": "Takas limiti", + "points_lack": "Yetersiz puan", + "exchange_middle": "Takas ediliyor", + "exchange_failed": "Takas başarısız oldu, lütfen daha sonra tekrar deneyin" +} \ No newline at end of file diff --git a/asset/taskcenter/vi.json b/asset/taskcenter/vi.json new file mode 100644 index 0000000..422ddaf --- /dev/null +++ b/asset/taskcenter/vi.json @@ -0,0 +1,40 @@ +{ + "completed": "hoàn thành", + "congrats": "Chúc mừng!", + "finish_task_get_reward": "Hoàn thành sẽ nhận được", + "next_week_do": "Tuần tới", + "ok": "Được rồi", + "receive": "Đổi thưởng", + "refresh_tomorrow": "Làm mới vào ngày mai", + "remain_time_text": "Thời gian còn lại", + "step": "Bước {{num}}", + "time_d": "{{d}} ngày", + "time_d_h": "{{d}} ngày {{h}} giờ", + "time_h": "{{h}} giờ", + "time_h_m": "{{h}} giờ {{m}} phút", + "time_m": "{{m}} phút", + "time_m_s": "{{m}} phút {{s}} giây", + "time_s": "{{s}} giây", + "to_complete": "Đi", + "use": "Sử dụng", + "week_do_1": "Làm mới vào thứ Hai", + "week_do_2": "Làm mới vào thứ Ba", + "week_do_3": "Làm mới vào thứ Tư", + "week_do_4": "Làm mới vào thứ Năm", + "week_do_5": "Làm mới vào thứ Sáu", + "week_do_6": "Làm mới vào thứ Bảy", + "week_do_7": "Làm mới vào Chủ Nhật", + "exchange": "Đổi", + "exchange_tips": "Bạn có chắc muốn tiêu [[{{coin}}]] để đổi <<{{title}}>> không?", + "confirm_exchange": "Xác nhận đổi?", + "exchange_success": "Đổi thành công", + "cancel": "Hủy", + "restock_tips": "Đang bổ sung phần thưởng...", + "sold_out": "Hết hàng", + "coming_soon": "Sắp ra mắt", + "discontinued": "Ngừng cung cấp", + "exchange_limit": "Giới hạn đổi thưởng", + "points_lack": "Không đủ điểm", + "exchange_middle": "Đang đổi thưởng", + "exchange_failed": "Đổi thưởng thất bại, vui lòng thử lại sau" +} \ No newline at end of file diff --git a/asset/taskcenter/zh-TW.json b/asset/taskcenter/zh-TW.json new file mode 100644 index 0000000..fcae76d --- /dev/null +++ b/asset/taskcenter/zh-TW.json @@ -0,0 +1,40 @@ +{ + "completed": "已完成", + "congrats": "恭喜您!", + "finish_task_get_reward": "完成可獲得", + "next_week_do": "下週再來", + "ok": "確認", + "receive": "領取", + "refresh_tomorrow": "明天再來", + "remain_time_text": "剩餘時間", + "step": "第{{num}}步", + "time_d": "{{d}}天", + "time_d_h": "{{d}}天{{h}}小時", + "time_h": "{{h}}小時", + "time_h_m": "{{h}}小時{{m}}分鐘", + "time_m": "{{m}}分鐘", + "time_m_s": "{{m}}分鐘{{s}}秒", + "time_s": "{{s}}秒", + "to_complete": "去完成", + "use": "使用", + "week_do_1": "週一再來", + "week_do_2": "週二再來", + "week_do_3": "週三再來", + "week_do_4": "週四再來", + "week_do_5": "週五再來", + "week_do_6": "週六再來", + "week_do_7": "週天再來", + "exchange": "兌換", + "exchange_tips": "確定要花費[[{{coin}}]]兌換 <<{{title}}>> 嗎?", + "confirm_exchange": "確認兌換?", + "exchange_success": "兌換成功", + "cancel": "取消", + "restock_tips": "獎品補貨中...", + "sold_out": "售罄", + "coming_soon": "即將上架", + "discontinued": "已下架", + "exchange_limit": "兌換上限", + "points_lack": "點數不足", + "exchange_middle": "兌換中", + "exchange_failed": "兌換失敗,請稍後再試" +} \ No newline at end of file diff --git a/asset/taskcenter/zh.json b/asset/taskcenter/zh.json new file mode 100644 index 0000000..c431492 --- /dev/null +++ b/asset/taskcenter/zh.json @@ -0,0 +1,40 @@ +{ + "completed": "已完成", + "congrats": "恭喜您!", + "finish_task_get_reward": "完成可获得", + "next_week_do": "下周再来", + "ok": "确定", + "receive": "领取", + "refresh_tomorrow": "明天再来", + "remain_time_text": "剩余时间", + "step": "第{{num}}步", + "time_d": "{{d}}天", + "time_d_h": "{{d}}天{{h}}小时", + "time_h": "{{h}}小时", + "time_h_m": "{{h}}小时{{m}}分钟", + "time_m": "{{m}}分钟", + "time_m_s": "{{m}}分钟{{s}}秒", + "time_s": "{{s}}秒", + "to_complete": "去完成", + "use": "使用", + "week_do_1": "周一再来", + "week_do_2": "周二再来", + "week_do_3": "周三再来", + "week_do_4": "周四再来", + "week_do_5": "周五再来", + "week_do_6": "周六再来", + "week_do_7": "周天再来", + "exchange": "兑换", + "exchange_tips": "确定要花费[[{{coin}}]]兑换<<{{title}}>>吗?", + "confirm_exchange": "确认兑换?", + "exchange_success": "兑换成功", + "cancel": "取消", + "restock_tips": "奖品补货中...", + "sold_out": "售罄", + "coming_soon": "即将上架", + "discontinued": "已下架", + "exchange_limit": "兑换上限", + "points_lack": "积分不足", + "exchange_middle": "兑换中", + "exchange_failed": "兑换失败,请稍后再试" +} \ No newline at end of file diff --git a/cmd/joybuywork/joybuywork.go b/cmd/joybuywork/joybuywork.go new file mode 100644 index 0000000..d59cf5b --- /dev/null +++ b/cmd/joybuywork/joybuywork.go @@ -0,0 +1,36 @@ +package main + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/boot" + "fmt" + "os" + "os/signal" + "syscall" +) + +func main() { + defer func() { + if err := recover(); err != nil { + app.Logger.Error(context.Background(), fmt.Sprintf("panic: %v", err)) + } + }() + err := boot.Init() + if err != nil { + panic(err) + } + + boot.Run() + + //监听程序退出 + ch := make(chan os.Signal, 1) + signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGKILL, syscall.SIGHUP) + + select { + case <-ch: + defer close(ch) + } + + boot.Shutdown() +} diff --git a/etc/config-dev.yaml b/etc/config-dev.yaml new file mode 100644 index 0000000..1933016 --- /dev/null +++ b/etc/config-dev.yaml @@ -0,0 +1,49 @@ +database: + url: root:branchcn_dev2@2023@tcp(120.79.90.126:3307)/dplk_db?charset=utf8mb4&parseTime=True&loc=Local + max_idle_conn: 10 + max_open_conn: 20 + conn_max_lifetime: 1h0m0s + slow_threshold: 300ms +etcd: + address: + - 192.168.0.153:12379 +kafka: + brokers: + - 120.79.90.126:9093 +logger: + std_out: true + file_out: true + path: ./logs/server.log + max_size: 10 + max_backups: 5 + max_age: 30 + compress: false +redis: + addr: 120.79.90.126:6380 + password: branchcn_dev2@redis + db: 0 + sentinel: "" + sentinel_master_name: "" +server: + env: dev + link_domain: .c.allapp.link + link_domain_proto: https:// + ladder_host: https://proxy.branchcn.com:8977 + ads_domain: .a.allapp.link + ads_domain_proto: https:// + ads_jump: "https://test-moads.allapp.link/ad" +alert: + feishu: + url: "https://open.feishu.cn/open-apis/bot/v2/hook/747c9575-66cd-4701-a691-cdf544056683" + secret: "KcATHHyFtGp7BUPfRW465e" + scenes: + - { url: "https://open.feishu.cn/open-apis/bot/v2/hook/be94c172-66c7-4915-9eae-4f7a885975a2", secret: "CzWcDpDeEMDnlALJ4E8SUd", scene: "normal" } + - { url: "https://open.feishu.cn/open-apis/bot/v2/hook/be94c172-66c7-4915-9eae-4f7a885975a2", secret: "CzWcDpDeEMDnlALJ4E8SUd", scene: "notice" } +upload: + endpoint: "https://oss-cn-shenzhen.aliyuncs.com" + upload_url: "https://client-project-resource.oss-cn-shenzhen.aliyuncs.com" + access_key: "LTAI5tNvMLF181bTb3qCZxk4" + secret: "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A" + bucket_name: "client-project-resource" + prefix: "resource/" + host: "https://i1.branchcn.com" diff --git a/etc/config-prod.yaml b/etc/config-prod.yaml new file mode 100644 index 0000000..f0da4f0 --- /dev/null +++ b/etc/config-prod.yaml @@ -0,0 +1,51 @@ +database: + url: dplk_normal:DPLKnormal321@tcp(pc-wz99ok336msd23893.rwlb.rds.aliyuncs.com:3306)/dplk_db?charset=utf8mb4&parseTime=True&loc=Local + max_idle_conn: 100 + max_open_conn: 800 + conn_max_lifetime: 1h0m0s + slow_threshold: 300ms +etcd: + address: + - 192.168.2.96:12379 +kafka: + brokers: + - "alikafka-post-cn-20p37xyih001-1-vpc.alikafka.aliyuncs.com:9092" + - "alikafka-post-cn-20p37xyih001-2-vpc.alikafka.aliyuncs.com:9092" + - "alikafka-post-cn-20p37xyih001-3-vpc.alikafka.aliyuncs.com:9092" +logger: + std_out: false + file_out: true + path: ./logs/server.log + max_size: 10 + max_backups: 5 + max_age: 30 + compress: false +redis: + addr: r-wz98ium6mmr6ho5nk6.redis.rds.aliyuncs.com:6379 + password: DPLKnormal321 + db: 0 + sentinel: "" + sentinel_master_name: "" +server: + env: prod + link_domain: .c.allapp.link + link_domain_proto: https:// + ladder_host: https://proxy.branchcn.com:8977 + ads_domain: .allappf.link + ads_domain_proto: https:// + ads_jump: "https://moads.allapp.link/ad" +alert: + feishu: + url: "https://open.feishu.cn/open-apis/bot/v2/hook/ffc935d6-698a-4206-9781-cd5d11a1378c" + secret: "apxjmywNPecErVM04hGBrc" + scenes: + - { url: "https://open.feishu.cn/open-apis/bot/v2/hook/3c3b0907-7fe3-47bd-951e-1ff4f995fd5c", secret: "O8mHHEkKBjN3H95XuVWW3g", scene: "normal" } + - { url: "https://open.feishu.cn/open-apis/bot/v2/hook/bc93441a-ffb8-429e-985c-9c952758ebb8", secret: "MzYOBFmnDMNM0s1SUo3GQh", scene: "notice" } +upload: + endpoint: "https://oss-cn-shenzhen.aliyuncs.com" + upload_url: "https://client-project-resource.oss-cn-shenzhen.aliyuncs.com" + access_key: "LTAI5tNvMLF181bTb3qCZxk4" + secret: "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A" + bucket_name: "client-project-resource" + prefix: "resource/" + host: "https://i1.branchcn.com" diff --git a/etc/config-test.yaml b/etc/config-test.yaml new file mode 100644 index 0000000..0085e02 --- /dev/null +++ b/etc/config-test.yaml @@ -0,0 +1,49 @@ +database: + url: root:branchcn_dev2@2023@tcp(120.79.90.126:3307)/dplk_db?charset=utf8mb4&parseTime=True&loc=Local + max_idle_conn: 100 + max_open_conn: 100 + conn_max_lifetime: 1h0m0s + slow_threshold: 300ms +etcd: + address: + - 127.0.0.1:2379 +kafka: + brokers: + - 127.0.0.1:9093 +logger: + std_out: true + file_out: true + path: ./logs/server.log + max_size: 10 + max_backups: 5 + max_age: 30 + compress: false +redis: + addr: 127.0.0.1:6379 + password: secret_redis + db: 0 + sentinel: "" + sentinel_master_name: "" +server: + env: test + link_domain: .c.allapp.link + link_domain_proto: https:// + ladder_host: https://proxy.branchcn.com:8977 + ads_domain: .a.allapp.link + ads_domain_proto: https:// + ads_jump: "https://test-moads.allapp.link/ad" +alert: + feishu: + url: "https://open.feishu.cn/open-apis/bot/v2/hook/747c9575-66cd-4701-a691-cdf544056683" + secret: "KcATHHyFtGp7BUPfRW465e" + scenes: + - { url: "https://open.feishu.cn/open-apis/bot/v2/hook/be94c172-66c7-4915-9eae-4f7a885975a2", secret: "CzWcDpDeEMDnlALJ4E8SUd", scene: "normal" } + - { url: "https://open.feishu.cn/open-apis/bot/v2/hook/be94c172-66c7-4915-9eae-4f7a885975a2", secret: "CzWcDpDeEMDnlALJ4E8SUd", scene: "notice" } +upload: + endpoint: "https://oss-cn-shenzhen.aliyuncs.com" + upload_url: "https://client-project-resource.oss-cn-shenzhen.aliyuncs.com" + access_key: "LTAI5tNvMLF181bTb3qCZxk4" + secret: "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A" + bucket_name: "client-project-resource" + prefix: "resource/" + host: "https://i1.branchcn.com" \ No newline at end of file diff --git a/etc/etc.yaml b/etc/etc.yaml new file mode 100755 index 0000000..caa55a0 --- /dev/null +++ b/etc/etc.yaml @@ -0,0 +1,32 @@ +alert: + feishu: + url: "" + secret: "" +database: + url: root:123456@tcp(127.0.0.1:3306)/dplk_db?charset=utf8mb4&parseTime=True&loc=Local + max_idle_conn: 100 + max_open_conn: 100 + conn_max_lifetime: 1h0m0s + slow_threshold: 300ms +etcd: + address: + - 127.0.0.1:2379 +kafka: + brokers: + - 127.0.0.1:9093 +logger: + std_out: true + file_out: true + path: ./logs/server.log + max_size: 10 + max_backups: 5 + max_age: 30 + compress: false +redis: + addr: 127.0.0.1:6379 + password: secret_redis + db: 0 + sentinel: "" + sentinel_master_name: "" +server: + service_name: joybuywork diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8f9ce0e --- /dev/null +++ b/go.mod @@ -0,0 +1,136 @@ +module joybuywork + +go 1.23.0 + +require ( + joybuywork/proto/go_proto v0.0.0-00010101000000-000000000000 + github.com/Shopify/sarama v1.38.1 + github.com/alexandrevicenzi/unchained v1.3.0 + github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible + github.com/bwmarrin/snowflake v0.3.0 + github.com/go-redis/redis/v8 v8.11.5 + github.com/golang-jwt/jwt/v5 v5.2.1 + github.com/golang-module/carbon/v2 v2.2.3 + github.com/orcaman/concurrent-map/v2 v2.0.1 + github.com/panjf2000/ants/v2 v2.10.0 + github.com/robfig/cron/v3 v3.0.1 + github.com/rs/xid v1.5.0 + github.com/shopspring/decimal v1.4.0 + github.com/sony/sonyflake v1.2.1 + github.com/valyala/fasthttp v1.48.0 + github.com/xuri/excelize/v2 v2.8.0 + gits.branchcn.com/backend/certified/proto/go_proto v0.0.0-20260615071616-c023fd0c5586 + gits.branchcn.com/backend/deepai/proto/go_proto v0.0.0-20260311111512-9ae266ff282b + gits.branchcn.com/backend/deeplink/proto/go_proto v0.0.0-20250818063346-f60f47f335af + gits.branchcn.com/backend/joybuywork/proto/go_proto v0.0.0-20250401063414-20cf6e26db1a + gits.branchcn.com/backend/fissionbi/proto/go_proto v0.0.0-20260528070429-e19531fb99fa + gits.branchcn.com/backend/microcode/micro v0.0.0-20250328073905-6ff169811aa1 + gits.branchcn.com/backend/microcode/plugins v0.0.0-20250918022229-32994257abc5 + gits.branchcn.com/backend/oplatform/proto/go_proto v0.0.0-20250402095105-d679a51b4c9f + gits.branchcn.com/backend/shortlink/proto/go_proto v0.0.0-20230831015347-65eb821f4a0e + gits.branchcn.com/backend/taskcenter/proto/go_proto v0.0.0-20260810091734-b7661d6d0055 + go-micro.dev/v4 v4.11.0 + go.etcd.io/etcd/api/v3 v3.5.15 + go.etcd.io/etcd/client/v3 v3.5.15 + go.uber.org/atomic v1.7.0 + go.uber.org/zap v1.24.0 + gopkg.in/yaml.v3 v3.0.1 + gorm.io/datatypes v1.2.4 + gorm.io/gen v0.3.27 + gorm.io/gorm v1.25.11 + gorm.io/plugin/dbresolver v1.5.0 +) + +require ( + filippo.io/edwards25519 v1.1.0 // indirect + github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect + github.com/acomagu/bufpipe v1.0.3 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect + github.com/bitly/go-simplejson v0.5.0 // indirect + github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/eapache/go-resiliency v1.3.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect + github.com/eapache/queue v1.1.0 // indirect + github.com/emirpasic/gods v1.12.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-acme/lego/v4 v4.17.4 // indirect + github.com/go-git/gcfg v1.5.0 // indirect + github.com/go-git/go-billy/v5 v5.3.1 // indirect + github.com/go-git/go-git/v5 v5.4.2 // indirect + github.com/go-micro/plugins/v4/client/grpc v1.2.0 // indirect + github.com/go-micro/plugins/v4/registry/etcd v1.2.0 // indirect + github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/gobwas/httphead v0.1.0 // indirect + github.com/gobwas/pool v0.2.1 // indirect + github.com/gobwas/ws v1.4.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/handlers v1.5.2 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/jcmturner/aescts/v2 v2.0.0 // indirect + github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect + github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect + github.com/klauspost/compress v1.16.3 // indirect + github.com/miekg/dns v1.1.62 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/hashstructure v1.1.0 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/natefinch/lumberjack v2.0.0+incompatible // indirect + github.com/nxadm/tail v1.4.8 // indirect + github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/pierrec/lz4/v4 v4.1.17 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/richardlehane/mscfb v1.0.4 // indirect + github.com/richardlehane/msoleps v1.0.3 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sergi/go-diff v1.1.0 // indirect + github.com/urfave/cli/v2 v2.27.2 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/xanzy/ssh-agent v0.3.0 // indirect + github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect + github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca // indirect + github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.15 // indirect + go.uber.org/multierr v1.6.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.26.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/grpc v1.63.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect + gorm.io/driver/mysql v1.5.6 // indirect + gorm.io/hints v1.1.0 // indirect +) + +replace joybuywork/proto/go_proto => ./proto/go_proto diff --git a/internal/app/ads.go b/internal/app/ads.go new file mode 100644 index 0000000..c36fddf --- /dev/null +++ b/internal/app/ads.go @@ -0,0 +1,242 @@ +package app + +import ( + "crypto/sha1" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "encoding/hex" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "runtime" + "sync" +) + +type Ads struct { + lc sync.RWMutex + Ad Ad +} + +type Ad struct { + Webs []*Web `json:"webs"` + Accounts struct { + Test string `json:"test"` + Prod string `json:"prod"` + } `json:"accounts"` +} + +type Web struct { + Host string `json:"host"` + Uris []struct { + Uri string `json:"uri"` + } `json:"uris"` +} + +var ads = &Ads{} + +// AdsInit 初始化数据 +func AdsInit(yun string) (err error) { + var data []byte + if yun == "" { + filename := fmt.Sprintf("%s/ads_%s.json", GetAdsFilePath(), config.Config.Server.Env) + data, err = os.ReadFile(filename) + if err != nil { + return + } + } else { + var resp *http.Response + resp, err = http.Get(yun) + if err != nil { + return + } + defer resp.Body.Close() + + data, err = io.ReadAll(resp.Body) + if err != nil { + return + } + } + + ads.lc.Lock() + ads.Ad = Ad{} + err = jsonm.Unmarshal(data, &ads.Ad) + ads.lc.Unlock() + + err = jsonm.Unmarshal([]byte(j1), &ads1.Ad) + err = jsonm.Unmarshal([]byte(j2), &ads2.Ad) + + return +} + +// jr +var ids1 = []int64{143, 374} +var ads1 = &Ads{} +var j1 = `{ + "accounts": { + "test": "ca-pub-2821871715805907", + "prod": "ca-pub-2821871715805907" + }, + "webs": [ + { + "host": "https://moads-r.allapp.link", + "uris": [ + { + "uri": "/business/helldivers-2-and-dead-island-2-support-studio-toadman-interactive-confirms-layoffs/" + }, + { + "uri": "/business/report-until-dawn-remake-developer-ballistic-moon-is-making-layoffs/" + }, + { + "uri": "/business/creative-uks-latest-fund-offers-up-to-25k-to-north-east-teams/" + }, + { + "uri": "/business/new-steam-tweaks-let-devs-highlight-related-games-and-dlc-on-store-pages/" + }, + { + "uri": "/business/mental-health-in-games-charity-take-this-is-facing-extinction/" + }, + { + "uri": "/finance/yes-network-msg-networks-to-launch-combined-new-york-regional-sports-app/" + }, + { + "uri": "/finance/nvidia-announces-50-billion-stock-buyback/" + }, + { + "uri": "/finance/nvidia-reports-122-revenue-growth-on-surging-demand-for-data-center-chips/" + }, + { + "uri": "/finance/ford-joins-list-of-companies-walking-back-dei-policies/" + }, + { + "uri": "/finance/lego-revenue-jumps-13-in-first-half-of-2024-boosted-by-lego-fortnite-and-diverse-brick-sets/" + }, + { + "uri": "/finance/nordstrom-shares-climb-5-as-earnings-top-estimates-but-retailer-issues-cautious-guidance/" + }, + { + "uri": "/news/civilization-7-interview-firaxis-answers-all-of-our-questions-about-the-anticipated-sequel-gamescom-2024/" + }, + { + "uri": "/news/crimson-desert-is-like-god-of-war-and-dragons-dogma-had-a-baby-gamescom-2024/" + }, + { + "uri": "/news/borderlands-4-announced-with-teaser-trailer-at-opening-night-live-gamescom-2024/" + }, + { + "uri": "/news/indiana-jones-and-the-great-circle-finally-gets-a-release-date-for-xboxand-playstation-gamescom-2024/" + }, + { + "uri": "/news/secret-level-every-video-game-in-the-new-gamescom-trailer/" + }, + { + "uri": "/news/ign-uk-podcast-762-the-best-of-gamescom-2024/" + } + ] + } + ] +}` + +// dhg +var ids2 = []int64{361} +var ads2 = &Ads{} +var j2 = `{ + "accounts": { + "test": "ca-pub-2821871715805907", + "prod": "ca-pub-2821871715805907" + }, + "webs": [ + { + "host": "https://moads-dh.branchcn.com", + "uris": [ + { + "uri": "/post/the-cost-of-temptation/" + }, + { + "uri": "/post/the-temptation-within-a-tale-of-infidelity/" + }, + { + "uri": "/unexpected-encounter/sweet-deceptions-the-story-of-athena-and-dax/" + } + ] + } + ] +}` + +// AdsRandOne 随便选一个 +func AdsRandOne(prod bool, projectId int64) (act, host, uri string) { + var obj = ads + for _, id := range ids1 { + if id == projectId { + obj = ads1 + break + } + } + + for _, id := range ids2 { + if id == projectId { + obj = ads2 + break + } + } + + obj.lc.RLock() + defer obj.lc.RUnlock() + if prod { + act = obj.Ad.Accounts.Prod + } else { + act = obj.Ad.Accounts.Test + } + + var hostMap = make(map[string]*Web, len(obj.Ad.Webs)) + for _, web := range obj.Ad.Webs { + hostMap[web.Host] = web + } + + for _, web := range hostMap { + host = web.Host + + var uriMap = make(map[string]struct{}, len(web.Uris)) + for _, v := range web.Uris { + uriMap[v.Uri] = struct{}{} + } + + for v := range uriMap { + uri = v + break + } + return + } + + return +} + +const ens = "cr6798rdervj4d3ekub0" + +func Encode(userId, event, key, val string, t int64) string { + v := fmt.Sprintf("%s:%s:%s:%s:%d:%s", userId, event, key, val, t, ens) + + hash := sha1.New() + hash.Write([]byte(v)) + b := hash.Sum(nil) + + return hex.EncodeToString(b) +} + +func TokenOk(token, userId, event, key, val string, t int64) bool { + return token == Encode(userId, event, key, val, t) +} + +// GetAdsFilePath 获取ads文件路径 +func GetAdsFilePath() string { + if !consts.RunTest { + dir, _ := os.Getwd() + return fmt.Sprintf("%s/asset/ads", dir) + } + + _, filename, _, _ := runtime.Caller(0) + current := filepath.Dir(filename) + return fmt.Sprintf("%s/../../asset/ads", current) +} diff --git a/internal/app/database_gen.go b/internal/app/database_gen.go new file mode 100644 index 0000000..c33fd29 --- /dev/null +++ b/internal/app/database_gen.go @@ -0,0 +1,26 @@ +// Code generated by gen. DO NOT EDIT. +package app + +import ( + "joybuywork/internal/config" + "gits.branchcn.com/backend/microcode/plugins/orm" +) + +var DB orm.Plugin + +func InitDB() (err error) { + dbConfig := orm.PluginConfig{ + URL: config.Config.Database.URL, + MaxIdleConn: config.Config.Database.MaxIdleConn, + MaxOpenConn: config.Config.Database.MaxOpenConn, + ConnMaxLifetime: config.Config.Database.ConnMaxLifetime, + Logger: Logger, + SlowThreshold: config.Config.Database.SlowThreshold, + } + DB, err = orm.NewPlugin(dbConfig) + if err != nil { + return + } + + return +} diff --git a/internal/app/etcd.go b/internal/app/etcd.go new file mode 100644 index 0000000..477a35e --- /dev/null +++ b/internal/app/etcd.go @@ -0,0 +1,56 @@ +package app + +import ( + "context" + "joybuywork/internal/config" + "time" + + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" +) + +const ( + EtcdPrefix = "/joybuywork" + EtcdConfig = EtcdPrefix + "/config" +) + +var EtcdCli *clientv3.Client + +func InitEtcdCli() (err error) { + EtcdCli, err = clientv3.New(clientv3.Config{ + Endpoints: config.Config.Etcd.Address, + DialTimeout: 10 * time.Second, + }) + + if err != nil { + return + } + + watch() + return +} + +func watch() { + GoSafe(func() { + for { + data, ok := <-EtcdCli.Watch(context.Background(), EtcdConfig, clientv3.WithPrefix(), clientv3.WithPrevKV()) + if !ok || data.Canceled { + FeishuNormalSend("etcd 退出了, 数据 %+v, 错误:%v", data, ok) + return + } + + for _, ev := range data.Events { + switch ev.Type { + case mvccpb.PUT: + switch string(ev.Kv.Key) { + case EtcdConfig + "/ads": + err := AdsInit(string(ev.Kv.Value)) + FeishuNormalSend("重制广告配置[%s],错误:%v", string(ev.Kv.Value), err) + } + + } + } + } + + }) +} diff --git a/internal/app/feishu_gen.go b/internal/app/feishu_gen.go new file mode 100644 index 0000000..af9dcea --- /dev/null +++ b/internal/app/feishu_gen.go @@ -0,0 +1,66 @@ +package app + +import ( + "joybuywork/internal/config" + "fmt" + "gits.branchcn.com/backend/microcode/plugins/alert" +) + +var FeiShu alert.Plugin + +func InitFeiShu() (err error) { + if config.Config.Alert.FeiShu.Url != "" { + alertConfig := alert.PluginConfig{ + Type: alert.PluginConfigTypeFeiShu, + Url: config.Config.Alert.FeiShu.Url, + Secret: config.Config.Alert.FeiShu.Secret, + } + + for _, v := range config.Config.Alert.Scenes { + alertConfig.Scenes = append(alertConfig.Scenes, &alert.Conf{ + Type: alert.PluginConfigTypeFeiShu, + Url: v.Url, + Secret: v.Secret, + Scene: v.Scene, + }) + } + + FeiShu, err = alert.NewPlugin(alertConfig) + } + return +} + +const ( + normal = "normal" + notice = "notice" +) + +// FeishuNormalSend 发送普通消息,这个给自己监听用的 +func FeishuNormalSend(format string, a ...any) { + h, ok := FeiShu.Scenes[normal] + if !ok { + return + } + + if len(a) > 0 { + h.SendText(fmt.Sprintf(format, a...)) + return + } + + h.SendText(format) +} + +// FeishuNoticeSend 发送通知消息,这个是一些业务通知用的 +func FeishuNoticeSend(format string, a ...any) { + h, ok := FeiShu.Scenes[notice] + if !ok { + return + } + + if len(a) > 0 { + h.SendText(fmt.Sprintf(format, a...)) + return + } + + h.SendText(format) +} diff --git a/internal/app/kafka_gen.go b/internal/app/kafka_gen.go new file mode 100644 index 0000000..1018476 --- /dev/null +++ b/internal/app/kafka_gen.go @@ -0,0 +1,20 @@ +// Code generated by gen. DO NOT EDIT. +package app + +import ( + "joybuywork/internal/config" + "gits.branchcn.com/backend/microcode/plugins/kafka" +) + +var Kafka kafka.Plugin + +func InitKafka() (err error) { + kafkaConfig := kafka.PluginConfig{ + Brokers: config.Config.Kafka.Brokers, + } + Kafka, err = kafka.NewPlugin(kafkaConfig) + if err != nil { + return + } + return +} diff --git a/internal/app/lang_data.go b/internal/app/lang_data.go new file mode 100644 index 0000000..46690b4 --- /dev/null +++ b/internal/app/lang_data.go @@ -0,0 +1,155 @@ +package app + +import ( + "joybuywork/internal/consts" + "encoding/json" + "fmt" + "os" + "path/filepath" + "runtime" + "strings" +) + +const ( + FixRewardsIdThank = -1 + FixRewardsIdChallengeFailed = -2 + FixRewardsIdEggFailed = -3 +) + +type FixReward struct { + langKey string + Id int64 `json:"id"` + RewardTitle string `json:"reward_title"` + Langs []*FixRewardLang `json:"langs"` +} + +type FixRewardLang struct { + Title string `json:"title"` + ImgUrl string `json:"img_url"` + Mark string `json:"mark"` + IsDefault bool `json:"is_default"` +} + +var FissionFixRewards []*FixReward + +// LangDataInit 初始化固定奖品 +func LangDataInit() (err error) { + FissionFixRewards = append(FissionFixRewards, &FixReward{ + langKey: "thank", + Id: FixRewardsIdThank, + RewardTitle: "NEXT TIME", + Langs: nil, + }, &FixReward{ + langKey: "challenge_failed", + RewardTitle: "FAILED", + Id: FixRewardsIdChallengeFailed, + Langs: nil, + }, &FixReward{ + langKey: "thank", + Id: FixRewardsIdEggFailed, + RewardTitle: "NEXT TIME", + Langs: nil, + }) + + path := GetI18nFilePath() + entrys, err := os.ReadDir(path) + if err != nil { + return + } + var langMap = make(map[string]map[string]string) + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(path + "/" + entry.Name()) + if err != nil { + return + } + err = json.Unmarshal(b, &ddd) + if err != nil { + return + } + langMap[mark] = ddd + } + + for _, reward := range FissionFixRewards { + imgUrl := consts.TempInfoImgDefaultValue + + switch reward.Id { + case -3: + imgUrl = "ftg/gashapon/default_thank.png" + } + + for mark, ddd := range langMap { + reward.Langs = append(reward.Langs, &FixRewardLang{ + Title: ddd[reward.langKey], + ImgUrl: imgUrl, + Mark: mark, + IsDefault: mark == consts.LangEn, + }) + + TalkMap.set(mark, ddd) + } + + } + + return +} + +type TalkMapType map[string]map[string]string + +var TalkMap TalkMapType = make(map[string]map[string]string) + +func (t TalkMapType) val(lang, mark string) string { + langs, ok := t[lang] + if !ok { + return "" + } + + return langs[mark] +} + +func (t TalkMapType) set(lang string, data map[string]string) { + if _, ok := t[lang]; !ok { + t[lang] = make(map[string]string) + } + for k, v := range data { + switch k { + case "active_talk", "complete_task_talk", "task_reset_talk", "dog_offline_talk": + t[lang][k] = v + } + } +} + +func (t TalkMapType) DogOffline(lang string) string { + return t.val(lang, "dog_offline_talk") +} + +func (t TalkMapType) TaskReset(lang string) string { + return t.val(lang, "task_reset_talk") +} + +func (t TalkMapType) Active(lang string) string { + return t.val(lang, "active_talk") +} + +func (t TalkMapType) CompeteTask(lang string) string { + return t.val(lang, "complete_task_talk") +} + +// GetI18nFilePath 获取i18n文件路径 +func GetI18nFilePath() string { + if !consts.RunTest { + dir, _ := os.Getwd() + return fmt.Sprintf("%s/asset/campaign/lang", dir) + } + + _, filename, _, _ := runtime.Caller(0) + current := filepath.Dir(filename) + return fmt.Sprintf("%s/../../asset/campaign/lang", current) +} diff --git a/internal/app/listener.go b/internal/app/listener.go new file mode 100644 index 0000000..2a42cf1 --- /dev/null +++ b/internal/app/listener.go @@ -0,0 +1,108 @@ +package app + +import ( + "context" + "fmt" + "time" + + cmap "github.com/orcaman/concurrent-map/v2" + + _ "net/http/pprof" +) + +var Listen = NewListener() + +const defaultT = time.Second + +type Listener struct { + ctx context.Context + d time.Duration +} + +func NewListener() *Listener { + return &Listener{ + ctx: context.Background(), + d: defaultT, + } +} + +// Listen 监听 +func (l *Listener) Listen(fn func() (messages []string), ds ...time.Duration) { + d := l.d + if len(ds) > 0 { + d = ds[0] + } + GoSafe(func() { + t := time.NewTicker(d) + defer t.Stop() + for { + select { + case <-l.ctx.Done(): + return + case <-t.C: + + messages := fn() + if len(messages) == 0 { + continue + } + for _, msg := range messages { + FeishuNormalSend(msg) + } + } + } + }) +} + +func (l *Listener) Stop() { + l.ctx.Done() +} + +// ListenPush 全局监听并推送 +func ListenPush(fn func() (messages []string), ds ...time.Duration) { + Listen.Listen(fn, ds...) +} + +var collect = cmap.New[cmap.ConcurrentMap[string, int64]]() + +func InitCollect() { + go func() { + t := time.NewTicker(15 * time.Second) + defer t.Stop() + for { + select { + case <-t.C: + for i := 2; i < 17; i++ { + collect.Remove(fmt.Sprintf("%d", time.Now().Unix()-int64(i))) + } + } + } + }() +} + +func Collect(name string) { + for i := 0; i < 15; i++ { + key := fmt.Sprintf("%d", time.Now().Unix()+int64(i)) + v := cmap.New[int64]() + collect.Upsert(key, v, func(exist bool, valueInMap cmap.ConcurrentMap[string, int64], newValue cmap.ConcurrentMap[string, int64]) cmap.ConcurrentMap[string, int64] { + if !exist { + v.Set(name, 1) + return v + } + + valueInMap.Upsert(name, 1, func(exist bool, valueInMap int64, newValue int64) int64 { + if exist { + return valueInMap + 1 + } + return newValue + }) + + return valueInMap + }) + } +} + +func GetCollect() (cmap.ConcurrentMap[string, int64], bool) { + key := fmt.Sprintf("%d", time.Now().Unix()-1) + + return collect.Pop(key) +} diff --git a/internal/app/logger_gen.go b/internal/app/logger_gen.go new file mode 100644 index 0000000..54e2e54 --- /dev/null +++ b/internal/app/logger_gen.go @@ -0,0 +1,43 @@ +package app + +import ( + "context" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "fmt" + "gits.branchcn.com/backend/microcode/plugins/logger" + "go.uber.org/zap/zapcore" +) + +var Logger logger.Plugin + +func InitLogger() { + loggerConfig := logger.PluginConfig{ + ModeProd: config.Config.Server.Env == "prod", + Level: zapcore.InfoLevel, + StdOut: config.Config.Logger.StdOut, + FileOut: config.Config.Logger.FileOut, + JsonEncode: false, + StackTraceLevel: zapcore.ErrorLevel, + FileConfig: logger.FileConfig{ + Path: config.Config.Logger.Path, + MaxSize: config.Config.Logger.MaxSize, + MaxBackups: config.Config.Logger.MaxBackups, + MaxAge: config.Config.Logger.MaxAge, + LocalTime: true, + Compress: config.Config.Logger.Compress, + }, + AlarmWriter: FeiShu.Alert, + Env: config.Config.Server.Env, + ContextTraceKey: consts.TraceIdKey, + ContextKey: []string{consts.CtxReqId, consts.CtxBootId, consts.CtxMsgId}, + } + Logger = logger.NewPlugin(loggerConfig) + +} + +func TryCatch(ctx context.Context, msg string) { + if err := recover(); err != nil { + Logger.Error(ctx, fmt.Sprintf("%s, 错误信息:%v", msg, err)) + } +} diff --git a/internal/app/micro.go b/internal/app/micro.go new file mode 100644 index 0000000..c819189 --- /dev/null +++ b/internal/app/micro.go @@ -0,0 +1,169 @@ +package app + +import ( + "joybuywork/internal/server/depend" + + c_fuserpb "gits.branchcn.com/backend/certified/proto/go_proto/c_fuser" + c_guserpb "gits.branchcn.com/backend/certified/proto/go_proto/c_guser" + c_userpb "gits.branchcn.com/backend/certified/proto/go_proto/c_user" + chatpb "gits.branchcn.com/backend/deepai/proto/go_proto/ai_chat" + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" + deventpb "gits.branchcn.com/backend/deeplink/proto/go_proto/devent" + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + analyzepb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_analyze" + factionpb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_fission_action" + oprojectpb "gits.branchcn.com/backend/oplatform/proto/go_proto/oproject" + linkpb "gits.branchcn.com/backend/shortlink/proto/go_proto/link" + t_centerpb "gits.branchcn.com/backend/taskcenter/proto/go_proto/t_center" + t_center_statpb "gits.branchcn.com/backend/taskcenter/proto/go_proto/t_center_stat" +) + +const ( + certifiedName = "certified" + deepLinkName = "deeplink" + shortLinkName = "shortlink" + fissionBiName = "fissionbi" + oplatformName = "oplatform" + deepAiName = "deepai" + taskcenterName = "taskcenter" +) + +func InitMicro() { + certified = certifiedService{ + cUser: c_userpb.NewCUserService(certifiedName, depend.M.Client()), + fUser: c_fuserpb.NewCFUserService(certifiedName, depend.M.Client()), + gUser: c_guserpb.NewCGUserService(certifiedName, depend.M.Client()), + } + + deepLink = deepLinkService{ + link: dlinkpb.NewDLinkService(deepLinkName, depend.M.Client()), + event: deventpb.NewDEventService(deepLinkName, depend.M.Client()), + device: ddevicepb.NewDDeviceService(deepLinkName, depend.M.Client()), + } + + shortLink = shortLinkService{ + link: linkpb.NewLinkService(shortLinkName, depend.M.Client()), + } + + fissionBi = fissionBiService{ + analyze: analyzepb.NewBiAnalyzeService(fissionBiName, depend.M.Client()), + faction: factionpb.NewBiFissionActionService(fissionBiName, depend.M.Client()), + } + oplatform = oplatformService{ + oproject: oprojectpb.NewOProjectService(oplatformName, depend.M.Client()), + } + + deepAi = deepAiService{ + chat: chatpb.NewChatService(deepAiName, depend.M.Client()), + } + + taskcenter = taskcenterService{ + center: t_centerpb.NewTCenterService(taskcenterName, depend.M.Client()), + centerStat: t_center_statpb.NewTCenterStatService(taskcenterName, depend.M.Client()), + } +} + +// 认证 +type certifiedService struct { + cUser c_userpb.CUserService + fUser c_fuserpb.CFUserService + gUser c_guserpb.CGUserService +} + +var certified certifiedService + +func NewCertifiedUser() c_userpb.CUserService { + return certified.cUser +} + +func NewCertifiedFUser() c_fuserpb.CFUserService { + return certified.fUser +} + +func NewCertifiedGUser() c_guserpb.CGUserService { + return certified.gUser +} + +// 深度链接 +type deepLinkService struct { + link dlinkpb.DLinkService + event deventpb.DEventService + device ddevicepb.DDeviceService +} + +var deepLink deepLinkService + +func NewDeepLinkLink() dlinkpb.DLinkService { + return deepLink.link +} + +func NewDeepLinkEvent() deventpb.DEventService { + return deepLink.event +} + +func NewDeepLinkDevice() ddevicepb.DDeviceService { + return deepLink.device +} + +// 短链 +type shortLinkService struct { + link linkpb.LinkService +} + +var shortLink shortLinkService + +func NewShortLinkNameLink() linkpb.LinkService { + return shortLink.link +} + +// 玩法报表 +type fissionBiService struct { + analyze analyzepb.BiAnalyzeService + faction factionpb.BiFissionActionService +} + +var fissionBi fissionBiService + +func NewFissionBiAnalyze() analyzepb.BiAnalyzeService { + return fissionBi.analyze +} + +func NewFissionBiFissionAction() factionpb.BiFissionActionService { + return fissionBi.faction +} + +// 开放平台 +type oplatformService struct { + oproject oprojectpb.OProjectService +} + +var oplatform oplatformService + +func NewOProject() oprojectpb.OProjectService { + return oplatform.oproject +} + +type deepAiService struct { + chat chatpb.ChatService +} + +var deepAi deepAiService + +func NewDeepAiChat() chatpb.ChatService { + return deepAi.chat +} + +type taskcenterService struct { + centerStat t_center_statpb.TCenterStatService + center t_centerpb.TCenterService +} + +var taskcenter taskcenterService + +func NewTaskcenterCenterStat() t_center_statpb.TCenterStatService { + return taskcenter.centerStat +} + +func NewTaskcenterCenter() t_centerpb.TCenterService { + return taskcenter.center +} diff --git a/internal/app/pprof_collector.go b/internal/app/pprof_collector.go new file mode 100644 index 0000000..85a00c6 --- /dev/null +++ b/internal/app/pprof_collector.go @@ -0,0 +1,159 @@ +package app + +import ( + "bytes" + "context" + "joybuywork/internal/consts" + "encoding/json" + "fmt" + "net" + "runtime" + "runtime/pprof" + "time" +) + +var Info ServiceInfo + +func SetUpCollector() { + Info = ServiceInfo{ + Name: consts.ServiceName, + NodeId: fmt.Sprint(NodeId), + GoVersion: runtime.Version(), + StartAt: time.Now().Unix(), + LastReportAt: time.Now().Unix(), + Ip: GetLocalIP(), + } + +} + +type PProfCollector struct { +} + +// 初始化采集器 +func NewPProfCollector() *PProfCollector { + return &PProfCollector{} +} + +// 采集运行时指标 +func (c *PProfCollector) collectRuntimeMetrics() map[string]any { + var memStats runtime.MemStats + runtime.ReadMemStats(&memStats) + + return map[string]any{ + "timestamp": time.Now().Unix(), + "heap_alloc": memStats.HeapAlloc, // 当前堆内存分配(字节) + "heap_sys": memStats.HeapSys, // 堆内存总申请量 + "goroutines": runtime.NumGoroutine(), // Goroutine 数量 + "gc_count": memStats.NumGC, // GC 次数 + "gc_pause_ns": memStats.PauseTotalNs, // GC 总暂停时间(纳秒) + } +} + +// 采集 Heap Profile 并存储到 Redis +func (c *PProfCollector) saveHeapProfile() { + var buf bytes.Buffer + if err := pprof.WriteHeapProfile(&buf); err != nil { + Logger.Error(context.Background(), fmt.Sprintf("Failed to collect heap profile: %v", err)) + return + } + + // 存储为 Redis String(二进制数据) + key := fmt.Sprintf("joybuywork:app:heap:%v:%s", NodeId, time.Now().Format("20060102_1504")) + if err := Redis.Cache.Set(context.Background(), key, buf.Bytes(), 30*time.Minute).Err(); err != nil { + Logger.Error(context.Background(), fmt.Sprintf("Failed to save heap profile to Redis: %v", err)) + } else { + Logger.Info(context.Background(), fmt.Sprintf("Heap profile saved: %s", key)) + } +} + +// 采集 CPU Profile(需谨慎,仅在必要时启用) +func (c *PProfCollector) saveCPUProfile(duration time.Duration) { + + var buf bytes.Buffer + if err := pprof.StartCPUProfile(&buf); err != nil { + Logger.Error(context.Background(), fmt.Sprintf("Failed to start CPU profile: %v", err)) + return + } + time.Sleep(duration) + pprof.StopCPUProfile() + + key := fmt.Sprintf("joybuywork:app:cpu:%v:%s", NodeId, time.Now().Format("20060102_1504")) + if err := Redis.Cache.Set(context.Background(), key, buf.Bytes(), 30*time.Minute).Err(); err != nil { + Logger.Error(context.Background(), fmt.Sprintf("Failed to save CPU profile to Redis: %v", err)) + } else { + Logger.Info(context.Background(), fmt.Sprintf("CPU profile saved: %s", key)) + } +} + +// 存储运行时指标到 Redis(JSON 格式) +func (c *PProfCollector) saveRuntimeMetrics() { + ctx := context.Background() + + // 指标存储 + metrics := c.collectRuntimeMetrics() + jsonData, err := json.Marshal(metrics) + if err != nil { + Logger.Error(ctx, fmt.Sprintf("Failed to marshal metrics: %v", err)) + return + } + + key := fmt.Sprintf("joybuywork:app:metrics:%v:%s", NodeId, time.Now().Format("20060102")) + if err := Redis.Cache.HSet(context.Background(), key, time.Now().Format("1504"), jsonData).Err(); err != nil { + Logger.Error(context.Background(), fmt.Sprintf("Failed to save metrics to Redis: %v", err)) + } else { + Redis.Cache.Expire(ctx, key, 24*time.Hour) + Logger.Info(context.Background(), fmt.Sprintf("Metrics saved: %s", key)) + } +} + +// 启动定时采集任务 +func (c *PProfCollector) Start() { + c.saveRuntimeMetrics() + c.saveHeapProfile() + c.saveCPUProfile(30 * time.Second) // 可选:采集 10 秒 CPU 数据 +} + +type ServiceInfo struct { + Name string `json:"name"` //服务名称 + NodeId string `json:"node_id"` //节点id + GoVersion string `json:"go_version"` //GO版本 + StartAt int64 `json:"start_at"` //启动时间戳 + LastReportAt int64 `json:"last_report_at"` //最后上报时间戳 + Ip string `json:"ip"` +} + +func HeartBeat() { + ctx := context.Background() + // 服务存储 + Info.LastReportAt = time.Now().Unix() + jsonInfo, err := json.Marshal(Info) + if err != nil { + Logger.Error(ctx, fmt.Sprintf("Failed to collect service info to json: %v\n", err)) + return + } + + infokey := fmt.Sprintf("service_info:%s", Info.Name) + err = Redis.Cache.HSet(ctx, infokey, Info.NodeId, string(jsonInfo)).Err() + if err != nil { + Logger.Error(ctx, fmt.Sprintf("Failed to report service info to Redis: %v\n", err)) + } + Redis.Cache.Expire(ctx, infokey, 1*time.Hour) +} + +func GetLocalIP() string { + addrs, err := net.InterfaceAddrs() + if err != nil { + return "" + } + + for _, addr := range addrs { + ipNet, ok := addr.(*net.IPNet) + if ok && !ipNet.IP.IsLoopback() { + if ipNet.IP.To4() != nil { + return ipNet.IP.String() + } + } + } + + return "" +} diff --git a/internal/app/redis_expend.go b/internal/app/redis_expend.go new file mode 100644 index 0000000..674a6a5 --- /dev/null +++ b/internal/app/redis_expend.go @@ -0,0 +1,67 @@ +package app + +import ( + "context" + "joybuywork/internal/consts/ckey" + "fmt" + "gits.branchcn.com/backend/microcode/plugins/derivative/bucket" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gits.branchcn.com/backend/microcode/plugins/derivative/progress" + "gits.branchcn.com/backend/microcode/plugins/derivative/task" + "gits.branchcn.com/backend/microcode/plugins/derivative/vercontrol" + "sync" +) + +type SubLock struct { + once sync.Once + lock *lock.SubLock +} + +var subLock = &SubLock{} + +// InitSubLock 初始化关注锁 +func InitSubLock() { + subLock.once.Do(func() { + subLock.lock = lock.NewSubLock(context.Background(), Redis.Cache, ckey.SubLockCommon(), lock.SetLogger(RedisLog{})) + }) +} + +// NewFollower redis订阅锁记录 +func NewFollower(ctx context.Context, key string, opts ...lock.Option) *lock.Follower { + return subLock.lock.NewFollower(ctx, key, opts...) +} + +// NewRedisLock redis锁记录 +func NewRedisLock(ctx context.Context, key string, opts ...lock.Option) *lock.RedisLock { + return lock.NewRedisLock(ctx, Redis.Cache, key, opts...) +} + +// NewLastingBucket redis桶 +func NewLastingBucket(ctx context.Context, key string, val bucket.Value, opts ...bucket.LastingOption) *bucket.LastingBucket { + return bucket.NewLastingBucket(ctx, Redis.Cache, key, val, opts...) +} + +// NewRedisProgress redis进度 +func NewRedisProgress(ctx context.Context, key string, opts ...progress.Option) *progress.Progress { + return progress.NewRedisProgress(ctx, Redis.Cache, key, opts...) +} + +// NewRedisTask redis任务 +func NewRedisTask(ctx context.Context, key string) *task.RedisTask { + return task.NewRedisTask(ctx, Redis.Cache, key) +} + +// NewVerControl redis版本 +func NewVerControl(ctx context.Context, key string, opts ...vercontrol.Option) *vercontrol.VerControl { + return vercontrol.NewRedisVerControl(ctx, Redis.Cache, key, opts...) +} + +type RedisLog struct { +} + +func (RedisLog) Print(ctx context.Context, format string, args ...interface{}) { + Logger.Info(ctx, fmt.Sprintf(format, args...)) +} +func (RedisLog) Panic(ctx context.Context, format string, args ...interface{}) { + Logger.Error(ctx, fmt.Sprintf(format, args...)) +} diff --git a/internal/app/redis_gen.go b/internal/app/redis_gen.go new file mode 100644 index 0000000..5ca0570 --- /dev/null +++ b/internal/app/redis_gen.go @@ -0,0 +1,21 @@ +// Code generated by gen. DO NOT EDIT. +package app + +import ( + "joybuywork/internal/config" + "gits.branchcn.com/backend/microcode/plugins/cache" +) + +var Redis cache.Plugin + +func InitRedis() (err error) { + cacheConfig := cache.PluginConfig{ + Host: config.Config.Redis.Addr, + Password: config.Config.Redis.Password, + DbNum: config.Config.Redis.DB, + Sentinel: config.Config.Redis.Sentinel, + SentinelMasterName: config.Config.Redis.SentinelMasterName, + } + Redis, err = cache.NewPlugin(cacheConfig) + return +} diff --git a/internal/app/snowflake.go b/internal/app/snowflake.go new file mode 100644 index 0000000..b3b8ea7 --- /dev/null +++ b/internal/app/snowflake.go @@ -0,0 +1,72 @@ +package app + +import ( + "context" + "sync" + "time" + + "github.com/bwmarrin/snowflake" +) + +var SnowFlakeNode *snowflake.Node +var SnowFlake11Node *snowflake11 +var NodeId int64 + +func InitNode() (err error) { + NodeId, err = Redis.Incr(context.Background(), "joybuywork:snow_flake_node") + if err != nil { + return + } + NodeId = NodeId % 1000 + snowflake.Epoch = 1687190400000 + SnowFlakeNode, _ = snowflake.NewNode(NodeId) + + SnowFlake11Node = newSnowflake11(NodeId) + return +} + +const ( + epoch = 1609459200000 // 2021-01-01 00:00:00 UTC + nodeBits = 4 // 节点ID位数 + stepBits = 7 // 序列号位数 +) + +type snowflake11 struct { + mu sync.Mutex + node int64 + step int64 + time int64 +} + +func newSnowflake11(node int64) *snowflake11 { + return &snowflake11{ + node: node % (1 << nodeBits), + } +} + +func (s *snowflake11) ID() int64 { + s.mu.Lock() + defer s.mu.Unlock() + + now := time.Now().UnixNano() / 1e6 // 毫秒时间戳 + + if s.time == now { + s.step = (s.step + 1) & ((1 << stepBits) - 1) + if s.step == 0 { + for now <= s.time { + now = time.Now().UnixNano() / 1e6 + } + } + } else { + s.step = 0 + } + + s.time = now + + // 组成11位ID: 时间差(24位) + 节点(4位) + 序列号(7位) + // 但实际计算会压缩到11位十进制 + id := (now-epoch)<<(nodeBits+stepBits) | (s.node << stepBits) | s.step + + // 转换为11位十进制数 + return id % 1e11 +} diff --git a/internal/app/thread.go b/internal/app/thread.go new file mode 100644 index 0000000..339d21d --- /dev/null +++ b/internal/app/thread.go @@ -0,0 +1,59 @@ +package app + +import ( + "context" + "fmt" + "github.com/panjf2000/ants/v2" +) + +type AntsLog struct { +} + +func (AntsLog) Printf(format string, args ...interface{}) { + Logger.Error(context.Background(), fmt.Sprintf(format, args...)) +} + +// 队列消费者池 +var QueueConsumerPool, _ = ants.NewMultiPool( + 50, // 50个池 + 60, // 每个池60个任务 + ants.RoundRobin, + ants.WithPreAlloc(true), + ants.WithPanicHandler(func(i interface{}) { + Logger.Error(context.Background(), fmt.Sprintf("ants task panic: %v", i)) + }), + ants.WithLogger(AntsLog{}), +) + +func GoSafe(fn func(), msg ...any) { + go func() { + defer func() { + if re := recover(); re != nil { + //协程异常捕捉及重试 + if len(msg) > 0 { + Logger.Error(context.Background(), fmt.Sprint(fmt.Sprint(msg...), fmt.Sprintf("协程捕捉到异常:%v", re))) + } else { + Logger.Error(context.Background(), fmt.Sprintf("协程捕捉到异常:%v", re)) + } + } + }() + fn() + }() +} + +func GoSafeRetry(fn func(), retryFn func(), msg ...any) { + go func() { + defer func() { + if re := recover(); re != nil { + //协程异常捕捉及重试 + if len(msg) > 0 { + Logger.Error(context.Background(), fmt.Sprint(fmt.Sprint(msg...), fmt.Sprintf("协程捕捉到异常:%v", re))) + } else { + Logger.Error(context.Background(), fmt.Sprintf("协程捕捉到异常:%v", re)) + } + retryFn() + } + }() + fn() + }() +} diff --git a/internal/boot/boot.go b/internal/boot/boot.go new file mode 100644 index 0000000..1602ae3 --- /dev/null +++ b/internal/boot/boot.go @@ -0,0 +1,148 @@ +package boot + +import ( + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/repository/dao" + "joybuywork/internal/server" + "joybuywork/internal/service/crons" + "joybuywork/internal/service/queue/consumer" + "joybuywork/internal/service/queue/consumer/campaignnotice" + "joybuywork/internal/service/queue/consumer/statcampaign" + "joybuywork/internal/service/queue/delay" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/utils" + "flag" + "fmt" + "time" +) + +// Init 初始化活动配置和全局变量 +func Init() (err error) { + + // 启动环境获取 + env := flag.String("env", "local", "environment, can be 'dev', 'test' or 'prod'") + flag.Parse() + + var filePath = config.FilePath{ + ConfigName: fmt.Sprintf("config-%s", *env), + ConfigType: "yaml", + ConfigPath: "./etc", + } + + err = config.LoadConfig(filePath) + if err != nil { + return + } + + //报警推送,一定要先初始化推送再开启日志 + err = app.InitFeiShu() + if err != nil { + return + } + + //日志 + app.InitLogger() + + //mysql + err = app.InitDB() + if err != nil { + return + } + + // 设置dao的数据库 + dao.SetDefault(app.DB.Client) + + //redis + err = app.InitRedis() + if err != nil { + return + } + + err = app.InitNode() + if err != nil { + return + } + + app.InitSubLock() + + // 采集 + app.SetUpCollector() + + err = app.InitEtcdCli() + if err != nil { + return + } + + //kafka + err = app.InitKafka() + if err != nil { + return + } + + //定时任务 + crons.SetUp() + + //队列生产者 + producer.SetUp() + + //队列消费者 + err = queue() + if err != nil { + return + } + + // 固定的奖品数据 + err = app.LangDataInit() + if err != nil { + return + } + + err = app.AdsInit("") + if err != nil { + return + } + + app.InitCollect() + + return +} + +// Run 服务启动 +func Run() { + _ = server.Run() + + // 初始化micro的一些服务 + + app.InitMicro() + + app.FeishuNormalSend("[%s]「%s」[%s] 服务启动", utils.GetIp(), config.Config.Server.Env, consts.ServiceName) +} + +func Shutdown() { + consumer.Stop() + + delay.Stop() + + time.Sleep(5 * time.Second) +} + +func queue() (err error) { + err = campaignnotice.Run() + if err != nil { + return + } + + err = statcampaign.Run() + if err != nil { + return + } + + err = delay.Setup() + if err != nil { + return + } + + return +} diff --git a/internal/boot/listen.go b/internal/boot/listen.go new file mode 100644 index 0000000..37bba85 --- /dev/null +++ b/internal/boot/listen.go @@ -0,0 +1,180 @@ +package boot + +import ( + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/utils" + "fmt" + "runtime" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" +) + +// ListenMysqlLink 监听mysql连接数 +func ListenMysqlLink() { + var cycTimes = 10 + var idx, mysqlLink int + var p90 bool // 是否超过了90% + var p90Time time.Time // 第一次超过90%的时间 + + app.ListenPush(func() (messages []string) { + db, _ := app.DB.Client.DB() + nc := db.Stats().OpenConnections // 当前使用的连接数 + maxConn := config.Config.Database.MaxOpenConn // 最大可使用的连接数 + + percent := float64(nc) / float64(maxConn) // 使用率 + + // 使用率大于90% + if percent > 0.9 && !p90 { + messages = append(messages, fmt.Sprintf("[%s]的mysql连接使用已经超过设置90%%(%d/%d)", utils.GetIp(), nc, maxConn)) + p90 = true + p90Time = time.Now() + } + + // 如果之前是超过90%使用率,现在下降至80%以下 + if p90 && percent < 0.8 { + + // 90%使用率占用超过10秒,会同送消息 + if time.Since(p90Time).Seconds() >= 10 { + messages = append(messages, fmt.Sprintf("[%s]的mysql连接使用已经下降低于80%%(%d/%d), 持续时间%.3f(s)", utils.GetIp(), nc, maxConn, time.Since(p90Time).Seconds())) + } + + // 使用率下降了至正常范围了 + p90 = false + } + + mysqlLink += nc // 每执行一次都加个总数 + idx++ // 叠加次数 + + // 叠加到一个轮循,就推送一次消息 + if idx == cycTimes { + if float64(mysqlLink)/float64(maxConn*cycTimes) > 0.8 && !p90 { + messages = append(messages, fmt.Sprintf("近10秒时间[%s]的mysql连接使用已经超过设置80%%(%d/%d)", utils.GetIp(), mysqlLink, maxConn*cycTimes)) + } + + // 重制一下 + idx, mysqlLink = 0, 0 + } + + return + }) +} + +// ListenSubRedisMap 关注锁的情况 +func ListenSubRedisMap() { + app.ListenPush(func() (messages []string) { + var str = fmt.Sprintf("%s关注锁情况", utils.GetIp()) + l := len(str) + for key, num := range lock.GetSubContent() { + str += fmt.Sprintf("\r\n 关注key:%s,关注剩余数:%d", key, num) + } + + if l == len(str) { + return + } + return []string{str} + }, 30*time.Second) +} + +// ListenQueueConsumerPoolUse 队列携程使用情况 +func ListenQueueConsumerPoolUse() { + var cycTimes = 10 + var idx, mysqlLink int + var p90 bool // 是否超过了90% + var p90Time time.Time // 第一次超过90%的时间 + var maxConn = 5000 + app.ListenPush(func() (messages []string) { + nc := app.QueueConsumerPool.Running() + + percent := float64(nc) / float64(maxConn) // 使用率 + + // 使用率大于90% + if percent > 0.9 && !p90 { + messages = append(messages, fmt.Sprintf("[%s]的队列携程使用已经超过设置90%%(%d/%d)", utils.GetIp(), nc, maxConn)) + p90 = true + p90Time = time.Now() + } + + // 如果之前是超过90%使用率,现在下降至80%以下 + if p90 && percent < 0.8 { + + // 90%使用率占用超过10秒,会同送消息 + if time.Since(p90Time).Seconds() >= 10 { + messages = append(messages, fmt.Sprintf("[%s]的队列携程使用已经下降低于80%%(%d/%d), 持续时间%.3f(s)", utils.GetIp(), nc, maxConn, time.Since(p90Time).Seconds())) + } + + // 使用率下降了至正常范围了 + p90 = false + } + + mysqlLink += nc // 每执行一次都加个总数 + idx++ // 叠加次数 + + // 叠加到一个轮循,就推送一次消息 + if idx == cycTimes { + if float64(mysqlLink)/float64(maxConn*cycTimes) > 0.8 && !p90 { + messages = append(messages, fmt.Sprintf("近10秒时间[%s]的队列携程使用已经超过设置80%%(%d/%d)", utils.GetIp(), mysqlLink, maxConn*cycTimes)) + } + + // 重制一下 + idx, mysqlLink = 0, 0 + } + + return + }) +} + +// ListenMemStats 关注内存情况 +func ListenMemStats() { + var idx int + var clearIdx int + var pushMsg = true + app.ListenPush(func() (messages []string) { + var m runtime.MemStats + runtime.ReadMemStats(&m) + + alloc := float64(m.Alloc) / 1024 / 1024 / 1024 + totalAlloc := float64(m.TotalAlloc) / 1024 / 1024 / 1024 + tSys := float64(m.Sys) / 1024 / 1024 / 1024 + tNumGc := m.NumGC + + if alloc > 0.512 { + idx++ + clearIdx = 0 + + if pushMsg { + ip := utils.GetIp() + data, ok := app.GetCollect() + + var num int64 + var dataMsg string + if ok { + dataMsg += fmt.Sprintf("[%s]\r\n", ip) + for v := range data.IterBuffered() { + dataMsg += fmt.Sprintf("%s: %d; ", v.Key, v.Val) + num += v.Val + } + } + + msg := fmt.Sprintf("[%s], Alloc = %.4f GB, TotalAlloc = %.4f GB, Sys = %.4f GB, NumGC = %v, 近15s业务量:%d", ip, alloc, totalAlloc, tSys, tNumGc, num) + messages = append(messages, msg) + + if dataMsg != "" { + messages = append(messages, dataMsg) + } + } + + if idx == 10 { + pushMsg = false + } + } else { + clearIdx++ + if clearIdx == 300 { + clearIdx, idx, pushMsg = 0, 0, true + } + } + + return + }, time.Second) +} diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..49a1826 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,121 @@ +package config + +import ( + "fmt" + "gopkg.in/yaml.v3" + "os" + "time" +) + +var Config = &AllConfig{} + +// AllConfig 应用程序配置结构体 +type AllConfig struct { + Server ServerConfig `yaml:"server"` + Etcd EtcdConfig `yaml:"etcd"` + Logger LoggerConfig `yaml:"logger"` + Database DatabaseConfig `yaml:"database"` + Redis RedisConfig `yaml:"redis"` + Kafka KafkaConfig `yaml:"kafka"` + Alert AlertConfig `yaml:"alert"` + Upload Oss `yaml:"upload"` //上传配置 +} + +// ServerConfig defines the configuration for the server. +type ServerConfig struct { + Env string `yaml:"env"` // 动环境,取值为 "dev"、"test" 或 "prod",默认为 "dev" + LinkDomain string `yaml:"link_domain"` //链接的域名 + LinkDomainProto string `yaml:"link_domain_proto"` //链接的域名协议 + LadderHost string `yaml:"ladder_host"` //转发地址 + AdsDomain string `yaml:"ads_domain"` //广告活动的域名 + AdsDomainProto string `yaml:"ads_domain_proto"` //广告活动的域名协议 + AdsJump string `yaml:"ads_jump"` //广告策略调整地址 +} + +// EtcdConfig defines the configuration for etcd +type EtcdConfig struct { + Address []string `yaml:"address"` +} + +// LoggerConfig defines the configuration for logging. +type LoggerConfig struct { + StdOut bool `yaml:"std_out"` + FileOut bool `yaml:"file_out"` + Path string `yaml:"path"` + MaxSize int `yaml:"max_size"` + MaxBackups int `yaml:"max_backups"` + MaxAge int `yaml:"max_age"` + Compress bool `yaml:"compress"` +} + +// DatabaseConfig defines the configuration for the database. +type DatabaseConfig struct { + URL string `yaml:"url"` // 数据库连接地址 + MaxIdleConn int `yaml:"max_idle_conn"` // 最大空闲连接数,默认为10 + MaxOpenConn int `yaml:"max_open_conn"` // 最大活动连接数,默认为100 + ConnMaxLifetime time.Duration `yaml:"conn_max_lifetime"` // 连接最大生命周期(单位:秒) 默认为3600 + SlowThreshold time.Duration `yaml:"slow_threshold"` //慢sql警告阈值(单位:毫秒) +} + +// RedisConfig defines the configuration for Redis. +type RedisConfig struct { + Addr string `yaml:"addr"` // Redis连接地址 + Password string `yaml:"password"` // Redis连接密码 + DB int `yaml:"db"` // 连接库 + Sentinel string `yaml:"sentinel"` // 哨兵模式时 哨兵地址,没有则不填 + SentinelMasterName string `yaml:"sentinel_master_name"` // 哨兵模式下master名称,没有则不填 +} + +// KafkaConfig defines the configuration for Kafka. +type KafkaConfig struct { + Brokers []string `yaml:"brokers"` // Kafka连接地址,格式为 "host1:port1,host2:port2,...",也支持多行格式 +} + +// AlertConfig defines the configuration for alerting. +type AlertConfig struct { + FeiShu FeiShuConfig `yaml:"feishu"` // 飞书告警配置 + Scenes []FeiShuScenesConfig `yaml:"scenes"` // 场景配置 +} + +type FeiShuConfig struct { + Url string `yaml:"url"` // 告警地址 + Secret string `yaml:"secret"` // 告警地址密码 +} + +type FeiShuScenesConfig struct { + Url string `yaml:"url"` // 告警地址 + Secret string `yaml:"secret"` // 告警地址密码 + Scene string `yaml:"scene"` //场景 +} + +// FilePath 配置文件路径信息 +type FilePath struct { + ConfigName string // 设置配置文件名 (不需要后缀) + ConfigType string // 设置配置文件类型 + ConfigPath string // 设置配置文件路径 +} + +type Oss struct { + AccessKey string `yaml:"access_key"` //AccessKeyId + Secret string `yaml:"secret"` //AccessKeySecret + UploadUrl string `yaml:"upload_url"` //阿里云上传地址 + Endpoint string `yaml:"endpoint"` //访问 OSS 服务的时候使用的域名 + BucketName string `yaml:"bucket_name"` //存储空间名称 + Prefix string `yaml:"prefix"` //上传文件路径前缀 + Host string `yaml:"host"` //全球访问host +} + +// LoadConfig 从文件中加载配置 +func LoadConfig(filepath FilePath) error { + gByte, err := os.ReadFile(fmt.Sprintf("%v/%v.yaml", filepath.ConfigPath, filepath.ConfigName)) + if err != nil { + panic(err) + } + + err = yaml.Unmarshal(gByte, &Config) // 将读取的配置映射到 Config 结构体中 + if err != nil { + return fmt.Errorf("failed to unmarshal config file: %s", err) + } + + return nil +} diff --git a/internal/consts/ckey/ckey.go b/internal/consts/ckey/ckey.go new file mode 100644 index 0000000..aebdd45 --- /dev/null +++ b/internal/consts/ckey/ckey.go @@ -0,0 +1,54 @@ +package ckey + +import "fmt" + +const ( + ProjectPrefix = "joybuywork:" //项目前缀 + + RedisTableFormat = ProjectPrefix + "redis_table:%s" //redis_table组件缓存format + + TaskPrefix = ProjectPrefix + "task:" + + CronPrefix = ProjectPrefix + "cron:" + + User = ProjectPrefix + "user:" //用户模块前缀 + + Project = ProjectPrefix + "project:" //项目模块前缀 + + Company = ProjectPrefix + "company:" //企业模块前缀 + + Fission = ProjectPrefix + "fission:" //玩法模块前缀 + + Export = ProjectPrefix + "export:" // 导出任务 + + SubLock = ProjectPrefix + "sublock:" // 关注锁 + + DataCache = ProjectPrefix + "data_cache:" // 临时数据缓存 + + Delay = ProjectPrefix + "delay:" // 延时对列 + + Mall = ProjectPrefix + "mall:" //兑换商城模块前缀 + + ProjectUser = ProjectPrefix + "project_user:" //项目用户模块前缀 + + Game = ProjectPrefix + "game:" //游戏模块前缀 +) + +// ForLock 用来做临时锁 +func ForLock(key string) string { + return key + ":for_lock" +} + +// RedisTableKey redis_table组件hash key名称 +func RedisTableKey(key string) string { + return fmt.Sprintf(RedisTableFormat, key) +} + +// ExportKey 导出的缓存key +func ExportKey(hashMark string) string { + return fmt.Sprintf("%s%s", Export, hashMark) +} + +func SubLockCommon() string { + return fmt.Sprintf("%scommon", SubLock) +} diff --git a/internal/consts/ckey/company.go b/internal/consts/ckey/company.go new file mode 100644 index 0000000..cd03a56 --- /dev/null +++ b/internal/consts/ckey/company.go @@ -0,0 +1,17 @@ +package ckey + +import "fmt" + +func CompanyKey(format string, a ...any) string { + return Company + fmt.Sprintf(format, a...) +} + +// CompanyMade 企业 +func CompanyMade(companyId int64, mark string) string { + return CompanyKey("made:%d_%s", companyId, mark) +} + +// CompanyMadeStoreOnce 自定义组件创建标识 +func CompanyMadeStoreOnce(companyId int64, mark string) string { + return CompanyKey("made_store_once:%d_%s", companyId, mark) +} diff --git a/internal/consts/ckey/cron.go b/internal/consts/ckey/cron.go new file mode 100644 index 0000000..c6f925d --- /dev/null +++ b/internal/consts/ckey/cron.go @@ -0,0 +1,115 @@ +package ckey + +import "fmt" + +func cronKey(format string, a ...any) string { + return CronPrefix + fmt.Sprintf(format, a...) +} + +// CronCampaignStart 活动开启 +func CronCampaignStart() string { + return cronKey("campaign_start") +} + +// CronCampaignEnd 活动结束 +func CronCampaignEnd() string { + return cronKey("campaign_end") +} + +// CronCampaignRewardAdd 活动奖品追加库存 +func CronCampaignRewardAdd() string { + return cronKey("campaign_reward_add") +} + +// CronCampaignQuizOpen 有奖竞猜开奖 +func CronCampaignQuizOpen() string { + return cronKey("campaign_quiz_open") +} + +// CronCampaignCompensateReward 活动奖品补偿 +func CronCampaignCompensateReward() string { + return cronKey("campaign_compensate_reward") +} + +// CronNotifyReward 玩法奖品回调 +func CronNotifyReward() string { + return cronKey("notify_reward") +} + +// CronGlobalRewardPushNotify 全局奖品回调 +func CronGlobalRewardPushNotify() string { + return cronKey("global_reward_push_notify") +} + +// CronPushNotify 玩法奖品回调 +func CronPushNotify() string { + return cronKey("push_notify") +} + +// CronStatHour 活动小时统计 +func CronStatHour() string { + return cronKey("stat_hour") +} + +// CronStatDay 活动天统计 +func CronStatDay() string { + return cronKey("stat_day") +} + +// CronCondHour 活条件小时统计 +func CronCondHour() string { + return cronKey("cond_hour") +} + +// CronCondDay 活动条件天统计 +func CronCondDay() string { + return cronKey("cond_day") +} + +// CronAdsDay 广告活动天统计 +func CronAdsDay() string { + return cronKey("ads_day") +} + +// CronAdsHour 广告活动小时统计 +func CronAdsHour() string { + return cronKey("ads_hour") +} + +// CronCampaignPreToTun 预发布转正式发布 +func CronCampaignPreToTun() string { + return cronKey("campaign_pre_to_run") +} + +// CronCampaignCancelReward 活动任务过期奖杯要取消 +func CronCampaignCancelReward() string { + return cronKey("campaign_cancel_reward") +} + +// CronCampaignCoinScene 活动金币池场次追加 +func CronCampaignCoinScene() string { + return cronKey("campaign_coin_scene") +} + +// CronCampaignCoinSceneSettlement 活动金币池场次结算 +func CronCampaignCoinSceneSettlement() string { + return cronKey("campaign_coin_scene_settlement") +} + +// CronErrLog 清理错误日志 +func CronErrLog() string { + return cronKey("err_log") +} + +// CronSlowLog 清理慢业务日志 +func CronSlowLog() string { + return cronKey("slow_log") +} + +func CronMallItemTask() string { + return cronKey("mall_item_task") +} + +func CronProjectUserCoinExpiredTask() string { + return cronKey("project_user_coin_expired_task") +} diff --git a/internal/consts/ckey/data_cache.go b/internal/consts/ckey/data_cache.go new file mode 100644 index 0000000..7833d3a --- /dev/null +++ b/internal/consts/ckey/data_cache.go @@ -0,0 +1,14 @@ +package ckey + +import "fmt" + +func dataCacheKey(format string, a ...any) string { + return DataCache + fmt.Sprintf(format, a...) +} + +func DataUserAppReward(cpnId int64, mark string) string { + if mark == "" { + return dataCacheKey("data_user_app_reward_%d", cpnId) + } + return dataCacheKey("data_user_app_reward_%d:%s", cpnId, mark) +} diff --git a/internal/consts/ckey/delay.go b/internal/consts/ckey/delay.go new file mode 100644 index 0000000..0b868d3 --- /dev/null +++ b/internal/consts/ckey/delay.go @@ -0,0 +1,11 @@ +package ckey + +import "fmt" + +func delayKey(format string, a ...any) string { + return Delay + fmt.Sprintf(format, a...) +} + +func DelayCommonKey() string { + return delayKey("common") +} diff --git a/internal/consts/ckey/fission.go b/internal/consts/ckey/fission.go new file mode 100644 index 0000000..1d066d9 --- /dev/null +++ b/internal/consts/ckey/fission.go @@ -0,0 +1,615 @@ +package ckey + +import "fmt" + +func fissionKey(format string, a ...any) string { + return Fission + fmt.Sprintf(format, a...) +} + +// FissionTempGroupStoreOnce 保证mark同时创建一个 +func FissionTempGroupStoreOnce(mark string) string { + return fissionKey("temp_group_store_once:%s", mark) +} + +// FissionUserStoreOnce 保证一个用户ID同时创建一个 +func FissionUserStoreOnce(campaignId int64, subUserId string) string { + return fissionKey("user_store_once:%d_%s", campaignId, subUserId) +} + +// FissionUserPlayOnce 保证一个只能有一个用户访问玩家接口 +func FissionUserPlayOnce(userId int64) string { + return fissionKey("user_play_once:%d", userId) +} + +// FissionUserStoreDeviceOnce 保证一个deviceID同时创建一个 +func FissionUserStoreDeviceOnce(campaignId int64, deviceId string) string { + return fissionKey("user_store_device_once:%d_%s", campaignId, deviceId) +} + +// FissionCampaignRewardLimitPool 活动总领奖限制池 +func FissionCampaignRewardLimitPool(campaignId int64) string { + return fissionKey("campaign_reward_limit_pool:%d", campaignId) +} + +// FissionCampaignPool 活动总领奖限制池(新) +func FissionCampaignPool(campaignId int64) string { + return fissionKey("campaign_pool:%d", campaignId) +} + +// FissionCampaignRewardPool 活动奖品池 +func FissionCampaignRewardPool(rewardId int64) string { + return fissionKey("campaign_reward_pool:%d", rewardId) +} + +// FissionCampaignPreRewardPool 活动预发放奖品池 +func FissionCampaignPreRewardPool(rewardId int64) string { + return fissionKey("campaign_reward_pre_pool:%d", rewardId) +} + +// FissionUserLotteryOnce 参与用户抽奖只能有一个在抽 +func FissionUserLotteryOnce(userId int64) string { + return fissionKey("user_lottery_once:%d", userId) +} + +// FissionUserAnswerOnce 参与用户答题只能有一个在答 +func FissionUserAnswerOnce(userId int64) string { + return fissionKey("user_answer_once:%d", userId) +} + +// FissionUserVoteOnce 参与用户投票只能有一个在投 +func FissionUserVoteOnce(userId int64) string { + return fissionKey("user_vote_once:%d", userId) +} + +// FissionUserInviteStat 参与用户邀请统计 +func FissionUserInviteStat(userId int64) string { + return fissionKey("user_invite_stat:%d", userId) +} + +// FissionUserTaskValidStat 参与用户任务有效统计 +func FissionUserTaskValidStat(userId, taskId int64) string { + return fissionKey("user_task_valid_stat:%d_%d", userId, taskId) +} + +// FissionStatOtherRecord 缓存活动中的用户其他行为记录 +func FissionStatOtherRecord(cpnId int64, mark string) string { + return fissionKey("stat_other_record:%d_%s", cpnId, mark) +} + +// FissionStatOther 缓存活动中的用户其他行为 +func FissionStatOther(cpnId int64) string { + return fissionKey("stat_other:%d", cpnId) +} + +// FissionParentInviteOnce 上级用户邀请成功要锁住,保证后面的操作串行 +func FissionParentInviteOnce(userId int64) string { + return fissionKey("parent_invite_once:%d", userId) +} + +// FissionUserWebRewardOnce 用户站外奖品领取锁 +func FissionUserWebRewardOnce(webId string) string { + return fissionKey("user_web_reward_once:%s", webId) +} + +// FissionWebLastChannel 站外用户最后访问的站外渠道key +func FissionWebLastChannel(campaignId int64, webId string) string { + return fissionKey("web_last_channel:%d_%s", campaignId, webId) +} + +// FissionAcceptRewardOnce 防止并发领取窗口奖品 +func FissionAcceptRewardOnce(campaignId int64, rewardHashId string) string { + return fissionKey("accept_reward_once:%d_%s", campaignId, rewardHashId) +} + +// FissionWinNewcomerOnce 一起赢奖励用户新人奖并发锁 +func FissionWinNewcomerOnce(userId int64) string { + return fissionKey("win_newcomer_once:%d", userId) +} + +// FissionCustomEffectiveOnce 自定义事件有效计算锁 +func FissionCustomEffectiveOnce(userId int64) string { + return fissionKey("customer_effective_once:%d", userId) +} + +// FissionRegisterOnce 一个活动只允许一次注册 +func FissionRegisterOnce(userId int64) string { + return fissionKey("register_once:%d", userId) +} + +// FissionEventEffectiveOnce 一个活动只允许一次事件触发 +func FissionEventEffectiveOnce(userId int64) string { + return fissionKey("event_effective_once:%d", userId) +} + +// FissionBehaviorTotalCreateOnce 行为活动统计只有能同时创建一个 +func FissionBehaviorTotalCreateOnce(campaignId int64, mark string) string { + return fissionKey("behavior_total_create_once:%d_%s", campaignId, mark) +} + +// FissionUserTargetNum 活动用户达标次数 +func FissionUserTargetNum(userId int64) string { + return fissionKey("user_target_num:%d", userId) +} + +// FissionUserCondFirst 用户第一次触发条件 +func FissionUserCondFirst(userId, condId int64) string { + return fissionKey("user_cond_first:%d_%d", userId, condId) +} + +// FissionUserFirstBehavior 活动用户第一次行为 +func FissionUserFirstBehavior(cpnId int64, userMark, mark string) string { + return fissionKey("user_first_behavior:%d_%s_%s", cpnId, userMark, mark) +} + +// FissionBehaviorTotalCycleHour 行为小时实时次数 +func FissionBehaviorTotalCycleHour(cpnId int64, hour string) string { + return fissionKey("behavior_total_cycle_hour:%d_%s", cpnId, hour) +} + +// FissionBehaviorTotalCycleHourUser 行为小时实时人数 +func FissionBehaviorTotalCycleHourUser(cpnId int64, hour, mark string) string { + return fissionKey("behavior_total_cycle_hour_user:%d_%s_%s", cpnId, hour, mark) +} + +// FissionBehaviorTotalCycleDay 行为天实时次数 +func FissionBehaviorTotalCycleDay(cpnId int64, day string) string { + return fissionKey("behavior_total_cycle_day:%d_%s", cpnId, day) +} + +// FissionBehaviorTotalCycleDayUser 行为天实时人数 +func FissionBehaviorTotalCycleDayUser(cpnId int64, day, mark string) string { + return fissionKey("behavior_total_cycle_day_user:%d_%s_%s", cpnId, day, mark) +} + +// FissionRewardResendOnce 防止并发请求重发奖品 +func FissionRewardResendOnce(hashId string) string { + return fissionKey("reward_resend_once:%s", hashId) +} + +// FissionConfigOnce 防止并发创建玩法配置 +func FissionConfigOnce(projectId int64) string { + return fissionKey("config_once:%d", projectId) +} + +// FissionUserDyLinkOnce 防止并发创建动态链接 +func FissionUserDyLinkOnce(userId int64, mark string) string { + return fissionKey("user_dy_link_one:%d_%s", userId, mark) +} + +// FissionUserSignOnce 活动用户签到锁 +func FissionUserSignOnce(userId int64) string { + return fissionKey("campaign_sign_once:%d", userId) +} + +// FissionCampaignSignState 活动用户签到状态 +func FissionCampaignSignState(campaignId int64, date string) string { + return fissionKey("campaign_sign_state:%d_%s", campaignId, date) +} + +// FissionDiceOnce 大富翁骰骰子锁 +func FissionDiceOnce(userId int64) string { + return fissionKey("dice_once:%d", userId) +} + +// FissionGrowGetOnce 用户领取成长生命体锁 +func FissionGrowGetOnce(userId int64) string { + return fissionKey("grow_get_once:%d", userId) +} + +// FissionGrowFeedOnce 用户喂养成长生命体锁 +func FissionGrowFeedOnce(userId int64) string { + return fissionKey("grow_feed_once:%d", userId) +} + +// FissionGrowGetFeedOnce 用户获取喂养道具锁 +func FissionGrowGetFeedOnce(userId int64, mark string) string { + return fissionKey("grow_get_feed_once:%d_%s", userId, mark) +} + +// FissionUserContentLinkStoreOnce 创建内容链接锁 +func FissionUserContentLinkStoreOnce(userId, markId int64, mark string) string { + return fissionKey("user_content_link_store_once:%d_%d_%s", userId, markId, mark) +} + +// FissionChopHelpUserReward 砍一刀奖品助力人次 +func FissionChopHelpUserReward(chopRewardId int64) string { + return fissionKey("chop_help_user_reward:%d", chopRewardId) +} + +// FissionChopHelpUser 砍一刀助力人次 +func FissionChopHelpUser(uniqMark any) string { + return fissionKey("chop_help_user:%v", uniqMark) +} + +// FissionChopHelpOnce 砍一刀奖品助力锁 +func FissionChopHelpOnce(chopRewardId int64) string { + return fissionKey("chop_help_once:%d", chopRewardId) +} + +// FissionChopHelpPercent 砍一刀奖品助力进度 +func FissionChopHelpPercent(chopRewardId int64) string { + return fissionKey("chop_help_percent:%d", chopRewardId) +} + +// FissionChopHelpMarkPercent 砍一刀奖品标识助力进度 +func FissionChopHelpMarkPercent(chopRewardId int64, mark string) string { + return fissionKey("chop_help_percent:%d_%s", chopRewardId, mark) +} + +// FissionCampaignLangSaveOnce 活动玩法语言保存锁 +func FissionCampaignLangSaveOnce(cpnHashId, mark string) string { + return fissionKey("campaign_lang_save_once:%s_%s", cpnHashId, mark) +} + +// FissionUserLevelOperateOnce 用户等级操作锁 +func FissionUserLevelOperateOnce(projectId int64, mark string) string { + return fissionKey("user_level_operate_once:%d_%s", projectId, mark) +} + +// FissionCampaignRewardUseStock 活动奖品已使用的库存 +func FissionCampaignRewardUseStock(rewardId int64) string { + return fissionKey("campaign_reward_use_stock:%d", rewardId) +} + +// FissionCampaignRewardPreUseStock 活动奖品预使用的库存 +func FissionCampaignRewardPreUseStock(rewardId int64) string { + return fissionKey("campaign_reward_pre_use_stock:%d", rewardId) +} + +// FissionCampaignRewardStock 活动奖品已使用的库存 +func FissionCampaignRewardStock(rewardId int64) string { + return fissionKey("campaign_reward_stock:%d", rewardId) +} + +// FissionCampaignRewardSelectStock 活动奖品选择的库存 +func FissionCampaignRewardSelectStock(rewardId int64) string { + return fissionKey("campaign_reward_select_stock:%d", rewardId) +} + +// FissionUserFinishStepOnce 用户完成现金抽奖阶段操作锁 +func FissionUserFinishStepOnce(userId int64) string { + return fissionKey("user_finish_step_once:%d_%s", userId) +} + +// FissionUserSpinOnce 用户现金抽奖玩法抽奖操作锁 +func FissionUserSpinOnce(userId int64) string { + return fissionKey("user_spin_once:%d_%s", userId) +} + +// FissionUserCashPercent 用户现金抽奖玩法抽奖进度数据 +func FissionUserCashPercent(cashId int64) string { + return fissionKey("user_cash_percent:%d", cashId) +} + +// FissionUserCashAgain 用户再次玩游戏 +func FissionUserCashAgain(userId int64) string { + return fissionKey("user_cash_again:%d", userId) +} + +// FissionAdsHourStat 广告小时归档统计锁 +func FissionAdsHourStat(cpnId int64, hourStr string) string { + return fissionKey("ads_hour_stat:%d_%s", cpnId, hourStr) +} + +// FissionAdsDayStat 广告天归档统计锁 +func FissionAdsDayStat(cpnId int64, dayStr string) string { + return fissionKey("ads_day_stat:%d_%s", cpnId, dayStr) +} + +// FissionUserMixReward 参与用户合成奖品锁 +func FissionUserMixReward(userId int64) string { + return fissionKey("user_mix_reward:%d", userId) +} + +// FissionUserTaskDayLimit 用户每日任务限制 +func FissionUserTaskDayLimit(day string, userId, taskId int64) string { + return fissionKey("user_task_day_limit:%s_%d_%d", day, userId, taskId) +} + +// FissionUserTaskCpnLimit 任务活动周期内限制 +func FissionUserTaskCpnLimit(userId, taskId int64) string { + return fissionKey("user_task_cpn_limit:%d_%d", userId, taskId) +} + +// FissionUserCondDayLimit 用户每日任务限制 +func FissionUserCondDayLimit(day string, userId, condId int64) string { + return fissionKey("user_cond_day_limit:%s_%d_%d", day, userId, condId) +} + +// FissionUserCondCpnLimit 任务活动周期内限制 +func FissionUserCondCpnLimit(userId, condId int64) string { + return fissionKey("user_cond_cpn_limit:%d_%d", userId, condId) +} + +// FissionDefaultAppChannel 活动默认站内渠道缓存 +func FissionDefaultAppChannel(cpnId int64) string { + return fissionKey("default_app_channel:%d", cpnId) +} + +// FissionUserAdsOnce 活动默认站内渠道缓存 +func FissionUserAdsOnce(token string) string { + return fissionKey("default_app_channel:%s", token) +} + +// FissionChanceNotify 中奖次数获得通知 +func FissionChanceNotify(userId int64) string { + return fissionKey("chance_notify:%d", userId) +} + +// FissionNewcomerRewardNotify 新人奖品通知 +func FissionNewcomerRewardNotify(userId int64) string { + return fissionKey("newcomer_reward_notify:%d", userId) +} + +// FissionUserWeekLimit 用户每周任务限制 +func FissionUserWeekLimit(start, userId, taskId int64) string { + return fissionKey("user_task_week_limit:%d_%d_%d", start, userId, taskId) +} + +// FissionUserCondWeekLimit 用户每周任务限制 +func FissionUserCondWeekLimit(start, userId, condId int64) string { + return fissionKey("user_cond_week_limit:%d_%d_%d", start, userId, condId) +} + +// FissionUserRunCreateOnce 用户绑定地图锁 +func FissionUserRunCreateOnce(userId int64) string { + return fissionKey("user_run_create_once:%d", userId) +} + +// FissionUserUniqMark 触发事件用户唯一标识 +func FissionUserUniqMark(campaignId int64, userMark string) string { + return fissionKey("user_uniq_mark:%d_%s", campaignId, userMark) +} + +// FissionUserIovdMark 用户的iovd标识 +func FissionUserIovdMark(userId int64) string { + return fissionKey("user_iovd_mark:%d", userId) +} + +// FissionProjectUserUniq 项目用户处理锁 +func FissionProjectUserUniq(projectId int64, userId string) string { + return fissionKey("project_user_uniq:%d_%s", projectId, userId) +} + +// FissionHelpPercentAdd 助力进度追加关键字 +func FissionHelpPercentAdd(userId int64) string { + return fissionKey("help_percent_add:%d", userId) +} + +// FissionUserGetRewardNum 用户获得奖品的数量 +func FissionUserGetRewardNum(userId int64) string { + return fissionKey("user_get_reward_num:%d", userId) +} + +// FissionRewardLimitUpVer 奖品限制 +func FissionRewardLimitUpVer(cpnId int64) string { + return fissionKey("reward_limit_up_ver:%d", cpnId) +} + +// FissionUserHelpFailMark 用户助力失败原因 +func FissionUserHelpFailMark(cpnId int64) string { + return fissionKey("user_help_fail_mark:%d", cpnId) +} + +// FissionUserPropFeedNum 获得道具任务已经喂养的次数 +func FissionUserPropFeedNum(keepId int64) string { + return fissionKey("user_prop_feed_num:%d", keepId) +} + +// FissionUserDayFirstInvite 用户是否是当天首次邀请 +func FissionUserDayFirstInvite(userId int64) string { + return fissionKey("user_day_first_invite:%d", userId) +} + +// FissionUserKeepDoingOnce 激励养成正在进行一些操作d +func FissionUserKeepDoingOnce(userId int64) string { + return fissionKey("user_keep_doing_once:%d", userId) +} + +// FissionUserDayFirstInviteUser 用户当天邀请的第一个用户 +func FissionUserDayFirstInviteUser(day string, userId int64) string { + return fissionKey("user_day_first_invite_user:%s_%d", day, userId) +} + +// FissionUserDayFirstFeed 用户当天邀请的第一个用户 +func FissionUserDayFirstFeed(day string, userId int64) string { + return fissionKey("user_day_first_feed:%s_%d", day, userId) +} + +// FissionUserCreatePlayerOnce 用户创建一个玩家数据 +func FissionUserCreatePlayerOnce(userId int64) string { + return fissionKey("user_create_player_once:%d", userId) +} + +// FissionUserKeepGetMachineLast 用户最后一次获取机器狗粮的时间 +func FissionUserKeepGetMachineLast(keepId int64) string { + return fissionKey("user_keep_get_machine_last:%d", keepId) +} + +// FissionUserKeepMachineSave 保存狗粮机的狗粮锁 +func FissionUserKeepMachineSave(keepId int64) string { + return fissionKey("user_keep_machine_save:%d", keepId) +} + +// FissionUserKeepMachineNotSave 收狗粮机之后不保存狗粮的时间 +func FissionUserKeepMachineNotSave(keepId int64) string { + return fissionKey("user_keep_machine_not_save:%d", keepId) +} + +// FissionUserKeepInviteDogFoodLimit 邀请人获得的狗粮数 +func FissionUserKeepInviteDogFoodLimit(userId int64) string { + return fissionKey("user_invite_dog_food_limit:%d", userId) +} + +// FissionUserTaskPreCond 用户完成的前置任务标识 +func FissionUserTaskPreCond(userId int64) string { + return fissionKey("user_task_pre_cond:%d", userId) +} + +// FissionKeepRewardSelectedUser 养狗奖品选择人数统计 +func FissionKeepRewardSelectedUser(cpnId int64) string { + return fissionKey("keep_reward_selected_user:%d", cpnId) +} + +// FissionPushUserGroup 推送缓存组 +func FissionPushUserGroup(cpnId int64, mark string, group int) string { + return fissionKey("push_user:%d_%s_%d", cpnId, mark, group) +} + +// FissionChildRank 子活动排行榜 +func FissionChildRank(cpnId int64) string { + return fissionKey("child_rank:%d", cpnId) +} + +// FissionStatActiveOnce 记录活跃请求处理 +func FissionStatActiveOnce(userId int64) string { + return fissionKey("stat_active_once:%d", userId) +} + +// FissionPlayerSetInitOnce 活动玩家设置初始次数锁 +func FissionPlayerSetInitOnce(userId int64) string { + return fissionKey("player_set_init:%d", userId) +} + +// FissionKeepMachineDayLimit 养狗狗粮机每日上限 +func FissionKeepMachineDayLimit(day string, userId int64) string { + return fissionKey("keep_machine_day_limit:%s_%d", day, userId) +} + +// FissionClueMapData 通知hash数据 +func FissionClueMapData(userId int64) string { + return fissionKey("clue_map_data:%d", userId) +} + +// FissionPushLimit push通知限制 +func FissionPushLimit(projectId int64, mark, subUserId string) string { + return fissionKey("push_limit:%d_%s_%s", projectId, mark, subUserId) +} + +// FissionUserKeepOfflineGetNum 用户离线 +func FissionUserKeepOfflineGetNum(day string, userId int64) string { + return fissionKey("user_keep_offline_get_num:%s_%d", day, userId) +} + +// FissionCoinSceneData 用户每场投放的数据 +func FissionCoinSceneData(sceneId int64) string { + return fissionKey("coin_scene_total:%d", sceneId) +} + +// FissionCoinLack 用户s2s请求扣除返回不足状态key +func FissionCoinLack(userId int64) string { + return fissionKey("coin_lack:%d", userId) +} + +// FissionCoinChangeLock 金币池金币修改锁 +func FissionCoinChangeLock(userId int64) string { + return fissionKey("coin_change_lock:%d", userId) +} + +// FissionSignData 签到玩家数据 +func FissionSignData(signId int64) string { + return fissionKey("sign_data:%d", signId) +} + +// FissionReceiveRewardLock 任务领奖锁 +func FissionReceiveRewardLock(userId, taskId int64) string { + return fissionKey("receive_reward_lock:%d_%d", userId, taskId) +} + +// FissionUserAttrCreateOnce 任务用户属性统计锁 +func FissionUserAttrCreateOnce(cpnId int64, attr, val string) string { + return fissionKey("user_attr_create:%d_%s_%s", cpnId, attr, val) +} + +// FissionUserQaSelect 用户题目选择数据 +func FissionUserQaSelect(userId int64) string { + return fissionKey("user_qa_select:%d", userId) +} + +// FissionUserCreateRewardCollect 创建奖品碎片收集数据 +func FissionUserCreateRewardCollect(userId, rewardId int64) string { + return fissionKey("user_create_reward_collect:%d_%d", userId, rewardId) +} + +// FissionUserCreateDicePropOnce 创建大富翁道具 +func FissionUserCreateDicePropOnce(userId int64, mark string) string { + return fissionKey("user_create_dice_prop:%d_%s", userId, mark) +} + +// FissionRewardPushTaskOnce 回调任务锁 +func FissionRewardPushTaskOnce(notifyId int64) string { + return fissionKey("reward_push_task_once:%d", notifyId) +} + +// FissionPushRewardOnce 防止并发领取窗口奖品 +func FissionPushRewardOnce(source string, sourceId, sourceSecondId, relateId int64) string { + return fissionKey("push_reward_once:%s_%d_%d_%d", source, sourceId, sourceSecondId, relateId) +} + +// FissionRewardPushOpenOnce 任务推送 +func FissionRewardPushOpenOnce(campaignId int64, mark string) string { + return fissionKey("reward_push_task_once:%d_%s", campaignId, mark) +} + +// FissionLvApiCache lv请求缓存 +func FissionLvApiCache(projectId int64, subUserId string) string { + return fissionKey("lv_api_cache:%d_%s", projectId, subUserId) +} + +// FissionPointsUseDayNum 积分每日使用次数 +func FissionPointsUseDayNum(userId int64, day string) string { + return fissionKey("points_use_day_num:%d_%s", userId, day) +} + +// FissionPointsUseNum 积分使用次数 +func FissionPointsUseNum(userId int64) string { + return fissionKey("points_use_num:%d", userId) +} + +// FissionChatDayTotal 聊天日统计 +func FissionChatDayTotal(userId int64, day string) string { + return fissionKey("chat_day_total:%d_%s", userId, day) +} + +func FissionVoteAcceptOnce(userId int64) string { + return fissionKey("vote_accept_once:%d", userId) +} + +// FissionUserUnoRandCardOnce Uno抽卡只能有一次 +func FissionUserUnoRandCardOnce(userId int64) string { + return fissionKey("user_uno_rand_card_once:%d", userId) +} + +// FissionUserUnoClaimOnce Uno收集卡只能有一次 +func FissionUserUnoClaimOnce(userId int64) string { + return fissionKey("user_uno_claim_once:%d", userId) +} + +// FissionUserUnoCollectOnce Uno收集创建只能有一次 +func FissionUserUnoCollectOnce(userId int64) string { + return fissionKey("user_uno_collect_once:%d", userId) +} + +// FissionUserEventFirstVisit 用户首次访问活动事件 +func FissionUserEventFirstVisit(userId int64) string { + return fissionKey("user_event_first_visit:%d", userId) +} + +// FissionUserExchangeOnce 交换只能有一次 +func FissionUserExchangeOnce(userId int64) string { + return fissionKey("user_exchange_once:%d", userId) +} + +// FissionUserTaskTip 任务奖励提示 +func FissionUserTaskTip(userId int64) string { + return fissionKey("user_task_tip:%d", userId) +} + +func FissionUserRewards(userId int64) string { + return fissionKey("user_reward:%d", userId) +} + +// FissionUserUnlockReward 用户解锁奖励 +func FissionUserUnlockReward(userId, rewardId int64) string { + return fissionKey("user_unlock_reward:%d_%d", userId, rewardId) +} diff --git a/internal/consts/ckey/game.go b/internal/consts/ckey/game.go new file mode 100644 index 0000000..1b33677 --- /dev/null +++ b/internal/consts/ckey/game.go @@ -0,0 +1,37 @@ +package ckey + +import "fmt" + +func gameKey(format string, a ...any) string { + return Game + fmt.Sprintf(format, a...) +} + +// GameLinkInit 初始化游戏默认链接 +func GameLinkInit(projectId, gameId int64) string { + return gameKey("link_init:%d_%d", projectId, gameId) +} + +// GameTotalCreateOnce 行为统计只有能同时创建一个 +func GameTotalCreateOnce(projectId, gameId, linkId int64) string { + return gameKey("total_create_once:%d_%d_%d", projectId, gameId, linkId) +} + +// GameTotalCreateOnceDate 行为统计只有能同时创建一个 +func GameTotalCreateOnceDate(projectId, gameId, linkId int64, date string) string { + return gameKey("total_create_once_date:%d_%d_%d_%s", projectId, gameId, linkId, date) +} + +// GameActionFirst 行为统计只有能同时创建一个 +func GameActionFirst(projectId, gameId, linkId, userId int64, t int32) string { + return gameKey("action_first:%d_%d_%d_%d_%d", projectId, gameId, linkId, userId, t) +} + +// GameActionFirstDate 行为统计只有能同时创建一个 +func GameActionFirstDate(projectId, gameId, linkId, userId int64, t int32, date string) string { + return gameKey("action_first_date:%d_%d_%d_%d_%d_%s", projectId, gameId, linkId, userId, t, date) +} + +// GameActionStayId 行为统计只有能同时创建一个 +func GameActionStayId(userId, linkId int64) string { + return gameKey("action_stay_id:%d_%d", userId, linkId) +} diff --git a/internal/consts/ckey/mall.go b/internal/consts/ckey/mall.go new file mode 100644 index 0000000..692bb79 --- /dev/null +++ b/internal/consts/ckey/mall.go @@ -0,0 +1,15 @@ +package ckey + +import "fmt" + +func mallKey(format string, a ...any) string { + return Mall + fmt.Sprintf(format, a...) +} + +func MallItemStock(mallItemId int64) string { + return mallKey("item_stock:%d", mallItemId) +} + +func MallItemExchanging(projectUserId int64) string { + return mallKey("item_exchanging:%d", projectUserId) +} diff --git a/internal/consts/ckey/project.go b/internal/consts/ckey/project.go new file mode 100644 index 0000000..4105e4c --- /dev/null +++ b/internal/consts/ckey/project.go @@ -0,0 +1,32 @@ +package ckey + +import "fmt" + +func projectKey(format string, a ...any) string { + return Project + fmt.Sprintf(format, a...) +} + +// ProjectDomainBucket 域名桶 +func ProjectDomainBucket() string { + return projectKey("domain_bucket") +} + +// ProjectStoreOnce 保证项目创建的时候,域名不被其他企业使用 +func ProjectStoreOnce(domain string) string { + return projectKey("store_once:%s", domain) +} + +// ProjectSecretOnce 保证项目创建私钥的时候没有并发创建 +func ProjectSecretOnce(projectId int64) string { + return projectKey("secret_once:%d", projectId) +} + +// ProjectAdsOnce 保证项目创建广告配置的时候没有并发创建 +func ProjectAdsOnce(projectHashId string) string { + return projectKey("ads_once:%s", projectHashId) +} + +// ProjectCoinCreateOnce 项目积分配置并发处理锁 +func ProjectCoinCreateOnce(projectHashId string) string { + return projectKey("coin_once:%s", projectHashId) +} diff --git a/internal/consts/ckey/project_user.go b/internal/consts/ckey/project_user.go new file mode 100644 index 0000000..0e7c191 --- /dev/null +++ b/internal/consts/ckey/project_user.go @@ -0,0 +1,22 @@ +package ckey + +import "fmt" + +func projectUserKey(format string, a ...any) string { + return ProjectUser + fmt.Sprintf(format, a...) +} + +// ProjectUserCreate 项目用户创建锁 +func ProjectUserCreate(projectId int64, appUserId string) string { + return projectUserKey("project_user_create:%d_%s", projectId, appUserId) +} + +// ProjectUserCoinNum 项目用户金币 +func ProjectUserCoinNum(userId int64) string { + return projectUserKey("coin_num:%d", userId) +} + +// ProjectUserCoinLack 项目用户金币api返回不足 +func ProjectUserCoinLack(projectId int64, appUserId string) string { + return projectUserKey("project_user_coin_lack:%d_%s", projectId, appUserId) +} diff --git a/internal/consts/ckey/task.go b/internal/consts/ckey/task.go new file mode 100644 index 0000000..4251bde --- /dev/null +++ b/internal/consts/ckey/task.go @@ -0,0 +1,22 @@ +package ckey + +import "fmt" + +func taskKey(format string, a ...any) string { + return TaskPrefix + fmt.Sprintf(format, a...) +} + +// ValidEventsKey 有效事件任务 +func ValidEventsKey(userId int64) string { + return taskKey("valid_events:%d", userId) +} + +// ValidEventsUserMarkKey 有效事件任务 +func ValidEventsUserMarkKey(userMark string) string { + return taskKey("valid_events_user_mark:%s", userMark) +} + +// ProjectUserCoinDeduct 项目用户积分扣除 +func ProjectUserCoinDeduct(userId int64) string { + return taskKey("project_user_coin_deduct:%d", userId) +} diff --git a/internal/consts/ckey/user.go b/internal/consts/ckey/user.go new file mode 100644 index 0000000..78e6b5a --- /dev/null +++ b/internal/consts/ckey/user.go @@ -0,0 +1,12 @@ +package ckey + +import "fmt" + +func userKey(format string, a ...any) string { + return User + fmt.Sprintf(format, a...) +} + +// UserStoreOnce 一个账号并发创建锁 +func UserStoreOnce(username string) string { + return userKey("store_once:%s", username) +} diff --git a/internal/consts/consts.go b/internal/consts/consts.go new file mode 100644 index 0000000..60f6962 --- /dev/null +++ b/internal/consts/consts.go @@ -0,0 +1,114 @@ +package consts + +import ( + "time" +) + +const ( + ServiceName = "joybuywork" + TraceIdKey = "trace_id" + XLangKey = "X-Lang" + DebugKey = "__debug__" +) + +const ( + CtxLangKey = "__ctx_lang__" // 语言ctx key + CtxTimezoneKey = "__ctx_timezone__" // 时区ctx key + CtxReqId = "rid" // 请求id + CtxBootId = "boot_id" // 脚本任务id + CtxMsgId = "mid" // 队列消息id +) + +const ( + AdminRoleName = "高级用户" + NormalRoleName = "普通用户" +) + +const ( + KB = 1 << 10 //1KB 字节 + MB = 1 << 20 //1MB 字节 + GB = 1 << 30 //1GB 字节 +) + +const ( + Local = "local" + Dev = "dev" + Test = "test" + Prod = "prod" +) + +const ( + LuckyThinkText = "good luck" //谢谢参与文案 + LuckyThinkImg = "https://i1.branchcn.com/resource/2023/06/08/ci0t5fki474ceqco5i0g.png" //谢谢参与logo图 +) + +const ( + RandEnStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" //随机英文字符串 + RandEnNumberStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" //随机英文数字字符串 +) + +const ( + ChannelMarkLen = 2 + ChannelDefaultName = "默认链接" + ChannelWebDefaultName = "活动自分享" +) + +const ( + TimeDay = time.Hour * 24 + TimeWeek = TimeDay * 7 + DaySec = 86400 // 一天的秒数字 +) + +// carbon 组件的format +const ( + YmdH = "YmdH" + Ymd = "Ymd" + Ymd_ = "Y-m-d" + His = "His" + His_ = "H:i:s" + YmdHs = "Y/m/d H:i" +) + +const ( + JoinComma = "," // 逗号切割 +) + +const ( + FissionRankTypeInstall = iota + 1 // 下载 + FissionRankTypeRegister // 注册 + FissionRankTypeFriendTarget // 好友达标 + FissionRankTypeSelfTask // 自己完成任务 + FissionRankTypeSign // 签到 + FissionRankTypeGrow // 养成 +) + +const ( + LangZhCn = "zh-cn" + LangEn = "en" +) + +const Colon = ":" + +const ( + CampaignTz = "GMT" + CampaignTzOffset = 8 + DefaultTz = -100 // 需要去活动的默认时区 +) + +const ( + PlatformAndroid = "android" // 安卓 + PlatformIOS = "ios" //ios + PlatformWeb = "web" //网页 + PlatformIPad = "ipad" //Ipad + PlatformOther = "other" //其他 +) + +const ( + TblPrefix = "__tbl-" // 一些特殊前缀 +) + +const ( + HelpStatusNotInstall = "not_install" // 未完成安装 + HelpStatusNotRegister = "not_register" // 未完成注册 + HelpStatusNotTask = "not_task" // 未完成任务 +) diff --git a/internal/consts/currency.go b/internal/consts/currency.go new file mode 100644 index 0000000..5fe6eb7 --- /dev/null +++ b/internal/consts/currency.go @@ -0,0 +1,67 @@ +package consts + +type CurrencyUnit struct { + Id int64 `json:"id"` + Unit string `json:"unit"` +} + +const ( + IdUSD = iota + 1 + IdCNY + IdRUB + IdEUR + IdGBP + IdKRW + IdFR + IdTRY + IdTSAR + IdRs + IdTHB +) + +var Currency = []CurrencyUnit{ + { + Id: IdUSD, + Unit: "$", + }, + { + Id: IdCNY, + Unit: "¥", + }, + { + Id: IdRUB, + Unit: "₽", + }, + { + Id: IdEUR, + Unit: "€", + }, + { + Id: IdGBP, + Unit: "£", + }, + { + Id: IdKRW, + Unit: "₩", + }, + { + Id: IdFR, + Unit: "Fr", + }, + { + Id: IdTRY, + Unit: "₤", + }, + { + Id: IdTSAR, + Unit: "ر.س", + }, + { + Id: IdRs, + Unit: "₨", + }, + { + Id: IdTHB, + Unit: "฿", + }, +} diff --git a/internal/consts/fission.go b/internal/consts/fission.go new file mode 100644 index 0000000..8eddd57 --- /dev/null +++ b/internal/consts/fission.go @@ -0,0 +1,747 @@ +package consts + +// fission表对应的数据,因为fission表是系统数据,所以把一些唯一性的数据直接用代码做对应表 + +const ( + FissionTargetApp = iota + 1 // app下载/注册 + FissionTargetConvert // 提升in-app + FissionTargetRetain // 留存 + FissionTargetAds // 广告互动 + FissionTargetChild // 子活动 +) + +const ( + IdReferral = iota + 1 // 老带新 + IdWinTogether // 一起赢奖励 + IdBlindBox // 盲盒 + IdPrizeWheel // 大转盘 + IdSlotMachine // 老虎机 + IdLuckyGrid // 九宫格 + IdPrizeQuiz // 有奖竞猜 (非新报表) + IdPrizeAnswer // 趣味问答 + IdSignIn // 签到 + IdDice // 骰子大富翁 + IdGrow // 快乐农场 + IdQa // 智力大考验 + IdQaAudio // 我爱记歌词 + IdQaVideo // 视频闯关 + IdBallot // 抽签 + IdChop // 砍一刀 + IdCash // 现金抽奖 + IdAdsWheel // 广告转盘 + IdAdsGrid // 广告九宫格 + IdFlip // 翻牌 + IdAdsFlip // 广告翻牌 + IdKeep // 激励养成 + IdGold // 金币任务 + IdCoin // 瓜分金币池 + IdVs // 赛事竞猜 + IdUno // UNO卡牌 + IdGashapon // 扭蛋机 +) +const ( + MarkReferral = "referral" //老带新 + MarkWinTogether = "win_together" //一起赢奖励 + MarkBlindBox = "blind_box" //盲盒 + MarkPrizeWheel = "prize_wheel" //大转盘 + MarkSlotMachine = "slot_machine" //老虎机 + MarkLuckyGrid = "lucky_grid" //九宫格 + MarkPrizeQuiz = "prize_quiz" //有奖竞猜 + MarkPrizeAnswer = "prize_answer" //趣味问答 + MarkSignIn = "sign_in" //签到 + MarkDice = "dice" //骰子大富翁 + MarkGrow = "grow" //快乐农场 + MarkQa = "qa" //智力大考验 + MarkQaAudio = "qa_audio" //我爱记歌词 + MarkQaVideo = "qa_video" //视频闯关 + MarkBallot = "ballot" //抽签 + MarkChop = "chop" //砍一刀 + MarkCash = "cash" //现金抽奖 + MarkAdsWheel = "ads_wheel" //广告转盘 + MarkAdsGrid = "ads_grid" //广告九宫格 + MarkFlip = "flip" //翻牌 + MarkAdsFlip = "ads_flip" //广告翻牌 + MarkKeep = "keep" //激励养成 + MarkGold = "gold" //金币任务 + MarkCoin = "coin" //瓜分金币池 + MarkVs = "vs" //赛事竞猜 + MarkUno = "uno" //UNO卡牌 + MarkGashapon = "gashapon" // 扭蛋机 +) + +type Fission struct { + Id int64 `json:"id"` + Mark string `json:"mark"` + Logo string `json:"logo"` + Color []string `json:"color"` + CanUse bool `json:"can_use"` + ConvertLogo string `json:"convert_logo"` + RetainLogo string `json:"retain_logo"` + PushLogo string `json:"push_logo"` + PushConvertLogo string `json:"push_convert_logo"` + PushRetainLogo string `json:"push_retain_logo"` +} + +var FissionIdMap = map[int64]string{ + IdReferral: MarkReferral, + IdWinTogether: MarkWinTogether, + IdBlindBox: MarkBlindBox, + IdPrizeWheel: MarkPrizeWheel, + IdSlotMachine: MarkSlotMachine, + IdLuckyGrid: MarkLuckyGrid, + IdPrizeQuiz: MarkPrizeQuiz, + IdPrizeAnswer: MarkPrizeAnswer, + IdSignIn: MarkSignIn, + IdDice: MarkDice, + IdGrow: MarkGrow, + IdQa: MarkQa, + IdQaAudio: MarkQaAudio, + IdQaVideo: MarkQaVideo, + IdBallot: MarkBallot, + IdChop: MarkChop, + IdCash: MarkCash, + IdAdsWheel: MarkAdsWheel, + IdAdsGrid: MarkAdsGrid, + IdFlip: MarkFlip, + IdAdsFlip: MarkAdsFlip, + IdKeep: MarkKeep, + IdGold: MarkGold, + IdCoin: MarkCoin, + IdVs: MarkVs, + IdUno: MarkUno, + IdGashapon: MarkGashapon, +} + +var FissionMarkMap = map[string]int64{ + MarkReferral: IdReferral, + MarkWinTogether: IdWinTogether, + MarkBlindBox: IdBlindBox, + MarkPrizeWheel: IdPrizeWheel, + MarkSlotMachine: IdSlotMachine, + MarkLuckyGrid: IdLuckyGrid, + MarkPrizeQuiz: IdPrizeQuiz, + MarkPrizeAnswer: IdPrizeAnswer, + MarkSignIn: IdSignIn, + MarkDice: IdDice, + MarkGrow: IdGrow, + MarkQa: IdQa, + MarkQaAudio: IdQaAudio, + MarkQaVideo: IdQaVideo, + MarkBallot: IdBallot, + MarkChop: IdChop, + MarkCash: IdCash, + MarkAdsWheel: IdAdsWheel, + MarkAdsGrid: IdAdsGrid, + MarkFlip: IdFlip, + MarkAdsFlip: IdAdsFlip, + MarkKeep: IdKeep, + MarkGold: IdGold, + MarkCoin: IdCoin, + MarkVs: IdVs, + MarkUno: IdUno, + MarkGashapon: IdGashapon, +} + +var FissionTitle = map[string]map[string]string{ + LangZhCn: { + MarkReferral: "经典老带新", + MarkWinTogether: "一起赢奖励", + MarkBlindBox: "盲盒大拆箱", + MarkPrizeWheel: "轮盘争上游", + MarkSlotMachine: "幸运777", + MarkLuckyGrid: "九宫格解密", + MarkPrizeQuiz: "谁是冠军", + MarkPrizeAnswer: "趣味问答", + MarkSignIn: "每日签到", + MarkDice: "骰子大富翁", + MarkGrow: "快乐农场", + MarkQa: "最强大脑", + MarkQaAudio: "我爱记歌词", + MarkQaVideo: "视频解谜挑战", + MarkBallot: "幸运上上签", + MarkChop: "好友助力狂欢", + MarkCash: "现金大抽奖", + MarkAdsWheel: "转盘抽奖", + MarkAdsGrid: "九宫格抽奖", + MarkFlip: "幸运翻牌", + MarkAdsFlip: "幸运翻牌", + MarkKeep: "激励养成", + MarkGold: "金币任务", + MarkCoin: "金币大派送", + MarkVs: "赛事竞猜", + MarkUno: "UNO卡牌", + MarkGashapon: "扭蛋机", + }, + LangEn: { + MarkReferral: "Referral Program", + MarkWinTogether: "Win Together", + MarkBlindBox: "Mystery Box", + MarkPrizeWheel: "Wheel of Fortune", + MarkSlotMachine: "Jackpot", + MarkLuckyGrid: "Lucky Grid", + MarkPrizeQuiz: "Who is Winner", + MarkPrizeAnswer: "Timed Quiz", + MarkSignIn: "Daily check-in", + MarkDice: "Monopoly", + MarkGrow: "Farm Paradise", + MarkQa: "Brain Teaser Quiz Contest", + MarkQaAudio: "Voice Quiz Challenge", + MarkQaVideo: "Video Puzzle Challenge", + MarkBallot: "Lucky Draw Texts Event", + MarkChop: "Friend Boost Fiesta", + MarkCash: "Cash Draw", + MarkAdsWheel: "Ads Wheel", + MarkAdsGrid: "Ads Gird", + MarkFlip: "Lucky Card", + MarkAdsFlip: "Lucky Card", + MarkKeep: "Incentivize", + MarkGold: "Gold Coin Mission", + MarkCoin: "Gold Coins Giveaway", + MarkVs: "Win Forecast", + MarkUno: "UNO Card Game", + MarkGashapon: "Gashapon", + }, +} + +var FissionDesc = map[string]map[string][]string{ + LangZhCn: { + MarkReferral: []string{"老用户人拉人,免费“自来水”", "“病毒”传播,无限裂变新流量"}, + MarkWinTogether: []string{"老用户邀请新用户,新老用户皆得奖励"}, + MarkBlindBox: []string{"无需开发,快速上线盲盒活动"}, + MarkPrizeWheel: []string{"随时随地创建抽奖活动,增长没有天花板"}, + MarkSlotMachine: []string{"让用户沉迷的老虎机小游戏"}, + MarkLuckyGrid: []string{"完成任务集碎片,趣味无穷赢奖励"}, + MarkPrizeQuiz: []string{"热点话题不错过,快速生成打榜竞猜"}, + MarkPrizeAnswer: []string{"更多互动,紧张刺激的限时问答活动"}, + MarkSignIn: []string{"加入签到挑战,赢取精彩奖品"}, + MarkDice: []string{"摇动骰子,穿越大富翁地图,赢取丰厚奖励!"}, + MarkGrow: []string{"养狗、种树,与好友们一起分享农场的欢乐与成就"}, + MarkQa: []string{"智力问答,挑战巅峰!"}, + MarkQaAudio: []string{"听音答题,赢取丰厚奖励"}, + MarkQaVideo: []string{"解谜挑战,奖励等你拿!"}, + MarkBallot: []string{"抽签赢好礼!参与幸运签文活动,有机会获得丰厚奖品!"}, + MarkChop: []string{"邀好友助力下载App,赢免费礼物"}, + MarkCash: []string{"现金抽奖,更好的吸引用户分享引流"}, + MarkAdsWheel: []string{"互动转盘,用奖品更好的吸引用户下载"}, + MarkAdsGrid: []string{"互动九宫格,用奖品更好的吸引用户下载"}, + MarkFlip: []string{"翻牌活动,更好的吸引用户分享引流"}, + MarkAdsFlip: []string{"翻牌活动,更好的吸引用户分享引流"}, + MarkKeep: []string{"邀新好友,完成任务,奖励叠加,拉新/留存/促活都能干"}, + MarkGold: []string{"完成任务收集金币,领取超级大奖,更好的促活与转化"}, + MarkCoin: []string{"瓜分金币宝箱,更好的促活与转化"}, + MarkVs: []string{"玩转热门赛事,增添观赛氛围感,提升日活好帮手"}, + MarkUno: []string{"收集UNO卡牌活动,领取超级大奖,更好的促活与转化"}, + MarkGashapon: []string{"扭蛋机,更好的促活与转化"}, + }, + LangEn: { + MarkReferral: []string{"Go viral with your exisiting users. Take advantage of your exisiting users for new user aquisations."}, + MarkWinTogether: []string{"Both referrals and referees can get rewards!"}, + MarkBlindBox: []string{"Create your own mystery box event in 5 mins.", "Catch the trend, no development needed."}, + MarkPrizeWheel: []string{"Use this fun and easy format to entertain your audience, spin to win!"}, + MarkSlotMachine: []string{"Match the three, enjoy the captivating slot machine. Let participants be addicted to it!"}, + MarkLuckyGrid: []string{"Assign different tasks for users to win the prize."}, + MarkPrizeQuiz: []string{"Never miss a popular topic. ID ranking or guessing contest in minutes! "}, + MarkPrizeAnswer: []string{"How to make a quiz even more engaging and challenging? Display a countdown and challenge your players and their friends!"}, + MarkSignIn: []string{"Join our daily check-in challenge and win exciting rewards!"}, + MarkDice: []string{"Roll the dice, traverse the Monopoly board, and win amazing rewards!"}, + MarkGrow: []string{"Raise dogs, plant trees, and share the joy and achievements of the farm with friends!"}, + MarkQa: []string{"Test Your Brain! Challenge the Summit!"}, + MarkQaAudio: []string{"Listen, Answer, Win! Exciting Rewards Await!"}, + MarkQaVideo: []string{"Watch & Win: Quiz Fun!"}, + MarkBallot: []string{"Win Exciting Prizes! Participate in the Lucky Draw Texts Event for a chance to win amazing rewards!"}, + MarkChop: []string{"Invite friends to boost, claim free gifts"}, + MarkCash: []string{"Cash lottery to better attract users to share and attract traffic"}, + MarkAdsWheel: []string{"Interactive turntable, use prizes to better attract users to download"}, + MarkAdsGrid: []string{"Interactive Nine-square grid, use prizes to better attract users to download"}, + MarkFlip: []string{"Flip the Card to better encourage users to share and attract traffic"}, + MarkAdsFlip: []string{"Flip the Card to better encourage users to share and attract traffic"}, + MarkKeep: []string{"Invite new friends, complete tasks, and receive rewards. You can attract new users, retain users, and promote activity"}, + MarkGold: []string{"Complete tasks to collect coins and claim super prizes to better promote activation and conversion"}, + MarkCoin: []string{"Divide the gold coin treasure box to better promote activation and conversion"}, + MarkVs: []string{"Enjoy trending events, enhance match atmosphere, and lift daily active users"}, + MarkUno: []string{"Collect UNO cards to win super prizes to better promote activation and conversion"}, + MarkGashapon: []string{"Gashapon, better promote activation and conversion"}, + }, +} + +var FissionConvertTitle = map[string]map[string]string{ + LangZhCn: { + MarkBlindBox: "神秘宝藏大挑战", + MarkPrizeWheel: "幸运之轮", + MarkSlotMachine: "夺宝奇兵", + MarkLuckyGrid: "抽奖嘉年华", + MarkFlip: "卡牌大师", + MarkGold: "金币任务", + }, + LangEn: { + MarkBlindBox: "Mystery Box Bonanza", + MarkPrizeWheel: "Spin to Win", + MarkSlotMachine: "Slot Bonanza TriggerShare", + MarkLuckyGrid: "Prize-Filled Tic-Tac-Toe", + MarkFlip: "Card Master", + MarkGold: "Gold Coin Mission", + }, +} + +var FissionConvertDesc = map[string]map[string][]string{ + LangZhCn: { + MarkBlindBox: []string{"参与盲盒狂欢夺神秘宝藏!"}, + MarkPrizeWheel: []string{"做赏金任务抽惊喜大奖"}, + MarkSlotMachine: []string{"转动抽奖老虎机赢取幸运大奖"}, + MarkLuckyGrid: []string{"挑战夺宝任务赢取神秘宝藏"}, + MarkFlip: []string{"做赏金任务实现翻牌自由"}, + MarkGold: []string{"完成任务收集金币,领取超级大奖,更好的促活与转化"}, + }, + LangEn: { + MarkBlindBox: []string{"Rise to the Challenge, Win the Ultimate Prize"}, + MarkPrizeWheel: []string{"Turn the Wheel of Fortune, Unlock Your Luck"}, + MarkSlotMachine: []string{"Play the Slots, Discover Hidden Treasures"}, + MarkLuckyGrid: []string{"Nine Squares of Surprise, Claim Your Reward"}, + MarkFlip: []string{"Do bounty tasks to achieve flip freedom"}, + MarkGold: []string{"Complete tasks to collect coins and claim super prizes to better promote activation and conversion"}, + }, +} + +func FissionList() []Fission { + return []Fission{ + { + Id: IdReferral, + Mark: MarkReferral, + Logo: "resource/2023/07/10/cilsqan70jnpckfrq2jg.svg", + Color: []string{"#EB2224", "#FF7400"}, + CanUse: true, + PushLogo: "ftg/logo/logo_referral.png", + }, + { + Id: IdWinTogether, + Mark: MarkWinTogether, + Logo: "resource/2023/07/10/cilss4770jnpd9ncs7m0.svg", + Color: []string{"#FE6607", "#FFC300"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "", + PushLogo: "ftg/logo/logo_win.png", + }, + { + Id: IdPrizeWheel, + Mark: MarkPrizeWheel, + Logo: "resource/2023/07/10/cilsu4n70jnpe3ah0k1g.svg", + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + ConvertLogo: "ftg/logo/convert_logo_wheel.svg", + PushLogo: "ftg/logo/logo_wheel.png", + PushConvertLogo: "ftg/logo/convert_logo_wheel.png", + }, + { + Id: IdSlotMachine, + Mark: MarkSlotMachine, + Logo: "resource/2023/07/10/cilsuvf70jnpenrke5e0.svg", + PushLogo: "ftg/logo/logo_slot.png", + Color: []string{"#0047FF", "#00FFC2"}, + CanUse: true, + ConvertLogo: "ftg/logo/convert_logo_slot.svg", + PushConvertLogo: "ftg/logo/convert_logo_slot.png", + }, + { + Id: IdBlindBox, + Mark: MarkBlindBox, + Logo: "resource/2023/07/10/cilst0v70jnpdn5080b0.svg", + PushLogo: "ftg/logo/logo_blind.png", + Color: []string{"#8228F6", "#3378FF"}, + CanUse: true, + ConvertLogo: "ftg/logo/convert_logo_blind.svg", + PushConvertLogo: "ftg/logo/convert_logo_blind.png", + }, + { + Id: IdLuckyGrid, + Mark: MarkLuckyGrid, + Logo: "resource/2023/07/10/cilsvhv70jnpf5l8iqog.svg", + PushLogo: "ftg/logo/logo_grid.png", + Color: []string{"#FA2121", "#BB4DFF"}, + CanUse: true, + ConvertLogo: "ftg/logo/convert_logo_grid.svg", + PushConvertLogo: "ftg/logo/convert_logo_grid.png", + }, + { + Id: IdPrizeAnswer, + Mark: MarkPrizeAnswer, + Logo: "resource/2023/07/10/cilt0jn70jnpftepg64g.svg", + PushLogo: "ftg/logo/logo_answer.png", + Color: []string{"#0039FF", "#AD00FF"}, + CanUse: true, + }, + { + Id: IdPrizeQuiz, + Mark: MarkPrizeQuiz, + Logo: "resource/2023/07/10/cilt07f70jnpfitsg2a0.svg", + PushLogo: "ftg/logo/logo_quiz.png", + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + }, + { + Id: IdSignIn, + Mark: MarkSignIn, + Logo: "", + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + RetainLogo: "ftg/logo/retain_logo_sign.svg", + PushRetainLogo: "ftg/logo/retain_logo_sign.png", + }, + { + Id: IdDice, + Mark: MarkDice, + Logo: "ftg/logo/logo_dice.svg", + PushLogo: "ftg/logo/logo_dice.png", + Color: []string{"#EA5455", "#FF9F43"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_dice.svg", + PushRetainLogo: "ftg/logo/retain_logo_dice.png", + }, + { + Id: IdGrow, + Mark: MarkGrow, + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_grow.svg", + PushRetainLogo: "ftg/logo/retain_logo_grow.png", + }, + { + Id: IdQa, + Mark: MarkQa, + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_qa.svg", + PushRetainLogo: "ftg/logo/retain_logo_qa.png", + }, + { + Id: IdQaAudio, + Mark: MarkQaAudio, + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_qa_audio.svg", + PushRetainLogo: "ftg/logo/retain_logo_qa_audio.png", + }, + { + Id: IdQaVideo, + Mark: MarkQaVideo, + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_qa_video.svg", + PushRetainLogo: "ftg/logo/retain_logo_qa_video.png", + }, + { + Id: IdBallot, + Mark: MarkBallot, + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_ballot.svg", + PushRetainLogo: "ftg/logo/retain_logo_ballot.png", + }, + { + Id: IdChop, + Mark: MarkChop, + Color: []string{"#01EB38", "#00B7FF"}, + CanUse: true, + ConvertLogo: "", + RetainLogo: "ftg/logo/retain_logo_chop.svg", + PushRetainLogo: "ftg/logo/retain_logo_chop.png", + }, + { + Id: IdCash, + Mark: MarkCash, + Logo: "ftg/logo/logo_cash.svg", + PushLogo: "ftg/logo/logo_cash.png", + Color: []string{"#FE6607", "#FFC300"}, + CanUse: true, + }, + { + Id: IdAdsWheel, + Mark: MarkAdsWheel, + Logo: "ftg/logo/logo_wheel.svg", + PushLogo: "ftg/logo/logo_wheel.png", + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + }, + { + Id: IdAdsGrid, + Mark: MarkAdsGrid, + Logo: "ftg/logo/logo_grid.svg", + PushLogo: "ftg/logo/logo_grid.png", + Color: []string{"#FA2121", "#BB4DFF"}, + CanUse: true, + }, + { + Id: IdFlip, + Mark: MarkFlip, + Logo: "ftg/logo/logo_flip.svg", + PushLogo: "ftg/logo/logo_flip.png", + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + ConvertLogo: "ftg/logo/logo_flip.svg", + PushConvertLogo: "ftg/logo/logo_flip.png", + }, + { + Id: IdAdsFlip, + Mark: MarkAdsFlip, + Logo: "ftg/logo/logo_flip.svg", + PushLogo: "ftg/logo/logo_flip.png", + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + ConvertLogo: "ftg/logo/logo_flip.svg", + PushConvertLogo: "ftg/logo/logo_flip.png", + }, + { + Id: IdKeep, + Mark: MarkKeep, + Logo: "ftg/logo/logo_keep.svg", + PushLogo: "ftg/logo/logo_keep.png", + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + RetainLogo: "ftg/logo/logo_keep.svg", + PushRetainLogo: "ftg/logo/logo_keep.png", + }, + { + Id: IdGold, + Mark: MarkGold, + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + ConvertLogo: "ftg/logo/convert_logo_gold.svg", + PushConvertLogo: "ftg/logo/convert_logo_gold.png", + }, + { + Id: IdCoin, + Mark: MarkCoin, + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + RetainLogo: "ftg/logo/retain_logo_coin.svg", + PushRetainLogo: "ftg/logo/retain_logo_coin.png", + }, + { + Id: IdVs, + Mark: MarkVs, + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + RetainLogo: "ftg/logo/retain_logo_vs.svg", + PushRetainLogo: "ftg/logo/retain_logo_vs.png", + }, + { + Id: IdUno, + Mark: MarkUno, + Color: []string{"#00CB5B", "#6CDF16"}, + CanUse: true, + RetainLogo: "ftg/logo/retain_logo_uno.svg", + PushRetainLogo: "ftg/logo/retain_logo_uno.png", + }, + { + Id: IdGashapon, + Mark: MarkGashapon, + Logo: "ftg/logo/logo_gashapon.svg", + Color: []string{"#0047FF", "#00FFC2"}, + CanUse: true, + RetainLogo: "ftg/logo/logo_gashapon.svg", + PushRetainLogo: "ftg/logo/logo_gashapon.png", + }, + } +} + +func (f Fission) GetTitle(lang string, target int32) string { + var titleMap = FissionTitle + switch target { + case FissionTargetConvert: + titleMap = FissionConvertTitle + } + + title, ok := titleMap[lang] + if !ok { + title = titleMap[LangZhCn] + } + + return title[f.Mark] +} + +func (f Fission) GetDesc(lang string, target int32) []string { + var descMap = FissionDesc + switch target { + case FissionTargetConvert: + descMap = FissionConvertDesc + } + + desc, ok := descMap[lang] + if !ok { + desc = descMap[LangZhCn] + } + + return desc[f.Mark] +} + +func (f Fission) GetPushLogo(target int32) (logo string) { + switch target { + case FissionTargetConvert: + logo = f.PushConvertLogo + case FissionTargetRetain: + logo = f.PushRetainLogo + } + + if logo != "" { + return + } + + return f.PushLogo +} + +func GetPushLogo(fissionId int64, target int32) string { + for _, fission := range FissionList() { + if fission.Id == fissionId { + return fission.GetPushLogo(target) + } + } + return "" +} + +const ( + TempInfoImgCommon = "ftg/commonimage/" + + TempInfoImgAndroidBtnKey = "android_btn" + TempInfoImgAndroidBtnValue = TempInfoImgCommon + TempInfoImgAndroidBtnKey + "%s.png" + TempInfoImgAndroidBtnDesc = "下载引导图-安卓按钮" + TempInfoImgIosBtnKey = "ios_btn" + TempInfoImgIosBtnValue = TempInfoImgCommon + TempInfoImgIosBtnKey + "%s.png" + TempInfoImgIosBtnDesc = "下载引导图-ios按钮" + TempInfoImgWechatBrowserKey = "wechat_browser" + TempInfoImgWechatBrowserValue = TempInfoImgCommon + TempInfoImgWechatBrowserKey + "%s.png" + TempInfoImgWechatBrowserDesc = "微信引导图-拉起浏览器" + TempInfoImgWechatLineKey = "wechat_line" + TempInfoImgWechatLineValue = TempInfoImgCommon + TempInfoImgWechatLineKey + "%s.png" + TempInfoImgWechatLineDesc = "微信引导图-引导线" + TempInfoImgDefaultKey = "default_thank" + TempInfoImgDefaultValue = TempInfoImgCommon + TempInfoImgDefaultKey + ".png" + TempInfoImgDefaultDesc = " 谢谢参与图片" + TempInfoImgAndroidBtnWhiteKey = "android_btn_white" + TempInfoImgAndroidBtnWhiteValue = TempInfoImgCommon + TempInfoImgAndroidBtnWhiteKey + "%s.png" + TempInfoImgAndroidBtnWhiteDesc = "下载引导图-安白底按钮" + TempInfoImgIosBtnWhiteKey = "ios_btn_white" + TempInfoImgIosBtnWhiteValue = TempInfoImgCommon + TempInfoImgIosBtnWhiteKey + "%s.png" + TempInfoImgIosBtnWhiteDesc = "下载引导图-ios白底按钮" +) + +const ( + FissionCashFixLeft = 22 // 现金抽奖固定还剩余的金额 + FissionCashFixEnergy = 499 // 现金抽奖固定能量值 + FissionCashFixEnergyUse = 100 // 现金抽奖固定使用的能量值 + FissionCashFixShare = 1 // 现金抽奖分享固定给的金额 +) + +type FissionCashSpinOne struct { + Id int64 `json:"id"` + Cash float64 `json:"cash"` +} + +var FissionCashSpin = []FissionCashSpinOne{ + {Id: 1, Cash: 0.01}, + {Id: 2, Cash: 8}, + {Id: 3, Cash: 5}, + {Id: 4, Cash: 0.99}, + {Id: 5, Cash: 3}, + {Id: 6, Cash: 2}, +} + +var SpinGetId = []int64{2, 3, 3, 6, 4, 1} + +const ( + PropNameSignCard = "sign_card" // 补签卡 + PropNameFixedDice = "fixed_dice" // 幸运骰子(固定点数) + PropNameUnoThree = "uno_three" // uno+3道具 + PropNameUnoFive = "uno_five" // uno+5道具 + PropNameUnoFix = "uno_fix" // uno+指定颜色道具 +) + +// NewReportFission 报表玩法 +var NewReportFission = []int64{ + IdLuckyGrid, + IdSlotMachine, + IdPrizeWheel, + IdBlindBox, + IdFlip, + IdDice, + IdGrow, + IdQa, + IdQaAudio, + IdQaVideo, + IdChop, + IdWinTogether, + IdReferral, + IdCash, + IdKeep, + IdGold, + IdCoin, + IdSignIn, + IdBallot, + IdPrizeAnswer, + IdPrizeQuiz, + IdVs, + IdUno, + IdGashapon, +} + +// NewEventCpn 是否不是新版事件驱动的玩法 +func NewEventCpn(fissionId int64) bool { + var arr = []int64{ + IdDice, + IdCash, + IdGrow, + IdLuckyGrid, IdPrizeWheel, IdBlindBox, IdSlotMachine, IdFlip, IdGashapon, + IdQa, IdQaVideo, IdQaAudio, IdPrizeAnswer, + IdChop, + IdWinTogether, IdReferral, + IdKeep, + IdGold, + IdCoin, + IdSignIn, + IdBallot, + IdPrizeQuiz, + IdVs, + IdUno, + } + + for _, v := range arr { + if v == fissionId { + return true + } + } + + return false +} + +var FissionByTarget = map[int32][]int64{ + FissionTargetApp: { + IdReferral, IdWinTogether, IdBlindBox, IdPrizeWheel, IdSlotMachine, IdLuckyGrid, IdPrizeQuiz, IdPrizeAnswer, IdDice, IdCash, IdFlip, + }, + FissionTargetConvert: { + IdPrizeWheel, IdSlotMachine, IdBlindBox, IdLuckyGrid, IdFlip, IdGold, + }, + FissionTargetRetain: { + IdSignIn, IdDice, IdGrow, IdQaAudio, IdQaVideo, IdQa, IdBallot, IdChop, IdKeep, IdCoin, IdVs, IdUno, IdGashapon, + }, + FissionTargetAds: { + IdAdsWheel, IdAdsGrid, IdAdsFlip, + }, +} + +const ( + FissionPropMarkDogFood = "dog_food" +) + +var FissionPropMarkTitle = map[string]string{ + FissionPropMarkDogFood: "狗粮", +} + +// FissionPropMark 玩法道具标识 +var FissionPropMark = map[int64]string{ + IdKeep: FissionPropMarkDogFood, //狗粮 +} diff --git a/internal/consts/games.go b/internal/consts/games.go new file mode 100644 index 0000000..891daf4 --- /dev/null +++ b/internal/consts/games.go @@ -0,0 +1,69 @@ +package consts + +type Game struct { + ID int64 + Title string + Img string + Link string +} + +var Games = []Game{ + { + ID: 1, + Img: "/resource/2026/06/10/d8keg5p0b4msm624ivcg.png", + Title: "Penalty Champs", + Link: "https://game-paly.playwithwin.com/penaltychamps22/v2/index.html?site-id=24792654", + }, + { + ID: 2, + Img: "/resource/2026/06/10/d8keg5progthlcfhvsqg.png", + Title: "Football Legends", + Link: "https://game-paly.playwithwin.com/footballlegends/v7/index.html?site-id=24792654", + }, + { + ID: 3, + Img: "/resource/2026/06/10/d8keg5o1bc5r8vr5962g.png", + Title: "Magic and Wizards Match", + Link: "https://game-paly.playwithwin.com/magicandwizardsmatch/v1/index.html?site-id=24792654", + }, + { + ID: 4, + Img: "/resource/2026/06/10/d8keg5o1bc5r8vr59670.png", + Title: "Soccer Bubble Shooter", + Link: "https://game-paly.playwithwin.com/soccerbubbleshooter/v3/index.html?site-id=24792654", + }, + { + ID: 5, + Img: "/resource/2026/06/16/d8ogirn5ar9vkeoif8n0.png", + Title: "Word City Crossed", + Link: "https://game-paly.playwithwin.com/wordcitycrossed/v2/index.html?site-id=24792654", + }, + { + ID: 6, + Img: "/resource/2026/06/10/d8keg5ta5kl0th1o0600.png", + Title: "Word Search", + Link: "https://game-paly.playwithwin.com/wordsearch/v1/index.html?site-id=24792654", + }, + { + ID: 7, + Img: "/resource/2026/06/10/d8keg5o1bc5r8vr5963g.png", + Title: "Ultimate Sudoku", + Link: "https://game-paly.playwithwin.com/ultimatesudoku/v2/index.html?site-id=24792654", + }, + { + ID: 8, + Img: "/resource/2026/06/10/d8keg5p35bitkaefcfhg.png", + Title: "2048", + Link: "https://game-paly.playwithwin.com/20482/v1/index.html?site-id=24792654", + }, +} + +func GameLinkMap() (ids []int64, gameMap map[int64]Game) { + ids = make([]int64, 0, len(Games)) + gameMap = make(map[int64]Game, len(Games)) + for _, v := range Games { + ids = append(ids, v.ID) + gameMap[v.ID] = v + } + return ids, gameMap +} diff --git a/internal/consts/share.go b/internal/consts/share.go new file mode 100644 index 0000000..aaa287c --- /dev/null +++ b/internal/consts/share.go @@ -0,0 +1,279 @@ +package consts + +const ( + //国内 + + Wechat = 1 //微信 + Weibo = 2 //微博 + QQ = 3 //QQ + Zhihu = 4 //知乎 + BZhan = 5 //B站 + HuPu = 6 //虎扑 + Douban = 7 //豆瓣 + BaiduTieBa = 8 //百度贴吧 + JiKe = 9 //即刻 + ZhiShiPlanet = 10 //知识星球 + PipiXia = 11 //皮皮虾 + JianShu = 12 //简书 + XiaoHongShu = 13 //小红书 + + //海外 + + Facebook = 50 //Facebook + WhatsApp = 51 //WhatsApp + Messenger = 52 //Messenger + Instagram = 53 //Instagram + Snapchat = 54 //Snapchat + Telegram = 55 //Telegram + Line = 56 //LINE + Sms = 57 //SMS + Email = 58 //Email + Linkedin = 59 //Linkedin + Twitter = 60 //Twitter + Youtube = 61 //Youtube + TikTok = 62 //TikTok + Discord = 63 //Discord + Reddit = 64 //Reddit +) + +type Share struct { + Id int64 + Title string + Logo string + Scheme string + IosScheme string + Close bool +} + +var ShareTitleMap = shareTitleMap() + +func shareTitleMap() map[int64]string { + list := append(ShareLocList, ShareOverSeaList...) + var data = make(map[int64]string) + for _, v := range list { + data[v.Id] = v.Title + } + return data +} + +var ShareMap = shareMap() + +func shareMap() map[int64]Share { + list := append(ShareLocList, ShareOverSeaList...) + var data = make(map[int64]Share) + for _, v := range list { + if v.Close { + continue + } + data[v.Id] = v + } + return data +} + +var ShareLocList = []Share{ + { + Id: Wechat, + Title: "微信", + Logo: "social_media/Wechat2.png", + Scheme: "weixin://", + IosScheme: "weixin://", + }, + { + Id: Weibo, + Title: "微博", + Logo: "social_media/Weibo2.png", + Scheme: "sinaweibo://userinfo", + IosScheme: "sinaweibo://", + }, + { + Id: Douban, + Title: "豆瓣", + Logo: "social_media/Douban2.png", + Scheme: "douban://douban.com", + IosScheme: "douban://", + }, + { + Id: Zhihu, + Title: "知乎", + Logo: "social_media/Zhihu2.png", + Scheme: "zhihu://", + IosScheme: "zhihu://", + }, + { + Id: BZhan, + Title: "bilibili", + Logo: "social_media/bilibili2.png", + Scheme: "bilibili://home", + IosScheme: "bilibili://", + }, + { + Id: HuPu, + Title: "虎扑", + Logo: "social_media/HuPu.png", + Scheme: "tencent222049://", + IosScheme: "tencent222049://", + Close: true, + }, + { + Id: QQ, + Title: "QQ", + Logo: "social_media/QQ2.png", + Scheme: "mqq://", + IosScheme: "mqq://", + }, + { + Id: BaiduTieBa, + Title: "百度贴吧", + Logo: "social_media/BaiduTieBa.png", + Scheme: "com.baidu.tieba://", + IosScheme: "com.baidu.tieba://", + Close: true, + }, + { + Id: JiKe, + Title: "即刻", + Logo: "social_media/JiKe.png", + Scheme: "com.ruguoapp.jike://", + IosScheme: "com.ruguoapp.jike://", + Close: true, + }, + { + Id: ZhiShiPlanet, + Title: "知识星球", + Logo: "social_media/ZhiShiPlanet.png", + Scheme: "xiaomiquan://", + IosScheme: "xiaomiquan://", + Close: true, + }, + { + Id: PipiXia, + Title: "皮皮虾", + Logo: "social_media/PipiXia.png", + Scheme: "bds://", + IosScheme: "bds://", + Close: true, + }, + { + Id: JianShu, + Title: "简书", + Logo: "social_media/Jianshu2.png", + Scheme: "jianshu://homepage", + IosScheme: "jianshu://", + }, + { + Id: XiaoHongShu, + Title: "小红书", + Logo: "social_media/Xiaohongshu2.png", + Scheme: "xhsdiscover://home/", + IosScheme: "xhsdiscover://home/", + }, +} + +var ShareOverSeaList = []Share{ + { + Id: Facebook, + Title: "Facebook", + Logo: "social_media/Facebook2.png", + Scheme: "fb://Fb", + IosScheme: "fb://Fb", + }, + { + Id: WhatsApp, + Title: "WhatsApp", + Logo: "social_media/Whatsapp2.png", + Scheme: "whatsapp://send?text=${shareText}", + IosScheme: "whatsapp://send?text=wa", + }, + { + Id: Messenger, + Title: "Messenger", + Logo: "social_media/Messenger2.png", + Scheme: "fb-messenger://settings", + IosScheme: "fb-Messenger://", + }, + { + Id: Instagram, + Title: "Instagram", + Logo: "social_media/Instagram2.png", + Scheme: "instagram://direct-inbox", + IosScheme: "instagram://direct-inbox", + }, + { + Id: Snapchat, + Title: "Snapchat", + Logo: "social_media/Snapchat2.png", + Scheme: "snapchat://", + IosScheme: "Snapchat://", + }, + { + Id: Telegram, + Title: "Telegram", + Logo: "social_media/Telegram2.png", + Scheme: "tg://msg?text=${shareText}", + IosScheme: "Telegram://msg?text=${shareText}", + }, + { + Id: Line, + Title: "LINE", + Logo: "social_media/Line2.png", + Scheme: "line://", + IosScheme: "line://", + }, + { + Id: Sms, + Title: "SMS", + Logo: "social_media/SMS2.png", + Scheme: "sms:?body=${shareText}", + IosScheme: "sms:?body=${shareText}", + }, + { + Id: Email, + Title: "Email", + Logo: "social_media/Email.png", + Scheme: "Mailto://", + IosScheme: "Mailto://", + Close: true, + }, + { + Id: Linkedin, + Title: "Linkedin", + Logo: "social_media/Linkedin2.png", + Scheme: "linkedin://profile", + IosScheme: "Linkedin://", + }, + { + Id: Twitter, + Title: "X", + Logo: "social_media/X2.png", + Scheme: "twitter://post?message=${shareText}", + IosScheme: "Twitter://post?message=${shareText}", + }, + { + Id: Youtube, + Title: "YouTube", + Logo: "social_media/Youtube2.png", + Scheme: "vnd.youtube://", + IosScheme: "YouTube://", + }, + { + Id: TikTok, + Title: "TikTok", + Logo: "social_media/TikTok2.png", + Scheme: "snssdk1180://", + IosScheme: "snssdk1180://", + }, + { + Id: Discord, + Title: "Discord", + Logo: "social_media/Discord2.png", + Scheme: "https://discord.com/app", + IosScheme: "https://discord.com/app", + }, + { + Id: Reddit, + Title: "Reddit", + Logo: "social_media/Reddit2.png", + Scheme: "https://www.reddit.com", + IosScheme: "https://www.reddit.com", + }, +} diff --git a/internal/consts/struct.go b/internal/consts/struct.go new file mode 100644 index 0000000..279830c --- /dev/null +++ b/internal/consts/struct.go @@ -0,0 +1,8 @@ +package consts + +type CampaignUserType struct { + LangMark string // 语言标识 + LevelId int64 // 用户等级id标识 + LevelMark string // 用户等级标识 + CountryMark string // 国家标识 +} diff --git a/internal/consts/type.go b/internal/consts/type.go new file mode 100644 index 0000000..01937f5 --- /dev/null +++ b/internal/consts/type.go @@ -0,0 +1,21 @@ +package consts + +type IntType interface { + int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 +} + +type NumberType interface { + int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float64 | float32 +} + +type NormalType interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~string | ~float64 | ~float32 +} + +type DbIdType interface { + int64 | string +} + +type SignNumber interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~float64 | ~float32 +} diff --git a/internal/consts/vars.go b/internal/consts/vars.go new file mode 100644 index 0000000..9ce520c --- /dev/null +++ b/internal/consts/vars.go @@ -0,0 +1,22 @@ +package consts + +import "time" + +var ( + FissionViewer = "~~view~~" // 活动预览用户id +) + +var ( + RunTest = false // RunTest 单元测试运行 + PrintAllLog = false // PrintAllLog 打印全量日志 + CollectSlowLog = false // CollectSlowLog 收集慢业务 +) + +// RunUnix 程序启动的时间,有时候可以拿来做一些切割点 +var RunUnix = time.Now() + +var HelpStatusTitle = map[string]string{ + HelpStatusNotInstall: "未完成安装", + HelpStatusNotRegister: "未完成注册", + HelpStatusNotTask: "未完成任务", +} diff --git a/internal/handler/w_campaign.go b/internal/handler/w_campaign.go new file mode 100644 index 0000000..679eb21 --- /dev/null +++ b/internal/handler/w_campaign.go @@ -0,0 +1,405 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_campaign" +) + +type WCampaignServer struct{} + +// List 活动列表 +func (s *WCampaignServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// Share 社媒选项 +func (s *WCampaignServer) Share(ctx context.Context, req *pb.ShareReq, res *pb.ShareRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Share(req, res) + return err +} + +// Status 修改状态 +func (s *WCampaignServer) Status(ctx context.Context, req *pb.StatusReq, res *pb.StatusRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Status(req, res) + return err +} + +// Destroy 删除活动 +func (s *WCampaignServer) Destroy(ctx context.Context, req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Destroy(req, res) + return err +} + +// Store 创建活动 +func (s *WCampaignServer) Store(ctx context.Context, req *pb.StoreReq, res *pb.StoreRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Store(req, res) + return err +} + +// Update 更新活动 +func (s *WCampaignServer) Update(ctx context.Context, req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Update(req, res) + return err +} + +// Show 活动详情 +func (s *WCampaignServer) Show(ctx context.Context, req *pb.ShowReq, res *pb.ShowRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Show(req, res) + return err +} + +// ChannelList 渠道列表 +func (s *WCampaignServer) ChannelList(ctx context.Context, req *pb.ChannelListReq, res *pb.ChannelListRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChannelList(req, res) + return err +} + +// ChannelCreate 渠道创建 +func (s *WCampaignServer) ChannelCreate(ctx context.Context, req *pb.ChannelCreateReq, res *pb.ChannelCreateRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChannelCreate(req, res) + return err +} + +// ChannelUpdate 渠道创建 +func (s *WCampaignServer) ChannelUpdate(ctx context.Context, req *pb.ChannelUpdateReq, res *pb.ChannelUpdateRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChannelUpdate(req, res) + return err +} + +// ChannelDestroy 渠道创建 +func (s *WCampaignServer) ChannelDestroy(ctx context.Context, req *pb.ChannelDestroyReq, res *pb.ChannelDestroyRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChannelDestroy(req, res) + return err +} + +// KvData 获取活动键值对 +func (s *WCampaignServer) KvData(ctx context.Context, req *pb.KvDataReq, res *pb.KvDataRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.KvData(req, res) + return err +} + +// Cert 认证活动信息 +func (s *WCampaignServer) Cert(ctx context.Context, req *pb.CertReq, res *pb.CertRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Cert(req, res) + return err +} + +// Barrage 活动弹幕 +func (s *WCampaignServer) Barrage(ctx context.Context, req *pb.BarrageReq, res *pb.BarrageRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Barrage(req, res) + return err +} + +// Option 投票选项 +func (s *WCampaignServer) Option(ctx context.Context, req *pb.OptionReq, res *pb.OptionRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Option(req, res) + return err +} + +// RelateDdl 活动关联动态下载页 +func (s *WCampaignServer) RelateDdl(ctx context.Context, req *pb.RelateDdlReq, res *pb.RelateDdlRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.RelateDdl(req, res) + return err +} + +// DdlCampaign 关联动态下载页的活动 +func (s *WCampaignServer) DdlCampaign(ctx context.Context, req *pb.DdlCampaignReq, res *pb.DdlCampaignRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.DdlCampaign(req, res) + return err +} + +// Langs 活动多语言配置信息 +func (s *WCampaignServer) Langs(ctx context.Context, req *pb.LangsReq, res *pb.LangsRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Langs(req, res) + return err +} + +// Lang 活动语言信息 +func (s *WCampaignServer) Lang(ctx context.Context, req *pb.LangReq, res *pb.LangRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Lang(req, res) + return err +} + +// SaveLang 保存活动多语言配置信息 +func (s *WCampaignServer) SaveLang(ctx context.Context, req *pb.SaveLangReq, res *pb.SaveLangRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.SaveLang(req, res) + return err +} + +// DestroyLang 删除活动语言配置信息 +func (s *WCampaignServer) DestroyLang(ctx context.Context, req *pb.DestroyLangReq, res *pb.DestroyLangRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.DestroyLang(req, res) + return err +} + +// LangSelect 活动语言选择 +func (s *WCampaignServer) LangSelect(ctx context.Context, req *pb.LangSelectReq, res *pb.LangSelectRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.LangSelect(req, res) + return err +} + +// CampaignInfo 活动信息 +func (s *WCampaignServer) CampaignInfo(ctx context.Context, req *pb.CampaignInfoReq, res *pb.CampaignInfoRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.CampaignInfo(req, res) + return err +} + +// ShowReward 显示的奖品数据 +func (s *WCampaignServer) ShowReward(ctx context.Context, req *pb.ShowRewardReq, res *pb.ShowRewardRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ShowReward(req, res) + return err +} + +// AdsStore 创建Ads活动 +func (s *WCampaignServer) AdsStore(ctx context.Context, req *pb.AdsStoreReq, res *pb.AdsStoreRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.AdsStore(req, res) + return err +} + +// AdsUpdate 更新Ads活动 +func (s *WCampaignServer) AdsUpdate(ctx context.Context, req *pb.AdsUpdateReq, res *pb.AdsUpdateRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.AdsUpdate(req, res) + return err +} + +// AdsShow Ads活动详情 +func (s *WCampaignServer) AdsShow(ctx context.Context, req *pb.AdsShowReq, res *pb.AdsShowRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.AdsShow(req, res) + return err +} + +// CampaignSelect 活动列表 +func (s *WCampaignServer) CampaignSelect(ctx context.Context, req *pb.CampaignSelectReq, res *pb.CampaignSelectRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.CampaignSelect(req, res) + return err +} + +// RewardDetail 奖品详情 +func (s *WCampaignServer) RewardDetail(ctx context.Context, req *pb.RewardDetailReq, res *pb.RewardDetailRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.RewardDetail(req, res) + return err +} + +// UpdateStock 修改奖品库存 +func (s *WCampaignServer) UpdateStock(ctx context.Context, req *pb.UpdateStockReq, res *pb.UpdateStockRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.UpdateStock(req, res) + return err +} + +// CampaignTz 活动时区数据 +func (s *WCampaignServer) CampaignTz(ctx context.Context, req *pb.CampaignTzReq, res *pb.CampaignTzRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.CampaignTz(req, res) + return err +} + +// CampaignRewardType 活动奖品类型 +func (s *WCampaignServer) CampaignRewardType(ctx context.Context, req *pb.CampaignRewardTypeReq, res *pb.CampaignRewardTypeRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.CampaignRewardType(req, res) + return err +} + +// ChildList 子活动列表 +func (s *WCampaignServer) ChildList(ctx context.Context, req *pb.ChildListReq, res *pb.ChildListRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChildList(req, res) + return err +} + +// ChildStore 子活动列表 +func (s *WCampaignServer) ChildStore(ctx context.Context, req *pb.ChildStoreReq, res *pb.ChildStoreRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChildStore(req, res) + return err +} + +// ChildUpdate 更新子活动 +func (s *WCampaignServer) ChildUpdate(ctx context.Context, req *pb.ChildUpdateReq, res *pb.ChildUpdateRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChildUpdate(req, res) + return err +} + +// ChildShow 子活动活动 +func (s *WCampaignServer) ChildShow(ctx context.Context, req *pb.ChildShowReq, res *pb.ChildShowRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ChildShow(req, res) + return err +} + +// TaskCenterJump 子活动列表 +func (s *WCampaignServer) TaskCenterJump(ctx context.Context, req *pb.TaskCenterJumpReq, res *pb.TaskCenterJumpRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.TaskCenterJump(req, res) + return err +} + +// CondList 活动任务数据 +func (s *WCampaignServer) CondList(ctx context.Context, req *pb.CondListReq, res *pb.CondListRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.CondList(req, res) + return err +} + +// Campaigns 获取活动数据 +func (s *WCampaignServer) Campaigns(ctx context.Context, req *pb.CampaignsReq, res *pb.CampaignsRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.Campaigns(req, res) + return err +} + +// SetLvApi 设置动态用户等级动态api +func (s *WCampaignServer) SetLvApi(ctx context.Context, req *pb.SetLvApiReq, res *pb.SetLvApiRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.SetLvApi(req, res) + return err +} + +// GetLvApi 设置动态用户等级动态api +func (s *WCampaignServer) GetLvApi(ctx context.Context, req *pb.GetLvApiReq, res *pb.GetLvApiRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.GetLvApi(req, res) + return err +} + +// VsSettlement 赛事竞猜结算 +func (s *WCampaignServer) VsSettlement(ctx context.Context, req *pb.VsSettlementReq, res *pb.VsSettlementRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.VsSettlement(req, res) + return err +} + +// VsSettlementInfo 赛事竞猜结算 +func (s *WCampaignServer) VsSettlementInfo(ctx context.Context, req *pb.VsSettlementInfoReq, res *pb.VsSettlementInfoRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.VsSettlementInfo(req, res) + return err +} + +// ActionList 行为列表 +func (s *WCampaignServer) ActionList(ctx context.Context, req *pb.ActionListReq, res *pb.ActionListRes) (err error) { + //初始化服务 + srv := service.WCampaign{} + srv.Init(ctx) + err = srv.ActionList(req, res) + return err +} diff --git a/internal/handler/w_campaign_stat.go b/internal/handler/w_campaign_stat.go new file mode 100644 index 0000000..a68a53b --- /dev/null +++ b/internal/handler/w_campaign_stat.go @@ -0,0 +1,173 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_campaign_stat" +) + +type WCampaignStatServer struct { + ser service.WCampaignStat +} + +// Summary 活动概览数据 +func (s *WCampaignStatServer) Summary(ctx context.Context, req *pb.SummaryReq, res *pb.SummaryRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.Summary(req, res) + return err +} + +// Campaign 活动数据 +func (s *WCampaignStatServer) Campaign(ctx context.Context, req *pb.CampaignReq, res *pb.CampaignRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.Campaign(req, res) + return err +} + +// Related 裂变数据 +func (s *WCampaignStatServer) Related(ctx context.Context, req *pb.RelatedReq, res *pb.RelatedRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.Related(req, res) + return err +} + +// Stat 统计事件数据 +func (s *WCampaignStatServer) Stat(ctx context.Context, req *pb.StatReq, res *pb.StatRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.Stat(req, res) + return err +} + +// Channel 渠道统计 +func (s *WCampaignStatServer) Channel(ctx context.Context, req *pb.ChannelReq, res *pb.ChannelRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.Channel(req, res) + return err +} + +// AdsSummary Ads总揽数据 +func (s *WCampaignStatServer) AdsSummary(ctx context.Context, req *pb.AdsSummaryReq, res *pb.AdsSummaryRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.AdsSummary(req, res) + return err +} + +// AdsTable Ads报表 +func (s *WCampaignStatServer) AdsTable(ctx context.Context, req *pb.AdsTableReq, res *pb.AdsTableRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.AdsTable(req, res) + return err +} + +// AdsReward Ads奖品 +func (s *WCampaignStatServer) AdsReward(ctx context.Context, req *pb.AdsRewardReq, res *pb.AdsRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.AdsReward(req, res) + return err +} + +// InAppBP 应用内埋点埋点 +func (s *WCampaignStatServer) InAppBP(ctx context.Context, req *pb.InAppBPReq, res *pb.InAppBPRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.InAppBP(req, res) + return err +} + +// OutAppBP 应用外埋点 +func (s *WCampaignStatServer) OutAppBP(ctx context.Context, req *pb.OutAppBPReq, res *pb.OutAppBPRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.OutAppBP(req, res) + return err +} + +// ReportInfo 报表信息 +func (s *WCampaignStatServer) ReportInfo(ctx context.Context, req *pb.ReportInfoReq, res *pb.ReportInfoRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.ReportInfo(req, res) + return err +} + +// StatEvent 活动统计的维度 +func (s *WCampaignStatServer) StatEvent(ctx context.Context, req *pb.StatEventReq, res *pb.StatEventRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.StatEvent(req, res) + return err +} + +// DemTitle 维度标题数据 +func (s *WCampaignStatServer) DemTitle(ctx context.Context, req *pb.DemTitleReq, res *pb.DemTitleRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.DemTitle(req, res) + return err +} + +// TopTen 活动前十排行榜 +func (s *WCampaignStatServer) TopTen(ctx context.Context, req *pb.TopTenReq, res *pb.TopTenRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.TopTen(req, res) + return err +} + +// UserCycle 用户明细占比数据 +func (s *WCampaignStatServer) UserCycle(ctx context.Context, req *pb.UserCycleReq, res *pb.UserCycleRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.UserCycle(req, res) + return err +} + +// Active 用户活跃 +func (s *WCampaignStatServer) Active(ctx context.Context, req *pb.ActiveReq, res *pb.ActiveRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.Active(req, res) + return err +} + +// ChildBP 应用内埋点 +func (s *WCampaignStatServer) ChildBP(ctx context.Context, req *pb.ChildBPReq, res *pb.ChildBPRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.ChildBP(req, res) + return err +} + +// ChildReportInfo 子活动报表信息 +func (s *WCampaignStatServer) ChildReportInfo(ctx context.Context, req *pb.ChildReportInfoReq, res *pb.ChildReportInfoRes) (err error) { + //初始化服务 + srv := service.WCampaignStat{} + srv.Init(ctx) + err = srv.ChildReportInfo(req, res) + return err +} diff --git a/internal/handler/w_campaign_user.go b/internal/handler/w_campaign_user.go new file mode 100644 index 0000000..f435521 --- /dev/null +++ b/internal/handler/w_campaign_user.go @@ -0,0 +1,864 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_campaign_user" +) + +type WCampaignUserServer struct{} + +// List 用户列表 +func (s *WCampaignUserServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// Reward 用户奖励 +func (s *WCampaignUserServer) Reward(ctx context.Context, req *pb.RewardReq, res *pb.RewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Reward(req, res) + return err +} + +// Visit 访问活动 +func (s *WCampaignUserServer) Visit(ctx context.Context, req *pb.VisitReq, res *pb.VisitRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Visit(req, res) + return err +} + +// Play 用户活动数据 +func (s *WCampaignUserServer) Play(ctx context.Context, req *pb.PlayReq, res *pb.PlayRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Play(req, res) + return err +} + +// RewardUser 中奖用户列表 +func (s *WCampaignUserServer) RewardUser(ctx context.Context, req *pb.RewardUserReq, res *pb.RewardUserRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.RewardUser(req, res) + return err +} + +// Info 用户信息 +func (s *WCampaignUserServer) Info(ctx context.Context, req *pb.InfoReq, res *pb.InfoRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Info(req, res) + return err +} + +// Rank 排行榜 +func (s *WCampaignUserServer) Rank(ctx context.Context, req *pb.RankReq, res *pb.RankRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Rank(req, res) + return err +} + +// Lottery 活动抽奖 +func (s *WCampaignUserServer) Lottery(ctx context.Context, req *pb.LotteryReq, res *pb.LotteryRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Lottery(req, res) + return err +} + +// Answer 活动答题 +func (s *WCampaignUserServer) Answer(ctx context.Context, req *pb.AnswerReq, res *pb.AnswerRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Answer(req, res) + return err +} + +// Vote 活动投票 +func (s *WCampaignUserServer) Vote(ctx context.Context, req *pb.VoteReq, res *pb.VoteRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Vote(req, res) + return err +} + +// Notify 客户端回调 +func (s *WCampaignUserServer) Notify(ctx context.Context, req *pb.NotifyReq, res *pb.NotifyRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Notify(req, res) + return err +} + +// AcceptReward 领取奖品 +func (s *WCampaignUserServer) AcceptReward(ctx context.Context, req *pb.AcceptRewardReq, res *pb.AcceptRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.AcceptReward(req, res) + return err +} + +// TargetRule 达标规则 +func (s *WCampaignUserServer) TargetRule(ctx context.Context, req *pb.TargetRuleReq, res *pb.TargetRuleRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.TargetRule(req, res) + return err +} + +// Task 我的任务 +func (s *WCampaignUserServer) Task(ctx context.Context, req *pb.TaskReq, res *pb.TaskRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Task(req, res) + return err +} + +// Resend 补发奖品 +func (s *WCampaignUserServer) Resend(ctx context.Context, req *pb.ResendReq, res *pb.ResendRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Resend(req, res) + return err +} + +// DynamicLink 获取用户动态链接 +func (s *WCampaignUserServer) DynamicLink(ctx context.Context, req *pb.DynamicLinkReq, res *pb.DynamicLinkRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.DynamicLink(req, res) + return err +} + +// DylinkShow 获取用户动态链接详情 +func (s *WCampaignUserServer) DylinkShow(ctx context.Context, req *pb.DylinkShowReq, res *pb.DylinkShowRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.DylinkShow(req, res) + return err +} + +// SignIn 我的签到板 +func (s *WCampaignUserServer) SignIn(ctx context.Context, req *pb.SignInReq, res *pb.SignInRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.SignIn(req, res) + return err +} + +// Sign 签到 +func (s *WCampaignUserServer) Sign(ctx context.Context, req *pb.SignReq, res *pb.SignRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Sign(req, res) + return err +} + +// DiceMap 大富翁地图 +func (s *WCampaignUserServer) DiceMap(ctx context.Context, req *pb.DiceMapReq, res *pb.DiceMapRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.DiceMap(req, res) + return err +} + +// Dice 大富翁骰子 +func (s *WCampaignUserServer) Dice(ctx context.Context, req *pb.DiceReq, res *pb.DiceRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Dice(req, res) + return err +} + +// Grow 成长生命体 +func (s *WCampaignUserServer) Grow(ctx context.Context, req *pb.GrowReq, res *pb.GrowRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Grow(req, res) + return err +} + +// GetGrow 成长生命体 +func (s *WCampaignUserServer) GetGrow(ctx context.Context, req *pb.GetGrowReq, res *pb.GetGrowRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GetGrow(req, res) + return err +} + +// Feed 饲养生命体 +func (s *WCampaignUserServer) Feed(ctx context.Context, req *pb.FeedReq, res *pb.FeedRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Feed(req, res) + return err +} + +// GetFeed 领取饲养道具 +func (s *WCampaignUserServer) GetFeed(ctx context.Context, req *pb.GetFeedReq, res *pb.GetFeedRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GetFeed(req, res) + return err +} + +// GrowRecord 成长记录 +func (s *WCampaignUserServer) GrowRecord(ctx context.Context, req *pb.GrowRecordReq, res *pb.GrowRecordRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GrowRecord(req, res) + return err +} + +// ContentLink 内容链接 +func (s *WCampaignUserServer) ContentLink(ctx context.Context, req *pb.ContentLinkReq, res *pb.ContentLinkRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ContentLink(req, res) + return err +} + +// LinkContent 链接内容 +func (s *WCampaignUserServer) LinkContent(ctx context.Context, req *pb.LinkContentReq, res *pb.LinkContentRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.LinkContent(req, res) + return err +} + +// ChopSelect 选择砍一刀奖品 +func (s *WCampaignUserServer) ChopSelect(ctx context.Context, req *pb.ChopSelectReq, res *pb.ChopSelectRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChopSelect(req, res) + return err +} + +// ChopReselect 重选砍一刀奖品 +func (s *WCampaignUserServer) ChopReselect(ctx context.Context, req *pb.ChopReselectReq, res *pb.ChopReselectRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChopReselect(req, res) + return err +} + +// ChopHelp 砍一刀助力记录 +func (s *WCampaignUserServer) ChopHelp(ctx context.Context, req *pb.ChopHelpReq, res *pb.ChopHelpRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChopHelp(req, res) + return err +} + +// LevelList 用户等级列表 +func (s *WCampaignUserServer) LevelList(ctx context.Context, req *pb.LevelListReq, res *pb.LevelListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.LevelList(req, res) + return err +} + +// LevelStore 创建用户等级 +func (s *WCampaignUserServer) LevelStore(ctx context.Context, req *pb.LevelStoreReq, res *pb.LevelStoreRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.LevelStore(req, res) + return err +} + +// LevelEdit 更新用户等级 +func (s *WCampaignUserServer) LevelEdit(ctx context.Context, req *pb.LevelEditReq, res *pb.LevelEditRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.LevelEdit(req, res) + return err +} + +// LevelDestroy 删除用户等级 +func (s *WCampaignUserServer) LevelDestroy(ctx context.Context, req *pb.LevelDestroyReq, res *pb.LevelDestroyRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.LevelDestroy(req, res) + return err +} + +// ProjectList 项目参与用户列表 +func (s *WCampaignUserServer) ProjectList(ctx context.Context, req *pb.ProjectListReq, res *pb.ProjectListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ProjectList(req, res) + return err +} + +// FinishStep 完成现金抽奖阶段 +func (s *WCampaignUserServer) FinishStep(ctx context.Context, req *pb.FinishStepReq, res *pb.FinishStepRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.FinishStep(req, res) + return err +} + +// Spin 现金转盘抽奖 +func (s *WCampaignUserServer) Spin(ctx context.Context, req *pb.SpinReq, res *pb.SpinRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Spin(req, res) + return err +} + +// CashRecords 现金转盘记录 +func (s *WCampaignUserServer) CashRecords(ctx context.Context, req *pb.CashRecordsReq, res *pb.CashRecordsRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.CashRecords(req, res) + return err +} + +// MixReward 合成奖品 +func (s *WCampaignUserServer) MixReward(ctx context.Context, req *pb.MixRewardReq, res *pb.MixRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.MixReward(req, res) + return err +} + +// DiceRecord 骰子记录 +func (s *WCampaignUserServer) DiceRecord(ctx context.Context, req *pb.DiceRecordReq, res *pb.DiceRecordRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.DiceRecord(req, res) + return err +} + +// RewardForm 奖品需要填写的表单 +func (s *WCampaignUserServer) RewardForm(ctx context.Context, req *pb.RewardFormReq, res *pb.RewardFormRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.RewardForm(req, res) + return err +} + +// SubmitForm 提交表单 +func (s *WCampaignUserServer) SubmitForm(ctx context.Context, req *pb.SubmitFormReq, res *pb.SubmitFormRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.SubmitForm(req, res) + return err +} + +// GetAdsUrl 广告停留回传 +func (s *WCampaignUserServer) GetAdsUrl(ctx context.Context, req *pb.GetAdsUrlReq, res *pb.GetAdsUrlRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GetAdsUrl(req, res) + return err +} + +// AdsStay 广告停留回传 +func (s *WCampaignUserServer) AdsStay(ctx context.Context, req *pb.AdsStayReq, res *pb.AdsStayRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.AdsStay(req, res) + return err +} + +// ClueNotified 通知信息已经被接收 +func (s *WCampaignUserServer) ClueNotified(ctx context.Context, req *pb.ClueNotifiedReq, res *pb.ClueNotifiedRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ClueNotified(req, res) + return err +} + +// ChangeUserLevel 修改用户等级 +func (s *WCampaignUserServer) ChangeUserLevel(ctx context.Context, req *pb.ChangeUserLevelReq, res *pb.ChangeUserLevelRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChangeUserLevel(req, res) + return err +} + +// ChopReward 砍一刀可选奖品 +func (s *WCampaignUserServer) ChopReward(ctx context.Context, req *pb.ChopRewardReq, res *pb.ChopRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChopReward(req, res) + return err +} + +// HelpPercent 助力进度 +func (s *WCampaignUserServer) HelpPercent(ctx context.Context, req *pb.HelpPercentReq, res *pb.HelpPercentRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.HelpPercent(req, res) + return err +} + +// InvokeCond 触发前置条件 +func (s *WCampaignUserServer) InvokeCond(ctx context.Context, req *pb.InvokeCondReq, res *pb.InvokeCondRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.InvokeCond(req, res) + return err +} + +// KeepReward 激励养成可选奖品 +func (s *WCampaignUserServer) KeepReward(ctx context.Context, req *pb.KeepRewardReq, res *pb.KeepRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepReward(req, res) + return err +} + +// KeepSelect 选择激励养成奖品 +func (s *WCampaignUserServer) KeepSelect(ctx context.Context, req *pb.KeepSelectReq, res *pb.KeepSelectRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepSelect(req, res) + return err +} + +// KeepCollect 激励养成收集一级道具 +func (s *WCampaignUserServer) KeepCollect(ctx context.Context, req *pb.KeepCollectReq, res *pb.KeepCollectRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepCollect(req, res) + return err +} + +// KeepFeed 激励养成收集一级道具 +func (s *WCampaignUserServer) KeepFeed(ctx context.Context, req *pb.KeepFeedReq, res *pb.KeepFeedRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepFeed(req, res) + return err +} + +// MachineSave 激励养成保存机器道具 +func (s *WCampaignUserServer) MachineSave(ctx context.Context, req *pb.MachineSaveReq, res *pb.MachineSaveRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.MachineSave(req, res) + return err +} + +// MachineRecycle 激励养成保存机器道具道具 +func (s *WCampaignUserServer) MachineRecycle(ctx context.Context, req *pb.MachineRecycleReq, res *pb.MachineRecycleRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.MachineRecycle(req, res) + return err +} + +// GetPropFeed 收喂养次数的道具 +func (s *WCampaignUserServer) GetPropFeed(ctx context.Context, req *pb.GetPropFeedReq, res *pb.GetPropFeedRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GetPropFeed(req, res) + return err +} + +// KeepLog 激励养成记录 +func (s *WCampaignUserServer) KeepLog(ctx context.Context, req *pb.KeepLogReq, res *pb.KeepLogRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepLog(req, res) + return err +} + +// KeepReselect 激励养成重新选择 +func (s *WCampaignUserServer) KeepReselect(ctx context.Context, req *pb.KeepReselectReq, res *pb.KeepReselectRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepReselect(req, res) + return err +} + +// KeepGuide 激励养成指引 +func (s *WCampaignUserServer) KeepGuide(ctx context.Context, req *pb.KeepGuideReq, res *pb.KeepGuideRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepGuide(req, res) + return err +} + +// KeepFirstInvite 激励养成首邀状态 +func (s *WCampaignUserServer) KeepFirstInvite(ctx context.Context, req *pb.KeepFirstInviteReq, res *pb.KeepFirstInviteRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.KeepFirstInvite(req, res) + return err +} + +// Child 子活动信息 +func (s *WCampaignUserServer) Child(ctx context.Context, req *pb.ChildReq, res *pb.ChildRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Child(req, res) + return err +} + +// ChildActive 参与子活动 +func (s *WCampaignUserServer) ChildActive(ctx context.Context, req *pb.ChildActiveReq, res *pb.ChildActiveRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChildActive(req, res) + return err +} + +// GoldFinishStep 完成金币任务阶段 +func (s *WCampaignUserServer) GoldFinishStep(ctx context.Context, req *pb.GoldFinishStepReq, res *pb.GoldFinishStepRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GoldFinishStep(req, res) + return err +} + +// GoldNotify 金币获取通知 +func (s *WCampaignUserServer) GoldNotify(ctx context.Context, req *pb.GoldNotifyReq, res *pb.GoldNotifyRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GoldNotify(req, res) + return err +} + +// GoldRecord 金币获取记录 +func (s *WCampaignUserServer) GoldRecord(ctx context.Context, req *pb.GoldRecordReq, res *pb.GoldRecordRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.GoldRecord(req, res) + return err +} + +// Deduct 扣除积分 +func (s *WCampaignUserServer) Deduct(ctx context.Context, req *pb.DeductReq, res *pb.DeductRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Deduct(req, res) + return err +} + +// Gain 领取积分 +func (s *WCampaignUserServer) Gain(ctx context.Context, req *pb.GainReq, res *pb.GainRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Gain(req, res) + return err +} + +// CoinRecord 金币池记录 +func (s *WCampaignUserServer) CoinRecord(ctx context.Context, req *pb.CoinRecordReq, res *pb.CoinRecordRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.CoinRecord(req, res) + return err +} + +// ChildList 子活动用户列表 +func (s *WCampaignUserServer) ChildList(ctx context.Context, req *pb.ChildListReq, res *pb.ChildListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChildList(req, res) + return err +} + +// ReceiveReward 领取奖励 +func (s *WCampaignUserServer) ReceiveReward(ctx context.Context, req *pb.ReceiveRewardReq, res *pb.ReceiveRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ReceiveReward(req, res) + return err +} + +// LotteryLog 抽奖玩法日志 +func (s *WCampaignUserServer) LotteryLog(ctx context.Context, req *pb.LotteryLogReq, res *pb.LotteryLogRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.LotteryLog(req, res) + return err +} + +// UserList 活动用户数据 +func (s *WCampaignUserServer) UserList(ctx context.Context, req *pb.UserListReq, res *pb.UserListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.UserList(req, res) + return err +} + +// CashAgain 现金大抽奖再玩一次 +func (s *WCampaignUserServer) CashAgain(ctx context.Context, req *pb.CashAgainReq, res *pb.CashAgainRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.CashAgain(req, res) + return err +} + +// MarkLevel 用户等级标识列表 +func (s *WCampaignUserServer) MarkLevel(ctx context.Context, req *pb.MarkLevelReq, res *pb.MarkLevelRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.MarkLevel(req, res) + return err +} + +// DiceCollect 用户手机碎片 +func (s *WCampaignUserServer) DiceCollect(ctx context.Context, req *pb.DiceCollectReq, res *pb.DiceCollectRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.DiceCollect(req, res) + return err +} + +// ClientReward 用户手机碎片 +func (s *WCampaignUserServer) ClientReward(ctx context.Context, req *pb.ClientRewardReq, res *pb.ClientRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ClientReward(req, res) + return err +} + +// PointsUse 积分兑换 +func (s *WCampaignUserServer) PointsUse(ctx context.Context, req *pb.PointsUseReq, res *pb.PointsUseRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.PointsUse(req, res) + return err +} + +// Chat Ai聊天 +func (s *WCampaignUserServer) Chat(ctx context.Context, req *pb.ChatReq, res *pb.ChatRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Chat(req, res) + return err +} + +// ChatList Ai聊天 +func (s *WCampaignUserServer) ChatList(ctx context.Context, req *pb.ChatListReq, res *pb.ChatListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ChatList(req, res) + return err +} + +// ScheduleList 赛程信息 +func (s *WCampaignUserServer) ScheduleList(ctx context.Context, req *pb.ScheduleListReq, res *pb.ScheduleListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.ScheduleList(req, res) + return err +} + +// MallList 用户商城奖品列表 +func (s *WCampaignUserServer) MallList(ctx context.Context, req *pb.MallListReq, res *pb.MallListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.MallList(req, res) + return err +} + +// Exchange 商城奖品兑换 +func (s *WCampaignUserServer) Exchange(ctx context.Context, req *pb.ExchangeReq, res *pb.ExchangeRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Exchange(req, res) + return err +} + +// VoteList 投票列表 +func (s *WCampaignUserServer) VoteList(ctx context.Context, req *pb.VoteListReq, res *pb.VoteListRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.VoteList(req, res) + return err +} + +// VsTipReward 接受投票结果 +func (s *WCampaignUserServer) VsTipReward(ctx context.Context, req *pb.VsTipRewardReq, res *pb.VsTipRewardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.VsTipReward(req, res) + return err +} + +// UnoRandCard uno随机牌 +func (s *WCampaignUserServer) UnoRandCard(ctx context.Context, req *pb.UnoRandCardReq, res *pb.UnoRandCardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.UnoRandCard(req, res) + return err +} + +// UnoClaim uno领取牌奖励 +func (s *WCampaignUserServer) UnoClaim(ctx context.Context, req *pb.UnoClaimReq, res *pb.UnoClaimRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.UnoClaim(req, res) + return err +} + +// UnoCard uno卡牌 +func (s *WCampaignUserServer) UnoCard(ctx context.Context, req *pb.UnoCardReq, res *pb.UnoCardRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.UnoCard(req, res) + return err +} + +// Show 用户详情 +func (s *WCampaignUserServer) Show(ctx context.Context, req *pb.ShowReq, res *pb.ShowRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.Show(req, res) + return err +} + +// EventFirstVisit 首次访问活动 +func (s *WCampaignUserServer) EventFirstVisit(ctx context.Context, req *pb.EventFirstVisitReq, res *pb.EventFirstVisitRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.EventFirstVisit(req, res) + return err +} + +// FindByUniq 通过唯一键找用户id +func (s *WCampaignUserServer) FindByUniq(ctx context.Context, req *pb.FindByUniqReq, res *pb.FindByUniqRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.FindByUniq(req, res) + return err +} + +// TaskTip 任务提示 +func (s *WCampaignUserServer) TaskTip(ctx context.Context, req *pb.TaskTipReq, res *pb.TaskTipRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.TaskTip(req, res) + return err +} + +// TaskTipOk 任务提示完成 +func (s *WCampaignUserServer) TaskTipOk(ctx context.Context, req *pb.TaskTipOkReq, res *pb.TaskTipOkRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.TaskTipOk(req, res) + return err +} + +// CoinLog 金币日志 +func (s *WCampaignUserServer) CoinLog(ctx context.Context, req *pb.CoinLogReq, res *pb.CoinLogRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.CoinLog(req, res) + return err +} + +// AnswerHistory 答题历史 +func (s *WCampaignUserServer) AnswerHistory(ctx context.Context, req *pb.AnswerHistoryReq, res *pb.AnswerHistoryRes) (err error) { + //初始化服务 + srv := service.WCampaignUser{} + srv.Init(ctx) + err = srv.AnswerHistory(req, res) + return err +} diff --git a/internal/handler/w_coin.go b/internal/handler/w_coin.go new file mode 100644 index 0000000..63f9dd9 --- /dev/null +++ b/internal/handler/w_coin.go @@ -0,0 +1,27 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_coin" +) + +type WCoinServer struct{} + +// Save 积分配置保存 +func (s *WCoinServer) Save(ctx context.Context, req *pb.SaveReq, res *pb.SaveRes) (err error) { + //初始化服务 + srv := service.WCoin{} + srv.Init(ctx) + err = srv.Save(req, res) + return err +} + +// Show 积分配置展示 +func (s *WCoinServer) Show(ctx context.Context, req *pb.ShowReq, res *pb.ShowRes) (err error) { + //初始化服务 + srv := service.WCoin{} + srv.Init(ctx) + err = srv.Show(req, res) + return err +} diff --git a/internal/handler/w_common.go b/internal/handler/w_common.go new file mode 100644 index 0000000..8a06e03 --- /dev/null +++ b/internal/handler/w_common.go @@ -0,0 +1,81 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_common" +) + +type WCommonServer struct{} + +// PolicyToken 获取阿里云token +func (s *WCommonServer) PolicyToken(ctx context.Context, req *pb.PolicyTokenReq, res *pb.PolicyTokenRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.PolicyToken(req, res) + return err +} + +// Whitelist 服务器白名单 +func (s *WCommonServer) Whitelist(ctx context.Context, req *pb.WhitelistReq, res *pb.WhitelistRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.Whitelist(req, res) + return err +} + +// Download 下载 +func (s *WCommonServer) Download(ctx context.Context, req *pb.DownloadReq, res *pb.DownloadRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.Download(req, res) + return err +} + +// DownloadStatus 下载状态 +func (s *WCommonServer) DownloadStatus(ctx context.Context, req *pb.DownloadStatusReq, res *pb.DownloadStatusRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.DownloadStatus(req, res) + return err +} + +// OperateLog dashboard操作日志 +func (s *WCommonServer) OperateLog(ctx context.Context, req *pb.OperateLogReq, res *pb.OperateLogRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.OperateLog(req, res) + return err +} + +// SaveMaterial 保存素材 +func (s *WCommonServer) SaveMaterial(ctx context.Context, req *pb.SaveMaterialReq, res *pb.SaveMaterialRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.SaveMaterial(req, res) + return err +} + +// MaterialList 素材列表 +func (s *WCommonServer) MaterialList(ctx context.Context, req *pb.MaterialListReq, res *pb.MaterialListRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.MaterialList(req, res) + return err +} + +// CompanyMade 企业定制组件列表 +func (s *WCommonServer) CompanyMade(ctx context.Context, req *pb.CompanyMadeReq, res *pb.CompanyMadeRes) (err error) { + //初始化服务 + srv := service.WCommon{} + srv.Init(ctx) + err = srv.CompanyMade(req, res) + return err +} diff --git a/internal/handler/w_fission.go b/internal/handler/w_fission.go new file mode 100644 index 0000000..fde1c93 --- /dev/null +++ b/internal/handler/w_fission.go @@ -0,0 +1,99 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_fission" +) + +type WFissionServer struct{} + +// List 玩法列表 +func (s *WFissionServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// TemplateList 玩法模版列表 +func (s *WFissionServer) TemplateList(ctx context.Context, req *pb.TemplateListReq, res *pb.TemplateListRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.TemplateList(req, res) + return err +} + +// TemplateInfo 玩法模版信息 +func (s *WFissionServer) TemplateInfo(ctx context.Context, req *pb.TemplateInfoReq, res *pb.TemplateInfoRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.TemplateInfo(req, res) + return err +} + +// CreateTempGroup 创建模板组 +func (s *WFissionServer) CreateTempGroup(ctx context.Context, req *pb.CreateTempGroupReq, res *pb.CreateTempGroupRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.CreateTempGroup(req, res) + return err +} + +// CreateTemp 玩法模版列表 +func (s *WFissionServer) CreateTemp(ctx context.Context, req *pb.CreateTempReq, res *pb.CreateTempRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.CreateTemp(req, res) + return err +} + +// CreateTempImg 玩法模版列表 +func (s *WFissionServer) CreateTempImg(ctx context.Context, req *pb.CreateTempImgReq, res *pb.CreateTempImgRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.CreateTempImg(req, res) + return err +} + +// CreateTempLang 玩法模版列表 +func (s *WFissionServer) CreateTempLang(ctx context.Context, req *pb.CreateTempLangReq, res *pb.CreateTempLangRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.CreateTempLang(req, res) + return err +} + +// UpdateTempImg 更新玩法图片配置 +func (s *WFissionServer) UpdateTempImg(ctx context.Context, req *pb.UpdateTempImgReq, res *pb.UpdateTempImgRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.UpdateTempImg(req, res) + return err +} + +// UpdateTempLang 更新玩法语言配置 +func (s *WFissionServer) UpdateTempLang(ctx context.Context, req *pb.UpdateTempLangReq, res *pb.UpdateTempLangRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.UpdateTempLang(req, res) + return err +} + +// UpdateTempGroup 更新模板组 +func (s *WFissionServer) UpdateTempGroup(ctx context.Context, req *pb.UpdateTempGroupReq, res *pb.UpdateTempGroupRes) (err error) { + //初始化服务 + srv := service.WFission{} + srv.Init(ctx) + err = srv.UpdateTempGroup(req, res) + return err +} diff --git a/internal/handler/w_fission_web.go b/internal/handler/w_fission_web.go new file mode 100644 index 0000000..7f36047 --- /dev/null +++ b/internal/handler/w_fission_web.go @@ -0,0 +1,63 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_fission_web" +) + +type WFissionWebServer struct{} + +// GetWebReward 抽取站外奖品 +func (s *WFissionWebServer) GetWebReward(ctx context.Context, req *pb.GetWebRewardReq, res *pb.GetWebRewardRes) (err error) { + //初始化服务 + srv := service.WFissionWeb{} + srv.Init(ctx) + err = srv.GetWebReward(req, res) + return err +} + +// BindWeb 绑定站外活动 +func (s *WFissionWebServer) BindWeb(ctx context.Context, req *pb.BindWebReq, res *pb.BindWebRes) (err error) { + //初始化服务 + srv := service.WFissionWeb{} + srv.Init(ctx) + err = srv.BindWeb(req, res) + return err +} + +// WebReward 用户站外奖 +func (s *WFissionWebServer) WebReward(ctx context.Context, req *pb.WebRewardReq, res *pb.WebRewardRes) (err error) { + //初始化服务 + srv := service.WFissionWeb{} + srv.Init(ctx) + err = srv.WebReward(req, res) + return err +} + +// WebAnswer 用户站外答题 +func (s *WFissionWebServer) WebAnswer(ctx context.Context, req *pb.WebAnswerReq, res *pb.WebAnswerRes) (err error) { + //初始化服务 + srv := service.WFissionWeb{} + srv.Init(ctx) + err = srv.WebAnswer(req, res) + return err +} + +// AdsUser Ads用户数据 +func (s *WFissionWebServer) AdsUser(ctx context.Context, req *pb.AdsUserReq, res *pb.AdsUserRes) (err error) { + //初始化服务 + srv := service.WFissionWeb{} + srv.Init(ctx) + err = srv.AdsUser(req, res) + return err +} + +// AdsLottery Ads抽奖 +func (s *WFissionWebServer) AdsLottery(ctx context.Context, req *pb.AdsLotteryReq, res *pb.AdsLotteryRes) (err error) { + //初始化服务 + srv := service.WFissionWeb{} + srv.Init(ctx) + err = srv.AdsLottery(req, res) + return err +} diff --git a/internal/handler/w_games.go b/internal/handler/w_games.go new file mode 100644 index 0000000..ac16e3d --- /dev/null +++ b/internal/handler/w_games.go @@ -0,0 +1,90 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_games" +) + +type WGamesServer struct{} + +// LinkList 链接列表 +func (s *WGamesServer) LinkList(ctx context.Context, req *pb.LinkListReq, res *pb.LinkListRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.LinkList(req, res) + return err +} + +// Visit 访问小游戏 +func (s *WGamesServer) Visit(ctx context.Context, req *pb.VisitReq, res *pb.VisitRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.Visit(req, res) + return err +} + +// List 游戏列表 +func (s *WGamesServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// LinkStore 创建链接 +func (s *WGamesServer) LinkStore(ctx context.Context, req *pb.LinkStoreReq, res *pb.LinkStoreRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.LinkStore(req, res) + return err +} + +// LinkUpdate 更新链接 +func (s *WGamesServer) LinkUpdate(ctx context.Context, req *pb.LinkUpdateReq, res *pb.LinkUpdateRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.LinkUpdate(req, res) + return err +} + +// LinkDestroy 删除链接 +func (s *WGamesServer) LinkDestroy(ctx context.Context, req *pb.LinkDestroyReq, res *pb.LinkDestroyRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.LinkDestroy(req, res) + return err +} + +// Trace 跟踪小游戏 +func (s *WGamesServer) Trace(ctx context.Context, req *pb.TraceReq, res *pb.TraceRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.Trace(req, res) + return err +} + +// Overview 小游戏统计 +func (s *WGamesServer) Overview(ctx context.Context, req *pb.OverviewReq, res *pb.OverviewRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.Overview(req, res) + return err +} + +// Trend 小游戏趋势 +func (s *WGamesServer) Trend(ctx context.Context, req *pb.TrendReq, res *pb.TrendRes) (err error) { + //初始化服务 + srv := service.WGames{} + srv.Init(ctx) + err = srv.Trend(req, res) + return err +} diff --git a/internal/handler/w_library.go b/internal/handler/w_library.go new file mode 100644 index 0000000..02203fa --- /dev/null +++ b/internal/handler/w_library.go @@ -0,0 +1,108 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_library" +) + +type WLibraryServer struct{} + +// QaGroup 题库列表 +func (s *WLibraryServer) QaGroup(ctx context.Context, req *pb.QaGroupReq, res *pb.QaGroupRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.QaGroup(req, res) + return err +} + +// StoreQaGroup 创建题库 +func (s *WLibraryServer) StoreQaGroup(ctx context.Context, req *pb.StoreQaGroupReq, res *pb.StoreQaGroupRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.StoreQaGroup(req, res) + return err +} + +// UpdateQaGroup 更新题库 +func (s *WLibraryServer) UpdateQaGroup(ctx context.Context, req *pb.UpdateQaGroupReq, res *pb.UpdateQaGroupRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.UpdateQaGroup(req, res) + return err +} + +// DestroyQaGroup 删除题库 +func (s *WLibraryServer) DestroyQaGroup(ctx context.Context, req *pb.DestroyQaGroupReq, res *pb.DestroyQaGroupRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.DestroyQaGroup(req, res) + return err +} + +// QaList 问题列表 +func (s *WLibraryServer) QaList(ctx context.Context, req *pb.QaListReq, res *pb.QaListRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.QaList(req, res) + return err +} + +// StoreQa 创建题目 +func (s *WLibraryServer) StoreQa(ctx context.Context, req *pb.StoreQaReq, res *pb.StoreQaRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.StoreQa(req, res) + return err +} + +// UpdateQa 更新题目 +func (s *WLibraryServer) UpdateQa(ctx context.Context, req *pb.UpdateQaReq, res *pb.UpdateQaRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.UpdateQa(req, res) + return err +} + +// DestroyQa 删除题目 +func (s *WLibraryServer) DestroyQa(ctx context.Context, req *pb.DestroyQaReq, res *pb.DestroyQaRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.DestroyQa(req, res) + return err +} + +// QaGroupSelect 题库选项 +func (s *WLibraryServer) QaGroupSelect(ctx context.Context, req *pb.QaGroupSelectReq, res *pb.QaGroupSelectRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.QaGroupSelect(req, res) + return err +} + +// QaRand 随机问题 +func (s *WLibraryServer) QaRand(ctx context.Context, req *pb.QaRandReq, res *pb.QaRandRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.QaRand(req, res) + return err +} + +// QaShow 问题详情 +func (s *WLibraryServer) QaShow(ctx context.Context, req *pb.QaShowReq, res *pb.QaShowRes) (err error) { + //初始化服务 + srv := service.WLibrary{} + srv.Init(ctx) + err = srv.QaShow(req, res) + return err +} diff --git a/internal/handler/w_mall.go b/internal/handler/w_mall.go new file mode 100644 index 0000000..e32ff0f --- /dev/null +++ b/internal/handler/w_mall.go @@ -0,0 +1,126 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_mall" +) + +type WMallServer struct{} + +// List 商城列表 +func (s *WMallServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// Store 商城创建 +func (s *WMallServer) Store(ctx context.Context, req *pb.StoreReq, res *pb.StoreRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.Store(req, res) + return err +} + +// Update 商城更新 +func (s *WMallServer) Update(ctx context.Context, req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.Update(req, res) + return err +} + +// Destroy 商城删除 +func (s *WMallServer) Destroy(ctx context.Context, req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.Destroy(req, res) + return err +} + +// ItemList 商城奖品列表 +func (s *WMallServer) ItemList(ctx context.Context, req *pb.ItemListReq, res *pb.ItemListRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.ItemList(req, res) + return err +} + +// ItemStore 商城奖品创建 +func (s *WMallServer) ItemStore(ctx context.Context, req *pb.ItemStoreReq, res *pb.ItemStoreRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.ItemStore(req, res) + return err +} + +// ItemUpdate 商城奖品更新 +func (s *WMallServer) ItemUpdate(ctx context.Context, req *pb.ItemUpdateReq, res *pb.ItemUpdateRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.ItemUpdate(req, res) + return err +} + +// ItemStatus 商城奖品状态修改 +func (s *WMallServer) ItemStatus(ctx context.Context, req *pb.ItemStatusReq, res *pb.ItemStatusRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.ItemStatus(req, res) + return err +} + +// ItemSort 商城奖品排序 +func (s *WMallServer) ItemSort(ctx context.Context, req *pb.ItemSortReq, res *pb.ItemSortRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.ItemSort(req, res) + return err +} + +// Select 商城选择 +func (s *WMallServer) Select(ctx context.Context, req *pb.SelectReq, res *pb.SelectRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.Select(req, res) + return err +} + +// RelateMall 关联商城 +func (s *WMallServer) RelateMall(ctx context.Context, req *pb.RelateMallReq, res *pb.RelateMallRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.RelateMall(req, res) + return err +} + +// UserItemList 用户商城奖品列表 +func (s *WMallServer) UserItemList(ctx context.Context, req *pb.UserItemListReq, res *pb.UserItemListRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.UserItemList(req, res) + return err +} + +// ExchangeItem 商城奖品兑换 +func (s *WMallServer) ExchangeItem(ctx context.Context, req *pb.ExchangeItemReq, res *pb.ExchangeItemRes) (err error) { + //初始化服务 + srv := service.WMall{} + srv.Init(ctx) + err = srv.ExchangeItem(req, res) + return err +} diff --git a/internal/handler/w_open_platform.go b/internal/handler/w_open_platform.go new file mode 100644 index 0000000..d7f5466 --- /dev/null +++ b/internal/handler/w_open_platform.go @@ -0,0 +1,36 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_open_platform" +) + +type WOpenPlatformServer struct{} + +// UserList 开放平台用户列表 +func (s *WOpenPlatformServer) UserList(ctx context.Context, req *pb.UserListReq, res *pb.UserListRes) (err error) { + //初始化服务 + srv := service.WOpenPlatform{} + srv.Init(ctx) + err = srv.UserList(req, res) + return err +} + +// CampaignInfo 开发平台活动信息 +func (s *WOpenPlatformServer) CampaignInfo(ctx context.Context, req *pb.CampaignInfoReq, res *pb.CampaignInfoRes) (err error) { + //初始化服务 + srv := service.WOpenPlatform{} + srv.Init(ctx) + err = srv.CampaignInfo(req, res) + return err +} + +// Player 用户在活动中的玩家数据 +func (s *WOpenPlatformServer) Player(ctx context.Context, req *pb.PlayerReq, res *pb.PlayerRes) (err error) { + //初始化服务 + srv := service.WOpenPlatform{} + srv.Init(ctx) + err = srv.Player(req, res) + return err +} diff --git a/internal/handler/w_project.go b/internal/handler/w_project.go new file mode 100644 index 0000000..2a82b96 --- /dev/null +++ b/internal/handler/w_project.go @@ -0,0 +1,162 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_project" +) + +type WProjectServer struct{} + +// Select 项目选择列表 +func (s *WProjectServer) Select(ctx context.Context, req *pb.SelectReq, res *pb.SelectRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.Select(req, res) + return err +} + +// List 项目列表 +func (s *WProjectServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// Show 项目详情 +func (s *WProjectServer) Show(ctx context.Context, req *pb.ShowReq, res *pb.ShowRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.Show(req, res) + return err +} + +// Store 创建项目 +func (s *WProjectServer) Store(ctx context.Context, req *pb.StoreReq, res *pb.StoreRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.Store(req, res) + return err +} + +// Update 更新项目 +func (s *WProjectServer) Update(ctx context.Context, req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.Update(req, res) + return err +} + +// Destroy 删除项目 +func (s *WProjectServer) Destroy(ctx context.Context, req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.Destroy(req, res) + return err +} + +// Cert 项目认证 +func (s *WProjectServer) Cert(ctx context.Context, req *pb.CertReq, res *pb.CertRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.Cert(req, res) + return err +} + +// ProjectSecret 项目私钥 +func (s *WProjectServer) ProjectSecret(ctx context.Context, req *pb.ProjectSecretReq, res *pb.ProjectSecretRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.ProjectSecret(req, res) + return err +} + +// ChangeSecret 修改密钥 +func (s *WProjectServer) ChangeSecret(ctx context.Context, req *pb.ChangeSecretReq, res *pb.ChangeSecretRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.ChangeSecret(req, res) + return err +} + +// DomainList 获取项目域名绑定的项目 +func (s *WProjectServer) DomainList(ctx context.Context, req *pb.DomainListReq, res *pb.DomainListRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.DomainList(req, res) + return err +} + +// ChangeOplatform 修改开放平台 +func (s *WProjectServer) ChangeOplatform(ctx context.Context, req *pb.ChangeOplatformReq, res *pb.ChangeOplatformRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.ChangeOplatform(req, res) + return err +} + +// SaveAdsConfig 保存广告修改 +func (s *WProjectServer) SaveAdsConfig(ctx context.Context, req *pb.SaveAdsConfigReq, res *pb.SaveAdsConfigRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.SaveAdsConfig(req, res) + return err +} + +// AdsConfig 获取广告配置 +func (s *WProjectServer) AdsConfig(ctx context.Context, req *pb.AdsConfigReq, res *pb.AdsConfigRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.AdsConfig(req, res) + return err +} + +// ChangeRebootUrl 修改开放平台的活动回调地址 +func (s *WProjectServer) ChangeRebootUrl(ctx context.Context, req *pb.ChangeRebootUrlReq, res *pb.ChangeRebootUrlRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.ChangeRebootUrl(req, res) + return err +} + +// FissionConfig 获取广告配置 +func (s *WProjectServer) FissionConfig(ctx context.Context, req *pb.FissionConfigReq, res *pb.FissionConfigRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.FissionConfig(req, res) + return err +} + +// SetPushVisit 获取广告配置 +func (s *WProjectServer) SetPushVisit(ctx context.Context, req *pb.SetPushVisitReq, res *pb.SetPushVisitRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.SetPushVisit(req, res) + return err +} + +// SetPushCampaignTask 设置活动任务完成推送开关 +func (s *WProjectServer) SetPushCampaignTask(ctx context.Context, req *pb.SetPushCampaignTaskReq, res *pb.SetPushCampaignTaskRes) (err error) { + //初始化服务 + srv := service.WProject{} + srv.Init(ctx) + err = srv.SetPushCampaignTask(req, res) + return err +} diff --git a/internal/handler/w_project_user.go b/internal/handler/w_project_user.go new file mode 100644 index 0000000..b271cec --- /dev/null +++ b/internal/handler/w_project_user.go @@ -0,0 +1,27 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_project_user" +) + +type WProjectUserServer struct{} + +// Point 积分 +func (s *WProjectUserServer) Point(ctx context.Context, req *pb.PointReq, res *pb.PointRes) (err error) { + //初始化服务 + srv := service.WProjectUser{} + srv.Init(ctx) + err = srv.Point(req, res) + return err +} + +// EarnCoin 获取积分 +func (s *WProjectUserServer) EarnCoin(ctx context.Context, req *pb.EarnCoinReq, res *pb.EarnCoinRes) (err error) { + //初始化服务 + srv := service.WProjectUser{} + srv.Init(ctx) + err = srv.EarnCoin(req, res) + return err +} diff --git a/internal/handler/w_register.go b/internal/handler/w_register.go new file mode 100644 index 0000000..f95a0d5 --- /dev/null +++ b/internal/handler/w_register.go @@ -0,0 +1,18 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_register" +) + +type WRegisterServer struct{} + +// Store 添加注册申请 +func (s *WRegisterServer) Store(ctx context.Context, req *pb.StoreReq, res *pb.StoreRes) (err error) { + //初始化服务 + srv := service.WRegister{} + srv.Init(ctx) + err = srv.Store(req, res) + return err +} diff --git a/internal/handler/w_reward.go b/internal/handler/w_reward.go new file mode 100644 index 0000000..89b2e31 --- /dev/null +++ b/internal/handler/w_reward.go @@ -0,0 +1,198 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_reward" +) + +type WRewardServer struct{} + +// List 奖品列表 +func (s *WRewardServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// Show 奖品详情 +func (s *WRewardServer) Show(ctx context.Context, req *pb.ShowReq, res *pb.ShowRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Show(req, res) + return err +} + +// Store 创建奖品 +func (s *WRewardServer) Store(ctx context.Context, req *pb.StoreReq, res *pb.StoreRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Store(req, res) + return err +} + +// Update 更新奖品 +func (s *WRewardServer) Update(ctx context.Context, req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Update(req, res) + return err +} + +// Destroy 删除奖品 +func (s *WRewardServer) Destroy(ctx context.Context, req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Destroy(req, res) + return err +} + +// UrlList 回调地址列表 +func (s *WRewardServer) UrlList(ctx context.Context, req *pb.UrlListReq, res *pb.UrlListRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.UrlList(req, res) + return err +} + +// UrlStore 创建回调地址 +func (s *WRewardServer) UrlStore(ctx context.Context, req *pb.UrlStoreReq, res *pb.UrlStoreRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.UrlStore(req, res) + return err +} + +// UrlUpdate 更新回调地址 +func (s *WRewardServer) UrlUpdate(ctx context.Context, req *pb.UrlUpdateReq, res *pb.UrlUpdateRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.UrlUpdate(req, res) + return err +} + +// UrlDestroy 删除回调地址 +func (s *WRewardServer) UrlDestroy(ctx context.Context, req *pb.UrlDestroyReq, res *pb.UrlDestroyRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.UrlDestroy(req, res) + return err +} + +// Select 奖品选择 +func (s *WRewardServer) Select(ctx context.Context, req *pb.SelectReq, res *pb.SelectRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Select(req, res) + return err +} + +// FormList 表单列表 +func (s *WRewardServer) FormList(ctx context.Context, req *pb.FormListReq, res *pb.FormListRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.FormList(req, res) + return err +} + +// FormSelect 表单选择 +func (s *WRewardServer) FormSelect(ctx context.Context, req *pb.FormSelectReq, res *pb.FormSelectRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.FormSelect(req, res) + return err +} + +// FormStore 创建表单 +func (s *WRewardServer) FormStore(ctx context.Context, req *pb.FormStoreReq, res *pb.FormStoreRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.FormStore(req, res) + return err +} + +// FormUpdate 更新表单 +func (s *WRewardServer) FormUpdate(ctx context.Context, req *pb.FormUpdateReq, res *pb.FormUpdateRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.FormUpdate(req, res) + return err +} + +// FormDestroy 删除表单 +func (s *WRewardServer) FormDestroy(ctx context.Context, req *pb.FormDestroyReq, res *pb.FormDestroyRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.FormDestroy(req, res) + return err +} + +// Urls 回调地址列表 +func (s *WRewardServer) Urls(ctx context.Context, req *pb.UrlsReq, res *pb.UrlsRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Urls(req, res) + return err +} + +// Rewards 奖品详情 +func (s *WRewardServer) Rewards(ctx context.Context, req *pb.RewardsReq, res *pb.RewardsRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Rewards(req, res) + return err +} + +// Forms 表单列表 +func (s *WRewardServer) Forms(ctx context.Context, req *pb.FormsReq, res *pb.FormsRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.Forms(req, res) + return err +} + +// RelateReward 关联奖品 +func (s *WRewardServer) RelateReward(ctx context.Context, req *pb.RelateRewardReq, res *pb.RelateRewardRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.RelateReward(req, res) + return err +} + +// PushReward 奖品推送 +func (s *WRewardServer) PushReward(ctx context.Context, req *pb.PushRewardReq, res *pb.PushRewardRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.PushReward(req, res) + return err +} + +// RewardIds 查询奖品id +func (s *WRewardServer) RewardIds(ctx context.Context, req *pb.RewardIdsReq, res *pb.RewardIdsRes) (err error) { + //初始化服务 + srv := service.WReward{} + srv.Init(ctx) + err = srv.RewardIds(req, res) + return err +} diff --git a/internal/handler/w_script.go b/internal/handler/w_script.go new file mode 100644 index 0000000..b8afd44 --- /dev/null +++ b/internal/handler/w_script.go @@ -0,0 +1,108 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_script" +) + +type WScriptServer struct{} + +// Boot 运行脚本 +func (s *WScriptServer) Boot(ctx context.Context, req *pb.BootReq, res *pb.BootRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.Boot(req, res) + return err +} + +// RefreshDayLimit 刷新每日限制 +func (s *WScriptServer) RefreshDayLimit(ctx context.Context, req *pb.RefreshDayLimitReq, res *pb.RefreshDayLimitRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.RefreshDayLimit(req, res) + return err +} + +// NotifyList 奖品回调列表 +func (s *WScriptServer) NotifyList(ctx context.Context, req *pb.NotifyListReq, res *pb.NotifyListRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.NotifyList(req, res) + return err +} + +// EtcdKey 查看etcd的key +func (s *WScriptServer) EtcdKey(ctx context.Context, req *pb.EtcdKeyReq, res *pb.EtcdKeyRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.EtcdKey(req, res) + return err +} + +// EventFlow 查看事件记录 +func (s *WScriptServer) EventFlow(ctx context.Context, req *pb.EventFlowReq, res *pb.EventFlowRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.EventFlow(req, res) + return err +} + +// ClearDevice 清除设备信息 +func (s *WScriptServer) ClearDevice(ctx context.Context, req *pb.ClearDeviceReq, res *pb.ClearDeviceRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.ClearDevice(req, res) + return err +} + +// RefreshView 重新体验玩法 +func (s *WScriptServer) RefreshView(ctx context.Context, req *pb.RefreshViewReq, res *pb.RefreshViewRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.RefreshView(req, res) + return err +} + +// ErrLog 错误日志记录 +func (s *WScriptServer) ErrLog(ctx context.Context, req *pb.ErrLogReq, res *pb.ErrLogRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.ErrLog(req, res) + return err +} + +// PointsLog 领扣积分请求 +func (s *WScriptServer) PointsLog(ctx context.Context, req *pb.PointsLogReq, res *pb.PointsLogRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.PointsLog(req, res) + return err +} + +// UserBehavior 用户行为日志 +func (s *WScriptServer) UserBehavior(ctx context.Context, req *pb.UserBehaviorReq, res *pb.UserBehaviorRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.UserBehavior(req, res) + return err +} + +// RewardPushLog 奖品推送日志 +func (s *WScriptServer) RewardPushLog(ctx context.Context, req *pb.RewardPushLogReq, res *pb.RewardPushLogRes) (err error) { + //初始化服务 + srv := service.WScript{} + srv.Init(ctx) + err = srv.RewardPushLog(req, res) + return err +} diff --git a/internal/handler/w_user.go b/internal/handler/w_user.go new file mode 100644 index 0000000..954009c --- /dev/null +++ b/internal/handler/w_user.go @@ -0,0 +1,72 @@ +package handler + +import ( + "context" + "joybuywork/internal/service" + pb "joybuywork/proto/go_proto/w_user" +) + +type WUserServer struct{} + +// Login 登陆 +func (s *WUserServer) Login(ctx context.Context, req *pb.LoginReq, res *pb.LoginRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.Login(req, res) + return err +} + +// List 用户列表 +func (s *WUserServer) List(ctx context.Context, req *pb.ListReq, res *pb.ListRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.List(req, res) + return err +} + +// Select 用户选择列表 +func (s *WUserServer) Select(ctx context.Context, req *pb.SelectReq, res *pb.SelectRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.Select(req, res) + return err +} + +// Show 员工详情 +func (s *WUserServer) Show(ctx context.Context, req *pb.ShowReq, res *pb.ShowRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.Show(req, res) + return err +} + +// Store 创建员工 +func (s *WUserServer) Store(ctx context.Context, req *pb.StoreReq, res *pb.StoreRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.Store(req, res) + return err +} + +// Update 更新员工 +func (s *WUserServer) Update(ctx context.Context, req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.Update(req, res) + return err +} + +// Destroy 删除员工 +func (s *WUserServer) Destroy(ctx context.Context, req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + //初始化服务 + srv := service.WUser{} + srv.Init(ctx) + err = srv.Destroy(req, res) + return err +} diff --git a/internal/plugins/certs/certs.go b/internal/plugins/certs/certs.go new file mode 100644 index 0000000..a1ee6f9 --- /dev/null +++ b/internal/plugins/certs/certs.go @@ -0,0 +1,11 @@ +package certs + +import "errors" + +const issuer = "joybuywork" + +const saltKey = "salt" +const signKey = "sign" + +var ExpiredErr = errors.New("token expired") +var InvalidToken = errors.New("invalid token") diff --git a/internal/plugins/certs/tools.go b/internal/plugins/certs/tools.go new file mode 100644 index 0000000..70314dd --- /dev/null +++ b/internal/plugins/certs/tools.go @@ -0,0 +1,51 @@ +package certs + +import ( + "bytes" + "crypto/md5" + "encoding/hex" + "math/rand" +) + +const ( + allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + allowedCharsSize = len(allowedChars) +) + +// returns a securely generated random string. +func randomString(length int) string { + b := make([]byte, length) + + for i := range b { + c := rand.Intn(allowedCharsSize) + b[i] = allowedChars[c] + } + + return string(b) +} + +func mmd5(str string) string { + var buf = bytes.NewBufferString(str) + hash := md5.New() + hash.Write(buf.Bytes()) + sign := hash.Sum(nil) + + return hex.EncodeToString(sign) +} + +func checkHeaderSign(header map[string]interface{}) (slt, sin string, ok bool) { + + salt, ok := header[saltKey] + if !ok { + return + } + + sign, ok := header[signKey] + if !ok { + return + } + + slt, sin = salt.(string), sign.(string) + + return +} diff --git a/internal/plugins/certs/user.go b/internal/plugins/certs/user.go new file mode 100644 index 0000000..218cfdd --- /dev/null +++ b/internal/plugins/certs/user.go @@ -0,0 +1,72 @@ +package certs + +import ( + "encoding/json" + "errors" + "github.com/golang-jwt/jwt/v5" + "github.com/rs/xid" + "time" +) + +type User struct { + UserId int64 `json:"id"` + jwt.RegisteredClaims +} + +func NewUser() *User { + return &User{} +} + +// Token 获取token +func (u *User) Token(id int64, username string) (string, error) { + u.UserId = id + u.RegisteredClaims = jwt.RegisteredClaims{ + Issuer: issuer, + Subject: username, + ExpiresAt: jwt.NewNumericDate(u.Expired()), + NotBefore: jwt.NewNumericDate(time.Now()), + IssuedAt: jwt.NewNumericDate(time.Now()), + ID: xid.New().String(), + } + + var key = randomString(6) + token := jwt.NewWithClaims(jwt.SigningMethodHS256, u) + + //加密校验字符串 + token.Header[saltKey] = key + token.Header[signKey] = mmd5(key) + + return token.SignedString([]byte(key)) +} + +// Parse 解析token +func (u *User) Parse(tokenString string) (err error) { + token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + salt, sign, ok := checkHeaderSign(token.Header) + if !ok || mmd5(salt) != sign { + return nil, errors.New("key invalid") + } + + return []byte(salt), nil + }) + + if err != nil { + return + } + + if user, ok := token.Claims.(jwt.MapClaims); ok && token.Valid { + b, _ := json.Marshal(user) + _ = json.Unmarshal(b, u) + return + } + + if errors.Is(err, jwt.ErrTokenExpired) || errors.Is(err, jwt.ErrTokenNotValidYet) { + return ExpiredErr + } + + return InvalidToken +} + +func (u *User) Expired() time.Time { + return time.Now().AddDate(0, 0, 7) +} diff --git a/internal/plugins/certs/user_test.go b/internal/plugins/certs/user_test.go new file mode 100644 index 0000000..71e1e6b --- /dev/null +++ b/internal/plugins/certs/user_test.go @@ -0,0 +1,36 @@ +package certs + +import ( + "github.com/rs/xid" + "testing" +) + +func TestName(t *testing.T) { + t.Log(xid.New().String()) + for i := 0; i < 10; i++ { + t.Logf(randomString(10)) + } +} + +func TestUser(t *testing.T) { + + var token = "eyJhbGciOiJIUzI1NiIsInNhbHQiOiJIYW1oMVgiLCJzaWduIjoiNGE2ZTgyZTZlN2U0NTJlMTEzZmI2ZTVhODE5NDBmN2QiLCJ0eXAiOiJKV1QifQ.eyJpZCI6MTMzLCJpc3MiOiJjZXJ0aWZpZWQiLCJzdWIiOiJ1c2VyMSIsImV4cCI6MTY4ODU1Mjc5NCwibmJmIjoxNjg3OTQ3OTk0LCJpYXQiOjE2ODc5NDc5OTQsImp0aSI6ImNpZTBsbW43MGpuaW5rdjNvaDAwIn0.vF3lOV4jAgGnbxgRn7pIYS3E6MGQdFlrpvCyOdLQ2-I" + + //t.Run("token", func(t *testing.T) { + // user := NewUser() + // var err error + // token, err = user.Token(1, "username") + // if err != nil { + // t.Fatal(err) + // } + // t.Log(token) + //}) + + t.Run("parse", func(t *testing.T) { + user := NewUser() + t.Log(user.Parse(token)) + + t.Log(user) + }) + +} diff --git a/internal/plugins/encrypt/encrypt.go b/internal/plugins/encrypt/encrypt.go new file mode 100644 index 0000000..5f2f177 --- /dev/null +++ b/internal/plugins/encrypt/encrypt.go @@ -0,0 +1,59 @@ +package encrypt + +import ( + "bytes" + "crypto/md5" + "crypto/sha1" + "encoding/hex" + "fmt" + "github.com/alexandrevicenzi/unchained" + "github.com/rs/xid" + "time" +) + +// UserPasswd 员工密码 +func UserPasswd(passwd string) (pwd string) { + pwd, _ = unchained.MakePassword( + passwd, + unchained.GetRandomString(unchained.DefaultSaltSize), + unchained.PBKDF2SHA256Hasher, + ) + return +} + +// CheckUserPasswd 验证员工密码 +func CheckUserPasswd(passwd, encode string) (bool, error) { + return unchained.CheckPassword(passwd, encode) +} + +// ProjectSecret 项目私钥生成方法 +func ProjectSecret(projectId int64) string { + var buf = bytes.NewBufferString(fmt.Sprintf("secret:%d%d%s", projectId, time.Now().Unix(), xid.New().String())) + hash := md5.New() + hash.Write(buf.Bytes()) + return hex.EncodeToString(hash.Sum(nil)) +} + +// ProjectToken 项目token生成方法 +func ProjectToken() string { + var buf = bytes.NewBufferString(fmt.Sprintf("token:%d%s", time.Now().Unix(), xid.New().String())) + hash := sha1.New() + hash.Write(buf.Bytes()) + return hex.EncodeToString(hash.Sum(nil)) +} + +// ProjectEncryptStr 项目encrypt_str生成方法 +func ProjectEncryptStr(hashId string) string { + var buf = bytes.NewBufferString(fmt.Sprintf("encrypt_str:%d%s", time.Now().Unix(), hashId)) + hash := sha1.New() + hash.Write(buf.Bytes()) + return hex.EncodeToString(hash.Sum(nil)) +} + +// ProjectThirdSecret 项目third_secret生成方法 +func ProjectThirdSecret(hashId string) string { + var buf = bytes.NewBufferString(fmt.Sprintf("third_secret:%d%s", time.Now().Unix(), hashId)) + hash := sha1.New() + hash.Write(buf.Bytes()) + return hex.EncodeToString(hash.Sum(nil)) +} diff --git a/internal/plugins/encrypt/encrypt_test.go b/internal/plugins/encrypt/encrypt_test.go new file mode 100644 index 0000000..55dd0be --- /dev/null +++ b/internal/plugins/encrypt/encrypt_test.go @@ -0,0 +1,20 @@ +package encrypt + +import ( + "testing" +) + +func TestProjectSecret(t *testing.T) { + + t.Log(ProjectSecret(1)) +} + +func TestUserPasswd(t *testing.T) { + t.Log(UserPasswd("user1")) +} + +func TestProjectToken(t *testing.T) { + + t.Log(ProjectToken()) + +} diff --git a/internal/plugins/export/csv/csv.go b/internal/plugins/export/csv/csv.go new file mode 100644 index 0000000..5fb1d03 --- /dev/null +++ b/internal/plugins/export/csv/csv.go @@ -0,0 +1,116 @@ +package csv + +import ( + "context" + "joybuywork/internal/plugins/export" + "encoding/csv" + "fmt" + "os" +) + +type Export struct { + export.BaseExport + fields []string //表头对应的字段key []string{"key1", "key2"} + header []string //表头数据 []string{"表头1", “表头2”} + file *os.File //文件资源 + w *csv.Writer //csv文件写入资源 +} + +// NewExport 实例化csv导出对象 +func NewExport(ctx context.Context, header export.HeaderField, total int64, opts ...export.Option) *Export { + ept := new(Export) + { + ept.Init(ctx, header, total, opts...) + } + + //初始化头部信息和字段key信息 + for _, v := range ept.Header { + ept.header = append(ept.header, v.Title) + ept.fields = append(ept.fields, v.Field) + } + + //设置文件名称 + ept.SetFilename(ept) + + return ept +} + +// ExportFile 直接导出数据 +func (e *Export) ExportFile(data []export.RowData) (err error) { + defer e.file.Close() + + err = e.initFile() + if err != nil { + return + } + + list := e.getList(data) + + //写入数据 + err = e.w.WriteAll(list) + if err != nil { + return err + } + + return +} + +// 初始化csv文件对象 +func (e *Export) initFile() (err error) { + // 不存在则创建;存在则追加;读写模式; + file, err := os.OpenFile(e.GetFullPath(), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) + if err != nil { + return + } + + //自定义文件 + if e.IsCustomerFile() { + e.w = csv.NewWriter(file) + return + } + + // 写入UTF-8 BOM,防止中文乱码 + _, err = file.WriteString("\xEF\xBB\xBF") + if err != nil { + return + } + + //实例csv写入数据 + w := csv.NewWriter(file) + + //写把头写到数据里面 + err = w.Write(e.header) + if err != nil { + return + } + w.Flush() + + e.w = w + e.file = file + + return +} + +// 获取每行输出的数据 +func (e *Export) getList(data []export.RowData) [][]string { + var list [][]string + for _, row := range data { + var one []string + for _, field := range e.fields { + v, ok := row[field] + if ok { + one = append(one, fmt.Sprintf("%v", v)) + } else { + one = append(one, "") + } + } + list = append(list, one) + } + + return list +} + +// FileSuffix 文件后缀 +func (e *Export) FileSuffix() string { + return "csv" +} diff --git a/internal/plugins/export/csv/csv_test.go b/internal/plugins/export/csv/csv_test.go new file mode 100644 index 0000000..3f4423a --- /dev/null +++ b/internal/plugins/export/csv/csv_test.go @@ -0,0 +1,114 @@ +package csv + +import ( + "context" + "joybuywork/internal/plugins/export" + "fmt" + "path/filepath" + "runtime" + "testing" +) + +func getData() (export.HeaderField, []export.RowData) { + header := export.HeaderField{ + { + Field: "name", + Title: "姓名", + }, + { + Field: "age", + Title: "年龄", + }, + { + Field: "like", + Title: "喜欢", + }, + } + + var data []export.RowData + for i := 0; i < 1000; i++ { + row := export.RowData{ + "name": fmt.Sprintf("学生%d", i), + "age": 15, + "like": fmt.Sprintf("不知道%d", i), + } + data = append(data, row) + } + + return header, data +} + +func TestExportCsv(t *testing.T) { + header, data := getData() + err := NewExport(context.Background(), header, int64(len(data))).ExportFile(data) + t.Log(err) +} + +func TestExportCsvTask(t *testing.T) { + header, data := getData() + + ct, err := NewExport(context.Background(), header, int64(len(data))).UpgradeTask(export.UseFinishPart(200, func(spn, nfp float64) { + t.Log(spn, nfp) + })) + if err != nil { + t.Log(err) + return + } + + ct.GetHashMark() + + err = export.Done(ct) + if err != nil { + t.Log(err) + return + } + + ct.AppendData(data) + + reply := <-ct.GetReply() + + if reply.Error != nil { + t.Log(err) + return + } + + t.Log(reply.Filename, reply.FilePath, reply.Error) +} + +func TestProceed(t *testing.T) { + header, data := getData() + _, filename, _, _ := runtime.Caller(0) + current := filepath.Dir(filename) + + t.Log(current) + + return + + xt, err := NewExport(context.Background(), header, int64(len(data)), + export.UseFile( + "ept_c6diaucjmgh6bp15jc1g82921.csv", + "G:\\Work\\go\\src\\app_service\\pkg\\components\\export\\csv/tmp/export/ept_c6diaucjmgh6bp15jc1g82921.csv", + ), + ).UpgradeTask(export.UserProceed(701, 0)) + + if err != nil { + t.Log(err) + return + } + + err = export.Done(xt) + if err != nil { + t.Log(err) + return + } + + xt.AppendData(data) + + reply := <-xt.GetReply() + + if reply.Error != nil { + t.Log(err) + return + } + t.Log(reply.Filename, reply.FilePath, reply.Fr) +} diff --git a/internal/plugins/export/csv/task.go b/internal/plugins/export/csv/task.go new file mode 100644 index 0000000..3608782 --- /dev/null +++ b/internal/plugins/export/csv/task.go @@ -0,0 +1,78 @@ +package csv + +import ( + "joybuywork/internal/plugins/export" +) + +const ( + FlushNum = 200 // csv写入多少行后从缓冲区写入文件 +) + +type Task struct { + export.BaseTask + *Export +} + +// UpgradeTask csv导出升级成任务模式 +func (e *Export) UpgradeTask(opts ...export.TaskOption) (*Task, error) { + task := &Task{ + Export: e, + } + + //初始化任务 + task.Init(e.Ctx, task, opts...) + + //初始化任务文件 + err := task.initFile() + if err != nil { + return nil, err + } + + return task, nil +} + +// 写入csv表格 +func (t *Task) writeRow(v []string) error { + //写入文件 + t.FrAdd() + + //不能写入当前行数据 + if !t.CanWriteRow() { + return nil + } + + err := t.w.Write(v) + if err != nil { + return err + } + + if t.GetFr()%FlushNum == 0 || t.GetFr() >= t.GetTotal() { // 到达缓冲区最大实现条数或者写入了最后一条 + t.w.Flush() + } + + //看看任务有没有完成 + t.CheckFinish() + return nil +} + +// WriteData 写入数据 +func (t *Task) WriteData(data []export.RowData) (err error) { + list := t.getList(data) + for _, v := range list { + err = t.writeRow(v) + if err != nil { + return + } + } + return +} + +// FileClose 关闭资源 +func (t *Task) FileClose() { + _ = t.file.Close() +} + +// GetTotal 获取导出总条数 +func (t *Task) GetTotal() int64 { + return t.Total +} diff --git a/internal/plugins/export/csv/tmp/export/.gitignore b/internal/plugins/export/csv/tmp/export/.gitignore new file mode 100644 index 0000000..cf57c3b --- /dev/null +++ b/internal/plugins/export/csv/tmp/export/.gitignore @@ -0,0 +1,2 @@ +.gitignore +!.gitignore \ No newline at end of file diff --git a/internal/plugins/export/export.go b/internal/plugins/export/export.go new file mode 100644 index 0000000..2bde7df --- /dev/null +++ b/internal/plugins/export/export.go @@ -0,0 +1,90 @@ +// Package export 导出组件的封装,一般导出的话csv性能是360插件的xlsx的几十倍 +// 但是xlsx可以更加丰富样式,所以没有样式的情况下,用csv性能更高 +package export + +import ( + "context" + "fmt" + "github.com/rs/xid" + "os" +) + +type HeaderFieldOne struct { + Field string //数据对应的字段名称 + Title string //表头名称 +} + +type HeaderField []HeaderFieldOne + +type Export interface { + FileSuffix() string //文件后缀 + ExportFile(data []RowData) error //导出数据 +} + +type BaseExport struct { + Ctx context.Context + hashMark string //导出任务的唯一hash + Header HeaderField //表头数据 + Total int64 //需要导出的总数 + filename string //文件名称 + fullPath string //文件存储路径 + customFile bool //是否自定义文件 +} + +// Init 实例化导出 +// @params +// +// header HeaderField excel表头 +// total int64 导出数据的总量条数 +// hashMark string 自定义的唯一标识 +func (e *BaseExport) Init(ctx context.Context, header HeaderField, total int64, opts ...Option) { + e.Ctx = ctx + e.Total = total + e.Header = header + e.hashMark = BuildHashMark() + + //设置参数 + for _, opt := range opts { + opt(e) + } +} + +// GetHashMark 获取导出的唯一标识 +func (e *BaseExport) GetHashMark() string { + return e.hashMark +} + +// GetBasePath 获取基础路径 +func (e *BaseExport) GetBasePath() string { + path, _ := os.Getwd() + return path + "/tmp/export/" +} + +// SetFilename 设置文件名称 +func (e *BaseExport) SetFilename(ept Export) { + if e.filename != "" { //已经设置好了就不设置了 + return + } + e.filename = e.GetHashMark() + "." + ept.FileSuffix() + e.fullPath = e.GetBasePath() + e.filename +} + +// GetFilename 获取文件名称 +func (e *BaseExport) GetFilename() string { + return e.filename +} + +// GetFullPath 获取文件全路径 +func (e *BaseExport) GetFullPath() string { + return e.fullPath +} + +// IsCustomerFile 文件是否已经存在 +func (e *BaseExport) IsCustomerFile() bool { + return e.customFile +} + +// BuildHashMark 初始化当前导出任务的唯一标识 +func BuildHashMark() string { + return fmt.Sprintf("ept_%s", xid.New().String()) +} diff --git a/internal/plugins/export/format.go b/internal/plugins/export/format.go new file mode 100644 index 0000000..f08c849 --- /dev/null +++ b/internal/plugins/export/format.go @@ -0,0 +1,28 @@ +package export + +import ( + "fmt" + "time" +) + +// DateString 把表格日期格式变成字符串格式 +func DateString(t *time.Time, format string) string { + if t == nil || t.IsZero() { + return "" + } + return NumberString(t.Format(format)) +} + +// NumberString 显示长数字的字符串 +func NumberString(number string) string { + return fmt.Sprintf("%s\t", number) +} + +// CashString 金钱保留两位小数 +func CashString(v float64) string { + if v == 0 { + return "0" + } + + return fmt.Sprintf("%.2f\t", v) +} diff --git a/internal/plugins/export/option.go b/internal/plugins/export/option.go new file mode 100644 index 0000000..b0fa6b1 --- /dev/null +++ b/internal/plugins/export/option.go @@ -0,0 +1,52 @@ +package export + +import "sync" + +type Option func(e *BaseExport) + +// UseHashMark 设置导出哈希标识 +func UseHashMark(hashMark string) Option { + return func(e *BaseExport) { + e.hashMark = hashMark + } +} + +// UseFile 使用自定义文件 +func UseFile(filename, filePath string) Option { + return func(e *BaseExport) { + e.filename = filename + e.fullPath = filePath + e.customFile = true + } +} + +type TaskOption func(tp *BaseTask) + +// UseFinishPart spn 分成的份数, fn 每完成一份的处理 +// +// 使用完成一部分就通讯,假如spn=50,就是把总数分成50份进行步进更新, +// fn只会处理到倒数第二份的时候,最后一份的逻辑,需要完成的时候实现 +func UseFinishPart(spn int, fn PartDone) TaskOption { + return func(tp *BaseTask) { + tp.fp = &FinishPart{ + l: &sync.Mutex{}, + spn: float64(spn), + notifySp: make(chan float64), + fn: fn, + } + } +} + +// UserProceed 使用断点续导出 +// +// begin是当写入是第几条的时候才开始写入到文件 +// filterNum是过滤的条数,假如:你是倒序查询,在导出的时候查询只有100条数据,但是续导的时候有101,那就这个值就是 1; 当然,如果你是正序的时候不用管,或者直接让begin值+1 +func UserProceed(begin, filterNum int64) TaskOption { + return func(tp *BaseTask) { + tp.pe = &Proceed{ + l: &sync.Mutex{}, + filterNum: filterNum, + begin: begin, + } + } +} diff --git a/internal/plugins/export/redis_part.go b/internal/plugins/export/redis_part.go new file mode 100644 index 0000000..271f63e --- /dev/null +++ b/internal/plugins/export/redis_part.go @@ -0,0 +1,40 @@ +package export + +import ( + "context" + "fmt" + "github.com/go-redis/redis/v8" + "time" +) + +type RedisPart struct { + ctx context.Context + client *redis.Client + redisKey string +} + +func NewRedisPart(ctx context.Context, client *redis.Client, redisKey string) *RedisPart { + return &RedisPart{ + ctx: ctx, + client: client, + redisKey: redisKey, + } +} + +func (s *RedisPart) FinishPart(spn int, fn ...PartDone) TaskOption { + return UseFinishPart(spn, func(spn, nfp float64) { + s.client.HSet(s.ctx, s.redisKey, "schedule", fmt.Sprintf("%.1f", nfp/spn)) + s.client.Expire(s.ctx, s.redisKey, 2*time.Minute) + for _, f := range fn { + f(spn, nfp) + } + }) +} + +func (s *RedisPart) Schedule() string { + return s.client.HGet(s.ctx, s.redisKey, "schedule").Val() +} + +func (s *RedisPart) Close() error { + return s.client.Del(s.ctx, s.redisKey).Err() +} diff --git a/internal/plugins/export/task.go b/internal/plugins/export/task.go new file mode 100644 index 0000000..249483c --- /dev/null +++ b/internal/plugins/export/task.go @@ -0,0 +1,276 @@ +package export + +import ( + "context" + "math" + "os" + "sync" +) + +const ( + MaxRow = 1000000 // excel 最大行数 +) + +// RowData 单条数据类型 +type RowData map[string]interface{} + +// AfterFinishCustomize 完成后自定义处理函数 +type AfterFinishCustomize func(fileName, fullPath string) error + +type Task interface { + GetTotal() int64 //获取导出的总条数 + GetBaseTask() *BaseTask //获取基础任务结构 + WriteData(data []RowData) (err error) //写入数据 + FileClose() //关闭文件 + GetFilename() string //获取文件名称 + GetFullPath() string //获取文件存储路径 +} + +// Done 执行导出任务,虽然现在没有错误 +func Done(et Task) { + //没有数据导出的时候直接任务结束 + t := et.GetBaseTask() + if et.GetTotal() == 0 { + t.taskEnd(nil) + return + } + + //监听步进完成 + go t.listenNotifySp() + + //监听数据加入 + go t.listenAppendData() + + //监听任务情况 + go func() { + var taskErr error + select { + case <-t.finish: //正常完成触发 + break + case <-t.ctx.Done(): //超时触发 + break + case notifyErr, ok := <-t.err: //执行过程出现异常 + if ok { + taskErr = notifyErr + } + } + + //任务结束后 + t.taskEnd(taskErr) + }() + + return +} + +type BaseTask struct { + ctx context.Context //上下文 + cancel context.CancelFunc //关闭上下文 + err chan error //错误通知,必须要有错误才通知 + fr int64 //当前写入的行数 + finish chan bool //导出完成标识 + ap chan []RowData //需要导出的数据 + reply chan Reply //处理结果通道,文件导出完成后,会通知该通道返回处理的结果,调用AfterFinish()方法可以获取到通知 + ti Task //任务接口(ti=>taskInterface) + fp *FinishPart //使用完成部分通讯 + pe *Proceed //从某一条数据之后继续导出 +} + +type Proceed struct { + l *sync.Mutex //写入进度锁 + filterNum int64 //先过滤多少条数据之后才开始计算 + nft int64 //当前已经过滤了多少条数据 + begin int64 //到当写入条数到这个点的时候才开始写入文件 +} + +type PartDone func(spn, nfp float64) + +// FinishPart 完成部分导出的结构体 +type FinishPart struct { + l *sync.Mutex //写入进度锁 + spn float64 //把整个导出文件分成多少份 + sp int64 //每多少条后计算一次速率 + nfp float64 //当前已导出的份数 + notifySp chan float64 //当前进度 / 分割数的值 + fn PartDone //进度完成要做什么操作 +} + +// Reply 处理结果结构体 +type Reply struct { + Error error + Filename string + FilePath string + Fr int64 +} + +// Init 初始化基础任务 +func (t *BaseTask) Init(ctx context.Context, ti Task, opts ...TaskOption) { + //设置的数据 + for _, opt := range opts { + opt(t) + } + + //初始化任务值 + t.err = make(chan error, 1) + t.finish = make(chan bool, 1) + t.reply = make(chan Reply, 1) + t.ap = make(chan []RowData, 1) + t.ctx, t.cancel = context.WithCancel(ctx) + t.ti = ti + + if t.HasFp() { + t.fp.sp = int64(math.Ceil(float64(ti.GetTotal()) / t.fp.spn)) + } + +} + +// GetBaseTask 获取基础任务结构 +func (t *BaseTask) GetBaseTask() *BaseTask { + return t +} + +// 监听加入的数据 +func (t *BaseTask) listenAppendData() { + for { + select { + case data, ok := <-t.ap: + if !ok { + return + } + + err := t.ti.WriteData(data) + if err != nil { + t.err <- err + return + } + case <-t.ctx.Done(): + return + } + } +} + +// CheckFinish 查看任务有没有完成 +func (t *BaseTask) CheckFinish() { + // 写入总数已经达到总条数,关闭文件和删除任务 + total := t.ti.GetTotal() + if t.fr >= total || t.fr >= MaxRow { + t.finish <- true + } else if t.HasFp() && t.fr%t.fp.sp == 0 { //达到完成部分导出 + t.notifySp() + } +} + +// 获取步进通知 +func (t *BaseTask) listenNotifySp() { + if t.fp == nil { + return + } + + for { + select { + case nfp, ok := <-t.fp.notifySp: + if !ok { + return + } + t.fp.fn(t.fp.spn, nfp) + case <-t.ctx.Done(): + return + } + } +} + +// 需要通知部分完成 +func (t *BaseTask) notifySp() { + t.fp.l.Lock() + defer t.fp.l.Unlock() + t.fp.nfp++ + t.fp.notifySp <- t.fp.nfp +} + +// AppendData 追加任务导出数据 +func (t *BaseTask) AppendData(data []RowData) { + t.ap <- data +} + +// 任务结束后 +func (t *BaseTask) taskEnd(err error) { + //结束其他进行中的协程任务 + t.cancel() + + //关闭文件资源占用 + t.ti.FileClose() + + //通知结构体 + reply := Reply{ + Filename: t.ti.GetFilename(), + FilePath: t.ti.GetFullPath(), + Fr: t.GetFr(), + } + + //有异常的时候处理 + if err != nil { + //删除文件,防止服务器积压 + _ = os.Remove(t.ti.GetFullPath()) + reply.Error = err + } + + //通知任务回调 + t.reply <- reply +} + +// CanWriteRow 是否可以写入数据 +func (t *BaseTask) CanWriteRow() bool { + if t.pe == nil { + return true + } + + t.pe.l.Lock() + defer t.pe.l.Unlock() + + //先处理一下要过滤的数据 + if t.pe.filterNum != 0 && t.pe.filterNum >= t.pe.nft { + t.fr-- + t.pe.nft++ + return false + } + + //看看不是已经到要写入的那一行 + if t.pe.begin <= t.fr { + return true + } + + return false +} + +// GetReply 获取任务结果 +func (t *BaseTask) GetReply() <-chan Reply { + return t.reply +} + +// HasFp 是否存在进度推送 +func (t *BaseTask) HasFp() bool { + return t.fp != nil +} + +// FrAdd 写入了一条数据 +func (t *BaseTask) FrAdd() { + t.fr++ +} + +// GetFr 获取写入文件的行数 +func (t *BaseTask) GetFr() int64 { + return t.fr +} + +// ManualEnd 手动结束,有错误传入的时候是 +func (t *BaseTask) ManualEnd(err error) { + if err != nil { + t.err <- err + return + } + t.finish <- true +} + +// Release 任务结束后释放 +func (t *BaseTask) Release() { + close(t.reply) +} diff --git a/internal/plugins/export/xlsx/option.go b/internal/plugins/export/xlsx/option.go new file mode 100644 index 0000000..586d016 --- /dev/null +++ b/internal/plugins/export/xlsx/option.go @@ -0,0 +1,70 @@ +package xlsx + +import ( + "joybuywork/internal/plugins/export" +) + +type Option func(e *Export) + +// UseDefaultSheet 创建文件开始的默认工作簿 +func UseDefaultSheet(name string) Option { + return func(e *Export) { + //旧的默认工作表 + index := e.CreateSheet(name) + + e.file.SetActiveSheet(index) + + //这个是组件自带的,所以删除掉 + e.file.DeleteSheet(DefaultSheetName) + e.sheet = name + } +} + +type Sheet struct { + Name string //当前sheet的名称 + Header export.HeaderField //当前sheet的字段数 + SwitchField []SwitchField //切换字段和标识值 + Total int64 //当前sheet的写入的总条数,用于自动切sheet,当 SwitchField = nil 的时候才使用该值 + writeNum int64 //写入当前sheet的条数 + sfIdx int64 //当前sheet从第几行开始写入 + fields map[string]string //头部对应的表格列和字段名 map[string]string{"A":"字段key1", "B": "字段key2"} + header map[string]string //表头数据map[string]string{"A1":"表头1", "B1": "表头2"} +} + +type SwitchField struct { + Key string //当前sheet的字段标识 + Val interface{} //当前sheet的字段标识的值 +} + +// UseManySheet 多sheet导出 +func UseManySheet(ss ...Sheet) Option { + return func(e *Export) { + var defaultIdx = -1 + for k, v := range ss { + //工作表存在,代表已经设置过表头,不用再设置了 + _ = e.CreateSheet(v.Name) + + //初始化 + e.initSheet(&v, true) + + if defaultIdx == -1 && (v.Total > 0 || v.SwitchField != nil) { + defaultIdx = k + } + + //设置他的索引 + e.ss = append(e.ss, v) + + if v.SwitchField != nil { + if e.sfv == nil { + e.sfv = make(map[string]int) + } + for _, v1 := range v.SwitchField { + e.sfv[e.getSfvKey(v1.Key, v1.Val)] = k + } + } + } + + //从第一个有导出数据的的sheet开始 + e.initSheet(&ss[defaultIdx], false) + } +} diff --git a/internal/plugins/export/xlsx/task.go b/internal/plugins/export/xlsx/task.go new file mode 100644 index 0000000..788930e --- /dev/null +++ b/internal/plugins/export/xlsx/task.go @@ -0,0 +1,87 @@ +package xlsx + +import ( + "joybuywork/internal/plugins/export" +) + +type Task struct { + export.BaseTask + *Export +} + +// UpgradeTask xlsx导出升级成任务模式 +func (e *Export) UpgradeTask(opts ...export.TaskOption) (*Task, error) { + task := &Task{ + Export: e, + } + + //初始化任务 + task.Init(e.Ctx, task, opts...) + + //设置表头,多sheet的情况下,不用设置表头 + if !task.HasManySheet() { + err := task.setHeader() + if err != nil { + return nil, err + } + } + + return task, nil +} + +// 写入xlsx表格 +func (t *Task) writeRow(row SheetRowData) error { + //写入一行 + t.FrAdd() + + //不能写入当前行数据 + if !t.CanWriteRow() { + return nil + } + + for axis, value := range row.row { + err := t.file.SetCellValue(row.sheet, axis, value) + if err != nil { + return err + } + } + + //看看任务有没有完成 + t.CheckFinish() + return nil +} + +// WriteData 写入数据 +func (t *Task) WriteData(data []export.RowData) (err error) { + list := t.getList(data) + + for k, v := range list { + //自动切sheet + ok := t.checkSwitchSheet() + if ok { //切换成功,要重新设置当前sheet在哪一行写入 + return t.WriteData(data[k:]) + } + + //写入一行 + err = t.writeRow(v) + if err != nil { + return + } + } + return +} + +// FileClose 关闭文件资源 +func (t *Task) FileClose() { + _ = t.file.SaveAs(t.GetFullPath()) +} + +// GetTotal 获取导出的总条数 +func (t *Task) GetTotal() int64 { + return t.Total +} + +// Done 执行任务 +func (t *Task) Done() { + export.Done(t) +} diff --git a/internal/plugins/export/xlsx/tmp/export/.gitignore b/internal/plugins/export/xlsx/tmp/export/.gitignore new file mode 100644 index 0000000..cf57c3b --- /dev/null +++ b/internal/plugins/export/xlsx/tmp/export/.gitignore @@ -0,0 +1,2 @@ +.gitignore +!.gitignore \ No newline at end of file diff --git a/internal/plugins/export/xlsx/xlsx.go b/internal/plugins/export/xlsx/xlsx.go new file mode 100644 index 0000000..3384a83 --- /dev/null +++ b/internal/plugins/export/xlsx/xlsx.go @@ -0,0 +1,299 @@ +package xlsx + +import ( + "context" + "joybuywork/internal/plugins/export" + "fmt" + + "github.com/xuri/excelize/v2" +) + +const ( + DefaultSheetName = "Sheet1" //默认拥有的工作簿名称 +) + +const ( + defaultSfIdx = 2 //每个sheet写入行从第二行开始 +) + +var columnField = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} + +type Export struct { + export.BaseExport + file *excelize.File //xlsx的文件对象 + + //多sheet模式需要的参数 + ss []Sheet //要导出的sheet + ssIdx int //当前导出的sheet索引 + swIdx int //当前切换的idx + sfv map[string]int //切换字段值对应的sheet的索引(PS:当设定了sheet对应字段是对应的值得时候,就会写到那个sheet上) + + //下面都是不用多sheet模式需要的参数 + sfIdx int64 //当前sheet写到第几行 + sheet string //当前写入的sheet + fields map[string]string //头部对应的表格列和字段名 map[string]string{"A":"字段key1", "B": "字段key2"} + header map[string]string //表头数据map[string]string{"A1":"表头1", "B1": "表头2"} +} + +// NewExport 实例化一个xlsx导出对象 +func NewExport(ctx context.Context, header export.HeaderField, total int64, opts ...export.Option) *Export { + ept := new(Export) + { + ept.Init(ctx, header, total, opts...) + } + + //初始化表头信息 + ept.header, ept.fields = ept.getHeaderAndFields() + + //设置文件名称 + ept.SetFilename(ept) + + //初始化文件 + ept.initFile() + + //默认的工作簿名称 + ept.sheet, ept.sfIdx = DefaultSheetName, defaultSfIdx + + return ept +} + +// Use 使用一些参数 +func (e *Export) Use(opts ...Option) *Export { + for _, opt := range opts { + opt(e) + } + return e +} + +// 初始化文件 +func (e *Export) initFile() { + if e.IsCustomerFile() { + e.file, _ = excelize.OpenFile(e.GetFullPath()) + } else { + e.file = excelize.NewFile() + } +} + +// 自动切换sheet +func (e *Export) checkSwitchSheet() (ok bool) { + if !e.HasManySheet() || e.sfv != nil { + return + } + + //当前sheet是不是写满了,写满了就切 + if e.ss[e.ssIdx].writeNum == e.ss[e.ssIdx].Total { + ok = e.switchSheet() + } else { + //当前sheet写入多一条数据 + e.ss[e.ssIdx].writeNum++ + } + + return +} + +// 切换sheet +func (e *Export) switchSheet() (sws bool) { + l := len(e.ss) + + //已经是最后一页 + if l-1 == e.swIdx { + return + } + + //剩余的sheet + remain := e.ss[e.swIdx+1:] + for _, v := range remain { + //下一个sheet + e.swIdx++ + if v.Total > 0 { + sws = true + break + } + } + + //有下一个sheet + if sws { + //把切换成功的idx换成导出的idx + e.ssIdx, e.sfIdx = e.swIdx, defaultSfIdx + + //初始化sheet + e.initSheet(&e.ss[e.ssIdx], false) + } + + return +} + +// 初始化sheet +func (e *Export) initSheet(sheet *Sheet, setHead bool) { + e.sheet, e.Header = sheet.Name, sheet.Header + + if sheet.header == nil || sheet.fields == nil { + //初始化字段数据 + sheet.header, sheet.fields = e.getHeaderAndFields() + sheet.sfIdx = defaultSfIdx + } + + //设置当前导出sheet + e.header, e.fields = sheet.header, sheet.fields + + //设置sheet的表头 + if setHead { + _ = e.setHeader() + } +} + +// 获取字段信息字段信息 +func (e *Export) getHeaderAndFields() (map[string]string, map[string]string) { + //初始化导出表头和字段数据 + header, fields := make(map[string]string), make(map[string]string) + for k, v := range e.Header { + cf := e.getColumnField(k) + fields[cf] = v.Field + header[fmt.Sprintf("%s1", cf)] = v.Title //第一行写表头 + } + return header, fields +} + +// 获取column +func (e *Export) getColumnField(idx int) string { + if idx < len(columnField) { + return columnField[idx] + } + + f := (idx / len(columnField)) - 1 + i := idx % len(columnField) + + return fmt.Sprintf("%s%s", columnField[f], columnField[i]) + +} + +type SheetRowData struct { + sheet string //当前行写入的sheet + row map[string]any //当前行的数据 +} + +// 获取写入xlsx的数据行 +func (e *Export) getList(data []export.RowData) (list []SheetRowData) { + list = make([]SheetRowData, 0, len(data)) + for _, row := range data { + list = append(list, e.getSheetData(row)) + } + return +} + +// 获取sheet的数据 +func (e *Export) getSheetData(row export.RowData) SheetRowData { + fields, idx, sfIdx := e.fields, e.ssIdx, e.sfIdx + + var one = SheetRowData{ + sheet: e.sheet, + row: map[string]any{}, + } + + //如果事标识的分sheet + if e.sfv != nil { + for field, value := range row { + if i, ok := e.sfv[e.getSfvKey(field, value)]; ok { + idx = i + fields, one.sheet, sfIdx = e.ss[idx].fields, e.ss[idx].Name, e.ss[idx].sfIdx + } + } + e.ss[idx].sfIdx++ + } + + //当前行的数据 + for column, field := range fields { + columnKey := fmt.Sprintf("%s%d", column, sfIdx) + one.row[columnKey] = "" + if v, ok := row[field]; ok { + one.row[columnKey] = v + } + } + e.sfIdx++ + + return one +} + +// 初始化xlsx文件对象 +func (e *Export) setHeader() (err error) { + for axis, value := range e.header { + err = e.file.SetCellValue(e.sheet, axis, value) + if err != nil { + return + } + } + return +} + +// DeleteSheet 删除工作表 +func (e *Export) DeleteSheet(name string) { + e.file.DeleteSheet(name) +} + +// CreateSheet 创建sheet +func (e *Export) CreateSheet(name string) (idx int) { + idx, _ = e.file.GetSheetIndex(name) + if idx == -1 { + idx, _ = e.file.NewSheet(name) + } + return +} + +// ExportFile 直接导出数据 +func (e *Export) ExportFile(data []export.RowData) (err error) { + err = e.setHeader() + if err != nil { + return + } + + //工作簿写入 + e.sheetWrite(data) + + return e.file.SaveAs(e.GetFullPath()) +} + +// 工作簿写入 +func (e *Export) sheetWrite(data []export.RowData) { + list := e.getList(data) + for key, row := range list { + //有标识切sheet的时候 + ok := e.checkSwitchSheet() + if ok { //切换成功,要重新计算行数 + e.sheetWrite(data[key:]) + return + } + + //写入文件 + for axis, value := range row.row { + switch value.(type) { + case int: + _ = e.file.SetCellInt(row.sheet, axis, value.(int)) + case int32: + _ = e.file.SetCellInt(row.sheet, axis, int(value.(int32))) + case uint32: + _ = e.file.SetCellInt(row.sheet, axis, int(value.(uint32))) + case int64: + _ = e.file.SetCellInt(row.sheet, axis, int(value.(int64))) + case uint64: + _ = e.file.SetCellInt(row.sheet, axis, int(value.(uint64))) + default: + _ = e.file.SetCellValue(row.sheet, axis, fmt.Sprintf("%v\t", value)) + } + } + } +} + +// FileSuffix 文件后缀 +func (e *Export) FileSuffix() string { + return "xlsx" +} + +// HasManySheet 是否有多sheet导出 +func (e *Export) HasManySheet() bool { + return len(e.ss) > 0 +} + +// 获取sfv的key +func (e *Export) getSfvKey(key string, val interface{}) string { + return fmt.Sprintf("%s_%v", key, val) +} diff --git a/internal/plugins/export/xlsx/xlsx_test.go b/internal/plugins/export/xlsx/xlsx_test.go new file mode 100644 index 0000000..8e89a93 --- /dev/null +++ b/internal/plugins/export/xlsx/xlsx_test.go @@ -0,0 +1,165 @@ +package xlsx + +import ( + "context" + "joybuywork/internal/plugins/export" + "fmt" + "testing" +) + +func getData() (export.HeaderField, []export.RowData) { + header := export.HeaderField{ + { + Field: "name", + Title: "姓名", + }, + { + Field: "age", + Title: "年龄", + }, + { + Field: "like", + Title: "喜欢", + }, + { + Field: "type", + Title: "类型", + }, + } + + var data []export.RowData + for i := 0; i < 20; i++ { + row := export.RowData{ + "name": fmt.Sprintf("学生%d", i), + "age": 15, + "like": fmt.Sprintf("不知道%d", i), + "type": i % 3, + } + data = append(data, row) + } + + return header, data +} + +func TestExportXlsx(t *testing.T) { + header, data := getData() + + ept := NewExport(context.Background(), header, int64(len(data))) + err := ept.ExportFile(data) + t.Log(err, ept.GetFullPath()) +} + +func TestProceed(t *testing.T) { + header, data := getData() + + xt, err := NewExport(context.Background(), header, int64(len(data)), + export.UseFile( + "ept_c6dhe3kjmgh5q40gftsg82921.xlsx", + "G:\\Work\\go\\src\\app_service\\pkg\\components\\export\\xlsx/tmp/export/ept_c6dhe3kjmgh5q40gftsg82921.xlsx", + ), + ).UpgradeTask(export.UserProceed(500, 0)) + + if err != nil { + t.Log(err) + return + } + + export.Done(xt) + + xt.AppendData(data) + + reply := <-xt.GetReply() + + if reply.Error != nil { + t.Log(err) + return + } + t.Log(reply.Filename, reply.FilePath, reply.Fr) +} + +func TestExportXlsxSheet(t *testing.T) { + header, data := getData() + + dataL := int64(len(data)) + + xt, err := NewExport(context.Background(), header, dataL).Use( + UseDefaultSheet("一阶"), + UseManySheet( + Sheet{ + Name: "一阶", + Header: header, + Total: 10, + SwitchField: []SwitchField{ + { + Key: "type", + Val: 0, + }, + }, + }, + Sheet{ + Name: "二阶", + Header: header, + Total: 5, + SwitchField: []SwitchField{ + { + Key: "type", + Val: 1, + }, + }, + }, + Sheet{ + Name: "三阶", + Header: header, + Total: 5, + SwitchField: []SwitchField{ + { + Key: "type", + Val: 2, + }, + }, + }, + ), + ).UpgradeTask() + if err != nil { + t.Log(err) + return + } + + export.Done(xt) + + xt.AppendData(data) + + reply := <-xt.GetReply() + + if reply.Error != nil { + t.Log(reply.Error) + return + } + t.Log(reply.Filename, reply.FilePath, reply.Fr) +} + +func TestExportXlsxTask(t *testing.T) { + header, data := getData() + + xt, err := NewExport(context.Background(), header, int64(len(data))).UpgradeTask(export.UseFinishPart(200, func(spn, nfp float64) { + t.Log(spn, nfp) + })) + if err != nil { + t.Log(err) + return + } + + xt.GetHashMark() + + export.Done(xt) + + xt.AppendData(data) + + reply := <-xt.GetReply() + + if reply.Error != nil { + t.Log(err) + return + } + t.Log(reply.Filename, reply.FilePath, reply.Fr) +} diff --git a/internal/plugins/hashid/dbid.go b/internal/plugins/hashid/dbid.go new file mode 100644 index 0000000..9ed7d31 --- /dev/null +++ b/internal/plugins/hashid/dbid.go @@ -0,0 +1,65 @@ +package hashid + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "fmt" + "gorm.io/gen/field" + "time" +) + +type IDbId interface { + TableName() string + GetFieldByName(fieldName string) (field.OrderExpr, bool) +} + +// IncrDbId 借助redis来做自增主键 +func IncrDbId(ctx context.Context, table IDbId, pks ...string) (id int64, err error) { + key := fmt.Sprintf("joybuywork:dbid:%s", table.TableName()) + defer func() { + if err != nil { + return + } + id, err = app.Redis.Incr(ctx, key) + }() + + exist, _ := app.Redis.Exists(ctx, key) + if exist { + return + } + + lc := app.NewFollower(ctx, ckey.ForLock(key)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + exist, _ = app.Redis.Exists(ctx, key) + if exist { + return + } + + var MaxId struct { + Id int64 `json:"id"` + } + + var pkField = "id" + for _, pk := range pks { + _, ok := table.GetFieldByName(pk) + if ok { + pkField = pk + break + } + } + + err = app.DB.Client.WithContext(ctx).Table(table.TableName()).Select(fmt.Sprintf("MAX(%s) as id", pkField)).Scan(&MaxId).Error + if err != nil { + return + } + + err = app.Redis.Cache.IncrBy(ctx, key, MaxId.Id).Err() + app.Redis.Cache.ExpireAt(ctx, key, time.Now().AddDate(0, 6, 0)) + return +} diff --git a/internal/plugins/hashid/hash_id.go b/internal/plugins/hashid/hash_id.go new file mode 100644 index 0000000..f99f283 --- /dev/null +++ b/internal/plugins/hashid/hash_id.go @@ -0,0 +1,22 @@ +package hashid + +import ( + "joybuywork/internal/app" + "fmt" + "github.com/rs/xid" +) + +// Id 20位的字符Id +func Id() string { + return xid.New().String() +} + +// IdBase16 16进制的id +func IdBase16() string { + return fmt.Sprintf("%x", IdBigint()) +} + +// IdBigint 整形id +func IdBigint() int64 { + return app.SnowFlakeNode.Generate().Int64() +} diff --git a/internal/plugins/hashid/hash_id_test.go b/internal/plugins/hashid/hash_id_test.go new file mode 100644 index 0000000..ecdb524 --- /dev/null +++ b/internal/plugins/hashid/hash_id_test.go @@ -0,0 +1,19 @@ +package hashid + +import ( + "testing" + + _ "joybuywork/test" +) + +func TestNormalId(t *testing.T) { + for i := 0; i < 20; i++ { + t.Log(Id()) + } +} + +func TestShortId(t *testing.T) { + for i := 0; i < 20; i++ { + t.Log(IdBase16()) + } +} diff --git a/internal/plugins/jsonm/jsonm.go b/internal/plugins/jsonm/jsonm.go new file mode 100644 index 0000000..04429c7 --- /dev/null +++ b/internal/plugins/jsonm/jsonm.go @@ -0,0 +1,115 @@ +package jsonm + +import ( + "bytes" + "crypto/md5" + "encoding/hex" + "encoding/json" + "reflect" +) + +type JsonM []byte + +// ToString 变成字符串 +func (m JsonM) ToString() string { + if m == nil { + return "" + } + return bytes.NewBuffer(m).String() +} + +// ToBytes 变成字节 +func (m JsonM) ToBytes() []byte { + if m == nil { + return nil + } + return bytes.NewBuffer(m).Bytes() +} + +// ToMd5 变成md5数据 +func (m JsonM) ToMd5() (str string, err error) { + hash := md5.New() + _, err = hash.Write(m) + if err != nil { + return + } + str = hex.EncodeToString(hash.Sum(nil)) + return +} + +// Marshal 直接解析为jsonM +func Marshal(v any) (JsonM, error) { + return marshal(v) +} + +// MarshalCkZero 验证传值类型是否为空值 +func MarshalCkZero(v any) (JsonM, error) { + if v == nil || reflect.ValueOf(v).IsZero() { + return nil, nil + } + + return marshal(v) +} + +// MarshalToString 转成字符串 +func MarshalToString(v any) (string, error) { + b, err := MarshalCkZero(v) + if err != nil { + return "", err + } + + return b.ToString(), nil +} + +// StrUnmarshal 字符串转结构体 +func StrUnmarshal(str string, v any) error { + if str == "" { + return nil + } + buf := bytes.NewBufferString(str) + return unmarshal(buf.Bytes(), v) +} + +// Unmarshal 把jsonM数据转成结构体 +func Unmarshal(data JsonM, v any) error { + if data == nil { + return nil + } + return unmarshal(data, v) +} + +// ToSliceString 如果是nil数据,返回"[]" +func ToSliceString(v any) (string, error) { + b, err := MarshalCkZero(v) + if err != nil { + return "", err + } + + if b == nil { + return "[]", nil + } + + return b.ToString(), nil +} + +// ToObjString 如果是nil数据,返回"{}" +func ToObjString(v any) (string, error) { + b, err := MarshalCkZero(v) + if err != nil { + return "", err + } + + if b == nil { + return "{}", nil + } + + return b.ToString(), nil +} + +func marshal(v any) (JsonM, error) { + return json.Marshal(v) +} + +func unmarshal(data JsonM, v any) error { + return json.Unmarshal(data, v) +} diff --git a/internal/plugins/jsonm/jsonm_test.go b/internal/plugins/jsonm/jsonm_test.go new file mode 100644 index 0000000..bd1b933 --- /dev/null +++ b/internal/plugins/jsonm/jsonm_test.go @@ -0,0 +1,37 @@ +package jsonm + +import ( + "testing" +) + +type B struct { + B string `json:"b"` +} + +func TestUnmarshal(t *testing.T) { + var c *B + + b, _ := Marshal(c) + + t.Log(b == nil) + t.Log(b == nil) + +} + +func TestMarshalCkNil(t *testing.T) { + var c int64 + + t.Run("Marshal", func(t *testing.T) { + b, _ := Marshal(c) + t.Log(b == nil) + t.Log(b == nil) + }) + + t.Run("MarshalCkZero", func(t *testing.T) { + + b, _ := MarshalCkZero(c) + t.Log(b == nil) + t.Log(b == nil) + }) + +} diff --git a/internal/plugins/lucky/logger.go b/internal/plugins/lucky/logger.go new file mode 100644 index 0000000..92e4790 --- /dev/null +++ b/internal/plugins/lucky/logger.go @@ -0,0 +1,14 @@ +package lucky + +import ( + "context" + "joybuywork/internal/app" + "fmt" +) + +type Logger struct { +} + +func (l Logger) Info(ctx context.Context, v interface{}, mark string) { + app.Logger.Info(ctx, fmt.Sprintf("%s:%v", mark, v)) +} diff --git a/internal/plugins/lucky/lucky.go b/internal/plugins/lucky/lucky.go new file mode 100644 index 0000000..4f27089 --- /dev/null +++ b/internal/plugins/lucky/lucky.go @@ -0,0 +1 @@ +package lucky diff --git a/internal/plugins/printer/option.go b/internal/plugins/printer/option.go new file mode 100644 index 0000000..9ab8e82 --- /dev/null +++ b/internal/plugins/printer/option.go @@ -0,0 +1,9 @@ +package printer + +type SlowLogOption func(opt *SlowLog) + +func SetSlow(slow SlowType) SlowLogOption { + return func(opt *SlowLog) { + opt.slow = slow + } +} diff --git a/internal/plugins/printer/printer.go b/internal/plugins/printer/printer.go new file mode 100644 index 0000000..3556f82 --- /dev/null +++ b/internal/plugins/printer/printer.go @@ -0,0 +1,22 @@ +package printer + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" +) + +// Print 基于环境打印日志 +func Print(ctx context.Context, msg string, err error) { + if err != nil { + app.Logger.Warn(ctx, msg) + return + } + + if config.Config.Server.Env == consts.Prod && !consts.PrintAllLog { + return + } + + app.Logger.Info(ctx, msg) +} diff --git a/internal/plugins/printer/slow_log.go b/internal/plugins/printer/slow_log.go new file mode 100644 index 0000000..5f51139 --- /dev/null +++ b/internal/plugins/printer/slow_log.go @@ -0,0 +1,114 @@ +package printer + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/utils" + "go-micro.dev/v4/metadata" + "sync/atomic" + "time" +) + +type slows struct { + idx atomic.Int32 + slowLogs [][]*model.SlowLog + listen *app.Listener +} + +var Slow = &slows{ + idx: atomic.Int32{}, + slowLogs: make([][]*model.SlowLog, 2), + listen: app.NewListener(), +} + +func (s *slows) Run() { + Slow.listen.Listen(func() (messages []string) { + + i := s.idx.Load() + if len(s.slowLogs[i]) == 0 { + return + } + + var logs = s.slowLogs[i] + if i == 0 { + s.idx.Add(1) + } else { + s.idx.Add(-1) + } + s.slowLogs[i] = nil + + _ = dao.SlowLog.WithContext(context.Background()).CreateInBatches(logs, 300) + + return + }, 5*time.Second) +} + +func (s *slows) Stop() { + Slow.listen.Stop() +} + +// 把慢日志入库 +func init() { + if consts.CollectSlowLog { + Slow.Run() + } +} + +type SlowType func() time.Duration + +var ( + normalSlow = func() time.Duration { return 51 * time.Millisecond } // 50ms + TenNormalSlow = func() time.Duration { return 501 * time.Millisecond } // 500ms +) + +type SlowLog struct { + ctx context.Context + slow SlowType + + start time.Time +} + +// NewSlowLog 实例化一个慢日志 +func NewSlowLog(ctx context.Context, opts ...SlowLogOption) *SlowLog { + sl := &SlowLog{ + ctx: ctx, + slow: normalSlow, + } + + for _, opt := range opts { + opt(sl) + } + + return sl +} + +// Start 开始 +func (s *SlowLog) Start(msg string) { + s.start = time.Now() + Print(s.ctx, msg, nil) +} + +// End 结束 +func (s *SlowLog) End(msg string, err error, method, req, res string) { + Print(s.ctx, msg, err) + if time.Since(s.start) < s.slow() { + return + } + + if consts.CollectSlowLog { + traceId, _ := metadata.Get(s.ctx, consts.TraceIdKey) + Slow.slowLogs[int(Slow.idx.Load())] = append(Slow.slowLogs[int(Slow.idx.Load())], &model.SlowLog{ + ID: hashid.IdBigint(), + Method: method, + Req: utils.STernary[string](req, "", "{}"), + Res: utils.STernary[string](res, "", "{}"), + Sec: time.Since(s.start).Milliseconds(), + TraceID: traceId, + }) + } + +} diff --git a/internal/repository/cache/cache.go b/internal/repository/cache/cache.go new file mode 100644 index 0000000..3ee8f9e --- /dev/null +++ b/internal/repository/cache/cache.go @@ -0,0 +1,320 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "errors" + "fmt" + "math/rand" + "sync" + "sync/atomic" + "time" + + grds "github.com/go-redis/redis/v8" + "gorm.io/gorm/schema" +) + +var keyPrefix = "dbcache:" + +var ( + cacheHits atomic.Int64 + cacheMisses atomic.Int64 +) + +func init() { + machineIP := app.GetLocalIP() + + app.GoSafe(func() { + ticker := time.NewTicker(4 * time.Hour) + defer ticker.Stop() + + for range ticker.C { + hits := cacheHits.Swap(0) + misses := cacheMisses.Swap(0) + total := hits + misses + + if total == 0 { + continue + } + + hitRate := float64(hits) / float64(total) * 100 + + app.FeishuNormalSend(fmt.Sprintf( + "db cache hit rate in the last minute: ip=%s, rate=%.2f%% (%d/%d)", + machineIP, + hitRate, + hits, + total, + )) + } + }) +} + +func recordCacheResult(err error) { + if err == nil { + cacheHits.Add(1) + return + } + cacheMisses.Add(1) +} + +type Option func(cache *Cache) + +type Cache struct { + ctx context.Context + tabler schema.Tabler + rdb *grds.Client +} + +func (c *Cache) init(ctx context.Context, tabler schema.Tabler, opts ...Option) { + c.ctx = ctx + c.tabler = tabler + c.rdb = app.Redis.Cache + + for _, opt := range opts { + opt(c) + } + +} + +func (c *Cache) getIdxInt64(key string, find func() ([]byte, error), opts ...Event) (idx int64, err error) { + event := redisEvent{} + for _, opt := range opts { + opt(&event) + } + + data, err := c.redis(c.ctx, key, find, event) + if err != nil || len(data) == 0 { + return + } + + err = jsonm.Unmarshal(data, &idx) + + return +} + +func (c *Cache) get(key string, find func() ([]byte, error), opts ...Event) (entry []byte, err error) { + event := redisEvent{} + for _, opt := range opts { + opt(&event) + } + + return c.redis(c.ctx, key, find, event) +} + +func (c *Cache) getKeys(keys []string, find func(idKeys []string) (map[string][]byte, error), opts ...Event) (entrys [][]byte, err error) { + event := redisEvent{} + for _, opt := range opts { + opt(&event) + } + + return c.redisKeys(c.ctx, keys, find, event) +} + +// Redis 获取数据 +func (c *Cache) redis(ctx context.Context, idKey string, find func() ([]byte, error), event redisEvent) (data []byte, err error) { + data, err = c.rdb.Get(ctx, idKey).Bytes() + recordCacheResult(err) + if err == nil || !errors.Is(err, grds.Nil) { + return + } + + //锁 + idKeyLock := ckey.ForLock(idKey) + lock := app.NewFollower(ctx, idKeyLock).Lock() + defer lock.Release() + if lock.Error() != nil { + err = lock.Error() + return + } + + data, err = c.rdb.Get(ctx, idKey).Bytes() + if err == nil || !errors.Is(err, grds.Nil) { + return + } + + data, err = find() + if err != nil { + return + } + + // 不存数据就设置成某个数据 + if data == nil && event.NilSet != nil { + data, err = event.NilSet() + if err != nil { + return + } + } + + err = c.set(ctx, idKey, data, event) + if err != nil { + return nil, err + } + + return +} + +// Redis 获取数据 +func (c *Cache) redisKeys(ctx context.Context, idKeys []string, find func(idKeys []string) (map[string][]byte, error), event redisEvent) (list [][]byte, err error) { + type state struct { + ok bool + idKey string + } + + wg := sync.WaitGroup{} + ch := make(chan state, 1) + var lcAppend = func(idKey string) (err1 error) { + //锁 + var one []byte + idKeyLock := ckey.ForLock(idKey) + lock := app.NewFollower(ctx, idKeyLock).Lock() + defer lock.Release() + if lock.Error() != nil { + return lock.Error() + } + + one, err1 = c.rdb.Get(ctx, idKey).Bytes() + if err1 == nil { + list = append(list, one) + ch <- state{ + ok: true, + idKey: idKey, + } + } + + if !errors.Is(err1, grds.Nil) { + return + } + + err1 = nil + + wg.Add(1) + ch <- state{ + ok: false, + idKey: idKey, + } + return + } + + app.GoSafe(func() { + var memIdKeys, aLen []string + defer func() { + + if len(memIdKeys) == 0 { + return + } + dm, _ := find(memIdKeys) + + for idKey, data := range dm { + if data == nil { + return + } + + list = append(list, data) + + _ = c.set(ctx, idKey, data, event) + } + + for range memIdKeys { + wg.Done() + } + }() + + for { + idKey, ok := <-ch + if !ok { + return + } + + aLen = append(aLen, idKey.idKey) + if !idKey.ok { + memIdKeys = append(memIdKeys, idKey.idKey) + } + + if len(aLen) == len(idKeys) { + return + } + } + + }) + + for _, idKey := range idKeys { + var one []byte + one, err = c.rdb.Get(ctx, idKey).Bytes() + recordCacheResult(err) + if err == nil { + list = append(list, one) + ch <- state{ + ok: true, + idKey: idKey, + } + continue + } + + if !errors.Is(err, grds.Nil) { + return + } + + err = nil + + key := idKey + wg.Add(1) + app.GoSafe(func() { + defer wg.Done() + _ = lcAppend(key) + }) + } + + wg.Wait() + return +} + +func (c *Cache) Prefix() string { + return fmt.Sprintf("%s%s%s", ckey.ProjectPrefix, keyPrefix, c.tabler.TableName()) +} + +func (c *Cache) TTLRand() time.Duration { + return time.Duration(rand.Intn(60)+60) * time.Minute +} + +func (c *Cache) set(ctx context.Context, key string, data []byte, event redisEvent) (err error) { + if data != nil { + //1小时~2小时随机 + return c.rdb.Set(ctx, key, data, c.TTLRand()).Err() + } + + // 如果是nil也存 + if event.NilSetLimit > 0 { + return c.rdb.Set(ctx, key, data, event.NilSetLimit).Err() + } + + return +} + +type LocalLogger struct { +} + +func (l LocalLogger) Printf(format string, v ...interface{}) { + app.Logger.Info(context.Background(), fmt.Sprintf(format, v...)) +} + +const idxSplit = "||" + +func (c *Cache) IdxKey(values ...any) string { + var suffix string + var idxL = len(values) / 2 + var idx int + + for i := 0; i < idxL; i++ { + if i == 0 { + suffix += fmt.Sprintf("%v_%v", values[idx], values[idx+1]) + } else { + suffix += fmt.Sprintf("%s%v_%v", idxSplit, values[idx], values[idx+1]) + } + idx += 2 + } + + return fmt.Sprintf("%s%s%s:idx:%s", ckey.ProjectPrefix, keyPrefix, c.tabler.TableName(), suffix) +} diff --git a/internal/repository/cache/cache_test.go b/internal/repository/cache/cache_test.go new file mode 100644 index 0000000..f470880 --- /dev/null +++ b/internal/repository/cache/cache_test.go @@ -0,0 +1,60 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/service/queue/producer" + "testing" +) + +func conf() { + var filePath = config.FilePath{ + ConfigName: "config-dev", + ConfigType: "yaml", + ConfigPath: "/Users/branchcn/Project/go/src/joybuywork/etc", + } + + err := config.LoadConfig(filePath) + if err != nil { + panic(err) + } + + err = app.InitFeiShu() + if err != nil { + panic(err) + } + + app.InitLogger() + + err = app.InitDB() + if err != nil { + panic(err) + } + err = app.InitRedis() + if err != nil { + panic(err) + } + + //kafka + err = app.InitKafka() + if err != nil { + panic(err) + } + + //队列生产者 + producer.SetUp() + + consts.RunTest = true + + // 固定的奖品数据 + app.FissionFixRewards.Init() +} + +func TestReward(t *testing.T) { + conf() + c := NewReward(context.Background()) + + t.Log(c.FindByIds([]int64{1, 2})) +} diff --git a/internal/repository/cache/campaign.go b/internal/repository/cache/campaign.go new file mode 100644 index 0000000..2746772 --- /dev/null +++ b/internal/repository/cache/campaign.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type Campaign struct { + Cache +} + +func NewCampaign(ctx context.Context) *Campaign { + c := new(Campaign) + c.init(ctx, &model.FissionCampaign{}) + + return c +} + +// FindById id 获取数据 +func (c Campaign) FindById(id int64) (*model.FissionCampaign, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionCampaign + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionCampaign + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +// FindByHashId link_hash_id获取换成数据 +func (c Campaign) FindByHashId(linkHashId string) (*model.FissionCampaign, error) { + data, err := c.get(c.hashIdKey(linkHashId), func() ([]byte, error) { + m := dao.Q.FissionCampaign + data, err := m.WithContext(c.ctx).Where(m.HashID.Eq(linkHashId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var cpn *model.FissionCampaign + err = jsonm.Unmarshal(data, &cpn) + + return cpn, err +} + +func (c Campaign) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c Campaign) hashIdKey(linkHashId string) string { + return fmt.Sprintf("%s:link_hash_id:%s", c.Prefix(), linkHashId) +} + +// Clear 清理缓存 +func (c Campaign) Clear(campaigns ...*model.FissionCampaign) error { + var key []string + for _, v := range campaigns { + key = append(key, c.idKey(v.ID), c.hashIdKey(v.HashID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_ballot.go b/internal/repository/cache/campaign_ballot.go new file mode 100644 index 0000000..d380724 --- /dev/null +++ b/internal/repository/cache/campaign_ballot.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignBallot struct { + Cache +} + +func NewCampaignBallot(ctx context.Context) *CampaignBallot { + c := new(CampaignBallot) + c.init(ctx, &model.FissionCampaignBallot{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignBallot) FindByCampaignId(campaignId int64) (*model.FissionCampaignBallot, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignBallot + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignBallot + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignBallot) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignBallot) Clear(vals ...*model.FissionCampaignBallot) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_blind.go b/internal/repository/cache/campaign_blind.go new file mode 100644 index 0000000..61baec7 --- /dev/null +++ b/internal/repository/cache/campaign_blind.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignBlind struct { + Cache +} + +func NewCampaignBlind(ctx context.Context) *CampaignBlind { + c := new(CampaignBlind) + c.init(ctx, &model.FissionCampaignBlind{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignBlind) FindByCampaignId(campaignId int64) (*model.FissionCampaignBlind, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignBlind + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignBlind + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignBlind) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignBlind) Clear(vals ...*model.FissionCampaignBlind) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_cash.go b/internal/repository/cache/campaign_cash.go new file mode 100644 index 0000000..e9c63a5 --- /dev/null +++ b/internal/repository/cache/campaign_cash.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignCash struct { + Cache +} + +func NewCampaignCash(ctx context.Context) *CampaignCash { + c := new(CampaignCash) + c.init(ctx, &model.FissionCampaignCash{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignCash) FindByCampaignId(campaignId int64) (*model.FissionCampaignCash, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignCash + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignCash + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignCash) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignCash) Clear(vals ...*model.FissionCampaignCash) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_channel.go b/internal/repository/cache/campaign_channel.go new file mode 100644 index 0000000..d02b720 --- /dev/null +++ b/internal/repository/cache/campaign_channel.go @@ -0,0 +1,92 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "errors" + "fmt" +) + +type CampaignChannel struct { + Cache +} + +func NewCampaignChannel(ctx context.Context) *CampaignChannel { + c := new(CampaignChannel) + c.init(ctx, &model.FissionCampaignChannel{}) + + return c +} + +// FindById id 获取数据 +func (c CampaignChannel) FindById(id int64) (*model.FissionCampaignChannel, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionCampaignChannel + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionCampaignChannel + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +// FindByMark 通过活动渠道标识找渠道 +func (c CampaignChannel) FindByMark(campaignId int64, mark string) (*model.FissionCampaignChannel, error) { + if campaignId == 0 || mark == "" { + return nil, errors.New("params not empty") + } + + key := c.IdxKey("campaign_id", campaignId, "mark", mark) + + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.FissionCampaignChannel + data, err := m.WithContext(c.ctx).Select(m.ID).Where(m.CampaignID.Eq(campaignId), m.Mark.Eq(mark), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + + if err != nil || id == 0 { + return nil, err + } + + return c.FindById(id) +} + +func (c CampaignChannel) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c CampaignChannel) Clear(campaigns ...*model.FissionCampaignChannel) error { + var key []string + for _, v := range campaigns { + key = append(key, c.idKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_chat.go b/internal/repository/cache/campaign_chat.go new file mode 100644 index 0000000..932176b --- /dev/null +++ b/internal/repository/cache/campaign_chat.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignChat struct { + Cache +} + +func NewCampaignChat(ctx context.Context) *CampaignChat { + c := new(CampaignChat) + c.init(ctx, &model.FissionCampaignChat{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignChat) FindByCampaignId(campaignId int64) (*model.FissionCampaignChat, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignChat + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignChat + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignChat) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignChat) Clear(vals ...*model.FissionCampaignChat) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_child.go b/internal/repository/cache/campaign_child.go new file mode 100644 index 0000000..57aaf80 --- /dev/null +++ b/internal/repository/cache/campaign_child.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignChild struct { + Cache +} + +func NewCampaignChild(ctx context.Context) *CampaignChild { + c := new(CampaignChild) + c.init(ctx, &model.FissionCampaignChild{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c CampaignChild) FindByUniqIdx(pcpnId int64, childType int8) (*model.FissionCampaignChild, error) { + data, err := c.get(c.uniqKey(pcpnId, childType), func() ([]byte, error) { + m := dao.Q.FissionCampaignChild + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(pcpnId), m.Type.Eq(childType)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionCampaignChild + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c CampaignChild) uniqKey(pcpnId int64, childType int8) string { + return fmt.Sprintf("%s:%d_%d", c.Prefix(), pcpnId, childType) +} + +// Clear 清理缓存 +func (c CampaignChild) Clear(vals ...*model.FissionCampaignChild) error { + var key []string + for _, v := range vals { + key = append(key, c.uniqKey(v.CampaignID, v.Type)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_chop.go b/internal/repository/cache/campaign_chop.go new file mode 100644 index 0000000..7234f70 --- /dev/null +++ b/internal/repository/cache/campaign_chop.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignChop struct { + Cache +} + +func NewCampaignChop(ctx context.Context) *CampaignChop { + c := new(CampaignChop) + c.init(ctx, &model.FissionCampaignChop{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignChop) FindByCampaignId(campaignId int64) (*model.FissionCampaignChop, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignChop + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignChop + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignChop) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignChop) Clear(vals ...*model.FissionCampaignChop) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_coin.go b/internal/repository/cache/campaign_coin.go new file mode 100644 index 0000000..c24c0a1 --- /dev/null +++ b/internal/repository/cache/campaign_coin.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignCoin struct { + Cache +} + +func NewCampaignCoin(ctx context.Context) *CampaignCoin { + c := new(CampaignCoin) + c.init(ctx, &model.FissionCampaignCoin{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignCoin) FindByCampaignId(campaignId int64) (*model.FissionCampaignCoin, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignCoin + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignCoin + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignCoin) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignCoin) Clear(vals ...*model.FissionCampaignCoin) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_cond.go b/internal/repository/cache/campaign_cond.go new file mode 100644 index 0000000..82a8f73 --- /dev/null +++ b/internal/repository/cache/campaign_cond.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignCond struct { + Cache +} + +func NewCampaignCond(ctx context.Context) *CampaignCond { + c := new(CampaignCond) + c.init(ctx, &model.FissionCampaignCond{}) + + return c +} + +// FindById campaignId 获取数据 +func (c CampaignCond) FindById(id int64) (*model.FissionCampaignCond, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionCampaignCond + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignCond + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignCond) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c CampaignCond) Clear(vals ...*model.FissionCampaignCond) error { + var key []string + for _, v := range vals { + key = append(key, c.idKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_config.go b/internal/repository/cache/campaign_config.go new file mode 100644 index 0000000..95f457f --- /dev/null +++ b/internal/repository/cache/campaign_config.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignConfig struct { + Cache +} + +func NewCampaignConfig(ctx context.Context) *CampaignConfig { + c := new(CampaignConfig) + c.init(ctx, &model.FissionCampaignConfig{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignConfig) FindByCampaignId(campaignId int64) (*model.FissionCampaignConfig, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignConfig + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignConfig + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignConfig) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignConfig) Clear(vals ...*model.FissionCampaignConfig) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_dice.go b/internal/repository/cache/campaign_dice.go new file mode 100644 index 0000000..7c6bd63 --- /dev/null +++ b/internal/repository/cache/campaign_dice.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignDice struct { + Cache +} + +func NewCampaignDice(ctx context.Context) *CampaignDice { + c := new(CampaignDice) + c.init(ctx, &model.FissionCampaignDice{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignDice) FindByCampaignId(campaignId int64) (*model.FissionCampaignDice, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignDice + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignDice + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignDice) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignDice) Clear(vals ...*model.FissionCampaignDice) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_evnet.go b/internal/repository/cache/campaign_evnet.go new file mode 100644 index 0000000..10023d2 --- /dev/null +++ b/internal/repository/cache/campaign_evnet.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignEvent struct { + Cache +} + +func NewCampaignEvent(ctx context.Context) *CampaignEvent { + c := new(CampaignEvent) + c.init(ctx, &model.FissionCampaignEvent{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignEvent) FindByCampaignId(campaignId int64, mark string) (*model.FissionCampaignEvent, error) { + data, err := c.get(c.campaignIdKey(campaignId, mark), func() ([]byte, error) { + m := dao.Q.FissionCampaignEvent + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignEvent + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignEvent) campaignIdKey(campaignId int64, mark string) string { + return fmt.Sprintf("%s:%d:%s", c.Prefix(), campaignId, mark) +} + +// Clear 清理缓存 +func (c CampaignEvent) Clear(vals ...*model.FissionCampaignEvent) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID, v.Mark)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_flip.go b/internal/repository/cache/campaign_flip.go new file mode 100644 index 0000000..aacdf27 --- /dev/null +++ b/internal/repository/cache/campaign_flip.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignFlip struct { + Cache +} + +func NewCampaignFlip(ctx context.Context) *CampaignFlip { + c := new(CampaignFlip) + c.init(ctx, &model.FissionCampaignFlip{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignFlip) FindByCampaignId(campaignId int64) (*model.FissionCampaignFlip, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignFlip + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignFlip + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignFlip) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignFlip) Clear(vals ...*model.FissionCampaignFlip) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_gashapon.go b/internal/repository/cache/campaign_gashapon.go new file mode 100644 index 0000000..5f16999 --- /dev/null +++ b/internal/repository/cache/campaign_gashapon.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignGashapon struct { + Cache +} + +func NewCampaignGashapon(ctx context.Context) *CampaignGashapon { + c := new(CampaignGashapon) + c.init(ctx, &model.FissionCampaignGashapon{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignGashapon) FindByCampaignId(campaignId int64) (*model.FissionCampaignGashapon, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignGashapon + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignGashapon + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignGashapon) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignGashapon) Clear(vals ...*model.FissionCampaignGashapon) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_gold.go b/internal/repository/cache/campaign_gold.go new file mode 100644 index 0000000..394a83e --- /dev/null +++ b/internal/repository/cache/campaign_gold.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignGold struct { + Cache +} + +func NewCampaignGold(ctx context.Context) *CampaignGold { + c := new(CampaignGold) + c.init(ctx, &model.FissionCampaignGold{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignGold) FindByCampaignId(campaignId int64) (*model.FissionCampaignGold, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignGold + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignGold + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignGold) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignGold) Clear(vals ...*model.FissionCampaignGold) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_grid.go b/internal/repository/cache/campaign_grid.go new file mode 100644 index 0000000..e3c93b5 --- /dev/null +++ b/internal/repository/cache/campaign_grid.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignGrid struct { + Cache +} + +func NewCampaignGrid(ctx context.Context) *CampaignGrid { + c := new(CampaignGrid) + c.init(ctx, &model.FissionCampaignGrid{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignGrid) FindByCampaignId(campaignId int64) (*model.FissionCampaignGrid, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignGrid + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignGrid + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignGrid) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignGrid) Clear(vals ...*model.FissionCampaignGrid) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_keep.go b/internal/repository/cache/campaign_keep.go new file mode 100644 index 0000000..f4e7d5c --- /dev/null +++ b/internal/repository/cache/campaign_keep.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignKeep struct { + Cache +} + +func NewCampaignKeep(ctx context.Context) *CampaignKeep { + c := new(CampaignKeep) + c.init(ctx, &model.FissionCampaignKeep{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignKeep) FindByCampaignId(campaignId int64) (*model.FissionCampaignKeep, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignKeep + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignKeep + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignKeep) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignKeep) Clear(vals ...*model.FissionCampaignKeep) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_lang.go b/internal/repository/cache/campaign_lang.go new file mode 100644 index 0000000..1dc7b87 --- /dev/null +++ b/internal/repository/cache/campaign_lang.go @@ -0,0 +1,62 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "fmt" +) + +type CampaignLang struct { + Cache +} + +func NewCampaignLang(ctx context.Context) *CampaignLang { + c := new(CampaignLang) + c.init(ctx, &model.FissionCampaignLang{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignLang) FindByCampaignId(campaignId int64, langMark string) (*model.FissionCampaignLang, error) { + data, err := c.get(c.campaignIdKey(campaignId, langMark), func() ([]byte, error) { + m := dao.Q.FissionCampaignLang + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.LangMark.Eq(langMark), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignLang + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignLang) campaignIdKey(campaignId int64, langMark string) string { + return fmt.Sprintf("%s:%d:%s", c.Prefix(), campaignId, langMark) +} + +// Clear 清理缓存 +func (c CampaignLang) Clear(vals ...*model.FissionCampaignLang) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID, v.LangMark)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_points_use.go b/internal/repository/cache/campaign_points_use.go new file mode 100644 index 0000000..5f08e8d --- /dev/null +++ b/internal/repository/cache/campaign_points_use.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignPointsUse struct { + Cache +} + +func NewCampaignPointsUse(ctx context.Context) *CampaignPointsUse { + c := new(CampaignPointsUse) + c.init(ctx, &model.FissionCampaignPointsUse{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignPointsUse) FindByCampaignId(campaignId int64) (*model.FissionCampaignPointsUse, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignPointsUse + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignPointsUse + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignPointsUse) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignPointsUse) Clear(vals ...*model.FissionCampaignPointsUse) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_qa.go b/internal/repository/cache/campaign_qa.go new file mode 100644 index 0000000..b1898ab --- /dev/null +++ b/internal/repository/cache/campaign_qa.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignQa struct { + Cache +} + +func NewCampaignQa(ctx context.Context) *CampaignQa { + c := new(CampaignQa) + c.init(ctx, &model.FissionCampaignQa{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignQa) FindByCampaignId(campaignId int64) (*model.FissionCampaignQa, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignQa + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignQa + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignQa) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignQa) Clear(vals ...*model.FissionCampaignQa) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_quiz.go b/internal/repository/cache/campaign_quiz.go new file mode 100644 index 0000000..b0ef7c8 --- /dev/null +++ b/internal/repository/cache/campaign_quiz.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignQuiz struct { + Cache +} + +func NewCampaignQuiz(ctx context.Context) *CampaignQuiz { + c := new(CampaignQuiz) + c.init(ctx, &model.FissionCampaignQuiz{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignQuiz) FindByCampaignId(campaignId int64) (*model.FissionCampaignQuiz, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignQuiz + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignQuiz + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignQuiz) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignQuiz) Clear(vals ...*model.FissionCampaignQuiz) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_referral.go b/internal/repository/cache/campaign_referral.go new file mode 100644 index 0000000..b43cc09 --- /dev/null +++ b/internal/repository/cache/campaign_referral.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignReferral struct { + Cache +} + +func NewCampaignReferral(ctx context.Context) *CampaignReferral { + c := new(CampaignReferral) + c.init(ctx, &model.FissionCampaignReferral{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignReferral) FindByCampaignId(campaignId int64) (*model.FissionCampaignReferral, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignReferral + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignReferral + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignReferral) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignReferral) Clear(vals ...*model.FissionCampaignReferral) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_reward_rule.go b/internal/repository/cache/campaign_reward_rule.go new file mode 100644 index 0000000..791b214 --- /dev/null +++ b/internal/repository/cache/campaign_reward_rule.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignRewardRule struct { + Cache +} + +func NewCampaignRewardRule(ctx context.Context) *CampaignRewardRule { + c := new(CampaignRewardRule) + c.init(ctx, &model.FissionCampaignRewardRule{}) + + return c +} + +// FindByRewardId rewardId 获取数据 +func (c CampaignRewardRule) FindByRewardId(rewardId int64) (*model.FissionCampaignRewardRule, error) { + data, err := c.get(c.rewardIdKey(rewardId), func() ([]byte, error) { + m := dao.Q.FissionCampaignRewardRule + data, err := m.WithContext(c.ctx).Where(m.RewardID.Eq(rewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignRewardRule + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignRewardRule) rewardIdKey(rewardId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), rewardId) +} + +// Clear 清理缓存 +func (c CampaignRewardRule) Clear(vals ...*model.FissionCampaignRewardRule) error { + var key []string + for _, v := range vals { + key = append(key, c.rewardIdKey(v.RewardID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_sign.go b/internal/repository/cache/campaign_sign.go new file mode 100644 index 0000000..271518c --- /dev/null +++ b/internal/repository/cache/campaign_sign.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignSign struct { + Cache +} + +func NewCampaignSign(ctx context.Context) *CampaignSign { + c := new(CampaignSign) + c.init(ctx, &model.FissionCampaignSign{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignSign) FindByCampaignId(campaignId int64) (*model.FissionCampaignSign, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignSign + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignSign + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignSign) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignSign) Clear(vals ...*model.FissionCampaignSign) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_slot.go b/internal/repository/cache/campaign_slot.go new file mode 100644 index 0000000..406a107 --- /dev/null +++ b/internal/repository/cache/campaign_slot.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignSlot struct { + Cache +} + +func NewCampaignSlot(ctx context.Context) *CampaignSlot { + c := new(CampaignSlot) + c.init(ctx, &model.FissionCampaignSlot{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignSlot) FindByCampaignId(campaignId int64) (*model.FissionCampaignSlot, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignSlot + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignSlot + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignSlot) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignSlot) Clear(vals ...*model.FissionCampaignSlot) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_style.go b/internal/repository/cache/campaign_style.go new file mode 100644 index 0000000..5fe2fe4 --- /dev/null +++ b/internal/repository/cache/campaign_style.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignStyle struct { + Cache +} + +func NewCampaignStyle(ctx context.Context) *CampaignStyle { + c := new(CampaignStyle) + c.init(ctx, &model.FissionCampaignStyle{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignStyle) FindByCampaignId(campaignId int64) (*model.FissionCampaignStyle, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignStyle + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignStyle + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignStyle) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignStyle) Clear(vals ...*model.FissionCampaignStyle) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_ticket.go b/internal/repository/cache/campaign_ticket.go new file mode 100644 index 0000000..5cf1afd --- /dev/null +++ b/internal/repository/cache/campaign_ticket.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignTicket struct { + Cache +} + +func NewCampaignTicket(ctx context.Context) *CampaignTicket { + c := new(CampaignTicket) + c.init(ctx, &model.FissionCampaignTicket{}) + + return c +} + +// FindById id 获取数据 +func (c CampaignTicket) FindById(id int64) (*model.FissionCampaignTicket, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionCampaignTicket + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignTicket + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +// FindByMark 通过规则标识找数据 +func (c CampaignTicket) FindByMark(campaignId int64, mark string) (*model.FissionCampaignTicket, error) { + + key := c.IdxKey("campaign_id", campaignId, "mark", mark) + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.FissionCampaignTicket + data, err := m.WithContext(c.ctx).Select(m.ID).Where(m.CampaignID.Eq(campaignId), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + + if err != nil || id == 0 { + return nil, err + } + + return c.FindById(id) +} + +func (c CampaignTicket) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c CampaignTicket) Clear(vals ...*model.FissionCampaignTicket) error { + var key []string + for _, v := range vals { + key = append(key, c.idKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_uno.go b/internal/repository/cache/campaign_uno.go new file mode 100644 index 0000000..1d82935 --- /dev/null +++ b/internal/repository/cache/campaign_uno.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignUno struct { + Cache +} + +func NewCampaignUno(ctx context.Context) *CampaignUno { + c := new(CampaignUno) + c.init(ctx, &model.FissionCampaignUno{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignUno) FindByCampaignId(campaignId int64) (*model.FissionCampaignUno, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignUno + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignUno + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignUno) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignUno) Clear(vals ...*model.FissionCampaignUno) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_vs.go b/internal/repository/cache/campaign_vs.go new file mode 100644 index 0000000..6684da7 --- /dev/null +++ b/internal/repository/cache/campaign_vs.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignVs struct { + Cache +} + +func NewCampaignVs(ctx context.Context) *CampaignVs { + c := new(CampaignVs) + c.init(ctx, &model.FissionCampaignV{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignVs) FindByCampaignId(campaignId int64) (*model.FissionCampaignV, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignV + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignV + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignVs) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignVs) Clear(vals ...*model.FissionCampaignV) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_wheel.go b/internal/repository/cache/campaign_wheel.go new file mode 100644 index 0000000..7aebe23 --- /dev/null +++ b/internal/repository/cache/campaign_wheel.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignWheel struct { + Cache +} + +func NewCampaignWheel(ctx context.Context) *CampaignWheel { + c := new(CampaignWheel) + c.init(ctx, &model.FissionCampaignWheel{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignWheel) FindByCampaignId(campaignId int64) (*model.FissionCampaignWheel, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignWheel + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignWheel + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignWheel) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignWheel) Clear(vals ...*model.FissionCampaignWheel) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/campaign_win.go b/internal/repository/cache/campaign_win.go new file mode 100644 index 0000000..208b06e --- /dev/null +++ b/internal/repository/cache/campaign_win.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CampaignWin struct { + Cache +} + +func NewCampaignWin(ctx context.Context) *CampaignWin { + c := new(CampaignWin) + c.init(ctx, &model.FissionCampaignWin{}) + + return c +} + +// FindByCampaignId campaignId 获取数据 +func (c CampaignWin) FindByCampaignId(campaignId int64) (*model.FissionCampaignWin, error) { + data, err := c.get(c.campaignIdKey(campaignId), func() ([]byte, error) { + m := dao.Q.FissionCampaignWin + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCampaignWin + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c CampaignWin) campaignIdKey(campaignId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), campaignId) +} + +// Clear 清理缓存 +func (c CampaignWin) Clear(vals ...*model.FissionCampaignWin) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/company_made.go b/internal/repository/cache/company_made.go new file mode 100644 index 0000000..5791497 --- /dev/null +++ b/internal/repository/cache/company_made.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type CompanyMade struct { + Cache +} + +func NewCompanyMade(ctx context.Context) *CompanyMade { + c := new(CompanyMade) + c.init(ctx, &model.CompanyMade{}) + + return c +} + +// FindByUniqId id 获取数据 +func (c CompanyMade) FindByUniqId(companyId int64, mark string) (*model.CompanyMade, error) { + data, err := c.get(c.uniqIdKey(companyId, mark), func() ([]byte, error) { + m := dao.Q.CompanyMade + data, err := m.WithContext(c.ctx).Where(m.CompanyID.Eq(companyId), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.CompanyMade + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c CompanyMade) uniqIdKey(companyId int64, mark string) string { + return fmt.Sprintf("%s:company_id:%d:mark:%s", c.Prefix(), companyId, mark) +} + +// Clear 清理缓存 +func (c CompanyMade) Clear(campaigns ...*model.CompanyMade) error { + var key []string + for _, v := range campaigns { + key = append(key, c.uniqIdKey(v.CompanyID, v.Mark)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_chat.go b/internal/repository/cache/fission_chat.go new file mode 100644 index 0000000..a4cf635 --- /dev/null +++ b/internal/repository/cache/fission_chat.go @@ -0,0 +1,75 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/withdefault" + "fmt" +) + +type FissionChat struct { + Cache +} + +func NewFissionChat(ctx context.Context) *FissionChat { + c := new(FissionChat) + c.init(ctx, &model.FissionChat{}) + + return c +} + +// FindByUniq 获取数据 +func (c FissionChat) FindByUniq(campaignId, userId int64) (*model.FissionChat, error) { + data, err := c.get(c.uniqKey(userId), func() ([]byte, error) { + m := dao.Q.FissionChat + data, err := m.WithContext(c.ctx).Where(m.UserID.Eq(userId), m.CancelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }, WithNilSet(func() ([]byte, error) { + chat := withdefault.FissionChat(&model.FissionChat{ + CampaignID: campaignId, + UserID: userId, + CancelTime: 0, + }) + + err := dao.Q.FissionChat.WithContext(c.ctx).Create(chat) + if err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(chat) + })) + if err != nil { + return nil, err + } + + var conf *model.FissionChat + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c FissionChat) uniqKey(userId int64) string { + return fmt.Sprintf("%s:user_id:%d", c.Prefix(), userId) +} + +// Clear 清理缓存 +func (c FissionChat) Clear(vals ...*model.FissionChat) error { + var key []string + for _, v := range vals { + key = append(key, c.uniqKey(v.UserID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_child_user.go b/internal/repository/cache/fission_child_user.go new file mode 100644 index 0000000..fb14bbe --- /dev/null +++ b/internal/repository/cache/fission_child_user.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionChildUser struct { + Cache +} + +func NewFissionChildUser(ctx context.Context) *FissionChildUser { + c := new(FissionChildUser) + c.init(ctx, &model.FissionChildUser{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c FissionChildUser) FindByUniqIdx(userId, cpnId int64, events ...Event) (*model.FissionChildUser, error) { + data, err := c.get(c.uniqKey(userId, cpnId), func() ([]byte, error) { + m := dao.Q.FissionChildUser + data, err := m.WithContext(c.ctx).Where(m.UserID.Eq(userId), m.CampaignID.Eq(cpnId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }, events...) + if err != nil { + return nil, err + } + + var info *model.FissionChildUser + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c FissionChildUser) uniqKey(userId, cpnId int64) string { + return fmt.Sprintf("%s:%d_%d", c.Prefix(), userId, cpnId) +} + +// Clear 清理缓存 +func (c FissionChildUser) Clear(vals ...*model.FissionChildUser) error { + var key []string + for _, v := range vals { + key = append(key, c.uniqKey(v.UserID, v.CampaignID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_config.go b/internal/repository/cache/fission_config.go new file mode 100644 index 0000000..d418484 --- /dev/null +++ b/internal/repository/cache/fission_config.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionConfig struct { + Cache +} + +func NewFissionConfig(ctx context.Context) *FissionConfig { + c := new(FissionConfig) + c.init(ctx, &model.FissionConfig{}) + + return c +} + +// FindByProjectId id 获取数据 +func (c FissionConfig) FindByProjectId(projectId int64) (*model.FissionConfig, error) { + data, err := c.get(c.projectIdKey(projectId), func() ([]byte, error) { + m := dao.Q.FissionConfig + data, err := m.WithContext(c.ctx).Where(m.ProjectID.Eq(projectId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionConfig + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c FissionConfig) projectIdKey(id int64) string { + return fmt.Sprintf("%s:project_id:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c FissionConfig) Clear(campaigns ...*model.FissionConfig) error { + var key []string + for _, v := range campaigns { + key = append(key, c.projectIdKey(v.ProjectID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_custom_btn.go b/internal/repository/cache/fission_custom_btn.go new file mode 100644 index 0000000..271d0b0 --- /dev/null +++ b/internal/repository/cache/fission_custom_btn.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionCustomBtn struct { + Cache +} + +func NewFissionCustomBtn(ctx context.Context) *FissionCustomBtn { + c := new(FissionCustomBtn) + c.init(ctx, &model.FissionCustomBtn{}) + + return c +} + +// FindByUniq 获取数据 +func (c FissionCustomBtn) FindByUniq(campaignId int64, text string) (*model.FissionCustomBtn, error) { + data, err := c.get(c.campaignIdKey(campaignId, text), func() ([]byte, error) { + m := dao.Q.FissionCustomBtn + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.BtnText.Eq(text)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.FissionCustomBtn + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c FissionCustomBtn) campaignIdKey(campaignId int64, text string) string { + return fmt.Sprintf("%s:%d_%s", c.Prefix(), campaignId, text) +} + +// Clear 清理缓存 +func (c FissionCustomBtn) Clear(vals ...*model.FissionCustomBtn) error { + var key []string + for _, v := range vals { + key = append(key, c.campaignIdKey(v.CampaignID, v.BtnText)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_temp.go b/internal/repository/cache/fission_temp.go new file mode 100644 index 0000000..b456b8c --- /dev/null +++ b/internal/repository/cache/fission_temp.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionTemp struct { + Cache +} + +func NewFissionTemp(ctx context.Context) *FissionTemp { + c := new(FissionTemp) + c.init(ctx, &model.FissionTemp{}) + + return c +} + +// FindById id 获取数据 +func (c FissionTemp) FindById(id int64) (*model.FissionTemp, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionTemp + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionTemp + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +// FindByHashId link_hash_id获取换成数据 +func (c FissionTemp) FindByHashId(linkHashId string) (*model.FissionTemp, error) { + data, err := c.get(c.hashIdKey(linkHashId), func() ([]byte, error) { + m := dao.Q.FissionTemp + data, err := m.WithContext(c.ctx).Where(m.HashID.Eq(linkHashId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var cpn *model.FissionTemp + err = jsonm.Unmarshal(data, &cpn) + + return cpn, err +} + +func (c FissionTemp) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c FissionTemp) hashIdKey(hashId string) string { + return fmt.Sprintf("%s:hash_id:%s", c.Prefix(), hashId) +} + +// Clear 清理缓存 +func (c FissionTemp) Clear(campaigns ...*model.FissionTemp) error { + var key []string + for _, v := range campaigns { + key = append(key, c.idKey(v.ID), c.hashIdKey(v.HashID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_temp_group.go b/internal/repository/cache/fission_temp_group.go new file mode 100644 index 0000000..78fe17b --- /dev/null +++ b/internal/repository/cache/fission_temp_group.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionTempGroup struct { + Cache +} + +func NewFissionTempGroup(ctx context.Context) *FissionTempGroup { + c := new(FissionTempGroup) + c.init(ctx, &model.FissionTempGroup{}) + + return c +} + +// FindById id 获取数据 +func (c FissionTempGroup) FindById(id int64) (*model.FissionTempGroup, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionTempGroup + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionTempGroup + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c FissionTempGroup) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c FissionTempGroup) Clear(campaigns ...*model.FissionTempGroup) error { + var key []string + for _, v := range campaigns { + key = append(key, c.idKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_total.go b/internal/repository/cache/fission_total.go new file mode 100644 index 0000000..513e276 --- /dev/null +++ b/internal/repository/cache/fission_total.go @@ -0,0 +1,64 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionTotal struct { + Cache +} + +func NewFissionTotal(ctx context.Context) *FissionTotal { + c := new(FissionTotal) + c.init(ctx, &model.FissionTotal{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c FissionTotal) FindByUniqIdx(campaignId int64, mark string) (int64, error) { + + key := c.IdxKey("campaign_id", campaignId, "mark", mark) + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.FissionTotal + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + if err != nil { + return 0, err + } + + return id, err +} + +func (c FissionTotal) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c FissionTotal) Clear(vals ...*model.FissionTotal) error { + var key []string + for _, v := range vals { + key = append(key, c.pkKey(v.ID), c.IdxKey("campaign_id", v.CampaignID, "mark", v.Mark)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_user.go b/internal/repository/cache/fission_user.go new file mode 100644 index 0000000..6ffd64c --- /dev/null +++ b/internal/repository/cache/fission_user.go @@ -0,0 +1,146 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "errors" + "fmt" +) + +type FissionUser struct { + Cache + campaignId int64 +} + +func NewFissionUser(ctx context.Context, campaignId int64) *FissionUser { + c := new(FissionUser) + c.init(ctx, &model.FissionUser{}) + c.campaignId = campaignId + + return c +} + +// FindByDeviceId 通过活动的设备id找数据 +func (c FissionUser) FindByDeviceId(deviceId string) (*model.FissionUser, error) { + if deviceId == "" { + return nil, errors.New("params not empty") + } + + key := c.IdxKey("campaign_id", c.campaignId, "device_id", deviceId) + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.FissionUser.SubTable(c.campaignId) + data, err := m.WithContext(c.ctx).Select(m.ID).Where(m.CampaignID.Eq(c.campaignId), m.DeviceID.Eq(deviceId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + + if err != nil || id == 0 { + return nil, err + } + + return c.FindById(id) +} + +// FindBySubUserId 通过活动的关注用户id找数据 +func (c FissionUser) FindBySubUserId(subUserId string) (*model.FissionUser, error) { + if subUserId == "" { + return nil, errors.New("params not empty") + } + + key := c.IdxKey("campaign_id", c.campaignId, "sub_user_id", subUserId) + + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.FissionUser.SubTable(c.campaignId) + data, err := m.WithContext(c.ctx).Select(m.ID).Where(m.CampaignID.Eq(c.campaignId), m.SubUserID.Eq(subUserId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + + if err != nil || id == 0 { + return nil, err + } + + return c.FindById(id) +} + +// FindById pk 获取数据 +func (c FissionUser) FindById(id int64) (*model.FissionUser, error) { + data, err := c.get(c.pkKey(id), func() ([]byte, error) { + m := dao.Q.FissionUser.SubTable(c.campaignId) + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.FissionUser + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +// FindByHashId hash_id 获取数据 +func (c FissionUser) FindByHashId(hashId string) (*model.FissionUser, error) { + data, err := c.get(c.hashKey(hashId), func() ([]byte, error) { + m := dao.Q.FissionUser.SubTable(c.campaignId) + data, err := m.WithContext(c.ctx).Where(m.HashID.Eq(hashId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.FissionUser + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +func (c FissionUser) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c FissionUser) hashKey(hashId string) string { + return fmt.Sprintf("%s:hash_id_%s", c.Prefix(), hashId) +} + +// Clear 清理缓存 +func (c FissionUser) Clear(vals ...*model.FissionUser) error { + var key []string + for _, v := range vals { + key = append(key, c.pkKey(v.ID), c.hashKey(v.HashID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_user_attr.go b/internal/repository/cache/fission_user_attr.go new file mode 100644 index 0000000..81aaecf --- /dev/null +++ b/internal/repository/cache/fission_user_attr.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionUserAttr struct { + Cache +} + +func NewFissionUserAttr(ctx context.Context) *FissionUserAttr { + c := new(FissionUserAttr) + c.init(ctx, &model.FissionUserAttr{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c FissionUserAttr) FindByUniqIdx(userId int64, attr string, events ...Event) (*model.FissionUserAttr, error) { + data, err := c.get(c.uniqKey(userId, attr), func() ([]byte, error) { + m := dao.Q.FissionUserAttr + data, err := m.WithContext(c.ctx).Where(m.UserID.Eq(userId), m.Attr.Eq(attr)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }, events...) + if err != nil { + return nil, err + } + + var info *model.FissionUserAttr + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c FissionUserAttr) uniqKey(userId int64, attr string) string { + return fmt.Sprintf("%s:%d_%s", c.Prefix(), userId, attr) +} + +// Clear 清理缓存 +func (c FissionUserAttr) Clear(vals ...*model.FissionUserAttr) error { + var key []string + for _, v := range vals { + key = append(key, c.uniqKey(v.UserID, v.Attr)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_user_attr_total.go b/internal/repository/cache/fission_user_attr_total.go new file mode 100644 index 0000000..7ae9400 --- /dev/null +++ b/internal/repository/cache/fission_user_attr_total.go @@ -0,0 +1,64 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionUserAttrTotal struct { + Cache +} + +func NewFissionUserAttrTotal(ctx context.Context) *FissionUserAttrTotal { + c := new(FissionUserAttrTotal) + c.init(ctx, &model.FissionUserAttrTotal{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c FissionUserAttrTotal) FindByUniqIdx(campaignId int64, attr, val string) (int64, error) { + + key := c.IdxKey("campaign_id", campaignId, "attr", attr, "val", val) + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.FissionUserAttrTotal + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.Attr.Eq(attr), m.Val.Eq(val)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + if err != nil { + return 0, err + } + + return id, err +} + +func (c FissionUserAttrTotal) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c FissionUserAttrTotal) Clear(vals ...*model.FissionUserAttrTotal) error { + var key []string + for _, v := range vals { + key = append(key, c.pkKey(v.ID), c.IdxKey("campaign_id", v.CampaignID, "attr", v.Attr, "val", v.Val)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_user_jattr.go b/internal/repository/cache/fission_user_jattr.go new file mode 100644 index 0000000..7333cdc --- /dev/null +++ b/internal/repository/cache/fission_user_jattr.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionUserJattr struct { + Cache +} + +func NewFissionUserJattr(ctx context.Context) *FissionUserJattr { + c := new(FissionUserJattr) + c.init(ctx, &model.FissionUserJattr{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c FissionUserJattr) FindByUniqIdx(userId int64, attr string, events ...Event) (*model.FissionUserJattr, error) { + data, err := c.get(c.uniqKey(userId, attr), func() ([]byte, error) { + m := dao.Q.FissionUserJattr + data, err := m.WithContext(c.ctx).Where(m.UserID.Eq(userId), m.Attr.Eq(attr)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }, events...) + if err != nil { + return nil, err + } + + var info *model.FissionUserJattr + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c FissionUserJattr) uniqKey(userId int64, attr string) string { + return fmt.Sprintf("%s:%d_%s", c.Prefix(), userId, attr) +} + +// Clear 清理缓存 +func (c FissionUserJattr) Clear(vals ...*model.FissionUserJattr) error { + var key []string + for _, v := range vals { + key = append(key, c.uniqKey(v.UserID, v.Attr)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_user_level.go b/internal/repository/cache/fission_user_level.go new file mode 100644 index 0000000..d3b1183 --- /dev/null +++ b/internal/repository/cache/fission_user_level.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionUserLevel struct { + Cache +} + +func NewFissionUserLevel(ctx context.Context) *FissionUserLevel { + c := new(FissionUserLevel) + c.init(ctx, &model.FissionUserLevel{}) + + return c +} + +// FindById id 获取数据 +func (c FissionUserLevel) FindById(id int64) (*model.FissionUserLevel, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.FissionUserLevel + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.FissionUserLevel + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +// FindByMarkId id 获取数据 +func (c FissionUserLevel) FindByMarkId(projectId int64, mark string) (int64, error) { + key := c.IdxKey("project_id", projectId, "mark", mark) + + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.FissionUserLevel + data, err := m.WithContext(c.ctx).Select(m.ID).Where(m.ProjectID.Eq(projectId), m.Mark.Eq(mark), m.DeletedAt.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + + if err != nil { + return 0, err + } + + return id, nil +} + +func (c FissionUserLevel) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c FissionUserLevel) Clear(list ...*model.FissionUserLevel) error { + var key []string + for _, v := range list { + key = append(key, c.idKey(v.ID), c.IdxKey("project_id", v.ProjectID, "mark", v.Mark)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/fission_web_user.go b/internal/repository/cache/fission_web_user.go new file mode 100644 index 0000000..0897835 --- /dev/null +++ b/internal/repository/cache/fission_web_user.go @@ -0,0 +1,118 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type FissionWebUser struct { + Cache +} + +func NewFissionWebUser(ctx context.Context) *FissionWebUser { + c := new(FissionWebUser) + c.init(ctx, &model.FissionWebUser{}) + + return c +} + +// FindByWebId 通过活动的设备id找数据 +func (c FissionWebUser) FindByWebId(campaignId int64, webId string) (*model.FissionWebUser, error) { + data, err := c.get(c.webIdKey(campaignId, webId), func() ([]byte, error) { + m := dao.Q.FissionWebUser + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.WebID.Eq(webId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.FissionWebUser + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +// FindById pk 获取数据 +func (c FissionWebUser) FindById(id int64) (*model.FissionWebUser, error) { + data, err := c.get(c.pkKey(id), func() ([]byte, error) { + m := dao.Q.FissionWebUser + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.FissionWebUser + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +// FindByUserId 通过活动的设备id找数据 +func (c FissionWebUser) FindByUserId(campaignId, userId int64) (*model.FissionWebUser, error) { + data, err := c.get(c.userIdKey(campaignId, userId), func() ([]byte, error) { + if userId == 0 { + return nil, nil + } + + m := dao.Q.FissionWebUser + data, err := m.WithContext(c.ctx).Where(m.CampaignID.Eq(campaignId), m.UserID.Eq(userId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.FissionWebUser + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +func (c FissionWebUser) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c FissionWebUser) webIdKey(cpnId int64, webId string) string { + return fmt.Sprintf("%s:cmapaign_id_%d:web_id_%s", c.Prefix(), cpnId, webId) +} + +func (c FissionWebUser) userIdKey(cpnId, userId int64) string { + return fmt.Sprintf("%s:cmapaign_id_%d:user_id_%d", c.Prefix(), cpnId, userId) +} + +// Clear 清理缓存 +func (c FissionWebUser) Clear(vals ...*model.FissionWebUser) error { + var key []string + for _, v := range vals { + key = append(key, c.pkKey(v.ID), c.webIdKey(v.CampaignID, v.WebID)) + if v.UserID > 0 { + key = append(key, c.pkKey(v.ID), c.userIdKey(v.UserID, v.UserID)) + } + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/form.go b/internal/repository/cache/form.go new file mode 100644 index 0000000..40475f0 --- /dev/null +++ b/internal/repository/cache/form.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type Form struct { + Cache +} + +func NewForm(ctx context.Context) *Form { + c := new(Form) + c.init(ctx, &model.Form{}) + + return c +} + +// FindById id 获取数据 +func (c Form) FindById(id int64) (*model.Form, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.Form + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.Form + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c Form) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c Form) Clear(forms ...*model.Form) error { + var key []string + for _, v := range forms { + key = append(key, c.idKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/game_total.go b/internal/repository/cache/game_total.go new file mode 100644 index 0000000..e83b9fa --- /dev/null +++ b/internal/repository/cache/game_total.go @@ -0,0 +1,64 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type GameTotal struct { + Cache +} + +func NewGameTotal(ctx context.Context) *GameTotal { + c := new(GameTotal) + c.init(ctx, &model.GameTotal{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c GameTotal) FindByUniqIdx(projectId, gameId, linkId int64) (int64, error) { + + key := c.IdxKey("project_id", projectId, "game_id", gameId, "link_id", linkId) + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.GameTotal + data, err := m.WithContext(c.ctx).Where(m.ProjectID.Eq(projectId), m.GameID.Eq(gameId), m.LinkID.Eq(linkId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + if err != nil { + return 0, err + } + + return id, err +} + +func (c GameTotal) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c GameTotal) Clear(vals ...*model.GameTotal) error { + var key []string + for _, v := range vals { + key = append(key, c.pkKey(v.ID), c.IdxKey("project_id", v.ProjectID, "game_id", v.GameID, "link_id", v.LinkID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/game_total_date.go b/internal/repository/cache/game_total_date.go new file mode 100644 index 0000000..bede010 --- /dev/null +++ b/internal/repository/cache/game_total_date.go @@ -0,0 +1,64 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type GameTotalDate struct { + Cache +} + +func NewGameTotalDate(ctx context.Context) *GameTotalDate { + c := new(GameTotalDate) + c.init(ctx, &model.GameTotalDate{}) + + return c +} + +// FindByUniqIdx 通过唯一索引获取数据 +func (c GameTotalDate) FindByUniqIdx(projectId, gameId, linkId int64, date string) (int64, error) { + + key := c.IdxKey("project_id", projectId, "game_id", gameId, "link_id", linkId, "date", date) + id, err := c.getIdxInt64(key, func() ([]byte, error) { + m := dao.Q.GameTotalDate + data, err := m.WithContext(c.ctx).Where(m.ProjectID.Eq(projectId), m.GameID.Eq(gameId), m.LinkID.Eq(linkId), m.Ymd.Eq(date)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + if data == nil { + return nil, nil + } + + return jsonm.MarshalCkZero(data.ID) + }) + if err != nil { + return 0, err + } + + return id, err +} + +func (c GameTotalDate) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c GameTotalDate) Clear(vals ...*model.GameTotalDate) error { + var key []string + for _, v := range vals { + key = append(key, c.pkKey(v.ID), c.IdxKey("project_id", v.ProjectID, "game_id", v.GameID, "link_id", v.LinkID, "date", v.Ymd)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/library_qa_group.go b/internal/repository/cache/library_qa_group.go new file mode 100644 index 0000000..ee5a56c --- /dev/null +++ b/internal/repository/cache/library_qa_group.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type LibraryQaGroup struct { + Cache +} + +func NewLibraryQaGroup(ctx context.Context) *LibraryQaGroup { + c := new(LibraryQaGroup) + c.init(ctx, &model.LibraryQaGroup{}) + + return c +} + +// FindById id 获取数据 +func (c LibraryQaGroup) FindById(id int64) (*model.LibraryQaGroup, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.LibraryQaGroup + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.LibraryQaGroup + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +// FindByHashId hash_id获取换成数据 +func (c LibraryQaGroup) FindByHashId(hashId string) (*model.LibraryQaGroup, error) { + data, err := c.get(c.hashIdKey(hashId), func() ([]byte, error) { + m := dao.Q.LibraryQaGroup + data, err := m.WithContext(c.ctx).Where(m.HashID.Eq(hashId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.LibraryQaGroup + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +func (c LibraryQaGroup) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c LibraryQaGroup) hashIdKey(hashId string) string { + return fmt.Sprintf("%s:hash_id:%s", c.Prefix(), hashId) +} + +// Clear 清理缓存 +func (c LibraryQaGroup) Clear(projects ...*model.LibraryQaGroup) error { + var key []string + for _, v := range projects { + key = append(key, c.idKey(v.ID), c.hashIdKey(v.HashID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/notify_url.go b/internal/repository/cache/notify_url.go new file mode 100644 index 0000000..127509e --- /dev/null +++ b/internal/repository/cache/notify_url.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type NotifyURL struct { + Cache +} + +func NewNotifyURL(ctx context.Context) *NotifyURL { + c := new(NotifyURL) + c.init(ctx, &model.NotifyURL{}) + + return c +} + +// FindById id 获取数据 +func (c NotifyURL) FindById(id int64) (*model.NotifyURL, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.NotifyURL + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.NotifyURL + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c NotifyURL) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c NotifyURL) Clear(urls ...*model.NotifyURL) error { + var key []string + for _, v := range urls { + key = append(key, c.idKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/option.go b/internal/repository/cache/option.go new file mode 100644 index 0000000..a7392fe --- /dev/null +++ b/internal/repository/cache/option.go @@ -0,0 +1,24 @@ +package cache + +import "time" + +type NilSetFn func() ([]byte, error) + +type Event func(event *redisEvent) + +type redisEvent struct { + NilSetLimit time.Duration // 为nil的过期时间自定义 + NilSet NilSetFn +} + +func WithEventNilSetLimit(expired time.Duration) Event { + return func(event *redisEvent) { + event.NilSetLimit = expired + } +} + +func WithNilSet(fn NilSetFn) Event { + return func(event *redisEvent) { + event.NilSet = fn + } +} diff --git a/internal/repository/cache/project.go b/internal/repository/cache/project.go new file mode 100644 index 0000000..0c69fd4 --- /dev/null +++ b/internal/repository/cache/project.go @@ -0,0 +1,93 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type Project struct { + Cache +} + +func NewProject(ctx context.Context) *Project { + c := new(Project) + c.init(ctx, &model.Project{}) + + return c +} + +// FindById id 获取数据 +func (c Project) FindById(id int64) (*model.Project, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.Project + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.Project + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +// FindByHashId hash_id获取换成数据 +func (c Project) FindByHashId(hashId string) (*model.Project, error) { + data, err := c.get(c.hashIdKey(hashId), func() ([]byte, error) { + m := dao.Q.Project + data, err := m.WithContext(c.ctx).Where(m.HashID.Eq(hashId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.Project + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +func (c Project) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c Project) hashIdKey(hashId string) string { + return fmt.Sprintf("%s:hash_id:%s", c.Prefix(), hashId) +} + +// Clear 清理缓存 +func (c Project) Clear(projects ...*model.Project) error { + var key []string + for _, v := range projects { + key = append(key, c.idKey(v.ID), c.hashIdKey(v.HashID)) + + // 临时代码 + app.Redis.Cache.Del(c.ctx, + fmt.Sprintf("certified:project:project_show_id:%d", v.ID), + fmt.Sprintf("certified:project:project_show_hash:%s", v.HashID), + ) + + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/project_ad.go b/internal/repository/cache/project_ad.go new file mode 100644 index 0000000..9fa4b7e --- /dev/null +++ b/internal/repository/cache/project_ad.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type ProjectAd struct { + Cache +} + +func NewProjectAd(ctx context.Context) *ProjectAd { + c := new(ProjectAd) + c.init(ctx, &model.ProjectAd{}) + + return c +} + +// FindByProjectId project_id 获取数据 +func (c ProjectAd) FindByProjectId(projectId int64) (*model.ProjectAd, error) { + data, err := c.get(c.projectIdKey(projectId), func() ([]byte, error) { + m := dao.Q.ProjectAd + data, err := m.WithContext(c.ctx).Where(m.ProjectID.Eq(projectId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var ads *model.ProjectAd + err = jsonm.Unmarshal(data, &ads) + + return ads, err +} + +func (c ProjectAd) projectIdKey(projectId int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), projectId) +} + +// Clear 清理缓存 +func (c ProjectAd) Clear(list ...*model.ProjectAd) error { + var key []string + for _, v := range list { + key = append(key, c.projectIdKey(v.ProjectID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/project_user.go b/internal/repository/cache/project_user.go new file mode 100644 index 0000000..69c8f4c --- /dev/null +++ b/internal/repository/cache/project_user.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type ProjectUser struct { + Cache +} + +func NewProjectUser(ctx context.Context) *ProjectUser { + c := new(ProjectUser) + c.init(ctx, &model.ProjectUser{}) + + return c +} + +// FindById 获取数据 +func (c ProjectUser) FindById(id int64) (*model.ProjectUser, error) { + data, err := c.get(c.pkKey(id), func() ([]byte, error) { + m := dao.Q.ProjectUser + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.ProjectUser + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +// FindByUniqId 获取数据 +func (c ProjectUser) FindByUniqId(projectId int64, userId string) (*model.ProjectUser, error) { + data, err := c.get(c.uniqId(projectId, userId), func() ([]byte, error) { + m := dao.Q.ProjectUser + data, err := m.WithContext(c.ctx).Where(m.ProjectID.Eq(projectId), m.UserID.Eq(userId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.ProjectUser + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +func (c ProjectUser) pkKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c ProjectUser) uniqId(projectId int64, userId string) string { + return fmt.Sprintf("%s:project_id:%d:user_id:%s", c.Prefix(), projectId, userId) +} + +// Clear 清理缓存 +func (c ProjectUser) Clear(projects ...*model.ProjectUser) error { + var key []string + for _, v := range projects { + key = append(key, c.uniqId(v.ProjectID, v.UserID), c.pkKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/redeem_mall.go b/internal/repository/cache/redeem_mall.go new file mode 100644 index 0000000..ac850c2 --- /dev/null +++ b/internal/repository/cache/redeem_mall.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type RedeemMall struct { + Cache +} + +func NewRedeemMall(ctx context.Context) *RedeemMall { + c := new(RedeemMall) + c.init(ctx, &model.RedeemMall{}) + + return c +} + +// FindById 获取数据 +func (c RedeemMall) FindById(id int64) (*model.RedeemMall, error) { + data, err := c.get(c.pkIdKey(id), func() ([]byte, error) { + m := dao.Q.RedeemMall + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.RedeemMall + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c RedeemMall) pkIdKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c RedeemMall) Clear(vals ...*model.RedeemMall) error { + var key []string + for _, v := range vals { + key = append(key, c.pkIdKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/redeem_mall_item.go b/internal/repository/cache/redeem_mall_item.go new file mode 100644 index 0000000..29ac9de --- /dev/null +++ b/internal/repository/cache/redeem_mall_item.go @@ -0,0 +1,61 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type RedeemMallItem struct { + Cache +} + +func NewRedeemMallItem(ctx context.Context) *RedeemMallItem { + c := new(RedeemMallItem) + c.init(ctx, &model.RedeemMallItem{}) + + return c +} + +// FindById campaignId 获取数据 +func (c RedeemMallItem) FindById(id int64) (*model.RedeemMallItem, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.RedeemMallItem + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var conf *model.RedeemMallItem + err = jsonm.Unmarshal(data, &conf) + + return conf, err +} + +func (c RedeemMallItem) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c RedeemMallItem) Clear(vals ...*model.RedeemMallItem) error { + var key []string + for _, v := range vals { + key = append(key, c.idKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/redistable/option.go b/internal/repository/cache/redistable/option.go new file mode 100644 index 0000000..c1252bd --- /dev/null +++ b/internal/repository/cache/redistable/option.go @@ -0,0 +1,12 @@ +package redistable + +import "time" + +type Option func(rt *RedisTable) + +// UseExp 给表加过期时间,大于0才生效 +func UseExp(t time.Duration) Option { + return func(rt *RedisTable) { + rt.exp = t + } +} diff --git a/internal/repository/cache/redistable/redis_table.go b/internal/repository/cache/redistable/redis_table.go new file mode 100644 index 0000000..686126d --- /dev/null +++ b/internal/repository/cache/redistable/redis_table.go @@ -0,0 +1,74 @@ +package redistable + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "fmt" + "time" +) + +type RedisTable struct { + Ctx context.Context + tableName string //表名称 + row map[string]string //行数据 + exp time.Duration +} + +// Init 初始化结构体 +func (t *RedisTable) Init(ctx context.Context, tableName string, opts ...Option) { + t.Ctx = ctx + t.tableName = ckey.RedisTableKey(tableName) + t.row = make(map[string]string) + t.exp = consts.TimeWeek + for _, opt := range opts { + opt(t) + } +} + +// GetTableName 获取表名 +func (t *RedisTable) GetTableName() string { + return t.tableName +} + +// AddField 添加字段 +func (t *RedisTable) AddField(field string, val interface{}) *RedisTable { + t.row[field] = fmt.Sprint(val) + return t +} + +// GetRow 获取数据列 +func (t *RedisTable) GetRow() map[string]string { + if len(t.row) == 0 { + val := app.Redis.Cache.HGetAll(t.Ctx, t.tableName).Val() + if val != nil { + t.row = val + } + } + + return t.row +} + +// DropTable 清空表数据 +func (t *RedisTable) DropTable() { + app.Redis.Cache.Del(t.Ctx, t.tableName) +} + +// Set 清空表数据 +func (t *RedisTable) Set() error { + if len(t.row) == 0 { + return nil + } + defer func() { //每次设置的时候,重新设置过期时间 + app.Redis.Cache.Expire(t.Ctx, t.tableName, t.exp) + }() + return app.Redis.Cache.HMSet(t.Ctx, t.tableName, t.row).Err() +} + +// IncrBy 步进处理 +func (t *RedisTable) IncrBy(field string, incr int64) int64 { + num := app.Redis.Cache.HIncrBy(t.Ctx, t.GetTableName(), field, incr).Val() + t.AddField(field, num) + return num +} diff --git a/internal/repository/cache/redistable/tables/fission_user_notify.go b/internal/repository/cache/redistable/tables/fission_user_notify.go new file mode 100644 index 0000000..5cd87a5 --- /dev/null +++ b/internal/repository/cache/redistable/tables/fission_user_notify.go @@ -0,0 +1,7 @@ +package tables + +import "joybuywork/internal/repository/cache/redistable" + +type FissionUserNotify struct { + redistable.RedisTable +} diff --git a/internal/repository/cache/reward.go b/internal/repository/cache/reward.go new file mode 100644 index 0000000..37c83c6 --- /dev/null +++ b/internal/repository/cache/reward.go @@ -0,0 +1,116 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/utils" + "fmt" + "strings" +) + +type Reward struct { + Cache +} + +func NewReward(ctx context.Context) *Reward { + c := new(Reward) + c.init(ctx, &model.Reward{}) + + return c +} + +// FindByIds ids 获取数据 +func (c Reward) FindByIds(ids []int64) ([]*model.Reward, error) { + + var idm = make(map[int64]struct{}) + var keys = make([]string, 0, len(ids)) + for _, id := range ids { + if _, ok := idm[id]; !ok { + keys = append(keys, c.idKey(id)) + idm[id] = struct{}{} + } + } + + data, err := c.getKeys(keys, func(idKeys []string) (map[string][]byte, error) { + var fids = make([]int64, 0, len(idKeys)) + var idMap = make(map[int64]string) + for _, idKey := range idKeys { + idStr, _ := strings.CutPrefix(idKey, c.Prefix()+":") + id := utils.StrToInt64(idStr) + fids = append(fids, id) + idMap[id] = idKey + } + + m := dao.Q.Reward + list, err := m.WithContext(c.ctx).Where(m.ID.In(fids...)).Find() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + var dataM = make(map[string][]byte, len(list)) + for _, v := range list { + b, _ := jsonm.MarshalCkZero(v) + dataM[c.idKey(v.ID)] = b + } + + return dataM, nil + }) + if err != nil { + return nil, err + } + + var list []*model.Reward + for _, v := range data { + var one *model.Reward + err = jsonm.Unmarshal(v, &one) + if err != nil { + return nil, err + } + list = append(list, one) + } + + return list, nil +} + +// FindById id 获取数据 +func (c Reward) FindById(id int64) (*model.Reward, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.Reward + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var info *model.Reward + err = jsonm.Unmarshal(data, &info) + + return info, err +} + +func (c Reward) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +// Clear 清理缓存 +func (c Reward) Clear(rewards ...*model.Reward) error { + var key []string + for _, v := range rewards { + key = append(key, c.idKey(v.ID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/t_coin.go b/internal/repository/cache/t_coin.go new file mode 100644 index 0000000..e842a23 --- /dev/null +++ b/internal/repository/cache/t_coin.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type TCoin struct { + Cache +} + +func NewTCoin(ctx context.Context) *TCoin { + c := new(TCoin) + c.init(ctx, &model.TCoin{}) + + return c +} + +// FindById id 获取数据 +func (c TCoin) FindById(id int64) (*model.TCoin, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.TCoin + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.TCoin + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +// FindByProjectId id 获取数据 +func (c TCoin) FindByProjectId(projectId int64) (*model.TCoin, error) { + data, err := c.get(c.projectIdKey(projectId), func() ([]byte, error) { + m := dao.Q.TCoin + data, err := m.WithContext(c.ctx).Where(m.ProjectID.Eq(projectId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var project *model.TCoin + err = jsonm.Unmarshal(data, &project) + + return project, err +} + +func (c TCoin) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c TCoin) projectIdKey(projectId int64) string { + return fmt.Sprintf("%s:project_id:%d", c.Prefix(), projectId) +} + +// Clear 清理缓存 +func (c TCoin) Clear(projects ...*model.TCoin) error { + var key []string + for _, v := range projects { + key = append(key, c.idKey(v.ID), c.projectIdKey(v.ProjectID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/cache/user.go b/internal/repository/cache/user.go new file mode 100644 index 0000000..c3055c4 --- /dev/null +++ b/internal/repository/cache/user.go @@ -0,0 +1,86 @@ +package cache + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "fmt" +) + +type User struct { + Cache +} + +func NewUser(ctx context.Context) *User { + c := new(User) + c.init(ctx, &model.User{}) + + return c +} + +// FindById id 获取数据 +func (c User) FindById(id int64) (*model.User, error) { + data, err := c.get(c.idKey(id), func() ([]byte, error) { + m := dao.Q.User + data, err := m.WithContext(c.ctx).Where(m.ID.Eq(id)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.User + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +// FindByHashId hash_id获取换成数据 +func (c User) FindByHashId(hashId string) (*model.User, error) { + data, err := c.get(c.hashIdKey(hashId), func() ([]byte, error) { + m := dao.Q.User + data, err := m.WithContext(c.ctx).Where(m.HashID.Eq(hashId)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, err + } + + return jsonm.MarshalCkZero(data) + }) + if err != nil { + return nil, err + } + + var user *model.User + err = jsonm.Unmarshal(data, &user) + + return user, err +} + +func (c User) idKey(id int64) string { + return fmt.Sprintf("%s:%d", c.Prefix(), id) +} + +func (c User) hashIdKey(hashId string) string { + return fmt.Sprintf("%s:hash_id:%s", c.Prefix(), hashId) +} + +// Clear 清理缓存 +func (c User) Clear(users ...*model.User) error { + var key []string + for _, v := range users { + key = append(key, c.idKey(v.ID), c.hashIdKey(v.HashID)) + } + + if len(key) > 0 { + return app.Redis.Cache.Del(c.ctx, key...).Err() + } + + return nil +} diff --git a/internal/repository/dao/company.gen.go b/internal/repository/dao/company.gen.go new file mode 100644 index 0000000..c5004eb --- /dev/null +++ b/internal/repository/dao/company.gen.go @@ -0,0 +1,369 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newCompany(db *gorm.DB, opts ...gen.DOOption) company { + _company := company{} + + _company.companyDo.UseDB(db, opts...) + _company.companyDo.UseModel(&model.Company{}) + + tableName := _company.companyDo.TableName() + _company.ALL = field.NewAsterisk(tableName) + _company.ID = field.NewInt64(tableName, "id") + _company.CreatedAt = field.NewInt64(tableName, "created_at") + _company.UpdatedAt = field.NewInt64(tableName, "updated_at") + _company.IsDel = field.NewInt8(tableName, "is_del") + _company.HashID = field.NewString(tableName, "hash_id") + _company.Uscid = field.NewString(tableName, "uscid") + _company.ShortName = field.NewString(tableName, "short_name") + _company.Phone = field.NewString(tableName, "phone") + _company.AppName = field.NewString(tableName, "app_name") + _company.FullName = field.NewString(tableName, "full_name") + _company.IsCert = field.NewInt8(tableName, "is_cert") + + _company.fillFieldMap() + + return _company +} + +type company struct { + companyDo companyDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 对外id + Uscid field.String // 营业执照编号 + ShortName field.String // 企业简称 + Phone field.String // 申请通过后公司显示手机号 + AppName field.String // 申请通过后公司站点名称 + FullName field.String // 企业全称 + IsCert field.Int8 // 是否为认证企业(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (c company) Table(newTableName string) *company { + c.companyDo.UseTable(newTableName) + return c.updateTableName(newTableName) +} + +func (c company) As(alias string) *company { + c.companyDo.DO = *(c.companyDo.As(alias).(*gen.DO)) + return c.updateTableName(alias) +} + +func (c *company) updateTableName(table string) *company { + c.ALL = field.NewAsterisk(table) + c.ID = field.NewInt64(table, "id") + c.CreatedAt = field.NewInt64(table, "created_at") + c.UpdatedAt = field.NewInt64(table, "updated_at") + c.IsDel = field.NewInt8(table, "is_del") + c.HashID = field.NewString(table, "hash_id") + c.Uscid = field.NewString(table, "uscid") + c.ShortName = field.NewString(table, "short_name") + c.Phone = field.NewString(table, "phone") + c.AppName = field.NewString(table, "app_name") + c.FullName = field.NewString(table, "full_name") + c.IsCert = field.NewInt8(table, "is_cert") + + c.fillFieldMap() + + return c +} + +func (c *company) WithContext(ctx context.Context) *companyDo { return c.companyDo.WithContext(ctx) } + +func (c company) TableName() string { return c.companyDo.TableName() } + +func (c company) Alias() string { return c.companyDo.Alias() } + +func (c *company) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := c.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (c *company) fillFieldMap() { + c.fieldMap = make(map[string]field.Expr, 11) + c.fieldMap["id"] = c.ID + c.fieldMap["created_at"] = c.CreatedAt + c.fieldMap["updated_at"] = c.UpdatedAt + c.fieldMap["is_del"] = c.IsDel + c.fieldMap["hash_id"] = c.HashID + c.fieldMap["uscid"] = c.Uscid + c.fieldMap["short_name"] = c.ShortName + c.fieldMap["phone"] = c.Phone + c.fieldMap["app_name"] = c.AppName + c.fieldMap["full_name"] = c.FullName + c.fieldMap["is_cert"] = c.IsCert +} + +func (c company) clone(db *gorm.DB) company { + c.companyDo.ReplaceConnPool(db.Statement.ConnPool) + return c +} + +func (c company) replaceDB(db *gorm.DB) company { + c.companyDo.ReplaceDB(db) + return c +} + +type companyDo struct{ gen.DO } + +func (c companyDo) Debug() *companyDo { + return c.withDO(c.DO.Debug()) +} + +func (c companyDo) WithContext(ctx context.Context) *companyDo { + return c.withDO(c.DO.WithContext(ctx)) +} + +func (c companyDo) ReadDB() *companyDo { + return c.Clauses(dbresolver.Read) +} + +func (c companyDo) WriteDB() *companyDo { + return c.Clauses(dbresolver.Write) +} + +func (c companyDo) Session(config *gorm.Session) *companyDo { + return c.withDO(c.DO.Session(config)) +} + +func (c companyDo) Clauses(conds ...clause.Expression) *companyDo { + return c.withDO(c.DO.Clauses(conds...)) +} + +func (c companyDo) Returning(value interface{}, columns ...string) *companyDo { + return c.withDO(c.DO.Returning(value, columns...)) +} + +func (c companyDo) Not(conds ...gen.Condition) *companyDo { + return c.withDO(c.DO.Not(conds...)) +} + +func (c companyDo) Or(conds ...gen.Condition) *companyDo { + return c.withDO(c.DO.Or(conds...)) +} + +func (c companyDo) Select(conds ...field.Expr) *companyDo { + return c.withDO(c.DO.Select(conds...)) +} + +func (c companyDo) Where(conds ...gen.Condition) *companyDo { + return c.withDO(c.DO.Where(conds...)) +} + +func (c companyDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *companyDo { + return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (c companyDo) Order(conds ...field.Expr) *companyDo { + return c.withDO(c.DO.Order(conds...)) +} + +func (c companyDo) Distinct(cols ...field.Expr) *companyDo { + return c.withDO(c.DO.Distinct(cols...)) +} + +func (c companyDo) Omit(cols ...field.Expr) *companyDo { + return c.withDO(c.DO.Omit(cols...)) +} + +func (c companyDo) Join(table schema.Tabler, on ...field.Expr) *companyDo { + return c.withDO(c.DO.Join(table, on...)) +} + +func (c companyDo) LeftJoin(table schema.Tabler, on ...field.Expr) *companyDo { + return c.withDO(c.DO.LeftJoin(table, on...)) +} + +func (c companyDo) RightJoin(table schema.Tabler, on ...field.Expr) *companyDo { + return c.withDO(c.DO.RightJoin(table, on...)) +} + +func (c companyDo) Group(cols ...field.Expr) *companyDo { + return c.withDO(c.DO.Group(cols...)) +} + +func (c companyDo) Having(conds ...gen.Condition) *companyDo { + return c.withDO(c.DO.Having(conds...)) +} + +func (c companyDo) Limit(limit int) *companyDo { + return c.withDO(c.DO.Limit(limit)) +} + +func (c companyDo) Offset(offset int) *companyDo { + return c.withDO(c.DO.Offset(offset)) +} + +func (c companyDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *companyDo { + return c.withDO(c.DO.Scopes(funcs...)) +} + +func (c companyDo) Unscoped() *companyDo { + return c.withDO(c.DO.Unscoped()) +} + +func (c companyDo) Create(values ...*model.Company) error { + if len(values) == 0 { + return nil + } + return c.DO.Create(values) +} + +func (c companyDo) CreateInBatches(values []*model.Company, batchSize int) error { + return c.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (c companyDo) Save(values ...*model.Company) error { + if len(values) == 0 { + return nil + } + return c.DO.Save(values) +} + +func (c companyDo) First() (*model.Company, error) { + if result, err := c.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Company), nil + } +} + +func (c companyDo) Take() (*model.Company, error) { + if result, err := c.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Company), nil + } +} + +func (c companyDo) Last() (*model.Company, error) { + if result, err := c.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Company), nil + } +} + +func (c companyDo) Find() ([]*model.Company, error) { + result, err := c.DO.Find() + return result.([]*model.Company), err +} + +func (c companyDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Company, err error) { + buf := make([]*model.Company, 0, batchSize) + err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (c companyDo) FindInBatches(result *[]*model.Company, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return c.DO.FindInBatches(result, batchSize, fc) +} + +func (c companyDo) Attrs(attrs ...field.AssignExpr) *companyDo { + return c.withDO(c.DO.Attrs(attrs...)) +} + +func (c companyDo) Assign(attrs ...field.AssignExpr) *companyDo { + return c.withDO(c.DO.Assign(attrs...)) +} + +func (c companyDo) Joins(fields ...field.RelationField) *companyDo { + for _, _f := range fields { + c = *c.withDO(c.DO.Joins(_f)) + } + return &c +} + +func (c companyDo) Preload(fields ...field.RelationField) *companyDo { + for _, _f := range fields { + c = *c.withDO(c.DO.Preload(_f)) + } + return &c +} + +func (c companyDo) FirstOrInit() (*model.Company, error) { + if result, err := c.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Company), nil + } +} + +func (c companyDo) FirstOrCreate() (*model.Company, error) { + if result, err := c.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Company), nil + } +} + +func (c companyDo) FindByPage(offset int, limit int) (result []*model.Company, count int64, err error) { + result, err = c.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = c.Offset(-1).Limit(-1).Count() + return +} + +func (c companyDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = c.Count() + if err != nil { + return + } + + err = c.Offset(offset).Limit(limit).Scan(result) + return +} + +func (c companyDo) Scan(result interface{}) (err error) { + return c.DO.Scan(result) +} + +func (c companyDo) Delete(models ...*model.Company) (result gen.ResultInfo, err error) { + return c.DO.Delete(models) +} + +func (c *companyDo) withDO(do gen.Dao) *companyDo { + c.DO = *do.(*gen.DO) + return c +} diff --git a/internal/repository/dao/company_made.gen.go b/internal/repository/dao/company_made.gen.go new file mode 100644 index 0000000..77470c2 --- /dev/null +++ b/internal/repository/dao/company_made.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newCompanyMade(db *gorm.DB, opts ...gen.DOOption) companyMade { + _companyMade := companyMade{} + + _companyMade.companyMadeDo.UseDB(db, opts...) + _companyMade.companyMadeDo.UseModel(&model.CompanyMade{}) + + tableName := _companyMade.companyMadeDo.TableName() + _companyMade.ALL = field.NewAsterisk(tableName) + _companyMade.ID = field.NewInt64(tableName, "id") + _companyMade.CreatedAt = field.NewInt64(tableName, "created_at") + _companyMade.UpdatedAt = field.NewInt64(tableName, "updated_at") + _companyMade.CompanyID = field.NewInt64(tableName, "company_id") + _companyMade.Mark = field.NewString(tableName, "mark") + _companyMade.Params = field.NewString(tableName, "params") + + _companyMade.fillFieldMap() + + return _companyMade +} + +type companyMade struct { + companyMadeDo companyMadeDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CompanyID field.Int64 // 企业id + Mark field.String // 功能标识 + Params field.String // 参数 + + fieldMap map[string]field.Expr +} + +func (c companyMade) Table(newTableName string) *companyMade { + c.companyMadeDo.UseTable(newTableName) + return c.updateTableName(newTableName) +} + +func (c companyMade) As(alias string) *companyMade { + c.companyMadeDo.DO = *(c.companyMadeDo.As(alias).(*gen.DO)) + return c.updateTableName(alias) +} + +func (c *companyMade) updateTableName(table string) *companyMade { + c.ALL = field.NewAsterisk(table) + c.ID = field.NewInt64(table, "id") + c.CreatedAt = field.NewInt64(table, "created_at") + c.UpdatedAt = field.NewInt64(table, "updated_at") + c.CompanyID = field.NewInt64(table, "company_id") + c.Mark = field.NewString(table, "mark") + c.Params = field.NewString(table, "params") + + c.fillFieldMap() + + return c +} + +func (c *companyMade) WithContext(ctx context.Context) *companyMadeDo { + return c.companyMadeDo.WithContext(ctx) +} + +func (c companyMade) TableName() string { return c.companyMadeDo.TableName() } + +func (c companyMade) Alias() string { return c.companyMadeDo.Alias() } + +func (c *companyMade) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := c.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (c *companyMade) fillFieldMap() { + c.fieldMap = make(map[string]field.Expr, 6) + c.fieldMap["id"] = c.ID + c.fieldMap["created_at"] = c.CreatedAt + c.fieldMap["updated_at"] = c.UpdatedAt + c.fieldMap["company_id"] = c.CompanyID + c.fieldMap["mark"] = c.Mark + c.fieldMap["params"] = c.Params +} + +func (c companyMade) clone(db *gorm.DB) companyMade { + c.companyMadeDo.ReplaceConnPool(db.Statement.ConnPool) + return c +} + +func (c companyMade) replaceDB(db *gorm.DB) companyMade { + c.companyMadeDo.ReplaceDB(db) + return c +} + +type companyMadeDo struct{ gen.DO } + +func (c companyMadeDo) Debug() *companyMadeDo { + return c.withDO(c.DO.Debug()) +} + +func (c companyMadeDo) WithContext(ctx context.Context) *companyMadeDo { + return c.withDO(c.DO.WithContext(ctx)) +} + +func (c companyMadeDo) ReadDB() *companyMadeDo { + return c.Clauses(dbresolver.Read) +} + +func (c companyMadeDo) WriteDB() *companyMadeDo { + return c.Clauses(dbresolver.Write) +} + +func (c companyMadeDo) Session(config *gorm.Session) *companyMadeDo { + return c.withDO(c.DO.Session(config)) +} + +func (c companyMadeDo) Clauses(conds ...clause.Expression) *companyMadeDo { + return c.withDO(c.DO.Clauses(conds...)) +} + +func (c companyMadeDo) Returning(value interface{}, columns ...string) *companyMadeDo { + return c.withDO(c.DO.Returning(value, columns...)) +} + +func (c companyMadeDo) Not(conds ...gen.Condition) *companyMadeDo { + return c.withDO(c.DO.Not(conds...)) +} + +func (c companyMadeDo) Or(conds ...gen.Condition) *companyMadeDo { + return c.withDO(c.DO.Or(conds...)) +} + +func (c companyMadeDo) Select(conds ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.Select(conds...)) +} + +func (c companyMadeDo) Where(conds ...gen.Condition) *companyMadeDo { + return c.withDO(c.DO.Where(conds...)) +} + +func (c companyMadeDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *companyMadeDo { + return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (c companyMadeDo) Order(conds ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.Order(conds...)) +} + +func (c companyMadeDo) Distinct(cols ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.Distinct(cols...)) +} + +func (c companyMadeDo) Omit(cols ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.Omit(cols...)) +} + +func (c companyMadeDo) Join(table schema.Tabler, on ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.Join(table, on...)) +} + +func (c companyMadeDo) LeftJoin(table schema.Tabler, on ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.LeftJoin(table, on...)) +} + +func (c companyMadeDo) RightJoin(table schema.Tabler, on ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.RightJoin(table, on...)) +} + +func (c companyMadeDo) Group(cols ...field.Expr) *companyMadeDo { + return c.withDO(c.DO.Group(cols...)) +} + +func (c companyMadeDo) Having(conds ...gen.Condition) *companyMadeDo { + return c.withDO(c.DO.Having(conds...)) +} + +func (c companyMadeDo) Limit(limit int) *companyMadeDo { + return c.withDO(c.DO.Limit(limit)) +} + +func (c companyMadeDo) Offset(offset int) *companyMadeDo { + return c.withDO(c.DO.Offset(offset)) +} + +func (c companyMadeDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *companyMadeDo { + return c.withDO(c.DO.Scopes(funcs...)) +} + +func (c companyMadeDo) Unscoped() *companyMadeDo { + return c.withDO(c.DO.Unscoped()) +} + +func (c companyMadeDo) Create(values ...*model.CompanyMade) error { + if len(values) == 0 { + return nil + } + return c.DO.Create(values) +} + +func (c companyMadeDo) CreateInBatches(values []*model.CompanyMade, batchSize int) error { + return c.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (c companyMadeDo) Save(values ...*model.CompanyMade) error { + if len(values) == 0 { + return nil + } + return c.DO.Save(values) +} + +func (c companyMadeDo) First() (*model.CompanyMade, error) { + if result, err := c.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.CompanyMade), nil + } +} + +func (c companyMadeDo) Take() (*model.CompanyMade, error) { + if result, err := c.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.CompanyMade), nil + } +} + +func (c companyMadeDo) Last() (*model.CompanyMade, error) { + if result, err := c.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.CompanyMade), nil + } +} + +func (c companyMadeDo) Find() ([]*model.CompanyMade, error) { + result, err := c.DO.Find() + return result.([]*model.CompanyMade), err +} + +func (c companyMadeDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CompanyMade, err error) { + buf := make([]*model.CompanyMade, 0, batchSize) + err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (c companyMadeDo) FindInBatches(result *[]*model.CompanyMade, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return c.DO.FindInBatches(result, batchSize, fc) +} + +func (c companyMadeDo) Attrs(attrs ...field.AssignExpr) *companyMadeDo { + return c.withDO(c.DO.Attrs(attrs...)) +} + +func (c companyMadeDo) Assign(attrs ...field.AssignExpr) *companyMadeDo { + return c.withDO(c.DO.Assign(attrs...)) +} + +func (c companyMadeDo) Joins(fields ...field.RelationField) *companyMadeDo { + for _, _f := range fields { + c = *c.withDO(c.DO.Joins(_f)) + } + return &c +} + +func (c companyMadeDo) Preload(fields ...field.RelationField) *companyMadeDo { + for _, _f := range fields { + c = *c.withDO(c.DO.Preload(_f)) + } + return &c +} + +func (c companyMadeDo) FirstOrInit() (*model.CompanyMade, error) { + if result, err := c.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.CompanyMade), nil + } +} + +func (c companyMadeDo) FirstOrCreate() (*model.CompanyMade, error) { + if result, err := c.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.CompanyMade), nil + } +} + +func (c companyMadeDo) FindByPage(offset int, limit int) (result []*model.CompanyMade, count int64, err error) { + result, err = c.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = c.Offset(-1).Limit(-1).Count() + return +} + +func (c companyMadeDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = c.Count() + if err != nil { + return + } + + err = c.Offset(offset).Limit(limit).Scan(result) + return +} + +func (c companyMadeDo) Scan(result interface{}) (err error) { + return c.DO.Scan(result) +} + +func (c companyMadeDo) Delete(models ...*model.CompanyMade) (result gen.ResultInfo, err error) { + return c.DO.Delete(models) +} + +func (c *companyMadeDo) withDO(do gen.Dao) *companyMadeDo { + c.DO = *do.(*gen.DO) + return c +} diff --git a/internal/repository/dao/cron_log.gen.go b/internal/repository/dao/cron_log.gen.go new file mode 100644 index 0000000..9d8ea7d --- /dev/null +++ b/internal/repository/dao/cron_log.gen.go @@ -0,0 +1,365 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newCronLog(db *gorm.DB, opts ...gen.DOOption) cronLog { + _cronLog := cronLog{} + + _cronLog.cronLogDo.UseDB(db, opts...) + _cronLog.cronLogDo.UseModel(&model.CronLog{}) + + tableName := _cronLog.cronLogDo.TableName() + _cronLog.ALL = field.NewAsterisk(tableName) + _cronLog.ID = field.NewInt64(tableName, "id") + _cronLog.ExecAt = field.NewInt64(tableName, "exec_at") + _cronLog.Desc = field.NewString(tableName, "desc") + _cronLog.Machine = field.NewString(tableName, "machine") + _cronLog.Total = field.NewInt64(tableName, "total") + _cronLog.SuccessNum = field.NewInt64(tableName, "success_num") + _cronLog.FailNum = field.NewInt64(tableName, "fail_num") + _cronLog.ExecStatus = field.NewInt8(tableName, "exec_status") + _cronLog.ExecFail = field.NewString(tableName, "exec_fail") + _cronLog.EndAt = field.NewInt64(tableName, "end_at") + + _cronLog.fillFieldMap() + + return _cronLog +} + +type cronLog struct { + cronLogDo cronLogDo + + ALL field.Asterisk + ID field.Int64 + ExecAt field.Int64 // 执行时间 + Desc field.String // 执行任务 + Machine field.String // 执行机器IP + Total field.Int64 // 处理总数据行数 + SuccessNum field.Int64 // 成功总数据行数 + FailNum field.Int64 // 失败总数据行数 + ExecStatus field.Int8 // 执行状态(1-成功,2-失败) + ExecFail field.String // 执行错误信息 + EndAt field.Int64 // 结束时间 + + fieldMap map[string]field.Expr +} + +func (c cronLog) Table(newTableName string) *cronLog { + c.cronLogDo.UseTable(newTableName) + return c.updateTableName(newTableName) +} + +func (c cronLog) As(alias string) *cronLog { + c.cronLogDo.DO = *(c.cronLogDo.As(alias).(*gen.DO)) + return c.updateTableName(alias) +} + +func (c *cronLog) updateTableName(table string) *cronLog { + c.ALL = field.NewAsterisk(table) + c.ID = field.NewInt64(table, "id") + c.ExecAt = field.NewInt64(table, "exec_at") + c.Desc = field.NewString(table, "desc") + c.Machine = field.NewString(table, "machine") + c.Total = field.NewInt64(table, "total") + c.SuccessNum = field.NewInt64(table, "success_num") + c.FailNum = field.NewInt64(table, "fail_num") + c.ExecStatus = field.NewInt8(table, "exec_status") + c.ExecFail = field.NewString(table, "exec_fail") + c.EndAt = field.NewInt64(table, "end_at") + + c.fillFieldMap() + + return c +} + +func (c *cronLog) WithContext(ctx context.Context) *cronLogDo { return c.cronLogDo.WithContext(ctx) } + +func (c cronLog) TableName() string { return c.cronLogDo.TableName() } + +func (c cronLog) Alias() string { return c.cronLogDo.Alias() } + +func (c *cronLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := c.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (c *cronLog) fillFieldMap() { + c.fieldMap = make(map[string]field.Expr, 10) + c.fieldMap["id"] = c.ID + c.fieldMap["exec_at"] = c.ExecAt + c.fieldMap["desc"] = c.Desc + c.fieldMap["machine"] = c.Machine + c.fieldMap["total"] = c.Total + c.fieldMap["success_num"] = c.SuccessNum + c.fieldMap["fail_num"] = c.FailNum + c.fieldMap["exec_status"] = c.ExecStatus + c.fieldMap["exec_fail"] = c.ExecFail + c.fieldMap["end_at"] = c.EndAt +} + +func (c cronLog) clone(db *gorm.DB) cronLog { + c.cronLogDo.ReplaceConnPool(db.Statement.ConnPool) + return c +} + +func (c cronLog) replaceDB(db *gorm.DB) cronLog { + c.cronLogDo.ReplaceDB(db) + return c +} + +type cronLogDo struct{ gen.DO } + +func (c cronLogDo) Debug() *cronLogDo { + return c.withDO(c.DO.Debug()) +} + +func (c cronLogDo) WithContext(ctx context.Context) *cronLogDo { + return c.withDO(c.DO.WithContext(ctx)) +} + +func (c cronLogDo) ReadDB() *cronLogDo { + return c.Clauses(dbresolver.Read) +} + +func (c cronLogDo) WriteDB() *cronLogDo { + return c.Clauses(dbresolver.Write) +} + +func (c cronLogDo) Session(config *gorm.Session) *cronLogDo { + return c.withDO(c.DO.Session(config)) +} + +func (c cronLogDo) Clauses(conds ...clause.Expression) *cronLogDo { + return c.withDO(c.DO.Clauses(conds...)) +} + +func (c cronLogDo) Returning(value interface{}, columns ...string) *cronLogDo { + return c.withDO(c.DO.Returning(value, columns...)) +} + +func (c cronLogDo) Not(conds ...gen.Condition) *cronLogDo { + return c.withDO(c.DO.Not(conds...)) +} + +func (c cronLogDo) Or(conds ...gen.Condition) *cronLogDo { + return c.withDO(c.DO.Or(conds...)) +} + +func (c cronLogDo) Select(conds ...field.Expr) *cronLogDo { + return c.withDO(c.DO.Select(conds...)) +} + +func (c cronLogDo) Where(conds ...gen.Condition) *cronLogDo { + return c.withDO(c.DO.Where(conds...)) +} + +func (c cronLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *cronLogDo { + return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (c cronLogDo) Order(conds ...field.Expr) *cronLogDo { + return c.withDO(c.DO.Order(conds...)) +} + +func (c cronLogDo) Distinct(cols ...field.Expr) *cronLogDo { + return c.withDO(c.DO.Distinct(cols...)) +} + +func (c cronLogDo) Omit(cols ...field.Expr) *cronLogDo { + return c.withDO(c.DO.Omit(cols...)) +} + +func (c cronLogDo) Join(table schema.Tabler, on ...field.Expr) *cronLogDo { + return c.withDO(c.DO.Join(table, on...)) +} + +func (c cronLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cronLogDo { + return c.withDO(c.DO.LeftJoin(table, on...)) +} + +func (c cronLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *cronLogDo { + return c.withDO(c.DO.RightJoin(table, on...)) +} + +func (c cronLogDo) Group(cols ...field.Expr) *cronLogDo { + return c.withDO(c.DO.Group(cols...)) +} + +func (c cronLogDo) Having(conds ...gen.Condition) *cronLogDo { + return c.withDO(c.DO.Having(conds...)) +} + +func (c cronLogDo) Limit(limit int) *cronLogDo { + return c.withDO(c.DO.Limit(limit)) +} + +func (c cronLogDo) Offset(offset int) *cronLogDo { + return c.withDO(c.DO.Offset(offset)) +} + +func (c cronLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cronLogDo { + return c.withDO(c.DO.Scopes(funcs...)) +} + +func (c cronLogDo) Unscoped() *cronLogDo { + return c.withDO(c.DO.Unscoped()) +} + +func (c cronLogDo) Create(values ...*model.CronLog) error { + if len(values) == 0 { + return nil + } + return c.DO.Create(values) +} + +func (c cronLogDo) CreateInBatches(values []*model.CronLog, batchSize int) error { + return c.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (c cronLogDo) Save(values ...*model.CronLog) error { + if len(values) == 0 { + return nil + } + return c.DO.Save(values) +} + +func (c cronLogDo) First() (*model.CronLog, error) { + if result, err := c.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.CronLog), nil + } +} + +func (c cronLogDo) Take() (*model.CronLog, error) { + if result, err := c.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.CronLog), nil + } +} + +func (c cronLogDo) Last() (*model.CronLog, error) { + if result, err := c.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.CronLog), nil + } +} + +func (c cronLogDo) Find() ([]*model.CronLog, error) { + result, err := c.DO.Find() + return result.([]*model.CronLog), err +} + +func (c cronLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CronLog, err error) { + buf := make([]*model.CronLog, 0, batchSize) + err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (c cronLogDo) FindInBatches(result *[]*model.CronLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return c.DO.FindInBatches(result, batchSize, fc) +} + +func (c cronLogDo) Attrs(attrs ...field.AssignExpr) *cronLogDo { + return c.withDO(c.DO.Attrs(attrs...)) +} + +func (c cronLogDo) Assign(attrs ...field.AssignExpr) *cronLogDo { + return c.withDO(c.DO.Assign(attrs...)) +} + +func (c cronLogDo) Joins(fields ...field.RelationField) *cronLogDo { + for _, _f := range fields { + c = *c.withDO(c.DO.Joins(_f)) + } + return &c +} + +func (c cronLogDo) Preload(fields ...field.RelationField) *cronLogDo { + for _, _f := range fields { + c = *c.withDO(c.DO.Preload(_f)) + } + return &c +} + +func (c cronLogDo) FirstOrInit() (*model.CronLog, error) { + if result, err := c.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.CronLog), nil + } +} + +func (c cronLogDo) FirstOrCreate() (*model.CronLog, error) { + if result, err := c.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.CronLog), nil + } +} + +func (c cronLogDo) FindByPage(offset int, limit int) (result []*model.CronLog, count int64, err error) { + result, err = c.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = c.Offset(-1).Limit(-1).Count() + return +} + +func (c cronLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = c.Count() + if err != nil { + return + } + + err = c.Offset(offset).Limit(limit).Scan(result) + return +} + +func (c cronLogDo) Scan(result interface{}) (err error) { + return c.DO.Scan(result) +} + +func (c cronLogDo) Delete(models ...*model.CronLog) (result gen.ResultInfo, err error) { + return c.DO.Delete(models) +} + +func (c *cronLogDo) withDO(do gen.Dao) *cronLogDo { + c.DO = *do.(*gen.DO) + return c +} diff --git a/internal/repository/dao/err_log.gen.go b/internal/repository/dao/err_log.gen.go new file mode 100644 index 0000000..2e51ac6 --- /dev/null +++ b/internal/repository/dao/err_log.gen.go @@ -0,0 +1,349 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newErrLog(db *gorm.DB, opts ...gen.DOOption) errLog { + _errLog := errLog{} + + _errLog.errLogDo.UseDB(db, opts...) + _errLog.errLogDo.UseModel(&model.ErrLog{}) + + tableName := _errLog.errLogDo.TableName() + _errLog.ALL = field.NewAsterisk(tableName) + _errLog.ID = field.NewInt64(tableName, "id") + _errLog.CreatedAt = field.NewInt64(tableName, "created_at") + _errLog.APIURL = field.NewString(tableName, "api_url") + _errLog.Data = field.NewString(tableName, "data") + _errLog.LinkURL = field.NewString(tableName, "link_url") + _errLog.Msg = field.NewString(tableName, "msg") + + _errLog.fillFieldMap() + + return _errLog +} + +type errLog struct { + errLogDo errLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + APIURL field.String // 请求的接口 + Data field.String // 请求数据 + LinkURL field.String // 当前页面地址 + Msg field.String // 返回数据 + + fieldMap map[string]field.Expr +} + +func (e errLog) Table(newTableName string) *errLog { + e.errLogDo.UseTable(newTableName) + return e.updateTableName(newTableName) +} + +func (e errLog) As(alias string) *errLog { + e.errLogDo.DO = *(e.errLogDo.As(alias).(*gen.DO)) + return e.updateTableName(alias) +} + +func (e *errLog) updateTableName(table string) *errLog { + e.ALL = field.NewAsterisk(table) + e.ID = field.NewInt64(table, "id") + e.CreatedAt = field.NewInt64(table, "created_at") + e.APIURL = field.NewString(table, "api_url") + e.Data = field.NewString(table, "data") + e.LinkURL = field.NewString(table, "link_url") + e.Msg = field.NewString(table, "msg") + + e.fillFieldMap() + + return e +} + +func (e *errLog) WithContext(ctx context.Context) *errLogDo { return e.errLogDo.WithContext(ctx) } + +func (e errLog) TableName() string { return e.errLogDo.TableName() } + +func (e errLog) Alias() string { return e.errLogDo.Alias() } + +func (e *errLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := e.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (e *errLog) fillFieldMap() { + e.fieldMap = make(map[string]field.Expr, 6) + e.fieldMap["id"] = e.ID + e.fieldMap["created_at"] = e.CreatedAt + e.fieldMap["api_url"] = e.APIURL + e.fieldMap["data"] = e.Data + e.fieldMap["link_url"] = e.LinkURL + e.fieldMap["msg"] = e.Msg +} + +func (e errLog) clone(db *gorm.DB) errLog { + e.errLogDo.ReplaceConnPool(db.Statement.ConnPool) + return e +} + +func (e errLog) replaceDB(db *gorm.DB) errLog { + e.errLogDo.ReplaceDB(db) + return e +} + +type errLogDo struct{ gen.DO } + +func (e errLogDo) Debug() *errLogDo { + return e.withDO(e.DO.Debug()) +} + +func (e errLogDo) WithContext(ctx context.Context) *errLogDo { + return e.withDO(e.DO.WithContext(ctx)) +} + +func (e errLogDo) ReadDB() *errLogDo { + return e.Clauses(dbresolver.Read) +} + +func (e errLogDo) WriteDB() *errLogDo { + return e.Clauses(dbresolver.Write) +} + +func (e errLogDo) Session(config *gorm.Session) *errLogDo { + return e.withDO(e.DO.Session(config)) +} + +func (e errLogDo) Clauses(conds ...clause.Expression) *errLogDo { + return e.withDO(e.DO.Clauses(conds...)) +} + +func (e errLogDo) Returning(value interface{}, columns ...string) *errLogDo { + return e.withDO(e.DO.Returning(value, columns...)) +} + +func (e errLogDo) Not(conds ...gen.Condition) *errLogDo { + return e.withDO(e.DO.Not(conds...)) +} + +func (e errLogDo) Or(conds ...gen.Condition) *errLogDo { + return e.withDO(e.DO.Or(conds...)) +} + +func (e errLogDo) Select(conds ...field.Expr) *errLogDo { + return e.withDO(e.DO.Select(conds...)) +} + +func (e errLogDo) Where(conds ...gen.Condition) *errLogDo { + return e.withDO(e.DO.Where(conds...)) +} + +func (e errLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *errLogDo { + return e.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (e errLogDo) Order(conds ...field.Expr) *errLogDo { + return e.withDO(e.DO.Order(conds...)) +} + +func (e errLogDo) Distinct(cols ...field.Expr) *errLogDo { + return e.withDO(e.DO.Distinct(cols...)) +} + +func (e errLogDo) Omit(cols ...field.Expr) *errLogDo { + return e.withDO(e.DO.Omit(cols...)) +} + +func (e errLogDo) Join(table schema.Tabler, on ...field.Expr) *errLogDo { + return e.withDO(e.DO.Join(table, on...)) +} + +func (e errLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *errLogDo { + return e.withDO(e.DO.LeftJoin(table, on...)) +} + +func (e errLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *errLogDo { + return e.withDO(e.DO.RightJoin(table, on...)) +} + +func (e errLogDo) Group(cols ...field.Expr) *errLogDo { + return e.withDO(e.DO.Group(cols...)) +} + +func (e errLogDo) Having(conds ...gen.Condition) *errLogDo { + return e.withDO(e.DO.Having(conds...)) +} + +func (e errLogDo) Limit(limit int) *errLogDo { + return e.withDO(e.DO.Limit(limit)) +} + +func (e errLogDo) Offset(offset int) *errLogDo { + return e.withDO(e.DO.Offset(offset)) +} + +func (e errLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *errLogDo { + return e.withDO(e.DO.Scopes(funcs...)) +} + +func (e errLogDo) Unscoped() *errLogDo { + return e.withDO(e.DO.Unscoped()) +} + +func (e errLogDo) Create(values ...*model.ErrLog) error { + if len(values) == 0 { + return nil + } + return e.DO.Create(values) +} + +func (e errLogDo) CreateInBatches(values []*model.ErrLog, batchSize int) error { + return e.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (e errLogDo) Save(values ...*model.ErrLog) error { + if len(values) == 0 { + return nil + } + return e.DO.Save(values) +} + +func (e errLogDo) First() (*model.ErrLog, error) { + if result, err := e.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ErrLog), nil + } +} + +func (e errLogDo) Take() (*model.ErrLog, error) { + if result, err := e.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ErrLog), nil + } +} + +func (e errLogDo) Last() (*model.ErrLog, error) { + if result, err := e.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ErrLog), nil + } +} + +func (e errLogDo) Find() ([]*model.ErrLog, error) { + result, err := e.DO.Find() + return result.([]*model.ErrLog), err +} + +func (e errLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ErrLog, err error) { + buf := make([]*model.ErrLog, 0, batchSize) + err = e.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (e errLogDo) FindInBatches(result *[]*model.ErrLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return e.DO.FindInBatches(result, batchSize, fc) +} + +func (e errLogDo) Attrs(attrs ...field.AssignExpr) *errLogDo { + return e.withDO(e.DO.Attrs(attrs...)) +} + +func (e errLogDo) Assign(attrs ...field.AssignExpr) *errLogDo { + return e.withDO(e.DO.Assign(attrs...)) +} + +func (e errLogDo) Joins(fields ...field.RelationField) *errLogDo { + for _, _f := range fields { + e = *e.withDO(e.DO.Joins(_f)) + } + return &e +} + +func (e errLogDo) Preload(fields ...field.RelationField) *errLogDo { + for _, _f := range fields { + e = *e.withDO(e.DO.Preload(_f)) + } + return &e +} + +func (e errLogDo) FirstOrInit() (*model.ErrLog, error) { + if result, err := e.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ErrLog), nil + } +} + +func (e errLogDo) FirstOrCreate() (*model.ErrLog, error) { + if result, err := e.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ErrLog), nil + } +} + +func (e errLogDo) FindByPage(offset int, limit int) (result []*model.ErrLog, count int64, err error) { + result, err = e.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = e.Offset(-1).Limit(-1).Count() + return +} + +func (e errLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = e.Count() + if err != nil { + return + } + + err = e.Offset(offset).Limit(limit).Scan(result) + return +} + +func (e errLogDo) Scan(result interface{}) (err error) { + return e.DO.Scan(result) +} + +func (e errLogDo) Delete(models ...*model.ErrLog) (result gen.ResultInfo, err error) { + return e.DO.Delete(models) +} + +func (e *errLogDo) withDO(do gen.Dao) *errLogDo { + e.DO = *do.(*gen.DO) + return e +} diff --git a/internal/repository/dao/export_task.gen.go b/internal/repository/dao/export_task.gen.go new file mode 100644 index 0000000..01b8005 --- /dev/null +++ b/internal/repository/dao/export_task.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newExportTask(db *gorm.DB, opts ...gen.DOOption) exportTask { + _exportTask := exportTask{} + + _exportTask.exportTaskDo.UseDB(db, opts...) + _exportTask.exportTaskDo.UseModel(&model.ExportTask{}) + + tableName := _exportTask.exportTaskDo.TableName() + _exportTask.ALL = field.NewAsterisk(tableName) + _exportTask.ID = field.NewInt64(tableName, "id") + _exportTask.CreatedAt = field.NewInt64(tableName, "created_at") + _exportTask.UpdatedAt = field.NewInt64(tableName, "updated_at") + _exportTask.HashID = field.NewString(tableName, "hash_id") + _exportTask.UserID = field.NewInt64(tableName, "user_id") + _exportTask.Mark = field.NewString(tableName, "mark") + _exportTask.Cond = field.NewString(tableName, "cond") + _exportTask.EptStatus = field.NewInt8(tableName, "ept_status") + _exportTask.ExpiredAt = field.NewInt64(tableName, "expired_at") + _exportTask.Filename = field.NewString(tableName, "filename") + _exportTask.FailMsg = field.NewString(tableName, "fail_msg") + + _exportTask.fillFieldMap() + + return _exportTask +} + +type exportTask struct { + exportTaskDo exportTaskDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 对外id + UserID field.Int64 // 用户ID(user表主键) + Mark field.String // 导出标识 + Cond field.String // 条件数据 + EptStatus field.Int8 // 状态(1-导出中,2-导出成功,3-导出失败,4-已过期) + ExpiredAt field.Int64 // 文件过期时间(0-不过期) + Filename field.String // 文件存储名称 + FailMsg field.String // 导出失败原因 + + fieldMap map[string]field.Expr +} + +func (e exportTask) Table(newTableName string) *exportTask { + e.exportTaskDo.UseTable(newTableName) + return e.updateTableName(newTableName) +} + +func (e exportTask) As(alias string) *exportTask { + e.exportTaskDo.DO = *(e.exportTaskDo.As(alias).(*gen.DO)) + return e.updateTableName(alias) +} + +func (e *exportTask) updateTableName(table string) *exportTask { + e.ALL = field.NewAsterisk(table) + e.ID = field.NewInt64(table, "id") + e.CreatedAt = field.NewInt64(table, "created_at") + e.UpdatedAt = field.NewInt64(table, "updated_at") + e.HashID = field.NewString(table, "hash_id") + e.UserID = field.NewInt64(table, "user_id") + e.Mark = field.NewString(table, "mark") + e.Cond = field.NewString(table, "cond") + e.EptStatus = field.NewInt8(table, "ept_status") + e.ExpiredAt = field.NewInt64(table, "expired_at") + e.Filename = field.NewString(table, "filename") + e.FailMsg = field.NewString(table, "fail_msg") + + e.fillFieldMap() + + return e +} + +func (e *exportTask) WithContext(ctx context.Context) *exportTaskDo { + return e.exportTaskDo.WithContext(ctx) +} + +func (e exportTask) TableName() string { return e.exportTaskDo.TableName() } + +func (e exportTask) Alias() string { return e.exportTaskDo.Alias() } + +func (e *exportTask) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := e.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (e *exportTask) fillFieldMap() { + e.fieldMap = make(map[string]field.Expr, 11) + e.fieldMap["id"] = e.ID + e.fieldMap["created_at"] = e.CreatedAt + e.fieldMap["updated_at"] = e.UpdatedAt + e.fieldMap["hash_id"] = e.HashID + e.fieldMap["user_id"] = e.UserID + e.fieldMap["mark"] = e.Mark + e.fieldMap["cond"] = e.Cond + e.fieldMap["ept_status"] = e.EptStatus + e.fieldMap["expired_at"] = e.ExpiredAt + e.fieldMap["filename"] = e.Filename + e.fieldMap["fail_msg"] = e.FailMsg +} + +func (e exportTask) clone(db *gorm.DB) exportTask { + e.exportTaskDo.ReplaceConnPool(db.Statement.ConnPool) + return e +} + +func (e exportTask) replaceDB(db *gorm.DB) exportTask { + e.exportTaskDo.ReplaceDB(db) + return e +} + +type exportTaskDo struct{ gen.DO } + +func (e exportTaskDo) Debug() *exportTaskDo { + return e.withDO(e.DO.Debug()) +} + +func (e exportTaskDo) WithContext(ctx context.Context) *exportTaskDo { + return e.withDO(e.DO.WithContext(ctx)) +} + +func (e exportTaskDo) ReadDB() *exportTaskDo { + return e.Clauses(dbresolver.Read) +} + +func (e exportTaskDo) WriteDB() *exportTaskDo { + return e.Clauses(dbresolver.Write) +} + +func (e exportTaskDo) Session(config *gorm.Session) *exportTaskDo { + return e.withDO(e.DO.Session(config)) +} + +func (e exportTaskDo) Clauses(conds ...clause.Expression) *exportTaskDo { + return e.withDO(e.DO.Clauses(conds...)) +} + +func (e exportTaskDo) Returning(value interface{}, columns ...string) *exportTaskDo { + return e.withDO(e.DO.Returning(value, columns...)) +} + +func (e exportTaskDo) Not(conds ...gen.Condition) *exportTaskDo { + return e.withDO(e.DO.Not(conds...)) +} + +func (e exportTaskDo) Or(conds ...gen.Condition) *exportTaskDo { + return e.withDO(e.DO.Or(conds...)) +} + +func (e exportTaskDo) Select(conds ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.Select(conds...)) +} + +func (e exportTaskDo) Where(conds ...gen.Condition) *exportTaskDo { + return e.withDO(e.DO.Where(conds...)) +} + +func (e exportTaskDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *exportTaskDo { + return e.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (e exportTaskDo) Order(conds ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.Order(conds...)) +} + +func (e exportTaskDo) Distinct(cols ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.Distinct(cols...)) +} + +func (e exportTaskDo) Omit(cols ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.Omit(cols...)) +} + +func (e exportTaskDo) Join(table schema.Tabler, on ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.Join(table, on...)) +} + +func (e exportTaskDo) LeftJoin(table schema.Tabler, on ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.LeftJoin(table, on...)) +} + +func (e exportTaskDo) RightJoin(table schema.Tabler, on ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.RightJoin(table, on...)) +} + +func (e exportTaskDo) Group(cols ...field.Expr) *exportTaskDo { + return e.withDO(e.DO.Group(cols...)) +} + +func (e exportTaskDo) Having(conds ...gen.Condition) *exportTaskDo { + return e.withDO(e.DO.Having(conds...)) +} + +func (e exportTaskDo) Limit(limit int) *exportTaskDo { + return e.withDO(e.DO.Limit(limit)) +} + +func (e exportTaskDo) Offset(offset int) *exportTaskDo { + return e.withDO(e.DO.Offset(offset)) +} + +func (e exportTaskDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *exportTaskDo { + return e.withDO(e.DO.Scopes(funcs...)) +} + +func (e exportTaskDo) Unscoped() *exportTaskDo { + return e.withDO(e.DO.Unscoped()) +} + +func (e exportTaskDo) Create(values ...*model.ExportTask) error { + if len(values) == 0 { + return nil + } + return e.DO.Create(values) +} + +func (e exportTaskDo) CreateInBatches(values []*model.ExportTask, batchSize int) error { + return e.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (e exportTaskDo) Save(values ...*model.ExportTask) error { + if len(values) == 0 { + return nil + } + return e.DO.Save(values) +} + +func (e exportTaskDo) First() (*model.ExportTask, error) { + if result, err := e.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ExportTask), nil + } +} + +func (e exportTaskDo) Take() (*model.ExportTask, error) { + if result, err := e.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ExportTask), nil + } +} + +func (e exportTaskDo) Last() (*model.ExportTask, error) { + if result, err := e.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ExportTask), nil + } +} + +func (e exportTaskDo) Find() ([]*model.ExportTask, error) { + result, err := e.DO.Find() + return result.([]*model.ExportTask), err +} + +func (e exportTaskDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ExportTask, err error) { + buf := make([]*model.ExportTask, 0, batchSize) + err = e.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (e exportTaskDo) FindInBatches(result *[]*model.ExportTask, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return e.DO.FindInBatches(result, batchSize, fc) +} + +func (e exportTaskDo) Attrs(attrs ...field.AssignExpr) *exportTaskDo { + return e.withDO(e.DO.Attrs(attrs...)) +} + +func (e exportTaskDo) Assign(attrs ...field.AssignExpr) *exportTaskDo { + return e.withDO(e.DO.Assign(attrs...)) +} + +func (e exportTaskDo) Joins(fields ...field.RelationField) *exportTaskDo { + for _, _f := range fields { + e = *e.withDO(e.DO.Joins(_f)) + } + return &e +} + +func (e exportTaskDo) Preload(fields ...field.RelationField) *exportTaskDo { + for _, _f := range fields { + e = *e.withDO(e.DO.Preload(_f)) + } + return &e +} + +func (e exportTaskDo) FirstOrInit() (*model.ExportTask, error) { + if result, err := e.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ExportTask), nil + } +} + +func (e exportTaskDo) FirstOrCreate() (*model.ExportTask, error) { + if result, err := e.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ExportTask), nil + } +} + +func (e exportTaskDo) FindByPage(offset int, limit int) (result []*model.ExportTask, count int64, err error) { + result, err = e.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = e.Offset(-1).Limit(-1).Count() + return +} + +func (e exportTaskDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = e.Count() + if err != nil { + return + } + + err = e.Offset(offset).Limit(limit).Scan(result) + return +} + +func (e exportTaskDo) Scan(result interface{}) (err error) { + return e.DO.Scan(result) +} + +func (e exportTaskDo) Delete(models ...*model.ExportTask) (result gen.ResultInfo, err error) { + return e.DO.Delete(models) +} + +func (e *exportTaskDo) withDO(do gen.Dao) *exportTaskDo { + e.DO = *do.(*gen.DO) + return e +} diff --git a/internal/repository/dao/fission_action.gen.go b/internal/repository/dao/fission_action.gen.go new file mode 100644 index 0000000..7f9c15b --- /dev/null +++ b/internal/repository/dao/fission_action.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionAction(db *gorm.DB, opts ...gen.DOOption) fissionAction { + _fissionAction := fissionAction{} + + _fissionAction.fissionActionDo.UseDB(db, opts...) + _fissionAction.fissionActionDo.UseModel(&model.FissionAction{}) + + tableName := _fissionAction.fissionActionDo.TableName() + _fissionAction.ALL = field.NewAsterisk(tableName) + _fissionAction.ID = field.NewInt64(tableName, "id") + _fissionAction.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionAction.UserMark = field.NewString(tableName, "user_mark") + _fissionAction.UserMarkSource = field.NewInt8(tableName, "user_mark_source") + _fissionAction.Type = field.NewInt32(tableName, "type") + _fissionAction.ActionTime = field.NewInt64(tableName, "action_time") + _fissionAction.Dimension = field.NewString(tableName, "dimension") + _fissionAction.OtherData = field.NewString(tableName, "other_data") + + _fissionAction.fillFieldMap() + + return _fissionAction +} + +type fissionAction struct { + fissionActionDo fissionActionDo + + ALL field.Asterisk + ID field.Int64 + CampaignID field.Int64 // 活动id + UserMark field.String // 用户唯一标识 + UserMarkSource field.Int8 // 用户标识来源(1-fission_user表,2-ua头获得的id) + Type field.Int32 // 用户行为类型 + ActionTime field.Int64 // 用户行为时间 + Dimension field.String // 维度数据 + OtherData field.String // 其他数据(如自定义数据,用户标识计算的原始数据) + + fieldMap map[string]field.Expr +} + +func (f fissionAction) Table(newTableName string) *fissionAction { + f.fissionActionDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionAction) As(alias string) *fissionAction { + f.fissionActionDo.DO = *(f.fissionActionDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionAction) updateTableName(table string) *fissionAction { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserMark = field.NewString(table, "user_mark") + f.UserMarkSource = field.NewInt8(table, "user_mark_source") + f.Type = field.NewInt32(table, "type") + f.ActionTime = field.NewInt64(table, "action_time") + f.Dimension = field.NewString(table, "dimension") + f.OtherData = field.NewString(table, "other_data") + + f.fillFieldMap() + + return f +} + +func (f *fissionAction) WithContext(ctx context.Context) *fissionActionDo { + return f.fissionActionDo.WithContext(ctx) +} + +func (f fissionAction) TableName() string { return f.fissionActionDo.TableName() } + +func (f fissionAction) Alias() string { return f.fissionActionDo.Alias() } + +func (f *fissionAction) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionAction) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_mark"] = f.UserMark + f.fieldMap["user_mark_source"] = f.UserMarkSource + f.fieldMap["type"] = f.Type + f.fieldMap["action_time"] = f.ActionTime + f.fieldMap["dimension"] = f.Dimension + f.fieldMap["other_data"] = f.OtherData +} + +func (f fissionAction) clone(db *gorm.DB) fissionAction { + f.fissionActionDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionAction) replaceDB(db *gorm.DB) fissionAction { + f.fissionActionDo.ReplaceDB(db) + return f +} + +type fissionActionDo struct{ gen.DO } + +func (f fissionActionDo) Debug() *fissionActionDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionActionDo) WithContext(ctx context.Context) *fissionActionDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionActionDo) ReadDB() *fissionActionDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionActionDo) WriteDB() *fissionActionDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionActionDo) Session(config *gorm.Session) *fissionActionDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionActionDo) Clauses(conds ...clause.Expression) *fissionActionDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionActionDo) Returning(value interface{}, columns ...string) *fissionActionDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionActionDo) Not(conds ...gen.Condition) *fissionActionDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionActionDo) Or(conds ...gen.Condition) *fissionActionDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionActionDo) Select(conds ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionActionDo) Where(conds ...gen.Condition) *fissionActionDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionActionDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionActionDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionActionDo) Order(conds ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionActionDo) Distinct(cols ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionActionDo) Omit(cols ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionActionDo) Join(table schema.Tabler, on ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionActionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionActionDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionActionDo) Group(cols ...field.Expr) *fissionActionDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionActionDo) Having(conds ...gen.Condition) *fissionActionDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionActionDo) Limit(limit int) *fissionActionDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionActionDo) Offset(offset int) *fissionActionDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionActionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionActionDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionActionDo) Unscoped() *fissionActionDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionActionDo) Create(values ...*model.FissionAction) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionActionDo) CreateInBatches(values []*model.FissionAction, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionActionDo) Save(values ...*model.FissionAction) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionActionDo) First() (*model.FissionAction, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionAction), nil + } +} + +func (f fissionActionDo) Take() (*model.FissionAction, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionAction), nil + } +} + +func (f fissionActionDo) Last() (*model.FissionAction, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionAction), nil + } +} + +func (f fissionActionDo) Find() ([]*model.FissionAction, error) { + result, err := f.DO.Find() + return result.([]*model.FissionAction), err +} + +func (f fissionActionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionAction, err error) { + buf := make([]*model.FissionAction, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionActionDo) FindInBatches(result *[]*model.FissionAction, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionActionDo) Attrs(attrs ...field.AssignExpr) *fissionActionDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionActionDo) Assign(attrs ...field.AssignExpr) *fissionActionDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionActionDo) Joins(fields ...field.RelationField) *fissionActionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionActionDo) Preload(fields ...field.RelationField) *fissionActionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionActionDo) FirstOrInit() (*model.FissionAction, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionAction), nil + } +} + +func (f fissionActionDo) FirstOrCreate() (*model.FissionAction, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionAction), nil + } +} + +func (f fissionActionDo) FindByPage(offset int, limit int) (result []*model.FissionAction, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionActionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionActionDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionActionDo) Delete(models ...*model.FissionAction) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionActionDo) withDO(do gen.Dao) *fissionActionDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_archive_task.gen.go b/internal/repository/dao/fission_archive_task.gen.go new file mode 100644 index 0000000..c06980b --- /dev/null +++ b/internal/repository/dao/fission_archive_task.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionArchiveTask(db *gorm.DB, opts ...gen.DOOption) fissionArchiveTask { + _fissionArchiveTask := fissionArchiveTask{} + + _fissionArchiveTask.fissionArchiveTaskDo.UseDB(db, opts...) + _fissionArchiveTask.fissionArchiveTaskDo.UseModel(&model.FissionArchiveTask{}) + + tableName := _fissionArchiveTask.fissionArchiveTaskDo.TableName() + _fissionArchiveTask.ALL = field.NewAsterisk(tableName) + _fissionArchiveTask.ID = field.NewInt64(tableName, "id") + _fissionArchiveTask.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionArchiveTask.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionArchiveTask.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionArchiveTask.EndTime = field.NewInt64(tableName, "end_time") + _fissionArchiveTask.Mark = field.NewString(tableName, "mark") + _fissionArchiveTask.IsStop = field.NewInt8(tableName, "is_stop") + + _fissionArchiveTask.fillFieldMap() + + return _fissionArchiveTask +} + +type fissionArchiveTask struct { + fissionArchiveTaskDo fissionArchiveTaskDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id + EndTime field.Int64 // 任务结束时间 + Mark field.String // 任务标识 + IsStop field.Int8 // 是否停止统计(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionArchiveTask) Table(newTableName string) *fissionArchiveTask { + f.fissionArchiveTaskDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionArchiveTask) As(alias string) *fissionArchiveTask { + f.fissionArchiveTaskDo.DO = *(f.fissionArchiveTaskDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionArchiveTask) updateTableName(table string) *fissionArchiveTask { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.EndTime = field.NewInt64(table, "end_time") + f.Mark = field.NewString(table, "mark") + f.IsStop = field.NewInt8(table, "is_stop") + + f.fillFieldMap() + + return f +} + +func (f *fissionArchiveTask) WithContext(ctx context.Context) *fissionArchiveTaskDo { + return f.fissionArchiveTaskDo.WithContext(ctx) +} + +func (f fissionArchiveTask) TableName() string { return f.fissionArchiveTaskDo.TableName() } + +func (f fissionArchiveTask) Alias() string { return f.fissionArchiveTaskDo.Alias() } + +func (f *fissionArchiveTask) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionArchiveTask) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["end_time"] = f.EndTime + f.fieldMap["mark"] = f.Mark + f.fieldMap["is_stop"] = f.IsStop +} + +func (f fissionArchiveTask) clone(db *gorm.DB) fissionArchiveTask { + f.fissionArchiveTaskDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionArchiveTask) replaceDB(db *gorm.DB) fissionArchiveTask { + f.fissionArchiveTaskDo.ReplaceDB(db) + return f +} + +type fissionArchiveTaskDo struct{ gen.DO } + +func (f fissionArchiveTaskDo) Debug() *fissionArchiveTaskDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionArchiveTaskDo) WithContext(ctx context.Context) *fissionArchiveTaskDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionArchiveTaskDo) ReadDB() *fissionArchiveTaskDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionArchiveTaskDo) WriteDB() *fissionArchiveTaskDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionArchiveTaskDo) Session(config *gorm.Session) *fissionArchiveTaskDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionArchiveTaskDo) Clauses(conds ...clause.Expression) *fissionArchiveTaskDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionArchiveTaskDo) Returning(value interface{}, columns ...string) *fissionArchiveTaskDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionArchiveTaskDo) Not(conds ...gen.Condition) *fissionArchiveTaskDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionArchiveTaskDo) Or(conds ...gen.Condition) *fissionArchiveTaskDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionArchiveTaskDo) Select(conds ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionArchiveTaskDo) Where(conds ...gen.Condition) *fissionArchiveTaskDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionArchiveTaskDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionArchiveTaskDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionArchiveTaskDo) Order(conds ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionArchiveTaskDo) Distinct(cols ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionArchiveTaskDo) Omit(cols ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionArchiveTaskDo) Join(table schema.Tabler, on ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionArchiveTaskDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionArchiveTaskDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionArchiveTaskDo) Group(cols ...field.Expr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionArchiveTaskDo) Having(conds ...gen.Condition) *fissionArchiveTaskDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionArchiveTaskDo) Limit(limit int) *fissionArchiveTaskDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionArchiveTaskDo) Offset(offset int) *fissionArchiveTaskDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionArchiveTaskDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionArchiveTaskDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionArchiveTaskDo) Unscoped() *fissionArchiveTaskDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionArchiveTaskDo) Create(values ...*model.FissionArchiveTask) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionArchiveTaskDo) CreateInBatches(values []*model.FissionArchiveTask, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionArchiveTaskDo) Save(values ...*model.FissionArchiveTask) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionArchiveTaskDo) First() (*model.FissionArchiveTask, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionArchiveTask), nil + } +} + +func (f fissionArchiveTaskDo) Take() (*model.FissionArchiveTask, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionArchiveTask), nil + } +} + +func (f fissionArchiveTaskDo) Last() (*model.FissionArchiveTask, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionArchiveTask), nil + } +} + +func (f fissionArchiveTaskDo) Find() ([]*model.FissionArchiveTask, error) { + result, err := f.DO.Find() + return result.([]*model.FissionArchiveTask), err +} + +func (f fissionArchiveTaskDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionArchiveTask, err error) { + buf := make([]*model.FissionArchiveTask, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionArchiveTaskDo) FindInBatches(result *[]*model.FissionArchiveTask, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionArchiveTaskDo) Attrs(attrs ...field.AssignExpr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionArchiveTaskDo) Assign(attrs ...field.AssignExpr) *fissionArchiveTaskDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionArchiveTaskDo) Joins(fields ...field.RelationField) *fissionArchiveTaskDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionArchiveTaskDo) Preload(fields ...field.RelationField) *fissionArchiveTaskDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionArchiveTaskDo) FirstOrInit() (*model.FissionArchiveTask, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionArchiveTask), nil + } +} + +func (f fissionArchiveTaskDo) FirstOrCreate() (*model.FissionArchiveTask, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionArchiveTask), nil + } +} + +func (f fissionArchiveTaskDo) FindByPage(offset int, limit int) (result []*model.FissionArchiveTask, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionArchiveTaskDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionArchiveTaskDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionArchiveTaskDo) Delete(models ...*model.FissionArchiveTask) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionArchiveTaskDo) withDO(do gen.Dao) *fissionArchiveTaskDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_ballot.gen.go b/internal/repository/dao/fission_ballot.gen.go new file mode 100644 index 0000000..c894806 --- /dev/null +++ b/internal/repository/dao/fission_ballot.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionBallot(db *gorm.DB, opts ...gen.DOOption) fissionBallot { + _fissionBallot := fissionBallot{} + + _fissionBallot.fissionBallotDo.UseDB(db, opts...) + _fissionBallot.fissionBallotDo.UseModel(&model.FissionBallot{}) + + tableName := _fissionBallot.fissionBallotDo.TableName() + _fissionBallot.ALL = field.NewAsterisk(tableName) + _fissionBallot.ID = field.NewInt64(tableName, "id") + _fissionBallot.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionBallot.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionBallot.UserID = field.NewInt64(tableName, "user_id") + _fissionBallot.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionBallot.Chance = field.NewInt32(tableName, "chance") + _fissionBallot.DayChance = field.NewInt32(tableName, "day_chance") + _fissionBallot.LastSign = field.NewString(tableName, "last_sign") + _fissionBallot.SetInit = field.NewInt8(tableName, "set_init") + + _fissionBallot.fillFieldMap() + + return _fissionBallot +} + +type fissionBallot struct { + fissionBallotDo fissionBallotDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽签数 + DayChance field.Int32 // 每日签到获得的抽签数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionBallot) Table(newTableName string) *fissionBallot { + f.fissionBallotDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionBallot) As(alias string) *fissionBallot { + f.fissionBallotDo.DO = *(f.fissionBallotDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionBallot) updateTableName(table string) *fissionBallot { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionBallot) WithContext(ctx context.Context) *fissionBallotDo { + return f.fissionBallotDo.WithContext(ctx) +} + +func (f fissionBallot) TableName() string { return f.fissionBallotDo.TableName() } + +func (f fissionBallot) Alias() string { return f.fissionBallotDo.Alias() } + +func (f *fissionBallot) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionBallot) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionBallot) clone(db *gorm.DB) fissionBallot { + f.fissionBallotDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionBallot) replaceDB(db *gorm.DB) fissionBallot { + f.fissionBallotDo.ReplaceDB(db) + return f +} + +type fissionBallotDo struct{ gen.DO } + +func (f fissionBallotDo) Debug() *fissionBallotDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionBallotDo) WithContext(ctx context.Context) *fissionBallotDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionBallotDo) ReadDB() *fissionBallotDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionBallotDo) WriteDB() *fissionBallotDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionBallotDo) Session(config *gorm.Session) *fissionBallotDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionBallotDo) Clauses(conds ...clause.Expression) *fissionBallotDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionBallotDo) Returning(value interface{}, columns ...string) *fissionBallotDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionBallotDo) Not(conds ...gen.Condition) *fissionBallotDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionBallotDo) Or(conds ...gen.Condition) *fissionBallotDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionBallotDo) Select(conds ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionBallotDo) Where(conds ...gen.Condition) *fissionBallotDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionBallotDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionBallotDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionBallotDo) Order(conds ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionBallotDo) Distinct(cols ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionBallotDo) Omit(cols ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionBallotDo) Join(table schema.Tabler, on ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionBallotDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionBallotDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionBallotDo) Group(cols ...field.Expr) *fissionBallotDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionBallotDo) Having(conds ...gen.Condition) *fissionBallotDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionBallotDo) Limit(limit int) *fissionBallotDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionBallotDo) Offset(offset int) *fissionBallotDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionBallotDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionBallotDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionBallotDo) Unscoped() *fissionBallotDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionBallotDo) Create(values ...*model.FissionBallot) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionBallotDo) CreateInBatches(values []*model.FissionBallot, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionBallotDo) Save(values ...*model.FissionBallot) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionBallotDo) First() (*model.FissionBallot, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallot), nil + } +} + +func (f fissionBallotDo) Take() (*model.FissionBallot, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallot), nil + } +} + +func (f fissionBallotDo) Last() (*model.FissionBallot, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallot), nil + } +} + +func (f fissionBallotDo) Find() ([]*model.FissionBallot, error) { + result, err := f.DO.Find() + return result.([]*model.FissionBallot), err +} + +func (f fissionBallotDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionBallot, err error) { + buf := make([]*model.FissionBallot, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionBallotDo) FindInBatches(result *[]*model.FissionBallot, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionBallotDo) Attrs(attrs ...field.AssignExpr) *fissionBallotDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionBallotDo) Assign(attrs ...field.AssignExpr) *fissionBallotDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionBallotDo) Joins(fields ...field.RelationField) *fissionBallotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionBallotDo) Preload(fields ...field.RelationField) *fissionBallotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionBallotDo) FirstOrInit() (*model.FissionBallot, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallot), nil + } +} + +func (f fissionBallotDo) FirstOrCreate() (*model.FissionBallot, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallot), nil + } +} + +func (f fissionBallotDo) FindByPage(offset int, limit int) (result []*model.FissionBallot, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionBallotDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionBallotDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionBallotDo) Delete(models ...*model.FissionBallot) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionBallotDo) withDO(do gen.Dao) *fissionBallotDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_ballot_log.gen.go b/internal/repository/dao/fission_ballot_log.gen.go new file mode 100644 index 0000000..cb0ba5d --- /dev/null +++ b/internal/repository/dao/fission_ballot_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionBallotLog(db *gorm.DB, opts ...gen.DOOption) fissionBallotLog { + _fissionBallotLog := fissionBallotLog{} + + _fissionBallotLog.fissionBallotLogDo.UseDB(db, opts...) + _fissionBallotLog.fissionBallotLogDo.UseModel(&model.FissionBallotLog{}) + + tableName := _fissionBallotLog.fissionBallotLogDo.TableName() + _fissionBallotLog.ALL = field.NewAsterisk(tableName) + _fissionBallotLog.ID = field.NewInt64(tableName, "id") + _fissionBallotLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionBallotLog.UserID = field.NewInt64(tableName, "user_id") + _fissionBallotLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionBallotLog.BallotID = field.NewInt64(tableName, "ballot_id") + _fissionBallotLog.Type = field.NewInt8(tableName, "type") + _fissionBallotLog.Source = field.NewString(tableName, "source") + _fissionBallotLog.Val = field.NewString(tableName, "val") + + _fissionBallotLog.fillFieldMap() + + return _fissionBallotLog +} + +type fissionBallotLog struct { + fissionBallotLogDo fissionBallotLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + BallotID field.Int64 // 玩家id(fission_ballot表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionBallotLog) Table(newTableName string) *fissionBallotLog { + f.fissionBallotLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionBallotLog) As(alias string) *fissionBallotLog { + f.fissionBallotLogDo.DO = *(f.fissionBallotLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionBallotLog) updateTableName(table string) *fissionBallotLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.BallotID = field.NewInt64(table, "ballot_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionBallotLog) WithContext(ctx context.Context) *fissionBallotLogDo { + return f.fissionBallotLogDo.WithContext(ctx) +} + +func (f fissionBallotLog) TableName() string { return f.fissionBallotLogDo.TableName() } + +func (f fissionBallotLog) Alias() string { return f.fissionBallotLogDo.Alias() } + +func (f *fissionBallotLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionBallotLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["ballot_id"] = f.BallotID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionBallotLog) clone(db *gorm.DB) fissionBallotLog { + f.fissionBallotLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionBallotLog) replaceDB(db *gorm.DB) fissionBallotLog { + f.fissionBallotLogDo.ReplaceDB(db) + return f +} + +type fissionBallotLogDo struct{ gen.DO } + +func (f fissionBallotLogDo) Debug() *fissionBallotLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionBallotLogDo) WithContext(ctx context.Context) *fissionBallotLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionBallotLogDo) ReadDB() *fissionBallotLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionBallotLogDo) WriteDB() *fissionBallotLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionBallotLogDo) Session(config *gorm.Session) *fissionBallotLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionBallotLogDo) Clauses(conds ...clause.Expression) *fissionBallotLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionBallotLogDo) Returning(value interface{}, columns ...string) *fissionBallotLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionBallotLogDo) Not(conds ...gen.Condition) *fissionBallotLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionBallotLogDo) Or(conds ...gen.Condition) *fissionBallotLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionBallotLogDo) Select(conds ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionBallotLogDo) Where(conds ...gen.Condition) *fissionBallotLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionBallotLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionBallotLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionBallotLogDo) Order(conds ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionBallotLogDo) Distinct(cols ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionBallotLogDo) Omit(cols ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionBallotLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionBallotLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionBallotLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionBallotLogDo) Group(cols ...field.Expr) *fissionBallotLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionBallotLogDo) Having(conds ...gen.Condition) *fissionBallotLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionBallotLogDo) Limit(limit int) *fissionBallotLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionBallotLogDo) Offset(offset int) *fissionBallotLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionBallotLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionBallotLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionBallotLogDo) Unscoped() *fissionBallotLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionBallotLogDo) Create(values ...*model.FissionBallotLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionBallotLogDo) CreateInBatches(values []*model.FissionBallotLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionBallotLogDo) Save(values ...*model.FissionBallotLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionBallotLogDo) First() (*model.FissionBallotLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallotLog), nil + } +} + +func (f fissionBallotLogDo) Take() (*model.FissionBallotLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallotLog), nil + } +} + +func (f fissionBallotLogDo) Last() (*model.FissionBallotLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallotLog), nil + } +} + +func (f fissionBallotLogDo) Find() ([]*model.FissionBallotLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionBallotLog), err +} + +func (f fissionBallotLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionBallotLog, err error) { + buf := make([]*model.FissionBallotLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionBallotLogDo) FindInBatches(result *[]*model.FissionBallotLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionBallotLogDo) Attrs(attrs ...field.AssignExpr) *fissionBallotLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionBallotLogDo) Assign(attrs ...field.AssignExpr) *fissionBallotLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionBallotLogDo) Joins(fields ...field.RelationField) *fissionBallotLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionBallotLogDo) Preload(fields ...field.RelationField) *fissionBallotLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionBallotLogDo) FirstOrInit() (*model.FissionBallotLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallotLog), nil + } +} + +func (f fissionBallotLogDo) FirstOrCreate() (*model.FissionBallotLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionBallotLog), nil + } +} + +func (f fissionBallotLogDo) FindByPage(offset int, limit int) (result []*model.FissionBallotLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionBallotLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionBallotLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionBallotLogDo) Delete(models ...*model.FissionBallotLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionBallotLogDo) withDO(do gen.Dao) *fissionBallotLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_behavior.gen.go b/internal/repository/dao/fission_behavior.gen.go new file mode 100644 index 0000000..1a5adf8 --- /dev/null +++ b/internal/repository/dao/fission_behavior.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionBehavior(db *gorm.DB, opts ...gen.DOOption) fissionBehavior { + _fissionBehavior := fissionBehavior{} + + _fissionBehavior.fissionBehaviorDo.UseDB(db, opts...) + _fissionBehavior.fissionBehaviorDo.UseModel(&model.FissionBehavior{}) + + tableName := _fissionBehavior.fissionBehaviorDo.TableName() + _fissionBehavior.ALL = field.NewAsterisk(tableName) + _fissionBehavior.ID = field.NewInt64(tableName, "id") + _fissionBehavior.BehaviorType = field.NewInt32(tableName, "behavior_type") + _fissionBehavior.BehaviorTime = field.NewInt64(tableName, "behavior_time") + _fissionBehavior.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionBehavior.UserMark = field.NewString(tableName, "user_mark") + _fissionBehavior.OtherData = field.NewString(tableName, "other_data") + _fissionBehavior.Mark = field.NewString(tableName, "mark") + + _fissionBehavior.fillFieldMap() + + return _fissionBehavior +} + +type fissionBehavior struct { + fissionBehaviorDo fissionBehaviorDo + + ALL field.Asterisk + ID field.Int64 + BehaviorType field.Int32 // 用户行为类型 + BehaviorTime field.Int64 // 用户行为时间 + CampaignID field.Int64 // 活动id + UserMark field.String // 用户唯一标识(用户ip,os,os_version,device_model的顺序哈希值) + OtherData field.String // 其他数据(如自定义事件行为时,存的自定义事件的数据) + Mark field.String // 用户行为标识 + + fieldMap map[string]field.Expr +} + +func (f fissionBehavior) Table(newTableName string) *fissionBehavior { + f.fissionBehaviorDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionBehavior) As(alias string) *fissionBehavior { + f.fissionBehaviorDo.DO = *(f.fissionBehaviorDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionBehavior) updateTableName(table string) *fissionBehavior { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.BehaviorType = field.NewInt32(table, "behavior_type") + f.BehaviorTime = field.NewInt64(table, "behavior_time") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserMark = field.NewString(table, "user_mark") + f.OtherData = field.NewString(table, "other_data") + f.Mark = field.NewString(table, "mark") + + f.fillFieldMap() + + return f +} + +func (f *fissionBehavior) WithContext(ctx context.Context) *fissionBehaviorDo { + return f.fissionBehaviorDo.WithContext(ctx) +} + +func (f fissionBehavior) TableName() string { return f.fissionBehaviorDo.TableName() } + +func (f fissionBehavior) Alias() string { return f.fissionBehaviorDo.Alias() } + +func (f *fissionBehavior) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionBehavior) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["behavior_type"] = f.BehaviorType + f.fieldMap["behavior_time"] = f.BehaviorTime + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_mark"] = f.UserMark + f.fieldMap["other_data"] = f.OtherData + f.fieldMap["mark"] = f.Mark +} + +func (f fissionBehavior) clone(db *gorm.DB) fissionBehavior { + f.fissionBehaviorDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionBehavior) replaceDB(db *gorm.DB) fissionBehavior { + f.fissionBehaviorDo.ReplaceDB(db) + return f +} + +type fissionBehaviorDo struct{ gen.DO } + +func (f fissionBehaviorDo) Debug() *fissionBehaviorDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionBehaviorDo) WithContext(ctx context.Context) *fissionBehaviorDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionBehaviorDo) ReadDB() *fissionBehaviorDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionBehaviorDo) WriteDB() *fissionBehaviorDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionBehaviorDo) Session(config *gorm.Session) *fissionBehaviorDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionBehaviorDo) Clauses(conds ...clause.Expression) *fissionBehaviorDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionBehaviorDo) Returning(value interface{}, columns ...string) *fissionBehaviorDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionBehaviorDo) Not(conds ...gen.Condition) *fissionBehaviorDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionBehaviorDo) Or(conds ...gen.Condition) *fissionBehaviorDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionBehaviorDo) Select(conds ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionBehaviorDo) Where(conds ...gen.Condition) *fissionBehaviorDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionBehaviorDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionBehaviorDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionBehaviorDo) Order(conds ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionBehaviorDo) Distinct(cols ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionBehaviorDo) Omit(cols ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionBehaviorDo) Join(table schema.Tabler, on ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionBehaviorDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionBehaviorDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionBehaviorDo) Group(cols ...field.Expr) *fissionBehaviorDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionBehaviorDo) Having(conds ...gen.Condition) *fissionBehaviorDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionBehaviorDo) Limit(limit int) *fissionBehaviorDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionBehaviorDo) Offset(offset int) *fissionBehaviorDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionBehaviorDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionBehaviorDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionBehaviorDo) Unscoped() *fissionBehaviorDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionBehaviorDo) Create(values ...*model.FissionBehavior) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionBehaviorDo) CreateInBatches(values []*model.FissionBehavior, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionBehaviorDo) Save(values ...*model.FissionBehavior) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionBehaviorDo) First() (*model.FissionBehavior, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionBehavior), nil + } +} + +func (f fissionBehaviorDo) Take() (*model.FissionBehavior, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionBehavior), nil + } +} + +func (f fissionBehaviorDo) Last() (*model.FissionBehavior, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionBehavior), nil + } +} + +func (f fissionBehaviorDo) Find() ([]*model.FissionBehavior, error) { + result, err := f.DO.Find() + return result.([]*model.FissionBehavior), err +} + +func (f fissionBehaviorDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionBehavior, err error) { + buf := make([]*model.FissionBehavior, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionBehaviorDo) FindInBatches(result *[]*model.FissionBehavior, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionBehaviorDo) Attrs(attrs ...field.AssignExpr) *fissionBehaviorDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionBehaviorDo) Assign(attrs ...field.AssignExpr) *fissionBehaviorDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionBehaviorDo) Joins(fields ...field.RelationField) *fissionBehaviorDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionBehaviorDo) Preload(fields ...field.RelationField) *fissionBehaviorDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionBehaviorDo) FirstOrInit() (*model.FissionBehavior, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionBehavior), nil + } +} + +func (f fissionBehaviorDo) FirstOrCreate() (*model.FissionBehavior, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionBehavior), nil + } +} + +func (f fissionBehaviorDo) FindByPage(offset int, limit int) (result []*model.FissionBehavior, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionBehaviorDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionBehaviorDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionBehaviorDo) Delete(models ...*model.FissionBehavior) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionBehaviorDo) withDO(do gen.Dao) *fissionBehaviorDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_blind.gen.go b/internal/repository/dao/fission_blind.gen.go new file mode 100644 index 0000000..3384b6f --- /dev/null +++ b/internal/repository/dao/fission_blind.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionBlind(db *gorm.DB, opts ...gen.DOOption) fissionBlind { + _fissionBlind := fissionBlind{} + + _fissionBlind.fissionBlindDo.UseDB(db, opts...) + _fissionBlind.fissionBlindDo.UseModel(&model.FissionBlind{}) + + tableName := _fissionBlind.fissionBlindDo.TableName() + _fissionBlind.ALL = field.NewAsterisk(tableName) + _fissionBlind.ID = field.NewInt64(tableName, "id") + _fissionBlind.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionBlind.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionBlind.IsDel = field.NewInt8(tableName, "is_del") + _fissionBlind.UserID = field.NewInt64(tableName, "user_id") + _fissionBlind.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionBlind.Chance = field.NewInt32(tableName, "chance") + _fissionBlind.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionBlind.DayChance = field.NewInt32(tableName, "day_chance") + _fissionBlind.LastSign = field.NewString(tableName, "last_sign") + _fissionBlind.SetInit = field.NewInt8(tableName, "set_init") + + _fissionBlind.fillFieldMap() + + return _fissionBlind +} + +type fissionBlind struct { + fissionBlindDo fissionBlindDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + TaskChance field.Int32 // 完成任务获取的抽奖次数 + DayChance field.Int32 // 每日签到获得的次数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionBlind) Table(newTableName string) *fissionBlind { + f.fissionBlindDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionBlind) As(alias string) *fissionBlind { + f.fissionBlindDo.DO = *(f.fissionBlindDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionBlind) updateTableName(table string) *fissionBlind { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionBlind) WithContext(ctx context.Context) *fissionBlindDo { + return f.fissionBlindDo.WithContext(ctx) +} + +func (f fissionBlind) TableName() string { return f.fissionBlindDo.TableName() } + +func (f fissionBlind) Alias() string { return f.fissionBlindDo.Alias() } + +func (f *fissionBlind) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionBlind) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionBlind) clone(db *gorm.DB) fissionBlind { + f.fissionBlindDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionBlind) replaceDB(db *gorm.DB) fissionBlind { + f.fissionBlindDo.ReplaceDB(db) + return f +} + +type fissionBlindDo struct{ gen.DO } + +func (f fissionBlindDo) Debug() *fissionBlindDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionBlindDo) WithContext(ctx context.Context) *fissionBlindDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionBlindDo) ReadDB() *fissionBlindDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionBlindDo) WriteDB() *fissionBlindDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionBlindDo) Session(config *gorm.Session) *fissionBlindDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionBlindDo) Clauses(conds ...clause.Expression) *fissionBlindDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionBlindDo) Returning(value interface{}, columns ...string) *fissionBlindDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionBlindDo) Not(conds ...gen.Condition) *fissionBlindDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionBlindDo) Or(conds ...gen.Condition) *fissionBlindDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionBlindDo) Select(conds ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionBlindDo) Where(conds ...gen.Condition) *fissionBlindDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionBlindDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionBlindDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionBlindDo) Order(conds ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionBlindDo) Distinct(cols ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionBlindDo) Omit(cols ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionBlindDo) Join(table schema.Tabler, on ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionBlindDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionBlindDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionBlindDo) Group(cols ...field.Expr) *fissionBlindDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionBlindDo) Having(conds ...gen.Condition) *fissionBlindDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionBlindDo) Limit(limit int) *fissionBlindDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionBlindDo) Offset(offset int) *fissionBlindDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionBlindDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionBlindDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionBlindDo) Unscoped() *fissionBlindDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionBlindDo) Create(values ...*model.FissionBlind) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionBlindDo) CreateInBatches(values []*model.FissionBlind, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionBlindDo) Save(values ...*model.FissionBlind) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionBlindDo) First() (*model.FissionBlind, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlind), nil + } +} + +func (f fissionBlindDo) Take() (*model.FissionBlind, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlind), nil + } +} + +func (f fissionBlindDo) Last() (*model.FissionBlind, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlind), nil + } +} + +func (f fissionBlindDo) Find() ([]*model.FissionBlind, error) { + result, err := f.DO.Find() + return result.([]*model.FissionBlind), err +} + +func (f fissionBlindDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionBlind, err error) { + buf := make([]*model.FissionBlind, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionBlindDo) FindInBatches(result *[]*model.FissionBlind, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionBlindDo) Attrs(attrs ...field.AssignExpr) *fissionBlindDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionBlindDo) Assign(attrs ...field.AssignExpr) *fissionBlindDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionBlindDo) Joins(fields ...field.RelationField) *fissionBlindDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionBlindDo) Preload(fields ...field.RelationField) *fissionBlindDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionBlindDo) FirstOrInit() (*model.FissionBlind, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlind), nil + } +} + +func (f fissionBlindDo) FirstOrCreate() (*model.FissionBlind, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlind), nil + } +} + +func (f fissionBlindDo) FindByPage(offset int, limit int) (result []*model.FissionBlind, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionBlindDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionBlindDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionBlindDo) Delete(models ...*model.FissionBlind) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionBlindDo) withDO(do gen.Dao) *fissionBlindDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_blind_log.gen.go b/internal/repository/dao/fission_blind_log.gen.go new file mode 100644 index 0000000..510f32d --- /dev/null +++ b/internal/repository/dao/fission_blind_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionBlindLog(db *gorm.DB, opts ...gen.DOOption) fissionBlindLog { + _fissionBlindLog := fissionBlindLog{} + + _fissionBlindLog.fissionBlindLogDo.UseDB(db, opts...) + _fissionBlindLog.fissionBlindLogDo.UseModel(&model.FissionBlindLog{}) + + tableName := _fissionBlindLog.fissionBlindLogDo.TableName() + _fissionBlindLog.ALL = field.NewAsterisk(tableName) + _fissionBlindLog.ID = field.NewInt64(tableName, "id") + _fissionBlindLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionBlindLog.UserID = field.NewInt64(tableName, "user_id") + _fissionBlindLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionBlindLog.BlindID = field.NewInt64(tableName, "blind_id") + _fissionBlindLog.Type = field.NewInt8(tableName, "type") + _fissionBlindLog.Source = field.NewString(tableName, "source") + _fissionBlindLog.Val = field.NewString(tableName, "val") + + _fissionBlindLog.fillFieldMap() + + return _fissionBlindLog +} + +type fissionBlindLog struct { + fissionBlindLogDo fissionBlindLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + BlindID field.Int64 // 玩家id(fission_prize_wheel表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionBlindLog) Table(newTableName string) *fissionBlindLog { + f.fissionBlindLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionBlindLog) As(alias string) *fissionBlindLog { + f.fissionBlindLogDo.DO = *(f.fissionBlindLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionBlindLog) updateTableName(table string) *fissionBlindLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.BlindID = field.NewInt64(table, "blind_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionBlindLog) WithContext(ctx context.Context) *fissionBlindLogDo { + return f.fissionBlindLogDo.WithContext(ctx) +} + +func (f fissionBlindLog) TableName() string { return f.fissionBlindLogDo.TableName() } + +func (f fissionBlindLog) Alias() string { return f.fissionBlindLogDo.Alias() } + +func (f *fissionBlindLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionBlindLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["blind_id"] = f.BlindID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionBlindLog) clone(db *gorm.DB) fissionBlindLog { + f.fissionBlindLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionBlindLog) replaceDB(db *gorm.DB) fissionBlindLog { + f.fissionBlindLogDo.ReplaceDB(db) + return f +} + +type fissionBlindLogDo struct{ gen.DO } + +func (f fissionBlindLogDo) Debug() *fissionBlindLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionBlindLogDo) WithContext(ctx context.Context) *fissionBlindLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionBlindLogDo) ReadDB() *fissionBlindLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionBlindLogDo) WriteDB() *fissionBlindLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionBlindLogDo) Session(config *gorm.Session) *fissionBlindLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionBlindLogDo) Clauses(conds ...clause.Expression) *fissionBlindLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionBlindLogDo) Returning(value interface{}, columns ...string) *fissionBlindLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionBlindLogDo) Not(conds ...gen.Condition) *fissionBlindLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionBlindLogDo) Or(conds ...gen.Condition) *fissionBlindLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionBlindLogDo) Select(conds ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionBlindLogDo) Where(conds ...gen.Condition) *fissionBlindLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionBlindLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionBlindLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionBlindLogDo) Order(conds ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionBlindLogDo) Distinct(cols ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionBlindLogDo) Omit(cols ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionBlindLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionBlindLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionBlindLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionBlindLogDo) Group(cols ...field.Expr) *fissionBlindLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionBlindLogDo) Having(conds ...gen.Condition) *fissionBlindLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionBlindLogDo) Limit(limit int) *fissionBlindLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionBlindLogDo) Offset(offset int) *fissionBlindLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionBlindLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionBlindLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionBlindLogDo) Unscoped() *fissionBlindLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionBlindLogDo) Create(values ...*model.FissionBlindLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionBlindLogDo) CreateInBatches(values []*model.FissionBlindLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionBlindLogDo) Save(values ...*model.FissionBlindLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionBlindLogDo) First() (*model.FissionBlindLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlindLog), nil + } +} + +func (f fissionBlindLogDo) Take() (*model.FissionBlindLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlindLog), nil + } +} + +func (f fissionBlindLogDo) Last() (*model.FissionBlindLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlindLog), nil + } +} + +func (f fissionBlindLogDo) Find() ([]*model.FissionBlindLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionBlindLog), err +} + +func (f fissionBlindLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionBlindLog, err error) { + buf := make([]*model.FissionBlindLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionBlindLogDo) FindInBatches(result *[]*model.FissionBlindLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionBlindLogDo) Attrs(attrs ...field.AssignExpr) *fissionBlindLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionBlindLogDo) Assign(attrs ...field.AssignExpr) *fissionBlindLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionBlindLogDo) Joins(fields ...field.RelationField) *fissionBlindLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionBlindLogDo) Preload(fields ...field.RelationField) *fissionBlindLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionBlindLogDo) FirstOrInit() (*model.FissionBlindLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlindLog), nil + } +} + +func (f fissionBlindLogDo) FirstOrCreate() (*model.FissionBlindLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionBlindLog), nil + } +} + +func (f fissionBlindLogDo) FindByPage(offset int, limit int) (result []*model.FissionBlindLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionBlindLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionBlindLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionBlindLogDo) Delete(models ...*model.FissionBlindLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionBlindLogDo) withDO(do gen.Dao) *fissionBlindLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign.gen.go b/internal/repository/dao/fission_campaign.gen.go new file mode 100644 index 0000000..2be7506 --- /dev/null +++ b/internal/repository/dao/fission_campaign.gen.go @@ -0,0 +1,423 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaign(db *gorm.DB, opts ...gen.DOOption) fissionCampaign { + _fissionCampaign := fissionCampaign{} + + _fissionCampaign.fissionCampaignDo.UseDB(db, opts...) + _fissionCampaign.fissionCampaignDo.UseModel(&model.FissionCampaign{}) + + tableName := _fissionCampaign.fissionCampaignDo.TableName() + _fissionCampaign.ALL = field.NewAsterisk(tableName) + _fissionCampaign.ID = field.NewInt64(tableName, "id") + _fissionCampaign.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaign.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaign.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaign.HashID = field.NewString(tableName, "hash_id") + _fissionCampaign.FissionID = field.NewInt64(tableName, "fission_id") + _fissionCampaign.ProjectID = field.NewInt64(tableName, "project_id") + _fissionCampaign.CreatorID = field.NewInt64(tableName, "creator_id") + _fissionCampaign.LanguagePkgID = field.NewInt64(tableName, "language_pkg_id") + _fissionCampaign.TemplateID = field.NewInt64(tableName, "template_id") + _fissionCampaign.Title = field.NewString(tableName, "title") + _fissionCampaign.Status = field.NewInt8(tableName, "status") + _fissionCampaign.StartTime = field.NewInt64(tableName, "start_time") + _fissionCampaign.EndTime = field.NewInt64(tableName, "end_time") + _fissionCampaign.CoverURL = field.NewString(tableName, "cover_url") + _fissionCampaign.TOffset = field.NewInt32(tableName, "t_offset") + _fissionCampaign.TStart = field.NewInt64(tableName, "t_start") + _fissionCampaign.TEnd = field.NewInt64(tableName, "t_end") + _fissionCampaign.LangTypes = field.NewString(tableName, "lang_types") + _fissionCampaign.Target = field.NewInt8(tableName, "target") + _fissionCampaign.ReportType = field.NewInt8(tableName, "report_type") + _fissionCampaign.PreToRun = field.NewInt64(tableName, "pre_to_run") + _fissionCampaign.Pid = field.NewInt64(tableName, "pid") + _fissionCampaign.ChildType = field.NewInt8(tableName, "child_type") + + _fissionCampaign.fillFieldMap() + + return _fissionCampaign +} + +type fissionCampaign struct { + fissionCampaignDo fissionCampaignDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 活动对外hash_id + FissionID field.Int64 // 玩法ID(fission表主键) + ProjectID field.Int64 // 项目ID(clintproject表主键) + CreatorID field.Int64 // 创建用户ID(user表主键) + LanguagePkgID field.Int64 // 语言包ID(languagepackage表主键) + TemplateID field.Int64 // 活动模板ID + Title field.String // 活动标题 + Status field.Int8 // 发布状态(1-待发布,2-已发布,3-已下线) + StartTime field.Int64 // 开始时间 + EndTime field.Int64 // 结束时间 + CoverURL field.String // 活动封面图 + TOffset field.Int32 // 时间偏移量 + TStart field.Int64 // 提交的开始时间(+8时区算出来的时间戳) + TEnd field.Int64 // 提交的结束时间(+8时区算出来的时间戳) + LangTypes field.String // 支持的语种标识 + Target field.Int8 // 活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告;5-子活动) + ReportType field.Int8 // 报表类型(1-旧版报表,2-广告报表,3-新版活动内报表) + PreToRun field.Int64 // 预发布转正式时间 + Pid field.Int64 // 上级活动id + ChildType field.Int8 // 子活动类型 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaign) Table(newTableName string) *fissionCampaign { + f.fissionCampaignDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaign) As(alias string) *fissionCampaign { + f.fissionCampaignDo.DO = *(f.fissionCampaignDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaign) updateTableName(table string) *fissionCampaign { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.HashID = field.NewString(table, "hash_id") + f.FissionID = field.NewInt64(table, "fission_id") + f.ProjectID = field.NewInt64(table, "project_id") + f.CreatorID = field.NewInt64(table, "creator_id") + f.LanguagePkgID = field.NewInt64(table, "language_pkg_id") + f.TemplateID = field.NewInt64(table, "template_id") + f.Title = field.NewString(table, "title") + f.Status = field.NewInt8(table, "status") + f.StartTime = field.NewInt64(table, "start_time") + f.EndTime = field.NewInt64(table, "end_time") + f.CoverURL = field.NewString(table, "cover_url") + f.TOffset = field.NewInt32(table, "t_offset") + f.TStart = field.NewInt64(table, "t_start") + f.TEnd = field.NewInt64(table, "t_end") + f.LangTypes = field.NewString(table, "lang_types") + f.Target = field.NewInt8(table, "target") + f.ReportType = field.NewInt8(table, "report_type") + f.PreToRun = field.NewInt64(table, "pre_to_run") + f.Pid = field.NewInt64(table, "pid") + f.ChildType = field.NewInt8(table, "child_type") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaign) WithContext(ctx context.Context) *fissionCampaignDo { + return f.fissionCampaignDo.WithContext(ctx) +} + +func (f fissionCampaign) TableName() string { return f.fissionCampaignDo.TableName() } + +func (f fissionCampaign) Alias() string { return f.fissionCampaignDo.Alias() } + +func (f *fissionCampaign) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaign) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 24) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["fission_id"] = f.FissionID + f.fieldMap["project_id"] = f.ProjectID + f.fieldMap["creator_id"] = f.CreatorID + f.fieldMap["language_pkg_id"] = f.LanguagePkgID + f.fieldMap["template_id"] = f.TemplateID + f.fieldMap["title"] = f.Title + f.fieldMap["status"] = f.Status + f.fieldMap["start_time"] = f.StartTime + f.fieldMap["end_time"] = f.EndTime + f.fieldMap["cover_url"] = f.CoverURL + f.fieldMap["t_offset"] = f.TOffset + f.fieldMap["t_start"] = f.TStart + f.fieldMap["t_end"] = f.TEnd + f.fieldMap["lang_types"] = f.LangTypes + f.fieldMap["target"] = f.Target + f.fieldMap["report_type"] = f.ReportType + f.fieldMap["pre_to_run"] = f.PreToRun + f.fieldMap["pid"] = f.Pid + f.fieldMap["child_type"] = f.ChildType +} + +func (f fissionCampaign) clone(db *gorm.DB) fissionCampaign { + f.fissionCampaignDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaign) replaceDB(db *gorm.DB) fissionCampaign { + f.fissionCampaignDo.ReplaceDB(db) + return f +} + +type fissionCampaignDo struct{ gen.DO } + +func (f fissionCampaignDo) Debug() *fissionCampaignDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignDo) WithContext(ctx context.Context) *fissionCampaignDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignDo) ReadDB() *fissionCampaignDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignDo) WriteDB() *fissionCampaignDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignDo) Session(config *gorm.Session) *fissionCampaignDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignDo) Clauses(conds ...clause.Expression) *fissionCampaignDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignDo) Returning(value interface{}, columns ...string) *fissionCampaignDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignDo) Not(conds ...gen.Condition) *fissionCampaignDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignDo) Or(conds ...gen.Condition) *fissionCampaignDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignDo) Select(conds ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignDo) Where(conds ...gen.Condition) *fissionCampaignDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignDo) Order(conds ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignDo) Distinct(cols ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignDo) Omit(cols ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignDo) Group(cols ...field.Expr) *fissionCampaignDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignDo) Having(conds ...gen.Condition) *fissionCampaignDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignDo) Limit(limit int) *fissionCampaignDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignDo) Offset(offset int) *fissionCampaignDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignDo) Unscoped() *fissionCampaignDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignDo) Create(values ...*model.FissionCampaign) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignDo) CreateInBatches(values []*model.FissionCampaign, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignDo) Save(values ...*model.FissionCampaign) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignDo) First() (*model.FissionCampaign, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaign), nil + } +} + +func (f fissionCampaignDo) Take() (*model.FissionCampaign, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaign), nil + } +} + +func (f fissionCampaignDo) Last() (*model.FissionCampaign, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaign), nil + } +} + +func (f fissionCampaignDo) Find() ([]*model.FissionCampaign, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaign), err +} + +func (f fissionCampaignDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaign, err error) { + buf := make([]*model.FissionCampaign, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignDo) FindInBatches(result *[]*model.FissionCampaign, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignDo) Assign(attrs ...field.AssignExpr) *fissionCampaignDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignDo) Joins(fields ...field.RelationField) *fissionCampaignDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignDo) Preload(fields ...field.RelationField) *fissionCampaignDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignDo) FirstOrInit() (*model.FissionCampaign, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaign), nil + } +} + +func (f fissionCampaignDo) FirstOrCreate() (*model.FissionCampaign, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaign), nil + } +} + +func (f fissionCampaignDo) FindByPage(offset int, limit int) (result []*model.FissionCampaign, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignDo) Delete(models ...*model.FissionCampaign) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignDo) withDO(do gen.Dao) *fissionCampaignDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_ballot.gen.go b/internal/repository/dao/fission_campaign_ballot.gen.go new file mode 100644 index 0000000..8b50997 --- /dev/null +++ b/internal/repository/dao/fission_campaign_ballot.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignBallot(db *gorm.DB, opts ...gen.DOOption) fissionCampaignBallot { + _fissionCampaignBallot := fissionCampaignBallot{} + + _fissionCampaignBallot.fissionCampaignBallotDo.UseDB(db, opts...) + _fissionCampaignBallot.fissionCampaignBallotDo.UseModel(&model.FissionCampaignBallot{}) + + tableName := _fissionCampaignBallot.fissionCampaignBallotDo.TableName() + _fissionCampaignBallot.ALL = field.NewAsterisk(tableName) + _fissionCampaignBallot.ID = field.NewInt64(tableName, "id") + _fissionCampaignBallot.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignBallot.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignBallot.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignBallot.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignBallot.DayChance = field.NewInt32(tableName, "day_chance") + + _fissionCampaignBallot.fillFieldMap() + + return _fissionCampaignBallot +} + +type fissionCampaignBallot struct { + fissionCampaignBallotDo fissionCampaignBallotDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + InitChance field.Int32 // 初始抽签数 + DayChance field.Int32 // 每日获得的抽签数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignBallot) Table(newTableName string) *fissionCampaignBallot { + f.fissionCampaignBallotDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignBallot) As(alias string) *fissionCampaignBallot { + f.fissionCampaignBallotDo.DO = *(f.fissionCampaignBallotDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignBallot) updateTableName(table string) *fissionCampaignBallot { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.InitChance = field.NewInt32(table, "init_chance") + f.DayChance = field.NewInt32(table, "day_chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignBallot) WithContext(ctx context.Context) *fissionCampaignBallotDo { + return f.fissionCampaignBallotDo.WithContext(ctx) +} + +func (f fissionCampaignBallot) TableName() string { return f.fissionCampaignBallotDo.TableName() } + +func (f fissionCampaignBallot) Alias() string { return f.fissionCampaignBallotDo.Alias() } + +func (f *fissionCampaignBallot) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignBallot) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["day_chance"] = f.DayChance +} + +func (f fissionCampaignBallot) clone(db *gorm.DB) fissionCampaignBallot { + f.fissionCampaignBallotDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignBallot) replaceDB(db *gorm.DB) fissionCampaignBallot { + f.fissionCampaignBallotDo.ReplaceDB(db) + return f +} + +type fissionCampaignBallotDo struct{ gen.DO } + +func (f fissionCampaignBallotDo) Debug() *fissionCampaignBallotDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignBallotDo) WithContext(ctx context.Context) *fissionCampaignBallotDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignBallotDo) ReadDB() *fissionCampaignBallotDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignBallotDo) WriteDB() *fissionCampaignBallotDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignBallotDo) Session(config *gorm.Session) *fissionCampaignBallotDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignBallotDo) Clauses(conds ...clause.Expression) *fissionCampaignBallotDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignBallotDo) Returning(value interface{}, columns ...string) *fissionCampaignBallotDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignBallotDo) Not(conds ...gen.Condition) *fissionCampaignBallotDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignBallotDo) Or(conds ...gen.Condition) *fissionCampaignBallotDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignBallotDo) Select(conds ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignBallotDo) Where(conds ...gen.Condition) *fissionCampaignBallotDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignBallotDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignBallotDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignBallotDo) Order(conds ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignBallotDo) Distinct(cols ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignBallotDo) Omit(cols ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignBallotDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignBallotDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignBallotDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignBallotDo) Group(cols ...field.Expr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignBallotDo) Having(conds ...gen.Condition) *fissionCampaignBallotDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignBallotDo) Limit(limit int) *fissionCampaignBallotDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignBallotDo) Offset(offset int) *fissionCampaignBallotDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignBallotDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignBallotDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignBallotDo) Unscoped() *fissionCampaignBallotDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignBallotDo) Create(values ...*model.FissionCampaignBallot) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignBallotDo) CreateInBatches(values []*model.FissionCampaignBallot, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignBallotDo) Save(values ...*model.FissionCampaignBallot) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignBallotDo) First() (*model.FissionCampaignBallot, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBallot), nil + } +} + +func (f fissionCampaignBallotDo) Take() (*model.FissionCampaignBallot, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBallot), nil + } +} + +func (f fissionCampaignBallotDo) Last() (*model.FissionCampaignBallot, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBallot), nil + } +} + +func (f fissionCampaignBallotDo) Find() ([]*model.FissionCampaignBallot, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignBallot), err +} + +func (f fissionCampaignBallotDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignBallot, err error) { + buf := make([]*model.FissionCampaignBallot, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignBallotDo) FindInBatches(result *[]*model.FissionCampaignBallot, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignBallotDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignBallotDo) Assign(attrs ...field.AssignExpr) *fissionCampaignBallotDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignBallotDo) Joins(fields ...field.RelationField) *fissionCampaignBallotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignBallotDo) Preload(fields ...field.RelationField) *fissionCampaignBallotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignBallotDo) FirstOrInit() (*model.FissionCampaignBallot, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBallot), nil + } +} + +func (f fissionCampaignBallotDo) FirstOrCreate() (*model.FissionCampaignBallot, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBallot), nil + } +} + +func (f fissionCampaignBallotDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignBallot, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignBallotDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignBallotDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignBallotDo) Delete(models ...*model.FissionCampaignBallot) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignBallotDo) withDO(do gen.Dao) *fissionCampaignBallotDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_blind.gen.go b/internal/repository/dao/fission_campaign_blind.gen.go new file mode 100644 index 0000000..d934625 --- /dev/null +++ b/internal/repository/dao/fission_campaign_blind.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignBlind(db *gorm.DB, opts ...gen.DOOption) fissionCampaignBlind { + _fissionCampaignBlind := fissionCampaignBlind{} + + _fissionCampaignBlind.fissionCampaignBlindDo.UseDB(db, opts...) + _fissionCampaignBlind.fissionCampaignBlindDo.UseModel(&model.FissionCampaignBlind{}) + + tableName := _fissionCampaignBlind.fissionCampaignBlindDo.TableName() + _fissionCampaignBlind.ALL = field.NewAsterisk(tableName) + _fissionCampaignBlind.ID = field.NewInt64(tableName, "id") + _fissionCampaignBlind.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignBlind.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignBlind.IsDel = field.NewUint8(tableName, "is_del") + _fissionCampaignBlind.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignBlind.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignBlind.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignBlind.Chance = field.NewInt32(tableName, "chance") + _fissionCampaignBlind.Odds = field.NewInt32(tableName, "odds") + _fissionCampaignBlind.DayChance = field.NewInt32(tableName, "day_chance") + + _fissionCampaignBlind.fillFieldMap() + + return _fissionCampaignBlind +} + +type fissionCampaignBlind struct { + fissionCampaignBlindDo fissionCampaignBlindDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + TargetNum field.Int32 // 达标条件需要的新用户个数 + InitChance field.Int32 // 初始答题机会次数 + Chance field.Int32 // 达标获得的抽奖机会次数 + Odds field.Int32 // 中奖概率 + DayChance field.Int32 // 每日获得的抽奖次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignBlind) Table(newTableName string) *fissionCampaignBlind { + f.fissionCampaignBlindDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignBlind) As(alias string) *fissionCampaignBlind { + f.fissionCampaignBlindDo.DO = *(f.fissionCampaignBlindDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignBlind) updateTableName(table string) *fissionCampaignBlind { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TargetNum = field.NewInt32(table, "target_num") + f.InitChance = field.NewInt32(table, "init_chance") + f.Chance = field.NewInt32(table, "chance") + f.Odds = field.NewInt32(table, "odds") + f.DayChance = field.NewInt32(table, "day_chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignBlind) WithContext(ctx context.Context) *fissionCampaignBlindDo { + return f.fissionCampaignBlindDo.WithContext(ctx) +} + +func (f fissionCampaignBlind) TableName() string { return f.fissionCampaignBlindDo.TableName() } + +func (f fissionCampaignBlind) Alias() string { return f.fissionCampaignBlindDo.Alias() } + +func (f *fissionCampaignBlind) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignBlind) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["chance"] = f.Chance + f.fieldMap["odds"] = f.Odds + f.fieldMap["day_chance"] = f.DayChance +} + +func (f fissionCampaignBlind) clone(db *gorm.DB) fissionCampaignBlind { + f.fissionCampaignBlindDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignBlind) replaceDB(db *gorm.DB) fissionCampaignBlind { + f.fissionCampaignBlindDo.ReplaceDB(db) + return f +} + +type fissionCampaignBlindDo struct{ gen.DO } + +func (f fissionCampaignBlindDo) Debug() *fissionCampaignBlindDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignBlindDo) WithContext(ctx context.Context) *fissionCampaignBlindDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignBlindDo) ReadDB() *fissionCampaignBlindDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignBlindDo) WriteDB() *fissionCampaignBlindDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignBlindDo) Session(config *gorm.Session) *fissionCampaignBlindDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignBlindDo) Clauses(conds ...clause.Expression) *fissionCampaignBlindDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignBlindDo) Returning(value interface{}, columns ...string) *fissionCampaignBlindDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignBlindDo) Not(conds ...gen.Condition) *fissionCampaignBlindDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignBlindDo) Or(conds ...gen.Condition) *fissionCampaignBlindDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignBlindDo) Select(conds ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignBlindDo) Where(conds ...gen.Condition) *fissionCampaignBlindDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignBlindDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignBlindDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignBlindDo) Order(conds ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignBlindDo) Distinct(cols ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignBlindDo) Omit(cols ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignBlindDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignBlindDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignBlindDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignBlindDo) Group(cols ...field.Expr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignBlindDo) Having(conds ...gen.Condition) *fissionCampaignBlindDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignBlindDo) Limit(limit int) *fissionCampaignBlindDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignBlindDo) Offset(offset int) *fissionCampaignBlindDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignBlindDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignBlindDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignBlindDo) Unscoped() *fissionCampaignBlindDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignBlindDo) Create(values ...*model.FissionCampaignBlind) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignBlindDo) CreateInBatches(values []*model.FissionCampaignBlind, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignBlindDo) Save(values ...*model.FissionCampaignBlind) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignBlindDo) First() (*model.FissionCampaignBlind, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBlind), nil + } +} + +func (f fissionCampaignBlindDo) Take() (*model.FissionCampaignBlind, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBlind), nil + } +} + +func (f fissionCampaignBlindDo) Last() (*model.FissionCampaignBlind, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBlind), nil + } +} + +func (f fissionCampaignBlindDo) Find() ([]*model.FissionCampaignBlind, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignBlind), err +} + +func (f fissionCampaignBlindDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignBlind, err error) { + buf := make([]*model.FissionCampaignBlind, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignBlindDo) FindInBatches(result *[]*model.FissionCampaignBlind, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignBlindDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignBlindDo) Assign(attrs ...field.AssignExpr) *fissionCampaignBlindDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignBlindDo) Joins(fields ...field.RelationField) *fissionCampaignBlindDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignBlindDo) Preload(fields ...field.RelationField) *fissionCampaignBlindDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignBlindDo) FirstOrInit() (*model.FissionCampaignBlind, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBlind), nil + } +} + +func (f fissionCampaignBlindDo) FirstOrCreate() (*model.FissionCampaignBlind, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignBlind), nil + } +} + +func (f fissionCampaignBlindDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignBlind, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignBlindDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignBlindDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignBlindDo) Delete(models ...*model.FissionCampaignBlind) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignBlindDo) withDO(do gen.Dao) *fissionCampaignBlindDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_cash.gen.go b/internal/repository/dao/fission_campaign_cash.gen.go new file mode 100644 index 0000000..09d2250 --- /dev/null +++ b/internal/repository/dao/fission_campaign_cash.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignCash(db *gorm.DB, opts ...gen.DOOption) fissionCampaignCash { + _fissionCampaignCash := fissionCampaignCash{} + + _fissionCampaignCash.fissionCampaignCashDo.UseDB(db, opts...) + _fissionCampaignCash.fissionCampaignCashDo.UseModel(&model.FissionCampaignCash{}) + + tableName := _fissionCampaignCash.fissionCampaignCashDo.TableName() + _fissionCampaignCash.ALL = field.NewAsterisk(tableName) + _fissionCampaignCash.ID = field.NewInt64(tableName, "id") + _fissionCampaignCash.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignCash.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignCash.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignCash.ExpiredDay = field.NewInt32(tableName, "expired_day") + _fissionCampaignCash.Price = field.NewInt32(tableName, "price") + _fissionCampaignCash.PriceNum = field.NewInt32(tableName, "price_num") + _fissionCampaignCash.Lack = field.NewInt8(tableName, "lack") + _fissionCampaignCash.Currency = field.NewInt8(tableName, "currency") + _fissionCampaignCash.LoopNum = field.NewInt32(tableName, "loop_num") + + _fissionCampaignCash.fillFieldMap() + + return _fissionCampaignCash +} + +type fissionCampaignCash struct { + fissionCampaignCashDo fissionCampaignCashDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + ExpiredDay field.Int32 // 任务重置天数 + Price field.Int32 // 单位奖品总价值 + PriceNum field.Int32 // 奖品总份额 + Lack field.Int8 // 缺乏库存 + Currency field.Int8 // 货币单位 + LoopNum field.Int32 // 用户可循环次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignCash) Table(newTableName string) *fissionCampaignCash { + f.fissionCampaignCashDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignCash) As(alias string) *fissionCampaignCash { + f.fissionCampaignCashDo.DO = *(f.fissionCampaignCashDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignCash) updateTableName(table string) *fissionCampaignCash { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ExpiredDay = field.NewInt32(table, "expired_day") + f.Price = field.NewInt32(table, "price") + f.PriceNum = field.NewInt32(table, "price_num") + f.Lack = field.NewInt8(table, "lack") + f.Currency = field.NewInt8(table, "currency") + f.LoopNum = field.NewInt32(table, "loop_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignCash) WithContext(ctx context.Context) *fissionCampaignCashDo { + return f.fissionCampaignCashDo.WithContext(ctx) +} + +func (f fissionCampaignCash) TableName() string { return f.fissionCampaignCashDo.TableName() } + +func (f fissionCampaignCash) Alias() string { return f.fissionCampaignCashDo.Alias() } + +func (f *fissionCampaignCash) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignCash) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["expired_day"] = f.ExpiredDay + f.fieldMap["price"] = f.Price + f.fieldMap["price_num"] = f.PriceNum + f.fieldMap["lack"] = f.Lack + f.fieldMap["currency"] = f.Currency + f.fieldMap["loop_num"] = f.LoopNum +} + +func (f fissionCampaignCash) clone(db *gorm.DB) fissionCampaignCash { + f.fissionCampaignCashDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignCash) replaceDB(db *gorm.DB) fissionCampaignCash { + f.fissionCampaignCashDo.ReplaceDB(db) + return f +} + +type fissionCampaignCashDo struct{ gen.DO } + +func (f fissionCampaignCashDo) Debug() *fissionCampaignCashDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignCashDo) WithContext(ctx context.Context) *fissionCampaignCashDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignCashDo) ReadDB() *fissionCampaignCashDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignCashDo) WriteDB() *fissionCampaignCashDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignCashDo) Session(config *gorm.Session) *fissionCampaignCashDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignCashDo) Clauses(conds ...clause.Expression) *fissionCampaignCashDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignCashDo) Returning(value interface{}, columns ...string) *fissionCampaignCashDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignCashDo) Not(conds ...gen.Condition) *fissionCampaignCashDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignCashDo) Or(conds ...gen.Condition) *fissionCampaignCashDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignCashDo) Select(conds ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignCashDo) Where(conds ...gen.Condition) *fissionCampaignCashDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignCashDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignCashDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignCashDo) Order(conds ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignCashDo) Distinct(cols ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignCashDo) Omit(cols ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignCashDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignCashDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignCashDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignCashDo) Group(cols ...field.Expr) *fissionCampaignCashDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignCashDo) Having(conds ...gen.Condition) *fissionCampaignCashDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignCashDo) Limit(limit int) *fissionCampaignCashDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignCashDo) Offset(offset int) *fissionCampaignCashDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignCashDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignCashDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignCashDo) Unscoped() *fissionCampaignCashDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignCashDo) Create(values ...*model.FissionCampaignCash) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignCashDo) CreateInBatches(values []*model.FissionCampaignCash, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignCashDo) Save(values ...*model.FissionCampaignCash) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignCashDo) First() (*model.FissionCampaignCash, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCash), nil + } +} + +func (f fissionCampaignCashDo) Take() (*model.FissionCampaignCash, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCash), nil + } +} + +func (f fissionCampaignCashDo) Last() (*model.FissionCampaignCash, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCash), nil + } +} + +func (f fissionCampaignCashDo) Find() ([]*model.FissionCampaignCash, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignCash), err +} + +func (f fissionCampaignCashDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignCash, err error) { + buf := make([]*model.FissionCampaignCash, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignCashDo) FindInBatches(result *[]*model.FissionCampaignCash, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignCashDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignCashDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignCashDo) Assign(attrs ...field.AssignExpr) *fissionCampaignCashDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignCashDo) Joins(fields ...field.RelationField) *fissionCampaignCashDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignCashDo) Preload(fields ...field.RelationField) *fissionCampaignCashDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignCashDo) FirstOrInit() (*model.FissionCampaignCash, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCash), nil + } +} + +func (f fissionCampaignCashDo) FirstOrCreate() (*model.FissionCampaignCash, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCash), nil + } +} + +func (f fissionCampaignCashDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignCash, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignCashDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignCashDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignCashDo) Delete(models ...*model.FissionCampaignCash) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignCashDo) withDO(do gen.Dao) *fissionCampaignCashDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_channel.gen.go b/internal/repository/dao/fission_campaign_channel.gen.go new file mode 100644 index 0000000..941b636 --- /dev/null +++ b/internal/repository/dao/fission_campaign_channel.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignChannel(db *gorm.DB, opts ...gen.DOOption) fissionCampaignChannel { + _fissionCampaignChannel := fissionCampaignChannel{} + + _fissionCampaignChannel.fissionCampaignChannelDo.UseDB(db, opts...) + _fissionCampaignChannel.fissionCampaignChannelDo.UseModel(&model.FissionCampaignChannel{}) + + tableName := _fissionCampaignChannel.fissionCampaignChannelDo.TableName() + _fissionCampaignChannel.ALL = field.NewAsterisk(tableName) + _fissionCampaignChannel.ID = field.NewInt64(tableName, "id") + _fissionCampaignChannel.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignChannel.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignChannel.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignChannel.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignChannel.IsDefault = field.NewInt8(tableName, "is_default") + _fissionCampaignChannel.Mark = field.NewString(tableName, "mark") + _fissionCampaignChannel.Title = field.NewString(tableName, "title") + _fissionCampaignChannel.CType = field.NewInt8(tableName, "c_type") + _fissionCampaignChannel.Code = field.NewString(tableName, "code") + _fissionCampaignChannel.ShortLink = field.NewString(tableName, "short_link") + + _fissionCampaignChannel.fillFieldMap() + + return _fissionCampaignChannel +} + +type fissionCampaignChannel struct { + fissionCampaignChannelDo fissionCampaignChannelDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动id(fission_campaign表) + IsDefault field.Int8 // 是否是默认值(0-否,1-是) + Mark field.String // 渠道标识 + Title field.String // 渠道名称 + CType field.Int8 // 渠道类型(1-站内渠道,2-站外渠道) + Code field.String // 口令字符串 + ShortLink field.String // 短链地址 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignChannel) Table(newTableName string) *fissionCampaignChannel { + f.fissionCampaignChannelDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignChannel) As(alias string) *fissionCampaignChannel { + f.fissionCampaignChannelDo.DO = *(f.fissionCampaignChannelDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignChannel) updateTableName(table string) *fissionCampaignChannel { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.IsDefault = field.NewInt8(table, "is_default") + f.Mark = field.NewString(table, "mark") + f.Title = field.NewString(table, "title") + f.CType = field.NewInt8(table, "c_type") + f.Code = field.NewString(table, "code") + f.ShortLink = field.NewString(table, "short_link") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignChannel) WithContext(ctx context.Context) *fissionCampaignChannelDo { + return f.fissionCampaignChannelDo.WithContext(ctx) +} + +func (f fissionCampaignChannel) TableName() string { return f.fissionCampaignChannelDo.TableName() } + +func (f fissionCampaignChannel) Alias() string { return f.fissionCampaignChannelDo.Alias() } + +func (f *fissionCampaignChannel) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignChannel) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["is_default"] = f.IsDefault + f.fieldMap["mark"] = f.Mark + f.fieldMap["title"] = f.Title + f.fieldMap["c_type"] = f.CType + f.fieldMap["code"] = f.Code + f.fieldMap["short_link"] = f.ShortLink +} + +func (f fissionCampaignChannel) clone(db *gorm.DB) fissionCampaignChannel { + f.fissionCampaignChannelDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignChannel) replaceDB(db *gorm.DB) fissionCampaignChannel { + f.fissionCampaignChannelDo.ReplaceDB(db) + return f +} + +type fissionCampaignChannelDo struct{ gen.DO } + +func (f fissionCampaignChannelDo) Debug() *fissionCampaignChannelDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignChannelDo) WithContext(ctx context.Context) *fissionCampaignChannelDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignChannelDo) ReadDB() *fissionCampaignChannelDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignChannelDo) WriteDB() *fissionCampaignChannelDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignChannelDo) Session(config *gorm.Session) *fissionCampaignChannelDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignChannelDo) Clauses(conds ...clause.Expression) *fissionCampaignChannelDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignChannelDo) Returning(value interface{}, columns ...string) *fissionCampaignChannelDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignChannelDo) Not(conds ...gen.Condition) *fissionCampaignChannelDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignChannelDo) Or(conds ...gen.Condition) *fissionCampaignChannelDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignChannelDo) Select(conds ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignChannelDo) Where(conds ...gen.Condition) *fissionCampaignChannelDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignChannelDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignChannelDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignChannelDo) Order(conds ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignChannelDo) Distinct(cols ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignChannelDo) Omit(cols ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignChannelDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignChannelDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignChannelDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignChannelDo) Group(cols ...field.Expr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignChannelDo) Having(conds ...gen.Condition) *fissionCampaignChannelDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignChannelDo) Limit(limit int) *fissionCampaignChannelDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignChannelDo) Offset(offset int) *fissionCampaignChannelDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignChannelDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignChannelDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignChannelDo) Unscoped() *fissionCampaignChannelDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignChannelDo) Create(values ...*model.FissionCampaignChannel) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignChannelDo) CreateInBatches(values []*model.FissionCampaignChannel, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignChannelDo) Save(values ...*model.FissionCampaignChannel) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignChannelDo) First() (*model.FissionCampaignChannel, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChannel), nil + } +} + +func (f fissionCampaignChannelDo) Take() (*model.FissionCampaignChannel, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChannel), nil + } +} + +func (f fissionCampaignChannelDo) Last() (*model.FissionCampaignChannel, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChannel), nil + } +} + +func (f fissionCampaignChannelDo) Find() ([]*model.FissionCampaignChannel, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignChannel), err +} + +func (f fissionCampaignChannelDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignChannel, err error) { + buf := make([]*model.FissionCampaignChannel, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignChannelDo) FindInBatches(result *[]*model.FissionCampaignChannel, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignChannelDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignChannelDo) Assign(attrs ...field.AssignExpr) *fissionCampaignChannelDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignChannelDo) Joins(fields ...field.RelationField) *fissionCampaignChannelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignChannelDo) Preload(fields ...field.RelationField) *fissionCampaignChannelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignChannelDo) FirstOrInit() (*model.FissionCampaignChannel, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChannel), nil + } +} + +func (f fissionCampaignChannelDo) FirstOrCreate() (*model.FissionCampaignChannel, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChannel), nil + } +} + +func (f fissionCampaignChannelDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignChannel, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignChannelDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignChannelDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignChannelDo) Delete(models ...*model.FissionCampaignChannel) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignChannelDo) withDO(do gen.Dao) *fissionCampaignChannelDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_chat.gen.go b/internal/repository/dao/fission_campaign_chat.gen.go new file mode 100644 index 0000000..b2a681b --- /dev/null +++ b/internal/repository/dao/fission_campaign_chat.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignChat(db *gorm.DB, opts ...gen.DOOption) fissionCampaignChat { + _fissionCampaignChat := fissionCampaignChat{} + + _fissionCampaignChat.fissionCampaignChatDo.UseDB(db, opts...) + _fissionCampaignChat.fissionCampaignChatDo.UseModel(&model.FissionCampaignChat{}) + + tableName := _fissionCampaignChat.fissionCampaignChatDo.TableName() + _fissionCampaignChat.ALL = field.NewAsterisk(tableName) + _fissionCampaignChat.ID = field.NewInt64(tableName, "id") + _fissionCampaignChat.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignChat.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignChat.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignChat.HeaderImg = field.NewString(tableName, "header_img") + _fissionCampaignChat.ChatBg = field.NewString(tableName, "chat_bg") + _fissionCampaignChat.DayLimit = field.NewInt32(tableName, "day_limit") + + _fissionCampaignChat.fillFieldMap() + + return _fissionCampaignChat +} + +type fissionCampaignChat struct { + fissionCampaignChatDo fissionCampaignChatDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + HeaderImg field.String // 头像地址 + ChatBg field.String // 聊天背景图 + DayLimit field.Int32 // 每日聊天上限 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignChat) Table(newTableName string) *fissionCampaignChat { + f.fissionCampaignChatDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignChat) As(alias string) *fissionCampaignChat { + f.fissionCampaignChatDo.DO = *(f.fissionCampaignChatDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignChat) updateTableName(table string) *fissionCampaignChat { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.HeaderImg = field.NewString(table, "header_img") + f.ChatBg = field.NewString(table, "chat_bg") + f.DayLimit = field.NewInt32(table, "day_limit") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignChat) WithContext(ctx context.Context) *fissionCampaignChatDo { + return f.fissionCampaignChatDo.WithContext(ctx) +} + +func (f fissionCampaignChat) TableName() string { return f.fissionCampaignChatDo.TableName() } + +func (f fissionCampaignChat) Alias() string { return f.fissionCampaignChatDo.Alias() } + +func (f *fissionCampaignChat) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignChat) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["header_img"] = f.HeaderImg + f.fieldMap["chat_bg"] = f.ChatBg + f.fieldMap["day_limit"] = f.DayLimit +} + +func (f fissionCampaignChat) clone(db *gorm.DB) fissionCampaignChat { + f.fissionCampaignChatDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignChat) replaceDB(db *gorm.DB) fissionCampaignChat { + f.fissionCampaignChatDo.ReplaceDB(db) + return f +} + +type fissionCampaignChatDo struct{ gen.DO } + +func (f fissionCampaignChatDo) Debug() *fissionCampaignChatDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignChatDo) WithContext(ctx context.Context) *fissionCampaignChatDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignChatDo) ReadDB() *fissionCampaignChatDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignChatDo) WriteDB() *fissionCampaignChatDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignChatDo) Session(config *gorm.Session) *fissionCampaignChatDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignChatDo) Clauses(conds ...clause.Expression) *fissionCampaignChatDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignChatDo) Returning(value interface{}, columns ...string) *fissionCampaignChatDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignChatDo) Not(conds ...gen.Condition) *fissionCampaignChatDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignChatDo) Or(conds ...gen.Condition) *fissionCampaignChatDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignChatDo) Select(conds ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignChatDo) Where(conds ...gen.Condition) *fissionCampaignChatDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignChatDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignChatDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignChatDo) Order(conds ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignChatDo) Distinct(cols ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignChatDo) Omit(cols ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignChatDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignChatDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignChatDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignChatDo) Group(cols ...field.Expr) *fissionCampaignChatDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignChatDo) Having(conds ...gen.Condition) *fissionCampaignChatDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignChatDo) Limit(limit int) *fissionCampaignChatDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignChatDo) Offset(offset int) *fissionCampaignChatDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignChatDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignChatDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignChatDo) Unscoped() *fissionCampaignChatDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignChatDo) Create(values ...*model.FissionCampaignChat) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignChatDo) CreateInBatches(values []*model.FissionCampaignChat, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignChatDo) Save(values ...*model.FissionCampaignChat) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignChatDo) First() (*model.FissionCampaignChat, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChat), nil + } +} + +func (f fissionCampaignChatDo) Take() (*model.FissionCampaignChat, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChat), nil + } +} + +func (f fissionCampaignChatDo) Last() (*model.FissionCampaignChat, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChat), nil + } +} + +func (f fissionCampaignChatDo) Find() ([]*model.FissionCampaignChat, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignChat), err +} + +func (f fissionCampaignChatDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignChat, err error) { + buf := make([]*model.FissionCampaignChat, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignChatDo) FindInBatches(result *[]*model.FissionCampaignChat, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignChatDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignChatDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignChatDo) Assign(attrs ...field.AssignExpr) *fissionCampaignChatDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignChatDo) Joins(fields ...field.RelationField) *fissionCampaignChatDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignChatDo) Preload(fields ...field.RelationField) *fissionCampaignChatDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignChatDo) FirstOrInit() (*model.FissionCampaignChat, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChat), nil + } +} + +func (f fissionCampaignChatDo) FirstOrCreate() (*model.FissionCampaignChat, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChat), nil + } +} + +func (f fissionCampaignChatDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignChat, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignChatDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignChatDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignChatDo) Delete(models ...*model.FissionCampaignChat) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignChatDo) withDO(do gen.Dao) *fissionCampaignChatDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_child.gen.go b/internal/repository/dao/fission_campaign_child.gen.go new file mode 100644 index 0000000..8ced94e --- /dev/null +++ b/internal/repository/dao/fission_campaign_child.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignChild(db *gorm.DB, opts ...gen.DOOption) fissionCampaignChild { + _fissionCampaignChild := fissionCampaignChild{} + + _fissionCampaignChild.fissionCampaignChildDo.UseDB(db, opts...) + _fissionCampaignChild.fissionCampaignChildDo.UseModel(&model.FissionCampaignChild{}) + + tableName := _fissionCampaignChild.fissionCampaignChildDo.TableName() + _fissionCampaignChild.ALL = field.NewAsterisk(tableName) + _fissionCampaignChild.ID = field.NewInt64(tableName, "id") + _fissionCampaignChild.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignChild.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignChild.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignChild.ChildID = field.NewInt64(tableName, "child_id") + _fissionCampaignChild.Type = field.NewInt8(tableName, "type") + + _fissionCampaignChild.fillFieldMap() + + return _fissionCampaignChild +} + +type fissionCampaignChild struct { + fissionCampaignChildDo fissionCampaignChildDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + ChildID field.Int64 // 子活动id(fission_campaign表) + Type field.Int8 // 活动类型 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignChild) Table(newTableName string) *fissionCampaignChild { + f.fissionCampaignChildDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignChild) As(alias string) *fissionCampaignChild { + f.fissionCampaignChildDo.DO = *(f.fissionCampaignChildDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignChild) updateTableName(table string) *fissionCampaignChild { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ChildID = field.NewInt64(table, "child_id") + f.Type = field.NewInt8(table, "type") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignChild) WithContext(ctx context.Context) *fissionCampaignChildDo { + return f.fissionCampaignChildDo.WithContext(ctx) +} + +func (f fissionCampaignChild) TableName() string { return f.fissionCampaignChildDo.TableName() } + +func (f fissionCampaignChild) Alias() string { return f.fissionCampaignChildDo.Alias() } + +func (f *fissionCampaignChild) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignChild) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["child_id"] = f.ChildID + f.fieldMap["type"] = f.Type +} + +func (f fissionCampaignChild) clone(db *gorm.DB) fissionCampaignChild { + f.fissionCampaignChildDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignChild) replaceDB(db *gorm.DB) fissionCampaignChild { + f.fissionCampaignChildDo.ReplaceDB(db) + return f +} + +type fissionCampaignChildDo struct{ gen.DO } + +func (f fissionCampaignChildDo) Debug() *fissionCampaignChildDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignChildDo) WithContext(ctx context.Context) *fissionCampaignChildDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignChildDo) ReadDB() *fissionCampaignChildDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignChildDo) WriteDB() *fissionCampaignChildDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignChildDo) Session(config *gorm.Session) *fissionCampaignChildDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignChildDo) Clauses(conds ...clause.Expression) *fissionCampaignChildDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignChildDo) Returning(value interface{}, columns ...string) *fissionCampaignChildDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignChildDo) Not(conds ...gen.Condition) *fissionCampaignChildDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignChildDo) Or(conds ...gen.Condition) *fissionCampaignChildDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignChildDo) Select(conds ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignChildDo) Where(conds ...gen.Condition) *fissionCampaignChildDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignChildDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignChildDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignChildDo) Order(conds ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignChildDo) Distinct(cols ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignChildDo) Omit(cols ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignChildDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignChildDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignChildDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignChildDo) Group(cols ...field.Expr) *fissionCampaignChildDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignChildDo) Having(conds ...gen.Condition) *fissionCampaignChildDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignChildDo) Limit(limit int) *fissionCampaignChildDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignChildDo) Offset(offset int) *fissionCampaignChildDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignChildDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignChildDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignChildDo) Unscoped() *fissionCampaignChildDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignChildDo) Create(values ...*model.FissionCampaignChild) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignChildDo) CreateInBatches(values []*model.FissionCampaignChild, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignChildDo) Save(values ...*model.FissionCampaignChild) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignChildDo) First() (*model.FissionCampaignChild, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChild), nil + } +} + +func (f fissionCampaignChildDo) Take() (*model.FissionCampaignChild, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChild), nil + } +} + +func (f fissionCampaignChildDo) Last() (*model.FissionCampaignChild, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChild), nil + } +} + +func (f fissionCampaignChildDo) Find() ([]*model.FissionCampaignChild, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignChild), err +} + +func (f fissionCampaignChildDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignChild, err error) { + buf := make([]*model.FissionCampaignChild, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignChildDo) FindInBatches(result *[]*model.FissionCampaignChild, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignChildDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignChildDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignChildDo) Assign(attrs ...field.AssignExpr) *fissionCampaignChildDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignChildDo) Joins(fields ...field.RelationField) *fissionCampaignChildDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignChildDo) Preload(fields ...field.RelationField) *fissionCampaignChildDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignChildDo) FirstOrInit() (*model.FissionCampaignChild, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChild), nil + } +} + +func (f fissionCampaignChildDo) FirstOrCreate() (*model.FissionCampaignChild, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChild), nil + } +} + +func (f fissionCampaignChildDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignChild, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignChildDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignChildDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignChildDo) Delete(models ...*model.FissionCampaignChild) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignChildDo) withDO(do gen.Dao) *fissionCampaignChildDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_chop.gen.go b/internal/repository/dao/fission_campaign_chop.gen.go new file mode 100644 index 0000000..ac9f711 --- /dev/null +++ b/internal/repository/dao/fission_campaign_chop.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignChop(db *gorm.DB, opts ...gen.DOOption) fissionCampaignChop { + _fissionCampaignChop := fissionCampaignChop{} + + _fissionCampaignChop.fissionCampaignChopDo.UseDB(db, opts...) + _fissionCampaignChop.fissionCampaignChopDo.UseModel(&model.FissionCampaignChop{}) + + tableName := _fissionCampaignChop.fissionCampaignChopDo.TableName() + _fissionCampaignChop.ALL = field.NewAsterisk(tableName) + _fissionCampaignChop.ID = field.NewInt64(tableName, "id") + _fissionCampaignChop.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignChop.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignChop.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignChop.ShowBar = field.NewInt8(tableName, "show_bar") + _fissionCampaignChop.HelpRule = field.NewInt8(tableName, "help_rule") + + _fissionCampaignChop.fillFieldMap() + + return _fissionCampaignChop +} + +type fissionCampaignChop struct { + fissionCampaignChopDo fissionCampaignChopDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + ShowBar field.Int8 // 是否显示进度条(1-是,0-否) + HelpRule field.Int8 // 助力规则(1-助力行为奖品唯一,2-助力行为用户唯一) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignChop) Table(newTableName string) *fissionCampaignChop { + f.fissionCampaignChopDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignChop) As(alias string) *fissionCampaignChop { + f.fissionCampaignChopDo.DO = *(f.fissionCampaignChopDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignChop) updateTableName(table string) *fissionCampaignChop { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ShowBar = field.NewInt8(table, "show_bar") + f.HelpRule = field.NewInt8(table, "help_rule") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignChop) WithContext(ctx context.Context) *fissionCampaignChopDo { + return f.fissionCampaignChopDo.WithContext(ctx) +} + +func (f fissionCampaignChop) TableName() string { return f.fissionCampaignChopDo.TableName() } + +func (f fissionCampaignChop) Alias() string { return f.fissionCampaignChopDo.Alias() } + +func (f *fissionCampaignChop) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignChop) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["show_bar"] = f.ShowBar + f.fieldMap["help_rule"] = f.HelpRule +} + +func (f fissionCampaignChop) clone(db *gorm.DB) fissionCampaignChop { + f.fissionCampaignChopDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignChop) replaceDB(db *gorm.DB) fissionCampaignChop { + f.fissionCampaignChopDo.ReplaceDB(db) + return f +} + +type fissionCampaignChopDo struct{ gen.DO } + +func (f fissionCampaignChopDo) Debug() *fissionCampaignChopDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignChopDo) WithContext(ctx context.Context) *fissionCampaignChopDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignChopDo) ReadDB() *fissionCampaignChopDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignChopDo) WriteDB() *fissionCampaignChopDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignChopDo) Session(config *gorm.Session) *fissionCampaignChopDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignChopDo) Clauses(conds ...clause.Expression) *fissionCampaignChopDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignChopDo) Returning(value interface{}, columns ...string) *fissionCampaignChopDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignChopDo) Not(conds ...gen.Condition) *fissionCampaignChopDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignChopDo) Or(conds ...gen.Condition) *fissionCampaignChopDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignChopDo) Select(conds ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignChopDo) Where(conds ...gen.Condition) *fissionCampaignChopDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignChopDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignChopDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignChopDo) Order(conds ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignChopDo) Distinct(cols ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignChopDo) Omit(cols ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignChopDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignChopDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignChopDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignChopDo) Group(cols ...field.Expr) *fissionCampaignChopDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignChopDo) Having(conds ...gen.Condition) *fissionCampaignChopDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignChopDo) Limit(limit int) *fissionCampaignChopDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignChopDo) Offset(offset int) *fissionCampaignChopDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignChopDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignChopDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignChopDo) Unscoped() *fissionCampaignChopDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignChopDo) Create(values ...*model.FissionCampaignChop) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignChopDo) CreateInBatches(values []*model.FissionCampaignChop, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignChopDo) Save(values ...*model.FissionCampaignChop) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignChopDo) First() (*model.FissionCampaignChop, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChop), nil + } +} + +func (f fissionCampaignChopDo) Take() (*model.FissionCampaignChop, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChop), nil + } +} + +func (f fissionCampaignChopDo) Last() (*model.FissionCampaignChop, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChop), nil + } +} + +func (f fissionCampaignChopDo) Find() ([]*model.FissionCampaignChop, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignChop), err +} + +func (f fissionCampaignChopDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignChop, err error) { + buf := make([]*model.FissionCampaignChop, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignChopDo) FindInBatches(result *[]*model.FissionCampaignChop, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignChopDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignChopDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignChopDo) Assign(attrs ...field.AssignExpr) *fissionCampaignChopDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignChopDo) Joins(fields ...field.RelationField) *fissionCampaignChopDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignChopDo) Preload(fields ...field.RelationField) *fissionCampaignChopDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignChopDo) FirstOrInit() (*model.FissionCampaignChop, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChop), nil + } +} + +func (f fissionCampaignChopDo) FirstOrCreate() (*model.FissionCampaignChop, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignChop), nil + } +} + +func (f fissionCampaignChopDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignChop, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignChopDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignChopDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignChopDo) Delete(models ...*model.FissionCampaignChop) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignChopDo) withDO(do gen.Dao) *fissionCampaignChopDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_coin.gen.go b/internal/repository/dao/fission_campaign_coin.gen.go new file mode 100644 index 0000000..5b44f7b --- /dev/null +++ b/internal/repository/dao/fission_campaign_coin.gen.go @@ -0,0 +1,395 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignCoin(db *gorm.DB, opts ...gen.DOOption) fissionCampaignCoin { + _fissionCampaignCoin := fissionCampaignCoin{} + + _fissionCampaignCoin.fissionCampaignCoinDo.UseDB(db, opts...) + _fissionCampaignCoin.fissionCampaignCoinDo.UseModel(&model.FissionCampaignCoin{}) + + tableName := _fissionCampaignCoin.fissionCampaignCoinDo.TableName() + _fissionCampaignCoin.ALL = field.NewAsterisk(tableName) + _fissionCampaignCoin.ID = field.NewInt64(tableName, "id") + _fissionCampaignCoin.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignCoin.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignCoin.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignCoin.CoinImg = field.NewString(tableName, "coin_img") + _fissionCampaignCoin.OpenDays = field.NewInt32(tableName, "open_days") + _fissionCampaignCoin.OpenLimit = field.NewInt32(tableName, "open_limit") + _fissionCampaignCoin.InitCoin = field.NewInt32(tableName, "init_coin") + _fissionCampaignCoin.InitUse = field.NewInt32(tableName, "init_use") + _fissionCampaignCoin.UseCoin = field.NewInt32(tableName, "use_coin") + _fissionCampaignCoin.UseLimit = field.NewInt32(tableName, "use_limit") + _fissionCampaignCoin.URLID = field.NewInt64(tableName, "url_id") + _fissionCampaignCoin.LackBtn = field.NewString(tableName, "lack_btn") + _fissionCampaignCoin.CustomBtnText = field.NewString(tableName, "custom_btn_text") + _fissionCampaignCoin.CustomWebURL = field.NewString(tableName, "custom_web_url") + _fissionCampaignCoin.CustomExtraParam = field.NewString(tableName, "custom_extra_param") + _fissionCampaignCoin.CustomPcParam = field.NewString(tableName, "custom_pc_param") + + _fissionCampaignCoin.fillFieldMap() + + return _fissionCampaignCoin +} + +type fissionCampaignCoin struct { + fissionCampaignCoinDo fissionCampaignCoinDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + CoinImg field.String // 金币图片 + OpenDays field.Int32 // 开奖天数 + OpenLimit field.Int32 // 开奖次数限制 + InitCoin field.Int32 // 初始金币数 + InitUse field.Int32 // 初始投放次数 + UseCoin field.Int32 // 单次投放消耗金币数 + UseLimit field.Int32 // 单次瓜分最多投放次数 + URLID field.Int64 // 回调地址id + LackBtn field.String // 金币不足展示的按钮(1-做任务,2-自定义按钮) + CustomBtnText field.String // 自定义按钮文案 + CustomWebURL field.String // 自定义web端url + CustomExtraParam field.String // 自定义app附加参数 + CustomPcParam field.String // 自定义pc端附加参数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignCoin) Table(newTableName string) *fissionCampaignCoin { + f.fissionCampaignCoinDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignCoin) As(alias string) *fissionCampaignCoin { + f.fissionCampaignCoinDo.DO = *(f.fissionCampaignCoinDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignCoin) updateTableName(table string) *fissionCampaignCoin { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.CoinImg = field.NewString(table, "coin_img") + f.OpenDays = field.NewInt32(table, "open_days") + f.OpenLimit = field.NewInt32(table, "open_limit") + f.InitCoin = field.NewInt32(table, "init_coin") + f.InitUse = field.NewInt32(table, "init_use") + f.UseCoin = field.NewInt32(table, "use_coin") + f.UseLimit = field.NewInt32(table, "use_limit") + f.URLID = field.NewInt64(table, "url_id") + f.LackBtn = field.NewString(table, "lack_btn") + f.CustomBtnText = field.NewString(table, "custom_btn_text") + f.CustomWebURL = field.NewString(table, "custom_web_url") + f.CustomExtraParam = field.NewString(table, "custom_extra_param") + f.CustomPcParam = field.NewString(table, "custom_pc_param") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignCoin) WithContext(ctx context.Context) *fissionCampaignCoinDo { + return f.fissionCampaignCoinDo.WithContext(ctx) +} + +func (f fissionCampaignCoin) TableName() string { return f.fissionCampaignCoinDo.TableName() } + +func (f fissionCampaignCoin) Alias() string { return f.fissionCampaignCoinDo.Alias() } + +func (f *fissionCampaignCoin) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignCoin) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 17) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["coin_img"] = f.CoinImg + f.fieldMap["open_days"] = f.OpenDays + f.fieldMap["open_limit"] = f.OpenLimit + f.fieldMap["init_coin"] = f.InitCoin + f.fieldMap["init_use"] = f.InitUse + f.fieldMap["use_coin"] = f.UseCoin + f.fieldMap["use_limit"] = f.UseLimit + f.fieldMap["url_id"] = f.URLID + f.fieldMap["lack_btn"] = f.LackBtn + f.fieldMap["custom_btn_text"] = f.CustomBtnText + f.fieldMap["custom_web_url"] = f.CustomWebURL + f.fieldMap["custom_extra_param"] = f.CustomExtraParam + f.fieldMap["custom_pc_param"] = f.CustomPcParam +} + +func (f fissionCampaignCoin) clone(db *gorm.DB) fissionCampaignCoin { + f.fissionCampaignCoinDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignCoin) replaceDB(db *gorm.DB) fissionCampaignCoin { + f.fissionCampaignCoinDo.ReplaceDB(db) + return f +} + +type fissionCampaignCoinDo struct{ gen.DO } + +func (f fissionCampaignCoinDo) Debug() *fissionCampaignCoinDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignCoinDo) WithContext(ctx context.Context) *fissionCampaignCoinDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignCoinDo) ReadDB() *fissionCampaignCoinDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignCoinDo) WriteDB() *fissionCampaignCoinDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignCoinDo) Session(config *gorm.Session) *fissionCampaignCoinDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignCoinDo) Clauses(conds ...clause.Expression) *fissionCampaignCoinDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignCoinDo) Returning(value interface{}, columns ...string) *fissionCampaignCoinDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignCoinDo) Not(conds ...gen.Condition) *fissionCampaignCoinDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignCoinDo) Or(conds ...gen.Condition) *fissionCampaignCoinDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignCoinDo) Select(conds ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignCoinDo) Where(conds ...gen.Condition) *fissionCampaignCoinDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignCoinDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignCoinDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignCoinDo) Order(conds ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignCoinDo) Distinct(cols ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignCoinDo) Omit(cols ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignCoinDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignCoinDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignCoinDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignCoinDo) Group(cols ...field.Expr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignCoinDo) Having(conds ...gen.Condition) *fissionCampaignCoinDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignCoinDo) Limit(limit int) *fissionCampaignCoinDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignCoinDo) Offset(offset int) *fissionCampaignCoinDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignCoinDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignCoinDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignCoinDo) Unscoped() *fissionCampaignCoinDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignCoinDo) Create(values ...*model.FissionCampaignCoin) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignCoinDo) CreateInBatches(values []*model.FissionCampaignCoin, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignCoinDo) Save(values ...*model.FissionCampaignCoin) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignCoinDo) First() (*model.FissionCampaignCoin, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCoin), nil + } +} + +func (f fissionCampaignCoinDo) Take() (*model.FissionCampaignCoin, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCoin), nil + } +} + +func (f fissionCampaignCoinDo) Last() (*model.FissionCampaignCoin, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCoin), nil + } +} + +func (f fissionCampaignCoinDo) Find() ([]*model.FissionCampaignCoin, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignCoin), err +} + +func (f fissionCampaignCoinDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignCoin, err error) { + buf := make([]*model.FissionCampaignCoin, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignCoinDo) FindInBatches(result *[]*model.FissionCampaignCoin, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignCoinDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignCoinDo) Assign(attrs ...field.AssignExpr) *fissionCampaignCoinDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignCoinDo) Joins(fields ...field.RelationField) *fissionCampaignCoinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignCoinDo) Preload(fields ...field.RelationField) *fissionCampaignCoinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignCoinDo) FirstOrInit() (*model.FissionCampaignCoin, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCoin), nil + } +} + +func (f fissionCampaignCoinDo) FirstOrCreate() (*model.FissionCampaignCoin, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCoin), nil + } +} + +func (f fissionCampaignCoinDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignCoin, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignCoinDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignCoinDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignCoinDo) Delete(models ...*model.FissionCampaignCoin) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignCoinDo) withDO(do gen.Dao) *fissionCampaignCoinDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_cond.gen.go b/internal/repository/dao/fission_campaign_cond.gen.go new file mode 100644 index 0000000..2ef1eaf --- /dev/null +++ b/internal/repository/dao/fission_campaign_cond.gen.go @@ -0,0 +1,463 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignCond(db *gorm.DB, opts ...gen.DOOption) fissionCampaignCond { + _fissionCampaignCond := fissionCampaignCond{} + + _fissionCampaignCond.fissionCampaignCondDo.UseDB(db, opts...) + _fissionCampaignCond.fissionCampaignCondDo.UseModel(&model.FissionCampaignCond{}) + + tableName := _fissionCampaignCond.fissionCampaignCondDo.TableName() + _fissionCampaignCond.ALL = field.NewAsterisk(tableName) + _fissionCampaignCond.ID = field.NewInt64(tableName, "id") + _fissionCampaignCond.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignCond.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignCond.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignCond.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignCond.ProjectID = field.NewInt64(tableName, "project_id") + _fissionCampaignCond.Event = field.NewString(tableName, "event") + _fissionCampaignCond.EventKey = field.NewString(tableName, "event_key") + _fissionCampaignCond.EventVal = field.NewString(tableName, "event_val") + _fissionCampaignCond.Desc = field.NewString(tableName, "desc") + _fissionCampaignCond.IfCond = field.NewInt8(tableName, "if_cond") + _fissionCampaignCond.Num = field.NewInt64(tableName, "num") + _fissionCampaignCond.UserNum = field.NewInt64(tableName, "user_num") + _fissionCampaignCond.Total = field.NewFloat64(tableName, "total") + _fissionCampaignCond.TriggetType = field.NewInt8(tableName, "trigget_type") + _fissionCampaignCond.DelUse = field.NewInt8(tableName, "del_use") + _fissionCampaignCond.EventType = field.NewInt8(tableName, "event_type") + _fissionCampaignCond.ViewType = field.NewInt8(tableName, "view_type") + _fissionCampaignCond.WatchSec = field.NewInt32(tableName, "watch_sec") + _fissionCampaignCond.OpenJump = field.NewInt8(tableName, "open_jump") + _fissionCampaignCond.WebURL = field.NewString(tableName, "web_url") + _fissionCampaignCond.ExtraParam = field.NewString(tableName, "extra_param") + _fissionCampaignCond.PcParam = field.NewString(tableName, "pc_param") + _fissionCampaignCond.GoShow = field.NewInt8(tableName, "go_show") + _fissionCampaignCond.AdsStrategyID = field.NewString(tableName, "ads_strategy_id") + _fissionCampaignCond.IsSuper = field.NewInt8(tableName, "is_super") + _fissionCampaignCond.Sort = field.NewInt32(tableName, "sort") + _fissionCampaignCond.OpenPush = field.NewInt8(tableName, "open_push") + _fissionCampaignCond.GoText = field.NewString(tableName, "go_text") + _fissionCampaignCond.ClickEffectOpen = field.NewInt8(tableName, "click_effect_open") + _fissionCampaignCond.ClickEffect = field.NewInt32(tableName, "click_effect") + _fissionCampaignCond.ClickEffectUnit = field.NewString(tableName, "click_effect_unit") + _fissionCampaignCond.PullInvite = field.NewInt8(tableName, "pull_invite") + _fissionCampaignCond.RewardID = field.NewInt64(tableName, "reward_id") + + _fissionCampaignCond.fillFieldMap() + + return _fissionCampaignCond +} + +type fissionCampaignCond struct { + fissionCampaignCondDo fissionCampaignCondDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID(fission_campaign表) + ProjectID field.Int64 // 项目id(project表) + Event field.String // 事件关键字 + EventKey field.String // 事件key + EventVal field.String // 事件值 + Desc field.String // 条件描述 + IfCond field.Int8 // 等式(0-等于,1-大于等于,2-累计) + Num field.Int64 // 触发次数 + UserNum field.Int64 // 触发人数 + Total field.Float64 // 值累计总数,仅当累计等式有值 + TriggetType field.Int8 // 事件触发条件(1-点击去完成按钮,2-全局监听) + DelUse field.Int8 // 下线后使用数据(0-否,1-是) + EventType field.Int8 // 事件类型(1-自定义事件,2-广告事件,3-标准时间,4-活动时间) + ViewType field.Int8 // 观看广告路径 + WatchSec field.Int32 // 观看秒数 + OpenJump field.Int8 // 事件跳转(0-否,1-是) + WebURL field.String // web端url长度 + ExtraParam field.String // 附加参数 + PcParam field.String // pc端附加参数 + GoShow field.Int8 // 是否显示“去完成”按钮(0-否,1-是) + AdsStrategyID field.String // 策略id + IsSuper field.Int8 // 是否超级任务(0-否,1-是) + Sort field.Int32 // 排序 + OpenPush field.Int8 // 是否开启完成推送(0-否,1-是) + GoText field.String // 去完成按钮文案 + ClickEffectOpen field.Int8 // 开启点击有效(0-关,1开) + ClickEffect field.Int32 // 点击有效值 + ClickEffectUnit field.String // 点击有效单位(min-分钟,hour-小时,day-天) + PullInvite field.Int8 // 是否拉起邀新(0-否,1-是) + RewardID field.Int64 // 奖品id + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignCond) Table(newTableName string) *fissionCampaignCond { + f.fissionCampaignCondDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignCond) As(alias string) *fissionCampaignCond { + f.fissionCampaignCondDo.DO = *(f.fissionCampaignCondDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignCond) updateTableName(table string) *fissionCampaignCond { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ProjectID = field.NewInt64(table, "project_id") + f.Event = field.NewString(table, "event") + f.EventKey = field.NewString(table, "event_key") + f.EventVal = field.NewString(table, "event_val") + f.Desc = field.NewString(table, "desc") + f.IfCond = field.NewInt8(table, "if_cond") + f.Num = field.NewInt64(table, "num") + f.UserNum = field.NewInt64(table, "user_num") + f.Total = field.NewFloat64(table, "total") + f.TriggetType = field.NewInt8(table, "trigget_type") + f.DelUse = field.NewInt8(table, "del_use") + f.EventType = field.NewInt8(table, "event_type") + f.ViewType = field.NewInt8(table, "view_type") + f.WatchSec = field.NewInt32(table, "watch_sec") + f.OpenJump = field.NewInt8(table, "open_jump") + f.WebURL = field.NewString(table, "web_url") + f.ExtraParam = field.NewString(table, "extra_param") + f.PcParam = field.NewString(table, "pc_param") + f.GoShow = field.NewInt8(table, "go_show") + f.AdsStrategyID = field.NewString(table, "ads_strategy_id") + f.IsSuper = field.NewInt8(table, "is_super") + f.Sort = field.NewInt32(table, "sort") + f.OpenPush = field.NewInt8(table, "open_push") + f.GoText = field.NewString(table, "go_text") + f.ClickEffectOpen = field.NewInt8(table, "click_effect_open") + f.ClickEffect = field.NewInt32(table, "click_effect") + f.ClickEffectUnit = field.NewString(table, "click_effect_unit") + f.PullInvite = field.NewInt8(table, "pull_invite") + f.RewardID = field.NewInt64(table, "reward_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignCond) WithContext(ctx context.Context) *fissionCampaignCondDo { + return f.fissionCampaignCondDo.WithContext(ctx) +} + +func (f fissionCampaignCond) TableName() string { return f.fissionCampaignCondDo.TableName() } + +func (f fissionCampaignCond) Alias() string { return f.fissionCampaignCondDo.Alias() } + +func (f *fissionCampaignCond) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignCond) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 34) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["project_id"] = f.ProjectID + f.fieldMap["event"] = f.Event + f.fieldMap["event_key"] = f.EventKey + f.fieldMap["event_val"] = f.EventVal + f.fieldMap["desc"] = f.Desc + f.fieldMap["if_cond"] = f.IfCond + f.fieldMap["num"] = f.Num + f.fieldMap["user_num"] = f.UserNum + f.fieldMap["total"] = f.Total + f.fieldMap["trigget_type"] = f.TriggetType + f.fieldMap["del_use"] = f.DelUse + f.fieldMap["event_type"] = f.EventType + f.fieldMap["view_type"] = f.ViewType + f.fieldMap["watch_sec"] = f.WatchSec + f.fieldMap["open_jump"] = f.OpenJump + f.fieldMap["web_url"] = f.WebURL + f.fieldMap["extra_param"] = f.ExtraParam + f.fieldMap["pc_param"] = f.PcParam + f.fieldMap["go_show"] = f.GoShow + f.fieldMap["ads_strategy_id"] = f.AdsStrategyID + f.fieldMap["is_super"] = f.IsSuper + f.fieldMap["sort"] = f.Sort + f.fieldMap["open_push"] = f.OpenPush + f.fieldMap["go_text"] = f.GoText + f.fieldMap["click_effect_open"] = f.ClickEffectOpen + f.fieldMap["click_effect"] = f.ClickEffect + f.fieldMap["click_effect_unit"] = f.ClickEffectUnit + f.fieldMap["pull_invite"] = f.PullInvite + f.fieldMap["reward_id"] = f.RewardID +} + +func (f fissionCampaignCond) clone(db *gorm.DB) fissionCampaignCond { + f.fissionCampaignCondDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignCond) replaceDB(db *gorm.DB) fissionCampaignCond { + f.fissionCampaignCondDo.ReplaceDB(db) + return f +} + +type fissionCampaignCondDo struct{ gen.DO } + +func (f fissionCampaignCondDo) Debug() *fissionCampaignCondDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignCondDo) WithContext(ctx context.Context) *fissionCampaignCondDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignCondDo) ReadDB() *fissionCampaignCondDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignCondDo) WriteDB() *fissionCampaignCondDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignCondDo) Session(config *gorm.Session) *fissionCampaignCondDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignCondDo) Clauses(conds ...clause.Expression) *fissionCampaignCondDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignCondDo) Returning(value interface{}, columns ...string) *fissionCampaignCondDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignCondDo) Not(conds ...gen.Condition) *fissionCampaignCondDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignCondDo) Or(conds ...gen.Condition) *fissionCampaignCondDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignCondDo) Select(conds ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignCondDo) Where(conds ...gen.Condition) *fissionCampaignCondDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignCondDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignCondDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignCondDo) Order(conds ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignCondDo) Distinct(cols ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignCondDo) Omit(cols ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignCondDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignCondDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignCondDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignCondDo) Group(cols ...field.Expr) *fissionCampaignCondDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignCondDo) Having(conds ...gen.Condition) *fissionCampaignCondDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignCondDo) Limit(limit int) *fissionCampaignCondDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignCondDo) Offset(offset int) *fissionCampaignCondDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignCondDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignCondDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignCondDo) Unscoped() *fissionCampaignCondDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignCondDo) Create(values ...*model.FissionCampaignCond) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignCondDo) CreateInBatches(values []*model.FissionCampaignCond, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignCondDo) Save(values ...*model.FissionCampaignCond) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignCondDo) First() (*model.FissionCampaignCond, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCond), nil + } +} + +func (f fissionCampaignCondDo) Take() (*model.FissionCampaignCond, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCond), nil + } +} + +func (f fissionCampaignCondDo) Last() (*model.FissionCampaignCond, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCond), nil + } +} + +func (f fissionCampaignCondDo) Find() ([]*model.FissionCampaignCond, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignCond), err +} + +func (f fissionCampaignCondDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignCond, err error) { + buf := make([]*model.FissionCampaignCond, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignCondDo) FindInBatches(result *[]*model.FissionCampaignCond, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignCondDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignCondDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignCondDo) Assign(attrs ...field.AssignExpr) *fissionCampaignCondDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignCondDo) Joins(fields ...field.RelationField) *fissionCampaignCondDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignCondDo) Preload(fields ...field.RelationField) *fissionCampaignCondDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignCondDo) FirstOrInit() (*model.FissionCampaignCond, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCond), nil + } +} + +func (f fissionCampaignCondDo) FirstOrCreate() (*model.FissionCampaignCond, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignCond), nil + } +} + +func (f fissionCampaignCondDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignCond, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignCondDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignCondDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignCondDo) Delete(models ...*model.FissionCampaignCond) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignCondDo) withDO(do gen.Dao) *fissionCampaignCondDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_config.gen.go b/internal/repository/dao/fission_campaign_config.gen.go new file mode 100644 index 0000000..5943df3 --- /dev/null +++ b/internal/repository/dao/fission_campaign_config.gen.go @@ -0,0 +1,611 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignConfig(db *gorm.DB, opts ...gen.DOOption) fissionCampaignConfig { + _fissionCampaignConfig := fissionCampaignConfig{} + + _fissionCampaignConfig.fissionCampaignConfigDo.UseDB(db, opts...) + _fissionCampaignConfig.fissionCampaignConfigDo.UseModel(&model.FissionCampaignConfig{}) + + tableName := _fissionCampaignConfig.fissionCampaignConfigDo.TableName() + _fissionCampaignConfig.ALL = field.NewAsterisk(tableName) + _fissionCampaignConfig.ID = field.NewInt64(tableName, "id") + _fissionCampaignConfig.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignConfig.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignConfig.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignConfig.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignConfig.RuleTextColor = field.NewString(tableName, "rule_text_color") + _fissionCampaignConfig.RuleBgColor = field.NewString(tableName, "rule_bg_color") + _fissionCampaignConfig.RuleTimeOpen = field.NewInt8(tableName, "rule_time_open") + _fissionCampaignConfig.ShareText = field.NewString(tableName, "share_text") + _fissionCampaignConfig.ShareImg = field.NewString(tableName, "share_img") + _fissionCampaignConfig.HasRank = field.NewInt8(tableName, "has_rank") + _fissionCampaignConfig.RankBackgroundColor = field.NewString(tableName, "rank_background_color") + _fissionCampaignConfig.RankTextColor = field.NewString(tableName, "rank_text_color") + _fissionCampaignConfig.DownloadPageImage = field.NewString(tableName, "download_page_image") + _fissionCampaignConfig.IsDefaultDownload = field.NewInt8(tableName, "is_default_download") + _fissionCampaignConfig.WechatPageImage = field.NewString(tableName, "wechat_page_image") + _fissionCampaignConfig.IsDefaultWechat = field.NewInt8(tableName, "is_default_wechat") + _fissionCampaignConfig.ImageMain = field.NewString(tableName, "image_main") + _fissionCampaignConfig.IsDefaultMain = field.NewInt8(tableName, "is_default_main") + _fissionCampaignConfig.ImagePreview = field.NewString(tableName, "image_preview") + _fissionCampaignConfig.LinkBtnTextColor = field.NewString(tableName, "link_btn_text_color") + _fissionCampaignConfig.LinkBtnBgColor = field.NewString(tableName, "link_btn_bg_color") + _fissionCampaignConfig.LinkTextColor = field.NewString(tableName, "link_text_color") + _fissionCampaignConfig.OpenShare = field.NewInt8(tableName, "open_share") + _fissionCampaignConfig.ShowShare = field.NewInt8(tableName, "show_share") + _fissionCampaignConfig.Share = field.NewString(tableName, "share") + _fissionCampaignConfig.CampaignData = field.NewString(tableName, "campaign_data") + _fissionCampaignConfig.PageTitle = field.NewString(tableName, "page_title") + _fissionCampaignConfig.DmShow = field.NewInt8(tableName, "dm_show") + _fissionCampaignConfig.HasWeb = field.NewInt8(tableName, "has_web") + _fissionCampaignConfig.WebBgImg = field.NewString(tableName, "web_bg_img") + _fissionCampaignConfig.HasWarmUp = field.NewInt8(tableName, "has_warm_up") + _fissionCampaignConfig.WarmUpImg = field.NewString(tableName, "warm_up_img") + _fissionCampaignConfig.WarmUpEnd = field.NewInt32(tableName, "warm_up_end") + _fissionCampaignConfig.Target = field.NewInt8(tableName, "target") + _fissionCampaignConfig.Option = field.NewInt8(tableName, "option") + _fissionCampaignConfig.AppEvent = field.NewInt8(tableName, "app_event") + _fissionCampaignConfig.BothType = field.NewInt8(tableName, "both_type") + _fissionCampaignConfig.IconType = field.NewInt8(tableName, "icon_type") + _fissionCampaignConfig.IconBgColor = field.NewString(tableName, "icon_bg_color") + _fissionCampaignConfig.DlType = field.NewInt8(tableName, "dl_type") + _fissionCampaignConfig.DlBannerType = field.NewInt8(tableName, "dl_banner_type") + _fissionCampaignConfig.DlBannerImg = field.NewString(tableName, "dl_banner_img") + _fissionCampaignConfig.DlBannerAppLogo = field.NewString(tableName, "dl_banner_app_logo") + _fissionCampaignConfig.DlBannerAppName = field.NewString(tableName, "dl_banner_app_name") + _fissionCampaignConfig.DlBannerAppBtn = field.NewString(tableName, "dl_banner_app_btn") + _fissionCampaignConfig.DlBannerPosition = field.NewInt8(tableName, "dl_banner_position") + _fissionCampaignConfig.TopicColor = field.NewString(tableName, "topic_color") + _fissionCampaignConfig.WindowCover = field.NewInt8(tableName, "window_cover") + _fissionCampaignConfig.RewardGroup = field.NewInt8(tableName, "reward_group") + _fissionCampaignConfig.SupportRewardMark = field.NewString(tableName, "support_reward_mark") + _fissionCampaignConfig.DefaultRewardMark = field.NewString(tableName, "default_reward_mark") + _fissionCampaignConfig.PlayRule = field.NewString(tableName, "play_rule") + _fissionCampaignConfig.IconOpen = field.NewString(tableName, "icon_open") + _fissionCampaignConfig.HasLongImg = field.NewInt8(tableName, "has_long_img") + _fissionCampaignConfig.HasWhite = field.NewInt8(tableName, "has_white") + _fissionCampaignConfig.WhiteList = field.NewString(tableName, "white_list") + _fissionCampaignConfig.PcBg = field.NewString(tableName, "pc_bg") + _fissionCampaignConfig.AdsType = field.NewInt8(tableName, "ads_type") + _fissionCampaignConfig.Countdown = field.NewInt32(tableName, "countdown") + _fissionCampaignConfig.PlayType = field.NewInt8(tableName, "play_type") + _fissionCampaignConfig.PointsUse = field.NewInt8(tableName, "points_use") + _fissionCampaignConfig.LinkTempID = field.NewString(tableName, "link_temp_id") + _fissionCampaignConfig.OutsideTask = field.NewInt8(tableName, "outside_task") + _fissionCampaignConfig.ShowToUse = field.NewInt8(tableName, "show_to_use") + _fissionCampaignConfig.OpenChat = field.NewInt8(tableName, "open_chat") + _fissionCampaignConfig.RuleType = field.NewInt8(tableName, "rule_type") + _fissionCampaignConfig.RuleOutside = field.NewInt8(tableName, "rule_outside") + _fissionCampaignConfig.DeviceOnce = field.NewInt8(tableName, "device_once") + + _fissionCampaignConfig.fillFieldMap() + + return _fissionCampaignConfig +} + +type fissionCampaignConfig struct { + fissionCampaignConfigDo fissionCampaignConfigDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID(fission_campaign表) + RuleTextColor field.String // 规则文字颜色 + RuleBgColor field.String // 规则背景颜色 + RuleTimeOpen field.Int8 // 是否展示规则中的活动时间 + ShareText field.String // 分享文案 + ShareImg field.String // 分享图片 + HasRank field.Int8 // 是否显示排行榜(1-是,0-否) + RankBackgroundColor field.String // 排行榜背景颜色 + RankTextColor field.String // 排行榜字体颜色 + DownloadPageImage field.String // 下载引导页的图片 + IsDefaultDownload field.Int8 // 是否使用默认下载图(0-否,1-是) + WechatPageImage field.String // 微信引导页的图片 + IsDefaultWechat field.Int8 // 是否使用默认微信引导图(0-否,1-是) + ImageMain field.String // 活动主图 + IsDefaultMain field.Int8 // 是否使用默认主图(0-否,1-是) + ImagePreview field.String // 预览页图 + LinkBtnTextColor field.String // 分享链接按钮文字颜色 + LinkBtnBgColor field.String // 分享链接按钮背景颜色 + LinkTextColor field.String // 分享链接文字颜色 + OpenShare field.Int8 // 是否开启分享模块 + ShowShare field.Int8 // 是否显示分享社交媒体(0-否,1-是) + Share field.String // 要分享的社交媒体,例如[1,2,3] + CampaignData field.String // 前端组件位置偏移数据 + PageTitle field.String // 页面标题 + DmShow field.Int8 // 是否显示弹幕(0-否,1-是) + HasWeb field.Int8 // 是否有站外活动(0-否,1-是) + WebBgImg field.String // 站外背景图地址 + HasWarmUp field.Int8 // 是否开启预热(0-否,1-是) + WarmUpImg field.String // 预热海报图 + WarmUpEnd field.Int32 // 活动开始前多少分钟结束预热 + Target field.Int8 // 活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Option field.Int8 // 标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗) + /* + 目标选择类型为1(option=1)的选项(1-安装;2-注册) + + */ + AppEvent field.Int8 + /* + 满足条件(1-所有条件满足,2-任一条件满足) + + */ + BothType field.Int8 + IconType field.Int8 // 活动挂件类型(用于前端挂件选用判断) + IconBgColor field.String // 活动挂件背景色 + DlType field.Int8 // 下载引导页类型(1-通用,2-自定义多媒体) + DlBannerType field.Int8 // 下载页横幅类型(1-默认,2-自定义) + DlBannerImg field.String // 下载页横幅自定义图 + DlBannerAppLogo field.String // 下载页横幅applogo图片 + DlBannerAppName field.String // 下载页横幅app名称 + DlBannerAppBtn field.String // 下载页横幅app按钮文案 + DlBannerPosition field.Int8 // 下载页横幅位置(1-顶部,2-底部) + TopicColor field.String // 主题颜色 + WindowCover field.Int8 // 是否开启全屏封面(0-关闭,1-开启) + RewardGroup field.Int8 // 奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品) + SupportRewardMark field.String // 支持使用的奖品标识 + DefaultRewardMark field.String // 默认使用奖品标识 + PlayRule field.String + IconOpen field.String // 开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友) + HasLongImg field.Int8 // 是否支持长图(0-否,1-是) + HasWhite field.Int8 // 是否开启白名单 + WhiteList field.String // 白名单列表 + PcBg field.String // Pc适配背景图 + AdsType field.Int8 // 广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + Countdown field.Int32 // 开奖倒计时 + PlayType field.Int8 // 玩法类型,根据不同子活动有不同意义 + PointsUse field.Int8 // 开启积分使用(0-否,1-是) + LinkTempID field.String // 模版id + OutsideTask field.Int8 // 是否外显任务(0-否,1-是) + ShowToUse field.Int8 // 是否展示奖品弹窗的去使用(0-不展示,1-展示) + OpenChat field.Int8 // 是否开启ai聊天 + RuleType field.Int8 // 规则展示类型(0-文本,1-图片) + RuleOutside field.Int8 // 规则是否外显(0-否,1-是) + DeviceOnce field.Int8 // 设备唯一 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignConfig) Table(newTableName string) *fissionCampaignConfig { + f.fissionCampaignConfigDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignConfig) As(alias string) *fissionCampaignConfig { + f.fissionCampaignConfigDo.DO = *(f.fissionCampaignConfigDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignConfig) updateTableName(table string) *fissionCampaignConfig { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RuleTextColor = field.NewString(table, "rule_text_color") + f.RuleBgColor = field.NewString(table, "rule_bg_color") + f.RuleTimeOpen = field.NewInt8(table, "rule_time_open") + f.ShareText = field.NewString(table, "share_text") + f.ShareImg = field.NewString(table, "share_img") + f.HasRank = field.NewInt8(table, "has_rank") + f.RankBackgroundColor = field.NewString(table, "rank_background_color") + f.RankTextColor = field.NewString(table, "rank_text_color") + f.DownloadPageImage = field.NewString(table, "download_page_image") + f.IsDefaultDownload = field.NewInt8(table, "is_default_download") + f.WechatPageImage = field.NewString(table, "wechat_page_image") + f.IsDefaultWechat = field.NewInt8(table, "is_default_wechat") + f.ImageMain = field.NewString(table, "image_main") + f.IsDefaultMain = field.NewInt8(table, "is_default_main") + f.ImagePreview = field.NewString(table, "image_preview") + f.LinkBtnTextColor = field.NewString(table, "link_btn_text_color") + f.LinkBtnBgColor = field.NewString(table, "link_btn_bg_color") + f.LinkTextColor = field.NewString(table, "link_text_color") + f.OpenShare = field.NewInt8(table, "open_share") + f.ShowShare = field.NewInt8(table, "show_share") + f.Share = field.NewString(table, "share") + f.CampaignData = field.NewString(table, "campaign_data") + f.PageTitle = field.NewString(table, "page_title") + f.DmShow = field.NewInt8(table, "dm_show") + f.HasWeb = field.NewInt8(table, "has_web") + f.WebBgImg = field.NewString(table, "web_bg_img") + f.HasWarmUp = field.NewInt8(table, "has_warm_up") + f.WarmUpImg = field.NewString(table, "warm_up_img") + f.WarmUpEnd = field.NewInt32(table, "warm_up_end") + f.Target = field.NewInt8(table, "target") + f.Option = field.NewInt8(table, "option") + f.AppEvent = field.NewInt8(table, "app_event") + f.BothType = field.NewInt8(table, "both_type") + f.IconType = field.NewInt8(table, "icon_type") + f.IconBgColor = field.NewString(table, "icon_bg_color") + f.DlType = field.NewInt8(table, "dl_type") + f.DlBannerType = field.NewInt8(table, "dl_banner_type") + f.DlBannerImg = field.NewString(table, "dl_banner_img") + f.DlBannerAppLogo = field.NewString(table, "dl_banner_app_logo") + f.DlBannerAppName = field.NewString(table, "dl_banner_app_name") + f.DlBannerAppBtn = field.NewString(table, "dl_banner_app_btn") + f.DlBannerPosition = field.NewInt8(table, "dl_banner_position") + f.TopicColor = field.NewString(table, "topic_color") + f.WindowCover = field.NewInt8(table, "window_cover") + f.RewardGroup = field.NewInt8(table, "reward_group") + f.SupportRewardMark = field.NewString(table, "support_reward_mark") + f.DefaultRewardMark = field.NewString(table, "default_reward_mark") + f.PlayRule = field.NewString(table, "play_rule") + f.IconOpen = field.NewString(table, "icon_open") + f.HasLongImg = field.NewInt8(table, "has_long_img") + f.HasWhite = field.NewInt8(table, "has_white") + f.WhiteList = field.NewString(table, "white_list") + f.PcBg = field.NewString(table, "pc_bg") + f.AdsType = field.NewInt8(table, "ads_type") + f.Countdown = field.NewInt32(table, "countdown") + f.PlayType = field.NewInt8(table, "play_type") + f.PointsUse = field.NewInt8(table, "points_use") + f.LinkTempID = field.NewString(table, "link_temp_id") + f.OutsideTask = field.NewInt8(table, "outside_task") + f.ShowToUse = field.NewInt8(table, "show_to_use") + f.OpenChat = field.NewInt8(table, "open_chat") + f.RuleType = field.NewInt8(table, "rule_type") + f.RuleOutside = field.NewInt8(table, "rule_outside") + f.DeviceOnce = field.NewInt8(table, "device_once") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignConfig) WithContext(ctx context.Context) *fissionCampaignConfigDo { + return f.fissionCampaignConfigDo.WithContext(ctx) +} + +func (f fissionCampaignConfig) TableName() string { return f.fissionCampaignConfigDo.TableName() } + +func (f fissionCampaignConfig) Alias() string { return f.fissionCampaignConfigDo.Alias() } + +func (f *fissionCampaignConfig) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignConfig) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 69) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["rule_text_color"] = f.RuleTextColor + f.fieldMap["rule_bg_color"] = f.RuleBgColor + f.fieldMap["rule_time_open"] = f.RuleTimeOpen + f.fieldMap["share_text"] = f.ShareText + f.fieldMap["share_img"] = f.ShareImg + f.fieldMap["has_rank"] = f.HasRank + f.fieldMap["rank_background_color"] = f.RankBackgroundColor + f.fieldMap["rank_text_color"] = f.RankTextColor + f.fieldMap["download_page_image"] = f.DownloadPageImage + f.fieldMap["is_default_download"] = f.IsDefaultDownload + f.fieldMap["wechat_page_image"] = f.WechatPageImage + f.fieldMap["is_default_wechat"] = f.IsDefaultWechat + f.fieldMap["image_main"] = f.ImageMain + f.fieldMap["is_default_main"] = f.IsDefaultMain + f.fieldMap["image_preview"] = f.ImagePreview + f.fieldMap["link_btn_text_color"] = f.LinkBtnTextColor + f.fieldMap["link_btn_bg_color"] = f.LinkBtnBgColor + f.fieldMap["link_text_color"] = f.LinkTextColor + f.fieldMap["open_share"] = f.OpenShare + f.fieldMap["show_share"] = f.ShowShare + f.fieldMap["share"] = f.Share + f.fieldMap["campaign_data"] = f.CampaignData + f.fieldMap["page_title"] = f.PageTitle + f.fieldMap["dm_show"] = f.DmShow + f.fieldMap["has_web"] = f.HasWeb + f.fieldMap["web_bg_img"] = f.WebBgImg + f.fieldMap["has_warm_up"] = f.HasWarmUp + f.fieldMap["warm_up_img"] = f.WarmUpImg + f.fieldMap["warm_up_end"] = f.WarmUpEnd + f.fieldMap["target"] = f.Target + f.fieldMap["option"] = f.Option + f.fieldMap["app_event"] = f.AppEvent + f.fieldMap["both_type"] = f.BothType + f.fieldMap["icon_type"] = f.IconType + f.fieldMap["icon_bg_color"] = f.IconBgColor + f.fieldMap["dl_type"] = f.DlType + f.fieldMap["dl_banner_type"] = f.DlBannerType + f.fieldMap["dl_banner_img"] = f.DlBannerImg + f.fieldMap["dl_banner_app_logo"] = f.DlBannerAppLogo + f.fieldMap["dl_banner_app_name"] = f.DlBannerAppName + f.fieldMap["dl_banner_app_btn"] = f.DlBannerAppBtn + f.fieldMap["dl_banner_position"] = f.DlBannerPosition + f.fieldMap["topic_color"] = f.TopicColor + f.fieldMap["window_cover"] = f.WindowCover + f.fieldMap["reward_group"] = f.RewardGroup + f.fieldMap["support_reward_mark"] = f.SupportRewardMark + f.fieldMap["default_reward_mark"] = f.DefaultRewardMark + f.fieldMap["play_rule"] = f.PlayRule + f.fieldMap["icon_open"] = f.IconOpen + f.fieldMap["has_long_img"] = f.HasLongImg + f.fieldMap["has_white"] = f.HasWhite + f.fieldMap["white_list"] = f.WhiteList + f.fieldMap["pc_bg"] = f.PcBg + f.fieldMap["ads_type"] = f.AdsType + f.fieldMap["countdown"] = f.Countdown + f.fieldMap["play_type"] = f.PlayType + f.fieldMap["points_use"] = f.PointsUse + f.fieldMap["link_temp_id"] = f.LinkTempID + f.fieldMap["outside_task"] = f.OutsideTask + f.fieldMap["show_to_use"] = f.ShowToUse + f.fieldMap["open_chat"] = f.OpenChat + f.fieldMap["rule_type"] = f.RuleType + f.fieldMap["rule_outside"] = f.RuleOutside + f.fieldMap["device_once"] = f.DeviceOnce +} + +func (f fissionCampaignConfig) clone(db *gorm.DB) fissionCampaignConfig { + f.fissionCampaignConfigDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignConfig) replaceDB(db *gorm.DB) fissionCampaignConfig { + f.fissionCampaignConfigDo.ReplaceDB(db) + return f +} + +type fissionCampaignConfigDo struct{ gen.DO } + +func (f fissionCampaignConfigDo) Debug() *fissionCampaignConfigDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignConfigDo) WithContext(ctx context.Context) *fissionCampaignConfigDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignConfigDo) ReadDB() *fissionCampaignConfigDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignConfigDo) WriteDB() *fissionCampaignConfigDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignConfigDo) Session(config *gorm.Session) *fissionCampaignConfigDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignConfigDo) Clauses(conds ...clause.Expression) *fissionCampaignConfigDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignConfigDo) Returning(value interface{}, columns ...string) *fissionCampaignConfigDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignConfigDo) Not(conds ...gen.Condition) *fissionCampaignConfigDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignConfigDo) Or(conds ...gen.Condition) *fissionCampaignConfigDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignConfigDo) Select(conds ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignConfigDo) Where(conds ...gen.Condition) *fissionCampaignConfigDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignConfigDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignConfigDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignConfigDo) Order(conds ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignConfigDo) Distinct(cols ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignConfigDo) Omit(cols ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignConfigDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignConfigDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignConfigDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignConfigDo) Group(cols ...field.Expr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignConfigDo) Having(conds ...gen.Condition) *fissionCampaignConfigDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignConfigDo) Limit(limit int) *fissionCampaignConfigDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignConfigDo) Offset(offset int) *fissionCampaignConfigDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignConfigDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignConfigDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignConfigDo) Unscoped() *fissionCampaignConfigDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignConfigDo) Create(values ...*model.FissionCampaignConfig) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignConfigDo) CreateInBatches(values []*model.FissionCampaignConfig, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignConfigDo) Save(values ...*model.FissionCampaignConfig) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignConfigDo) First() (*model.FissionCampaignConfig, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignConfig), nil + } +} + +func (f fissionCampaignConfigDo) Take() (*model.FissionCampaignConfig, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignConfig), nil + } +} + +func (f fissionCampaignConfigDo) Last() (*model.FissionCampaignConfig, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignConfig), nil + } +} + +func (f fissionCampaignConfigDo) Find() ([]*model.FissionCampaignConfig, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignConfig), err +} + +func (f fissionCampaignConfigDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignConfig, err error) { + buf := make([]*model.FissionCampaignConfig, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignConfigDo) FindInBatches(result *[]*model.FissionCampaignConfig, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignConfigDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignConfigDo) Assign(attrs ...field.AssignExpr) *fissionCampaignConfigDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignConfigDo) Joins(fields ...field.RelationField) *fissionCampaignConfigDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignConfigDo) Preload(fields ...field.RelationField) *fissionCampaignConfigDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignConfigDo) FirstOrInit() (*model.FissionCampaignConfig, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignConfig), nil + } +} + +func (f fissionCampaignConfigDo) FirstOrCreate() (*model.FissionCampaignConfig, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignConfig), nil + } +} + +func (f fissionCampaignConfigDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignConfig, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignConfigDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignConfigDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignConfigDo) Delete(models ...*model.FissionCampaignConfig) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignConfigDo) withDO(do gen.Dao) *fissionCampaignConfigDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_dice.gen.go b/internal/repository/dao/fission_campaign_dice.gen.go new file mode 100644 index 0000000..7440f0c --- /dev/null +++ b/internal/repository/dao/fission_campaign_dice.gen.go @@ -0,0 +1,411 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignDice(db *gorm.DB, opts ...gen.DOOption) fissionCampaignDice { + _fissionCampaignDice := fissionCampaignDice{} + + _fissionCampaignDice.fissionCampaignDiceDo.UseDB(db, opts...) + _fissionCampaignDice.fissionCampaignDiceDo.UseModel(&model.FissionCampaignDice{}) + + tableName := _fissionCampaignDice.fissionCampaignDiceDo.TableName() + _fissionCampaignDice.ALL = field.NewAsterisk(tableName) + _fissionCampaignDice.ID = field.NewInt64(tableName, "id") + _fissionCampaignDice.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignDice.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignDice.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignDice.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignDice.Chance = field.NewInt32(tableName, "chance") + _fissionCampaignDice.DayChance = field.NewInt32(tableName, "day_chance") + _fissionCampaignDice.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignDice.FixDice = field.NewInt8(tableName, "fix_dice") + _fissionCampaignDice.FixDiceTarget = field.NewInt32(tableName, "fix_dice_target") + _fissionCampaignDice.FixDiceLimit = field.NewInt32(tableName, "fix_dice_limit") + _fissionCampaignDice.FixDiceCond = field.NewInt8(tableName, "fix_dice_cond") + _fissionCampaignDice.CustomDice = field.NewString(tableName, "custom_dice") + _fissionCampaignDice.OpenMapPoint = field.NewInt8(tableName, "open_map_point") + _fissionCampaignDice.MapPoint = field.NewString(tableName, "map_point") + _fissionCampaignDice.AwardType = field.NewInt8(tableName, "award_type") + _fissionCampaignDice.Odds = field.NewInt32(tableName, "odds") + _fissionCampaignDice.OpenInvite = field.NewInt8(tableName, "open_invite") + _fissionCampaignDice.RollAgain = field.NewInt8(tableName, "roll_again") + _fissionCampaignDice.PlayImg = field.NewString(tableName, "play_img") + _fissionCampaignDice.CloudImg = field.NewString(tableName, "cloud_img") + + _fissionCampaignDice.fillFieldMap() + + return _fissionCampaignDice +} + +type fissionCampaignDice struct { + fissionCampaignDiceDo fissionCampaignDiceDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + InitChance field.Int32 // 初始骰子数 + Chance field.Int32 // 达标获得的骰子数 + DayChance field.Int32 // 每日获得的骰子数 + TargetNum field.Int32 // 达标条件需要的新用户个数 + FixDice field.Int8 // 开启固定骰子(0-不开启,1-开启) + FixDiceTarget field.Int32 // 获得固定骰子需要邀请的人数 + FixDiceLimit field.Int32 // 固定骰子限制获取数 + FixDiceCond field.Int8 // 邀请事件(1-安装,2-注册) + CustomDice field.String // 自定义骰子图片 + OpenMapPoint field.Int8 // 开启自定义底座(0-不开启,1-开启) + MapPoint field.String // 自定义底座数据 + AwardType field.Int8 // 奖品碎片收集方式(1-随机收集,2-概率收集) + Odds field.Int32 // 概率收集方式的中奖概率 + OpenInvite field.Int8 // 开启邀请挂件(0-关闭,1-开启) + RollAgain field.Int8 // 开启再摇一次(0-关闭,1-开启) + PlayImg field.String // play按钮图 + CloudImg field.String // 云朵图 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignDice) Table(newTableName string) *fissionCampaignDice { + f.fissionCampaignDiceDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignDice) As(alias string) *fissionCampaignDice { + f.fissionCampaignDiceDo.DO = *(f.fissionCampaignDiceDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignDice) updateTableName(table string) *fissionCampaignDice { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.InitChance = field.NewInt32(table, "init_chance") + f.Chance = field.NewInt32(table, "chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.TargetNum = field.NewInt32(table, "target_num") + f.FixDice = field.NewInt8(table, "fix_dice") + f.FixDiceTarget = field.NewInt32(table, "fix_dice_target") + f.FixDiceLimit = field.NewInt32(table, "fix_dice_limit") + f.FixDiceCond = field.NewInt8(table, "fix_dice_cond") + f.CustomDice = field.NewString(table, "custom_dice") + f.OpenMapPoint = field.NewInt8(table, "open_map_point") + f.MapPoint = field.NewString(table, "map_point") + f.AwardType = field.NewInt8(table, "award_type") + f.Odds = field.NewInt32(table, "odds") + f.OpenInvite = field.NewInt8(table, "open_invite") + f.RollAgain = field.NewInt8(table, "roll_again") + f.PlayImg = field.NewString(table, "play_img") + f.CloudImg = field.NewString(table, "cloud_img") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignDice) WithContext(ctx context.Context) *fissionCampaignDiceDo { + return f.fissionCampaignDiceDo.WithContext(ctx) +} + +func (f fissionCampaignDice) TableName() string { return f.fissionCampaignDiceDo.TableName() } + +func (f fissionCampaignDice) Alias() string { return f.fissionCampaignDiceDo.Alias() } + +func (f *fissionCampaignDice) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignDice) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 21) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["chance"] = f.Chance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["fix_dice"] = f.FixDice + f.fieldMap["fix_dice_target"] = f.FixDiceTarget + f.fieldMap["fix_dice_limit"] = f.FixDiceLimit + f.fieldMap["fix_dice_cond"] = f.FixDiceCond + f.fieldMap["custom_dice"] = f.CustomDice + f.fieldMap["open_map_point"] = f.OpenMapPoint + f.fieldMap["map_point"] = f.MapPoint + f.fieldMap["award_type"] = f.AwardType + f.fieldMap["odds"] = f.Odds + f.fieldMap["open_invite"] = f.OpenInvite + f.fieldMap["roll_again"] = f.RollAgain + f.fieldMap["play_img"] = f.PlayImg + f.fieldMap["cloud_img"] = f.CloudImg +} + +func (f fissionCampaignDice) clone(db *gorm.DB) fissionCampaignDice { + f.fissionCampaignDiceDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignDice) replaceDB(db *gorm.DB) fissionCampaignDice { + f.fissionCampaignDiceDo.ReplaceDB(db) + return f +} + +type fissionCampaignDiceDo struct{ gen.DO } + +func (f fissionCampaignDiceDo) Debug() *fissionCampaignDiceDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignDiceDo) WithContext(ctx context.Context) *fissionCampaignDiceDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignDiceDo) ReadDB() *fissionCampaignDiceDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignDiceDo) WriteDB() *fissionCampaignDiceDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignDiceDo) Session(config *gorm.Session) *fissionCampaignDiceDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignDiceDo) Clauses(conds ...clause.Expression) *fissionCampaignDiceDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignDiceDo) Returning(value interface{}, columns ...string) *fissionCampaignDiceDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignDiceDo) Not(conds ...gen.Condition) *fissionCampaignDiceDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignDiceDo) Or(conds ...gen.Condition) *fissionCampaignDiceDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignDiceDo) Select(conds ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignDiceDo) Where(conds ...gen.Condition) *fissionCampaignDiceDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignDiceDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignDiceDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignDiceDo) Order(conds ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignDiceDo) Distinct(cols ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignDiceDo) Omit(cols ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignDiceDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignDiceDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignDiceDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignDiceDo) Group(cols ...field.Expr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignDiceDo) Having(conds ...gen.Condition) *fissionCampaignDiceDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignDiceDo) Limit(limit int) *fissionCampaignDiceDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignDiceDo) Offset(offset int) *fissionCampaignDiceDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignDiceDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignDiceDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignDiceDo) Unscoped() *fissionCampaignDiceDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignDiceDo) Create(values ...*model.FissionCampaignDice) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignDiceDo) CreateInBatches(values []*model.FissionCampaignDice, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignDiceDo) Save(values ...*model.FissionCampaignDice) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignDiceDo) First() (*model.FissionCampaignDice, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignDice), nil + } +} + +func (f fissionCampaignDiceDo) Take() (*model.FissionCampaignDice, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignDice), nil + } +} + +func (f fissionCampaignDiceDo) Last() (*model.FissionCampaignDice, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignDice), nil + } +} + +func (f fissionCampaignDiceDo) Find() ([]*model.FissionCampaignDice, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignDice), err +} + +func (f fissionCampaignDiceDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignDice, err error) { + buf := make([]*model.FissionCampaignDice, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignDiceDo) FindInBatches(result *[]*model.FissionCampaignDice, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignDiceDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignDiceDo) Assign(attrs ...field.AssignExpr) *fissionCampaignDiceDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignDiceDo) Joins(fields ...field.RelationField) *fissionCampaignDiceDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignDiceDo) Preload(fields ...field.RelationField) *fissionCampaignDiceDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignDiceDo) FirstOrInit() (*model.FissionCampaignDice, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignDice), nil + } +} + +func (f fissionCampaignDiceDo) FirstOrCreate() (*model.FissionCampaignDice, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignDice), nil + } +} + +func (f fissionCampaignDiceDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignDice, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignDiceDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignDiceDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignDiceDo) Delete(models ...*model.FissionCampaignDice) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignDiceDo) withDO(do gen.Dao) *fissionCampaignDiceDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_event.gen.go b/internal/repository/dao/fission_campaign_event.gen.go new file mode 100644 index 0000000..86265e8 --- /dev/null +++ b/internal/repository/dao/fission_campaign_event.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignEvent(db *gorm.DB, opts ...gen.DOOption) fissionCampaignEvent { + _fissionCampaignEvent := fissionCampaignEvent{} + + _fissionCampaignEvent.fissionCampaignEventDo.UseDB(db, opts...) + _fissionCampaignEvent.fissionCampaignEventDo.UseModel(&model.FissionCampaignEvent{}) + + tableName := _fissionCampaignEvent.fissionCampaignEventDo.TableName() + _fissionCampaignEvent.ALL = field.NewAsterisk(tableName) + _fissionCampaignEvent.ID = field.NewInt64(tableName, "id") + _fissionCampaignEvent.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignEvent.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignEvent.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignEvent.Mark = field.NewString(tableName, "mark") + _fissionCampaignEvent.Open = field.NewInt8(tableName, "open") + _fissionCampaignEvent.Rewards = field.NewString(tableName, "rewards") + + _fissionCampaignEvent.fillFieldMap() + + return _fissionCampaignEvent +} + +type fissionCampaignEvent struct { + fissionCampaignEventDo fissionCampaignEventDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + Mark field.String // 标识(推送标识) + Open field.Int8 // 是否开启(0-否,1-是) + Rewards field.String // 奖励 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignEvent) Table(newTableName string) *fissionCampaignEvent { + f.fissionCampaignEventDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignEvent) As(alias string) *fissionCampaignEvent { + f.fissionCampaignEventDo.DO = *(f.fissionCampaignEventDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignEvent) updateTableName(table string) *fissionCampaignEvent { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.Open = field.NewInt8(table, "open") + f.Rewards = field.NewString(table, "rewards") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignEvent) WithContext(ctx context.Context) *fissionCampaignEventDo { + return f.fissionCampaignEventDo.WithContext(ctx) +} + +func (f fissionCampaignEvent) TableName() string { return f.fissionCampaignEventDo.TableName() } + +func (f fissionCampaignEvent) Alias() string { return f.fissionCampaignEventDo.Alias() } + +func (f *fissionCampaignEvent) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignEvent) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["open"] = f.Open + f.fieldMap["rewards"] = f.Rewards +} + +func (f fissionCampaignEvent) clone(db *gorm.DB) fissionCampaignEvent { + f.fissionCampaignEventDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignEvent) replaceDB(db *gorm.DB) fissionCampaignEvent { + f.fissionCampaignEventDo.ReplaceDB(db) + return f +} + +type fissionCampaignEventDo struct{ gen.DO } + +func (f fissionCampaignEventDo) Debug() *fissionCampaignEventDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignEventDo) WithContext(ctx context.Context) *fissionCampaignEventDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignEventDo) ReadDB() *fissionCampaignEventDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignEventDo) WriteDB() *fissionCampaignEventDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignEventDo) Session(config *gorm.Session) *fissionCampaignEventDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignEventDo) Clauses(conds ...clause.Expression) *fissionCampaignEventDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignEventDo) Returning(value interface{}, columns ...string) *fissionCampaignEventDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignEventDo) Not(conds ...gen.Condition) *fissionCampaignEventDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignEventDo) Or(conds ...gen.Condition) *fissionCampaignEventDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignEventDo) Select(conds ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignEventDo) Where(conds ...gen.Condition) *fissionCampaignEventDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignEventDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignEventDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignEventDo) Order(conds ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignEventDo) Distinct(cols ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignEventDo) Omit(cols ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignEventDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignEventDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignEventDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignEventDo) Group(cols ...field.Expr) *fissionCampaignEventDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignEventDo) Having(conds ...gen.Condition) *fissionCampaignEventDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignEventDo) Limit(limit int) *fissionCampaignEventDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignEventDo) Offset(offset int) *fissionCampaignEventDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignEventDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignEventDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignEventDo) Unscoped() *fissionCampaignEventDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignEventDo) Create(values ...*model.FissionCampaignEvent) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignEventDo) CreateInBatches(values []*model.FissionCampaignEvent, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignEventDo) Save(values ...*model.FissionCampaignEvent) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignEventDo) First() (*model.FissionCampaignEvent, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignEvent), nil + } +} + +func (f fissionCampaignEventDo) Take() (*model.FissionCampaignEvent, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignEvent), nil + } +} + +func (f fissionCampaignEventDo) Last() (*model.FissionCampaignEvent, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignEvent), nil + } +} + +func (f fissionCampaignEventDo) Find() ([]*model.FissionCampaignEvent, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignEvent), err +} + +func (f fissionCampaignEventDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignEvent, err error) { + buf := make([]*model.FissionCampaignEvent, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignEventDo) FindInBatches(result *[]*model.FissionCampaignEvent, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignEventDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignEventDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignEventDo) Assign(attrs ...field.AssignExpr) *fissionCampaignEventDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignEventDo) Joins(fields ...field.RelationField) *fissionCampaignEventDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignEventDo) Preload(fields ...field.RelationField) *fissionCampaignEventDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignEventDo) FirstOrInit() (*model.FissionCampaignEvent, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignEvent), nil + } +} + +func (f fissionCampaignEventDo) FirstOrCreate() (*model.FissionCampaignEvent, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignEvent), nil + } +} + +func (f fissionCampaignEventDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignEvent, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignEventDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignEventDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignEventDo) Delete(models ...*model.FissionCampaignEvent) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignEventDo) withDO(do gen.Dao) *fissionCampaignEventDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_flip.gen.go b/internal/repository/dao/fission_campaign_flip.gen.go new file mode 100644 index 0000000..8815289 --- /dev/null +++ b/internal/repository/dao/fission_campaign_flip.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignFlip(db *gorm.DB, opts ...gen.DOOption) fissionCampaignFlip { + _fissionCampaignFlip := fissionCampaignFlip{} + + _fissionCampaignFlip.fissionCampaignFlipDo.UseDB(db, opts...) + _fissionCampaignFlip.fissionCampaignFlipDo.UseModel(&model.FissionCampaignFlip{}) + + tableName := _fissionCampaignFlip.fissionCampaignFlipDo.TableName() + _fissionCampaignFlip.ALL = field.NewAsterisk(tableName) + _fissionCampaignFlip.ID = field.NewInt64(tableName, "id") + _fissionCampaignFlip.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignFlip.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignFlip.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignFlip.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignFlip.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignFlip.CardImg = field.NewString(tableName, "card_img") + _fissionCampaignFlip.DayChance = field.NewInt32(tableName, "day_chance") + + _fissionCampaignFlip.fillFieldMap() + + return _fissionCampaignFlip +} + +type fissionCampaignFlip struct { + fissionCampaignFlipDo fissionCampaignFlipDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + InitChance field.Int32 // 初始答题机会次数 + CardImg field.String // 牌子封面 + DayChance field.Int32 // 每日获得的抽奖次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignFlip) Table(newTableName string) *fissionCampaignFlip { + f.fissionCampaignFlipDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignFlip) As(alias string) *fissionCampaignFlip { + f.fissionCampaignFlipDo.DO = *(f.fissionCampaignFlipDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignFlip) updateTableName(table string) *fissionCampaignFlip { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.InitChance = field.NewInt32(table, "init_chance") + f.CardImg = field.NewString(table, "card_img") + f.DayChance = field.NewInt32(table, "day_chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignFlip) WithContext(ctx context.Context) *fissionCampaignFlipDo { + return f.fissionCampaignFlipDo.WithContext(ctx) +} + +func (f fissionCampaignFlip) TableName() string { return f.fissionCampaignFlipDo.TableName() } + +func (f fissionCampaignFlip) Alias() string { return f.fissionCampaignFlipDo.Alias() } + +func (f *fissionCampaignFlip) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignFlip) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["card_img"] = f.CardImg + f.fieldMap["day_chance"] = f.DayChance +} + +func (f fissionCampaignFlip) clone(db *gorm.DB) fissionCampaignFlip { + f.fissionCampaignFlipDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignFlip) replaceDB(db *gorm.DB) fissionCampaignFlip { + f.fissionCampaignFlipDo.ReplaceDB(db) + return f +} + +type fissionCampaignFlipDo struct{ gen.DO } + +func (f fissionCampaignFlipDo) Debug() *fissionCampaignFlipDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignFlipDo) WithContext(ctx context.Context) *fissionCampaignFlipDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignFlipDo) ReadDB() *fissionCampaignFlipDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignFlipDo) WriteDB() *fissionCampaignFlipDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignFlipDo) Session(config *gorm.Session) *fissionCampaignFlipDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignFlipDo) Clauses(conds ...clause.Expression) *fissionCampaignFlipDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignFlipDo) Returning(value interface{}, columns ...string) *fissionCampaignFlipDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignFlipDo) Not(conds ...gen.Condition) *fissionCampaignFlipDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignFlipDo) Or(conds ...gen.Condition) *fissionCampaignFlipDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignFlipDo) Select(conds ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignFlipDo) Where(conds ...gen.Condition) *fissionCampaignFlipDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignFlipDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignFlipDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignFlipDo) Order(conds ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignFlipDo) Distinct(cols ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignFlipDo) Omit(cols ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignFlipDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignFlipDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignFlipDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignFlipDo) Group(cols ...field.Expr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignFlipDo) Having(conds ...gen.Condition) *fissionCampaignFlipDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignFlipDo) Limit(limit int) *fissionCampaignFlipDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignFlipDo) Offset(offset int) *fissionCampaignFlipDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignFlipDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignFlipDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignFlipDo) Unscoped() *fissionCampaignFlipDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignFlipDo) Create(values ...*model.FissionCampaignFlip) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignFlipDo) CreateInBatches(values []*model.FissionCampaignFlip, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignFlipDo) Save(values ...*model.FissionCampaignFlip) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignFlipDo) First() (*model.FissionCampaignFlip, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignFlip), nil + } +} + +func (f fissionCampaignFlipDo) Take() (*model.FissionCampaignFlip, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignFlip), nil + } +} + +func (f fissionCampaignFlipDo) Last() (*model.FissionCampaignFlip, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignFlip), nil + } +} + +func (f fissionCampaignFlipDo) Find() ([]*model.FissionCampaignFlip, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignFlip), err +} + +func (f fissionCampaignFlipDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignFlip, err error) { + buf := make([]*model.FissionCampaignFlip, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignFlipDo) FindInBatches(result *[]*model.FissionCampaignFlip, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignFlipDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignFlipDo) Assign(attrs ...field.AssignExpr) *fissionCampaignFlipDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignFlipDo) Joins(fields ...field.RelationField) *fissionCampaignFlipDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignFlipDo) Preload(fields ...field.RelationField) *fissionCampaignFlipDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignFlipDo) FirstOrInit() (*model.FissionCampaignFlip, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignFlip), nil + } +} + +func (f fissionCampaignFlipDo) FirstOrCreate() (*model.FissionCampaignFlip, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignFlip), nil + } +} + +func (f fissionCampaignFlipDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignFlip, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignFlipDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignFlipDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignFlipDo) Delete(models ...*model.FissionCampaignFlip) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignFlipDo) withDO(do gen.Dao) *fissionCampaignFlipDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_gashapon.gen.go b/internal/repository/dao/fission_campaign_gashapon.gen.go new file mode 100644 index 0000000..dffac0b --- /dev/null +++ b/internal/repository/dao/fission_campaign_gashapon.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignGashapon(db *gorm.DB, opts ...gen.DOOption) fissionCampaignGashapon { + _fissionCampaignGashapon := fissionCampaignGashapon{} + + _fissionCampaignGashapon.fissionCampaignGashaponDo.UseDB(db, opts...) + _fissionCampaignGashapon.fissionCampaignGashaponDo.UseModel(&model.FissionCampaignGashapon{}) + + tableName := _fissionCampaignGashapon.fissionCampaignGashaponDo.TableName() + _fissionCampaignGashapon.ALL = field.NewAsterisk(tableName) + _fissionCampaignGashapon.ID = field.NewInt64(tableName, "id") + _fissionCampaignGashapon.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignGashapon.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignGashapon.IsDel = field.NewUint8(tableName, "is_del") + _fissionCampaignGashapon.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignGashapon.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignGashapon.DayChance = field.NewInt32(tableName, "day_chance") + + _fissionCampaignGashapon.fillFieldMap() + + return _fissionCampaignGashapon +} + +type fissionCampaignGashapon struct { + fissionCampaignGashaponDo fissionCampaignGashaponDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + InitChance field.Int32 // 初始抽奖机会次数 + DayChance field.Int32 // 每日获得的抽奖次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignGashapon) Table(newTableName string) *fissionCampaignGashapon { + f.fissionCampaignGashaponDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignGashapon) As(alias string) *fissionCampaignGashapon { + f.fissionCampaignGashaponDo.DO = *(f.fissionCampaignGashaponDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignGashapon) updateTableName(table string) *fissionCampaignGashapon { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.InitChance = field.NewInt32(table, "init_chance") + f.DayChance = field.NewInt32(table, "day_chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignGashapon) WithContext(ctx context.Context) *fissionCampaignGashaponDo { + return f.fissionCampaignGashaponDo.WithContext(ctx) +} + +func (f fissionCampaignGashapon) TableName() string { return f.fissionCampaignGashaponDo.TableName() } + +func (f fissionCampaignGashapon) Alias() string { return f.fissionCampaignGashaponDo.Alias() } + +func (f *fissionCampaignGashapon) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignGashapon) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["day_chance"] = f.DayChance +} + +func (f fissionCampaignGashapon) clone(db *gorm.DB) fissionCampaignGashapon { + f.fissionCampaignGashaponDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignGashapon) replaceDB(db *gorm.DB) fissionCampaignGashapon { + f.fissionCampaignGashaponDo.ReplaceDB(db) + return f +} + +type fissionCampaignGashaponDo struct{ gen.DO } + +func (f fissionCampaignGashaponDo) Debug() *fissionCampaignGashaponDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignGashaponDo) WithContext(ctx context.Context) *fissionCampaignGashaponDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignGashaponDo) ReadDB() *fissionCampaignGashaponDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignGashaponDo) WriteDB() *fissionCampaignGashaponDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignGashaponDo) Session(config *gorm.Session) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignGashaponDo) Clauses(conds ...clause.Expression) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignGashaponDo) Returning(value interface{}, columns ...string) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignGashaponDo) Not(conds ...gen.Condition) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignGashaponDo) Or(conds ...gen.Condition) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignGashaponDo) Select(conds ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignGashaponDo) Where(conds ...gen.Condition) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignGashaponDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignGashaponDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignGashaponDo) Order(conds ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignGashaponDo) Distinct(cols ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignGashaponDo) Omit(cols ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignGashaponDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignGashaponDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignGashaponDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignGashaponDo) Group(cols ...field.Expr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignGashaponDo) Having(conds ...gen.Condition) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignGashaponDo) Limit(limit int) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignGashaponDo) Offset(offset int) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignGashaponDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignGashaponDo) Unscoped() *fissionCampaignGashaponDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignGashaponDo) Create(values ...*model.FissionCampaignGashapon) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignGashaponDo) CreateInBatches(values []*model.FissionCampaignGashapon, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignGashaponDo) Save(values ...*model.FissionCampaignGashapon) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignGashaponDo) First() (*model.FissionCampaignGashapon, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGashapon), nil + } +} + +func (f fissionCampaignGashaponDo) Take() (*model.FissionCampaignGashapon, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGashapon), nil + } +} + +func (f fissionCampaignGashaponDo) Last() (*model.FissionCampaignGashapon, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGashapon), nil + } +} + +func (f fissionCampaignGashaponDo) Find() ([]*model.FissionCampaignGashapon, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignGashapon), err +} + +func (f fissionCampaignGashaponDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignGashapon, err error) { + buf := make([]*model.FissionCampaignGashapon, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignGashaponDo) FindInBatches(result *[]*model.FissionCampaignGashapon, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignGashaponDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignGashaponDo) Assign(attrs ...field.AssignExpr) *fissionCampaignGashaponDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignGashaponDo) Joins(fields ...field.RelationField) *fissionCampaignGashaponDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignGashaponDo) Preload(fields ...field.RelationField) *fissionCampaignGashaponDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignGashaponDo) FirstOrInit() (*model.FissionCampaignGashapon, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGashapon), nil + } +} + +func (f fissionCampaignGashaponDo) FirstOrCreate() (*model.FissionCampaignGashapon, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGashapon), nil + } +} + +func (f fissionCampaignGashaponDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignGashapon, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignGashaponDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignGashaponDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignGashaponDo) Delete(models ...*model.FissionCampaignGashapon) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignGashaponDo) withDO(do gen.Dao) *fissionCampaignGashaponDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_gold.gen.go b/internal/repository/dao/fission_campaign_gold.gen.go new file mode 100644 index 0000000..627d8bd --- /dev/null +++ b/internal/repository/dao/fission_campaign_gold.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignGold(db *gorm.DB, opts ...gen.DOOption) fissionCampaignGold { + _fissionCampaignGold := fissionCampaignGold{} + + _fissionCampaignGold.fissionCampaignGoldDo.UseDB(db, opts...) + _fissionCampaignGold.fissionCampaignGoldDo.UseModel(&model.FissionCampaignGold{}) + + tableName := _fissionCampaignGold.fissionCampaignGoldDo.TableName() + _fissionCampaignGold.ALL = field.NewAsterisk(tableName) + _fissionCampaignGold.ID = field.NewInt64(tableName, "id") + _fissionCampaignGold.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignGold.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignGold.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignGold.GoldNum = field.NewInt32(tableName, "gold_num") + _fissionCampaignGold.ExpiredDay = field.NewInt32(tableName, "expired_day") + _fissionCampaignGold.Price = field.NewFloat64(tableName, "price") + _fissionCampaignGold.PriceNum = field.NewInt32(tableName, "price_num") + _fissionCampaignGold.Lack = field.NewInt8(tableName, "lack") + _fissionCampaignGold.Currency = field.NewInt8(tableName, "currency") + + _fissionCampaignGold.fillFieldMap() + + return _fissionCampaignGold +} + +type fissionCampaignGold struct { + fissionCampaignGoldDo fissionCampaignGoldDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + GoldNum field.Int32 // 获得奖品需要的金币数 + ExpiredDay field.Int32 // 任务重置天数 + Price field.Float64 // 单位奖品总价值 + PriceNum field.Int32 // 奖品总份额 + Lack field.Int8 // 缺乏库存 + Currency field.Int8 // 货币单位 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignGold) Table(newTableName string) *fissionCampaignGold { + f.fissionCampaignGoldDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignGold) As(alias string) *fissionCampaignGold { + f.fissionCampaignGoldDo.DO = *(f.fissionCampaignGoldDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignGold) updateTableName(table string) *fissionCampaignGold { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.GoldNum = field.NewInt32(table, "gold_num") + f.ExpiredDay = field.NewInt32(table, "expired_day") + f.Price = field.NewFloat64(table, "price") + f.PriceNum = field.NewInt32(table, "price_num") + f.Lack = field.NewInt8(table, "lack") + f.Currency = field.NewInt8(table, "currency") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignGold) WithContext(ctx context.Context) *fissionCampaignGoldDo { + return f.fissionCampaignGoldDo.WithContext(ctx) +} + +func (f fissionCampaignGold) TableName() string { return f.fissionCampaignGoldDo.TableName() } + +func (f fissionCampaignGold) Alias() string { return f.fissionCampaignGoldDo.Alias() } + +func (f *fissionCampaignGold) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignGold) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["gold_num"] = f.GoldNum + f.fieldMap["expired_day"] = f.ExpiredDay + f.fieldMap["price"] = f.Price + f.fieldMap["price_num"] = f.PriceNum + f.fieldMap["lack"] = f.Lack + f.fieldMap["currency"] = f.Currency +} + +func (f fissionCampaignGold) clone(db *gorm.DB) fissionCampaignGold { + f.fissionCampaignGoldDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignGold) replaceDB(db *gorm.DB) fissionCampaignGold { + f.fissionCampaignGoldDo.ReplaceDB(db) + return f +} + +type fissionCampaignGoldDo struct{ gen.DO } + +func (f fissionCampaignGoldDo) Debug() *fissionCampaignGoldDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignGoldDo) WithContext(ctx context.Context) *fissionCampaignGoldDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignGoldDo) ReadDB() *fissionCampaignGoldDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignGoldDo) WriteDB() *fissionCampaignGoldDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignGoldDo) Session(config *gorm.Session) *fissionCampaignGoldDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignGoldDo) Clauses(conds ...clause.Expression) *fissionCampaignGoldDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignGoldDo) Returning(value interface{}, columns ...string) *fissionCampaignGoldDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignGoldDo) Not(conds ...gen.Condition) *fissionCampaignGoldDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignGoldDo) Or(conds ...gen.Condition) *fissionCampaignGoldDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignGoldDo) Select(conds ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignGoldDo) Where(conds ...gen.Condition) *fissionCampaignGoldDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignGoldDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignGoldDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignGoldDo) Order(conds ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignGoldDo) Distinct(cols ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignGoldDo) Omit(cols ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignGoldDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignGoldDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignGoldDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignGoldDo) Group(cols ...field.Expr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignGoldDo) Having(conds ...gen.Condition) *fissionCampaignGoldDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignGoldDo) Limit(limit int) *fissionCampaignGoldDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignGoldDo) Offset(offset int) *fissionCampaignGoldDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignGoldDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignGoldDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignGoldDo) Unscoped() *fissionCampaignGoldDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignGoldDo) Create(values ...*model.FissionCampaignGold) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignGoldDo) CreateInBatches(values []*model.FissionCampaignGold, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignGoldDo) Save(values ...*model.FissionCampaignGold) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignGoldDo) First() (*model.FissionCampaignGold, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGold), nil + } +} + +func (f fissionCampaignGoldDo) Take() (*model.FissionCampaignGold, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGold), nil + } +} + +func (f fissionCampaignGoldDo) Last() (*model.FissionCampaignGold, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGold), nil + } +} + +func (f fissionCampaignGoldDo) Find() ([]*model.FissionCampaignGold, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignGold), err +} + +func (f fissionCampaignGoldDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignGold, err error) { + buf := make([]*model.FissionCampaignGold, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignGoldDo) FindInBatches(result *[]*model.FissionCampaignGold, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignGoldDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignGoldDo) Assign(attrs ...field.AssignExpr) *fissionCampaignGoldDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignGoldDo) Joins(fields ...field.RelationField) *fissionCampaignGoldDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignGoldDo) Preload(fields ...field.RelationField) *fissionCampaignGoldDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignGoldDo) FirstOrInit() (*model.FissionCampaignGold, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGold), nil + } +} + +func (f fissionCampaignGoldDo) FirstOrCreate() (*model.FissionCampaignGold, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGold), nil + } +} + +func (f fissionCampaignGoldDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignGold, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignGoldDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignGoldDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignGoldDo) Delete(models ...*model.FissionCampaignGold) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignGoldDo) withDO(do gen.Dao) *fissionCampaignGoldDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_grid.gen.go b/internal/repository/dao/fission_campaign_grid.gen.go new file mode 100644 index 0000000..2dde01d --- /dev/null +++ b/internal/repository/dao/fission_campaign_grid.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignGrid(db *gorm.DB, opts ...gen.DOOption) fissionCampaignGrid { + _fissionCampaignGrid := fissionCampaignGrid{} + + _fissionCampaignGrid.fissionCampaignGridDo.UseDB(db, opts...) + _fissionCampaignGrid.fissionCampaignGridDo.UseModel(&model.FissionCampaignGrid{}) + + tableName := _fissionCampaignGrid.fissionCampaignGridDo.TableName() + _fissionCampaignGrid.ALL = field.NewAsterisk(tableName) + _fissionCampaignGrid.ID = field.NewInt64(tableName, "id") + _fissionCampaignGrid.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignGrid.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignGrid.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignGrid.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignGrid.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignGrid.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignGrid.Odds = field.NewInt32(tableName, "odds") + _fissionCampaignGrid.DayChance = field.NewInt32(tableName, "day_chance") + _fissionCampaignGrid.Chance = field.NewInt32(tableName, "chance") + + _fissionCampaignGrid.fillFieldMap() + + return _fissionCampaignGrid +} + +type fissionCampaignGrid struct { + fissionCampaignGridDo fissionCampaignGridDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + TargetNum field.Int32 // 达标条件需要的新用户个数 + InitChance field.Int32 // 初始答题机会次数 + Odds field.Int32 // 中奖概率 + DayChance field.Int32 // 每日获得的抽奖次数 + Chance field.Int32 // 达标获得的抽奖机会次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignGrid) Table(newTableName string) *fissionCampaignGrid { + f.fissionCampaignGridDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignGrid) As(alias string) *fissionCampaignGrid { + f.fissionCampaignGridDo.DO = *(f.fissionCampaignGridDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignGrid) updateTableName(table string) *fissionCampaignGrid { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TargetNum = field.NewInt32(table, "target_num") + f.InitChance = field.NewInt32(table, "init_chance") + f.Odds = field.NewInt32(table, "odds") + f.DayChance = field.NewInt32(table, "day_chance") + f.Chance = field.NewInt32(table, "chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignGrid) WithContext(ctx context.Context) *fissionCampaignGridDo { + return f.fissionCampaignGridDo.WithContext(ctx) +} + +func (f fissionCampaignGrid) TableName() string { return f.fissionCampaignGridDo.TableName() } + +func (f fissionCampaignGrid) Alias() string { return f.fissionCampaignGridDo.Alias() } + +func (f *fissionCampaignGrid) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignGrid) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["odds"] = f.Odds + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["chance"] = f.Chance +} + +func (f fissionCampaignGrid) clone(db *gorm.DB) fissionCampaignGrid { + f.fissionCampaignGridDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignGrid) replaceDB(db *gorm.DB) fissionCampaignGrid { + f.fissionCampaignGridDo.ReplaceDB(db) + return f +} + +type fissionCampaignGridDo struct{ gen.DO } + +func (f fissionCampaignGridDo) Debug() *fissionCampaignGridDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignGridDo) WithContext(ctx context.Context) *fissionCampaignGridDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignGridDo) ReadDB() *fissionCampaignGridDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignGridDo) WriteDB() *fissionCampaignGridDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignGridDo) Session(config *gorm.Session) *fissionCampaignGridDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignGridDo) Clauses(conds ...clause.Expression) *fissionCampaignGridDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignGridDo) Returning(value interface{}, columns ...string) *fissionCampaignGridDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignGridDo) Not(conds ...gen.Condition) *fissionCampaignGridDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignGridDo) Or(conds ...gen.Condition) *fissionCampaignGridDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignGridDo) Select(conds ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignGridDo) Where(conds ...gen.Condition) *fissionCampaignGridDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignGridDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignGridDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignGridDo) Order(conds ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignGridDo) Distinct(cols ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignGridDo) Omit(cols ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignGridDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignGridDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignGridDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignGridDo) Group(cols ...field.Expr) *fissionCampaignGridDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignGridDo) Having(conds ...gen.Condition) *fissionCampaignGridDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignGridDo) Limit(limit int) *fissionCampaignGridDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignGridDo) Offset(offset int) *fissionCampaignGridDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignGridDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignGridDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignGridDo) Unscoped() *fissionCampaignGridDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignGridDo) Create(values ...*model.FissionCampaignGrid) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignGridDo) CreateInBatches(values []*model.FissionCampaignGrid, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignGridDo) Save(values ...*model.FissionCampaignGrid) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignGridDo) First() (*model.FissionCampaignGrid, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrid), nil + } +} + +func (f fissionCampaignGridDo) Take() (*model.FissionCampaignGrid, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrid), nil + } +} + +func (f fissionCampaignGridDo) Last() (*model.FissionCampaignGrid, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrid), nil + } +} + +func (f fissionCampaignGridDo) Find() ([]*model.FissionCampaignGrid, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignGrid), err +} + +func (f fissionCampaignGridDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignGrid, err error) { + buf := make([]*model.FissionCampaignGrid, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignGridDo) FindInBatches(result *[]*model.FissionCampaignGrid, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignGridDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignGridDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignGridDo) Assign(attrs ...field.AssignExpr) *fissionCampaignGridDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignGridDo) Joins(fields ...field.RelationField) *fissionCampaignGridDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignGridDo) Preload(fields ...field.RelationField) *fissionCampaignGridDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignGridDo) FirstOrInit() (*model.FissionCampaignGrid, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrid), nil + } +} + +func (f fissionCampaignGridDo) FirstOrCreate() (*model.FissionCampaignGrid, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrid), nil + } +} + +func (f fissionCampaignGridDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignGrid, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignGridDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignGridDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignGridDo) Delete(models ...*model.FissionCampaignGrid) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignGridDo) withDO(do gen.Dao) *fissionCampaignGridDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_grow.gen.go b/internal/repository/dao/fission_campaign_grow.gen.go new file mode 100644 index 0000000..b104b7c --- /dev/null +++ b/internal/repository/dao/fission_campaign_grow.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignGrow(db *gorm.DB, opts ...gen.DOOption) fissionCampaignGrow { + _fissionCampaignGrow := fissionCampaignGrow{} + + _fissionCampaignGrow.fissionCampaignGrowDo.UseDB(db, opts...) + _fissionCampaignGrow.fissionCampaignGrowDo.UseModel(&model.FissionCampaignGrow{}) + + tableName := _fissionCampaignGrow.fissionCampaignGrowDo.TableName() + _fissionCampaignGrow.ALL = field.NewAsterisk(tableName) + _fissionCampaignGrow.ID = field.NewInt64(tableName, "id") + _fissionCampaignGrow.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignGrow.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignGrow.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignGrow.AutoHour = field.NewInt32(tableName, "auto_hour") + _fissionCampaignGrow.AutoNum = field.NewInt32(tableName, "auto_num") + _fissionCampaignGrow.GrowNum = field.NewInt32(tableName, "grow_num") + _fissionCampaignGrow.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignGrow.Revive = field.NewInt8(tableName, "revive") + _fissionCampaignGrow.ReviveNum = field.NewInt32(tableName, "revive_num") + _fissionCampaignGrow.DieHour = field.NewInt32(tableName, "die_hour") + _fissionCampaignGrow.InitNum = field.NewInt32(tableName, "init_num") + + _fissionCampaignGrow.fillFieldMap() + + return _fissionCampaignGrow +} + +type fissionCampaignGrow struct { + fissionCampaignGrowDo fissionCampaignGrowDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + AutoHour field.Int32 // 自动生产成长道具小时数 + AutoNum field.Int32 // 生产的成长道具数 + GrowNum field.Int32 // 邀请可获得的成长道具数量 + TargetNum field.Int32 // 获得成长道具需要邀请的人数 + Revive field.Int8 // 是否支持复活(0-否,1-是) + ReviveNum field.Int32 // 复活需要邀请的好友数 + DieHour field.Int32 // 未获得成长道具导致的死亡时间 + InitNum field.Int32 // 初始成长道具数量 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignGrow) Table(newTableName string) *fissionCampaignGrow { + f.fissionCampaignGrowDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignGrow) As(alias string) *fissionCampaignGrow { + f.fissionCampaignGrowDo.DO = *(f.fissionCampaignGrowDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignGrow) updateTableName(table string) *fissionCampaignGrow { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.AutoHour = field.NewInt32(table, "auto_hour") + f.AutoNum = field.NewInt32(table, "auto_num") + f.GrowNum = field.NewInt32(table, "grow_num") + f.TargetNum = field.NewInt32(table, "target_num") + f.Revive = field.NewInt8(table, "revive") + f.ReviveNum = field.NewInt32(table, "revive_num") + f.DieHour = field.NewInt32(table, "die_hour") + f.InitNum = field.NewInt32(table, "init_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignGrow) WithContext(ctx context.Context) *fissionCampaignGrowDo { + return f.fissionCampaignGrowDo.WithContext(ctx) +} + +func (f fissionCampaignGrow) TableName() string { return f.fissionCampaignGrowDo.TableName() } + +func (f fissionCampaignGrow) Alias() string { return f.fissionCampaignGrowDo.Alias() } + +func (f *fissionCampaignGrow) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignGrow) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 12) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["auto_hour"] = f.AutoHour + f.fieldMap["auto_num"] = f.AutoNum + f.fieldMap["grow_num"] = f.GrowNum + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["revive"] = f.Revive + f.fieldMap["revive_num"] = f.ReviveNum + f.fieldMap["die_hour"] = f.DieHour + f.fieldMap["init_num"] = f.InitNum +} + +func (f fissionCampaignGrow) clone(db *gorm.DB) fissionCampaignGrow { + f.fissionCampaignGrowDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignGrow) replaceDB(db *gorm.DB) fissionCampaignGrow { + f.fissionCampaignGrowDo.ReplaceDB(db) + return f +} + +type fissionCampaignGrowDo struct{ gen.DO } + +func (f fissionCampaignGrowDo) Debug() *fissionCampaignGrowDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignGrowDo) WithContext(ctx context.Context) *fissionCampaignGrowDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignGrowDo) ReadDB() *fissionCampaignGrowDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignGrowDo) WriteDB() *fissionCampaignGrowDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignGrowDo) Session(config *gorm.Session) *fissionCampaignGrowDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignGrowDo) Clauses(conds ...clause.Expression) *fissionCampaignGrowDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignGrowDo) Returning(value interface{}, columns ...string) *fissionCampaignGrowDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignGrowDo) Not(conds ...gen.Condition) *fissionCampaignGrowDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignGrowDo) Or(conds ...gen.Condition) *fissionCampaignGrowDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignGrowDo) Select(conds ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignGrowDo) Where(conds ...gen.Condition) *fissionCampaignGrowDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignGrowDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignGrowDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignGrowDo) Order(conds ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignGrowDo) Distinct(cols ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignGrowDo) Omit(cols ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignGrowDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignGrowDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignGrowDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignGrowDo) Group(cols ...field.Expr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignGrowDo) Having(conds ...gen.Condition) *fissionCampaignGrowDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignGrowDo) Limit(limit int) *fissionCampaignGrowDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignGrowDo) Offset(offset int) *fissionCampaignGrowDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignGrowDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignGrowDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignGrowDo) Unscoped() *fissionCampaignGrowDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignGrowDo) Create(values ...*model.FissionCampaignGrow) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignGrowDo) CreateInBatches(values []*model.FissionCampaignGrow, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignGrowDo) Save(values ...*model.FissionCampaignGrow) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignGrowDo) First() (*model.FissionCampaignGrow, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrow), nil + } +} + +func (f fissionCampaignGrowDo) Take() (*model.FissionCampaignGrow, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrow), nil + } +} + +func (f fissionCampaignGrowDo) Last() (*model.FissionCampaignGrow, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrow), nil + } +} + +func (f fissionCampaignGrowDo) Find() ([]*model.FissionCampaignGrow, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignGrow), err +} + +func (f fissionCampaignGrowDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignGrow, err error) { + buf := make([]*model.FissionCampaignGrow, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignGrowDo) FindInBatches(result *[]*model.FissionCampaignGrow, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignGrowDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignGrowDo) Assign(attrs ...field.AssignExpr) *fissionCampaignGrowDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignGrowDo) Joins(fields ...field.RelationField) *fissionCampaignGrowDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignGrowDo) Preload(fields ...field.RelationField) *fissionCampaignGrowDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignGrowDo) FirstOrInit() (*model.FissionCampaignGrow, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrow), nil + } +} + +func (f fissionCampaignGrowDo) FirstOrCreate() (*model.FissionCampaignGrow, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrow), nil + } +} + +func (f fissionCampaignGrowDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignGrow, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignGrowDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignGrowDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignGrowDo) Delete(models ...*model.FissionCampaignGrow) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignGrowDo) withDO(do gen.Dao) *fissionCampaignGrowDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_grow_step.gen.go b/internal/repository/dao/fission_campaign_grow_step.gen.go new file mode 100644 index 0000000..f8fc043 --- /dev/null +++ b/internal/repository/dao/fission_campaign_grow_step.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignGrowStep(db *gorm.DB, opts ...gen.DOOption) fissionCampaignGrowStep { + _fissionCampaignGrowStep := fissionCampaignGrowStep{} + + _fissionCampaignGrowStep.fissionCampaignGrowStepDo.UseDB(db, opts...) + _fissionCampaignGrowStep.fissionCampaignGrowStepDo.UseModel(&model.FissionCampaignGrowStep{}) + + tableName := _fissionCampaignGrowStep.fissionCampaignGrowStepDo.TableName() + _fissionCampaignGrowStep.ALL = field.NewAsterisk(tableName) + _fissionCampaignGrowStep.ID = field.NewInt64(tableName, "id") + _fissionCampaignGrowStep.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignGrowStep.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignGrowStep.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignGrowStep.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignGrowStep.Step = field.NewInt32(tableName, "step") + _fissionCampaignGrowStep.Num = field.NewInt32(tableName, "num") + + _fissionCampaignGrowStep.fillFieldMap() + + return _fissionCampaignGrowStep +} + +type fissionCampaignGrowStep struct { + fissionCampaignGrowStepDo fissionCampaignGrowStepDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + Step field.Int32 // 阶段 + Num field.Int32 // 需要的养成道具数量 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignGrowStep) Table(newTableName string) *fissionCampaignGrowStep { + f.fissionCampaignGrowStepDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignGrowStep) As(alias string) *fissionCampaignGrowStep { + f.fissionCampaignGrowStepDo.DO = *(f.fissionCampaignGrowStepDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignGrowStep) updateTableName(table string) *fissionCampaignGrowStep { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Step = field.NewInt32(table, "step") + f.Num = field.NewInt32(table, "num") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignGrowStep) WithContext(ctx context.Context) *fissionCampaignGrowStepDo { + return f.fissionCampaignGrowStepDo.WithContext(ctx) +} + +func (f fissionCampaignGrowStep) TableName() string { return f.fissionCampaignGrowStepDo.TableName() } + +func (f fissionCampaignGrowStep) Alias() string { return f.fissionCampaignGrowStepDo.Alias() } + +func (f *fissionCampaignGrowStep) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignGrowStep) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["step"] = f.Step + f.fieldMap["num"] = f.Num +} + +func (f fissionCampaignGrowStep) clone(db *gorm.DB) fissionCampaignGrowStep { + f.fissionCampaignGrowStepDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignGrowStep) replaceDB(db *gorm.DB) fissionCampaignGrowStep { + f.fissionCampaignGrowStepDo.ReplaceDB(db) + return f +} + +type fissionCampaignGrowStepDo struct{ gen.DO } + +func (f fissionCampaignGrowStepDo) Debug() *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignGrowStepDo) WithContext(ctx context.Context) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignGrowStepDo) ReadDB() *fissionCampaignGrowStepDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignGrowStepDo) WriteDB() *fissionCampaignGrowStepDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignGrowStepDo) Session(config *gorm.Session) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignGrowStepDo) Clauses(conds ...clause.Expression) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignGrowStepDo) Returning(value interface{}, columns ...string) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignGrowStepDo) Not(conds ...gen.Condition) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignGrowStepDo) Or(conds ...gen.Condition) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignGrowStepDo) Select(conds ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignGrowStepDo) Where(conds ...gen.Condition) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignGrowStepDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignGrowStepDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignGrowStepDo) Order(conds ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignGrowStepDo) Distinct(cols ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignGrowStepDo) Omit(cols ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignGrowStepDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignGrowStepDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignGrowStepDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignGrowStepDo) Group(cols ...field.Expr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignGrowStepDo) Having(conds ...gen.Condition) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignGrowStepDo) Limit(limit int) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignGrowStepDo) Offset(offset int) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignGrowStepDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignGrowStepDo) Unscoped() *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignGrowStepDo) Create(values ...*model.FissionCampaignGrowStep) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignGrowStepDo) CreateInBatches(values []*model.FissionCampaignGrowStep, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignGrowStepDo) Save(values ...*model.FissionCampaignGrowStep) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignGrowStepDo) First() (*model.FissionCampaignGrowStep, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrowStep), nil + } +} + +func (f fissionCampaignGrowStepDo) Take() (*model.FissionCampaignGrowStep, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrowStep), nil + } +} + +func (f fissionCampaignGrowStepDo) Last() (*model.FissionCampaignGrowStep, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrowStep), nil + } +} + +func (f fissionCampaignGrowStepDo) Find() ([]*model.FissionCampaignGrowStep, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignGrowStep), err +} + +func (f fissionCampaignGrowStepDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignGrowStep, err error) { + buf := make([]*model.FissionCampaignGrowStep, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignGrowStepDo) FindInBatches(result *[]*model.FissionCampaignGrowStep, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignGrowStepDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignGrowStepDo) Assign(attrs ...field.AssignExpr) *fissionCampaignGrowStepDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignGrowStepDo) Joins(fields ...field.RelationField) *fissionCampaignGrowStepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignGrowStepDo) Preload(fields ...field.RelationField) *fissionCampaignGrowStepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignGrowStepDo) FirstOrInit() (*model.FissionCampaignGrowStep, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrowStep), nil + } +} + +func (f fissionCampaignGrowStepDo) FirstOrCreate() (*model.FissionCampaignGrowStep, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignGrowStep), nil + } +} + +func (f fissionCampaignGrowStepDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignGrowStep, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignGrowStepDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignGrowStepDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignGrowStepDo) Delete(models ...*model.FissionCampaignGrowStep) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignGrowStepDo) withDO(do gen.Dao) *fissionCampaignGrowStepDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_keep.gen.go b/internal/repository/dao/fission_campaign_keep.gen.go new file mode 100644 index 0000000..ac71a65 --- /dev/null +++ b/internal/repository/dao/fission_campaign_keep.gen.go @@ -0,0 +1,411 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignKeep(db *gorm.DB, opts ...gen.DOOption) fissionCampaignKeep { + _fissionCampaignKeep := fissionCampaignKeep{} + + _fissionCampaignKeep.fissionCampaignKeepDo.UseDB(db, opts...) + _fissionCampaignKeep.fissionCampaignKeepDo.UseModel(&model.FissionCampaignKeep{}) + + tableName := _fissionCampaignKeep.fissionCampaignKeepDo.TableName() + _fissionCampaignKeep.ALL = field.NewAsterisk(tableName) + _fissionCampaignKeep.ID = field.NewInt64(tableName, "id") + _fissionCampaignKeep.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignKeep.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignKeep.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignKeep.Collect = field.NewInt32(tableName, "collect") + _fissionCampaignKeep.CollectSecond = field.NewInt32(tableName, "collect_second") + _fissionCampaignKeep.OpenInvite = field.NewInt8(tableName, "open_invite") + _fissionCampaignKeep.Invite = field.NewString(tableName, "invite") + _fissionCampaignKeep.InitGet = field.NewInt32(tableName, "init_get") + _fissionCampaignKeep.SecGet = field.NewFloat64(tableName, "sec_get") + _fissionCampaignKeep.FeedNum = field.NewInt32(tableName, "feed_num") + _fissionCampaignKeep.FeedCycle = field.NewInt32(tableName, "feed_cycle") + _fissionCampaignKeep.TalkText = field.NewString(tableName, "talk_text") + _fissionCampaignKeep.MaxFeed = field.NewInt32(tableName, "max_feed") + _fissionCampaignKeep.FeedGet = field.NewInt32(tableName, "feed_get") + _fissionCampaignKeep.FeedGetNum = field.NewInt32(tableName, "feed_get_num") + _fissionCampaignKeep.SecGetDayLimit = field.NewFloat64(tableName, "sec_get_day_limit") + _fissionCampaignKeep.MachineType = field.NewInt8(tableName, "machine_type") + _fissionCampaignKeep.OfflineMin = field.NewInt32(tableName, "offline_min") + _fissionCampaignKeep.OfflineGet = field.NewInt32(tableName, "offline_get") + _fissionCampaignKeep.OfflineLimit = field.NewInt32(tableName, "offline_limit") + + _fissionCampaignKeep.fillFieldMap() + + return _fissionCampaignKeep +} + +type fissionCampaignKeep struct { + fissionCampaignKeepDo fissionCampaignKeepDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + Collect field.Int32 // 获得最终奖品需要的总收集数 + CollectSecond field.Int32 // 单个收集需要的二级资源数 + OpenInvite field.Int8 // 开启邀请(0-关闭,1-开启) + Invite field.String // 邀请数据 + InitGet field.Int32 // 初始道具数 + SecGet field.Float64 // 每秒获得道具数 + FeedNum field.Int32 // 每次使用道具数 + FeedCycle field.Int32 // 喂养周期(单位:天) + TalkText field.String // 对话文案 + MaxFeed field.Int32 // 最大可领养次数 + FeedGet field.Int32 // 喂养能得到的道具数 + FeedGetNum field.Int32 // 得到喂养道具需要的喂养次数 + SecGetDayLimit field.Float64 // 每秒获得道具每日上限 + MachineType field.Int8 // 狗粮机类型(1-在线收益,2-离线收益) + OfflineMin field.Int32 // 离线分钟时长 + OfflineGet field.Int32 // 离线收益最大值 + OfflineLimit field.Int32 // 离线收益单日最大领取次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignKeep) Table(newTableName string) *fissionCampaignKeep { + f.fissionCampaignKeepDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignKeep) As(alias string) *fissionCampaignKeep { + f.fissionCampaignKeepDo.DO = *(f.fissionCampaignKeepDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignKeep) updateTableName(table string) *fissionCampaignKeep { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Collect = field.NewInt32(table, "collect") + f.CollectSecond = field.NewInt32(table, "collect_second") + f.OpenInvite = field.NewInt8(table, "open_invite") + f.Invite = field.NewString(table, "invite") + f.InitGet = field.NewInt32(table, "init_get") + f.SecGet = field.NewFloat64(table, "sec_get") + f.FeedNum = field.NewInt32(table, "feed_num") + f.FeedCycle = field.NewInt32(table, "feed_cycle") + f.TalkText = field.NewString(table, "talk_text") + f.MaxFeed = field.NewInt32(table, "max_feed") + f.FeedGet = field.NewInt32(table, "feed_get") + f.FeedGetNum = field.NewInt32(table, "feed_get_num") + f.SecGetDayLimit = field.NewFloat64(table, "sec_get_day_limit") + f.MachineType = field.NewInt8(table, "machine_type") + f.OfflineMin = field.NewInt32(table, "offline_min") + f.OfflineGet = field.NewInt32(table, "offline_get") + f.OfflineLimit = field.NewInt32(table, "offline_limit") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignKeep) WithContext(ctx context.Context) *fissionCampaignKeepDo { + return f.fissionCampaignKeepDo.WithContext(ctx) +} + +func (f fissionCampaignKeep) TableName() string { return f.fissionCampaignKeepDo.TableName() } + +func (f fissionCampaignKeep) Alias() string { return f.fissionCampaignKeepDo.Alias() } + +func (f *fissionCampaignKeep) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignKeep) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 21) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["collect"] = f.Collect + f.fieldMap["collect_second"] = f.CollectSecond + f.fieldMap["open_invite"] = f.OpenInvite + f.fieldMap["invite"] = f.Invite + f.fieldMap["init_get"] = f.InitGet + f.fieldMap["sec_get"] = f.SecGet + f.fieldMap["feed_num"] = f.FeedNum + f.fieldMap["feed_cycle"] = f.FeedCycle + f.fieldMap["talk_text"] = f.TalkText + f.fieldMap["max_feed"] = f.MaxFeed + f.fieldMap["feed_get"] = f.FeedGet + f.fieldMap["feed_get_num"] = f.FeedGetNum + f.fieldMap["sec_get_day_limit"] = f.SecGetDayLimit + f.fieldMap["machine_type"] = f.MachineType + f.fieldMap["offline_min"] = f.OfflineMin + f.fieldMap["offline_get"] = f.OfflineGet + f.fieldMap["offline_limit"] = f.OfflineLimit +} + +func (f fissionCampaignKeep) clone(db *gorm.DB) fissionCampaignKeep { + f.fissionCampaignKeepDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignKeep) replaceDB(db *gorm.DB) fissionCampaignKeep { + f.fissionCampaignKeepDo.ReplaceDB(db) + return f +} + +type fissionCampaignKeepDo struct{ gen.DO } + +func (f fissionCampaignKeepDo) Debug() *fissionCampaignKeepDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignKeepDo) WithContext(ctx context.Context) *fissionCampaignKeepDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignKeepDo) ReadDB() *fissionCampaignKeepDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignKeepDo) WriteDB() *fissionCampaignKeepDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignKeepDo) Session(config *gorm.Session) *fissionCampaignKeepDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignKeepDo) Clauses(conds ...clause.Expression) *fissionCampaignKeepDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignKeepDo) Returning(value interface{}, columns ...string) *fissionCampaignKeepDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignKeepDo) Not(conds ...gen.Condition) *fissionCampaignKeepDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignKeepDo) Or(conds ...gen.Condition) *fissionCampaignKeepDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignKeepDo) Select(conds ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignKeepDo) Where(conds ...gen.Condition) *fissionCampaignKeepDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignKeepDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignKeepDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignKeepDo) Order(conds ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignKeepDo) Distinct(cols ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignKeepDo) Omit(cols ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignKeepDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignKeepDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignKeepDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignKeepDo) Group(cols ...field.Expr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignKeepDo) Having(conds ...gen.Condition) *fissionCampaignKeepDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignKeepDo) Limit(limit int) *fissionCampaignKeepDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignKeepDo) Offset(offset int) *fissionCampaignKeepDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignKeepDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignKeepDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignKeepDo) Unscoped() *fissionCampaignKeepDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignKeepDo) Create(values ...*model.FissionCampaignKeep) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignKeepDo) CreateInBatches(values []*model.FissionCampaignKeep, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignKeepDo) Save(values ...*model.FissionCampaignKeep) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignKeepDo) First() (*model.FissionCampaignKeep, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeep), nil + } +} + +func (f fissionCampaignKeepDo) Take() (*model.FissionCampaignKeep, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeep), nil + } +} + +func (f fissionCampaignKeepDo) Last() (*model.FissionCampaignKeep, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeep), nil + } +} + +func (f fissionCampaignKeepDo) Find() ([]*model.FissionCampaignKeep, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignKeep), err +} + +func (f fissionCampaignKeepDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignKeep, err error) { + buf := make([]*model.FissionCampaignKeep, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignKeepDo) FindInBatches(result *[]*model.FissionCampaignKeep, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignKeepDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignKeepDo) Assign(attrs ...field.AssignExpr) *fissionCampaignKeepDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignKeepDo) Joins(fields ...field.RelationField) *fissionCampaignKeepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignKeepDo) Preload(fields ...field.RelationField) *fissionCampaignKeepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignKeepDo) FirstOrInit() (*model.FissionCampaignKeep, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeep), nil + } +} + +func (f fissionCampaignKeepDo) FirstOrCreate() (*model.FissionCampaignKeep, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeep), nil + } +} + +func (f fissionCampaignKeepDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignKeep, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignKeepDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignKeepDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignKeepDo) Delete(models ...*model.FissionCampaignKeep) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignKeepDo) withDO(do gen.Dao) *fissionCampaignKeepDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_keep_step.gen.go b/internal/repository/dao/fission_campaign_keep_step.gen.go new file mode 100644 index 0000000..d991289 --- /dev/null +++ b/internal/repository/dao/fission_campaign_keep_step.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignKeepStep(db *gorm.DB, opts ...gen.DOOption) fissionCampaignKeepStep { + _fissionCampaignKeepStep := fissionCampaignKeepStep{} + + _fissionCampaignKeepStep.fissionCampaignKeepStepDo.UseDB(db, opts...) + _fissionCampaignKeepStep.fissionCampaignKeepStepDo.UseModel(&model.FissionCampaignKeepStep{}) + + tableName := _fissionCampaignKeepStep.fissionCampaignKeepStepDo.TableName() + _fissionCampaignKeepStep.ALL = field.NewAsterisk(tableName) + _fissionCampaignKeepStep.ID = field.NewInt64(tableName, "id") + _fissionCampaignKeepStep.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignKeepStep.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignKeepStep.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignKeepStep.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignKeepStep.Step = field.NewInt32(tableName, "step") + _fissionCampaignKeepStep.Percent = field.NewInt32(tableName, "percent") + _fissionCampaignKeepStep.RewardType = field.NewInt8(tableName, "reward_type") + _fissionCampaignKeepStep.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignKeepStep.RewardNum = field.NewInt32(tableName, "reward_num") + + _fissionCampaignKeepStep.fillFieldMap() + + return _fissionCampaignKeepStep +} + +type fissionCampaignKeepStep struct { + fissionCampaignKeepStepDo fissionCampaignKeepStepDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 + CampaignID field.Int64 // 活动ID + Step field.Int32 // 阶段 + Percent field.Int32 // 对应的进度条数值 + RewardType field.Int8 // 奖品类型(1-成长道具,2-奖品) + RewardID field.Int64 // 奖品id + RewardNum field.Int32 // 发放道具数量 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignKeepStep) Table(newTableName string) *fissionCampaignKeepStep { + f.fissionCampaignKeepStepDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignKeepStep) As(alias string) *fissionCampaignKeepStep { + f.fissionCampaignKeepStepDo.DO = *(f.fissionCampaignKeepStepDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignKeepStep) updateTableName(table string) *fissionCampaignKeepStep { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Step = field.NewInt32(table, "step") + f.Percent = field.NewInt32(table, "percent") + f.RewardType = field.NewInt8(table, "reward_type") + f.RewardID = field.NewInt64(table, "reward_id") + f.RewardNum = field.NewInt32(table, "reward_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignKeepStep) WithContext(ctx context.Context) *fissionCampaignKeepStepDo { + return f.fissionCampaignKeepStepDo.WithContext(ctx) +} + +func (f fissionCampaignKeepStep) TableName() string { return f.fissionCampaignKeepStepDo.TableName() } + +func (f fissionCampaignKeepStep) Alias() string { return f.fissionCampaignKeepStepDo.Alias() } + +func (f *fissionCampaignKeepStep) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignKeepStep) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["step"] = f.Step + f.fieldMap["percent"] = f.Percent + f.fieldMap["reward_type"] = f.RewardType + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["reward_num"] = f.RewardNum +} + +func (f fissionCampaignKeepStep) clone(db *gorm.DB) fissionCampaignKeepStep { + f.fissionCampaignKeepStepDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignKeepStep) replaceDB(db *gorm.DB) fissionCampaignKeepStep { + f.fissionCampaignKeepStepDo.ReplaceDB(db) + return f +} + +type fissionCampaignKeepStepDo struct{ gen.DO } + +func (f fissionCampaignKeepStepDo) Debug() *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignKeepStepDo) WithContext(ctx context.Context) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignKeepStepDo) ReadDB() *fissionCampaignKeepStepDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignKeepStepDo) WriteDB() *fissionCampaignKeepStepDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignKeepStepDo) Session(config *gorm.Session) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignKeepStepDo) Clauses(conds ...clause.Expression) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignKeepStepDo) Returning(value interface{}, columns ...string) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignKeepStepDo) Not(conds ...gen.Condition) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignKeepStepDo) Or(conds ...gen.Condition) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignKeepStepDo) Select(conds ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignKeepStepDo) Where(conds ...gen.Condition) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignKeepStepDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignKeepStepDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignKeepStepDo) Order(conds ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignKeepStepDo) Distinct(cols ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignKeepStepDo) Omit(cols ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignKeepStepDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignKeepStepDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignKeepStepDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignKeepStepDo) Group(cols ...field.Expr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignKeepStepDo) Having(conds ...gen.Condition) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignKeepStepDo) Limit(limit int) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignKeepStepDo) Offset(offset int) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignKeepStepDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignKeepStepDo) Unscoped() *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignKeepStepDo) Create(values ...*model.FissionCampaignKeepStep) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignKeepStepDo) CreateInBatches(values []*model.FissionCampaignKeepStep, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignKeepStepDo) Save(values ...*model.FissionCampaignKeepStep) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignKeepStepDo) First() (*model.FissionCampaignKeepStep, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeepStep), nil + } +} + +func (f fissionCampaignKeepStepDo) Take() (*model.FissionCampaignKeepStep, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeepStep), nil + } +} + +func (f fissionCampaignKeepStepDo) Last() (*model.FissionCampaignKeepStep, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeepStep), nil + } +} + +func (f fissionCampaignKeepStepDo) Find() ([]*model.FissionCampaignKeepStep, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignKeepStep), err +} + +func (f fissionCampaignKeepStepDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignKeepStep, err error) { + buf := make([]*model.FissionCampaignKeepStep, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignKeepStepDo) FindInBatches(result *[]*model.FissionCampaignKeepStep, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignKeepStepDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignKeepStepDo) Assign(attrs ...field.AssignExpr) *fissionCampaignKeepStepDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignKeepStepDo) Joins(fields ...field.RelationField) *fissionCampaignKeepStepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignKeepStepDo) Preload(fields ...field.RelationField) *fissionCampaignKeepStepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignKeepStepDo) FirstOrInit() (*model.FissionCampaignKeepStep, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeepStep), nil + } +} + +func (f fissionCampaignKeepStepDo) FirstOrCreate() (*model.FissionCampaignKeepStep, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignKeepStep), nil + } +} + +func (f fissionCampaignKeepStepDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignKeepStep, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignKeepStepDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignKeepStepDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignKeepStepDo) Delete(models ...*model.FissionCampaignKeepStep) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignKeepStepDo) withDO(do gen.Dao) *fissionCampaignKeepStepDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_lang.gen.go b/internal/repository/dao/fission_campaign_lang.gen.go new file mode 100644 index 0000000..dee985d --- /dev/null +++ b/internal/repository/dao/fission_campaign_lang.gen.go @@ -0,0 +1,475 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignLang(db *gorm.DB, opts ...gen.DOOption) fissionCampaignLang { + _fissionCampaignLang := fissionCampaignLang{} + + _fissionCampaignLang.fissionCampaignLangDo.UseDB(db, opts...) + _fissionCampaignLang.fissionCampaignLangDo.UseModel(&model.FissionCampaignLang{}) + + tableName := _fissionCampaignLang.fissionCampaignLangDo.TableName() + _fissionCampaignLang.ALL = field.NewAsterisk(tableName) + _fissionCampaignLang.ID = field.NewInt64(tableName, "id") + _fissionCampaignLang.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignLang.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignLang.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignLang.HashID = field.NewString(tableName, "hash_id") + _fissionCampaignLang.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignLang.LangMark = field.NewString(tableName, "lang_mark") + _fissionCampaignLang.PageTitle = field.NewString(tableName, "page_title") + _fissionCampaignLang.ImageMain = field.NewString(tableName, "image_main") + _fissionCampaignLang.DownloadPageImage = field.NewString(tableName, "download_page_image") + _fissionCampaignLang.WechatPageImage = field.NewString(tableName, "wechat_page_image") + _fissionCampaignLang.ContentImg = field.NewString(tableName, "content_img") + _fissionCampaignLang.WebBgImg = field.NewString(tableName, "web_bg_img") + _fissionCampaignLang.WarmUpImg = field.NewString(tableName, "warm_up_img") + _fissionCampaignLang.DlBgImg = field.NewString(tableName, "dl_bg_img") + _fissionCampaignLang.DlBannerImg = field.NewString(tableName, "dl_banner_img") + _fissionCampaignLang.DlBannerAppLogo = field.NewString(tableName, "dl_banner_app_logo") + _fissionCampaignLang.DlBannerAppName = field.NewString(tableName, "dl_banner_app_name") + _fissionCampaignLang.DlBannerAppBtn = field.NewString(tableName, "dl_banner_app_btn") + _fissionCampaignLang.ShareText = field.NewString(tableName, "share_text") + _fissionCampaignLang.ShareImg = field.NewString(tableName, "share_img") + _fissionCampaignLang.Rule = field.NewString(tableName, "rule") + _fissionCampaignLang.RuleImg = field.NewString(tableName, "rule_img") + _fissionCampaignLang.Conds = field.NewString(tableName, "conds") + _fissionCampaignLang.Quit = field.NewString(tableName, "quit") + _fissionCampaignLang.Questions = field.NewString(tableName, "questions") + _fissionCampaignLang.QaGroup = field.NewString(tableName, "qa_group") + _fissionCampaignLang.LongImg = field.NewString(tableName, "long_img") + _fissionCampaignLang.Cash = field.NewString(tableName, "cash") + _fissionCampaignLang.Gold = field.NewString(tableName, "gold") + _fissionCampaignLang.TOffset = field.NewInt32(tableName, "t_offset") + _fissionCampaignLang.TalkText = field.NewString(tableName, "talk_text") + _fissionCampaignLang.Coin = field.NewString(tableName, "coin") + _fissionCampaignLang.TopicColor = field.NewString(tableName, "topic_color") + _fissionCampaignLang.PcBg = field.NewString(tableName, "pc_bg") + _fissionCampaignLang.Vs = field.NewString(tableName, "vs") + _fissionCampaignLang.Uno = field.NewString(tableName, "uno") + + _fissionCampaignLang.fillFieldMap() + + return _fissionCampaignLang +} + +type fissionCampaignLang struct { + fissionCampaignLangDo fissionCampaignLangDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 对外hash_id + CampaignID field.Int64 // 活动id(fission_campaign表) + LangMark field.String // 语言对应的唯一标识 + PageTitle field.String // 页面标题 + ImageMain field.String // 活动主图 + DownloadPageImage field.String // 下载引导页的图片 + WechatPageImage field.String // 微信引导页的图片 + ContentImg field.String // 内容背景图 + WebBgImg field.String // 站外背景图地址 + WarmUpImg field.String // 预热海报图 + DlBgImg field.String // 引导页背景图 + DlBannerImg field.String // 下载页横幅自定义图 + DlBannerAppLogo field.String // 下载页横幅applogo图片 + DlBannerAppName field.String // 下载页横幅app名称 + DlBannerAppBtn field.String // 下载页横幅app按钮文案 + ShareText field.String // 分享文案 + ShareImg field.String // 分享图片 + Rule field.String // 活动规则 + RuleImg field.String // 活动规则图片 + Conds field.String // 事件驱动的条件描述 + Quit field.String // 谁是冠军选项数据 + Questions field.String // 题目数据 + QaGroup field.String // 题库数据 + LongImg field.String // 长图数据 + Cash field.String // 现金抽奖数据 + Gold field.String // 金币任务数据 + TOffset field.Int32 // 时间偏移量 + TalkText field.String // 对话文案 + Coin field.String // 金币池数据 + TopicColor field.String // 主题色 + PcBg field.String + Vs field.String // 赛事竞猜数据 + Uno field.String // uno卡牌数据 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignLang) Table(newTableName string) *fissionCampaignLang { + f.fissionCampaignLangDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignLang) As(alias string) *fissionCampaignLang { + f.fissionCampaignLangDo.DO = *(f.fissionCampaignLangDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignLang) updateTableName(table string) *fissionCampaignLang { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.LangMark = field.NewString(table, "lang_mark") + f.PageTitle = field.NewString(table, "page_title") + f.ImageMain = field.NewString(table, "image_main") + f.DownloadPageImage = field.NewString(table, "download_page_image") + f.WechatPageImage = field.NewString(table, "wechat_page_image") + f.ContentImg = field.NewString(table, "content_img") + f.WebBgImg = field.NewString(table, "web_bg_img") + f.WarmUpImg = field.NewString(table, "warm_up_img") + f.DlBgImg = field.NewString(table, "dl_bg_img") + f.DlBannerImg = field.NewString(table, "dl_banner_img") + f.DlBannerAppLogo = field.NewString(table, "dl_banner_app_logo") + f.DlBannerAppName = field.NewString(table, "dl_banner_app_name") + f.DlBannerAppBtn = field.NewString(table, "dl_banner_app_btn") + f.ShareText = field.NewString(table, "share_text") + f.ShareImg = field.NewString(table, "share_img") + f.Rule = field.NewString(table, "rule") + f.RuleImg = field.NewString(table, "rule_img") + f.Conds = field.NewString(table, "conds") + f.Quit = field.NewString(table, "quit") + f.Questions = field.NewString(table, "questions") + f.QaGroup = field.NewString(table, "qa_group") + f.LongImg = field.NewString(table, "long_img") + f.Cash = field.NewString(table, "cash") + f.Gold = field.NewString(table, "gold") + f.TOffset = field.NewInt32(table, "t_offset") + f.TalkText = field.NewString(table, "talk_text") + f.Coin = field.NewString(table, "coin") + f.TopicColor = field.NewString(table, "topic_color") + f.PcBg = field.NewString(table, "pc_bg") + f.Vs = field.NewString(table, "vs") + f.Uno = field.NewString(table, "uno") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignLang) WithContext(ctx context.Context) *fissionCampaignLangDo { + return f.fissionCampaignLangDo.WithContext(ctx) +} + +func (f fissionCampaignLang) TableName() string { return f.fissionCampaignLangDo.TableName() } + +func (f fissionCampaignLang) Alias() string { return f.fissionCampaignLangDo.Alias() } + +func (f *fissionCampaignLang) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignLang) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 37) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["lang_mark"] = f.LangMark + f.fieldMap["page_title"] = f.PageTitle + f.fieldMap["image_main"] = f.ImageMain + f.fieldMap["download_page_image"] = f.DownloadPageImage + f.fieldMap["wechat_page_image"] = f.WechatPageImage + f.fieldMap["content_img"] = f.ContentImg + f.fieldMap["web_bg_img"] = f.WebBgImg + f.fieldMap["warm_up_img"] = f.WarmUpImg + f.fieldMap["dl_bg_img"] = f.DlBgImg + f.fieldMap["dl_banner_img"] = f.DlBannerImg + f.fieldMap["dl_banner_app_logo"] = f.DlBannerAppLogo + f.fieldMap["dl_banner_app_name"] = f.DlBannerAppName + f.fieldMap["dl_banner_app_btn"] = f.DlBannerAppBtn + f.fieldMap["share_text"] = f.ShareText + f.fieldMap["share_img"] = f.ShareImg + f.fieldMap["rule"] = f.Rule + f.fieldMap["rule_img"] = f.RuleImg + f.fieldMap["conds"] = f.Conds + f.fieldMap["quit"] = f.Quit + f.fieldMap["questions"] = f.Questions + f.fieldMap["qa_group"] = f.QaGroup + f.fieldMap["long_img"] = f.LongImg + f.fieldMap["cash"] = f.Cash + f.fieldMap["gold"] = f.Gold + f.fieldMap["t_offset"] = f.TOffset + f.fieldMap["talk_text"] = f.TalkText + f.fieldMap["coin"] = f.Coin + f.fieldMap["topic_color"] = f.TopicColor + f.fieldMap["pc_bg"] = f.PcBg + f.fieldMap["vs"] = f.Vs + f.fieldMap["uno"] = f.Uno +} + +func (f fissionCampaignLang) clone(db *gorm.DB) fissionCampaignLang { + f.fissionCampaignLangDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignLang) replaceDB(db *gorm.DB) fissionCampaignLang { + f.fissionCampaignLangDo.ReplaceDB(db) + return f +} + +type fissionCampaignLangDo struct{ gen.DO } + +func (f fissionCampaignLangDo) Debug() *fissionCampaignLangDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignLangDo) WithContext(ctx context.Context) *fissionCampaignLangDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignLangDo) ReadDB() *fissionCampaignLangDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignLangDo) WriteDB() *fissionCampaignLangDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignLangDo) Session(config *gorm.Session) *fissionCampaignLangDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignLangDo) Clauses(conds ...clause.Expression) *fissionCampaignLangDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignLangDo) Returning(value interface{}, columns ...string) *fissionCampaignLangDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignLangDo) Not(conds ...gen.Condition) *fissionCampaignLangDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignLangDo) Or(conds ...gen.Condition) *fissionCampaignLangDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignLangDo) Select(conds ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignLangDo) Where(conds ...gen.Condition) *fissionCampaignLangDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignLangDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignLangDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignLangDo) Order(conds ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignLangDo) Distinct(cols ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignLangDo) Omit(cols ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignLangDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignLangDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignLangDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignLangDo) Group(cols ...field.Expr) *fissionCampaignLangDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignLangDo) Having(conds ...gen.Condition) *fissionCampaignLangDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignLangDo) Limit(limit int) *fissionCampaignLangDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignLangDo) Offset(offset int) *fissionCampaignLangDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignLangDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignLangDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignLangDo) Unscoped() *fissionCampaignLangDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignLangDo) Create(values ...*model.FissionCampaignLang) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignLangDo) CreateInBatches(values []*model.FissionCampaignLang, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignLangDo) Save(values ...*model.FissionCampaignLang) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignLangDo) First() (*model.FissionCampaignLang, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLang), nil + } +} + +func (f fissionCampaignLangDo) Take() (*model.FissionCampaignLang, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLang), nil + } +} + +func (f fissionCampaignLangDo) Last() (*model.FissionCampaignLang, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLang), nil + } +} + +func (f fissionCampaignLangDo) Find() ([]*model.FissionCampaignLang, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignLang), err +} + +func (f fissionCampaignLangDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignLang, err error) { + buf := make([]*model.FissionCampaignLang, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignLangDo) FindInBatches(result *[]*model.FissionCampaignLang, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignLangDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignLangDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignLangDo) Assign(attrs ...field.AssignExpr) *fissionCampaignLangDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignLangDo) Joins(fields ...field.RelationField) *fissionCampaignLangDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignLangDo) Preload(fields ...field.RelationField) *fissionCampaignLangDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignLangDo) FirstOrInit() (*model.FissionCampaignLang, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLang), nil + } +} + +func (f fissionCampaignLangDo) FirstOrCreate() (*model.FissionCampaignLang, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLang), nil + } +} + +func (f fissionCampaignLangDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignLang, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignLangDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignLangDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignLangDo) Delete(models ...*model.FissionCampaignLang) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignLangDo) withDO(do gen.Dao) *fissionCampaignLangDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_long_img.gen.go b/internal/repository/dao/fission_campaign_long_img.gen.go new file mode 100644 index 0000000..3a892f2 --- /dev/null +++ b/internal/repository/dao/fission_campaign_long_img.gen.go @@ -0,0 +1,383 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignLongImg(db *gorm.DB, opts ...gen.DOOption) fissionCampaignLongImg { + _fissionCampaignLongImg := fissionCampaignLongImg{} + + _fissionCampaignLongImg.fissionCampaignLongImgDo.UseDB(db, opts...) + _fissionCampaignLongImg.fissionCampaignLongImgDo.UseModel(&model.FissionCampaignLongImg{}) + + tableName := _fissionCampaignLongImg.fissionCampaignLongImgDo.TableName() + _fissionCampaignLongImg.ALL = field.NewAsterisk(tableName) + _fissionCampaignLongImg.ID = field.NewInt64(tableName, "id") + _fissionCampaignLongImg.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignLongImg.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignLongImg.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignLongImg.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignLongImg.LangID = field.NewInt64(tableName, "lang_id") + _fissionCampaignLongImg.LangSourceID = field.NewInt64(tableName, "lang_source_id") + _fissionCampaignLongImg.ClickType = field.NewInt8(tableName, "click_type") + _fissionCampaignLongImg.ImgURL = field.NewString(tableName, "img_url") + _fissionCampaignLongImg.WebURL = field.NewString(tableName, "web_url") + _fissionCampaignLongImg.AppParam = field.NewString(tableName, "app_param") + _fissionCampaignLongImg.PcParam = field.NewString(tableName, "pc_param") + _fissionCampaignLongImg.TargetType = field.NewInt8(tableName, "target_type") + _fissionCampaignLongImg.TargetID = field.NewInt64(tableName, "target_id") + + _fissionCampaignLongImg.fillFieldMap() + + return _fissionCampaignLongImg +} + +type fissionCampaignLongImg struct { + fissionCampaignLongImgDo fissionCampaignLongImgDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID(fission_campaign表) + LangID field.Int64 // 语言ID(fission_campaign_lang表) + LangSourceID field.Int64 // 语言长途源ID + ClickType field.Int8 // 点击类型(1-整图点击,2-区域点击) + ImgURL field.String // 图片地址 + WebURL field.String // Web跳转地址 + AppParam field.String // App跳转参数 + PcParam field.String // pc跳转参数 + TargetType field.Int8 // 跳转目标(1-指定地址,2-活动) + TargetID field.Int64 // 目标id + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignLongImg) Table(newTableName string) *fissionCampaignLongImg { + f.fissionCampaignLongImgDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignLongImg) As(alias string) *fissionCampaignLongImg { + f.fissionCampaignLongImgDo.DO = *(f.fissionCampaignLongImgDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignLongImg) updateTableName(table string) *fissionCampaignLongImg { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.LangID = field.NewInt64(table, "lang_id") + f.LangSourceID = field.NewInt64(table, "lang_source_id") + f.ClickType = field.NewInt8(table, "click_type") + f.ImgURL = field.NewString(table, "img_url") + f.WebURL = field.NewString(table, "web_url") + f.AppParam = field.NewString(table, "app_param") + f.PcParam = field.NewString(table, "pc_param") + f.TargetType = field.NewInt8(table, "target_type") + f.TargetID = field.NewInt64(table, "target_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignLongImg) WithContext(ctx context.Context) *fissionCampaignLongImgDo { + return f.fissionCampaignLongImgDo.WithContext(ctx) +} + +func (f fissionCampaignLongImg) TableName() string { return f.fissionCampaignLongImgDo.TableName() } + +func (f fissionCampaignLongImg) Alias() string { return f.fissionCampaignLongImgDo.Alias() } + +func (f *fissionCampaignLongImg) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignLongImg) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 14) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["lang_id"] = f.LangID + f.fieldMap["lang_source_id"] = f.LangSourceID + f.fieldMap["click_type"] = f.ClickType + f.fieldMap["img_url"] = f.ImgURL + f.fieldMap["web_url"] = f.WebURL + f.fieldMap["app_param"] = f.AppParam + f.fieldMap["pc_param"] = f.PcParam + f.fieldMap["target_type"] = f.TargetType + f.fieldMap["target_id"] = f.TargetID +} + +func (f fissionCampaignLongImg) clone(db *gorm.DB) fissionCampaignLongImg { + f.fissionCampaignLongImgDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignLongImg) replaceDB(db *gorm.DB) fissionCampaignLongImg { + f.fissionCampaignLongImgDo.ReplaceDB(db) + return f +} + +type fissionCampaignLongImgDo struct{ gen.DO } + +func (f fissionCampaignLongImgDo) Debug() *fissionCampaignLongImgDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignLongImgDo) WithContext(ctx context.Context) *fissionCampaignLongImgDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignLongImgDo) ReadDB() *fissionCampaignLongImgDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignLongImgDo) WriteDB() *fissionCampaignLongImgDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignLongImgDo) Session(config *gorm.Session) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignLongImgDo) Clauses(conds ...clause.Expression) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignLongImgDo) Returning(value interface{}, columns ...string) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignLongImgDo) Not(conds ...gen.Condition) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignLongImgDo) Or(conds ...gen.Condition) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignLongImgDo) Select(conds ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignLongImgDo) Where(conds ...gen.Condition) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignLongImgDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignLongImgDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignLongImgDo) Order(conds ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignLongImgDo) Distinct(cols ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignLongImgDo) Omit(cols ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignLongImgDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignLongImgDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignLongImgDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignLongImgDo) Group(cols ...field.Expr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignLongImgDo) Having(conds ...gen.Condition) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignLongImgDo) Limit(limit int) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignLongImgDo) Offset(offset int) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignLongImgDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignLongImgDo) Unscoped() *fissionCampaignLongImgDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignLongImgDo) Create(values ...*model.FissionCampaignLongImg) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignLongImgDo) CreateInBatches(values []*model.FissionCampaignLongImg, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignLongImgDo) Save(values ...*model.FissionCampaignLongImg) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignLongImgDo) First() (*model.FissionCampaignLongImg, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImg), nil + } +} + +func (f fissionCampaignLongImgDo) Take() (*model.FissionCampaignLongImg, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImg), nil + } +} + +func (f fissionCampaignLongImgDo) Last() (*model.FissionCampaignLongImg, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImg), nil + } +} + +func (f fissionCampaignLongImgDo) Find() ([]*model.FissionCampaignLongImg, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignLongImg), err +} + +func (f fissionCampaignLongImgDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignLongImg, err error) { + buf := make([]*model.FissionCampaignLongImg, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignLongImgDo) FindInBatches(result *[]*model.FissionCampaignLongImg, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignLongImgDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignLongImgDo) Assign(attrs ...field.AssignExpr) *fissionCampaignLongImgDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignLongImgDo) Joins(fields ...field.RelationField) *fissionCampaignLongImgDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignLongImgDo) Preload(fields ...field.RelationField) *fissionCampaignLongImgDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignLongImgDo) FirstOrInit() (*model.FissionCampaignLongImg, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImg), nil + } +} + +func (f fissionCampaignLongImgDo) FirstOrCreate() (*model.FissionCampaignLongImg, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImg), nil + } +} + +func (f fissionCampaignLongImgDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignLongImg, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignLongImgDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignLongImgDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignLongImgDo) Delete(models ...*model.FissionCampaignLongImg) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignLongImgDo) withDO(do gen.Dao) *fissionCampaignLongImgDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_long_img_zone.gen.go b/internal/repository/dao/fission_campaign_long_img_zone.gen.go new file mode 100644 index 0000000..144391b --- /dev/null +++ b/internal/repository/dao/fission_campaign_long_img_zone.gen.go @@ -0,0 +1,389 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignLongImgZone(db *gorm.DB, opts ...gen.DOOption) fissionCampaignLongImgZone { + _fissionCampaignLongImgZone := fissionCampaignLongImgZone{} + + _fissionCampaignLongImgZone.fissionCampaignLongImgZoneDo.UseDB(db, opts...) + _fissionCampaignLongImgZone.fissionCampaignLongImgZoneDo.UseModel(&model.FissionCampaignLongImgZone{}) + + tableName := _fissionCampaignLongImgZone.fissionCampaignLongImgZoneDo.TableName() + _fissionCampaignLongImgZone.ALL = field.NewAsterisk(tableName) + _fissionCampaignLongImgZone.ID = field.NewInt64(tableName, "id") + _fissionCampaignLongImgZone.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignLongImgZone.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignLongImgZone.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignLongImgZone.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignLongImgZone.ImgID = field.NewInt64(tableName, "img_id") + _fissionCampaignLongImgZone.WebURL = field.NewString(tableName, "web_url") + _fissionCampaignLongImgZone.AppParam = field.NewString(tableName, "app_param") + _fissionCampaignLongImgZone.PcParam = field.NewString(tableName, "pc_param") + _fissionCampaignLongImgZone.ClickX = field.NewFloat64(tableName, "click_x") + _fissionCampaignLongImgZone.ClickY = field.NewFloat64(tableName, "click_y") + _fissionCampaignLongImgZone.ClickH = field.NewFloat64(tableName, "click_h") + _fissionCampaignLongImgZone.ClickW = field.NewFloat64(tableName, "click_w") + _fissionCampaignLongImgZone.TargetType = field.NewInt8(tableName, "target_type") + _fissionCampaignLongImgZone.TargetID = field.NewInt64(tableName, "target_id") + + _fissionCampaignLongImgZone.fillFieldMap() + + return _fissionCampaignLongImgZone +} + +type fissionCampaignLongImgZone struct { + fissionCampaignLongImgZoneDo fissionCampaignLongImgZoneDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID(fission_campaign表) + ImgID field.Int64 // 长图ID(fission_campaign_long_img表) + WebURL field.String // Web跳转地址 + AppParam field.String // App跳转参数 + PcParam field.String // pc跳转参数 + ClickX field.Float64 // 点击区域x + ClickY field.Float64 // 点击区域y + ClickH field.Float64 // 点击区域h + ClickW field.Float64 // 点击区域w + TargetType field.Int8 // 跳转目标(1-指定地址,2-活动) + TargetID field.Int64 // 目标id + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignLongImgZone) Table(newTableName string) *fissionCampaignLongImgZone { + f.fissionCampaignLongImgZoneDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignLongImgZone) As(alias string) *fissionCampaignLongImgZone { + f.fissionCampaignLongImgZoneDo.DO = *(f.fissionCampaignLongImgZoneDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignLongImgZone) updateTableName(table string) *fissionCampaignLongImgZone { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ImgID = field.NewInt64(table, "img_id") + f.WebURL = field.NewString(table, "web_url") + f.AppParam = field.NewString(table, "app_param") + f.PcParam = field.NewString(table, "pc_param") + f.ClickX = field.NewFloat64(table, "click_x") + f.ClickY = field.NewFloat64(table, "click_y") + f.ClickH = field.NewFloat64(table, "click_h") + f.ClickW = field.NewFloat64(table, "click_w") + f.TargetType = field.NewInt8(table, "target_type") + f.TargetID = field.NewInt64(table, "target_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignLongImgZone) WithContext(ctx context.Context) *fissionCampaignLongImgZoneDo { + return f.fissionCampaignLongImgZoneDo.WithContext(ctx) +} + +func (f fissionCampaignLongImgZone) TableName() string { + return f.fissionCampaignLongImgZoneDo.TableName() +} + +func (f fissionCampaignLongImgZone) Alias() string { return f.fissionCampaignLongImgZoneDo.Alias() } + +func (f *fissionCampaignLongImgZone) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignLongImgZone) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 15) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["img_id"] = f.ImgID + f.fieldMap["web_url"] = f.WebURL + f.fieldMap["app_param"] = f.AppParam + f.fieldMap["pc_param"] = f.PcParam + f.fieldMap["click_x"] = f.ClickX + f.fieldMap["click_y"] = f.ClickY + f.fieldMap["click_h"] = f.ClickH + f.fieldMap["click_w"] = f.ClickW + f.fieldMap["target_type"] = f.TargetType + f.fieldMap["target_id"] = f.TargetID +} + +func (f fissionCampaignLongImgZone) clone(db *gorm.DB) fissionCampaignLongImgZone { + f.fissionCampaignLongImgZoneDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignLongImgZone) replaceDB(db *gorm.DB) fissionCampaignLongImgZone { + f.fissionCampaignLongImgZoneDo.ReplaceDB(db) + return f +} + +type fissionCampaignLongImgZoneDo struct{ gen.DO } + +func (f fissionCampaignLongImgZoneDo) Debug() *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignLongImgZoneDo) WithContext(ctx context.Context) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignLongImgZoneDo) ReadDB() *fissionCampaignLongImgZoneDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignLongImgZoneDo) WriteDB() *fissionCampaignLongImgZoneDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignLongImgZoneDo) Session(config *gorm.Session) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignLongImgZoneDo) Clauses(conds ...clause.Expression) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Returning(value interface{}, columns ...string) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignLongImgZoneDo) Not(conds ...gen.Condition) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Or(conds ...gen.Condition) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Select(conds ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Where(conds ...gen.Condition) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignLongImgZoneDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignLongImgZoneDo) Order(conds ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Distinct(cols ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignLongImgZoneDo) Omit(cols ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignLongImgZoneDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignLongImgZoneDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignLongImgZoneDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignLongImgZoneDo) Group(cols ...field.Expr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignLongImgZoneDo) Having(conds ...gen.Condition) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignLongImgZoneDo) Limit(limit int) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignLongImgZoneDo) Offset(offset int) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignLongImgZoneDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignLongImgZoneDo) Unscoped() *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignLongImgZoneDo) Create(values ...*model.FissionCampaignLongImgZone) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignLongImgZoneDo) CreateInBatches(values []*model.FissionCampaignLongImgZone, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignLongImgZoneDo) Save(values ...*model.FissionCampaignLongImgZone) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignLongImgZoneDo) First() (*model.FissionCampaignLongImgZone, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImgZone), nil + } +} + +func (f fissionCampaignLongImgZoneDo) Take() (*model.FissionCampaignLongImgZone, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImgZone), nil + } +} + +func (f fissionCampaignLongImgZoneDo) Last() (*model.FissionCampaignLongImgZone, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImgZone), nil + } +} + +func (f fissionCampaignLongImgZoneDo) Find() ([]*model.FissionCampaignLongImgZone, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignLongImgZone), err +} + +func (f fissionCampaignLongImgZoneDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignLongImgZone, err error) { + buf := make([]*model.FissionCampaignLongImgZone, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignLongImgZoneDo) FindInBatches(result *[]*model.FissionCampaignLongImgZone, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignLongImgZoneDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignLongImgZoneDo) Assign(attrs ...field.AssignExpr) *fissionCampaignLongImgZoneDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignLongImgZoneDo) Joins(fields ...field.RelationField) *fissionCampaignLongImgZoneDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignLongImgZoneDo) Preload(fields ...field.RelationField) *fissionCampaignLongImgZoneDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignLongImgZoneDo) FirstOrInit() (*model.FissionCampaignLongImgZone, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImgZone), nil + } +} + +func (f fissionCampaignLongImgZoneDo) FirstOrCreate() (*model.FissionCampaignLongImgZone, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignLongImgZone), nil + } +} + +func (f fissionCampaignLongImgZoneDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignLongImgZone, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignLongImgZoneDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignLongImgZoneDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignLongImgZoneDo) Delete(models ...*model.FissionCampaignLongImgZone) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignLongImgZoneDo) withDO(do gen.Dao) *fissionCampaignLongImgZoneDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_points_use.gen.go b/internal/repository/dao/fission_campaign_points_use.gen.go new file mode 100644 index 0000000..7968a1a --- /dev/null +++ b/internal/repository/dao/fission_campaign_points_use.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignPointsUse(db *gorm.DB, opts ...gen.DOOption) fissionCampaignPointsUse { + _fissionCampaignPointsUse := fissionCampaignPointsUse{} + + _fissionCampaignPointsUse.fissionCampaignPointsUseDo.UseDB(db, opts...) + _fissionCampaignPointsUse.fissionCampaignPointsUseDo.UseModel(&model.FissionCampaignPointsUse{}) + + tableName := _fissionCampaignPointsUse.fissionCampaignPointsUseDo.TableName() + _fissionCampaignPointsUse.ALL = field.NewAsterisk(tableName) + _fissionCampaignPointsUse.ID = field.NewInt64(tableName, "id") + _fissionCampaignPointsUse.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignPointsUse.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignPointsUse.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignPointsUse.Icon = field.NewString(tableName, "icon") + _fissionCampaignPointsUse.URLID = field.NewInt64(tableName, "url_id") + _fissionCampaignPointsUse.UseNum = field.NewInt32(tableName, "use_num") + _fissionCampaignPointsUse.DayLimit = field.NewInt32(tableName, "day_limit") + _fissionCampaignPointsUse.TotalLimit = field.NewInt32(tableName, "total_limit") + + _fissionCampaignPointsUse.fillFieldMap() + + return _fissionCampaignPointsUse +} + +type fissionCampaignPointsUse struct { + fissionCampaignPointsUseDo fissionCampaignPointsUseDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + Icon field.String // 积分图 + URLID field.Int64 // 积分回调地址id + UseNum field.Int32 // 单次兑换使用积分数字 + DayLimit field.Int32 // 每日可兑换次数 + TotalLimit field.Int32 // 总兑换次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignPointsUse) Table(newTableName string) *fissionCampaignPointsUse { + f.fissionCampaignPointsUseDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignPointsUse) As(alias string) *fissionCampaignPointsUse { + f.fissionCampaignPointsUseDo.DO = *(f.fissionCampaignPointsUseDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignPointsUse) updateTableName(table string) *fissionCampaignPointsUse { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Icon = field.NewString(table, "icon") + f.URLID = field.NewInt64(table, "url_id") + f.UseNum = field.NewInt32(table, "use_num") + f.DayLimit = field.NewInt32(table, "day_limit") + f.TotalLimit = field.NewInt32(table, "total_limit") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignPointsUse) WithContext(ctx context.Context) *fissionCampaignPointsUseDo { + return f.fissionCampaignPointsUseDo.WithContext(ctx) +} + +func (f fissionCampaignPointsUse) TableName() string { return f.fissionCampaignPointsUseDo.TableName() } + +func (f fissionCampaignPointsUse) Alias() string { return f.fissionCampaignPointsUseDo.Alias() } + +func (f *fissionCampaignPointsUse) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignPointsUse) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["icon"] = f.Icon + f.fieldMap["url_id"] = f.URLID + f.fieldMap["use_num"] = f.UseNum + f.fieldMap["day_limit"] = f.DayLimit + f.fieldMap["total_limit"] = f.TotalLimit +} + +func (f fissionCampaignPointsUse) clone(db *gorm.DB) fissionCampaignPointsUse { + f.fissionCampaignPointsUseDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignPointsUse) replaceDB(db *gorm.DB) fissionCampaignPointsUse { + f.fissionCampaignPointsUseDo.ReplaceDB(db) + return f +} + +type fissionCampaignPointsUseDo struct{ gen.DO } + +func (f fissionCampaignPointsUseDo) Debug() *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignPointsUseDo) WithContext(ctx context.Context) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignPointsUseDo) ReadDB() *fissionCampaignPointsUseDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignPointsUseDo) WriteDB() *fissionCampaignPointsUseDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignPointsUseDo) Session(config *gorm.Session) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignPointsUseDo) Clauses(conds ...clause.Expression) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignPointsUseDo) Returning(value interface{}, columns ...string) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignPointsUseDo) Not(conds ...gen.Condition) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignPointsUseDo) Or(conds ...gen.Condition) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignPointsUseDo) Select(conds ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignPointsUseDo) Where(conds ...gen.Condition) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignPointsUseDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignPointsUseDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignPointsUseDo) Order(conds ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignPointsUseDo) Distinct(cols ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignPointsUseDo) Omit(cols ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignPointsUseDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignPointsUseDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignPointsUseDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignPointsUseDo) Group(cols ...field.Expr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignPointsUseDo) Having(conds ...gen.Condition) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignPointsUseDo) Limit(limit int) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignPointsUseDo) Offset(offset int) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignPointsUseDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignPointsUseDo) Unscoped() *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignPointsUseDo) Create(values ...*model.FissionCampaignPointsUse) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignPointsUseDo) CreateInBatches(values []*model.FissionCampaignPointsUse, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignPointsUseDo) Save(values ...*model.FissionCampaignPointsUse) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignPointsUseDo) First() (*model.FissionCampaignPointsUse, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPointsUse), nil + } +} + +func (f fissionCampaignPointsUseDo) Take() (*model.FissionCampaignPointsUse, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPointsUse), nil + } +} + +func (f fissionCampaignPointsUseDo) Last() (*model.FissionCampaignPointsUse, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPointsUse), nil + } +} + +func (f fissionCampaignPointsUseDo) Find() ([]*model.FissionCampaignPointsUse, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignPointsUse), err +} + +func (f fissionCampaignPointsUseDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignPointsUse, err error) { + buf := make([]*model.FissionCampaignPointsUse, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignPointsUseDo) FindInBatches(result *[]*model.FissionCampaignPointsUse, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignPointsUseDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignPointsUseDo) Assign(attrs ...field.AssignExpr) *fissionCampaignPointsUseDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignPointsUseDo) Joins(fields ...field.RelationField) *fissionCampaignPointsUseDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignPointsUseDo) Preload(fields ...field.RelationField) *fissionCampaignPointsUseDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignPointsUseDo) FirstOrInit() (*model.FissionCampaignPointsUse, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPointsUse), nil + } +} + +func (f fissionCampaignPointsUseDo) FirstOrCreate() (*model.FissionCampaignPointsUse, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPointsUse), nil + } +} + +func (f fissionCampaignPointsUseDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignPointsUse, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignPointsUseDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignPointsUseDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignPointsUseDo) Delete(models ...*model.FissionCampaignPointsUse) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignPointsUseDo) withDO(do gen.Dao) *fissionCampaignPointsUseDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_push.gen.go b/internal/repository/dao/fission_campaign_push.gen.go new file mode 100644 index 0000000..0a4232e --- /dev/null +++ b/internal/repository/dao/fission_campaign_push.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignPush(db *gorm.DB, opts ...gen.DOOption) fissionCampaignPush { + _fissionCampaignPush := fissionCampaignPush{} + + _fissionCampaignPush.fissionCampaignPushDo.UseDB(db, opts...) + _fissionCampaignPush.fissionCampaignPushDo.UseModel(&model.FissionCampaignPush{}) + + tableName := _fissionCampaignPush.fissionCampaignPushDo.TableName() + _fissionCampaignPush.ALL = field.NewAsterisk(tableName) + _fissionCampaignPush.ID = field.NewInt64(tableName, "id") + _fissionCampaignPush.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignPush.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignPush.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignPush.Mark = field.NewString(tableName, "mark") + _fissionCampaignPush.Cond = field.NewString(tableName, "cond") + _fissionCampaignPush.Open = field.NewInt8(tableName, "open") + + _fissionCampaignPush.fillFieldMap() + + return _fissionCampaignPush +} + +type fissionCampaignPush struct { + fissionCampaignPushDo fissionCampaignPushDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + Mark field.String // 标识(推送标识) + Cond field.String // 推送条件 + Open field.Int8 // 是否开启(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignPush) Table(newTableName string) *fissionCampaignPush { + f.fissionCampaignPushDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignPush) As(alias string) *fissionCampaignPush { + f.fissionCampaignPushDo.DO = *(f.fissionCampaignPushDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignPush) updateTableName(table string) *fissionCampaignPush { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.Cond = field.NewString(table, "cond") + f.Open = field.NewInt8(table, "open") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignPush) WithContext(ctx context.Context) *fissionCampaignPushDo { + return f.fissionCampaignPushDo.WithContext(ctx) +} + +func (f fissionCampaignPush) TableName() string { return f.fissionCampaignPushDo.TableName() } + +func (f fissionCampaignPush) Alias() string { return f.fissionCampaignPushDo.Alias() } + +func (f *fissionCampaignPush) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignPush) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["cond"] = f.Cond + f.fieldMap["open"] = f.Open +} + +func (f fissionCampaignPush) clone(db *gorm.DB) fissionCampaignPush { + f.fissionCampaignPushDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignPush) replaceDB(db *gorm.DB) fissionCampaignPush { + f.fissionCampaignPushDo.ReplaceDB(db) + return f +} + +type fissionCampaignPushDo struct{ gen.DO } + +func (f fissionCampaignPushDo) Debug() *fissionCampaignPushDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignPushDo) WithContext(ctx context.Context) *fissionCampaignPushDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignPushDo) ReadDB() *fissionCampaignPushDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignPushDo) WriteDB() *fissionCampaignPushDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignPushDo) Session(config *gorm.Session) *fissionCampaignPushDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignPushDo) Clauses(conds ...clause.Expression) *fissionCampaignPushDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignPushDo) Returning(value interface{}, columns ...string) *fissionCampaignPushDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignPushDo) Not(conds ...gen.Condition) *fissionCampaignPushDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignPushDo) Or(conds ...gen.Condition) *fissionCampaignPushDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignPushDo) Select(conds ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignPushDo) Where(conds ...gen.Condition) *fissionCampaignPushDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignPushDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignPushDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignPushDo) Order(conds ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignPushDo) Distinct(cols ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignPushDo) Omit(cols ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignPushDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignPushDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignPushDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignPushDo) Group(cols ...field.Expr) *fissionCampaignPushDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignPushDo) Having(conds ...gen.Condition) *fissionCampaignPushDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignPushDo) Limit(limit int) *fissionCampaignPushDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignPushDo) Offset(offset int) *fissionCampaignPushDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignPushDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignPushDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignPushDo) Unscoped() *fissionCampaignPushDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignPushDo) Create(values ...*model.FissionCampaignPush) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignPushDo) CreateInBatches(values []*model.FissionCampaignPush, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignPushDo) Save(values ...*model.FissionCampaignPush) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignPushDo) First() (*model.FissionCampaignPush, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPush), nil + } +} + +func (f fissionCampaignPushDo) Take() (*model.FissionCampaignPush, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPush), nil + } +} + +func (f fissionCampaignPushDo) Last() (*model.FissionCampaignPush, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPush), nil + } +} + +func (f fissionCampaignPushDo) Find() ([]*model.FissionCampaignPush, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignPush), err +} + +func (f fissionCampaignPushDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignPush, err error) { + buf := make([]*model.FissionCampaignPush, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignPushDo) FindInBatches(result *[]*model.FissionCampaignPush, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignPushDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignPushDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignPushDo) Assign(attrs ...field.AssignExpr) *fissionCampaignPushDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignPushDo) Joins(fields ...field.RelationField) *fissionCampaignPushDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignPushDo) Preload(fields ...field.RelationField) *fissionCampaignPushDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignPushDo) FirstOrInit() (*model.FissionCampaignPush, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPush), nil + } +} + +func (f fissionCampaignPushDo) FirstOrCreate() (*model.FissionCampaignPush, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignPush), nil + } +} + +func (f fissionCampaignPushDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignPush, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignPushDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignPushDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignPushDo) Delete(models ...*model.FissionCampaignPush) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignPushDo) withDO(do gen.Dao) *fissionCampaignPushDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_qa.gen.go b/internal/repository/dao/fission_campaign_qa.gen.go new file mode 100644 index 0000000..a0b4b5a --- /dev/null +++ b/internal/repository/dao/fission_campaign_qa.gen.go @@ -0,0 +1,379 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignQa(db *gorm.DB, opts ...gen.DOOption) fissionCampaignQa { + _fissionCampaignQa := fissionCampaignQa{} + + _fissionCampaignQa.fissionCampaignQaDo.UseDB(db, opts...) + _fissionCampaignQa.fissionCampaignQaDo.UseModel(&model.FissionCampaignQa{}) + + tableName := _fissionCampaignQa.fissionCampaignQaDo.TableName() + _fissionCampaignQa.ALL = field.NewAsterisk(tableName) + _fissionCampaignQa.ID = field.NewInt64(tableName, "id") + _fissionCampaignQa.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignQa.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignQa.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignQa.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignQa.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignQa.Chance = field.NewInt32(tableName, "chance") + _fissionCampaignQa.QuestionAskTime = field.NewInt32(tableName, "question_ask_time") + _fissionCampaignQa.QaGroupID = field.NewInt64(tableName, "qa_group_id") + _fissionCampaignQa.QaNum = field.NewInt32(tableName, "qa_num") + _fissionCampaignQa.DayChance = field.NewInt32(tableName, "day_chance") + _fissionCampaignQa.OpenGuide = field.NewInt8(tableName, "open_guide") + _fissionCampaignQa.GuideGroupID = field.NewInt64(tableName, "guide_group_id") + + _fissionCampaignQa.fillFieldMap() + + return _fissionCampaignQa +} + +type fissionCampaignQa struct { + fissionCampaignQaDo fissionCampaignQaDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + TargetNum field.Int32 // 达标条件需要的新用户个数 + InitChance field.Int32 // 初始答题机会次数 + Chance field.Int32 // 达标获得的答题机会次数 + QuestionAskTime field.Int32 // 答题时间限制(单位:S,如:1 就是1秒) + QaGroupID field.Int64 // 题库id(library_qa_group表) + QaNum field.Int32 // 题库选题数量 + DayChance field.Int32 // 每日签到获得的答题数 + OpenGuide field.Int8 // 是否开启引导 + GuideGroupID field.Int64 // 引导题库id + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignQa) Table(newTableName string) *fissionCampaignQa { + f.fissionCampaignQaDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignQa) As(alias string) *fissionCampaignQa { + f.fissionCampaignQaDo.DO = *(f.fissionCampaignQaDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignQa) updateTableName(table string) *fissionCampaignQa { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TargetNum = field.NewInt32(table, "target_num") + f.InitChance = field.NewInt32(table, "init_chance") + f.Chance = field.NewInt32(table, "chance") + f.QuestionAskTime = field.NewInt32(table, "question_ask_time") + f.QaGroupID = field.NewInt64(table, "qa_group_id") + f.QaNum = field.NewInt32(table, "qa_num") + f.DayChance = field.NewInt32(table, "day_chance") + f.OpenGuide = field.NewInt8(table, "open_guide") + f.GuideGroupID = field.NewInt64(table, "guide_group_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignQa) WithContext(ctx context.Context) *fissionCampaignQaDo { + return f.fissionCampaignQaDo.WithContext(ctx) +} + +func (f fissionCampaignQa) TableName() string { return f.fissionCampaignQaDo.TableName() } + +func (f fissionCampaignQa) Alias() string { return f.fissionCampaignQaDo.Alias() } + +func (f *fissionCampaignQa) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignQa) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 13) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["chance"] = f.Chance + f.fieldMap["question_ask_time"] = f.QuestionAskTime + f.fieldMap["qa_group_id"] = f.QaGroupID + f.fieldMap["qa_num"] = f.QaNum + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["open_guide"] = f.OpenGuide + f.fieldMap["guide_group_id"] = f.GuideGroupID +} + +func (f fissionCampaignQa) clone(db *gorm.DB) fissionCampaignQa { + f.fissionCampaignQaDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignQa) replaceDB(db *gorm.DB) fissionCampaignQa { + f.fissionCampaignQaDo.ReplaceDB(db) + return f +} + +type fissionCampaignQaDo struct{ gen.DO } + +func (f fissionCampaignQaDo) Debug() *fissionCampaignQaDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignQaDo) WithContext(ctx context.Context) *fissionCampaignQaDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignQaDo) ReadDB() *fissionCampaignQaDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignQaDo) WriteDB() *fissionCampaignQaDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignQaDo) Session(config *gorm.Session) *fissionCampaignQaDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignQaDo) Clauses(conds ...clause.Expression) *fissionCampaignQaDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignQaDo) Returning(value interface{}, columns ...string) *fissionCampaignQaDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignQaDo) Not(conds ...gen.Condition) *fissionCampaignQaDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignQaDo) Or(conds ...gen.Condition) *fissionCampaignQaDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignQaDo) Select(conds ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignQaDo) Where(conds ...gen.Condition) *fissionCampaignQaDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignQaDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignQaDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignQaDo) Order(conds ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignQaDo) Distinct(cols ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignQaDo) Omit(cols ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignQaDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignQaDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignQaDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignQaDo) Group(cols ...field.Expr) *fissionCampaignQaDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignQaDo) Having(conds ...gen.Condition) *fissionCampaignQaDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignQaDo) Limit(limit int) *fissionCampaignQaDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignQaDo) Offset(offset int) *fissionCampaignQaDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignQaDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignQaDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignQaDo) Unscoped() *fissionCampaignQaDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignQaDo) Create(values ...*model.FissionCampaignQa) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignQaDo) CreateInBatches(values []*model.FissionCampaignQa, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignQaDo) Save(values ...*model.FissionCampaignQa) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignQaDo) First() (*model.FissionCampaignQa, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQa), nil + } +} + +func (f fissionCampaignQaDo) Take() (*model.FissionCampaignQa, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQa), nil + } +} + +func (f fissionCampaignQaDo) Last() (*model.FissionCampaignQa, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQa), nil + } +} + +func (f fissionCampaignQaDo) Find() ([]*model.FissionCampaignQa, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignQa), err +} + +func (f fissionCampaignQaDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignQa, err error) { + buf := make([]*model.FissionCampaignQa, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignQaDo) FindInBatches(result *[]*model.FissionCampaignQa, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignQaDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignQaDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignQaDo) Assign(attrs ...field.AssignExpr) *fissionCampaignQaDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignQaDo) Joins(fields ...field.RelationField) *fissionCampaignQaDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignQaDo) Preload(fields ...field.RelationField) *fissionCampaignQaDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignQaDo) FirstOrInit() (*model.FissionCampaignQa, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQa), nil + } +} + +func (f fissionCampaignQaDo) FirstOrCreate() (*model.FissionCampaignQa, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQa), nil + } +} + +func (f fissionCampaignQaDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignQa, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignQaDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignQaDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignQaDo) Delete(models ...*model.FissionCampaignQa) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignQaDo) withDO(do gen.Dao) *fissionCampaignQaDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_qa_option.gen.go b/internal/repository/dao/fission_campaign_qa_option.gen.go new file mode 100644 index 0000000..fb946a8 --- /dev/null +++ b/internal/repository/dao/fission_campaign_qa_option.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignQaOption(db *gorm.DB, opts ...gen.DOOption) fissionCampaignQaOption { + _fissionCampaignQaOption := fissionCampaignQaOption{} + + _fissionCampaignQaOption.fissionCampaignQaOptionDo.UseDB(db, opts...) + _fissionCampaignQaOption.fissionCampaignQaOptionDo.UseModel(&model.FissionCampaignQaOption{}) + + tableName := _fissionCampaignQaOption.fissionCampaignQaOptionDo.TableName() + _fissionCampaignQaOption.ALL = field.NewAsterisk(tableName) + _fissionCampaignQaOption.ID = field.NewInt64(tableName, "id") + _fissionCampaignQaOption.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignQaOption.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignQaOption.IsDel = field.NewUint8(tableName, "is_del") + _fissionCampaignQaOption.QuestionID = field.NewInt64(tableName, "question_id") + _fissionCampaignQaOption.Title = field.NewString(tableName, "title") + _fissionCampaignQaOption.IsRight = field.NewInt8(tableName, "is_right") + + _fissionCampaignQaOption.fillFieldMap() + + return _fissionCampaignQaOption +} + +type fissionCampaignQaOption struct { + fissionCampaignQaOptionDo fissionCampaignQaOptionDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + QuestionID field.Int64 // 问题id(fission_campaign_quiz_question表) + Title field.String // 答案 + IsRight field.Int8 // 是否正确答案 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignQaOption) Table(newTableName string) *fissionCampaignQaOption { + f.fissionCampaignQaOptionDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignQaOption) As(alias string) *fissionCampaignQaOption { + f.fissionCampaignQaOptionDo.DO = *(f.fissionCampaignQaOptionDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignQaOption) updateTableName(table string) *fissionCampaignQaOption { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.QuestionID = field.NewInt64(table, "question_id") + f.Title = field.NewString(table, "title") + f.IsRight = field.NewInt8(table, "is_right") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignQaOption) WithContext(ctx context.Context) *fissionCampaignQaOptionDo { + return f.fissionCampaignQaOptionDo.WithContext(ctx) +} + +func (f fissionCampaignQaOption) TableName() string { return f.fissionCampaignQaOptionDo.TableName() } + +func (f fissionCampaignQaOption) Alias() string { return f.fissionCampaignQaOptionDo.Alias() } + +func (f *fissionCampaignQaOption) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignQaOption) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["question_id"] = f.QuestionID + f.fieldMap["title"] = f.Title + f.fieldMap["is_right"] = f.IsRight +} + +func (f fissionCampaignQaOption) clone(db *gorm.DB) fissionCampaignQaOption { + f.fissionCampaignQaOptionDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignQaOption) replaceDB(db *gorm.DB) fissionCampaignQaOption { + f.fissionCampaignQaOptionDo.ReplaceDB(db) + return f +} + +type fissionCampaignQaOptionDo struct{ gen.DO } + +func (f fissionCampaignQaOptionDo) Debug() *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignQaOptionDo) WithContext(ctx context.Context) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignQaOptionDo) ReadDB() *fissionCampaignQaOptionDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignQaOptionDo) WriteDB() *fissionCampaignQaOptionDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignQaOptionDo) Session(config *gorm.Session) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignQaOptionDo) Clauses(conds ...clause.Expression) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignQaOptionDo) Returning(value interface{}, columns ...string) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignQaOptionDo) Not(conds ...gen.Condition) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignQaOptionDo) Or(conds ...gen.Condition) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignQaOptionDo) Select(conds ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignQaOptionDo) Where(conds ...gen.Condition) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignQaOptionDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignQaOptionDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignQaOptionDo) Order(conds ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignQaOptionDo) Distinct(cols ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignQaOptionDo) Omit(cols ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignQaOptionDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignQaOptionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignQaOptionDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignQaOptionDo) Group(cols ...field.Expr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignQaOptionDo) Having(conds ...gen.Condition) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignQaOptionDo) Limit(limit int) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignQaOptionDo) Offset(offset int) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignQaOptionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignQaOptionDo) Unscoped() *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignQaOptionDo) Create(values ...*model.FissionCampaignQaOption) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignQaOptionDo) CreateInBatches(values []*model.FissionCampaignQaOption, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignQaOptionDo) Save(values ...*model.FissionCampaignQaOption) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignQaOptionDo) First() (*model.FissionCampaignQaOption, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaOption), nil + } +} + +func (f fissionCampaignQaOptionDo) Take() (*model.FissionCampaignQaOption, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaOption), nil + } +} + +func (f fissionCampaignQaOptionDo) Last() (*model.FissionCampaignQaOption, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaOption), nil + } +} + +func (f fissionCampaignQaOptionDo) Find() ([]*model.FissionCampaignQaOption, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignQaOption), err +} + +func (f fissionCampaignQaOptionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignQaOption, err error) { + buf := make([]*model.FissionCampaignQaOption, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignQaOptionDo) FindInBatches(result *[]*model.FissionCampaignQaOption, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignQaOptionDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignQaOptionDo) Assign(attrs ...field.AssignExpr) *fissionCampaignQaOptionDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignQaOptionDo) Joins(fields ...field.RelationField) *fissionCampaignQaOptionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignQaOptionDo) Preload(fields ...field.RelationField) *fissionCampaignQaOptionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignQaOptionDo) FirstOrInit() (*model.FissionCampaignQaOption, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaOption), nil + } +} + +func (f fissionCampaignQaOptionDo) FirstOrCreate() (*model.FissionCampaignQaOption, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaOption), nil + } +} + +func (f fissionCampaignQaOptionDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignQaOption, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignQaOptionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignQaOptionDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignQaOptionDo) Delete(models ...*model.FissionCampaignQaOption) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignQaOptionDo) withDO(do gen.Dao) *fissionCampaignQaOptionDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_qa_question.gen.go b/internal/repository/dao/fission_campaign_qa_question.gen.go new file mode 100644 index 0000000..9d81a02 --- /dev/null +++ b/internal/repository/dao/fission_campaign_qa_question.gen.go @@ -0,0 +1,365 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignQaQuestion(db *gorm.DB, opts ...gen.DOOption) fissionCampaignQaQuestion { + _fissionCampaignQaQuestion := fissionCampaignQaQuestion{} + + _fissionCampaignQaQuestion.fissionCampaignQaQuestionDo.UseDB(db, opts...) + _fissionCampaignQaQuestion.fissionCampaignQaQuestionDo.UseModel(&model.FissionCampaignQaQuestion{}) + + tableName := _fissionCampaignQaQuestion.fissionCampaignQaQuestionDo.TableName() + _fissionCampaignQaQuestion.ALL = field.NewAsterisk(tableName) + _fissionCampaignQaQuestion.ID = field.NewInt64(tableName, "id") + _fissionCampaignQaQuestion.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignQaQuestion.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignQaQuestion.IsDel = field.NewUint8(tableName, "is_del") + _fissionCampaignQaQuestion.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignQaQuestion.QaID = field.NewInt64(tableName, "qa_id") + _fissionCampaignQaQuestion.Title = field.NewString(tableName, "title") + _fissionCampaignQaQuestion.Score = field.NewInt32(tableName, "score") + _fissionCampaignQaQuestion.Sort = field.NewInt32(tableName, "sort") + + _fissionCampaignQaQuestion.fillFieldMap() + + return _fissionCampaignQaQuestion +} + +type fissionCampaignQaQuestion struct { + fissionCampaignQaQuestionDo fissionCampaignQaQuestionDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动id(fission_campaign表) + QaID field.Int64 // 趣味问答配置ID(fission_campaign_qa主键) + Title field.String // 题目 + Score field.Int32 // 可获得的分数 + Sort field.Int32 // 排序 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignQaQuestion) Table(newTableName string) *fissionCampaignQaQuestion { + f.fissionCampaignQaQuestionDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignQaQuestion) As(alias string) *fissionCampaignQaQuestion { + f.fissionCampaignQaQuestionDo.DO = *(f.fissionCampaignQaQuestionDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignQaQuestion) updateTableName(table string) *fissionCampaignQaQuestion { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.QaID = field.NewInt64(table, "qa_id") + f.Title = field.NewString(table, "title") + f.Score = field.NewInt32(table, "score") + f.Sort = field.NewInt32(table, "sort") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignQaQuestion) WithContext(ctx context.Context) *fissionCampaignQaQuestionDo { + return f.fissionCampaignQaQuestionDo.WithContext(ctx) +} + +func (f fissionCampaignQaQuestion) TableName() string { + return f.fissionCampaignQaQuestionDo.TableName() +} + +func (f fissionCampaignQaQuestion) Alias() string { return f.fissionCampaignQaQuestionDo.Alias() } + +func (f *fissionCampaignQaQuestion) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignQaQuestion) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["qa_id"] = f.QaID + f.fieldMap["title"] = f.Title + f.fieldMap["score"] = f.Score + f.fieldMap["sort"] = f.Sort +} + +func (f fissionCampaignQaQuestion) clone(db *gorm.DB) fissionCampaignQaQuestion { + f.fissionCampaignQaQuestionDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignQaQuestion) replaceDB(db *gorm.DB) fissionCampaignQaQuestion { + f.fissionCampaignQaQuestionDo.ReplaceDB(db) + return f +} + +type fissionCampaignQaQuestionDo struct{ gen.DO } + +func (f fissionCampaignQaQuestionDo) Debug() *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignQaQuestionDo) WithContext(ctx context.Context) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignQaQuestionDo) ReadDB() *fissionCampaignQaQuestionDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignQaQuestionDo) WriteDB() *fissionCampaignQaQuestionDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignQaQuestionDo) Session(config *gorm.Session) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignQaQuestionDo) Clauses(conds ...clause.Expression) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Returning(value interface{}, columns ...string) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignQaQuestionDo) Not(conds ...gen.Condition) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Or(conds ...gen.Condition) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Select(conds ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Where(conds ...gen.Condition) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignQaQuestionDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignQaQuestionDo) Order(conds ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Distinct(cols ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignQaQuestionDo) Omit(cols ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignQaQuestionDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignQaQuestionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignQaQuestionDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignQaQuestionDo) Group(cols ...field.Expr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignQaQuestionDo) Having(conds ...gen.Condition) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignQaQuestionDo) Limit(limit int) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignQaQuestionDo) Offset(offset int) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignQaQuestionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignQaQuestionDo) Unscoped() *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignQaQuestionDo) Create(values ...*model.FissionCampaignQaQuestion) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignQaQuestionDo) CreateInBatches(values []*model.FissionCampaignQaQuestion, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignQaQuestionDo) Save(values ...*model.FissionCampaignQaQuestion) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignQaQuestionDo) First() (*model.FissionCampaignQaQuestion, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaQuestion), nil + } +} + +func (f fissionCampaignQaQuestionDo) Take() (*model.FissionCampaignQaQuestion, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaQuestion), nil + } +} + +func (f fissionCampaignQaQuestionDo) Last() (*model.FissionCampaignQaQuestion, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaQuestion), nil + } +} + +func (f fissionCampaignQaQuestionDo) Find() ([]*model.FissionCampaignQaQuestion, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignQaQuestion), err +} + +func (f fissionCampaignQaQuestionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignQaQuestion, err error) { + buf := make([]*model.FissionCampaignQaQuestion, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignQaQuestionDo) FindInBatches(result *[]*model.FissionCampaignQaQuestion, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignQaQuestionDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignQaQuestionDo) Assign(attrs ...field.AssignExpr) *fissionCampaignQaQuestionDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignQaQuestionDo) Joins(fields ...field.RelationField) *fissionCampaignQaQuestionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignQaQuestionDo) Preload(fields ...field.RelationField) *fissionCampaignQaQuestionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignQaQuestionDo) FirstOrInit() (*model.FissionCampaignQaQuestion, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaQuestion), nil + } +} + +func (f fissionCampaignQaQuestionDo) FirstOrCreate() (*model.FissionCampaignQaQuestion, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQaQuestion), nil + } +} + +func (f fissionCampaignQaQuestionDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignQaQuestion, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignQaQuestionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignQaQuestionDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignQaQuestionDo) Delete(models ...*model.FissionCampaignQaQuestion) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignQaQuestionDo) withDO(do gen.Dao) *fissionCampaignQaQuestionDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_quiz.gen.go b/internal/repository/dao/fission_campaign_quiz.gen.go new file mode 100644 index 0000000..3e395be --- /dev/null +++ b/internal/repository/dao/fission_campaign_quiz.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignQuiz(db *gorm.DB, opts ...gen.DOOption) fissionCampaignQuiz { + _fissionCampaignQuiz := fissionCampaignQuiz{} + + _fissionCampaignQuiz.fissionCampaignQuizDo.UseDB(db, opts...) + _fissionCampaignQuiz.fissionCampaignQuizDo.UseModel(&model.FissionCampaignQuiz{}) + + tableName := _fissionCampaignQuiz.fissionCampaignQuizDo.TableName() + _fissionCampaignQuiz.ALL = field.NewAsterisk(tableName) + _fissionCampaignQuiz.ID = field.NewInt64(tableName, "id") + _fissionCampaignQuiz.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignQuiz.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignQuiz.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignQuiz.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignQuiz.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignQuiz.Chance = field.NewInt32(tableName, "chance") + _fissionCampaignQuiz.RewardRule = field.NewInt8(tableName, "reward_rule") + _fissionCampaignQuiz.OpenPrize = field.NewInt64(tableName, "open_prize") + _fissionCampaignQuiz.OpenType = field.NewInt8(tableName, "open_type") + _fissionCampaignQuiz.Title = field.NewString(tableName, "title") + _fissionCampaignQuiz.TOpen = field.NewInt64(tableName, "t_open") + + _fissionCampaignQuiz.fillFieldMap() + + return _fissionCampaignQuiz +} + +type fissionCampaignQuiz struct { + fissionCampaignQuizDo fissionCampaignQuizDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + TargetNum field.Int32 // 达标条件需要的新用户个数 + InitChance field.Int32 // 初始投票机会次数 + Chance field.Int32 // 达标获得的投票机会次数 + RewardRule field.Int8 // 奖励规则(1-投票结果排名,2-自定义竞猜结果) + OpenPrize field.Int64 // 开奖时间 + OpenType field.Int8 // 开奖状态(1-未开奖,2-已开奖,3-不开奖) + Title field.String // 选项标题 + TOpen field.Int64 // 提交上来的时间 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignQuiz) Table(newTableName string) *fissionCampaignQuiz { + f.fissionCampaignQuizDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignQuiz) As(alias string) *fissionCampaignQuiz { + f.fissionCampaignQuizDo.DO = *(f.fissionCampaignQuizDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignQuiz) updateTableName(table string) *fissionCampaignQuiz { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TargetNum = field.NewInt32(table, "target_num") + f.InitChance = field.NewInt32(table, "init_chance") + f.Chance = field.NewInt32(table, "chance") + f.RewardRule = field.NewInt8(table, "reward_rule") + f.OpenPrize = field.NewInt64(table, "open_prize") + f.OpenType = field.NewInt8(table, "open_type") + f.Title = field.NewString(table, "title") + f.TOpen = field.NewInt64(table, "t_open") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignQuiz) WithContext(ctx context.Context) *fissionCampaignQuizDo { + return f.fissionCampaignQuizDo.WithContext(ctx) +} + +func (f fissionCampaignQuiz) TableName() string { return f.fissionCampaignQuizDo.TableName() } + +func (f fissionCampaignQuiz) Alias() string { return f.fissionCampaignQuizDo.Alias() } + +func (f *fissionCampaignQuiz) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignQuiz) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 12) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["chance"] = f.Chance + f.fieldMap["reward_rule"] = f.RewardRule + f.fieldMap["open_prize"] = f.OpenPrize + f.fieldMap["open_type"] = f.OpenType + f.fieldMap["title"] = f.Title + f.fieldMap["t_open"] = f.TOpen +} + +func (f fissionCampaignQuiz) clone(db *gorm.DB) fissionCampaignQuiz { + f.fissionCampaignQuizDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignQuiz) replaceDB(db *gorm.DB) fissionCampaignQuiz { + f.fissionCampaignQuizDo.ReplaceDB(db) + return f +} + +type fissionCampaignQuizDo struct{ gen.DO } + +func (f fissionCampaignQuizDo) Debug() *fissionCampaignQuizDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignQuizDo) WithContext(ctx context.Context) *fissionCampaignQuizDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignQuizDo) ReadDB() *fissionCampaignQuizDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignQuizDo) WriteDB() *fissionCampaignQuizDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignQuizDo) Session(config *gorm.Session) *fissionCampaignQuizDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignQuizDo) Clauses(conds ...clause.Expression) *fissionCampaignQuizDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignQuizDo) Returning(value interface{}, columns ...string) *fissionCampaignQuizDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignQuizDo) Not(conds ...gen.Condition) *fissionCampaignQuizDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignQuizDo) Or(conds ...gen.Condition) *fissionCampaignQuizDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignQuizDo) Select(conds ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignQuizDo) Where(conds ...gen.Condition) *fissionCampaignQuizDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignQuizDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignQuizDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignQuizDo) Order(conds ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignQuizDo) Distinct(cols ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignQuizDo) Omit(cols ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignQuizDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignQuizDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignQuizDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignQuizDo) Group(cols ...field.Expr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignQuizDo) Having(conds ...gen.Condition) *fissionCampaignQuizDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignQuizDo) Limit(limit int) *fissionCampaignQuizDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignQuizDo) Offset(offset int) *fissionCampaignQuizDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignQuizDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignQuizDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignQuizDo) Unscoped() *fissionCampaignQuizDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignQuizDo) Create(values ...*model.FissionCampaignQuiz) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignQuizDo) CreateInBatches(values []*model.FissionCampaignQuiz, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignQuizDo) Save(values ...*model.FissionCampaignQuiz) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignQuizDo) First() (*model.FissionCampaignQuiz, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuiz), nil + } +} + +func (f fissionCampaignQuizDo) Take() (*model.FissionCampaignQuiz, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuiz), nil + } +} + +func (f fissionCampaignQuizDo) Last() (*model.FissionCampaignQuiz, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuiz), nil + } +} + +func (f fissionCampaignQuizDo) Find() ([]*model.FissionCampaignQuiz, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignQuiz), err +} + +func (f fissionCampaignQuizDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignQuiz, err error) { + buf := make([]*model.FissionCampaignQuiz, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignQuizDo) FindInBatches(result *[]*model.FissionCampaignQuiz, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignQuizDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignQuizDo) Assign(attrs ...field.AssignExpr) *fissionCampaignQuizDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignQuizDo) Joins(fields ...field.RelationField) *fissionCampaignQuizDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignQuizDo) Preload(fields ...field.RelationField) *fissionCampaignQuizDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignQuizDo) FirstOrInit() (*model.FissionCampaignQuiz, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuiz), nil + } +} + +func (f fissionCampaignQuizDo) FirstOrCreate() (*model.FissionCampaignQuiz, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuiz), nil + } +} + +func (f fissionCampaignQuizDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignQuiz, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignQuizDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignQuizDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignQuizDo) Delete(models ...*model.FissionCampaignQuiz) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignQuizDo) withDO(do gen.Dao) *fissionCampaignQuizDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_quiz_option.gen.go b/internal/repository/dao/fission_campaign_quiz_option.gen.go new file mode 100644 index 0000000..7243b28 --- /dev/null +++ b/internal/repository/dao/fission_campaign_quiz_option.gen.go @@ -0,0 +1,365 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignQuizOption(db *gorm.DB, opts ...gen.DOOption) fissionCampaignQuizOption { + _fissionCampaignQuizOption := fissionCampaignQuizOption{} + + _fissionCampaignQuizOption.fissionCampaignQuizOptionDo.UseDB(db, opts...) + _fissionCampaignQuizOption.fissionCampaignQuizOptionDo.UseModel(&model.FissionCampaignQuizOption{}) + + tableName := _fissionCampaignQuizOption.fissionCampaignQuizOptionDo.TableName() + _fissionCampaignQuizOption.ALL = field.NewAsterisk(tableName) + _fissionCampaignQuizOption.ID = field.NewInt64(tableName, "id") + _fissionCampaignQuizOption.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignQuizOption.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignQuizOption.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignQuizOption.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignQuizOption.Title = field.NewString(tableName, "title") + _fissionCampaignQuizOption.ImgURL = field.NewString(tableName, "img_url") + _fissionCampaignQuizOption.IsRight = field.NewInt8(tableName, "is_right") + _fissionCampaignQuizOption.VoteNum = field.NewInt64(tableName, "vote_num") + + _fissionCampaignQuizOption.fillFieldMap() + + return _fissionCampaignQuizOption +} + +type fissionCampaignQuizOption struct { + fissionCampaignQuizOptionDo fissionCampaignQuizOptionDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动id(fission_campaign表) + Title field.String // 选项标题 + ImgURL field.String // 选项图片 + IsRight field.Int8 // 是否正确选项(0-否,1-是) + VoteNum field.Int64 // 投票数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignQuizOption) Table(newTableName string) *fissionCampaignQuizOption { + f.fissionCampaignQuizOptionDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignQuizOption) As(alias string) *fissionCampaignQuizOption { + f.fissionCampaignQuizOptionDo.DO = *(f.fissionCampaignQuizOptionDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignQuizOption) updateTableName(table string) *fissionCampaignQuizOption { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Title = field.NewString(table, "title") + f.ImgURL = field.NewString(table, "img_url") + f.IsRight = field.NewInt8(table, "is_right") + f.VoteNum = field.NewInt64(table, "vote_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignQuizOption) WithContext(ctx context.Context) *fissionCampaignQuizOptionDo { + return f.fissionCampaignQuizOptionDo.WithContext(ctx) +} + +func (f fissionCampaignQuizOption) TableName() string { + return f.fissionCampaignQuizOptionDo.TableName() +} + +func (f fissionCampaignQuizOption) Alias() string { return f.fissionCampaignQuizOptionDo.Alias() } + +func (f *fissionCampaignQuizOption) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignQuizOption) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["title"] = f.Title + f.fieldMap["img_url"] = f.ImgURL + f.fieldMap["is_right"] = f.IsRight + f.fieldMap["vote_num"] = f.VoteNum +} + +func (f fissionCampaignQuizOption) clone(db *gorm.DB) fissionCampaignQuizOption { + f.fissionCampaignQuizOptionDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignQuizOption) replaceDB(db *gorm.DB) fissionCampaignQuizOption { + f.fissionCampaignQuizOptionDo.ReplaceDB(db) + return f +} + +type fissionCampaignQuizOptionDo struct{ gen.DO } + +func (f fissionCampaignQuizOptionDo) Debug() *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignQuizOptionDo) WithContext(ctx context.Context) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignQuizOptionDo) ReadDB() *fissionCampaignQuizOptionDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignQuizOptionDo) WriteDB() *fissionCampaignQuizOptionDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignQuizOptionDo) Session(config *gorm.Session) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignQuizOptionDo) Clauses(conds ...clause.Expression) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Returning(value interface{}, columns ...string) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignQuizOptionDo) Not(conds ...gen.Condition) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Or(conds ...gen.Condition) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Select(conds ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Where(conds ...gen.Condition) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignQuizOptionDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignQuizOptionDo) Order(conds ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Distinct(cols ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignQuizOptionDo) Omit(cols ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignQuizOptionDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignQuizOptionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignQuizOptionDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignQuizOptionDo) Group(cols ...field.Expr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignQuizOptionDo) Having(conds ...gen.Condition) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignQuizOptionDo) Limit(limit int) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignQuizOptionDo) Offset(offset int) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignQuizOptionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignQuizOptionDo) Unscoped() *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignQuizOptionDo) Create(values ...*model.FissionCampaignQuizOption) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignQuizOptionDo) CreateInBatches(values []*model.FissionCampaignQuizOption, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignQuizOptionDo) Save(values ...*model.FissionCampaignQuizOption) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignQuizOptionDo) First() (*model.FissionCampaignQuizOption, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuizOption), nil + } +} + +func (f fissionCampaignQuizOptionDo) Take() (*model.FissionCampaignQuizOption, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuizOption), nil + } +} + +func (f fissionCampaignQuizOptionDo) Last() (*model.FissionCampaignQuizOption, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuizOption), nil + } +} + +func (f fissionCampaignQuizOptionDo) Find() ([]*model.FissionCampaignQuizOption, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignQuizOption), err +} + +func (f fissionCampaignQuizOptionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignQuizOption, err error) { + buf := make([]*model.FissionCampaignQuizOption, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignQuizOptionDo) FindInBatches(result *[]*model.FissionCampaignQuizOption, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignQuizOptionDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignQuizOptionDo) Assign(attrs ...field.AssignExpr) *fissionCampaignQuizOptionDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignQuizOptionDo) Joins(fields ...field.RelationField) *fissionCampaignQuizOptionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignQuizOptionDo) Preload(fields ...field.RelationField) *fissionCampaignQuizOptionDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignQuizOptionDo) FirstOrInit() (*model.FissionCampaignQuizOption, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuizOption), nil + } +} + +func (f fissionCampaignQuizOptionDo) FirstOrCreate() (*model.FissionCampaignQuizOption, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignQuizOption), nil + } +} + +func (f fissionCampaignQuizOptionDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignQuizOption, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignQuizOptionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignQuizOptionDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignQuizOptionDo) Delete(models ...*model.FissionCampaignQuizOption) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignQuizOptionDo) withDO(do gen.Dao) *fissionCampaignQuizOptionDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_referral.gen.go b/internal/repository/dao/fission_campaign_referral.gen.go new file mode 100644 index 0000000..2b9ac2b --- /dev/null +++ b/internal/repository/dao/fission_campaign_referral.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignReferral(db *gorm.DB, opts ...gen.DOOption) fissionCampaignReferral { + _fissionCampaignReferral := fissionCampaignReferral{} + + _fissionCampaignReferral.fissionCampaignReferralDo.UseDB(db, opts...) + _fissionCampaignReferral.fissionCampaignReferralDo.UseModel(&model.FissionCampaignReferral{}) + + tableName := _fissionCampaignReferral.fissionCampaignReferralDo.TableName() + _fissionCampaignReferral.ALL = field.NewAsterisk(tableName) + _fissionCampaignReferral.ID = field.NewInt64(tableName, "id") + _fissionCampaignReferral.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignReferral.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignReferral.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignReferral.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignReferral.RewardLimit = field.NewInt32(tableName, "reward_limit") + _fissionCampaignReferral.RewardType = field.NewInt8(tableName, "reward_type") + _fissionCampaignReferral.Connect = field.NewString(tableName, "connect") + _fissionCampaignReferral.RewardRule = field.NewInt8(tableName, "reward_rule") + _fissionCampaignReferral.InviteLimit = field.NewInt32(tableName, "invite_limit") + _fissionCampaignReferral.StepLoop = field.NewInt8(tableName, "step_loop") + + _fissionCampaignReferral.fillFieldMap() + + return _fissionCampaignReferral +} + +type fissionCampaignReferral struct { + fissionCampaignReferralDo fissionCampaignReferralDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动id(fission_campaign表) + RewardLimit field.Int32 // 活动总奖励上限 + RewardType field.Int8 // 发奖方式(1-系统发放,2-联系用户发放) + Connect field.String // 发奖联系方式 + RewardRule field.Int8 // 用户奖励规则(1-阶梯,2-非阶梯) + InviteLimit field.Int32 // 邀请超过多少人不能再获得奖励 + StepLoop field.Int8 // 阶梯是否支持循环(0-不支持,1-支持) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignReferral) Table(newTableName string) *fissionCampaignReferral { + f.fissionCampaignReferralDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignReferral) As(alias string) *fissionCampaignReferral { + f.fissionCampaignReferralDo.DO = *(f.fissionCampaignReferralDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignReferral) updateTableName(table string) *fissionCampaignReferral { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardLimit = field.NewInt32(table, "reward_limit") + f.RewardType = field.NewInt8(table, "reward_type") + f.Connect = field.NewString(table, "connect") + f.RewardRule = field.NewInt8(table, "reward_rule") + f.InviteLimit = field.NewInt32(table, "invite_limit") + f.StepLoop = field.NewInt8(table, "step_loop") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignReferral) WithContext(ctx context.Context) *fissionCampaignReferralDo { + return f.fissionCampaignReferralDo.WithContext(ctx) +} + +func (f fissionCampaignReferral) TableName() string { return f.fissionCampaignReferralDo.TableName() } + +func (f fissionCampaignReferral) Alias() string { return f.fissionCampaignReferralDo.Alias() } + +func (f *fissionCampaignReferral) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignReferral) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_limit"] = f.RewardLimit + f.fieldMap["reward_type"] = f.RewardType + f.fieldMap["connect"] = f.Connect + f.fieldMap["reward_rule"] = f.RewardRule + f.fieldMap["invite_limit"] = f.InviteLimit + f.fieldMap["step_loop"] = f.StepLoop +} + +func (f fissionCampaignReferral) clone(db *gorm.DB) fissionCampaignReferral { + f.fissionCampaignReferralDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignReferral) replaceDB(db *gorm.DB) fissionCampaignReferral { + f.fissionCampaignReferralDo.ReplaceDB(db) + return f +} + +type fissionCampaignReferralDo struct{ gen.DO } + +func (f fissionCampaignReferralDo) Debug() *fissionCampaignReferralDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignReferralDo) WithContext(ctx context.Context) *fissionCampaignReferralDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignReferralDo) ReadDB() *fissionCampaignReferralDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignReferralDo) WriteDB() *fissionCampaignReferralDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignReferralDo) Session(config *gorm.Session) *fissionCampaignReferralDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignReferralDo) Clauses(conds ...clause.Expression) *fissionCampaignReferralDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignReferralDo) Returning(value interface{}, columns ...string) *fissionCampaignReferralDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignReferralDo) Not(conds ...gen.Condition) *fissionCampaignReferralDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignReferralDo) Or(conds ...gen.Condition) *fissionCampaignReferralDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignReferralDo) Select(conds ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignReferralDo) Where(conds ...gen.Condition) *fissionCampaignReferralDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignReferralDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignReferralDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignReferralDo) Order(conds ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignReferralDo) Distinct(cols ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignReferralDo) Omit(cols ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignReferralDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignReferralDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignReferralDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignReferralDo) Group(cols ...field.Expr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignReferralDo) Having(conds ...gen.Condition) *fissionCampaignReferralDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignReferralDo) Limit(limit int) *fissionCampaignReferralDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignReferralDo) Offset(offset int) *fissionCampaignReferralDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignReferralDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignReferralDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignReferralDo) Unscoped() *fissionCampaignReferralDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignReferralDo) Create(values ...*model.FissionCampaignReferral) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignReferralDo) CreateInBatches(values []*model.FissionCampaignReferral, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignReferralDo) Save(values ...*model.FissionCampaignReferral) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignReferralDo) First() (*model.FissionCampaignReferral, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReferral), nil + } +} + +func (f fissionCampaignReferralDo) Take() (*model.FissionCampaignReferral, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReferral), nil + } +} + +func (f fissionCampaignReferralDo) Last() (*model.FissionCampaignReferral, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReferral), nil + } +} + +func (f fissionCampaignReferralDo) Find() ([]*model.FissionCampaignReferral, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignReferral), err +} + +func (f fissionCampaignReferralDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignReferral, err error) { + buf := make([]*model.FissionCampaignReferral, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignReferralDo) FindInBatches(result *[]*model.FissionCampaignReferral, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignReferralDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignReferralDo) Assign(attrs ...field.AssignExpr) *fissionCampaignReferralDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignReferralDo) Joins(fields ...field.RelationField) *fissionCampaignReferralDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignReferralDo) Preload(fields ...field.RelationField) *fissionCampaignReferralDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignReferralDo) FirstOrInit() (*model.FissionCampaignReferral, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReferral), nil + } +} + +func (f fissionCampaignReferralDo) FirstOrCreate() (*model.FissionCampaignReferral, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReferral), nil + } +} + +func (f fissionCampaignReferralDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignReferral, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignReferralDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignReferralDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignReferralDo) Delete(models ...*model.FissionCampaignReferral) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignReferralDo) withDO(do gen.Dao) *fissionCampaignReferralDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_reward.gen.go b/internal/repository/dao/fission_campaign_reward.gen.go new file mode 100644 index 0000000..a55a5f2 --- /dev/null +++ b/internal/repository/dao/fission_campaign_reward.gen.go @@ -0,0 +1,463 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignReward(db *gorm.DB, opts ...gen.DOOption) fissionCampaignReward { + _fissionCampaignReward := fissionCampaignReward{} + + _fissionCampaignReward.fissionCampaignRewardDo.UseDB(db, opts...) + _fissionCampaignReward.fissionCampaignRewardDo.UseModel(&model.FissionCampaignReward{}) + + tableName := _fissionCampaignReward.fissionCampaignRewardDo.TableName() + _fissionCampaignReward.ALL = field.NewAsterisk(tableName) + _fissionCampaignReward.ID = field.NewInt64(tableName, "id") + _fissionCampaignReward.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignReward.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignReward.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignReward.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignReward.Title = field.NewString(tableName, "title") + _fissionCampaignReward.ImgURL = field.NewString(tableName, "img_url") + _fissionCampaignReward.Stock = field.NewInt32(tableName, "stock") + _fissionCampaignReward.KvData = field.NewString(tableName, "kv_data") + _fissionCampaignReward.UseStock = field.NewInt32(tableName, "use_stock") + _fissionCampaignReward.Sort = field.NewInt32(tableName, "sort") + _fissionCampaignReward.RewardType = field.NewInt8(tableName, "reward_type") + _fissionCampaignReward.Step = field.NewInt32(tableName, "step") + _fissionCampaignReward.InviteNum = field.NewInt32(tableName, "invite_num") + _fissionCampaignReward.RewardNum = field.NewInt32(tableName, "reward_num") + _fissionCampaignReward.IsThank = field.NewInt8(tableName, "is_thank") + _fissionCampaignReward.Score = field.NewInt32(tableName, "score") + _fissionCampaignReward.OldID = field.NewInt64(tableName, "old_id") + _fissionCampaignReward.SignDay = field.NewInt32(tableName, "sign_day") + _fissionCampaignReward.CollectNum = field.NewInt32(tableName, "collect_num") + _fissionCampaignReward.CollectRule = field.NewString(tableName, "collect_rule") + _fissionCampaignReward.IsSuper = field.NewInt8(tableName, "is_super") + _fissionCampaignReward.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignReward.LangMark = field.NewString(tableName, "lang_mark") + _fissionCampaignReward.LevelID = field.NewInt64(tableName, "level_id") + _fissionCampaignReward.Odds = field.NewInt32(tableName, "odds") + _fissionCampaignReward.CountryMark = field.NewString(tableName, "country_mark") + _fissionCampaignReward.JumpURL = field.NewString(tableName, "jump_url") + _fissionCampaignReward.HasRule = field.NewInt8(tableName, "has_rule") + _fissionCampaignReward.InitPercent = field.NewFloat64(tableName, "init_percent") + _fissionCampaignReward.PropMark = field.NewString(tableName, "prop_mark") + _fissionCampaignReward.ExpiredDay = field.NewString(tableName, "expired_day") + _fissionCampaignReward.OpenAdd = field.NewInt8(tableName, "open_add") + _fissionCampaignReward.OpenTask = field.NewInt8(tableName, "open_task") + + _fissionCampaignReward.fillFieldMap() + + return _fissionCampaignReward +} + +type fissionCampaignReward struct { + fissionCampaignRewardDo fissionCampaignRewardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动id(fission_campaign表) + Title field.String // 奖品名称 + ImgURL field.String // 奖品图片 + Stock field.Int32 // 奖品库存 + KvData field.String // 跳转链接自定义参数 + UseStock field.Int32 // 已发放奖品数 + Sort field.Int32 // 排序 + RewardType field.Int8 // 奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品) + Step field.Int32 // 奖励阶段 + InviteNum field.Int32 // 需要邀请的人数 + RewardNum field.Int32 // 获得的奖品数量 + IsThank field.Int8 // 是否谢谢参与(0-否,1-是) + Score field.Int32 // 领取奖品的分数 + OldID field.Int64 // 迁移前旧id + SignDay field.Int32 // 签到天数 + CollectNum field.Int32 // 收集碎片数 + CollectRule field.String // 收集规则 + IsSuper field.Int8 // 是否超级大奖 + RewardID field.Int64 // 奖品id(reward表) + LangMark field.String // 奖品归属语言标识 + LevelID field.Int64 // 奖品归属用户等级id(fission_user_level表) + Odds field.Int32 // 中奖概率 + CountryMark field.String // 奖品归属国家标识 + JumpURL field.String // 跳转地址 + HasRule field.Int8 // 是否有领奖规则(0-否,1-是) + InitPercent field.Float64 // 初始助力进度 + PropMark field.String // 道具类型(reward-奖品,chance-活动道具,point-积分) + ExpiredDay field.String // 过期天数 + OpenAdd field.Int8 // 是否开启动态库存 + OpenTask field.Int8 // 开启任务解锁 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignReward) Table(newTableName string) *fissionCampaignReward { + f.fissionCampaignRewardDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignReward) As(alias string) *fissionCampaignReward { + f.fissionCampaignRewardDo.DO = *(f.fissionCampaignRewardDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignReward) updateTableName(table string) *fissionCampaignReward { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Title = field.NewString(table, "title") + f.ImgURL = field.NewString(table, "img_url") + f.Stock = field.NewInt32(table, "stock") + f.KvData = field.NewString(table, "kv_data") + f.UseStock = field.NewInt32(table, "use_stock") + f.Sort = field.NewInt32(table, "sort") + f.RewardType = field.NewInt8(table, "reward_type") + f.Step = field.NewInt32(table, "step") + f.InviteNum = field.NewInt32(table, "invite_num") + f.RewardNum = field.NewInt32(table, "reward_num") + f.IsThank = field.NewInt8(table, "is_thank") + f.Score = field.NewInt32(table, "score") + f.OldID = field.NewInt64(table, "old_id") + f.SignDay = field.NewInt32(table, "sign_day") + f.CollectNum = field.NewInt32(table, "collect_num") + f.CollectRule = field.NewString(table, "collect_rule") + f.IsSuper = field.NewInt8(table, "is_super") + f.RewardID = field.NewInt64(table, "reward_id") + f.LangMark = field.NewString(table, "lang_mark") + f.LevelID = field.NewInt64(table, "level_id") + f.Odds = field.NewInt32(table, "odds") + f.CountryMark = field.NewString(table, "country_mark") + f.JumpURL = field.NewString(table, "jump_url") + f.HasRule = field.NewInt8(table, "has_rule") + f.InitPercent = field.NewFloat64(table, "init_percent") + f.PropMark = field.NewString(table, "prop_mark") + f.ExpiredDay = field.NewString(table, "expired_day") + f.OpenAdd = field.NewInt8(table, "open_add") + f.OpenTask = field.NewInt8(table, "open_task") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignReward) WithContext(ctx context.Context) *fissionCampaignRewardDo { + return f.fissionCampaignRewardDo.WithContext(ctx) +} + +func (f fissionCampaignReward) TableName() string { return f.fissionCampaignRewardDo.TableName() } + +func (f fissionCampaignReward) Alias() string { return f.fissionCampaignRewardDo.Alias() } + +func (f *fissionCampaignReward) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignReward) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 34) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["title"] = f.Title + f.fieldMap["img_url"] = f.ImgURL + f.fieldMap["stock"] = f.Stock + f.fieldMap["kv_data"] = f.KvData + f.fieldMap["use_stock"] = f.UseStock + f.fieldMap["sort"] = f.Sort + f.fieldMap["reward_type"] = f.RewardType + f.fieldMap["step"] = f.Step + f.fieldMap["invite_num"] = f.InviteNum + f.fieldMap["reward_num"] = f.RewardNum + f.fieldMap["is_thank"] = f.IsThank + f.fieldMap["score"] = f.Score + f.fieldMap["old_id"] = f.OldID + f.fieldMap["sign_day"] = f.SignDay + f.fieldMap["collect_num"] = f.CollectNum + f.fieldMap["collect_rule"] = f.CollectRule + f.fieldMap["is_super"] = f.IsSuper + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["lang_mark"] = f.LangMark + f.fieldMap["level_id"] = f.LevelID + f.fieldMap["odds"] = f.Odds + f.fieldMap["country_mark"] = f.CountryMark + f.fieldMap["jump_url"] = f.JumpURL + f.fieldMap["has_rule"] = f.HasRule + f.fieldMap["init_percent"] = f.InitPercent + f.fieldMap["prop_mark"] = f.PropMark + f.fieldMap["expired_day"] = f.ExpiredDay + f.fieldMap["open_add"] = f.OpenAdd + f.fieldMap["open_task"] = f.OpenTask +} + +func (f fissionCampaignReward) clone(db *gorm.DB) fissionCampaignReward { + f.fissionCampaignRewardDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignReward) replaceDB(db *gorm.DB) fissionCampaignReward { + f.fissionCampaignRewardDo.ReplaceDB(db) + return f +} + +type fissionCampaignRewardDo struct{ gen.DO } + +func (f fissionCampaignRewardDo) Debug() *fissionCampaignRewardDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignRewardDo) WithContext(ctx context.Context) *fissionCampaignRewardDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignRewardDo) ReadDB() *fissionCampaignRewardDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignRewardDo) WriteDB() *fissionCampaignRewardDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignRewardDo) Session(config *gorm.Session) *fissionCampaignRewardDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignRewardDo) Clauses(conds ...clause.Expression) *fissionCampaignRewardDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignRewardDo) Returning(value interface{}, columns ...string) *fissionCampaignRewardDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignRewardDo) Not(conds ...gen.Condition) *fissionCampaignRewardDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignRewardDo) Or(conds ...gen.Condition) *fissionCampaignRewardDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignRewardDo) Select(conds ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignRewardDo) Where(conds ...gen.Condition) *fissionCampaignRewardDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignRewardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignRewardDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignRewardDo) Order(conds ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignRewardDo) Distinct(cols ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignRewardDo) Omit(cols ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignRewardDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignRewardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignRewardDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignRewardDo) Group(cols ...field.Expr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignRewardDo) Having(conds ...gen.Condition) *fissionCampaignRewardDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignRewardDo) Limit(limit int) *fissionCampaignRewardDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignRewardDo) Offset(offset int) *fissionCampaignRewardDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignRewardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignRewardDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignRewardDo) Unscoped() *fissionCampaignRewardDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignRewardDo) Create(values ...*model.FissionCampaignReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignRewardDo) CreateInBatches(values []*model.FissionCampaignReward, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignRewardDo) Save(values ...*model.FissionCampaignReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignRewardDo) First() (*model.FissionCampaignReward, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReward), nil + } +} + +func (f fissionCampaignRewardDo) Take() (*model.FissionCampaignReward, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReward), nil + } +} + +func (f fissionCampaignRewardDo) Last() (*model.FissionCampaignReward, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReward), nil + } +} + +func (f fissionCampaignRewardDo) Find() ([]*model.FissionCampaignReward, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignReward), err +} + +func (f fissionCampaignRewardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignReward, err error) { + buf := make([]*model.FissionCampaignReward, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignRewardDo) FindInBatches(result *[]*model.FissionCampaignReward, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignRewardDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignRewardDo) Assign(attrs ...field.AssignExpr) *fissionCampaignRewardDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignRewardDo) Joins(fields ...field.RelationField) *fissionCampaignRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignRewardDo) Preload(fields ...field.RelationField) *fissionCampaignRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignRewardDo) FirstOrInit() (*model.FissionCampaignReward, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReward), nil + } +} + +func (f fissionCampaignRewardDo) FirstOrCreate() (*model.FissionCampaignReward, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignReward), nil + } +} + +func (f fissionCampaignRewardDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignReward, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignRewardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignRewardDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignRewardDo) Delete(models ...*model.FissionCampaignReward) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignRewardDo) withDO(do gen.Dao) *fissionCampaignRewardDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_reward_add.gen.go b/internal/repository/dao/fission_campaign_reward_add.gen.go new file mode 100644 index 0000000..bdb48ee --- /dev/null +++ b/internal/repository/dao/fission_campaign_reward_add.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignRewardAdd(db *gorm.DB, opts ...gen.DOOption) fissionCampaignRewardAdd { + _fissionCampaignRewardAdd := fissionCampaignRewardAdd{} + + _fissionCampaignRewardAdd.fissionCampaignRewardAddDo.UseDB(db, opts...) + _fissionCampaignRewardAdd.fissionCampaignRewardAddDo.UseModel(&model.FissionCampaignRewardAdd{}) + + tableName := _fissionCampaignRewardAdd.fissionCampaignRewardAddDo.TableName() + _fissionCampaignRewardAdd.ALL = field.NewAsterisk(tableName) + _fissionCampaignRewardAdd.ID = field.NewInt64(tableName, "id") + _fissionCampaignRewardAdd.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignRewardAdd.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignRewardAdd.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignRewardAdd.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignRewardAdd.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignRewardAdd.Start = field.NewInt64(tableName, "start") + _fissionCampaignRewardAdd.End = field.NewInt64(tableName, "end") + _fissionCampaignRewardAdd.DayNum = field.NewInt32(tableName, "day_num") + _fissionCampaignRewardAdd.DayAdd = field.NewInt32(tableName, "day_add") + _fissionCampaignRewardAdd.FinishAt = field.NewInt64(tableName, "finish_at") + + _fissionCampaignRewardAdd.fillFieldMap() + + return _fissionCampaignRewardAdd +} + +type fissionCampaignRewardAdd struct { + fissionCampaignRewardAddDo fissionCampaignRewardAddDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 + CampaignID field.Int64 // 活动ID(fission_campaign表) + RewardID field.Int64 // 奖品id + Start field.Int64 // 开始时间 + End field.Int64 // 结束时间 + DayNum field.Int32 // 每多少天 + DayAdd field.Int32 // 追加库存数量 + FinishAt field.Int64 // 完成时间 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignRewardAdd) Table(newTableName string) *fissionCampaignRewardAdd { + f.fissionCampaignRewardAddDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignRewardAdd) As(alias string) *fissionCampaignRewardAdd { + f.fissionCampaignRewardAddDo.DO = *(f.fissionCampaignRewardAddDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignRewardAdd) updateTableName(table string) *fissionCampaignRewardAdd { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.Start = field.NewInt64(table, "start") + f.End = field.NewInt64(table, "end") + f.DayNum = field.NewInt32(table, "day_num") + f.DayAdd = field.NewInt32(table, "day_add") + f.FinishAt = field.NewInt64(table, "finish_at") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignRewardAdd) WithContext(ctx context.Context) *fissionCampaignRewardAddDo { + return f.fissionCampaignRewardAddDo.WithContext(ctx) +} + +func (f fissionCampaignRewardAdd) TableName() string { return f.fissionCampaignRewardAddDo.TableName() } + +func (f fissionCampaignRewardAdd) Alias() string { return f.fissionCampaignRewardAddDo.Alias() } + +func (f *fissionCampaignRewardAdd) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignRewardAdd) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["start"] = f.Start + f.fieldMap["end"] = f.End + f.fieldMap["day_num"] = f.DayNum + f.fieldMap["day_add"] = f.DayAdd + f.fieldMap["finish_at"] = f.FinishAt +} + +func (f fissionCampaignRewardAdd) clone(db *gorm.DB) fissionCampaignRewardAdd { + f.fissionCampaignRewardAddDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignRewardAdd) replaceDB(db *gorm.DB) fissionCampaignRewardAdd { + f.fissionCampaignRewardAddDo.ReplaceDB(db) + return f +} + +type fissionCampaignRewardAddDo struct{ gen.DO } + +func (f fissionCampaignRewardAddDo) Debug() *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignRewardAddDo) WithContext(ctx context.Context) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignRewardAddDo) ReadDB() *fissionCampaignRewardAddDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignRewardAddDo) WriteDB() *fissionCampaignRewardAddDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignRewardAddDo) Session(config *gorm.Session) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignRewardAddDo) Clauses(conds ...clause.Expression) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignRewardAddDo) Returning(value interface{}, columns ...string) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignRewardAddDo) Not(conds ...gen.Condition) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignRewardAddDo) Or(conds ...gen.Condition) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignRewardAddDo) Select(conds ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignRewardAddDo) Where(conds ...gen.Condition) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignRewardAddDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignRewardAddDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignRewardAddDo) Order(conds ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignRewardAddDo) Distinct(cols ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignRewardAddDo) Omit(cols ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignRewardAddDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignRewardAddDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignRewardAddDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignRewardAddDo) Group(cols ...field.Expr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignRewardAddDo) Having(conds ...gen.Condition) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignRewardAddDo) Limit(limit int) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignRewardAddDo) Offset(offset int) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignRewardAddDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignRewardAddDo) Unscoped() *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignRewardAddDo) Create(values ...*model.FissionCampaignRewardAdd) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignRewardAddDo) CreateInBatches(values []*model.FissionCampaignRewardAdd, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignRewardAddDo) Save(values ...*model.FissionCampaignRewardAdd) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignRewardAddDo) First() (*model.FissionCampaignRewardAdd, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAdd), nil + } +} + +func (f fissionCampaignRewardAddDo) Take() (*model.FissionCampaignRewardAdd, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAdd), nil + } +} + +func (f fissionCampaignRewardAddDo) Last() (*model.FissionCampaignRewardAdd, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAdd), nil + } +} + +func (f fissionCampaignRewardAddDo) Find() ([]*model.FissionCampaignRewardAdd, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignRewardAdd), err +} + +func (f fissionCampaignRewardAddDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignRewardAdd, err error) { + buf := make([]*model.FissionCampaignRewardAdd, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignRewardAddDo) FindInBatches(result *[]*model.FissionCampaignRewardAdd, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignRewardAddDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignRewardAddDo) Assign(attrs ...field.AssignExpr) *fissionCampaignRewardAddDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignRewardAddDo) Joins(fields ...field.RelationField) *fissionCampaignRewardAddDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignRewardAddDo) Preload(fields ...field.RelationField) *fissionCampaignRewardAddDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignRewardAddDo) FirstOrInit() (*model.FissionCampaignRewardAdd, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAdd), nil + } +} + +func (f fissionCampaignRewardAddDo) FirstOrCreate() (*model.FissionCampaignRewardAdd, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAdd), nil + } +} + +func (f fissionCampaignRewardAddDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignRewardAdd, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignRewardAddDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignRewardAddDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignRewardAddDo) Delete(models ...*model.FissionCampaignRewardAdd) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignRewardAddDo) withDO(do gen.Dao) *fissionCampaignRewardAddDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_reward_add_log.gen.go b/internal/repository/dao/fission_campaign_reward_add_log.gen.go new file mode 100644 index 0000000..c7ac3c6 --- /dev/null +++ b/internal/repository/dao/fission_campaign_reward_add_log.gen.go @@ -0,0 +1,357 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignRewardAddLog(db *gorm.DB, opts ...gen.DOOption) fissionCampaignRewardAddLog { + _fissionCampaignRewardAddLog := fissionCampaignRewardAddLog{} + + _fissionCampaignRewardAddLog.fissionCampaignRewardAddLogDo.UseDB(db, opts...) + _fissionCampaignRewardAddLog.fissionCampaignRewardAddLogDo.UseModel(&model.FissionCampaignRewardAddLog{}) + + tableName := _fissionCampaignRewardAddLog.fissionCampaignRewardAddLogDo.TableName() + _fissionCampaignRewardAddLog.ALL = field.NewAsterisk(tableName) + _fissionCampaignRewardAddLog.ID = field.NewInt64(tableName, "id") + _fissionCampaignRewardAddLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignRewardAddLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignRewardAddLog.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignRewardAddLog.AddAt = field.NewInt64(tableName, "add_at") + _fissionCampaignRewardAddLog.DayAdd = field.NewInt32(tableName, "day_add") + _fissionCampaignRewardAddLog.BeforeAdd = field.NewInt32(tableName, "before_add") + + _fissionCampaignRewardAddLog.fillFieldMap() + + return _fissionCampaignRewardAddLog +} + +type fissionCampaignRewardAddLog struct { + fissionCampaignRewardAddLogDo fissionCampaignRewardAddLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + RewardID field.Int64 // 奖品id + AddAt field.Int64 // 追加的日期 + DayAdd field.Int32 // 追加库存数量 + BeforeAdd field.Int32 // 追加前库存数量 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignRewardAddLog) Table(newTableName string) *fissionCampaignRewardAddLog { + f.fissionCampaignRewardAddLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignRewardAddLog) As(alias string) *fissionCampaignRewardAddLog { + f.fissionCampaignRewardAddLogDo.DO = *(f.fissionCampaignRewardAddLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignRewardAddLog) updateTableName(table string) *fissionCampaignRewardAddLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.AddAt = field.NewInt64(table, "add_at") + f.DayAdd = field.NewInt32(table, "day_add") + f.BeforeAdd = field.NewInt32(table, "before_add") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignRewardAddLog) WithContext(ctx context.Context) *fissionCampaignRewardAddLogDo { + return f.fissionCampaignRewardAddLogDo.WithContext(ctx) +} + +func (f fissionCampaignRewardAddLog) TableName() string { + return f.fissionCampaignRewardAddLogDo.TableName() +} + +func (f fissionCampaignRewardAddLog) Alias() string { return f.fissionCampaignRewardAddLogDo.Alias() } + +func (f *fissionCampaignRewardAddLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignRewardAddLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["add_at"] = f.AddAt + f.fieldMap["day_add"] = f.DayAdd + f.fieldMap["before_add"] = f.BeforeAdd +} + +func (f fissionCampaignRewardAddLog) clone(db *gorm.DB) fissionCampaignRewardAddLog { + f.fissionCampaignRewardAddLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignRewardAddLog) replaceDB(db *gorm.DB) fissionCampaignRewardAddLog { + f.fissionCampaignRewardAddLogDo.ReplaceDB(db) + return f +} + +type fissionCampaignRewardAddLogDo struct{ gen.DO } + +func (f fissionCampaignRewardAddLogDo) Debug() *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignRewardAddLogDo) WithContext(ctx context.Context) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignRewardAddLogDo) ReadDB() *fissionCampaignRewardAddLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignRewardAddLogDo) WriteDB() *fissionCampaignRewardAddLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignRewardAddLogDo) Session(config *gorm.Session) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignRewardAddLogDo) Clauses(conds ...clause.Expression) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Returning(value interface{}, columns ...string) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignRewardAddLogDo) Not(conds ...gen.Condition) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Or(conds ...gen.Condition) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Select(conds ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Where(conds ...gen.Condition) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignRewardAddLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignRewardAddLogDo) Order(conds ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Distinct(cols ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignRewardAddLogDo) Omit(cols ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignRewardAddLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignRewardAddLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignRewardAddLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignRewardAddLogDo) Group(cols ...field.Expr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignRewardAddLogDo) Having(conds ...gen.Condition) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignRewardAddLogDo) Limit(limit int) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignRewardAddLogDo) Offset(offset int) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignRewardAddLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignRewardAddLogDo) Unscoped() *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignRewardAddLogDo) Create(values ...*model.FissionCampaignRewardAddLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignRewardAddLogDo) CreateInBatches(values []*model.FissionCampaignRewardAddLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignRewardAddLogDo) Save(values ...*model.FissionCampaignRewardAddLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignRewardAddLogDo) First() (*model.FissionCampaignRewardAddLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAddLog), nil + } +} + +func (f fissionCampaignRewardAddLogDo) Take() (*model.FissionCampaignRewardAddLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAddLog), nil + } +} + +func (f fissionCampaignRewardAddLogDo) Last() (*model.FissionCampaignRewardAddLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAddLog), nil + } +} + +func (f fissionCampaignRewardAddLogDo) Find() ([]*model.FissionCampaignRewardAddLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignRewardAddLog), err +} + +func (f fissionCampaignRewardAddLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignRewardAddLog, err error) { + buf := make([]*model.FissionCampaignRewardAddLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignRewardAddLogDo) FindInBatches(result *[]*model.FissionCampaignRewardAddLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignRewardAddLogDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignRewardAddLogDo) Assign(attrs ...field.AssignExpr) *fissionCampaignRewardAddLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignRewardAddLogDo) Joins(fields ...field.RelationField) *fissionCampaignRewardAddLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignRewardAddLogDo) Preload(fields ...field.RelationField) *fissionCampaignRewardAddLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignRewardAddLogDo) FirstOrInit() (*model.FissionCampaignRewardAddLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAddLog), nil + } +} + +func (f fissionCampaignRewardAddLogDo) FirstOrCreate() (*model.FissionCampaignRewardAddLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardAddLog), nil + } +} + +func (f fissionCampaignRewardAddLogDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignRewardAddLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignRewardAddLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignRewardAddLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignRewardAddLogDo) Delete(models ...*model.FissionCampaignRewardAddLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignRewardAddLogDo) withDO(do gen.Dao) *fissionCampaignRewardAddLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_reward_rule.gen.go b/internal/repository/dao/fission_campaign_reward_rule.gen.go new file mode 100644 index 0000000..9366c4a --- /dev/null +++ b/internal/repository/dao/fission_campaign_reward_rule.gen.go @@ -0,0 +1,353 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignRewardRule(db *gorm.DB, opts ...gen.DOOption) fissionCampaignRewardRule { + _fissionCampaignRewardRule := fissionCampaignRewardRule{} + + _fissionCampaignRewardRule.fissionCampaignRewardRuleDo.UseDB(db, opts...) + _fissionCampaignRewardRule.fissionCampaignRewardRuleDo.UseModel(&model.FissionCampaignRewardRule{}) + + tableName := _fissionCampaignRewardRule.fissionCampaignRewardRuleDo.TableName() + _fissionCampaignRewardRule.ALL = field.NewAsterisk(tableName) + _fissionCampaignRewardRule.ID = field.NewInt64(tableName, "id") + _fissionCampaignRewardRule.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignRewardRule.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignRewardRule.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignRewardRule.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignRewardRule.CampaignLimit = field.NewInt32(tableName, "campaign_limit") + + _fissionCampaignRewardRule.fillFieldMap() + + return _fissionCampaignRewardRule +} + +type fissionCampaignRewardRule struct { + fissionCampaignRewardRuleDo fissionCampaignRewardRuleDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + RewardID field.Int64 // 奖品id(fission_campaign_reward表) + CampaignLimit field.Int32 // 活动内单个用户可获得奖品数限制 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignRewardRule) Table(newTableName string) *fissionCampaignRewardRule { + f.fissionCampaignRewardRuleDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignRewardRule) As(alias string) *fissionCampaignRewardRule { + f.fissionCampaignRewardRuleDo.DO = *(f.fissionCampaignRewardRuleDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignRewardRule) updateTableName(table string) *fissionCampaignRewardRule { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.CampaignLimit = field.NewInt32(table, "campaign_limit") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignRewardRule) WithContext(ctx context.Context) *fissionCampaignRewardRuleDo { + return f.fissionCampaignRewardRuleDo.WithContext(ctx) +} + +func (f fissionCampaignRewardRule) TableName() string { + return f.fissionCampaignRewardRuleDo.TableName() +} + +func (f fissionCampaignRewardRule) Alias() string { return f.fissionCampaignRewardRuleDo.Alias() } + +func (f *fissionCampaignRewardRule) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignRewardRule) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["campaign_limit"] = f.CampaignLimit +} + +func (f fissionCampaignRewardRule) clone(db *gorm.DB) fissionCampaignRewardRule { + f.fissionCampaignRewardRuleDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignRewardRule) replaceDB(db *gorm.DB) fissionCampaignRewardRule { + f.fissionCampaignRewardRuleDo.ReplaceDB(db) + return f +} + +type fissionCampaignRewardRuleDo struct{ gen.DO } + +func (f fissionCampaignRewardRuleDo) Debug() *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignRewardRuleDo) WithContext(ctx context.Context) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignRewardRuleDo) ReadDB() *fissionCampaignRewardRuleDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignRewardRuleDo) WriteDB() *fissionCampaignRewardRuleDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignRewardRuleDo) Session(config *gorm.Session) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignRewardRuleDo) Clauses(conds ...clause.Expression) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Returning(value interface{}, columns ...string) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignRewardRuleDo) Not(conds ...gen.Condition) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Or(conds ...gen.Condition) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Select(conds ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Where(conds ...gen.Condition) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignRewardRuleDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignRewardRuleDo) Order(conds ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Distinct(cols ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignRewardRuleDo) Omit(cols ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignRewardRuleDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignRewardRuleDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignRewardRuleDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignRewardRuleDo) Group(cols ...field.Expr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignRewardRuleDo) Having(conds ...gen.Condition) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignRewardRuleDo) Limit(limit int) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignRewardRuleDo) Offset(offset int) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignRewardRuleDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignRewardRuleDo) Unscoped() *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignRewardRuleDo) Create(values ...*model.FissionCampaignRewardRule) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignRewardRuleDo) CreateInBatches(values []*model.FissionCampaignRewardRule, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignRewardRuleDo) Save(values ...*model.FissionCampaignRewardRule) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignRewardRuleDo) First() (*model.FissionCampaignRewardRule, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardRule), nil + } +} + +func (f fissionCampaignRewardRuleDo) Take() (*model.FissionCampaignRewardRule, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardRule), nil + } +} + +func (f fissionCampaignRewardRuleDo) Last() (*model.FissionCampaignRewardRule, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardRule), nil + } +} + +func (f fissionCampaignRewardRuleDo) Find() ([]*model.FissionCampaignRewardRule, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignRewardRule), err +} + +func (f fissionCampaignRewardRuleDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignRewardRule, err error) { + buf := make([]*model.FissionCampaignRewardRule, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignRewardRuleDo) FindInBatches(result *[]*model.FissionCampaignRewardRule, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignRewardRuleDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignRewardRuleDo) Assign(attrs ...field.AssignExpr) *fissionCampaignRewardRuleDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignRewardRuleDo) Joins(fields ...field.RelationField) *fissionCampaignRewardRuleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignRewardRuleDo) Preload(fields ...field.RelationField) *fissionCampaignRewardRuleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignRewardRuleDo) FirstOrInit() (*model.FissionCampaignRewardRule, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardRule), nil + } +} + +func (f fissionCampaignRewardRuleDo) FirstOrCreate() (*model.FissionCampaignRewardRule, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignRewardRule), nil + } +} + +func (f fissionCampaignRewardRuleDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignRewardRule, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignRewardRuleDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignRewardRuleDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignRewardRuleDo) Delete(models ...*model.FissionCampaignRewardRule) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignRewardRuleDo) withDO(do gen.Dao) *fissionCampaignRewardRuleDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_sign.gen.go b/internal/repository/dao/fission_campaign_sign.gen.go new file mode 100644 index 0000000..2619665 --- /dev/null +++ b/internal/repository/dao/fission_campaign_sign.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignSign(db *gorm.DB, opts ...gen.DOOption) fissionCampaignSign { + _fissionCampaignSign := fissionCampaignSign{} + + _fissionCampaignSign.fissionCampaignSignDo.UseDB(db, opts...) + _fissionCampaignSign.fissionCampaignSignDo.UseModel(&model.FissionCampaignSign{}) + + tableName := _fissionCampaignSign.fissionCampaignSignDo.TableName() + _fissionCampaignSign.ALL = field.NewAsterisk(tableName) + _fissionCampaignSign.ID = field.NewInt64(tableName, "id") + _fissionCampaignSign.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignSign.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignSign.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignSign.SignType = field.NewInt8(tableName, "sign_type") + _fissionCampaignSign.IsContinue = field.NewInt8(tableName, "is_continue") + _fissionCampaignSign.HasCard = field.NewInt8(tableName, "has_card") + _fissionCampaignSign.InviteNum = field.NewInt32(tableName, "invite_num") + _fissionCampaignSign.IsLoop = field.NewInt8(tableName, "is_loop") + _fissionCampaignSign.SignCycle = field.NewInt32(tableName, "sign_cycle") + _fissionCampaignSign.RecycleType = field.NewInt8(tableName, "recycle_type") + _fissionCampaignSign.Color = field.NewString(tableName, "color") + + _fissionCampaignSign.fillFieldMap() + + return _fissionCampaignSign +} + +type fissionCampaignSign struct { + fissionCampaignSignDo fissionCampaignSignDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID + SignType field.Int8 // 签到类型(1-普通签到,2-阶梯签到,3-周期签到) + IsContinue field.Int8 // 是否连续签到(1-是,0-否) + HasCard field.Int8 // 是否开启签到卡(1-开启,0-不开启) + InviteNum field.Int32 // 邀请好友数可获得签到卡 + IsLoop field.Int8 // 是否支持阶梯可循环(0-否,1-是) + SignCycle field.Int32 // 签到周期 + RecycleType field.Int8 // 重新签到模式(1-断签重签,2-周期重签) + Color field.String // 主题颜色 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignSign) Table(newTableName string) *fissionCampaignSign { + f.fissionCampaignSignDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignSign) As(alias string) *fissionCampaignSign { + f.fissionCampaignSignDo.DO = *(f.fissionCampaignSignDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignSign) updateTableName(table string) *fissionCampaignSign { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.SignType = field.NewInt8(table, "sign_type") + f.IsContinue = field.NewInt8(table, "is_continue") + f.HasCard = field.NewInt8(table, "has_card") + f.InviteNum = field.NewInt32(table, "invite_num") + f.IsLoop = field.NewInt8(table, "is_loop") + f.SignCycle = field.NewInt32(table, "sign_cycle") + f.RecycleType = field.NewInt8(table, "recycle_type") + f.Color = field.NewString(table, "color") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignSign) WithContext(ctx context.Context) *fissionCampaignSignDo { + return f.fissionCampaignSignDo.WithContext(ctx) +} + +func (f fissionCampaignSign) TableName() string { return f.fissionCampaignSignDo.TableName() } + +func (f fissionCampaignSign) Alias() string { return f.fissionCampaignSignDo.Alias() } + +func (f *fissionCampaignSign) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignSign) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 12) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["sign_type"] = f.SignType + f.fieldMap["is_continue"] = f.IsContinue + f.fieldMap["has_card"] = f.HasCard + f.fieldMap["invite_num"] = f.InviteNum + f.fieldMap["is_loop"] = f.IsLoop + f.fieldMap["sign_cycle"] = f.SignCycle + f.fieldMap["recycle_type"] = f.RecycleType + f.fieldMap["color"] = f.Color +} + +func (f fissionCampaignSign) clone(db *gorm.DB) fissionCampaignSign { + f.fissionCampaignSignDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignSign) replaceDB(db *gorm.DB) fissionCampaignSign { + f.fissionCampaignSignDo.ReplaceDB(db) + return f +} + +type fissionCampaignSignDo struct{ gen.DO } + +func (f fissionCampaignSignDo) Debug() *fissionCampaignSignDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignSignDo) WithContext(ctx context.Context) *fissionCampaignSignDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignSignDo) ReadDB() *fissionCampaignSignDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignSignDo) WriteDB() *fissionCampaignSignDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignSignDo) Session(config *gorm.Session) *fissionCampaignSignDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignSignDo) Clauses(conds ...clause.Expression) *fissionCampaignSignDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignSignDo) Returning(value interface{}, columns ...string) *fissionCampaignSignDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignSignDo) Not(conds ...gen.Condition) *fissionCampaignSignDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignSignDo) Or(conds ...gen.Condition) *fissionCampaignSignDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignSignDo) Select(conds ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignSignDo) Where(conds ...gen.Condition) *fissionCampaignSignDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignSignDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignSignDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignSignDo) Order(conds ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignSignDo) Distinct(cols ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignSignDo) Omit(cols ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignSignDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignSignDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignSignDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignSignDo) Group(cols ...field.Expr) *fissionCampaignSignDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignSignDo) Having(conds ...gen.Condition) *fissionCampaignSignDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignSignDo) Limit(limit int) *fissionCampaignSignDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignSignDo) Offset(offset int) *fissionCampaignSignDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignSignDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignSignDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignSignDo) Unscoped() *fissionCampaignSignDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignSignDo) Create(values ...*model.FissionCampaignSign) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignSignDo) CreateInBatches(values []*model.FissionCampaignSign, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignSignDo) Save(values ...*model.FissionCampaignSign) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignSignDo) First() (*model.FissionCampaignSign, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSign), nil + } +} + +func (f fissionCampaignSignDo) Take() (*model.FissionCampaignSign, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSign), nil + } +} + +func (f fissionCampaignSignDo) Last() (*model.FissionCampaignSign, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSign), nil + } +} + +func (f fissionCampaignSignDo) Find() ([]*model.FissionCampaignSign, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignSign), err +} + +func (f fissionCampaignSignDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignSign, err error) { + buf := make([]*model.FissionCampaignSign, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignSignDo) FindInBatches(result *[]*model.FissionCampaignSign, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignSignDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignSignDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignSignDo) Assign(attrs ...field.AssignExpr) *fissionCampaignSignDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignSignDo) Joins(fields ...field.RelationField) *fissionCampaignSignDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignSignDo) Preload(fields ...field.RelationField) *fissionCampaignSignDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignSignDo) FirstOrInit() (*model.FissionCampaignSign, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSign), nil + } +} + +func (f fissionCampaignSignDo) FirstOrCreate() (*model.FissionCampaignSign, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSign), nil + } +} + +func (f fissionCampaignSignDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignSign, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignSignDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignSignDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignSignDo) Delete(models ...*model.FissionCampaignSign) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignSignDo) withDO(do gen.Dao) *fissionCampaignSignDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_slot.gen.go b/internal/repository/dao/fission_campaign_slot.gen.go new file mode 100644 index 0000000..f00ab6e --- /dev/null +++ b/internal/repository/dao/fission_campaign_slot.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignSlot(db *gorm.DB, opts ...gen.DOOption) fissionCampaignSlot { + _fissionCampaignSlot := fissionCampaignSlot{} + + _fissionCampaignSlot.fissionCampaignSlotDo.UseDB(db, opts...) + _fissionCampaignSlot.fissionCampaignSlotDo.UseModel(&model.FissionCampaignSlot{}) + + tableName := _fissionCampaignSlot.fissionCampaignSlotDo.TableName() + _fissionCampaignSlot.ALL = field.NewAsterisk(tableName) + _fissionCampaignSlot.ID = field.NewInt64(tableName, "id") + _fissionCampaignSlot.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignSlot.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignSlot.IsDel = field.NewUint8(tableName, "is_del") + _fissionCampaignSlot.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignSlot.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignSlot.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignSlot.Chance = field.NewInt32(tableName, "chance") + _fissionCampaignSlot.Odds = field.NewInt32(tableName, "odds") + _fissionCampaignSlot.DayChance = field.NewInt32(tableName, "day_chance") + + _fissionCampaignSlot.fillFieldMap() + + return _fissionCampaignSlot +} + +type fissionCampaignSlot struct { + fissionCampaignSlotDo fissionCampaignSlotDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + TargetNum field.Int32 // 达标条件需要的新用户个数 + InitChance field.Int32 // 初始抽奖机会次数 + Chance field.Int32 // 达标获得的抽奖机会次数 + Odds field.Int32 // 中奖概率 + DayChance field.Int32 // 每日获得的抽奖次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignSlot) Table(newTableName string) *fissionCampaignSlot { + f.fissionCampaignSlotDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignSlot) As(alias string) *fissionCampaignSlot { + f.fissionCampaignSlotDo.DO = *(f.fissionCampaignSlotDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignSlot) updateTableName(table string) *fissionCampaignSlot { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TargetNum = field.NewInt32(table, "target_num") + f.InitChance = field.NewInt32(table, "init_chance") + f.Chance = field.NewInt32(table, "chance") + f.Odds = field.NewInt32(table, "odds") + f.DayChance = field.NewInt32(table, "day_chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignSlot) WithContext(ctx context.Context) *fissionCampaignSlotDo { + return f.fissionCampaignSlotDo.WithContext(ctx) +} + +func (f fissionCampaignSlot) TableName() string { return f.fissionCampaignSlotDo.TableName() } + +func (f fissionCampaignSlot) Alias() string { return f.fissionCampaignSlotDo.Alias() } + +func (f *fissionCampaignSlot) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignSlot) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["chance"] = f.Chance + f.fieldMap["odds"] = f.Odds + f.fieldMap["day_chance"] = f.DayChance +} + +func (f fissionCampaignSlot) clone(db *gorm.DB) fissionCampaignSlot { + f.fissionCampaignSlotDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignSlot) replaceDB(db *gorm.DB) fissionCampaignSlot { + f.fissionCampaignSlotDo.ReplaceDB(db) + return f +} + +type fissionCampaignSlotDo struct{ gen.DO } + +func (f fissionCampaignSlotDo) Debug() *fissionCampaignSlotDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignSlotDo) WithContext(ctx context.Context) *fissionCampaignSlotDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignSlotDo) ReadDB() *fissionCampaignSlotDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignSlotDo) WriteDB() *fissionCampaignSlotDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignSlotDo) Session(config *gorm.Session) *fissionCampaignSlotDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignSlotDo) Clauses(conds ...clause.Expression) *fissionCampaignSlotDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignSlotDo) Returning(value interface{}, columns ...string) *fissionCampaignSlotDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignSlotDo) Not(conds ...gen.Condition) *fissionCampaignSlotDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignSlotDo) Or(conds ...gen.Condition) *fissionCampaignSlotDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignSlotDo) Select(conds ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignSlotDo) Where(conds ...gen.Condition) *fissionCampaignSlotDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignSlotDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignSlotDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignSlotDo) Order(conds ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignSlotDo) Distinct(cols ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignSlotDo) Omit(cols ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignSlotDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignSlotDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignSlotDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignSlotDo) Group(cols ...field.Expr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignSlotDo) Having(conds ...gen.Condition) *fissionCampaignSlotDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignSlotDo) Limit(limit int) *fissionCampaignSlotDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignSlotDo) Offset(offset int) *fissionCampaignSlotDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignSlotDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignSlotDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignSlotDo) Unscoped() *fissionCampaignSlotDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignSlotDo) Create(values ...*model.FissionCampaignSlot) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignSlotDo) CreateInBatches(values []*model.FissionCampaignSlot, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignSlotDo) Save(values ...*model.FissionCampaignSlot) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignSlotDo) First() (*model.FissionCampaignSlot, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSlot), nil + } +} + +func (f fissionCampaignSlotDo) Take() (*model.FissionCampaignSlot, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSlot), nil + } +} + +func (f fissionCampaignSlotDo) Last() (*model.FissionCampaignSlot, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSlot), nil + } +} + +func (f fissionCampaignSlotDo) Find() ([]*model.FissionCampaignSlot, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignSlot), err +} + +func (f fissionCampaignSlotDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignSlot, err error) { + buf := make([]*model.FissionCampaignSlot, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignSlotDo) FindInBatches(result *[]*model.FissionCampaignSlot, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignSlotDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignSlotDo) Assign(attrs ...field.AssignExpr) *fissionCampaignSlotDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignSlotDo) Joins(fields ...field.RelationField) *fissionCampaignSlotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignSlotDo) Preload(fields ...field.RelationField) *fissionCampaignSlotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignSlotDo) FirstOrInit() (*model.FissionCampaignSlot, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSlot), nil + } +} + +func (f fissionCampaignSlotDo) FirstOrCreate() (*model.FissionCampaignSlot, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignSlot), nil + } +} + +func (f fissionCampaignSlotDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignSlot, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignSlotDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignSlotDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignSlotDo) Delete(models ...*model.FissionCampaignSlot) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignSlotDo) withDO(do gen.Dao) *fissionCampaignSlotDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_style.gen.go b/internal/repository/dao/fission_campaign_style.gen.go new file mode 100644 index 0000000..291939b --- /dev/null +++ b/internal/repository/dao/fission_campaign_style.gen.go @@ -0,0 +1,471 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignStyle(db *gorm.DB, opts ...gen.DOOption) fissionCampaignStyle { + _fissionCampaignStyle := fissionCampaignStyle{} + + _fissionCampaignStyle.fissionCampaignStyleDo.UseDB(db, opts...) + _fissionCampaignStyle.fissionCampaignStyleDo.UseModel(&model.FissionCampaignStyle{}) + + tableName := _fissionCampaignStyle.fissionCampaignStyleDo.TableName() + _fissionCampaignStyle.ALL = field.NewAsterisk(tableName) + _fissionCampaignStyle.ID = field.NewInt64(tableName, "id") + _fissionCampaignStyle.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignStyle.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignStyle.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignStyle.RuleTextColor = field.NewString(tableName, "rule_text_color") + _fissionCampaignStyle.RuleBgColor = field.NewString(tableName, "rule_bg_color") + _fissionCampaignStyle.ShareText = field.NewString(tableName, "share_text") + _fissionCampaignStyle.ShareImg = field.NewString(tableName, "share_img") + _fissionCampaignStyle.RankBackgroundColor = field.NewString(tableName, "rank_background_color") + _fissionCampaignStyle.RankTextColor = field.NewString(tableName, "rank_text_color") + _fissionCampaignStyle.LinkBtnTextColor = field.NewString(tableName, "link_btn_text_color") + _fissionCampaignStyle.LinkBtnBgColor = field.NewString(tableName, "link_btn_bg_color") + _fissionCampaignStyle.LinkTextColor = field.NewString(tableName, "link_text_color") + _fissionCampaignStyle.PageTitle = field.NewString(tableName, "page_title") + _fissionCampaignStyle.IconType = field.NewInt8(tableName, "icon_type") + _fissionCampaignStyle.IconBgColor = field.NewString(tableName, "icon_bg_color") + _fissionCampaignStyle.IconTextColor = field.NewString(tableName, "icon_text_color") + _fissionCampaignStyle.MainImg = field.NewString(tableName, "main_img") + _fissionCampaignStyle.WechatImg = field.NewString(tableName, "wechat_img") + _fissionCampaignStyle.DownloadImg = field.NewString(tableName, "download_img") + _fissionCampaignStyle.WebImg = field.NewString(tableName, "web_img") + _fissionCampaignStyle.Share = field.NewString(tableName, "share") + _fissionCampaignStyle.WarmUpImg = field.NewString(tableName, "warm_up_img") + _fissionCampaignStyle.WarmUpEnd = field.NewInt32(tableName, "warm_up_end") + _fissionCampaignStyle.DlBannerImg = field.NewString(tableName, "dl_banner_img") + _fissionCampaignStyle.DlBannerAppLogo = field.NewString(tableName, "dl_banner_app_logo") + _fissionCampaignStyle.DlBannerAppName = field.NewString(tableName, "dl_banner_app_name") + _fissionCampaignStyle.DlBannerAppBtn = field.NewString(tableName, "dl_banner_app_btn") + _fissionCampaignStyle.DlBannerPosition = field.NewInt8(tableName, "dl_banner_position") + _fissionCampaignStyle.TopicColor = field.NewString(tableName, "topic_color") + _fissionCampaignStyle.IconOpen = field.NewString(tableName, "icon_open") + _fissionCampaignStyle.PcBg = field.NewString(tableName, "pc_bg") + _fissionCampaignStyle.CustomStyle = field.NewString(tableName, "custom_style") + _fissionCampaignStyle.PlayRule = field.NewString(tableName, "play_rule") + _fissionCampaignStyle.RuleImg = field.NewString(tableName, "rule_img") + _fissionCampaignStyle.BgImg = field.NewString(tableName, "bg_img") + + _fissionCampaignStyle.fillFieldMap() + + return _fissionCampaignStyle +} + +type fissionCampaignStyle struct { + fissionCampaignStyleDo fissionCampaignStyleDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + RuleTextColor field.String // 规则文字颜色 + RuleBgColor field.String // 规则背景颜色 + ShareText field.String // 分享文案 + ShareImg field.String // 分享图片 + RankBackgroundColor field.String // 排行榜背景颜色 + RankTextColor field.String // 排行榜字体颜色 + LinkBtnTextColor field.String // 分享链接按钮文字颜色 + LinkBtnBgColor field.String // 分享链接按钮背景颜色 + LinkTextColor field.String // 分享链接文字颜色 + PageTitle field.String // 页面标题 + IconType field.Int8 // 活动挂件样式(用于前端挂件选用判断) + IconBgColor field.String // 活动挂件背景色 + IconTextColor field.String // 活动挂件文字颜色 + MainImg field.String // 活动背景图 + WechatImg field.String // 微信引导页 + DownloadImg field.String // 下载引导页 + WebImg field.String // 站外活动背景图 + Share field.String // 要分享的社交媒体,例如[1,2,3] + WarmUpImg field.String // 预热海报图 + WarmUpEnd field.Int32 // 活动开始前多少分钟结束预热 + DlBannerImg field.String // 下载页横幅自定义图 + DlBannerAppLogo field.String // 下载页横幅applogo图片 + DlBannerAppName field.String // 下载页横幅app名称 + DlBannerAppBtn field.String // 下载页横幅app按钮文案 + DlBannerPosition field.Int8 // 下载页横幅位置(1-顶部,2-底部) + TopicColor field.String // 主题颜色 + IconOpen field.String // 开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友) + PcBg field.String // Pc适配背景图 + CustomStyle field.String // 自定义样式数据 + PlayRule field.String // 活动规则 + RuleImg field.String // 活动规则图片 + BgImg field.String // 玩法背景图(如:问题背景图) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignStyle) Table(newTableName string) *fissionCampaignStyle { + f.fissionCampaignStyleDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignStyle) As(alias string) *fissionCampaignStyle { + f.fissionCampaignStyleDo.DO = *(f.fissionCampaignStyleDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignStyle) updateTableName(table string) *fissionCampaignStyle { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RuleTextColor = field.NewString(table, "rule_text_color") + f.RuleBgColor = field.NewString(table, "rule_bg_color") + f.ShareText = field.NewString(table, "share_text") + f.ShareImg = field.NewString(table, "share_img") + f.RankBackgroundColor = field.NewString(table, "rank_background_color") + f.RankTextColor = field.NewString(table, "rank_text_color") + f.LinkBtnTextColor = field.NewString(table, "link_btn_text_color") + f.LinkBtnBgColor = field.NewString(table, "link_btn_bg_color") + f.LinkTextColor = field.NewString(table, "link_text_color") + f.PageTitle = field.NewString(table, "page_title") + f.IconType = field.NewInt8(table, "icon_type") + f.IconBgColor = field.NewString(table, "icon_bg_color") + f.IconTextColor = field.NewString(table, "icon_text_color") + f.MainImg = field.NewString(table, "main_img") + f.WechatImg = field.NewString(table, "wechat_img") + f.DownloadImg = field.NewString(table, "download_img") + f.WebImg = field.NewString(table, "web_img") + f.Share = field.NewString(table, "share") + f.WarmUpImg = field.NewString(table, "warm_up_img") + f.WarmUpEnd = field.NewInt32(table, "warm_up_end") + f.DlBannerImg = field.NewString(table, "dl_banner_img") + f.DlBannerAppLogo = field.NewString(table, "dl_banner_app_logo") + f.DlBannerAppName = field.NewString(table, "dl_banner_app_name") + f.DlBannerAppBtn = field.NewString(table, "dl_banner_app_btn") + f.DlBannerPosition = field.NewInt8(table, "dl_banner_position") + f.TopicColor = field.NewString(table, "topic_color") + f.IconOpen = field.NewString(table, "icon_open") + f.PcBg = field.NewString(table, "pc_bg") + f.CustomStyle = field.NewString(table, "custom_style") + f.PlayRule = field.NewString(table, "play_rule") + f.RuleImg = field.NewString(table, "rule_img") + f.BgImg = field.NewString(table, "bg_img") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignStyle) WithContext(ctx context.Context) *fissionCampaignStyleDo { + return f.fissionCampaignStyleDo.WithContext(ctx) +} + +func (f fissionCampaignStyle) TableName() string { return f.fissionCampaignStyleDo.TableName() } + +func (f fissionCampaignStyle) Alias() string { return f.fissionCampaignStyleDo.Alias() } + +func (f *fissionCampaignStyle) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignStyle) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 36) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["rule_text_color"] = f.RuleTextColor + f.fieldMap["rule_bg_color"] = f.RuleBgColor + f.fieldMap["share_text"] = f.ShareText + f.fieldMap["share_img"] = f.ShareImg + f.fieldMap["rank_background_color"] = f.RankBackgroundColor + f.fieldMap["rank_text_color"] = f.RankTextColor + f.fieldMap["link_btn_text_color"] = f.LinkBtnTextColor + f.fieldMap["link_btn_bg_color"] = f.LinkBtnBgColor + f.fieldMap["link_text_color"] = f.LinkTextColor + f.fieldMap["page_title"] = f.PageTitle + f.fieldMap["icon_type"] = f.IconType + f.fieldMap["icon_bg_color"] = f.IconBgColor + f.fieldMap["icon_text_color"] = f.IconTextColor + f.fieldMap["main_img"] = f.MainImg + f.fieldMap["wechat_img"] = f.WechatImg + f.fieldMap["download_img"] = f.DownloadImg + f.fieldMap["web_img"] = f.WebImg + f.fieldMap["share"] = f.Share + f.fieldMap["warm_up_img"] = f.WarmUpImg + f.fieldMap["warm_up_end"] = f.WarmUpEnd + f.fieldMap["dl_banner_img"] = f.DlBannerImg + f.fieldMap["dl_banner_app_logo"] = f.DlBannerAppLogo + f.fieldMap["dl_banner_app_name"] = f.DlBannerAppName + f.fieldMap["dl_banner_app_btn"] = f.DlBannerAppBtn + f.fieldMap["dl_banner_position"] = f.DlBannerPosition + f.fieldMap["topic_color"] = f.TopicColor + f.fieldMap["icon_open"] = f.IconOpen + f.fieldMap["pc_bg"] = f.PcBg + f.fieldMap["custom_style"] = f.CustomStyle + f.fieldMap["play_rule"] = f.PlayRule + f.fieldMap["rule_img"] = f.RuleImg + f.fieldMap["bg_img"] = f.BgImg +} + +func (f fissionCampaignStyle) clone(db *gorm.DB) fissionCampaignStyle { + f.fissionCampaignStyleDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignStyle) replaceDB(db *gorm.DB) fissionCampaignStyle { + f.fissionCampaignStyleDo.ReplaceDB(db) + return f +} + +type fissionCampaignStyleDo struct{ gen.DO } + +func (f fissionCampaignStyleDo) Debug() *fissionCampaignStyleDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignStyleDo) WithContext(ctx context.Context) *fissionCampaignStyleDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignStyleDo) ReadDB() *fissionCampaignStyleDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignStyleDo) WriteDB() *fissionCampaignStyleDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignStyleDo) Session(config *gorm.Session) *fissionCampaignStyleDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignStyleDo) Clauses(conds ...clause.Expression) *fissionCampaignStyleDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignStyleDo) Returning(value interface{}, columns ...string) *fissionCampaignStyleDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignStyleDo) Not(conds ...gen.Condition) *fissionCampaignStyleDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignStyleDo) Or(conds ...gen.Condition) *fissionCampaignStyleDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignStyleDo) Select(conds ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignStyleDo) Where(conds ...gen.Condition) *fissionCampaignStyleDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignStyleDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignStyleDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignStyleDo) Order(conds ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignStyleDo) Distinct(cols ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignStyleDo) Omit(cols ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignStyleDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignStyleDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignStyleDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignStyleDo) Group(cols ...field.Expr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignStyleDo) Having(conds ...gen.Condition) *fissionCampaignStyleDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignStyleDo) Limit(limit int) *fissionCampaignStyleDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignStyleDo) Offset(offset int) *fissionCampaignStyleDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignStyleDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignStyleDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignStyleDo) Unscoped() *fissionCampaignStyleDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignStyleDo) Create(values ...*model.FissionCampaignStyle) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignStyleDo) CreateInBatches(values []*model.FissionCampaignStyle, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignStyleDo) Save(values ...*model.FissionCampaignStyle) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignStyleDo) First() (*model.FissionCampaignStyle, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignStyle), nil + } +} + +func (f fissionCampaignStyleDo) Take() (*model.FissionCampaignStyle, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignStyle), nil + } +} + +func (f fissionCampaignStyleDo) Last() (*model.FissionCampaignStyle, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignStyle), nil + } +} + +func (f fissionCampaignStyleDo) Find() ([]*model.FissionCampaignStyle, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignStyle), err +} + +func (f fissionCampaignStyleDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignStyle, err error) { + buf := make([]*model.FissionCampaignStyle, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignStyleDo) FindInBatches(result *[]*model.FissionCampaignStyle, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignStyleDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignStyleDo) Assign(attrs ...field.AssignExpr) *fissionCampaignStyleDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignStyleDo) Joins(fields ...field.RelationField) *fissionCampaignStyleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignStyleDo) Preload(fields ...field.RelationField) *fissionCampaignStyleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignStyleDo) FirstOrInit() (*model.FissionCampaignStyle, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignStyle), nil + } +} + +func (f fissionCampaignStyleDo) FirstOrCreate() (*model.FissionCampaignStyle, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignStyle), nil + } +} + +func (f fissionCampaignStyleDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignStyle, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignStyleDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignStyleDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignStyleDo) Delete(models ...*model.FissionCampaignStyle) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignStyleDo) withDO(do gen.Dao) *fissionCampaignStyleDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_task.gen.go b/internal/repository/dao/fission_campaign_task.gen.go new file mode 100644 index 0000000..cd1780d --- /dev/null +++ b/internal/repository/dao/fission_campaign_task.gen.go @@ -0,0 +1,423 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignTask(db *gorm.DB, opts ...gen.DOOption) fissionCampaignTask { + _fissionCampaignTask := fissionCampaignTask{} + + _fissionCampaignTask.fissionCampaignTaskDo.UseDB(db, opts...) + _fissionCampaignTask.fissionCampaignTaskDo.UseModel(&model.FissionCampaignTask{}) + + tableName := _fissionCampaignTask.fissionCampaignTaskDo.TableName() + _fissionCampaignTask.ALL = field.NewAsterisk(tableName) + _fissionCampaignTask.ID = field.NewInt64(tableName, "id") + _fissionCampaignTask.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignTask.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignTask.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignTask.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignTask.TaskType = field.NewInt8(tableName, "task_type") + _fissionCampaignTask.TaskMark = field.NewString(tableName, "task_mark") + _fissionCampaignTask.PropMark = field.NewString(tableName, "prop_mark") + _fissionCampaignTask.Num = field.NewInt32(tableName, "num") + _fissionCampaignTask.Chance = field.NewInt32(tableName, "chance") + _fissionCampaignTask.ChanceLimit = field.NewInt32(tableName, "chance_limit") + _fissionCampaignTask.TaskLimit = field.NewInt32(tableName, "task_limit") + _fissionCampaignTask.Percent = field.NewFloat64(tableName, "percent") + _fissionCampaignTask.PercentLimit = field.NewFloat64(tableName, "percent_limit") + _fissionCampaignTask.DayLimit = field.NewInt32(tableName, "day_limit") + _fissionCampaignTask.LevelLimit = field.NewString(tableName, "level_limit") + _fissionCampaignTask.LangMarks = field.NewString(tableName, "lang_marks") + _fissionCampaignTask.WeekLimit = field.NewInt32(tableName, "week_limit") + _fissionCampaignTask.WeekNum = field.NewInt8(tableName, "week_num") + _fissionCampaignTask.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignTask.HasPre = field.NewInt8(tableName, "has_pre") + _fissionCampaignTask.PreCond = field.NewInt32(tableName, "pre_cond") + _fissionCampaignTask.ExpiredMin = field.NewInt32(tableName, "expired_min") + _fissionCampaignTask.AwardMode = field.NewInt8(tableName, "award_mode") + + _fissionCampaignTask.fillFieldMap() + + return _fissionCampaignTask +} + +type fissionCampaignTask struct { + fissionCampaignTaskDo fissionCampaignTaskDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID(fission_campaign表) + TaskType field.Int8 // 任务类型(1-下载app,2-注册-app,3-满足所有自定义条件,4-满足特定自定义条件) + TaskMark field.String // 任务类型标识 + PropMark field.String // 发放的道具标识(chance-次数,fixed_roll-幸运骰,reward-奖品) + Num field.Int32 // 完成所需要的触发次数 + Chance field.Int32 // 完成发放的次数(如:骰子数) + ChanceLimit field.Int32 // 最大可发放的次数 + TaskLimit field.Int32 // 任务最大可完成次数 + Percent field.Float64 // 完成发放的百分比值 + PercentLimit field.Float64 // 最大获得的百分比值 + DayLimit field.Int32 // 每日可完成任务的次数(0为不限制) + LevelLimit field.String // 用户等级ID集合 + LangMarks field.String // 语言限制集合 + WeekLimit field.Int32 // 每周限制数 + WeekNum field.Int8 // 周几刷新 + RewardID field.Int64 // 发放的奖励id + HasPre field.Int8 // 是否有前置条件(0-否,1-是) + PreCond field.Int32 // 前置条件 + ExpiredMin field.Int32 // 过期分钟 + AwardMode field.Int8 // 领奖模式(0-自动领奖,1-手动领奖) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignTask) Table(newTableName string) *fissionCampaignTask { + f.fissionCampaignTaskDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignTask) As(alias string) *fissionCampaignTask { + f.fissionCampaignTaskDo.DO = *(f.fissionCampaignTaskDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignTask) updateTableName(table string) *fissionCampaignTask { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TaskType = field.NewInt8(table, "task_type") + f.TaskMark = field.NewString(table, "task_mark") + f.PropMark = field.NewString(table, "prop_mark") + f.Num = field.NewInt32(table, "num") + f.Chance = field.NewInt32(table, "chance") + f.ChanceLimit = field.NewInt32(table, "chance_limit") + f.TaskLimit = field.NewInt32(table, "task_limit") + f.Percent = field.NewFloat64(table, "percent") + f.PercentLimit = field.NewFloat64(table, "percent_limit") + f.DayLimit = field.NewInt32(table, "day_limit") + f.LevelLimit = field.NewString(table, "level_limit") + f.LangMarks = field.NewString(table, "lang_marks") + f.WeekLimit = field.NewInt32(table, "week_limit") + f.WeekNum = field.NewInt8(table, "week_num") + f.RewardID = field.NewInt64(table, "reward_id") + f.HasPre = field.NewInt8(table, "has_pre") + f.PreCond = field.NewInt32(table, "pre_cond") + f.ExpiredMin = field.NewInt32(table, "expired_min") + f.AwardMode = field.NewInt8(table, "award_mode") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignTask) WithContext(ctx context.Context) *fissionCampaignTaskDo { + return f.fissionCampaignTaskDo.WithContext(ctx) +} + +func (f fissionCampaignTask) TableName() string { return f.fissionCampaignTaskDo.TableName() } + +func (f fissionCampaignTask) Alias() string { return f.fissionCampaignTaskDo.Alias() } + +func (f *fissionCampaignTask) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignTask) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 24) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["task_type"] = f.TaskType + f.fieldMap["task_mark"] = f.TaskMark + f.fieldMap["prop_mark"] = f.PropMark + f.fieldMap["num"] = f.Num + f.fieldMap["chance"] = f.Chance + f.fieldMap["chance_limit"] = f.ChanceLimit + f.fieldMap["task_limit"] = f.TaskLimit + f.fieldMap["percent"] = f.Percent + f.fieldMap["percent_limit"] = f.PercentLimit + f.fieldMap["day_limit"] = f.DayLimit + f.fieldMap["level_limit"] = f.LevelLimit + f.fieldMap["lang_marks"] = f.LangMarks + f.fieldMap["week_limit"] = f.WeekLimit + f.fieldMap["week_num"] = f.WeekNum + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["has_pre"] = f.HasPre + f.fieldMap["pre_cond"] = f.PreCond + f.fieldMap["expired_min"] = f.ExpiredMin + f.fieldMap["award_mode"] = f.AwardMode +} + +func (f fissionCampaignTask) clone(db *gorm.DB) fissionCampaignTask { + f.fissionCampaignTaskDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignTask) replaceDB(db *gorm.DB) fissionCampaignTask { + f.fissionCampaignTaskDo.ReplaceDB(db) + return f +} + +type fissionCampaignTaskDo struct{ gen.DO } + +func (f fissionCampaignTaskDo) Debug() *fissionCampaignTaskDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignTaskDo) WithContext(ctx context.Context) *fissionCampaignTaskDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignTaskDo) ReadDB() *fissionCampaignTaskDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignTaskDo) WriteDB() *fissionCampaignTaskDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignTaskDo) Session(config *gorm.Session) *fissionCampaignTaskDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignTaskDo) Clauses(conds ...clause.Expression) *fissionCampaignTaskDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignTaskDo) Returning(value interface{}, columns ...string) *fissionCampaignTaskDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignTaskDo) Not(conds ...gen.Condition) *fissionCampaignTaskDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignTaskDo) Or(conds ...gen.Condition) *fissionCampaignTaskDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignTaskDo) Select(conds ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignTaskDo) Where(conds ...gen.Condition) *fissionCampaignTaskDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignTaskDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignTaskDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignTaskDo) Order(conds ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignTaskDo) Distinct(cols ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignTaskDo) Omit(cols ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignTaskDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignTaskDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignTaskDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignTaskDo) Group(cols ...field.Expr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignTaskDo) Having(conds ...gen.Condition) *fissionCampaignTaskDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignTaskDo) Limit(limit int) *fissionCampaignTaskDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignTaskDo) Offset(offset int) *fissionCampaignTaskDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignTaskDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignTaskDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignTaskDo) Unscoped() *fissionCampaignTaskDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignTaskDo) Create(values ...*model.FissionCampaignTask) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignTaskDo) CreateInBatches(values []*model.FissionCampaignTask, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignTaskDo) Save(values ...*model.FissionCampaignTask) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignTaskDo) First() (*model.FissionCampaignTask, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTask), nil + } +} + +func (f fissionCampaignTaskDo) Take() (*model.FissionCampaignTask, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTask), nil + } +} + +func (f fissionCampaignTaskDo) Last() (*model.FissionCampaignTask, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTask), nil + } +} + +func (f fissionCampaignTaskDo) Find() ([]*model.FissionCampaignTask, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignTask), err +} + +func (f fissionCampaignTaskDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignTask, err error) { + buf := make([]*model.FissionCampaignTask, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignTaskDo) FindInBatches(result *[]*model.FissionCampaignTask, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignTaskDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignTaskDo) Assign(attrs ...field.AssignExpr) *fissionCampaignTaskDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignTaskDo) Joins(fields ...field.RelationField) *fissionCampaignTaskDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignTaskDo) Preload(fields ...field.RelationField) *fissionCampaignTaskDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignTaskDo) FirstOrInit() (*model.FissionCampaignTask, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTask), nil + } +} + +func (f fissionCampaignTaskDo) FirstOrCreate() (*model.FissionCampaignTask, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTask), nil + } +} + +func (f fissionCampaignTaskDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignTask, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignTaskDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignTaskDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignTaskDo) Delete(models ...*model.FissionCampaignTask) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignTaskDo) withDO(do gen.Dao) *fissionCampaignTaskDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_ticket.gen.go b/internal/repository/dao/fission_campaign_ticket.gen.go new file mode 100644 index 0000000..108025d --- /dev/null +++ b/internal/repository/dao/fission_campaign_ticket.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignTicket(db *gorm.DB, opts ...gen.DOOption) fissionCampaignTicket { + _fissionCampaignTicket := fissionCampaignTicket{} + + _fissionCampaignTicket.fissionCampaignTicketDo.UseDB(db, opts...) + _fissionCampaignTicket.fissionCampaignTicketDo.UseModel(&model.FissionCampaignTicket{}) + + tableName := _fissionCampaignTicket.fissionCampaignTicketDo.TableName() + _fissionCampaignTicket.ALL = field.NewAsterisk(tableName) + _fissionCampaignTicket.ID = field.NewInt64(tableName, "id") + _fissionCampaignTicket.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignTicket.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignTicket.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignTicket.Mark = field.NewString(tableName, "mark") + _fissionCampaignTicket.Open = field.NewInt8(tableName, "open") + _fissionCampaignTicket.AppEvent = field.NewInt8(tableName, "app_event") + _fissionCampaignTicket.BothType = field.NewInt8(tableName, "both_type") + _fissionCampaignTicket.HelpEvent = field.NewString(tableName, "help_event") + _fissionCampaignTicket.PreEvent = field.NewInt8(tableName, "pre_event") + + _fissionCampaignTicket.fillFieldMap() + + return _fissionCampaignTicket +} + +type fissionCampaignTicket struct { + fissionCampaignTicketDo fissionCampaignTicketDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + Mark field.String // 支持规则标识(fixed-固定事件,custom-自定义事件,reward_help-奖品助力) + Open field.Int8 // 开启状态(0-未开启,1-开启) + AppEvent field.Int8 // 固定事件选项(1-安装;2-注册) + /* + 自定义事件满足条件(1-所有条件满足,2-任一条件满足) + + */ + BothType field.Int8 + HelpEvent field.String // 支持助力事件(help_install,help_register,help_click,help_open) + PreEvent field.Int8 // 自定义事件前置事件(1-安装;2-注册) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignTicket) Table(newTableName string) *fissionCampaignTicket { + f.fissionCampaignTicketDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignTicket) As(alias string) *fissionCampaignTicket { + f.fissionCampaignTicketDo.DO = *(f.fissionCampaignTicketDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignTicket) updateTableName(table string) *fissionCampaignTicket { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.Open = field.NewInt8(table, "open") + f.AppEvent = field.NewInt8(table, "app_event") + f.BothType = field.NewInt8(table, "both_type") + f.HelpEvent = field.NewString(table, "help_event") + f.PreEvent = field.NewInt8(table, "pre_event") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignTicket) WithContext(ctx context.Context) *fissionCampaignTicketDo { + return f.fissionCampaignTicketDo.WithContext(ctx) +} + +func (f fissionCampaignTicket) TableName() string { return f.fissionCampaignTicketDo.TableName() } + +func (f fissionCampaignTicket) Alias() string { return f.fissionCampaignTicketDo.Alias() } + +func (f *fissionCampaignTicket) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignTicket) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["open"] = f.Open + f.fieldMap["app_event"] = f.AppEvent + f.fieldMap["both_type"] = f.BothType + f.fieldMap["help_event"] = f.HelpEvent + f.fieldMap["pre_event"] = f.PreEvent +} + +func (f fissionCampaignTicket) clone(db *gorm.DB) fissionCampaignTicket { + f.fissionCampaignTicketDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignTicket) replaceDB(db *gorm.DB) fissionCampaignTicket { + f.fissionCampaignTicketDo.ReplaceDB(db) + return f +} + +type fissionCampaignTicketDo struct{ gen.DO } + +func (f fissionCampaignTicketDo) Debug() *fissionCampaignTicketDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignTicketDo) WithContext(ctx context.Context) *fissionCampaignTicketDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignTicketDo) ReadDB() *fissionCampaignTicketDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignTicketDo) WriteDB() *fissionCampaignTicketDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignTicketDo) Session(config *gorm.Session) *fissionCampaignTicketDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignTicketDo) Clauses(conds ...clause.Expression) *fissionCampaignTicketDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignTicketDo) Returning(value interface{}, columns ...string) *fissionCampaignTicketDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignTicketDo) Not(conds ...gen.Condition) *fissionCampaignTicketDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignTicketDo) Or(conds ...gen.Condition) *fissionCampaignTicketDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignTicketDo) Select(conds ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignTicketDo) Where(conds ...gen.Condition) *fissionCampaignTicketDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignTicketDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignTicketDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignTicketDo) Order(conds ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignTicketDo) Distinct(cols ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignTicketDo) Omit(cols ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignTicketDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignTicketDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignTicketDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignTicketDo) Group(cols ...field.Expr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignTicketDo) Having(conds ...gen.Condition) *fissionCampaignTicketDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignTicketDo) Limit(limit int) *fissionCampaignTicketDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignTicketDo) Offset(offset int) *fissionCampaignTicketDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignTicketDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignTicketDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignTicketDo) Unscoped() *fissionCampaignTicketDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignTicketDo) Create(values ...*model.FissionCampaignTicket) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignTicketDo) CreateInBatches(values []*model.FissionCampaignTicket, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignTicketDo) Save(values ...*model.FissionCampaignTicket) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignTicketDo) First() (*model.FissionCampaignTicket, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTicket), nil + } +} + +func (f fissionCampaignTicketDo) Take() (*model.FissionCampaignTicket, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTicket), nil + } +} + +func (f fissionCampaignTicketDo) Last() (*model.FissionCampaignTicket, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTicket), nil + } +} + +func (f fissionCampaignTicketDo) Find() ([]*model.FissionCampaignTicket, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignTicket), err +} + +func (f fissionCampaignTicketDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignTicket, err error) { + buf := make([]*model.FissionCampaignTicket, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignTicketDo) FindInBatches(result *[]*model.FissionCampaignTicket, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignTicketDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignTicketDo) Assign(attrs ...field.AssignExpr) *fissionCampaignTicketDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignTicketDo) Joins(fields ...field.RelationField) *fissionCampaignTicketDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignTicketDo) Preload(fields ...field.RelationField) *fissionCampaignTicketDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignTicketDo) FirstOrInit() (*model.FissionCampaignTicket, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTicket), nil + } +} + +func (f fissionCampaignTicketDo) FirstOrCreate() (*model.FissionCampaignTicket, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignTicket), nil + } +} + +func (f fissionCampaignTicketDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignTicket, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignTicketDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignTicketDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignTicketDo) Delete(models ...*model.FissionCampaignTicket) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignTicketDo) withDO(do gen.Dao) *fissionCampaignTicketDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_uno.gen.go b/internal/repository/dao/fission_campaign_uno.gen.go new file mode 100644 index 0000000..c81d90a --- /dev/null +++ b/internal/repository/dao/fission_campaign_uno.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignUno(db *gorm.DB, opts ...gen.DOOption) fissionCampaignUno { + _fissionCampaignUno := fissionCampaignUno{} + + _fissionCampaignUno.fissionCampaignUnoDo.UseDB(db, opts...) + _fissionCampaignUno.fissionCampaignUnoDo.UseModel(&model.FissionCampaignUno{}) + + tableName := _fissionCampaignUno.fissionCampaignUnoDo.TableName() + _fissionCampaignUno.ALL = field.NewAsterisk(tableName) + _fissionCampaignUno.ID = field.NewInt64(tableName, "id") + _fissionCampaignUno.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignUno.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignUno.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignUno.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignUno.PropMarks = field.NewString(tableName, "prop_marks") + + _fissionCampaignUno.fillFieldMap() + + return _fissionCampaignUno +} + +type fissionCampaignUno struct { + fissionCampaignUnoDo fissionCampaignUnoDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + InitChance field.Int32 // 初始投票次数 + PropMarks field.String // 开启的道具(three-+3道具卡,five-+5道具卡,fix-固定颜色道具卡) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignUno) Table(newTableName string) *fissionCampaignUno { + f.fissionCampaignUnoDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignUno) As(alias string) *fissionCampaignUno { + f.fissionCampaignUnoDo.DO = *(f.fissionCampaignUnoDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignUno) updateTableName(table string) *fissionCampaignUno { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.InitChance = field.NewInt32(table, "init_chance") + f.PropMarks = field.NewString(table, "prop_marks") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignUno) WithContext(ctx context.Context) *fissionCampaignUnoDo { + return f.fissionCampaignUnoDo.WithContext(ctx) +} + +func (f fissionCampaignUno) TableName() string { return f.fissionCampaignUnoDo.TableName() } + +func (f fissionCampaignUno) Alias() string { return f.fissionCampaignUnoDo.Alias() } + +func (f *fissionCampaignUno) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignUno) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["prop_marks"] = f.PropMarks +} + +func (f fissionCampaignUno) clone(db *gorm.DB) fissionCampaignUno { + f.fissionCampaignUnoDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignUno) replaceDB(db *gorm.DB) fissionCampaignUno { + f.fissionCampaignUnoDo.ReplaceDB(db) + return f +} + +type fissionCampaignUnoDo struct{ gen.DO } + +func (f fissionCampaignUnoDo) Debug() *fissionCampaignUnoDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignUnoDo) WithContext(ctx context.Context) *fissionCampaignUnoDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignUnoDo) ReadDB() *fissionCampaignUnoDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignUnoDo) WriteDB() *fissionCampaignUnoDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignUnoDo) Session(config *gorm.Session) *fissionCampaignUnoDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignUnoDo) Clauses(conds ...clause.Expression) *fissionCampaignUnoDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignUnoDo) Returning(value interface{}, columns ...string) *fissionCampaignUnoDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignUnoDo) Not(conds ...gen.Condition) *fissionCampaignUnoDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignUnoDo) Or(conds ...gen.Condition) *fissionCampaignUnoDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignUnoDo) Select(conds ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignUnoDo) Where(conds ...gen.Condition) *fissionCampaignUnoDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignUnoDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignUnoDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignUnoDo) Order(conds ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignUnoDo) Distinct(cols ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignUnoDo) Omit(cols ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignUnoDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignUnoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignUnoDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignUnoDo) Group(cols ...field.Expr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignUnoDo) Having(conds ...gen.Condition) *fissionCampaignUnoDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignUnoDo) Limit(limit int) *fissionCampaignUnoDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignUnoDo) Offset(offset int) *fissionCampaignUnoDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignUnoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignUnoDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignUnoDo) Unscoped() *fissionCampaignUnoDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignUnoDo) Create(values ...*model.FissionCampaignUno) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignUnoDo) CreateInBatches(values []*model.FissionCampaignUno, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignUnoDo) Save(values ...*model.FissionCampaignUno) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignUnoDo) First() (*model.FissionCampaignUno, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUno), nil + } +} + +func (f fissionCampaignUnoDo) Take() (*model.FissionCampaignUno, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUno), nil + } +} + +func (f fissionCampaignUnoDo) Last() (*model.FissionCampaignUno, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUno), nil + } +} + +func (f fissionCampaignUnoDo) Find() ([]*model.FissionCampaignUno, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignUno), err +} + +func (f fissionCampaignUnoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignUno, err error) { + buf := make([]*model.FissionCampaignUno, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignUnoDo) FindInBatches(result *[]*model.FissionCampaignUno, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignUnoDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignUnoDo) Assign(attrs ...field.AssignExpr) *fissionCampaignUnoDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignUnoDo) Joins(fields ...field.RelationField) *fissionCampaignUnoDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignUnoDo) Preload(fields ...field.RelationField) *fissionCampaignUnoDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignUnoDo) FirstOrInit() (*model.FissionCampaignUno, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUno), nil + } +} + +func (f fissionCampaignUnoDo) FirstOrCreate() (*model.FissionCampaignUno, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUno), nil + } +} + +func (f fissionCampaignUnoDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignUno, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignUnoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignUnoDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignUnoDo) Delete(models ...*model.FissionCampaignUno) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignUnoDo) withDO(do gen.Dao) *fissionCampaignUnoDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_uno_card.gen.go b/internal/repository/dao/fission_campaign_uno_card.gen.go new file mode 100644 index 0000000..32a03a8 --- /dev/null +++ b/internal/repository/dao/fission_campaign_uno_card.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignUnoCard(db *gorm.DB, opts ...gen.DOOption) fissionCampaignUnoCard { + _fissionCampaignUnoCard := fissionCampaignUnoCard{} + + _fissionCampaignUnoCard.fissionCampaignUnoCardDo.UseDB(db, opts...) + _fissionCampaignUnoCard.fissionCampaignUnoCardDo.UseModel(&model.FissionCampaignUnoCard{}) + + tableName := _fissionCampaignUnoCard.fissionCampaignUnoCardDo.TableName() + _fissionCampaignUnoCard.ALL = field.NewAsterisk(tableName) + _fissionCampaignUnoCard.ID = field.NewInt64(tableName, "id") + _fissionCampaignUnoCard.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignUnoCard.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignUnoCard.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignUnoCard.Mark = field.NewString(tableName, "mark") + _fissionCampaignUnoCard.CardNo = field.NewInt32(tableName, "card_no") + _fissionCampaignUnoCard.Title = field.NewString(tableName, "title") + _fissionCampaignUnoCard.ImgURL = field.NewString(tableName, "img_url") + _fissionCampaignUnoCard.WebURL = field.NewString(tableName, "web_url") + _fissionCampaignUnoCard.AppParam = field.NewString(tableName, "app_param") + _fissionCampaignUnoCard.PcParam = field.NewString(tableName, "pc_param") + + _fissionCampaignUnoCard.fillFieldMap() + + return _fissionCampaignUnoCard +} + +type fissionCampaignUnoCard struct { + fissionCampaignUnoCardDo fissionCampaignUnoCardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + Mark field.String // 牌色标识 + CardNo field.Int32 // 牌号 + Title field.String // 跳转按钮文案 + ImgURL field.String // 图片地址 + WebURL field.String // Web跳转地址 + AppParam field.String // App跳转参数 + PcParam field.String // pc跳转参数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignUnoCard) Table(newTableName string) *fissionCampaignUnoCard { + f.fissionCampaignUnoCardDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignUnoCard) As(alias string) *fissionCampaignUnoCard { + f.fissionCampaignUnoCardDo.DO = *(f.fissionCampaignUnoCardDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignUnoCard) updateTableName(table string) *fissionCampaignUnoCard { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.CardNo = field.NewInt32(table, "card_no") + f.Title = field.NewString(table, "title") + f.ImgURL = field.NewString(table, "img_url") + f.WebURL = field.NewString(table, "web_url") + f.AppParam = field.NewString(table, "app_param") + f.PcParam = field.NewString(table, "pc_param") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignUnoCard) WithContext(ctx context.Context) *fissionCampaignUnoCardDo { + return f.fissionCampaignUnoCardDo.WithContext(ctx) +} + +func (f fissionCampaignUnoCard) TableName() string { return f.fissionCampaignUnoCardDo.TableName() } + +func (f fissionCampaignUnoCard) Alias() string { return f.fissionCampaignUnoCardDo.Alias() } + +func (f *fissionCampaignUnoCard) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignUnoCard) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["card_no"] = f.CardNo + f.fieldMap["title"] = f.Title + f.fieldMap["img_url"] = f.ImgURL + f.fieldMap["web_url"] = f.WebURL + f.fieldMap["app_param"] = f.AppParam + f.fieldMap["pc_param"] = f.PcParam +} + +func (f fissionCampaignUnoCard) clone(db *gorm.DB) fissionCampaignUnoCard { + f.fissionCampaignUnoCardDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignUnoCard) replaceDB(db *gorm.DB) fissionCampaignUnoCard { + f.fissionCampaignUnoCardDo.ReplaceDB(db) + return f +} + +type fissionCampaignUnoCardDo struct{ gen.DO } + +func (f fissionCampaignUnoCardDo) Debug() *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignUnoCardDo) WithContext(ctx context.Context) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignUnoCardDo) ReadDB() *fissionCampaignUnoCardDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignUnoCardDo) WriteDB() *fissionCampaignUnoCardDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignUnoCardDo) Session(config *gorm.Session) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignUnoCardDo) Clauses(conds ...clause.Expression) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignUnoCardDo) Returning(value interface{}, columns ...string) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignUnoCardDo) Not(conds ...gen.Condition) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignUnoCardDo) Or(conds ...gen.Condition) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignUnoCardDo) Select(conds ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignUnoCardDo) Where(conds ...gen.Condition) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignUnoCardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignUnoCardDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignUnoCardDo) Order(conds ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignUnoCardDo) Distinct(cols ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignUnoCardDo) Omit(cols ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignUnoCardDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignUnoCardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignUnoCardDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignUnoCardDo) Group(cols ...field.Expr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignUnoCardDo) Having(conds ...gen.Condition) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignUnoCardDo) Limit(limit int) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignUnoCardDo) Offset(offset int) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignUnoCardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignUnoCardDo) Unscoped() *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignUnoCardDo) Create(values ...*model.FissionCampaignUnoCard) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignUnoCardDo) CreateInBatches(values []*model.FissionCampaignUnoCard, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignUnoCardDo) Save(values ...*model.FissionCampaignUnoCard) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignUnoCardDo) First() (*model.FissionCampaignUnoCard, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoCard), nil + } +} + +func (f fissionCampaignUnoCardDo) Take() (*model.FissionCampaignUnoCard, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoCard), nil + } +} + +func (f fissionCampaignUnoCardDo) Last() (*model.FissionCampaignUnoCard, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoCard), nil + } +} + +func (f fissionCampaignUnoCardDo) Find() ([]*model.FissionCampaignUnoCard, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignUnoCard), err +} + +func (f fissionCampaignUnoCardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignUnoCard, err error) { + buf := make([]*model.FissionCampaignUnoCard, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignUnoCardDo) FindInBatches(result *[]*model.FissionCampaignUnoCard, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignUnoCardDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignUnoCardDo) Assign(attrs ...field.AssignExpr) *fissionCampaignUnoCardDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignUnoCardDo) Joins(fields ...field.RelationField) *fissionCampaignUnoCardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignUnoCardDo) Preload(fields ...field.RelationField) *fissionCampaignUnoCardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignUnoCardDo) FirstOrInit() (*model.FissionCampaignUnoCard, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoCard), nil + } +} + +func (f fissionCampaignUnoCardDo) FirstOrCreate() (*model.FissionCampaignUnoCard, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoCard), nil + } +} + +func (f fissionCampaignUnoCardDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignUnoCard, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignUnoCardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignUnoCardDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignUnoCardDo) Delete(models ...*model.FissionCampaignUnoCard) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignUnoCardDo) withDO(do gen.Dao) *fissionCampaignUnoCardDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_uno_group.gen.go b/internal/repository/dao/fission_campaign_uno_group.gen.go new file mode 100644 index 0000000..118f034 --- /dev/null +++ b/internal/repository/dao/fission_campaign_uno_group.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignUnoGroup(db *gorm.DB, opts ...gen.DOOption) fissionCampaignUnoGroup { + _fissionCampaignUnoGroup := fissionCampaignUnoGroup{} + + _fissionCampaignUnoGroup.fissionCampaignUnoGroupDo.UseDB(db, opts...) + _fissionCampaignUnoGroup.fissionCampaignUnoGroupDo.UseModel(&model.FissionCampaignUnoGroup{}) + + tableName := _fissionCampaignUnoGroup.fissionCampaignUnoGroupDo.TableName() + _fissionCampaignUnoGroup.ALL = field.NewAsterisk(tableName) + _fissionCampaignUnoGroup.ID = field.NewInt64(tableName, "id") + _fissionCampaignUnoGroup.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignUnoGroup.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignUnoGroup.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignUnoGroup.Mark = field.NewString(tableName, "mark") + _fissionCampaignUnoGroup.Odds = field.NewString(tableName, "odds") + _fissionCampaignUnoGroup.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignUnoGroup.OpenRule = field.NewInt8(tableName, "open_rule") + _fissionCampaignUnoGroup.LimitRule = field.NewString(tableName, "limit_rule") + _fissionCampaignUnoGroup.CustomCard = field.NewInt8(tableName, "custom_card") + + _fissionCampaignUnoGroup.fillFieldMap() + + return _fissionCampaignUnoGroup +} + +type fissionCampaignUnoGroup struct { + fissionCampaignUnoGroupDo fissionCampaignUnoGroupDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + Mark field.String // 牌色标识 + Odds field.String // 获得牌型概率 + RewardID field.Int64 // 奖品id + OpenRule field.Int8 // 是否开启得派规则(0-否,1-时) + LimitRule field.String // 上限规则 + CustomCard field.Int8 // 自定义卡牌(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignUnoGroup) Table(newTableName string) *fissionCampaignUnoGroup { + f.fissionCampaignUnoGroupDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignUnoGroup) As(alias string) *fissionCampaignUnoGroup { + f.fissionCampaignUnoGroupDo.DO = *(f.fissionCampaignUnoGroupDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignUnoGroup) updateTableName(table string) *fissionCampaignUnoGroup { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.Odds = field.NewString(table, "odds") + f.RewardID = field.NewInt64(table, "reward_id") + f.OpenRule = field.NewInt8(table, "open_rule") + f.LimitRule = field.NewString(table, "limit_rule") + f.CustomCard = field.NewInt8(table, "custom_card") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignUnoGroup) WithContext(ctx context.Context) *fissionCampaignUnoGroupDo { + return f.fissionCampaignUnoGroupDo.WithContext(ctx) +} + +func (f fissionCampaignUnoGroup) TableName() string { return f.fissionCampaignUnoGroupDo.TableName() } + +func (f fissionCampaignUnoGroup) Alias() string { return f.fissionCampaignUnoGroupDo.Alias() } + +func (f *fissionCampaignUnoGroup) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignUnoGroup) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["odds"] = f.Odds + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["open_rule"] = f.OpenRule + f.fieldMap["limit_rule"] = f.LimitRule + f.fieldMap["custom_card"] = f.CustomCard +} + +func (f fissionCampaignUnoGroup) clone(db *gorm.DB) fissionCampaignUnoGroup { + f.fissionCampaignUnoGroupDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignUnoGroup) replaceDB(db *gorm.DB) fissionCampaignUnoGroup { + f.fissionCampaignUnoGroupDo.ReplaceDB(db) + return f +} + +type fissionCampaignUnoGroupDo struct{ gen.DO } + +func (f fissionCampaignUnoGroupDo) Debug() *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignUnoGroupDo) WithContext(ctx context.Context) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignUnoGroupDo) ReadDB() *fissionCampaignUnoGroupDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignUnoGroupDo) WriteDB() *fissionCampaignUnoGroupDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignUnoGroupDo) Session(config *gorm.Session) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignUnoGroupDo) Clauses(conds ...clause.Expression) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Returning(value interface{}, columns ...string) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignUnoGroupDo) Not(conds ...gen.Condition) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Or(conds ...gen.Condition) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Select(conds ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Where(conds ...gen.Condition) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignUnoGroupDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignUnoGroupDo) Order(conds ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Distinct(cols ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignUnoGroupDo) Omit(cols ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignUnoGroupDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignUnoGroupDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignUnoGroupDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignUnoGroupDo) Group(cols ...field.Expr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignUnoGroupDo) Having(conds ...gen.Condition) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignUnoGroupDo) Limit(limit int) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignUnoGroupDo) Offset(offset int) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignUnoGroupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignUnoGroupDo) Unscoped() *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignUnoGroupDo) Create(values ...*model.FissionCampaignUnoGroup) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignUnoGroupDo) CreateInBatches(values []*model.FissionCampaignUnoGroup, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignUnoGroupDo) Save(values ...*model.FissionCampaignUnoGroup) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignUnoGroupDo) First() (*model.FissionCampaignUnoGroup, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoGroup), nil + } +} + +func (f fissionCampaignUnoGroupDo) Take() (*model.FissionCampaignUnoGroup, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoGroup), nil + } +} + +func (f fissionCampaignUnoGroupDo) Last() (*model.FissionCampaignUnoGroup, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoGroup), nil + } +} + +func (f fissionCampaignUnoGroupDo) Find() ([]*model.FissionCampaignUnoGroup, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignUnoGroup), err +} + +func (f fissionCampaignUnoGroupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignUnoGroup, err error) { + buf := make([]*model.FissionCampaignUnoGroup, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignUnoGroupDo) FindInBatches(result *[]*model.FissionCampaignUnoGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignUnoGroupDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignUnoGroupDo) Assign(attrs ...field.AssignExpr) *fissionCampaignUnoGroupDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignUnoGroupDo) Joins(fields ...field.RelationField) *fissionCampaignUnoGroupDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignUnoGroupDo) Preload(fields ...field.RelationField) *fissionCampaignUnoGroupDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignUnoGroupDo) FirstOrInit() (*model.FissionCampaignUnoGroup, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoGroup), nil + } +} + +func (f fissionCampaignUnoGroupDo) FirstOrCreate() (*model.FissionCampaignUnoGroup, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignUnoGroup), nil + } +} + +func (f fissionCampaignUnoGroupDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignUnoGroup, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignUnoGroupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignUnoGroupDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignUnoGroupDo) Delete(models ...*model.FissionCampaignUnoGroup) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignUnoGroupDo) withDO(do gen.Dao) *fissionCampaignUnoGroupDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_vs.gen.go b/internal/repository/dao/fission_campaign_vs.gen.go new file mode 100644 index 0000000..004700f --- /dev/null +++ b/internal/repository/dao/fission_campaign_vs.gen.go @@ -0,0 +1,387 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignV(db *gorm.DB, opts ...gen.DOOption) fissionCampaignV { + _fissionCampaignV := fissionCampaignV{} + + _fissionCampaignV.fissionCampaignVDo.UseDB(db, opts...) + _fissionCampaignV.fissionCampaignVDo.UseModel(&model.FissionCampaignV{}) + + tableName := _fissionCampaignV.fissionCampaignVDo.TableName() + _fissionCampaignV.ALL = field.NewAsterisk(tableName) + _fissionCampaignV.ID = field.NewInt64(tableName, "id") + _fissionCampaignV.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignV.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignV.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignV.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignV.EachLimitNum = field.NewInt32(tableName, "each_limit_num") + _fissionCampaignV.OpenPoint = field.NewInt8(tableName, "open_point") + _fissionCampaignV.PointsNum = field.NewInt32(tableName, "points_num") + _fissionCampaignV.MallOpen = field.NewInt8(tableName, "mall_open") + _fissionCampaignV.MallID = field.NewInt64(tableName, "mall_id") + _fissionCampaignV.VsTz = field.NewInt32(tableName, "vs_tz") + _fissionCampaignV.ClaimType = field.NewInt8(tableName, "claim_type") + _fissionCampaignV.IconMall = field.NewString(tableName, "icon_mall") + _fissionCampaignV.IconReward = field.NewString(tableName, "icon_reward") + _fissionCampaignV.IconSchedule = field.NewString(tableName, "icon_schedule") + + _fissionCampaignV.fillFieldMap() + + return _fissionCampaignV +} + +type fissionCampaignV struct { + fissionCampaignVDo fissionCampaignVDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + InitChance field.Int32 // 初始投票次数 + EachLimitNum field.Int32 // 每场可投票次数 + OpenPoint field.Int8 // 是否开启积分(0-否,1-时) + PointsNum field.Int32 // 投票扣除积分数 + MallOpen field.Int8 // 是否使用积分商城(0-否,1-是) + MallID field.Int64 // 兑换商城id + VsTz field.Int32 // 比赛时区 + ClaimType field.Int8 // 领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + IconMall field.String // 商城图标 + IconReward field.String // 奖励记录图标 + IconSchedule field.String // 赛程图标 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignV) Table(newTableName string) *fissionCampaignV { + f.fissionCampaignVDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignV) As(alias string) *fissionCampaignV { + f.fissionCampaignVDo.DO = *(f.fissionCampaignVDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignV) updateTableName(table string) *fissionCampaignV { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.InitChance = field.NewInt32(table, "init_chance") + f.EachLimitNum = field.NewInt32(table, "each_limit_num") + f.OpenPoint = field.NewInt8(table, "open_point") + f.PointsNum = field.NewInt32(table, "points_num") + f.MallOpen = field.NewInt8(table, "mall_open") + f.MallID = field.NewInt64(table, "mall_id") + f.VsTz = field.NewInt32(table, "vs_tz") + f.ClaimType = field.NewInt8(table, "claim_type") + f.IconMall = field.NewString(table, "icon_mall") + f.IconReward = field.NewString(table, "icon_reward") + f.IconSchedule = field.NewString(table, "icon_schedule") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignV) WithContext(ctx context.Context) *fissionCampaignVDo { + return f.fissionCampaignVDo.WithContext(ctx) +} + +func (f fissionCampaignV) TableName() string { return f.fissionCampaignVDo.TableName() } + +func (f fissionCampaignV) Alias() string { return f.fissionCampaignVDo.Alias() } + +func (f *fissionCampaignV) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignV) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 15) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["each_limit_num"] = f.EachLimitNum + f.fieldMap["open_point"] = f.OpenPoint + f.fieldMap["points_num"] = f.PointsNum + f.fieldMap["mall_open"] = f.MallOpen + f.fieldMap["mall_id"] = f.MallID + f.fieldMap["vs_tz"] = f.VsTz + f.fieldMap["claim_type"] = f.ClaimType + f.fieldMap["icon_mall"] = f.IconMall + f.fieldMap["icon_reward"] = f.IconReward + f.fieldMap["icon_schedule"] = f.IconSchedule +} + +func (f fissionCampaignV) clone(db *gorm.DB) fissionCampaignV { + f.fissionCampaignVDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignV) replaceDB(db *gorm.DB) fissionCampaignV { + f.fissionCampaignVDo.ReplaceDB(db) + return f +} + +type fissionCampaignVDo struct{ gen.DO } + +func (f fissionCampaignVDo) Debug() *fissionCampaignVDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignVDo) WithContext(ctx context.Context) *fissionCampaignVDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignVDo) ReadDB() *fissionCampaignVDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignVDo) WriteDB() *fissionCampaignVDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignVDo) Session(config *gorm.Session) *fissionCampaignVDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignVDo) Clauses(conds ...clause.Expression) *fissionCampaignVDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignVDo) Returning(value interface{}, columns ...string) *fissionCampaignVDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignVDo) Not(conds ...gen.Condition) *fissionCampaignVDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignVDo) Or(conds ...gen.Condition) *fissionCampaignVDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignVDo) Select(conds ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignVDo) Where(conds ...gen.Condition) *fissionCampaignVDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignVDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignVDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignVDo) Order(conds ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignVDo) Distinct(cols ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignVDo) Omit(cols ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignVDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignVDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignVDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignVDo) Group(cols ...field.Expr) *fissionCampaignVDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignVDo) Having(conds ...gen.Condition) *fissionCampaignVDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignVDo) Limit(limit int) *fissionCampaignVDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignVDo) Offset(offset int) *fissionCampaignVDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignVDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignVDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignVDo) Unscoped() *fissionCampaignVDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignVDo) Create(values ...*model.FissionCampaignV) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignVDo) CreateInBatches(values []*model.FissionCampaignV, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignVDo) Save(values ...*model.FissionCampaignV) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignVDo) First() (*model.FissionCampaignV, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignV), nil + } +} + +func (f fissionCampaignVDo) Take() (*model.FissionCampaignV, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignV), nil + } +} + +func (f fissionCampaignVDo) Last() (*model.FissionCampaignV, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignV), nil + } +} + +func (f fissionCampaignVDo) Find() ([]*model.FissionCampaignV, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignV), err +} + +func (f fissionCampaignVDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignV, err error) { + buf := make([]*model.FissionCampaignV, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignVDo) FindInBatches(result *[]*model.FissionCampaignV, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignVDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignVDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignVDo) Assign(attrs ...field.AssignExpr) *fissionCampaignVDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignVDo) Joins(fields ...field.RelationField) *fissionCampaignVDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignVDo) Preload(fields ...field.RelationField) *fissionCampaignVDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignVDo) FirstOrInit() (*model.FissionCampaignV, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignV), nil + } +} + +func (f fissionCampaignVDo) FirstOrCreate() (*model.FissionCampaignV, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignV), nil + } +} + +func (f fissionCampaignVDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignV, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignVDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignVDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignVDo) Delete(models ...*model.FissionCampaignV) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignVDo) withDO(do gen.Dao) *fissionCampaignVDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_vs_schedule.gen.go b/internal/repository/dao/fission_campaign_vs_schedule.gen.go new file mode 100644 index 0000000..ef9cc96 --- /dev/null +++ b/internal/repository/dao/fission_campaign_vs_schedule.gen.go @@ -0,0 +1,405 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignVsSchedule(db *gorm.DB, opts ...gen.DOOption) fissionCampaignVsSchedule { + _fissionCampaignVsSchedule := fissionCampaignVsSchedule{} + + _fissionCampaignVsSchedule.fissionCampaignVsScheduleDo.UseDB(db, opts...) + _fissionCampaignVsSchedule.fissionCampaignVsScheduleDo.UseModel(&model.FissionCampaignVsSchedule{}) + + tableName := _fissionCampaignVsSchedule.fissionCampaignVsScheduleDo.TableName() + _fissionCampaignVsSchedule.ALL = field.NewAsterisk(tableName) + _fissionCampaignVsSchedule.ID = field.NewInt64(tableName, "id") + _fissionCampaignVsSchedule.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignVsSchedule.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignVsSchedule.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignVsSchedule.VsIdx = field.NewInt32(tableName, "vs_idx") + _fissionCampaignVsSchedule.RewardID = field.NewInt64(tableName, "reward_id") + _fissionCampaignVsSchedule.VsTeamIds = field.NewString(tableName, "vs_team_ids") + _fissionCampaignVsSchedule.VoteStart = field.NewInt64(tableName, "vote_start") + _fissionCampaignVsSchedule.VoteEnd = field.NewInt64(tableName, "vote_end") + _fissionCampaignVsSchedule.VsAt = field.NewInt64(tableName, "vs_at") + _fissionCampaignVsSchedule.VsImg = field.NewString(tableName, "vs_img") + _fissionCampaignVsSchedule.Desc = field.NewString(tableName, "desc") + _fissionCampaignVsSchedule.IsSettlement = field.NewInt8(tableName, "is_settlement") + _fissionCampaignVsSchedule.OtherVote = field.NewString(tableName, "other_vote") + _fissionCampaignVsSchedule.Settlement = field.NewString(tableName, "settlement") + _fissionCampaignVsSchedule.OpenOdds = field.NewInt8(tableName, "open_odds") + _fissionCampaignVsSchedule.OddsLeft = field.NewString(tableName, "odds_left") + _fissionCampaignVsSchedule.OddsRight = field.NewString(tableName, "odds_right") + _fissionCampaignVsSchedule.OddsDraw = field.NewString(tableName, "odds_draw") + + _fissionCampaignVsSchedule.fillFieldMap() + + return _fissionCampaignVsSchedule +} + +type fissionCampaignVsSchedule struct { + fissionCampaignVsScheduleDo fissionCampaignVsScheduleDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + VsIdx field.Int32 // 赛程 + RewardID field.Int64 // 奖品id(fission_campaign_reward表) + VsTeamIds field.String // 对战队伍id + VoteStart field.Int64 // 投票开始时间 + VoteEnd field.Int64 // 投票结束时间 + VsAt field.Int64 // 开赛时间 + VsImg field.String // 对战图 + Desc field.String // 标题描述 + IsSettlement field.Int8 // 是否已经结算(0-否,1-是) + OtherVote field.String // 额外投票选项 + Settlement field.String // 结算数据 + OpenOdds field.Int8 // 开启赔率 + OddsLeft field.String // 左边赔率 + OddsRight field.String // 右边赔率 + OddsDraw field.String // 平局赔率 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignVsSchedule) Table(newTableName string) *fissionCampaignVsSchedule { + f.fissionCampaignVsScheduleDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignVsSchedule) As(alias string) *fissionCampaignVsSchedule { + f.fissionCampaignVsScheduleDo.DO = *(f.fissionCampaignVsScheduleDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignVsSchedule) updateTableName(table string) *fissionCampaignVsSchedule { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.VsIdx = field.NewInt32(table, "vs_idx") + f.RewardID = field.NewInt64(table, "reward_id") + f.VsTeamIds = field.NewString(table, "vs_team_ids") + f.VoteStart = field.NewInt64(table, "vote_start") + f.VoteEnd = field.NewInt64(table, "vote_end") + f.VsAt = field.NewInt64(table, "vs_at") + f.VsImg = field.NewString(table, "vs_img") + f.Desc = field.NewString(table, "desc") + f.IsSettlement = field.NewInt8(table, "is_settlement") + f.OtherVote = field.NewString(table, "other_vote") + f.Settlement = field.NewString(table, "settlement") + f.OpenOdds = field.NewInt8(table, "open_odds") + f.OddsLeft = field.NewString(table, "odds_left") + f.OddsRight = field.NewString(table, "odds_right") + f.OddsDraw = field.NewString(table, "odds_draw") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignVsSchedule) WithContext(ctx context.Context) *fissionCampaignVsScheduleDo { + return f.fissionCampaignVsScheduleDo.WithContext(ctx) +} + +func (f fissionCampaignVsSchedule) TableName() string { + return f.fissionCampaignVsScheduleDo.TableName() +} + +func (f fissionCampaignVsSchedule) Alias() string { return f.fissionCampaignVsScheduleDo.Alias() } + +func (f *fissionCampaignVsSchedule) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignVsSchedule) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 19) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["vs_idx"] = f.VsIdx + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["vs_team_ids"] = f.VsTeamIds + f.fieldMap["vote_start"] = f.VoteStart + f.fieldMap["vote_end"] = f.VoteEnd + f.fieldMap["vs_at"] = f.VsAt + f.fieldMap["vs_img"] = f.VsImg + f.fieldMap["desc"] = f.Desc + f.fieldMap["is_settlement"] = f.IsSettlement + f.fieldMap["other_vote"] = f.OtherVote + f.fieldMap["settlement"] = f.Settlement + f.fieldMap["open_odds"] = f.OpenOdds + f.fieldMap["odds_left"] = f.OddsLeft + f.fieldMap["odds_right"] = f.OddsRight + f.fieldMap["odds_draw"] = f.OddsDraw +} + +func (f fissionCampaignVsSchedule) clone(db *gorm.DB) fissionCampaignVsSchedule { + f.fissionCampaignVsScheduleDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignVsSchedule) replaceDB(db *gorm.DB) fissionCampaignVsSchedule { + f.fissionCampaignVsScheduleDo.ReplaceDB(db) + return f +} + +type fissionCampaignVsScheduleDo struct{ gen.DO } + +func (f fissionCampaignVsScheduleDo) Debug() *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignVsScheduleDo) WithContext(ctx context.Context) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignVsScheduleDo) ReadDB() *fissionCampaignVsScheduleDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignVsScheduleDo) WriteDB() *fissionCampaignVsScheduleDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignVsScheduleDo) Session(config *gorm.Session) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignVsScheduleDo) Clauses(conds ...clause.Expression) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Returning(value interface{}, columns ...string) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignVsScheduleDo) Not(conds ...gen.Condition) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Or(conds ...gen.Condition) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Select(conds ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Where(conds ...gen.Condition) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignVsScheduleDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignVsScheduleDo) Order(conds ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Distinct(cols ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignVsScheduleDo) Omit(cols ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignVsScheduleDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignVsScheduleDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignVsScheduleDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignVsScheduleDo) Group(cols ...field.Expr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignVsScheduleDo) Having(conds ...gen.Condition) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignVsScheduleDo) Limit(limit int) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignVsScheduleDo) Offset(offset int) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignVsScheduleDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignVsScheduleDo) Unscoped() *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignVsScheduleDo) Create(values ...*model.FissionCampaignVsSchedule) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignVsScheduleDo) CreateInBatches(values []*model.FissionCampaignVsSchedule, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignVsScheduleDo) Save(values ...*model.FissionCampaignVsSchedule) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignVsScheduleDo) First() (*model.FissionCampaignVsSchedule, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsSchedule), nil + } +} + +func (f fissionCampaignVsScheduleDo) Take() (*model.FissionCampaignVsSchedule, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsSchedule), nil + } +} + +func (f fissionCampaignVsScheduleDo) Last() (*model.FissionCampaignVsSchedule, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsSchedule), nil + } +} + +func (f fissionCampaignVsScheduleDo) Find() ([]*model.FissionCampaignVsSchedule, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignVsSchedule), err +} + +func (f fissionCampaignVsScheduleDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignVsSchedule, err error) { + buf := make([]*model.FissionCampaignVsSchedule, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignVsScheduleDo) FindInBatches(result *[]*model.FissionCampaignVsSchedule, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignVsScheduleDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignVsScheduleDo) Assign(attrs ...field.AssignExpr) *fissionCampaignVsScheduleDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignVsScheduleDo) Joins(fields ...field.RelationField) *fissionCampaignVsScheduleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignVsScheduleDo) Preload(fields ...field.RelationField) *fissionCampaignVsScheduleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignVsScheduleDo) FirstOrInit() (*model.FissionCampaignVsSchedule, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsSchedule), nil + } +} + +func (f fissionCampaignVsScheduleDo) FirstOrCreate() (*model.FissionCampaignVsSchedule, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsSchedule), nil + } +} + +func (f fissionCampaignVsScheduleDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignVsSchedule, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignVsScheduleDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignVsScheduleDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignVsScheduleDo) Delete(models ...*model.FissionCampaignVsSchedule) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignVsScheduleDo) withDO(do gen.Dao) *fissionCampaignVsScheduleDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_vs_team.gen.go b/internal/repository/dao/fission_campaign_vs_team.gen.go new file mode 100644 index 0000000..fe7a054 --- /dev/null +++ b/internal/repository/dao/fission_campaign_vs_team.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignVsTeam(db *gorm.DB, opts ...gen.DOOption) fissionCampaignVsTeam { + _fissionCampaignVsTeam := fissionCampaignVsTeam{} + + _fissionCampaignVsTeam.fissionCampaignVsTeamDo.UseDB(db, opts...) + _fissionCampaignVsTeam.fissionCampaignVsTeamDo.UseModel(&model.FissionCampaignVsTeam{}) + + tableName := _fissionCampaignVsTeam.fissionCampaignVsTeamDo.TableName() + _fissionCampaignVsTeam.ALL = field.NewAsterisk(tableName) + _fissionCampaignVsTeam.ID = field.NewInt64(tableName, "id") + _fissionCampaignVsTeam.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignVsTeam.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignVsTeam.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignVsTeam.Name = field.NewString(tableName, "name") + _fissionCampaignVsTeam.LogoImg = field.NewString(tableName, "logo_img") + + _fissionCampaignVsTeam.fillFieldMap() + + return _fissionCampaignVsTeam +} + +type fissionCampaignVsTeam struct { + fissionCampaignVsTeamDo fissionCampaignVsTeamDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + Name field.String // 队伍名称 + LogoImg field.String // 队伍图标 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignVsTeam) Table(newTableName string) *fissionCampaignVsTeam { + f.fissionCampaignVsTeamDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignVsTeam) As(alias string) *fissionCampaignVsTeam { + f.fissionCampaignVsTeamDo.DO = *(f.fissionCampaignVsTeamDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignVsTeam) updateTableName(table string) *fissionCampaignVsTeam { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Name = field.NewString(table, "name") + f.LogoImg = field.NewString(table, "logo_img") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignVsTeam) WithContext(ctx context.Context) *fissionCampaignVsTeamDo { + return f.fissionCampaignVsTeamDo.WithContext(ctx) +} + +func (f fissionCampaignVsTeam) TableName() string { return f.fissionCampaignVsTeamDo.TableName() } + +func (f fissionCampaignVsTeam) Alias() string { return f.fissionCampaignVsTeamDo.Alias() } + +func (f *fissionCampaignVsTeam) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignVsTeam) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["name"] = f.Name + f.fieldMap["logo_img"] = f.LogoImg +} + +func (f fissionCampaignVsTeam) clone(db *gorm.DB) fissionCampaignVsTeam { + f.fissionCampaignVsTeamDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignVsTeam) replaceDB(db *gorm.DB) fissionCampaignVsTeam { + f.fissionCampaignVsTeamDo.ReplaceDB(db) + return f +} + +type fissionCampaignVsTeamDo struct{ gen.DO } + +func (f fissionCampaignVsTeamDo) Debug() *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignVsTeamDo) WithContext(ctx context.Context) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignVsTeamDo) ReadDB() *fissionCampaignVsTeamDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignVsTeamDo) WriteDB() *fissionCampaignVsTeamDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignVsTeamDo) Session(config *gorm.Session) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignVsTeamDo) Clauses(conds ...clause.Expression) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignVsTeamDo) Returning(value interface{}, columns ...string) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignVsTeamDo) Not(conds ...gen.Condition) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignVsTeamDo) Or(conds ...gen.Condition) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignVsTeamDo) Select(conds ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignVsTeamDo) Where(conds ...gen.Condition) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignVsTeamDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignVsTeamDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignVsTeamDo) Order(conds ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignVsTeamDo) Distinct(cols ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignVsTeamDo) Omit(cols ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignVsTeamDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignVsTeamDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignVsTeamDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignVsTeamDo) Group(cols ...field.Expr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignVsTeamDo) Having(conds ...gen.Condition) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignVsTeamDo) Limit(limit int) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignVsTeamDo) Offset(offset int) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignVsTeamDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignVsTeamDo) Unscoped() *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignVsTeamDo) Create(values ...*model.FissionCampaignVsTeam) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignVsTeamDo) CreateInBatches(values []*model.FissionCampaignVsTeam, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignVsTeamDo) Save(values ...*model.FissionCampaignVsTeam) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignVsTeamDo) First() (*model.FissionCampaignVsTeam, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsTeam), nil + } +} + +func (f fissionCampaignVsTeamDo) Take() (*model.FissionCampaignVsTeam, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsTeam), nil + } +} + +func (f fissionCampaignVsTeamDo) Last() (*model.FissionCampaignVsTeam, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsTeam), nil + } +} + +func (f fissionCampaignVsTeamDo) Find() ([]*model.FissionCampaignVsTeam, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignVsTeam), err +} + +func (f fissionCampaignVsTeamDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignVsTeam, err error) { + buf := make([]*model.FissionCampaignVsTeam, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignVsTeamDo) FindInBatches(result *[]*model.FissionCampaignVsTeam, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignVsTeamDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignVsTeamDo) Assign(attrs ...field.AssignExpr) *fissionCampaignVsTeamDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignVsTeamDo) Joins(fields ...field.RelationField) *fissionCampaignVsTeamDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignVsTeamDo) Preload(fields ...field.RelationField) *fissionCampaignVsTeamDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignVsTeamDo) FirstOrInit() (*model.FissionCampaignVsTeam, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsTeam), nil + } +} + +func (f fissionCampaignVsTeamDo) FirstOrCreate() (*model.FissionCampaignVsTeam, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignVsTeam), nil + } +} + +func (f fissionCampaignVsTeamDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignVsTeam, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignVsTeamDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignVsTeamDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignVsTeamDo) Delete(models ...*model.FissionCampaignVsTeam) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignVsTeamDo) withDO(do gen.Dao) *fissionCampaignVsTeamDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_wheel.gen.go b/internal/repository/dao/fission_campaign_wheel.gen.go new file mode 100644 index 0000000..0bae38b --- /dev/null +++ b/internal/repository/dao/fission_campaign_wheel.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignWheel(db *gorm.DB, opts ...gen.DOOption) fissionCampaignWheel { + _fissionCampaignWheel := fissionCampaignWheel{} + + _fissionCampaignWheel.fissionCampaignWheelDo.UseDB(db, opts...) + _fissionCampaignWheel.fissionCampaignWheelDo.UseModel(&model.FissionCampaignWheel{}) + + tableName := _fissionCampaignWheel.fissionCampaignWheelDo.TableName() + _fissionCampaignWheel.ALL = field.NewAsterisk(tableName) + _fissionCampaignWheel.ID = field.NewInt64(tableName, "id") + _fissionCampaignWheel.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignWheel.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignWheel.IsDel = field.NewUint8(tableName, "is_del") + _fissionCampaignWheel.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignWheel.TargetNum = field.NewInt32(tableName, "target_num") + _fissionCampaignWheel.InitChance = field.NewInt32(tableName, "init_chance") + _fissionCampaignWheel.Odds = field.NewInt32(tableName, "odds") + _fissionCampaignWheel.DayChance = field.NewInt32(tableName, "day_chance") + _fissionCampaignWheel.Chance = field.NewInt32(tableName, "chance") + + _fissionCampaignWheel.fillFieldMap() + + return _fissionCampaignWheel +} + +type fissionCampaignWheel struct { + fissionCampaignWheelDo fissionCampaignWheelDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动ID + TargetNum field.Int32 // 达标条件需要的新用户个数 + InitChance field.Int32 // 初始答题机会次数 + Odds field.Int32 // 中奖概率 + DayChance field.Int32 // 每日获得的抽奖次数 + Chance field.Int32 // 达标获得的抽奖机会次数 + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignWheel) Table(newTableName string) *fissionCampaignWheel { + f.fissionCampaignWheelDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignWheel) As(alias string) *fissionCampaignWheel { + f.fissionCampaignWheelDo.DO = *(f.fissionCampaignWheelDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignWheel) updateTableName(table string) *fissionCampaignWheel { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TargetNum = field.NewInt32(table, "target_num") + f.InitChance = field.NewInt32(table, "init_chance") + f.Odds = field.NewInt32(table, "odds") + f.DayChance = field.NewInt32(table, "day_chance") + f.Chance = field.NewInt32(table, "chance") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignWheel) WithContext(ctx context.Context) *fissionCampaignWheelDo { + return f.fissionCampaignWheelDo.WithContext(ctx) +} + +func (f fissionCampaignWheel) TableName() string { return f.fissionCampaignWheelDo.TableName() } + +func (f fissionCampaignWheel) Alias() string { return f.fissionCampaignWheelDo.Alias() } + +func (f *fissionCampaignWheel) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignWheel) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["init_chance"] = f.InitChance + f.fieldMap["odds"] = f.Odds + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["chance"] = f.Chance +} + +func (f fissionCampaignWheel) clone(db *gorm.DB) fissionCampaignWheel { + f.fissionCampaignWheelDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignWheel) replaceDB(db *gorm.DB) fissionCampaignWheel { + f.fissionCampaignWheelDo.ReplaceDB(db) + return f +} + +type fissionCampaignWheelDo struct{ gen.DO } + +func (f fissionCampaignWheelDo) Debug() *fissionCampaignWheelDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignWheelDo) WithContext(ctx context.Context) *fissionCampaignWheelDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignWheelDo) ReadDB() *fissionCampaignWheelDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignWheelDo) WriteDB() *fissionCampaignWheelDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignWheelDo) Session(config *gorm.Session) *fissionCampaignWheelDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignWheelDo) Clauses(conds ...clause.Expression) *fissionCampaignWheelDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignWheelDo) Returning(value interface{}, columns ...string) *fissionCampaignWheelDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignWheelDo) Not(conds ...gen.Condition) *fissionCampaignWheelDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignWheelDo) Or(conds ...gen.Condition) *fissionCampaignWheelDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignWheelDo) Select(conds ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignWheelDo) Where(conds ...gen.Condition) *fissionCampaignWheelDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignWheelDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignWheelDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignWheelDo) Order(conds ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignWheelDo) Distinct(cols ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignWheelDo) Omit(cols ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignWheelDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignWheelDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignWheelDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignWheelDo) Group(cols ...field.Expr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignWheelDo) Having(conds ...gen.Condition) *fissionCampaignWheelDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignWheelDo) Limit(limit int) *fissionCampaignWheelDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignWheelDo) Offset(offset int) *fissionCampaignWheelDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignWheelDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignWheelDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignWheelDo) Unscoped() *fissionCampaignWheelDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignWheelDo) Create(values ...*model.FissionCampaignWheel) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignWheelDo) CreateInBatches(values []*model.FissionCampaignWheel, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignWheelDo) Save(values ...*model.FissionCampaignWheel) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignWheelDo) First() (*model.FissionCampaignWheel, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWheel), nil + } +} + +func (f fissionCampaignWheelDo) Take() (*model.FissionCampaignWheel, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWheel), nil + } +} + +func (f fissionCampaignWheelDo) Last() (*model.FissionCampaignWheel, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWheel), nil + } +} + +func (f fissionCampaignWheelDo) Find() ([]*model.FissionCampaignWheel, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignWheel), err +} + +func (f fissionCampaignWheelDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignWheel, err error) { + buf := make([]*model.FissionCampaignWheel, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignWheelDo) FindInBatches(result *[]*model.FissionCampaignWheel, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignWheelDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignWheelDo) Assign(attrs ...field.AssignExpr) *fissionCampaignWheelDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignWheelDo) Joins(fields ...field.RelationField) *fissionCampaignWheelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignWheelDo) Preload(fields ...field.RelationField) *fissionCampaignWheelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignWheelDo) FirstOrInit() (*model.FissionCampaignWheel, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWheel), nil + } +} + +func (f fissionCampaignWheelDo) FirstOrCreate() (*model.FissionCampaignWheel, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWheel), nil + } +} + +func (f fissionCampaignWheelDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignWheel, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignWheelDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignWheelDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignWheelDo) Delete(models ...*model.FissionCampaignWheel) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignWheelDo) withDO(do gen.Dao) *fissionCampaignWheelDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_campaign_win.gen.go b/internal/repository/dao/fission_campaign_win.gen.go new file mode 100644 index 0000000..73726c2 --- /dev/null +++ b/internal/repository/dao/fission_campaign_win.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCampaignWin(db *gorm.DB, opts ...gen.DOOption) fissionCampaignWin { + _fissionCampaignWin := fissionCampaignWin{} + + _fissionCampaignWin.fissionCampaignWinDo.UseDB(db, opts...) + _fissionCampaignWin.fissionCampaignWinDo.UseModel(&model.FissionCampaignWin{}) + + tableName := _fissionCampaignWin.fissionCampaignWinDo.TableName() + _fissionCampaignWin.ALL = field.NewAsterisk(tableName) + _fissionCampaignWin.ID = field.NewInt64(tableName, "id") + _fissionCampaignWin.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCampaignWin.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCampaignWin.IsDel = field.NewInt8(tableName, "is_del") + _fissionCampaignWin.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCampaignWin.RewardLimit = field.NewInt32(tableName, "reward_limit") + _fissionCampaignWin.RewardRule = field.NewInt8(tableName, "reward_rule") + _fissionCampaignWin.InviteLimit = field.NewInt32(tableName, "invite_limit") + _fissionCampaignWin.NewcomerCond = field.NewInt8(tableName, "newcomer_cond") + _fissionCampaignWin.StepLoop = field.NewInt8(tableName, "step_loop") + + _fissionCampaignWin.fillFieldMap() + + return _fissionCampaignWin +} + +type fissionCampaignWin struct { + fissionCampaignWinDo fissionCampaignWinDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CampaignID field.Int64 // 活动id(fission_campaign表) + RewardLimit field.Int32 // 活动总奖励上限 + RewardRule field.Int8 // 用户奖励规则(1-阶梯,2-非阶梯) + InviteLimit field.Int32 // 邀请超过多少人不能再获得奖励 + NewcomerCond field.Int8 // 新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + StepLoop field.Int8 // 阶梯是否支持循环(0-不支持,1-支持) + + fieldMap map[string]field.Expr +} + +func (f fissionCampaignWin) Table(newTableName string) *fissionCampaignWin { + f.fissionCampaignWinDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCampaignWin) As(alias string) *fissionCampaignWin { + f.fissionCampaignWinDo.DO = *(f.fissionCampaignWinDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCampaignWin) updateTableName(table string) *fissionCampaignWin { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardLimit = field.NewInt32(table, "reward_limit") + f.RewardRule = field.NewInt8(table, "reward_rule") + f.InviteLimit = field.NewInt32(table, "invite_limit") + f.NewcomerCond = field.NewInt8(table, "newcomer_cond") + f.StepLoop = field.NewInt8(table, "step_loop") + + f.fillFieldMap() + + return f +} + +func (f *fissionCampaignWin) WithContext(ctx context.Context) *fissionCampaignWinDo { + return f.fissionCampaignWinDo.WithContext(ctx) +} + +func (f fissionCampaignWin) TableName() string { return f.fissionCampaignWinDo.TableName() } + +func (f fissionCampaignWin) Alias() string { return f.fissionCampaignWinDo.Alias() } + +func (f *fissionCampaignWin) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCampaignWin) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_limit"] = f.RewardLimit + f.fieldMap["reward_rule"] = f.RewardRule + f.fieldMap["invite_limit"] = f.InviteLimit + f.fieldMap["newcomer_cond"] = f.NewcomerCond + f.fieldMap["step_loop"] = f.StepLoop +} + +func (f fissionCampaignWin) clone(db *gorm.DB) fissionCampaignWin { + f.fissionCampaignWinDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCampaignWin) replaceDB(db *gorm.DB) fissionCampaignWin { + f.fissionCampaignWinDo.ReplaceDB(db) + return f +} + +type fissionCampaignWinDo struct{ gen.DO } + +func (f fissionCampaignWinDo) Debug() *fissionCampaignWinDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCampaignWinDo) WithContext(ctx context.Context) *fissionCampaignWinDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCampaignWinDo) ReadDB() *fissionCampaignWinDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCampaignWinDo) WriteDB() *fissionCampaignWinDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCampaignWinDo) Session(config *gorm.Session) *fissionCampaignWinDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCampaignWinDo) Clauses(conds ...clause.Expression) *fissionCampaignWinDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCampaignWinDo) Returning(value interface{}, columns ...string) *fissionCampaignWinDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCampaignWinDo) Not(conds ...gen.Condition) *fissionCampaignWinDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCampaignWinDo) Or(conds ...gen.Condition) *fissionCampaignWinDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCampaignWinDo) Select(conds ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCampaignWinDo) Where(conds ...gen.Condition) *fissionCampaignWinDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCampaignWinDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCampaignWinDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCampaignWinDo) Order(conds ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCampaignWinDo) Distinct(cols ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCampaignWinDo) Omit(cols ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCampaignWinDo) Join(table schema.Tabler, on ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCampaignWinDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCampaignWinDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCampaignWinDo) Group(cols ...field.Expr) *fissionCampaignWinDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCampaignWinDo) Having(conds ...gen.Condition) *fissionCampaignWinDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCampaignWinDo) Limit(limit int) *fissionCampaignWinDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCampaignWinDo) Offset(offset int) *fissionCampaignWinDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCampaignWinDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCampaignWinDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCampaignWinDo) Unscoped() *fissionCampaignWinDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCampaignWinDo) Create(values ...*model.FissionCampaignWin) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCampaignWinDo) CreateInBatches(values []*model.FissionCampaignWin, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCampaignWinDo) Save(values ...*model.FissionCampaignWin) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCampaignWinDo) First() (*model.FissionCampaignWin, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWin), nil + } +} + +func (f fissionCampaignWinDo) Take() (*model.FissionCampaignWin, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWin), nil + } +} + +func (f fissionCampaignWinDo) Last() (*model.FissionCampaignWin, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWin), nil + } +} + +func (f fissionCampaignWinDo) Find() ([]*model.FissionCampaignWin, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCampaignWin), err +} + +func (f fissionCampaignWinDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCampaignWin, err error) { + buf := make([]*model.FissionCampaignWin, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCampaignWinDo) FindInBatches(result *[]*model.FissionCampaignWin, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCampaignWinDo) Attrs(attrs ...field.AssignExpr) *fissionCampaignWinDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCampaignWinDo) Assign(attrs ...field.AssignExpr) *fissionCampaignWinDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCampaignWinDo) Joins(fields ...field.RelationField) *fissionCampaignWinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCampaignWinDo) Preload(fields ...field.RelationField) *fissionCampaignWinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCampaignWinDo) FirstOrInit() (*model.FissionCampaignWin, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWin), nil + } +} + +func (f fissionCampaignWinDo) FirstOrCreate() (*model.FissionCampaignWin, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCampaignWin), nil + } +} + +func (f fissionCampaignWinDo) FindByPage(offset int, limit int) (result []*model.FissionCampaignWin, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCampaignWinDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCampaignWinDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCampaignWinDo) Delete(models ...*model.FissionCampaignWin) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCampaignWinDo) withDO(do gen.Dao) *fissionCampaignWinDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_cash.gen.go b/internal/repository/dao/fission_cash.gen.go new file mode 100644 index 0000000..874ac73 --- /dev/null +++ b/internal/repository/dao/fission_cash.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCash(db *gorm.DB, opts ...gen.DOOption) fissionCash { + _fissionCash := fissionCash{} + + _fissionCash.fissionCashDo.UseDB(db, opts...) + _fissionCash.fissionCashDo.UseModel(&model.FissionCash{}) + + tableName := _fissionCash.fissionCashDo.TableName() + _fissionCash.ALL = field.NewAsterisk(tableName) + _fissionCash.ID = field.NewInt64(tableName, "id") + _fissionCash.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCash.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCash.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCash.UserID = field.NewInt64(tableName, "user_id") + _fissionCash.LotteryNum = field.NewInt8(tableName, "lottery_num") + _fissionCash.NextStep = field.NewString(tableName, "next_step") + _fissionCash.Energy = field.NewInt32(tableName, "energy") + _fissionCash.ShowPrice = field.NewFloat64(tableName, "show_price") + _fissionCash.ExpiredIn = field.NewInt64(tableName, "expired_in") + _fissionCash.IsExpired = field.NewInt8(tableName, "is_expired") + _fissionCash.Lang = field.NewString(tableName, "lang") + + _fissionCash.fillFieldMap() + + return _fissionCash +} + +type fissionCash struct { + fissionCashDo fissionCashDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户ID(fission_user表主键) + LotteryNum field.Int8 // 抽奖次数 + NextStep field.String // 下一节点要做的动作(open_gift-开礼品盒,trigger_share-用户需要触发分享,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品,none-没有任何节点需要完成了,invite_spin-等待完成邀请获得最后一次抽奖) + Energy field.Int32 // 剩余能量数 + ShowPrice field.Float64 // 展示的金额 + ExpiredIn field.Int64 // 任务重置时间 + IsExpired field.Int8 // 任务是否已过期(0-否,1-是) + Lang field.String // 语种 + + fieldMap map[string]field.Expr +} + +func (f fissionCash) Table(newTableName string) *fissionCash { + f.fissionCashDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCash) As(alias string) *fissionCash { + f.fissionCashDo.DO = *(f.fissionCashDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCash) updateTableName(table string) *fissionCash { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.LotteryNum = field.NewInt8(table, "lottery_num") + f.NextStep = field.NewString(table, "next_step") + f.Energy = field.NewInt32(table, "energy") + f.ShowPrice = field.NewFloat64(table, "show_price") + f.ExpiredIn = field.NewInt64(table, "expired_in") + f.IsExpired = field.NewInt8(table, "is_expired") + f.Lang = field.NewString(table, "lang") + + f.fillFieldMap() + + return f +} + +func (f *fissionCash) WithContext(ctx context.Context) *fissionCashDo { + return f.fissionCashDo.WithContext(ctx) +} + +func (f fissionCash) TableName() string { return f.fissionCashDo.TableName() } + +func (f fissionCash) Alias() string { return f.fissionCashDo.Alias() } + +func (f *fissionCash) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCash) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 12) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["lottery_num"] = f.LotteryNum + f.fieldMap["next_step"] = f.NextStep + f.fieldMap["energy"] = f.Energy + f.fieldMap["show_price"] = f.ShowPrice + f.fieldMap["expired_in"] = f.ExpiredIn + f.fieldMap["is_expired"] = f.IsExpired + f.fieldMap["lang"] = f.Lang +} + +func (f fissionCash) clone(db *gorm.DB) fissionCash { + f.fissionCashDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCash) replaceDB(db *gorm.DB) fissionCash { + f.fissionCashDo.ReplaceDB(db) + return f +} + +type fissionCashDo struct{ gen.DO } + +func (f fissionCashDo) Debug() *fissionCashDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCashDo) WithContext(ctx context.Context) *fissionCashDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCashDo) ReadDB() *fissionCashDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCashDo) WriteDB() *fissionCashDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCashDo) Session(config *gorm.Session) *fissionCashDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCashDo) Clauses(conds ...clause.Expression) *fissionCashDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCashDo) Returning(value interface{}, columns ...string) *fissionCashDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCashDo) Not(conds ...gen.Condition) *fissionCashDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCashDo) Or(conds ...gen.Condition) *fissionCashDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCashDo) Select(conds ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCashDo) Where(conds ...gen.Condition) *fissionCashDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCashDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCashDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCashDo) Order(conds ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCashDo) Distinct(cols ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCashDo) Omit(cols ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCashDo) Join(table schema.Tabler, on ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCashDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCashDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCashDo) Group(cols ...field.Expr) *fissionCashDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCashDo) Having(conds ...gen.Condition) *fissionCashDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCashDo) Limit(limit int) *fissionCashDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCashDo) Offset(offset int) *fissionCashDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCashDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCashDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCashDo) Unscoped() *fissionCashDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCashDo) Create(values ...*model.FissionCash) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCashDo) CreateInBatches(values []*model.FissionCash, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCashDo) Save(values ...*model.FissionCash) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCashDo) First() (*model.FissionCash, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCash), nil + } +} + +func (f fissionCashDo) Take() (*model.FissionCash, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCash), nil + } +} + +func (f fissionCashDo) Last() (*model.FissionCash, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCash), nil + } +} + +func (f fissionCashDo) Find() ([]*model.FissionCash, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCash), err +} + +func (f fissionCashDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCash, err error) { + buf := make([]*model.FissionCash, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCashDo) FindInBatches(result *[]*model.FissionCash, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCashDo) Attrs(attrs ...field.AssignExpr) *fissionCashDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCashDo) Assign(attrs ...field.AssignExpr) *fissionCashDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCashDo) Joins(fields ...field.RelationField) *fissionCashDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCashDo) Preload(fields ...field.RelationField) *fissionCashDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCashDo) FirstOrInit() (*model.FissionCash, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCash), nil + } +} + +func (f fissionCashDo) FirstOrCreate() (*model.FissionCash, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCash), nil + } +} + +func (f fissionCashDo) FindByPage(offset int, limit int) (result []*model.FissionCash, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCashDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCashDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCashDo) Delete(models ...*model.FissionCash) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCashDo) withDO(do gen.Dao) *fissionCashDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_cash_record.gen.go b/internal/repository/dao/fission_cash_record.gen.go new file mode 100644 index 0000000..be5708e --- /dev/null +++ b/internal/repository/dao/fission_cash_record.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCashRecord(db *gorm.DB, opts ...gen.DOOption) fissionCashRecord { + _fissionCashRecord := fissionCashRecord{} + + _fissionCashRecord.fissionCashRecordDo.UseDB(db, opts...) + _fissionCashRecord.fissionCashRecordDo.UseModel(&model.FissionCashRecord{}) + + tableName := _fissionCashRecord.fissionCashRecordDo.TableName() + _fissionCashRecord.ALL = field.NewAsterisk(tableName) + _fissionCashRecord.ID = field.NewInt64(tableName, "id") + _fissionCashRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCashRecord.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCashRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCashRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionCashRecord.CashID = field.NewInt64(tableName, "cash_id") + _fissionCashRecord.Type = field.NewInt8(tableName, "type") + _fissionCashRecord.Data = field.NewString(tableName, "data") + + _fissionCashRecord.fillFieldMap() + + return _fissionCashRecord +} + +type fissionCashRecord struct { + fissionCashRecordDo fissionCashRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CashID field.Int64 // 现金抽奖玩家数据id(fission_cash表) + Type field.Int8 // 记录类型(1-邀请,2-金额情况,3-能量情况,4-奖品记录) + Data field.String // 数据内容 + + fieldMap map[string]field.Expr +} + +func (f fissionCashRecord) Table(newTableName string) *fissionCashRecord { + f.fissionCashRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCashRecord) As(alias string) *fissionCashRecord { + f.fissionCashRecordDo.DO = *(f.fissionCashRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCashRecord) updateTableName(table string) *fissionCashRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.CashID = field.NewInt64(table, "cash_id") + f.Type = field.NewInt8(table, "type") + f.Data = field.NewString(table, "data") + + f.fillFieldMap() + + return f +} + +func (f *fissionCashRecord) WithContext(ctx context.Context) *fissionCashRecordDo { + return f.fissionCashRecordDo.WithContext(ctx) +} + +func (f fissionCashRecord) TableName() string { return f.fissionCashRecordDo.TableName() } + +func (f fissionCashRecord) Alias() string { return f.fissionCashRecordDo.Alias() } + +func (f *fissionCashRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCashRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["cash_id"] = f.CashID + f.fieldMap["type"] = f.Type + f.fieldMap["data"] = f.Data +} + +func (f fissionCashRecord) clone(db *gorm.DB) fissionCashRecord { + f.fissionCashRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCashRecord) replaceDB(db *gorm.DB) fissionCashRecord { + f.fissionCashRecordDo.ReplaceDB(db) + return f +} + +type fissionCashRecordDo struct{ gen.DO } + +func (f fissionCashRecordDo) Debug() *fissionCashRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCashRecordDo) WithContext(ctx context.Context) *fissionCashRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCashRecordDo) ReadDB() *fissionCashRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCashRecordDo) WriteDB() *fissionCashRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCashRecordDo) Session(config *gorm.Session) *fissionCashRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCashRecordDo) Clauses(conds ...clause.Expression) *fissionCashRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCashRecordDo) Returning(value interface{}, columns ...string) *fissionCashRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCashRecordDo) Not(conds ...gen.Condition) *fissionCashRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCashRecordDo) Or(conds ...gen.Condition) *fissionCashRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCashRecordDo) Select(conds ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCashRecordDo) Where(conds ...gen.Condition) *fissionCashRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCashRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCashRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCashRecordDo) Order(conds ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCashRecordDo) Distinct(cols ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCashRecordDo) Omit(cols ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCashRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCashRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCashRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCashRecordDo) Group(cols ...field.Expr) *fissionCashRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCashRecordDo) Having(conds ...gen.Condition) *fissionCashRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCashRecordDo) Limit(limit int) *fissionCashRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCashRecordDo) Offset(offset int) *fissionCashRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCashRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCashRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCashRecordDo) Unscoped() *fissionCashRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCashRecordDo) Create(values ...*model.FissionCashRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCashRecordDo) CreateInBatches(values []*model.FissionCashRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCashRecordDo) Save(values ...*model.FissionCashRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCashRecordDo) First() (*model.FissionCashRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCashRecord), nil + } +} + +func (f fissionCashRecordDo) Take() (*model.FissionCashRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCashRecord), nil + } +} + +func (f fissionCashRecordDo) Last() (*model.FissionCashRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCashRecord), nil + } +} + +func (f fissionCashRecordDo) Find() ([]*model.FissionCashRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCashRecord), err +} + +func (f fissionCashRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCashRecord, err error) { + buf := make([]*model.FissionCashRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCashRecordDo) FindInBatches(result *[]*model.FissionCashRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCashRecordDo) Attrs(attrs ...field.AssignExpr) *fissionCashRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCashRecordDo) Assign(attrs ...field.AssignExpr) *fissionCashRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCashRecordDo) Joins(fields ...field.RelationField) *fissionCashRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCashRecordDo) Preload(fields ...field.RelationField) *fissionCashRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCashRecordDo) FirstOrInit() (*model.FissionCashRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCashRecord), nil + } +} + +func (f fissionCashRecordDo) FirstOrCreate() (*model.FissionCashRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCashRecord), nil + } +} + +func (f fissionCashRecordDo) FindByPage(offset int, limit int) (result []*model.FissionCashRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCashRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCashRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCashRecordDo) Delete(models ...*model.FissionCashRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCashRecordDo) withDO(do gen.Dao) *fissionCashRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_chat.gen.go b/internal/repository/dao/fission_chat.gen.go new file mode 100644 index 0000000..1213994 --- /dev/null +++ b/internal/repository/dao/fission_chat.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChat(db *gorm.DB, opts ...gen.DOOption) fissionChat { + _fissionChat := fissionChat{} + + _fissionChat.fissionChatDo.UseDB(db, opts...) + _fissionChat.fissionChatDo.UseModel(&model.FissionChat{}) + + tableName := _fissionChat.fissionChatDo.TableName() + _fissionChat.ALL = field.NewAsterisk(tableName) + _fissionChat.ID = field.NewInt64(tableName, "id") + _fissionChat.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChat.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionChat.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChat.UserID = field.NewInt64(tableName, "user_id") + _fissionChat.CancelTime = field.NewInt64(tableName, "cancel_time") + _fissionChat.Character = field.NewString(tableName, "character") + + _fissionChat.fillFieldMap() + + return _fissionChat +} + +type fissionChat struct { + fissionChatDo fissionChatDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户ID(fission_user表) + CancelTime field.Int64 // 关闭时间 + Character field.String // 性格 + + fieldMap map[string]field.Expr +} + +func (f fissionChat) Table(newTableName string) *fissionChat { + f.fissionChatDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChat) As(alias string) *fissionChat { + f.fissionChatDo.DO = *(f.fissionChatDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChat) updateTableName(table string) *fissionChat { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.CancelTime = field.NewInt64(table, "cancel_time") + f.Character = field.NewString(table, "character") + + f.fillFieldMap() + + return f +} + +func (f *fissionChat) WithContext(ctx context.Context) *fissionChatDo { + return f.fissionChatDo.WithContext(ctx) +} + +func (f fissionChat) TableName() string { return f.fissionChatDo.TableName() } + +func (f fissionChat) Alias() string { return f.fissionChatDo.Alias() } + +func (f *fissionChat) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChat) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["cancel_time"] = f.CancelTime + f.fieldMap["character"] = f.Character +} + +func (f fissionChat) clone(db *gorm.DB) fissionChat { + f.fissionChatDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChat) replaceDB(db *gorm.DB) fissionChat { + f.fissionChatDo.ReplaceDB(db) + return f +} + +type fissionChatDo struct{ gen.DO } + +func (f fissionChatDo) Debug() *fissionChatDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChatDo) WithContext(ctx context.Context) *fissionChatDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChatDo) ReadDB() *fissionChatDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChatDo) WriteDB() *fissionChatDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChatDo) Session(config *gorm.Session) *fissionChatDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChatDo) Clauses(conds ...clause.Expression) *fissionChatDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChatDo) Returning(value interface{}, columns ...string) *fissionChatDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChatDo) Not(conds ...gen.Condition) *fissionChatDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChatDo) Or(conds ...gen.Condition) *fissionChatDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChatDo) Select(conds ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChatDo) Where(conds ...gen.Condition) *fissionChatDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChatDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChatDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChatDo) Order(conds ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChatDo) Distinct(cols ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChatDo) Omit(cols ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChatDo) Join(table schema.Tabler, on ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChatDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChatDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChatDo) Group(cols ...field.Expr) *fissionChatDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChatDo) Having(conds ...gen.Condition) *fissionChatDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChatDo) Limit(limit int) *fissionChatDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChatDo) Offset(offset int) *fissionChatDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChatDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChatDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChatDo) Unscoped() *fissionChatDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChatDo) Create(values ...*model.FissionChat) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChatDo) CreateInBatches(values []*model.FissionChat, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChatDo) Save(values ...*model.FissionChat) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChatDo) First() (*model.FissionChat, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChat), nil + } +} + +func (f fissionChatDo) Take() (*model.FissionChat, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChat), nil + } +} + +func (f fissionChatDo) Last() (*model.FissionChat, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChat), nil + } +} + +func (f fissionChatDo) Find() ([]*model.FissionChat, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChat), err +} + +func (f fissionChatDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChat, err error) { + buf := make([]*model.FissionChat, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChatDo) FindInBatches(result *[]*model.FissionChat, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChatDo) Attrs(attrs ...field.AssignExpr) *fissionChatDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChatDo) Assign(attrs ...field.AssignExpr) *fissionChatDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChatDo) Joins(fields ...field.RelationField) *fissionChatDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChatDo) Preload(fields ...field.RelationField) *fissionChatDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChatDo) FirstOrInit() (*model.FissionChat, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChat), nil + } +} + +func (f fissionChatDo) FirstOrCreate() (*model.FissionChat, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChat), nil + } +} + +func (f fissionChatDo) FindByPage(offset int, limit int) (result []*model.FissionChat, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChatDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChatDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChatDo) Delete(models ...*model.FissionChat) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChatDo) withDO(do gen.Dao) *fissionChatDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_chat_msg.gen.go b/internal/repository/dao/fission_chat_msg.gen.go new file mode 100644 index 0000000..bf73bd4 --- /dev/null +++ b/internal/repository/dao/fission_chat_msg.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChatMsg(db *gorm.DB, opts ...gen.DOOption) fissionChatMsg { + _fissionChatMsg := fissionChatMsg{} + + _fissionChatMsg.fissionChatMsgDo.UseDB(db, opts...) + _fissionChatMsg.fissionChatMsgDo.UseModel(&model.FissionChatMsg{}) + + tableName := _fissionChatMsg.fissionChatMsgDo.TableName() + _fissionChatMsg.ALL = field.NewAsterisk(tableName) + _fissionChatMsg.ID = field.NewInt64(tableName, "id") + _fissionChatMsg.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChatMsg.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChatMsg.UserID = field.NewInt64(tableName, "user_id") + _fissionChatMsg.ChatID = field.NewInt64(tableName, "chat_id") + _fissionChatMsg.Source = field.NewString(tableName, "source") + _fissionChatMsg.MsgType = field.NewInt8(tableName, "msg_type") + _fissionChatMsg.Val = field.NewString(tableName, "val") + + _fissionChatMsg.fillFieldMap() + + return _fissionChatMsg +} + +type fissionChatMsg struct { + fissionChatMsgDo fissionChatMsgDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户ID(fission_user表) + ChatID field.Int64 // 聊天窗ID(fission_chat) + Source field.String // 来源 + MsgType field.Int8 // 消息类型 + Val field.String // 消息数据 + + fieldMap map[string]field.Expr +} + +func (f fissionChatMsg) Table(newTableName string) *fissionChatMsg { + f.fissionChatMsgDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChatMsg) As(alias string) *fissionChatMsg { + f.fissionChatMsgDo.DO = *(f.fissionChatMsgDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChatMsg) updateTableName(table string) *fissionChatMsg { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.ChatID = field.NewInt64(table, "chat_id") + f.Source = field.NewString(table, "source") + f.MsgType = field.NewInt8(table, "msg_type") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionChatMsg) WithContext(ctx context.Context) *fissionChatMsgDo { + return f.fissionChatMsgDo.WithContext(ctx) +} + +func (f fissionChatMsg) TableName() string { return f.fissionChatMsgDo.TableName() } + +func (f fissionChatMsg) Alias() string { return f.fissionChatMsgDo.Alias() } + +func (f *fissionChatMsg) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChatMsg) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["chat_id"] = f.ChatID + f.fieldMap["source"] = f.Source + f.fieldMap["msg_type"] = f.MsgType + f.fieldMap["val"] = f.Val +} + +func (f fissionChatMsg) clone(db *gorm.DB) fissionChatMsg { + f.fissionChatMsgDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChatMsg) replaceDB(db *gorm.DB) fissionChatMsg { + f.fissionChatMsgDo.ReplaceDB(db) + return f +} + +type fissionChatMsgDo struct{ gen.DO } + +func (f fissionChatMsgDo) Debug() *fissionChatMsgDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChatMsgDo) WithContext(ctx context.Context) *fissionChatMsgDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChatMsgDo) ReadDB() *fissionChatMsgDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChatMsgDo) WriteDB() *fissionChatMsgDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChatMsgDo) Session(config *gorm.Session) *fissionChatMsgDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChatMsgDo) Clauses(conds ...clause.Expression) *fissionChatMsgDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChatMsgDo) Returning(value interface{}, columns ...string) *fissionChatMsgDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChatMsgDo) Not(conds ...gen.Condition) *fissionChatMsgDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChatMsgDo) Or(conds ...gen.Condition) *fissionChatMsgDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChatMsgDo) Select(conds ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChatMsgDo) Where(conds ...gen.Condition) *fissionChatMsgDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChatMsgDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChatMsgDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChatMsgDo) Order(conds ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChatMsgDo) Distinct(cols ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChatMsgDo) Omit(cols ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChatMsgDo) Join(table schema.Tabler, on ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChatMsgDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChatMsgDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChatMsgDo) Group(cols ...field.Expr) *fissionChatMsgDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChatMsgDo) Having(conds ...gen.Condition) *fissionChatMsgDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChatMsgDo) Limit(limit int) *fissionChatMsgDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChatMsgDo) Offset(offset int) *fissionChatMsgDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChatMsgDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChatMsgDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChatMsgDo) Unscoped() *fissionChatMsgDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChatMsgDo) Create(values ...*model.FissionChatMsg) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChatMsgDo) CreateInBatches(values []*model.FissionChatMsg, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChatMsgDo) Save(values ...*model.FissionChatMsg) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChatMsgDo) First() (*model.FissionChatMsg, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChatMsg), nil + } +} + +func (f fissionChatMsgDo) Take() (*model.FissionChatMsg, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChatMsg), nil + } +} + +func (f fissionChatMsgDo) Last() (*model.FissionChatMsg, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChatMsg), nil + } +} + +func (f fissionChatMsgDo) Find() ([]*model.FissionChatMsg, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChatMsg), err +} + +func (f fissionChatMsgDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChatMsg, err error) { + buf := make([]*model.FissionChatMsg, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChatMsgDo) FindInBatches(result *[]*model.FissionChatMsg, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChatMsgDo) Attrs(attrs ...field.AssignExpr) *fissionChatMsgDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChatMsgDo) Assign(attrs ...field.AssignExpr) *fissionChatMsgDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChatMsgDo) Joins(fields ...field.RelationField) *fissionChatMsgDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChatMsgDo) Preload(fields ...field.RelationField) *fissionChatMsgDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChatMsgDo) FirstOrInit() (*model.FissionChatMsg, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChatMsg), nil + } +} + +func (f fissionChatMsgDo) FirstOrCreate() (*model.FissionChatMsg, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChatMsg), nil + } +} + +func (f fissionChatMsgDo) FindByPage(offset int, limit int) (result []*model.FissionChatMsg, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChatMsgDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChatMsgDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChatMsgDo) Delete(models ...*model.FissionChatMsg) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChatMsgDo) withDO(do gen.Dao) *fissionChatMsgDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_child_user.gen.go b/internal/repository/dao/fission_child_user.gen.go new file mode 100644 index 0000000..bd4738d --- /dev/null +++ b/internal/repository/dao/fission_child_user.gen.go @@ -0,0 +1,391 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChildUser(db *gorm.DB, opts ...gen.DOOption) fissionChildUser { + _fissionChildUser := fissionChildUser{} + + _fissionChildUser.fissionChildUserDo.UseDB(db, opts...) + _fissionChildUser.fissionChildUserDo.UseModel(&model.FissionChildUser{}) + + tableName := _fissionChildUser.fissionChildUserDo.TableName() + _fissionChildUser.ALL = field.NewAsterisk(tableName) + _fissionChildUser.ID = field.NewInt64(tableName, "id") + _fissionChildUser.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChildUser.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionChildUser.PCpnID = field.NewInt64(tableName, "p_cpn_id") + _fissionChildUser.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChildUser.UserID = field.NewInt64(tableName, "user_id") + _fissionChildUser.ParentID = field.NewInt64(tableName, "parent_id") + _fissionChildUser.ChildType = field.NewInt8(tableName, "child_type") + _fissionChildUser.LastDone = field.NewInt64(tableName, "last_done") + _fissionChildUser.RewardID = field.NewInt64(tableName, "reward_id") + _fissionChildUser.RecordID = field.NewInt64(tableName, "record_id") + _fissionChildUser.ContinueSign = field.NewInt32(tableName, "continue_sign") + _fissionChildUser.SignDay = field.NewInt32(tableName, "sign_day") + _fissionChildUser.InviteNum = field.NewInt64(tableName, "invite_num") + _fissionChildUser.LuckyReward = field.NewString(tableName, "lucky_reward") + _fissionChildUser.JoinTime = field.NewInt64(tableName, "join_time") + + _fissionChildUser.fillFieldMap() + + return _fissionChildUser +} + +type fissionChildUser struct { + fissionChildUserDo fissionChildUserDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + PCpnID field.Int64 // 父级活动ID(fission_campaign表) + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fisison_user表) + ParentID field.Int64 // 父级用户id(fission_user表) + ChildType field.Int8 // 子活动类型 + LastDone field.Int64 // 最后参与时间 + RewardID field.Int64 // 奖品id(fission_campaign_reward表) + RecordID field.Int64 // 奖品记录id(fission_reward_record表) + ContinueSign field.Int32 // 连续签到天数 + SignDay field.Int32 // 签到天数 + InviteNum field.Int64 // 邀请人数 + LuckyReward field.String // 每日抽奖中奖的奖品id + JoinTime field.Int64 // 参与活动时间 + + fieldMap map[string]field.Expr +} + +func (f fissionChildUser) Table(newTableName string) *fissionChildUser { + f.fissionChildUserDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChildUser) As(alias string) *fissionChildUser { + f.fissionChildUserDo.DO = *(f.fissionChildUserDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChildUser) updateTableName(table string) *fissionChildUser { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.PCpnID = field.NewInt64(table, "p_cpn_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.ParentID = field.NewInt64(table, "parent_id") + f.ChildType = field.NewInt8(table, "child_type") + f.LastDone = field.NewInt64(table, "last_done") + f.RewardID = field.NewInt64(table, "reward_id") + f.RecordID = field.NewInt64(table, "record_id") + f.ContinueSign = field.NewInt32(table, "continue_sign") + f.SignDay = field.NewInt32(table, "sign_day") + f.InviteNum = field.NewInt64(table, "invite_num") + f.LuckyReward = field.NewString(table, "lucky_reward") + f.JoinTime = field.NewInt64(table, "join_time") + + f.fillFieldMap() + + return f +} + +func (f *fissionChildUser) WithContext(ctx context.Context) *fissionChildUserDo { + return f.fissionChildUserDo.WithContext(ctx) +} + +func (f fissionChildUser) TableName() string { return f.fissionChildUserDo.TableName() } + +func (f fissionChildUser) Alias() string { return f.fissionChildUserDo.Alias() } + +func (f *fissionChildUser) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChildUser) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 16) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["p_cpn_id"] = f.PCpnID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["parent_id"] = f.ParentID + f.fieldMap["child_type"] = f.ChildType + f.fieldMap["last_done"] = f.LastDone + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["record_id"] = f.RecordID + f.fieldMap["continue_sign"] = f.ContinueSign + f.fieldMap["sign_day"] = f.SignDay + f.fieldMap["invite_num"] = f.InviteNum + f.fieldMap["lucky_reward"] = f.LuckyReward + f.fieldMap["join_time"] = f.JoinTime +} + +func (f fissionChildUser) clone(db *gorm.DB) fissionChildUser { + f.fissionChildUserDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChildUser) replaceDB(db *gorm.DB) fissionChildUser { + f.fissionChildUserDo.ReplaceDB(db) + return f +} + +type fissionChildUserDo struct{ gen.DO } + +func (f fissionChildUserDo) Debug() *fissionChildUserDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChildUserDo) WithContext(ctx context.Context) *fissionChildUserDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChildUserDo) ReadDB() *fissionChildUserDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChildUserDo) WriteDB() *fissionChildUserDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChildUserDo) Session(config *gorm.Session) *fissionChildUserDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChildUserDo) Clauses(conds ...clause.Expression) *fissionChildUserDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChildUserDo) Returning(value interface{}, columns ...string) *fissionChildUserDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChildUserDo) Not(conds ...gen.Condition) *fissionChildUserDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChildUserDo) Or(conds ...gen.Condition) *fissionChildUserDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChildUserDo) Select(conds ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChildUserDo) Where(conds ...gen.Condition) *fissionChildUserDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChildUserDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChildUserDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChildUserDo) Order(conds ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChildUserDo) Distinct(cols ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChildUserDo) Omit(cols ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChildUserDo) Join(table schema.Tabler, on ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChildUserDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChildUserDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChildUserDo) Group(cols ...field.Expr) *fissionChildUserDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChildUserDo) Having(conds ...gen.Condition) *fissionChildUserDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChildUserDo) Limit(limit int) *fissionChildUserDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChildUserDo) Offset(offset int) *fissionChildUserDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChildUserDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChildUserDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChildUserDo) Unscoped() *fissionChildUserDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChildUserDo) Create(values ...*model.FissionChildUser) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChildUserDo) CreateInBatches(values []*model.FissionChildUser, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChildUserDo) Save(values ...*model.FissionChildUser) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChildUserDo) First() (*model.FissionChildUser, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUser), nil + } +} + +func (f fissionChildUserDo) Take() (*model.FissionChildUser, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUser), nil + } +} + +func (f fissionChildUserDo) Last() (*model.FissionChildUser, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUser), nil + } +} + +func (f fissionChildUserDo) Find() ([]*model.FissionChildUser, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChildUser), err +} + +func (f fissionChildUserDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChildUser, err error) { + buf := make([]*model.FissionChildUser, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChildUserDo) FindInBatches(result *[]*model.FissionChildUser, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChildUserDo) Attrs(attrs ...field.AssignExpr) *fissionChildUserDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChildUserDo) Assign(attrs ...field.AssignExpr) *fissionChildUserDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChildUserDo) Joins(fields ...field.RelationField) *fissionChildUserDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChildUserDo) Preload(fields ...field.RelationField) *fissionChildUserDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChildUserDo) FirstOrInit() (*model.FissionChildUser, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUser), nil + } +} + +func (f fissionChildUserDo) FirstOrCreate() (*model.FissionChildUser, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUser), nil + } +} + +func (f fissionChildUserDo) FindByPage(offset int, limit int) (result []*model.FissionChildUser, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChildUserDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChildUserDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChildUserDo) Delete(models ...*model.FissionChildUser) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChildUserDo) withDO(do gen.Dao) *fissionChildUserDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_child_user_record.gen.go b/internal/repository/dao/fission_child_user_record.gen.go new file mode 100644 index 0000000..1bda4a7 --- /dev/null +++ b/internal/repository/dao/fission_child_user_record.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChildUserRecord(db *gorm.DB, opts ...gen.DOOption) fissionChildUserRecord { + _fissionChildUserRecord := fissionChildUserRecord{} + + _fissionChildUserRecord.fissionChildUserRecordDo.UseDB(db, opts...) + _fissionChildUserRecord.fissionChildUserRecordDo.UseModel(&model.FissionChildUserRecord{}) + + tableName := _fissionChildUserRecord.fissionChildUserRecordDo.TableName() + _fissionChildUserRecord.ALL = field.NewAsterisk(tableName) + _fissionChildUserRecord.ID = field.NewInt64(tableName, "id") + _fissionChildUserRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChildUserRecord.PCpnID = field.NewInt64(tableName, "p_cpn_id") + _fissionChildUserRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChildUserRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionChildUserRecord.PlayerID = field.NewInt64(tableName, "player_id") + _fissionChildUserRecord.ChildType = field.NewInt8(tableName, "child_type") + _fissionChildUserRecord.Mark = field.NewString(tableName, "mark") + _fissionChildUserRecord.RecordID = field.NewInt64(tableName, "record_id") + + _fissionChildUserRecord.fillFieldMap() + + return _fissionChildUserRecord +} + +type fissionChildUserRecord struct { + fissionChildUserRecordDo fissionChildUserRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + PCpnID field.Int64 // 父级活动ID(fission_campaign表) + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + PlayerID field.Int64 // 玩家数据id(fission_child_user表) + ChildType field.Int8 // 子活动类型 + Mark field.String // 日志源 + RecordID field.Int64 // 奖品记录id(fission_reward_record表) + + fieldMap map[string]field.Expr +} + +func (f fissionChildUserRecord) Table(newTableName string) *fissionChildUserRecord { + f.fissionChildUserRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChildUserRecord) As(alias string) *fissionChildUserRecord { + f.fissionChildUserRecordDo.DO = *(f.fissionChildUserRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChildUserRecord) updateTableName(table string) *fissionChildUserRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.PCpnID = field.NewInt64(table, "p_cpn_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.PlayerID = field.NewInt64(table, "player_id") + f.ChildType = field.NewInt8(table, "child_type") + f.Mark = field.NewString(table, "mark") + f.RecordID = field.NewInt64(table, "record_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionChildUserRecord) WithContext(ctx context.Context) *fissionChildUserRecordDo { + return f.fissionChildUserRecordDo.WithContext(ctx) +} + +func (f fissionChildUserRecord) TableName() string { return f.fissionChildUserRecordDo.TableName() } + +func (f fissionChildUserRecord) Alias() string { return f.fissionChildUserRecordDo.Alias() } + +func (f *fissionChildUserRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChildUserRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["p_cpn_id"] = f.PCpnID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["player_id"] = f.PlayerID + f.fieldMap["child_type"] = f.ChildType + f.fieldMap["mark"] = f.Mark + f.fieldMap["record_id"] = f.RecordID +} + +func (f fissionChildUserRecord) clone(db *gorm.DB) fissionChildUserRecord { + f.fissionChildUserRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChildUserRecord) replaceDB(db *gorm.DB) fissionChildUserRecord { + f.fissionChildUserRecordDo.ReplaceDB(db) + return f +} + +type fissionChildUserRecordDo struct{ gen.DO } + +func (f fissionChildUserRecordDo) Debug() *fissionChildUserRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChildUserRecordDo) WithContext(ctx context.Context) *fissionChildUserRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChildUserRecordDo) ReadDB() *fissionChildUserRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChildUserRecordDo) WriteDB() *fissionChildUserRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChildUserRecordDo) Session(config *gorm.Session) *fissionChildUserRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChildUserRecordDo) Clauses(conds ...clause.Expression) *fissionChildUserRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChildUserRecordDo) Returning(value interface{}, columns ...string) *fissionChildUserRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChildUserRecordDo) Not(conds ...gen.Condition) *fissionChildUserRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChildUserRecordDo) Or(conds ...gen.Condition) *fissionChildUserRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChildUserRecordDo) Select(conds ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChildUserRecordDo) Where(conds ...gen.Condition) *fissionChildUserRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChildUserRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChildUserRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChildUserRecordDo) Order(conds ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChildUserRecordDo) Distinct(cols ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChildUserRecordDo) Omit(cols ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChildUserRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChildUserRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChildUserRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChildUserRecordDo) Group(cols ...field.Expr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChildUserRecordDo) Having(conds ...gen.Condition) *fissionChildUserRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChildUserRecordDo) Limit(limit int) *fissionChildUserRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChildUserRecordDo) Offset(offset int) *fissionChildUserRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChildUserRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChildUserRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChildUserRecordDo) Unscoped() *fissionChildUserRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChildUserRecordDo) Create(values ...*model.FissionChildUserRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChildUserRecordDo) CreateInBatches(values []*model.FissionChildUserRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChildUserRecordDo) Save(values ...*model.FissionChildUserRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChildUserRecordDo) First() (*model.FissionChildUserRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUserRecord), nil + } +} + +func (f fissionChildUserRecordDo) Take() (*model.FissionChildUserRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUserRecord), nil + } +} + +func (f fissionChildUserRecordDo) Last() (*model.FissionChildUserRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUserRecord), nil + } +} + +func (f fissionChildUserRecordDo) Find() ([]*model.FissionChildUserRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChildUserRecord), err +} + +func (f fissionChildUserRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChildUserRecord, err error) { + buf := make([]*model.FissionChildUserRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChildUserRecordDo) FindInBatches(result *[]*model.FissionChildUserRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChildUserRecordDo) Attrs(attrs ...field.AssignExpr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChildUserRecordDo) Assign(attrs ...field.AssignExpr) *fissionChildUserRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChildUserRecordDo) Joins(fields ...field.RelationField) *fissionChildUserRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChildUserRecordDo) Preload(fields ...field.RelationField) *fissionChildUserRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChildUserRecordDo) FirstOrInit() (*model.FissionChildUserRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUserRecord), nil + } +} + +func (f fissionChildUserRecordDo) FirstOrCreate() (*model.FissionChildUserRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChildUserRecord), nil + } +} + +func (f fissionChildUserRecordDo) FindByPage(offset int, limit int) (result []*model.FissionChildUserRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChildUserRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChildUserRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChildUserRecordDo) Delete(models ...*model.FissionChildUserRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChildUserRecordDo) withDO(do gen.Dao) *fissionChildUserRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_chop.gen.go b/internal/repository/dao/fission_chop.gen.go new file mode 100644 index 0000000..0c1803f --- /dev/null +++ b/internal/repository/dao/fission_chop.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChop(db *gorm.DB, opts ...gen.DOOption) fissionChop { + _fissionChop := fissionChop{} + + _fissionChop.fissionChopDo.UseDB(db, opts...) + _fissionChop.fissionChopDo.UseModel(&model.FissionChop{}) + + tableName := _fissionChop.fissionChopDo.TableName() + _fissionChop.ALL = field.NewAsterisk(tableName) + _fissionChop.ID = field.NewInt64(tableName, "id") + _fissionChop.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChop.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionChop.UserID = field.NewInt64(tableName, "user_id") + _fissionChop.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChop.ChopRewardID = field.NewInt64(tableName, "chop_reward_id") + + _fissionChop.fillFieldMap() + + return _fissionChop +} + +type fissionChop struct { + fissionChopDo fissionChopDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + ChopRewardID field.Int64 // 选择的助力奖品id(fission_chop_reward表) + + fieldMap map[string]field.Expr +} + +func (f fissionChop) Table(newTableName string) *fissionChop { + f.fissionChopDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChop) As(alias string) *fissionChop { + f.fissionChopDo.DO = *(f.fissionChopDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChop) updateTableName(table string) *fissionChop { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ChopRewardID = field.NewInt64(table, "chop_reward_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionChop) WithContext(ctx context.Context) *fissionChopDo { + return f.fissionChopDo.WithContext(ctx) +} + +func (f fissionChop) TableName() string { return f.fissionChopDo.TableName() } + +func (f fissionChop) Alias() string { return f.fissionChopDo.Alias() } + +func (f *fissionChop) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChop) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chop_reward_id"] = f.ChopRewardID +} + +func (f fissionChop) clone(db *gorm.DB) fissionChop { + f.fissionChopDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChop) replaceDB(db *gorm.DB) fissionChop { + f.fissionChopDo.ReplaceDB(db) + return f +} + +type fissionChopDo struct{ gen.DO } + +func (f fissionChopDo) Debug() *fissionChopDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChopDo) WithContext(ctx context.Context) *fissionChopDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChopDo) ReadDB() *fissionChopDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChopDo) WriteDB() *fissionChopDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChopDo) Session(config *gorm.Session) *fissionChopDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChopDo) Clauses(conds ...clause.Expression) *fissionChopDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChopDo) Returning(value interface{}, columns ...string) *fissionChopDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChopDo) Not(conds ...gen.Condition) *fissionChopDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChopDo) Or(conds ...gen.Condition) *fissionChopDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChopDo) Select(conds ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChopDo) Where(conds ...gen.Condition) *fissionChopDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChopDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChopDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChopDo) Order(conds ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChopDo) Distinct(cols ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChopDo) Omit(cols ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChopDo) Join(table schema.Tabler, on ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChopDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChopDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChopDo) Group(cols ...field.Expr) *fissionChopDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChopDo) Having(conds ...gen.Condition) *fissionChopDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChopDo) Limit(limit int) *fissionChopDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChopDo) Offset(offset int) *fissionChopDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChopDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChopDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChopDo) Unscoped() *fissionChopDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChopDo) Create(values ...*model.FissionChop) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChopDo) CreateInBatches(values []*model.FissionChop, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChopDo) Save(values ...*model.FissionChop) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChopDo) First() (*model.FissionChop, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChop), nil + } +} + +func (f fissionChopDo) Take() (*model.FissionChop, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChop), nil + } +} + +func (f fissionChopDo) Last() (*model.FissionChop, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChop), nil + } +} + +func (f fissionChopDo) Find() ([]*model.FissionChop, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChop), err +} + +func (f fissionChopDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChop, err error) { + buf := make([]*model.FissionChop, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChopDo) FindInBatches(result *[]*model.FissionChop, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChopDo) Attrs(attrs ...field.AssignExpr) *fissionChopDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChopDo) Assign(attrs ...field.AssignExpr) *fissionChopDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChopDo) Joins(fields ...field.RelationField) *fissionChopDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChopDo) Preload(fields ...field.RelationField) *fissionChopDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChopDo) FirstOrInit() (*model.FissionChop, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChop), nil + } +} + +func (f fissionChopDo) FirstOrCreate() (*model.FissionChop, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChop), nil + } +} + +func (f fissionChopDo) FindByPage(offset int, limit int) (result []*model.FissionChop, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChopDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChopDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChopDo) Delete(models ...*model.FissionChop) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChopDo) withDO(do gen.Dao) *fissionChopDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_chop_help.gen.go b/internal/repository/dao/fission_chop_help.gen.go new file mode 100644 index 0000000..2ce0942 --- /dev/null +++ b/internal/repository/dao/fission_chop_help.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChopHelp(db *gorm.DB, opts ...gen.DOOption) fissionChopHelp { + _fissionChopHelp := fissionChopHelp{} + + _fissionChopHelp.fissionChopHelpDo.UseDB(db, opts...) + _fissionChopHelp.fissionChopHelpDo.UseModel(&model.FissionChopHelp{}) + + tableName := _fissionChopHelp.fissionChopHelpDo.TableName() + _fissionChopHelp.ALL = field.NewAsterisk(tableName) + _fissionChopHelp.ID = field.NewInt64(tableName, "id") + _fissionChopHelp.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChopHelp.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionChopHelp.UserID = field.NewInt64(tableName, "user_id") + _fissionChopHelp.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChopHelp.ChopRewardID = field.NewInt64(tableName, "chop_reward_id") + _fissionChopHelp.Mark = field.NewString(tableName, "mark") + _fissionChopHelp.Percent = field.NewFloat64(tableName, "percent") + _fissionChopHelp.UserMark = field.NewString(tableName, "user_mark") + + _fissionChopHelp.fillFieldMap() + + return _fissionChopHelp +} + +type fissionChopHelp struct { + fissionChopHelpDo fissionChopHelpDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + ChopRewardID field.Int64 // 选择的奖品id(fission_chop_reward表) + Mark field.String // 助力标识 + Percent field.Float64 // 助力进度 + UserMark field.String // 事件人标识 + + fieldMap map[string]field.Expr +} + +func (f fissionChopHelp) Table(newTableName string) *fissionChopHelp { + f.fissionChopHelpDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChopHelp) As(alias string) *fissionChopHelp { + f.fissionChopHelpDo.DO = *(f.fissionChopHelpDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChopHelp) updateTableName(table string) *fissionChopHelp { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ChopRewardID = field.NewInt64(table, "chop_reward_id") + f.Mark = field.NewString(table, "mark") + f.Percent = field.NewFloat64(table, "percent") + f.UserMark = field.NewString(table, "user_mark") + + f.fillFieldMap() + + return f +} + +func (f *fissionChopHelp) WithContext(ctx context.Context) *fissionChopHelpDo { + return f.fissionChopHelpDo.WithContext(ctx) +} + +func (f fissionChopHelp) TableName() string { return f.fissionChopHelpDo.TableName() } + +func (f fissionChopHelp) Alias() string { return f.fissionChopHelpDo.Alias() } + +func (f *fissionChopHelp) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChopHelp) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chop_reward_id"] = f.ChopRewardID + f.fieldMap["mark"] = f.Mark + f.fieldMap["percent"] = f.Percent + f.fieldMap["user_mark"] = f.UserMark +} + +func (f fissionChopHelp) clone(db *gorm.DB) fissionChopHelp { + f.fissionChopHelpDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChopHelp) replaceDB(db *gorm.DB) fissionChopHelp { + f.fissionChopHelpDo.ReplaceDB(db) + return f +} + +type fissionChopHelpDo struct{ gen.DO } + +func (f fissionChopHelpDo) Debug() *fissionChopHelpDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChopHelpDo) WithContext(ctx context.Context) *fissionChopHelpDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChopHelpDo) ReadDB() *fissionChopHelpDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChopHelpDo) WriteDB() *fissionChopHelpDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChopHelpDo) Session(config *gorm.Session) *fissionChopHelpDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChopHelpDo) Clauses(conds ...clause.Expression) *fissionChopHelpDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChopHelpDo) Returning(value interface{}, columns ...string) *fissionChopHelpDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChopHelpDo) Not(conds ...gen.Condition) *fissionChopHelpDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChopHelpDo) Or(conds ...gen.Condition) *fissionChopHelpDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChopHelpDo) Select(conds ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChopHelpDo) Where(conds ...gen.Condition) *fissionChopHelpDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChopHelpDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChopHelpDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChopHelpDo) Order(conds ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChopHelpDo) Distinct(cols ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChopHelpDo) Omit(cols ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChopHelpDo) Join(table schema.Tabler, on ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChopHelpDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChopHelpDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChopHelpDo) Group(cols ...field.Expr) *fissionChopHelpDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChopHelpDo) Having(conds ...gen.Condition) *fissionChopHelpDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChopHelpDo) Limit(limit int) *fissionChopHelpDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChopHelpDo) Offset(offset int) *fissionChopHelpDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChopHelpDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChopHelpDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChopHelpDo) Unscoped() *fissionChopHelpDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChopHelpDo) Create(values ...*model.FissionChopHelp) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChopHelpDo) CreateInBatches(values []*model.FissionChopHelp, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChopHelpDo) Save(values ...*model.FissionChopHelp) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChopHelpDo) First() (*model.FissionChopHelp, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopHelp), nil + } +} + +func (f fissionChopHelpDo) Take() (*model.FissionChopHelp, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopHelp), nil + } +} + +func (f fissionChopHelpDo) Last() (*model.FissionChopHelp, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopHelp), nil + } +} + +func (f fissionChopHelpDo) Find() ([]*model.FissionChopHelp, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChopHelp), err +} + +func (f fissionChopHelpDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChopHelp, err error) { + buf := make([]*model.FissionChopHelp, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChopHelpDo) FindInBatches(result *[]*model.FissionChopHelp, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChopHelpDo) Attrs(attrs ...field.AssignExpr) *fissionChopHelpDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChopHelpDo) Assign(attrs ...field.AssignExpr) *fissionChopHelpDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChopHelpDo) Joins(fields ...field.RelationField) *fissionChopHelpDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChopHelpDo) Preload(fields ...field.RelationField) *fissionChopHelpDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChopHelpDo) FirstOrInit() (*model.FissionChopHelp, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopHelp), nil + } +} + +func (f fissionChopHelpDo) FirstOrCreate() (*model.FissionChopHelp, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopHelp), nil + } +} + +func (f fissionChopHelpDo) FindByPage(offset int, limit int) (result []*model.FissionChopHelp, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChopHelpDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChopHelpDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChopHelpDo) Delete(models ...*model.FissionChopHelp) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChopHelpDo) withDO(do gen.Dao) *fissionChopHelpDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_chop_reward.gen.go b/internal/repository/dao/fission_chop_reward.gen.go new file mode 100644 index 0000000..45da1c1 --- /dev/null +++ b/internal/repository/dao/fission_chop_reward.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionChopReward(db *gorm.DB, opts ...gen.DOOption) fissionChopReward { + _fissionChopReward := fissionChopReward{} + + _fissionChopReward.fissionChopRewardDo.UseDB(db, opts...) + _fissionChopReward.fissionChopRewardDo.UseModel(&model.FissionChopReward{}) + + tableName := _fissionChopReward.fissionChopRewardDo.TableName() + _fissionChopReward.ALL = field.NewAsterisk(tableName) + _fissionChopReward.ID = field.NewInt64(tableName, "id") + _fissionChopReward.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionChopReward.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionChopReward.UserID = field.NewInt64(tableName, "user_id") + _fissionChopReward.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionChopReward.RewardID = field.NewInt64(tableName, "reward_id") + _fissionChopReward.InitPercent = field.NewFloat64(tableName, "init_percent") + _fissionChopReward.Percent = field.NewFloat64(tableName, "percent") + _fissionChopReward.RecordID = field.NewInt64(tableName, "record_id") + + _fissionChopReward.fillFieldMap() + + return _fissionChopReward +} + +type fissionChopReward struct { + fissionChopRewardDo fissionChopRewardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + RewardID field.Int64 // 选择的助力奖品id(fission_campaign_reward表) + InitPercent field.Float64 // 获得的初始进度 + Percent field.Float64 // 当前获奖进度 + RecordID field.Int64 // 奖品记录id(fission_reward_record表) + + fieldMap map[string]field.Expr +} + +func (f fissionChopReward) Table(newTableName string) *fissionChopReward { + f.fissionChopRewardDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionChopReward) As(alias string) *fissionChopReward { + f.fissionChopRewardDo.DO = *(f.fissionChopRewardDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionChopReward) updateTableName(table string) *fissionChopReward { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.InitPercent = field.NewFloat64(table, "init_percent") + f.Percent = field.NewFloat64(table, "percent") + f.RecordID = field.NewInt64(table, "record_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionChopReward) WithContext(ctx context.Context) *fissionChopRewardDo { + return f.fissionChopRewardDo.WithContext(ctx) +} + +func (f fissionChopReward) TableName() string { return f.fissionChopRewardDo.TableName() } + +func (f fissionChopReward) Alias() string { return f.fissionChopRewardDo.Alias() } + +func (f *fissionChopReward) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionChopReward) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["init_percent"] = f.InitPercent + f.fieldMap["percent"] = f.Percent + f.fieldMap["record_id"] = f.RecordID +} + +func (f fissionChopReward) clone(db *gorm.DB) fissionChopReward { + f.fissionChopRewardDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionChopReward) replaceDB(db *gorm.DB) fissionChopReward { + f.fissionChopRewardDo.ReplaceDB(db) + return f +} + +type fissionChopRewardDo struct{ gen.DO } + +func (f fissionChopRewardDo) Debug() *fissionChopRewardDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionChopRewardDo) WithContext(ctx context.Context) *fissionChopRewardDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionChopRewardDo) ReadDB() *fissionChopRewardDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionChopRewardDo) WriteDB() *fissionChopRewardDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionChopRewardDo) Session(config *gorm.Session) *fissionChopRewardDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionChopRewardDo) Clauses(conds ...clause.Expression) *fissionChopRewardDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionChopRewardDo) Returning(value interface{}, columns ...string) *fissionChopRewardDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionChopRewardDo) Not(conds ...gen.Condition) *fissionChopRewardDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionChopRewardDo) Or(conds ...gen.Condition) *fissionChopRewardDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionChopRewardDo) Select(conds ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionChopRewardDo) Where(conds ...gen.Condition) *fissionChopRewardDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionChopRewardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionChopRewardDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionChopRewardDo) Order(conds ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionChopRewardDo) Distinct(cols ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionChopRewardDo) Omit(cols ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionChopRewardDo) Join(table schema.Tabler, on ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionChopRewardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionChopRewardDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionChopRewardDo) Group(cols ...field.Expr) *fissionChopRewardDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionChopRewardDo) Having(conds ...gen.Condition) *fissionChopRewardDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionChopRewardDo) Limit(limit int) *fissionChopRewardDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionChopRewardDo) Offset(offset int) *fissionChopRewardDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionChopRewardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionChopRewardDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionChopRewardDo) Unscoped() *fissionChopRewardDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionChopRewardDo) Create(values ...*model.FissionChopReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionChopRewardDo) CreateInBatches(values []*model.FissionChopReward, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionChopRewardDo) Save(values ...*model.FissionChopReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionChopRewardDo) First() (*model.FissionChopReward, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopReward), nil + } +} + +func (f fissionChopRewardDo) Take() (*model.FissionChopReward, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopReward), nil + } +} + +func (f fissionChopRewardDo) Last() (*model.FissionChopReward, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopReward), nil + } +} + +func (f fissionChopRewardDo) Find() ([]*model.FissionChopReward, error) { + result, err := f.DO.Find() + return result.([]*model.FissionChopReward), err +} + +func (f fissionChopRewardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionChopReward, err error) { + buf := make([]*model.FissionChopReward, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionChopRewardDo) FindInBatches(result *[]*model.FissionChopReward, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionChopRewardDo) Attrs(attrs ...field.AssignExpr) *fissionChopRewardDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionChopRewardDo) Assign(attrs ...field.AssignExpr) *fissionChopRewardDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionChopRewardDo) Joins(fields ...field.RelationField) *fissionChopRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionChopRewardDo) Preload(fields ...field.RelationField) *fissionChopRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionChopRewardDo) FirstOrInit() (*model.FissionChopReward, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopReward), nil + } +} + +func (f fissionChopRewardDo) FirstOrCreate() (*model.FissionChopReward, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionChopReward), nil + } +} + +func (f fissionChopRewardDo) FindByPage(offset int, limit int) (result []*model.FissionChopReward, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionChopRewardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionChopRewardDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionChopRewardDo) Delete(models ...*model.FissionChopReward) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionChopRewardDo) withDO(do gen.Dao) *fissionChopRewardDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_client_reward.gen.go b/internal/repository/dao/fission_client_reward.gen.go new file mode 100644 index 0000000..8015397 --- /dev/null +++ b/internal/repository/dao/fission_client_reward.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionClientReward(db *gorm.DB, opts ...gen.DOOption) fissionClientReward { + _fissionClientReward := fissionClientReward{} + + _fissionClientReward.fissionClientRewardDo.UseDB(db, opts...) + _fissionClientReward.fissionClientRewardDo.UseModel(&model.FissionClientReward{}) + + tableName := _fissionClientReward.fissionClientRewardDo.TableName() + _fissionClientReward.ALL = field.NewAsterisk(tableName) + _fissionClientReward.ID = field.NewInt64(tableName, "id") + _fissionClientReward.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionClientReward.UserID = field.NewString(tableName, "user_id") + _fissionClientReward.ProjectID = field.NewInt64(tableName, "project_id") + _fissionClientReward.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionClientReward.RecordID = field.NewInt64(tableName, "record_id") + _fissionClientReward.ReceiveAt = field.NewInt64(tableName, "receive_at") + + _fissionClientReward.fillFieldMap() + + return _fissionClientReward +} + +type fissionClientReward struct { + fissionClientRewardDo fissionClientRewardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.String // 用户id + ProjectID field.Int64 // 项目id + CampaignID field.Int64 // 活动id + RecordID field.Int64 // 发奖记录id + ReceiveAt field.Int64 // 接收时间 + + fieldMap map[string]field.Expr +} + +func (f fissionClientReward) Table(newTableName string) *fissionClientReward { + f.fissionClientRewardDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionClientReward) As(alias string) *fissionClientReward { + f.fissionClientRewardDo.DO = *(f.fissionClientRewardDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionClientReward) updateTableName(table string) *fissionClientReward { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewString(table, "user_id") + f.ProjectID = field.NewInt64(table, "project_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RecordID = field.NewInt64(table, "record_id") + f.ReceiveAt = field.NewInt64(table, "receive_at") + + f.fillFieldMap() + + return f +} + +func (f *fissionClientReward) WithContext(ctx context.Context) *fissionClientRewardDo { + return f.fissionClientRewardDo.WithContext(ctx) +} + +func (f fissionClientReward) TableName() string { return f.fissionClientRewardDo.TableName() } + +func (f fissionClientReward) Alias() string { return f.fissionClientRewardDo.Alias() } + +func (f *fissionClientReward) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionClientReward) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["project_id"] = f.ProjectID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["record_id"] = f.RecordID + f.fieldMap["receive_at"] = f.ReceiveAt +} + +func (f fissionClientReward) clone(db *gorm.DB) fissionClientReward { + f.fissionClientRewardDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionClientReward) replaceDB(db *gorm.DB) fissionClientReward { + f.fissionClientRewardDo.ReplaceDB(db) + return f +} + +type fissionClientRewardDo struct{ gen.DO } + +func (f fissionClientRewardDo) Debug() *fissionClientRewardDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionClientRewardDo) WithContext(ctx context.Context) *fissionClientRewardDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionClientRewardDo) ReadDB() *fissionClientRewardDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionClientRewardDo) WriteDB() *fissionClientRewardDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionClientRewardDo) Session(config *gorm.Session) *fissionClientRewardDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionClientRewardDo) Clauses(conds ...clause.Expression) *fissionClientRewardDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionClientRewardDo) Returning(value interface{}, columns ...string) *fissionClientRewardDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionClientRewardDo) Not(conds ...gen.Condition) *fissionClientRewardDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionClientRewardDo) Or(conds ...gen.Condition) *fissionClientRewardDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionClientRewardDo) Select(conds ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionClientRewardDo) Where(conds ...gen.Condition) *fissionClientRewardDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionClientRewardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionClientRewardDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionClientRewardDo) Order(conds ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionClientRewardDo) Distinct(cols ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionClientRewardDo) Omit(cols ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionClientRewardDo) Join(table schema.Tabler, on ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionClientRewardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionClientRewardDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionClientRewardDo) Group(cols ...field.Expr) *fissionClientRewardDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionClientRewardDo) Having(conds ...gen.Condition) *fissionClientRewardDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionClientRewardDo) Limit(limit int) *fissionClientRewardDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionClientRewardDo) Offset(offset int) *fissionClientRewardDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionClientRewardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionClientRewardDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionClientRewardDo) Unscoped() *fissionClientRewardDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionClientRewardDo) Create(values ...*model.FissionClientReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionClientRewardDo) CreateInBatches(values []*model.FissionClientReward, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionClientRewardDo) Save(values ...*model.FissionClientReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionClientRewardDo) First() (*model.FissionClientReward, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionClientReward), nil + } +} + +func (f fissionClientRewardDo) Take() (*model.FissionClientReward, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionClientReward), nil + } +} + +func (f fissionClientRewardDo) Last() (*model.FissionClientReward, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionClientReward), nil + } +} + +func (f fissionClientRewardDo) Find() ([]*model.FissionClientReward, error) { + result, err := f.DO.Find() + return result.([]*model.FissionClientReward), err +} + +func (f fissionClientRewardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionClientReward, err error) { + buf := make([]*model.FissionClientReward, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionClientRewardDo) FindInBatches(result *[]*model.FissionClientReward, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionClientRewardDo) Attrs(attrs ...field.AssignExpr) *fissionClientRewardDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionClientRewardDo) Assign(attrs ...field.AssignExpr) *fissionClientRewardDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionClientRewardDo) Joins(fields ...field.RelationField) *fissionClientRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionClientRewardDo) Preload(fields ...field.RelationField) *fissionClientRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionClientRewardDo) FirstOrInit() (*model.FissionClientReward, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionClientReward), nil + } +} + +func (f fissionClientRewardDo) FirstOrCreate() (*model.FissionClientReward, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionClientReward), nil + } +} + +func (f fissionClientRewardDo) FindByPage(offset int, limit int) (result []*model.FissionClientReward, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionClientRewardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionClientRewardDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionClientRewardDo) Delete(models ...*model.FissionClientReward) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionClientRewardDo) withDO(do gen.Dao) *fissionClientRewardDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_coin.gen.go b/internal/repository/dao/fission_coin.gen.go new file mode 100644 index 0000000..8165248 --- /dev/null +++ b/internal/repository/dao/fission_coin.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCoin(db *gorm.DB, opts ...gen.DOOption) fissionCoin { + _fissionCoin := fissionCoin{} + + _fissionCoin.fissionCoinDo.UseDB(db, opts...) + _fissionCoin.fissionCoinDo.UseModel(&model.FissionCoin{}) + + tableName := _fissionCoin.fissionCoinDo.TableName() + _fissionCoin.ALL = field.NewAsterisk(tableName) + _fissionCoin.ID = field.NewInt64(tableName, "id") + _fissionCoin.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCoin.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCoin.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCoin.UserID = field.NewInt64(tableName, "user_id") + _fissionCoin.SceneID = field.NewInt64(tableName, "scene_id") + _fissionCoin.UseNum = field.NewInt32(tableName, "use_num") + _fissionCoin.UseCoin = field.NewInt32(tableName, "use_coin") + _fissionCoin.GetCoin = field.NewInt32(tableName, "get_coin") + _fissionCoin.Status = field.NewInt8(tableName, "status") + _fissionCoin.PreSceneOk = field.NewInt8(tableName, "pre_scene_ok") + + _fissionCoin.fillFieldMap() + + return _fissionCoin +} + +type fissionCoin struct { + fissionCoinDo fissionCoinDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id + SceneID field.Int64 // 场次id + UseNum field.Int32 // 投放次数 + UseCoin field.Int32 // 投放金币总数 + GetCoin field.Int32 // 领取的金币数 + Status field.Int8 // 状态(1-未参与,2-待领取,3-已领取,4-未领取) + PreSceneOk field.Int8 // 上一场活动是否结算完毕(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionCoin) Table(newTableName string) *fissionCoin { + f.fissionCoinDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCoin) As(alias string) *fissionCoin { + f.fissionCoinDo.DO = *(f.fissionCoinDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCoin) updateTableName(table string) *fissionCoin { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.SceneID = field.NewInt64(table, "scene_id") + f.UseNum = field.NewInt32(table, "use_num") + f.UseCoin = field.NewInt32(table, "use_coin") + f.GetCoin = field.NewInt32(table, "get_coin") + f.Status = field.NewInt8(table, "status") + f.PreSceneOk = field.NewInt8(table, "pre_scene_ok") + + f.fillFieldMap() + + return f +} + +func (f *fissionCoin) WithContext(ctx context.Context) *fissionCoinDo { + return f.fissionCoinDo.WithContext(ctx) +} + +func (f fissionCoin) TableName() string { return f.fissionCoinDo.TableName() } + +func (f fissionCoin) Alias() string { return f.fissionCoinDo.Alias() } + +func (f *fissionCoin) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCoin) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["scene_id"] = f.SceneID + f.fieldMap["use_num"] = f.UseNum + f.fieldMap["use_coin"] = f.UseCoin + f.fieldMap["get_coin"] = f.GetCoin + f.fieldMap["status"] = f.Status + f.fieldMap["pre_scene_ok"] = f.PreSceneOk +} + +func (f fissionCoin) clone(db *gorm.DB) fissionCoin { + f.fissionCoinDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCoin) replaceDB(db *gorm.DB) fissionCoin { + f.fissionCoinDo.ReplaceDB(db) + return f +} + +type fissionCoinDo struct{ gen.DO } + +func (f fissionCoinDo) Debug() *fissionCoinDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCoinDo) WithContext(ctx context.Context) *fissionCoinDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCoinDo) ReadDB() *fissionCoinDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCoinDo) WriteDB() *fissionCoinDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCoinDo) Session(config *gorm.Session) *fissionCoinDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCoinDo) Clauses(conds ...clause.Expression) *fissionCoinDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCoinDo) Returning(value interface{}, columns ...string) *fissionCoinDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCoinDo) Not(conds ...gen.Condition) *fissionCoinDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCoinDo) Or(conds ...gen.Condition) *fissionCoinDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCoinDo) Select(conds ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCoinDo) Where(conds ...gen.Condition) *fissionCoinDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCoinDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCoinDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCoinDo) Order(conds ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCoinDo) Distinct(cols ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCoinDo) Omit(cols ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCoinDo) Join(table schema.Tabler, on ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCoinDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCoinDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCoinDo) Group(cols ...field.Expr) *fissionCoinDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCoinDo) Having(conds ...gen.Condition) *fissionCoinDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCoinDo) Limit(limit int) *fissionCoinDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCoinDo) Offset(offset int) *fissionCoinDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCoinDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCoinDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCoinDo) Unscoped() *fissionCoinDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCoinDo) Create(values ...*model.FissionCoin) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCoinDo) CreateInBatches(values []*model.FissionCoin, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCoinDo) Save(values ...*model.FissionCoin) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCoinDo) First() (*model.FissionCoin, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoin), nil + } +} + +func (f fissionCoinDo) Take() (*model.FissionCoin, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoin), nil + } +} + +func (f fissionCoinDo) Last() (*model.FissionCoin, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoin), nil + } +} + +func (f fissionCoinDo) Find() ([]*model.FissionCoin, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCoin), err +} + +func (f fissionCoinDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCoin, err error) { + buf := make([]*model.FissionCoin, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCoinDo) FindInBatches(result *[]*model.FissionCoin, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCoinDo) Attrs(attrs ...field.AssignExpr) *fissionCoinDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCoinDo) Assign(attrs ...field.AssignExpr) *fissionCoinDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCoinDo) Joins(fields ...field.RelationField) *fissionCoinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCoinDo) Preload(fields ...field.RelationField) *fissionCoinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCoinDo) FirstOrInit() (*model.FissionCoin, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoin), nil + } +} + +func (f fissionCoinDo) FirstOrCreate() (*model.FissionCoin, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoin), nil + } +} + +func (f fissionCoinDo) FindByPage(offset int, limit int) (result []*model.FissionCoin, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCoinDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCoinDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCoinDo) Delete(models ...*model.FissionCoin) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCoinDo) withDO(do gen.Dao) *fissionCoinDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_coin_log.gen.go b/internal/repository/dao/fission_coin_log.gen.go new file mode 100644 index 0000000..f649c18 --- /dev/null +++ b/internal/repository/dao/fission_coin_log.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCoinLog(db *gorm.DB, opts ...gen.DOOption) fissionCoinLog { + _fissionCoinLog := fissionCoinLog{} + + _fissionCoinLog.fissionCoinLogDo.UseDB(db, opts...) + _fissionCoinLog.fissionCoinLogDo.UseModel(&model.FissionCoinLog{}) + + tableName := _fissionCoinLog.fissionCoinLogDo.TableName() + _fissionCoinLog.ALL = field.NewAsterisk(tableName) + _fissionCoinLog.ID = field.NewInt64(tableName, "id") + _fissionCoinLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCoinLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCoinLog.UserID = field.NewInt64(tableName, "user_id") + _fissionCoinLog.CoinID = field.NewInt64(tableName, "coin_id") + _fissionCoinLog.SceneID = field.NewInt64(tableName, "scene_id") + _fissionCoinLog.Type = field.NewInt8(tableName, "type") + _fissionCoinLog.Source = field.NewString(tableName, "source") + _fissionCoinLog.Val = field.NewString(tableName, "val") + + _fissionCoinLog.fillFieldMap() + + return _fissionCoinLog +} + +type fissionCoinLog struct { + fissionCoinLogDo fissionCoinLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id + CoinID field.Int64 // 金币池玩家id(fission_coin) + SceneID field.Int64 // 场次id(fission_coin_scene表) + Type field.Int8 // 日志类型(1-消耗金币,2-获得金币,3-获得奖品) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionCoinLog) Table(newTableName string) *fissionCoinLog { + f.fissionCoinLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCoinLog) As(alias string) *fissionCoinLog { + f.fissionCoinLogDo.DO = *(f.fissionCoinLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCoinLog) updateTableName(table string) *fissionCoinLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.CoinID = field.NewInt64(table, "coin_id") + f.SceneID = field.NewInt64(table, "scene_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionCoinLog) WithContext(ctx context.Context) *fissionCoinLogDo { + return f.fissionCoinLogDo.WithContext(ctx) +} + +func (f fissionCoinLog) TableName() string { return f.fissionCoinLogDo.TableName() } + +func (f fissionCoinLog) Alias() string { return f.fissionCoinLogDo.Alias() } + +func (f *fissionCoinLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCoinLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["coin_id"] = f.CoinID + f.fieldMap["scene_id"] = f.SceneID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionCoinLog) clone(db *gorm.DB) fissionCoinLog { + f.fissionCoinLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCoinLog) replaceDB(db *gorm.DB) fissionCoinLog { + f.fissionCoinLogDo.ReplaceDB(db) + return f +} + +type fissionCoinLogDo struct{ gen.DO } + +func (f fissionCoinLogDo) Debug() *fissionCoinLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCoinLogDo) WithContext(ctx context.Context) *fissionCoinLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCoinLogDo) ReadDB() *fissionCoinLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCoinLogDo) WriteDB() *fissionCoinLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCoinLogDo) Session(config *gorm.Session) *fissionCoinLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCoinLogDo) Clauses(conds ...clause.Expression) *fissionCoinLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCoinLogDo) Returning(value interface{}, columns ...string) *fissionCoinLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCoinLogDo) Not(conds ...gen.Condition) *fissionCoinLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCoinLogDo) Or(conds ...gen.Condition) *fissionCoinLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCoinLogDo) Select(conds ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCoinLogDo) Where(conds ...gen.Condition) *fissionCoinLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCoinLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCoinLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCoinLogDo) Order(conds ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCoinLogDo) Distinct(cols ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCoinLogDo) Omit(cols ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCoinLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCoinLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCoinLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCoinLogDo) Group(cols ...field.Expr) *fissionCoinLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCoinLogDo) Having(conds ...gen.Condition) *fissionCoinLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCoinLogDo) Limit(limit int) *fissionCoinLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCoinLogDo) Offset(offset int) *fissionCoinLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCoinLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCoinLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCoinLogDo) Unscoped() *fissionCoinLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCoinLogDo) Create(values ...*model.FissionCoinLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCoinLogDo) CreateInBatches(values []*model.FissionCoinLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCoinLogDo) Save(values ...*model.FissionCoinLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCoinLogDo) First() (*model.FissionCoinLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinLog), nil + } +} + +func (f fissionCoinLogDo) Take() (*model.FissionCoinLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinLog), nil + } +} + +func (f fissionCoinLogDo) Last() (*model.FissionCoinLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinLog), nil + } +} + +func (f fissionCoinLogDo) Find() ([]*model.FissionCoinLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCoinLog), err +} + +func (f fissionCoinLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCoinLog, err error) { + buf := make([]*model.FissionCoinLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCoinLogDo) FindInBatches(result *[]*model.FissionCoinLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCoinLogDo) Attrs(attrs ...field.AssignExpr) *fissionCoinLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCoinLogDo) Assign(attrs ...field.AssignExpr) *fissionCoinLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCoinLogDo) Joins(fields ...field.RelationField) *fissionCoinLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCoinLogDo) Preload(fields ...field.RelationField) *fissionCoinLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCoinLogDo) FirstOrInit() (*model.FissionCoinLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinLog), nil + } +} + +func (f fissionCoinLogDo) FirstOrCreate() (*model.FissionCoinLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinLog), nil + } +} + +func (f fissionCoinLogDo) FindByPage(offset int, limit int) (result []*model.FissionCoinLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCoinLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCoinLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCoinLogDo) Delete(models ...*model.FissionCoinLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCoinLogDo) withDO(do gen.Dao) *fissionCoinLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_coin_scene.gen.go b/internal/repository/dao/fission_coin_scene.gen.go new file mode 100644 index 0000000..2df76b3 --- /dev/null +++ b/internal/repository/dao/fission_coin_scene.gen.go @@ -0,0 +1,387 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCoinScene(db *gorm.DB, opts ...gen.DOOption) fissionCoinScene { + _fissionCoinScene := fissionCoinScene{} + + _fissionCoinScene.fissionCoinSceneDo.UseDB(db, opts...) + _fissionCoinScene.fissionCoinSceneDo.UseModel(&model.FissionCoinScene{}) + + tableName := _fissionCoinScene.fissionCoinSceneDo.TableName() + _fissionCoinScene.ALL = field.NewAsterisk(tableName) + _fissionCoinScene.ID = field.NewInt64(tableName, "id") + _fissionCoinScene.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCoinScene.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionCoinScene.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCoinScene.OpenTime = field.NewInt64(tableName, "open_time") + _fissionCoinScene.InitCoin = field.NewInt32(tableName, "init_coin") + _fissionCoinScene.InitUse = field.NewInt32(tableName, "init_use") + _fissionCoinScene.UserCoin = field.NewInt64(tableName, "user_coin") + _fissionCoinScene.RewardTime = field.NewInt64(tableName, "reward_time") + _fissionCoinScene.JoinNum = field.NewInt64(tableName, "join_num") + _fissionCoinScene.JoinUserNum = field.NewInt64(tableName, "join_user_num") + _fissionCoinScene.GetNum = field.NewInt64(tableName, "get_num") + _fissionCoinScene.GetCoin = field.NewInt64(tableName, "get_coin") + _fissionCoinScene.PreScene = field.NewInt64(tableName, "pre_scene") + _fissionCoinScene.IsArchive = field.NewInt8(tableName, "is_archive") + + _fissionCoinScene.fillFieldMap() + + return _fissionCoinScene +} + +type fissionCoinScene struct { + fissionCoinSceneDo fissionCoinSceneDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + OpenTime field.Int64 // 开奖时间 + InitCoin field.Int32 // 结算完毕后时奖池初始金额 + InitUse field.Int32 // 结算完毕后初始投放次数 + UserCoin field.Int64 // 用户投入的金币总数 + RewardTime field.Int64 // 领奖结束时间 + JoinNum field.Int64 // 投放总数 + JoinUserNum field.Int64 // 投放人数 + GetNum field.Int64 // 领奖总人数 + GetCoin field.Int64 // 领取的总金币数 + PreScene field.Int64 // 上一场id + IsArchive field.Int8 // 是否已经归档 + + fieldMap map[string]field.Expr +} + +func (f fissionCoinScene) Table(newTableName string) *fissionCoinScene { + f.fissionCoinSceneDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCoinScene) As(alias string) *fissionCoinScene { + f.fissionCoinSceneDo.DO = *(f.fissionCoinSceneDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCoinScene) updateTableName(table string) *fissionCoinScene { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.OpenTime = field.NewInt64(table, "open_time") + f.InitCoin = field.NewInt32(table, "init_coin") + f.InitUse = field.NewInt32(table, "init_use") + f.UserCoin = field.NewInt64(table, "user_coin") + f.RewardTime = field.NewInt64(table, "reward_time") + f.JoinNum = field.NewInt64(table, "join_num") + f.JoinUserNum = field.NewInt64(table, "join_user_num") + f.GetNum = field.NewInt64(table, "get_num") + f.GetCoin = field.NewInt64(table, "get_coin") + f.PreScene = field.NewInt64(table, "pre_scene") + f.IsArchive = field.NewInt8(table, "is_archive") + + f.fillFieldMap() + + return f +} + +func (f *fissionCoinScene) WithContext(ctx context.Context) *fissionCoinSceneDo { + return f.fissionCoinSceneDo.WithContext(ctx) +} + +func (f fissionCoinScene) TableName() string { return f.fissionCoinSceneDo.TableName() } + +func (f fissionCoinScene) Alias() string { return f.fissionCoinSceneDo.Alias() } + +func (f *fissionCoinScene) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCoinScene) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 15) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["open_time"] = f.OpenTime + f.fieldMap["init_coin"] = f.InitCoin + f.fieldMap["init_use"] = f.InitUse + f.fieldMap["user_coin"] = f.UserCoin + f.fieldMap["reward_time"] = f.RewardTime + f.fieldMap["join_num"] = f.JoinNum + f.fieldMap["join_user_num"] = f.JoinUserNum + f.fieldMap["get_num"] = f.GetNum + f.fieldMap["get_coin"] = f.GetCoin + f.fieldMap["pre_scene"] = f.PreScene + f.fieldMap["is_archive"] = f.IsArchive +} + +func (f fissionCoinScene) clone(db *gorm.DB) fissionCoinScene { + f.fissionCoinSceneDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCoinScene) replaceDB(db *gorm.DB) fissionCoinScene { + f.fissionCoinSceneDo.ReplaceDB(db) + return f +} + +type fissionCoinSceneDo struct{ gen.DO } + +func (f fissionCoinSceneDo) Debug() *fissionCoinSceneDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCoinSceneDo) WithContext(ctx context.Context) *fissionCoinSceneDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCoinSceneDo) ReadDB() *fissionCoinSceneDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCoinSceneDo) WriteDB() *fissionCoinSceneDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCoinSceneDo) Session(config *gorm.Session) *fissionCoinSceneDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCoinSceneDo) Clauses(conds ...clause.Expression) *fissionCoinSceneDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCoinSceneDo) Returning(value interface{}, columns ...string) *fissionCoinSceneDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCoinSceneDo) Not(conds ...gen.Condition) *fissionCoinSceneDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCoinSceneDo) Or(conds ...gen.Condition) *fissionCoinSceneDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCoinSceneDo) Select(conds ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCoinSceneDo) Where(conds ...gen.Condition) *fissionCoinSceneDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCoinSceneDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCoinSceneDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCoinSceneDo) Order(conds ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCoinSceneDo) Distinct(cols ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCoinSceneDo) Omit(cols ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCoinSceneDo) Join(table schema.Tabler, on ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCoinSceneDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCoinSceneDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCoinSceneDo) Group(cols ...field.Expr) *fissionCoinSceneDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCoinSceneDo) Having(conds ...gen.Condition) *fissionCoinSceneDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCoinSceneDo) Limit(limit int) *fissionCoinSceneDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCoinSceneDo) Offset(offset int) *fissionCoinSceneDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCoinSceneDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCoinSceneDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCoinSceneDo) Unscoped() *fissionCoinSceneDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCoinSceneDo) Create(values ...*model.FissionCoinScene) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCoinSceneDo) CreateInBatches(values []*model.FissionCoinScene, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCoinSceneDo) Save(values ...*model.FissionCoinScene) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCoinSceneDo) First() (*model.FissionCoinScene, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinScene), nil + } +} + +func (f fissionCoinSceneDo) Take() (*model.FissionCoinScene, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinScene), nil + } +} + +func (f fissionCoinSceneDo) Last() (*model.FissionCoinScene, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinScene), nil + } +} + +func (f fissionCoinSceneDo) Find() ([]*model.FissionCoinScene, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCoinScene), err +} + +func (f fissionCoinSceneDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCoinScene, err error) { + buf := make([]*model.FissionCoinScene, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCoinSceneDo) FindInBatches(result *[]*model.FissionCoinScene, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCoinSceneDo) Attrs(attrs ...field.AssignExpr) *fissionCoinSceneDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCoinSceneDo) Assign(attrs ...field.AssignExpr) *fissionCoinSceneDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCoinSceneDo) Joins(fields ...field.RelationField) *fissionCoinSceneDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCoinSceneDo) Preload(fields ...field.RelationField) *fissionCoinSceneDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCoinSceneDo) FirstOrInit() (*model.FissionCoinScene, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinScene), nil + } +} + +func (f fissionCoinSceneDo) FirstOrCreate() (*model.FissionCoinScene, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCoinScene), nil + } +} + +func (f fissionCoinSceneDo) FindByPage(offset int, limit int) (result []*model.FissionCoinScene, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCoinSceneDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCoinSceneDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCoinSceneDo) Delete(models ...*model.FissionCoinScene) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCoinSceneDo) withDO(do gen.Dao) *fissionCoinSceneDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_config.gen.go b/internal/repository/dao/fission_config.gen.go new file mode 100644 index 0000000..9418f4e --- /dev/null +++ b/internal/repository/dao/fission_config.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionConfig(db *gorm.DB, opts ...gen.DOOption) fissionConfig { + _fissionConfig := fissionConfig{} + + _fissionConfig.fissionConfigDo.UseDB(db, opts...) + _fissionConfig.fissionConfigDo.UseModel(&model.FissionConfig{}) + + tableName := _fissionConfig.fissionConfigDo.TableName() + _fissionConfig.ALL = field.NewAsterisk(tableName) + _fissionConfig.ID = field.NewInt64(tableName, "id") + _fissionConfig.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionConfig.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionConfig.ProjectID = field.NewInt64(tableName, "project_id") + _fissionConfig.DynamicCampaign = field.NewInt64(tableName, "dynamic_campaign") + _fissionConfig.LvURLID = field.NewInt64(tableName, "lv_url_id") + _fissionConfig.PushVisit = field.NewInt8(tableName, "push_visit") + _fissionConfig.PushCampaignTask = field.NewInt8(tableName, "push_campaign_task") + + _fissionConfig.fillFieldMap() + + return _fissionConfig +} + +type fissionConfig struct { + fissionConfigDo fissionConfigDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目ID(clintproject表主键) + DynamicCampaign field.Int64 // 动态下载页关联活动 + LvURLID field.Int64 // 用户类型关联访问地址 + PushVisit field.Int8 // 用户访问推送(0-否,1-是) + PushCampaignTask field.Int8 // 活动任务完成推送(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionConfig) Table(newTableName string) *fissionConfig { + f.fissionConfigDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionConfig) As(alias string) *fissionConfig { + f.fissionConfigDo.DO = *(f.fissionConfigDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionConfig) updateTableName(table string) *fissionConfig { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.ProjectID = field.NewInt64(table, "project_id") + f.DynamicCampaign = field.NewInt64(table, "dynamic_campaign") + f.LvURLID = field.NewInt64(table, "lv_url_id") + f.PushVisit = field.NewInt8(table, "push_visit") + f.PushCampaignTask = field.NewInt8(table, "push_campaign_task") + + f.fillFieldMap() + + return f +} + +func (f *fissionConfig) WithContext(ctx context.Context) *fissionConfigDo { + return f.fissionConfigDo.WithContext(ctx) +} + +func (f fissionConfig) TableName() string { return f.fissionConfigDo.TableName() } + +func (f fissionConfig) Alias() string { return f.fissionConfigDo.Alias() } + +func (f *fissionConfig) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionConfig) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["project_id"] = f.ProjectID + f.fieldMap["dynamic_campaign"] = f.DynamicCampaign + f.fieldMap["lv_url_id"] = f.LvURLID + f.fieldMap["push_visit"] = f.PushVisit + f.fieldMap["push_campaign_task"] = f.PushCampaignTask +} + +func (f fissionConfig) clone(db *gorm.DB) fissionConfig { + f.fissionConfigDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionConfig) replaceDB(db *gorm.DB) fissionConfig { + f.fissionConfigDo.ReplaceDB(db) + return f +} + +type fissionConfigDo struct{ gen.DO } + +func (f fissionConfigDo) Debug() *fissionConfigDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionConfigDo) WithContext(ctx context.Context) *fissionConfigDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionConfigDo) ReadDB() *fissionConfigDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionConfigDo) WriteDB() *fissionConfigDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionConfigDo) Session(config *gorm.Session) *fissionConfigDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionConfigDo) Clauses(conds ...clause.Expression) *fissionConfigDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionConfigDo) Returning(value interface{}, columns ...string) *fissionConfigDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionConfigDo) Not(conds ...gen.Condition) *fissionConfigDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionConfigDo) Or(conds ...gen.Condition) *fissionConfigDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionConfigDo) Select(conds ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionConfigDo) Where(conds ...gen.Condition) *fissionConfigDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionConfigDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionConfigDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionConfigDo) Order(conds ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionConfigDo) Distinct(cols ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionConfigDo) Omit(cols ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionConfigDo) Join(table schema.Tabler, on ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionConfigDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionConfigDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionConfigDo) Group(cols ...field.Expr) *fissionConfigDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionConfigDo) Having(conds ...gen.Condition) *fissionConfigDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionConfigDo) Limit(limit int) *fissionConfigDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionConfigDo) Offset(offset int) *fissionConfigDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionConfigDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionConfigDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionConfigDo) Unscoped() *fissionConfigDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionConfigDo) Create(values ...*model.FissionConfig) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionConfigDo) CreateInBatches(values []*model.FissionConfig, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionConfigDo) Save(values ...*model.FissionConfig) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionConfigDo) First() (*model.FissionConfig, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionConfig), nil + } +} + +func (f fissionConfigDo) Take() (*model.FissionConfig, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionConfig), nil + } +} + +func (f fissionConfigDo) Last() (*model.FissionConfig, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionConfig), nil + } +} + +func (f fissionConfigDo) Find() ([]*model.FissionConfig, error) { + result, err := f.DO.Find() + return result.([]*model.FissionConfig), err +} + +func (f fissionConfigDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionConfig, err error) { + buf := make([]*model.FissionConfig, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionConfigDo) FindInBatches(result *[]*model.FissionConfig, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionConfigDo) Attrs(attrs ...field.AssignExpr) *fissionConfigDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionConfigDo) Assign(attrs ...field.AssignExpr) *fissionConfigDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionConfigDo) Joins(fields ...field.RelationField) *fissionConfigDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionConfigDo) Preload(fields ...field.RelationField) *fissionConfigDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionConfigDo) FirstOrInit() (*model.FissionConfig, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionConfig), nil + } +} + +func (f fissionConfigDo) FirstOrCreate() (*model.FissionConfig, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionConfig), nil + } +} + +func (f fissionConfigDo) FindByPage(offset int, limit int) (result []*model.FissionConfig, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionConfigDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionConfigDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionConfigDo) Delete(models ...*model.FissionConfig) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionConfigDo) withDO(do gen.Dao) *fissionConfigDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_custom_btn.gen.go b/internal/repository/dao/fission_custom_btn.gen.go new file mode 100644 index 0000000..8942813 --- /dev/null +++ b/internal/repository/dao/fission_custom_btn.gen.go @@ -0,0 +1,343 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionCustomBtn(db *gorm.DB, opts ...gen.DOOption) fissionCustomBtn { + _fissionCustomBtn := fissionCustomBtn{} + + _fissionCustomBtn.fissionCustomBtnDo.UseDB(db, opts...) + _fissionCustomBtn.fissionCustomBtnDo.UseModel(&model.FissionCustomBtn{}) + + tableName := _fissionCustomBtn.fissionCustomBtnDo.TableName() + _fissionCustomBtn.ALL = field.NewAsterisk(tableName) + _fissionCustomBtn.ID = field.NewInt64(tableName, "id") + _fissionCustomBtn.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionCustomBtn.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionCustomBtn.BtnText = field.NewString(tableName, "btn_text") + + _fissionCustomBtn.fillFieldMap() + + return _fissionCustomBtn +} + +type fissionCustomBtn struct { + fissionCustomBtnDo fissionCustomBtnDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + BtnText field.String // 按钮文案 + + fieldMap map[string]field.Expr +} + +func (f fissionCustomBtn) Table(newTableName string) *fissionCustomBtn { + f.fissionCustomBtnDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionCustomBtn) As(alias string) *fissionCustomBtn { + f.fissionCustomBtnDo.DO = *(f.fissionCustomBtnDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionCustomBtn) updateTableName(table string) *fissionCustomBtn { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.BtnText = field.NewString(table, "btn_text") + + f.fillFieldMap() + + return f +} + +func (f *fissionCustomBtn) WithContext(ctx context.Context) *fissionCustomBtnDo { + return f.fissionCustomBtnDo.WithContext(ctx) +} + +func (f fissionCustomBtn) TableName() string { return f.fissionCustomBtnDo.TableName() } + +func (f fissionCustomBtn) Alias() string { return f.fissionCustomBtnDo.Alias() } + +func (f *fissionCustomBtn) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionCustomBtn) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 4) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["btn_text"] = f.BtnText +} + +func (f fissionCustomBtn) clone(db *gorm.DB) fissionCustomBtn { + f.fissionCustomBtnDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionCustomBtn) replaceDB(db *gorm.DB) fissionCustomBtn { + f.fissionCustomBtnDo.ReplaceDB(db) + return f +} + +type fissionCustomBtnDo struct{ gen.DO } + +func (f fissionCustomBtnDo) Debug() *fissionCustomBtnDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionCustomBtnDo) WithContext(ctx context.Context) *fissionCustomBtnDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionCustomBtnDo) ReadDB() *fissionCustomBtnDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionCustomBtnDo) WriteDB() *fissionCustomBtnDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionCustomBtnDo) Session(config *gorm.Session) *fissionCustomBtnDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionCustomBtnDo) Clauses(conds ...clause.Expression) *fissionCustomBtnDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionCustomBtnDo) Returning(value interface{}, columns ...string) *fissionCustomBtnDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionCustomBtnDo) Not(conds ...gen.Condition) *fissionCustomBtnDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionCustomBtnDo) Or(conds ...gen.Condition) *fissionCustomBtnDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionCustomBtnDo) Select(conds ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionCustomBtnDo) Where(conds ...gen.Condition) *fissionCustomBtnDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionCustomBtnDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionCustomBtnDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionCustomBtnDo) Order(conds ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionCustomBtnDo) Distinct(cols ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionCustomBtnDo) Omit(cols ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionCustomBtnDo) Join(table schema.Tabler, on ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionCustomBtnDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionCustomBtnDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionCustomBtnDo) Group(cols ...field.Expr) *fissionCustomBtnDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionCustomBtnDo) Having(conds ...gen.Condition) *fissionCustomBtnDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionCustomBtnDo) Limit(limit int) *fissionCustomBtnDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionCustomBtnDo) Offset(offset int) *fissionCustomBtnDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionCustomBtnDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionCustomBtnDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionCustomBtnDo) Unscoped() *fissionCustomBtnDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionCustomBtnDo) Create(values ...*model.FissionCustomBtn) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionCustomBtnDo) CreateInBatches(values []*model.FissionCustomBtn, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionCustomBtnDo) Save(values ...*model.FissionCustomBtn) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionCustomBtnDo) First() (*model.FissionCustomBtn, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionCustomBtn), nil + } +} + +func (f fissionCustomBtnDo) Take() (*model.FissionCustomBtn, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionCustomBtn), nil + } +} + +func (f fissionCustomBtnDo) Last() (*model.FissionCustomBtn, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionCustomBtn), nil + } +} + +func (f fissionCustomBtnDo) Find() ([]*model.FissionCustomBtn, error) { + result, err := f.DO.Find() + return result.([]*model.FissionCustomBtn), err +} + +func (f fissionCustomBtnDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionCustomBtn, err error) { + buf := make([]*model.FissionCustomBtn, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionCustomBtnDo) FindInBatches(result *[]*model.FissionCustomBtn, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionCustomBtnDo) Attrs(attrs ...field.AssignExpr) *fissionCustomBtnDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionCustomBtnDo) Assign(attrs ...field.AssignExpr) *fissionCustomBtnDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionCustomBtnDo) Joins(fields ...field.RelationField) *fissionCustomBtnDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionCustomBtnDo) Preload(fields ...field.RelationField) *fissionCustomBtnDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionCustomBtnDo) FirstOrInit() (*model.FissionCustomBtn, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionCustomBtn), nil + } +} + +func (f fissionCustomBtnDo) FirstOrCreate() (*model.FissionCustomBtn, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionCustomBtn), nil + } +} + +func (f fissionCustomBtnDo) FindByPage(offset int, limit int) (result []*model.FissionCustomBtn, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionCustomBtnDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionCustomBtnDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionCustomBtnDo) Delete(models ...*model.FissionCustomBtn) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionCustomBtnDo) withDO(do gen.Dao) *fissionCustomBtnDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice.gen.go b/internal/repository/dao/fission_dice.gen.go new file mode 100644 index 0000000..aec2051 --- /dev/null +++ b/internal/repository/dao/fission_dice.gen.go @@ -0,0 +1,379 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDice(db *gorm.DB, opts ...gen.DOOption) fissionDice { + _fissionDice := fissionDice{} + + _fissionDice.fissionDiceDo.UseDB(db, opts...) + _fissionDice.fissionDiceDo.UseModel(&model.FissionDice{}) + + tableName := _fissionDice.fissionDiceDo.TableName() + _fissionDice.ALL = field.NewAsterisk(tableName) + _fissionDice.ID = field.NewInt64(tableName, "id") + _fissionDice.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDice.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionDice.UserID = field.NewInt64(tableName, "user_id") + _fissionDice.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDice.Chance = field.NewInt32(tableName, "chance") + _fissionDice.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionDice.DayChance = field.NewInt32(tableName, "day_chance") + _fissionDice.MapID = field.NewInt64(tableName, "map_id") + _fissionDice.LastSign = field.NewString(tableName, "last_sign") + _fissionDice.DmgID = field.NewInt64(tableName, "dmg_id") + _fissionDice.GoStep = field.NewInt64(tableName, "go_step") + _fissionDice.SetInit = field.NewInt8(tableName, "set_init") + + _fissionDice.fillFieldMap() + + return _fissionDice +} + +type fissionDice struct { + fissionDiceDo fissionDiceDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 骰子数 + TaskChance field.Int32 // 邀请达标获得的骰子数 + DayChance field.Int32 // 每日签到获得的骰子数 + MapID field.Int64 // 当前所在地图位置id + LastSign field.String // 最后签到日期 + DmgID field.Int64 // 地图组id(fission_dice_map_group表) + GoStep field.Int64 // 走过的总步数 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionDice) Table(newTableName string) *fissionDice { + f.fissionDiceDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDice) As(alias string) *fissionDice { + f.fissionDiceDo.DO = *(f.fissionDiceDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDice) updateTableName(table string) *fissionDice { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.MapID = field.NewInt64(table, "map_id") + f.LastSign = field.NewString(table, "last_sign") + f.DmgID = field.NewInt64(table, "dmg_id") + f.GoStep = field.NewInt64(table, "go_step") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionDice) WithContext(ctx context.Context) *fissionDiceDo { + return f.fissionDiceDo.WithContext(ctx) +} + +func (f fissionDice) TableName() string { return f.fissionDiceDo.TableName() } + +func (f fissionDice) Alias() string { return f.fissionDiceDo.Alias() } + +func (f *fissionDice) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDice) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 13) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["map_id"] = f.MapID + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["dmg_id"] = f.DmgID + f.fieldMap["go_step"] = f.GoStep + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionDice) clone(db *gorm.DB) fissionDice { + f.fissionDiceDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDice) replaceDB(db *gorm.DB) fissionDice { + f.fissionDiceDo.ReplaceDB(db) + return f +} + +type fissionDiceDo struct{ gen.DO } + +func (f fissionDiceDo) Debug() *fissionDiceDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDiceDo) WithContext(ctx context.Context) *fissionDiceDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDiceDo) ReadDB() *fissionDiceDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDiceDo) WriteDB() *fissionDiceDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDiceDo) Session(config *gorm.Session) *fissionDiceDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDiceDo) Clauses(conds ...clause.Expression) *fissionDiceDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDiceDo) Returning(value interface{}, columns ...string) *fissionDiceDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDiceDo) Not(conds ...gen.Condition) *fissionDiceDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDiceDo) Or(conds ...gen.Condition) *fissionDiceDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDiceDo) Select(conds ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDiceDo) Where(conds ...gen.Condition) *fissionDiceDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDiceDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDiceDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDiceDo) Order(conds ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDiceDo) Distinct(cols ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDiceDo) Omit(cols ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDiceDo) Join(table schema.Tabler, on ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDiceDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDiceDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDiceDo) Group(cols ...field.Expr) *fissionDiceDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDiceDo) Having(conds ...gen.Condition) *fissionDiceDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDiceDo) Limit(limit int) *fissionDiceDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDiceDo) Offset(offset int) *fissionDiceDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDiceDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDiceDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDiceDo) Unscoped() *fissionDiceDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDiceDo) Create(values ...*model.FissionDice) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDiceDo) CreateInBatches(values []*model.FissionDice, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDiceDo) Save(values ...*model.FissionDice) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDiceDo) First() (*model.FissionDice, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDice), nil + } +} + +func (f fissionDiceDo) Take() (*model.FissionDice, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDice), nil + } +} + +func (f fissionDiceDo) Last() (*model.FissionDice, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDice), nil + } +} + +func (f fissionDiceDo) Find() ([]*model.FissionDice, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDice), err +} + +func (f fissionDiceDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDice, err error) { + buf := make([]*model.FissionDice, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDiceDo) FindInBatches(result *[]*model.FissionDice, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDiceDo) Attrs(attrs ...field.AssignExpr) *fissionDiceDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDiceDo) Assign(attrs ...field.AssignExpr) *fissionDiceDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDiceDo) Joins(fields ...field.RelationField) *fissionDiceDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDiceDo) Preload(fields ...field.RelationField) *fissionDiceDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDiceDo) FirstOrInit() (*model.FissionDice, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDice), nil + } +} + +func (f fissionDiceDo) FirstOrCreate() (*model.FissionDice, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDice), nil + } +} + +func (f fissionDiceDo) FindByPage(offset int, limit int) (result []*model.FissionDice, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDiceDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDiceDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDiceDo) Delete(models ...*model.FissionDice) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDiceDo) withDO(do gen.Dao) *fissionDiceDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice_collect.gen.go b/internal/repository/dao/fission_dice_collect.gen.go new file mode 100644 index 0000000..c63d3a2 --- /dev/null +++ b/internal/repository/dao/fission_dice_collect.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDiceCollect(db *gorm.DB, opts ...gen.DOOption) fissionDiceCollect { + _fissionDiceCollect := fissionDiceCollect{} + + _fissionDiceCollect.fissionDiceCollectDo.UseDB(db, opts...) + _fissionDiceCollect.fissionDiceCollectDo.UseModel(&model.FissionDiceCollect{}) + + tableName := _fissionDiceCollect.fissionDiceCollectDo.TableName() + _fissionDiceCollect.ALL = field.NewAsterisk(tableName) + _fissionDiceCollect.ID = field.NewInt64(tableName, "id") + _fissionDiceCollect.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDiceCollect.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionDiceCollect.UserID = field.NewInt64(tableName, "user_id") + _fissionDiceCollect.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDiceCollect.RewardID = field.NewInt64(tableName, "reward_id") + _fissionDiceCollect.Num = field.NewInt32(tableName, "num") + _fissionDiceCollect.IntactNum = field.NewInt32(tableName, "intact_num") + _fissionDiceCollect.RecordID = field.NewInt64(tableName, "record_id") + _fissionDiceCollect.SignNum = field.NewInt32(tableName, "sign_num") + + _fissionDiceCollect.fillFieldMap() + + return _fissionDiceCollect +} + +type fissionDiceCollect struct { + fissionDiceCollectDo fissionDiceCollectDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + RewardID field.Int64 // 奖品id + Num field.Int32 // 拥有的奖品碎片数量 + IntactNum field.Int32 // 完整奖品数 + RecordID field.Int64 // 需要合成的奖品记录id(fission_reward_record表) + SignNum field.Int32 // 已经签到天数 + + fieldMap map[string]field.Expr +} + +func (f fissionDiceCollect) Table(newTableName string) *fissionDiceCollect { + f.fissionDiceCollectDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDiceCollect) As(alias string) *fissionDiceCollect { + f.fissionDiceCollectDo.DO = *(f.fissionDiceCollectDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDiceCollect) updateTableName(table string) *fissionDiceCollect { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.Num = field.NewInt32(table, "num") + f.IntactNum = field.NewInt32(table, "intact_num") + f.RecordID = field.NewInt64(table, "record_id") + f.SignNum = field.NewInt32(table, "sign_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionDiceCollect) WithContext(ctx context.Context) *fissionDiceCollectDo { + return f.fissionDiceCollectDo.WithContext(ctx) +} + +func (f fissionDiceCollect) TableName() string { return f.fissionDiceCollectDo.TableName() } + +func (f fissionDiceCollect) Alias() string { return f.fissionDiceCollectDo.Alias() } + +func (f *fissionDiceCollect) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDiceCollect) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["num"] = f.Num + f.fieldMap["intact_num"] = f.IntactNum + f.fieldMap["record_id"] = f.RecordID + f.fieldMap["sign_num"] = f.SignNum +} + +func (f fissionDiceCollect) clone(db *gorm.DB) fissionDiceCollect { + f.fissionDiceCollectDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDiceCollect) replaceDB(db *gorm.DB) fissionDiceCollect { + f.fissionDiceCollectDo.ReplaceDB(db) + return f +} + +type fissionDiceCollectDo struct{ gen.DO } + +func (f fissionDiceCollectDo) Debug() *fissionDiceCollectDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDiceCollectDo) WithContext(ctx context.Context) *fissionDiceCollectDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDiceCollectDo) ReadDB() *fissionDiceCollectDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDiceCollectDo) WriteDB() *fissionDiceCollectDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDiceCollectDo) Session(config *gorm.Session) *fissionDiceCollectDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDiceCollectDo) Clauses(conds ...clause.Expression) *fissionDiceCollectDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDiceCollectDo) Returning(value interface{}, columns ...string) *fissionDiceCollectDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDiceCollectDo) Not(conds ...gen.Condition) *fissionDiceCollectDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDiceCollectDo) Or(conds ...gen.Condition) *fissionDiceCollectDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDiceCollectDo) Select(conds ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDiceCollectDo) Where(conds ...gen.Condition) *fissionDiceCollectDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDiceCollectDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDiceCollectDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDiceCollectDo) Order(conds ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDiceCollectDo) Distinct(cols ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDiceCollectDo) Omit(cols ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDiceCollectDo) Join(table schema.Tabler, on ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDiceCollectDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDiceCollectDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDiceCollectDo) Group(cols ...field.Expr) *fissionDiceCollectDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDiceCollectDo) Having(conds ...gen.Condition) *fissionDiceCollectDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDiceCollectDo) Limit(limit int) *fissionDiceCollectDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDiceCollectDo) Offset(offset int) *fissionDiceCollectDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDiceCollectDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDiceCollectDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDiceCollectDo) Unscoped() *fissionDiceCollectDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDiceCollectDo) Create(values ...*model.FissionDiceCollect) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDiceCollectDo) CreateInBatches(values []*model.FissionDiceCollect, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDiceCollectDo) Save(values ...*model.FissionDiceCollect) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDiceCollectDo) First() (*model.FissionDiceCollect, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceCollect), nil + } +} + +func (f fissionDiceCollectDo) Take() (*model.FissionDiceCollect, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceCollect), nil + } +} + +func (f fissionDiceCollectDo) Last() (*model.FissionDiceCollect, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceCollect), nil + } +} + +func (f fissionDiceCollectDo) Find() ([]*model.FissionDiceCollect, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDiceCollect), err +} + +func (f fissionDiceCollectDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDiceCollect, err error) { + buf := make([]*model.FissionDiceCollect, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDiceCollectDo) FindInBatches(result *[]*model.FissionDiceCollect, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDiceCollectDo) Attrs(attrs ...field.AssignExpr) *fissionDiceCollectDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDiceCollectDo) Assign(attrs ...field.AssignExpr) *fissionDiceCollectDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDiceCollectDo) Joins(fields ...field.RelationField) *fissionDiceCollectDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDiceCollectDo) Preload(fields ...field.RelationField) *fissionDiceCollectDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDiceCollectDo) FirstOrInit() (*model.FissionDiceCollect, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceCollect), nil + } +} + +func (f fissionDiceCollectDo) FirstOrCreate() (*model.FissionDiceCollect, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceCollect), nil + } +} + +func (f fissionDiceCollectDo) FindByPage(offset int, limit int) (result []*model.FissionDiceCollect, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDiceCollectDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDiceCollectDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDiceCollectDo) Delete(models ...*model.FissionDiceCollect) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDiceCollectDo) withDO(do gen.Dao) *fissionDiceCollectDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice_map.gen.go b/internal/repository/dao/fission_dice_map.gen.go new file mode 100644 index 0000000..b2f1573 --- /dev/null +++ b/internal/repository/dao/fission_dice_map.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDiceMap(db *gorm.DB, opts ...gen.DOOption) fissionDiceMap { + _fissionDiceMap := fissionDiceMap{} + + _fissionDiceMap.fissionDiceMapDo.UseDB(db, opts...) + _fissionDiceMap.fissionDiceMapDo.UseModel(&model.FissionDiceMap{}) + + tableName := _fissionDiceMap.fissionDiceMapDo.TableName() + _fissionDiceMap.ALL = field.NewAsterisk(tableName) + _fissionDiceMap.ID = field.NewInt64(tableName, "id") + _fissionDiceMap.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDiceMap.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionDiceMap.HashID = field.NewString(tableName, "hash_id") + _fissionDiceMap.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDiceMap.MarkType = field.NewInt8(tableName, "mark_type") + _fissionDiceMap.RewardID = field.NewInt64(tableName, "reward_id") + _fissionDiceMap.DmgID = field.NewInt64(tableName, "dmg_id") + + _fissionDiceMap.fillFieldMap() + + return _fissionDiceMap +} + +type fissionDiceMap struct { + fissionDiceMapDo fissionDiceMapDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 对外id + CampaignID field.Int64 // 活动ID(fission_campaign表) + MarkType field.Int8 // 格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几) + RewardID field.Int64 // 奖品id + DmgID field.Int64 // 地图组id(fission_dice_map_group表) + + fieldMap map[string]field.Expr +} + +func (f fissionDiceMap) Table(newTableName string) *fissionDiceMap { + f.fissionDiceMapDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDiceMap) As(alias string) *fissionDiceMap { + f.fissionDiceMapDo.DO = *(f.fissionDiceMapDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDiceMap) updateTableName(table string) *fissionDiceMap { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.MarkType = field.NewInt8(table, "mark_type") + f.RewardID = field.NewInt64(table, "reward_id") + f.DmgID = field.NewInt64(table, "dmg_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionDiceMap) WithContext(ctx context.Context) *fissionDiceMapDo { + return f.fissionDiceMapDo.WithContext(ctx) +} + +func (f fissionDiceMap) TableName() string { return f.fissionDiceMapDo.TableName() } + +func (f fissionDiceMap) Alias() string { return f.fissionDiceMapDo.Alias() } + +func (f *fissionDiceMap) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDiceMap) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark_type"] = f.MarkType + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["dmg_id"] = f.DmgID +} + +func (f fissionDiceMap) clone(db *gorm.DB) fissionDiceMap { + f.fissionDiceMapDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDiceMap) replaceDB(db *gorm.DB) fissionDiceMap { + f.fissionDiceMapDo.ReplaceDB(db) + return f +} + +type fissionDiceMapDo struct{ gen.DO } + +func (f fissionDiceMapDo) Debug() *fissionDiceMapDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDiceMapDo) WithContext(ctx context.Context) *fissionDiceMapDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDiceMapDo) ReadDB() *fissionDiceMapDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDiceMapDo) WriteDB() *fissionDiceMapDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDiceMapDo) Session(config *gorm.Session) *fissionDiceMapDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDiceMapDo) Clauses(conds ...clause.Expression) *fissionDiceMapDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDiceMapDo) Returning(value interface{}, columns ...string) *fissionDiceMapDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDiceMapDo) Not(conds ...gen.Condition) *fissionDiceMapDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDiceMapDo) Or(conds ...gen.Condition) *fissionDiceMapDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDiceMapDo) Select(conds ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDiceMapDo) Where(conds ...gen.Condition) *fissionDiceMapDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDiceMapDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDiceMapDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDiceMapDo) Order(conds ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDiceMapDo) Distinct(cols ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDiceMapDo) Omit(cols ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDiceMapDo) Join(table schema.Tabler, on ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDiceMapDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDiceMapDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDiceMapDo) Group(cols ...field.Expr) *fissionDiceMapDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDiceMapDo) Having(conds ...gen.Condition) *fissionDiceMapDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDiceMapDo) Limit(limit int) *fissionDiceMapDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDiceMapDo) Offset(offset int) *fissionDiceMapDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDiceMapDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDiceMapDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDiceMapDo) Unscoped() *fissionDiceMapDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDiceMapDo) Create(values ...*model.FissionDiceMap) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDiceMapDo) CreateInBatches(values []*model.FissionDiceMap, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDiceMapDo) Save(values ...*model.FissionDiceMap) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDiceMapDo) First() (*model.FissionDiceMap, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMap), nil + } +} + +func (f fissionDiceMapDo) Take() (*model.FissionDiceMap, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMap), nil + } +} + +func (f fissionDiceMapDo) Last() (*model.FissionDiceMap, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMap), nil + } +} + +func (f fissionDiceMapDo) Find() ([]*model.FissionDiceMap, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDiceMap), err +} + +func (f fissionDiceMapDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDiceMap, err error) { + buf := make([]*model.FissionDiceMap, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDiceMapDo) FindInBatches(result *[]*model.FissionDiceMap, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDiceMapDo) Attrs(attrs ...field.AssignExpr) *fissionDiceMapDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDiceMapDo) Assign(attrs ...field.AssignExpr) *fissionDiceMapDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDiceMapDo) Joins(fields ...field.RelationField) *fissionDiceMapDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDiceMapDo) Preload(fields ...field.RelationField) *fissionDiceMapDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDiceMapDo) FirstOrInit() (*model.FissionDiceMap, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMap), nil + } +} + +func (f fissionDiceMapDo) FirstOrCreate() (*model.FissionDiceMap, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMap), nil + } +} + +func (f fissionDiceMapDo) FindByPage(offset int, limit int) (result []*model.FissionDiceMap, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDiceMapDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDiceMapDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDiceMapDo) Delete(models ...*model.FissionDiceMap) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDiceMapDo) withDO(do gen.Dao) *fissionDiceMapDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice_map_group.gen.go b/internal/repository/dao/fission_dice_map_group.gen.go new file mode 100644 index 0000000..f86c861 --- /dev/null +++ b/internal/repository/dao/fission_dice_map_group.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDiceMapGroup(db *gorm.DB, opts ...gen.DOOption) fissionDiceMapGroup { + _fissionDiceMapGroup := fissionDiceMapGroup{} + + _fissionDiceMapGroup.fissionDiceMapGroupDo.UseDB(db, opts...) + _fissionDiceMapGroup.fissionDiceMapGroupDo.UseModel(&model.FissionDiceMapGroup{}) + + tableName := _fissionDiceMapGroup.fissionDiceMapGroupDo.TableName() + _fissionDiceMapGroup.ALL = field.NewAsterisk(tableName) + _fissionDiceMapGroup.ID = field.NewInt64(tableName, "id") + _fissionDiceMapGroup.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDiceMapGroup.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionDiceMapGroup.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDiceMapGroup.LevelID = field.NewInt64(tableName, "level_id") + _fissionDiceMapGroup.LangMark = field.NewString(tableName, "lang_mark") + _fissionDiceMapGroup.CountryMark = field.NewString(tableName, "country_mark") + + _fissionDiceMapGroup.fillFieldMap() + + return _fissionDiceMapGroup +} + +type fissionDiceMapGroup struct { + fissionDiceMapGroupDo fissionDiceMapGroupDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + LevelID field.Int64 // 用户类型id(fission_user_level表) + LangMark field.String // 语言标识 + CountryMark field.String // 国家标识 + + fieldMap map[string]field.Expr +} + +func (f fissionDiceMapGroup) Table(newTableName string) *fissionDiceMapGroup { + f.fissionDiceMapGroupDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDiceMapGroup) As(alias string) *fissionDiceMapGroup { + f.fissionDiceMapGroupDo.DO = *(f.fissionDiceMapGroupDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDiceMapGroup) updateTableName(table string) *fissionDiceMapGroup { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.LevelID = field.NewInt64(table, "level_id") + f.LangMark = field.NewString(table, "lang_mark") + f.CountryMark = field.NewString(table, "country_mark") + + f.fillFieldMap() + + return f +} + +func (f *fissionDiceMapGroup) WithContext(ctx context.Context) *fissionDiceMapGroupDo { + return f.fissionDiceMapGroupDo.WithContext(ctx) +} + +func (f fissionDiceMapGroup) TableName() string { return f.fissionDiceMapGroupDo.TableName() } + +func (f fissionDiceMapGroup) Alias() string { return f.fissionDiceMapGroupDo.Alias() } + +func (f *fissionDiceMapGroup) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDiceMapGroup) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["level_id"] = f.LevelID + f.fieldMap["lang_mark"] = f.LangMark + f.fieldMap["country_mark"] = f.CountryMark +} + +func (f fissionDiceMapGroup) clone(db *gorm.DB) fissionDiceMapGroup { + f.fissionDiceMapGroupDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDiceMapGroup) replaceDB(db *gorm.DB) fissionDiceMapGroup { + f.fissionDiceMapGroupDo.ReplaceDB(db) + return f +} + +type fissionDiceMapGroupDo struct{ gen.DO } + +func (f fissionDiceMapGroupDo) Debug() *fissionDiceMapGroupDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDiceMapGroupDo) WithContext(ctx context.Context) *fissionDiceMapGroupDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDiceMapGroupDo) ReadDB() *fissionDiceMapGroupDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDiceMapGroupDo) WriteDB() *fissionDiceMapGroupDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDiceMapGroupDo) Session(config *gorm.Session) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDiceMapGroupDo) Clauses(conds ...clause.Expression) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDiceMapGroupDo) Returning(value interface{}, columns ...string) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDiceMapGroupDo) Not(conds ...gen.Condition) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDiceMapGroupDo) Or(conds ...gen.Condition) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDiceMapGroupDo) Select(conds ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDiceMapGroupDo) Where(conds ...gen.Condition) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDiceMapGroupDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDiceMapGroupDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDiceMapGroupDo) Order(conds ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDiceMapGroupDo) Distinct(cols ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDiceMapGroupDo) Omit(cols ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDiceMapGroupDo) Join(table schema.Tabler, on ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDiceMapGroupDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDiceMapGroupDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDiceMapGroupDo) Group(cols ...field.Expr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDiceMapGroupDo) Having(conds ...gen.Condition) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDiceMapGroupDo) Limit(limit int) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDiceMapGroupDo) Offset(offset int) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDiceMapGroupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDiceMapGroupDo) Unscoped() *fissionDiceMapGroupDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDiceMapGroupDo) Create(values ...*model.FissionDiceMapGroup) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDiceMapGroupDo) CreateInBatches(values []*model.FissionDiceMapGroup, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDiceMapGroupDo) Save(values ...*model.FissionDiceMapGroup) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDiceMapGroupDo) First() (*model.FissionDiceMapGroup, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMapGroup), nil + } +} + +func (f fissionDiceMapGroupDo) Take() (*model.FissionDiceMapGroup, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMapGroup), nil + } +} + +func (f fissionDiceMapGroupDo) Last() (*model.FissionDiceMapGroup, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMapGroup), nil + } +} + +func (f fissionDiceMapGroupDo) Find() ([]*model.FissionDiceMapGroup, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDiceMapGroup), err +} + +func (f fissionDiceMapGroupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDiceMapGroup, err error) { + buf := make([]*model.FissionDiceMapGroup, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDiceMapGroupDo) FindInBatches(result *[]*model.FissionDiceMapGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDiceMapGroupDo) Attrs(attrs ...field.AssignExpr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDiceMapGroupDo) Assign(attrs ...field.AssignExpr) *fissionDiceMapGroupDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDiceMapGroupDo) Joins(fields ...field.RelationField) *fissionDiceMapGroupDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDiceMapGroupDo) Preload(fields ...field.RelationField) *fissionDiceMapGroupDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDiceMapGroupDo) FirstOrInit() (*model.FissionDiceMapGroup, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMapGroup), nil + } +} + +func (f fissionDiceMapGroupDo) FirstOrCreate() (*model.FissionDiceMapGroup, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceMapGroup), nil + } +} + +func (f fissionDiceMapGroupDo) FindByPage(offset int, limit int) (result []*model.FissionDiceMapGroup, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDiceMapGroupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDiceMapGroupDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDiceMapGroupDo) Delete(models ...*model.FissionDiceMapGroup) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDiceMapGroupDo) withDO(do gen.Dao) *fissionDiceMapGroupDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice_props.gen.go b/internal/repository/dao/fission_dice_props.gen.go new file mode 100644 index 0000000..19885ff --- /dev/null +++ b/internal/repository/dao/fission_dice_props.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDiceProp(db *gorm.DB, opts ...gen.DOOption) fissionDiceProp { + _fissionDiceProp := fissionDiceProp{} + + _fissionDiceProp.fissionDicePropDo.UseDB(db, opts...) + _fissionDiceProp.fissionDicePropDo.UseModel(&model.FissionDiceProp{}) + + tableName := _fissionDiceProp.fissionDicePropDo.TableName() + _fissionDiceProp.ALL = field.NewAsterisk(tableName) + _fissionDiceProp.ID = field.NewInt64(tableName, "id") + _fissionDiceProp.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDiceProp.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionDiceProp.UserID = field.NewInt64(tableName, "user_id") + _fissionDiceProp.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDiceProp.Mark = field.NewString(tableName, "mark") + _fissionDiceProp.Num = field.NewInt32(tableName, "num") + _fissionDiceProp.TotalNum = field.NewInt32(tableName, "total_num") + + _fissionDiceProp.fillFieldMap() + + return _fissionDiceProp +} + +type fissionDiceProp struct { + fissionDicePropDo fissionDicePropDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Mark field.String // 道具标识(chance-再来一次,fixed_roll-固定点数) + Num field.Int32 // 道具卡数量 + TotalNum field.Int32 // 道具获得总数 + + fieldMap map[string]field.Expr +} + +func (f fissionDiceProp) Table(newTableName string) *fissionDiceProp { + f.fissionDicePropDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDiceProp) As(alias string) *fissionDiceProp { + f.fissionDicePropDo.DO = *(f.fissionDicePropDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDiceProp) updateTableName(table string) *fissionDiceProp { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.Num = field.NewInt32(table, "num") + f.TotalNum = field.NewInt32(table, "total_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionDiceProp) WithContext(ctx context.Context) *fissionDicePropDo { + return f.fissionDicePropDo.WithContext(ctx) +} + +func (f fissionDiceProp) TableName() string { return f.fissionDicePropDo.TableName() } + +func (f fissionDiceProp) Alias() string { return f.fissionDicePropDo.Alias() } + +func (f *fissionDiceProp) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDiceProp) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["num"] = f.Num + f.fieldMap["total_num"] = f.TotalNum +} + +func (f fissionDiceProp) clone(db *gorm.DB) fissionDiceProp { + f.fissionDicePropDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDiceProp) replaceDB(db *gorm.DB) fissionDiceProp { + f.fissionDicePropDo.ReplaceDB(db) + return f +} + +type fissionDicePropDo struct{ gen.DO } + +func (f fissionDicePropDo) Debug() *fissionDicePropDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDicePropDo) WithContext(ctx context.Context) *fissionDicePropDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDicePropDo) ReadDB() *fissionDicePropDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDicePropDo) WriteDB() *fissionDicePropDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDicePropDo) Session(config *gorm.Session) *fissionDicePropDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDicePropDo) Clauses(conds ...clause.Expression) *fissionDicePropDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDicePropDo) Returning(value interface{}, columns ...string) *fissionDicePropDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDicePropDo) Not(conds ...gen.Condition) *fissionDicePropDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDicePropDo) Or(conds ...gen.Condition) *fissionDicePropDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDicePropDo) Select(conds ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDicePropDo) Where(conds ...gen.Condition) *fissionDicePropDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDicePropDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDicePropDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDicePropDo) Order(conds ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDicePropDo) Distinct(cols ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDicePropDo) Omit(cols ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDicePropDo) Join(table schema.Tabler, on ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDicePropDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDicePropDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDicePropDo) Group(cols ...field.Expr) *fissionDicePropDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDicePropDo) Having(conds ...gen.Condition) *fissionDicePropDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDicePropDo) Limit(limit int) *fissionDicePropDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDicePropDo) Offset(offset int) *fissionDicePropDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDicePropDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDicePropDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDicePropDo) Unscoped() *fissionDicePropDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDicePropDo) Create(values ...*model.FissionDiceProp) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDicePropDo) CreateInBatches(values []*model.FissionDiceProp, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDicePropDo) Save(values ...*model.FissionDiceProp) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDicePropDo) First() (*model.FissionDiceProp, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceProp), nil + } +} + +func (f fissionDicePropDo) Take() (*model.FissionDiceProp, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceProp), nil + } +} + +func (f fissionDicePropDo) Last() (*model.FissionDiceProp, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceProp), nil + } +} + +func (f fissionDicePropDo) Find() ([]*model.FissionDiceProp, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDiceProp), err +} + +func (f fissionDicePropDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDiceProp, err error) { + buf := make([]*model.FissionDiceProp, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDicePropDo) FindInBatches(result *[]*model.FissionDiceProp, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDicePropDo) Attrs(attrs ...field.AssignExpr) *fissionDicePropDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDicePropDo) Assign(attrs ...field.AssignExpr) *fissionDicePropDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDicePropDo) Joins(fields ...field.RelationField) *fissionDicePropDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDicePropDo) Preload(fields ...field.RelationField) *fissionDicePropDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDicePropDo) FirstOrInit() (*model.FissionDiceProp, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceProp), nil + } +} + +func (f fissionDicePropDo) FirstOrCreate() (*model.FissionDiceProp, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceProp), nil + } +} + +func (f fissionDicePropDo) FindByPage(offset int, limit int) (result []*model.FissionDiceProp, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDicePropDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDicePropDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDicePropDo) Delete(models ...*model.FissionDiceProp) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDicePropDo) withDO(do gen.Dao) *fissionDicePropDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice_record.gen.go b/internal/repository/dao/fission_dice_record.gen.go new file mode 100644 index 0000000..6c913c5 --- /dev/null +++ b/internal/repository/dao/fission_dice_record.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDiceRecord(db *gorm.DB, opts ...gen.DOOption) fissionDiceRecord { + _fissionDiceRecord := fissionDiceRecord{} + + _fissionDiceRecord.fissionDiceRecordDo.UseDB(db, opts...) + _fissionDiceRecord.fissionDiceRecordDo.UseModel(&model.FissionDiceRecord{}) + + tableName := _fissionDiceRecord.fissionDiceRecordDo.TableName() + _fissionDiceRecord.ALL = field.NewAsterisk(tableName) + _fissionDiceRecord.ID = field.NewInt64(tableName, "id") + _fissionDiceRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDiceRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDiceRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionDiceRecord.Mark = field.NewString(tableName, "mark") + _fissionDiceRecord.Data = field.NewString(tableName, "data") + + _fissionDiceRecord.fillFieldMap() + + return _fissionDiceRecord +} + +type fissionDiceRecord struct { + fissionDiceRecordDo fissionDiceRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户id(fission_user表) + Mark field.String // 记录标识(roll-掷骰子,get_roll_sys-参与活动获得骰子,get_roll_all-完成所有任务获得骰子,get_roll_task-完成任务获得骰子,get_roll_register-完成好友注册任务获得骰子,get_roll_install-完成邀请好友下载获得骰子,roll_collect-获得碎片,roll_chance-再摇一次,lucky-使用幸运骰,lucky_chance-使用幸运骰获得再来一次,lucky_collect-使用幸运骰获得碎片,get_lucky-获得幸运骰,reward-获取奖品,sign-签到获得骰子) + Data field.String // 记录数据 + + fieldMap map[string]field.Expr +} + +func (f fissionDiceRecord) Table(newTableName string) *fissionDiceRecord { + f.fissionDiceRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDiceRecord) As(alias string) *fissionDiceRecord { + f.fissionDiceRecordDo.DO = *(f.fissionDiceRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDiceRecord) updateTableName(table string) *fissionDiceRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Mark = field.NewString(table, "mark") + f.Data = field.NewString(table, "data") + + f.fillFieldMap() + + return f +} + +func (f *fissionDiceRecord) WithContext(ctx context.Context) *fissionDiceRecordDo { + return f.fissionDiceRecordDo.WithContext(ctx) +} + +func (f fissionDiceRecord) TableName() string { return f.fissionDiceRecordDo.TableName() } + +func (f fissionDiceRecord) Alias() string { return f.fissionDiceRecordDo.Alias() } + +func (f *fissionDiceRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDiceRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["mark"] = f.Mark + f.fieldMap["data"] = f.Data +} + +func (f fissionDiceRecord) clone(db *gorm.DB) fissionDiceRecord { + f.fissionDiceRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDiceRecord) replaceDB(db *gorm.DB) fissionDiceRecord { + f.fissionDiceRecordDo.ReplaceDB(db) + return f +} + +type fissionDiceRecordDo struct{ gen.DO } + +func (f fissionDiceRecordDo) Debug() *fissionDiceRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDiceRecordDo) WithContext(ctx context.Context) *fissionDiceRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDiceRecordDo) ReadDB() *fissionDiceRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDiceRecordDo) WriteDB() *fissionDiceRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDiceRecordDo) Session(config *gorm.Session) *fissionDiceRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDiceRecordDo) Clauses(conds ...clause.Expression) *fissionDiceRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDiceRecordDo) Returning(value interface{}, columns ...string) *fissionDiceRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDiceRecordDo) Not(conds ...gen.Condition) *fissionDiceRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDiceRecordDo) Or(conds ...gen.Condition) *fissionDiceRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDiceRecordDo) Select(conds ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDiceRecordDo) Where(conds ...gen.Condition) *fissionDiceRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDiceRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDiceRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDiceRecordDo) Order(conds ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDiceRecordDo) Distinct(cols ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDiceRecordDo) Omit(cols ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDiceRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDiceRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDiceRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDiceRecordDo) Group(cols ...field.Expr) *fissionDiceRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDiceRecordDo) Having(conds ...gen.Condition) *fissionDiceRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDiceRecordDo) Limit(limit int) *fissionDiceRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDiceRecordDo) Offset(offset int) *fissionDiceRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDiceRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDiceRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDiceRecordDo) Unscoped() *fissionDiceRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDiceRecordDo) Create(values ...*model.FissionDiceRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDiceRecordDo) CreateInBatches(values []*model.FissionDiceRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDiceRecordDo) Save(values ...*model.FissionDiceRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDiceRecordDo) First() (*model.FissionDiceRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRecord), nil + } +} + +func (f fissionDiceRecordDo) Take() (*model.FissionDiceRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRecord), nil + } +} + +func (f fissionDiceRecordDo) Last() (*model.FissionDiceRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRecord), nil + } +} + +func (f fissionDiceRecordDo) Find() ([]*model.FissionDiceRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDiceRecord), err +} + +func (f fissionDiceRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDiceRecord, err error) { + buf := make([]*model.FissionDiceRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDiceRecordDo) FindInBatches(result *[]*model.FissionDiceRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDiceRecordDo) Attrs(attrs ...field.AssignExpr) *fissionDiceRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDiceRecordDo) Assign(attrs ...field.AssignExpr) *fissionDiceRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDiceRecordDo) Joins(fields ...field.RelationField) *fissionDiceRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDiceRecordDo) Preload(fields ...field.RelationField) *fissionDiceRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDiceRecordDo) FirstOrInit() (*model.FissionDiceRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRecord), nil + } +} + +func (f fissionDiceRecordDo) FirstOrCreate() (*model.FissionDiceRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRecord), nil + } +} + +func (f fissionDiceRecordDo) FindByPage(offset int, limit int) (result []*model.FissionDiceRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDiceRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDiceRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDiceRecordDo) Delete(models ...*model.FissionDiceRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDiceRecordDo) withDO(do gen.Dao) *fissionDiceRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_dice_run.gen.go b/internal/repository/dao/fission_dice_run.gen.go new file mode 100644 index 0000000..016281a --- /dev/null +++ b/internal/repository/dao/fission_dice_run.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionDiceRun(db *gorm.DB, opts ...gen.DOOption) fissionDiceRun { + _fissionDiceRun := fissionDiceRun{} + + _fissionDiceRun.fissionDiceRunDo.UseDB(db, opts...) + _fissionDiceRun.fissionDiceRunDo.UseModel(&model.FissionDiceRun{}) + + tableName := _fissionDiceRun.fissionDiceRunDo.TableName() + _fissionDiceRun.ALL = field.NewAsterisk(tableName) + _fissionDiceRun.ID = field.NewInt64(tableName, "id") + _fissionDiceRun.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionDiceRun.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionDiceRun.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionDiceRun.UserID = field.NewInt64(tableName, "user_id") + _fissionDiceRun.DmgID = field.NewInt64(tableName, "dmg_id") + _fissionDiceRun.MapID = field.NewInt64(tableName, "map_id") + _fissionDiceRun.MapHashID = field.NewString(tableName, "map_hash_id") + _fissionDiceRun.GoStep = field.NewInt64(tableName, "go_step") + + _fissionDiceRun.fillFieldMap() + + return _fissionDiceRun +} + +type fissionDiceRun struct { + fissionDiceRunDo fissionDiceRunDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + DmgID field.Int64 // 地图组id(fission_dice_map_group表) + MapID field.Int64 // 当前所在地图位置id + MapHashID field.String // 地图hash_id + GoStep field.Int64 // 当前地图走过的总步数 + + fieldMap map[string]field.Expr +} + +func (f fissionDiceRun) Table(newTableName string) *fissionDiceRun { + f.fissionDiceRunDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionDiceRun) As(alias string) *fissionDiceRun { + f.fissionDiceRunDo.DO = *(f.fissionDiceRunDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionDiceRun) updateTableName(table string) *fissionDiceRun { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.DmgID = field.NewInt64(table, "dmg_id") + f.MapID = field.NewInt64(table, "map_id") + f.MapHashID = field.NewString(table, "map_hash_id") + f.GoStep = field.NewInt64(table, "go_step") + + f.fillFieldMap() + + return f +} + +func (f *fissionDiceRun) WithContext(ctx context.Context) *fissionDiceRunDo { + return f.fissionDiceRunDo.WithContext(ctx) +} + +func (f fissionDiceRun) TableName() string { return f.fissionDiceRunDo.TableName() } + +func (f fissionDiceRun) Alias() string { return f.fissionDiceRunDo.Alias() } + +func (f *fissionDiceRun) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionDiceRun) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["dmg_id"] = f.DmgID + f.fieldMap["map_id"] = f.MapID + f.fieldMap["map_hash_id"] = f.MapHashID + f.fieldMap["go_step"] = f.GoStep +} + +func (f fissionDiceRun) clone(db *gorm.DB) fissionDiceRun { + f.fissionDiceRunDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionDiceRun) replaceDB(db *gorm.DB) fissionDiceRun { + f.fissionDiceRunDo.ReplaceDB(db) + return f +} + +type fissionDiceRunDo struct{ gen.DO } + +func (f fissionDiceRunDo) Debug() *fissionDiceRunDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionDiceRunDo) WithContext(ctx context.Context) *fissionDiceRunDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionDiceRunDo) ReadDB() *fissionDiceRunDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionDiceRunDo) WriteDB() *fissionDiceRunDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionDiceRunDo) Session(config *gorm.Session) *fissionDiceRunDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionDiceRunDo) Clauses(conds ...clause.Expression) *fissionDiceRunDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionDiceRunDo) Returning(value interface{}, columns ...string) *fissionDiceRunDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionDiceRunDo) Not(conds ...gen.Condition) *fissionDiceRunDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionDiceRunDo) Or(conds ...gen.Condition) *fissionDiceRunDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionDiceRunDo) Select(conds ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionDiceRunDo) Where(conds ...gen.Condition) *fissionDiceRunDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionDiceRunDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionDiceRunDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionDiceRunDo) Order(conds ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionDiceRunDo) Distinct(cols ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionDiceRunDo) Omit(cols ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionDiceRunDo) Join(table schema.Tabler, on ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionDiceRunDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionDiceRunDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionDiceRunDo) Group(cols ...field.Expr) *fissionDiceRunDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionDiceRunDo) Having(conds ...gen.Condition) *fissionDiceRunDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionDiceRunDo) Limit(limit int) *fissionDiceRunDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionDiceRunDo) Offset(offset int) *fissionDiceRunDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionDiceRunDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionDiceRunDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionDiceRunDo) Unscoped() *fissionDiceRunDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionDiceRunDo) Create(values ...*model.FissionDiceRun) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionDiceRunDo) CreateInBatches(values []*model.FissionDiceRun, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionDiceRunDo) Save(values ...*model.FissionDiceRun) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionDiceRunDo) First() (*model.FissionDiceRun, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRun), nil + } +} + +func (f fissionDiceRunDo) Take() (*model.FissionDiceRun, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRun), nil + } +} + +func (f fissionDiceRunDo) Last() (*model.FissionDiceRun, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRun), nil + } +} + +func (f fissionDiceRunDo) Find() ([]*model.FissionDiceRun, error) { + result, err := f.DO.Find() + return result.([]*model.FissionDiceRun), err +} + +func (f fissionDiceRunDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionDiceRun, err error) { + buf := make([]*model.FissionDiceRun, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionDiceRunDo) FindInBatches(result *[]*model.FissionDiceRun, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionDiceRunDo) Attrs(attrs ...field.AssignExpr) *fissionDiceRunDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionDiceRunDo) Assign(attrs ...field.AssignExpr) *fissionDiceRunDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionDiceRunDo) Joins(fields ...field.RelationField) *fissionDiceRunDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionDiceRunDo) Preload(fields ...field.RelationField) *fissionDiceRunDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionDiceRunDo) FirstOrInit() (*model.FissionDiceRun, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRun), nil + } +} + +func (f fissionDiceRunDo) FirstOrCreate() (*model.FissionDiceRun, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionDiceRun), nil + } +} + +func (f fissionDiceRunDo) FindByPage(offset int, limit int) (result []*model.FissionDiceRun, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionDiceRunDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionDiceRunDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionDiceRunDo) Delete(models ...*model.FissionDiceRun) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionDiceRunDo) withDO(do gen.Dao) *fissionDiceRunDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_flip.gen.go b/internal/repository/dao/fission_flip.gen.go new file mode 100644 index 0000000..62ffe3a --- /dev/null +++ b/internal/repository/dao/fission_flip.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionFlip(db *gorm.DB, opts ...gen.DOOption) fissionFlip { + _fissionFlip := fissionFlip{} + + _fissionFlip.fissionFlipDo.UseDB(db, opts...) + _fissionFlip.fissionFlipDo.UseModel(&model.FissionFlip{}) + + tableName := _fissionFlip.fissionFlipDo.TableName() + _fissionFlip.ALL = field.NewAsterisk(tableName) + _fissionFlip.ID = field.NewInt64(tableName, "id") + _fissionFlip.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionFlip.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionFlip.UserID = field.NewInt64(tableName, "user_id") + _fissionFlip.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionFlip.Chance = field.NewInt32(tableName, "chance") + _fissionFlip.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionFlip.DayChance = field.NewInt32(tableName, "day_chance") + _fissionFlip.LastSign = field.NewString(tableName, "last_sign") + _fissionFlip.SetInit = field.NewInt8(tableName, "set_init") + + _fissionFlip.fillFieldMap() + + return _fissionFlip +} + +type fissionFlip struct { + fissionFlipDo fissionFlipDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + TaskChance field.Int32 // 完成任务获取的抽奖次数 + DayChance field.Int32 // 每日签到获得的抽奖次数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionFlip) Table(newTableName string) *fissionFlip { + f.fissionFlipDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionFlip) As(alias string) *fissionFlip { + f.fissionFlipDo.DO = *(f.fissionFlipDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionFlip) updateTableName(table string) *fissionFlip { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionFlip) WithContext(ctx context.Context) *fissionFlipDo { + return f.fissionFlipDo.WithContext(ctx) +} + +func (f fissionFlip) TableName() string { return f.fissionFlipDo.TableName() } + +func (f fissionFlip) Alias() string { return f.fissionFlipDo.Alias() } + +func (f *fissionFlip) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionFlip) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionFlip) clone(db *gorm.DB) fissionFlip { + f.fissionFlipDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionFlip) replaceDB(db *gorm.DB) fissionFlip { + f.fissionFlipDo.ReplaceDB(db) + return f +} + +type fissionFlipDo struct{ gen.DO } + +func (f fissionFlipDo) Debug() *fissionFlipDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionFlipDo) WithContext(ctx context.Context) *fissionFlipDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionFlipDo) ReadDB() *fissionFlipDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionFlipDo) WriteDB() *fissionFlipDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionFlipDo) Session(config *gorm.Session) *fissionFlipDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionFlipDo) Clauses(conds ...clause.Expression) *fissionFlipDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionFlipDo) Returning(value interface{}, columns ...string) *fissionFlipDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionFlipDo) Not(conds ...gen.Condition) *fissionFlipDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionFlipDo) Or(conds ...gen.Condition) *fissionFlipDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionFlipDo) Select(conds ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionFlipDo) Where(conds ...gen.Condition) *fissionFlipDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionFlipDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionFlipDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionFlipDo) Order(conds ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionFlipDo) Distinct(cols ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionFlipDo) Omit(cols ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionFlipDo) Join(table schema.Tabler, on ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionFlipDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionFlipDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionFlipDo) Group(cols ...field.Expr) *fissionFlipDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionFlipDo) Having(conds ...gen.Condition) *fissionFlipDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionFlipDo) Limit(limit int) *fissionFlipDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionFlipDo) Offset(offset int) *fissionFlipDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionFlipDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionFlipDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionFlipDo) Unscoped() *fissionFlipDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionFlipDo) Create(values ...*model.FissionFlip) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionFlipDo) CreateInBatches(values []*model.FissionFlip, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionFlipDo) Save(values ...*model.FissionFlip) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionFlipDo) First() (*model.FissionFlip, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlip), nil + } +} + +func (f fissionFlipDo) Take() (*model.FissionFlip, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlip), nil + } +} + +func (f fissionFlipDo) Last() (*model.FissionFlip, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlip), nil + } +} + +func (f fissionFlipDo) Find() ([]*model.FissionFlip, error) { + result, err := f.DO.Find() + return result.([]*model.FissionFlip), err +} + +func (f fissionFlipDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionFlip, err error) { + buf := make([]*model.FissionFlip, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionFlipDo) FindInBatches(result *[]*model.FissionFlip, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionFlipDo) Attrs(attrs ...field.AssignExpr) *fissionFlipDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionFlipDo) Assign(attrs ...field.AssignExpr) *fissionFlipDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionFlipDo) Joins(fields ...field.RelationField) *fissionFlipDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionFlipDo) Preload(fields ...field.RelationField) *fissionFlipDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionFlipDo) FirstOrInit() (*model.FissionFlip, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlip), nil + } +} + +func (f fissionFlipDo) FirstOrCreate() (*model.FissionFlip, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlip), nil + } +} + +func (f fissionFlipDo) FindByPage(offset int, limit int) (result []*model.FissionFlip, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionFlipDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionFlipDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionFlipDo) Delete(models ...*model.FissionFlip) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionFlipDo) withDO(do gen.Dao) *fissionFlipDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_flip_log.gen.go b/internal/repository/dao/fission_flip_log.gen.go new file mode 100644 index 0000000..9d8e13b --- /dev/null +++ b/internal/repository/dao/fission_flip_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionFlipLog(db *gorm.DB, opts ...gen.DOOption) fissionFlipLog { + _fissionFlipLog := fissionFlipLog{} + + _fissionFlipLog.fissionFlipLogDo.UseDB(db, opts...) + _fissionFlipLog.fissionFlipLogDo.UseModel(&model.FissionFlipLog{}) + + tableName := _fissionFlipLog.fissionFlipLogDo.TableName() + _fissionFlipLog.ALL = field.NewAsterisk(tableName) + _fissionFlipLog.ID = field.NewInt64(tableName, "id") + _fissionFlipLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionFlipLog.UserID = field.NewInt64(tableName, "user_id") + _fissionFlipLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionFlipLog.FlipID = field.NewInt64(tableName, "flip_id") + _fissionFlipLog.Type = field.NewInt8(tableName, "type") + _fissionFlipLog.Source = field.NewString(tableName, "source") + _fissionFlipLog.Val = field.NewString(tableName, "val") + + _fissionFlipLog.fillFieldMap() + + return _fissionFlipLog +} + +type fissionFlipLog struct { + fissionFlipLogDo fissionFlipLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + FlipID field.Int64 // 玩家id(fission_flip表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionFlipLog) Table(newTableName string) *fissionFlipLog { + f.fissionFlipLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionFlipLog) As(alias string) *fissionFlipLog { + f.fissionFlipLogDo.DO = *(f.fissionFlipLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionFlipLog) updateTableName(table string) *fissionFlipLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.FlipID = field.NewInt64(table, "flip_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionFlipLog) WithContext(ctx context.Context) *fissionFlipLogDo { + return f.fissionFlipLogDo.WithContext(ctx) +} + +func (f fissionFlipLog) TableName() string { return f.fissionFlipLogDo.TableName() } + +func (f fissionFlipLog) Alias() string { return f.fissionFlipLogDo.Alias() } + +func (f *fissionFlipLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionFlipLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["flip_id"] = f.FlipID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionFlipLog) clone(db *gorm.DB) fissionFlipLog { + f.fissionFlipLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionFlipLog) replaceDB(db *gorm.DB) fissionFlipLog { + f.fissionFlipLogDo.ReplaceDB(db) + return f +} + +type fissionFlipLogDo struct{ gen.DO } + +func (f fissionFlipLogDo) Debug() *fissionFlipLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionFlipLogDo) WithContext(ctx context.Context) *fissionFlipLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionFlipLogDo) ReadDB() *fissionFlipLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionFlipLogDo) WriteDB() *fissionFlipLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionFlipLogDo) Session(config *gorm.Session) *fissionFlipLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionFlipLogDo) Clauses(conds ...clause.Expression) *fissionFlipLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionFlipLogDo) Returning(value interface{}, columns ...string) *fissionFlipLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionFlipLogDo) Not(conds ...gen.Condition) *fissionFlipLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionFlipLogDo) Or(conds ...gen.Condition) *fissionFlipLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionFlipLogDo) Select(conds ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionFlipLogDo) Where(conds ...gen.Condition) *fissionFlipLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionFlipLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionFlipLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionFlipLogDo) Order(conds ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionFlipLogDo) Distinct(cols ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionFlipLogDo) Omit(cols ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionFlipLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionFlipLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionFlipLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionFlipLogDo) Group(cols ...field.Expr) *fissionFlipLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionFlipLogDo) Having(conds ...gen.Condition) *fissionFlipLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionFlipLogDo) Limit(limit int) *fissionFlipLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionFlipLogDo) Offset(offset int) *fissionFlipLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionFlipLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionFlipLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionFlipLogDo) Unscoped() *fissionFlipLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionFlipLogDo) Create(values ...*model.FissionFlipLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionFlipLogDo) CreateInBatches(values []*model.FissionFlipLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionFlipLogDo) Save(values ...*model.FissionFlipLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionFlipLogDo) First() (*model.FissionFlipLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlipLog), nil + } +} + +func (f fissionFlipLogDo) Take() (*model.FissionFlipLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlipLog), nil + } +} + +func (f fissionFlipLogDo) Last() (*model.FissionFlipLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlipLog), nil + } +} + +func (f fissionFlipLogDo) Find() ([]*model.FissionFlipLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionFlipLog), err +} + +func (f fissionFlipLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionFlipLog, err error) { + buf := make([]*model.FissionFlipLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionFlipLogDo) FindInBatches(result *[]*model.FissionFlipLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionFlipLogDo) Attrs(attrs ...field.AssignExpr) *fissionFlipLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionFlipLogDo) Assign(attrs ...field.AssignExpr) *fissionFlipLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionFlipLogDo) Joins(fields ...field.RelationField) *fissionFlipLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionFlipLogDo) Preload(fields ...field.RelationField) *fissionFlipLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionFlipLogDo) FirstOrInit() (*model.FissionFlipLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlipLog), nil + } +} + +func (f fissionFlipLogDo) FirstOrCreate() (*model.FissionFlipLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionFlipLog), nil + } +} + +func (f fissionFlipLogDo) FindByPage(offset int, limit int) (result []*model.FissionFlipLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionFlipLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionFlipLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionFlipLogDo) Delete(models ...*model.FissionFlipLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionFlipLogDo) withDO(do gen.Dao) *fissionFlipLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_gashapon.gen.go b/internal/repository/dao/fission_gashapon.gen.go new file mode 100644 index 0000000..7565c22 --- /dev/null +++ b/internal/repository/dao/fission_gashapon.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGashapon(db *gorm.DB, opts ...gen.DOOption) fissionGashapon { + _fissionGashapon := fissionGashapon{} + + _fissionGashapon.fissionGashaponDo.UseDB(db, opts...) + _fissionGashapon.fissionGashaponDo.UseModel(&model.FissionGashapon{}) + + tableName := _fissionGashapon.fissionGashaponDo.TableName() + _fissionGashapon.ALL = field.NewAsterisk(tableName) + _fissionGashapon.ID = field.NewInt64(tableName, "id") + _fissionGashapon.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGashapon.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGashapon.UserID = field.NewInt64(tableName, "user_id") + _fissionGashapon.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGashapon.Chance = field.NewInt32(tableName, "chance") + _fissionGashapon.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionGashapon.DayChance = field.NewInt32(tableName, "day_chance") + _fissionGashapon.LastSign = field.NewString(tableName, "last_sign") + _fissionGashapon.SetInit = field.NewInt8(tableName, "set_init") + + _fissionGashapon.fillFieldMap() + + return _fissionGashapon +} + +type fissionGashapon struct { + fissionGashaponDo fissionGashaponDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + TaskChance field.Int32 // 完成任务获取的抽奖次数 + DayChance field.Int32 // 每日签到获得的抽奖次数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionGashapon) Table(newTableName string) *fissionGashapon { + f.fissionGashaponDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGashapon) As(alias string) *fissionGashapon { + f.fissionGashaponDo.DO = *(f.fissionGashaponDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGashapon) updateTableName(table string) *fissionGashapon { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionGashapon) WithContext(ctx context.Context) *fissionGashaponDo { + return f.fissionGashaponDo.WithContext(ctx) +} + +func (f fissionGashapon) TableName() string { return f.fissionGashaponDo.TableName() } + +func (f fissionGashapon) Alias() string { return f.fissionGashaponDo.Alias() } + +func (f *fissionGashapon) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGashapon) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionGashapon) clone(db *gorm.DB) fissionGashapon { + f.fissionGashaponDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGashapon) replaceDB(db *gorm.DB) fissionGashapon { + f.fissionGashaponDo.ReplaceDB(db) + return f +} + +type fissionGashaponDo struct{ gen.DO } + +func (f fissionGashaponDo) Debug() *fissionGashaponDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGashaponDo) WithContext(ctx context.Context) *fissionGashaponDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGashaponDo) ReadDB() *fissionGashaponDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGashaponDo) WriteDB() *fissionGashaponDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGashaponDo) Session(config *gorm.Session) *fissionGashaponDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGashaponDo) Clauses(conds ...clause.Expression) *fissionGashaponDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGashaponDo) Returning(value interface{}, columns ...string) *fissionGashaponDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGashaponDo) Not(conds ...gen.Condition) *fissionGashaponDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGashaponDo) Or(conds ...gen.Condition) *fissionGashaponDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGashaponDo) Select(conds ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGashaponDo) Where(conds ...gen.Condition) *fissionGashaponDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGashaponDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGashaponDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGashaponDo) Order(conds ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGashaponDo) Distinct(cols ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGashaponDo) Omit(cols ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGashaponDo) Join(table schema.Tabler, on ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGashaponDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGashaponDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGashaponDo) Group(cols ...field.Expr) *fissionGashaponDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGashaponDo) Having(conds ...gen.Condition) *fissionGashaponDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGashaponDo) Limit(limit int) *fissionGashaponDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGashaponDo) Offset(offset int) *fissionGashaponDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGashaponDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGashaponDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGashaponDo) Unscoped() *fissionGashaponDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGashaponDo) Create(values ...*model.FissionGashapon) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGashaponDo) CreateInBatches(values []*model.FissionGashapon, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGashaponDo) Save(values ...*model.FissionGashapon) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGashaponDo) First() (*model.FissionGashapon, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashapon), nil + } +} + +func (f fissionGashaponDo) Take() (*model.FissionGashapon, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashapon), nil + } +} + +func (f fissionGashaponDo) Last() (*model.FissionGashapon, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashapon), nil + } +} + +func (f fissionGashaponDo) Find() ([]*model.FissionGashapon, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGashapon), err +} + +func (f fissionGashaponDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGashapon, err error) { + buf := make([]*model.FissionGashapon, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGashaponDo) FindInBatches(result *[]*model.FissionGashapon, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGashaponDo) Attrs(attrs ...field.AssignExpr) *fissionGashaponDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGashaponDo) Assign(attrs ...field.AssignExpr) *fissionGashaponDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGashaponDo) Joins(fields ...field.RelationField) *fissionGashaponDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGashaponDo) Preload(fields ...field.RelationField) *fissionGashaponDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGashaponDo) FirstOrInit() (*model.FissionGashapon, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashapon), nil + } +} + +func (f fissionGashaponDo) FirstOrCreate() (*model.FissionGashapon, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashapon), nil + } +} + +func (f fissionGashaponDo) FindByPage(offset int, limit int) (result []*model.FissionGashapon, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGashaponDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGashaponDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGashaponDo) Delete(models ...*model.FissionGashapon) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGashaponDo) withDO(do gen.Dao) *fissionGashaponDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_gashapon_log.gen.go b/internal/repository/dao/fission_gashapon_log.gen.go new file mode 100644 index 0000000..de702ae --- /dev/null +++ b/internal/repository/dao/fission_gashapon_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGashaponLog(db *gorm.DB, opts ...gen.DOOption) fissionGashaponLog { + _fissionGashaponLog := fissionGashaponLog{} + + _fissionGashaponLog.fissionGashaponLogDo.UseDB(db, opts...) + _fissionGashaponLog.fissionGashaponLogDo.UseModel(&model.FissionGashaponLog{}) + + tableName := _fissionGashaponLog.fissionGashaponLogDo.TableName() + _fissionGashaponLog.ALL = field.NewAsterisk(tableName) + _fissionGashaponLog.ID = field.NewInt64(tableName, "id") + _fissionGashaponLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGashaponLog.UserID = field.NewInt64(tableName, "user_id") + _fissionGashaponLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGashaponLog.GashaponID = field.NewInt64(tableName, "gashapon_id") + _fissionGashaponLog.Type = field.NewInt8(tableName, "type") + _fissionGashaponLog.Source = field.NewString(tableName, "source") + _fissionGashaponLog.Val = field.NewString(tableName, "val") + + _fissionGashaponLog.fillFieldMap() + + return _fissionGashaponLog +} + +type fissionGashaponLog struct { + fissionGashaponLogDo fissionGashaponLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + GashaponID field.Int64 // 玩家id(fission_gashapon表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionGashaponLog) Table(newTableName string) *fissionGashaponLog { + f.fissionGashaponLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGashaponLog) As(alias string) *fissionGashaponLog { + f.fissionGashaponLogDo.DO = *(f.fissionGashaponLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGashaponLog) updateTableName(table string) *fissionGashaponLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.GashaponID = field.NewInt64(table, "gashapon_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionGashaponLog) WithContext(ctx context.Context) *fissionGashaponLogDo { + return f.fissionGashaponLogDo.WithContext(ctx) +} + +func (f fissionGashaponLog) TableName() string { return f.fissionGashaponLogDo.TableName() } + +func (f fissionGashaponLog) Alias() string { return f.fissionGashaponLogDo.Alias() } + +func (f *fissionGashaponLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGashaponLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["gashapon_id"] = f.GashaponID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionGashaponLog) clone(db *gorm.DB) fissionGashaponLog { + f.fissionGashaponLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGashaponLog) replaceDB(db *gorm.DB) fissionGashaponLog { + f.fissionGashaponLogDo.ReplaceDB(db) + return f +} + +type fissionGashaponLogDo struct{ gen.DO } + +func (f fissionGashaponLogDo) Debug() *fissionGashaponLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGashaponLogDo) WithContext(ctx context.Context) *fissionGashaponLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGashaponLogDo) ReadDB() *fissionGashaponLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGashaponLogDo) WriteDB() *fissionGashaponLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGashaponLogDo) Session(config *gorm.Session) *fissionGashaponLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGashaponLogDo) Clauses(conds ...clause.Expression) *fissionGashaponLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGashaponLogDo) Returning(value interface{}, columns ...string) *fissionGashaponLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGashaponLogDo) Not(conds ...gen.Condition) *fissionGashaponLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGashaponLogDo) Or(conds ...gen.Condition) *fissionGashaponLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGashaponLogDo) Select(conds ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGashaponLogDo) Where(conds ...gen.Condition) *fissionGashaponLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGashaponLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGashaponLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGashaponLogDo) Order(conds ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGashaponLogDo) Distinct(cols ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGashaponLogDo) Omit(cols ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGashaponLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGashaponLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGashaponLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGashaponLogDo) Group(cols ...field.Expr) *fissionGashaponLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGashaponLogDo) Having(conds ...gen.Condition) *fissionGashaponLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGashaponLogDo) Limit(limit int) *fissionGashaponLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGashaponLogDo) Offset(offset int) *fissionGashaponLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGashaponLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGashaponLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGashaponLogDo) Unscoped() *fissionGashaponLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGashaponLogDo) Create(values ...*model.FissionGashaponLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGashaponLogDo) CreateInBatches(values []*model.FissionGashaponLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGashaponLogDo) Save(values ...*model.FissionGashaponLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGashaponLogDo) First() (*model.FissionGashaponLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashaponLog), nil + } +} + +func (f fissionGashaponLogDo) Take() (*model.FissionGashaponLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashaponLog), nil + } +} + +func (f fissionGashaponLogDo) Last() (*model.FissionGashaponLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashaponLog), nil + } +} + +func (f fissionGashaponLogDo) Find() ([]*model.FissionGashaponLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGashaponLog), err +} + +func (f fissionGashaponLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGashaponLog, err error) { + buf := make([]*model.FissionGashaponLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGashaponLogDo) FindInBatches(result *[]*model.FissionGashaponLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGashaponLogDo) Attrs(attrs ...field.AssignExpr) *fissionGashaponLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGashaponLogDo) Assign(attrs ...field.AssignExpr) *fissionGashaponLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGashaponLogDo) Joins(fields ...field.RelationField) *fissionGashaponLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGashaponLogDo) Preload(fields ...field.RelationField) *fissionGashaponLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGashaponLogDo) FirstOrInit() (*model.FissionGashaponLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashaponLog), nil + } +} + +func (f fissionGashaponLogDo) FirstOrCreate() (*model.FissionGashaponLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGashaponLog), nil + } +} + +func (f fissionGashaponLogDo) FindByPage(offset int, limit int) (result []*model.FissionGashaponLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGashaponLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGashaponLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGashaponLogDo) Delete(models ...*model.FissionGashaponLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGashaponLogDo) withDO(do gen.Dao) *fissionGashaponLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_gold.gen.go b/internal/repository/dao/fission_gold.gen.go new file mode 100644 index 0000000..fdca2ac --- /dev/null +++ b/internal/repository/dao/fission_gold.gen.go @@ -0,0 +1,379 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGold(db *gorm.DB, opts ...gen.DOOption) fissionGold { + _fissionGold := fissionGold{} + + _fissionGold.fissionGoldDo.UseDB(db, opts...) + _fissionGold.fissionGoldDo.UseModel(&model.FissionGold{}) + + tableName := _fissionGold.fissionGoldDo.TableName() + _fissionGold.ALL = field.NewAsterisk(tableName) + _fissionGold.ID = field.NewInt64(tableName, "id") + _fissionGold.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGold.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGold.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGold.UserID = field.NewInt64(tableName, "user_id") + _fissionGold.GoldNum = field.NewInt32(tableName, "gold_num") + _fissionGold.LotteryNum = field.NewInt8(tableName, "lottery_num") + _fissionGold.NextStep = field.NewString(tableName, "next_step") + _fissionGold.Energy = field.NewInt32(tableName, "energy") + _fissionGold.ShowPrice = field.NewFloat64(tableName, "show_price") + _fissionGold.ExpiredIn = field.NewInt64(tableName, "expired_in") + _fissionGold.IsExpired = field.NewInt8(tableName, "is_expired") + _fissionGold.Lang = field.NewString(tableName, "lang") + + _fissionGold.fillFieldMap() + + return _fissionGold +} + +type fissionGold struct { + fissionGoldDo fissionGoldDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户ID(fission_user表主键) + GoldNum field.Int32 // 获得的金币数 + LotteryNum field.Int8 // 抽奖次数 + NextStep field.String // 下一节点要做的动作(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, giveaway-赠送能量,none-没有任何节点需要完成了) + Energy field.Int32 // 剩余能量数 + ShowPrice field.Float64 // 展示的金额 + ExpiredIn field.Int64 // 任务重置时间 + IsExpired field.Int8 // 任务是否已过期(0-否,1-是) + Lang field.String // 语种 + + fieldMap map[string]field.Expr +} + +func (f fissionGold) Table(newTableName string) *fissionGold { + f.fissionGoldDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGold) As(alias string) *fissionGold { + f.fissionGoldDo.DO = *(f.fissionGoldDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGold) updateTableName(table string) *fissionGold { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.GoldNum = field.NewInt32(table, "gold_num") + f.LotteryNum = field.NewInt8(table, "lottery_num") + f.NextStep = field.NewString(table, "next_step") + f.Energy = field.NewInt32(table, "energy") + f.ShowPrice = field.NewFloat64(table, "show_price") + f.ExpiredIn = field.NewInt64(table, "expired_in") + f.IsExpired = field.NewInt8(table, "is_expired") + f.Lang = field.NewString(table, "lang") + + f.fillFieldMap() + + return f +} + +func (f *fissionGold) WithContext(ctx context.Context) *fissionGoldDo { + return f.fissionGoldDo.WithContext(ctx) +} + +func (f fissionGold) TableName() string { return f.fissionGoldDo.TableName() } + +func (f fissionGold) Alias() string { return f.fissionGoldDo.Alias() } + +func (f *fissionGold) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGold) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 13) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["gold_num"] = f.GoldNum + f.fieldMap["lottery_num"] = f.LotteryNum + f.fieldMap["next_step"] = f.NextStep + f.fieldMap["energy"] = f.Energy + f.fieldMap["show_price"] = f.ShowPrice + f.fieldMap["expired_in"] = f.ExpiredIn + f.fieldMap["is_expired"] = f.IsExpired + f.fieldMap["lang"] = f.Lang +} + +func (f fissionGold) clone(db *gorm.DB) fissionGold { + f.fissionGoldDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGold) replaceDB(db *gorm.DB) fissionGold { + f.fissionGoldDo.ReplaceDB(db) + return f +} + +type fissionGoldDo struct{ gen.DO } + +func (f fissionGoldDo) Debug() *fissionGoldDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGoldDo) WithContext(ctx context.Context) *fissionGoldDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGoldDo) ReadDB() *fissionGoldDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGoldDo) WriteDB() *fissionGoldDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGoldDo) Session(config *gorm.Session) *fissionGoldDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGoldDo) Clauses(conds ...clause.Expression) *fissionGoldDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGoldDo) Returning(value interface{}, columns ...string) *fissionGoldDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGoldDo) Not(conds ...gen.Condition) *fissionGoldDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGoldDo) Or(conds ...gen.Condition) *fissionGoldDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGoldDo) Select(conds ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGoldDo) Where(conds ...gen.Condition) *fissionGoldDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGoldDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGoldDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGoldDo) Order(conds ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGoldDo) Distinct(cols ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGoldDo) Omit(cols ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGoldDo) Join(table schema.Tabler, on ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGoldDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGoldDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGoldDo) Group(cols ...field.Expr) *fissionGoldDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGoldDo) Having(conds ...gen.Condition) *fissionGoldDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGoldDo) Limit(limit int) *fissionGoldDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGoldDo) Offset(offset int) *fissionGoldDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGoldDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGoldDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGoldDo) Unscoped() *fissionGoldDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGoldDo) Create(values ...*model.FissionGold) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGoldDo) CreateInBatches(values []*model.FissionGold, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGoldDo) Save(values ...*model.FissionGold) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGoldDo) First() (*model.FissionGold, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGold), nil + } +} + +func (f fissionGoldDo) Take() (*model.FissionGold, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGold), nil + } +} + +func (f fissionGoldDo) Last() (*model.FissionGold, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGold), nil + } +} + +func (f fissionGoldDo) Find() ([]*model.FissionGold, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGold), err +} + +func (f fissionGoldDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGold, err error) { + buf := make([]*model.FissionGold, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGoldDo) FindInBatches(result *[]*model.FissionGold, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGoldDo) Attrs(attrs ...field.AssignExpr) *fissionGoldDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGoldDo) Assign(attrs ...field.AssignExpr) *fissionGoldDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGoldDo) Joins(fields ...field.RelationField) *fissionGoldDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGoldDo) Preload(fields ...field.RelationField) *fissionGoldDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGoldDo) FirstOrInit() (*model.FissionGold, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGold), nil + } +} + +func (f fissionGoldDo) FirstOrCreate() (*model.FissionGold, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGold), nil + } +} + +func (f fissionGoldDo) FindByPage(offset int, limit int) (result []*model.FissionGold, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGoldDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGoldDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGoldDo) Delete(models ...*model.FissionGold) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGoldDo) withDO(do gen.Dao) *fissionGoldDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_gold_log.gen.go b/internal/repository/dao/fission_gold_log.gen.go new file mode 100644 index 0000000..7dd88d6 --- /dev/null +++ b/internal/repository/dao/fission_gold_log.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGoldLog(db *gorm.DB, opts ...gen.DOOption) fissionGoldLog { + _fissionGoldLog := fissionGoldLog{} + + _fissionGoldLog.fissionGoldLogDo.UseDB(db, opts...) + _fissionGoldLog.fissionGoldLogDo.UseModel(&model.FissionGoldLog{}) + + tableName := _fissionGoldLog.fissionGoldLogDo.TableName() + _fissionGoldLog.ALL = field.NewAsterisk(tableName) + _fissionGoldLog.ID = field.NewInt64(tableName, "id") + _fissionGoldLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGoldLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGoldLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGoldLog.UserID = field.NewInt64(tableName, "user_id") + _fissionGoldLog.GoldID = field.NewInt64(tableName, "gold_id") + _fissionGoldLog.Type = field.NewInt8(tableName, "type") + _fissionGoldLog.Source = field.NewString(tableName, "source") + _fissionGoldLog.Val = field.NewString(tableName, "val") + + _fissionGoldLog.fillFieldMap() + + return _fissionGoldLog +} + +type fissionGoldLog struct { + fissionGoldLogDo fissionGoldLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户ID(fission_user表主键) + GoldID field.Int64 // 金币任务玩家id(fission_gold表) + Type field.Int8 // 日志类型(1-打开盒子,2-抽奖,3-完成任务,4-获得奖品) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionGoldLog) Table(newTableName string) *fissionGoldLog { + f.fissionGoldLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGoldLog) As(alias string) *fissionGoldLog { + f.fissionGoldLogDo.DO = *(f.fissionGoldLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGoldLog) updateTableName(table string) *fissionGoldLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.GoldID = field.NewInt64(table, "gold_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionGoldLog) WithContext(ctx context.Context) *fissionGoldLogDo { + return f.fissionGoldLogDo.WithContext(ctx) +} + +func (f fissionGoldLog) TableName() string { return f.fissionGoldLogDo.TableName() } + +func (f fissionGoldLog) Alias() string { return f.fissionGoldLogDo.Alias() } + +func (f *fissionGoldLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGoldLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["gold_id"] = f.GoldID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionGoldLog) clone(db *gorm.DB) fissionGoldLog { + f.fissionGoldLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGoldLog) replaceDB(db *gorm.DB) fissionGoldLog { + f.fissionGoldLogDo.ReplaceDB(db) + return f +} + +type fissionGoldLogDo struct{ gen.DO } + +func (f fissionGoldLogDo) Debug() *fissionGoldLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGoldLogDo) WithContext(ctx context.Context) *fissionGoldLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGoldLogDo) ReadDB() *fissionGoldLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGoldLogDo) WriteDB() *fissionGoldLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGoldLogDo) Session(config *gorm.Session) *fissionGoldLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGoldLogDo) Clauses(conds ...clause.Expression) *fissionGoldLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGoldLogDo) Returning(value interface{}, columns ...string) *fissionGoldLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGoldLogDo) Not(conds ...gen.Condition) *fissionGoldLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGoldLogDo) Or(conds ...gen.Condition) *fissionGoldLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGoldLogDo) Select(conds ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGoldLogDo) Where(conds ...gen.Condition) *fissionGoldLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGoldLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGoldLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGoldLogDo) Order(conds ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGoldLogDo) Distinct(cols ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGoldLogDo) Omit(cols ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGoldLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGoldLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGoldLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGoldLogDo) Group(cols ...field.Expr) *fissionGoldLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGoldLogDo) Having(conds ...gen.Condition) *fissionGoldLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGoldLogDo) Limit(limit int) *fissionGoldLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGoldLogDo) Offset(offset int) *fissionGoldLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGoldLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGoldLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGoldLogDo) Unscoped() *fissionGoldLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGoldLogDo) Create(values ...*model.FissionGoldLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGoldLogDo) CreateInBatches(values []*model.FissionGoldLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGoldLogDo) Save(values ...*model.FissionGoldLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGoldLogDo) First() (*model.FissionGoldLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGoldLog), nil + } +} + +func (f fissionGoldLogDo) Take() (*model.FissionGoldLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGoldLog), nil + } +} + +func (f fissionGoldLogDo) Last() (*model.FissionGoldLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGoldLog), nil + } +} + +func (f fissionGoldLogDo) Find() ([]*model.FissionGoldLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGoldLog), err +} + +func (f fissionGoldLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGoldLog, err error) { + buf := make([]*model.FissionGoldLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGoldLogDo) FindInBatches(result *[]*model.FissionGoldLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGoldLogDo) Attrs(attrs ...field.AssignExpr) *fissionGoldLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGoldLogDo) Assign(attrs ...field.AssignExpr) *fissionGoldLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGoldLogDo) Joins(fields ...field.RelationField) *fissionGoldLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGoldLogDo) Preload(fields ...field.RelationField) *fissionGoldLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGoldLogDo) FirstOrInit() (*model.FissionGoldLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGoldLog), nil + } +} + +func (f fissionGoldLogDo) FirstOrCreate() (*model.FissionGoldLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGoldLog), nil + } +} + +func (f fissionGoldLogDo) FindByPage(offset int, limit int) (result []*model.FissionGoldLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGoldLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGoldLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGoldLogDo) Delete(models ...*model.FissionGoldLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGoldLogDo) withDO(do gen.Dao) *fissionGoldLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_grid.gen.go b/internal/repository/dao/fission_grid.gen.go new file mode 100644 index 0000000..75e1e85 --- /dev/null +++ b/internal/repository/dao/fission_grid.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGrid(db *gorm.DB, opts ...gen.DOOption) fissionGrid { + _fissionGrid := fissionGrid{} + + _fissionGrid.fissionGridDo.UseDB(db, opts...) + _fissionGrid.fissionGridDo.UseModel(&model.FissionGrid{}) + + tableName := _fissionGrid.fissionGridDo.TableName() + _fissionGrid.ALL = field.NewAsterisk(tableName) + _fissionGrid.ID = field.NewInt64(tableName, "id") + _fissionGrid.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGrid.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGrid.IsDel = field.NewInt8(tableName, "is_del") + _fissionGrid.UserID = field.NewInt64(tableName, "user_id") + _fissionGrid.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGrid.Chance = field.NewInt32(tableName, "chance") + _fissionGrid.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionGrid.DayChance = field.NewInt32(tableName, "day_chance") + _fissionGrid.LastSign = field.NewString(tableName, "last_sign") + _fissionGrid.SetInit = field.NewInt8(tableName, "set_init") + + _fissionGrid.fillFieldMap() + + return _fissionGrid +} + +type fissionGrid struct { + fissionGridDo fissionGridDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + TaskChance field.Int32 // 完成任务获取的抽奖次数 + DayChance field.Int32 // 每日签到获得的抽奖次数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionGrid) Table(newTableName string) *fissionGrid { + f.fissionGridDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGrid) As(alias string) *fissionGrid { + f.fissionGridDo.DO = *(f.fissionGridDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGrid) updateTableName(table string) *fissionGrid { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionGrid) WithContext(ctx context.Context) *fissionGridDo { + return f.fissionGridDo.WithContext(ctx) +} + +func (f fissionGrid) TableName() string { return f.fissionGridDo.TableName() } + +func (f fissionGrid) Alias() string { return f.fissionGridDo.Alias() } + +func (f *fissionGrid) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGrid) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionGrid) clone(db *gorm.DB) fissionGrid { + f.fissionGridDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGrid) replaceDB(db *gorm.DB) fissionGrid { + f.fissionGridDo.ReplaceDB(db) + return f +} + +type fissionGridDo struct{ gen.DO } + +func (f fissionGridDo) Debug() *fissionGridDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGridDo) WithContext(ctx context.Context) *fissionGridDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGridDo) ReadDB() *fissionGridDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGridDo) WriteDB() *fissionGridDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGridDo) Session(config *gorm.Session) *fissionGridDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGridDo) Clauses(conds ...clause.Expression) *fissionGridDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGridDo) Returning(value interface{}, columns ...string) *fissionGridDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGridDo) Not(conds ...gen.Condition) *fissionGridDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGridDo) Or(conds ...gen.Condition) *fissionGridDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGridDo) Select(conds ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGridDo) Where(conds ...gen.Condition) *fissionGridDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGridDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGridDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGridDo) Order(conds ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGridDo) Distinct(cols ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGridDo) Omit(cols ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGridDo) Join(table schema.Tabler, on ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGridDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGridDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGridDo) Group(cols ...field.Expr) *fissionGridDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGridDo) Having(conds ...gen.Condition) *fissionGridDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGridDo) Limit(limit int) *fissionGridDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGridDo) Offset(offset int) *fissionGridDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGridDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGridDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGridDo) Unscoped() *fissionGridDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGridDo) Create(values ...*model.FissionGrid) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGridDo) CreateInBatches(values []*model.FissionGrid, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGridDo) Save(values ...*model.FissionGrid) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGridDo) First() (*model.FissionGrid, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrid), nil + } +} + +func (f fissionGridDo) Take() (*model.FissionGrid, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrid), nil + } +} + +func (f fissionGridDo) Last() (*model.FissionGrid, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrid), nil + } +} + +func (f fissionGridDo) Find() ([]*model.FissionGrid, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGrid), err +} + +func (f fissionGridDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGrid, err error) { + buf := make([]*model.FissionGrid, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGridDo) FindInBatches(result *[]*model.FissionGrid, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGridDo) Attrs(attrs ...field.AssignExpr) *fissionGridDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGridDo) Assign(attrs ...field.AssignExpr) *fissionGridDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGridDo) Joins(fields ...field.RelationField) *fissionGridDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGridDo) Preload(fields ...field.RelationField) *fissionGridDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGridDo) FirstOrInit() (*model.FissionGrid, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrid), nil + } +} + +func (f fissionGridDo) FirstOrCreate() (*model.FissionGrid, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrid), nil + } +} + +func (f fissionGridDo) FindByPage(offset int, limit int) (result []*model.FissionGrid, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGridDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGridDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGridDo) Delete(models ...*model.FissionGrid) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGridDo) withDO(do gen.Dao) *fissionGridDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_grid_log.gen.go b/internal/repository/dao/fission_grid_log.gen.go new file mode 100644 index 0000000..233dddd --- /dev/null +++ b/internal/repository/dao/fission_grid_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGridLog(db *gorm.DB, opts ...gen.DOOption) fissionGridLog { + _fissionGridLog := fissionGridLog{} + + _fissionGridLog.fissionGridLogDo.UseDB(db, opts...) + _fissionGridLog.fissionGridLogDo.UseModel(&model.FissionGridLog{}) + + tableName := _fissionGridLog.fissionGridLogDo.TableName() + _fissionGridLog.ALL = field.NewAsterisk(tableName) + _fissionGridLog.ID = field.NewInt64(tableName, "id") + _fissionGridLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGridLog.UserID = field.NewInt64(tableName, "user_id") + _fissionGridLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGridLog.GridID = field.NewInt64(tableName, "grid_id") + _fissionGridLog.Type = field.NewInt8(tableName, "type") + _fissionGridLog.Source = field.NewString(tableName, "source") + _fissionGridLog.Val = field.NewString(tableName, "val") + + _fissionGridLog.fillFieldMap() + + return _fissionGridLog +} + +type fissionGridLog struct { + fissionGridLogDo fissionGridLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + GridID field.Int64 // 玩家id(fission_grid表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionGridLog) Table(newTableName string) *fissionGridLog { + f.fissionGridLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGridLog) As(alias string) *fissionGridLog { + f.fissionGridLogDo.DO = *(f.fissionGridLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGridLog) updateTableName(table string) *fissionGridLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.GridID = field.NewInt64(table, "grid_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionGridLog) WithContext(ctx context.Context) *fissionGridLogDo { + return f.fissionGridLogDo.WithContext(ctx) +} + +func (f fissionGridLog) TableName() string { return f.fissionGridLogDo.TableName() } + +func (f fissionGridLog) Alias() string { return f.fissionGridLogDo.Alias() } + +func (f *fissionGridLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGridLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["grid_id"] = f.GridID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionGridLog) clone(db *gorm.DB) fissionGridLog { + f.fissionGridLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGridLog) replaceDB(db *gorm.DB) fissionGridLog { + f.fissionGridLogDo.ReplaceDB(db) + return f +} + +type fissionGridLogDo struct{ gen.DO } + +func (f fissionGridLogDo) Debug() *fissionGridLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGridLogDo) WithContext(ctx context.Context) *fissionGridLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGridLogDo) ReadDB() *fissionGridLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGridLogDo) WriteDB() *fissionGridLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGridLogDo) Session(config *gorm.Session) *fissionGridLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGridLogDo) Clauses(conds ...clause.Expression) *fissionGridLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGridLogDo) Returning(value interface{}, columns ...string) *fissionGridLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGridLogDo) Not(conds ...gen.Condition) *fissionGridLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGridLogDo) Or(conds ...gen.Condition) *fissionGridLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGridLogDo) Select(conds ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGridLogDo) Where(conds ...gen.Condition) *fissionGridLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGridLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGridLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGridLogDo) Order(conds ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGridLogDo) Distinct(cols ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGridLogDo) Omit(cols ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGridLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGridLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGridLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGridLogDo) Group(cols ...field.Expr) *fissionGridLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGridLogDo) Having(conds ...gen.Condition) *fissionGridLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGridLogDo) Limit(limit int) *fissionGridLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGridLogDo) Offset(offset int) *fissionGridLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGridLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGridLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGridLogDo) Unscoped() *fissionGridLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGridLogDo) Create(values ...*model.FissionGridLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGridLogDo) CreateInBatches(values []*model.FissionGridLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGridLogDo) Save(values ...*model.FissionGridLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGridLogDo) First() (*model.FissionGridLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGridLog), nil + } +} + +func (f fissionGridLogDo) Take() (*model.FissionGridLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGridLog), nil + } +} + +func (f fissionGridLogDo) Last() (*model.FissionGridLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGridLog), nil + } +} + +func (f fissionGridLogDo) Find() ([]*model.FissionGridLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGridLog), err +} + +func (f fissionGridLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGridLog, err error) { + buf := make([]*model.FissionGridLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGridLogDo) FindInBatches(result *[]*model.FissionGridLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGridLogDo) Attrs(attrs ...field.AssignExpr) *fissionGridLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGridLogDo) Assign(attrs ...field.AssignExpr) *fissionGridLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGridLogDo) Joins(fields ...field.RelationField) *fissionGridLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGridLogDo) Preload(fields ...field.RelationField) *fissionGridLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGridLogDo) FirstOrInit() (*model.FissionGridLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGridLog), nil + } +} + +func (f fissionGridLogDo) FirstOrCreate() (*model.FissionGridLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGridLog), nil + } +} + +func (f fissionGridLogDo) FindByPage(offset int, limit int) (result []*model.FissionGridLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGridLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGridLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGridLogDo) Delete(models ...*model.FissionGridLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGridLogDo) withDO(do gen.Dao) *fissionGridLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_grow.gen.go b/internal/repository/dao/fission_grow.gen.go new file mode 100644 index 0000000..8abbc6d --- /dev/null +++ b/internal/repository/dao/fission_grow.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGrow(db *gorm.DB, opts ...gen.DOOption) fissionGrow { + _fissionGrow := fissionGrow{} + + _fissionGrow.fissionGrowDo.UseDB(db, opts...) + _fissionGrow.fissionGrowDo.UseModel(&model.FissionGrow{}) + + tableName := _fissionGrow.fissionGrowDo.TableName() + _fissionGrow.ALL = field.NewAsterisk(tableName) + _fissionGrow.ID = field.NewInt64(tableName, "id") + _fissionGrow.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGrow.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGrow.UserID = field.NewInt64(tableName, "user_id") + _fissionGrow.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGrow.GrowNum = field.NewInt32(tableName, "grow_num") + _fissionGrow.TaskNum = field.NewInt32(tableName, "task_num") + _fissionGrow.AutoNum = field.NewInt32(tableName, "auto_num") + _fissionGrow.PropsTime = field.NewInt64(tableName, "props_time") + + _fissionGrow.fillFieldMap() + + return _fissionGrow +} + +type fissionGrow struct { + fissionGrowDo fissionGrowDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + GrowNum field.Int32 // 成长道具数量 + TaskNum field.Int32 // 邀请获得的成长道具数 + AutoNum field.Int32 // 自动生成获取的道具数 + PropsTime field.Int64 // 下次领取道具时间 + + fieldMap map[string]field.Expr +} + +func (f fissionGrow) Table(newTableName string) *fissionGrow { + f.fissionGrowDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGrow) As(alias string) *fissionGrow { + f.fissionGrowDo.DO = *(f.fissionGrowDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGrow) updateTableName(table string) *fissionGrow { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.GrowNum = field.NewInt32(table, "grow_num") + f.TaskNum = field.NewInt32(table, "task_num") + f.AutoNum = field.NewInt32(table, "auto_num") + f.PropsTime = field.NewInt64(table, "props_time") + + f.fillFieldMap() + + return f +} + +func (f *fissionGrow) WithContext(ctx context.Context) *fissionGrowDo { + return f.fissionGrowDo.WithContext(ctx) +} + +func (f fissionGrow) TableName() string { return f.fissionGrowDo.TableName() } + +func (f fissionGrow) Alias() string { return f.fissionGrowDo.Alias() } + +func (f *fissionGrow) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGrow) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["grow_num"] = f.GrowNum + f.fieldMap["task_num"] = f.TaskNum + f.fieldMap["auto_num"] = f.AutoNum + f.fieldMap["props_time"] = f.PropsTime +} + +func (f fissionGrow) clone(db *gorm.DB) fissionGrow { + f.fissionGrowDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGrow) replaceDB(db *gorm.DB) fissionGrow { + f.fissionGrowDo.ReplaceDB(db) + return f +} + +type fissionGrowDo struct{ gen.DO } + +func (f fissionGrowDo) Debug() *fissionGrowDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGrowDo) WithContext(ctx context.Context) *fissionGrowDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGrowDo) ReadDB() *fissionGrowDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGrowDo) WriteDB() *fissionGrowDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGrowDo) Session(config *gorm.Session) *fissionGrowDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGrowDo) Clauses(conds ...clause.Expression) *fissionGrowDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGrowDo) Returning(value interface{}, columns ...string) *fissionGrowDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGrowDo) Not(conds ...gen.Condition) *fissionGrowDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGrowDo) Or(conds ...gen.Condition) *fissionGrowDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGrowDo) Select(conds ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGrowDo) Where(conds ...gen.Condition) *fissionGrowDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGrowDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGrowDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGrowDo) Order(conds ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGrowDo) Distinct(cols ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGrowDo) Omit(cols ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGrowDo) Join(table schema.Tabler, on ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGrowDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGrowDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGrowDo) Group(cols ...field.Expr) *fissionGrowDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGrowDo) Having(conds ...gen.Condition) *fissionGrowDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGrowDo) Limit(limit int) *fissionGrowDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGrowDo) Offset(offset int) *fissionGrowDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGrowDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGrowDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGrowDo) Unscoped() *fissionGrowDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGrowDo) Create(values ...*model.FissionGrow) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGrowDo) CreateInBatches(values []*model.FissionGrow, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGrowDo) Save(values ...*model.FissionGrow) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGrowDo) First() (*model.FissionGrow, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrow), nil + } +} + +func (f fissionGrowDo) Take() (*model.FissionGrow, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrow), nil + } +} + +func (f fissionGrowDo) Last() (*model.FissionGrow, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrow), nil + } +} + +func (f fissionGrowDo) Find() ([]*model.FissionGrow, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGrow), err +} + +func (f fissionGrowDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGrow, err error) { + buf := make([]*model.FissionGrow, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGrowDo) FindInBatches(result *[]*model.FissionGrow, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGrowDo) Attrs(attrs ...field.AssignExpr) *fissionGrowDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGrowDo) Assign(attrs ...field.AssignExpr) *fissionGrowDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGrowDo) Joins(fields ...field.RelationField) *fissionGrowDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGrowDo) Preload(fields ...field.RelationField) *fissionGrowDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGrowDo) FirstOrInit() (*model.FissionGrow, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrow), nil + } +} + +func (f fissionGrowDo) FirstOrCreate() (*model.FissionGrow, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrow), nil + } +} + +func (f fissionGrowDo) FindByPage(offset int, limit int) (result []*model.FissionGrow, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGrowDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGrowDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGrowDo) Delete(models ...*model.FissionGrow) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGrowDo) withDO(do gen.Dao) *fissionGrowDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_grow_life.gen.go b/internal/repository/dao/fission_grow_life.gen.go new file mode 100644 index 0000000..d75e7d6 --- /dev/null +++ b/internal/repository/dao/fission_grow_life.gen.go @@ -0,0 +1,379 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGrowLife(db *gorm.DB, opts ...gen.DOOption) fissionGrowLife { + _fissionGrowLife := fissionGrowLife{} + + _fissionGrowLife.fissionGrowLifeDo.UseDB(db, opts...) + _fissionGrowLife.fissionGrowLifeDo.UseModel(&model.FissionGrowLife{}) + + tableName := _fissionGrowLife.fissionGrowLifeDo.TableName() + _fissionGrowLife.ALL = field.NewAsterisk(tableName) + _fissionGrowLife.ID = field.NewInt64(tableName, "id") + _fissionGrowLife.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGrowLife.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGrowLife.UserID = field.NewInt64(tableName, "user_id") + _fissionGrowLife.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGrowLife.Title = field.NewString(tableName, "title") + _fissionGrowLife.Num = field.NewInt32(tableName, "num") + _fissionGrowLife.Step = field.NewInt32(tableName, "step") + _fissionGrowLife.DieTime = field.NewInt64(tableName, "die_time") + _fissionGrowLife.IsGrow = field.NewInt8(tableName, "is_grow") + _fissionGrowLife.IsDie = field.NewInt8(tableName, "is_die") + _fissionGrowLife.RewardID = field.NewInt64(tableName, "reward_id") + _fissionGrowLife.RecordID = field.NewInt64(tableName, "record_id") + + _fissionGrowLife.fillFieldMap() + + return _fissionGrowLife +} + +type fissionGrowLife struct { + fissionGrowLifeDo fissionGrowLifeDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Title field.String // 名称 + Num field.Int32 // 成长道具数量 + Step field.Int32 // 等级 + DieTime field.Int64 // 死亡时间 + IsGrow field.Int8 // 是否当前种植(1-是,0-否) + IsDie field.Int8 // 是否已死亡 + RewardID field.Int64 // 对应的奖品id(fission_campaign_reward表) + RecordID field.Int64 // 奖品记录id(fission_reward_record表) + + fieldMap map[string]field.Expr +} + +func (f fissionGrowLife) Table(newTableName string) *fissionGrowLife { + f.fissionGrowLifeDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGrowLife) As(alias string) *fissionGrowLife { + f.fissionGrowLifeDo.DO = *(f.fissionGrowLifeDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGrowLife) updateTableName(table string) *fissionGrowLife { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Title = field.NewString(table, "title") + f.Num = field.NewInt32(table, "num") + f.Step = field.NewInt32(table, "step") + f.DieTime = field.NewInt64(table, "die_time") + f.IsGrow = field.NewInt8(table, "is_grow") + f.IsDie = field.NewInt8(table, "is_die") + f.RewardID = field.NewInt64(table, "reward_id") + f.RecordID = field.NewInt64(table, "record_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionGrowLife) WithContext(ctx context.Context) *fissionGrowLifeDo { + return f.fissionGrowLifeDo.WithContext(ctx) +} + +func (f fissionGrowLife) TableName() string { return f.fissionGrowLifeDo.TableName() } + +func (f fissionGrowLife) Alias() string { return f.fissionGrowLifeDo.Alias() } + +func (f *fissionGrowLife) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGrowLife) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 13) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["title"] = f.Title + f.fieldMap["num"] = f.Num + f.fieldMap["step"] = f.Step + f.fieldMap["die_time"] = f.DieTime + f.fieldMap["is_grow"] = f.IsGrow + f.fieldMap["is_die"] = f.IsDie + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["record_id"] = f.RecordID +} + +func (f fissionGrowLife) clone(db *gorm.DB) fissionGrowLife { + f.fissionGrowLifeDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGrowLife) replaceDB(db *gorm.DB) fissionGrowLife { + f.fissionGrowLifeDo.ReplaceDB(db) + return f +} + +type fissionGrowLifeDo struct{ gen.DO } + +func (f fissionGrowLifeDo) Debug() *fissionGrowLifeDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGrowLifeDo) WithContext(ctx context.Context) *fissionGrowLifeDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGrowLifeDo) ReadDB() *fissionGrowLifeDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGrowLifeDo) WriteDB() *fissionGrowLifeDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGrowLifeDo) Session(config *gorm.Session) *fissionGrowLifeDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGrowLifeDo) Clauses(conds ...clause.Expression) *fissionGrowLifeDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGrowLifeDo) Returning(value interface{}, columns ...string) *fissionGrowLifeDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGrowLifeDo) Not(conds ...gen.Condition) *fissionGrowLifeDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGrowLifeDo) Or(conds ...gen.Condition) *fissionGrowLifeDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGrowLifeDo) Select(conds ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGrowLifeDo) Where(conds ...gen.Condition) *fissionGrowLifeDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGrowLifeDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGrowLifeDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGrowLifeDo) Order(conds ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGrowLifeDo) Distinct(cols ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGrowLifeDo) Omit(cols ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGrowLifeDo) Join(table schema.Tabler, on ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGrowLifeDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGrowLifeDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGrowLifeDo) Group(cols ...field.Expr) *fissionGrowLifeDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGrowLifeDo) Having(conds ...gen.Condition) *fissionGrowLifeDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGrowLifeDo) Limit(limit int) *fissionGrowLifeDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGrowLifeDo) Offset(offset int) *fissionGrowLifeDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGrowLifeDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGrowLifeDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGrowLifeDo) Unscoped() *fissionGrowLifeDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGrowLifeDo) Create(values ...*model.FissionGrowLife) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGrowLifeDo) CreateInBatches(values []*model.FissionGrowLife, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGrowLifeDo) Save(values ...*model.FissionGrowLife) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGrowLifeDo) First() (*model.FissionGrowLife, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowLife), nil + } +} + +func (f fissionGrowLifeDo) Take() (*model.FissionGrowLife, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowLife), nil + } +} + +func (f fissionGrowLifeDo) Last() (*model.FissionGrowLife, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowLife), nil + } +} + +func (f fissionGrowLifeDo) Find() ([]*model.FissionGrowLife, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGrowLife), err +} + +func (f fissionGrowLifeDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGrowLife, err error) { + buf := make([]*model.FissionGrowLife, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGrowLifeDo) FindInBatches(result *[]*model.FissionGrowLife, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGrowLifeDo) Attrs(attrs ...field.AssignExpr) *fissionGrowLifeDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGrowLifeDo) Assign(attrs ...field.AssignExpr) *fissionGrowLifeDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGrowLifeDo) Joins(fields ...field.RelationField) *fissionGrowLifeDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGrowLifeDo) Preload(fields ...field.RelationField) *fissionGrowLifeDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGrowLifeDo) FirstOrInit() (*model.FissionGrowLife, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowLife), nil + } +} + +func (f fissionGrowLifeDo) FirstOrCreate() (*model.FissionGrowLife, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowLife), nil + } +} + +func (f fissionGrowLifeDo) FindByPage(offset int, limit int) (result []*model.FissionGrowLife, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGrowLifeDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGrowLifeDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGrowLifeDo) Delete(models ...*model.FissionGrowLife) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGrowLifeDo) withDO(do gen.Dao) *fissionGrowLifeDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_grow_record.gen.go b/internal/repository/dao/fission_grow_record.gen.go new file mode 100644 index 0000000..3edb1bd --- /dev/null +++ b/internal/repository/dao/fission_grow_record.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionGrowRecord(db *gorm.DB, opts ...gen.DOOption) fissionGrowRecord { + _fissionGrowRecord := fissionGrowRecord{} + + _fissionGrowRecord.fissionGrowRecordDo.UseDB(db, opts...) + _fissionGrowRecord.fissionGrowRecordDo.UseModel(&model.FissionGrowRecord{}) + + tableName := _fissionGrowRecord.fissionGrowRecordDo.TableName() + _fissionGrowRecord.ALL = field.NewAsterisk(tableName) + _fissionGrowRecord.ID = field.NewInt64(tableName, "id") + _fissionGrowRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionGrowRecord.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionGrowRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionGrowRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionGrowRecord.Mark = field.NewString(tableName, "mark") + _fissionGrowRecord.VarData = field.NewString(tableName, "var_data") + + _fissionGrowRecord.fillFieldMap() + + return _fissionGrowRecord +} + +type fissionGrowRecord struct { + fissionGrowRecordDo fissionGrowRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Mark field.String // 记录数据标识 + VarData field.String // 变量数据 + + fieldMap map[string]field.Expr +} + +func (f fissionGrowRecord) Table(newTableName string) *fissionGrowRecord { + f.fissionGrowRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionGrowRecord) As(alias string) *fissionGrowRecord { + f.fissionGrowRecordDo.DO = *(f.fissionGrowRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionGrowRecord) updateTableName(table string) *fissionGrowRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.VarData = field.NewString(table, "var_data") + + f.fillFieldMap() + + return f +} + +func (f *fissionGrowRecord) WithContext(ctx context.Context) *fissionGrowRecordDo { + return f.fissionGrowRecordDo.WithContext(ctx) +} + +func (f fissionGrowRecord) TableName() string { return f.fissionGrowRecordDo.TableName() } + +func (f fissionGrowRecord) Alias() string { return f.fissionGrowRecordDo.Alias() } + +func (f *fissionGrowRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionGrowRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["var_data"] = f.VarData +} + +func (f fissionGrowRecord) clone(db *gorm.DB) fissionGrowRecord { + f.fissionGrowRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionGrowRecord) replaceDB(db *gorm.DB) fissionGrowRecord { + f.fissionGrowRecordDo.ReplaceDB(db) + return f +} + +type fissionGrowRecordDo struct{ gen.DO } + +func (f fissionGrowRecordDo) Debug() *fissionGrowRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionGrowRecordDo) WithContext(ctx context.Context) *fissionGrowRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionGrowRecordDo) ReadDB() *fissionGrowRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionGrowRecordDo) WriteDB() *fissionGrowRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionGrowRecordDo) Session(config *gorm.Session) *fissionGrowRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionGrowRecordDo) Clauses(conds ...clause.Expression) *fissionGrowRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionGrowRecordDo) Returning(value interface{}, columns ...string) *fissionGrowRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionGrowRecordDo) Not(conds ...gen.Condition) *fissionGrowRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionGrowRecordDo) Or(conds ...gen.Condition) *fissionGrowRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionGrowRecordDo) Select(conds ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionGrowRecordDo) Where(conds ...gen.Condition) *fissionGrowRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionGrowRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionGrowRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionGrowRecordDo) Order(conds ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionGrowRecordDo) Distinct(cols ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionGrowRecordDo) Omit(cols ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionGrowRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionGrowRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionGrowRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionGrowRecordDo) Group(cols ...field.Expr) *fissionGrowRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionGrowRecordDo) Having(conds ...gen.Condition) *fissionGrowRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionGrowRecordDo) Limit(limit int) *fissionGrowRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionGrowRecordDo) Offset(offset int) *fissionGrowRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionGrowRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionGrowRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionGrowRecordDo) Unscoped() *fissionGrowRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionGrowRecordDo) Create(values ...*model.FissionGrowRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionGrowRecordDo) CreateInBatches(values []*model.FissionGrowRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionGrowRecordDo) Save(values ...*model.FissionGrowRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionGrowRecordDo) First() (*model.FissionGrowRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowRecord), nil + } +} + +func (f fissionGrowRecordDo) Take() (*model.FissionGrowRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowRecord), nil + } +} + +func (f fissionGrowRecordDo) Last() (*model.FissionGrowRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowRecord), nil + } +} + +func (f fissionGrowRecordDo) Find() ([]*model.FissionGrowRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionGrowRecord), err +} + +func (f fissionGrowRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionGrowRecord, err error) { + buf := make([]*model.FissionGrowRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionGrowRecordDo) FindInBatches(result *[]*model.FissionGrowRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionGrowRecordDo) Attrs(attrs ...field.AssignExpr) *fissionGrowRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionGrowRecordDo) Assign(attrs ...field.AssignExpr) *fissionGrowRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionGrowRecordDo) Joins(fields ...field.RelationField) *fissionGrowRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionGrowRecordDo) Preload(fields ...field.RelationField) *fissionGrowRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionGrowRecordDo) FirstOrInit() (*model.FissionGrowRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowRecord), nil + } +} + +func (f fissionGrowRecordDo) FirstOrCreate() (*model.FissionGrowRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionGrowRecord), nil + } +} + +func (f fissionGrowRecordDo) FindByPage(offset int, limit int) (result []*model.FissionGrowRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionGrowRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionGrowRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionGrowRecordDo) Delete(models ...*model.FissionGrowRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionGrowRecordDo) withDO(do gen.Dao) *fissionGrowRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_keep.gen.go b/internal/repository/dao/fission_keep.gen.go new file mode 100644 index 0000000..116006c --- /dev/null +++ b/internal/repository/dao/fission_keep.gen.go @@ -0,0 +1,407 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionKeep(db *gorm.DB, opts ...gen.DOOption) fissionKeep { + _fissionKeep := fissionKeep{} + + _fissionKeep.fissionKeepDo.UseDB(db, opts...) + _fissionKeep.fissionKeepDo.UseModel(&model.FissionKeep{}) + + tableName := _fissionKeep.fissionKeepDo.TableName() + _fissionKeep.ALL = field.NewAsterisk(tableName) + _fissionKeep.ID = field.NewInt64(tableName, "id") + _fissionKeep.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionKeep.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionKeep.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionKeep.UserID = field.NewInt64(tableName, "user_id") + _fissionKeep.Num = field.NewInt32(tableName, "num") + _fissionKeep.MachineNum = field.NewFloat64(tableName, "machine_num") + _fissionKeep.CollectNum = field.NewInt32(tableName, "collect_num") + _fissionKeep.Collect = field.NewInt32(tableName, "collect") + _fissionKeep.SecondNum = field.NewInt32(tableName, "second_num") + _fissionKeep.RewardID = field.NewInt64(tableName, "reward_id") + _fissionKeep.RecordID = field.NewInt64(tableName, "record_id") + _fissionKeep.FeedGetAt = field.NewInt64(tableName, "feed_get_at") + _fissionKeep.Step = field.NewInt32(tableName, "step") + _fissionKeep.ExpiredAt = field.NewInt64(tableName, "expired_at") + _fissionKeep.Guided = field.NewInt8(tableName, "guided") + _fissionKeep.InviteLimit = field.NewInt8(tableName, "invite_limit") + _fissionKeep.ReselectAt = field.NewInt64(tableName, "reselect_at") + _fissionKeep.CancelReward = field.NewInt8(tableName, "cancel_reward") + _fissionKeep.ReceiveOffline = field.NewInt64(tableName, "receive_offline") + + _fissionKeep.fillFieldMap() + + return _fissionKeep +} + +type fissionKeep struct { + fissionKeepDo fissionKeepDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户id + Num field.Int32 // 剩余总道具数 + MachineNum field.Float64 // 机器产生的道具数 + CollectNum field.Int32 // 获得的总一级道具数量 + Collect field.Int32 // 可收集的一级道具数量 + SecondNum field.Int32 // 收集的二级道具数量 + RewardID field.Int64 // 选择的奖品id(fission_campaign_reward表) + RecordID field.Int64 // 选择奖品的获奖记录id(fission_reward_record表) + FeedGetAt field.Int64 // 最后一次获喂养道具的时间 + Step field.Int32 // 养成阶段 + ExpiredAt field.Int64 // 过期时间戳(单位:s) + Guided field.Int8 // 是否已经进行了引导 + InviteLimit field.Int8 // 是否达到邀请上限(0-否,1-是) + ReselectAt field.Int64 // 重新下一个奖品时间 + CancelReward field.Int8 // 是否取消了奖品(0-否,1-是) + ReceiveOffline field.Int64 // 最近一次领取离线狗粮时间 + + fieldMap map[string]field.Expr +} + +func (f fissionKeep) Table(newTableName string) *fissionKeep { + f.fissionKeepDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionKeep) As(alias string) *fissionKeep { + f.fissionKeepDo.DO = *(f.fissionKeepDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionKeep) updateTableName(table string) *fissionKeep { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Num = field.NewInt32(table, "num") + f.MachineNum = field.NewFloat64(table, "machine_num") + f.CollectNum = field.NewInt32(table, "collect_num") + f.Collect = field.NewInt32(table, "collect") + f.SecondNum = field.NewInt32(table, "second_num") + f.RewardID = field.NewInt64(table, "reward_id") + f.RecordID = field.NewInt64(table, "record_id") + f.FeedGetAt = field.NewInt64(table, "feed_get_at") + f.Step = field.NewInt32(table, "step") + f.ExpiredAt = field.NewInt64(table, "expired_at") + f.Guided = field.NewInt8(table, "guided") + f.InviteLimit = field.NewInt8(table, "invite_limit") + f.ReselectAt = field.NewInt64(table, "reselect_at") + f.CancelReward = field.NewInt8(table, "cancel_reward") + f.ReceiveOffline = field.NewInt64(table, "receive_offline") + + f.fillFieldMap() + + return f +} + +func (f *fissionKeep) WithContext(ctx context.Context) *fissionKeepDo { + return f.fissionKeepDo.WithContext(ctx) +} + +func (f fissionKeep) TableName() string { return f.fissionKeepDo.TableName() } + +func (f fissionKeep) Alias() string { return f.fissionKeepDo.Alias() } + +func (f *fissionKeep) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionKeep) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 20) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["num"] = f.Num + f.fieldMap["machine_num"] = f.MachineNum + f.fieldMap["collect_num"] = f.CollectNum + f.fieldMap["collect"] = f.Collect + f.fieldMap["second_num"] = f.SecondNum + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["record_id"] = f.RecordID + f.fieldMap["feed_get_at"] = f.FeedGetAt + f.fieldMap["step"] = f.Step + f.fieldMap["expired_at"] = f.ExpiredAt + f.fieldMap["guided"] = f.Guided + f.fieldMap["invite_limit"] = f.InviteLimit + f.fieldMap["reselect_at"] = f.ReselectAt + f.fieldMap["cancel_reward"] = f.CancelReward + f.fieldMap["receive_offline"] = f.ReceiveOffline +} + +func (f fissionKeep) clone(db *gorm.DB) fissionKeep { + f.fissionKeepDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionKeep) replaceDB(db *gorm.DB) fissionKeep { + f.fissionKeepDo.ReplaceDB(db) + return f +} + +type fissionKeepDo struct{ gen.DO } + +func (f fissionKeepDo) Debug() *fissionKeepDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionKeepDo) WithContext(ctx context.Context) *fissionKeepDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionKeepDo) ReadDB() *fissionKeepDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionKeepDo) WriteDB() *fissionKeepDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionKeepDo) Session(config *gorm.Session) *fissionKeepDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionKeepDo) Clauses(conds ...clause.Expression) *fissionKeepDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionKeepDo) Returning(value interface{}, columns ...string) *fissionKeepDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionKeepDo) Not(conds ...gen.Condition) *fissionKeepDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionKeepDo) Or(conds ...gen.Condition) *fissionKeepDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionKeepDo) Select(conds ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionKeepDo) Where(conds ...gen.Condition) *fissionKeepDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionKeepDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionKeepDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionKeepDo) Order(conds ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionKeepDo) Distinct(cols ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionKeepDo) Omit(cols ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionKeepDo) Join(table schema.Tabler, on ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionKeepDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionKeepDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionKeepDo) Group(cols ...field.Expr) *fissionKeepDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionKeepDo) Having(conds ...gen.Condition) *fissionKeepDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionKeepDo) Limit(limit int) *fissionKeepDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionKeepDo) Offset(offset int) *fissionKeepDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionKeepDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionKeepDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionKeepDo) Unscoped() *fissionKeepDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionKeepDo) Create(values ...*model.FissionKeep) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionKeepDo) CreateInBatches(values []*model.FissionKeep, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionKeepDo) Save(values ...*model.FissionKeep) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionKeepDo) First() (*model.FissionKeep, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeep), nil + } +} + +func (f fissionKeepDo) Take() (*model.FissionKeep, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeep), nil + } +} + +func (f fissionKeepDo) Last() (*model.FissionKeep, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeep), nil + } +} + +func (f fissionKeepDo) Find() ([]*model.FissionKeep, error) { + result, err := f.DO.Find() + return result.([]*model.FissionKeep), err +} + +func (f fissionKeepDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionKeep, err error) { + buf := make([]*model.FissionKeep, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionKeepDo) FindInBatches(result *[]*model.FissionKeep, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionKeepDo) Attrs(attrs ...field.AssignExpr) *fissionKeepDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionKeepDo) Assign(attrs ...field.AssignExpr) *fissionKeepDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionKeepDo) Joins(fields ...field.RelationField) *fissionKeepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionKeepDo) Preload(fields ...field.RelationField) *fissionKeepDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionKeepDo) FirstOrInit() (*model.FissionKeep, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeep), nil + } +} + +func (f fissionKeepDo) FirstOrCreate() (*model.FissionKeep, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeep), nil + } +} + +func (f fissionKeepDo) FindByPage(offset int, limit int) (result []*model.FissionKeep, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionKeepDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionKeepDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionKeepDo) Delete(models ...*model.FissionKeep) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionKeepDo) withDO(do gen.Dao) *fissionKeepDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_keep_log.gen.go b/internal/repository/dao/fission_keep_log.gen.go new file mode 100644 index 0000000..f59afcf --- /dev/null +++ b/internal/repository/dao/fission_keep_log.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionKeepLog(db *gorm.DB, opts ...gen.DOOption) fissionKeepLog { + _fissionKeepLog := fissionKeepLog{} + + _fissionKeepLog.fissionKeepLogDo.UseDB(db, opts...) + _fissionKeepLog.fissionKeepLogDo.UseModel(&model.FissionKeepLog{}) + + tableName := _fissionKeepLog.fissionKeepLogDo.TableName() + _fissionKeepLog.ALL = field.NewAsterisk(tableName) + _fissionKeepLog.ID = field.NewInt64(tableName, "id") + _fissionKeepLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionKeepLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionKeepLog.UserID = field.NewInt64(tableName, "user_id") + _fissionKeepLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionKeepLog.KeepID = field.NewInt64(tableName, "keep_id") + _fissionKeepLog.Type = field.NewInt8(tableName, "type") + _fissionKeepLog.Source = field.NewString(tableName, "source") + _fissionKeepLog.Val = field.NewString(tableName, "val") + _fissionKeepLog.ValSource = field.NewString(tableName, "val_source") + + _fissionKeepLog.fillFieldMap() + + return _fissionKeepLog +} + +type fissionKeepLog struct { + fissionKeepLogDo fissionKeepLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + KeepID field.Int64 // 玩家id(fission_keep表id) + Type field.Int8 // 日志类型(1-收集爱心,2-获得狗粮,3-喂养狗粮) + Source field.String // 来源标识 + Val field.String // 展示的数值 + ValSource field.String // 数据追溯参数 + + fieldMap map[string]field.Expr +} + +func (f fissionKeepLog) Table(newTableName string) *fissionKeepLog { + f.fissionKeepLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionKeepLog) As(alias string) *fissionKeepLog { + f.fissionKeepLogDo.DO = *(f.fissionKeepLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionKeepLog) updateTableName(table string) *fissionKeepLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.KeepID = field.NewInt64(table, "keep_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + f.ValSource = field.NewString(table, "val_source") + + f.fillFieldMap() + + return f +} + +func (f *fissionKeepLog) WithContext(ctx context.Context) *fissionKeepLogDo { + return f.fissionKeepLogDo.WithContext(ctx) +} + +func (f fissionKeepLog) TableName() string { return f.fissionKeepLogDo.TableName() } + +func (f fissionKeepLog) Alias() string { return f.fissionKeepLogDo.Alias() } + +func (f *fissionKeepLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionKeepLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["keep_id"] = f.KeepID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val + f.fieldMap["val_source"] = f.ValSource +} + +func (f fissionKeepLog) clone(db *gorm.DB) fissionKeepLog { + f.fissionKeepLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionKeepLog) replaceDB(db *gorm.DB) fissionKeepLog { + f.fissionKeepLogDo.ReplaceDB(db) + return f +} + +type fissionKeepLogDo struct{ gen.DO } + +func (f fissionKeepLogDo) Debug() *fissionKeepLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionKeepLogDo) WithContext(ctx context.Context) *fissionKeepLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionKeepLogDo) ReadDB() *fissionKeepLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionKeepLogDo) WriteDB() *fissionKeepLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionKeepLogDo) Session(config *gorm.Session) *fissionKeepLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionKeepLogDo) Clauses(conds ...clause.Expression) *fissionKeepLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionKeepLogDo) Returning(value interface{}, columns ...string) *fissionKeepLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionKeepLogDo) Not(conds ...gen.Condition) *fissionKeepLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionKeepLogDo) Or(conds ...gen.Condition) *fissionKeepLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionKeepLogDo) Select(conds ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionKeepLogDo) Where(conds ...gen.Condition) *fissionKeepLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionKeepLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionKeepLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionKeepLogDo) Order(conds ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionKeepLogDo) Distinct(cols ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionKeepLogDo) Omit(cols ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionKeepLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionKeepLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionKeepLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionKeepLogDo) Group(cols ...field.Expr) *fissionKeepLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionKeepLogDo) Having(conds ...gen.Condition) *fissionKeepLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionKeepLogDo) Limit(limit int) *fissionKeepLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionKeepLogDo) Offset(offset int) *fissionKeepLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionKeepLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionKeepLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionKeepLogDo) Unscoped() *fissionKeepLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionKeepLogDo) Create(values ...*model.FissionKeepLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionKeepLogDo) CreateInBatches(values []*model.FissionKeepLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionKeepLogDo) Save(values ...*model.FissionKeepLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionKeepLogDo) First() (*model.FissionKeepLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeepLog), nil + } +} + +func (f fissionKeepLogDo) Take() (*model.FissionKeepLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeepLog), nil + } +} + +func (f fissionKeepLogDo) Last() (*model.FissionKeepLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeepLog), nil + } +} + +func (f fissionKeepLogDo) Find() ([]*model.FissionKeepLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionKeepLog), err +} + +func (f fissionKeepLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionKeepLog, err error) { + buf := make([]*model.FissionKeepLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionKeepLogDo) FindInBatches(result *[]*model.FissionKeepLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionKeepLogDo) Attrs(attrs ...field.AssignExpr) *fissionKeepLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionKeepLogDo) Assign(attrs ...field.AssignExpr) *fissionKeepLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionKeepLogDo) Joins(fields ...field.RelationField) *fissionKeepLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionKeepLogDo) Preload(fields ...field.RelationField) *fissionKeepLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionKeepLogDo) FirstOrInit() (*model.FissionKeepLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeepLog), nil + } +} + +func (f fissionKeepLogDo) FirstOrCreate() (*model.FissionKeepLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionKeepLog), nil + } +} + +func (f fissionKeepLogDo) FindByPage(offset int, limit int) (result []*model.FissionKeepLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionKeepLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionKeepLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionKeepLogDo) Delete(models ...*model.FissionKeepLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionKeepLogDo) withDO(do gen.Dao) *fissionKeepLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_lang_module.gen.go b/internal/repository/dao/fission_lang_module.gen.go new file mode 100644 index 0000000..5ed4c54 --- /dev/null +++ b/internal/repository/dao/fission_lang_module.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionLangModule(db *gorm.DB, opts ...gen.DOOption) fissionLangModule { + _fissionLangModule := fissionLangModule{} + + _fissionLangModule.fissionLangModuleDo.UseDB(db, opts...) + _fissionLangModule.fissionLangModuleDo.UseModel(&model.FissionLangModule{}) + + tableName := _fissionLangModule.fissionLangModuleDo.TableName() + _fissionLangModule.ALL = field.NewAsterisk(tableName) + _fissionLangModule.ID = field.NewInt64(tableName, "id") + _fissionLangModule.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionLangModule.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionLangModule.Mark = field.NewString(tableName, "mark") + _fissionLangModule.Desc = field.NewString(tableName, "desc") + _fissionLangModule.Parts = field.NewString(tableName, "parts") + + _fissionLangModule.fillFieldMap() + + return _fissionLangModule +} + +type fissionLangModule struct { + fissionLangModuleDo fissionLangModuleDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + Mark field.String // 组件标识 + Desc field.String // 描述(用于描述用途或者一些使用提示) + Parts field.String // 使用的语言字段 + + fieldMap map[string]field.Expr +} + +func (f fissionLangModule) Table(newTableName string) *fissionLangModule { + f.fissionLangModuleDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionLangModule) As(alias string) *fissionLangModule { + f.fissionLangModuleDo.DO = *(f.fissionLangModuleDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionLangModule) updateTableName(table string) *fissionLangModule { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.Mark = field.NewString(table, "mark") + f.Desc = field.NewString(table, "desc") + f.Parts = field.NewString(table, "parts") + + f.fillFieldMap() + + return f +} + +func (f *fissionLangModule) WithContext(ctx context.Context) *fissionLangModuleDo { + return f.fissionLangModuleDo.WithContext(ctx) +} + +func (f fissionLangModule) TableName() string { return f.fissionLangModuleDo.TableName() } + +func (f fissionLangModule) Alias() string { return f.fissionLangModuleDo.Alias() } + +func (f *fissionLangModule) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionLangModule) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["mark"] = f.Mark + f.fieldMap["desc"] = f.Desc + f.fieldMap["parts"] = f.Parts +} + +func (f fissionLangModule) clone(db *gorm.DB) fissionLangModule { + f.fissionLangModuleDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionLangModule) replaceDB(db *gorm.DB) fissionLangModule { + f.fissionLangModuleDo.ReplaceDB(db) + return f +} + +type fissionLangModuleDo struct{ gen.DO } + +func (f fissionLangModuleDo) Debug() *fissionLangModuleDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionLangModuleDo) WithContext(ctx context.Context) *fissionLangModuleDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionLangModuleDo) ReadDB() *fissionLangModuleDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionLangModuleDo) WriteDB() *fissionLangModuleDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionLangModuleDo) Session(config *gorm.Session) *fissionLangModuleDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionLangModuleDo) Clauses(conds ...clause.Expression) *fissionLangModuleDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionLangModuleDo) Returning(value interface{}, columns ...string) *fissionLangModuleDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionLangModuleDo) Not(conds ...gen.Condition) *fissionLangModuleDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionLangModuleDo) Or(conds ...gen.Condition) *fissionLangModuleDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionLangModuleDo) Select(conds ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionLangModuleDo) Where(conds ...gen.Condition) *fissionLangModuleDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionLangModuleDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionLangModuleDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionLangModuleDo) Order(conds ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionLangModuleDo) Distinct(cols ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionLangModuleDo) Omit(cols ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionLangModuleDo) Join(table schema.Tabler, on ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionLangModuleDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionLangModuleDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionLangModuleDo) Group(cols ...field.Expr) *fissionLangModuleDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionLangModuleDo) Having(conds ...gen.Condition) *fissionLangModuleDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionLangModuleDo) Limit(limit int) *fissionLangModuleDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionLangModuleDo) Offset(offset int) *fissionLangModuleDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionLangModuleDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionLangModuleDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionLangModuleDo) Unscoped() *fissionLangModuleDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionLangModuleDo) Create(values ...*model.FissionLangModule) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionLangModuleDo) CreateInBatches(values []*model.FissionLangModule, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionLangModuleDo) Save(values ...*model.FissionLangModule) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionLangModuleDo) First() (*model.FissionLangModule, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionLangModule), nil + } +} + +func (f fissionLangModuleDo) Take() (*model.FissionLangModule, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionLangModule), nil + } +} + +func (f fissionLangModuleDo) Last() (*model.FissionLangModule, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionLangModule), nil + } +} + +func (f fissionLangModuleDo) Find() ([]*model.FissionLangModule, error) { + result, err := f.DO.Find() + return result.([]*model.FissionLangModule), err +} + +func (f fissionLangModuleDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionLangModule, err error) { + buf := make([]*model.FissionLangModule, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionLangModuleDo) FindInBatches(result *[]*model.FissionLangModule, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionLangModuleDo) Attrs(attrs ...field.AssignExpr) *fissionLangModuleDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionLangModuleDo) Assign(attrs ...field.AssignExpr) *fissionLangModuleDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionLangModuleDo) Joins(fields ...field.RelationField) *fissionLangModuleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionLangModuleDo) Preload(fields ...field.RelationField) *fissionLangModuleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionLangModuleDo) FirstOrInit() (*model.FissionLangModule, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionLangModule), nil + } +} + +func (f fissionLangModuleDo) FirstOrCreate() (*model.FissionLangModule, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionLangModule), nil + } +} + +func (f fissionLangModuleDo) FindByPage(offset int, limit int) (result []*model.FissionLangModule, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionLangModuleDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionLangModuleDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionLangModuleDo) Delete(models ...*model.FissionLangModule) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionLangModuleDo) withDO(do gen.Dao) *fissionLangModuleDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_notify.gen.go b/internal/repository/dao/fission_notify.gen.go new file mode 100644 index 0000000..45ab914 --- /dev/null +++ b/internal/repository/dao/fission_notify.gen.go @@ -0,0 +1,387 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionNotify(db *gorm.DB, opts ...gen.DOOption) fissionNotify { + _fissionNotify := fissionNotify{} + + _fissionNotify.fissionNotifyDo.UseDB(db, opts...) + _fissionNotify.fissionNotifyDo.UseModel(&model.FissionNotify{}) + + tableName := _fissionNotify.fissionNotifyDo.TableName() + _fissionNotify.ALL = field.NewAsterisk(tableName) + _fissionNotify.ID = field.NewInt64(tableName, "id") + _fissionNotify.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionNotify.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionNotify.HashID = field.NewString(tableName, "hash_id") + _fissionNotify.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionNotify.RecordID = field.NewInt64(tableName, "record_id") + _fissionNotify.RewardID = field.NewInt64(tableName, "reward_id") + _fissionNotify.NotifyType = field.NewInt8(tableName, "notify_type") + _fissionNotify.NotifyURL = field.NewString(tableName, "notify_url") + _fissionNotify.Token = field.NewString(tableName, "token") + _fissionNotify.Body = field.NewString(tableName, "body") + _fissionNotify.PushNum = field.NewInt32(tableName, "push_num") + _fissionNotify.IsOk = field.NewInt8(tableName, "is_ok") + _fissionNotify.PushLadder = field.NewInt8(tableName, "push_ladder") + _fissionNotify.Headers = field.NewString(tableName, "headers") + + _fissionNotify.fillFieldMap() + + return _fissionNotify +} + +type fissionNotify struct { + fissionNotifyDo fissionNotifyDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 对外hash_id + CampaignID field.Int64 // 活动id(fission_campaign表) + RecordID field.Int64 // 玩法奖品记录id(fission_reward_record表) + RewardID field.Int64 // 奖品id(活动下对应的用户奖品表id) + NotifyType field.Int8 // 回调类型(1-服务端回调,2-客户端监听) + NotifyURL field.String // 回调地址 + Token field.String // 回调的token + Body field.String // 推送数据 + PushNum field.Int32 // 推送次数 + IsOk field.Int8 // 是否推送成功(0-否,1-是) + PushLadder field.Int8 // 是否开启转发推送 + Headers field.String // 请求头数据 + + fieldMap map[string]field.Expr +} + +func (f fissionNotify) Table(newTableName string) *fissionNotify { + f.fissionNotifyDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionNotify) As(alias string) *fissionNotify { + f.fissionNotifyDo.DO = *(f.fissionNotifyDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionNotify) updateTableName(table string) *fissionNotify { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RecordID = field.NewInt64(table, "record_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.NotifyType = field.NewInt8(table, "notify_type") + f.NotifyURL = field.NewString(table, "notify_url") + f.Token = field.NewString(table, "token") + f.Body = field.NewString(table, "body") + f.PushNum = field.NewInt32(table, "push_num") + f.IsOk = field.NewInt8(table, "is_ok") + f.PushLadder = field.NewInt8(table, "push_ladder") + f.Headers = field.NewString(table, "headers") + + f.fillFieldMap() + + return f +} + +func (f *fissionNotify) WithContext(ctx context.Context) *fissionNotifyDo { + return f.fissionNotifyDo.WithContext(ctx) +} + +func (f fissionNotify) TableName() string { return f.fissionNotifyDo.TableName() } + +func (f fissionNotify) Alias() string { return f.fissionNotifyDo.Alias() } + +func (f *fissionNotify) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionNotify) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 15) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["record_id"] = f.RecordID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["notify_type"] = f.NotifyType + f.fieldMap["notify_url"] = f.NotifyURL + f.fieldMap["token"] = f.Token + f.fieldMap["body"] = f.Body + f.fieldMap["push_num"] = f.PushNum + f.fieldMap["is_ok"] = f.IsOk + f.fieldMap["push_ladder"] = f.PushLadder + f.fieldMap["headers"] = f.Headers +} + +func (f fissionNotify) clone(db *gorm.DB) fissionNotify { + f.fissionNotifyDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionNotify) replaceDB(db *gorm.DB) fissionNotify { + f.fissionNotifyDo.ReplaceDB(db) + return f +} + +type fissionNotifyDo struct{ gen.DO } + +func (f fissionNotifyDo) Debug() *fissionNotifyDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionNotifyDo) WithContext(ctx context.Context) *fissionNotifyDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionNotifyDo) ReadDB() *fissionNotifyDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionNotifyDo) WriteDB() *fissionNotifyDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionNotifyDo) Session(config *gorm.Session) *fissionNotifyDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionNotifyDo) Clauses(conds ...clause.Expression) *fissionNotifyDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionNotifyDo) Returning(value interface{}, columns ...string) *fissionNotifyDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionNotifyDo) Not(conds ...gen.Condition) *fissionNotifyDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionNotifyDo) Or(conds ...gen.Condition) *fissionNotifyDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionNotifyDo) Select(conds ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionNotifyDo) Where(conds ...gen.Condition) *fissionNotifyDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionNotifyDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionNotifyDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionNotifyDo) Order(conds ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionNotifyDo) Distinct(cols ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionNotifyDo) Omit(cols ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionNotifyDo) Join(table schema.Tabler, on ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionNotifyDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionNotifyDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionNotifyDo) Group(cols ...field.Expr) *fissionNotifyDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionNotifyDo) Having(conds ...gen.Condition) *fissionNotifyDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionNotifyDo) Limit(limit int) *fissionNotifyDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionNotifyDo) Offset(offset int) *fissionNotifyDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionNotifyDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionNotifyDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionNotifyDo) Unscoped() *fissionNotifyDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionNotifyDo) Create(values ...*model.FissionNotify) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionNotifyDo) CreateInBatches(values []*model.FissionNotify, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionNotifyDo) Save(values ...*model.FissionNotify) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionNotifyDo) First() (*model.FissionNotify, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotify), nil + } +} + +func (f fissionNotifyDo) Take() (*model.FissionNotify, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotify), nil + } +} + +func (f fissionNotifyDo) Last() (*model.FissionNotify, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotify), nil + } +} + +func (f fissionNotifyDo) Find() ([]*model.FissionNotify, error) { + result, err := f.DO.Find() + return result.([]*model.FissionNotify), err +} + +func (f fissionNotifyDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionNotify, err error) { + buf := make([]*model.FissionNotify, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionNotifyDo) FindInBatches(result *[]*model.FissionNotify, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionNotifyDo) Attrs(attrs ...field.AssignExpr) *fissionNotifyDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionNotifyDo) Assign(attrs ...field.AssignExpr) *fissionNotifyDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionNotifyDo) Joins(fields ...field.RelationField) *fissionNotifyDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionNotifyDo) Preload(fields ...field.RelationField) *fissionNotifyDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionNotifyDo) FirstOrInit() (*model.FissionNotify, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotify), nil + } +} + +func (f fissionNotifyDo) FirstOrCreate() (*model.FissionNotify, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotify), nil + } +} + +func (f fissionNotifyDo) FindByPage(offset int, limit int) (result []*model.FissionNotify, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionNotifyDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionNotifyDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionNotifyDo) Delete(models ...*model.FissionNotify) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionNotifyDo) withDO(do gen.Dao) *fissionNotifyDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_notify_resp.gen.go b/internal/repository/dao/fission_notify_resp.gen.go new file mode 100644 index 0000000..26d763f --- /dev/null +++ b/internal/repository/dao/fission_notify_resp.gen.go @@ -0,0 +1,347 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionNotifyResp(db *gorm.DB, opts ...gen.DOOption) fissionNotifyResp { + _fissionNotifyResp := fissionNotifyResp{} + + _fissionNotifyResp.fissionNotifyRespDo.UseDB(db, opts...) + _fissionNotifyResp.fissionNotifyRespDo.UseModel(&model.FissionNotifyResp{}) + + tableName := _fissionNotifyResp.fissionNotifyRespDo.TableName() + _fissionNotifyResp.ALL = field.NewAsterisk(tableName) + _fissionNotifyResp.ID = field.NewInt64(tableName, "id") + _fissionNotifyResp.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionNotifyResp.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionNotifyResp.NotifyID = field.NewInt64(tableName, "notify_id") + _fissionNotifyResp.Resp = field.NewString(tableName, "resp") + + _fissionNotifyResp.fillFieldMap() + + return _fissionNotifyResp +} + +type fissionNotifyResp struct { + fissionNotifyRespDo fissionNotifyRespDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + NotifyID field.Int64 // 回调记录id(fission_notify表) + Resp field.String // 回调结果 + + fieldMap map[string]field.Expr +} + +func (f fissionNotifyResp) Table(newTableName string) *fissionNotifyResp { + f.fissionNotifyRespDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionNotifyResp) As(alias string) *fissionNotifyResp { + f.fissionNotifyRespDo.DO = *(f.fissionNotifyRespDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionNotifyResp) updateTableName(table string) *fissionNotifyResp { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.NotifyID = field.NewInt64(table, "notify_id") + f.Resp = field.NewString(table, "resp") + + f.fillFieldMap() + + return f +} + +func (f *fissionNotifyResp) WithContext(ctx context.Context) *fissionNotifyRespDo { + return f.fissionNotifyRespDo.WithContext(ctx) +} + +func (f fissionNotifyResp) TableName() string { return f.fissionNotifyRespDo.TableName() } + +func (f fissionNotifyResp) Alias() string { return f.fissionNotifyRespDo.Alias() } + +func (f *fissionNotifyResp) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionNotifyResp) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 5) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["notify_id"] = f.NotifyID + f.fieldMap["resp"] = f.Resp +} + +func (f fissionNotifyResp) clone(db *gorm.DB) fissionNotifyResp { + f.fissionNotifyRespDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionNotifyResp) replaceDB(db *gorm.DB) fissionNotifyResp { + f.fissionNotifyRespDo.ReplaceDB(db) + return f +} + +type fissionNotifyRespDo struct{ gen.DO } + +func (f fissionNotifyRespDo) Debug() *fissionNotifyRespDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionNotifyRespDo) WithContext(ctx context.Context) *fissionNotifyRespDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionNotifyRespDo) ReadDB() *fissionNotifyRespDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionNotifyRespDo) WriteDB() *fissionNotifyRespDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionNotifyRespDo) Session(config *gorm.Session) *fissionNotifyRespDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionNotifyRespDo) Clauses(conds ...clause.Expression) *fissionNotifyRespDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionNotifyRespDo) Returning(value interface{}, columns ...string) *fissionNotifyRespDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionNotifyRespDo) Not(conds ...gen.Condition) *fissionNotifyRespDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionNotifyRespDo) Or(conds ...gen.Condition) *fissionNotifyRespDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionNotifyRespDo) Select(conds ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionNotifyRespDo) Where(conds ...gen.Condition) *fissionNotifyRespDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionNotifyRespDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionNotifyRespDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionNotifyRespDo) Order(conds ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionNotifyRespDo) Distinct(cols ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionNotifyRespDo) Omit(cols ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionNotifyRespDo) Join(table schema.Tabler, on ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionNotifyRespDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionNotifyRespDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionNotifyRespDo) Group(cols ...field.Expr) *fissionNotifyRespDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionNotifyRespDo) Having(conds ...gen.Condition) *fissionNotifyRespDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionNotifyRespDo) Limit(limit int) *fissionNotifyRespDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionNotifyRespDo) Offset(offset int) *fissionNotifyRespDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionNotifyRespDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionNotifyRespDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionNotifyRespDo) Unscoped() *fissionNotifyRespDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionNotifyRespDo) Create(values ...*model.FissionNotifyResp) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionNotifyRespDo) CreateInBatches(values []*model.FissionNotifyResp, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionNotifyRespDo) Save(values ...*model.FissionNotifyResp) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionNotifyRespDo) First() (*model.FissionNotifyResp, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyResp), nil + } +} + +func (f fissionNotifyRespDo) Take() (*model.FissionNotifyResp, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyResp), nil + } +} + +func (f fissionNotifyRespDo) Last() (*model.FissionNotifyResp, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyResp), nil + } +} + +func (f fissionNotifyRespDo) Find() ([]*model.FissionNotifyResp, error) { + result, err := f.DO.Find() + return result.([]*model.FissionNotifyResp), err +} + +func (f fissionNotifyRespDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionNotifyResp, err error) { + buf := make([]*model.FissionNotifyResp, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionNotifyRespDo) FindInBatches(result *[]*model.FissionNotifyResp, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionNotifyRespDo) Attrs(attrs ...field.AssignExpr) *fissionNotifyRespDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionNotifyRespDo) Assign(attrs ...field.AssignExpr) *fissionNotifyRespDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionNotifyRespDo) Joins(fields ...field.RelationField) *fissionNotifyRespDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionNotifyRespDo) Preload(fields ...field.RelationField) *fissionNotifyRespDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionNotifyRespDo) FirstOrInit() (*model.FissionNotifyResp, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyResp), nil + } +} + +func (f fissionNotifyRespDo) FirstOrCreate() (*model.FissionNotifyResp, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyResp), nil + } +} + +func (f fissionNotifyRespDo) FindByPage(offset int, limit int) (result []*model.FissionNotifyResp, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionNotifyRespDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionNotifyRespDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionNotifyRespDo) Delete(models ...*model.FissionNotifyResp) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionNotifyRespDo) withDO(do gen.Dao) *fissionNotifyRespDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_notify_task.gen.go b/internal/repository/dao/fission_notify_task.gen.go new file mode 100644 index 0000000..15d4414 --- /dev/null +++ b/internal/repository/dao/fission_notify_task.gen.go @@ -0,0 +1,343 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionNotifyTask(db *gorm.DB, opts ...gen.DOOption) fissionNotifyTask { + _fissionNotifyTask := fissionNotifyTask{} + + _fissionNotifyTask.fissionNotifyTaskDo.UseDB(db, opts...) + _fissionNotifyTask.fissionNotifyTaskDo.UseModel(&model.FissionNotifyTask{}) + + tableName := _fissionNotifyTask.fissionNotifyTaskDo.TableName() + _fissionNotifyTask.ALL = field.NewAsterisk(tableName) + _fissionNotifyTask.ID = field.NewInt64(tableName, "id") + _fissionNotifyTask.DoTime = field.NewInt64(tableName, "do_time") + _fissionNotifyTask.NotifyID = field.NewInt64(tableName, "notify_id") + _fissionNotifyTask.Reward = field.NewString(tableName, "reward") + + _fissionNotifyTask.fillFieldMap() + + return _fissionNotifyTask +} + +type fissionNotifyTask struct { + fissionNotifyTaskDo fissionNotifyTaskDo + + ALL field.Asterisk + ID field.Int64 + DoTime field.Int64 // 执行时间 + NotifyID field.Int64 // 回调id(fission_notify表) + Reward field.String // 奖品推送内容 + + fieldMap map[string]field.Expr +} + +func (f fissionNotifyTask) Table(newTableName string) *fissionNotifyTask { + f.fissionNotifyTaskDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionNotifyTask) As(alias string) *fissionNotifyTask { + f.fissionNotifyTaskDo.DO = *(f.fissionNotifyTaskDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionNotifyTask) updateTableName(table string) *fissionNotifyTask { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.DoTime = field.NewInt64(table, "do_time") + f.NotifyID = field.NewInt64(table, "notify_id") + f.Reward = field.NewString(table, "reward") + + f.fillFieldMap() + + return f +} + +func (f *fissionNotifyTask) WithContext(ctx context.Context) *fissionNotifyTaskDo { + return f.fissionNotifyTaskDo.WithContext(ctx) +} + +func (f fissionNotifyTask) TableName() string { return f.fissionNotifyTaskDo.TableName() } + +func (f fissionNotifyTask) Alias() string { return f.fissionNotifyTaskDo.Alias() } + +func (f *fissionNotifyTask) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionNotifyTask) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 4) + f.fieldMap["id"] = f.ID + f.fieldMap["do_time"] = f.DoTime + f.fieldMap["notify_id"] = f.NotifyID + f.fieldMap["reward"] = f.Reward +} + +func (f fissionNotifyTask) clone(db *gorm.DB) fissionNotifyTask { + f.fissionNotifyTaskDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionNotifyTask) replaceDB(db *gorm.DB) fissionNotifyTask { + f.fissionNotifyTaskDo.ReplaceDB(db) + return f +} + +type fissionNotifyTaskDo struct{ gen.DO } + +func (f fissionNotifyTaskDo) Debug() *fissionNotifyTaskDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionNotifyTaskDo) WithContext(ctx context.Context) *fissionNotifyTaskDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionNotifyTaskDo) ReadDB() *fissionNotifyTaskDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionNotifyTaskDo) WriteDB() *fissionNotifyTaskDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionNotifyTaskDo) Session(config *gorm.Session) *fissionNotifyTaskDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionNotifyTaskDo) Clauses(conds ...clause.Expression) *fissionNotifyTaskDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionNotifyTaskDo) Returning(value interface{}, columns ...string) *fissionNotifyTaskDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionNotifyTaskDo) Not(conds ...gen.Condition) *fissionNotifyTaskDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionNotifyTaskDo) Or(conds ...gen.Condition) *fissionNotifyTaskDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionNotifyTaskDo) Select(conds ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionNotifyTaskDo) Where(conds ...gen.Condition) *fissionNotifyTaskDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionNotifyTaskDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionNotifyTaskDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionNotifyTaskDo) Order(conds ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionNotifyTaskDo) Distinct(cols ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionNotifyTaskDo) Omit(cols ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionNotifyTaskDo) Join(table schema.Tabler, on ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionNotifyTaskDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionNotifyTaskDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionNotifyTaskDo) Group(cols ...field.Expr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionNotifyTaskDo) Having(conds ...gen.Condition) *fissionNotifyTaskDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionNotifyTaskDo) Limit(limit int) *fissionNotifyTaskDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionNotifyTaskDo) Offset(offset int) *fissionNotifyTaskDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionNotifyTaskDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionNotifyTaskDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionNotifyTaskDo) Unscoped() *fissionNotifyTaskDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionNotifyTaskDo) Create(values ...*model.FissionNotifyTask) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionNotifyTaskDo) CreateInBatches(values []*model.FissionNotifyTask, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionNotifyTaskDo) Save(values ...*model.FissionNotifyTask) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionNotifyTaskDo) First() (*model.FissionNotifyTask, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyTask), nil + } +} + +func (f fissionNotifyTaskDo) Take() (*model.FissionNotifyTask, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyTask), nil + } +} + +func (f fissionNotifyTaskDo) Last() (*model.FissionNotifyTask, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyTask), nil + } +} + +func (f fissionNotifyTaskDo) Find() ([]*model.FissionNotifyTask, error) { + result, err := f.DO.Find() + return result.([]*model.FissionNotifyTask), err +} + +func (f fissionNotifyTaskDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionNotifyTask, err error) { + buf := make([]*model.FissionNotifyTask, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionNotifyTaskDo) FindInBatches(result *[]*model.FissionNotifyTask, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionNotifyTaskDo) Attrs(attrs ...field.AssignExpr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionNotifyTaskDo) Assign(attrs ...field.AssignExpr) *fissionNotifyTaskDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionNotifyTaskDo) Joins(fields ...field.RelationField) *fissionNotifyTaskDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionNotifyTaskDo) Preload(fields ...field.RelationField) *fissionNotifyTaskDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionNotifyTaskDo) FirstOrInit() (*model.FissionNotifyTask, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyTask), nil + } +} + +func (f fissionNotifyTaskDo) FirstOrCreate() (*model.FissionNotifyTask, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionNotifyTask), nil + } +} + +func (f fissionNotifyTaskDo) FindByPage(offset int, limit int) (result []*model.FissionNotifyTask, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionNotifyTaskDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionNotifyTaskDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionNotifyTaskDo) Delete(models ...*model.FissionNotifyTask) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionNotifyTaskDo) withDO(do gen.Dao) *fissionNotifyTaskDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_point_deduct.gen.go b/internal/repository/dao/fission_point_deduct.gen.go new file mode 100644 index 0000000..a4204b5 --- /dev/null +++ b/internal/repository/dao/fission_point_deduct.gen.go @@ -0,0 +1,343 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionPointDeduct(db *gorm.DB, opts ...gen.DOOption) fissionPointDeduct { + _fissionPointDeduct := fissionPointDeduct{} + + _fissionPointDeduct.fissionPointDeductDo.UseDB(db, opts...) + _fissionPointDeduct.fissionPointDeductDo.UseModel(&model.FissionPointDeduct{}) + + tableName := _fissionPointDeduct.fissionPointDeductDo.TableName() + _fissionPointDeduct.ALL = field.NewAsterisk(tableName) + _fissionPointDeduct.ID = field.NewInt64(tableName, "id") + _fissionPointDeduct.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionPointDeduct.UserID = field.NewInt64(tableName, "user_id") + _fissionPointDeduct.Num = field.NewInt32(tableName, "num") + + _fissionPointDeduct.fillFieldMap() + + return _fissionPointDeduct +} + +type fissionPointDeduct struct { + fissionPointDeductDo fissionPointDeductDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 + Num field.Int32 // 扣除数量 + + fieldMap map[string]field.Expr +} + +func (f fissionPointDeduct) Table(newTableName string) *fissionPointDeduct { + f.fissionPointDeductDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionPointDeduct) As(alias string) *fissionPointDeduct { + f.fissionPointDeductDo.DO = *(f.fissionPointDeductDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionPointDeduct) updateTableName(table string) *fissionPointDeduct { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.Num = field.NewInt32(table, "num") + + f.fillFieldMap() + + return f +} + +func (f *fissionPointDeduct) WithContext(ctx context.Context) *fissionPointDeductDo { + return f.fissionPointDeductDo.WithContext(ctx) +} + +func (f fissionPointDeduct) TableName() string { return f.fissionPointDeductDo.TableName() } + +func (f fissionPointDeduct) Alias() string { return f.fissionPointDeductDo.Alias() } + +func (f *fissionPointDeduct) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionPointDeduct) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 4) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["num"] = f.Num +} + +func (f fissionPointDeduct) clone(db *gorm.DB) fissionPointDeduct { + f.fissionPointDeductDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionPointDeduct) replaceDB(db *gorm.DB) fissionPointDeduct { + f.fissionPointDeductDo.ReplaceDB(db) + return f +} + +type fissionPointDeductDo struct{ gen.DO } + +func (f fissionPointDeductDo) Debug() *fissionPointDeductDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionPointDeductDo) WithContext(ctx context.Context) *fissionPointDeductDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionPointDeductDo) ReadDB() *fissionPointDeductDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionPointDeductDo) WriteDB() *fissionPointDeductDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionPointDeductDo) Session(config *gorm.Session) *fissionPointDeductDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionPointDeductDo) Clauses(conds ...clause.Expression) *fissionPointDeductDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionPointDeductDo) Returning(value interface{}, columns ...string) *fissionPointDeductDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionPointDeductDo) Not(conds ...gen.Condition) *fissionPointDeductDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionPointDeductDo) Or(conds ...gen.Condition) *fissionPointDeductDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionPointDeductDo) Select(conds ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionPointDeductDo) Where(conds ...gen.Condition) *fissionPointDeductDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionPointDeductDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionPointDeductDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionPointDeductDo) Order(conds ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionPointDeductDo) Distinct(cols ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionPointDeductDo) Omit(cols ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionPointDeductDo) Join(table schema.Tabler, on ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionPointDeductDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionPointDeductDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionPointDeductDo) Group(cols ...field.Expr) *fissionPointDeductDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionPointDeductDo) Having(conds ...gen.Condition) *fissionPointDeductDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionPointDeductDo) Limit(limit int) *fissionPointDeductDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionPointDeductDo) Offset(offset int) *fissionPointDeductDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionPointDeductDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionPointDeductDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionPointDeductDo) Unscoped() *fissionPointDeductDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionPointDeductDo) Create(values ...*model.FissionPointDeduct) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionPointDeductDo) CreateInBatches(values []*model.FissionPointDeduct, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionPointDeductDo) Save(values ...*model.FissionPointDeduct) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionPointDeductDo) First() (*model.FissionPointDeduct, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointDeduct), nil + } +} + +func (f fissionPointDeductDo) Take() (*model.FissionPointDeduct, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointDeduct), nil + } +} + +func (f fissionPointDeductDo) Last() (*model.FissionPointDeduct, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointDeduct), nil + } +} + +func (f fissionPointDeductDo) Find() ([]*model.FissionPointDeduct, error) { + result, err := f.DO.Find() + return result.([]*model.FissionPointDeduct), err +} + +func (f fissionPointDeductDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionPointDeduct, err error) { + buf := make([]*model.FissionPointDeduct, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionPointDeductDo) FindInBatches(result *[]*model.FissionPointDeduct, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionPointDeductDo) Attrs(attrs ...field.AssignExpr) *fissionPointDeductDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionPointDeductDo) Assign(attrs ...field.AssignExpr) *fissionPointDeductDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionPointDeductDo) Joins(fields ...field.RelationField) *fissionPointDeductDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionPointDeductDo) Preload(fields ...field.RelationField) *fissionPointDeductDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionPointDeductDo) FirstOrInit() (*model.FissionPointDeduct, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointDeduct), nil + } +} + +func (f fissionPointDeductDo) FirstOrCreate() (*model.FissionPointDeduct, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointDeduct), nil + } +} + +func (f fissionPointDeductDo) FindByPage(offset int, limit int) (result []*model.FissionPointDeduct, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionPointDeductDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionPointDeductDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionPointDeductDo) Delete(models ...*model.FissionPointDeduct) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionPointDeductDo) withDO(do gen.Dao) *fissionPointDeductDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_points_log.gen.go b/internal/repository/dao/fission_points_log.gen.go new file mode 100644 index 0000000..0646e83 --- /dev/null +++ b/internal/repository/dao/fission_points_log.gen.go @@ -0,0 +1,395 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionPointsLog(db *gorm.DB, opts ...gen.DOOption) fissionPointsLog { + _fissionPointsLog := fissionPointsLog{} + + _fissionPointsLog.fissionPointsLogDo.UseDB(db, opts...) + _fissionPointsLog.fissionPointsLogDo.UseModel(&model.FissionPointsLog{}) + + tableName := _fissionPointsLog.fissionPointsLogDo.TableName() + _fissionPointsLog.ALL = field.NewAsterisk(tableName) + _fissionPointsLog.ID = field.NewInt64(tableName, "id") + _fissionPointsLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionPointsLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionPointsLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionPointsLog.UserID = field.NewInt64(tableName, "user_id") + _fissionPointsLog.State = field.NewString(tableName, "state") + _fissionPointsLog.Num = field.NewInt32(tableName, "num") + _fissionPointsLog.Source = field.NewString(tableName, "source") + _fissionPointsLog.ReqURL = field.NewString(tableName, "req_url") + _fissionPointsLog.Req = field.NewString(tableName, "req") + _fissionPointsLog.Resp = field.NewString(tableName, "resp") + _fissionPointsLog.RespCode = field.NewInt32(tableName, "resp_code") + _fissionPointsLog.ReqTime = field.NewInt64(tableName, "req_time") + _fissionPointsLog.ErrMsg = field.NewString(tableName, "err_msg") + _fissionPointsLog.OtherData = field.NewString(tableName, "other_data") + _fissionPointsLog.Token = field.NewString(tableName, "token") + _fissionPointsLog.ReqHeader = field.NewString(tableName, "req_header") + + _fissionPointsLog.fillFieldMap() + + return _fissionPointsLog +} + +type fissionPointsLog struct { + fissionPointsLogDo fissionPointsLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + State field.String // 类型(deduct - 扣除, gain - 获得) + Num field.Int32 // 数量 + Source field.String // 来源标识 + ReqURL field.String // 请求地址 + Req field.String // 请求数据 + Resp field.String // 返回数据 + RespCode field.Int32 // 返回状态码 + ReqTime field.Int64 // 请求时长(单位:ms) + ErrMsg field.String // 错误信息 + OtherData field.String // 其他数据信息 + Token field.String // 请求token + ReqHeader field.String // 请求头数据 + + fieldMap map[string]field.Expr +} + +func (f fissionPointsLog) Table(newTableName string) *fissionPointsLog { + f.fissionPointsLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionPointsLog) As(alias string) *fissionPointsLog { + f.fissionPointsLogDo.DO = *(f.fissionPointsLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionPointsLog) updateTableName(table string) *fissionPointsLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.State = field.NewString(table, "state") + f.Num = field.NewInt32(table, "num") + f.Source = field.NewString(table, "source") + f.ReqURL = field.NewString(table, "req_url") + f.Req = field.NewString(table, "req") + f.Resp = field.NewString(table, "resp") + f.RespCode = field.NewInt32(table, "resp_code") + f.ReqTime = field.NewInt64(table, "req_time") + f.ErrMsg = field.NewString(table, "err_msg") + f.OtherData = field.NewString(table, "other_data") + f.Token = field.NewString(table, "token") + f.ReqHeader = field.NewString(table, "req_header") + + f.fillFieldMap() + + return f +} + +func (f *fissionPointsLog) WithContext(ctx context.Context) *fissionPointsLogDo { + return f.fissionPointsLogDo.WithContext(ctx) +} + +func (f fissionPointsLog) TableName() string { return f.fissionPointsLogDo.TableName() } + +func (f fissionPointsLog) Alias() string { return f.fissionPointsLogDo.Alias() } + +func (f *fissionPointsLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionPointsLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 17) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["state"] = f.State + f.fieldMap["num"] = f.Num + f.fieldMap["source"] = f.Source + f.fieldMap["req_url"] = f.ReqURL + f.fieldMap["req"] = f.Req + f.fieldMap["resp"] = f.Resp + f.fieldMap["resp_code"] = f.RespCode + f.fieldMap["req_time"] = f.ReqTime + f.fieldMap["err_msg"] = f.ErrMsg + f.fieldMap["other_data"] = f.OtherData + f.fieldMap["token"] = f.Token + f.fieldMap["req_header"] = f.ReqHeader +} + +func (f fissionPointsLog) clone(db *gorm.DB) fissionPointsLog { + f.fissionPointsLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionPointsLog) replaceDB(db *gorm.DB) fissionPointsLog { + f.fissionPointsLogDo.ReplaceDB(db) + return f +} + +type fissionPointsLogDo struct{ gen.DO } + +func (f fissionPointsLogDo) Debug() *fissionPointsLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionPointsLogDo) WithContext(ctx context.Context) *fissionPointsLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionPointsLogDo) ReadDB() *fissionPointsLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionPointsLogDo) WriteDB() *fissionPointsLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionPointsLogDo) Session(config *gorm.Session) *fissionPointsLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionPointsLogDo) Clauses(conds ...clause.Expression) *fissionPointsLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionPointsLogDo) Returning(value interface{}, columns ...string) *fissionPointsLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionPointsLogDo) Not(conds ...gen.Condition) *fissionPointsLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionPointsLogDo) Or(conds ...gen.Condition) *fissionPointsLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionPointsLogDo) Select(conds ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionPointsLogDo) Where(conds ...gen.Condition) *fissionPointsLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionPointsLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionPointsLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionPointsLogDo) Order(conds ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionPointsLogDo) Distinct(cols ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionPointsLogDo) Omit(cols ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionPointsLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionPointsLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionPointsLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionPointsLogDo) Group(cols ...field.Expr) *fissionPointsLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionPointsLogDo) Having(conds ...gen.Condition) *fissionPointsLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionPointsLogDo) Limit(limit int) *fissionPointsLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionPointsLogDo) Offset(offset int) *fissionPointsLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionPointsLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionPointsLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionPointsLogDo) Unscoped() *fissionPointsLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionPointsLogDo) Create(values ...*model.FissionPointsLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionPointsLogDo) CreateInBatches(values []*model.FissionPointsLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionPointsLogDo) Save(values ...*model.FissionPointsLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionPointsLogDo) First() (*model.FissionPointsLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointsLog), nil + } +} + +func (f fissionPointsLogDo) Take() (*model.FissionPointsLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointsLog), nil + } +} + +func (f fissionPointsLogDo) Last() (*model.FissionPointsLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointsLog), nil + } +} + +func (f fissionPointsLogDo) Find() ([]*model.FissionPointsLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionPointsLog), err +} + +func (f fissionPointsLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionPointsLog, err error) { + buf := make([]*model.FissionPointsLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionPointsLogDo) FindInBatches(result *[]*model.FissionPointsLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionPointsLogDo) Attrs(attrs ...field.AssignExpr) *fissionPointsLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionPointsLogDo) Assign(attrs ...field.AssignExpr) *fissionPointsLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionPointsLogDo) Joins(fields ...field.RelationField) *fissionPointsLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionPointsLogDo) Preload(fields ...field.RelationField) *fissionPointsLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionPointsLogDo) FirstOrInit() (*model.FissionPointsLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointsLog), nil + } +} + +func (f fissionPointsLogDo) FirstOrCreate() (*model.FissionPointsLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionPointsLog), nil + } +} + +func (f fissionPointsLogDo) FindByPage(offset int, limit int) (result []*model.FissionPointsLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionPointsLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionPointsLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionPointsLogDo) Delete(models ...*model.FissionPointsLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionPointsLogDo) withDO(do gen.Dao) *fissionPointsLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_prize_wheel.gen.go b/internal/repository/dao/fission_prize_wheel.gen.go new file mode 100644 index 0000000..263b709 --- /dev/null +++ b/internal/repository/dao/fission_prize_wheel.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionPrizeWheel(db *gorm.DB, opts ...gen.DOOption) fissionPrizeWheel { + _fissionPrizeWheel := fissionPrizeWheel{} + + _fissionPrizeWheel.fissionPrizeWheelDo.UseDB(db, opts...) + _fissionPrizeWheel.fissionPrizeWheelDo.UseModel(&model.FissionPrizeWheel{}) + + tableName := _fissionPrizeWheel.fissionPrizeWheelDo.TableName() + _fissionPrizeWheel.ALL = field.NewAsterisk(tableName) + _fissionPrizeWheel.ID = field.NewInt64(tableName, "id") + _fissionPrizeWheel.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionPrizeWheel.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionPrizeWheel.IsDel = field.NewInt8(tableName, "is_del") + _fissionPrizeWheel.UserID = field.NewInt64(tableName, "user_id") + _fissionPrizeWheel.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionPrizeWheel.Chance = field.NewInt32(tableName, "chance") + _fissionPrizeWheel.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionPrizeWheel.DayChance = field.NewInt32(tableName, "day_chance") + _fissionPrizeWheel.LastSign = field.NewString(tableName, "last_sign") + _fissionPrizeWheel.SetInit = field.NewInt8(tableName, "set_init") + + _fissionPrizeWheel.fillFieldMap() + + return _fissionPrizeWheel +} + +type fissionPrizeWheel struct { + fissionPrizeWheelDo fissionPrizeWheelDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + TaskChance field.Int32 // 完成任务获取的抽奖次数 + DayChance field.Int32 // 每日签到获得的抽奖次数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionPrizeWheel) Table(newTableName string) *fissionPrizeWheel { + f.fissionPrizeWheelDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionPrizeWheel) As(alias string) *fissionPrizeWheel { + f.fissionPrizeWheelDo.DO = *(f.fissionPrizeWheelDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionPrizeWheel) updateTableName(table string) *fissionPrizeWheel { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionPrizeWheel) WithContext(ctx context.Context) *fissionPrizeWheelDo { + return f.fissionPrizeWheelDo.WithContext(ctx) +} + +func (f fissionPrizeWheel) TableName() string { return f.fissionPrizeWheelDo.TableName() } + +func (f fissionPrizeWheel) Alias() string { return f.fissionPrizeWheelDo.Alias() } + +func (f *fissionPrizeWheel) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionPrizeWheel) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionPrizeWheel) clone(db *gorm.DB) fissionPrizeWheel { + f.fissionPrizeWheelDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionPrizeWheel) replaceDB(db *gorm.DB) fissionPrizeWheel { + f.fissionPrizeWheelDo.ReplaceDB(db) + return f +} + +type fissionPrizeWheelDo struct{ gen.DO } + +func (f fissionPrizeWheelDo) Debug() *fissionPrizeWheelDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionPrizeWheelDo) WithContext(ctx context.Context) *fissionPrizeWheelDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionPrizeWheelDo) ReadDB() *fissionPrizeWheelDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionPrizeWheelDo) WriteDB() *fissionPrizeWheelDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionPrizeWheelDo) Session(config *gorm.Session) *fissionPrizeWheelDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionPrizeWheelDo) Clauses(conds ...clause.Expression) *fissionPrizeWheelDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionPrizeWheelDo) Returning(value interface{}, columns ...string) *fissionPrizeWheelDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionPrizeWheelDo) Not(conds ...gen.Condition) *fissionPrizeWheelDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionPrizeWheelDo) Or(conds ...gen.Condition) *fissionPrizeWheelDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionPrizeWheelDo) Select(conds ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionPrizeWheelDo) Where(conds ...gen.Condition) *fissionPrizeWheelDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionPrizeWheelDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionPrizeWheelDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionPrizeWheelDo) Order(conds ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionPrizeWheelDo) Distinct(cols ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionPrizeWheelDo) Omit(cols ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionPrizeWheelDo) Join(table schema.Tabler, on ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionPrizeWheelDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionPrizeWheelDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionPrizeWheelDo) Group(cols ...field.Expr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionPrizeWheelDo) Having(conds ...gen.Condition) *fissionPrizeWheelDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionPrizeWheelDo) Limit(limit int) *fissionPrizeWheelDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionPrizeWheelDo) Offset(offset int) *fissionPrizeWheelDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionPrizeWheelDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionPrizeWheelDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionPrizeWheelDo) Unscoped() *fissionPrizeWheelDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionPrizeWheelDo) Create(values ...*model.FissionPrizeWheel) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionPrizeWheelDo) CreateInBatches(values []*model.FissionPrizeWheel, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionPrizeWheelDo) Save(values ...*model.FissionPrizeWheel) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionPrizeWheelDo) First() (*model.FissionPrizeWheel, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheel), nil + } +} + +func (f fissionPrizeWheelDo) Take() (*model.FissionPrizeWheel, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheel), nil + } +} + +func (f fissionPrizeWheelDo) Last() (*model.FissionPrizeWheel, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheel), nil + } +} + +func (f fissionPrizeWheelDo) Find() ([]*model.FissionPrizeWheel, error) { + result, err := f.DO.Find() + return result.([]*model.FissionPrizeWheel), err +} + +func (f fissionPrizeWheelDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionPrizeWheel, err error) { + buf := make([]*model.FissionPrizeWheel, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionPrizeWheelDo) FindInBatches(result *[]*model.FissionPrizeWheel, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionPrizeWheelDo) Attrs(attrs ...field.AssignExpr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionPrizeWheelDo) Assign(attrs ...field.AssignExpr) *fissionPrizeWheelDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionPrizeWheelDo) Joins(fields ...field.RelationField) *fissionPrizeWheelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionPrizeWheelDo) Preload(fields ...field.RelationField) *fissionPrizeWheelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionPrizeWheelDo) FirstOrInit() (*model.FissionPrizeWheel, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheel), nil + } +} + +func (f fissionPrizeWheelDo) FirstOrCreate() (*model.FissionPrizeWheel, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheel), nil + } +} + +func (f fissionPrizeWheelDo) FindByPage(offset int, limit int) (result []*model.FissionPrizeWheel, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionPrizeWheelDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionPrizeWheelDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionPrizeWheelDo) Delete(models ...*model.FissionPrizeWheel) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionPrizeWheelDo) withDO(do gen.Dao) *fissionPrizeWheelDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_prize_wheel_log.gen.go b/internal/repository/dao/fission_prize_wheel_log.gen.go new file mode 100644 index 0000000..83f3344 --- /dev/null +++ b/internal/repository/dao/fission_prize_wheel_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionPrizeWheelLog(db *gorm.DB, opts ...gen.DOOption) fissionPrizeWheelLog { + _fissionPrizeWheelLog := fissionPrizeWheelLog{} + + _fissionPrizeWheelLog.fissionPrizeWheelLogDo.UseDB(db, opts...) + _fissionPrizeWheelLog.fissionPrizeWheelLogDo.UseModel(&model.FissionPrizeWheelLog{}) + + tableName := _fissionPrizeWheelLog.fissionPrizeWheelLogDo.TableName() + _fissionPrizeWheelLog.ALL = field.NewAsterisk(tableName) + _fissionPrizeWheelLog.ID = field.NewInt64(tableName, "id") + _fissionPrizeWheelLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionPrizeWheelLog.UserID = field.NewInt64(tableName, "user_id") + _fissionPrizeWheelLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionPrizeWheelLog.WheelID = field.NewInt64(tableName, "wheel_id") + _fissionPrizeWheelLog.Type = field.NewInt8(tableName, "type") + _fissionPrizeWheelLog.Source = field.NewString(tableName, "source") + _fissionPrizeWheelLog.Val = field.NewString(tableName, "val") + + _fissionPrizeWheelLog.fillFieldMap() + + return _fissionPrizeWheelLog +} + +type fissionPrizeWheelLog struct { + fissionPrizeWheelLogDo fissionPrizeWheelLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + WheelID field.Int64 // 玩家id(fission_prize_wheel表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionPrizeWheelLog) Table(newTableName string) *fissionPrizeWheelLog { + f.fissionPrizeWheelLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionPrizeWheelLog) As(alias string) *fissionPrizeWheelLog { + f.fissionPrizeWheelLogDo.DO = *(f.fissionPrizeWheelLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionPrizeWheelLog) updateTableName(table string) *fissionPrizeWheelLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.WheelID = field.NewInt64(table, "wheel_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionPrizeWheelLog) WithContext(ctx context.Context) *fissionPrizeWheelLogDo { + return f.fissionPrizeWheelLogDo.WithContext(ctx) +} + +func (f fissionPrizeWheelLog) TableName() string { return f.fissionPrizeWheelLogDo.TableName() } + +func (f fissionPrizeWheelLog) Alias() string { return f.fissionPrizeWheelLogDo.Alias() } + +func (f *fissionPrizeWheelLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionPrizeWheelLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["wheel_id"] = f.WheelID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionPrizeWheelLog) clone(db *gorm.DB) fissionPrizeWheelLog { + f.fissionPrizeWheelLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionPrizeWheelLog) replaceDB(db *gorm.DB) fissionPrizeWheelLog { + f.fissionPrizeWheelLogDo.ReplaceDB(db) + return f +} + +type fissionPrizeWheelLogDo struct{ gen.DO } + +func (f fissionPrizeWheelLogDo) Debug() *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionPrizeWheelLogDo) WithContext(ctx context.Context) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionPrizeWheelLogDo) ReadDB() *fissionPrizeWheelLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionPrizeWheelLogDo) WriteDB() *fissionPrizeWheelLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionPrizeWheelLogDo) Session(config *gorm.Session) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionPrizeWheelLogDo) Clauses(conds ...clause.Expression) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionPrizeWheelLogDo) Returning(value interface{}, columns ...string) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionPrizeWheelLogDo) Not(conds ...gen.Condition) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionPrizeWheelLogDo) Or(conds ...gen.Condition) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionPrizeWheelLogDo) Select(conds ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionPrizeWheelLogDo) Where(conds ...gen.Condition) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionPrizeWheelLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionPrizeWheelLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionPrizeWheelLogDo) Order(conds ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionPrizeWheelLogDo) Distinct(cols ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionPrizeWheelLogDo) Omit(cols ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionPrizeWheelLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionPrizeWheelLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionPrizeWheelLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionPrizeWheelLogDo) Group(cols ...field.Expr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionPrizeWheelLogDo) Having(conds ...gen.Condition) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionPrizeWheelLogDo) Limit(limit int) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionPrizeWheelLogDo) Offset(offset int) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionPrizeWheelLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionPrizeWheelLogDo) Unscoped() *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionPrizeWheelLogDo) Create(values ...*model.FissionPrizeWheelLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionPrizeWheelLogDo) CreateInBatches(values []*model.FissionPrizeWheelLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionPrizeWheelLogDo) Save(values ...*model.FissionPrizeWheelLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionPrizeWheelLogDo) First() (*model.FissionPrizeWheelLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheelLog), nil + } +} + +func (f fissionPrizeWheelLogDo) Take() (*model.FissionPrizeWheelLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheelLog), nil + } +} + +func (f fissionPrizeWheelLogDo) Last() (*model.FissionPrizeWheelLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheelLog), nil + } +} + +func (f fissionPrizeWheelLogDo) Find() ([]*model.FissionPrizeWheelLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionPrizeWheelLog), err +} + +func (f fissionPrizeWheelLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionPrizeWheelLog, err error) { + buf := make([]*model.FissionPrizeWheelLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionPrizeWheelLogDo) FindInBatches(result *[]*model.FissionPrizeWheelLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionPrizeWheelLogDo) Attrs(attrs ...field.AssignExpr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionPrizeWheelLogDo) Assign(attrs ...field.AssignExpr) *fissionPrizeWheelLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionPrizeWheelLogDo) Joins(fields ...field.RelationField) *fissionPrizeWheelLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionPrizeWheelLogDo) Preload(fields ...field.RelationField) *fissionPrizeWheelLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionPrizeWheelLogDo) FirstOrInit() (*model.FissionPrizeWheelLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheelLog), nil + } +} + +func (f fissionPrizeWheelLogDo) FirstOrCreate() (*model.FissionPrizeWheelLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionPrizeWheelLog), nil + } +} + +func (f fissionPrizeWheelLogDo) FindByPage(offset int, limit int) (result []*model.FissionPrizeWheelLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionPrizeWheelLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionPrizeWheelLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionPrizeWheelLogDo) Delete(models ...*model.FissionPrizeWheelLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionPrizeWheelLogDo) withDO(do gen.Dao) *fissionPrizeWheelLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_qa.gen.go b/internal/repository/dao/fission_qa.gen.go new file mode 100644 index 0000000..aaf5776 --- /dev/null +++ b/internal/repository/dao/fission_qa.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionQa(db *gorm.DB, opts ...gen.DOOption) fissionQa { + _fissionQa := fissionQa{} + + _fissionQa.fissionQaDo.UseDB(db, opts...) + _fissionQa.fissionQaDo.UseModel(&model.FissionQa{}) + + tableName := _fissionQa.fissionQaDo.TableName() + _fissionQa.ALL = field.NewAsterisk(tableName) + _fissionQa.ID = field.NewInt64(tableName, "id") + _fissionQa.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionQa.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionQa.UserID = field.NewInt64(tableName, "user_id") + _fissionQa.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionQa.Chance = field.NewInt32(tableName, "chance") + _fissionQa.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionQa.DayChance = field.NewInt32(tableName, "day_chance") + _fissionQa.LastSign = field.NewString(tableName, "last_sign") + _fissionQa.SetInit = field.NewInt8(tableName, "set_init") + + _fissionQa.fillFieldMap() + + return _fissionQa +} + +type fissionQa struct { + fissionQaDo fissionQaDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 答题机会数 + TaskChance field.Int32 // 完成任务获取的答题次数 + DayChance field.Int32 // 每日签到获得的抽签数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionQa) Table(newTableName string) *fissionQa { + f.fissionQaDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionQa) As(alias string) *fissionQa { + f.fissionQaDo.DO = *(f.fissionQaDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionQa) updateTableName(table string) *fissionQa { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionQa) WithContext(ctx context.Context) *fissionQaDo { + return f.fissionQaDo.WithContext(ctx) +} + +func (f fissionQa) TableName() string { return f.fissionQaDo.TableName() } + +func (f fissionQa) Alias() string { return f.fissionQaDo.Alias() } + +func (f *fissionQa) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionQa) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionQa) clone(db *gorm.DB) fissionQa { + f.fissionQaDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionQa) replaceDB(db *gorm.DB) fissionQa { + f.fissionQaDo.ReplaceDB(db) + return f +} + +type fissionQaDo struct{ gen.DO } + +func (f fissionQaDo) Debug() *fissionQaDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionQaDo) WithContext(ctx context.Context) *fissionQaDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionQaDo) ReadDB() *fissionQaDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionQaDo) WriteDB() *fissionQaDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionQaDo) Session(config *gorm.Session) *fissionQaDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionQaDo) Clauses(conds ...clause.Expression) *fissionQaDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionQaDo) Returning(value interface{}, columns ...string) *fissionQaDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionQaDo) Not(conds ...gen.Condition) *fissionQaDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionQaDo) Or(conds ...gen.Condition) *fissionQaDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionQaDo) Select(conds ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionQaDo) Where(conds ...gen.Condition) *fissionQaDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionQaDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionQaDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionQaDo) Order(conds ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionQaDo) Distinct(cols ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionQaDo) Omit(cols ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionQaDo) Join(table schema.Tabler, on ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionQaDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionQaDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionQaDo) Group(cols ...field.Expr) *fissionQaDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionQaDo) Having(conds ...gen.Condition) *fissionQaDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionQaDo) Limit(limit int) *fissionQaDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionQaDo) Offset(offset int) *fissionQaDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionQaDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionQaDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionQaDo) Unscoped() *fissionQaDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionQaDo) Create(values ...*model.FissionQa) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionQaDo) CreateInBatches(values []*model.FissionQa, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionQaDo) Save(values ...*model.FissionQa) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionQaDo) First() (*model.FissionQa, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionQa), nil + } +} + +func (f fissionQaDo) Take() (*model.FissionQa, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionQa), nil + } +} + +func (f fissionQaDo) Last() (*model.FissionQa, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionQa), nil + } +} + +func (f fissionQaDo) Find() ([]*model.FissionQa, error) { + result, err := f.DO.Find() + return result.([]*model.FissionQa), err +} + +func (f fissionQaDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionQa, err error) { + buf := make([]*model.FissionQa, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionQaDo) FindInBatches(result *[]*model.FissionQa, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionQaDo) Attrs(attrs ...field.AssignExpr) *fissionQaDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionQaDo) Assign(attrs ...field.AssignExpr) *fissionQaDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionQaDo) Joins(fields ...field.RelationField) *fissionQaDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionQaDo) Preload(fields ...field.RelationField) *fissionQaDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionQaDo) FirstOrInit() (*model.FissionQa, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionQa), nil + } +} + +func (f fissionQaDo) FirstOrCreate() (*model.FissionQa, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionQa), nil + } +} + +func (f fissionQaDo) FindByPage(offset int, limit int) (result []*model.FissionQa, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionQaDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionQaDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionQaDo) Delete(models ...*model.FissionQa) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionQaDo) withDO(do gen.Dao) *fissionQaDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_qa_log.gen.go b/internal/repository/dao/fission_qa_log.gen.go new file mode 100644 index 0000000..13b6eac --- /dev/null +++ b/internal/repository/dao/fission_qa_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionQaLog(db *gorm.DB, opts ...gen.DOOption) fissionQaLog { + _fissionQaLog := fissionQaLog{} + + _fissionQaLog.fissionQaLogDo.UseDB(db, opts...) + _fissionQaLog.fissionQaLogDo.UseModel(&model.FissionQaLog{}) + + tableName := _fissionQaLog.fissionQaLogDo.TableName() + _fissionQaLog.ALL = field.NewAsterisk(tableName) + _fissionQaLog.ID = field.NewInt64(tableName, "id") + _fissionQaLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionQaLog.UserID = field.NewInt64(tableName, "user_id") + _fissionQaLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionQaLog.QaID = field.NewInt64(tableName, "qa_id") + _fissionQaLog.Type = field.NewInt8(tableName, "type") + _fissionQaLog.Source = field.NewString(tableName, "source") + _fissionQaLog.Val = field.NewString(tableName, "val") + + _fissionQaLog.fillFieldMap() + + return _fissionQaLog +} + +type fissionQaLog struct { + fissionQaLogDo fissionQaLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + QaID field.Int64 // 玩家id(fission_qa表id) + Type field.Int8 // 日志类型(1-获得答题机会,2-答题) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionQaLog) Table(newTableName string) *fissionQaLog { + f.fissionQaLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionQaLog) As(alias string) *fissionQaLog { + f.fissionQaLogDo.DO = *(f.fissionQaLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionQaLog) updateTableName(table string) *fissionQaLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.QaID = field.NewInt64(table, "qa_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionQaLog) WithContext(ctx context.Context) *fissionQaLogDo { + return f.fissionQaLogDo.WithContext(ctx) +} + +func (f fissionQaLog) TableName() string { return f.fissionQaLogDo.TableName() } + +func (f fissionQaLog) Alias() string { return f.fissionQaLogDo.Alias() } + +func (f *fissionQaLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionQaLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["qa_id"] = f.QaID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionQaLog) clone(db *gorm.DB) fissionQaLog { + f.fissionQaLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionQaLog) replaceDB(db *gorm.DB) fissionQaLog { + f.fissionQaLogDo.ReplaceDB(db) + return f +} + +type fissionQaLogDo struct{ gen.DO } + +func (f fissionQaLogDo) Debug() *fissionQaLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionQaLogDo) WithContext(ctx context.Context) *fissionQaLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionQaLogDo) ReadDB() *fissionQaLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionQaLogDo) WriteDB() *fissionQaLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionQaLogDo) Session(config *gorm.Session) *fissionQaLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionQaLogDo) Clauses(conds ...clause.Expression) *fissionQaLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionQaLogDo) Returning(value interface{}, columns ...string) *fissionQaLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionQaLogDo) Not(conds ...gen.Condition) *fissionQaLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionQaLogDo) Or(conds ...gen.Condition) *fissionQaLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionQaLogDo) Select(conds ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionQaLogDo) Where(conds ...gen.Condition) *fissionQaLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionQaLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionQaLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionQaLogDo) Order(conds ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionQaLogDo) Distinct(cols ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionQaLogDo) Omit(cols ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionQaLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionQaLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionQaLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionQaLogDo) Group(cols ...field.Expr) *fissionQaLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionQaLogDo) Having(conds ...gen.Condition) *fissionQaLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionQaLogDo) Limit(limit int) *fissionQaLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionQaLogDo) Offset(offset int) *fissionQaLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionQaLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionQaLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionQaLogDo) Unscoped() *fissionQaLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionQaLogDo) Create(values ...*model.FissionQaLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionQaLogDo) CreateInBatches(values []*model.FissionQaLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionQaLogDo) Save(values ...*model.FissionQaLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionQaLogDo) First() (*model.FissionQaLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionQaLog), nil + } +} + +func (f fissionQaLogDo) Take() (*model.FissionQaLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionQaLog), nil + } +} + +func (f fissionQaLogDo) Last() (*model.FissionQaLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionQaLog), nil + } +} + +func (f fissionQaLogDo) Find() ([]*model.FissionQaLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionQaLog), err +} + +func (f fissionQaLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionQaLog, err error) { + buf := make([]*model.FissionQaLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionQaLogDo) FindInBatches(result *[]*model.FissionQaLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionQaLogDo) Attrs(attrs ...field.AssignExpr) *fissionQaLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionQaLogDo) Assign(attrs ...field.AssignExpr) *fissionQaLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionQaLogDo) Joins(fields ...field.RelationField) *fissionQaLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionQaLogDo) Preload(fields ...field.RelationField) *fissionQaLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionQaLogDo) FirstOrInit() (*model.FissionQaLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionQaLog), nil + } +} + +func (f fissionQaLogDo) FirstOrCreate() (*model.FissionQaLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionQaLog), nil + } +} + +func (f fissionQaLogDo) FindByPage(offset int, limit int) (result []*model.FissionQaLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionQaLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionQaLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionQaLogDo) Delete(models ...*model.FissionQaLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionQaLogDo) withDO(do gen.Dao) *fissionQaLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_quiz.gen.go b/internal/repository/dao/fission_quiz.gen.go new file mode 100644 index 0000000..0db11c2 --- /dev/null +++ b/internal/repository/dao/fission_quiz.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionQuiz(db *gorm.DB, opts ...gen.DOOption) fissionQuiz { + _fissionQuiz := fissionQuiz{} + + _fissionQuiz.fissionQuizDo.UseDB(db, opts...) + _fissionQuiz.fissionQuizDo.UseModel(&model.FissionQuiz{}) + + tableName := _fissionQuiz.fissionQuizDo.TableName() + _fissionQuiz.ALL = field.NewAsterisk(tableName) + _fissionQuiz.ID = field.NewInt64(tableName, "id") + _fissionQuiz.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionQuiz.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionQuiz.UserID = field.NewInt64(tableName, "user_id") + _fissionQuiz.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionQuiz.Chance = field.NewInt32(tableName, "chance") + _fissionQuiz.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionQuiz.OptionID = field.NewInt64(tableName, "option_id") + _fissionQuiz.IsWin = field.NewInt8(tableName, "is_win") + _fissionQuiz.SetInit = field.NewInt8(tableName, "set_init") + + _fissionQuiz.fillFieldMap() + + return _fissionQuiz +} + +type fissionQuiz struct { + fissionQuizDo fissionQuizDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 投票机会数 + TaskChance field.Int32 // 完成任务获取的投票机会次数 + OptionID field.Int64 // 选项id(fission_campaign_quiz_option表) + IsWin field.Int8 // 是否赢得竞猜(0-否,1-是) + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionQuiz) Table(newTableName string) *fissionQuiz { + f.fissionQuizDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionQuiz) As(alias string) *fissionQuiz { + f.fissionQuizDo.DO = *(f.fissionQuizDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionQuiz) updateTableName(table string) *fissionQuiz { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.OptionID = field.NewInt64(table, "option_id") + f.IsWin = field.NewInt8(table, "is_win") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionQuiz) WithContext(ctx context.Context) *fissionQuizDo { + return f.fissionQuizDo.WithContext(ctx) +} + +func (f fissionQuiz) TableName() string { return f.fissionQuizDo.TableName() } + +func (f fissionQuiz) Alias() string { return f.fissionQuizDo.Alias() } + +func (f *fissionQuiz) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionQuiz) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["option_id"] = f.OptionID + f.fieldMap["is_win"] = f.IsWin + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionQuiz) clone(db *gorm.DB) fissionQuiz { + f.fissionQuizDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionQuiz) replaceDB(db *gorm.DB) fissionQuiz { + f.fissionQuizDo.ReplaceDB(db) + return f +} + +type fissionQuizDo struct{ gen.DO } + +func (f fissionQuizDo) Debug() *fissionQuizDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionQuizDo) WithContext(ctx context.Context) *fissionQuizDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionQuizDo) ReadDB() *fissionQuizDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionQuizDo) WriteDB() *fissionQuizDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionQuizDo) Session(config *gorm.Session) *fissionQuizDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionQuizDo) Clauses(conds ...clause.Expression) *fissionQuizDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionQuizDo) Returning(value interface{}, columns ...string) *fissionQuizDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionQuizDo) Not(conds ...gen.Condition) *fissionQuizDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionQuizDo) Or(conds ...gen.Condition) *fissionQuizDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionQuizDo) Select(conds ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionQuizDo) Where(conds ...gen.Condition) *fissionQuizDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionQuizDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionQuizDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionQuizDo) Order(conds ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionQuizDo) Distinct(cols ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionQuizDo) Omit(cols ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionQuizDo) Join(table schema.Tabler, on ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionQuizDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionQuizDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionQuizDo) Group(cols ...field.Expr) *fissionQuizDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionQuizDo) Having(conds ...gen.Condition) *fissionQuizDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionQuizDo) Limit(limit int) *fissionQuizDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionQuizDo) Offset(offset int) *fissionQuizDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionQuizDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionQuizDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionQuizDo) Unscoped() *fissionQuizDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionQuizDo) Create(values ...*model.FissionQuiz) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionQuizDo) CreateInBatches(values []*model.FissionQuiz, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionQuizDo) Save(values ...*model.FissionQuiz) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionQuizDo) First() (*model.FissionQuiz, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuiz), nil + } +} + +func (f fissionQuizDo) Take() (*model.FissionQuiz, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuiz), nil + } +} + +func (f fissionQuizDo) Last() (*model.FissionQuiz, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuiz), nil + } +} + +func (f fissionQuizDo) Find() ([]*model.FissionQuiz, error) { + result, err := f.DO.Find() + return result.([]*model.FissionQuiz), err +} + +func (f fissionQuizDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionQuiz, err error) { + buf := make([]*model.FissionQuiz, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionQuizDo) FindInBatches(result *[]*model.FissionQuiz, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionQuizDo) Attrs(attrs ...field.AssignExpr) *fissionQuizDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionQuizDo) Assign(attrs ...field.AssignExpr) *fissionQuizDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionQuizDo) Joins(fields ...field.RelationField) *fissionQuizDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionQuizDo) Preload(fields ...field.RelationField) *fissionQuizDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionQuizDo) FirstOrInit() (*model.FissionQuiz, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuiz), nil + } +} + +func (f fissionQuizDo) FirstOrCreate() (*model.FissionQuiz, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuiz), nil + } +} + +func (f fissionQuizDo) FindByPage(offset int, limit int) (result []*model.FissionQuiz, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionQuizDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionQuizDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionQuizDo) Delete(models ...*model.FissionQuiz) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionQuizDo) withDO(do gen.Dao) *fissionQuizDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_quiz_log.gen.go b/internal/repository/dao/fission_quiz_log.gen.go new file mode 100644 index 0000000..20cfcd3 --- /dev/null +++ b/internal/repository/dao/fission_quiz_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionQuizLog(db *gorm.DB, opts ...gen.DOOption) fissionQuizLog { + _fissionQuizLog := fissionQuizLog{} + + _fissionQuizLog.fissionQuizLogDo.UseDB(db, opts...) + _fissionQuizLog.fissionQuizLogDo.UseModel(&model.FissionQuizLog{}) + + tableName := _fissionQuizLog.fissionQuizLogDo.TableName() + _fissionQuizLog.ALL = field.NewAsterisk(tableName) + _fissionQuizLog.ID = field.NewInt64(tableName, "id") + _fissionQuizLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionQuizLog.UserID = field.NewInt64(tableName, "user_id") + _fissionQuizLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionQuizLog.QuizID = field.NewInt64(tableName, "quiz_id") + _fissionQuizLog.Type = field.NewInt8(tableName, "type") + _fissionQuizLog.Source = field.NewString(tableName, "source") + _fissionQuizLog.Val = field.NewString(tableName, "val") + + _fissionQuizLog.fillFieldMap() + + return _fissionQuizLog +} + +type fissionQuizLog struct { + fissionQuizLogDo fissionQuizLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + QuizID field.Int64 // 玩家id(fission_quiz表id) + Type field.Int8 // 日志类型(1-获得投票机会,2-投票,3-获得奖品) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionQuizLog) Table(newTableName string) *fissionQuizLog { + f.fissionQuizLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionQuizLog) As(alias string) *fissionQuizLog { + f.fissionQuizLogDo.DO = *(f.fissionQuizLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionQuizLog) updateTableName(table string) *fissionQuizLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.QuizID = field.NewInt64(table, "quiz_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionQuizLog) WithContext(ctx context.Context) *fissionQuizLogDo { + return f.fissionQuizLogDo.WithContext(ctx) +} + +func (f fissionQuizLog) TableName() string { return f.fissionQuizLogDo.TableName() } + +func (f fissionQuizLog) Alias() string { return f.fissionQuizLogDo.Alias() } + +func (f *fissionQuizLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionQuizLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["quiz_id"] = f.QuizID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionQuizLog) clone(db *gorm.DB) fissionQuizLog { + f.fissionQuizLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionQuizLog) replaceDB(db *gorm.DB) fissionQuizLog { + f.fissionQuizLogDo.ReplaceDB(db) + return f +} + +type fissionQuizLogDo struct{ gen.DO } + +func (f fissionQuizLogDo) Debug() *fissionQuizLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionQuizLogDo) WithContext(ctx context.Context) *fissionQuizLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionQuizLogDo) ReadDB() *fissionQuizLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionQuizLogDo) WriteDB() *fissionQuizLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionQuizLogDo) Session(config *gorm.Session) *fissionQuizLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionQuizLogDo) Clauses(conds ...clause.Expression) *fissionQuizLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionQuizLogDo) Returning(value interface{}, columns ...string) *fissionQuizLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionQuizLogDo) Not(conds ...gen.Condition) *fissionQuizLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionQuizLogDo) Or(conds ...gen.Condition) *fissionQuizLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionQuizLogDo) Select(conds ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionQuizLogDo) Where(conds ...gen.Condition) *fissionQuizLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionQuizLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionQuizLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionQuizLogDo) Order(conds ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionQuizLogDo) Distinct(cols ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionQuizLogDo) Omit(cols ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionQuizLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionQuizLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionQuizLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionQuizLogDo) Group(cols ...field.Expr) *fissionQuizLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionQuizLogDo) Having(conds ...gen.Condition) *fissionQuizLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionQuizLogDo) Limit(limit int) *fissionQuizLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionQuizLogDo) Offset(offset int) *fissionQuizLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionQuizLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionQuizLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionQuizLogDo) Unscoped() *fissionQuizLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionQuizLogDo) Create(values ...*model.FissionQuizLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionQuizLogDo) CreateInBatches(values []*model.FissionQuizLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionQuizLogDo) Save(values ...*model.FissionQuizLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionQuizLogDo) First() (*model.FissionQuizLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuizLog), nil + } +} + +func (f fissionQuizLogDo) Take() (*model.FissionQuizLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuizLog), nil + } +} + +func (f fissionQuizLogDo) Last() (*model.FissionQuizLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuizLog), nil + } +} + +func (f fissionQuizLogDo) Find() ([]*model.FissionQuizLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionQuizLog), err +} + +func (f fissionQuizLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionQuizLog, err error) { + buf := make([]*model.FissionQuizLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionQuizLogDo) FindInBatches(result *[]*model.FissionQuizLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionQuizLogDo) Attrs(attrs ...field.AssignExpr) *fissionQuizLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionQuizLogDo) Assign(attrs ...field.AssignExpr) *fissionQuizLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionQuizLogDo) Joins(fields ...field.RelationField) *fissionQuizLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionQuizLogDo) Preload(fields ...field.RelationField) *fissionQuizLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionQuizLogDo) FirstOrInit() (*model.FissionQuizLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuizLog), nil + } +} + +func (f fissionQuizLogDo) FirstOrCreate() (*model.FissionQuizLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionQuizLog), nil + } +} + +func (f fissionQuizLogDo) FindByPage(offset int, limit int) (result []*model.FissionQuizLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionQuizLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionQuizLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionQuizLogDo) Delete(models ...*model.FissionQuizLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionQuizLogDo) withDO(do gen.Dao) *fissionQuizLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_referral.gen.go b/internal/repository/dao/fission_referral.gen.go new file mode 100644 index 0000000..2169bf3 --- /dev/null +++ b/internal/repository/dao/fission_referral.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionReferral(db *gorm.DB, opts ...gen.DOOption) fissionReferral { + _fissionReferral := fissionReferral{} + + _fissionReferral.fissionReferralDo.UseDB(db, opts...) + _fissionReferral.fissionReferralDo.UseModel(&model.FissionReferral{}) + + tableName := _fissionReferral.fissionReferralDo.TableName() + _fissionReferral.ALL = field.NewAsterisk(tableName) + _fissionReferral.ID = field.NewInt64(tableName, "id") + _fissionReferral.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionReferral.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionReferral.IsDel = field.NewInt8(tableName, "is_del") + _fissionReferral.UserID = field.NewInt64(tableName, "user_id") + _fissionReferral.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionReferral.LimitStatus = field.NewInt8(tableName, "limit_status") + _fissionReferral.BindInstall = field.NewInt8(tableName, "bind_install") + _fissionReferral.BindRegister = field.NewInt8(tableName, "bind_register") + _fissionReferral.NextStep = field.NewInt32(tableName, "next_step") + _fissionReferral.LoopInvite = field.NewInt32(tableName, "loop_invite") + + _fissionReferral.fillFieldMap() + + return _fissionReferral +} + +type fissionReferral struct { + fissionReferralDo fissionReferralDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + LimitStatus field.Int8 // 任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制) + BindInstall field.Int8 // 是否绑定了安装事件(0-否,1-是) + BindRegister field.Int8 // 是否绑定了注册事件(0-否,1-是) + NextStep field.Int32 // 可领取的下一阶段奖品 + LoopInvite field.Int32 // 当前循环的数 + + fieldMap map[string]field.Expr +} + +func (f fissionReferral) Table(newTableName string) *fissionReferral { + f.fissionReferralDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionReferral) As(alias string) *fissionReferral { + f.fissionReferralDo.DO = *(f.fissionReferralDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionReferral) updateTableName(table string) *fissionReferral { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.LimitStatus = field.NewInt8(table, "limit_status") + f.BindInstall = field.NewInt8(table, "bind_install") + f.BindRegister = field.NewInt8(table, "bind_register") + f.NextStep = field.NewInt32(table, "next_step") + f.LoopInvite = field.NewInt32(table, "loop_invite") + + f.fillFieldMap() + + return f +} + +func (f *fissionReferral) WithContext(ctx context.Context) *fissionReferralDo { + return f.fissionReferralDo.WithContext(ctx) +} + +func (f fissionReferral) TableName() string { return f.fissionReferralDo.TableName() } + +func (f fissionReferral) Alias() string { return f.fissionReferralDo.Alias() } + +func (f *fissionReferral) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionReferral) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["limit_status"] = f.LimitStatus + f.fieldMap["bind_install"] = f.BindInstall + f.fieldMap["bind_register"] = f.BindRegister + f.fieldMap["next_step"] = f.NextStep + f.fieldMap["loop_invite"] = f.LoopInvite +} + +func (f fissionReferral) clone(db *gorm.DB) fissionReferral { + f.fissionReferralDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionReferral) replaceDB(db *gorm.DB) fissionReferral { + f.fissionReferralDo.ReplaceDB(db) + return f +} + +type fissionReferralDo struct{ gen.DO } + +func (f fissionReferralDo) Debug() *fissionReferralDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionReferralDo) WithContext(ctx context.Context) *fissionReferralDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionReferralDo) ReadDB() *fissionReferralDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionReferralDo) WriteDB() *fissionReferralDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionReferralDo) Session(config *gorm.Session) *fissionReferralDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionReferralDo) Clauses(conds ...clause.Expression) *fissionReferralDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionReferralDo) Returning(value interface{}, columns ...string) *fissionReferralDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionReferralDo) Not(conds ...gen.Condition) *fissionReferralDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionReferralDo) Or(conds ...gen.Condition) *fissionReferralDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionReferralDo) Select(conds ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionReferralDo) Where(conds ...gen.Condition) *fissionReferralDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionReferralDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionReferralDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionReferralDo) Order(conds ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionReferralDo) Distinct(cols ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionReferralDo) Omit(cols ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionReferralDo) Join(table schema.Tabler, on ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionReferralDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionReferralDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionReferralDo) Group(cols ...field.Expr) *fissionReferralDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionReferralDo) Having(conds ...gen.Condition) *fissionReferralDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionReferralDo) Limit(limit int) *fissionReferralDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionReferralDo) Offset(offset int) *fissionReferralDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionReferralDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionReferralDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionReferralDo) Unscoped() *fissionReferralDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionReferralDo) Create(values ...*model.FissionReferral) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionReferralDo) CreateInBatches(values []*model.FissionReferral, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionReferralDo) Save(values ...*model.FissionReferral) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionReferralDo) First() (*model.FissionReferral, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionReferral), nil + } +} + +func (f fissionReferralDo) Take() (*model.FissionReferral, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionReferral), nil + } +} + +func (f fissionReferralDo) Last() (*model.FissionReferral, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionReferral), nil + } +} + +func (f fissionReferralDo) Find() ([]*model.FissionReferral, error) { + result, err := f.DO.Find() + return result.([]*model.FissionReferral), err +} + +func (f fissionReferralDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionReferral, err error) { + buf := make([]*model.FissionReferral, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionReferralDo) FindInBatches(result *[]*model.FissionReferral, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionReferralDo) Attrs(attrs ...field.AssignExpr) *fissionReferralDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionReferralDo) Assign(attrs ...field.AssignExpr) *fissionReferralDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionReferralDo) Joins(fields ...field.RelationField) *fissionReferralDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionReferralDo) Preload(fields ...field.RelationField) *fissionReferralDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionReferralDo) FirstOrInit() (*model.FissionReferral, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionReferral), nil + } +} + +func (f fissionReferralDo) FirstOrCreate() (*model.FissionReferral, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionReferral), nil + } +} + +func (f fissionReferralDo) FindByPage(offset int, limit int) (result []*model.FissionReferral, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionReferralDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionReferralDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionReferralDo) Delete(models ...*model.FissionReferral) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionReferralDo) withDO(do gen.Dao) *fissionReferralDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_reward_record.gen.go b/internal/repository/dao/fission_reward_record.gen.go new file mode 100644 index 0000000..556974b --- /dev/null +++ b/internal/repository/dao/fission_reward_record.gen.go @@ -0,0 +1,423 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionRewardRecord(db *gorm.DB, opts ...gen.DOOption) fissionRewardRecord { + _fissionRewardRecord := fissionRewardRecord{} + + _fissionRewardRecord.fissionRewardRecordDo.UseDB(db, opts...) + _fissionRewardRecord.fissionRewardRecordDo.UseModel(&model.FissionRewardRecord{}) + + tableName := _fissionRewardRecord.fissionRewardRecordDo.TableName() + _fissionRewardRecord.ALL = field.NewAsterisk(tableName) + _fissionRewardRecord.ID = field.NewInt64(tableName, "id") + _fissionRewardRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionRewardRecord.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionRewardRecord.HashID = field.NewString(tableName, "hash_id") + _fissionRewardRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionRewardRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionRewardRecord.RewardID = field.NewInt64(tableName, "reward_id") + _fissionRewardRecord.Title = field.NewString(tableName, "title") + _fissionRewardRecord.ImgURL = field.NewString(tableName, "img_url") + _fissionRewardRecord.RewardType = field.NewInt8(tableName, "reward_type") + _fissionRewardRecord.RewardNum = field.NewInt32(tableName, "reward_num") + _fissionRewardRecord.Step = field.NewInt32(tableName, "step") + _fissionRewardRecord.IsThank = field.NewInt8(tableName, "is_thank") + _fissionRewardRecord.Score = field.NewInt32(tableName, "score") + _fissionRewardRecord.Answer = field.NewString(tableName, "answer") + _fissionRewardRecord.Status = field.NewInt8(tableName, "status") + _fissionRewardRecord.FailType = field.NewString(tableName, "fail_type") + _fissionRewardRecord.FailMsg = field.NewString(tableName, "fail_msg") + _fissionRewardRecord.BaseRewardID = field.NewInt64(tableName, "base_reward_id") + _fissionRewardRecord.CustomRewardVal = field.NewString(tableName, "custom_reward_val") + _fissionRewardRecord.PropMark = field.NewString(tableName, "prop_mark") + _fissionRewardRecord.ChildID = field.NewInt64(tableName, "child_id") + _fissionRewardRecord.MallRecordID = field.NewInt64(tableName, "mall_record_id") + _fissionRewardRecord.ExchangePoints = field.NewInt32(tableName, "exchange_points") + + _fissionRewardRecord.fillFieldMap() + + return _fissionRewardRecord +} + +type fissionRewardRecord struct { + fissionRewardRecordDo fissionRewardRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 奖品对外id + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户id(fission_user表) + RewardID field.Int64 // 奖品id(fission_campaign_reward表) + Title field.String // 奖品名称 + ImgURL field.String // 奖品图片 + RewardType field.Int8 // 奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品) + RewardNum field.Int32 // 获得的奖品数量 + Step field.Int32 // 奖励阶段 + IsThank field.Int8 // 是否谢谢参与奖(0-否,1-是) + Score field.Int32 // 领取奖品的分数 + Answer field.String // 答卷内容 + Status field.Int8 // 奖品状态(1-处理成功,2-待推送,3-推送失败,4-手动发放,5-待填写表单,6-已填写表单) + FailType field.String // 失败原因标识 + FailMsg field.String // 具体失败原因 + BaseRewardID field.Int64 // 基础奖品id(reward表) + CustomRewardVal field.String // 回调后接收到的数据 + PropMark field.String // 道具类型(reward-奖品,chance-活动道具) + ChildID field.Int64 // 子活动id + MallRecordID field.Int64 // 商城商品id + ExchangePoints field.Int32 // 兑换所需积分 + + fieldMap map[string]field.Expr +} + +func (f fissionRewardRecord) Table(newTableName string) *fissionRewardRecord { + f.fissionRewardRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionRewardRecord) As(alias string) *fissionRewardRecord { + f.fissionRewardRecordDo.DO = *(f.fissionRewardRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionRewardRecord) updateTableName(table string) *fissionRewardRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.Title = field.NewString(table, "title") + f.ImgURL = field.NewString(table, "img_url") + f.RewardType = field.NewInt8(table, "reward_type") + f.RewardNum = field.NewInt32(table, "reward_num") + f.Step = field.NewInt32(table, "step") + f.IsThank = field.NewInt8(table, "is_thank") + f.Score = field.NewInt32(table, "score") + f.Answer = field.NewString(table, "answer") + f.Status = field.NewInt8(table, "status") + f.FailType = field.NewString(table, "fail_type") + f.FailMsg = field.NewString(table, "fail_msg") + f.BaseRewardID = field.NewInt64(table, "base_reward_id") + f.CustomRewardVal = field.NewString(table, "custom_reward_val") + f.PropMark = field.NewString(table, "prop_mark") + f.ChildID = field.NewInt64(table, "child_id") + f.MallRecordID = field.NewInt64(table, "mall_record_id") + f.ExchangePoints = field.NewInt32(table, "exchange_points") + + f.fillFieldMap() + + return f +} + +func (f *fissionRewardRecord) WithContext(ctx context.Context) *fissionRewardRecordDo { + return f.fissionRewardRecordDo.WithContext(ctx) +} + +func (f fissionRewardRecord) TableName() string { return f.fissionRewardRecordDo.TableName() } + +func (f fissionRewardRecord) Alias() string { return f.fissionRewardRecordDo.Alias() } + +func (f *fissionRewardRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionRewardRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 24) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["title"] = f.Title + f.fieldMap["img_url"] = f.ImgURL + f.fieldMap["reward_type"] = f.RewardType + f.fieldMap["reward_num"] = f.RewardNum + f.fieldMap["step"] = f.Step + f.fieldMap["is_thank"] = f.IsThank + f.fieldMap["score"] = f.Score + f.fieldMap["answer"] = f.Answer + f.fieldMap["status"] = f.Status + f.fieldMap["fail_type"] = f.FailType + f.fieldMap["fail_msg"] = f.FailMsg + f.fieldMap["base_reward_id"] = f.BaseRewardID + f.fieldMap["custom_reward_val"] = f.CustomRewardVal + f.fieldMap["prop_mark"] = f.PropMark + f.fieldMap["child_id"] = f.ChildID + f.fieldMap["mall_record_id"] = f.MallRecordID + f.fieldMap["exchange_points"] = f.ExchangePoints +} + +func (f fissionRewardRecord) clone(db *gorm.DB) fissionRewardRecord { + f.fissionRewardRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionRewardRecord) replaceDB(db *gorm.DB) fissionRewardRecord { + f.fissionRewardRecordDo.ReplaceDB(db) + return f +} + +type fissionRewardRecordDo struct{ gen.DO } + +func (f fissionRewardRecordDo) Debug() *fissionRewardRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionRewardRecordDo) WithContext(ctx context.Context) *fissionRewardRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionRewardRecordDo) ReadDB() *fissionRewardRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionRewardRecordDo) WriteDB() *fissionRewardRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionRewardRecordDo) Session(config *gorm.Session) *fissionRewardRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionRewardRecordDo) Clauses(conds ...clause.Expression) *fissionRewardRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionRewardRecordDo) Returning(value interface{}, columns ...string) *fissionRewardRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionRewardRecordDo) Not(conds ...gen.Condition) *fissionRewardRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionRewardRecordDo) Or(conds ...gen.Condition) *fissionRewardRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionRewardRecordDo) Select(conds ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionRewardRecordDo) Where(conds ...gen.Condition) *fissionRewardRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionRewardRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionRewardRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionRewardRecordDo) Order(conds ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionRewardRecordDo) Distinct(cols ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionRewardRecordDo) Omit(cols ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionRewardRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionRewardRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionRewardRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionRewardRecordDo) Group(cols ...field.Expr) *fissionRewardRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionRewardRecordDo) Having(conds ...gen.Condition) *fissionRewardRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionRewardRecordDo) Limit(limit int) *fissionRewardRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionRewardRecordDo) Offset(offset int) *fissionRewardRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionRewardRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionRewardRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionRewardRecordDo) Unscoped() *fissionRewardRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionRewardRecordDo) Create(values ...*model.FissionRewardRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionRewardRecordDo) CreateInBatches(values []*model.FissionRewardRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionRewardRecordDo) Save(values ...*model.FissionRewardRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionRewardRecordDo) First() (*model.FissionRewardRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecord), nil + } +} + +func (f fissionRewardRecordDo) Take() (*model.FissionRewardRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecord), nil + } +} + +func (f fissionRewardRecordDo) Last() (*model.FissionRewardRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecord), nil + } +} + +func (f fissionRewardRecordDo) Find() ([]*model.FissionRewardRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionRewardRecord), err +} + +func (f fissionRewardRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionRewardRecord, err error) { + buf := make([]*model.FissionRewardRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionRewardRecordDo) FindInBatches(result *[]*model.FissionRewardRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionRewardRecordDo) Attrs(attrs ...field.AssignExpr) *fissionRewardRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionRewardRecordDo) Assign(attrs ...field.AssignExpr) *fissionRewardRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionRewardRecordDo) Joins(fields ...field.RelationField) *fissionRewardRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionRewardRecordDo) Preload(fields ...field.RelationField) *fissionRewardRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionRewardRecordDo) FirstOrInit() (*model.FissionRewardRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecord), nil + } +} + +func (f fissionRewardRecordDo) FirstOrCreate() (*model.FissionRewardRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecord), nil + } +} + +func (f fissionRewardRecordDo) FindByPage(offset int, limit int) (result []*model.FissionRewardRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionRewardRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionRewardRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionRewardRecordDo) Delete(models ...*model.FissionRewardRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionRewardRecordDo) withDO(do gen.Dao) *fissionRewardRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_reward_record_form.gen.go b/internal/repository/dao/fission_reward_record_form.gen.go new file mode 100644 index 0000000..a354e82 --- /dev/null +++ b/internal/repository/dao/fission_reward_record_form.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionRewardRecordForm(db *gorm.DB, opts ...gen.DOOption) fissionRewardRecordForm { + _fissionRewardRecordForm := fissionRewardRecordForm{} + + _fissionRewardRecordForm.fissionRewardRecordFormDo.UseDB(db, opts...) + _fissionRewardRecordForm.fissionRewardRecordFormDo.UseModel(&model.FissionRewardRecordForm{}) + + tableName := _fissionRewardRecordForm.fissionRewardRecordFormDo.TableName() + _fissionRewardRecordForm.ALL = field.NewAsterisk(tableName) + _fissionRewardRecordForm.ID = field.NewInt64(tableName, "id") + _fissionRewardRecordForm.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionRewardRecordForm.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionRewardRecordForm.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionRewardRecordForm.RecordID = field.NewInt64(tableName, "record_id") + _fissionRewardRecordForm.FormID = field.NewInt64(tableName, "form_id") + _fissionRewardRecordForm.Items = field.NewString(tableName, "items") + + _fissionRewardRecordForm.fillFieldMap() + + return _fissionRewardRecordForm +} + +type fissionRewardRecordForm struct { + fissionRewardRecordFormDo fissionRewardRecordFormDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + RecordID field.Int64 // 奖品记录ID(fission_reward_record_form) + FormID field.Int64 // 表单id(form表) + Items field.String // 表单数据 + + fieldMap map[string]field.Expr +} + +func (f fissionRewardRecordForm) Table(newTableName string) *fissionRewardRecordForm { + f.fissionRewardRecordFormDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionRewardRecordForm) As(alias string) *fissionRewardRecordForm { + f.fissionRewardRecordFormDo.DO = *(f.fissionRewardRecordFormDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionRewardRecordForm) updateTableName(table string) *fissionRewardRecordForm { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.RecordID = field.NewInt64(table, "record_id") + f.FormID = field.NewInt64(table, "form_id") + f.Items = field.NewString(table, "items") + + f.fillFieldMap() + + return f +} + +func (f *fissionRewardRecordForm) WithContext(ctx context.Context) *fissionRewardRecordFormDo { + return f.fissionRewardRecordFormDo.WithContext(ctx) +} + +func (f fissionRewardRecordForm) TableName() string { return f.fissionRewardRecordFormDo.TableName() } + +func (f fissionRewardRecordForm) Alias() string { return f.fissionRewardRecordFormDo.Alias() } + +func (f *fissionRewardRecordForm) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionRewardRecordForm) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["record_id"] = f.RecordID + f.fieldMap["form_id"] = f.FormID + f.fieldMap["items"] = f.Items +} + +func (f fissionRewardRecordForm) clone(db *gorm.DB) fissionRewardRecordForm { + f.fissionRewardRecordFormDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionRewardRecordForm) replaceDB(db *gorm.DB) fissionRewardRecordForm { + f.fissionRewardRecordFormDo.ReplaceDB(db) + return f +} + +type fissionRewardRecordFormDo struct{ gen.DO } + +func (f fissionRewardRecordFormDo) Debug() *fissionRewardRecordFormDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionRewardRecordFormDo) WithContext(ctx context.Context) *fissionRewardRecordFormDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionRewardRecordFormDo) ReadDB() *fissionRewardRecordFormDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionRewardRecordFormDo) WriteDB() *fissionRewardRecordFormDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionRewardRecordFormDo) Session(config *gorm.Session) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionRewardRecordFormDo) Clauses(conds ...clause.Expression) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionRewardRecordFormDo) Returning(value interface{}, columns ...string) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionRewardRecordFormDo) Not(conds ...gen.Condition) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionRewardRecordFormDo) Or(conds ...gen.Condition) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionRewardRecordFormDo) Select(conds ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionRewardRecordFormDo) Where(conds ...gen.Condition) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionRewardRecordFormDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionRewardRecordFormDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionRewardRecordFormDo) Order(conds ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionRewardRecordFormDo) Distinct(cols ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionRewardRecordFormDo) Omit(cols ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionRewardRecordFormDo) Join(table schema.Tabler, on ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionRewardRecordFormDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionRewardRecordFormDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionRewardRecordFormDo) Group(cols ...field.Expr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionRewardRecordFormDo) Having(conds ...gen.Condition) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionRewardRecordFormDo) Limit(limit int) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionRewardRecordFormDo) Offset(offset int) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionRewardRecordFormDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionRewardRecordFormDo) Unscoped() *fissionRewardRecordFormDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionRewardRecordFormDo) Create(values ...*model.FissionRewardRecordForm) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionRewardRecordFormDo) CreateInBatches(values []*model.FissionRewardRecordForm, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionRewardRecordFormDo) Save(values ...*model.FissionRewardRecordForm) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionRewardRecordFormDo) First() (*model.FissionRewardRecordForm, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecordForm), nil + } +} + +func (f fissionRewardRecordFormDo) Take() (*model.FissionRewardRecordForm, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecordForm), nil + } +} + +func (f fissionRewardRecordFormDo) Last() (*model.FissionRewardRecordForm, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecordForm), nil + } +} + +func (f fissionRewardRecordFormDo) Find() ([]*model.FissionRewardRecordForm, error) { + result, err := f.DO.Find() + return result.([]*model.FissionRewardRecordForm), err +} + +func (f fissionRewardRecordFormDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionRewardRecordForm, err error) { + buf := make([]*model.FissionRewardRecordForm, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionRewardRecordFormDo) FindInBatches(result *[]*model.FissionRewardRecordForm, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionRewardRecordFormDo) Attrs(attrs ...field.AssignExpr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionRewardRecordFormDo) Assign(attrs ...field.AssignExpr) *fissionRewardRecordFormDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionRewardRecordFormDo) Joins(fields ...field.RelationField) *fissionRewardRecordFormDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionRewardRecordFormDo) Preload(fields ...field.RelationField) *fissionRewardRecordFormDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionRewardRecordFormDo) FirstOrInit() (*model.FissionRewardRecordForm, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecordForm), nil + } +} + +func (f fissionRewardRecordFormDo) FirstOrCreate() (*model.FissionRewardRecordForm, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionRewardRecordForm), nil + } +} + +func (f fissionRewardRecordFormDo) FindByPage(offset int, limit int) (result []*model.FissionRewardRecordForm, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionRewardRecordFormDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionRewardRecordFormDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionRewardRecordFormDo) Delete(models ...*model.FissionRewardRecordForm) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionRewardRecordFormDo) withDO(do gen.Dao) *fissionRewardRecordFormDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_sign.gen.go b/internal/repository/dao/fission_sign.gen.go new file mode 100644 index 0000000..b39909e --- /dev/null +++ b/internal/repository/dao/fission_sign.gen.go @@ -0,0 +1,383 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionSign(db *gorm.DB, opts ...gen.DOOption) fissionSign { + _fissionSign := fissionSign{} + + _fissionSign.fissionSignDo.UseDB(db, opts...) + _fissionSign.fissionSignDo.UseModel(&model.FissionSign{}) + + tableName := _fissionSign.fissionSignDo.TableName() + _fissionSign.ALL = field.NewAsterisk(tableName) + _fissionSign.ID = field.NewInt64(tableName, "id") + _fissionSign.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionSign.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionSign.UserID = field.NewInt64(tableName, "user_id") + _fissionSign.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionSign.SignDay = field.NewInt32(tableName, "sign_day") + _fissionSign.SignContinue = field.NewInt32(tableName, "sign_continue") + _fissionSign.CardNum = field.NewInt32(tableName, "card_num") + _fissionSign.TaskCard = field.NewInt32(tableName, "task_card") + _fissionSign.SignStart = field.NewInt64(tableName, "sign_start") + _fissionSign.MaxContinue = field.NewInt32(tableName, "max_continue") + _fissionSign.LoopNum = field.NewInt32(tableName, "loop_num") + _fissionSign.NextStep = field.NewInt32(tableName, "next_step") + _fissionSign.CycleStart = field.NewInt64(tableName, "cycle_start") + + _fissionSign.fillFieldMap() + + return _fissionSign +} + +type fissionSign struct { + fissionSignDo fissionSignDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + SignDay field.Int32 // 签到天数 + SignContinue field.Int32 // 连续签到天数 + CardNum field.Int32 // 签到卡数量 + TaskCard field.Int32 // 邀请获得的签到卡数 + SignStart field.Int64 // 开始签到时间 + MaxContinue field.Int32 // 最大连签天数 + LoopNum field.Int32 // 完成的循环数 + NextStep field.Int32 // 下一阶完成 + CycleStart field.Int64 // 周期开始时间 + + fieldMap map[string]field.Expr +} + +func (f fissionSign) Table(newTableName string) *fissionSign { + f.fissionSignDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionSign) As(alias string) *fissionSign { + f.fissionSignDo.DO = *(f.fissionSignDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionSign) updateTableName(table string) *fissionSign { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.SignDay = field.NewInt32(table, "sign_day") + f.SignContinue = field.NewInt32(table, "sign_continue") + f.CardNum = field.NewInt32(table, "card_num") + f.TaskCard = field.NewInt32(table, "task_card") + f.SignStart = field.NewInt64(table, "sign_start") + f.MaxContinue = field.NewInt32(table, "max_continue") + f.LoopNum = field.NewInt32(table, "loop_num") + f.NextStep = field.NewInt32(table, "next_step") + f.CycleStart = field.NewInt64(table, "cycle_start") + + f.fillFieldMap() + + return f +} + +func (f *fissionSign) WithContext(ctx context.Context) *fissionSignDo { + return f.fissionSignDo.WithContext(ctx) +} + +func (f fissionSign) TableName() string { return f.fissionSignDo.TableName() } + +func (f fissionSign) Alias() string { return f.fissionSignDo.Alias() } + +func (f *fissionSign) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionSign) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 14) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["sign_day"] = f.SignDay + f.fieldMap["sign_continue"] = f.SignContinue + f.fieldMap["card_num"] = f.CardNum + f.fieldMap["task_card"] = f.TaskCard + f.fieldMap["sign_start"] = f.SignStart + f.fieldMap["max_continue"] = f.MaxContinue + f.fieldMap["loop_num"] = f.LoopNum + f.fieldMap["next_step"] = f.NextStep + f.fieldMap["cycle_start"] = f.CycleStart +} + +func (f fissionSign) clone(db *gorm.DB) fissionSign { + f.fissionSignDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionSign) replaceDB(db *gorm.DB) fissionSign { + f.fissionSignDo.ReplaceDB(db) + return f +} + +type fissionSignDo struct{ gen.DO } + +func (f fissionSignDo) Debug() *fissionSignDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionSignDo) WithContext(ctx context.Context) *fissionSignDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionSignDo) ReadDB() *fissionSignDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionSignDo) WriteDB() *fissionSignDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionSignDo) Session(config *gorm.Session) *fissionSignDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionSignDo) Clauses(conds ...clause.Expression) *fissionSignDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionSignDo) Returning(value interface{}, columns ...string) *fissionSignDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionSignDo) Not(conds ...gen.Condition) *fissionSignDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionSignDo) Or(conds ...gen.Condition) *fissionSignDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionSignDo) Select(conds ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionSignDo) Where(conds ...gen.Condition) *fissionSignDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionSignDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionSignDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionSignDo) Order(conds ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionSignDo) Distinct(cols ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionSignDo) Omit(cols ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionSignDo) Join(table schema.Tabler, on ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionSignDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionSignDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionSignDo) Group(cols ...field.Expr) *fissionSignDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionSignDo) Having(conds ...gen.Condition) *fissionSignDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionSignDo) Limit(limit int) *fissionSignDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionSignDo) Offset(offset int) *fissionSignDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionSignDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionSignDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionSignDo) Unscoped() *fissionSignDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionSignDo) Create(values ...*model.FissionSign) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionSignDo) CreateInBatches(values []*model.FissionSign, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionSignDo) Save(values ...*model.FissionSign) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionSignDo) First() (*model.FissionSign, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionSign), nil + } +} + +func (f fissionSignDo) Take() (*model.FissionSign, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionSign), nil + } +} + +func (f fissionSignDo) Last() (*model.FissionSign, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionSign), nil + } +} + +func (f fissionSignDo) Find() ([]*model.FissionSign, error) { + result, err := f.DO.Find() + return result.([]*model.FissionSign), err +} + +func (f fissionSignDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionSign, err error) { + buf := make([]*model.FissionSign, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionSignDo) FindInBatches(result *[]*model.FissionSign, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionSignDo) Attrs(attrs ...field.AssignExpr) *fissionSignDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionSignDo) Assign(attrs ...field.AssignExpr) *fissionSignDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionSignDo) Joins(fields ...field.RelationField) *fissionSignDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionSignDo) Preload(fields ...field.RelationField) *fissionSignDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionSignDo) FirstOrInit() (*model.FissionSign, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionSign), nil + } +} + +func (f fissionSignDo) FirstOrCreate() (*model.FissionSign, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionSign), nil + } +} + +func (f fissionSignDo) FindByPage(offset int, limit int) (result []*model.FissionSign, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionSignDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionSignDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionSignDo) Delete(models ...*model.FissionSign) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionSignDo) withDO(do gen.Dao) *fissionSignDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_sign_day.gen.go b/internal/repository/dao/fission_sign_day.gen.go new file mode 100644 index 0000000..7eba4c8 --- /dev/null +++ b/internal/repository/dao/fission_sign_day.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionSignDay(db *gorm.DB, opts ...gen.DOOption) fissionSignDay { + _fissionSignDay := fissionSignDay{} + + _fissionSignDay.fissionSignDayDo.UseDB(db, opts...) + _fissionSignDay.fissionSignDayDo.UseModel(&model.FissionSignDay{}) + + tableName := _fissionSignDay.fissionSignDayDo.TableName() + _fissionSignDay.ALL = field.NewAsterisk(tableName) + _fissionSignDay.ID = field.NewInt64(tableName, "id") + _fissionSignDay.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionSignDay.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionSignDay.UserID = field.NewInt64(tableName, "user_id") + _fissionSignDay.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionSignDay.SignDate = field.NewString(tableName, "sign_date") + _fissionSignDay.SignType = field.NewInt8(tableName, "sign_type") + _fissionSignDay.RecordIds = field.NewString(tableName, "record_ids") + + _fissionSignDay.fillFieldMap() + + return _fissionSignDay +} + +type fissionSignDay struct { + fissionSignDayDo fissionSignDayDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + SignDate field.String // 签到日期 + SignType field.Int8 // 签到类型(1-正常签到,2-漏签,3-补签) + RecordIds field.String // 关联的奖品记录id(fission_reward_record表) + + fieldMap map[string]field.Expr +} + +func (f fissionSignDay) Table(newTableName string) *fissionSignDay { + f.fissionSignDayDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionSignDay) As(alias string) *fissionSignDay { + f.fissionSignDayDo.DO = *(f.fissionSignDayDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionSignDay) updateTableName(table string) *fissionSignDay { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.SignDate = field.NewString(table, "sign_date") + f.SignType = field.NewInt8(table, "sign_type") + f.RecordIds = field.NewString(table, "record_ids") + + f.fillFieldMap() + + return f +} + +func (f *fissionSignDay) WithContext(ctx context.Context) *fissionSignDayDo { + return f.fissionSignDayDo.WithContext(ctx) +} + +func (f fissionSignDay) TableName() string { return f.fissionSignDayDo.TableName() } + +func (f fissionSignDay) Alias() string { return f.fissionSignDayDo.Alias() } + +func (f *fissionSignDay) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionSignDay) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["sign_date"] = f.SignDate + f.fieldMap["sign_type"] = f.SignType + f.fieldMap["record_ids"] = f.RecordIds +} + +func (f fissionSignDay) clone(db *gorm.DB) fissionSignDay { + f.fissionSignDayDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionSignDay) replaceDB(db *gorm.DB) fissionSignDay { + f.fissionSignDayDo.ReplaceDB(db) + return f +} + +type fissionSignDayDo struct{ gen.DO } + +func (f fissionSignDayDo) Debug() *fissionSignDayDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionSignDayDo) WithContext(ctx context.Context) *fissionSignDayDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionSignDayDo) ReadDB() *fissionSignDayDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionSignDayDo) WriteDB() *fissionSignDayDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionSignDayDo) Session(config *gorm.Session) *fissionSignDayDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionSignDayDo) Clauses(conds ...clause.Expression) *fissionSignDayDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionSignDayDo) Returning(value interface{}, columns ...string) *fissionSignDayDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionSignDayDo) Not(conds ...gen.Condition) *fissionSignDayDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionSignDayDo) Or(conds ...gen.Condition) *fissionSignDayDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionSignDayDo) Select(conds ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionSignDayDo) Where(conds ...gen.Condition) *fissionSignDayDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionSignDayDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionSignDayDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionSignDayDo) Order(conds ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionSignDayDo) Distinct(cols ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionSignDayDo) Omit(cols ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionSignDayDo) Join(table schema.Tabler, on ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionSignDayDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionSignDayDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionSignDayDo) Group(cols ...field.Expr) *fissionSignDayDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionSignDayDo) Having(conds ...gen.Condition) *fissionSignDayDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionSignDayDo) Limit(limit int) *fissionSignDayDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionSignDayDo) Offset(offset int) *fissionSignDayDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionSignDayDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionSignDayDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionSignDayDo) Unscoped() *fissionSignDayDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionSignDayDo) Create(values ...*model.FissionSignDay) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionSignDayDo) CreateInBatches(values []*model.FissionSignDay, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionSignDayDo) Save(values ...*model.FissionSignDay) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionSignDayDo) First() (*model.FissionSignDay, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignDay), nil + } +} + +func (f fissionSignDayDo) Take() (*model.FissionSignDay, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignDay), nil + } +} + +func (f fissionSignDayDo) Last() (*model.FissionSignDay, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignDay), nil + } +} + +func (f fissionSignDayDo) Find() ([]*model.FissionSignDay, error) { + result, err := f.DO.Find() + return result.([]*model.FissionSignDay), err +} + +func (f fissionSignDayDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionSignDay, err error) { + buf := make([]*model.FissionSignDay, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionSignDayDo) FindInBatches(result *[]*model.FissionSignDay, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionSignDayDo) Attrs(attrs ...field.AssignExpr) *fissionSignDayDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionSignDayDo) Assign(attrs ...field.AssignExpr) *fissionSignDayDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionSignDayDo) Joins(fields ...field.RelationField) *fissionSignDayDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionSignDayDo) Preload(fields ...field.RelationField) *fissionSignDayDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionSignDayDo) FirstOrInit() (*model.FissionSignDay, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignDay), nil + } +} + +func (f fissionSignDayDo) FirstOrCreate() (*model.FissionSignDay, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignDay), nil + } +} + +func (f fissionSignDayDo) FindByPage(offset int, limit int) (result []*model.FissionSignDay, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionSignDayDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionSignDayDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionSignDayDo) Delete(models ...*model.FissionSignDay) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionSignDayDo) withDO(do gen.Dao) *fissionSignDayDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_sign_log.gen.go b/internal/repository/dao/fission_sign_log.gen.go new file mode 100644 index 0000000..79cb3b2 --- /dev/null +++ b/internal/repository/dao/fission_sign_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionSignLog(db *gorm.DB, opts ...gen.DOOption) fissionSignLog { + _fissionSignLog := fissionSignLog{} + + _fissionSignLog.fissionSignLogDo.UseDB(db, opts...) + _fissionSignLog.fissionSignLogDo.UseModel(&model.FissionSignLog{}) + + tableName := _fissionSignLog.fissionSignLogDo.TableName() + _fissionSignLog.ALL = field.NewAsterisk(tableName) + _fissionSignLog.ID = field.NewInt64(tableName, "id") + _fissionSignLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionSignLog.UserID = field.NewInt64(tableName, "user_id") + _fissionSignLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionSignLog.SignID = field.NewInt64(tableName, "sign_id") + _fissionSignLog.Type = field.NewInt8(tableName, "type") + _fissionSignLog.Source = field.NewString(tableName, "source") + _fissionSignLog.Val = field.NewString(tableName, "val") + + _fissionSignLog.fillFieldMap() + + return _fissionSignLog +} + +type fissionSignLog struct { + fissionSignLogDo fissionSignLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + SignID field.Int64 // 玩家id(fission_sign表id) + Type field.Int8 // 日志类型(1-签到,2-获得奖品,4-补签卡状态) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionSignLog) Table(newTableName string) *fissionSignLog { + f.fissionSignLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionSignLog) As(alias string) *fissionSignLog { + f.fissionSignLogDo.DO = *(f.fissionSignLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionSignLog) updateTableName(table string) *fissionSignLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.SignID = field.NewInt64(table, "sign_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionSignLog) WithContext(ctx context.Context) *fissionSignLogDo { + return f.fissionSignLogDo.WithContext(ctx) +} + +func (f fissionSignLog) TableName() string { return f.fissionSignLogDo.TableName() } + +func (f fissionSignLog) Alias() string { return f.fissionSignLogDo.Alias() } + +func (f *fissionSignLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionSignLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["sign_id"] = f.SignID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionSignLog) clone(db *gorm.DB) fissionSignLog { + f.fissionSignLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionSignLog) replaceDB(db *gorm.DB) fissionSignLog { + f.fissionSignLogDo.ReplaceDB(db) + return f +} + +type fissionSignLogDo struct{ gen.DO } + +func (f fissionSignLogDo) Debug() *fissionSignLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionSignLogDo) WithContext(ctx context.Context) *fissionSignLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionSignLogDo) ReadDB() *fissionSignLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionSignLogDo) WriteDB() *fissionSignLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionSignLogDo) Session(config *gorm.Session) *fissionSignLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionSignLogDo) Clauses(conds ...clause.Expression) *fissionSignLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionSignLogDo) Returning(value interface{}, columns ...string) *fissionSignLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionSignLogDo) Not(conds ...gen.Condition) *fissionSignLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionSignLogDo) Or(conds ...gen.Condition) *fissionSignLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionSignLogDo) Select(conds ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionSignLogDo) Where(conds ...gen.Condition) *fissionSignLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionSignLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionSignLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionSignLogDo) Order(conds ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionSignLogDo) Distinct(cols ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionSignLogDo) Omit(cols ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionSignLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionSignLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionSignLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionSignLogDo) Group(cols ...field.Expr) *fissionSignLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionSignLogDo) Having(conds ...gen.Condition) *fissionSignLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionSignLogDo) Limit(limit int) *fissionSignLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionSignLogDo) Offset(offset int) *fissionSignLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionSignLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionSignLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionSignLogDo) Unscoped() *fissionSignLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionSignLogDo) Create(values ...*model.FissionSignLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionSignLogDo) CreateInBatches(values []*model.FissionSignLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionSignLogDo) Save(values ...*model.FissionSignLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionSignLogDo) First() (*model.FissionSignLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignLog), nil + } +} + +func (f fissionSignLogDo) Take() (*model.FissionSignLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignLog), nil + } +} + +func (f fissionSignLogDo) Last() (*model.FissionSignLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignLog), nil + } +} + +func (f fissionSignLogDo) Find() ([]*model.FissionSignLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionSignLog), err +} + +func (f fissionSignLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionSignLog, err error) { + buf := make([]*model.FissionSignLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionSignLogDo) FindInBatches(result *[]*model.FissionSignLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionSignLogDo) Attrs(attrs ...field.AssignExpr) *fissionSignLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionSignLogDo) Assign(attrs ...field.AssignExpr) *fissionSignLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionSignLogDo) Joins(fields ...field.RelationField) *fissionSignLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionSignLogDo) Preload(fields ...field.RelationField) *fissionSignLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionSignLogDo) FirstOrInit() (*model.FissionSignLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignLog), nil + } +} + +func (f fissionSignLogDo) FirstOrCreate() (*model.FissionSignLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionSignLog), nil + } +} + +func (f fissionSignLogDo) FindByPage(offset int, limit int) (result []*model.FissionSignLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionSignLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionSignLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionSignLogDo) Delete(models ...*model.FissionSignLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionSignLogDo) withDO(do gen.Dao) *fissionSignLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_slot.gen.go b/internal/repository/dao/fission_slot.gen.go new file mode 100644 index 0000000..f9cea14 --- /dev/null +++ b/internal/repository/dao/fission_slot.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionSlot(db *gorm.DB, opts ...gen.DOOption) fissionSlot { + _fissionSlot := fissionSlot{} + + _fissionSlot.fissionSlotDo.UseDB(db, opts...) + _fissionSlot.fissionSlotDo.UseModel(&model.FissionSlot{}) + + tableName := _fissionSlot.fissionSlotDo.TableName() + _fissionSlot.ALL = field.NewAsterisk(tableName) + _fissionSlot.ID = field.NewInt64(tableName, "id") + _fissionSlot.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionSlot.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionSlot.IsDel = field.NewInt8(tableName, "is_del") + _fissionSlot.UserID = field.NewInt64(tableName, "user_id") + _fissionSlot.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionSlot.Chance = field.NewInt32(tableName, "chance") + _fissionSlot.TaskChance = field.NewInt32(tableName, "task_chance") + _fissionSlot.DayChance = field.NewInt32(tableName, "day_chance") + _fissionSlot.LastSign = field.NewString(tableName, "last_sign") + _fissionSlot.SetInit = field.NewInt8(tableName, "set_init") + + _fissionSlot.fillFieldMap() + + return _fissionSlot +} + +type fissionSlot struct { + fissionSlotDo fissionSlotDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + TaskChance field.Int32 // 完成任务获取的抽奖次数 + DayChance field.Int32 // 每日签到获得的抽奖次数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionSlot) Table(newTableName string) *fissionSlot { + f.fissionSlotDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionSlot) As(alias string) *fissionSlot { + f.fissionSlotDo.DO = *(f.fissionSlotDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionSlot) updateTableName(table string) *fissionSlot { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.TaskChance = field.NewInt32(table, "task_chance") + f.DayChance = field.NewInt32(table, "day_chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + + f.fillFieldMap() + + return f +} + +func (f *fissionSlot) WithContext(ctx context.Context) *fissionSlotDo { + return f.fissionSlotDo.WithContext(ctx) +} + +func (f fissionSlot) TableName() string { return f.fissionSlotDo.TableName() } + +func (f fissionSlot) Alias() string { return f.fissionSlotDo.Alias() } + +func (f *fissionSlot) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionSlot) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["task_chance"] = f.TaskChance + f.fieldMap["day_chance"] = f.DayChance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit +} + +func (f fissionSlot) clone(db *gorm.DB) fissionSlot { + f.fissionSlotDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionSlot) replaceDB(db *gorm.DB) fissionSlot { + f.fissionSlotDo.ReplaceDB(db) + return f +} + +type fissionSlotDo struct{ gen.DO } + +func (f fissionSlotDo) Debug() *fissionSlotDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionSlotDo) WithContext(ctx context.Context) *fissionSlotDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionSlotDo) ReadDB() *fissionSlotDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionSlotDo) WriteDB() *fissionSlotDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionSlotDo) Session(config *gorm.Session) *fissionSlotDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionSlotDo) Clauses(conds ...clause.Expression) *fissionSlotDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionSlotDo) Returning(value interface{}, columns ...string) *fissionSlotDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionSlotDo) Not(conds ...gen.Condition) *fissionSlotDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionSlotDo) Or(conds ...gen.Condition) *fissionSlotDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionSlotDo) Select(conds ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionSlotDo) Where(conds ...gen.Condition) *fissionSlotDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionSlotDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionSlotDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionSlotDo) Order(conds ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionSlotDo) Distinct(cols ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionSlotDo) Omit(cols ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionSlotDo) Join(table schema.Tabler, on ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionSlotDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionSlotDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionSlotDo) Group(cols ...field.Expr) *fissionSlotDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionSlotDo) Having(conds ...gen.Condition) *fissionSlotDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionSlotDo) Limit(limit int) *fissionSlotDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionSlotDo) Offset(offset int) *fissionSlotDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionSlotDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionSlotDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionSlotDo) Unscoped() *fissionSlotDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionSlotDo) Create(values ...*model.FissionSlot) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionSlotDo) CreateInBatches(values []*model.FissionSlot, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionSlotDo) Save(values ...*model.FissionSlot) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionSlotDo) First() (*model.FissionSlot, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlot), nil + } +} + +func (f fissionSlotDo) Take() (*model.FissionSlot, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlot), nil + } +} + +func (f fissionSlotDo) Last() (*model.FissionSlot, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlot), nil + } +} + +func (f fissionSlotDo) Find() ([]*model.FissionSlot, error) { + result, err := f.DO.Find() + return result.([]*model.FissionSlot), err +} + +func (f fissionSlotDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionSlot, err error) { + buf := make([]*model.FissionSlot, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionSlotDo) FindInBatches(result *[]*model.FissionSlot, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionSlotDo) Attrs(attrs ...field.AssignExpr) *fissionSlotDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionSlotDo) Assign(attrs ...field.AssignExpr) *fissionSlotDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionSlotDo) Joins(fields ...field.RelationField) *fissionSlotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionSlotDo) Preload(fields ...field.RelationField) *fissionSlotDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionSlotDo) FirstOrInit() (*model.FissionSlot, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlot), nil + } +} + +func (f fissionSlotDo) FirstOrCreate() (*model.FissionSlot, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlot), nil + } +} + +func (f fissionSlotDo) FindByPage(offset int, limit int) (result []*model.FissionSlot, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionSlotDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionSlotDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionSlotDo) Delete(models ...*model.FissionSlot) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionSlotDo) withDO(do gen.Dao) *fissionSlotDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_slot_log.gen.go b/internal/repository/dao/fission_slot_log.gen.go new file mode 100644 index 0000000..8c9cdaf --- /dev/null +++ b/internal/repository/dao/fission_slot_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionSlotLog(db *gorm.DB, opts ...gen.DOOption) fissionSlotLog { + _fissionSlotLog := fissionSlotLog{} + + _fissionSlotLog.fissionSlotLogDo.UseDB(db, opts...) + _fissionSlotLog.fissionSlotLogDo.UseModel(&model.FissionSlotLog{}) + + tableName := _fissionSlotLog.fissionSlotLogDo.TableName() + _fissionSlotLog.ALL = field.NewAsterisk(tableName) + _fissionSlotLog.ID = field.NewInt64(tableName, "id") + _fissionSlotLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionSlotLog.UserID = field.NewInt64(tableName, "user_id") + _fissionSlotLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionSlotLog.SlotID = field.NewInt64(tableName, "slot_id") + _fissionSlotLog.Type = field.NewInt8(tableName, "type") + _fissionSlotLog.Source = field.NewString(tableName, "source") + _fissionSlotLog.Val = field.NewString(tableName, "val") + + _fissionSlotLog.fillFieldMap() + + return _fissionSlotLog +} + +type fissionSlotLog struct { + fissionSlotLogDo fissionSlotLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + SlotID field.Int64 // 玩家id(fission_slot表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionSlotLog) Table(newTableName string) *fissionSlotLog { + f.fissionSlotLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionSlotLog) As(alias string) *fissionSlotLog { + f.fissionSlotLogDo.DO = *(f.fissionSlotLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionSlotLog) updateTableName(table string) *fissionSlotLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.SlotID = field.NewInt64(table, "slot_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionSlotLog) WithContext(ctx context.Context) *fissionSlotLogDo { + return f.fissionSlotLogDo.WithContext(ctx) +} + +func (f fissionSlotLog) TableName() string { return f.fissionSlotLogDo.TableName() } + +func (f fissionSlotLog) Alias() string { return f.fissionSlotLogDo.Alias() } + +func (f *fissionSlotLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionSlotLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["slot_id"] = f.SlotID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionSlotLog) clone(db *gorm.DB) fissionSlotLog { + f.fissionSlotLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionSlotLog) replaceDB(db *gorm.DB) fissionSlotLog { + f.fissionSlotLogDo.ReplaceDB(db) + return f +} + +type fissionSlotLogDo struct{ gen.DO } + +func (f fissionSlotLogDo) Debug() *fissionSlotLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionSlotLogDo) WithContext(ctx context.Context) *fissionSlotLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionSlotLogDo) ReadDB() *fissionSlotLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionSlotLogDo) WriteDB() *fissionSlotLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionSlotLogDo) Session(config *gorm.Session) *fissionSlotLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionSlotLogDo) Clauses(conds ...clause.Expression) *fissionSlotLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionSlotLogDo) Returning(value interface{}, columns ...string) *fissionSlotLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionSlotLogDo) Not(conds ...gen.Condition) *fissionSlotLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionSlotLogDo) Or(conds ...gen.Condition) *fissionSlotLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionSlotLogDo) Select(conds ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionSlotLogDo) Where(conds ...gen.Condition) *fissionSlotLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionSlotLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionSlotLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionSlotLogDo) Order(conds ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionSlotLogDo) Distinct(cols ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionSlotLogDo) Omit(cols ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionSlotLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionSlotLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionSlotLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionSlotLogDo) Group(cols ...field.Expr) *fissionSlotLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionSlotLogDo) Having(conds ...gen.Condition) *fissionSlotLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionSlotLogDo) Limit(limit int) *fissionSlotLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionSlotLogDo) Offset(offset int) *fissionSlotLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionSlotLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionSlotLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionSlotLogDo) Unscoped() *fissionSlotLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionSlotLogDo) Create(values ...*model.FissionSlotLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionSlotLogDo) CreateInBatches(values []*model.FissionSlotLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionSlotLogDo) Save(values ...*model.FissionSlotLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionSlotLogDo) First() (*model.FissionSlotLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlotLog), nil + } +} + +func (f fissionSlotLogDo) Take() (*model.FissionSlotLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlotLog), nil + } +} + +func (f fissionSlotLogDo) Last() (*model.FissionSlotLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlotLog), nil + } +} + +func (f fissionSlotLogDo) Find() ([]*model.FissionSlotLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionSlotLog), err +} + +func (f fissionSlotLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionSlotLog, err error) { + buf := make([]*model.FissionSlotLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionSlotLogDo) FindInBatches(result *[]*model.FissionSlotLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionSlotLogDo) Attrs(attrs ...field.AssignExpr) *fissionSlotLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionSlotLogDo) Assign(attrs ...field.AssignExpr) *fissionSlotLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionSlotLogDo) Joins(fields ...field.RelationField) *fissionSlotLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionSlotLogDo) Preload(fields ...field.RelationField) *fissionSlotLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionSlotLogDo) FirstOrInit() (*model.FissionSlotLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlotLog), nil + } +} + +func (f fissionSlotLogDo) FirstOrCreate() (*model.FissionSlotLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionSlotLog), nil + } +} + +func (f fissionSlotLogDo) FindByPage(offset int, limit int) (result []*model.FissionSlotLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionSlotLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionSlotLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionSlotLogDo) Delete(models ...*model.FissionSlotLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionSlotLogDo) withDO(do gen.Dao) *fissionSlotLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_target_record.gen.go b/internal/repository/dao/fission_target_record.gen.go new file mode 100644 index 0000000..fd91314 --- /dev/null +++ b/internal/repository/dao/fission_target_record.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTargetRecord(db *gorm.DB, opts ...gen.DOOption) fissionTargetRecord { + _fissionTargetRecord := fissionTargetRecord{} + + _fissionTargetRecord.fissionTargetRecordDo.UseDB(db, opts...) + _fissionTargetRecord.fissionTargetRecordDo.UseModel(&model.FissionTargetRecord{}) + + tableName := _fissionTargetRecord.fissionTargetRecordDo.TableName() + _fissionTargetRecord.ALL = field.NewAsterisk(tableName) + _fissionTargetRecord.ID = field.NewInt64(tableName, "id") + _fissionTargetRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionTargetRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionTargetRecord.Num = field.NewInt32(tableName, "num") + _fissionTargetRecord.CondID = field.NewString(tableName, "cond_id") + _fissionTargetRecord.FinishTime = field.NewInt64(tableName, "finish_time") + + _fissionTargetRecord.fillFieldMap() + + return _fissionTargetRecord +} + +type fissionTargetRecord struct { + fissionTargetRecordDo fissionTargetRecordDo + + ALL field.Asterisk + ID field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + Num field.Int32 // 第几次达标 + CondID field.String // 完成的事件所以达标,多个用,分割 + FinishTime field.Int64 // 完成时间 + + fieldMap map[string]field.Expr +} + +func (f fissionTargetRecord) Table(newTableName string) *fissionTargetRecord { + f.fissionTargetRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTargetRecord) As(alias string) *fissionTargetRecord { + f.fissionTargetRecordDo.DO = *(f.fissionTargetRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTargetRecord) updateTableName(table string) *fissionTargetRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Num = field.NewInt32(table, "num") + f.CondID = field.NewString(table, "cond_id") + f.FinishTime = field.NewInt64(table, "finish_time") + + f.fillFieldMap() + + return f +} + +func (f *fissionTargetRecord) WithContext(ctx context.Context) *fissionTargetRecordDo { + return f.fissionTargetRecordDo.WithContext(ctx) +} + +func (f fissionTargetRecord) TableName() string { return f.fissionTargetRecordDo.TableName() } + +func (f fissionTargetRecord) Alias() string { return f.fissionTargetRecordDo.Alias() } + +func (f *fissionTargetRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTargetRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["num"] = f.Num + f.fieldMap["cond_id"] = f.CondID + f.fieldMap["finish_time"] = f.FinishTime +} + +func (f fissionTargetRecord) clone(db *gorm.DB) fissionTargetRecord { + f.fissionTargetRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTargetRecord) replaceDB(db *gorm.DB) fissionTargetRecord { + f.fissionTargetRecordDo.ReplaceDB(db) + return f +} + +type fissionTargetRecordDo struct{ gen.DO } + +func (f fissionTargetRecordDo) Debug() *fissionTargetRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTargetRecordDo) WithContext(ctx context.Context) *fissionTargetRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTargetRecordDo) ReadDB() *fissionTargetRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTargetRecordDo) WriteDB() *fissionTargetRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTargetRecordDo) Session(config *gorm.Session) *fissionTargetRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTargetRecordDo) Clauses(conds ...clause.Expression) *fissionTargetRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTargetRecordDo) Returning(value interface{}, columns ...string) *fissionTargetRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTargetRecordDo) Not(conds ...gen.Condition) *fissionTargetRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTargetRecordDo) Or(conds ...gen.Condition) *fissionTargetRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTargetRecordDo) Select(conds ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTargetRecordDo) Where(conds ...gen.Condition) *fissionTargetRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTargetRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTargetRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTargetRecordDo) Order(conds ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTargetRecordDo) Distinct(cols ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTargetRecordDo) Omit(cols ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTargetRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTargetRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTargetRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTargetRecordDo) Group(cols ...field.Expr) *fissionTargetRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTargetRecordDo) Having(conds ...gen.Condition) *fissionTargetRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTargetRecordDo) Limit(limit int) *fissionTargetRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTargetRecordDo) Offset(offset int) *fissionTargetRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTargetRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTargetRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTargetRecordDo) Unscoped() *fissionTargetRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTargetRecordDo) Create(values ...*model.FissionTargetRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTargetRecordDo) CreateInBatches(values []*model.FissionTargetRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTargetRecordDo) Save(values ...*model.FissionTargetRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTargetRecordDo) First() (*model.FissionTargetRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTargetRecord), nil + } +} + +func (f fissionTargetRecordDo) Take() (*model.FissionTargetRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTargetRecord), nil + } +} + +func (f fissionTargetRecordDo) Last() (*model.FissionTargetRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTargetRecord), nil + } +} + +func (f fissionTargetRecordDo) Find() ([]*model.FissionTargetRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTargetRecord), err +} + +func (f fissionTargetRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTargetRecord, err error) { + buf := make([]*model.FissionTargetRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTargetRecordDo) FindInBatches(result *[]*model.FissionTargetRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTargetRecordDo) Attrs(attrs ...field.AssignExpr) *fissionTargetRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTargetRecordDo) Assign(attrs ...field.AssignExpr) *fissionTargetRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTargetRecordDo) Joins(fields ...field.RelationField) *fissionTargetRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTargetRecordDo) Preload(fields ...field.RelationField) *fissionTargetRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTargetRecordDo) FirstOrInit() (*model.FissionTargetRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTargetRecord), nil + } +} + +func (f fissionTargetRecordDo) FirstOrCreate() (*model.FissionTargetRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTargetRecord), nil + } +} + +func (f fissionTargetRecordDo) FindByPage(offset int, limit int) (result []*model.FissionTargetRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTargetRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTargetRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTargetRecordDo) Delete(models ...*model.FissionTargetRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTargetRecordDo) withDO(do gen.Dao) *fissionTargetRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_temp.gen.go b/internal/repository/dao/fission_temp.gen.go new file mode 100644 index 0000000..0a8d1f2 --- /dev/null +++ b/internal/repository/dao/fission_temp.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTemp(db *gorm.DB, opts ...gen.DOOption) fissionTemp { + _fissionTemp := fissionTemp{} + + _fissionTemp.fissionTempDo.UseDB(db, opts...) + _fissionTemp.fissionTempDo.UseModel(&model.FissionTemp{}) + + tableName := _fissionTemp.fissionTempDo.TableName() + _fissionTemp.ALL = field.NewAsterisk(tableName) + _fissionTemp.ID = field.NewInt64(tableName, "id") + _fissionTemp.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTemp.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTemp.IsDel = field.NewInt8(tableName, "is_del") + _fissionTemp.HashID = field.NewString(tableName, "hash_id") + _fissionTemp.FissionID = field.NewInt64(tableName, "fission_id") + _fissionTemp.GroupID = field.NewInt64(tableName, "group_id") + _fissionTemp.LangType = field.NewInt8(tableName, "lang_type") + _fissionTemp.TextType = field.NewInt8(tableName, "text_type") + + _fissionTemp.fillFieldMap() + + return _fissionTemp +} + +type fissionTemp struct { + fissionTempDo fissionTempDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 模版对外id + FissionID field.Int64 // 玩法id(fission表主键) + GroupID field.Int64 // 模版组id(fission_temp_group表) + LangType field.Int8 // 语言(1-中文,2-英文) + TextType field.Int8 // 文字模板(1-汉字模板,2-拉丁语系模板) + + fieldMap map[string]field.Expr +} + +func (f fissionTemp) Table(newTableName string) *fissionTemp { + f.fissionTempDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTemp) As(alias string) *fissionTemp { + f.fissionTempDo.DO = *(f.fissionTempDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTemp) updateTableName(table string) *fissionTemp { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.HashID = field.NewString(table, "hash_id") + f.FissionID = field.NewInt64(table, "fission_id") + f.GroupID = field.NewInt64(table, "group_id") + f.LangType = field.NewInt8(table, "lang_type") + f.TextType = field.NewInt8(table, "text_type") + + f.fillFieldMap() + + return f +} + +func (f *fissionTemp) WithContext(ctx context.Context) *fissionTempDo { + return f.fissionTempDo.WithContext(ctx) +} + +func (f fissionTemp) TableName() string { return f.fissionTempDo.TableName() } + +func (f fissionTemp) Alias() string { return f.fissionTempDo.Alias() } + +func (f *fissionTemp) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTemp) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["fission_id"] = f.FissionID + f.fieldMap["group_id"] = f.GroupID + f.fieldMap["lang_type"] = f.LangType + f.fieldMap["text_type"] = f.TextType +} + +func (f fissionTemp) clone(db *gorm.DB) fissionTemp { + f.fissionTempDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTemp) replaceDB(db *gorm.DB) fissionTemp { + f.fissionTempDo.ReplaceDB(db) + return f +} + +type fissionTempDo struct{ gen.DO } + +func (f fissionTempDo) Debug() *fissionTempDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTempDo) WithContext(ctx context.Context) *fissionTempDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTempDo) ReadDB() *fissionTempDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTempDo) WriteDB() *fissionTempDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTempDo) Session(config *gorm.Session) *fissionTempDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTempDo) Clauses(conds ...clause.Expression) *fissionTempDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTempDo) Returning(value interface{}, columns ...string) *fissionTempDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTempDo) Not(conds ...gen.Condition) *fissionTempDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTempDo) Or(conds ...gen.Condition) *fissionTempDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTempDo) Select(conds ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTempDo) Where(conds ...gen.Condition) *fissionTempDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTempDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTempDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTempDo) Order(conds ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTempDo) Distinct(cols ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTempDo) Omit(cols ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTempDo) Join(table schema.Tabler, on ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTempDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTempDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTempDo) Group(cols ...field.Expr) *fissionTempDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTempDo) Having(conds ...gen.Condition) *fissionTempDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTempDo) Limit(limit int) *fissionTempDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTempDo) Offset(offset int) *fissionTempDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTempDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTempDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTempDo) Unscoped() *fissionTempDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTempDo) Create(values ...*model.FissionTemp) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTempDo) CreateInBatches(values []*model.FissionTemp, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTempDo) Save(values ...*model.FissionTemp) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTempDo) First() (*model.FissionTemp, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTemp), nil + } +} + +func (f fissionTempDo) Take() (*model.FissionTemp, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTemp), nil + } +} + +func (f fissionTempDo) Last() (*model.FissionTemp, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTemp), nil + } +} + +func (f fissionTempDo) Find() ([]*model.FissionTemp, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTemp), err +} + +func (f fissionTempDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTemp, err error) { + buf := make([]*model.FissionTemp, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTempDo) FindInBatches(result *[]*model.FissionTemp, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTempDo) Attrs(attrs ...field.AssignExpr) *fissionTempDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTempDo) Assign(attrs ...field.AssignExpr) *fissionTempDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTempDo) Joins(fields ...field.RelationField) *fissionTempDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTempDo) Preload(fields ...field.RelationField) *fissionTempDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTempDo) FirstOrInit() (*model.FissionTemp, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTemp), nil + } +} + +func (f fissionTempDo) FirstOrCreate() (*model.FissionTemp, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTemp), nil + } +} + +func (f fissionTempDo) FindByPage(offset int, limit int) (result []*model.FissionTemp, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTempDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTempDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTempDo) Delete(models ...*model.FissionTemp) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTempDo) withDO(do gen.Dao) *fissionTempDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_temp_group.gen.go b/internal/repository/dao/fission_temp_group.gen.go new file mode 100644 index 0000000..e4dbb4b --- /dev/null +++ b/internal/repository/dao/fission_temp_group.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTempGroup(db *gorm.DB, opts ...gen.DOOption) fissionTempGroup { + _fissionTempGroup := fissionTempGroup{} + + _fissionTempGroup.fissionTempGroupDo.UseDB(db, opts...) + _fissionTempGroup.fissionTempGroupDo.UseModel(&model.FissionTempGroup{}) + + tableName := _fissionTempGroup.fissionTempGroupDo.TableName() + _fissionTempGroup.ALL = field.NewAsterisk(tableName) + _fissionTempGroup.ID = field.NewInt64(tableName, "id") + _fissionTempGroup.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTempGroup.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTempGroup.IsDel = field.NewInt8(tableName, "is_del") + _fissionTempGroup.FissionID = field.NewInt64(tableName, "fission_id") + _fissionTempGroup.CoverURL = field.NewString(tableName, "cover_url") + _fissionTempGroup.Mark = field.NewString(tableName, "mark") + _fissionTempGroup.Sort = field.NewInt32(tableName, "sort") + _fissionTempGroup.ConvertCoverURL = field.NewString(tableName, "convert_cover_url") + _fissionTempGroup.LangParts = field.NewString(tableName, "lang_parts") + _fissionTempGroup.IsPrivate = field.NewInt8(tableName, "is_private") + + _fissionTempGroup.fillFieldMap() + + return _fissionTempGroup +} + +type fissionTempGroup struct { + fissionTempGroupDo fissionTempGroupDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + FissionID field.Int64 // 玩法id(fission表主键) + CoverURL field.String // 模版组封面 + Mark field.String // 模版组标识 + Sort field.Int32 // 排序(越小越前) + ConvertCoverURL field.String // 事件转化封面 + LangParts field.String // 支持玩法组件翻译 + IsPrivate field.Int8 // 是否私有模板(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionTempGroup) Table(newTableName string) *fissionTempGroup { + f.fissionTempGroupDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTempGroup) As(alias string) *fissionTempGroup { + f.fissionTempGroupDo.DO = *(f.fissionTempGroupDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTempGroup) updateTableName(table string) *fissionTempGroup { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.FissionID = field.NewInt64(table, "fission_id") + f.CoverURL = field.NewString(table, "cover_url") + f.Mark = field.NewString(table, "mark") + f.Sort = field.NewInt32(table, "sort") + f.ConvertCoverURL = field.NewString(table, "convert_cover_url") + f.LangParts = field.NewString(table, "lang_parts") + f.IsPrivate = field.NewInt8(table, "is_private") + + f.fillFieldMap() + + return f +} + +func (f *fissionTempGroup) WithContext(ctx context.Context) *fissionTempGroupDo { + return f.fissionTempGroupDo.WithContext(ctx) +} + +func (f fissionTempGroup) TableName() string { return f.fissionTempGroupDo.TableName() } + +func (f fissionTempGroup) Alias() string { return f.fissionTempGroupDo.Alias() } + +func (f *fissionTempGroup) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTempGroup) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["fission_id"] = f.FissionID + f.fieldMap["cover_url"] = f.CoverURL + f.fieldMap["mark"] = f.Mark + f.fieldMap["sort"] = f.Sort + f.fieldMap["convert_cover_url"] = f.ConvertCoverURL + f.fieldMap["lang_parts"] = f.LangParts + f.fieldMap["is_private"] = f.IsPrivate +} + +func (f fissionTempGroup) clone(db *gorm.DB) fissionTempGroup { + f.fissionTempGroupDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTempGroup) replaceDB(db *gorm.DB) fissionTempGroup { + f.fissionTempGroupDo.ReplaceDB(db) + return f +} + +type fissionTempGroupDo struct{ gen.DO } + +func (f fissionTempGroupDo) Debug() *fissionTempGroupDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTempGroupDo) WithContext(ctx context.Context) *fissionTempGroupDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTempGroupDo) ReadDB() *fissionTempGroupDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTempGroupDo) WriteDB() *fissionTempGroupDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTempGroupDo) Session(config *gorm.Session) *fissionTempGroupDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTempGroupDo) Clauses(conds ...clause.Expression) *fissionTempGroupDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTempGroupDo) Returning(value interface{}, columns ...string) *fissionTempGroupDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTempGroupDo) Not(conds ...gen.Condition) *fissionTempGroupDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTempGroupDo) Or(conds ...gen.Condition) *fissionTempGroupDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTempGroupDo) Select(conds ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTempGroupDo) Where(conds ...gen.Condition) *fissionTempGroupDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTempGroupDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTempGroupDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTempGroupDo) Order(conds ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTempGroupDo) Distinct(cols ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTempGroupDo) Omit(cols ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTempGroupDo) Join(table schema.Tabler, on ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTempGroupDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTempGroupDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTempGroupDo) Group(cols ...field.Expr) *fissionTempGroupDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTempGroupDo) Having(conds ...gen.Condition) *fissionTempGroupDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTempGroupDo) Limit(limit int) *fissionTempGroupDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTempGroupDo) Offset(offset int) *fissionTempGroupDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTempGroupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTempGroupDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTempGroupDo) Unscoped() *fissionTempGroupDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTempGroupDo) Create(values ...*model.FissionTempGroup) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTempGroupDo) CreateInBatches(values []*model.FissionTempGroup, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTempGroupDo) Save(values ...*model.FissionTempGroup) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTempGroupDo) First() (*model.FissionTempGroup, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroup), nil + } +} + +func (f fissionTempGroupDo) Take() (*model.FissionTempGroup, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroup), nil + } +} + +func (f fissionTempGroupDo) Last() (*model.FissionTempGroup, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroup), nil + } +} + +func (f fissionTempGroupDo) Find() ([]*model.FissionTempGroup, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTempGroup), err +} + +func (f fissionTempGroupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTempGroup, err error) { + buf := make([]*model.FissionTempGroup, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTempGroupDo) FindInBatches(result *[]*model.FissionTempGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTempGroupDo) Attrs(attrs ...field.AssignExpr) *fissionTempGroupDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTempGroupDo) Assign(attrs ...field.AssignExpr) *fissionTempGroupDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTempGroupDo) Joins(fields ...field.RelationField) *fissionTempGroupDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTempGroupDo) Preload(fields ...field.RelationField) *fissionTempGroupDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTempGroupDo) FirstOrInit() (*model.FissionTempGroup, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroup), nil + } +} + +func (f fissionTempGroupDo) FirstOrCreate() (*model.FissionTempGroup, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroup), nil + } +} + +func (f fissionTempGroupDo) FindByPage(offset int, limit int) (result []*model.FissionTempGroup, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTempGroupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTempGroupDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTempGroupDo) Delete(models ...*model.FissionTempGroup) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTempGroupDo) withDO(do gen.Dao) *fissionTempGroupDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_temp_group_lang.gen.go b/internal/repository/dao/fission_temp_group_lang.gen.go new file mode 100644 index 0000000..a6aab97 --- /dev/null +++ b/internal/repository/dao/fission_temp_group_lang.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTempGroupLang(db *gorm.DB, opts ...gen.DOOption) fissionTempGroupLang { + _fissionTempGroupLang := fissionTempGroupLang{} + + _fissionTempGroupLang.fissionTempGroupLangDo.UseDB(db, opts...) + _fissionTempGroupLang.fissionTempGroupLangDo.UseModel(&model.FissionTempGroupLang{}) + + tableName := _fissionTempGroupLang.fissionTempGroupLangDo.TableName() + _fissionTempGroupLang.ALL = field.NewAsterisk(tableName) + _fissionTempGroupLang.ID = field.NewInt64(tableName, "id") + _fissionTempGroupLang.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTempGroupLang.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTempGroupLang.GroupID = field.NewInt64(tableName, "group_id") + _fissionTempGroupLang.Mark = field.NewString(tableName, "mark") + _fissionTempGroupLang.Desc = field.NewString(tableName, "desc") + _fissionTempGroupLang.LangMark = field.NewString(tableName, "lang_mark") + + _fissionTempGroupLang.fillFieldMap() + + return _fissionTempGroupLang +} + +type fissionTempGroupLang struct { + fissionTempGroupLangDo fissionTempGroupLangDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + GroupID field.Int64 // 模版组id + Mark field.String // 翻译键值 + Desc field.String // 说明 + LangMark field.String // 语言包对应的标识 + + fieldMap map[string]field.Expr +} + +func (f fissionTempGroupLang) Table(newTableName string) *fissionTempGroupLang { + f.fissionTempGroupLangDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTempGroupLang) As(alias string) *fissionTempGroupLang { + f.fissionTempGroupLangDo.DO = *(f.fissionTempGroupLangDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTempGroupLang) updateTableName(table string) *fissionTempGroupLang { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.GroupID = field.NewInt64(table, "group_id") + f.Mark = field.NewString(table, "mark") + f.Desc = field.NewString(table, "desc") + f.LangMark = field.NewString(table, "lang_mark") + + f.fillFieldMap() + + return f +} + +func (f *fissionTempGroupLang) WithContext(ctx context.Context) *fissionTempGroupLangDo { + return f.fissionTempGroupLangDo.WithContext(ctx) +} + +func (f fissionTempGroupLang) TableName() string { return f.fissionTempGroupLangDo.TableName() } + +func (f fissionTempGroupLang) Alias() string { return f.fissionTempGroupLangDo.Alias() } + +func (f *fissionTempGroupLang) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTempGroupLang) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["group_id"] = f.GroupID + f.fieldMap["mark"] = f.Mark + f.fieldMap["desc"] = f.Desc + f.fieldMap["lang_mark"] = f.LangMark +} + +func (f fissionTempGroupLang) clone(db *gorm.DB) fissionTempGroupLang { + f.fissionTempGroupLangDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTempGroupLang) replaceDB(db *gorm.DB) fissionTempGroupLang { + f.fissionTempGroupLangDo.ReplaceDB(db) + return f +} + +type fissionTempGroupLangDo struct{ gen.DO } + +func (f fissionTempGroupLangDo) Debug() *fissionTempGroupLangDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTempGroupLangDo) WithContext(ctx context.Context) *fissionTempGroupLangDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTempGroupLangDo) ReadDB() *fissionTempGroupLangDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTempGroupLangDo) WriteDB() *fissionTempGroupLangDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTempGroupLangDo) Session(config *gorm.Session) *fissionTempGroupLangDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTempGroupLangDo) Clauses(conds ...clause.Expression) *fissionTempGroupLangDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTempGroupLangDo) Returning(value interface{}, columns ...string) *fissionTempGroupLangDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTempGroupLangDo) Not(conds ...gen.Condition) *fissionTempGroupLangDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTempGroupLangDo) Or(conds ...gen.Condition) *fissionTempGroupLangDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTempGroupLangDo) Select(conds ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTempGroupLangDo) Where(conds ...gen.Condition) *fissionTempGroupLangDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTempGroupLangDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTempGroupLangDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTempGroupLangDo) Order(conds ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTempGroupLangDo) Distinct(cols ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTempGroupLangDo) Omit(cols ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTempGroupLangDo) Join(table schema.Tabler, on ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTempGroupLangDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTempGroupLangDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTempGroupLangDo) Group(cols ...field.Expr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTempGroupLangDo) Having(conds ...gen.Condition) *fissionTempGroupLangDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTempGroupLangDo) Limit(limit int) *fissionTempGroupLangDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTempGroupLangDo) Offset(offset int) *fissionTempGroupLangDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTempGroupLangDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTempGroupLangDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTempGroupLangDo) Unscoped() *fissionTempGroupLangDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTempGroupLangDo) Create(values ...*model.FissionTempGroupLang) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTempGroupLangDo) CreateInBatches(values []*model.FissionTempGroupLang, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTempGroupLangDo) Save(values ...*model.FissionTempGroupLang) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTempGroupLangDo) First() (*model.FissionTempGroupLang, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroupLang), nil + } +} + +func (f fissionTempGroupLangDo) Take() (*model.FissionTempGroupLang, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroupLang), nil + } +} + +func (f fissionTempGroupLangDo) Last() (*model.FissionTempGroupLang, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroupLang), nil + } +} + +func (f fissionTempGroupLangDo) Find() ([]*model.FissionTempGroupLang, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTempGroupLang), err +} + +func (f fissionTempGroupLangDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTempGroupLang, err error) { + buf := make([]*model.FissionTempGroupLang, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTempGroupLangDo) FindInBatches(result *[]*model.FissionTempGroupLang, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTempGroupLangDo) Attrs(attrs ...field.AssignExpr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTempGroupLangDo) Assign(attrs ...field.AssignExpr) *fissionTempGroupLangDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTempGroupLangDo) Joins(fields ...field.RelationField) *fissionTempGroupLangDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTempGroupLangDo) Preload(fields ...field.RelationField) *fissionTempGroupLangDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTempGroupLangDo) FirstOrInit() (*model.FissionTempGroupLang, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroupLang), nil + } +} + +func (f fissionTempGroupLangDo) FirstOrCreate() (*model.FissionTempGroupLang, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempGroupLang), nil + } +} + +func (f fissionTempGroupLangDo) FindByPage(offset int, limit int) (result []*model.FissionTempGroupLang, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTempGroupLangDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTempGroupLangDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTempGroupLangDo) Delete(models ...*model.FissionTempGroupLang) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTempGroupLangDo) withDO(do gen.Dao) *fissionTempGroupLangDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_temp_image.gen.go b/internal/repository/dao/fission_temp_image.gen.go new file mode 100644 index 0000000..d0dd54a --- /dev/null +++ b/internal/repository/dao/fission_temp_image.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTempImage(db *gorm.DB, opts ...gen.DOOption) fissionTempImage { + _fissionTempImage := fissionTempImage{} + + _fissionTempImage.fissionTempImageDo.UseDB(db, opts...) + _fissionTempImage.fissionTempImageDo.UseModel(&model.FissionTempImage{}) + + tableName := _fissionTempImage.fissionTempImageDo.TableName() + _fissionTempImage.ALL = field.NewAsterisk(tableName) + _fissionTempImage.ID = field.NewInt64(tableName, "id") + _fissionTempImage.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTempImage.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTempImage.IsDel = field.NewInt8(tableName, "is_del") + _fissionTempImage.TempID = field.NewInt64(tableName, "temp_id") + _fissionTempImage.Mark = field.NewString(tableName, "mark") + _fissionTempImage.Val = field.NewString(tableName, "val") + _fissionTempImage.Desc = field.NewString(tableName, "desc") + + _fissionTempImage.fillFieldMap() + + return _fissionTempImage +} + +type fissionTempImage struct { + fissionTempImageDo fissionTempImageDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + TempID field.Int64 // 模版id + Mark field.String // 模版键值 + Val field.String // 值 + Desc field.String // 描述 + + fieldMap map[string]field.Expr +} + +func (f fissionTempImage) Table(newTableName string) *fissionTempImage { + f.fissionTempImageDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTempImage) As(alias string) *fissionTempImage { + f.fissionTempImageDo.DO = *(f.fissionTempImageDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTempImage) updateTableName(table string) *fissionTempImage { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.TempID = field.NewInt64(table, "temp_id") + f.Mark = field.NewString(table, "mark") + f.Val = field.NewString(table, "val") + f.Desc = field.NewString(table, "desc") + + f.fillFieldMap() + + return f +} + +func (f *fissionTempImage) WithContext(ctx context.Context) *fissionTempImageDo { + return f.fissionTempImageDo.WithContext(ctx) +} + +func (f fissionTempImage) TableName() string { return f.fissionTempImageDo.TableName() } + +func (f fissionTempImage) Alias() string { return f.fissionTempImageDo.Alias() } + +func (f *fissionTempImage) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTempImage) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["temp_id"] = f.TempID + f.fieldMap["mark"] = f.Mark + f.fieldMap["val"] = f.Val + f.fieldMap["desc"] = f.Desc +} + +func (f fissionTempImage) clone(db *gorm.DB) fissionTempImage { + f.fissionTempImageDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTempImage) replaceDB(db *gorm.DB) fissionTempImage { + f.fissionTempImageDo.ReplaceDB(db) + return f +} + +type fissionTempImageDo struct{ gen.DO } + +func (f fissionTempImageDo) Debug() *fissionTempImageDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTempImageDo) WithContext(ctx context.Context) *fissionTempImageDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTempImageDo) ReadDB() *fissionTempImageDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTempImageDo) WriteDB() *fissionTempImageDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTempImageDo) Session(config *gorm.Session) *fissionTempImageDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTempImageDo) Clauses(conds ...clause.Expression) *fissionTempImageDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTempImageDo) Returning(value interface{}, columns ...string) *fissionTempImageDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTempImageDo) Not(conds ...gen.Condition) *fissionTempImageDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTempImageDo) Or(conds ...gen.Condition) *fissionTempImageDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTempImageDo) Select(conds ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTempImageDo) Where(conds ...gen.Condition) *fissionTempImageDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTempImageDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTempImageDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTempImageDo) Order(conds ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTempImageDo) Distinct(cols ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTempImageDo) Omit(cols ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTempImageDo) Join(table schema.Tabler, on ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTempImageDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTempImageDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTempImageDo) Group(cols ...field.Expr) *fissionTempImageDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTempImageDo) Having(conds ...gen.Condition) *fissionTempImageDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTempImageDo) Limit(limit int) *fissionTempImageDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTempImageDo) Offset(offset int) *fissionTempImageDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTempImageDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTempImageDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTempImageDo) Unscoped() *fissionTempImageDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTempImageDo) Create(values ...*model.FissionTempImage) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTempImageDo) CreateInBatches(values []*model.FissionTempImage, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTempImageDo) Save(values ...*model.FissionTempImage) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTempImageDo) First() (*model.FissionTempImage, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempImage), nil + } +} + +func (f fissionTempImageDo) Take() (*model.FissionTempImage, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempImage), nil + } +} + +func (f fissionTempImageDo) Last() (*model.FissionTempImage, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempImage), nil + } +} + +func (f fissionTempImageDo) Find() ([]*model.FissionTempImage, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTempImage), err +} + +func (f fissionTempImageDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTempImage, err error) { + buf := make([]*model.FissionTempImage, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTempImageDo) FindInBatches(result *[]*model.FissionTempImage, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTempImageDo) Attrs(attrs ...field.AssignExpr) *fissionTempImageDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTempImageDo) Assign(attrs ...field.AssignExpr) *fissionTempImageDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTempImageDo) Joins(fields ...field.RelationField) *fissionTempImageDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTempImageDo) Preload(fields ...field.RelationField) *fissionTempImageDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTempImageDo) FirstOrInit() (*model.FissionTempImage, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempImage), nil + } +} + +func (f fissionTempImageDo) FirstOrCreate() (*model.FissionTempImage, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempImage), nil + } +} + +func (f fissionTempImageDo) FindByPage(offset int, limit int) (result []*model.FissionTempImage, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTempImageDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTempImageDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTempImageDo) Delete(models ...*model.FissionTempImage) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTempImageDo) withDO(do gen.Dao) *fissionTempImageDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_temp_lang.gen.go b/internal/repository/dao/fission_temp_lang.gen.go new file mode 100644 index 0000000..3a682b5 --- /dev/null +++ b/internal/repository/dao/fission_temp_lang.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTempLang(db *gorm.DB, opts ...gen.DOOption) fissionTempLang { + _fissionTempLang := fissionTempLang{} + + _fissionTempLang.fissionTempLangDo.UseDB(db, opts...) + _fissionTempLang.fissionTempLangDo.UseModel(&model.FissionTempLang{}) + + tableName := _fissionTempLang.fissionTempLangDo.TableName() + _fissionTempLang.ALL = field.NewAsterisk(tableName) + _fissionTempLang.ID = field.NewInt64(tableName, "id") + _fissionTempLang.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTempLang.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTempLang.IsDel = field.NewInt8(tableName, "is_del") + _fissionTempLang.TempID = field.NewInt64(tableName, "temp_id") + _fissionTempLang.Mark = field.NewString(tableName, "mark") + _fissionTempLang.Val = field.NewString(tableName, "val") + _fissionTempLang.Desc = field.NewString(tableName, "desc") + + _fissionTempLang.fillFieldMap() + + return _fissionTempLang +} + +type fissionTempLang struct { + fissionTempLangDo fissionTempLangDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + TempID field.Int64 // 模版id + Mark field.String // 翻译键值 + Val field.String // 值 + Desc field.String // 说明 + + fieldMap map[string]field.Expr +} + +func (f fissionTempLang) Table(newTableName string) *fissionTempLang { + f.fissionTempLangDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTempLang) As(alias string) *fissionTempLang { + f.fissionTempLangDo.DO = *(f.fissionTempLangDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTempLang) updateTableName(table string) *fissionTempLang { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.TempID = field.NewInt64(table, "temp_id") + f.Mark = field.NewString(table, "mark") + f.Val = field.NewString(table, "val") + f.Desc = field.NewString(table, "desc") + + f.fillFieldMap() + + return f +} + +func (f *fissionTempLang) WithContext(ctx context.Context) *fissionTempLangDo { + return f.fissionTempLangDo.WithContext(ctx) +} + +func (f fissionTempLang) TableName() string { return f.fissionTempLangDo.TableName() } + +func (f fissionTempLang) Alias() string { return f.fissionTempLangDo.Alias() } + +func (f *fissionTempLang) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTempLang) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["temp_id"] = f.TempID + f.fieldMap["mark"] = f.Mark + f.fieldMap["val"] = f.Val + f.fieldMap["desc"] = f.Desc +} + +func (f fissionTempLang) clone(db *gorm.DB) fissionTempLang { + f.fissionTempLangDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTempLang) replaceDB(db *gorm.DB) fissionTempLang { + f.fissionTempLangDo.ReplaceDB(db) + return f +} + +type fissionTempLangDo struct{ gen.DO } + +func (f fissionTempLangDo) Debug() *fissionTempLangDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTempLangDo) WithContext(ctx context.Context) *fissionTempLangDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTempLangDo) ReadDB() *fissionTempLangDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTempLangDo) WriteDB() *fissionTempLangDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTempLangDo) Session(config *gorm.Session) *fissionTempLangDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTempLangDo) Clauses(conds ...clause.Expression) *fissionTempLangDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTempLangDo) Returning(value interface{}, columns ...string) *fissionTempLangDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTempLangDo) Not(conds ...gen.Condition) *fissionTempLangDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTempLangDo) Or(conds ...gen.Condition) *fissionTempLangDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTempLangDo) Select(conds ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTempLangDo) Where(conds ...gen.Condition) *fissionTempLangDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTempLangDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTempLangDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTempLangDo) Order(conds ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTempLangDo) Distinct(cols ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTempLangDo) Omit(cols ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTempLangDo) Join(table schema.Tabler, on ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTempLangDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTempLangDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTempLangDo) Group(cols ...field.Expr) *fissionTempLangDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTempLangDo) Having(conds ...gen.Condition) *fissionTempLangDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTempLangDo) Limit(limit int) *fissionTempLangDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTempLangDo) Offset(offset int) *fissionTempLangDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTempLangDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTempLangDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTempLangDo) Unscoped() *fissionTempLangDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTempLangDo) Create(values ...*model.FissionTempLang) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTempLangDo) CreateInBatches(values []*model.FissionTempLang, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTempLangDo) Save(values ...*model.FissionTempLang) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTempLangDo) First() (*model.FissionTempLang, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempLang), nil + } +} + +func (f fissionTempLangDo) Take() (*model.FissionTempLang, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempLang), nil + } +} + +func (f fissionTempLangDo) Last() (*model.FissionTempLang, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempLang), nil + } +} + +func (f fissionTempLangDo) Find() ([]*model.FissionTempLang, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTempLang), err +} + +func (f fissionTempLangDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTempLang, err error) { + buf := make([]*model.FissionTempLang, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTempLangDo) FindInBatches(result *[]*model.FissionTempLang, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTempLangDo) Attrs(attrs ...field.AssignExpr) *fissionTempLangDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTempLangDo) Assign(attrs ...field.AssignExpr) *fissionTempLangDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTempLangDo) Joins(fields ...field.RelationField) *fissionTempLangDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTempLangDo) Preload(fields ...field.RelationField) *fissionTempLangDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTempLangDo) FirstOrInit() (*model.FissionTempLang, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempLang), nil + } +} + +func (f fissionTempLangDo) FirstOrCreate() (*model.FissionTempLang, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTempLang), nil + } +} + +func (f fissionTempLangDo) FindByPage(offset int, limit int) (result []*model.FissionTempLang, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTempLangDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTempLangDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTempLangDo) Delete(models ...*model.FissionTempLang) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTempLangDo) withDO(do gen.Dao) *fissionTempLangDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_total.gen.go b/internal/repository/dao/fission_total.gen.go new file mode 100644 index 0000000..2d45b47 --- /dev/null +++ b/internal/repository/dao/fission_total.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTotal(db *gorm.DB, opts ...gen.DOOption) fissionTotal { + _fissionTotal := fissionTotal{} + + _fissionTotal.fissionTotalDo.UseDB(db, opts...) + _fissionTotal.fissionTotalDo.UseModel(&model.FissionTotal{}) + + tableName := _fissionTotal.fissionTotalDo.TableName() + _fissionTotal.ALL = field.NewAsterisk(tableName) + _fissionTotal.ID = field.NewInt64(tableName, "id") + _fissionTotal.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTotal.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTotal.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionTotal.Mark = field.NewString(tableName, "mark") + _fissionTotal.Num = field.NewInt64(tableName, "num") + _fissionTotal.UserNum = field.NewInt64(tableName, "user_num") + _fissionTotal.BehaviorType = field.NewInt32(tableName, "behavior_type") + + _fissionTotal.fillFieldMap() + + return _fissionTotal +} + +type fissionTotal struct { + fissionTotalDo fissionTotalDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + Mark field.String // 用户行为标识 + Num field.Int64 // 次数 + UserNum field.Int64 // 人数 + BehaviorType field.Int32 // 用户行为类型 + + fieldMap map[string]field.Expr +} + +func (f fissionTotal) Table(newTableName string) *fissionTotal { + f.fissionTotalDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTotal) As(alias string) *fissionTotal { + f.fissionTotalDo.DO = *(f.fissionTotalDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTotal) updateTableName(table string) *fissionTotal { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Mark = field.NewString(table, "mark") + f.Num = field.NewInt64(table, "num") + f.UserNum = field.NewInt64(table, "user_num") + f.BehaviorType = field.NewInt32(table, "behavior_type") + + f.fillFieldMap() + + return f +} + +func (f *fissionTotal) WithContext(ctx context.Context) *fissionTotalDo { + return f.fissionTotalDo.WithContext(ctx) +} + +func (f fissionTotal) TableName() string { return f.fissionTotalDo.TableName() } + +func (f fissionTotal) Alias() string { return f.fissionTotalDo.Alias() } + +func (f *fissionTotal) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTotal) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["mark"] = f.Mark + f.fieldMap["num"] = f.Num + f.fieldMap["user_num"] = f.UserNum + f.fieldMap["behavior_type"] = f.BehaviorType +} + +func (f fissionTotal) clone(db *gorm.DB) fissionTotal { + f.fissionTotalDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTotal) replaceDB(db *gorm.DB) fissionTotal { + f.fissionTotalDo.ReplaceDB(db) + return f +} + +type fissionTotalDo struct{ gen.DO } + +func (f fissionTotalDo) Debug() *fissionTotalDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTotalDo) WithContext(ctx context.Context) *fissionTotalDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTotalDo) ReadDB() *fissionTotalDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTotalDo) WriteDB() *fissionTotalDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTotalDo) Session(config *gorm.Session) *fissionTotalDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTotalDo) Clauses(conds ...clause.Expression) *fissionTotalDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTotalDo) Returning(value interface{}, columns ...string) *fissionTotalDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTotalDo) Not(conds ...gen.Condition) *fissionTotalDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTotalDo) Or(conds ...gen.Condition) *fissionTotalDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTotalDo) Select(conds ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTotalDo) Where(conds ...gen.Condition) *fissionTotalDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTotalDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTotalDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTotalDo) Order(conds ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTotalDo) Distinct(cols ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTotalDo) Omit(cols ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTotalDo) Join(table schema.Tabler, on ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTotalDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTotalDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTotalDo) Group(cols ...field.Expr) *fissionTotalDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTotalDo) Having(conds ...gen.Condition) *fissionTotalDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTotalDo) Limit(limit int) *fissionTotalDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTotalDo) Offset(offset int) *fissionTotalDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTotalDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTotalDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTotalDo) Unscoped() *fissionTotalDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTotalDo) Create(values ...*model.FissionTotal) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTotalDo) CreateInBatches(values []*model.FissionTotal, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTotalDo) Save(values ...*model.FissionTotal) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTotalDo) First() (*model.FissionTotal, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotal), nil + } +} + +func (f fissionTotalDo) Take() (*model.FissionTotal, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotal), nil + } +} + +func (f fissionTotalDo) Last() (*model.FissionTotal, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotal), nil + } +} + +func (f fissionTotalDo) Find() ([]*model.FissionTotal, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTotal), err +} + +func (f fissionTotalDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTotal, err error) { + buf := make([]*model.FissionTotal, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTotalDo) FindInBatches(result *[]*model.FissionTotal, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTotalDo) Attrs(attrs ...field.AssignExpr) *fissionTotalDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTotalDo) Assign(attrs ...field.AssignExpr) *fissionTotalDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTotalDo) Joins(fields ...field.RelationField) *fissionTotalDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTotalDo) Preload(fields ...field.RelationField) *fissionTotalDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTotalDo) FirstOrInit() (*model.FissionTotal, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotal), nil + } +} + +func (f fissionTotalDo) FirstOrCreate() (*model.FissionTotal, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotal), nil + } +} + +func (f fissionTotalDo) FindByPage(offset int, limit int) (result []*model.FissionTotal, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTotalDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTotalDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTotalDo) Delete(models ...*model.FissionTotal) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTotalDo) withDO(do gen.Dao) *fissionTotalDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_total_cycle.gen.go b/internal/repository/dao/fission_total_cycle.gen.go new file mode 100644 index 0000000..827fcfc --- /dev/null +++ b/internal/repository/dao/fission_total_cycle.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionTotalCycle(db *gorm.DB, opts ...gen.DOOption) fissionTotalCycle { + _fissionTotalCycle := fissionTotalCycle{} + + _fissionTotalCycle.fissionTotalCycleDo.UseDB(db, opts...) + _fissionTotalCycle.fissionTotalCycleDo.UseModel(&model.FissionTotalCycle{}) + + tableName := _fissionTotalCycle.fissionTotalCycleDo.TableName() + _fissionTotalCycle.ALL = field.NewAsterisk(tableName) + _fissionTotalCycle.ID = field.NewInt64(tableName, "id") + _fissionTotalCycle.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionTotalCycle.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionTotalCycle.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionTotalCycle.StatTime = field.NewInt64(tableName, "stat_time") + _fissionTotalCycle.StatType = field.NewInt8(tableName, "stat_type") + _fissionTotalCycle.Mark = field.NewString(tableName, "mark") + _fissionTotalCycle.Num = field.NewInt64(tableName, "num") + _fissionTotalCycle.UserNum = field.NewInt64(tableName, "user_num") + _fissionTotalCycle.BehaviorType = field.NewInt32(tableName, "behavior_type") + + _fissionTotalCycle.fillFieldMap() + + return _fissionTotalCycle +} + +type fissionTotalCycle struct { + fissionTotalCycleDo fissionTotalCycleDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + StatTime field.Int64 // 统计时间 + StatType field.Int8 // 统计类型(1-小时,2-天) + Mark field.String // 用户行为标识 + Num field.Int64 // 次数 + UserNum field.Int64 // 人数 + BehaviorType field.Int32 // 用户行为类型 + + fieldMap map[string]field.Expr +} + +func (f fissionTotalCycle) Table(newTableName string) *fissionTotalCycle { + f.fissionTotalCycleDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionTotalCycle) As(alias string) *fissionTotalCycle { + f.fissionTotalCycleDo.DO = *(f.fissionTotalCycleDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionTotalCycle) updateTableName(table string) *fissionTotalCycle { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.StatTime = field.NewInt64(table, "stat_time") + f.StatType = field.NewInt8(table, "stat_type") + f.Mark = field.NewString(table, "mark") + f.Num = field.NewInt64(table, "num") + f.UserNum = field.NewInt64(table, "user_num") + f.BehaviorType = field.NewInt32(table, "behavior_type") + + f.fillFieldMap() + + return f +} + +func (f *fissionTotalCycle) WithContext(ctx context.Context) *fissionTotalCycleDo { + return f.fissionTotalCycleDo.WithContext(ctx) +} + +func (f fissionTotalCycle) TableName() string { return f.fissionTotalCycleDo.TableName() } + +func (f fissionTotalCycle) Alias() string { return f.fissionTotalCycleDo.Alias() } + +func (f *fissionTotalCycle) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionTotalCycle) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["stat_time"] = f.StatTime + f.fieldMap["stat_type"] = f.StatType + f.fieldMap["mark"] = f.Mark + f.fieldMap["num"] = f.Num + f.fieldMap["user_num"] = f.UserNum + f.fieldMap["behavior_type"] = f.BehaviorType +} + +func (f fissionTotalCycle) clone(db *gorm.DB) fissionTotalCycle { + f.fissionTotalCycleDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionTotalCycle) replaceDB(db *gorm.DB) fissionTotalCycle { + f.fissionTotalCycleDo.ReplaceDB(db) + return f +} + +type fissionTotalCycleDo struct{ gen.DO } + +func (f fissionTotalCycleDo) Debug() *fissionTotalCycleDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionTotalCycleDo) WithContext(ctx context.Context) *fissionTotalCycleDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionTotalCycleDo) ReadDB() *fissionTotalCycleDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionTotalCycleDo) WriteDB() *fissionTotalCycleDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionTotalCycleDo) Session(config *gorm.Session) *fissionTotalCycleDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionTotalCycleDo) Clauses(conds ...clause.Expression) *fissionTotalCycleDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionTotalCycleDo) Returning(value interface{}, columns ...string) *fissionTotalCycleDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionTotalCycleDo) Not(conds ...gen.Condition) *fissionTotalCycleDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionTotalCycleDo) Or(conds ...gen.Condition) *fissionTotalCycleDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionTotalCycleDo) Select(conds ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionTotalCycleDo) Where(conds ...gen.Condition) *fissionTotalCycleDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionTotalCycleDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionTotalCycleDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionTotalCycleDo) Order(conds ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionTotalCycleDo) Distinct(cols ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionTotalCycleDo) Omit(cols ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionTotalCycleDo) Join(table schema.Tabler, on ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionTotalCycleDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionTotalCycleDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionTotalCycleDo) Group(cols ...field.Expr) *fissionTotalCycleDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionTotalCycleDo) Having(conds ...gen.Condition) *fissionTotalCycleDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionTotalCycleDo) Limit(limit int) *fissionTotalCycleDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionTotalCycleDo) Offset(offset int) *fissionTotalCycleDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionTotalCycleDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionTotalCycleDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionTotalCycleDo) Unscoped() *fissionTotalCycleDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionTotalCycleDo) Create(values ...*model.FissionTotalCycle) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionTotalCycleDo) CreateInBatches(values []*model.FissionTotalCycle, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionTotalCycleDo) Save(values ...*model.FissionTotalCycle) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionTotalCycleDo) First() (*model.FissionTotalCycle, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotalCycle), nil + } +} + +func (f fissionTotalCycleDo) Take() (*model.FissionTotalCycle, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotalCycle), nil + } +} + +func (f fissionTotalCycleDo) Last() (*model.FissionTotalCycle, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotalCycle), nil + } +} + +func (f fissionTotalCycleDo) Find() ([]*model.FissionTotalCycle, error) { + result, err := f.DO.Find() + return result.([]*model.FissionTotalCycle), err +} + +func (f fissionTotalCycleDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionTotalCycle, err error) { + buf := make([]*model.FissionTotalCycle, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionTotalCycleDo) FindInBatches(result *[]*model.FissionTotalCycle, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionTotalCycleDo) Attrs(attrs ...field.AssignExpr) *fissionTotalCycleDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionTotalCycleDo) Assign(attrs ...field.AssignExpr) *fissionTotalCycleDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionTotalCycleDo) Joins(fields ...field.RelationField) *fissionTotalCycleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionTotalCycleDo) Preload(fields ...field.RelationField) *fissionTotalCycleDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionTotalCycleDo) FirstOrInit() (*model.FissionTotalCycle, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotalCycle), nil + } +} + +func (f fissionTotalCycleDo) FirstOrCreate() (*model.FissionTotalCycle, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionTotalCycle), nil + } +} + +func (f fissionTotalCycleDo) FindByPage(offset int, limit int) (result []*model.FissionTotalCycle, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionTotalCycleDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionTotalCycleDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionTotalCycleDo) Delete(models ...*model.FissionTotalCycle) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionTotalCycleDo) withDO(do gen.Dao) *fissionTotalCycleDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_unlock_reward.gen.go b/internal/repository/dao/fission_unlock_reward.gen.go new file mode 100644 index 0000000..4d929fa --- /dev/null +++ b/internal/repository/dao/fission_unlock_reward.gen.go @@ -0,0 +1,347 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUnlockReward(db *gorm.DB, opts ...gen.DOOption) fissionUnlockReward { + _fissionUnlockReward := fissionUnlockReward{} + + _fissionUnlockReward.fissionUnlockRewardDo.UseDB(db, opts...) + _fissionUnlockReward.fissionUnlockRewardDo.UseModel(&model.FissionUnlockReward{}) + + tableName := _fissionUnlockReward.fissionUnlockRewardDo.TableName() + _fissionUnlockReward.ALL = field.NewAsterisk(tableName) + _fissionUnlockReward.ID = field.NewInt64(tableName, "id") + _fissionUnlockReward.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUnlockReward.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUnlockReward.UserID = field.NewInt64(tableName, "user_id") + _fissionUnlockReward.RewardID = field.NewInt64(tableName, "reward_id") + + _fissionUnlockReward.fillFieldMap() + + return _fissionUnlockReward +} + +type fissionUnlockReward struct { + fissionUnlockRewardDo fissionUnlockRewardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 活动用户ID(fission_user表主键) + RewardID field.Int64 // 活动奖品id + + fieldMap map[string]field.Expr +} + +func (f fissionUnlockReward) Table(newTableName string) *fissionUnlockReward { + f.fissionUnlockRewardDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUnlockReward) As(alias string) *fissionUnlockReward { + f.fissionUnlockRewardDo.DO = *(f.fissionUnlockRewardDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUnlockReward) updateTableName(table string) *fissionUnlockReward { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.RewardID = field.NewInt64(table, "reward_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionUnlockReward) WithContext(ctx context.Context) *fissionUnlockRewardDo { + return f.fissionUnlockRewardDo.WithContext(ctx) +} + +func (f fissionUnlockReward) TableName() string { return f.fissionUnlockRewardDo.TableName() } + +func (f fissionUnlockReward) Alias() string { return f.fissionUnlockRewardDo.Alias() } + +func (f *fissionUnlockReward) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUnlockReward) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 5) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["reward_id"] = f.RewardID +} + +func (f fissionUnlockReward) clone(db *gorm.DB) fissionUnlockReward { + f.fissionUnlockRewardDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUnlockReward) replaceDB(db *gorm.DB) fissionUnlockReward { + f.fissionUnlockRewardDo.ReplaceDB(db) + return f +} + +type fissionUnlockRewardDo struct{ gen.DO } + +func (f fissionUnlockRewardDo) Debug() *fissionUnlockRewardDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUnlockRewardDo) WithContext(ctx context.Context) *fissionUnlockRewardDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUnlockRewardDo) ReadDB() *fissionUnlockRewardDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUnlockRewardDo) WriteDB() *fissionUnlockRewardDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUnlockRewardDo) Session(config *gorm.Session) *fissionUnlockRewardDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUnlockRewardDo) Clauses(conds ...clause.Expression) *fissionUnlockRewardDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUnlockRewardDo) Returning(value interface{}, columns ...string) *fissionUnlockRewardDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUnlockRewardDo) Not(conds ...gen.Condition) *fissionUnlockRewardDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUnlockRewardDo) Or(conds ...gen.Condition) *fissionUnlockRewardDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUnlockRewardDo) Select(conds ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUnlockRewardDo) Where(conds ...gen.Condition) *fissionUnlockRewardDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUnlockRewardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUnlockRewardDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUnlockRewardDo) Order(conds ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUnlockRewardDo) Distinct(cols ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUnlockRewardDo) Omit(cols ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUnlockRewardDo) Join(table schema.Tabler, on ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUnlockRewardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUnlockRewardDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUnlockRewardDo) Group(cols ...field.Expr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUnlockRewardDo) Having(conds ...gen.Condition) *fissionUnlockRewardDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUnlockRewardDo) Limit(limit int) *fissionUnlockRewardDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUnlockRewardDo) Offset(offset int) *fissionUnlockRewardDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUnlockRewardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUnlockRewardDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUnlockRewardDo) Unscoped() *fissionUnlockRewardDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUnlockRewardDo) Create(values ...*model.FissionUnlockReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUnlockRewardDo) CreateInBatches(values []*model.FissionUnlockReward, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUnlockRewardDo) Save(values ...*model.FissionUnlockReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUnlockRewardDo) First() (*model.FissionUnlockReward, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnlockReward), nil + } +} + +func (f fissionUnlockRewardDo) Take() (*model.FissionUnlockReward, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnlockReward), nil + } +} + +func (f fissionUnlockRewardDo) Last() (*model.FissionUnlockReward, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnlockReward), nil + } +} + +func (f fissionUnlockRewardDo) Find() ([]*model.FissionUnlockReward, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUnlockReward), err +} + +func (f fissionUnlockRewardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUnlockReward, err error) { + buf := make([]*model.FissionUnlockReward, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUnlockRewardDo) FindInBatches(result *[]*model.FissionUnlockReward, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUnlockRewardDo) Attrs(attrs ...field.AssignExpr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUnlockRewardDo) Assign(attrs ...field.AssignExpr) *fissionUnlockRewardDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUnlockRewardDo) Joins(fields ...field.RelationField) *fissionUnlockRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUnlockRewardDo) Preload(fields ...field.RelationField) *fissionUnlockRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUnlockRewardDo) FirstOrInit() (*model.FissionUnlockReward, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnlockReward), nil + } +} + +func (f fissionUnlockRewardDo) FirstOrCreate() (*model.FissionUnlockReward, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnlockReward), nil + } +} + +func (f fissionUnlockRewardDo) FindByPage(offset int, limit int) (result []*model.FissionUnlockReward, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUnlockRewardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUnlockRewardDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUnlockRewardDo) Delete(models ...*model.FissionUnlockReward) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUnlockRewardDo) withDO(do gen.Dao) *fissionUnlockRewardDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_uno.gen.go b/internal/repository/dao/fission_uno.gen.go new file mode 100644 index 0000000..2d0db9e --- /dev/null +++ b/internal/repository/dao/fission_uno.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUno(db *gorm.DB, opts ...gen.DOOption) fissionUno { + _fissionUno := fissionUno{} + + _fissionUno.fissionUnoDo.UseDB(db, opts...) + _fissionUno.fissionUnoDo.UseModel(&model.FissionUno{}) + + tableName := _fissionUno.fissionUnoDo.TableName() + _fissionUno.ALL = field.NewAsterisk(tableName) + _fissionUno.ID = field.NewInt64(tableName, "id") + _fissionUno.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUno.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUno.UserID = field.NewInt64(tableName, "user_id") + _fissionUno.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUno.Chance = field.NewInt32(tableName, "chance") + _fissionUno.LastSign = field.NewString(tableName, "last_sign") + _fissionUno.SetInit = field.NewInt8(tableName, "set_init") + _fissionUno.ThreeNum = field.NewInt32(tableName, "three_num") + _fissionUno.FiveNum = field.NewInt32(tableName, "five_num") + _fissionUno.FixNum = field.NewInt32(tableName, "fix_num") + + _fissionUno.fillFieldMap() + + return _fissionUno +} + +type fissionUno struct { + fissionUnoDo fissionUnoDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + Chance field.Int32 // 抽奖机会数 + LastSign field.String // 最后签到日期 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + ThreeNum field.Int32 // +3道具牌数量 + FiveNum field.Int32 // +5道具牌数量 + FixNum field.Int32 // 固定颜色道具牌数量 + + fieldMap map[string]field.Expr +} + +func (f fissionUno) Table(newTableName string) *fissionUno { + f.fissionUnoDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUno) As(alias string) *fissionUno { + f.fissionUnoDo.DO = *(f.fissionUnoDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUno) updateTableName(table string) *fissionUno { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Chance = field.NewInt32(table, "chance") + f.LastSign = field.NewString(table, "last_sign") + f.SetInit = field.NewInt8(table, "set_init") + f.ThreeNum = field.NewInt32(table, "three_num") + f.FiveNum = field.NewInt32(table, "five_num") + f.FixNum = field.NewInt32(table, "fix_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionUno) WithContext(ctx context.Context) *fissionUnoDo { + return f.fissionUnoDo.WithContext(ctx) +} + +func (f fissionUno) TableName() string { return f.fissionUnoDo.TableName() } + +func (f fissionUno) Alias() string { return f.fissionUnoDo.Alias() } + +func (f *fissionUno) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUno) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["chance"] = f.Chance + f.fieldMap["last_sign"] = f.LastSign + f.fieldMap["set_init"] = f.SetInit + f.fieldMap["three_num"] = f.ThreeNum + f.fieldMap["five_num"] = f.FiveNum + f.fieldMap["fix_num"] = f.FixNum +} + +func (f fissionUno) clone(db *gorm.DB) fissionUno { + f.fissionUnoDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUno) replaceDB(db *gorm.DB) fissionUno { + f.fissionUnoDo.ReplaceDB(db) + return f +} + +type fissionUnoDo struct{ gen.DO } + +func (f fissionUnoDo) Debug() *fissionUnoDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUnoDo) WithContext(ctx context.Context) *fissionUnoDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUnoDo) ReadDB() *fissionUnoDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUnoDo) WriteDB() *fissionUnoDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUnoDo) Session(config *gorm.Session) *fissionUnoDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUnoDo) Clauses(conds ...clause.Expression) *fissionUnoDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUnoDo) Returning(value interface{}, columns ...string) *fissionUnoDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUnoDo) Not(conds ...gen.Condition) *fissionUnoDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUnoDo) Or(conds ...gen.Condition) *fissionUnoDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUnoDo) Select(conds ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUnoDo) Where(conds ...gen.Condition) *fissionUnoDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUnoDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUnoDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUnoDo) Order(conds ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUnoDo) Distinct(cols ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUnoDo) Omit(cols ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUnoDo) Join(table schema.Tabler, on ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUnoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUnoDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUnoDo) Group(cols ...field.Expr) *fissionUnoDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUnoDo) Having(conds ...gen.Condition) *fissionUnoDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUnoDo) Limit(limit int) *fissionUnoDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUnoDo) Offset(offset int) *fissionUnoDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUnoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUnoDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUnoDo) Unscoped() *fissionUnoDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUnoDo) Create(values ...*model.FissionUno) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUnoDo) CreateInBatches(values []*model.FissionUno, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUnoDo) Save(values ...*model.FissionUno) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUnoDo) First() (*model.FissionUno, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUno), nil + } +} + +func (f fissionUnoDo) Take() (*model.FissionUno, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUno), nil + } +} + +func (f fissionUnoDo) Last() (*model.FissionUno, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUno), nil + } +} + +func (f fissionUnoDo) Find() ([]*model.FissionUno, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUno), err +} + +func (f fissionUnoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUno, err error) { + buf := make([]*model.FissionUno, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUnoDo) FindInBatches(result *[]*model.FissionUno, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUnoDo) Attrs(attrs ...field.AssignExpr) *fissionUnoDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUnoDo) Assign(attrs ...field.AssignExpr) *fissionUnoDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUnoDo) Joins(fields ...field.RelationField) *fissionUnoDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUnoDo) Preload(fields ...field.RelationField) *fissionUnoDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUnoDo) FirstOrInit() (*model.FissionUno, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUno), nil + } +} + +func (f fissionUnoDo) FirstOrCreate() (*model.FissionUno, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUno), nil + } +} + +func (f fissionUnoDo) FindByPage(offset int, limit int) (result []*model.FissionUno, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUnoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUnoDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUnoDo) Delete(models ...*model.FissionUno) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUnoDo) withDO(do gen.Dao) *fissionUnoDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_uno_collect.gen.go b/internal/repository/dao/fission_uno_collect.gen.go new file mode 100644 index 0000000..fb553a6 --- /dev/null +++ b/internal/repository/dao/fission_uno_collect.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUnoCollect(db *gorm.DB, opts ...gen.DOOption) fissionUnoCollect { + _fissionUnoCollect := fissionUnoCollect{} + + _fissionUnoCollect.fissionUnoCollectDo.UseDB(db, opts...) + _fissionUnoCollect.fissionUnoCollectDo.UseModel(&model.FissionUnoCollect{}) + + tableName := _fissionUnoCollect.fissionUnoCollectDo.TableName() + _fissionUnoCollect.ALL = field.NewAsterisk(tableName) + _fissionUnoCollect.ID = field.NewInt64(tableName, "id") + _fissionUnoCollect.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUnoCollect.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUnoCollect.UserID = field.NewInt64(tableName, "user_id") + _fissionUnoCollect.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUnoCollect.UnoID = field.NewInt64(tableName, "uno_id") + _fissionUnoCollect.Mark = field.NewString(tableName, "mark") + _fissionUnoCollect.SignNum = field.NewInt32(tableName, "sign_num") + _fissionUnoCollect.IntactNum = field.NewInt32(tableName, "intact_num") + _fissionUnoCollect.PreIntactNum = field.NewInt32(tableName, "pre_intact_num") + _fissionUnoCollect.CardInfo = field.NewString(tableName, "card_info") + + _fissionUnoCollect.fillFieldMap() + + return _fissionUnoCollect +} + +type fissionUnoCollect struct { + fissionUnoCollectDo fissionUnoCollectDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + UnoID field.Int64 // 玩家id(fission_uno表) + Mark field.String // 收集颜色标识 + SignNum field.Int32 // 已经签到天数 + IntactNum field.Int32 // 完整奖品数 + PreIntactNum field.Int32 // 待合成奖品数 + CardInfo field.String // 卡片数据 + + fieldMap map[string]field.Expr +} + +func (f fissionUnoCollect) Table(newTableName string) *fissionUnoCollect { + f.fissionUnoCollectDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUnoCollect) As(alias string) *fissionUnoCollect { + f.fissionUnoCollectDo.DO = *(f.fissionUnoCollectDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUnoCollect) updateTableName(table string) *fissionUnoCollect { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UnoID = field.NewInt64(table, "uno_id") + f.Mark = field.NewString(table, "mark") + f.SignNum = field.NewInt32(table, "sign_num") + f.IntactNum = field.NewInt32(table, "intact_num") + f.PreIntactNum = field.NewInt32(table, "pre_intact_num") + f.CardInfo = field.NewString(table, "card_info") + + f.fillFieldMap() + + return f +} + +func (f *fissionUnoCollect) WithContext(ctx context.Context) *fissionUnoCollectDo { + return f.fissionUnoCollectDo.WithContext(ctx) +} + +func (f fissionUnoCollect) TableName() string { return f.fissionUnoCollectDo.TableName() } + +func (f fissionUnoCollect) Alias() string { return f.fissionUnoCollectDo.Alias() } + +func (f *fissionUnoCollect) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUnoCollect) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["uno_id"] = f.UnoID + f.fieldMap["mark"] = f.Mark + f.fieldMap["sign_num"] = f.SignNum + f.fieldMap["intact_num"] = f.IntactNum + f.fieldMap["pre_intact_num"] = f.PreIntactNum + f.fieldMap["card_info"] = f.CardInfo +} + +func (f fissionUnoCollect) clone(db *gorm.DB) fissionUnoCollect { + f.fissionUnoCollectDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUnoCollect) replaceDB(db *gorm.DB) fissionUnoCollect { + f.fissionUnoCollectDo.ReplaceDB(db) + return f +} + +type fissionUnoCollectDo struct{ gen.DO } + +func (f fissionUnoCollectDo) Debug() *fissionUnoCollectDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUnoCollectDo) WithContext(ctx context.Context) *fissionUnoCollectDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUnoCollectDo) ReadDB() *fissionUnoCollectDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUnoCollectDo) WriteDB() *fissionUnoCollectDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUnoCollectDo) Session(config *gorm.Session) *fissionUnoCollectDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUnoCollectDo) Clauses(conds ...clause.Expression) *fissionUnoCollectDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUnoCollectDo) Returning(value interface{}, columns ...string) *fissionUnoCollectDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUnoCollectDo) Not(conds ...gen.Condition) *fissionUnoCollectDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUnoCollectDo) Or(conds ...gen.Condition) *fissionUnoCollectDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUnoCollectDo) Select(conds ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUnoCollectDo) Where(conds ...gen.Condition) *fissionUnoCollectDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUnoCollectDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUnoCollectDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUnoCollectDo) Order(conds ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUnoCollectDo) Distinct(cols ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUnoCollectDo) Omit(cols ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUnoCollectDo) Join(table schema.Tabler, on ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUnoCollectDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUnoCollectDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUnoCollectDo) Group(cols ...field.Expr) *fissionUnoCollectDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUnoCollectDo) Having(conds ...gen.Condition) *fissionUnoCollectDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUnoCollectDo) Limit(limit int) *fissionUnoCollectDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUnoCollectDo) Offset(offset int) *fissionUnoCollectDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUnoCollectDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUnoCollectDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUnoCollectDo) Unscoped() *fissionUnoCollectDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUnoCollectDo) Create(values ...*model.FissionUnoCollect) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUnoCollectDo) CreateInBatches(values []*model.FissionUnoCollect, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUnoCollectDo) Save(values ...*model.FissionUnoCollect) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUnoCollectDo) First() (*model.FissionUnoCollect, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoCollect), nil + } +} + +func (f fissionUnoCollectDo) Take() (*model.FissionUnoCollect, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoCollect), nil + } +} + +func (f fissionUnoCollectDo) Last() (*model.FissionUnoCollect, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoCollect), nil + } +} + +func (f fissionUnoCollectDo) Find() ([]*model.FissionUnoCollect, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUnoCollect), err +} + +func (f fissionUnoCollectDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUnoCollect, err error) { + buf := make([]*model.FissionUnoCollect, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUnoCollectDo) FindInBatches(result *[]*model.FissionUnoCollect, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUnoCollectDo) Attrs(attrs ...field.AssignExpr) *fissionUnoCollectDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUnoCollectDo) Assign(attrs ...field.AssignExpr) *fissionUnoCollectDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUnoCollectDo) Joins(fields ...field.RelationField) *fissionUnoCollectDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUnoCollectDo) Preload(fields ...field.RelationField) *fissionUnoCollectDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUnoCollectDo) FirstOrInit() (*model.FissionUnoCollect, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoCollect), nil + } +} + +func (f fissionUnoCollectDo) FirstOrCreate() (*model.FissionUnoCollect, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoCollect), nil + } +} + +func (f fissionUnoCollectDo) FindByPage(offset int, limit int) (result []*model.FissionUnoCollect, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUnoCollectDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUnoCollectDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUnoCollectDo) Delete(models ...*model.FissionUnoCollect) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUnoCollectDo) withDO(do gen.Dao) *fissionUnoCollectDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_uno_log.gen.go b/internal/repository/dao/fission_uno_log.gen.go new file mode 100644 index 0000000..5d26a94 --- /dev/null +++ b/internal/repository/dao/fission_uno_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUnoLog(db *gorm.DB, opts ...gen.DOOption) fissionUnoLog { + _fissionUnoLog := fissionUnoLog{} + + _fissionUnoLog.fissionUnoLogDo.UseDB(db, opts...) + _fissionUnoLog.fissionUnoLogDo.UseModel(&model.FissionUnoLog{}) + + tableName := _fissionUnoLog.fissionUnoLogDo.TableName() + _fissionUnoLog.ALL = field.NewAsterisk(tableName) + _fissionUnoLog.ID = field.NewInt64(tableName, "id") + _fissionUnoLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUnoLog.UserID = field.NewInt64(tableName, "user_id") + _fissionUnoLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUnoLog.UnoID = field.NewInt64(tableName, "uno_id") + _fissionUnoLog.Type = field.NewInt8(tableName, "type") + _fissionUnoLog.Source = field.NewString(tableName, "source") + _fissionUnoLog.Val = field.NewString(tableName, "val") + + _fissionUnoLog.fillFieldMap() + + return _fissionUnoLog +} + +type fissionUnoLog struct { + fissionUnoLogDo fissionUnoLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + UnoID field.Int64 // 玩家id(fission_uno表id) + Type field.Int8 // 日志类型(1-获得抽奖机会,2-抽奖) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionUnoLog) Table(newTableName string) *fissionUnoLog { + f.fissionUnoLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUnoLog) As(alias string) *fissionUnoLog { + f.fissionUnoLogDo.DO = *(f.fissionUnoLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUnoLog) updateTableName(table string) *fissionUnoLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UnoID = field.NewInt64(table, "uno_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionUnoLog) WithContext(ctx context.Context) *fissionUnoLogDo { + return f.fissionUnoLogDo.WithContext(ctx) +} + +func (f fissionUnoLog) TableName() string { return f.fissionUnoLogDo.TableName() } + +func (f fissionUnoLog) Alias() string { return f.fissionUnoLogDo.Alias() } + +func (f *fissionUnoLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUnoLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["uno_id"] = f.UnoID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionUnoLog) clone(db *gorm.DB) fissionUnoLog { + f.fissionUnoLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUnoLog) replaceDB(db *gorm.DB) fissionUnoLog { + f.fissionUnoLogDo.ReplaceDB(db) + return f +} + +type fissionUnoLogDo struct{ gen.DO } + +func (f fissionUnoLogDo) Debug() *fissionUnoLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUnoLogDo) WithContext(ctx context.Context) *fissionUnoLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUnoLogDo) ReadDB() *fissionUnoLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUnoLogDo) WriteDB() *fissionUnoLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUnoLogDo) Session(config *gorm.Session) *fissionUnoLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUnoLogDo) Clauses(conds ...clause.Expression) *fissionUnoLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUnoLogDo) Returning(value interface{}, columns ...string) *fissionUnoLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUnoLogDo) Not(conds ...gen.Condition) *fissionUnoLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUnoLogDo) Or(conds ...gen.Condition) *fissionUnoLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUnoLogDo) Select(conds ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUnoLogDo) Where(conds ...gen.Condition) *fissionUnoLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUnoLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUnoLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUnoLogDo) Order(conds ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUnoLogDo) Distinct(cols ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUnoLogDo) Omit(cols ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUnoLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUnoLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUnoLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUnoLogDo) Group(cols ...field.Expr) *fissionUnoLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUnoLogDo) Having(conds ...gen.Condition) *fissionUnoLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUnoLogDo) Limit(limit int) *fissionUnoLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUnoLogDo) Offset(offset int) *fissionUnoLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUnoLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUnoLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUnoLogDo) Unscoped() *fissionUnoLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUnoLogDo) Create(values ...*model.FissionUnoLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUnoLogDo) CreateInBatches(values []*model.FissionUnoLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUnoLogDo) Save(values ...*model.FissionUnoLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUnoLogDo) First() (*model.FissionUnoLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoLog), nil + } +} + +func (f fissionUnoLogDo) Take() (*model.FissionUnoLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoLog), nil + } +} + +func (f fissionUnoLogDo) Last() (*model.FissionUnoLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoLog), nil + } +} + +func (f fissionUnoLogDo) Find() ([]*model.FissionUnoLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUnoLog), err +} + +func (f fissionUnoLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUnoLog, err error) { + buf := make([]*model.FissionUnoLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUnoLogDo) FindInBatches(result *[]*model.FissionUnoLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUnoLogDo) Attrs(attrs ...field.AssignExpr) *fissionUnoLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUnoLogDo) Assign(attrs ...field.AssignExpr) *fissionUnoLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUnoLogDo) Joins(fields ...field.RelationField) *fissionUnoLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUnoLogDo) Preload(fields ...field.RelationField) *fissionUnoLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUnoLogDo) FirstOrInit() (*model.FissionUnoLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoLog), nil + } +} + +func (f fissionUnoLogDo) FirstOrCreate() (*model.FissionUnoLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUnoLog), nil + } +} + +func (f fissionUnoLogDo) FindByPage(offset int, limit int) (result []*model.FissionUnoLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUnoLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUnoLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUnoLogDo) Delete(models ...*model.FissionUnoLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUnoLogDo) withDO(do gen.Dao) *fissionUnoLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user.gen.go b/internal/repository/dao/fission_user.gen.go new file mode 100644 index 0000000..37d76d0 --- /dev/null +++ b/internal/repository/dao/fission_user.gen.go @@ -0,0 +1,443 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUser(db *gorm.DB, opts ...gen.DOOption) fissionUser { + _fissionUser := fissionUser{} + + _fissionUser.fissionUserDo.UseDB(db, opts...) + _fissionUser.fissionUserDo.UseModel(&model.FissionUser{}) + + tableName := _fissionUser.fissionUserDo.TableName() + _fissionUser.ALL = field.NewAsterisk(tableName) + _fissionUser.ID = field.NewInt64(tableName, "id") + _fissionUser.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUser.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUser.IsDel = field.NewInt8(tableName, "is_del") + _fissionUser.HashID = field.NewString(tableName, "hash_id") + _fissionUser.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUser.ChannelID = field.NewInt64(tableName, "channel_id") + _fissionUser.ParentID = field.NewInt64(tableName, "parent_id") + _fissionUser.Deep = field.NewInt32(tableName, "deep") + _fissionUser.IsNew = field.NewInt8(tableName, "is_new") + _fissionUser.SubUserID = field.NewString(tableName, "sub_user_id") + _fissionUser.DeviceID = field.NewString(tableName, "device_id") + _fissionUser.UserMark = field.NewString(tableName, "user_mark") + _fissionUser.UserType = field.NewInt8(tableName, "user_type") + _fissionUser.ParentIds = field.NewString(tableName, "parent_ids") + _fissionUser.IsView = field.NewInt8(tableName, "is_view") + _fissionUser.ShareLink = field.NewString(tableName, "share_link") + _fissionUser.Source = field.NewInt8(tableName, "source") + _fissionUser.IsHelp = field.NewInt8(tableName, "is_help") + _fissionUser.LangMark = field.NewString(tableName, "lang_mark") + _fissionUser.LevelMark = field.NewString(tableName, "level_mark") + _fissionUser.UserLevelMark = field.NewString(tableName, "user_level_mark") + _fissionUser.UserLevel = field.NewInt64(tableName, "user_level") + _fissionUser.FixedUserLevel = field.NewInt8(tableName, "fixed_user_level") + _fissionUser.UserLang = field.NewString(tableName, "user_lang") + _fissionUser.UserCountry = field.NewString(tableName, "user_country") + _fissionUser.JoinAt = field.NewInt64(tableName, "join_at") + _fissionUser.InstallAt = field.NewInt64(tableName, "install_at") + _fissionUser.RegisterAt = field.NewInt64(tableName, "register_at") + + _fissionUser.fillFieldMap() + + return _fissionUser +} + +type fissionUser struct { + fissionUserDo fissionUserDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 对外hash_id + CampaignID field.Int64 // 活动ID(campaign表主键) + ChannelID field.Int64 // 渠道id(fission_campaign_channel表) + ParentID field.Int64 // 上级ID + Deep field.Int32 // 推广深度 + IsNew field.Int8 // 是否新安装用户(1-是,0-否) + SubUserID field.String // 关注用户ID + DeviceID field.String // 设备ID + UserMark field.String // 用户标识(当sub_user_id为空取device_id) + UserType field.Int8 // 用户类型(1-访客,2-参与用户) + ParentIds field.String // 祖上ID(父级以上,不包括父级) + IsView field.Int8 // 是否为预览用户(1-是,0-否) + ShareLink field.String // 分享链接 + Source field.Int8 // 来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件,6-动态下载页,7-网页端首次打开,8-支付事件) + IsHelp field.Int8 // 是否助力成功(0-否,1-是) + LangMark field.String // 活动语言标识 + LevelMark field.String // 请求带过来的等级标识 + UserLevelMark field.String // 用户等级标识 + UserLevel field.Int64 // 用户等级id标识 + FixedUserLevel field.Int8 // 用户等级是否已经固定(0-否,1-是) + UserLang field.String // 用户语言标识 + UserCountry field.String // 用户国家标识 + JoinAt field.Int64 // 进入活动的时间 + InstallAt field.Int64 // 首次安装时间 + RegisterAt field.Int64 // 首次注册时间 + + fieldMap map[string]field.Expr +} + +func (f fissionUser) Table(newTableName string) *fissionUser { + f.fissionUserDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUser) As(alias string) *fissionUser { + f.fissionUserDo.DO = *(f.fissionUserDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUser) updateTableName(table string) *fissionUser { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ChannelID = field.NewInt64(table, "channel_id") + f.ParentID = field.NewInt64(table, "parent_id") + f.Deep = field.NewInt32(table, "deep") + f.IsNew = field.NewInt8(table, "is_new") + f.SubUserID = field.NewString(table, "sub_user_id") + f.DeviceID = field.NewString(table, "device_id") + f.UserMark = field.NewString(table, "user_mark") + f.UserType = field.NewInt8(table, "user_type") + f.ParentIds = field.NewString(table, "parent_ids") + f.IsView = field.NewInt8(table, "is_view") + f.ShareLink = field.NewString(table, "share_link") + f.Source = field.NewInt8(table, "source") + f.IsHelp = field.NewInt8(table, "is_help") + f.LangMark = field.NewString(table, "lang_mark") + f.LevelMark = field.NewString(table, "level_mark") + f.UserLevelMark = field.NewString(table, "user_level_mark") + f.UserLevel = field.NewInt64(table, "user_level") + f.FixedUserLevel = field.NewInt8(table, "fixed_user_level") + f.UserLang = field.NewString(table, "user_lang") + f.UserCountry = field.NewString(table, "user_country") + f.JoinAt = field.NewInt64(table, "join_at") + f.InstallAt = field.NewInt64(table, "install_at") + f.RegisterAt = field.NewInt64(table, "register_at") + + f.fillFieldMap() + + return f +} + +func (f *fissionUser) WithContext(ctx context.Context) *fissionUserDo { + return f.fissionUserDo.WithContext(ctx) +} + +func (f fissionUser) TableName() string { return f.fissionUserDo.TableName() } + +func (f fissionUser) Alias() string { return f.fissionUserDo.Alias() } + +func (f *fissionUser) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUser) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 29) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["channel_id"] = f.ChannelID + f.fieldMap["parent_id"] = f.ParentID + f.fieldMap["deep"] = f.Deep + f.fieldMap["is_new"] = f.IsNew + f.fieldMap["sub_user_id"] = f.SubUserID + f.fieldMap["device_id"] = f.DeviceID + f.fieldMap["user_mark"] = f.UserMark + f.fieldMap["user_type"] = f.UserType + f.fieldMap["parent_ids"] = f.ParentIds + f.fieldMap["is_view"] = f.IsView + f.fieldMap["share_link"] = f.ShareLink + f.fieldMap["source"] = f.Source + f.fieldMap["is_help"] = f.IsHelp + f.fieldMap["lang_mark"] = f.LangMark + f.fieldMap["level_mark"] = f.LevelMark + f.fieldMap["user_level_mark"] = f.UserLevelMark + f.fieldMap["user_level"] = f.UserLevel + f.fieldMap["fixed_user_level"] = f.FixedUserLevel + f.fieldMap["user_lang"] = f.UserLang + f.fieldMap["user_country"] = f.UserCountry + f.fieldMap["join_at"] = f.JoinAt + f.fieldMap["install_at"] = f.InstallAt + f.fieldMap["register_at"] = f.RegisterAt +} + +func (f fissionUser) clone(db *gorm.DB) fissionUser { + f.fissionUserDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUser) replaceDB(db *gorm.DB) fissionUser { + f.fissionUserDo.ReplaceDB(db) + return f +} + +type fissionUserDo struct{ gen.DO } + +func (f fissionUserDo) Debug() *fissionUserDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserDo) WithContext(ctx context.Context) *fissionUserDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserDo) ReadDB() *fissionUserDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserDo) WriteDB() *fissionUserDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserDo) Session(config *gorm.Session) *fissionUserDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserDo) Clauses(conds ...clause.Expression) *fissionUserDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserDo) Returning(value interface{}, columns ...string) *fissionUserDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserDo) Not(conds ...gen.Condition) *fissionUserDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserDo) Or(conds ...gen.Condition) *fissionUserDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserDo) Select(conds ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserDo) Where(conds ...gen.Condition) *fissionUserDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserDo) Order(conds ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserDo) Distinct(cols ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserDo) Omit(cols ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserDo) Group(cols ...field.Expr) *fissionUserDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserDo) Having(conds ...gen.Condition) *fissionUserDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserDo) Limit(limit int) *fissionUserDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserDo) Offset(offset int) *fissionUserDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserDo) Unscoped() *fissionUserDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserDo) Create(values ...*model.FissionUser) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserDo) CreateInBatches(values []*model.FissionUser, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserDo) Save(values ...*model.FissionUser) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserDo) First() (*model.FissionUser, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUser), nil + } +} + +func (f fissionUserDo) Take() (*model.FissionUser, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUser), nil + } +} + +func (f fissionUserDo) Last() (*model.FissionUser, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUser), nil + } +} + +func (f fissionUserDo) Find() ([]*model.FissionUser, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUser), err +} + +func (f fissionUserDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUser, err error) { + buf := make([]*model.FissionUser, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserDo) FindInBatches(result *[]*model.FissionUser, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserDo) Attrs(attrs ...field.AssignExpr) *fissionUserDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserDo) Assign(attrs ...field.AssignExpr) *fissionUserDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserDo) Joins(fields ...field.RelationField) *fissionUserDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserDo) Preload(fields ...field.RelationField) *fissionUserDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserDo) FirstOrInit() (*model.FissionUser, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUser), nil + } +} + +func (f fissionUserDo) FirstOrCreate() (*model.FissionUser, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUser), nil + } +} + +func (f fissionUserDo) FindByPage(offset int, limit int) (result []*model.FissionUser, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserDo) Delete(models ...*model.FissionUser) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserDo) withDO(do gen.Dao) *fissionUserDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_active.gen.go b/internal/repository/dao/fission_user_active.gen.go new file mode 100644 index 0000000..a68526e --- /dev/null +++ b/internal/repository/dao/fission_user_active.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserActive(db *gorm.DB, opts ...gen.DOOption) fissionUserActive { + _fissionUserActive := fissionUserActive{} + + _fissionUserActive.fissionUserActiveDo.UseDB(db, opts...) + _fissionUserActive.fissionUserActiveDo.UseModel(&model.FissionUserActive{}) + + tableName := _fissionUserActive.fissionUserActiveDo.TableName() + _fissionUserActive.ALL = field.NewAsterisk(tableName) + _fissionUserActive.ID = field.NewInt64(tableName, "id") + _fissionUserActive.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserActive.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserActive.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserActive.UserID = field.NewInt64(tableName, "user_id") + _fissionUserActive.LastActive = field.NewInt64(tableName, "last_active") + + _fissionUserActive.fillFieldMap() + + return _fissionUserActive +} + +type fissionUserActive struct { + fissionUserActiveDo fissionUserActiveDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动Id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + LastActive field.Int64 // 最后活跃时间 + + fieldMap map[string]field.Expr +} + +func (f fissionUserActive) Table(newTableName string) *fissionUserActive { + f.fissionUserActiveDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserActive) As(alias string) *fissionUserActive { + f.fissionUserActiveDo.DO = *(f.fissionUserActiveDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserActive) updateTableName(table string) *fissionUserActive { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.LastActive = field.NewInt64(table, "last_active") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserActive) WithContext(ctx context.Context) *fissionUserActiveDo { + return f.fissionUserActiveDo.WithContext(ctx) +} + +func (f fissionUserActive) TableName() string { return f.fissionUserActiveDo.TableName() } + +func (f fissionUserActive) Alias() string { return f.fissionUserActiveDo.Alias() } + +func (f *fissionUserActive) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserActive) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["last_active"] = f.LastActive +} + +func (f fissionUserActive) clone(db *gorm.DB) fissionUserActive { + f.fissionUserActiveDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserActive) replaceDB(db *gorm.DB) fissionUserActive { + f.fissionUserActiveDo.ReplaceDB(db) + return f +} + +type fissionUserActiveDo struct{ gen.DO } + +func (f fissionUserActiveDo) Debug() *fissionUserActiveDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserActiveDo) WithContext(ctx context.Context) *fissionUserActiveDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserActiveDo) ReadDB() *fissionUserActiveDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserActiveDo) WriteDB() *fissionUserActiveDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserActiveDo) Session(config *gorm.Session) *fissionUserActiveDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserActiveDo) Clauses(conds ...clause.Expression) *fissionUserActiveDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserActiveDo) Returning(value interface{}, columns ...string) *fissionUserActiveDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserActiveDo) Not(conds ...gen.Condition) *fissionUserActiveDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserActiveDo) Or(conds ...gen.Condition) *fissionUserActiveDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserActiveDo) Select(conds ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserActiveDo) Where(conds ...gen.Condition) *fissionUserActiveDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserActiveDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserActiveDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserActiveDo) Order(conds ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserActiveDo) Distinct(cols ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserActiveDo) Omit(cols ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserActiveDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserActiveDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserActiveDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserActiveDo) Group(cols ...field.Expr) *fissionUserActiveDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserActiveDo) Having(conds ...gen.Condition) *fissionUserActiveDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserActiveDo) Limit(limit int) *fissionUserActiveDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserActiveDo) Offset(offset int) *fissionUserActiveDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserActiveDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserActiveDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserActiveDo) Unscoped() *fissionUserActiveDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserActiveDo) Create(values ...*model.FissionUserActive) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserActiveDo) CreateInBatches(values []*model.FissionUserActive, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserActiveDo) Save(values ...*model.FissionUserActive) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserActiveDo) First() (*model.FissionUserActive, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserActive), nil + } +} + +func (f fissionUserActiveDo) Take() (*model.FissionUserActive, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserActive), nil + } +} + +func (f fissionUserActiveDo) Last() (*model.FissionUserActive, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserActive), nil + } +} + +func (f fissionUserActiveDo) Find() ([]*model.FissionUserActive, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserActive), err +} + +func (f fissionUserActiveDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserActive, err error) { + buf := make([]*model.FissionUserActive, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserActiveDo) FindInBatches(result *[]*model.FissionUserActive, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserActiveDo) Attrs(attrs ...field.AssignExpr) *fissionUserActiveDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserActiveDo) Assign(attrs ...field.AssignExpr) *fissionUserActiveDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserActiveDo) Joins(fields ...field.RelationField) *fissionUserActiveDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserActiveDo) Preload(fields ...field.RelationField) *fissionUserActiveDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserActiveDo) FirstOrInit() (*model.FissionUserActive, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserActive), nil + } +} + +func (f fissionUserActiveDo) FirstOrCreate() (*model.FissionUserActive, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserActive), nil + } +} + +func (f fissionUserActiveDo) FindByPage(offset int, limit int) (result []*model.FissionUserActive, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserActiveDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserActiveDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserActiveDo) Delete(models ...*model.FissionUserActive) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserActiveDo) withDO(do gen.Dao) *fissionUserActiveDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_attr.gen.go b/internal/repository/dao/fission_user_attr.gen.go new file mode 100644 index 0000000..e48cbf9 --- /dev/null +++ b/internal/repository/dao/fission_user_attr.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserAttr(db *gorm.DB, opts ...gen.DOOption) fissionUserAttr { + _fissionUserAttr := fissionUserAttr{} + + _fissionUserAttr.fissionUserAttrDo.UseDB(db, opts...) + _fissionUserAttr.fissionUserAttrDo.UseModel(&model.FissionUserAttr{}) + + tableName := _fissionUserAttr.fissionUserAttrDo.TableName() + _fissionUserAttr.ALL = field.NewAsterisk(tableName) + _fissionUserAttr.ID = field.NewInt64(tableName, "id") + _fissionUserAttr.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserAttr.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserAttr.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserAttr.UserID = field.NewInt64(tableName, "user_id") + _fissionUserAttr.Attr = field.NewString(tableName, "attr") + _fissionUserAttr.Value = field.NewString(tableName, "value") + _fissionUserAttr.Values = field.NewString(tableName, "values") + + _fissionUserAttr.fillFieldMap() + + return _fissionUserAttr +} + +type fissionUserAttr struct { + fissionUserAttrDo fissionUserAttrDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(campaign表主键) + UserID field.Int64 // 用户ID(fission_user表) + Attr field.String // 属性标识 + Value field.String // 属性值 + Values field.String // 多属性值 + + fieldMap map[string]field.Expr +} + +func (f fissionUserAttr) Table(newTableName string) *fissionUserAttr { + f.fissionUserAttrDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserAttr) As(alias string) *fissionUserAttr { + f.fissionUserAttrDo.DO = *(f.fissionUserAttrDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserAttr) updateTableName(table string) *fissionUserAttr { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Attr = field.NewString(table, "attr") + f.Value = field.NewString(table, "value") + f.Values = field.NewString(table, "values") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserAttr) WithContext(ctx context.Context) *fissionUserAttrDo { + return f.fissionUserAttrDo.WithContext(ctx) +} + +func (f fissionUserAttr) TableName() string { return f.fissionUserAttrDo.TableName() } + +func (f fissionUserAttr) Alias() string { return f.fissionUserAttrDo.Alias() } + +func (f *fissionUserAttr) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserAttr) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["attr"] = f.Attr + f.fieldMap["value"] = f.Value + f.fieldMap["values"] = f.Values +} + +func (f fissionUserAttr) clone(db *gorm.DB) fissionUserAttr { + f.fissionUserAttrDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserAttr) replaceDB(db *gorm.DB) fissionUserAttr { + f.fissionUserAttrDo.ReplaceDB(db) + return f +} + +type fissionUserAttrDo struct{ gen.DO } + +func (f fissionUserAttrDo) Debug() *fissionUserAttrDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserAttrDo) WithContext(ctx context.Context) *fissionUserAttrDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserAttrDo) ReadDB() *fissionUserAttrDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserAttrDo) WriteDB() *fissionUserAttrDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserAttrDo) Session(config *gorm.Session) *fissionUserAttrDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserAttrDo) Clauses(conds ...clause.Expression) *fissionUserAttrDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserAttrDo) Returning(value interface{}, columns ...string) *fissionUserAttrDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserAttrDo) Not(conds ...gen.Condition) *fissionUserAttrDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserAttrDo) Or(conds ...gen.Condition) *fissionUserAttrDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserAttrDo) Select(conds ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserAttrDo) Where(conds ...gen.Condition) *fissionUserAttrDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserAttrDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserAttrDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserAttrDo) Order(conds ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserAttrDo) Distinct(cols ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserAttrDo) Omit(cols ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserAttrDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserAttrDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserAttrDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserAttrDo) Group(cols ...field.Expr) *fissionUserAttrDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserAttrDo) Having(conds ...gen.Condition) *fissionUserAttrDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserAttrDo) Limit(limit int) *fissionUserAttrDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserAttrDo) Offset(offset int) *fissionUserAttrDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserAttrDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserAttrDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserAttrDo) Unscoped() *fissionUserAttrDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserAttrDo) Create(values ...*model.FissionUserAttr) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserAttrDo) CreateInBatches(values []*model.FissionUserAttr, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserAttrDo) Save(values ...*model.FissionUserAttr) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserAttrDo) First() (*model.FissionUserAttr, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttr), nil + } +} + +func (f fissionUserAttrDo) Take() (*model.FissionUserAttr, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttr), nil + } +} + +func (f fissionUserAttrDo) Last() (*model.FissionUserAttr, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttr), nil + } +} + +func (f fissionUserAttrDo) Find() ([]*model.FissionUserAttr, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserAttr), err +} + +func (f fissionUserAttrDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserAttr, err error) { + buf := make([]*model.FissionUserAttr, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserAttrDo) FindInBatches(result *[]*model.FissionUserAttr, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserAttrDo) Attrs(attrs ...field.AssignExpr) *fissionUserAttrDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserAttrDo) Assign(attrs ...field.AssignExpr) *fissionUserAttrDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserAttrDo) Joins(fields ...field.RelationField) *fissionUserAttrDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserAttrDo) Preload(fields ...field.RelationField) *fissionUserAttrDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserAttrDo) FirstOrInit() (*model.FissionUserAttr, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttr), nil + } +} + +func (f fissionUserAttrDo) FirstOrCreate() (*model.FissionUserAttr, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttr), nil + } +} + +func (f fissionUserAttrDo) FindByPage(offset int, limit int) (result []*model.FissionUserAttr, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserAttrDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserAttrDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserAttrDo) Delete(models ...*model.FissionUserAttr) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserAttrDo) withDO(do gen.Dao) *fissionUserAttrDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_attr_total.gen.go b/internal/repository/dao/fission_user_attr_total.gen.go new file mode 100644 index 0000000..668c095 --- /dev/null +++ b/internal/repository/dao/fission_user_attr_total.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserAttrTotal(db *gorm.DB, opts ...gen.DOOption) fissionUserAttrTotal { + _fissionUserAttrTotal := fissionUserAttrTotal{} + + _fissionUserAttrTotal.fissionUserAttrTotalDo.UseDB(db, opts...) + _fissionUserAttrTotal.fissionUserAttrTotalDo.UseModel(&model.FissionUserAttrTotal{}) + + tableName := _fissionUserAttrTotal.fissionUserAttrTotalDo.TableName() + _fissionUserAttrTotal.ALL = field.NewAsterisk(tableName) + _fissionUserAttrTotal.ID = field.NewInt64(tableName, "id") + _fissionUserAttrTotal.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserAttrTotal.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserAttrTotal.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserAttrTotal.Attr = field.NewString(tableName, "attr") + _fissionUserAttrTotal.Val = field.NewString(tableName, "val") + _fissionUserAttrTotal.Num = field.NewInt64(tableName, "num") + + _fissionUserAttrTotal.fillFieldMap() + + return _fissionUserAttrTotal +} + +type fissionUserAttrTotal struct { + fissionUserAttrTotalDo fissionUserAttrTotalDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(campaign表主键) + Attr field.String // 属性标识 + Val field.String // 属性值 + Num field.Int64 // 人数 + + fieldMap map[string]field.Expr +} + +func (f fissionUserAttrTotal) Table(newTableName string) *fissionUserAttrTotal { + f.fissionUserAttrTotalDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserAttrTotal) As(alias string) *fissionUserAttrTotal { + f.fissionUserAttrTotalDo.DO = *(f.fissionUserAttrTotalDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserAttrTotal) updateTableName(table string) *fissionUserAttrTotal { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.Attr = field.NewString(table, "attr") + f.Val = field.NewString(table, "val") + f.Num = field.NewInt64(table, "num") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserAttrTotal) WithContext(ctx context.Context) *fissionUserAttrTotalDo { + return f.fissionUserAttrTotalDo.WithContext(ctx) +} + +func (f fissionUserAttrTotal) TableName() string { return f.fissionUserAttrTotalDo.TableName() } + +func (f fissionUserAttrTotal) Alias() string { return f.fissionUserAttrTotalDo.Alias() } + +func (f *fissionUserAttrTotal) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserAttrTotal) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["attr"] = f.Attr + f.fieldMap["val"] = f.Val + f.fieldMap["num"] = f.Num +} + +func (f fissionUserAttrTotal) clone(db *gorm.DB) fissionUserAttrTotal { + f.fissionUserAttrTotalDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserAttrTotal) replaceDB(db *gorm.DB) fissionUserAttrTotal { + f.fissionUserAttrTotalDo.ReplaceDB(db) + return f +} + +type fissionUserAttrTotalDo struct{ gen.DO } + +func (f fissionUserAttrTotalDo) Debug() *fissionUserAttrTotalDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserAttrTotalDo) WithContext(ctx context.Context) *fissionUserAttrTotalDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserAttrTotalDo) ReadDB() *fissionUserAttrTotalDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserAttrTotalDo) WriteDB() *fissionUserAttrTotalDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserAttrTotalDo) Session(config *gorm.Session) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserAttrTotalDo) Clauses(conds ...clause.Expression) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserAttrTotalDo) Returning(value interface{}, columns ...string) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserAttrTotalDo) Not(conds ...gen.Condition) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserAttrTotalDo) Or(conds ...gen.Condition) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserAttrTotalDo) Select(conds ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserAttrTotalDo) Where(conds ...gen.Condition) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserAttrTotalDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserAttrTotalDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserAttrTotalDo) Order(conds ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserAttrTotalDo) Distinct(cols ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserAttrTotalDo) Omit(cols ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserAttrTotalDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserAttrTotalDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserAttrTotalDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserAttrTotalDo) Group(cols ...field.Expr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserAttrTotalDo) Having(conds ...gen.Condition) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserAttrTotalDo) Limit(limit int) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserAttrTotalDo) Offset(offset int) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserAttrTotalDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserAttrTotalDo) Unscoped() *fissionUserAttrTotalDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserAttrTotalDo) Create(values ...*model.FissionUserAttrTotal) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserAttrTotalDo) CreateInBatches(values []*model.FissionUserAttrTotal, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserAttrTotalDo) Save(values ...*model.FissionUserAttrTotal) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserAttrTotalDo) First() (*model.FissionUserAttrTotal, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttrTotal), nil + } +} + +func (f fissionUserAttrTotalDo) Take() (*model.FissionUserAttrTotal, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttrTotal), nil + } +} + +func (f fissionUserAttrTotalDo) Last() (*model.FissionUserAttrTotal, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttrTotal), nil + } +} + +func (f fissionUserAttrTotalDo) Find() ([]*model.FissionUserAttrTotal, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserAttrTotal), err +} + +func (f fissionUserAttrTotalDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserAttrTotal, err error) { + buf := make([]*model.FissionUserAttrTotal, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserAttrTotalDo) FindInBatches(result *[]*model.FissionUserAttrTotal, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserAttrTotalDo) Attrs(attrs ...field.AssignExpr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserAttrTotalDo) Assign(attrs ...field.AssignExpr) *fissionUserAttrTotalDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserAttrTotalDo) Joins(fields ...field.RelationField) *fissionUserAttrTotalDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserAttrTotalDo) Preload(fields ...field.RelationField) *fissionUserAttrTotalDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserAttrTotalDo) FirstOrInit() (*model.FissionUserAttrTotal, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttrTotal), nil + } +} + +func (f fissionUserAttrTotalDo) FirstOrCreate() (*model.FissionUserAttrTotal, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserAttrTotal), nil + } +} + +func (f fissionUserAttrTotalDo) FindByPage(offset int, limit int) (result []*model.FissionUserAttrTotal, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserAttrTotalDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserAttrTotalDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserAttrTotalDo) Delete(models ...*model.FissionUserAttrTotal) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserAttrTotalDo) withDO(do gen.Dao) *fissionUserAttrTotalDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_cond.gen.go b/internal/repository/dao/fission_user_cond.gen.go new file mode 100644 index 0000000..3c0ad62 --- /dev/null +++ b/internal/repository/dao/fission_user_cond.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserCond(db *gorm.DB, opts ...gen.DOOption) fissionUserCond { + _fissionUserCond := fissionUserCond{} + + _fissionUserCond.fissionUserCondDo.UseDB(db, opts...) + _fissionUserCond.fissionUserCondDo.UseModel(&model.FissionUserCond{}) + + tableName := _fissionUserCond.fissionUserCondDo.TableName() + _fissionUserCond.ALL = field.NewAsterisk(tableName) + _fissionUserCond.ID = field.NewInt64(tableName, "id") + _fissionUserCond.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserCond.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserCond.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserCond.UserID = field.NewInt64(tableName, "user_id") + _fissionUserCond.CondID = field.NewInt64(tableName, "cond_id") + _fissionUserCond.Num = field.NewInt64(tableName, "num") + _fissionUserCond.Total = field.NewString(tableName, "total") + _fissionUserCond.CountNum = field.NewInt64(tableName, "count_num") + _fissionUserCond.TotalExp = field.NewInt64(tableName, "total_exp") + + _fissionUserCond.fillFieldMap() + + return _fissionUserCond +} + +type fissionUserCond struct { + fissionUserCondDo fissionUserCondDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + CondID field.Int64 // 条件事件id(fission_campaign_cond表) + Num field.Int64 // 完成次数 + Total field.String // 累计值(当条件完成事累积型的时候,非空) + CountNum field.Int64 // 可计算的完成次数 + TotalExp field.Int64 // 可计算值的过期时间 + + fieldMap map[string]field.Expr +} + +func (f fissionUserCond) Table(newTableName string) *fissionUserCond { + f.fissionUserCondDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserCond) As(alias string) *fissionUserCond { + f.fissionUserCondDo.DO = *(f.fissionUserCondDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserCond) updateTableName(table string) *fissionUserCond { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.CondID = field.NewInt64(table, "cond_id") + f.Num = field.NewInt64(table, "num") + f.Total = field.NewString(table, "total") + f.CountNum = field.NewInt64(table, "count_num") + f.TotalExp = field.NewInt64(table, "total_exp") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserCond) WithContext(ctx context.Context) *fissionUserCondDo { + return f.fissionUserCondDo.WithContext(ctx) +} + +func (f fissionUserCond) TableName() string { return f.fissionUserCondDo.TableName() } + +func (f fissionUserCond) Alias() string { return f.fissionUserCondDo.Alias() } + +func (f *fissionUserCond) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserCond) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 10) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["cond_id"] = f.CondID + f.fieldMap["num"] = f.Num + f.fieldMap["total"] = f.Total + f.fieldMap["count_num"] = f.CountNum + f.fieldMap["total_exp"] = f.TotalExp +} + +func (f fissionUserCond) clone(db *gorm.DB) fissionUserCond { + f.fissionUserCondDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserCond) replaceDB(db *gorm.DB) fissionUserCond { + f.fissionUserCondDo.ReplaceDB(db) + return f +} + +type fissionUserCondDo struct{ gen.DO } + +func (f fissionUserCondDo) Debug() *fissionUserCondDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserCondDo) WithContext(ctx context.Context) *fissionUserCondDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserCondDo) ReadDB() *fissionUserCondDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserCondDo) WriteDB() *fissionUserCondDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserCondDo) Session(config *gorm.Session) *fissionUserCondDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserCondDo) Clauses(conds ...clause.Expression) *fissionUserCondDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserCondDo) Returning(value interface{}, columns ...string) *fissionUserCondDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserCondDo) Not(conds ...gen.Condition) *fissionUserCondDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserCondDo) Or(conds ...gen.Condition) *fissionUserCondDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserCondDo) Select(conds ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserCondDo) Where(conds ...gen.Condition) *fissionUserCondDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserCondDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserCondDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserCondDo) Order(conds ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserCondDo) Distinct(cols ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserCondDo) Omit(cols ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserCondDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserCondDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserCondDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserCondDo) Group(cols ...field.Expr) *fissionUserCondDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserCondDo) Having(conds ...gen.Condition) *fissionUserCondDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserCondDo) Limit(limit int) *fissionUserCondDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserCondDo) Offset(offset int) *fissionUserCondDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserCondDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserCondDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserCondDo) Unscoped() *fissionUserCondDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserCondDo) Create(values ...*model.FissionUserCond) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserCondDo) CreateInBatches(values []*model.FissionUserCond, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserCondDo) Save(values ...*model.FissionUserCond) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserCondDo) First() (*model.FissionUserCond, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCond), nil + } +} + +func (f fissionUserCondDo) Take() (*model.FissionUserCond, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCond), nil + } +} + +func (f fissionUserCondDo) Last() (*model.FissionUserCond, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCond), nil + } +} + +func (f fissionUserCondDo) Find() ([]*model.FissionUserCond, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserCond), err +} + +func (f fissionUserCondDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserCond, err error) { + buf := make([]*model.FissionUserCond, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserCondDo) FindInBatches(result *[]*model.FissionUserCond, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserCondDo) Attrs(attrs ...field.AssignExpr) *fissionUserCondDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserCondDo) Assign(attrs ...field.AssignExpr) *fissionUserCondDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserCondDo) Joins(fields ...field.RelationField) *fissionUserCondDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserCondDo) Preload(fields ...field.RelationField) *fissionUserCondDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserCondDo) FirstOrInit() (*model.FissionUserCond, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCond), nil + } +} + +func (f fissionUserCondDo) FirstOrCreate() (*model.FissionUserCond, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCond), nil + } +} + +func (f fissionUserCondDo) FindByPage(offset int, limit int) (result []*model.FissionUserCond, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserCondDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserCondDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserCondDo) Delete(models ...*model.FissionUserCond) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserCondDo) withDO(do gen.Dao) *fissionUserCondDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_cond_record.gen.go b/internal/repository/dao/fission_user_cond_record.gen.go new file mode 100644 index 0000000..f5aa933 --- /dev/null +++ b/internal/repository/dao/fission_user_cond_record.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserCondRecord(db *gorm.DB, opts ...gen.DOOption) fissionUserCondRecord { + _fissionUserCondRecord := fissionUserCondRecord{} + + _fissionUserCondRecord.fissionUserCondRecordDo.UseDB(db, opts...) + _fissionUserCondRecord.fissionUserCondRecordDo.UseModel(&model.FissionUserCondRecord{}) + + tableName := _fissionUserCondRecord.fissionUserCondRecordDo.TableName() + _fissionUserCondRecord.ALL = field.NewAsterisk(tableName) + _fissionUserCondRecord.ID = field.NewInt64(tableName, "id") + _fissionUserCondRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserCondRecord.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserCondRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserCondRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionUserCondRecord.CondID = field.NewInt64(tableName, "cond_id") + _fissionUserCondRecord.Val = field.NewString(tableName, "val") + _fissionUserCondRecord.IsUse = field.NewInt8(tableName, "is_use") + _fissionUserCondRecord.BehaviorTime = field.NewInt64(tableName, "behavior_time") + + _fissionUserCondRecord.fillFieldMap() + + return _fissionUserCondRecord +} + +type fissionUserCondRecord struct { + fissionUserCondRecordDo fissionUserCondRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + CondID field.Int64 // 条件事件id(fission_campaign_cond表) + Val field.String // 完成的触发值 + IsUse field.Int8 // 是否已被计算(0-否,1-是) + BehaviorTime field.Int64 // 行为发生时间 + + fieldMap map[string]field.Expr +} + +func (f fissionUserCondRecord) Table(newTableName string) *fissionUserCondRecord { + f.fissionUserCondRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserCondRecord) As(alias string) *fissionUserCondRecord { + f.fissionUserCondRecordDo.DO = *(f.fissionUserCondRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserCondRecord) updateTableName(table string) *fissionUserCondRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.CondID = field.NewInt64(table, "cond_id") + f.Val = field.NewString(table, "val") + f.IsUse = field.NewInt8(table, "is_use") + f.BehaviorTime = field.NewInt64(table, "behavior_time") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserCondRecord) WithContext(ctx context.Context) *fissionUserCondRecordDo { + return f.fissionUserCondRecordDo.WithContext(ctx) +} + +func (f fissionUserCondRecord) TableName() string { return f.fissionUserCondRecordDo.TableName() } + +func (f fissionUserCondRecord) Alias() string { return f.fissionUserCondRecordDo.Alias() } + +func (f *fissionUserCondRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserCondRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["cond_id"] = f.CondID + f.fieldMap["val"] = f.Val + f.fieldMap["is_use"] = f.IsUse + f.fieldMap["behavior_time"] = f.BehaviorTime +} + +func (f fissionUserCondRecord) clone(db *gorm.DB) fissionUserCondRecord { + f.fissionUserCondRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserCondRecord) replaceDB(db *gorm.DB) fissionUserCondRecord { + f.fissionUserCondRecordDo.ReplaceDB(db) + return f +} + +type fissionUserCondRecordDo struct{ gen.DO } + +func (f fissionUserCondRecordDo) Debug() *fissionUserCondRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserCondRecordDo) WithContext(ctx context.Context) *fissionUserCondRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserCondRecordDo) ReadDB() *fissionUserCondRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserCondRecordDo) WriteDB() *fissionUserCondRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserCondRecordDo) Session(config *gorm.Session) *fissionUserCondRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserCondRecordDo) Clauses(conds ...clause.Expression) *fissionUserCondRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserCondRecordDo) Returning(value interface{}, columns ...string) *fissionUserCondRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserCondRecordDo) Not(conds ...gen.Condition) *fissionUserCondRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserCondRecordDo) Or(conds ...gen.Condition) *fissionUserCondRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserCondRecordDo) Select(conds ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserCondRecordDo) Where(conds ...gen.Condition) *fissionUserCondRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserCondRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserCondRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserCondRecordDo) Order(conds ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserCondRecordDo) Distinct(cols ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserCondRecordDo) Omit(cols ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserCondRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserCondRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserCondRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserCondRecordDo) Group(cols ...field.Expr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserCondRecordDo) Having(conds ...gen.Condition) *fissionUserCondRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserCondRecordDo) Limit(limit int) *fissionUserCondRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserCondRecordDo) Offset(offset int) *fissionUserCondRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserCondRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserCondRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserCondRecordDo) Unscoped() *fissionUserCondRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserCondRecordDo) Create(values ...*model.FissionUserCondRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserCondRecordDo) CreateInBatches(values []*model.FissionUserCondRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserCondRecordDo) Save(values ...*model.FissionUserCondRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserCondRecordDo) First() (*model.FissionUserCondRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCondRecord), nil + } +} + +func (f fissionUserCondRecordDo) Take() (*model.FissionUserCondRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCondRecord), nil + } +} + +func (f fissionUserCondRecordDo) Last() (*model.FissionUserCondRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCondRecord), nil + } +} + +func (f fissionUserCondRecordDo) Find() ([]*model.FissionUserCondRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserCondRecord), err +} + +func (f fissionUserCondRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserCondRecord, err error) { + buf := make([]*model.FissionUserCondRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserCondRecordDo) FindInBatches(result *[]*model.FissionUserCondRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserCondRecordDo) Attrs(attrs ...field.AssignExpr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserCondRecordDo) Assign(attrs ...field.AssignExpr) *fissionUserCondRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserCondRecordDo) Joins(fields ...field.RelationField) *fissionUserCondRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserCondRecordDo) Preload(fields ...field.RelationField) *fissionUserCondRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserCondRecordDo) FirstOrInit() (*model.FissionUserCondRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCondRecord), nil + } +} + +func (f fissionUserCondRecordDo) FirstOrCreate() (*model.FissionUserCondRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCondRecord), nil + } +} + +func (f fissionUserCondRecordDo) FindByPage(offset int, limit int) (result []*model.FissionUserCondRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserCondRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserCondRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserCondRecordDo) Delete(models ...*model.FissionUserCondRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserCondRecordDo) withDO(do gen.Dao) *fissionUserCondRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_ctlink.gen.go b/internal/repository/dao/fission_user_ctlink.gen.go new file mode 100644 index 0000000..406e955 --- /dev/null +++ b/internal/repository/dao/fission_user_ctlink.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserCtlink(db *gorm.DB, opts ...gen.DOOption) fissionUserCtlink { + _fissionUserCtlink := fissionUserCtlink{} + + _fissionUserCtlink.fissionUserCtlinkDo.UseDB(db, opts...) + _fissionUserCtlink.fissionUserCtlinkDo.UseModel(&model.FissionUserCtlink{}) + + tableName := _fissionUserCtlink.fissionUserCtlinkDo.TableName() + _fissionUserCtlink.ALL = field.NewAsterisk(tableName) + _fissionUserCtlink.ID = field.NewInt64(tableName, "id") + _fissionUserCtlink.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserCtlink.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserCtlink.HashID = field.NewString(tableName, "hash_id") + _fissionUserCtlink.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserCtlink.UserID = field.NewInt64(tableName, "user_id") + _fissionUserCtlink.Mark = field.NewString(tableName, "mark") + _fissionUserCtlink.MarkID = field.NewInt64(tableName, "mark_id") + _fissionUserCtlink.LinkURL = field.NewString(tableName, "link_url") + + _fissionUserCtlink.fillFieldMap() + + return _fissionUserCtlink +} + +type fissionUserCtlink struct { + fissionUserCtlinkDo fissionUserCtlinkDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 对外的唯一id + CampaignID field.Int64 // 活动id + UserID field.Int64 // 用户id + Mark field.String // 内容类型(qa-问题) + MarkID field.Int64 // 内容类型对应的数据id + LinkURL field.String // 链接 + + fieldMap map[string]field.Expr +} + +func (f fissionUserCtlink) Table(newTableName string) *fissionUserCtlink { + f.fissionUserCtlinkDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserCtlink) As(alias string) *fissionUserCtlink { + f.fissionUserCtlinkDo.DO = *(f.fissionUserCtlinkDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserCtlink) updateTableName(table string) *fissionUserCtlink { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Mark = field.NewString(table, "mark") + f.MarkID = field.NewInt64(table, "mark_id") + f.LinkURL = field.NewString(table, "link_url") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserCtlink) WithContext(ctx context.Context) *fissionUserCtlinkDo { + return f.fissionUserCtlinkDo.WithContext(ctx) +} + +func (f fissionUserCtlink) TableName() string { return f.fissionUserCtlinkDo.TableName() } + +func (f fissionUserCtlink) Alias() string { return f.fissionUserCtlinkDo.Alias() } + +func (f *fissionUserCtlink) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserCtlink) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["mark"] = f.Mark + f.fieldMap["mark_id"] = f.MarkID + f.fieldMap["link_url"] = f.LinkURL +} + +func (f fissionUserCtlink) clone(db *gorm.DB) fissionUserCtlink { + f.fissionUserCtlinkDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserCtlink) replaceDB(db *gorm.DB) fissionUserCtlink { + f.fissionUserCtlinkDo.ReplaceDB(db) + return f +} + +type fissionUserCtlinkDo struct{ gen.DO } + +func (f fissionUserCtlinkDo) Debug() *fissionUserCtlinkDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserCtlinkDo) WithContext(ctx context.Context) *fissionUserCtlinkDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserCtlinkDo) ReadDB() *fissionUserCtlinkDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserCtlinkDo) WriteDB() *fissionUserCtlinkDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserCtlinkDo) Session(config *gorm.Session) *fissionUserCtlinkDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserCtlinkDo) Clauses(conds ...clause.Expression) *fissionUserCtlinkDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserCtlinkDo) Returning(value interface{}, columns ...string) *fissionUserCtlinkDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserCtlinkDo) Not(conds ...gen.Condition) *fissionUserCtlinkDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserCtlinkDo) Or(conds ...gen.Condition) *fissionUserCtlinkDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserCtlinkDo) Select(conds ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserCtlinkDo) Where(conds ...gen.Condition) *fissionUserCtlinkDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserCtlinkDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserCtlinkDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserCtlinkDo) Order(conds ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserCtlinkDo) Distinct(cols ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserCtlinkDo) Omit(cols ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserCtlinkDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserCtlinkDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserCtlinkDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserCtlinkDo) Group(cols ...field.Expr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserCtlinkDo) Having(conds ...gen.Condition) *fissionUserCtlinkDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserCtlinkDo) Limit(limit int) *fissionUserCtlinkDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserCtlinkDo) Offset(offset int) *fissionUserCtlinkDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserCtlinkDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserCtlinkDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserCtlinkDo) Unscoped() *fissionUserCtlinkDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserCtlinkDo) Create(values ...*model.FissionUserCtlink) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserCtlinkDo) CreateInBatches(values []*model.FissionUserCtlink, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserCtlinkDo) Save(values ...*model.FissionUserCtlink) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserCtlinkDo) First() (*model.FissionUserCtlink, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCtlink), nil + } +} + +func (f fissionUserCtlinkDo) Take() (*model.FissionUserCtlink, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCtlink), nil + } +} + +func (f fissionUserCtlinkDo) Last() (*model.FissionUserCtlink, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCtlink), nil + } +} + +func (f fissionUserCtlinkDo) Find() ([]*model.FissionUserCtlink, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserCtlink), err +} + +func (f fissionUserCtlinkDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserCtlink, err error) { + buf := make([]*model.FissionUserCtlink, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserCtlinkDo) FindInBatches(result *[]*model.FissionUserCtlink, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserCtlinkDo) Attrs(attrs ...field.AssignExpr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserCtlinkDo) Assign(attrs ...field.AssignExpr) *fissionUserCtlinkDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserCtlinkDo) Joins(fields ...field.RelationField) *fissionUserCtlinkDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserCtlinkDo) Preload(fields ...field.RelationField) *fissionUserCtlinkDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserCtlinkDo) FirstOrInit() (*model.FissionUserCtlink, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCtlink), nil + } +} + +func (f fissionUserCtlinkDo) FirstOrCreate() (*model.FissionUserCtlink, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserCtlink), nil + } +} + +func (f fissionUserCtlinkDo) FindByPage(offset int, limit int) (result []*model.FissionUserCtlink, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserCtlinkDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserCtlinkDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserCtlinkDo) Delete(models ...*model.FissionUserCtlink) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserCtlinkDo) withDO(do gen.Dao) *fissionUserCtlinkDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_dylink.gen.go b/internal/repository/dao/fission_user_dylink.gen.go new file mode 100644 index 0000000..13ad4ad --- /dev/null +++ b/internal/repository/dao/fission_user_dylink.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserDylink(db *gorm.DB, opts ...gen.DOOption) fissionUserDylink { + _fissionUserDylink := fissionUserDylink{} + + _fissionUserDylink.fissionUserDylinkDo.UseDB(db, opts...) + _fissionUserDylink.fissionUserDylinkDo.UseModel(&model.FissionUserDylink{}) + + tableName := _fissionUserDylink.fissionUserDylinkDo.TableName() + _fissionUserDylink.ALL = field.NewAsterisk(tableName) + _fissionUserDylink.ID = field.NewInt64(tableName, "id") + _fissionUserDylink.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserDylink.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserDylink.HashID = field.NewString(tableName, "hash_id") + _fissionUserDylink.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserDylink.UserID = field.NewInt64(tableName, "user_id") + _fissionUserDylink.LinkMark = field.NewString(tableName, "link_mark") + _fissionUserDylink.Params = field.NewString(tableName, "params") + _fissionUserDylink.LinkURL = field.NewString(tableName, "link_url") + + _fissionUserDylink.fillFieldMap() + + return _fissionUserDylink +} + +type fissionUserDylink struct { + fissionUserDylinkDo fissionUserDylinkDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 对外hash_id + CampaignID field.Int64 // 活动ID(campaign表主键) + UserID field.Int64 // 用户id + LinkMark field.String // 链接参数唯一标识 + Params field.String // 动态参数数据 + LinkURL field.String // 跳转地址 + + fieldMap map[string]field.Expr +} + +func (f fissionUserDylink) Table(newTableName string) *fissionUserDylink { + f.fissionUserDylinkDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserDylink) As(alias string) *fissionUserDylink { + f.fissionUserDylinkDo.DO = *(f.fissionUserDylinkDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserDylink) updateTableName(table string) *fissionUserDylink { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.HashID = field.NewString(table, "hash_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.LinkMark = field.NewString(table, "link_mark") + f.Params = field.NewString(table, "params") + f.LinkURL = field.NewString(table, "link_url") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserDylink) WithContext(ctx context.Context) *fissionUserDylinkDo { + return f.fissionUserDylinkDo.WithContext(ctx) +} + +func (f fissionUserDylink) TableName() string { return f.fissionUserDylinkDo.TableName() } + +func (f fissionUserDylink) Alias() string { return f.fissionUserDylinkDo.Alias() } + +func (f *fissionUserDylink) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserDylink) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["hash_id"] = f.HashID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["link_mark"] = f.LinkMark + f.fieldMap["params"] = f.Params + f.fieldMap["link_url"] = f.LinkURL +} + +func (f fissionUserDylink) clone(db *gorm.DB) fissionUserDylink { + f.fissionUserDylinkDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserDylink) replaceDB(db *gorm.DB) fissionUserDylink { + f.fissionUserDylinkDo.ReplaceDB(db) + return f +} + +type fissionUserDylinkDo struct{ gen.DO } + +func (f fissionUserDylinkDo) Debug() *fissionUserDylinkDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserDylinkDo) WithContext(ctx context.Context) *fissionUserDylinkDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserDylinkDo) ReadDB() *fissionUserDylinkDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserDylinkDo) WriteDB() *fissionUserDylinkDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserDylinkDo) Session(config *gorm.Session) *fissionUserDylinkDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserDylinkDo) Clauses(conds ...clause.Expression) *fissionUserDylinkDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserDylinkDo) Returning(value interface{}, columns ...string) *fissionUserDylinkDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserDylinkDo) Not(conds ...gen.Condition) *fissionUserDylinkDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserDylinkDo) Or(conds ...gen.Condition) *fissionUserDylinkDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserDylinkDo) Select(conds ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserDylinkDo) Where(conds ...gen.Condition) *fissionUserDylinkDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserDylinkDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserDylinkDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserDylinkDo) Order(conds ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserDylinkDo) Distinct(cols ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserDylinkDo) Omit(cols ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserDylinkDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserDylinkDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserDylinkDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserDylinkDo) Group(cols ...field.Expr) *fissionUserDylinkDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserDylinkDo) Having(conds ...gen.Condition) *fissionUserDylinkDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserDylinkDo) Limit(limit int) *fissionUserDylinkDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserDylinkDo) Offset(offset int) *fissionUserDylinkDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserDylinkDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserDylinkDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserDylinkDo) Unscoped() *fissionUserDylinkDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserDylinkDo) Create(values ...*model.FissionUserDylink) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserDylinkDo) CreateInBatches(values []*model.FissionUserDylink, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserDylinkDo) Save(values ...*model.FissionUserDylink) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserDylinkDo) First() (*model.FissionUserDylink, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserDylink), nil + } +} + +func (f fissionUserDylinkDo) Take() (*model.FissionUserDylink, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserDylink), nil + } +} + +func (f fissionUserDylinkDo) Last() (*model.FissionUserDylink, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserDylink), nil + } +} + +func (f fissionUserDylinkDo) Find() ([]*model.FissionUserDylink, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserDylink), err +} + +func (f fissionUserDylinkDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserDylink, err error) { + buf := make([]*model.FissionUserDylink, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserDylinkDo) FindInBatches(result *[]*model.FissionUserDylink, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserDylinkDo) Attrs(attrs ...field.AssignExpr) *fissionUserDylinkDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserDylinkDo) Assign(attrs ...field.AssignExpr) *fissionUserDylinkDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserDylinkDo) Joins(fields ...field.RelationField) *fissionUserDylinkDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserDylinkDo) Preload(fields ...field.RelationField) *fissionUserDylinkDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserDylinkDo) FirstOrInit() (*model.FissionUserDylink, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserDylink), nil + } +} + +func (f fissionUserDylinkDo) FirstOrCreate() (*model.FissionUserDylink, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserDylink), nil + } +} + +func (f fissionUserDylinkDo) FindByPage(offset int, limit int) (result []*model.FissionUserDylink, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserDylinkDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserDylinkDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserDylinkDo) Delete(models ...*model.FissionUserDylink) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserDylinkDo) withDO(do gen.Dao) *fissionUserDylinkDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_event.gen.go b/internal/repository/dao/fission_user_event.gen.go new file mode 100644 index 0000000..779b0f9 --- /dev/null +++ b/internal/repository/dao/fission_user_event.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserEvent(db *gorm.DB, opts ...gen.DOOption) fissionUserEvent { + _fissionUserEvent := fissionUserEvent{} + + _fissionUserEvent.fissionUserEventDo.UseDB(db, opts...) + _fissionUserEvent.fissionUserEventDo.UseModel(&model.FissionUserEvent{}) + + tableName := _fissionUserEvent.fissionUserEventDo.TableName() + _fissionUserEvent.ALL = field.NewAsterisk(tableName) + _fissionUserEvent.ID = field.NewInt64(tableName, "id") + _fissionUserEvent.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserEvent.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserEvent.UserID = field.NewInt64(tableName, "user_id") + _fissionUserEvent.Mark = field.NewString(tableName, "mark") + _fissionUserEvent.EventData = field.NewString(tableName, "event_data") + + _fissionUserEvent.fillFieldMap() + + return _fissionUserEvent +} + +type fissionUserEvent struct { + fissionUserEventDo fissionUserEventDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动Id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + Mark field.String // 标识(推送标识) + EventData field.String // 事件数据 + + fieldMap map[string]field.Expr +} + +func (f fissionUserEvent) Table(newTableName string) *fissionUserEvent { + f.fissionUserEventDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserEvent) As(alias string) *fissionUserEvent { + f.fissionUserEventDo.DO = *(f.fissionUserEventDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserEvent) updateTableName(table string) *fissionUserEvent { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Mark = field.NewString(table, "mark") + f.EventData = field.NewString(table, "event_data") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserEvent) WithContext(ctx context.Context) *fissionUserEventDo { + return f.fissionUserEventDo.WithContext(ctx) +} + +func (f fissionUserEvent) TableName() string { return f.fissionUserEventDo.TableName() } + +func (f fissionUserEvent) Alias() string { return f.fissionUserEventDo.Alias() } + +func (f *fissionUserEvent) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserEvent) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 6) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["mark"] = f.Mark + f.fieldMap["event_data"] = f.EventData +} + +func (f fissionUserEvent) clone(db *gorm.DB) fissionUserEvent { + f.fissionUserEventDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserEvent) replaceDB(db *gorm.DB) fissionUserEvent { + f.fissionUserEventDo.ReplaceDB(db) + return f +} + +type fissionUserEventDo struct{ gen.DO } + +func (f fissionUserEventDo) Debug() *fissionUserEventDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserEventDo) WithContext(ctx context.Context) *fissionUserEventDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserEventDo) ReadDB() *fissionUserEventDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserEventDo) WriteDB() *fissionUserEventDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserEventDo) Session(config *gorm.Session) *fissionUserEventDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserEventDo) Clauses(conds ...clause.Expression) *fissionUserEventDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserEventDo) Returning(value interface{}, columns ...string) *fissionUserEventDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserEventDo) Not(conds ...gen.Condition) *fissionUserEventDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserEventDo) Or(conds ...gen.Condition) *fissionUserEventDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserEventDo) Select(conds ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserEventDo) Where(conds ...gen.Condition) *fissionUserEventDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserEventDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserEventDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserEventDo) Order(conds ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserEventDo) Distinct(cols ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserEventDo) Omit(cols ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserEventDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserEventDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserEventDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserEventDo) Group(cols ...field.Expr) *fissionUserEventDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserEventDo) Having(conds ...gen.Condition) *fissionUserEventDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserEventDo) Limit(limit int) *fissionUserEventDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserEventDo) Offset(offset int) *fissionUserEventDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserEventDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserEventDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserEventDo) Unscoped() *fissionUserEventDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserEventDo) Create(values ...*model.FissionUserEvent) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserEventDo) CreateInBatches(values []*model.FissionUserEvent, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserEventDo) Save(values ...*model.FissionUserEvent) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserEventDo) First() (*model.FissionUserEvent, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserEvent), nil + } +} + +func (f fissionUserEventDo) Take() (*model.FissionUserEvent, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserEvent), nil + } +} + +func (f fissionUserEventDo) Last() (*model.FissionUserEvent, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserEvent), nil + } +} + +func (f fissionUserEventDo) Find() ([]*model.FissionUserEvent, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserEvent), err +} + +func (f fissionUserEventDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserEvent, err error) { + buf := make([]*model.FissionUserEvent, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserEventDo) FindInBatches(result *[]*model.FissionUserEvent, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserEventDo) Attrs(attrs ...field.AssignExpr) *fissionUserEventDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserEventDo) Assign(attrs ...field.AssignExpr) *fissionUserEventDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserEventDo) Joins(fields ...field.RelationField) *fissionUserEventDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserEventDo) Preload(fields ...field.RelationField) *fissionUserEventDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserEventDo) FirstOrInit() (*model.FissionUserEvent, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserEvent), nil + } +} + +func (f fissionUserEventDo) FirstOrCreate() (*model.FissionUserEvent, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserEvent), nil + } +} + +func (f fissionUserEventDo) FindByPage(offset int, limit int) (result []*model.FissionUserEvent, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserEventDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserEventDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserEventDo) Delete(models ...*model.FissionUserEvent) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserEventDo) withDO(do gen.Dao) *fissionUserEventDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_jattr.gen.go b/internal/repository/dao/fission_user_jattr.gen.go new file mode 100644 index 0000000..606b292 --- /dev/null +++ b/internal/repository/dao/fission_user_jattr.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserJattr(db *gorm.DB, opts ...gen.DOOption) fissionUserJattr { + _fissionUserJattr := fissionUserJattr{} + + _fissionUserJattr.fissionUserJattrDo.UseDB(db, opts...) + _fissionUserJattr.fissionUserJattrDo.UseModel(&model.FissionUserJattr{}) + + tableName := _fissionUserJattr.fissionUserJattrDo.TableName() + _fissionUserJattr.ALL = field.NewAsterisk(tableName) + _fissionUserJattr.ID = field.NewInt64(tableName, "id") + _fissionUserJattr.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserJattr.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserJattr.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserJattr.UserID = field.NewInt64(tableName, "user_id") + _fissionUserJattr.Attr = field.NewString(tableName, "attr") + _fissionUserJattr.Value = field.NewString(tableName, "value") + _fissionUserJattr.Values = field.NewString(tableName, "values") + + _fissionUserJattr.fillFieldMap() + + return _fissionUserJattr +} + +type fissionUserJattr struct { + fissionUserJattrDo fissionUserJattrDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(campaign表主键) + UserID field.Int64 // 用户ID(fission_user表) + Attr field.String // 属性标识 + Value field.String // 属性值 + Values field.String // 多属性值 + + fieldMap map[string]field.Expr +} + +func (f fissionUserJattr) Table(newTableName string) *fissionUserJattr { + f.fissionUserJattrDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserJattr) As(alias string) *fissionUserJattr { + f.fissionUserJattrDo.DO = *(f.fissionUserJattrDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserJattr) updateTableName(table string) *fissionUserJattr { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Attr = field.NewString(table, "attr") + f.Value = field.NewString(table, "value") + f.Values = field.NewString(table, "values") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserJattr) WithContext(ctx context.Context) *fissionUserJattrDo { + return f.fissionUserJattrDo.WithContext(ctx) +} + +func (f fissionUserJattr) TableName() string { return f.fissionUserJattrDo.TableName() } + +func (f fissionUserJattr) Alias() string { return f.fissionUserJattrDo.Alias() } + +func (f *fissionUserJattr) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserJattr) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["attr"] = f.Attr + f.fieldMap["value"] = f.Value + f.fieldMap["values"] = f.Values +} + +func (f fissionUserJattr) clone(db *gorm.DB) fissionUserJattr { + f.fissionUserJattrDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserJattr) replaceDB(db *gorm.DB) fissionUserJattr { + f.fissionUserJattrDo.ReplaceDB(db) + return f +} + +type fissionUserJattrDo struct{ gen.DO } + +func (f fissionUserJattrDo) Debug() *fissionUserJattrDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserJattrDo) WithContext(ctx context.Context) *fissionUserJattrDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserJattrDo) ReadDB() *fissionUserJattrDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserJattrDo) WriteDB() *fissionUserJattrDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserJattrDo) Session(config *gorm.Session) *fissionUserJattrDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserJattrDo) Clauses(conds ...clause.Expression) *fissionUserJattrDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserJattrDo) Returning(value interface{}, columns ...string) *fissionUserJattrDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserJattrDo) Not(conds ...gen.Condition) *fissionUserJattrDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserJattrDo) Or(conds ...gen.Condition) *fissionUserJattrDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserJattrDo) Select(conds ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserJattrDo) Where(conds ...gen.Condition) *fissionUserJattrDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserJattrDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserJattrDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserJattrDo) Order(conds ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserJattrDo) Distinct(cols ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserJattrDo) Omit(cols ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserJattrDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserJattrDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserJattrDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserJattrDo) Group(cols ...field.Expr) *fissionUserJattrDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserJattrDo) Having(conds ...gen.Condition) *fissionUserJattrDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserJattrDo) Limit(limit int) *fissionUserJattrDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserJattrDo) Offset(offset int) *fissionUserJattrDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserJattrDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserJattrDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserJattrDo) Unscoped() *fissionUserJattrDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserJattrDo) Create(values ...*model.FissionUserJattr) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserJattrDo) CreateInBatches(values []*model.FissionUserJattr, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserJattrDo) Save(values ...*model.FissionUserJattr) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserJattrDo) First() (*model.FissionUserJattr, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserJattr), nil + } +} + +func (f fissionUserJattrDo) Take() (*model.FissionUserJattr, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserJattr), nil + } +} + +func (f fissionUserJattrDo) Last() (*model.FissionUserJattr, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserJattr), nil + } +} + +func (f fissionUserJattrDo) Find() ([]*model.FissionUserJattr, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserJattr), err +} + +func (f fissionUserJattrDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserJattr, err error) { + buf := make([]*model.FissionUserJattr, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserJattrDo) FindInBatches(result *[]*model.FissionUserJattr, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserJattrDo) Attrs(attrs ...field.AssignExpr) *fissionUserJattrDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserJattrDo) Assign(attrs ...field.AssignExpr) *fissionUserJattrDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserJattrDo) Joins(fields ...field.RelationField) *fissionUserJattrDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserJattrDo) Preload(fields ...field.RelationField) *fissionUserJattrDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserJattrDo) FirstOrInit() (*model.FissionUserJattr, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserJattr), nil + } +} + +func (f fissionUserJattrDo) FirstOrCreate() (*model.FissionUserJattr, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserJattr), nil + } +} + +func (f fissionUserJattrDo) FindByPage(offset int, limit int) (result []*model.FissionUserJattr, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserJattrDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserJattrDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserJattrDo) Delete(models ...*model.FissionUserJattr) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserJattrDo) withDO(do gen.Dao) *fissionUserJattrDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_level.gen.go b/internal/repository/dao/fission_user_level.gen.go new file mode 100644 index 0000000..4b93f83 --- /dev/null +++ b/internal/repository/dao/fission_user_level.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserLevel(db *gorm.DB, opts ...gen.DOOption) fissionUserLevel { + _fissionUserLevel := fissionUserLevel{} + + _fissionUserLevel.fissionUserLevelDo.UseDB(db, opts...) + _fissionUserLevel.fissionUserLevelDo.UseModel(&model.FissionUserLevel{}) + + tableName := _fissionUserLevel.fissionUserLevelDo.TableName() + _fissionUserLevel.ALL = field.NewAsterisk(tableName) + _fissionUserLevel.ID = field.NewInt64(tableName, "id") + _fissionUserLevel.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserLevel.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserLevel.DeletedAt = field.NewInt64(tableName, "deleted_at") + _fissionUserLevel.ProjectID = field.NewInt64(tableName, "project_id") + _fissionUserLevel.Mark = field.NewString(tableName, "mark") + _fissionUserLevel.Title = field.NewString(tableName, "title") + + _fissionUserLevel.fillFieldMap() + + return _fissionUserLevel +} + +type fissionUserLevel struct { + fissionUserLevelDo fissionUserLevelDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + DeletedAt field.Int64 + ProjectID field.Int64 // 项目id + Mark field.String // 用户等级标识 + Title field.String // 用户等级 + + fieldMap map[string]field.Expr +} + +func (f fissionUserLevel) Table(newTableName string) *fissionUserLevel { + f.fissionUserLevelDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserLevel) As(alias string) *fissionUserLevel { + f.fissionUserLevelDo.DO = *(f.fissionUserLevelDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserLevel) updateTableName(table string) *fissionUserLevel { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.DeletedAt = field.NewInt64(table, "deleted_at") + f.ProjectID = field.NewInt64(table, "project_id") + f.Mark = field.NewString(table, "mark") + f.Title = field.NewString(table, "title") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserLevel) WithContext(ctx context.Context) *fissionUserLevelDo { + return f.fissionUserLevelDo.WithContext(ctx) +} + +func (f fissionUserLevel) TableName() string { return f.fissionUserLevelDo.TableName() } + +func (f fissionUserLevel) Alias() string { return f.fissionUserLevelDo.Alias() } + +func (f *fissionUserLevel) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserLevel) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["deleted_at"] = f.DeletedAt + f.fieldMap["project_id"] = f.ProjectID + f.fieldMap["mark"] = f.Mark + f.fieldMap["title"] = f.Title +} + +func (f fissionUserLevel) clone(db *gorm.DB) fissionUserLevel { + f.fissionUserLevelDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserLevel) replaceDB(db *gorm.DB) fissionUserLevel { + f.fissionUserLevelDo.ReplaceDB(db) + return f +} + +type fissionUserLevelDo struct{ gen.DO } + +func (f fissionUserLevelDo) Debug() *fissionUserLevelDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserLevelDo) WithContext(ctx context.Context) *fissionUserLevelDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserLevelDo) ReadDB() *fissionUserLevelDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserLevelDo) WriteDB() *fissionUserLevelDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserLevelDo) Session(config *gorm.Session) *fissionUserLevelDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserLevelDo) Clauses(conds ...clause.Expression) *fissionUserLevelDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserLevelDo) Returning(value interface{}, columns ...string) *fissionUserLevelDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserLevelDo) Not(conds ...gen.Condition) *fissionUserLevelDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserLevelDo) Or(conds ...gen.Condition) *fissionUserLevelDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserLevelDo) Select(conds ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserLevelDo) Where(conds ...gen.Condition) *fissionUserLevelDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserLevelDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserLevelDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserLevelDo) Order(conds ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserLevelDo) Distinct(cols ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserLevelDo) Omit(cols ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserLevelDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserLevelDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserLevelDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserLevelDo) Group(cols ...field.Expr) *fissionUserLevelDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserLevelDo) Having(conds ...gen.Condition) *fissionUserLevelDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserLevelDo) Limit(limit int) *fissionUserLevelDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserLevelDo) Offset(offset int) *fissionUserLevelDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserLevelDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserLevelDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserLevelDo) Unscoped() *fissionUserLevelDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserLevelDo) Create(values ...*model.FissionUserLevel) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserLevelDo) CreateInBatches(values []*model.FissionUserLevel, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserLevelDo) Save(values ...*model.FissionUserLevel) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserLevelDo) First() (*model.FissionUserLevel, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevel), nil + } +} + +func (f fissionUserLevelDo) Take() (*model.FissionUserLevel, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevel), nil + } +} + +func (f fissionUserLevelDo) Last() (*model.FissionUserLevel, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevel), nil + } +} + +func (f fissionUserLevelDo) Find() ([]*model.FissionUserLevel, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserLevel), err +} + +func (f fissionUserLevelDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserLevel, err error) { + buf := make([]*model.FissionUserLevel, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserLevelDo) FindInBatches(result *[]*model.FissionUserLevel, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserLevelDo) Attrs(attrs ...field.AssignExpr) *fissionUserLevelDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserLevelDo) Assign(attrs ...field.AssignExpr) *fissionUserLevelDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserLevelDo) Joins(fields ...field.RelationField) *fissionUserLevelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserLevelDo) Preload(fields ...field.RelationField) *fissionUserLevelDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserLevelDo) FirstOrInit() (*model.FissionUserLevel, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevel), nil + } +} + +func (f fissionUserLevelDo) FirstOrCreate() (*model.FissionUserLevel, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevel), nil + } +} + +func (f fissionUserLevelDo) FindByPage(offset int, limit int) (result []*model.FissionUserLevel, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserLevelDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserLevelDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserLevelDo) Delete(models ...*model.FissionUserLevel) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserLevelDo) withDO(do gen.Dao) *fissionUserLevelDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_level_related.gen.go b/internal/repository/dao/fission_user_level_related.gen.go new file mode 100644 index 0000000..5b2f252 --- /dev/null +++ b/internal/repository/dao/fission_user_level_related.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserLevelRelated(db *gorm.DB, opts ...gen.DOOption) fissionUserLevelRelated { + _fissionUserLevelRelated := fissionUserLevelRelated{} + + _fissionUserLevelRelated.fissionUserLevelRelatedDo.UseDB(db, opts...) + _fissionUserLevelRelated.fissionUserLevelRelatedDo.UseModel(&model.FissionUserLevelRelated{}) + + tableName := _fissionUserLevelRelated.fissionUserLevelRelatedDo.TableName() + _fissionUserLevelRelated.ALL = field.NewAsterisk(tableName) + _fissionUserLevelRelated.ID = field.NewInt64(tableName, "id") + _fissionUserLevelRelated.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserLevelRelated.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserLevelRelated.LevelID = field.NewInt64(tableName, "level_id") + _fissionUserLevelRelated.RelateID = field.NewInt64(tableName, "relate_id") + _fissionUserLevelRelated.RelateTable = field.NewString(tableName, "relate_table") + _fissionUserLevelRelated.CancelTime = field.NewInt64(tableName, "cancel_time") + + _fissionUserLevelRelated.fillFieldMap() + + return _fissionUserLevelRelated +} + +type fissionUserLevelRelated struct { + fissionUserLevelRelatedDo fissionUserLevelRelatedDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + LevelID field.Int64 // 用户等级id(fission_user_level表) + RelateID field.Int64 // 关联id + RelateTable field.String // 关联表名 + CancelTime field.Int64 // 取消关联时间 + + fieldMap map[string]field.Expr +} + +func (f fissionUserLevelRelated) Table(newTableName string) *fissionUserLevelRelated { + f.fissionUserLevelRelatedDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserLevelRelated) As(alias string) *fissionUserLevelRelated { + f.fissionUserLevelRelatedDo.DO = *(f.fissionUserLevelRelatedDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserLevelRelated) updateTableName(table string) *fissionUserLevelRelated { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.LevelID = field.NewInt64(table, "level_id") + f.RelateID = field.NewInt64(table, "relate_id") + f.RelateTable = field.NewString(table, "relate_table") + f.CancelTime = field.NewInt64(table, "cancel_time") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserLevelRelated) WithContext(ctx context.Context) *fissionUserLevelRelatedDo { + return f.fissionUserLevelRelatedDo.WithContext(ctx) +} + +func (f fissionUserLevelRelated) TableName() string { return f.fissionUserLevelRelatedDo.TableName() } + +func (f fissionUserLevelRelated) Alias() string { return f.fissionUserLevelRelatedDo.Alias() } + +func (f *fissionUserLevelRelated) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserLevelRelated) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["level_id"] = f.LevelID + f.fieldMap["relate_id"] = f.RelateID + f.fieldMap["relate_table"] = f.RelateTable + f.fieldMap["cancel_time"] = f.CancelTime +} + +func (f fissionUserLevelRelated) clone(db *gorm.DB) fissionUserLevelRelated { + f.fissionUserLevelRelatedDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserLevelRelated) replaceDB(db *gorm.DB) fissionUserLevelRelated { + f.fissionUserLevelRelatedDo.ReplaceDB(db) + return f +} + +type fissionUserLevelRelatedDo struct{ gen.DO } + +func (f fissionUserLevelRelatedDo) Debug() *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserLevelRelatedDo) WithContext(ctx context.Context) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserLevelRelatedDo) ReadDB() *fissionUserLevelRelatedDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserLevelRelatedDo) WriteDB() *fissionUserLevelRelatedDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserLevelRelatedDo) Session(config *gorm.Session) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserLevelRelatedDo) Clauses(conds ...clause.Expression) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserLevelRelatedDo) Returning(value interface{}, columns ...string) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserLevelRelatedDo) Not(conds ...gen.Condition) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserLevelRelatedDo) Or(conds ...gen.Condition) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserLevelRelatedDo) Select(conds ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserLevelRelatedDo) Where(conds ...gen.Condition) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserLevelRelatedDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserLevelRelatedDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserLevelRelatedDo) Order(conds ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserLevelRelatedDo) Distinct(cols ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserLevelRelatedDo) Omit(cols ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserLevelRelatedDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserLevelRelatedDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserLevelRelatedDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserLevelRelatedDo) Group(cols ...field.Expr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserLevelRelatedDo) Having(conds ...gen.Condition) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserLevelRelatedDo) Limit(limit int) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserLevelRelatedDo) Offset(offset int) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserLevelRelatedDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserLevelRelatedDo) Unscoped() *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserLevelRelatedDo) Create(values ...*model.FissionUserLevelRelated) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserLevelRelatedDo) CreateInBatches(values []*model.FissionUserLevelRelated, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserLevelRelatedDo) Save(values ...*model.FissionUserLevelRelated) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserLevelRelatedDo) First() (*model.FissionUserLevelRelated, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevelRelated), nil + } +} + +func (f fissionUserLevelRelatedDo) Take() (*model.FissionUserLevelRelated, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevelRelated), nil + } +} + +func (f fissionUserLevelRelatedDo) Last() (*model.FissionUserLevelRelated, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevelRelated), nil + } +} + +func (f fissionUserLevelRelatedDo) Find() ([]*model.FissionUserLevelRelated, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserLevelRelated), err +} + +func (f fissionUserLevelRelatedDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserLevelRelated, err error) { + buf := make([]*model.FissionUserLevelRelated, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserLevelRelatedDo) FindInBatches(result *[]*model.FissionUserLevelRelated, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserLevelRelatedDo) Attrs(attrs ...field.AssignExpr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserLevelRelatedDo) Assign(attrs ...field.AssignExpr) *fissionUserLevelRelatedDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserLevelRelatedDo) Joins(fields ...field.RelationField) *fissionUserLevelRelatedDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserLevelRelatedDo) Preload(fields ...field.RelationField) *fissionUserLevelRelatedDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserLevelRelatedDo) FirstOrInit() (*model.FissionUserLevelRelated, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevelRelated), nil + } +} + +func (f fissionUserLevelRelatedDo) FirstOrCreate() (*model.FissionUserLevelRelated, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserLevelRelated), nil + } +} + +func (f fissionUserLevelRelatedDo) FindByPage(offset int, limit int) (result []*model.FissionUserLevelRelated, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserLevelRelatedDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserLevelRelatedDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserLevelRelatedDo) Delete(models ...*model.FissionUserLevelRelated) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserLevelRelatedDo) withDO(do gen.Dao) *fissionUserLevelRelatedDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_pre_cond.gen.go b/internal/repository/dao/fission_user_pre_cond.gen.go new file mode 100644 index 0000000..6fb1d06 --- /dev/null +++ b/internal/repository/dao/fission_user_pre_cond.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserPreCond(db *gorm.DB, opts ...gen.DOOption) fissionUserPreCond { + _fissionUserPreCond := fissionUserPreCond{} + + _fissionUserPreCond.fissionUserPreCondDo.UseDB(db, opts...) + _fissionUserPreCond.fissionUserPreCondDo.UseModel(&model.FissionUserPreCond{}) + + tableName := _fissionUserPreCond.fissionUserPreCondDo.TableName() + _fissionUserPreCond.ALL = field.NewAsterisk(tableName) + _fissionUserPreCond.ID = field.NewInt64(tableName, "id") + _fissionUserPreCond.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserPreCond.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserPreCond.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserPreCond.UserID = field.NewInt64(tableName, "user_id") + _fissionUserPreCond.PreCond = field.NewInt32(tableName, "pre_cond") + _fissionUserPreCond.ExpiredAt = field.NewInt64(tableName, "expired_at") + + _fissionUserPreCond.fillFieldMap() + + return _fissionUserPreCond +} + +type fissionUserPreCond struct { + fissionUserPreCondDo fissionUserPreCondDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(fission_campaign表) + UserID field.Int64 // 用户id + PreCond field.Int32 // 完成的前置任务 + ExpiredAt field.Int64 // 前置任务过期时间 + + fieldMap map[string]field.Expr +} + +func (f fissionUserPreCond) Table(newTableName string) *fissionUserPreCond { + f.fissionUserPreCondDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserPreCond) As(alias string) *fissionUserPreCond { + f.fissionUserPreCondDo.DO = *(f.fissionUserPreCondDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserPreCond) updateTableName(table string) *fissionUserPreCond { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.PreCond = field.NewInt32(table, "pre_cond") + f.ExpiredAt = field.NewInt64(table, "expired_at") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserPreCond) WithContext(ctx context.Context) *fissionUserPreCondDo { + return f.fissionUserPreCondDo.WithContext(ctx) +} + +func (f fissionUserPreCond) TableName() string { return f.fissionUserPreCondDo.TableName() } + +func (f fissionUserPreCond) Alias() string { return f.fissionUserPreCondDo.Alias() } + +func (f *fissionUserPreCond) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserPreCond) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["pre_cond"] = f.PreCond + f.fieldMap["expired_at"] = f.ExpiredAt +} + +func (f fissionUserPreCond) clone(db *gorm.DB) fissionUserPreCond { + f.fissionUserPreCondDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserPreCond) replaceDB(db *gorm.DB) fissionUserPreCond { + f.fissionUserPreCondDo.ReplaceDB(db) + return f +} + +type fissionUserPreCondDo struct{ gen.DO } + +func (f fissionUserPreCondDo) Debug() *fissionUserPreCondDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserPreCondDo) WithContext(ctx context.Context) *fissionUserPreCondDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserPreCondDo) ReadDB() *fissionUserPreCondDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserPreCondDo) WriteDB() *fissionUserPreCondDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserPreCondDo) Session(config *gorm.Session) *fissionUserPreCondDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserPreCondDo) Clauses(conds ...clause.Expression) *fissionUserPreCondDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserPreCondDo) Returning(value interface{}, columns ...string) *fissionUserPreCondDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserPreCondDo) Not(conds ...gen.Condition) *fissionUserPreCondDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserPreCondDo) Or(conds ...gen.Condition) *fissionUserPreCondDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserPreCondDo) Select(conds ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserPreCondDo) Where(conds ...gen.Condition) *fissionUserPreCondDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserPreCondDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserPreCondDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserPreCondDo) Order(conds ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserPreCondDo) Distinct(cols ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserPreCondDo) Omit(cols ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserPreCondDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserPreCondDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserPreCondDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserPreCondDo) Group(cols ...field.Expr) *fissionUserPreCondDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserPreCondDo) Having(conds ...gen.Condition) *fissionUserPreCondDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserPreCondDo) Limit(limit int) *fissionUserPreCondDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserPreCondDo) Offset(offset int) *fissionUserPreCondDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserPreCondDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserPreCondDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserPreCondDo) Unscoped() *fissionUserPreCondDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserPreCondDo) Create(values ...*model.FissionUserPreCond) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserPreCondDo) CreateInBatches(values []*model.FissionUserPreCond, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserPreCondDo) Save(values ...*model.FissionUserPreCond) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserPreCondDo) First() (*model.FissionUserPreCond, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserPreCond), nil + } +} + +func (f fissionUserPreCondDo) Take() (*model.FissionUserPreCond, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserPreCond), nil + } +} + +func (f fissionUserPreCondDo) Last() (*model.FissionUserPreCond, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserPreCond), nil + } +} + +func (f fissionUserPreCondDo) Find() ([]*model.FissionUserPreCond, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserPreCond), err +} + +func (f fissionUserPreCondDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserPreCond, err error) { + buf := make([]*model.FissionUserPreCond, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserPreCondDo) FindInBatches(result *[]*model.FissionUserPreCond, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserPreCondDo) Attrs(attrs ...field.AssignExpr) *fissionUserPreCondDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserPreCondDo) Assign(attrs ...field.AssignExpr) *fissionUserPreCondDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserPreCondDo) Joins(fields ...field.RelationField) *fissionUserPreCondDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserPreCondDo) Preload(fields ...field.RelationField) *fissionUserPreCondDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserPreCondDo) FirstOrInit() (*model.FissionUserPreCond, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserPreCond), nil + } +} + +func (f fissionUserPreCondDo) FirstOrCreate() (*model.FissionUserPreCond, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserPreCond), nil + } +} + +func (f fissionUserPreCondDo) FindByPage(offset int, limit int) (result []*model.FissionUserPreCond, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserPreCondDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserPreCondDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserPreCondDo) Delete(models ...*model.FissionUserPreCond) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserPreCondDo) withDO(do gen.Dao) *fissionUserPreCondDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_stat.gen.go b/internal/repository/dao/fission_user_stat.gen.go new file mode 100644 index 0000000..4e34f63 --- /dev/null +++ b/internal/repository/dao/fission_user_stat.gen.go @@ -0,0 +1,395 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserStat(db *gorm.DB, opts ...gen.DOOption) fissionUserStat { + _fissionUserStat := fissionUserStat{} + + _fissionUserStat.fissionUserStatDo.UseDB(db, opts...) + _fissionUserStat.fissionUserStatDo.UseModel(&model.FissionUserStat{}) + + tableName := _fissionUserStat.fissionUserStatDo.TableName() + _fissionUserStat.ALL = field.NewAsterisk(tableName) + _fissionUserStat.ID = field.NewInt64(tableName, "id") + _fissionUserStat.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserStat.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserStat.IsDel = field.NewUint8(tableName, "is_del") + _fissionUserStat.UserID = field.NewInt64(tableName, "user_id") + _fissionUserStat.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserStat.DirectNum = field.NewInt64(tableName, "direct_num") + _fissionUserStat.IndirectNum = field.NewInt64(tableName, "indirect_num") + _fissionUserStat.EffectiveNum = field.NewInt64(tableName, "effective_num") + _fissionUserStat.IndirectEffectiveNum = field.NewInt64(tableName, "indirect_effective_num") + _fissionUserStat.TargetNum = field.NewInt64(tableName, "target_num") + _fissionUserStat.IndirectTargetNum = field.NewInt64(tableName, "indirect_target_num") + _fissionUserStat.SignNum = field.NewInt64(tableName, "sign_num") + _fissionUserStat.SignRewardNum = field.NewInt64(tableName, "sign_reward_num") + _fissionUserStat.GrowNum = field.NewInt64(tableName, "grow_num") + _fissionUserStat.GrowRewardNum = field.NewInt64(tableName, "grow_reward_num") + _fissionUserStat.HelpNum = field.NewInt64(tableName, "help_num") + + _fissionUserStat.fillFieldMap() + + return _fissionUserStat +} + +type fissionUserStat struct { + fissionUserStatDo fissionUserStatDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Uint8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + DirectNum field.Int64 // 直接裂变人数 + IndirectNum field.Int64 // 间接裂变人数 + EffectiveNum field.Int64 // 有效邀请人数 + IndirectEffectiveNum field.Int64 // 间接有效邀请人数 + TargetNum field.Int64 // 达标次数 + IndirectTargetNum field.Int64 // 间接达标次数 + SignNum field.Int64 // 签到次数 + SignRewardNum field.Int64 // 领奖签到奖次数 + GrowNum field.Int64 // 领养次数 + GrowRewardNum field.Int64 // 养成次数 + HelpNum field.Int64 // 助力次数 + + fieldMap map[string]field.Expr +} + +func (f fissionUserStat) Table(newTableName string) *fissionUserStat { + f.fissionUserStatDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserStat) As(alias string) *fissionUserStat { + f.fissionUserStatDo.DO = *(f.fissionUserStatDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserStat) updateTableName(table string) *fissionUserStat { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewUint8(table, "is_del") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.DirectNum = field.NewInt64(table, "direct_num") + f.IndirectNum = field.NewInt64(table, "indirect_num") + f.EffectiveNum = field.NewInt64(table, "effective_num") + f.IndirectEffectiveNum = field.NewInt64(table, "indirect_effective_num") + f.TargetNum = field.NewInt64(table, "target_num") + f.IndirectTargetNum = field.NewInt64(table, "indirect_target_num") + f.SignNum = field.NewInt64(table, "sign_num") + f.SignRewardNum = field.NewInt64(table, "sign_reward_num") + f.GrowNum = field.NewInt64(table, "grow_num") + f.GrowRewardNum = field.NewInt64(table, "grow_reward_num") + f.HelpNum = field.NewInt64(table, "help_num") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserStat) WithContext(ctx context.Context) *fissionUserStatDo { + return f.fissionUserStatDo.WithContext(ctx) +} + +func (f fissionUserStat) TableName() string { return f.fissionUserStatDo.TableName() } + +func (f fissionUserStat) Alias() string { return f.fissionUserStatDo.Alias() } + +func (f *fissionUserStat) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserStat) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 17) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["direct_num"] = f.DirectNum + f.fieldMap["indirect_num"] = f.IndirectNum + f.fieldMap["effective_num"] = f.EffectiveNum + f.fieldMap["indirect_effective_num"] = f.IndirectEffectiveNum + f.fieldMap["target_num"] = f.TargetNum + f.fieldMap["indirect_target_num"] = f.IndirectTargetNum + f.fieldMap["sign_num"] = f.SignNum + f.fieldMap["sign_reward_num"] = f.SignRewardNum + f.fieldMap["grow_num"] = f.GrowNum + f.fieldMap["grow_reward_num"] = f.GrowRewardNum + f.fieldMap["help_num"] = f.HelpNum +} + +func (f fissionUserStat) clone(db *gorm.DB) fissionUserStat { + f.fissionUserStatDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserStat) replaceDB(db *gorm.DB) fissionUserStat { + f.fissionUserStatDo.ReplaceDB(db) + return f +} + +type fissionUserStatDo struct{ gen.DO } + +func (f fissionUserStatDo) Debug() *fissionUserStatDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserStatDo) WithContext(ctx context.Context) *fissionUserStatDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserStatDo) ReadDB() *fissionUserStatDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserStatDo) WriteDB() *fissionUserStatDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserStatDo) Session(config *gorm.Session) *fissionUserStatDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserStatDo) Clauses(conds ...clause.Expression) *fissionUserStatDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserStatDo) Returning(value interface{}, columns ...string) *fissionUserStatDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserStatDo) Not(conds ...gen.Condition) *fissionUserStatDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserStatDo) Or(conds ...gen.Condition) *fissionUserStatDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserStatDo) Select(conds ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserStatDo) Where(conds ...gen.Condition) *fissionUserStatDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserStatDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserStatDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserStatDo) Order(conds ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserStatDo) Distinct(cols ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserStatDo) Omit(cols ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserStatDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserStatDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserStatDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserStatDo) Group(cols ...field.Expr) *fissionUserStatDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserStatDo) Having(conds ...gen.Condition) *fissionUserStatDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserStatDo) Limit(limit int) *fissionUserStatDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserStatDo) Offset(offset int) *fissionUserStatDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserStatDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserStatDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserStatDo) Unscoped() *fissionUserStatDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserStatDo) Create(values ...*model.FissionUserStat) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserStatDo) CreateInBatches(values []*model.FissionUserStat, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserStatDo) Save(values ...*model.FissionUserStat) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserStatDo) First() (*model.FissionUserStat, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserStat), nil + } +} + +func (f fissionUserStatDo) Take() (*model.FissionUserStat, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserStat), nil + } +} + +func (f fissionUserStatDo) Last() (*model.FissionUserStat, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserStat), nil + } +} + +func (f fissionUserStatDo) Find() ([]*model.FissionUserStat, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserStat), err +} + +func (f fissionUserStatDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserStat, err error) { + buf := make([]*model.FissionUserStat, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserStatDo) FindInBatches(result *[]*model.FissionUserStat, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserStatDo) Attrs(attrs ...field.AssignExpr) *fissionUserStatDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserStatDo) Assign(attrs ...field.AssignExpr) *fissionUserStatDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserStatDo) Joins(fields ...field.RelationField) *fissionUserStatDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserStatDo) Preload(fields ...field.RelationField) *fissionUserStatDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserStatDo) FirstOrInit() (*model.FissionUserStat, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserStat), nil + } +} + +func (f fissionUserStatDo) FirstOrCreate() (*model.FissionUserStat, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserStat), nil + } +} + +func (f fissionUserStatDo) FindByPage(offset int, limit int) (result []*model.FissionUserStat, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserStatDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserStatDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserStatDo) Delete(models ...*model.FissionUserStat) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserStatDo) withDO(do gen.Dao) *fissionUserStatDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_task_record.gen.go b/internal/repository/dao/fission_user_task_record.gen.go new file mode 100644 index 0000000..aac1fde --- /dev/null +++ b/internal/repository/dao/fission_user_task_record.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserTaskRecord(db *gorm.DB, opts ...gen.DOOption) fissionUserTaskRecord { + _fissionUserTaskRecord := fissionUserTaskRecord{} + + _fissionUserTaskRecord.fissionUserTaskRecordDo.UseDB(db, opts...) + _fissionUserTaskRecord.fissionUserTaskRecordDo.UseModel(&model.FissionUserTaskRecord{}) + + tableName := _fissionUserTaskRecord.fissionUserTaskRecordDo.TableName() + _fissionUserTaskRecord.ALL = field.NewAsterisk(tableName) + _fissionUserTaskRecord.ID = field.NewInt64(tableName, "id") + _fissionUserTaskRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserTaskRecord.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserTaskRecord.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserTaskRecord.UserID = field.NewInt64(tableName, "user_id") + _fissionUserTaskRecord.TaskID = field.NewInt64(tableName, "task_id") + _fissionUserTaskRecord.IndicatorData = field.NewString(tableName, "indicator_data") + _fissionUserTaskRecord.Chance = field.NewInt32(tableName, "chance") + _fissionUserTaskRecord.LimitProp = field.NewInt8(tableName, "limit_prop") + + _fissionUserTaskRecord.fillFieldMap() + + return _fissionUserTaskRecord +} + +type fissionUserTaskRecord struct { + fissionUserTaskRecordDo fissionUserTaskRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + TaskID field.Int64 // 任务表(fission_campaign_task表) + IndicatorData field.String // 完成任务的指标数据,如:下载数 + Chance field.Int32 // 发放的骰子数 + LimitProp field.Int8 // 是否因为限制而不发道具(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (f fissionUserTaskRecord) Table(newTableName string) *fissionUserTaskRecord { + f.fissionUserTaskRecordDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserTaskRecord) As(alias string) *fissionUserTaskRecord { + f.fissionUserTaskRecordDo.DO = *(f.fissionUserTaskRecordDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserTaskRecord) updateTableName(table string) *fissionUserTaskRecord { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.TaskID = field.NewInt64(table, "task_id") + f.IndicatorData = field.NewString(table, "indicator_data") + f.Chance = field.NewInt32(table, "chance") + f.LimitProp = field.NewInt8(table, "limit_prop") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserTaskRecord) WithContext(ctx context.Context) *fissionUserTaskRecordDo { + return f.fissionUserTaskRecordDo.WithContext(ctx) +} + +func (f fissionUserTaskRecord) TableName() string { return f.fissionUserTaskRecordDo.TableName() } + +func (f fissionUserTaskRecord) Alias() string { return f.fissionUserTaskRecordDo.Alias() } + +func (f *fissionUserTaskRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserTaskRecord) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 9) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["task_id"] = f.TaskID + f.fieldMap["indicator_data"] = f.IndicatorData + f.fieldMap["chance"] = f.Chance + f.fieldMap["limit_prop"] = f.LimitProp +} + +func (f fissionUserTaskRecord) clone(db *gorm.DB) fissionUserTaskRecord { + f.fissionUserTaskRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserTaskRecord) replaceDB(db *gorm.DB) fissionUserTaskRecord { + f.fissionUserTaskRecordDo.ReplaceDB(db) + return f +} + +type fissionUserTaskRecordDo struct{ gen.DO } + +func (f fissionUserTaskRecordDo) Debug() *fissionUserTaskRecordDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserTaskRecordDo) WithContext(ctx context.Context) *fissionUserTaskRecordDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserTaskRecordDo) ReadDB() *fissionUserTaskRecordDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserTaskRecordDo) WriteDB() *fissionUserTaskRecordDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserTaskRecordDo) Session(config *gorm.Session) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserTaskRecordDo) Clauses(conds ...clause.Expression) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserTaskRecordDo) Returning(value interface{}, columns ...string) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserTaskRecordDo) Not(conds ...gen.Condition) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserTaskRecordDo) Or(conds ...gen.Condition) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserTaskRecordDo) Select(conds ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserTaskRecordDo) Where(conds ...gen.Condition) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserTaskRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserTaskRecordDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserTaskRecordDo) Order(conds ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserTaskRecordDo) Distinct(cols ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserTaskRecordDo) Omit(cols ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserTaskRecordDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserTaskRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserTaskRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserTaskRecordDo) Group(cols ...field.Expr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserTaskRecordDo) Having(conds ...gen.Condition) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserTaskRecordDo) Limit(limit int) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserTaskRecordDo) Offset(offset int) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserTaskRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserTaskRecordDo) Unscoped() *fissionUserTaskRecordDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserTaskRecordDo) Create(values ...*model.FissionUserTaskRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserTaskRecordDo) CreateInBatches(values []*model.FissionUserTaskRecord, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserTaskRecordDo) Save(values ...*model.FissionUserTaskRecord) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserTaskRecordDo) First() (*model.FissionUserTaskRecord, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskRecord), nil + } +} + +func (f fissionUserTaskRecordDo) Take() (*model.FissionUserTaskRecord, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskRecord), nil + } +} + +func (f fissionUserTaskRecordDo) Last() (*model.FissionUserTaskRecord, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskRecord), nil + } +} + +func (f fissionUserTaskRecordDo) Find() ([]*model.FissionUserTaskRecord, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserTaskRecord), err +} + +func (f fissionUserTaskRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserTaskRecord, err error) { + buf := make([]*model.FissionUserTaskRecord, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserTaskRecordDo) FindInBatches(result *[]*model.FissionUserTaskRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserTaskRecordDo) Attrs(attrs ...field.AssignExpr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserTaskRecordDo) Assign(attrs ...field.AssignExpr) *fissionUserTaskRecordDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserTaskRecordDo) Joins(fields ...field.RelationField) *fissionUserTaskRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserTaskRecordDo) Preload(fields ...field.RelationField) *fissionUserTaskRecordDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserTaskRecordDo) FirstOrInit() (*model.FissionUserTaskRecord, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskRecord), nil + } +} + +func (f fissionUserTaskRecordDo) FirstOrCreate() (*model.FissionUserTaskRecord, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskRecord), nil + } +} + +func (f fissionUserTaskRecordDo) FindByPage(offset int, limit int) (result []*model.FissionUserTaskRecord, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserTaskRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserTaskRecordDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserTaskRecordDo) Delete(models ...*model.FissionUserTaskRecord) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserTaskRecordDo) withDO(do gen.Dao) *fissionUserTaskRecordDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_task_reward.gen.go b/internal/repository/dao/fission_user_task_reward.gen.go new file mode 100644 index 0000000..aee93f1 --- /dev/null +++ b/internal/repository/dao/fission_user_task_reward.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserTaskReward(db *gorm.DB, opts ...gen.DOOption) fissionUserTaskReward { + _fissionUserTaskReward := fissionUserTaskReward{} + + _fissionUserTaskReward.fissionUserTaskRewardDo.UseDB(db, opts...) + _fissionUserTaskReward.fissionUserTaskRewardDo.UseModel(&model.FissionUserTaskReward{}) + + tableName := _fissionUserTaskReward.fissionUserTaskRewardDo.TableName() + _fissionUserTaskReward.ALL = field.NewAsterisk(tableName) + _fissionUserTaskReward.ID = field.NewInt64(tableName, "id") + _fissionUserTaskReward.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserTaskReward.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionUserTaskReward.UserID = field.NewInt64(tableName, "user_id") + _fissionUserTaskReward.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserTaskReward.TaskID = field.NewInt64(tableName, "task_id") + _fissionUserTaskReward.ReceiveTime = field.NewInt64(tableName, "receive_time") + _fissionUserTaskReward.TaskRecordID = field.NewInt64(tableName, "task_record_id") + + _fissionUserTaskReward.fillFieldMap() + + return _fissionUserTaskReward +} + +type fissionUserTaskReward struct { + fissionUserTaskRewardDo fissionUserTaskRewardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + TaskID field.Int64 // 任务ID(fission_campaign_task表) + ReceiveTime field.Int64 // 领取时间 + TaskRecordID field.Int64 // 任务完成记录ID(fission_user_task_record表) + + fieldMap map[string]field.Expr +} + +func (f fissionUserTaskReward) Table(newTableName string) *fissionUserTaskReward { + f.fissionUserTaskRewardDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserTaskReward) As(alias string) *fissionUserTaskReward { + f.fissionUserTaskRewardDo.DO = *(f.fissionUserTaskRewardDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserTaskReward) updateTableName(table string) *fissionUserTaskReward { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.TaskID = field.NewInt64(table, "task_id") + f.ReceiveTime = field.NewInt64(table, "receive_time") + f.TaskRecordID = field.NewInt64(table, "task_record_id") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserTaskReward) WithContext(ctx context.Context) *fissionUserTaskRewardDo { + return f.fissionUserTaskRewardDo.WithContext(ctx) +} + +func (f fissionUserTaskReward) TableName() string { return f.fissionUserTaskRewardDo.TableName() } + +func (f fissionUserTaskReward) Alias() string { return f.fissionUserTaskRewardDo.Alias() } + +func (f *fissionUserTaskReward) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserTaskReward) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["task_id"] = f.TaskID + f.fieldMap["receive_time"] = f.ReceiveTime + f.fieldMap["task_record_id"] = f.TaskRecordID +} + +func (f fissionUserTaskReward) clone(db *gorm.DB) fissionUserTaskReward { + f.fissionUserTaskRewardDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserTaskReward) replaceDB(db *gorm.DB) fissionUserTaskReward { + f.fissionUserTaskRewardDo.ReplaceDB(db) + return f +} + +type fissionUserTaskRewardDo struct{ gen.DO } + +func (f fissionUserTaskRewardDo) Debug() *fissionUserTaskRewardDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserTaskRewardDo) WithContext(ctx context.Context) *fissionUserTaskRewardDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserTaskRewardDo) ReadDB() *fissionUserTaskRewardDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserTaskRewardDo) WriteDB() *fissionUserTaskRewardDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserTaskRewardDo) Session(config *gorm.Session) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserTaskRewardDo) Clauses(conds ...clause.Expression) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserTaskRewardDo) Returning(value interface{}, columns ...string) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserTaskRewardDo) Not(conds ...gen.Condition) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserTaskRewardDo) Or(conds ...gen.Condition) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserTaskRewardDo) Select(conds ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserTaskRewardDo) Where(conds ...gen.Condition) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserTaskRewardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserTaskRewardDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserTaskRewardDo) Order(conds ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserTaskRewardDo) Distinct(cols ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserTaskRewardDo) Omit(cols ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserTaskRewardDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserTaskRewardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserTaskRewardDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserTaskRewardDo) Group(cols ...field.Expr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserTaskRewardDo) Having(conds ...gen.Condition) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserTaskRewardDo) Limit(limit int) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserTaskRewardDo) Offset(offset int) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserTaskRewardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserTaskRewardDo) Unscoped() *fissionUserTaskRewardDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserTaskRewardDo) Create(values ...*model.FissionUserTaskReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserTaskRewardDo) CreateInBatches(values []*model.FissionUserTaskReward, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserTaskRewardDo) Save(values ...*model.FissionUserTaskReward) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserTaskRewardDo) First() (*model.FissionUserTaskReward, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskReward), nil + } +} + +func (f fissionUserTaskRewardDo) Take() (*model.FissionUserTaskReward, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskReward), nil + } +} + +func (f fissionUserTaskRewardDo) Last() (*model.FissionUserTaskReward, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskReward), nil + } +} + +func (f fissionUserTaskRewardDo) Find() ([]*model.FissionUserTaskReward, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserTaskReward), err +} + +func (f fissionUserTaskRewardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserTaskReward, err error) { + buf := make([]*model.FissionUserTaskReward, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserTaskRewardDo) FindInBatches(result *[]*model.FissionUserTaskReward, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserTaskRewardDo) Attrs(attrs ...field.AssignExpr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserTaskRewardDo) Assign(attrs ...field.AssignExpr) *fissionUserTaskRewardDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserTaskRewardDo) Joins(fields ...field.RelationField) *fissionUserTaskRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserTaskRewardDo) Preload(fields ...field.RelationField) *fissionUserTaskRewardDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserTaskRewardDo) FirstOrInit() (*model.FissionUserTaskReward, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskReward), nil + } +} + +func (f fissionUserTaskRewardDo) FirstOrCreate() (*model.FissionUserTaskReward, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskReward), nil + } +} + +func (f fissionUserTaskRewardDo) FindByPage(offset int, limit int) (result []*model.FissionUserTaskReward, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserTaskRewardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserTaskRewardDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserTaskRewardDo) Delete(models ...*model.FissionUserTaskReward) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserTaskRewardDo) withDO(do gen.Dao) *fissionUserTaskRewardDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_user_task_valid.gen.go b/internal/repository/dao/fission_user_task_valid.gen.go new file mode 100644 index 0000000..3a5d68e --- /dev/null +++ b/internal/repository/dao/fission_user_task_valid.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionUserTaskValid(db *gorm.DB, opts ...gen.DOOption) fissionUserTaskValid { + _fissionUserTaskValid := fissionUserTaskValid{} + + _fissionUserTaskValid.fissionUserTaskValidDo.UseDB(db, opts...) + _fissionUserTaskValid.fissionUserTaskValidDo.UseModel(&model.FissionUserTaskValid{}) + + tableName := _fissionUserTaskValid.fissionUserTaskValidDo.TableName() + _fissionUserTaskValid.ALL = field.NewAsterisk(tableName) + _fissionUserTaskValid.ID = field.NewInt64(tableName, "id") + _fissionUserTaskValid.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionUserTaskValid.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionUserTaskValid.UserID = field.NewInt64(tableName, "user_id") + _fissionUserTaskValid.TaskID = field.NewInt64(tableName, "task_id") + _fissionUserTaskValid.Ideq = field.NewString(tableName, "ideq") + _fissionUserTaskValid.IdeqParam = field.NewString(tableName, "ideq_param") + + _fissionUserTaskValid.fillFieldMap() + + return _fissionUserTaskValid +} + +type fissionUserTaskValid struct { + fissionUserTaskValidDo fissionUserTaskValidDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 活动用户id(fission_user表) + TaskID field.Int64 // 任务id + Ideq field.String // 幂等字符串 + IdeqParam field.String // 加密参数 + + fieldMap map[string]field.Expr +} + +func (f fissionUserTaskValid) Table(newTableName string) *fissionUserTaskValid { + f.fissionUserTaskValidDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionUserTaskValid) As(alias string) *fissionUserTaskValid { + f.fissionUserTaskValidDo.DO = *(f.fissionUserTaskValidDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionUserTaskValid) updateTableName(table string) *fissionUserTaskValid { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.TaskID = field.NewInt64(table, "task_id") + f.Ideq = field.NewString(table, "ideq") + f.IdeqParam = field.NewString(table, "ideq_param") + + f.fillFieldMap() + + return f +} + +func (f *fissionUserTaskValid) WithContext(ctx context.Context) *fissionUserTaskValidDo { + return f.fissionUserTaskValidDo.WithContext(ctx) +} + +func (f fissionUserTaskValid) TableName() string { return f.fissionUserTaskValidDo.TableName() } + +func (f fissionUserTaskValid) Alias() string { return f.fissionUserTaskValidDo.Alias() } + +func (f *fissionUserTaskValid) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionUserTaskValid) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["task_id"] = f.TaskID + f.fieldMap["ideq"] = f.Ideq + f.fieldMap["ideq_param"] = f.IdeqParam +} + +func (f fissionUserTaskValid) clone(db *gorm.DB) fissionUserTaskValid { + f.fissionUserTaskValidDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionUserTaskValid) replaceDB(db *gorm.DB) fissionUserTaskValid { + f.fissionUserTaskValidDo.ReplaceDB(db) + return f +} + +type fissionUserTaskValidDo struct{ gen.DO } + +func (f fissionUserTaskValidDo) Debug() *fissionUserTaskValidDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionUserTaskValidDo) WithContext(ctx context.Context) *fissionUserTaskValidDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionUserTaskValidDo) ReadDB() *fissionUserTaskValidDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionUserTaskValidDo) WriteDB() *fissionUserTaskValidDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionUserTaskValidDo) Session(config *gorm.Session) *fissionUserTaskValidDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionUserTaskValidDo) Clauses(conds ...clause.Expression) *fissionUserTaskValidDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionUserTaskValidDo) Returning(value interface{}, columns ...string) *fissionUserTaskValidDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionUserTaskValidDo) Not(conds ...gen.Condition) *fissionUserTaskValidDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionUserTaskValidDo) Or(conds ...gen.Condition) *fissionUserTaskValidDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionUserTaskValidDo) Select(conds ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionUserTaskValidDo) Where(conds ...gen.Condition) *fissionUserTaskValidDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionUserTaskValidDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionUserTaskValidDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionUserTaskValidDo) Order(conds ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionUserTaskValidDo) Distinct(cols ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionUserTaskValidDo) Omit(cols ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionUserTaskValidDo) Join(table schema.Tabler, on ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionUserTaskValidDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionUserTaskValidDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionUserTaskValidDo) Group(cols ...field.Expr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionUserTaskValidDo) Having(conds ...gen.Condition) *fissionUserTaskValidDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionUserTaskValidDo) Limit(limit int) *fissionUserTaskValidDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionUserTaskValidDo) Offset(offset int) *fissionUserTaskValidDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionUserTaskValidDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionUserTaskValidDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionUserTaskValidDo) Unscoped() *fissionUserTaskValidDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionUserTaskValidDo) Create(values ...*model.FissionUserTaskValid) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionUserTaskValidDo) CreateInBatches(values []*model.FissionUserTaskValid, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionUserTaskValidDo) Save(values ...*model.FissionUserTaskValid) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionUserTaskValidDo) First() (*model.FissionUserTaskValid, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskValid), nil + } +} + +func (f fissionUserTaskValidDo) Take() (*model.FissionUserTaskValid, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskValid), nil + } +} + +func (f fissionUserTaskValidDo) Last() (*model.FissionUserTaskValid, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskValid), nil + } +} + +func (f fissionUserTaskValidDo) Find() ([]*model.FissionUserTaskValid, error) { + result, err := f.DO.Find() + return result.([]*model.FissionUserTaskValid), err +} + +func (f fissionUserTaskValidDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionUserTaskValid, err error) { + buf := make([]*model.FissionUserTaskValid, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionUserTaskValidDo) FindInBatches(result *[]*model.FissionUserTaskValid, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionUserTaskValidDo) Attrs(attrs ...field.AssignExpr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionUserTaskValidDo) Assign(attrs ...field.AssignExpr) *fissionUserTaskValidDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionUserTaskValidDo) Joins(fields ...field.RelationField) *fissionUserTaskValidDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionUserTaskValidDo) Preload(fields ...field.RelationField) *fissionUserTaskValidDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionUserTaskValidDo) FirstOrInit() (*model.FissionUserTaskValid, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskValid), nil + } +} + +func (f fissionUserTaskValidDo) FirstOrCreate() (*model.FissionUserTaskValid, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionUserTaskValid), nil + } +} + +func (f fissionUserTaskValidDo) FindByPage(offset int, limit int) (result []*model.FissionUserTaskValid, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionUserTaskValidDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionUserTaskValidDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionUserTaskValidDo) Delete(models ...*model.FissionUserTaskValid) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionUserTaskValidDo) withDO(do gen.Dao) *fissionUserTaskValidDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_vs.gen.go b/internal/repository/dao/fission_vs.gen.go new file mode 100644 index 0000000..d8c6af0 --- /dev/null +++ b/internal/repository/dao/fission_vs.gen.go @@ -0,0 +1,369 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionV(db *gorm.DB, opts ...gen.DOOption) fissionV { + _fissionV := fissionV{} + + _fissionV.fissionVDo.UseDB(db, opts...) + _fissionV.fissionVDo.UseModel(&model.FissionV{}) + + tableName := _fissionV.fissionVDo.TableName() + _fissionV.ALL = field.NewAsterisk(tableName) + _fissionV.ID = field.NewInt64(tableName, "id") + _fissionV.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionV.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionV.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionV.UserID = field.NewInt64(tableName, "user_id") + _fissionV.Chance = field.NewInt32(tableName, "chance") + _fissionV.UsePoint = field.NewInt64(tableName, "use_point") + _fissionV.SetInit = field.NewInt8(tableName, "set_init") + _fissionV.VoteNum = field.NewInt32(tableName, "vote_num") + _fissionV.CoinGet = field.NewInt32(tableName, "coin_get") + _fissionV.CoinUse = field.NewInt32(tableName, "coin_use") + + _fissionV.fillFieldMap() + + return _fissionV +} + +type fissionV struct { + fissionVDo fissionVDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + Chance field.Int32 // 投票机会数 + UsePoint field.Int64 // 使用积分数 + SetInit field.Int8 // 是否被设置过初始次数(0-否,1-是) + VoteNum field.Int32 // 投票次数 + CoinGet field.Int32 // 获得积分数 + CoinUse field.Int32 // 使用积分数 + + fieldMap map[string]field.Expr +} + +func (f fissionV) Table(newTableName string) *fissionV { + f.fissionVDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionV) As(alias string) *fissionV { + f.fissionVDo.DO = *(f.fissionVDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionV) updateTableName(table string) *fissionV { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.Chance = field.NewInt32(table, "chance") + f.UsePoint = field.NewInt64(table, "use_point") + f.SetInit = field.NewInt8(table, "set_init") + f.VoteNum = field.NewInt32(table, "vote_num") + f.CoinGet = field.NewInt32(table, "coin_get") + f.CoinUse = field.NewInt32(table, "coin_use") + + f.fillFieldMap() + + return f +} + +func (f *fissionV) WithContext(ctx context.Context) *fissionVDo { return f.fissionVDo.WithContext(ctx) } + +func (f fissionV) TableName() string { return f.fissionVDo.TableName() } + +func (f fissionV) Alias() string { return f.fissionVDo.Alias() } + +func (f *fissionV) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionV) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["chance"] = f.Chance + f.fieldMap["use_point"] = f.UsePoint + f.fieldMap["set_init"] = f.SetInit + f.fieldMap["vote_num"] = f.VoteNum + f.fieldMap["coin_get"] = f.CoinGet + f.fieldMap["coin_use"] = f.CoinUse +} + +func (f fissionV) clone(db *gorm.DB) fissionV { + f.fissionVDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionV) replaceDB(db *gorm.DB) fissionV { + f.fissionVDo.ReplaceDB(db) + return f +} + +type fissionVDo struct{ gen.DO } + +func (f fissionVDo) Debug() *fissionVDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionVDo) WithContext(ctx context.Context) *fissionVDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionVDo) ReadDB() *fissionVDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionVDo) WriteDB() *fissionVDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionVDo) Session(config *gorm.Session) *fissionVDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionVDo) Clauses(conds ...clause.Expression) *fissionVDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionVDo) Returning(value interface{}, columns ...string) *fissionVDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionVDo) Not(conds ...gen.Condition) *fissionVDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionVDo) Or(conds ...gen.Condition) *fissionVDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionVDo) Select(conds ...field.Expr) *fissionVDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionVDo) Where(conds ...gen.Condition) *fissionVDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionVDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionVDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionVDo) Order(conds ...field.Expr) *fissionVDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionVDo) Distinct(cols ...field.Expr) *fissionVDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionVDo) Omit(cols ...field.Expr) *fissionVDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionVDo) Join(table schema.Tabler, on ...field.Expr) *fissionVDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionVDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionVDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionVDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionVDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionVDo) Group(cols ...field.Expr) *fissionVDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionVDo) Having(conds ...gen.Condition) *fissionVDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionVDo) Limit(limit int) *fissionVDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionVDo) Offset(offset int) *fissionVDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionVDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionVDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionVDo) Unscoped() *fissionVDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionVDo) Create(values ...*model.FissionV) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionVDo) CreateInBatches(values []*model.FissionV, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionVDo) Save(values ...*model.FissionV) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionVDo) First() (*model.FissionV, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionV), nil + } +} + +func (f fissionVDo) Take() (*model.FissionV, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionV), nil + } +} + +func (f fissionVDo) Last() (*model.FissionV, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionV), nil + } +} + +func (f fissionVDo) Find() ([]*model.FissionV, error) { + result, err := f.DO.Find() + return result.([]*model.FissionV), err +} + +func (f fissionVDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionV, err error) { + buf := make([]*model.FissionV, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionVDo) FindInBatches(result *[]*model.FissionV, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionVDo) Attrs(attrs ...field.AssignExpr) *fissionVDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionVDo) Assign(attrs ...field.AssignExpr) *fissionVDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionVDo) Joins(fields ...field.RelationField) *fissionVDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionVDo) Preload(fields ...field.RelationField) *fissionVDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionVDo) FirstOrInit() (*model.FissionV, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionV), nil + } +} + +func (f fissionVDo) FirstOrCreate() (*model.FissionV, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionV), nil + } +} + +func (f fissionVDo) FindByPage(offset int, limit int) (result []*model.FissionV, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionVDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionVDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionVDo) Delete(models ...*model.FissionV) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionVDo) withDO(do gen.Dao) *fissionVDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_vs_log.gen.go b/internal/repository/dao/fission_vs_log.gen.go new file mode 100644 index 0000000..396e040 --- /dev/null +++ b/internal/repository/dao/fission_vs_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionVsLog(db *gorm.DB, opts ...gen.DOOption) fissionVsLog { + _fissionVsLog := fissionVsLog{} + + _fissionVsLog.fissionVsLogDo.UseDB(db, opts...) + _fissionVsLog.fissionVsLogDo.UseModel(&model.FissionVsLog{}) + + tableName := _fissionVsLog.fissionVsLogDo.TableName() + _fissionVsLog.ALL = field.NewAsterisk(tableName) + _fissionVsLog.ID = field.NewInt64(tableName, "id") + _fissionVsLog.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionVsLog.UserID = field.NewInt64(tableName, "user_id") + _fissionVsLog.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionVsLog.VsID = field.NewInt64(tableName, "vs_id") + _fissionVsLog.Type = field.NewInt8(tableName, "type") + _fissionVsLog.Source = field.NewString(tableName, "source") + _fissionVsLog.Val = field.NewString(tableName, "val") + + _fissionVsLog.fillFieldMap() + + return _fissionVsLog +} + +type fissionVsLog struct { + fissionVsLogDo fissionVsLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + VsID field.Int64 // 玩家id(fission_prize_wheel表id) + Type field.Int8 // 日志类型(1-获得投票机会,2-投票) + Source field.String // 来源标识 + Val field.String // 数据对象 + + fieldMap map[string]field.Expr +} + +func (f fissionVsLog) Table(newTableName string) *fissionVsLog { + f.fissionVsLogDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionVsLog) As(alias string) *fissionVsLog { + f.fissionVsLogDo.DO = *(f.fissionVsLogDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionVsLog) updateTableName(table string) *fissionVsLog { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.VsID = field.NewInt64(table, "vs_id") + f.Type = field.NewInt8(table, "type") + f.Source = field.NewString(table, "source") + f.Val = field.NewString(table, "val") + + f.fillFieldMap() + + return f +} + +func (f *fissionVsLog) WithContext(ctx context.Context) *fissionVsLogDo { + return f.fissionVsLogDo.WithContext(ctx) +} + +func (f fissionVsLog) TableName() string { return f.fissionVsLogDo.TableName() } + +func (f fissionVsLog) Alias() string { return f.fissionVsLogDo.Alias() } + +func (f *fissionVsLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionVsLog) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 8) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["vs_id"] = f.VsID + f.fieldMap["type"] = f.Type + f.fieldMap["source"] = f.Source + f.fieldMap["val"] = f.Val +} + +func (f fissionVsLog) clone(db *gorm.DB) fissionVsLog { + f.fissionVsLogDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionVsLog) replaceDB(db *gorm.DB) fissionVsLog { + f.fissionVsLogDo.ReplaceDB(db) + return f +} + +type fissionVsLogDo struct{ gen.DO } + +func (f fissionVsLogDo) Debug() *fissionVsLogDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionVsLogDo) WithContext(ctx context.Context) *fissionVsLogDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionVsLogDo) ReadDB() *fissionVsLogDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionVsLogDo) WriteDB() *fissionVsLogDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionVsLogDo) Session(config *gorm.Session) *fissionVsLogDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionVsLogDo) Clauses(conds ...clause.Expression) *fissionVsLogDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionVsLogDo) Returning(value interface{}, columns ...string) *fissionVsLogDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionVsLogDo) Not(conds ...gen.Condition) *fissionVsLogDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionVsLogDo) Or(conds ...gen.Condition) *fissionVsLogDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionVsLogDo) Select(conds ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionVsLogDo) Where(conds ...gen.Condition) *fissionVsLogDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionVsLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionVsLogDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionVsLogDo) Order(conds ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionVsLogDo) Distinct(cols ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionVsLogDo) Omit(cols ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionVsLogDo) Join(table schema.Tabler, on ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionVsLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionVsLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionVsLogDo) Group(cols ...field.Expr) *fissionVsLogDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionVsLogDo) Having(conds ...gen.Condition) *fissionVsLogDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionVsLogDo) Limit(limit int) *fissionVsLogDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionVsLogDo) Offset(offset int) *fissionVsLogDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionVsLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionVsLogDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionVsLogDo) Unscoped() *fissionVsLogDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionVsLogDo) Create(values ...*model.FissionVsLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionVsLogDo) CreateInBatches(values []*model.FissionVsLog, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionVsLogDo) Save(values ...*model.FissionVsLog) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionVsLogDo) First() (*model.FissionVsLog, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsLog), nil + } +} + +func (f fissionVsLogDo) Take() (*model.FissionVsLog, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsLog), nil + } +} + +func (f fissionVsLogDo) Last() (*model.FissionVsLog, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsLog), nil + } +} + +func (f fissionVsLogDo) Find() ([]*model.FissionVsLog, error) { + result, err := f.DO.Find() + return result.([]*model.FissionVsLog), err +} + +func (f fissionVsLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionVsLog, err error) { + buf := make([]*model.FissionVsLog, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionVsLogDo) FindInBatches(result *[]*model.FissionVsLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionVsLogDo) Attrs(attrs ...field.AssignExpr) *fissionVsLogDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionVsLogDo) Assign(attrs ...field.AssignExpr) *fissionVsLogDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionVsLogDo) Joins(fields ...field.RelationField) *fissionVsLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionVsLogDo) Preload(fields ...field.RelationField) *fissionVsLogDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionVsLogDo) FirstOrInit() (*model.FissionVsLog, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsLog), nil + } +} + +func (f fissionVsLogDo) FirstOrCreate() (*model.FissionVsLog, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsLog), nil + } +} + +func (f fissionVsLogDo) FindByPage(offset int, limit int) (result []*model.FissionVsLog, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionVsLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionVsLogDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionVsLogDo) Delete(models ...*model.FissionVsLog) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionVsLogDo) withDO(do gen.Dao) *fissionVsLogDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_vs_vote.gen.go b/internal/repository/dao/fission_vs_vote.gen.go new file mode 100644 index 0000000..bcb44c3 --- /dev/null +++ b/internal/repository/dao/fission_vs_vote.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionVsVote(db *gorm.DB, opts ...gen.DOOption) fissionVsVote { + _fissionVsVote := fissionVsVote{} + + _fissionVsVote.fissionVsVoteDo.UseDB(db, opts...) + _fissionVsVote.fissionVsVoteDo.UseModel(&model.FissionVsVote{}) + + tableName := _fissionVsVote.fissionVsVoteDo.TableName() + _fissionVsVote.ALL = field.NewAsterisk(tableName) + _fissionVsVote.ID = field.NewInt64(tableName, "id") + _fissionVsVote.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionVsVote.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionVsVote.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionVsVote.UserID = field.NewInt64(tableName, "user_id") + _fissionVsVote.VsID = field.NewInt64(tableName, "vs_id") + _fissionVsVote.ScheduleID = field.NewInt64(tableName, "schedule_id") + _fissionVsVote.WinType = field.NewInt8(tableName, "win_type") + _fissionVsVote.WinTeamID = field.NewInt64(tableName, "win_team_id") + _fissionVsVote.IsWin = field.NewInt8(tableName, "is_win") + _fissionVsVote.FreeVote = field.NewInt32(tableName, "free_vote") + _fissionVsVote.PointVote = field.NewInt32(tableName, "point_vote") + + _fissionVsVote.fillFieldMap() + + return _fissionVsVote +} + +type fissionVsVote struct { + fissionVsVoteDo fissionVsVoteDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + VsID field.Int64 // 赛事竞猜玩家id + ScheduleID field.Int64 // 赛程id + WinType field.Int8 // 获胜方式(1-胜利,2-平局) + WinTeamID field.Int64 // 选择的获胜队伍 + IsWin field.Int8 // 是否赢得奖励 + FreeVote field.Int32 // 免费投票数 + PointVote field.Int32 // 积分投票数 + + fieldMap map[string]field.Expr +} + +func (f fissionVsVote) Table(newTableName string) *fissionVsVote { + f.fissionVsVoteDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionVsVote) As(alias string) *fissionVsVote { + f.fissionVsVoteDo.DO = *(f.fissionVsVoteDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionVsVote) updateTableName(table string) *fissionVsVote { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.VsID = field.NewInt64(table, "vs_id") + f.ScheduleID = field.NewInt64(table, "schedule_id") + f.WinType = field.NewInt8(table, "win_type") + f.WinTeamID = field.NewInt64(table, "win_team_id") + f.IsWin = field.NewInt8(table, "is_win") + f.FreeVote = field.NewInt32(table, "free_vote") + f.PointVote = field.NewInt32(table, "point_vote") + + f.fillFieldMap() + + return f +} + +func (f *fissionVsVote) WithContext(ctx context.Context) *fissionVsVoteDo { + return f.fissionVsVoteDo.WithContext(ctx) +} + +func (f fissionVsVote) TableName() string { return f.fissionVsVoteDo.TableName() } + +func (f fissionVsVote) Alias() string { return f.fissionVsVoteDo.Alias() } + +func (f *fissionVsVote) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionVsVote) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 12) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["vs_id"] = f.VsID + f.fieldMap["schedule_id"] = f.ScheduleID + f.fieldMap["win_type"] = f.WinType + f.fieldMap["win_team_id"] = f.WinTeamID + f.fieldMap["is_win"] = f.IsWin + f.fieldMap["free_vote"] = f.FreeVote + f.fieldMap["point_vote"] = f.PointVote +} + +func (f fissionVsVote) clone(db *gorm.DB) fissionVsVote { + f.fissionVsVoteDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionVsVote) replaceDB(db *gorm.DB) fissionVsVote { + f.fissionVsVoteDo.ReplaceDB(db) + return f +} + +type fissionVsVoteDo struct{ gen.DO } + +func (f fissionVsVoteDo) Debug() *fissionVsVoteDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionVsVoteDo) WithContext(ctx context.Context) *fissionVsVoteDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionVsVoteDo) ReadDB() *fissionVsVoteDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionVsVoteDo) WriteDB() *fissionVsVoteDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionVsVoteDo) Session(config *gorm.Session) *fissionVsVoteDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionVsVoteDo) Clauses(conds ...clause.Expression) *fissionVsVoteDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionVsVoteDo) Returning(value interface{}, columns ...string) *fissionVsVoteDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionVsVoteDo) Not(conds ...gen.Condition) *fissionVsVoteDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionVsVoteDo) Or(conds ...gen.Condition) *fissionVsVoteDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionVsVoteDo) Select(conds ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionVsVoteDo) Where(conds ...gen.Condition) *fissionVsVoteDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionVsVoteDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionVsVoteDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionVsVoteDo) Order(conds ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionVsVoteDo) Distinct(cols ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionVsVoteDo) Omit(cols ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionVsVoteDo) Join(table schema.Tabler, on ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionVsVoteDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionVsVoteDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionVsVoteDo) Group(cols ...field.Expr) *fissionVsVoteDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionVsVoteDo) Having(conds ...gen.Condition) *fissionVsVoteDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionVsVoteDo) Limit(limit int) *fissionVsVoteDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionVsVoteDo) Offset(offset int) *fissionVsVoteDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionVsVoteDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionVsVoteDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionVsVoteDo) Unscoped() *fissionVsVoteDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionVsVoteDo) Create(values ...*model.FissionVsVote) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionVsVoteDo) CreateInBatches(values []*model.FissionVsVote, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionVsVoteDo) Save(values ...*model.FissionVsVote) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionVsVoteDo) First() (*model.FissionVsVote, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVote), nil + } +} + +func (f fissionVsVoteDo) Take() (*model.FissionVsVote, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVote), nil + } +} + +func (f fissionVsVoteDo) Last() (*model.FissionVsVote, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVote), nil + } +} + +func (f fissionVsVoteDo) Find() ([]*model.FissionVsVote, error) { + result, err := f.DO.Find() + return result.([]*model.FissionVsVote), err +} + +func (f fissionVsVoteDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionVsVote, err error) { + buf := make([]*model.FissionVsVote, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionVsVoteDo) FindInBatches(result *[]*model.FissionVsVote, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionVsVoteDo) Attrs(attrs ...field.AssignExpr) *fissionVsVoteDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionVsVoteDo) Assign(attrs ...field.AssignExpr) *fissionVsVoteDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionVsVoteDo) Joins(fields ...field.RelationField) *fissionVsVoteDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionVsVoteDo) Preload(fields ...field.RelationField) *fissionVsVoteDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionVsVoteDo) FirstOrInit() (*model.FissionVsVote, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVote), nil + } +} + +func (f fissionVsVoteDo) FirstOrCreate() (*model.FissionVsVote, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVote), nil + } +} + +func (f fissionVsVoteDo) FindByPage(offset int, limit int) (result []*model.FissionVsVote, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionVsVoteDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionVsVoteDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionVsVoteDo) Delete(models ...*model.FissionVsVote) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionVsVoteDo) withDO(do gen.Dao) *fissionVsVoteDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_vs_vote_settlement.gen.go b/internal/repository/dao/fission_vs_vote_settlement.gen.go new file mode 100644 index 0000000..e0614f3 --- /dev/null +++ b/internal/repository/dao/fission_vs_vote_settlement.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionVsVoteSettlement(db *gorm.DB, opts ...gen.DOOption) fissionVsVoteSettlement { + _fissionVsVoteSettlement := fissionVsVoteSettlement{} + + _fissionVsVoteSettlement.fissionVsVoteSettlementDo.UseDB(db, opts...) + _fissionVsVoteSettlement.fissionVsVoteSettlementDo.UseModel(&model.FissionVsVoteSettlement{}) + + tableName := _fissionVsVoteSettlement.fissionVsVoteSettlementDo.TableName() + _fissionVsVoteSettlement.ALL = field.NewAsterisk(tableName) + _fissionVsVoteSettlement.ID = field.NewInt64(tableName, "id") + _fissionVsVoteSettlement.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionVsVoteSettlement.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionVsVoteSettlement.UserID = field.NewInt64(tableName, "user_id") + _fissionVsVoteSettlement.ScheduleID = field.NewInt64(tableName, "schedule_id") + _fissionVsVoteSettlement.VsID = field.NewInt64(tableName, "vs_id") + _fissionVsVoteSettlement.VoteID = field.NewInt64(tableName, "vote_id") + _fissionVsVoteSettlement.AcceptAt = field.NewInt64(tableName, "accept_at") + _fissionVsVoteSettlement.RecordIds = field.NewString(tableName, "record_ids") + _fissionVsVoteSettlement.TipAt = field.NewInt64(tableName, "tip_at") + _fissionVsVoteSettlement.Odds = field.NewString(tableName, "odds") + + _fissionVsVoteSettlement.fillFieldMap() + + return _fissionVsVoteSettlement +} + +type fissionVsVoteSettlement struct { + fissionVsVoteSettlementDo fissionVsVoteSettlementDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + CampaignID field.Int64 // 活动id(fission_campaign表) + UserID field.Int64 // 用户id(fission_user表) + ScheduleID field.Int64 // 赛程id + VsID field.Int64 // 赛事竞猜玩家id + VoteID field.Int64 // 投票记录(fission_vs_vote表) + AcceptAt field.Int64 // 接收时间 + RecordIds field.String // 奖励记录id + TipAt field.Int64 // 提示时间 + Odds field.String // 赔率 + + fieldMap map[string]field.Expr +} + +func (f fissionVsVoteSettlement) Table(newTableName string) *fissionVsVoteSettlement { + f.fissionVsVoteSettlementDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionVsVoteSettlement) As(alias string) *fissionVsVoteSettlement { + f.fissionVsVoteSettlementDo.DO = *(f.fissionVsVoteSettlementDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionVsVoteSettlement) updateTableName(table string) *fissionVsVoteSettlement { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.UserID = field.NewInt64(table, "user_id") + f.ScheduleID = field.NewInt64(table, "schedule_id") + f.VsID = field.NewInt64(table, "vs_id") + f.VoteID = field.NewInt64(table, "vote_id") + f.AcceptAt = field.NewInt64(table, "accept_at") + f.RecordIds = field.NewString(table, "record_ids") + f.TipAt = field.NewInt64(table, "tip_at") + f.Odds = field.NewString(table, "odds") + + f.fillFieldMap() + + return f +} + +func (f *fissionVsVoteSettlement) WithContext(ctx context.Context) *fissionVsVoteSettlementDo { + return f.fissionVsVoteSettlementDo.WithContext(ctx) +} + +func (f fissionVsVoteSettlement) TableName() string { return f.fissionVsVoteSettlementDo.TableName() } + +func (f fissionVsVoteSettlement) Alias() string { return f.fissionVsVoteSettlementDo.Alias() } + +func (f *fissionVsVoteSettlement) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionVsVoteSettlement) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["schedule_id"] = f.ScheduleID + f.fieldMap["vs_id"] = f.VsID + f.fieldMap["vote_id"] = f.VoteID + f.fieldMap["accept_at"] = f.AcceptAt + f.fieldMap["record_ids"] = f.RecordIds + f.fieldMap["tip_at"] = f.TipAt + f.fieldMap["odds"] = f.Odds +} + +func (f fissionVsVoteSettlement) clone(db *gorm.DB) fissionVsVoteSettlement { + f.fissionVsVoteSettlementDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionVsVoteSettlement) replaceDB(db *gorm.DB) fissionVsVoteSettlement { + f.fissionVsVoteSettlementDo.ReplaceDB(db) + return f +} + +type fissionVsVoteSettlementDo struct{ gen.DO } + +func (f fissionVsVoteSettlementDo) Debug() *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionVsVoteSettlementDo) WithContext(ctx context.Context) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionVsVoteSettlementDo) ReadDB() *fissionVsVoteSettlementDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionVsVoteSettlementDo) WriteDB() *fissionVsVoteSettlementDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionVsVoteSettlementDo) Session(config *gorm.Session) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionVsVoteSettlementDo) Clauses(conds ...clause.Expression) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionVsVoteSettlementDo) Returning(value interface{}, columns ...string) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionVsVoteSettlementDo) Not(conds ...gen.Condition) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionVsVoteSettlementDo) Or(conds ...gen.Condition) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionVsVoteSettlementDo) Select(conds ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionVsVoteSettlementDo) Where(conds ...gen.Condition) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionVsVoteSettlementDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionVsVoteSettlementDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionVsVoteSettlementDo) Order(conds ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionVsVoteSettlementDo) Distinct(cols ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionVsVoteSettlementDo) Omit(cols ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionVsVoteSettlementDo) Join(table schema.Tabler, on ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionVsVoteSettlementDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionVsVoteSettlementDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionVsVoteSettlementDo) Group(cols ...field.Expr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionVsVoteSettlementDo) Having(conds ...gen.Condition) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionVsVoteSettlementDo) Limit(limit int) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionVsVoteSettlementDo) Offset(offset int) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionVsVoteSettlementDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionVsVoteSettlementDo) Unscoped() *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionVsVoteSettlementDo) Create(values ...*model.FissionVsVoteSettlement) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionVsVoteSettlementDo) CreateInBatches(values []*model.FissionVsVoteSettlement, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionVsVoteSettlementDo) Save(values ...*model.FissionVsVoteSettlement) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionVsVoteSettlementDo) First() (*model.FissionVsVoteSettlement, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVoteSettlement), nil + } +} + +func (f fissionVsVoteSettlementDo) Take() (*model.FissionVsVoteSettlement, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVoteSettlement), nil + } +} + +func (f fissionVsVoteSettlementDo) Last() (*model.FissionVsVoteSettlement, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVoteSettlement), nil + } +} + +func (f fissionVsVoteSettlementDo) Find() ([]*model.FissionVsVoteSettlement, error) { + result, err := f.DO.Find() + return result.([]*model.FissionVsVoteSettlement), err +} + +func (f fissionVsVoteSettlementDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionVsVoteSettlement, err error) { + buf := make([]*model.FissionVsVoteSettlement, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionVsVoteSettlementDo) FindInBatches(result *[]*model.FissionVsVoteSettlement, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionVsVoteSettlementDo) Attrs(attrs ...field.AssignExpr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionVsVoteSettlementDo) Assign(attrs ...field.AssignExpr) *fissionVsVoteSettlementDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionVsVoteSettlementDo) Joins(fields ...field.RelationField) *fissionVsVoteSettlementDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionVsVoteSettlementDo) Preload(fields ...field.RelationField) *fissionVsVoteSettlementDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionVsVoteSettlementDo) FirstOrInit() (*model.FissionVsVoteSettlement, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVoteSettlement), nil + } +} + +func (f fissionVsVoteSettlementDo) FirstOrCreate() (*model.FissionVsVoteSettlement, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionVsVoteSettlement), nil + } +} + +func (f fissionVsVoteSettlementDo) FindByPage(offset int, limit int) (result []*model.FissionVsVoteSettlement, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionVsVoteSettlementDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionVsVoteSettlementDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionVsVoteSettlementDo) Delete(models ...*model.FissionVsVoteSettlement) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionVsVoteSettlementDo) withDO(do gen.Dao) *fissionVsVoteSettlementDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_web_user.gen.go b/internal/repository/dao/fission_web_user.gen.go new file mode 100644 index 0000000..7de9dd0 --- /dev/null +++ b/internal/repository/dao/fission_web_user.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionWebUser(db *gorm.DB, opts ...gen.DOOption) fissionWebUser { + _fissionWebUser := fissionWebUser{} + + _fissionWebUser.fissionWebUserDo.UseDB(db, opts...) + _fissionWebUser.fissionWebUserDo.UseModel(&model.FissionWebUser{}) + + tableName := _fissionWebUser.fissionWebUserDo.TableName() + _fissionWebUser.ALL = field.NewAsterisk(tableName) + _fissionWebUser.ID = field.NewInt64(tableName, "id") + _fissionWebUser.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionWebUser.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionWebUser.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionWebUser.ChannelID = field.NewInt64(tableName, "channel_id") + _fissionWebUser.WebID = field.NewString(tableName, "web_id") + _fissionWebUser.UserID = field.NewInt64(tableName, "user_id") + _fissionWebUser.RewardID = field.NewInt64(tableName, "reward_id") + _fissionWebUser.Score = field.NewInt32(tableName, "score") + _fissionWebUser.Answer = field.NewString(tableName, "answer") + _fissionWebUser.IP = field.NewString(tableName, "ip") + _fissionWebUser.IPCity = field.NewString(tableName, "ip_city") + + _fissionWebUser.fillFieldMap() + + return _fissionWebUser +} + +type fissionWebUser struct { + fissionWebUserDo fissionWebUserDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动ID(campaign表主键) + ChannelID field.Int64 // 渠道id(fission_campaign_channel表) + WebID field.String // 浏览器唯一id + UserID field.Int64 // 用户id(fission_user表) + RewardID field.Int64 // 抽奖的奖品id + Score field.Int32 // 答题分数 + Answer field.String // 答卷内容 + IP field.String // 用户ip地址 + IPCity field.String // Ip的国家地区 + + fieldMap map[string]field.Expr +} + +func (f fissionWebUser) Table(newTableName string) *fissionWebUser { + f.fissionWebUserDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionWebUser) As(alias string) *fissionWebUser { + f.fissionWebUserDo.DO = *(f.fissionWebUserDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionWebUser) updateTableName(table string) *fissionWebUser { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.ChannelID = field.NewInt64(table, "channel_id") + f.WebID = field.NewString(table, "web_id") + f.UserID = field.NewInt64(table, "user_id") + f.RewardID = field.NewInt64(table, "reward_id") + f.Score = field.NewInt32(table, "score") + f.Answer = field.NewString(table, "answer") + f.IP = field.NewString(table, "ip") + f.IPCity = field.NewString(table, "ip_city") + + f.fillFieldMap() + + return f +} + +func (f *fissionWebUser) WithContext(ctx context.Context) *fissionWebUserDo { + return f.fissionWebUserDo.WithContext(ctx) +} + +func (f fissionWebUser) TableName() string { return f.fissionWebUserDo.TableName() } + +func (f fissionWebUser) Alias() string { return f.fissionWebUserDo.Alias() } + +func (f *fissionWebUser) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionWebUser) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 12) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["channel_id"] = f.ChannelID + f.fieldMap["web_id"] = f.WebID + f.fieldMap["user_id"] = f.UserID + f.fieldMap["reward_id"] = f.RewardID + f.fieldMap["score"] = f.Score + f.fieldMap["answer"] = f.Answer + f.fieldMap["ip"] = f.IP + f.fieldMap["ip_city"] = f.IPCity +} + +func (f fissionWebUser) clone(db *gorm.DB) fissionWebUser { + f.fissionWebUserDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionWebUser) replaceDB(db *gorm.DB) fissionWebUser { + f.fissionWebUserDo.ReplaceDB(db) + return f +} + +type fissionWebUserDo struct{ gen.DO } + +func (f fissionWebUserDo) Debug() *fissionWebUserDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionWebUserDo) WithContext(ctx context.Context) *fissionWebUserDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionWebUserDo) ReadDB() *fissionWebUserDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionWebUserDo) WriteDB() *fissionWebUserDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionWebUserDo) Session(config *gorm.Session) *fissionWebUserDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionWebUserDo) Clauses(conds ...clause.Expression) *fissionWebUserDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionWebUserDo) Returning(value interface{}, columns ...string) *fissionWebUserDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionWebUserDo) Not(conds ...gen.Condition) *fissionWebUserDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionWebUserDo) Or(conds ...gen.Condition) *fissionWebUserDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionWebUserDo) Select(conds ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionWebUserDo) Where(conds ...gen.Condition) *fissionWebUserDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionWebUserDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionWebUserDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionWebUserDo) Order(conds ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionWebUserDo) Distinct(cols ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionWebUserDo) Omit(cols ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionWebUserDo) Join(table schema.Tabler, on ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionWebUserDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionWebUserDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionWebUserDo) Group(cols ...field.Expr) *fissionWebUserDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionWebUserDo) Having(conds ...gen.Condition) *fissionWebUserDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionWebUserDo) Limit(limit int) *fissionWebUserDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionWebUserDo) Offset(offset int) *fissionWebUserDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionWebUserDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionWebUserDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionWebUserDo) Unscoped() *fissionWebUserDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionWebUserDo) Create(values ...*model.FissionWebUser) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionWebUserDo) CreateInBatches(values []*model.FissionWebUser, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionWebUserDo) Save(values ...*model.FissionWebUser) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionWebUserDo) First() (*model.FissionWebUser, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionWebUser), nil + } +} + +func (f fissionWebUserDo) Take() (*model.FissionWebUser, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionWebUser), nil + } +} + +func (f fissionWebUserDo) Last() (*model.FissionWebUser, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionWebUser), nil + } +} + +func (f fissionWebUserDo) Find() ([]*model.FissionWebUser, error) { + result, err := f.DO.Find() + return result.([]*model.FissionWebUser), err +} + +func (f fissionWebUserDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionWebUser, err error) { + buf := make([]*model.FissionWebUser, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionWebUserDo) FindInBatches(result *[]*model.FissionWebUser, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionWebUserDo) Attrs(attrs ...field.AssignExpr) *fissionWebUserDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionWebUserDo) Assign(attrs ...field.AssignExpr) *fissionWebUserDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionWebUserDo) Joins(fields ...field.RelationField) *fissionWebUserDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionWebUserDo) Preload(fields ...field.RelationField) *fissionWebUserDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionWebUserDo) FirstOrInit() (*model.FissionWebUser, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionWebUser), nil + } +} + +func (f fissionWebUserDo) FirstOrCreate() (*model.FissionWebUser, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionWebUser), nil + } +} + +func (f fissionWebUserDo) FindByPage(offset int, limit int) (result []*model.FissionWebUser, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionWebUserDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionWebUserDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionWebUserDo) Delete(models ...*model.FissionWebUser) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionWebUserDo) withDO(do gen.Dao) *fissionWebUserDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/fission_win.gen.go b/internal/repository/dao/fission_win.gen.go new file mode 100644 index 0000000..05e147e --- /dev/null +++ b/internal/repository/dao/fission_win.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newFissionWin(db *gorm.DB, opts ...gen.DOOption) fissionWin { + _fissionWin := fissionWin{} + + _fissionWin.fissionWinDo.UseDB(db, opts...) + _fissionWin.fissionWinDo.UseModel(&model.FissionWin{}) + + tableName := _fissionWin.fissionWinDo.TableName() + _fissionWin.ALL = field.NewAsterisk(tableName) + _fissionWin.ID = field.NewInt64(tableName, "id") + _fissionWin.CreatedAt = field.NewInt64(tableName, "created_at") + _fissionWin.UpdatedAt = field.NewInt64(tableName, "updated_at") + _fissionWin.UserID = field.NewInt64(tableName, "user_id") + _fissionWin.CampaignID = field.NewInt64(tableName, "campaign_id") + _fissionWin.LimitStatus = field.NewInt8(tableName, "limit_status") + _fissionWin.BindInstall = field.NewInt8(tableName, "bind_install") + _fissionWin.BindRegister = field.NewInt8(tableName, "bind_register") + _fissionWin.IsNewcomer = field.NewInt8(tableName, "is_newcomer") + _fissionWin.NextStep = field.NewInt32(tableName, "next_step") + _fissionWin.LoopInvite = field.NewInt32(tableName, "loop_invite") + + _fissionWin.fillFieldMap() + + return _fissionWin +} + +type fissionWin struct { + fissionWinDo fissionWinDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 活动用户ID(fission_user表主键) + CampaignID field.Int64 // 活动ID(fission_campaign表) + LimitStatus field.Int8 // 任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制) + BindInstall field.Int8 // 是否绑定了安装事件(0-否,1-是) + BindRegister field.Int8 // 是否绑定了注册事件(0-否,1-是) + IsNewcomer field.Int8 // 是否新人用户(0-否,1-是) + NextStep field.Int32 // 可领取的下一阶段奖品 + LoopInvite field.Int32 // 当前循环的邀请数 + + fieldMap map[string]field.Expr +} + +func (f fissionWin) Table(newTableName string) *fissionWin { + f.fissionWinDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f fissionWin) As(alias string) *fissionWin { + f.fissionWinDo.DO = *(f.fissionWinDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *fissionWin) updateTableName(table string) *fissionWin { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.UserID = field.NewInt64(table, "user_id") + f.CampaignID = field.NewInt64(table, "campaign_id") + f.LimitStatus = field.NewInt8(table, "limit_status") + f.BindInstall = field.NewInt8(table, "bind_install") + f.BindRegister = field.NewInt8(table, "bind_register") + f.IsNewcomer = field.NewInt8(table, "is_newcomer") + f.NextStep = field.NewInt32(table, "next_step") + f.LoopInvite = field.NewInt32(table, "loop_invite") + + f.fillFieldMap() + + return f +} + +func (f *fissionWin) WithContext(ctx context.Context) *fissionWinDo { + return f.fissionWinDo.WithContext(ctx) +} + +func (f fissionWin) TableName() string { return f.fissionWinDo.TableName() } + +func (f fissionWin) Alias() string { return f.fissionWinDo.Alias() } + +func (f *fissionWin) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *fissionWin) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 11) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["user_id"] = f.UserID + f.fieldMap["campaign_id"] = f.CampaignID + f.fieldMap["limit_status"] = f.LimitStatus + f.fieldMap["bind_install"] = f.BindInstall + f.fieldMap["bind_register"] = f.BindRegister + f.fieldMap["is_newcomer"] = f.IsNewcomer + f.fieldMap["next_step"] = f.NextStep + f.fieldMap["loop_invite"] = f.LoopInvite +} + +func (f fissionWin) clone(db *gorm.DB) fissionWin { + f.fissionWinDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f fissionWin) replaceDB(db *gorm.DB) fissionWin { + f.fissionWinDo.ReplaceDB(db) + return f +} + +type fissionWinDo struct{ gen.DO } + +func (f fissionWinDo) Debug() *fissionWinDo { + return f.withDO(f.DO.Debug()) +} + +func (f fissionWinDo) WithContext(ctx context.Context) *fissionWinDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f fissionWinDo) ReadDB() *fissionWinDo { + return f.Clauses(dbresolver.Read) +} + +func (f fissionWinDo) WriteDB() *fissionWinDo { + return f.Clauses(dbresolver.Write) +} + +func (f fissionWinDo) Session(config *gorm.Session) *fissionWinDo { + return f.withDO(f.DO.Session(config)) +} + +func (f fissionWinDo) Clauses(conds ...clause.Expression) *fissionWinDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f fissionWinDo) Returning(value interface{}, columns ...string) *fissionWinDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f fissionWinDo) Not(conds ...gen.Condition) *fissionWinDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f fissionWinDo) Or(conds ...gen.Condition) *fissionWinDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f fissionWinDo) Select(conds ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f fissionWinDo) Where(conds ...gen.Condition) *fissionWinDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f fissionWinDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionWinDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f fissionWinDo) Order(conds ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f fissionWinDo) Distinct(cols ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f fissionWinDo) Omit(cols ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f fissionWinDo) Join(table schema.Tabler, on ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f fissionWinDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f fissionWinDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f fissionWinDo) Group(cols ...field.Expr) *fissionWinDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f fissionWinDo) Having(conds ...gen.Condition) *fissionWinDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f fissionWinDo) Limit(limit int) *fissionWinDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f fissionWinDo) Offset(offset int) *fissionWinDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f fissionWinDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionWinDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f fissionWinDo) Unscoped() *fissionWinDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f fissionWinDo) Create(values ...*model.FissionWin) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f fissionWinDo) CreateInBatches(values []*model.FissionWin, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f fissionWinDo) Save(values ...*model.FissionWin) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f fissionWinDo) First() (*model.FissionWin, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.FissionWin), nil + } +} + +func (f fissionWinDo) Take() (*model.FissionWin, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.FissionWin), nil + } +} + +func (f fissionWinDo) Last() (*model.FissionWin, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.FissionWin), nil + } +} + +func (f fissionWinDo) Find() ([]*model.FissionWin, error) { + result, err := f.DO.Find() + return result.([]*model.FissionWin), err +} + +func (f fissionWinDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionWin, err error) { + buf := make([]*model.FissionWin, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f fissionWinDo) FindInBatches(result *[]*model.FissionWin, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f fissionWinDo) Attrs(attrs ...field.AssignExpr) *fissionWinDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f fissionWinDo) Assign(attrs ...field.AssignExpr) *fissionWinDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f fissionWinDo) Joins(fields ...field.RelationField) *fissionWinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f fissionWinDo) Preload(fields ...field.RelationField) *fissionWinDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f fissionWinDo) FirstOrInit() (*model.FissionWin, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.FissionWin), nil + } +} + +func (f fissionWinDo) FirstOrCreate() (*model.FissionWin, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.FissionWin), nil + } +} + +func (f fissionWinDo) FindByPage(offset int, limit int) (result []*model.FissionWin, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f fissionWinDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f fissionWinDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f fissionWinDo) Delete(models ...*model.FissionWin) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *fissionWinDo) withDO(do gen.Dao) *fissionWinDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/form.gen.go b/internal/repository/dao/form.gen.go new file mode 100644 index 0000000..b41408d --- /dev/null +++ b/internal/repository/dao/form.gen.go @@ -0,0 +1,353 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newForm(db *gorm.DB, opts ...gen.DOOption) form { + _form := form{} + + _form.formDo.UseDB(db, opts...) + _form.formDo.UseModel(&model.Form{}) + + tableName := _form.formDo.TableName() + _form.ALL = field.NewAsterisk(tableName) + _form.ID = field.NewInt64(tableName, "id") + _form.CreatedAt = field.NewInt64(tableName, "created_at") + _form.UpdatedAt = field.NewInt64(tableName, "updated_at") + _form.IsDel = field.NewInt8(tableName, "is_del") + _form.ProjectID = field.NewInt64(tableName, "project_id") + _form.Title = field.NewString(tableName, "title") + _form.Items = field.NewString(tableName, "items") + + _form.fillFieldMap() + + return _form +} + +type form struct { + formDo formDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 + ProjectID field.Int64 // 项目id(project表) + Title field.String // 表单标题 + Items field.String // 表单项 + + fieldMap map[string]field.Expr +} + +func (f form) Table(newTableName string) *form { + f.formDo.UseTable(newTableName) + return f.updateTableName(newTableName) +} + +func (f form) As(alias string) *form { + f.formDo.DO = *(f.formDo.As(alias).(*gen.DO)) + return f.updateTableName(alias) +} + +func (f *form) updateTableName(table string) *form { + f.ALL = field.NewAsterisk(table) + f.ID = field.NewInt64(table, "id") + f.CreatedAt = field.NewInt64(table, "created_at") + f.UpdatedAt = field.NewInt64(table, "updated_at") + f.IsDel = field.NewInt8(table, "is_del") + f.ProjectID = field.NewInt64(table, "project_id") + f.Title = field.NewString(table, "title") + f.Items = field.NewString(table, "items") + + f.fillFieldMap() + + return f +} + +func (f *form) WithContext(ctx context.Context) *formDo { return f.formDo.WithContext(ctx) } + +func (f form) TableName() string { return f.formDo.TableName() } + +func (f form) Alias() string { return f.formDo.Alias() } + +func (f *form) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := f.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (f *form) fillFieldMap() { + f.fieldMap = make(map[string]field.Expr, 7) + f.fieldMap["id"] = f.ID + f.fieldMap["created_at"] = f.CreatedAt + f.fieldMap["updated_at"] = f.UpdatedAt + f.fieldMap["is_del"] = f.IsDel + f.fieldMap["project_id"] = f.ProjectID + f.fieldMap["title"] = f.Title + f.fieldMap["items"] = f.Items +} + +func (f form) clone(db *gorm.DB) form { + f.formDo.ReplaceConnPool(db.Statement.ConnPool) + return f +} + +func (f form) replaceDB(db *gorm.DB) form { + f.formDo.ReplaceDB(db) + return f +} + +type formDo struct{ gen.DO } + +func (f formDo) Debug() *formDo { + return f.withDO(f.DO.Debug()) +} + +func (f formDo) WithContext(ctx context.Context) *formDo { + return f.withDO(f.DO.WithContext(ctx)) +} + +func (f formDo) ReadDB() *formDo { + return f.Clauses(dbresolver.Read) +} + +func (f formDo) WriteDB() *formDo { + return f.Clauses(dbresolver.Write) +} + +func (f formDo) Session(config *gorm.Session) *formDo { + return f.withDO(f.DO.Session(config)) +} + +func (f formDo) Clauses(conds ...clause.Expression) *formDo { + return f.withDO(f.DO.Clauses(conds...)) +} + +func (f formDo) Returning(value interface{}, columns ...string) *formDo { + return f.withDO(f.DO.Returning(value, columns...)) +} + +func (f formDo) Not(conds ...gen.Condition) *formDo { + return f.withDO(f.DO.Not(conds...)) +} + +func (f formDo) Or(conds ...gen.Condition) *formDo { + return f.withDO(f.DO.Or(conds...)) +} + +func (f formDo) Select(conds ...field.Expr) *formDo { + return f.withDO(f.DO.Select(conds...)) +} + +func (f formDo) Where(conds ...gen.Condition) *formDo { + return f.withDO(f.DO.Where(conds...)) +} + +func (f formDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *formDo { + return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (f formDo) Order(conds ...field.Expr) *formDo { + return f.withDO(f.DO.Order(conds...)) +} + +func (f formDo) Distinct(cols ...field.Expr) *formDo { + return f.withDO(f.DO.Distinct(cols...)) +} + +func (f formDo) Omit(cols ...field.Expr) *formDo { + return f.withDO(f.DO.Omit(cols...)) +} + +func (f formDo) Join(table schema.Tabler, on ...field.Expr) *formDo { + return f.withDO(f.DO.Join(table, on...)) +} + +func (f formDo) LeftJoin(table schema.Tabler, on ...field.Expr) *formDo { + return f.withDO(f.DO.LeftJoin(table, on...)) +} + +func (f formDo) RightJoin(table schema.Tabler, on ...field.Expr) *formDo { + return f.withDO(f.DO.RightJoin(table, on...)) +} + +func (f formDo) Group(cols ...field.Expr) *formDo { + return f.withDO(f.DO.Group(cols...)) +} + +func (f formDo) Having(conds ...gen.Condition) *formDo { + return f.withDO(f.DO.Having(conds...)) +} + +func (f formDo) Limit(limit int) *formDo { + return f.withDO(f.DO.Limit(limit)) +} + +func (f formDo) Offset(offset int) *formDo { + return f.withDO(f.DO.Offset(offset)) +} + +func (f formDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *formDo { + return f.withDO(f.DO.Scopes(funcs...)) +} + +func (f formDo) Unscoped() *formDo { + return f.withDO(f.DO.Unscoped()) +} + +func (f formDo) Create(values ...*model.Form) error { + if len(values) == 0 { + return nil + } + return f.DO.Create(values) +} + +func (f formDo) CreateInBatches(values []*model.Form, batchSize int) error { + return f.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (f formDo) Save(values ...*model.Form) error { + if len(values) == 0 { + return nil + } + return f.DO.Save(values) +} + +func (f formDo) First() (*model.Form, error) { + if result, err := f.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Form), nil + } +} + +func (f formDo) Take() (*model.Form, error) { + if result, err := f.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Form), nil + } +} + +func (f formDo) Last() (*model.Form, error) { + if result, err := f.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Form), nil + } +} + +func (f formDo) Find() ([]*model.Form, error) { + result, err := f.DO.Find() + return result.([]*model.Form), err +} + +func (f formDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Form, err error) { + buf := make([]*model.Form, 0, batchSize) + err = f.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (f formDo) FindInBatches(result *[]*model.Form, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return f.DO.FindInBatches(result, batchSize, fc) +} + +func (f formDo) Attrs(attrs ...field.AssignExpr) *formDo { + return f.withDO(f.DO.Attrs(attrs...)) +} + +func (f formDo) Assign(attrs ...field.AssignExpr) *formDo { + return f.withDO(f.DO.Assign(attrs...)) +} + +func (f formDo) Joins(fields ...field.RelationField) *formDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Joins(_f)) + } + return &f +} + +func (f formDo) Preload(fields ...field.RelationField) *formDo { + for _, _f := range fields { + f = *f.withDO(f.DO.Preload(_f)) + } + return &f +} + +func (f formDo) FirstOrInit() (*model.Form, error) { + if result, err := f.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Form), nil + } +} + +func (f formDo) FirstOrCreate() (*model.Form, error) { + if result, err := f.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Form), nil + } +} + +func (f formDo) FindByPage(offset int, limit int) (result []*model.Form, count int64, err error) { + result, err = f.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = f.Offset(-1).Limit(-1).Count() + return +} + +func (f formDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = f.Count() + if err != nil { + return + } + + err = f.Offset(offset).Limit(limit).Scan(result) + return +} + +func (f formDo) Scan(result interface{}) (err error) { + return f.DO.Scan(result) +} + +func (f formDo) Delete(models ...*model.Form) (result gen.ResultInfo, err error) { + return f.DO.Delete(models) +} + +func (f *formDo) withDO(do gen.Dao) *formDo { + f.DO = *do.(*gen.DO) + return f +} diff --git a/internal/repository/dao/game_action.gen.go b/internal/repository/dao/game_action.gen.go new file mode 100644 index 0000000..f0b9349 --- /dev/null +++ b/internal/repository/dao/game_action.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newGameAction(db *gorm.DB, opts ...gen.DOOption) gameAction { + _gameAction := gameAction{} + + _gameAction.gameActionDo.UseDB(db, opts...) + _gameAction.gameActionDo.UseModel(&model.GameAction{}) + + tableName := _gameAction.gameActionDo.TableName() + _gameAction.ALL = field.NewAsterisk(tableName) + _gameAction.ID = field.NewInt64(tableName, "id") + _gameAction.ProjectID = field.NewInt64(tableName, "project_id") + _gameAction.GameID = field.NewInt64(tableName, "game_id") + _gameAction.UserID = field.NewInt64(tableName, "user_id") + _gameAction.LinkID = field.NewInt64(tableName, "link_id") + _gameAction.Type = field.NewInt32(tableName, "type") + _gameAction.ActionTime = field.NewInt64(tableName, "action_time") + _gameAction.Dimension = field.NewString(tableName, "dimension") + + _gameAction.fillFieldMap() + + return _gameAction +} + +type gameAction struct { + gameActionDo gameActionDo + + ALL field.Asterisk + ID field.Int64 + ProjectID field.Int64 // 项目id + GameID field.Int64 // 游戏id + UserID field.Int64 // 用户id + LinkID field.Int64 // 链接id + Type field.Int32 // 用户行为类型 + ActionTime field.Int64 // 用户行为时间 + Dimension field.String // 维度数据 + + fieldMap map[string]field.Expr +} + +func (g gameAction) Table(newTableName string) *gameAction { + g.gameActionDo.UseTable(newTableName) + return g.updateTableName(newTableName) +} + +func (g gameAction) As(alias string) *gameAction { + g.gameActionDo.DO = *(g.gameActionDo.As(alias).(*gen.DO)) + return g.updateTableName(alias) +} + +func (g *gameAction) updateTableName(table string) *gameAction { + g.ALL = field.NewAsterisk(table) + g.ID = field.NewInt64(table, "id") + g.ProjectID = field.NewInt64(table, "project_id") + g.GameID = field.NewInt64(table, "game_id") + g.UserID = field.NewInt64(table, "user_id") + g.LinkID = field.NewInt64(table, "link_id") + g.Type = field.NewInt32(table, "type") + g.ActionTime = field.NewInt64(table, "action_time") + g.Dimension = field.NewString(table, "dimension") + + g.fillFieldMap() + + return g +} + +func (g *gameAction) WithContext(ctx context.Context) *gameActionDo { + return g.gameActionDo.WithContext(ctx) +} + +func (g gameAction) TableName() string { return g.gameActionDo.TableName() } + +func (g gameAction) Alias() string { return g.gameActionDo.Alias() } + +func (g *gameAction) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := g.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (g *gameAction) fillFieldMap() { + g.fieldMap = make(map[string]field.Expr, 8) + g.fieldMap["id"] = g.ID + g.fieldMap["project_id"] = g.ProjectID + g.fieldMap["game_id"] = g.GameID + g.fieldMap["user_id"] = g.UserID + g.fieldMap["link_id"] = g.LinkID + g.fieldMap["type"] = g.Type + g.fieldMap["action_time"] = g.ActionTime + g.fieldMap["dimension"] = g.Dimension +} + +func (g gameAction) clone(db *gorm.DB) gameAction { + g.gameActionDo.ReplaceConnPool(db.Statement.ConnPool) + return g +} + +func (g gameAction) replaceDB(db *gorm.DB) gameAction { + g.gameActionDo.ReplaceDB(db) + return g +} + +type gameActionDo struct{ gen.DO } + +func (g gameActionDo) Debug() *gameActionDo { + return g.withDO(g.DO.Debug()) +} + +func (g gameActionDo) WithContext(ctx context.Context) *gameActionDo { + return g.withDO(g.DO.WithContext(ctx)) +} + +func (g gameActionDo) ReadDB() *gameActionDo { + return g.Clauses(dbresolver.Read) +} + +func (g gameActionDo) WriteDB() *gameActionDo { + return g.Clauses(dbresolver.Write) +} + +func (g gameActionDo) Session(config *gorm.Session) *gameActionDo { + return g.withDO(g.DO.Session(config)) +} + +func (g gameActionDo) Clauses(conds ...clause.Expression) *gameActionDo { + return g.withDO(g.DO.Clauses(conds...)) +} + +func (g gameActionDo) Returning(value interface{}, columns ...string) *gameActionDo { + return g.withDO(g.DO.Returning(value, columns...)) +} + +func (g gameActionDo) Not(conds ...gen.Condition) *gameActionDo { + return g.withDO(g.DO.Not(conds...)) +} + +func (g gameActionDo) Or(conds ...gen.Condition) *gameActionDo { + return g.withDO(g.DO.Or(conds...)) +} + +func (g gameActionDo) Select(conds ...field.Expr) *gameActionDo { + return g.withDO(g.DO.Select(conds...)) +} + +func (g gameActionDo) Where(conds ...gen.Condition) *gameActionDo { + return g.withDO(g.DO.Where(conds...)) +} + +func (g gameActionDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *gameActionDo { + return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (g gameActionDo) Order(conds ...field.Expr) *gameActionDo { + return g.withDO(g.DO.Order(conds...)) +} + +func (g gameActionDo) Distinct(cols ...field.Expr) *gameActionDo { + return g.withDO(g.DO.Distinct(cols...)) +} + +func (g gameActionDo) Omit(cols ...field.Expr) *gameActionDo { + return g.withDO(g.DO.Omit(cols...)) +} + +func (g gameActionDo) Join(table schema.Tabler, on ...field.Expr) *gameActionDo { + return g.withDO(g.DO.Join(table, on...)) +} + +func (g gameActionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *gameActionDo { + return g.withDO(g.DO.LeftJoin(table, on...)) +} + +func (g gameActionDo) RightJoin(table schema.Tabler, on ...field.Expr) *gameActionDo { + return g.withDO(g.DO.RightJoin(table, on...)) +} + +func (g gameActionDo) Group(cols ...field.Expr) *gameActionDo { + return g.withDO(g.DO.Group(cols...)) +} + +func (g gameActionDo) Having(conds ...gen.Condition) *gameActionDo { + return g.withDO(g.DO.Having(conds...)) +} + +func (g gameActionDo) Limit(limit int) *gameActionDo { + return g.withDO(g.DO.Limit(limit)) +} + +func (g gameActionDo) Offset(offset int) *gameActionDo { + return g.withDO(g.DO.Offset(offset)) +} + +func (g gameActionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *gameActionDo { + return g.withDO(g.DO.Scopes(funcs...)) +} + +func (g gameActionDo) Unscoped() *gameActionDo { + return g.withDO(g.DO.Unscoped()) +} + +func (g gameActionDo) Create(values ...*model.GameAction) error { + if len(values) == 0 { + return nil + } + return g.DO.Create(values) +} + +func (g gameActionDo) CreateInBatches(values []*model.GameAction, batchSize int) error { + return g.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (g gameActionDo) Save(values ...*model.GameAction) error { + if len(values) == 0 { + return nil + } + return g.DO.Save(values) +} + +func (g gameActionDo) First() (*model.GameAction, error) { + if result, err := g.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.GameAction), nil + } +} + +func (g gameActionDo) Take() (*model.GameAction, error) { + if result, err := g.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.GameAction), nil + } +} + +func (g gameActionDo) Last() (*model.GameAction, error) { + if result, err := g.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.GameAction), nil + } +} + +func (g gameActionDo) Find() ([]*model.GameAction, error) { + result, err := g.DO.Find() + return result.([]*model.GameAction), err +} + +func (g gameActionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.GameAction, err error) { + buf := make([]*model.GameAction, 0, batchSize) + err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (g gameActionDo) FindInBatches(result *[]*model.GameAction, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return g.DO.FindInBatches(result, batchSize, fc) +} + +func (g gameActionDo) Attrs(attrs ...field.AssignExpr) *gameActionDo { + return g.withDO(g.DO.Attrs(attrs...)) +} + +func (g gameActionDo) Assign(attrs ...field.AssignExpr) *gameActionDo { + return g.withDO(g.DO.Assign(attrs...)) +} + +func (g gameActionDo) Joins(fields ...field.RelationField) *gameActionDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Joins(_f)) + } + return &g +} + +func (g gameActionDo) Preload(fields ...field.RelationField) *gameActionDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Preload(_f)) + } + return &g +} + +func (g gameActionDo) FirstOrInit() (*model.GameAction, error) { + if result, err := g.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.GameAction), nil + } +} + +func (g gameActionDo) FirstOrCreate() (*model.GameAction, error) { + if result, err := g.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.GameAction), nil + } +} + +func (g gameActionDo) FindByPage(offset int, limit int) (result []*model.GameAction, count int64, err error) { + result, err = g.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = g.Offset(-1).Limit(-1).Count() + return +} + +func (g gameActionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = g.Count() + if err != nil { + return + } + + err = g.Offset(offset).Limit(limit).Scan(result) + return +} + +func (g gameActionDo) Scan(result interface{}) (err error) { + return g.DO.Scan(result) +} + +func (g gameActionDo) Delete(models ...*model.GameAction) (result gen.ResultInfo, err error) { + return g.DO.Delete(models) +} + +func (g *gameActionDo) withDO(do gen.Dao) *gameActionDo { + g.DO = *do.(*gen.DO) + return g +} diff --git a/internal/repository/dao/game_link.gen.go b/internal/repository/dao/game_link.gen.go new file mode 100644 index 0000000..1e3276a --- /dev/null +++ b/internal/repository/dao/game_link.gen.go @@ -0,0 +1,361 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newGameLink(db *gorm.DB, opts ...gen.DOOption) gameLink { + _gameLink := gameLink{} + + _gameLink.gameLinkDo.UseDB(db, opts...) + _gameLink.gameLinkDo.UseModel(&model.GameLink{}) + + tableName := _gameLink.gameLinkDo.TableName() + _gameLink.ALL = field.NewAsterisk(tableName) + _gameLink.ID = field.NewInt64(tableName, "id") + _gameLink.HashID = field.NewString(tableName, "hash_id") + _gameLink.CreatedAt = field.NewInt64(tableName, "created_at") + _gameLink.UpdatedAt = field.NewInt64(tableName, "updated_at") + _gameLink.IsDel = field.NewInt8(tableName, "is_del") + _gameLink.ProjectID = field.NewInt64(tableName, "project_id") + _gameLink.GameID = field.NewInt64(tableName, "game_id") + _gameLink.Title = field.NewString(tableName, "title") + _gameLink.IsDefault = field.NewInt8(tableName, "is_default") + + _gameLink.fillFieldMap() + + return _gameLink +} + +type gameLink struct { + gameLinkDo gameLinkDo + + ALL field.Asterisk + ID field.Int64 + HashID field.String + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 + ProjectID field.Int64 // 项目id + GameID field.Int64 // 游戏id + Title field.String // 标题 + IsDefault field.Int8 // 是否默认(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (g gameLink) Table(newTableName string) *gameLink { + g.gameLinkDo.UseTable(newTableName) + return g.updateTableName(newTableName) +} + +func (g gameLink) As(alias string) *gameLink { + g.gameLinkDo.DO = *(g.gameLinkDo.As(alias).(*gen.DO)) + return g.updateTableName(alias) +} + +func (g *gameLink) updateTableName(table string) *gameLink { + g.ALL = field.NewAsterisk(table) + g.ID = field.NewInt64(table, "id") + g.HashID = field.NewString(table, "hash_id") + g.CreatedAt = field.NewInt64(table, "created_at") + g.UpdatedAt = field.NewInt64(table, "updated_at") + g.IsDel = field.NewInt8(table, "is_del") + g.ProjectID = field.NewInt64(table, "project_id") + g.GameID = field.NewInt64(table, "game_id") + g.Title = field.NewString(table, "title") + g.IsDefault = field.NewInt8(table, "is_default") + + g.fillFieldMap() + + return g +} + +func (g *gameLink) WithContext(ctx context.Context) *gameLinkDo { return g.gameLinkDo.WithContext(ctx) } + +func (g gameLink) TableName() string { return g.gameLinkDo.TableName() } + +func (g gameLink) Alias() string { return g.gameLinkDo.Alias() } + +func (g *gameLink) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := g.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (g *gameLink) fillFieldMap() { + g.fieldMap = make(map[string]field.Expr, 9) + g.fieldMap["id"] = g.ID + g.fieldMap["hash_id"] = g.HashID + g.fieldMap["created_at"] = g.CreatedAt + g.fieldMap["updated_at"] = g.UpdatedAt + g.fieldMap["is_del"] = g.IsDel + g.fieldMap["project_id"] = g.ProjectID + g.fieldMap["game_id"] = g.GameID + g.fieldMap["title"] = g.Title + g.fieldMap["is_default"] = g.IsDefault +} + +func (g gameLink) clone(db *gorm.DB) gameLink { + g.gameLinkDo.ReplaceConnPool(db.Statement.ConnPool) + return g +} + +func (g gameLink) replaceDB(db *gorm.DB) gameLink { + g.gameLinkDo.ReplaceDB(db) + return g +} + +type gameLinkDo struct{ gen.DO } + +func (g gameLinkDo) Debug() *gameLinkDo { + return g.withDO(g.DO.Debug()) +} + +func (g gameLinkDo) WithContext(ctx context.Context) *gameLinkDo { + return g.withDO(g.DO.WithContext(ctx)) +} + +func (g gameLinkDo) ReadDB() *gameLinkDo { + return g.Clauses(dbresolver.Read) +} + +func (g gameLinkDo) WriteDB() *gameLinkDo { + return g.Clauses(dbresolver.Write) +} + +func (g gameLinkDo) Session(config *gorm.Session) *gameLinkDo { + return g.withDO(g.DO.Session(config)) +} + +func (g gameLinkDo) Clauses(conds ...clause.Expression) *gameLinkDo { + return g.withDO(g.DO.Clauses(conds...)) +} + +func (g gameLinkDo) Returning(value interface{}, columns ...string) *gameLinkDo { + return g.withDO(g.DO.Returning(value, columns...)) +} + +func (g gameLinkDo) Not(conds ...gen.Condition) *gameLinkDo { + return g.withDO(g.DO.Not(conds...)) +} + +func (g gameLinkDo) Or(conds ...gen.Condition) *gameLinkDo { + return g.withDO(g.DO.Or(conds...)) +} + +func (g gameLinkDo) Select(conds ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.Select(conds...)) +} + +func (g gameLinkDo) Where(conds ...gen.Condition) *gameLinkDo { + return g.withDO(g.DO.Where(conds...)) +} + +func (g gameLinkDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *gameLinkDo { + return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (g gameLinkDo) Order(conds ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.Order(conds...)) +} + +func (g gameLinkDo) Distinct(cols ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.Distinct(cols...)) +} + +func (g gameLinkDo) Omit(cols ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.Omit(cols...)) +} + +func (g gameLinkDo) Join(table schema.Tabler, on ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.Join(table, on...)) +} + +func (g gameLinkDo) LeftJoin(table schema.Tabler, on ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.LeftJoin(table, on...)) +} + +func (g gameLinkDo) RightJoin(table schema.Tabler, on ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.RightJoin(table, on...)) +} + +func (g gameLinkDo) Group(cols ...field.Expr) *gameLinkDo { + return g.withDO(g.DO.Group(cols...)) +} + +func (g gameLinkDo) Having(conds ...gen.Condition) *gameLinkDo { + return g.withDO(g.DO.Having(conds...)) +} + +func (g gameLinkDo) Limit(limit int) *gameLinkDo { + return g.withDO(g.DO.Limit(limit)) +} + +func (g gameLinkDo) Offset(offset int) *gameLinkDo { + return g.withDO(g.DO.Offset(offset)) +} + +func (g gameLinkDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *gameLinkDo { + return g.withDO(g.DO.Scopes(funcs...)) +} + +func (g gameLinkDo) Unscoped() *gameLinkDo { + return g.withDO(g.DO.Unscoped()) +} + +func (g gameLinkDo) Create(values ...*model.GameLink) error { + if len(values) == 0 { + return nil + } + return g.DO.Create(values) +} + +func (g gameLinkDo) CreateInBatches(values []*model.GameLink, batchSize int) error { + return g.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (g gameLinkDo) Save(values ...*model.GameLink) error { + if len(values) == 0 { + return nil + } + return g.DO.Save(values) +} + +func (g gameLinkDo) First() (*model.GameLink, error) { + if result, err := g.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.GameLink), nil + } +} + +func (g gameLinkDo) Take() (*model.GameLink, error) { + if result, err := g.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.GameLink), nil + } +} + +func (g gameLinkDo) Last() (*model.GameLink, error) { + if result, err := g.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.GameLink), nil + } +} + +func (g gameLinkDo) Find() ([]*model.GameLink, error) { + result, err := g.DO.Find() + return result.([]*model.GameLink), err +} + +func (g gameLinkDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.GameLink, err error) { + buf := make([]*model.GameLink, 0, batchSize) + err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (g gameLinkDo) FindInBatches(result *[]*model.GameLink, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return g.DO.FindInBatches(result, batchSize, fc) +} + +func (g gameLinkDo) Attrs(attrs ...field.AssignExpr) *gameLinkDo { + return g.withDO(g.DO.Attrs(attrs...)) +} + +func (g gameLinkDo) Assign(attrs ...field.AssignExpr) *gameLinkDo { + return g.withDO(g.DO.Assign(attrs...)) +} + +func (g gameLinkDo) Joins(fields ...field.RelationField) *gameLinkDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Joins(_f)) + } + return &g +} + +func (g gameLinkDo) Preload(fields ...field.RelationField) *gameLinkDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Preload(_f)) + } + return &g +} + +func (g gameLinkDo) FirstOrInit() (*model.GameLink, error) { + if result, err := g.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.GameLink), nil + } +} + +func (g gameLinkDo) FirstOrCreate() (*model.GameLink, error) { + if result, err := g.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.GameLink), nil + } +} + +func (g gameLinkDo) FindByPage(offset int, limit int) (result []*model.GameLink, count int64, err error) { + result, err = g.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = g.Offset(-1).Limit(-1).Count() + return +} + +func (g gameLinkDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = g.Count() + if err != nil { + return + } + + err = g.Offset(offset).Limit(limit).Scan(result) + return +} + +func (g gameLinkDo) Scan(result interface{}) (err error) { + return g.DO.Scan(result) +} + +func (g gameLinkDo) Delete(models ...*model.GameLink) (result gen.ResultInfo, err error) { + return g.DO.Delete(models) +} + +func (g *gameLinkDo) withDO(do gen.Dao) *gameLinkDo { + g.DO = *do.(*gen.DO) + return g +} diff --git a/internal/repository/dao/game_total.gen.go b/internal/repository/dao/game_total.gen.go new file mode 100644 index 0000000..0f9424c --- /dev/null +++ b/internal/repository/dao/game_total.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newGameTotal(db *gorm.DB, opts ...gen.DOOption) gameTotal { + _gameTotal := gameTotal{} + + _gameTotal.gameTotalDo.UseDB(db, opts...) + _gameTotal.gameTotalDo.UseModel(&model.GameTotal{}) + + tableName := _gameTotal.gameTotalDo.TableName() + _gameTotal.ALL = field.NewAsterisk(tableName) + _gameTotal.ID = field.NewInt64(tableName, "id") + _gameTotal.CreatedAt = field.NewInt64(tableName, "created_at") + _gameTotal.UpdatedAt = field.NewInt64(tableName, "updated_at") + _gameTotal.ProjectID = field.NewInt64(tableName, "project_id") + _gameTotal.GameID = field.NewInt64(tableName, "game_id") + _gameTotal.LinkID = field.NewInt64(tableName, "link_id") + _gameTotal.Pv = field.NewInt64(tableName, "pv") + _gameTotal.Uv = field.NewInt64(tableName, "uv") + _gameTotal.Psec = field.NewInt64(tableName, "psec") + + _gameTotal.fillFieldMap() + + return _gameTotal +} + +type gameTotal struct { + gameTotalDo gameTotalDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id + GameID field.Int64 // 游戏id + LinkID field.Int64 // 链接id + Pv field.Int64 + Uv field.Int64 + Psec field.Int64 + + fieldMap map[string]field.Expr +} + +func (g gameTotal) Table(newTableName string) *gameTotal { + g.gameTotalDo.UseTable(newTableName) + return g.updateTableName(newTableName) +} + +func (g gameTotal) As(alias string) *gameTotal { + g.gameTotalDo.DO = *(g.gameTotalDo.As(alias).(*gen.DO)) + return g.updateTableName(alias) +} + +func (g *gameTotal) updateTableName(table string) *gameTotal { + g.ALL = field.NewAsterisk(table) + g.ID = field.NewInt64(table, "id") + g.CreatedAt = field.NewInt64(table, "created_at") + g.UpdatedAt = field.NewInt64(table, "updated_at") + g.ProjectID = field.NewInt64(table, "project_id") + g.GameID = field.NewInt64(table, "game_id") + g.LinkID = field.NewInt64(table, "link_id") + g.Pv = field.NewInt64(table, "pv") + g.Uv = field.NewInt64(table, "uv") + g.Psec = field.NewInt64(table, "psec") + + g.fillFieldMap() + + return g +} + +func (g *gameTotal) WithContext(ctx context.Context) *gameTotalDo { + return g.gameTotalDo.WithContext(ctx) +} + +func (g gameTotal) TableName() string { return g.gameTotalDo.TableName() } + +func (g gameTotal) Alias() string { return g.gameTotalDo.Alias() } + +func (g *gameTotal) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := g.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (g *gameTotal) fillFieldMap() { + g.fieldMap = make(map[string]field.Expr, 9) + g.fieldMap["id"] = g.ID + g.fieldMap["created_at"] = g.CreatedAt + g.fieldMap["updated_at"] = g.UpdatedAt + g.fieldMap["project_id"] = g.ProjectID + g.fieldMap["game_id"] = g.GameID + g.fieldMap["link_id"] = g.LinkID + g.fieldMap["pv"] = g.Pv + g.fieldMap["uv"] = g.Uv + g.fieldMap["psec"] = g.Psec +} + +func (g gameTotal) clone(db *gorm.DB) gameTotal { + g.gameTotalDo.ReplaceConnPool(db.Statement.ConnPool) + return g +} + +func (g gameTotal) replaceDB(db *gorm.DB) gameTotal { + g.gameTotalDo.ReplaceDB(db) + return g +} + +type gameTotalDo struct{ gen.DO } + +func (g gameTotalDo) Debug() *gameTotalDo { + return g.withDO(g.DO.Debug()) +} + +func (g gameTotalDo) WithContext(ctx context.Context) *gameTotalDo { + return g.withDO(g.DO.WithContext(ctx)) +} + +func (g gameTotalDo) ReadDB() *gameTotalDo { + return g.Clauses(dbresolver.Read) +} + +func (g gameTotalDo) WriteDB() *gameTotalDo { + return g.Clauses(dbresolver.Write) +} + +func (g gameTotalDo) Session(config *gorm.Session) *gameTotalDo { + return g.withDO(g.DO.Session(config)) +} + +func (g gameTotalDo) Clauses(conds ...clause.Expression) *gameTotalDo { + return g.withDO(g.DO.Clauses(conds...)) +} + +func (g gameTotalDo) Returning(value interface{}, columns ...string) *gameTotalDo { + return g.withDO(g.DO.Returning(value, columns...)) +} + +func (g gameTotalDo) Not(conds ...gen.Condition) *gameTotalDo { + return g.withDO(g.DO.Not(conds...)) +} + +func (g gameTotalDo) Or(conds ...gen.Condition) *gameTotalDo { + return g.withDO(g.DO.Or(conds...)) +} + +func (g gameTotalDo) Select(conds ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.Select(conds...)) +} + +func (g gameTotalDo) Where(conds ...gen.Condition) *gameTotalDo { + return g.withDO(g.DO.Where(conds...)) +} + +func (g gameTotalDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *gameTotalDo { + return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (g gameTotalDo) Order(conds ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.Order(conds...)) +} + +func (g gameTotalDo) Distinct(cols ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.Distinct(cols...)) +} + +func (g gameTotalDo) Omit(cols ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.Omit(cols...)) +} + +func (g gameTotalDo) Join(table schema.Tabler, on ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.Join(table, on...)) +} + +func (g gameTotalDo) LeftJoin(table schema.Tabler, on ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.LeftJoin(table, on...)) +} + +func (g gameTotalDo) RightJoin(table schema.Tabler, on ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.RightJoin(table, on...)) +} + +func (g gameTotalDo) Group(cols ...field.Expr) *gameTotalDo { + return g.withDO(g.DO.Group(cols...)) +} + +func (g gameTotalDo) Having(conds ...gen.Condition) *gameTotalDo { + return g.withDO(g.DO.Having(conds...)) +} + +func (g gameTotalDo) Limit(limit int) *gameTotalDo { + return g.withDO(g.DO.Limit(limit)) +} + +func (g gameTotalDo) Offset(offset int) *gameTotalDo { + return g.withDO(g.DO.Offset(offset)) +} + +func (g gameTotalDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *gameTotalDo { + return g.withDO(g.DO.Scopes(funcs...)) +} + +func (g gameTotalDo) Unscoped() *gameTotalDo { + return g.withDO(g.DO.Unscoped()) +} + +func (g gameTotalDo) Create(values ...*model.GameTotal) error { + if len(values) == 0 { + return nil + } + return g.DO.Create(values) +} + +func (g gameTotalDo) CreateInBatches(values []*model.GameTotal, batchSize int) error { + return g.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (g gameTotalDo) Save(values ...*model.GameTotal) error { + if len(values) == 0 { + return nil + } + return g.DO.Save(values) +} + +func (g gameTotalDo) First() (*model.GameTotal, error) { + if result, err := g.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.GameTotal), nil + } +} + +func (g gameTotalDo) Take() (*model.GameTotal, error) { + if result, err := g.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.GameTotal), nil + } +} + +func (g gameTotalDo) Last() (*model.GameTotal, error) { + if result, err := g.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.GameTotal), nil + } +} + +func (g gameTotalDo) Find() ([]*model.GameTotal, error) { + result, err := g.DO.Find() + return result.([]*model.GameTotal), err +} + +func (g gameTotalDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.GameTotal, err error) { + buf := make([]*model.GameTotal, 0, batchSize) + err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (g gameTotalDo) FindInBatches(result *[]*model.GameTotal, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return g.DO.FindInBatches(result, batchSize, fc) +} + +func (g gameTotalDo) Attrs(attrs ...field.AssignExpr) *gameTotalDo { + return g.withDO(g.DO.Attrs(attrs...)) +} + +func (g gameTotalDo) Assign(attrs ...field.AssignExpr) *gameTotalDo { + return g.withDO(g.DO.Assign(attrs...)) +} + +func (g gameTotalDo) Joins(fields ...field.RelationField) *gameTotalDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Joins(_f)) + } + return &g +} + +func (g gameTotalDo) Preload(fields ...field.RelationField) *gameTotalDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Preload(_f)) + } + return &g +} + +func (g gameTotalDo) FirstOrInit() (*model.GameTotal, error) { + if result, err := g.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.GameTotal), nil + } +} + +func (g gameTotalDo) FirstOrCreate() (*model.GameTotal, error) { + if result, err := g.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.GameTotal), nil + } +} + +func (g gameTotalDo) FindByPage(offset int, limit int) (result []*model.GameTotal, count int64, err error) { + result, err = g.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = g.Offset(-1).Limit(-1).Count() + return +} + +func (g gameTotalDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = g.Count() + if err != nil { + return + } + + err = g.Offset(offset).Limit(limit).Scan(result) + return +} + +func (g gameTotalDo) Scan(result interface{}) (err error) { + return g.DO.Scan(result) +} + +func (g gameTotalDo) Delete(models ...*model.GameTotal) (result gen.ResultInfo, err error) { + return g.DO.Delete(models) +} + +func (g *gameTotalDo) withDO(do gen.Dao) *gameTotalDo { + g.DO = *do.(*gen.DO) + return g +} diff --git a/internal/repository/dao/game_total_date.gen.go b/internal/repository/dao/game_total_date.gen.go new file mode 100644 index 0000000..b9c84c4 --- /dev/null +++ b/internal/repository/dao/game_total_date.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newGameTotalDate(db *gorm.DB, opts ...gen.DOOption) gameTotalDate { + _gameTotalDate := gameTotalDate{} + + _gameTotalDate.gameTotalDateDo.UseDB(db, opts...) + _gameTotalDate.gameTotalDateDo.UseModel(&model.GameTotalDate{}) + + tableName := _gameTotalDate.gameTotalDateDo.TableName() + _gameTotalDate.ALL = field.NewAsterisk(tableName) + _gameTotalDate.ID = field.NewInt64(tableName, "id") + _gameTotalDate.CreatedAt = field.NewInt64(tableName, "created_at") + _gameTotalDate.UpdatedAt = field.NewInt64(tableName, "updated_at") + _gameTotalDate.ProjectID = field.NewInt64(tableName, "project_id") + _gameTotalDate.GameID = field.NewInt64(tableName, "game_id") + _gameTotalDate.LinkID = field.NewInt64(tableName, "link_id") + _gameTotalDate.Ymd = field.NewString(tableName, "ymd") + _gameTotalDate.Pv = field.NewInt64(tableName, "pv") + _gameTotalDate.Uv = field.NewInt64(tableName, "uv") + _gameTotalDate.Psec = field.NewInt64(tableName, "psec") + + _gameTotalDate.fillFieldMap() + + return _gameTotalDate +} + +type gameTotalDate struct { + gameTotalDateDo gameTotalDateDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id + GameID field.Int64 // 游戏id + LinkID field.Int64 // 链接id + Ymd field.String // 日期 + Pv field.Int64 + Uv field.Int64 + Psec field.Int64 + + fieldMap map[string]field.Expr +} + +func (g gameTotalDate) Table(newTableName string) *gameTotalDate { + g.gameTotalDateDo.UseTable(newTableName) + return g.updateTableName(newTableName) +} + +func (g gameTotalDate) As(alias string) *gameTotalDate { + g.gameTotalDateDo.DO = *(g.gameTotalDateDo.As(alias).(*gen.DO)) + return g.updateTableName(alias) +} + +func (g *gameTotalDate) updateTableName(table string) *gameTotalDate { + g.ALL = field.NewAsterisk(table) + g.ID = field.NewInt64(table, "id") + g.CreatedAt = field.NewInt64(table, "created_at") + g.UpdatedAt = field.NewInt64(table, "updated_at") + g.ProjectID = field.NewInt64(table, "project_id") + g.GameID = field.NewInt64(table, "game_id") + g.LinkID = field.NewInt64(table, "link_id") + g.Ymd = field.NewString(table, "ymd") + g.Pv = field.NewInt64(table, "pv") + g.Uv = field.NewInt64(table, "uv") + g.Psec = field.NewInt64(table, "psec") + + g.fillFieldMap() + + return g +} + +func (g *gameTotalDate) WithContext(ctx context.Context) *gameTotalDateDo { + return g.gameTotalDateDo.WithContext(ctx) +} + +func (g gameTotalDate) TableName() string { return g.gameTotalDateDo.TableName() } + +func (g gameTotalDate) Alias() string { return g.gameTotalDateDo.Alias() } + +func (g *gameTotalDate) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := g.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (g *gameTotalDate) fillFieldMap() { + g.fieldMap = make(map[string]field.Expr, 10) + g.fieldMap["id"] = g.ID + g.fieldMap["created_at"] = g.CreatedAt + g.fieldMap["updated_at"] = g.UpdatedAt + g.fieldMap["project_id"] = g.ProjectID + g.fieldMap["game_id"] = g.GameID + g.fieldMap["link_id"] = g.LinkID + g.fieldMap["ymd"] = g.Ymd + g.fieldMap["pv"] = g.Pv + g.fieldMap["uv"] = g.Uv + g.fieldMap["psec"] = g.Psec +} + +func (g gameTotalDate) clone(db *gorm.DB) gameTotalDate { + g.gameTotalDateDo.ReplaceConnPool(db.Statement.ConnPool) + return g +} + +func (g gameTotalDate) replaceDB(db *gorm.DB) gameTotalDate { + g.gameTotalDateDo.ReplaceDB(db) + return g +} + +type gameTotalDateDo struct{ gen.DO } + +func (g gameTotalDateDo) Debug() *gameTotalDateDo { + return g.withDO(g.DO.Debug()) +} + +func (g gameTotalDateDo) WithContext(ctx context.Context) *gameTotalDateDo { + return g.withDO(g.DO.WithContext(ctx)) +} + +func (g gameTotalDateDo) ReadDB() *gameTotalDateDo { + return g.Clauses(dbresolver.Read) +} + +func (g gameTotalDateDo) WriteDB() *gameTotalDateDo { + return g.Clauses(dbresolver.Write) +} + +func (g gameTotalDateDo) Session(config *gorm.Session) *gameTotalDateDo { + return g.withDO(g.DO.Session(config)) +} + +func (g gameTotalDateDo) Clauses(conds ...clause.Expression) *gameTotalDateDo { + return g.withDO(g.DO.Clauses(conds...)) +} + +func (g gameTotalDateDo) Returning(value interface{}, columns ...string) *gameTotalDateDo { + return g.withDO(g.DO.Returning(value, columns...)) +} + +func (g gameTotalDateDo) Not(conds ...gen.Condition) *gameTotalDateDo { + return g.withDO(g.DO.Not(conds...)) +} + +func (g gameTotalDateDo) Or(conds ...gen.Condition) *gameTotalDateDo { + return g.withDO(g.DO.Or(conds...)) +} + +func (g gameTotalDateDo) Select(conds ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.Select(conds...)) +} + +func (g gameTotalDateDo) Where(conds ...gen.Condition) *gameTotalDateDo { + return g.withDO(g.DO.Where(conds...)) +} + +func (g gameTotalDateDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *gameTotalDateDo { + return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (g gameTotalDateDo) Order(conds ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.Order(conds...)) +} + +func (g gameTotalDateDo) Distinct(cols ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.Distinct(cols...)) +} + +func (g gameTotalDateDo) Omit(cols ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.Omit(cols...)) +} + +func (g gameTotalDateDo) Join(table schema.Tabler, on ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.Join(table, on...)) +} + +func (g gameTotalDateDo) LeftJoin(table schema.Tabler, on ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.LeftJoin(table, on...)) +} + +func (g gameTotalDateDo) RightJoin(table schema.Tabler, on ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.RightJoin(table, on...)) +} + +func (g gameTotalDateDo) Group(cols ...field.Expr) *gameTotalDateDo { + return g.withDO(g.DO.Group(cols...)) +} + +func (g gameTotalDateDo) Having(conds ...gen.Condition) *gameTotalDateDo { + return g.withDO(g.DO.Having(conds...)) +} + +func (g gameTotalDateDo) Limit(limit int) *gameTotalDateDo { + return g.withDO(g.DO.Limit(limit)) +} + +func (g gameTotalDateDo) Offset(offset int) *gameTotalDateDo { + return g.withDO(g.DO.Offset(offset)) +} + +func (g gameTotalDateDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *gameTotalDateDo { + return g.withDO(g.DO.Scopes(funcs...)) +} + +func (g gameTotalDateDo) Unscoped() *gameTotalDateDo { + return g.withDO(g.DO.Unscoped()) +} + +func (g gameTotalDateDo) Create(values ...*model.GameTotalDate) error { + if len(values) == 0 { + return nil + } + return g.DO.Create(values) +} + +func (g gameTotalDateDo) CreateInBatches(values []*model.GameTotalDate, batchSize int) error { + return g.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (g gameTotalDateDo) Save(values ...*model.GameTotalDate) error { + if len(values) == 0 { + return nil + } + return g.DO.Save(values) +} + +func (g gameTotalDateDo) First() (*model.GameTotalDate, error) { + if result, err := g.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.GameTotalDate), nil + } +} + +func (g gameTotalDateDo) Take() (*model.GameTotalDate, error) { + if result, err := g.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.GameTotalDate), nil + } +} + +func (g gameTotalDateDo) Last() (*model.GameTotalDate, error) { + if result, err := g.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.GameTotalDate), nil + } +} + +func (g gameTotalDateDo) Find() ([]*model.GameTotalDate, error) { + result, err := g.DO.Find() + return result.([]*model.GameTotalDate), err +} + +func (g gameTotalDateDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.GameTotalDate, err error) { + buf := make([]*model.GameTotalDate, 0, batchSize) + err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (g gameTotalDateDo) FindInBatches(result *[]*model.GameTotalDate, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return g.DO.FindInBatches(result, batchSize, fc) +} + +func (g gameTotalDateDo) Attrs(attrs ...field.AssignExpr) *gameTotalDateDo { + return g.withDO(g.DO.Attrs(attrs...)) +} + +func (g gameTotalDateDo) Assign(attrs ...field.AssignExpr) *gameTotalDateDo { + return g.withDO(g.DO.Assign(attrs...)) +} + +func (g gameTotalDateDo) Joins(fields ...field.RelationField) *gameTotalDateDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Joins(_f)) + } + return &g +} + +func (g gameTotalDateDo) Preload(fields ...field.RelationField) *gameTotalDateDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Preload(_f)) + } + return &g +} + +func (g gameTotalDateDo) FirstOrInit() (*model.GameTotalDate, error) { + if result, err := g.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.GameTotalDate), nil + } +} + +func (g gameTotalDateDo) FirstOrCreate() (*model.GameTotalDate, error) { + if result, err := g.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.GameTotalDate), nil + } +} + +func (g gameTotalDateDo) FindByPage(offset int, limit int) (result []*model.GameTotalDate, count int64, err error) { + result, err = g.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = g.Offset(-1).Limit(-1).Count() + return +} + +func (g gameTotalDateDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = g.Count() + if err != nil { + return + } + + err = g.Offset(offset).Limit(limit).Scan(result) + return +} + +func (g gameTotalDateDo) Scan(result interface{}) (err error) { + return g.DO.Scan(result) +} + +func (g gameTotalDateDo) Delete(models ...*model.GameTotalDate) (result gen.ResultInfo, err error) { + return g.DO.Delete(models) +} + +func (g *gameTotalDateDo) withDO(do gen.Dao) *gameTotalDateDo { + g.DO = *do.(*gen.DO) + return g +} diff --git a/internal/repository/dao/game_user.gen.go b/internal/repository/dao/game_user.gen.go new file mode 100644 index 0000000..cc04a87 --- /dev/null +++ b/internal/repository/dao/game_user.gen.go @@ -0,0 +1,373 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newGameUser(db *gorm.DB, opts ...gen.DOOption) gameUser { + _gameUser := gameUser{} + + _gameUser.gameUserDo.UseDB(db, opts...) + _gameUser.gameUserDo.UseModel(&model.GameUser{}) + + tableName := _gameUser.gameUserDo.TableName() + _gameUser.ALL = field.NewAsterisk(tableName) + _gameUser.ID = field.NewInt64(tableName, "id") + _gameUser.HashID = field.NewString(tableName, "hash_id") + _gameUser.CreatedAt = field.NewInt64(tableName, "created_at") + _gameUser.UpdatedAt = field.NewInt64(tableName, "updated_at") + _gameUser.ProjectID = field.NewInt64(tableName, "project_id") + _gameUser.GameID = field.NewInt64(tableName, "game_id") + _gameUser.IP = field.NewString(tableName, "ip") + _gameUser.Os = field.NewString(tableName, "os") + _gameUser.Ver = field.NewString(tableName, "ver") + _gameUser.DModel = field.NewString(tableName, "d_model") + _gameUser.SubUserID = field.NewString(tableName, "sub_user_id") + _gameUser.IovdMark = field.NewString(tableName, "iovd_mark") + + _gameUser.fillFieldMap() + + return _gameUser +} + +type gameUser struct { + gameUserDo gameUserDo + + ALL field.Asterisk + ID field.Int64 + HashID field.String + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id + GameID field.Int64 // 游戏id + IP field.String + Os field.String + Ver field.String + DModel field.String + SubUserID field.String // 用户id + IovdMark field.String // App用户唯一标识 + + fieldMap map[string]field.Expr +} + +func (g gameUser) Table(newTableName string) *gameUser { + g.gameUserDo.UseTable(newTableName) + return g.updateTableName(newTableName) +} + +func (g gameUser) As(alias string) *gameUser { + g.gameUserDo.DO = *(g.gameUserDo.As(alias).(*gen.DO)) + return g.updateTableName(alias) +} + +func (g *gameUser) updateTableName(table string) *gameUser { + g.ALL = field.NewAsterisk(table) + g.ID = field.NewInt64(table, "id") + g.HashID = field.NewString(table, "hash_id") + g.CreatedAt = field.NewInt64(table, "created_at") + g.UpdatedAt = field.NewInt64(table, "updated_at") + g.ProjectID = field.NewInt64(table, "project_id") + g.GameID = field.NewInt64(table, "game_id") + g.IP = field.NewString(table, "ip") + g.Os = field.NewString(table, "os") + g.Ver = field.NewString(table, "ver") + g.DModel = field.NewString(table, "d_model") + g.SubUserID = field.NewString(table, "sub_user_id") + g.IovdMark = field.NewString(table, "iovd_mark") + + g.fillFieldMap() + + return g +} + +func (g *gameUser) WithContext(ctx context.Context) *gameUserDo { return g.gameUserDo.WithContext(ctx) } + +func (g gameUser) TableName() string { return g.gameUserDo.TableName() } + +func (g gameUser) Alias() string { return g.gameUserDo.Alias() } + +func (g *gameUser) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := g.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (g *gameUser) fillFieldMap() { + g.fieldMap = make(map[string]field.Expr, 12) + g.fieldMap["id"] = g.ID + g.fieldMap["hash_id"] = g.HashID + g.fieldMap["created_at"] = g.CreatedAt + g.fieldMap["updated_at"] = g.UpdatedAt + g.fieldMap["project_id"] = g.ProjectID + g.fieldMap["game_id"] = g.GameID + g.fieldMap["ip"] = g.IP + g.fieldMap["os"] = g.Os + g.fieldMap["ver"] = g.Ver + g.fieldMap["d_model"] = g.DModel + g.fieldMap["sub_user_id"] = g.SubUserID + g.fieldMap["iovd_mark"] = g.IovdMark +} + +func (g gameUser) clone(db *gorm.DB) gameUser { + g.gameUserDo.ReplaceConnPool(db.Statement.ConnPool) + return g +} + +func (g gameUser) replaceDB(db *gorm.DB) gameUser { + g.gameUserDo.ReplaceDB(db) + return g +} + +type gameUserDo struct{ gen.DO } + +func (g gameUserDo) Debug() *gameUserDo { + return g.withDO(g.DO.Debug()) +} + +func (g gameUserDo) WithContext(ctx context.Context) *gameUserDo { + return g.withDO(g.DO.WithContext(ctx)) +} + +func (g gameUserDo) ReadDB() *gameUserDo { + return g.Clauses(dbresolver.Read) +} + +func (g gameUserDo) WriteDB() *gameUserDo { + return g.Clauses(dbresolver.Write) +} + +func (g gameUserDo) Session(config *gorm.Session) *gameUserDo { + return g.withDO(g.DO.Session(config)) +} + +func (g gameUserDo) Clauses(conds ...clause.Expression) *gameUserDo { + return g.withDO(g.DO.Clauses(conds...)) +} + +func (g gameUserDo) Returning(value interface{}, columns ...string) *gameUserDo { + return g.withDO(g.DO.Returning(value, columns...)) +} + +func (g gameUserDo) Not(conds ...gen.Condition) *gameUserDo { + return g.withDO(g.DO.Not(conds...)) +} + +func (g gameUserDo) Or(conds ...gen.Condition) *gameUserDo { + return g.withDO(g.DO.Or(conds...)) +} + +func (g gameUserDo) Select(conds ...field.Expr) *gameUserDo { + return g.withDO(g.DO.Select(conds...)) +} + +func (g gameUserDo) Where(conds ...gen.Condition) *gameUserDo { + return g.withDO(g.DO.Where(conds...)) +} + +func (g gameUserDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *gameUserDo { + return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (g gameUserDo) Order(conds ...field.Expr) *gameUserDo { + return g.withDO(g.DO.Order(conds...)) +} + +func (g gameUserDo) Distinct(cols ...field.Expr) *gameUserDo { + return g.withDO(g.DO.Distinct(cols...)) +} + +func (g gameUserDo) Omit(cols ...field.Expr) *gameUserDo { + return g.withDO(g.DO.Omit(cols...)) +} + +func (g gameUserDo) Join(table schema.Tabler, on ...field.Expr) *gameUserDo { + return g.withDO(g.DO.Join(table, on...)) +} + +func (g gameUserDo) LeftJoin(table schema.Tabler, on ...field.Expr) *gameUserDo { + return g.withDO(g.DO.LeftJoin(table, on...)) +} + +func (g gameUserDo) RightJoin(table schema.Tabler, on ...field.Expr) *gameUserDo { + return g.withDO(g.DO.RightJoin(table, on...)) +} + +func (g gameUserDo) Group(cols ...field.Expr) *gameUserDo { + return g.withDO(g.DO.Group(cols...)) +} + +func (g gameUserDo) Having(conds ...gen.Condition) *gameUserDo { + return g.withDO(g.DO.Having(conds...)) +} + +func (g gameUserDo) Limit(limit int) *gameUserDo { + return g.withDO(g.DO.Limit(limit)) +} + +func (g gameUserDo) Offset(offset int) *gameUserDo { + return g.withDO(g.DO.Offset(offset)) +} + +func (g gameUserDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *gameUserDo { + return g.withDO(g.DO.Scopes(funcs...)) +} + +func (g gameUserDo) Unscoped() *gameUserDo { + return g.withDO(g.DO.Unscoped()) +} + +func (g gameUserDo) Create(values ...*model.GameUser) error { + if len(values) == 0 { + return nil + } + return g.DO.Create(values) +} + +func (g gameUserDo) CreateInBatches(values []*model.GameUser, batchSize int) error { + return g.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (g gameUserDo) Save(values ...*model.GameUser) error { + if len(values) == 0 { + return nil + } + return g.DO.Save(values) +} + +func (g gameUserDo) First() (*model.GameUser, error) { + if result, err := g.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.GameUser), nil + } +} + +func (g gameUserDo) Take() (*model.GameUser, error) { + if result, err := g.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.GameUser), nil + } +} + +func (g gameUserDo) Last() (*model.GameUser, error) { + if result, err := g.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.GameUser), nil + } +} + +func (g gameUserDo) Find() ([]*model.GameUser, error) { + result, err := g.DO.Find() + return result.([]*model.GameUser), err +} + +func (g gameUserDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.GameUser, err error) { + buf := make([]*model.GameUser, 0, batchSize) + err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (g gameUserDo) FindInBatches(result *[]*model.GameUser, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return g.DO.FindInBatches(result, batchSize, fc) +} + +func (g gameUserDo) Attrs(attrs ...field.AssignExpr) *gameUserDo { + return g.withDO(g.DO.Attrs(attrs...)) +} + +func (g gameUserDo) Assign(attrs ...field.AssignExpr) *gameUserDo { + return g.withDO(g.DO.Assign(attrs...)) +} + +func (g gameUserDo) Joins(fields ...field.RelationField) *gameUserDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Joins(_f)) + } + return &g +} + +func (g gameUserDo) Preload(fields ...field.RelationField) *gameUserDo { + for _, _f := range fields { + g = *g.withDO(g.DO.Preload(_f)) + } + return &g +} + +func (g gameUserDo) FirstOrInit() (*model.GameUser, error) { + if result, err := g.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.GameUser), nil + } +} + +func (g gameUserDo) FirstOrCreate() (*model.GameUser, error) { + if result, err := g.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.GameUser), nil + } +} + +func (g gameUserDo) FindByPage(offset int, limit int) (result []*model.GameUser, count int64, err error) { + result, err = g.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = g.Offset(-1).Limit(-1).Count() + return +} + +func (g gameUserDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = g.Count() + if err != nil { + return + } + + err = g.Offset(offset).Limit(limit).Scan(result) + return +} + +func (g gameUserDo) Scan(result interface{}) (err error) { + return g.DO.Scan(result) +} + +func (g gameUserDo) Delete(models ...*model.GameUser) (result gen.ResultInfo, err error) { + return g.DO.Delete(models) +} + +func (g *gameUserDo) withDO(do gen.Dao) *gameUserDo { + g.DO = *do.(*gen.DO) + return g +} diff --git a/internal/repository/dao/gen.go b/internal/repository/dao/gen.go new file mode 100644 index 0000000..347cee2 --- /dev/null +++ b/internal/repository/dao/gen.go @@ -0,0 +1,1671 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + "database/sql" + + "gorm.io/gorm" + + "gorm.io/gen" + + "gorm.io/plugin/dbresolver" +) + +var ( + Q = new(Query) + Company *company + CompanyMade *companyMade + CronLog *cronLog + ErrLog *errLog + ExportTask *exportTask + FissionArchiveTask *fissionArchiveTask + FissionBallot *fissionBallot + FissionBallotLog *fissionBallotLog + FissionBehavior *fissionBehavior + FissionBlind *fissionBlind + FissionBlindLog *fissionBlindLog + FissionCampaign *fissionCampaign + FissionCampaignBallot *fissionCampaignBallot + FissionCampaignBlind *fissionCampaignBlind + FissionCampaignCash *fissionCampaignCash + FissionCampaignChannel *fissionCampaignChannel + FissionCampaignChat *fissionCampaignChat + FissionCampaignChild *fissionCampaignChild + FissionCampaignChop *fissionCampaignChop + FissionCampaignCoin *fissionCampaignCoin + FissionCampaignCond *fissionCampaignCond + FissionCampaignConfig *fissionCampaignConfig + FissionCampaignDice *fissionCampaignDice + FissionCampaignEvent *fissionCampaignEvent + FissionCampaignFlip *fissionCampaignFlip + FissionCampaignGashapon *fissionCampaignGashapon + FissionCampaignGold *fissionCampaignGold + FissionCampaignGrid *fissionCampaignGrid + FissionCampaignGrow *fissionCampaignGrow + FissionCampaignGrowStep *fissionCampaignGrowStep + FissionCampaignKeep *fissionCampaignKeep + FissionCampaignKeepStep *fissionCampaignKeepStep + FissionCampaignLang *fissionCampaignLang + FissionCampaignLongImg *fissionCampaignLongImg + FissionCampaignLongImgZone *fissionCampaignLongImgZone + FissionCampaignPointsUse *fissionCampaignPointsUse + FissionCampaignPush *fissionCampaignPush + FissionCampaignQa *fissionCampaignQa + FissionCampaignQaOption *fissionCampaignQaOption + FissionCampaignQaQuestion *fissionCampaignQaQuestion + FissionCampaignQuiz *fissionCampaignQuiz + FissionCampaignQuizOption *fissionCampaignQuizOption + FissionCampaignReferral *fissionCampaignReferral + FissionCampaignReward *fissionCampaignReward + FissionCampaignRewardAdd *fissionCampaignRewardAdd + FissionCampaignRewardAddLog *fissionCampaignRewardAddLog + FissionCampaignRewardRule *fissionCampaignRewardRule + FissionCampaignSign *fissionCampaignSign + FissionCampaignSlot *fissionCampaignSlot + FissionCampaignStyle *fissionCampaignStyle + FissionCampaignTask *fissionCampaignTask + FissionCampaignTicket *fissionCampaignTicket + FissionCampaignUno *fissionCampaignUno + FissionCampaignUnoCard *fissionCampaignUnoCard + FissionCampaignUnoGroup *fissionCampaignUnoGroup + FissionCampaignV *fissionCampaignV + FissionCampaignVsSchedule *fissionCampaignVsSchedule + FissionCampaignVsTeam *fissionCampaignVsTeam + FissionCampaignWheel *fissionCampaignWheel + FissionCampaignWin *fissionCampaignWin + FissionCash *fissionCash + FissionCashRecord *fissionCashRecord + FissionChat *fissionChat + FissionChatMsg *fissionChatMsg + FissionChildUser *fissionChildUser + FissionChildUserRecord *fissionChildUserRecord + FissionChop *fissionChop + FissionChopHelp *fissionChopHelp + FissionChopReward *fissionChopReward + FissionClientReward *fissionClientReward + FissionCoin *fissionCoin + FissionCoinLog *fissionCoinLog + FissionCoinScene *fissionCoinScene + FissionConfig *fissionConfig + FissionCustomBtn *fissionCustomBtn + FissionDice *fissionDice + FissionDiceCollect *fissionDiceCollect + FissionDiceMap *fissionDiceMap + FissionDiceMapGroup *fissionDiceMapGroup + FissionDiceProp *fissionDiceProp + FissionDiceRecord *fissionDiceRecord + FissionDiceRun *fissionDiceRun + FissionFlip *fissionFlip + FissionFlipLog *fissionFlipLog + FissionGashapon *fissionGashapon + FissionGashaponLog *fissionGashaponLog + FissionGold *fissionGold + FissionGoldLog *fissionGoldLog + FissionGrid *fissionGrid + FissionGridLog *fissionGridLog + FissionGrow *fissionGrow + FissionGrowLife *fissionGrowLife + FissionGrowRecord *fissionGrowRecord + FissionKeep *fissionKeep + FissionKeepLog *fissionKeepLog + FissionLangModule *fissionLangModule + FissionNotify *fissionNotify + FissionNotifyResp *fissionNotifyResp + FissionNotifyTask *fissionNotifyTask + FissionPointDeduct *fissionPointDeduct + FissionPointsLog *fissionPointsLog + FissionPrizeWheel *fissionPrizeWheel + FissionPrizeWheelLog *fissionPrizeWheelLog + FissionQa *fissionQa + FissionQaLog *fissionQaLog + FissionQuiz *fissionQuiz + FissionQuizLog *fissionQuizLog + FissionReferral *fissionReferral + FissionRewardRecord *fissionRewardRecord + FissionRewardRecordForm *fissionRewardRecordForm + FissionSign *fissionSign + FissionSignDay *fissionSignDay + FissionSignLog *fissionSignLog + FissionSlot *fissionSlot + FissionSlotLog *fissionSlotLog + FissionTargetRecord *fissionTargetRecord + FissionTemp *fissionTemp + FissionTempGroup *fissionTempGroup + FissionTempGroupLang *fissionTempGroupLang + FissionTempImage *fissionTempImage + FissionTempLang *fissionTempLang + FissionTotal *fissionTotal + FissionTotalCycle *fissionTotalCycle + FissionUnlockReward *fissionUnlockReward + FissionUno *fissionUno + FissionUnoCollect *fissionUnoCollect + FissionUnoLog *fissionUnoLog + FissionUser *fissionUser + FissionUserActive *fissionUserActive + FissionUserAttr *fissionUserAttr + FissionUserAttrTotal *fissionUserAttrTotal + FissionUserCond *fissionUserCond + FissionUserCondRecord *fissionUserCondRecord + FissionUserCtlink *fissionUserCtlink + FissionUserDylink *fissionUserDylink + FissionUserEvent *fissionUserEvent + FissionUserJattr *fissionUserJattr + FissionUserLevel *fissionUserLevel + FissionUserLevelRelated *fissionUserLevelRelated + FissionUserPreCond *fissionUserPreCond + FissionUserStat *fissionUserStat + FissionUserTaskRecord *fissionUserTaskRecord + FissionUserTaskReward *fissionUserTaskReward + FissionUserTaskValid *fissionUserTaskValid + FissionV *fissionV + FissionVsLog *fissionVsLog + FissionVsVote *fissionVsVote + FissionVsVoteSettlement *fissionVsVoteSettlement + FissionWebUser *fissionWebUser + FissionWin *fissionWin + Form *form + GameAction *gameAction + GameLink *gameLink + GameTotal *gameTotal + GameTotalDate *gameTotalDate + GameUser *gameUser + Lang *lang + LangTextMark *langTextMark + LibraryQa *libraryQa + LibraryQaGroup *libraryQaGroup + LibraryQaOption *libraryQaOption + LvAPILog *lvAPILog + Material *material + ModuleStatisticsEventflow *moduleStatisticsEventflow + NotifyURL *notifyURL + OperateLog *operateLog + Project *project + ProjectAd *projectAd + ProjectSecret *projectSecret + ProjectUser *projectUser + ProjectUserCoin *projectUserCoin + ProjectUserCoinDeduct *projectUserCoinDeduct + ProjectUserCoinExpired *projectUserCoinExpired + ProjectUserCoinLog *projectUserCoinLog + ProjectUserCoinRecord *projectUserCoinRecord + ProjectUserCoinUse *projectUserCoinUse + ProjectUserInfoLog *projectUserInfoLog + RedeemMall *redeemMall + RedeemMallItem *redeemMallItem + RedeemMallItemTask *redeemMallItemTask + RedeemMallRecord *redeemMallRecord + RedeemMallRelate *redeemMallRelate + Register *register + RegisterAudit *registerAudit + Reward *reward + RewardLang *rewardLang + RewardPush *rewardPush + RewardPushLog *rewardPushLog + RewardPushTask *rewardPushTask + RewardRelated *rewardRelated + ServerWhitelist *serverWhitelist + SlowLog *slowLog + TCoin *tCoin + TCoinLang *tCoinLang + User *user + UserBehavior *userBehavior + UserProjectRelate *userProjectRelate +) + +func SetDefault(db *gorm.DB, opts ...gen.DOOption) { + *Q = *Use(db, opts...) + Company = &Q.Company + CompanyMade = &Q.CompanyMade + CronLog = &Q.CronLog + ErrLog = &Q.ErrLog + ExportTask = &Q.ExportTask + FissionArchiveTask = &Q.FissionArchiveTask + FissionBallot = &Q.FissionBallot + FissionBallotLog = &Q.FissionBallotLog + FissionBehavior = &Q.FissionBehavior + FissionBlind = &Q.FissionBlind + FissionBlindLog = &Q.FissionBlindLog + FissionCampaign = &Q.FissionCampaign + FissionCampaignBallot = &Q.FissionCampaignBallot + FissionCampaignBlind = &Q.FissionCampaignBlind + FissionCampaignCash = &Q.FissionCampaignCash + FissionCampaignChannel = &Q.FissionCampaignChannel + FissionCampaignChat = &Q.FissionCampaignChat + FissionCampaignChild = &Q.FissionCampaignChild + FissionCampaignChop = &Q.FissionCampaignChop + FissionCampaignCoin = &Q.FissionCampaignCoin + FissionCampaignCond = &Q.FissionCampaignCond + FissionCampaignConfig = &Q.FissionCampaignConfig + FissionCampaignDice = &Q.FissionCampaignDice + FissionCampaignEvent = &Q.FissionCampaignEvent + FissionCampaignFlip = &Q.FissionCampaignFlip + FissionCampaignGashapon = &Q.FissionCampaignGashapon + FissionCampaignGold = &Q.FissionCampaignGold + FissionCampaignGrid = &Q.FissionCampaignGrid + FissionCampaignGrow = &Q.FissionCampaignGrow + FissionCampaignGrowStep = &Q.FissionCampaignGrowStep + FissionCampaignKeep = &Q.FissionCampaignKeep + FissionCampaignKeepStep = &Q.FissionCampaignKeepStep + FissionCampaignLang = &Q.FissionCampaignLang + FissionCampaignLongImg = &Q.FissionCampaignLongImg + FissionCampaignLongImgZone = &Q.FissionCampaignLongImgZone + FissionCampaignPointsUse = &Q.FissionCampaignPointsUse + FissionCampaignPush = &Q.FissionCampaignPush + FissionCampaignQa = &Q.FissionCampaignQa + FissionCampaignQaOption = &Q.FissionCampaignQaOption + FissionCampaignQaQuestion = &Q.FissionCampaignQaQuestion + FissionCampaignQuiz = &Q.FissionCampaignQuiz + FissionCampaignQuizOption = &Q.FissionCampaignQuizOption + FissionCampaignReferral = &Q.FissionCampaignReferral + FissionCampaignReward = &Q.FissionCampaignReward + FissionCampaignRewardAdd = &Q.FissionCampaignRewardAdd + FissionCampaignRewardAddLog = &Q.FissionCampaignRewardAddLog + FissionCampaignRewardRule = &Q.FissionCampaignRewardRule + FissionCampaignSign = &Q.FissionCampaignSign + FissionCampaignSlot = &Q.FissionCampaignSlot + FissionCampaignStyle = &Q.FissionCampaignStyle + FissionCampaignTask = &Q.FissionCampaignTask + FissionCampaignTicket = &Q.FissionCampaignTicket + FissionCampaignUno = &Q.FissionCampaignUno + FissionCampaignUnoCard = &Q.FissionCampaignUnoCard + FissionCampaignUnoGroup = &Q.FissionCampaignUnoGroup + FissionCampaignV = &Q.FissionCampaignV + FissionCampaignVsSchedule = &Q.FissionCampaignVsSchedule + FissionCampaignVsTeam = &Q.FissionCampaignVsTeam + FissionCampaignWheel = &Q.FissionCampaignWheel + FissionCampaignWin = &Q.FissionCampaignWin + FissionCash = &Q.FissionCash + FissionCashRecord = &Q.FissionCashRecord + FissionChat = &Q.FissionChat + FissionChatMsg = &Q.FissionChatMsg + FissionChildUser = &Q.FissionChildUser + FissionChildUserRecord = &Q.FissionChildUserRecord + FissionChop = &Q.FissionChop + FissionChopHelp = &Q.FissionChopHelp + FissionChopReward = &Q.FissionChopReward + FissionClientReward = &Q.FissionClientReward + FissionCoin = &Q.FissionCoin + FissionCoinLog = &Q.FissionCoinLog + FissionCoinScene = &Q.FissionCoinScene + FissionConfig = &Q.FissionConfig + FissionCustomBtn = &Q.FissionCustomBtn + FissionDice = &Q.FissionDice + FissionDiceCollect = &Q.FissionDiceCollect + FissionDiceMap = &Q.FissionDiceMap + FissionDiceMapGroup = &Q.FissionDiceMapGroup + FissionDiceProp = &Q.FissionDiceProp + FissionDiceRecord = &Q.FissionDiceRecord + FissionDiceRun = &Q.FissionDiceRun + FissionFlip = &Q.FissionFlip + FissionFlipLog = &Q.FissionFlipLog + FissionGashapon = &Q.FissionGashapon + FissionGashaponLog = &Q.FissionGashaponLog + FissionGold = &Q.FissionGold + FissionGoldLog = &Q.FissionGoldLog + FissionGrid = &Q.FissionGrid + FissionGridLog = &Q.FissionGridLog + FissionGrow = &Q.FissionGrow + FissionGrowLife = &Q.FissionGrowLife + FissionGrowRecord = &Q.FissionGrowRecord + FissionKeep = &Q.FissionKeep + FissionKeepLog = &Q.FissionKeepLog + FissionLangModule = &Q.FissionLangModule + FissionNotify = &Q.FissionNotify + FissionNotifyResp = &Q.FissionNotifyResp + FissionNotifyTask = &Q.FissionNotifyTask + FissionPointDeduct = &Q.FissionPointDeduct + FissionPointsLog = &Q.FissionPointsLog + FissionPrizeWheel = &Q.FissionPrizeWheel + FissionPrizeWheelLog = &Q.FissionPrizeWheelLog + FissionQa = &Q.FissionQa + FissionQaLog = &Q.FissionQaLog + FissionQuiz = &Q.FissionQuiz + FissionQuizLog = &Q.FissionQuizLog + FissionReferral = &Q.FissionReferral + FissionRewardRecord = &Q.FissionRewardRecord + FissionRewardRecordForm = &Q.FissionRewardRecordForm + FissionSign = &Q.FissionSign + FissionSignDay = &Q.FissionSignDay + FissionSignLog = &Q.FissionSignLog + FissionSlot = &Q.FissionSlot + FissionSlotLog = &Q.FissionSlotLog + FissionTargetRecord = &Q.FissionTargetRecord + FissionTemp = &Q.FissionTemp + FissionTempGroup = &Q.FissionTempGroup + FissionTempGroupLang = &Q.FissionTempGroupLang + FissionTempImage = &Q.FissionTempImage + FissionTempLang = &Q.FissionTempLang + FissionTotal = &Q.FissionTotal + FissionTotalCycle = &Q.FissionTotalCycle + FissionUnlockReward = &Q.FissionUnlockReward + FissionUno = &Q.FissionUno + FissionUnoCollect = &Q.FissionUnoCollect + FissionUnoLog = &Q.FissionUnoLog + FissionUser = &Q.FissionUser + FissionUserActive = &Q.FissionUserActive + FissionUserAttr = &Q.FissionUserAttr + FissionUserAttrTotal = &Q.FissionUserAttrTotal + FissionUserCond = &Q.FissionUserCond + FissionUserCondRecord = &Q.FissionUserCondRecord + FissionUserCtlink = &Q.FissionUserCtlink + FissionUserDylink = &Q.FissionUserDylink + FissionUserEvent = &Q.FissionUserEvent + FissionUserJattr = &Q.FissionUserJattr + FissionUserLevel = &Q.FissionUserLevel + FissionUserLevelRelated = &Q.FissionUserLevelRelated + FissionUserPreCond = &Q.FissionUserPreCond + FissionUserStat = &Q.FissionUserStat + FissionUserTaskRecord = &Q.FissionUserTaskRecord + FissionUserTaskReward = &Q.FissionUserTaskReward + FissionUserTaskValid = &Q.FissionUserTaskValid + FissionV = &Q.FissionV + FissionVsLog = &Q.FissionVsLog + FissionVsVote = &Q.FissionVsVote + FissionVsVoteSettlement = &Q.FissionVsVoteSettlement + FissionWebUser = &Q.FissionWebUser + FissionWin = &Q.FissionWin + Form = &Q.Form + GameAction = &Q.GameAction + GameLink = &Q.GameLink + GameTotal = &Q.GameTotal + GameTotalDate = &Q.GameTotalDate + GameUser = &Q.GameUser + Lang = &Q.Lang + LangTextMark = &Q.LangTextMark + LibraryQa = &Q.LibraryQa + LibraryQaGroup = &Q.LibraryQaGroup + LibraryQaOption = &Q.LibraryQaOption + LvAPILog = &Q.LvAPILog + Material = &Q.Material + ModuleStatisticsEventflow = &Q.ModuleStatisticsEventflow + NotifyURL = &Q.NotifyURL + OperateLog = &Q.OperateLog + Project = &Q.Project + ProjectAd = &Q.ProjectAd + ProjectSecret = &Q.ProjectSecret + ProjectUser = &Q.ProjectUser + ProjectUserCoin = &Q.ProjectUserCoin + ProjectUserCoinDeduct = &Q.ProjectUserCoinDeduct + ProjectUserCoinExpired = &Q.ProjectUserCoinExpired + ProjectUserCoinLog = &Q.ProjectUserCoinLog + ProjectUserCoinRecord = &Q.ProjectUserCoinRecord + ProjectUserCoinUse = &Q.ProjectUserCoinUse + ProjectUserInfoLog = &Q.ProjectUserInfoLog + RedeemMall = &Q.RedeemMall + RedeemMallItem = &Q.RedeemMallItem + RedeemMallItemTask = &Q.RedeemMallItemTask + RedeemMallRecord = &Q.RedeemMallRecord + RedeemMallRelate = &Q.RedeemMallRelate + Register = &Q.Register + RegisterAudit = &Q.RegisterAudit + Reward = &Q.Reward + RewardLang = &Q.RewardLang + RewardPush = &Q.RewardPush + RewardPushLog = &Q.RewardPushLog + RewardPushTask = &Q.RewardPushTask + RewardRelated = &Q.RewardRelated + ServerWhitelist = &Q.ServerWhitelist + SlowLog = &Q.SlowLog + TCoin = &Q.TCoin + TCoinLang = &Q.TCoinLang + User = &Q.User + UserBehavior = &Q.UserBehavior + UserProjectRelate = &Q.UserProjectRelate +} + +func Use(db *gorm.DB, opts ...gen.DOOption) *Query { + return &Query{ + db: db, + Company: newCompany(db, opts...), + CompanyMade: newCompanyMade(db, opts...), + CronLog: newCronLog(db, opts...), + ErrLog: newErrLog(db, opts...), + ExportTask: newExportTask(db, opts...), + FissionArchiveTask: newFissionArchiveTask(db, opts...), + FissionBallot: newFissionBallot(db, opts...), + FissionBallotLog: newFissionBallotLog(db, opts...), + FissionBehavior: newFissionBehavior(db, opts...), + FissionBlind: newFissionBlind(db, opts...), + FissionBlindLog: newFissionBlindLog(db, opts...), + FissionCampaign: newFissionCampaign(db, opts...), + FissionCampaignBallot: newFissionCampaignBallot(db, opts...), + FissionCampaignBlind: newFissionCampaignBlind(db, opts...), + FissionCampaignCash: newFissionCampaignCash(db, opts...), + FissionCampaignChannel: newFissionCampaignChannel(db, opts...), + FissionCampaignChat: newFissionCampaignChat(db, opts...), + FissionCampaignChild: newFissionCampaignChild(db, opts...), + FissionCampaignChop: newFissionCampaignChop(db, opts...), + FissionCampaignCoin: newFissionCampaignCoin(db, opts...), + FissionCampaignCond: newFissionCampaignCond(db, opts...), + FissionCampaignConfig: newFissionCampaignConfig(db, opts...), + FissionCampaignDice: newFissionCampaignDice(db, opts...), + FissionCampaignEvent: newFissionCampaignEvent(db, opts...), + FissionCampaignFlip: newFissionCampaignFlip(db, opts...), + FissionCampaignGashapon: newFissionCampaignGashapon(db, opts...), + FissionCampaignGold: newFissionCampaignGold(db, opts...), + FissionCampaignGrid: newFissionCampaignGrid(db, opts...), + FissionCampaignGrow: newFissionCampaignGrow(db, opts...), + FissionCampaignGrowStep: newFissionCampaignGrowStep(db, opts...), + FissionCampaignKeep: newFissionCampaignKeep(db, opts...), + FissionCampaignKeepStep: newFissionCampaignKeepStep(db, opts...), + FissionCampaignLang: newFissionCampaignLang(db, opts...), + FissionCampaignLongImg: newFissionCampaignLongImg(db, opts...), + FissionCampaignLongImgZone: newFissionCampaignLongImgZone(db, opts...), + FissionCampaignPointsUse: newFissionCampaignPointsUse(db, opts...), + FissionCampaignPush: newFissionCampaignPush(db, opts...), + FissionCampaignQa: newFissionCampaignQa(db, opts...), + FissionCampaignQaOption: newFissionCampaignQaOption(db, opts...), + FissionCampaignQaQuestion: newFissionCampaignQaQuestion(db, opts...), + FissionCampaignQuiz: newFissionCampaignQuiz(db, opts...), + FissionCampaignQuizOption: newFissionCampaignQuizOption(db, opts...), + FissionCampaignReferral: newFissionCampaignReferral(db, opts...), + FissionCampaignReward: newFissionCampaignReward(db, opts...), + FissionCampaignRewardAdd: newFissionCampaignRewardAdd(db, opts...), + FissionCampaignRewardAddLog: newFissionCampaignRewardAddLog(db, opts...), + FissionCampaignRewardRule: newFissionCampaignRewardRule(db, opts...), + FissionCampaignSign: newFissionCampaignSign(db, opts...), + FissionCampaignSlot: newFissionCampaignSlot(db, opts...), + FissionCampaignStyle: newFissionCampaignStyle(db, opts...), + FissionCampaignTask: newFissionCampaignTask(db, opts...), + FissionCampaignTicket: newFissionCampaignTicket(db, opts...), + FissionCampaignUno: newFissionCampaignUno(db, opts...), + FissionCampaignUnoCard: newFissionCampaignUnoCard(db, opts...), + FissionCampaignUnoGroup: newFissionCampaignUnoGroup(db, opts...), + FissionCampaignV: newFissionCampaignV(db, opts...), + FissionCampaignVsSchedule: newFissionCampaignVsSchedule(db, opts...), + FissionCampaignVsTeam: newFissionCampaignVsTeam(db, opts...), + FissionCampaignWheel: newFissionCampaignWheel(db, opts...), + FissionCampaignWin: newFissionCampaignWin(db, opts...), + FissionCash: newFissionCash(db, opts...), + FissionCashRecord: newFissionCashRecord(db, opts...), + FissionChat: newFissionChat(db, opts...), + FissionChatMsg: newFissionChatMsg(db, opts...), + FissionChildUser: newFissionChildUser(db, opts...), + FissionChildUserRecord: newFissionChildUserRecord(db, opts...), + FissionChop: newFissionChop(db, opts...), + FissionChopHelp: newFissionChopHelp(db, opts...), + FissionChopReward: newFissionChopReward(db, opts...), + FissionClientReward: newFissionClientReward(db, opts...), + FissionCoin: newFissionCoin(db, opts...), + FissionCoinLog: newFissionCoinLog(db, opts...), + FissionCoinScene: newFissionCoinScene(db, opts...), + FissionConfig: newFissionConfig(db, opts...), + FissionCustomBtn: newFissionCustomBtn(db, opts...), + FissionDice: newFissionDice(db, opts...), + FissionDiceCollect: newFissionDiceCollect(db, opts...), + FissionDiceMap: newFissionDiceMap(db, opts...), + FissionDiceMapGroup: newFissionDiceMapGroup(db, opts...), + FissionDiceProp: newFissionDiceProp(db, opts...), + FissionDiceRecord: newFissionDiceRecord(db, opts...), + FissionDiceRun: newFissionDiceRun(db, opts...), + FissionFlip: newFissionFlip(db, opts...), + FissionFlipLog: newFissionFlipLog(db, opts...), + FissionGashapon: newFissionGashapon(db, opts...), + FissionGashaponLog: newFissionGashaponLog(db, opts...), + FissionGold: newFissionGold(db, opts...), + FissionGoldLog: newFissionGoldLog(db, opts...), + FissionGrid: newFissionGrid(db, opts...), + FissionGridLog: newFissionGridLog(db, opts...), + FissionGrow: newFissionGrow(db, opts...), + FissionGrowLife: newFissionGrowLife(db, opts...), + FissionGrowRecord: newFissionGrowRecord(db, opts...), + FissionKeep: newFissionKeep(db, opts...), + FissionKeepLog: newFissionKeepLog(db, opts...), + FissionLangModule: newFissionLangModule(db, opts...), + FissionNotify: newFissionNotify(db, opts...), + FissionNotifyResp: newFissionNotifyResp(db, opts...), + FissionNotifyTask: newFissionNotifyTask(db, opts...), + FissionPointDeduct: newFissionPointDeduct(db, opts...), + FissionPointsLog: newFissionPointsLog(db, opts...), + FissionPrizeWheel: newFissionPrizeWheel(db, opts...), + FissionPrizeWheelLog: newFissionPrizeWheelLog(db, opts...), + FissionQa: newFissionQa(db, opts...), + FissionQaLog: newFissionQaLog(db, opts...), + FissionQuiz: newFissionQuiz(db, opts...), + FissionQuizLog: newFissionQuizLog(db, opts...), + FissionReferral: newFissionReferral(db, opts...), + FissionRewardRecord: newFissionRewardRecord(db, opts...), + FissionRewardRecordForm: newFissionRewardRecordForm(db, opts...), + FissionSign: newFissionSign(db, opts...), + FissionSignDay: newFissionSignDay(db, opts...), + FissionSignLog: newFissionSignLog(db, opts...), + FissionSlot: newFissionSlot(db, opts...), + FissionSlotLog: newFissionSlotLog(db, opts...), + FissionTargetRecord: newFissionTargetRecord(db, opts...), + FissionTemp: newFissionTemp(db, opts...), + FissionTempGroup: newFissionTempGroup(db, opts...), + FissionTempGroupLang: newFissionTempGroupLang(db, opts...), + FissionTempImage: newFissionTempImage(db, opts...), + FissionTempLang: newFissionTempLang(db, opts...), + FissionTotal: newFissionTotal(db, opts...), + FissionTotalCycle: newFissionTotalCycle(db, opts...), + FissionUnlockReward: newFissionUnlockReward(db, opts...), + FissionUno: newFissionUno(db, opts...), + FissionUnoCollect: newFissionUnoCollect(db, opts...), + FissionUnoLog: newFissionUnoLog(db, opts...), + FissionUser: newFissionUser(db, opts...), + FissionUserActive: newFissionUserActive(db, opts...), + FissionUserAttr: newFissionUserAttr(db, opts...), + FissionUserAttrTotal: newFissionUserAttrTotal(db, opts...), + FissionUserCond: newFissionUserCond(db, opts...), + FissionUserCondRecord: newFissionUserCondRecord(db, opts...), + FissionUserCtlink: newFissionUserCtlink(db, opts...), + FissionUserDylink: newFissionUserDylink(db, opts...), + FissionUserEvent: newFissionUserEvent(db, opts...), + FissionUserJattr: newFissionUserJattr(db, opts...), + FissionUserLevel: newFissionUserLevel(db, opts...), + FissionUserLevelRelated: newFissionUserLevelRelated(db, opts...), + FissionUserPreCond: newFissionUserPreCond(db, opts...), + FissionUserStat: newFissionUserStat(db, opts...), + FissionUserTaskRecord: newFissionUserTaskRecord(db, opts...), + FissionUserTaskReward: newFissionUserTaskReward(db, opts...), + FissionUserTaskValid: newFissionUserTaskValid(db, opts...), + FissionV: newFissionV(db, opts...), + FissionVsLog: newFissionVsLog(db, opts...), + FissionVsVote: newFissionVsVote(db, opts...), + FissionVsVoteSettlement: newFissionVsVoteSettlement(db, opts...), + FissionWebUser: newFissionWebUser(db, opts...), + FissionWin: newFissionWin(db, opts...), + Form: newForm(db, opts...), + GameAction: newGameAction(db, opts...), + GameLink: newGameLink(db, opts...), + GameTotal: newGameTotal(db, opts...), + GameTotalDate: newGameTotalDate(db, opts...), + GameUser: newGameUser(db, opts...), + Lang: newLang(db, opts...), + LangTextMark: newLangTextMark(db, opts...), + LibraryQa: newLibraryQa(db, opts...), + LibraryQaGroup: newLibraryQaGroup(db, opts...), + LibraryQaOption: newLibraryQaOption(db, opts...), + LvAPILog: newLvAPILog(db, opts...), + Material: newMaterial(db, opts...), + ModuleStatisticsEventflow: newModuleStatisticsEventflow(db, opts...), + NotifyURL: newNotifyURL(db, opts...), + OperateLog: newOperateLog(db, opts...), + Project: newProject(db, opts...), + ProjectAd: newProjectAd(db, opts...), + ProjectSecret: newProjectSecret(db, opts...), + ProjectUser: newProjectUser(db, opts...), + ProjectUserCoin: newProjectUserCoin(db, opts...), + ProjectUserCoinDeduct: newProjectUserCoinDeduct(db, opts...), + ProjectUserCoinExpired: newProjectUserCoinExpired(db, opts...), + ProjectUserCoinLog: newProjectUserCoinLog(db, opts...), + ProjectUserCoinRecord: newProjectUserCoinRecord(db, opts...), + ProjectUserCoinUse: newProjectUserCoinUse(db, opts...), + ProjectUserInfoLog: newProjectUserInfoLog(db, opts...), + RedeemMall: newRedeemMall(db, opts...), + RedeemMallItem: newRedeemMallItem(db, opts...), + RedeemMallItemTask: newRedeemMallItemTask(db, opts...), + RedeemMallRecord: newRedeemMallRecord(db, opts...), + RedeemMallRelate: newRedeemMallRelate(db, opts...), + Register: newRegister(db, opts...), + RegisterAudit: newRegisterAudit(db, opts...), + Reward: newReward(db, opts...), + RewardLang: newRewardLang(db, opts...), + RewardPush: newRewardPush(db, opts...), + RewardPushLog: newRewardPushLog(db, opts...), + RewardPushTask: newRewardPushTask(db, opts...), + RewardRelated: newRewardRelated(db, opts...), + ServerWhitelist: newServerWhitelist(db, opts...), + SlowLog: newSlowLog(db, opts...), + TCoin: newTCoin(db, opts...), + TCoinLang: newTCoinLang(db, opts...), + User: newUser(db, opts...), + UserBehavior: newUserBehavior(db, opts...), + UserProjectRelate: newUserProjectRelate(db, opts...), + } +} + +type Query struct { + db *gorm.DB + + Company company + CompanyMade companyMade + CronLog cronLog + ErrLog errLog + ExportTask exportTask + FissionArchiveTask fissionArchiveTask + FissionBallot fissionBallot + FissionBallotLog fissionBallotLog + FissionBehavior fissionBehavior + FissionBlind fissionBlind + FissionBlindLog fissionBlindLog + FissionCampaign fissionCampaign + FissionCampaignBallot fissionCampaignBallot + FissionCampaignBlind fissionCampaignBlind + FissionCampaignCash fissionCampaignCash + FissionCampaignChannel fissionCampaignChannel + FissionCampaignChat fissionCampaignChat + FissionCampaignChild fissionCampaignChild + FissionCampaignChop fissionCampaignChop + FissionCampaignCoin fissionCampaignCoin + FissionCampaignCond fissionCampaignCond + FissionCampaignConfig fissionCampaignConfig + FissionCampaignDice fissionCampaignDice + FissionCampaignEvent fissionCampaignEvent + FissionCampaignFlip fissionCampaignFlip + FissionCampaignGashapon fissionCampaignGashapon + FissionCampaignGold fissionCampaignGold + FissionCampaignGrid fissionCampaignGrid + FissionCampaignGrow fissionCampaignGrow + FissionCampaignGrowStep fissionCampaignGrowStep + FissionCampaignKeep fissionCampaignKeep + FissionCampaignKeepStep fissionCampaignKeepStep + FissionCampaignLang fissionCampaignLang + FissionCampaignLongImg fissionCampaignLongImg + FissionCampaignLongImgZone fissionCampaignLongImgZone + FissionCampaignPointsUse fissionCampaignPointsUse + FissionCampaignPush fissionCampaignPush + FissionCampaignQa fissionCampaignQa + FissionCampaignQaOption fissionCampaignQaOption + FissionCampaignQaQuestion fissionCampaignQaQuestion + FissionCampaignQuiz fissionCampaignQuiz + FissionCampaignQuizOption fissionCampaignQuizOption + FissionCampaignReferral fissionCampaignReferral + FissionCampaignReward fissionCampaignReward + FissionCampaignRewardAdd fissionCampaignRewardAdd + FissionCampaignRewardAddLog fissionCampaignRewardAddLog + FissionCampaignRewardRule fissionCampaignRewardRule + FissionCampaignSign fissionCampaignSign + FissionCampaignSlot fissionCampaignSlot + FissionCampaignStyle fissionCampaignStyle + FissionCampaignTask fissionCampaignTask + FissionCampaignTicket fissionCampaignTicket + FissionCampaignUno fissionCampaignUno + FissionCampaignUnoCard fissionCampaignUnoCard + FissionCampaignUnoGroup fissionCampaignUnoGroup + FissionCampaignV fissionCampaignV + FissionCampaignVsSchedule fissionCampaignVsSchedule + FissionCampaignVsTeam fissionCampaignVsTeam + FissionCampaignWheel fissionCampaignWheel + FissionCampaignWin fissionCampaignWin + FissionCash fissionCash + FissionCashRecord fissionCashRecord + FissionChat fissionChat + FissionChatMsg fissionChatMsg + FissionChildUser fissionChildUser + FissionChildUserRecord fissionChildUserRecord + FissionChop fissionChop + FissionChopHelp fissionChopHelp + FissionChopReward fissionChopReward + FissionClientReward fissionClientReward + FissionCoin fissionCoin + FissionCoinLog fissionCoinLog + FissionCoinScene fissionCoinScene + FissionConfig fissionConfig + FissionCustomBtn fissionCustomBtn + FissionDice fissionDice + FissionDiceCollect fissionDiceCollect + FissionDiceMap fissionDiceMap + FissionDiceMapGroup fissionDiceMapGroup + FissionDiceProp fissionDiceProp + FissionDiceRecord fissionDiceRecord + FissionDiceRun fissionDiceRun + FissionFlip fissionFlip + FissionFlipLog fissionFlipLog + FissionGashapon fissionGashapon + FissionGashaponLog fissionGashaponLog + FissionGold fissionGold + FissionGoldLog fissionGoldLog + FissionGrid fissionGrid + FissionGridLog fissionGridLog + FissionGrow fissionGrow + FissionGrowLife fissionGrowLife + FissionGrowRecord fissionGrowRecord + FissionKeep fissionKeep + FissionKeepLog fissionKeepLog + FissionLangModule fissionLangModule + FissionNotify fissionNotify + FissionNotifyResp fissionNotifyResp + FissionNotifyTask fissionNotifyTask + FissionPointDeduct fissionPointDeduct + FissionPointsLog fissionPointsLog + FissionPrizeWheel fissionPrizeWheel + FissionPrizeWheelLog fissionPrizeWheelLog + FissionQa fissionQa + FissionQaLog fissionQaLog + FissionQuiz fissionQuiz + FissionQuizLog fissionQuizLog + FissionReferral fissionReferral + FissionRewardRecord fissionRewardRecord + FissionRewardRecordForm fissionRewardRecordForm + FissionSign fissionSign + FissionSignDay fissionSignDay + FissionSignLog fissionSignLog + FissionSlot fissionSlot + FissionSlotLog fissionSlotLog + FissionTargetRecord fissionTargetRecord + FissionTemp fissionTemp + FissionTempGroup fissionTempGroup + FissionTempGroupLang fissionTempGroupLang + FissionTempImage fissionTempImage + FissionTempLang fissionTempLang + FissionTotal fissionTotal + FissionTotalCycle fissionTotalCycle + FissionUnlockReward fissionUnlockReward + FissionUno fissionUno + FissionUnoCollect fissionUnoCollect + FissionUnoLog fissionUnoLog + FissionUser fissionUser + FissionUserActive fissionUserActive + FissionUserAttr fissionUserAttr + FissionUserAttrTotal fissionUserAttrTotal + FissionUserCond fissionUserCond + FissionUserCondRecord fissionUserCondRecord + FissionUserCtlink fissionUserCtlink + FissionUserDylink fissionUserDylink + FissionUserEvent fissionUserEvent + FissionUserJattr fissionUserJattr + FissionUserLevel fissionUserLevel + FissionUserLevelRelated fissionUserLevelRelated + FissionUserPreCond fissionUserPreCond + FissionUserStat fissionUserStat + FissionUserTaskRecord fissionUserTaskRecord + FissionUserTaskReward fissionUserTaskReward + FissionUserTaskValid fissionUserTaskValid + FissionV fissionV + FissionVsLog fissionVsLog + FissionVsVote fissionVsVote + FissionVsVoteSettlement fissionVsVoteSettlement + FissionWebUser fissionWebUser + FissionWin fissionWin + Form form + GameAction gameAction + GameLink gameLink + GameTotal gameTotal + GameTotalDate gameTotalDate + GameUser gameUser + Lang lang + LangTextMark langTextMark + LibraryQa libraryQa + LibraryQaGroup libraryQaGroup + LibraryQaOption libraryQaOption + LvAPILog lvAPILog + Material material + ModuleStatisticsEventflow moduleStatisticsEventflow + NotifyURL notifyURL + OperateLog operateLog + Project project + ProjectAd projectAd + ProjectSecret projectSecret + ProjectUser projectUser + ProjectUserCoin projectUserCoin + ProjectUserCoinDeduct projectUserCoinDeduct + ProjectUserCoinExpired projectUserCoinExpired + ProjectUserCoinLog projectUserCoinLog + ProjectUserCoinRecord projectUserCoinRecord + ProjectUserCoinUse projectUserCoinUse + ProjectUserInfoLog projectUserInfoLog + RedeemMall redeemMall + RedeemMallItem redeemMallItem + RedeemMallItemTask redeemMallItemTask + RedeemMallRecord redeemMallRecord + RedeemMallRelate redeemMallRelate + Register register + RegisterAudit registerAudit + Reward reward + RewardLang rewardLang + RewardPush rewardPush + RewardPushLog rewardPushLog + RewardPushTask rewardPushTask + RewardRelated rewardRelated + ServerWhitelist serverWhitelist + SlowLog slowLog + TCoin tCoin + TCoinLang tCoinLang + User user + UserBehavior userBehavior + UserProjectRelate userProjectRelate +} + +func (q *Query) Available() bool { return q.db != nil } + +func (q *Query) clone(db *gorm.DB) *Query { + return &Query{ + db: db, + Company: q.Company.clone(db), + CompanyMade: q.CompanyMade.clone(db), + CronLog: q.CronLog.clone(db), + ErrLog: q.ErrLog.clone(db), + ExportTask: q.ExportTask.clone(db), + FissionArchiveTask: q.FissionArchiveTask.clone(db), + FissionBallot: q.FissionBallot.clone(db), + FissionBallotLog: q.FissionBallotLog.clone(db), + FissionBehavior: q.FissionBehavior.clone(db), + FissionBlind: q.FissionBlind.clone(db), + FissionBlindLog: q.FissionBlindLog.clone(db), + FissionCampaign: q.FissionCampaign.clone(db), + FissionCampaignBallot: q.FissionCampaignBallot.clone(db), + FissionCampaignBlind: q.FissionCampaignBlind.clone(db), + FissionCampaignCash: q.FissionCampaignCash.clone(db), + FissionCampaignChannel: q.FissionCampaignChannel.clone(db), + FissionCampaignChat: q.FissionCampaignChat.clone(db), + FissionCampaignChild: q.FissionCampaignChild.clone(db), + FissionCampaignChop: q.FissionCampaignChop.clone(db), + FissionCampaignCoin: q.FissionCampaignCoin.clone(db), + FissionCampaignCond: q.FissionCampaignCond.clone(db), + FissionCampaignConfig: q.FissionCampaignConfig.clone(db), + FissionCampaignDice: q.FissionCampaignDice.clone(db), + FissionCampaignEvent: q.FissionCampaignEvent.clone(db), + FissionCampaignFlip: q.FissionCampaignFlip.clone(db), + FissionCampaignGashapon: q.FissionCampaignGashapon.clone(db), + FissionCampaignGold: q.FissionCampaignGold.clone(db), + FissionCampaignGrid: q.FissionCampaignGrid.clone(db), + FissionCampaignGrow: q.FissionCampaignGrow.clone(db), + FissionCampaignGrowStep: q.FissionCampaignGrowStep.clone(db), + FissionCampaignKeep: q.FissionCampaignKeep.clone(db), + FissionCampaignKeepStep: q.FissionCampaignKeepStep.clone(db), + FissionCampaignLang: q.FissionCampaignLang.clone(db), + FissionCampaignLongImg: q.FissionCampaignLongImg.clone(db), + FissionCampaignLongImgZone: q.FissionCampaignLongImgZone.clone(db), + FissionCampaignPointsUse: q.FissionCampaignPointsUse.clone(db), + FissionCampaignPush: q.FissionCampaignPush.clone(db), + FissionCampaignQa: q.FissionCampaignQa.clone(db), + FissionCampaignQaOption: q.FissionCampaignQaOption.clone(db), + FissionCampaignQaQuestion: q.FissionCampaignQaQuestion.clone(db), + FissionCampaignQuiz: q.FissionCampaignQuiz.clone(db), + FissionCampaignQuizOption: q.FissionCampaignQuizOption.clone(db), + FissionCampaignReferral: q.FissionCampaignReferral.clone(db), + FissionCampaignReward: q.FissionCampaignReward.clone(db), + FissionCampaignRewardAdd: q.FissionCampaignRewardAdd.clone(db), + FissionCampaignRewardAddLog: q.FissionCampaignRewardAddLog.clone(db), + FissionCampaignRewardRule: q.FissionCampaignRewardRule.clone(db), + FissionCampaignSign: q.FissionCampaignSign.clone(db), + FissionCampaignSlot: q.FissionCampaignSlot.clone(db), + FissionCampaignStyle: q.FissionCampaignStyle.clone(db), + FissionCampaignTask: q.FissionCampaignTask.clone(db), + FissionCampaignTicket: q.FissionCampaignTicket.clone(db), + FissionCampaignUno: q.FissionCampaignUno.clone(db), + FissionCampaignUnoCard: q.FissionCampaignUnoCard.clone(db), + FissionCampaignUnoGroup: q.FissionCampaignUnoGroup.clone(db), + FissionCampaignV: q.FissionCampaignV.clone(db), + FissionCampaignVsSchedule: q.FissionCampaignVsSchedule.clone(db), + FissionCampaignVsTeam: q.FissionCampaignVsTeam.clone(db), + FissionCampaignWheel: q.FissionCampaignWheel.clone(db), + FissionCampaignWin: q.FissionCampaignWin.clone(db), + FissionCash: q.FissionCash.clone(db), + FissionCashRecord: q.FissionCashRecord.clone(db), + FissionChat: q.FissionChat.clone(db), + FissionChatMsg: q.FissionChatMsg.clone(db), + FissionChildUser: q.FissionChildUser.clone(db), + FissionChildUserRecord: q.FissionChildUserRecord.clone(db), + FissionChop: q.FissionChop.clone(db), + FissionChopHelp: q.FissionChopHelp.clone(db), + FissionChopReward: q.FissionChopReward.clone(db), + FissionClientReward: q.FissionClientReward.clone(db), + FissionCoin: q.FissionCoin.clone(db), + FissionCoinLog: q.FissionCoinLog.clone(db), + FissionCoinScene: q.FissionCoinScene.clone(db), + FissionConfig: q.FissionConfig.clone(db), + FissionCustomBtn: q.FissionCustomBtn.clone(db), + FissionDice: q.FissionDice.clone(db), + FissionDiceCollect: q.FissionDiceCollect.clone(db), + FissionDiceMap: q.FissionDiceMap.clone(db), + FissionDiceMapGroup: q.FissionDiceMapGroup.clone(db), + FissionDiceProp: q.FissionDiceProp.clone(db), + FissionDiceRecord: q.FissionDiceRecord.clone(db), + FissionDiceRun: q.FissionDiceRun.clone(db), + FissionFlip: q.FissionFlip.clone(db), + FissionFlipLog: q.FissionFlipLog.clone(db), + FissionGashapon: q.FissionGashapon.clone(db), + FissionGashaponLog: q.FissionGashaponLog.clone(db), + FissionGold: q.FissionGold.clone(db), + FissionGoldLog: q.FissionGoldLog.clone(db), + FissionGrid: q.FissionGrid.clone(db), + FissionGridLog: q.FissionGridLog.clone(db), + FissionGrow: q.FissionGrow.clone(db), + FissionGrowLife: q.FissionGrowLife.clone(db), + FissionGrowRecord: q.FissionGrowRecord.clone(db), + FissionKeep: q.FissionKeep.clone(db), + FissionKeepLog: q.FissionKeepLog.clone(db), + FissionLangModule: q.FissionLangModule.clone(db), + FissionNotify: q.FissionNotify.clone(db), + FissionNotifyResp: q.FissionNotifyResp.clone(db), + FissionNotifyTask: q.FissionNotifyTask.clone(db), + FissionPointDeduct: q.FissionPointDeduct.clone(db), + FissionPointsLog: q.FissionPointsLog.clone(db), + FissionPrizeWheel: q.FissionPrizeWheel.clone(db), + FissionPrizeWheelLog: q.FissionPrizeWheelLog.clone(db), + FissionQa: q.FissionQa.clone(db), + FissionQaLog: q.FissionQaLog.clone(db), + FissionQuiz: q.FissionQuiz.clone(db), + FissionQuizLog: q.FissionQuizLog.clone(db), + FissionReferral: q.FissionReferral.clone(db), + FissionRewardRecord: q.FissionRewardRecord.clone(db), + FissionRewardRecordForm: q.FissionRewardRecordForm.clone(db), + FissionSign: q.FissionSign.clone(db), + FissionSignDay: q.FissionSignDay.clone(db), + FissionSignLog: q.FissionSignLog.clone(db), + FissionSlot: q.FissionSlot.clone(db), + FissionSlotLog: q.FissionSlotLog.clone(db), + FissionTargetRecord: q.FissionTargetRecord.clone(db), + FissionTemp: q.FissionTemp.clone(db), + FissionTempGroup: q.FissionTempGroup.clone(db), + FissionTempGroupLang: q.FissionTempGroupLang.clone(db), + FissionTempImage: q.FissionTempImage.clone(db), + FissionTempLang: q.FissionTempLang.clone(db), + FissionTotal: q.FissionTotal.clone(db), + FissionTotalCycle: q.FissionTotalCycle.clone(db), + FissionUnlockReward: q.FissionUnlockReward.clone(db), + FissionUno: q.FissionUno.clone(db), + FissionUnoCollect: q.FissionUnoCollect.clone(db), + FissionUnoLog: q.FissionUnoLog.clone(db), + FissionUser: q.FissionUser.clone(db), + FissionUserActive: q.FissionUserActive.clone(db), + FissionUserAttr: q.FissionUserAttr.clone(db), + FissionUserAttrTotal: q.FissionUserAttrTotal.clone(db), + FissionUserCond: q.FissionUserCond.clone(db), + FissionUserCondRecord: q.FissionUserCondRecord.clone(db), + FissionUserCtlink: q.FissionUserCtlink.clone(db), + FissionUserDylink: q.FissionUserDylink.clone(db), + FissionUserEvent: q.FissionUserEvent.clone(db), + FissionUserJattr: q.FissionUserJattr.clone(db), + FissionUserLevel: q.FissionUserLevel.clone(db), + FissionUserLevelRelated: q.FissionUserLevelRelated.clone(db), + FissionUserPreCond: q.FissionUserPreCond.clone(db), + FissionUserStat: q.FissionUserStat.clone(db), + FissionUserTaskRecord: q.FissionUserTaskRecord.clone(db), + FissionUserTaskReward: q.FissionUserTaskReward.clone(db), + FissionUserTaskValid: q.FissionUserTaskValid.clone(db), + FissionV: q.FissionV.clone(db), + FissionVsLog: q.FissionVsLog.clone(db), + FissionVsVote: q.FissionVsVote.clone(db), + FissionVsVoteSettlement: q.FissionVsVoteSettlement.clone(db), + FissionWebUser: q.FissionWebUser.clone(db), + FissionWin: q.FissionWin.clone(db), + Form: q.Form.clone(db), + GameAction: q.GameAction.clone(db), + GameLink: q.GameLink.clone(db), + GameTotal: q.GameTotal.clone(db), + GameTotalDate: q.GameTotalDate.clone(db), + GameUser: q.GameUser.clone(db), + Lang: q.Lang.clone(db), + LangTextMark: q.LangTextMark.clone(db), + LibraryQa: q.LibraryQa.clone(db), + LibraryQaGroup: q.LibraryQaGroup.clone(db), + LibraryQaOption: q.LibraryQaOption.clone(db), + LvAPILog: q.LvAPILog.clone(db), + Material: q.Material.clone(db), + ModuleStatisticsEventflow: q.ModuleStatisticsEventflow.clone(db), + NotifyURL: q.NotifyURL.clone(db), + OperateLog: q.OperateLog.clone(db), + Project: q.Project.clone(db), + ProjectAd: q.ProjectAd.clone(db), + ProjectSecret: q.ProjectSecret.clone(db), + ProjectUser: q.ProjectUser.clone(db), + ProjectUserCoin: q.ProjectUserCoin.clone(db), + ProjectUserCoinDeduct: q.ProjectUserCoinDeduct.clone(db), + ProjectUserCoinExpired: q.ProjectUserCoinExpired.clone(db), + ProjectUserCoinLog: q.ProjectUserCoinLog.clone(db), + ProjectUserCoinRecord: q.ProjectUserCoinRecord.clone(db), + ProjectUserCoinUse: q.ProjectUserCoinUse.clone(db), + ProjectUserInfoLog: q.ProjectUserInfoLog.clone(db), + RedeemMall: q.RedeemMall.clone(db), + RedeemMallItem: q.RedeemMallItem.clone(db), + RedeemMallItemTask: q.RedeemMallItemTask.clone(db), + RedeemMallRecord: q.RedeemMallRecord.clone(db), + RedeemMallRelate: q.RedeemMallRelate.clone(db), + Register: q.Register.clone(db), + RegisterAudit: q.RegisterAudit.clone(db), + Reward: q.Reward.clone(db), + RewardLang: q.RewardLang.clone(db), + RewardPush: q.RewardPush.clone(db), + RewardPushLog: q.RewardPushLog.clone(db), + RewardPushTask: q.RewardPushTask.clone(db), + RewardRelated: q.RewardRelated.clone(db), + ServerWhitelist: q.ServerWhitelist.clone(db), + SlowLog: q.SlowLog.clone(db), + TCoin: q.TCoin.clone(db), + TCoinLang: q.TCoinLang.clone(db), + User: q.User.clone(db), + UserBehavior: q.UserBehavior.clone(db), + UserProjectRelate: q.UserProjectRelate.clone(db), + } +} + +func (q *Query) ReadDB() *Query { + return q.ReplaceDB(q.db.Clauses(dbresolver.Read)) +} + +func (q *Query) WriteDB() *Query { + return q.ReplaceDB(q.db.Clauses(dbresolver.Write)) +} + +func (q *Query) ReplaceDB(db *gorm.DB) *Query { + return &Query{ + db: db, + Company: q.Company.replaceDB(db), + CompanyMade: q.CompanyMade.replaceDB(db), + CronLog: q.CronLog.replaceDB(db), + ErrLog: q.ErrLog.replaceDB(db), + ExportTask: q.ExportTask.replaceDB(db), + FissionArchiveTask: q.FissionArchiveTask.replaceDB(db), + FissionBallot: q.FissionBallot.replaceDB(db), + FissionBallotLog: q.FissionBallotLog.replaceDB(db), + FissionBehavior: q.FissionBehavior.replaceDB(db), + FissionBlind: q.FissionBlind.replaceDB(db), + FissionBlindLog: q.FissionBlindLog.replaceDB(db), + FissionCampaign: q.FissionCampaign.replaceDB(db), + FissionCampaignBallot: q.FissionCampaignBallot.replaceDB(db), + FissionCampaignBlind: q.FissionCampaignBlind.replaceDB(db), + FissionCampaignCash: q.FissionCampaignCash.replaceDB(db), + FissionCampaignChannel: q.FissionCampaignChannel.replaceDB(db), + FissionCampaignChat: q.FissionCampaignChat.replaceDB(db), + FissionCampaignChild: q.FissionCampaignChild.replaceDB(db), + FissionCampaignChop: q.FissionCampaignChop.replaceDB(db), + FissionCampaignCoin: q.FissionCampaignCoin.replaceDB(db), + FissionCampaignCond: q.FissionCampaignCond.replaceDB(db), + FissionCampaignConfig: q.FissionCampaignConfig.replaceDB(db), + FissionCampaignDice: q.FissionCampaignDice.replaceDB(db), + FissionCampaignEvent: q.FissionCampaignEvent.replaceDB(db), + FissionCampaignFlip: q.FissionCampaignFlip.replaceDB(db), + FissionCampaignGashapon: q.FissionCampaignGashapon.replaceDB(db), + FissionCampaignGold: q.FissionCampaignGold.replaceDB(db), + FissionCampaignGrid: q.FissionCampaignGrid.replaceDB(db), + FissionCampaignGrow: q.FissionCampaignGrow.replaceDB(db), + FissionCampaignGrowStep: q.FissionCampaignGrowStep.replaceDB(db), + FissionCampaignKeep: q.FissionCampaignKeep.replaceDB(db), + FissionCampaignKeepStep: q.FissionCampaignKeepStep.replaceDB(db), + FissionCampaignLang: q.FissionCampaignLang.replaceDB(db), + FissionCampaignLongImg: q.FissionCampaignLongImg.replaceDB(db), + FissionCampaignLongImgZone: q.FissionCampaignLongImgZone.replaceDB(db), + FissionCampaignPointsUse: q.FissionCampaignPointsUse.replaceDB(db), + FissionCampaignPush: q.FissionCampaignPush.replaceDB(db), + FissionCampaignQa: q.FissionCampaignQa.replaceDB(db), + FissionCampaignQaOption: q.FissionCampaignQaOption.replaceDB(db), + FissionCampaignQaQuestion: q.FissionCampaignQaQuestion.replaceDB(db), + FissionCampaignQuiz: q.FissionCampaignQuiz.replaceDB(db), + FissionCampaignQuizOption: q.FissionCampaignQuizOption.replaceDB(db), + FissionCampaignReferral: q.FissionCampaignReferral.replaceDB(db), + FissionCampaignReward: q.FissionCampaignReward.replaceDB(db), + FissionCampaignRewardAdd: q.FissionCampaignRewardAdd.replaceDB(db), + FissionCampaignRewardAddLog: q.FissionCampaignRewardAddLog.replaceDB(db), + FissionCampaignRewardRule: q.FissionCampaignRewardRule.replaceDB(db), + FissionCampaignSign: q.FissionCampaignSign.replaceDB(db), + FissionCampaignSlot: q.FissionCampaignSlot.replaceDB(db), + FissionCampaignStyle: q.FissionCampaignStyle.replaceDB(db), + FissionCampaignTask: q.FissionCampaignTask.replaceDB(db), + FissionCampaignTicket: q.FissionCampaignTicket.replaceDB(db), + FissionCampaignUno: q.FissionCampaignUno.replaceDB(db), + FissionCampaignUnoCard: q.FissionCampaignUnoCard.replaceDB(db), + FissionCampaignUnoGroup: q.FissionCampaignUnoGroup.replaceDB(db), + FissionCampaignV: q.FissionCampaignV.replaceDB(db), + FissionCampaignVsSchedule: q.FissionCampaignVsSchedule.replaceDB(db), + FissionCampaignVsTeam: q.FissionCampaignVsTeam.replaceDB(db), + FissionCampaignWheel: q.FissionCampaignWheel.replaceDB(db), + FissionCampaignWin: q.FissionCampaignWin.replaceDB(db), + FissionCash: q.FissionCash.replaceDB(db), + FissionCashRecord: q.FissionCashRecord.replaceDB(db), + FissionChat: q.FissionChat.replaceDB(db), + FissionChatMsg: q.FissionChatMsg.replaceDB(db), + FissionChildUser: q.FissionChildUser.replaceDB(db), + FissionChildUserRecord: q.FissionChildUserRecord.replaceDB(db), + FissionChop: q.FissionChop.replaceDB(db), + FissionChopHelp: q.FissionChopHelp.replaceDB(db), + FissionChopReward: q.FissionChopReward.replaceDB(db), + FissionClientReward: q.FissionClientReward.replaceDB(db), + FissionCoin: q.FissionCoin.replaceDB(db), + FissionCoinLog: q.FissionCoinLog.replaceDB(db), + FissionCoinScene: q.FissionCoinScene.replaceDB(db), + FissionConfig: q.FissionConfig.replaceDB(db), + FissionCustomBtn: q.FissionCustomBtn.replaceDB(db), + FissionDice: q.FissionDice.replaceDB(db), + FissionDiceCollect: q.FissionDiceCollect.replaceDB(db), + FissionDiceMap: q.FissionDiceMap.replaceDB(db), + FissionDiceMapGroup: q.FissionDiceMapGroup.replaceDB(db), + FissionDiceProp: q.FissionDiceProp.replaceDB(db), + FissionDiceRecord: q.FissionDiceRecord.replaceDB(db), + FissionDiceRun: q.FissionDiceRun.replaceDB(db), + FissionFlip: q.FissionFlip.replaceDB(db), + FissionFlipLog: q.FissionFlipLog.replaceDB(db), + FissionGashapon: q.FissionGashapon.replaceDB(db), + FissionGashaponLog: q.FissionGashaponLog.replaceDB(db), + FissionGold: q.FissionGold.replaceDB(db), + FissionGoldLog: q.FissionGoldLog.replaceDB(db), + FissionGrid: q.FissionGrid.replaceDB(db), + FissionGridLog: q.FissionGridLog.replaceDB(db), + FissionGrow: q.FissionGrow.replaceDB(db), + FissionGrowLife: q.FissionGrowLife.replaceDB(db), + FissionGrowRecord: q.FissionGrowRecord.replaceDB(db), + FissionKeep: q.FissionKeep.replaceDB(db), + FissionKeepLog: q.FissionKeepLog.replaceDB(db), + FissionLangModule: q.FissionLangModule.replaceDB(db), + FissionNotify: q.FissionNotify.replaceDB(db), + FissionNotifyResp: q.FissionNotifyResp.replaceDB(db), + FissionNotifyTask: q.FissionNotifyTask.replaceDB(db), + FissionPointDeduct: q.FissionPointDeduct.replaceDB(db), + FissionPointsLog: q.FissionPointsLog.replaceDB(db), + FissionPrizeWheel: q.FissionPrizeWheel.replaceDB(db), + FissionPrizeWheelLog: q.FissionPrizeWheelLog.replaceDB(db), + FissionQa: q.FissionQa.replaceDB(db), + FissionQaLog: q.FissionQaLog.replaceDB(db), + FissionQuiz: q.FissionQuiz.replaceDB(db), + FissionQuizLog: q.FissionQuizLog.replaceDB(db), + FissionReferral: q.FissionReferral.replaceDB(db), + FissionRewardRecord: q.FissionRewardRecord.replaceDB(db), + FissionRewardRecordForm: q.FissionRewardRecordForm.replaceDB(db), + FissionSign: q.FissionSign.replaceDB(db), + FissionSignDay: q.FissionSignDay.replaceDB(db), + FissionSignLog: q.FissionSignLog.replaceDB(db), + FissionSlot: q.FissionSlot.replaceDB(db), + FissionSlotLog: q.FissionSlotLog.replaceDB(db), + FissionTargetRecord: q.FissionTargetRecord.replaceDB(db), + FissionTemp: q.FissionTemp.replaceDB(db), + FissionTempGroup: q.FissionTempGroup.replaceDB(db), + FissionTempGroupLang: q.FissionTempGroupLang.replaceDB(db), + FissionTempImage: q.FissionTempImage.replaceDB(db), + FissionTempLang: q.FissionTempLang.replaceDB(db), + FissionTotal: q.FissionTotal.replaceDB(db), + FissionTotalCycle: q.FissionTotalCycle.replaceDB(db), + FissionUnlockReward: q.FissionUnlockReward.replaceDB(db), + FissionUno: q.FissionUno.replaceDB(db), + FissionUnoCollect: q.FissionUnoCollect.replaceDB(db), + FissionUnoLog: q.FissionUnoLog.replaceDB(db), + FissionUser: q.FissionUser.replaceDB(db), + FissionUserActive: q.FissionUserActive.replaceDB(db), + FissionUserAttr: q.FissionUserAttr.replaceDB(db), + FissionUserAttrTotal: q.FissionUserAttrTotal.replaceDB(db), + FissionUserCond: q.FissionUserCond.replaceDB(db), + FissionUserCondRecord: q.FissionUserCondRecord.replaceDB(db), + FissionUserCtlink: q.FissionUserCtlink.replaceDB(db), + FissionUserDylink: q.FissionUserDylink.replaceDB(db), + FissionUserEvent: q.FissionUserEvent.replaceDB(db), + FissionUserJattr: q.FissionUserJattr.replaceDB(db), + FissionUserLevel: q.FissionUserLevel.replaceDB(db), + FissionUserLevelRelated: q.FissionUserLevelRelated.replaceDB(db), + FissionUserPreCond: q.FissionUserPreCond.replaceDB(db), + FissionUserStat: q.FissionUserStat.replaceDB(db), + FissionUserTaskRecord: q.FissionUserTaskRecord.replaceDB(db), + FissionUserTaskReward: q.FissionUserTaskReward.replaceDB(db), + FissionUserTaskValid: q.FissionUserTaskValid.replaceDB(db), + FissionV: q.FissionV.replaceDB(db), + FissionVsLog: q.FissionVsLog.replaceDB(db), + FissionVsVote: q.FissionVsVote.replaceDB(db), + FissionVsVoteSettlement: q.FissionVsVoteSettlement.replaceDB(db), + FissionWebUser: q.FissionWebUser.replaceDB(db), + FissionWin: q.FissionWin.replaceDB(db), + Form: q.Form.replaceDB(db), + GameAction: q.GameAction.replaceDB(db), + GameLink: q.GameLink.replaceDB(db), + GameTotal: q.GameTotal.replaceDB(db), + GameTotalDate: q.GameTotalDate.replaceDB(db), + GameUser: q.GameUser.replaceDB(db), + Lang: q.Lang.replaceDB(db), + LangTextMark: q.LangTextMark.replaceDB(db), + LibraryQa: q.LibraryQa.replaceDB(db), + LibraryQaGroup: q.LibraryQaGroup.replaceDB(db), + LibraryQaOption: q.LibraryQaOption.replaceDB(db), + LvAPILog: q.LvAPILog.replaceDB(db), + Material: q.Material.replaceDB(db), + ModuleStatisticsEventflow: q.ModuleStatisticsEventflow.replaceDB(db), + NotifyURL: q.NotifyURL.replaceDB(db), + OperateLog: q.OperateLog.replaceDB(db), + Project: q.Project.replaceDB(db), + ProjectAd: q.ProjectAd.replaceDB(db), + ProjectSecret: q.ProjectSecret.replaceDB(db), + ProjectUser: q.ProjectUser.replaceDB(db), + ProjectUserCoin: q.ProjectUserCoin.replaceDB(db), + ProjectUserCoinDeduct: q.ProjectUserCoinDeduct.replaceDB(db), + ProjectUserCoinExpired: q.ProjectUserCoinExpired.replaceDB(db), + ProjectUserCoinLog: q.ProjectUserCoinLog.replaceDB(db), + ProjectUserCoinRecord: q.ProjectUserCoinRecord.replaceDB(db), + ProjectUserCoinUse: q.ProjectUserCoinUse.replaceDB(db), + ProjectUserInfoLog: q.ProjectUserInfoLog.replaceDB(db), + RedeemMall: q.RedeemMall.replaceDB(db), + RedeemMallItem: q.RedeemMallItem.replaceDB(db), + RedeemMallItemTask: q.RedeemMallItemTask.replaceDB(db), + RedeemMallRecord: q.RedeemMallRecord.replaceDB(db), + RedeemMallRelate: q.RedeemMallRelate.replaceDB(db), + Register: q.Register.replaceDB(db), + RegisterAudit: q.RegisterAudit.replaceDB(db), + Reward: q.Reward.replaceDB(db), + RewardLang: q.RewardLang.replaceDB(db), + RewardPush: q.RewardPush.replaceDB(db), + RewardPushLog: q.RewardPushLog.replaceDB(db), + RewardPushTask: q.RewardPushTask.replaceDB(db), + RewardRelated: q.RewardRelated.replaceDB(db), + ServerWhitelist: q.ServerWhitelist.replaceDB(db), + SlowLog: q.SlowLog.replaceDB(db), + TCoin: q.TCoin.replaceDB(db), + TCoinLang: q.TCoinLang.replaceDB(db), + User: q.User.replaceDB(db), + UserBehavior: q.UserBehavior.replaceDB(db), + UserProjectRelate: q.UserProjectRelate.replaceDB(db), + } +} + +type queryCtx struct { + Company *companyDo + CompanyMade *companyMadeDo + CronLog *cronLogDo + ErrLog *errLogDo + ExportTask *exportTaskDo + FissionArchiveTask *fissionArchiveTaskDo + FissionBallot *fissionBallotDo + FissionBallotLog *fissionBallotLogDo + FissionBehavior *fissionBehaviorDo + FissionBlind *fissionBlindDo + FissionBlindLog *fissionBlindLogDo + FissionCampaign *fissionCampaignDo + FissionCampaignBallot *fissionCampaignBallotDo + FissionCampaignBlind *fissionCampaignBlindDo + FissionCampaignCash *fissionCampaignCashDo + FissionCampaignChannel *fissionCampaignChannelDo + FissionCampaignChat *fissionCampaignChatDo + FissionCampaignChild *fissionCampaignChildDo + FissionCampaignChop *fissionCampaignChopDo + FissionCampaignCoin *fissionCampaignCoinDo + FissionCampaignCond *fissionCampaignCondDo + FissionCampaignConfig *fissionCampaignConfigDo + FissionCampaignDice *fissionCampaignDiceDo + FissionCampaignEvent *fissionCampaignEventDo + FissionCampaignFlip *fissionCampaignFlipDo + FissionCampaignGashapon *fissionCampaignGashaponDo + FissionCampaignGold *fissionCampaignGoldDo + FissionCampaignGrid *fissionCampaignGridDo + FissionCampaignGrow *fissionCampaignGrowDo + FissionCampaignGrowStep *fissionCampaignGrowStepDo + FissionCampaignKeep *fissionCampaignKeepDo + FissionCampaignKeepStep *fissionCampaignKeepStepDo + FissionCampaignLang *fissionCampaignLangDo + FissionCampaignLongImg *fissionCampaignLongImgDo + FissionCampaignLongImgZone *fissionCampaignLongImgZoneDo + FissionCampaignPointsUse *fissionCampaignPointsUseDo + FissionCampaignPush *fissionCampaignPushDo + FissionCampaignQa *fissionCampaignQaDo + FissionCampaignQaOption *fissionCampaignQaOptionDo + FissionCampaignQaQuestion *fissionCampaignQaQuestionDo + FissionCampaignQuiz *fissionCampaignQuizDo + FissionCampaignQuizOption *fissionCampaignQuizOptionDo + FissionCampaignReferral *fissionCampaignReferralDo + FissionCampaignReward *fissionCampaignRewardDo + FissionCampaignRewardAdd *fissionCampaignRewardAddDo + FissionCampaignRewardAddLog *fissionCampaignRewardAddLogDo + FissionCampaignRewardRule *fissionCampaignRewardRuleDo + FissionCampaignSign *fissionCampaignSignDo + FissionCampaignSlot *fissionCampaignSlotDo + FissionCampaignStyle *fissionCampaignStyleDo + FissionCampaignTask *fissionCampaignTaskDo + FissionCampaignTicket *fissionCampaignTicketDo + FissionCampaignUno *fissionCampaignUnoDo + FissionCampaignUnoCard *fissionCampaignUnoCardDo + FissionCampaignUnoGroup *fissionCampaignUnoGroupDo + FissionCampaignV *fissionCampaignVDo + FissionCampaignVsSchedule *fissionCampaignVsScheduleDo + FissionCampaignVsTeam *fissionCampaignVsTeamDo + FissionCampaignWheel *fissionCampaignWheelDo + FissionCampaignWin *fissionCampaignWinDo + FissionCash *fissionCashDo + FissionCashRecord *fissionCashRecordDo + FissionChat *fissionChatDo + FissionChatMsg *fissionChatMsgDo + FissionChildUser *fissionChildUserDo + FissionChildUserRecord *fissionChildUserRecordDo + FissionChop *fissionChopDo + FissionChopHelp *fissionChopHelpDo + FissionChopReward *fissionChopRewardDo + FissionClientReward *fissionClientRewardDo + FissionCoin *fissionCoinDo + FissionCoinLog *fissionCoinLogDo + FissionCoinScene *fissionCoinSceneDo + FissionConfig *fissionConfigDo + FissionCustomBtn *fissionCustomBtnDo + FissionDice *fissionDiceDo + FissionDiceCollect *fissionDiceCollectDo + FissionDiceMap *fissionDiceMapDo + FissionDiceMapGroup *fissionDiceMapGroupDo + FissionDiceProp *fissionDicePropDo + FissionDiceRecord *fissionDiceRecordDo + FissionDiceRun *fissionDiceRunDo + FissionFlip *fissionFlipDo + FissionFlipLog *fissionFlipLogDo + FissionGashapon *fissionGashaponDo + FissionGashaponLog *fissionGashaponLogDo + FissionGold *fissionGoldDo + FissionGoldLog *fissionGoldLogDo + FissionGrid *fissionGridDo + FissionGridLog *fissionGridLogDo + FissionGrow *fissionGrowDo + FissionGrowLife *fissionGrowLifeDo + FissionGrowRecord *fissionGrowRecordDo + FissionKeep *fissionKeepDo + FissionKeepLog *fissionKeepLogDo + FissionLangModule *fissionLangModuleDo + FissionNotify *fissionNotifyDo + FissionNotifyResp *fissionNotifyRespDo + FissionNotifyTask *fissionNotifyTaskDo + FissionPointDeduct *fissionPointDeductDo + FissionPointsLog *fissionPointsLogDo + FissionPrizeWheel *fissionPrizeWheelDo + FissionPrizeWheelLog *fissionPrizeWheelLogDo + FissionQa *fissionQaDo + FissionQaLog *fissionQaLogDo + FissionQuiz *fissionQuizDo + FissionQuizLog *fissionQuizLogDo + FissionReferral *fissionReferralDo + FissionRewardRecord *fissionRewardRecordDo + FissionRewardRecordForm *fissionRewardRecordFormDo + FissionSign *fissionSignDo + FissionSignDay *fissionSignDayDo + FissionSignLog *fissionSignLogDo + FissionSlot *fissionSlotDo + FissionSlotLog *fissionSlotLogDo + FissionTargetRecord *fissionTargetRecordDo + FissionTemp *fissionTempDo + FissionTempGroup *fissionTempGroupDo + FissionTempGroupLang *fissionTempGroupLangDo + FissionTempImage *fissionTempImageDo + FissionTempLang *fissionTempLangDo + FissionTotal *fissionTotalDo + FissionTotalCycle *fissionTotalCycleDo + FissionUnlockReward *fissionUnlockRewardDo + FissionUno *fissionUnoDo + FissionUnoCollect *fissionUnoCollectDo + FissionUnoLog *fissionUnoLogDo + FissionUser *fissionUserDo + FissionUserActive *fissionUserActiveDo + FissionUserAttr *fissionUserAttrDo + FissionUserAttrTotal *fissionUserAttrTotalDo + FissionUserCond *fissionUserCondDo + FissionUserCondRecord *fissionUserCondRecordDo + FissionUserCtlink *fissionUserCtlinkDo + FissionUserDylink *fissionUserDylinkDo + FissionUserEvent *fissionUserEventDo + FissionUserJattr *fissionUserJattrDo + FissionUserLevel *fissionUserLevelDo + FissionUserLevelRelated *fissionUserLevelRelatedDo + FissionUserPreCond *fissionUserPreCondDo + FissionUserStat *fissionUserStatDo + FissionUserTaskRecord *fissionUserTaskRecordDo + FissionUserTaskReward *fissionUserTaskRewardDo + FissionUserTaskValid *fissionUserTaskValidDo + FissionV *fissionVDo + FissionVsLog *fissionVsLogDo + FissionVsVote *fissionVsVoteDo + FissionVsVoteSettlement *fissionVsVoteSettlementDo + FissionWebUser *fissionWebUserDo + FissionWin *fissionWinDo + Form *formDo + GameAction *gameActionDo + GameLink *gameLinkDo + GameTotal *gameTotalDo + GameTotalDate *gameTotalDateDo + GameUser *gameUserDo + Lang *langDo + LangTextMark *langTextMarkDo + LibraryQa *libraryQaDo + LibraryQaGroup *libraryQaGroupDo + LibraryQaOption *libraryQaOptionDo + LvAPILog *lvAPILogDo + Material *materialDo + ModuleStatisticsEventflow *moduleStatisticsEventflowDo + NotifyURL *notifyURLDo + OperateLog *operateLogDo + Project *projectDo + ProjectAd *projectAdDo + ProjectSecret *projectSecretDo + ProjectUser *projectUserDo + ProjectUserCoin *projectUserCoinDo + ProjectUserCoinDeduct *projectUserCoinDeductDo + ProjectUserCoinExpired *projectUserCoinExpiredDo + ProjectUserCoinLog *projectUserCoinLogDo + ProjectUserCoinRecord *projectUserCoinRecordDo + ProjectUserCoinUse *projectUserCoinUseDo + ProjectUserInfoLog *projectUserInfoLogDo + RedeemMall *redeemMallDo + RedeemMallItem *redeemMallItemDo + RedeemMallItemTask *redeemMallItemTaskDo + RedeemMallRecord *redeemMallRecordDo + RedeemMallRelate *redeemMallRelateDo + Register *registerDo + RegisterAudit *registerAuditDo + Reward *rewardDo + RewardLang *rewardLangDo + RewardPush *rewardPushDo + RewardPushLog *rewardPushLogDo + RewardPushTask *rewardPushTaskDo + RewardRelated *rewardRelatedDo + ServerWhitelist *serverWhitelistDo + SlowLog *slowLogDo + TCoin *tCoinDo + TCoinLang *tCoinLangDo + User *userDo + UserBehavior *userBehaviorDo + UserProjectRelate *userProjectRelateDo +} + +func (q *Query) WithContext(ctx context.Context) *queryCtx { + return &queryCtx{ + Company: q.Company.WithContext(ctx), + CompanyMade: q.CompanyMade.WithContext(ctx), + CronLog: q.CronLog.WithContext(ctx), + ErrLog: q.ErrLog.WithContext(ctx), + ExportTask: q.ExportTask.WithContext(ctx), + FissionArchiveTask: q.FissionArchiveTask.WithContext(ctx), + FissionBallot: q.FissionBallot.WithContext(ctx), + FissionBallotLog: q.FissionBallotLog.WithContext(ctx), + FissionBehavior: q.FissionBehavior.WithContext(ctx), + FissionBlind: q.FissionBlind.WithContext(ctx), + FissionBlindLog: q.FissionBlindLog.WithContext(ctx), + FissionCampaign: q.FissionCampaign.WithContext(ctx), + FissionCampaignBallot: q.FissionCampaignBallot.WithContext(ctx), + FissionCampaignBlind: q.FissionCampaignBlind.WithContext(ctx), + FissionCampaignCash: q.FissionCampaignCash.WithContext(ctx), + FissionCampaignChannel: q.FissionCampaignChannel.WithContext(ctx), + FissionCampaignChat: q.FissionCampaignChat.WithContext(ctx), + FissionCampaignChild: q.FissionCampaignChild.WithContext(ctx), + FissionCampaignChop: q.FissionCampaignChop.WithContext(ctx), + FissionCampaignCoin: q.FissionCampaignCoin.WithContext(ctx), + FissionCampaignCond: q.FissionCampaignCond.WithContext(ctx), + FissionCampaignConfig: q.FissionCampaignConfig.WithContext(ctx), + FissionCampaignDice: q.FissionCampaignDice.WithContext(ctx), + FissionCampaignEvent: q.FissionCampaignEvent.WithContext(ctx), + FissionCampaignFlip: q.FissionCampaignFlip.WithContext(ctx), + FissionCampaignGashapon: q.FissionCampaignGashapon.WithContext(ctx), + FissionCampaignGold: q.FissionCampaignGold.WithContext(ctx), + FissionCampaignGrid: q.FissionCampaignGrid.WithContext(ctx), + FissionCampaignGrow: q.FissionCampaignGrow.WithContext(ctx), + FissionCampaignGrowStep: q.FissionCampaignGrowStep.WithContext(ctx), + FissionCampaignKeep: q.FissionCampaignKeep.WithContext(ctx), + FissionCampaignKeepStep: q.FissionCampaignKeepStep.WithContext(ctx), + FissionCampaignLang: q.FissionCampaignLang.WithContext(ctx), + FissionCampaignLongImg: q.FissionCampaignLongImg.WithContext(ctx), + FissionCampaignLongImgZone: q.FissionCampaignLongImgZone.WithContext(ctx), + FissionCampaignPointsUse: q.FissionCampaignPointsUse.WithContext(ctx), + FissionCampaignPush: q.FissionCampaignPush.WithContext(ctx), + FissionCampaignQa: q.FissionCampaignQa.WithContext(ctx), + FissionCampaignQaOption: q.FissionCampaignQaOption.WithContext(ctx), + FissionCampaignQaQuestion: q.FissionCampaignQaQuestion.WithContext(ctx), + FissionCampaignQuiz: q.FissionCampaignQuiz.WithContext(ctx), + FissionCampaignQuizOption: q.FissionCampaignQuizOption.WithContext(ctx), + FissionCampaignReferral: q.FissionCampaignReferral.WithContext(ctx), + FissionCampaignReward: q.FissionCampaignReward.WithContext(ctx), + FissionCampaignRewardAdd: q.FissionCampaignRewardAdd.WithContext(ctx), + FissionCampaignRewardAddLog: q.FissionCampaignRewardAddLog.WithContext(ctx), + FissionCampaignRewardRule: q.FissionCampaignRewardRule.WithContext(ctx), + FissionCampaignSign: q.FissionCampaignSign.WithContext(ctx), + FissionCampaignSlot: q.FissionCampaignSlot.WithContext(ctx), + FissionCampaignStyle: q.FissionCampaignStyle.WithContext(ctx), + FissionCampaignTask: q.FissionCampaignTask.WithContext(ctx), + FissionCampaignTicket: q.FissionCampaignTicket.WithContext(ctx), + FissionCampaignUno: q.FissionCampaignUno.WithContext(ctx), + FissionCampaignUnoCard: q.FissionCampaignUnoCard.WithContext(ctx), + FissionCampaignUnoGroup: q.FissionCampaignUnoGroup.WithContext(ctx), + FissionCampaignV: q.FissionCampaignV.WithContext(ctx), + FissionCampaignVsSchedule: q.FissionCampaignVsSchedule.WithContext(ctx), + FissionCampaignVsTeam: q.FissionCampaignVsTeam.WithContext(ctx), + FissionCampaignWheel: q.FissionCampaignWheel.WithContext(ctx), + FissionCampaignWin: q.FissionCampaignWin.WithContext(ctx), + FissionCash: q.FissionCash.WithContext(ctx), + FissionCashRecord: q.FissionCashRecord.WithContext(ctx), + FissionChat: q.FissionChat.WithContext(ctx), + FissionChatMsg: q.FissionChatMsg.WithContext(ctx), + FissionChildUser: q.FissionChildUser.WithContext(ctx), + FissionChildUserRecord: q.FissionChildUserRecord.WithContext(ctx), + FissionChop: q.FissionChop.WithContext(ctx), + FissionChopHelp: q.FissionChopHelp.WithContext(ctx), + FissionChopReward: q.FissionChopReward.WithContext(ctx), + FissionClientReward: q.FissionClientReward.WithContext(ctx), + FissionCoin: q.FissionCoin.WithContext(ctx), + FissionCoinLog: q.FissionCoinLog.WithContext(ctx), + FissionCoinScene: q.FissionCoinScene.WithContext(ctx), + FissionConfig: q.FissionConfig.WithContext(ctx), + FissionCustomBtn: q.FissionCustomBtn.WithContext(ctx), + FissionDice: q.FissionDice.WithContext(ctx), + FissionDiceCollect: q.FissionDiceCollect.WithContext(ctx), + FissionDiceMap: q.FissionDiceMap.WithContext(ctx), + FissionDiceMapGroup: q.FissionDiceMapGroup.WithContext(ctx), + FissionDiceProp: q.FissionDiceProp.WithContext(ctx), + FissionDiceRecord: q.FissionDiceRecord.WithContext(ctx), + FissionDiceRun: q.FissionDiceRun.WithContext(ctx), + FissionFlip: q.FissionFlip.WithContext(ctx), + FissionFlipLog: q.FissionFlipLog.WithContext(ctx), + FissionGashapon: q.FissionGashapon.WithContext(ctx), + FissionGashaponLog: q.FissionGashaponLog.WithContext(ctx), + FissionGold: q.FissionGold.WithContext(ctx), + FissionGoldLog: q.FissionGoldLog.WithContext(ctx), + FissionGrid: q.FissionGrid.WithContext(ctx), + FissionGridLog: q.FissionGridLog.WithContext(ctx), + FissionGrow: q.FissionGrow.WithContext(ctx), + FissionGrowLife: q.FissionGrowLife.WithContext(ctx), + FissionGrowRecord: q.FissionGrowRecord.WithContext(ctx), + FissionKeep: q.FissionKeep.WithContext(ctx), + FissionKeepLog: q.FissionKeepLog.WithContext(ctx), + FissionLangModule: q.FissionLangModule.WithContext(ctx), + FissionNotify: q.FissionNotify.WithContext(ctx), + FissionNotifyResp: q.FissionNotifyResp.WithContext(ctx), + FissionNotifyTask: q.FissionNotifyTask.WithContext(ctx), + FissionPointDeduct: q.FissionPointDeduct.WithContext(ctx), + FissionPointsLog: q.FissionPointsLog.WithContext(ctx), + FissionPrizeWheel: q.FissionPrizeWheel.WithContext(ctx), + FissionPrizeWheelLog: q.FissionPrizeWheelLog.WithContext(ctx), + FissionQa: q.FissionQa.WithContext(ctx), + FissionQaLog: q.FissionQaLog.WithContext(ctx), + FissionQuiz: q.FissionQuiz.WithContext(ctx), + FissionQuizLog: q.FissionQuizLog.WithContext(ctx), + FissionReferral: q.FissionReferral.WithContext(ctx), + FissionRewardRecord: q.FissionRewardRecord.WithContext(ctx), + FissionRewardRecordForm: q.FissionRewardRecordForm.WithContext(ctx), + FissionSign: q.FissionSign.WithContext(ctx), + FissionSignDay: q.FissionSignDay.WithContext(ctx), + FissionSignLog: q.FissionSignLog.WithContext(ctx), + FissionSlot: q.FissionSlot.WithContext(ctx), + FissionSlotLog: q.FissionSlotLog.WithContext(ctx), + FissionTargetRecord: q.FissionTargetRecord.WithContext(ctx), + FissionTemp: q.FissionTemp.WithContext(ctx), + FissionTempGroup: q.FissionTempGroup.WithContext(ctx), + FissionTempGroupLang: q.FissionTempGroupLang.WithContext(ctx), + FissionTempImage: q.FissionTempImage.WithContext(ctx), + FissionTempLang: q.FissionTempLang.WithContext(ctx), + FissionTotal: q.FissionTotal.WithContext(ctx), + FissionTotalCycle: q.FissionTotalCycle.WithContext(ctx), + FissionUnlockReward: q.FissionUnlockReward.WithContext(ctx), + FissionUno: q.FissionUno.WithContext(ctx), + FissionUnoCollect: q.FissionUnoCollect.WithContext(ctx), + FissionUnoLog: q.FissionUnoLog.WithContext(ctx), + FissionUser: q.FissionUser.WithContext(ctx), + FissionUserActive: q.FissionUserActive.WithContext(ctx), + FissionUserAttr: q.FissionUserAttr.WithContext(ctx), + FissionUserAttrTotal: q.FissionUserAttrTotal.WithContext(ctx), + FissionUserCond: q.FissionUserCond.WithContext(ctx), + FissionUserCondRecord: q.FissionUserCondRecord.WithContext(ctx), + FissionUserCtlink: q.FissionUserCtlink.WithContext(ctx), + FissionUserDylink: q.FissionUserDylink.WithContext(ctx), + FissionUserEvent: q.FissionUserEvent.WithContext(ctx), + FissionUserJattr: q.FissionUserJattr.WithContext(ctx), + FissionUserLevel: q.FissionUserLevel.WithContext(ctx), + FissionUserLevelRelated: q.FissionUserLevelRelated.WithContext(ctx), + FissionUserPreCond: q.FissionUserPreCond.WithContext(ctx), + FissionUserStat: q.FissionUserStat.WithContext(ctx), + FissionUserTaskRecord: q.FissionUserTaskRecord.WithContext(ctx), + FissionUserTaskReward: q.FissionUserTaskReward.WithContext(ctx), + FissionUserTaskValid: q.FissionUserTaskValid.WithContext(ctx), + FissionV: q.FissionV.WithContext(ctx), + FissionVsLog: q.FissionVsLog.WithContext(ctx), + FissionVsVote: q.FissionVsVote.WithContext(ctx), + FissionVsVoteSettlement: q.FissionVsVoteSettlement.WithContext(ctx), + FissionWebUser: q.FissionWebUser.WithContext(ctx), + FissionWin: q.FissionWin.WithContext(ctx), + Form: q.Form.WithContext(ctx), + GameAction: q.GameAction.WithContext(ctx), + GameLink: q.GameLink.WithContext(ctx), + GameTotal: q.GameTotal.WithContext(ctx), + GameTotalDate: q.GameTotalDate.WithContext(ctx), + GameUser: q.GameUser.WithContext(ctx), + Lang: q.Lang.WithContext(ctx), + LangTextMark: q.LangTextMark.WithContext(ctx), + LibraryQa: q.LibraryQa.WithContext(ctx), + LibraryQaGroup: q.LibraryQaGroup.WithContext(ctx), + LibraryQaOption: q.LibraryQaOption.WithContext(ctx), + LvAPILog: q.LvAPILog.WithContext(ctx), + Material: q.Material.WithContext(ctx), + ModuleStatisticsEventflow: q.ModuleStatisticsEventflow.WithContext(ctx), + NotifyURL: q.NotifyURL.WithContext(ctx), + OperateLog: q.OperateLog.WithContext(ctx), + Project: q.Project.WithContext(ctx), + ProjectAd: q.ProjectAd.WithContext(ctx), + ProjectSecret: q.ProjectSecret.WithContext(ctx), + ProjectUser: q.ProjectUser.WithContext(ctx), + ProjectUserCoin: q.ProjectUserCoin.WithContext(ctx), + ProjectUserCoinDeduct: q.ProjectUserCoinDeduct.WithContext(ctx), + ProjectUserCoinExpired: q.ProjectUserCoinExpired.WithContext(ctx), + ProjectUserCoinLog: q.ProjectUserCoinLog.WithContext(ctx), + ProjectUserCoinRecord: q.ProjectUserCoinRecord.WithContext(ctx), + ProjectUserCoinUse: q.ProjectUserCoinUse.WithContext(ctx), + ProjectUserInfoLog: q.ProjectUserInfoLog.WithContext(ctx), + RedeemMall: q.RedeemMall.WithContext(ctx), + RedeemMallItem: q.RedeemMallItem.WithContext(ctx), + RedeemMallItemTask: q.RedeemMallItemTask.WithContext(ctx), + RedeemMallRecord: q.RedeemMallRecord.WithContext(ctx), + RedeemMallRelate: q.RedeemMallRelate.WithContext(ctx), + Register: q.Register.WithContext(ctx), + RegisterAudit: q.RegisterAudit.WithContext(ctx), + Reward: q.Reward.WithContext(ctx), + RewardLang: q.RewardLang.WithContext(ctx), + RewardPush: q.RewardPush.WithContext(ctx), + RewardPushLog: q.RewardPushLog.WithContext(ctx), + RewardPushTask: q.RewardPushTask.WithContext(ctx), + RewardRelated: q.RewardRelated.WithContext(ctx), + ServerWhitelist: q.ServerWhitelist.WithContext(ctx), + SlowLog: q.SlowLog.WithContext(ctx), + TCoin: q.TCoin.WithContext(ctx), + TCoinLang: q.TCoinLang.WithContext(ctx), + User: q.User.WithContext(ctx), + UserBehavior: q.UserBehavior.WithContext(ctx), + UserProjectRelate: q.UserProjectRelate.WithContext(ctx), + } +} + +func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error { + return q.db.Transaction(func(tx *gorm.DB) error { return fc(q.clone(tx)) }, opts...) +} + +func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx { + tx := q.db.Begin(opts...) + return &QueryTx{Query: q.clone(tx), Error: tx.Error} +} + +type QueryTx struct { + *Query + Error error +} + +func (q *QueryTx) Commit() error { + return q.db.Commit().Error +} + +func (q *QueryTx) Rollback() error { + return q.db.Rollback().Error +} + +func (q *QueryTx) SavePoint(name string) error { + return q.db.SavePoint(name).Error +} + +func (q *QueryTx) RollbackTo(name string) error { + return q.db.RollbackTo(name).Error +} diff --git a/internal/repository/dao/lang.gen.go b/internal/repository/dao/lang.gen.go new file mode 100644 index 0000000..25875cb --- /dev/null +++ b/internal/repository/dao/lang.gen.go @@ -0,0 +1,349 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newLang(db *gorm.DB, opts ...gen.DOOption) lang { + _lang := lang{} + + _lang.langDo.UseDB(db, opts...) + _lang.langDo.UseModel(&model.Lang{}) + + tableName := _lang.langDo.TableName() + _lang.ALL = field.NewAsterisk(tableName) + _lang.ID = field.NewInt64(tableName, "id") + _lang.CreatedAt = field.NewInt64(tableName, "created_at") + _lang.UpdatedAt = field.NewInt64(tableName, "updated_at") + _lang.Mark = field.NewString(tableName, "mark") + _lang.LangMark = field.NewString(tableName, "lang_mark") + _lang.LangText = field.NewString(tableName, "lang_text") + + _lang.fillFieldMap() + + return _lang +} + +type lang struct { + langDo langDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + Mark field.String // 语种标识 + LangMark field.String // 语言唯一标识 + LangText field.String // 对应语种的翻译文案 + + fieldMap map[string]field.Expr +} + +func (l lang) Table(newTableName string) *lang { + l.langDo.UseTable(newTableName) + return l.updateTableName(newTableName) +} + +func (l lang) As(alias string) *lang { + l.langDo.DO = *(l.langDo.As(alias).(*gen.DO)) + return l.updateTableName(alias) +} + +func (l *lang) updateTableName(table string) *lang { + l.ALL = field.NewAsterisk(table) + l.ID = field.NewInt64(table, "id") + l.CreatedAt = field.NewInt64(table, "created_at") + l.UpdatedAt = field.NewInt64(table, "updated_at") + l.Mark = field.NewString(table, "mark") + l.LangMark = field.NewString(table, "lang_mark") + l.LangText = field.NewString(table, "lang_text") + + l.fillFieldMap() + + return l +} + +func (l *lang) WithContext(ctx context.Context) *langDo { return l.langDo.WithContext(ctx) } + +func (l lang) TableName() string { return l.langDo.TableName() } + +func (l lang) Alias() string { return l.langDo.Alias() } + +func (l *lang) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := l.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (l *lang) fillFieldMap() { + l.fieldMap = make(map[string]field.Expr, 6) + l.fieldMap["id"] = l.ID + l.fieldMap["created_at"] = l.CreatedAt + l.fieldMap["updated_at"] = l.UpdatedAt + l.fieldMap["mark"] = l.Mark + l.fieldMap["lang_mark"] = l.LangMark + l.fieldMap["lang_text"] = l.LangText +} + +func (l lang) clone(db *gorm.DB) lang { + l.langDo.ReplaceConnPool(db.Statement.ConnPool) + return l +} + +func (l lang) replaceDB(db *gorm.DB) lang { + l.langDo.ReplaceDB(db) + return l +} + +type langDo struct{ gen.DO } + +func (l langDo) Debug() *langDo { + return l.withDO(l.DO.Debug()) +} + +func (l langDo) WithContext(ctx context.Context) *langDo { + return l.withDO(l.DO.WithContext(ctx)) +} + +func (l langDo) ReadDB() *langDo { + return l.Clauses(dbresolver.Read) +} + +func (l langDo) WriteDB() *langDo { + return l.Clauses(dbresolver.Write) +} + +func (l langDo) Session(config *gorm.Session) *langDo { + return l.withDO(l.DO.Session(config)) +} + +func (l langDo) Clauses(conds ...clause.Expression) *langDo { + return l.withDO(l.DO.Clauses(conds...)) +} + +func (l langDo) Returning(value interface{}, columns ...string) *langDo { + return l.withDO(l.DO.Returning(value, columns...)) +} + +func (l langDo) Not(conds ...gen.Condition) *langDo { + return l.withDO(l.DO.Not(conds...)) +} + +func (l langDo) Or(conds ...gen.Condition) *langDo { + return l.withDO(l.DO.Or(conds...)) +} + +func (l langDo) Select(conds ...field.Expr) *langDo { + return l.withDO(l.DO.Select(conds...)) +} + +func (l langDo) Where(conds ...gen.Condition) *langDo { + return l.withDO(l.DO.Where(conds...)) +} + +func (l langDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *langDo { + return l.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (l langDo) Order(conds ...field.Expr) *langDo { + return l.withDO(l.DO.Order(conds...)) +} + +func (l langDo) Distinct(cols ...field.Expr) *langDo { + return l.withDO(l.DO.Distinct(cols...)) +} + +func (l langDo) Omit(cols ...field.Expr) *langDo { + return l.withDO(l.DO.Omit(cols...)) +} + +func (l langDo) Join(table schema.Tabler, on ...field.Expr) *langDo { + return l.withDO(l.DO.Join(table, on...)) +} + +func (l langDo) LeftJoin(table schema.Tabler, on ...field.Expr) *langDo { + return l.withDO(l.DO.LeftJoin(table, on...)) +} + +func (l langDo) RightJoin(table schema.Tabler, on ...field.Expr) *langDo { + return l.withDO(l.DO.RightJoin(table, on...)) +} + +func (l langDo) Group(cols ...field.Expr) *langDo { + return l.withDO(l.DO.Group(cols...)) +} + +func (l langDo) Having(conds ...gen.Condition) *langDo { + return l.withDO(l.DO.Having(conds...)) +} + +func (l langDo) Limit(limit int) *langDo { + return l.withDO(l.DO.Limit(limit)) +} + +func (l langDo) Offset(offset int) *langDo { + return l.withDO(l.DO.Offset(offset)) +} + +func (l langDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *langDo { + return l.withDO(l.DO.Scopes(funcs...)) +} + +func (l langDo) Unscoped() *langDo { + return l.withDO(l.DO.Unscoped()) +} + +func (l langDo) Create(values ...*model.Lang) error { + if len(values) == 0 { + return nil + } + return l.DO.Create(values) +} + +func (l langDo) CreateInBatches(values []*model.Lang, batchSize int) error { + return l.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (l langDo) Save(values ...*model.Lang) error { + if len(values) == 0 { + return nil + } + return l.DO.Save(values) +} + +func (l langDo) First() (*model.Lang, error) { + if result, err := l.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Lang), nil + } +} + +func (l langDo) Take() (*model.Lang, error) { + if result, err := l.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Lang), nil + } +} + +func (l langDo) Last() (*model.Lang, error) { + if result, err := l.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Lang), nil + } +} + +func (l langDo) Find() ([]*model.Lang, error) { + result, err := l.DO.Find() + return result.([]*model.Lang), err +} + +func (l langDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Lang, err error) { + buf := make([]*model.Lang, 0, batchSize) + err = l.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (l langDo) FindInBatches(result *[]*model.Lang, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return l.DO.FindInBatches(result, batchSize, fc) +} + +func (l langDo) Attrs(attrs ...field.AssignExpr) *langDo { + return l.withDO(l.DO.Attrs(attrs...)) +} + +func (l langDo) Assign(attrs ...field.AssignExpr) *langDo { + return l.withDO(l.DO.Assign(attrs...)) +} + +func (l langDo) Joins(fields ...field.RelationField) *langDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Joins(_f)) + } + return &l +} + +func (l langDo) Preload(fields ...field.RelationField) *langDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Preload(_f)) + } + return &l +} + +func (l langDo) FirstOrInit() (*model.Lang, error) { + if result, err := l.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Lang), nil + } +} + +func (l langDo) FirstOrCreate() (*model.Lang, error) { + if result, err := l.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Lang), nil + } +} + +func (l langDo) FindByPage(offset int, limit int) (result []*model.Lang, count int64, err error) { + result, err = l.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = l.Offset(-1).Limit(-1).Count() + return +} + +func (l langDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = l.Count() + if err != nil { + return + } + + err = l.Offset(offset).Limit(limit).Scan(result) + return +} + +func (l langDo) Scan(result interface{}) (err error) { + return l.DO.Scan(result) +} + +func (l langDo) Delete(models ...*model.Lang) (result gen.ResultInfo, err error) { + return l.DO.Delete(models) +} + +func (l *langDo) withDO(do gen.Dao) *langDo { + l.DO = *do.(*gen.DO) + return l +} diff --git a/internal/repository/dao/lang_text_mark.gen.go b/internal/repository/dao/lang_text_mark.gen.go new file mode 100644 index 0000000..260fe95 --- /dev/null +++ b/internal/repository/dao/lang_text_mark.gen.go @@ -0,0 +1,347 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newLangTextMark(db *gorm.DB, opts ...gen.DOOption) langTextMark { + _langTextMark := langTextMark{} + + _langTextMark.langTextMarkDo.UseDB(db, opts...) + _langTextMark.langTextMarkDo.UseModel(&model.LangTextMark{}) + + tableName := _langTextMark.langTextMarkDo.TableName() + _langTextMark.ALL = field.NewAsterisk(tableName) + _langTextMark.ID = field.NewInt64(tableName, "id") + _langTextMark.CreatedAt = field.NewInt64(tableName, "created_at") + _langTextMark.UpdatedAt = field.NewInt64(tableName, "updated_at") + _langTextMark.Mark = field.NewString(tableName, "mark") + _langTextMark.Text = field.NewString(tableName, "text") + + _langTextMark.fillFieldMap() + + return _langTextMark +} + +type langTextMark struct { + langTextMarkDo langTextMarkDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + Mark field.String // 语言唯一标识 + Text field.String // 对应语种的翻译文案 + + fieldMap map[string]field.Expr +} + +func (l langTextMark) Table(newTableName string) *langTextMark { + l.langTextMarkDo.UseTable(newTableName) + return l.updateTableName(newTableName) +} + +func (l langTextMark) As(alias string) *langTextMark { + l.langTextMarkDo.DO = *(l.langTextMarkDo.As(alias).(*gen.DO)) + return l.updateTableName(alias) +} + +func (l *langTextMark) updateTableName(table string) *langTextMark { + l.ALL = field.NewAsterisk(table) + l.ID = field.NewInt64(table, "id") + l.CreatedAt = field.NewInt64(table, "created_at") + l.UpdatedAt = field.NewInt64(table, "updated_at") + l.Mark = field.NewString(table, "mark") + l.Text = field.NewString(table, "text") + + l.fillFieldMap() + + return l +} + +func (l *langTextMark) WithContext(ctx context.Context) *langTextMarkDo { + return l.langTextMarkDo.WithContext(ctx) +} + +func (l langTextMark) TableName() string { return l.langTextMarkDo.TableName() } + +func (l langTextMark) Alias() string { return l.langTextMarkDo.Alias() } + +func (l *langTextMark) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := l.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (l *langTextMark) fillFieldMap() { + l.fieldMap = make(map[string]field.Expr, 5) + l.fieldMap["id"] = l.ID + l.fieldMap["created_at"] = l.CreatedAt + l.fieldMap["updated_at"] = l.UpdatedAt + l.fieldMap["mark"] = l.Mark + l.fieldMap["text"] = l.Text +} + +func (l langTextMark) clone(db *gorm.DB) langTextMark { + l.langTextMarkDo.ReplaceConnPool(db.Statement.ConnPool) + return l +} + +func (l langTextMark) replaceDB(db *gorm.DB) langTextMark { + l.langTextMarkDo.ReplaceDB(db) + return l +} + +type langTextMarkDo struct{ gen.DO } + +func (l langTextMarkDo) Debug() *langTextMarkDo { + return l.withDO(l.DO.Debug()) +} + +func (l langTextMarkDo) WithContext(ctx context.Context) *langTextMarkDo { + return l.withDO(l.DO.WithContext(ctx)) +} + +func (l langTextMarkDo) ReadDB() *langTextMarkDo { + return l.Clauses(dbresolver.Read) +} + +func (l langTextMarkDo) WriteDB() *langTextMarkDo { + return l.Clauses(dbresolver.Write) +} + +func (l langTextMarkDo) Session(config *gorm.Session) *langTextMarkDo { + return l.withDO(l.DO.Session(config)) +} + +func (l langTextMarkDo) Clauses(conds ...clause.Expression) *langTextMarkDo { + return l.withDO(l.DO.Clauses(conds...)) +} + +func (l langTextMarkDo) Returning(value interface{}, columns ...string) *langTextMarkDo { + return l.withDO(l.DO.Returning(value, columns...)) +} + +func (l langTextMarkDo) Not(conds ...gen.Condition) *langTextMarkDo { + return l.withDO(l.DO.Not(conds...)) +} + +func (l langTextMarkDo) Or(conds ...gen.Condition) *langTextMarkDo { + return l.withDO(l.DO.Or(conds...)) +} + +func (l langTextMarkDo) Select(conds ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.Select(conds...)) +} + +func (l langTextMarkDo) Where(conds ...gen.Condition) *langTextMarkDo { + return l.withDO(l.DO.Where(conds...)) +} + +func (l langTextMarkDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *langTextMarkDo { + return l.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (l langTextMarkDo) Order(conds ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.Order(conds...)) +} + +func (l langTextMarkDo) Distinct(cols ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.Distinct(cols...)) +} + +func (l langTextMarkDo) Omit(cols ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.Omit(cols...)) +} + +func (l langTextMarkDo) Join(table schema.Tabler, on ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.Join(table, on...)) +} + +func (l langTextMarkDo) LeftJoin(table schema.Tabler, on ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.LeftJoin(table, on...)) +} + +func (l langTextMarkDo) RightJoin(table schema.Tabler, on ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.RightJoin(table, on...)) +} + +func (l langTextMarkDo) Group(cols ...field.Expr) *langTextMarkDo { + return l.withDO(l.DO.Group(cols...)) +} + +func (l langTextMarkDo) Having(conds ...gen.Condition) *langTextMarkDo { + return l.withDO(l.DO.Having(conds...)) +} + +func (l langTextMarkDo) Limit(limit int) *langTextMarkDo { + return l.withDO(l.DO.Limit(limit)) +} + +func (l langTextMarkDo) Offset(offset int) *langTextMarkDo { + return l.withDO(l.DO.Offset(offset)) +} + +func (l langTextMarkDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *langTextMarkDo { + return l.withDO(l.DO.Scopes(funcs...)) +} + +func (l langTextMarkDo) Unscoped() *langTextMarkDo { + return l.withDO(l.DO.Unscoped()) +} + +func (l langTextMarkDo) Create(values ...*model.LangTextMark) error { + if len(values) == 0 { + return nil + } + return l.DO.Create(values) +} + +func (l langTextMarkDo) CreateInBatches(values []*model.LangTextMark, batchSize int) error { + return l.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (l langTextMarkDo) Save(values ...*model.LangTextMark) error { + if len(values) == 0 { + return nil + } + return l.DO.Save(values) +} + +func (l langTextMarkDo) First() (*model.LangTextMark, error) { + if result, err := l.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.LangTextMark), nil + } +} + +func (l langTextMarkDo) Take() (*model.LangTextMark, error) { + if result, err := l.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.LangTextMark), nil + } +} + +func (l langTextMarkDo) Last() (*model.LangTextMark, error) { + if result, err := l.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.LangTextMark), nil + } +} + +func (l langTextMarkDo) Find() ([]*model.LangTextMark, error) { + result, err := l.DO.Find() + return result.([]*model.LangTextMark), err +} + +func (l langTextMarkDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.LangTextMark, err error) { + buf := make([]*model.LangTextMark, 0, batchSize) + err = l.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (l langTextMarkDo) FindInBatches(result *[]*model.LangTextMark, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return l.DO.FindInBatches(result, batchSize, fc) +} + +func (l langTextMarkDo) Attrs(attrs ...field.AssignExpr) *langTextMarkDo { + return l.withDO(l.DO.Attrs(attrs...)) +} + +func (l langTextMarkDo) Assign(attrs ...field.AssignExpr) *langTextMarkDo { + return l.withDO(l.DO.Assign(attrs...)) +} + +func (l langTextMarkDo) Joins(fields ...field.RelationField) *langTextMarkDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Joins(_f)) + } + return &l +} + +func (l langTextMarkDo) Preload(fields ...field.RelationField) *langTextMarkDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Preload(_f)) + } + return &l +} + +func (l langTextMarkDo) FirstOrInit() (*model.LangTextMark, error) { + if result, err := l.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.LangTextMark), nil + } +} + +func (l langTextMarkDo) FirstOrCreate() (*model.LangTextMark, error) { + if result, err := l.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.LangTextMark), nil + } +} + +func (l langTextMarkDo) FindByPage(offset int, limit int) (result []*model.LangTextMark, count int64, err error) { + result, err = l.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = l.Offset(-1).Limit(-1).Count() + return +} + +func (l langTextMarkDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = l.Count() + if err != nil { + return + } + + err = l.Offset(offset).Limit(limit).Scan(result) + return +} + +func (l langTextMarkDo) Scan(result interface{}) (err error) { + return l.DO.Scan(result) +} + +func (l langTextMarkDo) Delete(models ...*model.LangTextMark) (result gen.ResultInfo, err error) { + return l.DO.Delete(models) +} + +func (l *langTextMarkDo) withDO(do gen.Dao) *langTextMarkDo { + l.DO = *do.(*gen.DO) + return l +} diff --git a/internal/repository/dao/library_qa.gen.go b/internal/repository/dao/library_qa.gen.go new file mode 100644 index 0000000..48e8e85 --- /dev/null +++ b/internal/repository/dao/library_qa.gen.go @@ -0,0 +1,383 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newLibraryQa(db *gorm.DB, opts ...gen.DOOption) libraryQa { + _libraryQa := libraryQa{} + + _libraryQa.libraryQaDo.UseDB(db, opts...) + _libraryQa.libraryQaDo.UseModel(&model.LibraryQa{}) + + tableName := _libraryQa.libraryQaDo.TableName() + _libraryQa.ALL = field.NewAsterisk(tableName) + _libraryQa.ID = field.NewInt64(tableName, "id") + _libraryQa.CreatedAt = field.NewInt64(tableName, "created_at") + _libraryQa.UpdatedAt = field.NewInt64(tableName, "updated_at") + _libraryQa.IsDel = field.NewInt8(tableName, "is_del") + _libraryQa.HashID = field.NewString(tableName, "hash_id") + _libraryQa.ProjectID = field.NewInt64(tableName, "project_id") + _libraryQa.GroupID = field.NewInt64(tableName, "group_id") + _libraryQa.Mark = field.NewString(tableName, "mark") + _libraryQa.Title = field.NewString(tableName, "title") + _libraryQa.LinkURL = field.NewString(tableName, "link_url") + _libraryQa.CoverURL = field.NewString(tableName, "cover_url") + _libraryQa.ExplainText = field.NewString(tableName, "explain_text") + _libraryQa.ExplainImg = field.NewString(tableName, "explain_img") + _libraryQa.AnswerMark = field.NewString(tableName, "answer_mark") + + _libraryQa.fillFieldMap() + + return _libraryQa +} + +type libraryQa struct { + libraryQaDo libraryQaDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 对外hash_id + ProjectID field.Int64 // 项目id(project表) + GroupID field.Int64 // 题库组id(libary_qa_group表) + Mark field.String // 问题类型(image_text-图文,video-视频,audio-音频) + Title field.String // 题目 + LinkURL field.String // 附件链接地址 + CoverURL field.String // 封面图地址 + ExplainText field.String // 答案讲解文本 + ExplainImg field.String // 答案讲解图 + AnswerMark field.String // 答案类型(image_text-图文,text-文本) + + fieldMap map[string]field.Expr +} + +func (l libraryQa) Table(newTableName string) *libraryQa { + l.libraryQaDo.UseTable(newTableName) + return l.updateTableName(newTableName) +} + +func (l libraryQa) As(alias string) *libraryQa { + l.libraryQaDo.DO = *(l.libraryQaDo.As(alias).(*gen.DO)) + return l.updateTableName(alias) +} + +func (l *libraryQa) updateTableName(table string) *libraryQa { + l.ALL = field.NewAsterisk(table) + l.ID = field.NewInt64(table, "id") + l.CreatedAt = field.NewInt64(table, "created_at") + l.UpdatedAt = field.NewInt64(table, "updated_at") + l.IsDel = field.NewInt8(table, "is_del") + l.HashID = field.NewString(table, "hash_id") + l.ProjectID = field.NewInt64(table, "project_id") + l.GroupID = field.NewInt64(table, "group_id") + l.Mark = field.NewString(table, "mark") + l.Title = field.NewString(table, "title") + l.LinkURL = field.NewString(table, "link_url") + l.CoverURL = field.NewString(table, "cover_url") + l.ExplainText = field.NewString(table, "explain_text") + l.ExplainImg = field.NewString(table, "explain_img") + l.AnswerMark = field.NewString(table, "answer_mark") + + l.fillFieldMap() + + return l +} + +func (l *libraryQa) WithContext(ctx context.Context) *libraryQaDo { + return l.libraryQaDo.WithContext(ctx) +} + +func (l libraryQa) TableName() string { return l.libraryQaDo.TableName() } + +func (l libraryQa) Alias() string { return l.libraryQaDo.Alias() } + +func (l *libraryQa) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := l.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (l *libraryQa) fillFieldMap() { + l.fieldMap = make(map[string]field.Expr, 14) + l.fieldMap["id"] = l.ID + l.fieldMap["created_at"] = l.CreatedAt + l.fieldMap["updated_at"] = l.UpdatedAt + l.fieldMap["is_del"] = l.IsDel + l.fieldMap["hash_id"] = l.HashID + l.fieldMap["project_id"] = l.ProjectID + l.fieldMap["group_id"] = l.GroupID + l.fieldMap["mark"] = l.Mark + l.fieldMap["title"] = l.Title + l.fieldMap["link_url"] = l.LinkURL + l.fieldMap["cover_url"] = l.CoverURL + l.fieldMap["explain_text"] = l.ExplainText + l.fieldMap["explain_img"] = l.ExplainImg + l.fieldMap["answer_mark"] = l.AnswerMark +} + +func (l libraryQa) clone(db *gorm.DB) libraryQa { + l.libraryQaDo.ReplaceConnPool(db.Statement.ConnPool) + return l +} + +func (l libraryQa) replaceDB(db *gorm.DB) libraryQa { + l.libraryQaDo.ReplaceDB(db) + return l +} + +type libraryQaDo struct{ gen.DO } + +func (l libraryQaDo) Debug() *libraryQaDo { + return l.withDO(l.DO.Debug()) +} + +func (l libraryQaDo) WithContext(ctx context.Context) *libraryQaDo { + return l.withDO(l.DO.WithContext(ctx)) +} + +func (l libraryQaDo) ReadDB() *libraryQaDo { + return l.Clauses(dbresolver.Read) +} + +func (l libraryQaDo) WriteDB() *libraryQaDo { + return l.Clauses(dbresolver.Write) +} + +func (l libraryQaDo) Session(config *gorm.Session) *libraryQaDo { + return l.withDO(l.DO.Session(config)) +} + +func (l libraryQaDo) Clauses(conds ...clause.Expression) *libraryQaDo { + return l.withDO(l.DO.Clauses(conds...)) +} + +func (l libraryQaDo) Returning(value interface{}, columns ...string) *libraryQaDo { + return l.withDO(l.DO.Returning(value, columns...)) +} + +func (l libraryQaDo) Not(conds ...gen.Condition) *libraryQaDo { + return l.withDO(l.DO.Not(conds...)) +} + +func (l libraryQaDo) Or(conds ...gen.Condition) *libraryQaDo { + return l.withDO(l.DO.Or(conds...)) +} + +func (l libraryQaDo) Select(conds ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.Select(conds...)) +} + +func (l libraryQaDo) Where(conds ...gen.Condition) *libraryQaDo { + return l.withDO(l.DO.Where(conds...)) +} + +func (l libraryQaDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *libraryQaDo { + return l.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (l libraryQaDo) Order(conds ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.Order(conds...)) +} + +func (l libraryQaDo) Distinct(cols ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.Distinct(cols...)) +} + +func (l libraryQaDo) Omit(cols ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.Omit(cols...)) +} + +func (l libraryQaDo) Join(table schema.Tabler, on ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.Join(table, on...)) +} + +func (l libraryQaDo) LeftJoin(table schema.Tabler, on ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.LeftJoin(table, on...)) +} + +func (l libraryQaDo) RightJoin(table schema.Tabler, on ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.RightJoin(table, on...)) +} + +func (l libraryQaDo) Group(cols ...field.Expr) *libraryQaDo { + return l.withDO(l.DO.Group(cols...)) +} + +func (l libraryQaDo) Having(conds ...gen.Condition) *libraryQaDo { + return l.withDO(l.DO.Having(conds...)) +} + +func (l libraryQaDo) Limit(limit int) *libraryQaDo { + return l.withDO(l.DO.Limit(limit)) +} + +func (l libraryQaDo) Offset(offset int) *libraryQaDo { + return l.withDO(l.DO.Offset(offset)) +} + +func (l libraryQaDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *libraryQaDo { + return l.withDO(l.DO.Scopes(funcs...)) +} + +func (l libraryQaDo) Unscoped() *libraryQaDo { + return l.withDO(l.DO.Unscoped()) +} + +func (l libraryQaDo) Create(values ...*model.LibraryQa) error { + if len(values) == 0 { + return nil + } + return l.DO.Create(values) +} + +func (l libraryQaDo) CreateInBatches(values []*model.LibraryQa, batchSize int) error { + return l.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (l libraryQaDo) Save(values ...*model.LibraryQa) error { + if len(values) == 0 { + return nil + } + return l.DO.Save(values) +} + +func (l libraryQaDo) First() (*model.LibraryQa, error) { + if result, err := l.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQa), nil + } +} + +func (l libraryQaDo) Take() (*model.LibraryQa, error) { + if result, err := l.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQa), nil + } +} + +func (l libraryQaDo) Last() (*model.LibraryQa, error) { + if result, err := l.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQa), nil + } +} + +func (l libraryQaDo) Find() ([]*model.LibraryQa, error) { + result, err := l.DO.Find() + return result.([]*model.LibraryQa), err +} + +func (l libraryQaDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.LibraryQa, err error) { + buf := make([]*model.LibraryQa, 0, batchSize) + err = l.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (l libraryQaDo) FindInBatches(result *[]*model.LibraryQa, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return l.DO.FindInBatches(result, batchSize, fc) +} + +func (l libraryQaDo) Attrs(attrs ...field.AssignExpr) *libraryQaDo { + return l.withDO(l.DO.Attrs(attrs...)) +} + +func (l libraryQaDo) Assign(attrs ...field.AssignExpr) *libraryQaDo { + return l.withDO(l.DO.Assign(attrs...)) +} + +func (l libraryQaDo) Joins(fields ...field.RelationField) *libraryQaDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Joins(_f)) + } + return &l +} + +func (l libraryQaDo) Preload(fields ...field.RelationField) *libraryQaDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Preload(_f)) + } + return &l +} + +func (l libraryQaDo) FirstOrInit() (*model.LibraryQa, error) { + if result, err := l.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQa), nil + } +} + +func (l libraryQaDo) FirstOrCreate() (*model.LibraryQa, error) { + if result, err := l.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQa), nil + } +} + +func (l libraryQaDo) FindByPage(offset int, limit int) (result []*model.LibraryQa, count int64, err error) { + result, err = l.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = l.Offset(-1).Limit(-1).Count() + return +} + +func (l libraryQaDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = l.Count() + if err != nil { + return + } + + err = l.Offset(offset).Limit(limit).Scan(result) + return +} + +func (l libraryQaDo) Scan(result interface{}) (err error) { + return l.DO.Scan(result) +} + +func (l libraryQaDo) Delete(models ...*model.LibraryQa) (result gen.ResultInfo, err error) { + return l.DO.Delete(models) +} + +func (l *libraryQaDo) withDO(do gen.Dao) *libraryQaDo { + l.DO = *do.(*gen.DO) + return l +} diff --git a/internal/repository/dao/library_qa_group.gen.go b/internal/repository/dao/library_qa_group.gen.go new file mode 100644 index 0000000..fe2c89b --- /dev/null +++ b/internal/repository/dao/library_qa_group.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newLibraryQaGroup(db *gorm.DB, opts ...gen.DOOption) libraryQaGroup { + _libraryQaGroup := libraryQaGroup{} + + _libraryQaGroup.libraryQaGroupDo.UseDB(db, opts...) + _libraryQaGroup.libraryQaGroupDo.UseModel(&model.LibraryQaGroup{}) + + tableName := _libraryQaGroup.libraryQaGroupDo.TableName() + _libraryQaGroup.ALL = field.NewAsterisk(tableName) + _libraryQaGroup.ID = field.NewInt64(tableName, "id") + _libraryQaGroup.CreatedAt = field.NewInt64(tableName, "created_at") + _libraryQaGroup.UpdatedAt = field.NewInt64(tableName, "updated_at") + _libraryQaGroup.HashID = field.NewString(tableName, "hash_id") + _libraryQaGroup.ProjectID = field.NewInt64(tableName, "project_id") + _libraryQaGroup.Title = field.NewString(tableName, "title") + _libraryQaGroup.DelTime = field.NewInt64(tableName, "del_time") + + _libraryQaGroup.fillFieldMap() + + return _libraryQaGroup +} + +type libraryQaGroup struct { + libraryQaGroupDo libraryQaGroupDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + HashID field.String // 对外hash_id + ProjectID field.Int64 // 项目id(project表) + Title field.String // 题库标题 + DelTime field.Int64 // 删除时间 + + fieldMap map[string]field.Expr +} + +func (l libraryQaGroup) Table(newTableName string) *libraryQaGroup { + l.libraryQaGroupDo.UseTable(newTableName) + return l.updateTableName(newTableName) +} + +func (l libraryQaGroup) As(alias string) *libraryQaGroup { + l.libraryQaGroupDo.DO = *(l.libraryQaGroupDo.As(alias).(*gen.DO)) + return l.updateTableName(alias) +} + +func (l *libraryQaGroup) updateTableName(table string) *libraryQaGroup { + l.ALL = field.NewAsterisk(table) + l.ID = field.NewInt64(table, "id") + l.CreatedAt = field.NewInt64(table, "created_at") + l.UpdatedAt = field.NewInt64(table, "updated_at") + l.HashID = field.NewString(table, "hash_id") + l.ProjectID = field.NewInt64(table, "project_id") + l.Title = field.NewString(table, "title") + l.DelTime = field.NewInt64(table, "del_time") + + l.fillFieldMap() + + return l +} + +func (l *libraryQaGroup) WithContext(ctx context.Context) *libraryQaGroupDo { + return l.libraryQaGroupDo.WithContext(ctx) +} + +func (l libraryQaGroup) TableName() string { return l.libraryQaGroupDo.TableName() } + +func (l libraryQaGroup) Alias() string { return l.libraryQaGroupDo.Alias() } + +func (l *libraryQaGroup) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := l.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (l *libraryQaGroup) fillFieldMap() { + l.fieldMap = make(map[string]field.Expr, 7) + l.fieldMap["id"] = l.ID + l.fieldMap["created_at"] = l.CreatedAt + l.fieldMap["updated_at"] = l.UpdatedAt + l.fieldMap["hash_id"] = l.HashID + l.fieldMap["project_id"] = l.ProjectID + l.fieldMap["title"] = l.Title + l.fieldMap["del_time"] = l.DelTime +} + +func (l libraryQaGroup) clone(db *gorm.DB) libraryQaGroup { + l.libraryQaGroupDo.ReplaceConnPool(db.Statement.ConnPool) + return l +} + +func (l libraryQaGroup) replaceDB(db *gorm.DB) libraryQaGroup { + l.libraryQaGroupDo.ReplaceDB(db) + return l +} + +type libraryQaGroupDo struct{ gen.DO } + +func (l libraryQaGroupDo) Debug() *libraryQaGroupDo { + return l.withDO(l.DO.Debug()) +} + +func (l libraryQaGroupDo) WithContext(ctx context.Context) *libraryQaGroupDo { + return l.withDO(l.DO.WithContext(ctx)) +} + +func (l libraryQaGroupDo) ReadDB() *libraryQaGroupDo { + return l.Clauses(dbresolver.Read) +} + +func (l libraryQaGroupDo) WriteDB() *libraryQaGroupDo { + return l.Clauses(dbresolver.Write) +} + +func (l libraryQaGroupDo) Session(config *gorm.Session) *libraryQaGroupDo { + return l.withDO(l.DO.Session(config)) +} + +func (l libraryQaGroupDo) Clauses(conds ...clause.Expression) *libraryQaGroupDo { + return l.withDO(l.DO.Clauses(conds...)) +} + +func (l libraryQaGroupDo) Returning(value interface{}, columns ...string) *libraryQaGroupDo { + return l.withDO(l.DO.Returning(value, columns...)) +} + +func (l libraryQaGroupDo) Not(conds ...gen.Condition) *libraryQaGroupDo { + return l.withDO(l.DO.Not(conds...)) +} + +func (l libraryQaGroupDo) Or(conds ...gen.Condition) *libraryQaGroupDo { + return l.withDO(l.DO.Or(conds...)) +} + +func (l libraryQaGroupDo) Select(conds ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.Select(conds...)) +} + +func (l libraryQaGroupDo) Where(conds ...gen.Condition) *libraryQaGroupDo { + return l.withDO(l.DO.Where(conds...)) +} + +func (l libraryQaGroupDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *libraryQaGroupDo { + return l.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (l libraryQaGroupDo) Order(conds ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.Order(conds...)) +} + +func (l libraryQaGroupDo) Distinct(cols ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.Distinct(cols...)) +} + +func (l libraryQaGroupDo) Omit(cols ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.Omit(cols...)) +} + +func (l libraryQaGroupDo) Join(table schema.Tabler, on ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.Join(table, on...)) +} + +func (l libraryQaGroupDo) LeftJoin(table schema.Tabler, on ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.LeftJoin(table, on...)) +} + +func (l libraryQaGroupDo) RightJoin(table schema.Tabler, on ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.RightJoin(table, on...)) +} + +func (l libraryQaGroupDo) Group(cols ...field.Expr) *libraryQaGroupDo { + return l.withDO(l.DO.Group(cols...)) +} + +func (l libraryQaGroupDo) Having(conds ...gen.Condition) *libraryQaGroupDo { + return l.withDO(l.DO.Having(conds...)) +} + +func (l libraryQaGroupDo) Limit(limit int) *libraryQaGroupDo { + return l.withDO(l.DO.Limit(limit)) +} + +func (l libraryQaGroupDo) Offset(offset int) *libraryQaGroupDo { + return l.withDO(l.DO.Offset(offset)) +} + +func (l libraryQaGroupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *libraryQaGroupDo { + return l.withDO(l.DO.Scopes(funcs...)) +} + +func (l libraryQaGroupDo) Unscoped() *libraryQaGroupDo { + return l.withDO(l.DO.Unscoped()) +} + +func (l libraryQaGroupDo) Create(values ...*model.LibraryQaGroup) error { + if len(values) == 0 { + return nil + } + return l.DO.Create(values) +} + +func (l libraryQaGroupDo) CreateInBatches(values []*model.LibraryQaGroup, batchSize int) error { + return l.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (l libraryQaGroupDo) Save(values ...*model.LibraryQaGroup) error { + if len(values) == 0 { + return nil + } + return l.DO.Save(values) +} + +func (l libraryQaGroupDo) First() (*model.LibraryQaGroup, error) { + if result, err := l.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaGroup), nil + } +} + +func (l libraryQaGroupDo) Take() (*model.LibraryQaGroup, error) { + if result, err := l.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaGroup), nil + } +} + +func (l libraryQaGroupDo) Last() (*model.LibraryQaGroup, error) { + if result, err := l.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaGroup), nil + } +} + +func (l libraryQaGroupDo) Find() ([]*model.LibraryQaGroup, error) { + result, err := l.DO.Find() + return result.([]*model.LibraryQaGroup), err +} + +func (l libraryQaGroupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.LibraryQaGroup, err error) { + buf := make([]*model.LibraryQaGroup, 0, batchSize) + err = l.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (l libraryQaGroupDo) FindInBatches(result *[]*model.LibraryQaGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return l.DO.FindInBatches(result, batchSize, fc) +} + +func (l libraryQaGroupDo) Attrs(attrs ...field.AssignExpr) *libraryQaGroupDo { + return l.withDO(l.DO.Attrs(attrs...)) +} + +func (l libraryQaGroupDo) Assign(attrs ...field.AssignExpr) *libraryQaGroupDo { + return l.withDO(l.DO.Assign(attrs...)) +} + +func (l libraryQaGroupDo) Joins(fields ...field.RelationField) *libraryQaGroupDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Joins(_f)) + } + return &l +} + +func (l libraryQaGroupDo) Preload(fields ...field.RelationField) *libraryQaGroupDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Preload(_f)) + } + return &l +} + +func (l libraryQaGroupDo) FirstOrInit() (*model.LibraryQaGroup, error) { + if result, err := l.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaGroup), nil + } +} + +func (l libraryQaGroupDo) FirstOrCreate() (*model.LibraryQaGroup, error) { + if result, err := l.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaGroup), nil + } +} + +func (l libraryQaGroupDo) FindByPage(offset int, limit int) (result []*model.LibraryQaGroup, count int64, err error) { + result, err = l.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = l.Offset(-1).Limit(-1).Count() + return +} + +func (l libraryQaGroupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = l.Count() + if err != nil { + return + } + + err = l.Offset(offset).Limit(limit).Scan(result) + return +} + +func (l libraryQaGroupDo) Scan(result interface{}) (err error) { + return l.DO.Scan(result) +} + +func (l libraryQaGroupDo) Delete(models ...*model.LibraryQaGroup) (result gen.ResultInfo, err error) { + return l.DO.Delete(models) +} + +func (l *libraryQaGroupDo) withDO(do gen.Dao) *libraryQaGroupDo { + l.DO = *do.(*gen.DO) + return l +} diff --git a/internal/repository/dao/library_qa_option.gen.go b/internal/repository/dao/library_qa_option.gen.go new file mode 100644 index 0000000..9591ff9 --- /dev/null +++ b/internal/repository/dao/library_qa_option.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newLibraryQaOption(db *gorm.DB, opts ...gen.DOOption) libraryQaOption { + _libraryQaOption := libraryQaOption{} + + _libraryQaOption.libraryQaOptionDo.UseDB(db, opts...) + _libraryQaOption.libraryQaOptionDo.UseModel(&model.LibraryQaOption{}) + + tableName := _libraryQaOption.libraryQaOptionDo.TableName() + _libraryQaOption.ALL = field.NewAsterisk(tableName) + _libraryQaOption.ID = field.NewInt64(tableName, "id") + _libraryQaOption.CreatedAt = field.NewInt64(tableName, "created_at") + _libraryQaOption.UpdatedAt = field.NewInt64(tableName, "updated_at") + _libraryQaOption.IsDel = field.NewInt8(tableName, "is_del") + _libraryQaOption.QaID = field.NewInt64(tableName, "qa_id") + _libraryQaOption.Title = field.NewString(tableName, "title") + _libraryQaOption.ImgURL = field.NewString(tableName, "img_url") + _libraryQaOption.IsRight = field.NewInt8(tableName, "is_right") + + _libraryQaOption.fillFieldMap() + + return _libraryQaOption +} + +type libraryQaOption struct { + libraryQaOptionDo libraryQaOptionDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + QaID field.Int64 // 问题id(libary_qa表) + Title field.String // 答案 + ImgURL field.String // 图片地址 + IsRight field.Int8 // 是否正确答案 + + fieldMap map[string]field.Expr +} + +func (l libraryQaOption) Table(newTableName string) *libraryQaOption { + l.libraryQaOptionDo.UseTable(newTableName) + return l.updateTableName(newTableName) +} + +func (l libraryQaOption) As(alias string) *libraryQaOption { + l.libraryQaOptionDo.DO = *(l.libraryQaOptionDo.As(alias).(*gen.DO)) + return l.updateTableName(alias) +} + +func (l *libraryQaOption) updateTableName(table string) *libraryQaOption { + l.ALL = field.NewAsterisk(table) + l.ID = field.NewInt64(table, "id") + l.CreatedAt = field.NewInt64(table, "created_at") + l.UpdatedAt = field.NewInt64(table, "updated_at") + l.IsDel = field.NewInt8(table, "is_del") + l.QaID = field.NewInt64(table, "qa_id") + l.Title = field.NewString(table, "title") + l.ImgURL = field.NewString(table, "img_url") + l.IsRight = field.NewInt8(table, "is_right") + + l.fillFieldMap() + + return l +} + +func (l *libraryQaOption) WithContext(ctx context.Context) *libraryQaOptionDo { + return l.libraryQaOptionDo.WithContext(ctx) +} + +func (l libraryQaOption) TableName() string { return l.libraryQaOptionDo.TableName() } + +func (l libraryQaOption) Alias() string { return l.libraryQaOptionDo.Alias() } + +func (l *libraryQaOption) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := l.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (l *libraryQaOption) fillFieldMap() { + l.fieldMap = make(map[string]field.Expr, 8) + l.fieldMap["id"] = l.ID + l.fieldMap["created_at"] = l.CreatedAt + l.fieldMap["updated_at"] = l.UpdatedAt + l.fieldMap["is_del"] = l.IsDel + l.fieldMap["qa_id"] = l.QaID + l.fieldMap["title"] = l.Title + l.fieldMap["img_url"] = l.ImgURL + l.fieldMap["is_right"] = l.IsRight +} + +func (l libraryQaOption) clone(db *gorm.DB) libraryQaOption { + l.libraryQaOptionDo.ReplaceConnPool(db.Statement.ConnPool) + return l +} + +func (l libraryQaOption) replaceDB(db *gorm.DB) libraryQaOption { + l.libraryQaOptionDo.ReplaceDB(db) + return l +} + +type libraryQaOptionDo struct{ gen.DO } + +func (l libraryQaOptionDo) Debug() *libraryQaOptionDo { + return l.withDO(l.DO.Debug()) +} + +func (l libraryQaOptionDo) WithContext(ctx context.Context) *libraryQaOptionDo { + return l.withDO(l.DO.WithContext(ctx)) +} + +func (l libraryQaOptionDo) ReadDB() *libraryQaOptionDo { + return l.Clauses(dbresolver.Read) +} + +func (l libraryQaOptionDo) WriteDB() *libraryQaOptionDo { + return l.Clauses(dbresolver.Write) +} + +func (l libraryQaOptionDo) Session(config *gorm.Session) *libraryQaOptionDo { + return l.withDO(l.DO.Session(config)) +} + +func (l libraryQaOptionDo) Clauses(conds ...clause.Expression) *libraryQaOptionDo { + return l.withDO(l.DO.Clauses(conds...)) +} + +func (l libraryQaOptionDo) Returning(value interface{}, columns ...string) *libraryQaOptionDo { + return l.withDO(l.DO.Returning(value, columns...)) +} + +func (l libraryQaOptionDo) Not(conds ...gen.Condition) *libraryQaOptionDo { + return l.withDO(l.DO.Not(conds...)) +} + +func (l libraryQaOptionDo) Or(conds ...gen.Condition) *libraryQaOptionDo { + return l.withDO(l.DO.Or(conds...)) +} + +func (l libraryQaOptionDo) Select(conds ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.Select(conds...)) +} + +func (l libraryQaOptionDo) Where(conds ...gen.Condition) *libraryQaOptionDo { + return l.withDO(l.DO.Where(conds...)) +} + +func (l libraryQaOptionDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *libraryQaOptionDo { + return l.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (l libraryQaOptionDo) Order(conds ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.Order(conds...)) +} + +func (l libraryQaOptionDo) Distinct(cols ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.Distinct(cols...)) +} + +func (l libraryQaOptionDo) Omit(cols ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.Omit(cols...)) +} + +func (l libraryQaOptionDo) Join(table schema.Tabler, on ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.Join(table, on...)) +} + +func (l libraryQaOptionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.LeftJoin(table, on...)) +} + +func (l libraryQaOptionDo) RightJoin(table schema.Tabler, on ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.RightJoin(table, on...)) +} + +func (l libraryQaOptionDo) Group(cols ...field.Expr) *libraryQaOptionDo { + return l.withDO(l.DO.Group(cols...)) +} + +func (l libraryQaOptionDo) Having(conds ...gen.Condition) *libraryQaOptionDo { + return l.withDO(l.DO.Having(conds...)) +} + +func (l libraryQaOptionDo) Limit(limit int) *libraryQaOptionDo { + return l.withDO(l.DO.Limit(limit)) +} + +func (l libraryQaOptionDo) Offset(offset int) *libraryQaOptionDo { + return l.withDO(l.DO.Offset(offset)) +} + +func (l libraryQaOptionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *libraryQaOptionDo { + return l.withDO(l.DO.Scopes(funcs...)) +} + +func (l libraryQaOptionDo) Unscoped() *libraryQaOptionDo { + return l.withDO(l.DO.Unscoped()) +} + +func (l libraryQaOptionDo) Create(values ...*model.LibraryQaOption) error { + if len(values) == 0 { + return nil + } + return l.DO.Create(values) +} + +func (l libraryQaOptionDo) CreateInBatches(values []*model.LibraryQaOption, batchSize int) error { + return l.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (l libraryQaOptionDo) Save(values ...*model.LibraryQaOption) error { + if len(values) == 0 { + return nil + } + return l.DO.Save(values) +} + +func (l libraryQaOptionDo) First() (*model.LibraryQaOption, error) { + if result, err := l.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaOption), nil + } +} + +func (l libraryQaOptionDo) Take() (*model.LibraryQaOption, error) { + if result, err := l.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaOption), nil + } +} + +func (l libraryQaOptionDo) Last() (*model.LibraryQaOption, error) { + if result, err := l.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaOption), nil + } +} + +func (l libraryQaOptionDo) Find() ([]*model.LibraryQaOption, error) { + result, err := l.DO.Find() + return result.([]*model.LibraryQaOption), err +} + +func (l libraryQaOptionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.LibraryQaOption, err error) { + buf := make([]*model.LibraryQaOption, 0, batchSize) + err = l.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (l libraryQaOptionDo) FindInBatches(result *[]*model.LibraryQaOption, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return l.DO.FindInBatches(result, batchSize, fc) +} + +func (l libraryQaOptionDo) Attrs(attrs ...field.AssignExpr) *libraryQaOptionDo { + return l.withDO(l.DO.Attrs(attrs...)) +} + +func (l libraryQaOptionDo) Assign(attrs ...field.AssignExpr) *libraryQaOptionDo { + return l.withDO(l.DO.Assign(attrs...)) +} + +func (l libraryQaOptionDo) Joins(fields ...field.RelationField) *libraryQaOptionDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Joins(_f)) + } + return &l +} + +func (l libraryQaOptionDo) Preload(fields ...field.RelationField) *libraryQaOptionDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Preload(_f)) + } + return &l +} + +func (l libraryQaOptionDo) FirstOrInit() (*model.LibraryQaOption, error) { + if result, err := l.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaOption), nil + } +} + +func (l libraryQaOptionDo) FirstOrCreate() (*model.LibraryQaOption, error) { + if result, err := l.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.LibraryQaOption), nil + } +} + +func (l libraryQaOptionDo) FindByPage(offset int, limit int) (result []*model.LibraryQaOption, count int64, err error) { + result, err = l.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = l.Offset(-1).Limit(-1).Count() + return +} + +func (l libraryQaOptionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = l.Count() + if err != nil { + return + } + + err = l.Offset(offset).Limit(limit).Scan(result) + return +} + +func (l libraryQaOptionDo) Scan(result interface{}) (err error) { + return l.DO.Scan(result) +} + +func (l libraryQaOptionDo) Delete(models ...*model.LibraryQaOption) (result gen.ResultInfo, err error) { + return l.DO.Delete(models) +} + +func (l *libraryQaOptionDo) withDO(do gen.Dao) *libraryQaOptionDo { + l.DO = *do.(*gen.DO) + return l +} diff --git a/internal/repository/dao/lv_api_log.gen.go b/internal/repository/dao/lv_api_log.gen.go new file mode 100644 index 0000000..7387025 --- /dev/null +++ b/internal/repository/dao/lv_api_log.gen.go @@ -0,0 +1,381 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newLvAPILog(db *gorm.DB, opts ...gen.DOOption) lvAPILog { + _lvAPILog := lvAPILog{} + + _lvAPILog.lvAPILogDo.UseDB(db, opts...) + _lvAPILog.lvAPILogDo.UseModel(&model.LvAPILog{}) + + tableName := _lvAPILog.lvAPILogDo.TableName() + _lvAPILog.ALL = field.NewAsterisk(tableName) + _lvAPILog.ID = field.NewInt64(tableName, "id") + _lvAPILog.CreatedAt = field.NewInt64(tableName, "created_at") + _lvAPILog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _lvAPILog.CampaignID = field.NewInt64(tableName, "campaign_id") + _lvAPILog.Source = field.NewString(tableName, "source") + _lvAPILog.UserID = field.NewString(tableName, "user_id") + _lvAPILog.ReqURL = field.NewString(tableName, "req_url") + _lvAPILog.Req = field.NewString(tableName, "req") + _lvAPILog.Resp = field.NewString(tableName, "resp") + _lvAPILog.RespCode = field.NewInt32(tableName, "resp_code") + _lvAPILog.ReqTime = field.NewInt64(tableName, "req_time") + _lvAPILog.ErrMsg = field.NewString(tableName, "err_msg") + _lvAPILog.Token = field.NewString(tableName, "token") + _lvAPILog.ReqHeader = field.NewString(tableName, "req_header") + + _lvAPILog.fillFieldMap() + + return _lvAPILog +} + +type lvAPILog struct { + lvAPILogDo lvAPILogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + CampaignID field.Int64 // 活动id + Source field.String // 来源 + UserID field.String // 用户id + ReqURL field.String // 请求地址 + Req field.String // 请求数据 + Resp field.String // 返回数据 + RespCode field.Int32 // 返回状态码 + ReqTime field.Int64 // 请求时长(单位:ms) + ErrMsg field.String // 错误信息 + Token field.String // 请求token + ReqHeader field.String // 请求头数据 + + fieldMap map[string]field.Expr +} + +func (l lvAPILog) Table(newTableName string) *lvAPILog { + l.lvAPILogDo.UseTable(newTableName) + return l.updateTableName(newTableName) +} + +func (l lvAPILog) As(alias string) *lvAPILog { + l.lvAPILogDo.DO = *(l.lvAPILogDo.As(alias).(*gen.DO)) + return l.updateTableName(alias) +} + +func (l *lvAPILog) updateTableName(table string) *lvAPILog { + l.ALL = field.NewAsterisk(table) + l.ID = field.NewInt64(table, "id") + l.CreatedAt = field.NewInt64(table, "created_at") + l.UpdatedAt = field.NewInt64(table, "updated_at") + l.CampaignID = field.NewInt64(table, "campaign_id") + l.Source = field.NewString(table, "source") + l.UserID = field.NewString(table, "user_id") + l.ReqURL = field.NewString(table, "req_url") + l.Req = field.NewString(table, "req") + l.Resp = field.NewString(table, "resp") + l.RespCode = field.NewInt32(table, "resp_code") + l.ReqTime = field.NewInt64(table, "req_time") + l.ErrMsg = field.NewString(table, "err_msg") + l.Token = field.NewString(table, "token") + l.ReqHeader = field.NewString(table, "req_header") + + l.fillFieldMap() + + return l +} + +func (l *lvAPILog) WithContext(ctx context.Context) *lvAPILogDo { return l.lvAPILogDo.WithContext(ctx) } + +func (l lvAPILog) TableName() string { return l.lvAPILogDo.TableName() } + +func (l lvAPILog) Alias() string { return l.lvAPILogDo.Alias() } + +func (l *lvAPILog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := l.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (l *lvAPILog) fillFieldMap() { + l.fieldMap = make(map[string]field.Expr, 14) + l.fieldMap["id"] = l.ID + l.fieldMap["created_at"] = l.CreatedAt + l.fieldMap["updated_at"] = l.UpdatedAt + l.fieldMap["campaign_id"] = l.CampaignID + l.fieldMap["source"] = l.Source + l.fieldMap["user_id"] = l.UserID + l.fieldMap["req_url"] = l.ReqURL + l.fieldMap["req"] = l.Req + l.fieldMap["resp"] = l.Resp + l.fieldMap["resp_code"] = l.RespCode + l.fieldMap["req_time"] = l.ReqTime + l.fieldMap["err_msg"] = l.ErrMsg + l.fieldMap["token"] = l.Token + l.fieldMap["req_header"] = l.ReqHeader +} + +func (l lvAPILog) clone(db *gorm.DB) lvAPILog { + l.lvAPILogDo.ReplaceConnPool(db.Statement.ConnPool) + return l +} + +func (l lvAPILog) replaceDB(db *gorm.DB) lvAPILog { + l.lvAPILogDo.ReplaceDB(db) + return l +} + +type lvAPILogDo struct{ gen.DO } + +func (l lvAPILogDo) Debug() *lvAPILogDo { + return l.withDO(l.DO.Debug()) +} + +func (l lvAPILogDo) WithContext(ctx context.Context) *lvAPILogDo { + return l.withDO(l.DO.WithContext(ctx)) +} + +func (l lvAPILogDo) ReadDB() *lvAPILogDo { + return l.Clauses(dbresolver.Read) +} + +func (l lvAPILogDo) WriteDB() *lvAPILogDo { + return l.Clauses(dbresolver.Write) +} + +func (l lvAPILogDo) Session(config *gorm.Session) *lvAPILogDo { + return l.withDO(l.DO.Session(config)) +} + +func (l lvAPILogDo) Clauses(conds ...clause.Expression) *lvAPILogDo { + return l.withDO(l.DO.Clauses(conds...)) +} + +func (l lvAPILogDo) Returning(value interface{}, columns ...string) *lvAPILogDo { + return l.withDO(l.DO.Returning(value, columns...)) +} + +func (l lvAPILogDo) Not(conds ...gen.Condition) *lvAPILogDo { + return l.withDO(l.DO.Not(conds...)) +} + +func (l lvAPILogDo) Or(conds ...gen.Condition) *lvAPILogDo { + return l.withDO(l.DO.Or(conds...)) +} + +func (l lvAPILogDo) Select(conds ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.Select(conds...)) +} + +func (l lvAPILogDo) Where(conds ...gen.Condition) *lvAPILogDo { + return l.withDO(l.DO.Where(conds...)) +} + +func (l lvAPILogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *lvAPILogDo { + return l.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (l lvAPILogDo) Order(conds ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.Order(conds...)) +} + +func (l lvAPILogDo) Distinct(cols ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.Distinct(cols...)) +} + +func (l lvAPILogDo) Omit(cols ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.Omit(cols...)) +} + +func (l lvAPILogDo) Join(table schema.Tabler, on ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.Join(table, on...)) +} + +func (l lvAPILogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.LeftJoin(table, on...)) +} + +func (l lvAPILogDo) RightJoin(table schema.Tabler, on ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.RightJoin(table, on...)) +} + +func (l lvAPILogDo) Group(cols ...field.Expr) *lvAPILogDo { + return l.withDO(l.DO.Group(cols...)) +} + +func (l lvAPILogDo) Having(conds ...gen.Condition) *lvAPILogDo { + return l.withDO(l.DO.Having(conds...)) +} + +func (l lvAPILogDo) Limit(limit int) *lvAPILogDo { + return l.withDO(l.DO.Limit(limit)) +} + +func (l lvAPILogDo) Offset(offset int) *lvAPILogDo { + return l.withDO(l.DO.Offset(offset)) +} + +func (l lvAPILogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *lvAPILogDo { + return l.withDO(l.DO.Scopes(funcs...)) +} + +func (l lvAPILogDo) Unscoped() *lvAPILogDo { + return l.withDO(l.DO.Unscoped()) +} + +func (l lvAPILogDo) Create(values ...*model.LvAPILog) error { + if len(values) == 0 { + return nil + } + return l.DO.Create(values) +} + +func (l lvAPILogDo) CreateInBatches(values []*model.LvAPILog, batchSize int) error { + return l.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (l lvAPILogDo) Save(values ...*model.LvAPILog) error { + if len(values) == 0 { + return nil + } + return l.DO.Save(values) +} + +func (l lvAPILogDo) First() (*model.LvAPILog, error) { + if result, err := l.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.LvAPILog), nil + } +} + +func (l lvAPILogDo) Take() (*model.LvAPILog, error) { + if result, err := l.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.LvAPILog), nil + } +} + +func (l lvAPILogDo) Last() (*model.LvAPILog, error) { + if result, err := l.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.LvAPILog), nil + } +} + +func (l lvAPILogDo) Find() ([]*model.LvAPILog, error) { + result, err := l.DO.Find() + return result.([]*model.LvAPILog), err +} + +func (l lvAPILogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.LvAPILog, err error) { + buf := make([]*model.LvAPILog, 0, batchSize) + err = l.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (l lvAPILogDo) FindInBatches(result *[]*model.LvAPILog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return l.DO.FindInBatches(result, batchSize, fc) +} + +func (l lvAPILogDo) Attrs(attrs ...field.AssignExpr) *lvAPILogDo { + return l.withDO(l.DO.Attrs(attrs...)) +} + +func (l lvAPILogDo) Assign(attrs ...field.AssignExpr) *lvAPILogDo { + return l.withDO(l.DO.Assign(attrs...)) +} + +func (l lvAPILogDo) Joins(fields ...field.RelationField) *lvAPILogDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Joins(_f)) + } + return &l +} + +func (l lvAPILogDo) Preload(fields ...field.RelationField) *lvAPILogDo { + for _, _f := range fields { + l = *l.withDO(l.DO.Preload(_f)) + } + return &l +} + +func (l lvAPILogDo) FirstOrInit() (*model.LvAPILog, error) { + if result, err := l.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.LvAPILog), nil + } +} + +func (l lvAPILogDo) FirstOrCreate() (*model.LvAPILog, error) { + if result, err := l.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.LvAPILog), nil + } +} + +func (l lvAPILogDo) FindByPage(offset int, limit int) (result []*model.LvAPILog, count int64, err error) { + result, err = l.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = l.Offset(-1).Limit(-1).Count() + return +} + +func (l lvAPILogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = l.Count() + if err != nil { + return + } + + err = l.Offset(offset).Limit(limit).Scan(result) + return +} + +func (l lvAPILogDo) Scan(result interface{}) (err error) { + return l.DO.Scan(result) +} + +func (l lvAPILogDo) Delete(models ...*model.LvAPILog) (result gen.ResultInfo, err error) { + return l.DO.Delete(models) +} + +func (l *lvAPILogDo) withDO(do gen.Dao) *lvAPILogDo { + l.DO = *do.(*gen.DO) + return l +} diff --git a/internal/repository/dao/material.gen.go b/internal/repository/dao/material.gen.go new file mode 100644 index 0000000..4dba4a8 --- /dev/null +++ b/internal/repository/dao/material.gen.go @@ -0,0 +1,353 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newMaterial(db *gorm.DB, opts ...gen.DOOption) material { + _material := material{} + + _material.materialDo.UseDB(db, opts...) + _material.materialDo.UseModel(&model.Material{}) + + tableName := _material.materialDo.TableName() + _material.ALL = field.NewAsterisk(tableName) + _material.ID = field.NewInt64(tableName, "id") + _material.CreatedAt = field.NewInt64(tableName, "created_at") + _material.UpdatedAt = field.NewInt64(tableName, "updated_at") + _material.IsDel = field.NewInt8(tableName, "is_del") + _material.ProjectID = field.NewInt64(tableName, "project_id") + _material.MaterialType = field.NewInt8(tableName, "material_type") + _material.MaterialData = field.NewString(tableName, "material_data") + + _material.fillFieldMap() + + return _material +} + +type material struct { + materialDo materialDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + ProjectID field.Int64 // 项目id(project表) + MaterialType field.Int8 // 素材类型 + MaterialData field.String // 素材数据 + + fieldMap map[string]field.Expr +} + +func (m material) Table(newTableName string) *material { + m.materialDo.UseTable(newTableName) + return m.updateTableName(newTableName) +} + +func (m material) As(alias string) *material { + m.materialDo.DO = *(m.materialDo.As(alias).(*gen.DO)) + return m.updateTableName(alias) +} + +func (m *material) updateTableName(table string) *material { + m.ALL = field.NewAsterisk(table) + m.ID = field.NewInt64(table, "id") + m.CreatedAt = field.NewInt64(table, "created_at") + m.UpdatedAt = field.NewInt64(table, "updated_at") + m.IsDel = field.NewInt8(table, "is_del") + m.ProjectID = field.NewInt64(table, "project_id") + m.MaterialType = field.NewInt8(table, "material_type") + m.MaterialData = field.NewString(table, "material_data") + + m.fillFieldMap() + + return m +} + +func (m *material) WithContext(ctx context.Context) *materialDo { return m.materialDo.WithContext(ctx) } + +func (m material) TableName() string { return m.materialDo.TableName() } + +func (m material) Alias() string { return m.materialDo.Alias() } + +func (m *material) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := m.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (m *material) fillFieldMap() { + m.fieldMap = make(map[string]field.Expr, 7) + m.fieldMap["id"] = m.ID + m.fieldMap["created_at"] = m.CreatedAt + m.fieldMap["updated_at"] = m.UpdatedAt + m.fieldMap["is_del"] = m.IsDel + m.fieldMap["project_id"] = m.ProjectID + m.fieldMap["material_type"] = m.MaterialType + m.fieldMap["material_data"] = m.MaterialData +} + +func (m material) clone(db *gorm.DB) material { + m.materialDo.ReplaceConnPool(db.Statement.ConnPool) + return m +} + +func (m material) replaceDB(db *gorm.DB) material { + m.materialDo.ReplaceDB(db) + return m +} + +type materialDo struct{ gen.DO } + +func (m materialDo) Debug() *materialDo { + return m.withDO(m.DO.Debug()) +} + +func (m materialDo) WithContext(ctx context.Context) *materialDo { + return m.withDO(m.DO.WithContext(ctx)) +} + +func (m materialDo) ReadDB() *materialDo { + return m.Clauses(dbresolver.Read) +} + +func (m materialDo) WriteDB() *materialDo { + return m.Clauses(dbresolver.Write) +} + +func (m materialDo) Session(config *gorm.Session) *materialDo { + return m.withDO(m.DO.Session(config)) +} + +func (m materialDo) Clauses(conds ...clause.Expression) *materialDo { + return m.withDO(m.DO.Clauses(conds...)) +} + +func (m materialDo) Returning(value interface{}, columns ...string) *materialDo { + return m.withDO(m.DO.Returning(value, columns...)) +} + +func (m materialDo) Not(conds ...gen.Condition) *materialDo { + return m.withDO(m.DO.Not(conds...)) +} + +func (m materialDo) Or(conds ...gen.Condition) *materialDo { + return m.withDO(m.DO.Or(conds...)) +} + +func (m materialDo) Select(conds ...field.Expr) *materialDo { + return m.withDO(m.DO.Select(conds...)) +} + +func (m materialDo) Where(conds ...gen.Condition) *materialDo { + return m.withDO(m.DO.Where(conds...)) +} + +func (m materialDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *materialDo { + return m.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (m materialDo) Order(conds ...field.Expr) *materialDo { + return m.withDO(m.DO.Order(conds...)) +} + +func (m materialDo) Distinct(cols ...field.Expr) *materialDo { + return m.withDO(m.DO.Distinct(cols...)) +} + +func (m materialDo) Omit(cols ...field.Expr) *materialDo { + return m.withDO(m.DO.Omit(cols...)) +} + +func (m materialDo) Join(table schema.Tabler, on ...field.Expr) *materialDo { + return m.withDO(m.DO.Join(table, on...)) +} + +func (m materialDo) LeftJoin(table schema.Tabler, on ...field.Expr) *materialDo { + return m.withDO(m.DO.LeftJoin(table, on...)) +} + +func (m materialDo) RightJoin(table schema.Tabler, on ...field.Expr) *materialDo { + return m.withDO(m.DO.RightJoin(table, on...)) +} + +func (m materialDo) Group(cols ...field.Expr) *materialDo { + return m.withDO(m.DO.Group(cols...)) +} + +func (m materialDo) Having(conds ...gen.Condition) *materialDo { + return m.withDO(m.DO.Having(conds...)) +} + +func (m materialDo) Limit(limit int) *materialDo { + return m.withDO(m.DO.Limit(limit)) +} + +func (m materialDo) Offset(offset int) *materialDo { + return m.withDO(m.DO.Offset(offset)) +} + +func (m materialDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *materialDo { + return m.withDO(m.DO.Scopes(funcs...)) +} + +func (m materialDo) Unscoped() *materialDo { + return m.withDO(m.DO.Unscoped()) +} + +func (m materialDo) Create(values ...*model.Material) error { + if len(values) == 0 { + return nil + } + return m.DO.Create(values) +} + +func (m materialDo) CreateInBatches(values []*model.Material, batchSize int) error { + return m.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (m materialDo) Save(values ...*model.Material) error { + if len(values) == 0 { + return nil + } + return m.DO.Save(values) +} + +func (m materialDo) First() (*model.Material, error) { + if result, err := m.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Material), nil + } +} + +func (m materialDo) Take() (*model.Material, error) { + if result, err := m.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Material), nil + } +} + +func (m materialDo) Last() (*model.Material, error) { + if result, err := m.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Material), nil + } +} + +func (m materialDo) Find() ([]*model.Material, error) { + result, err := m.DO.Find() + return result.([]*model.Material), err +} + +func (m materialDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Material, err error) { + buf := make([]*model.Material, 0, batchSize) + err = m.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (m materialDo) FindInBatches(result *[]*model.Material, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return m.DO.FindInBatches(result, batchSize, fc) +} + +func (m materialDo) Attrs(attrs ...field.AssignExpr) *materialDo { + return m.withDO(m.DO.Attrs(attrs...)) +} + +func (m materialDo) Assign(attrs ...field.AssignExpr) *materialDo { + return m.withDO(m.DO.Assign(attrs...)) +} + +func (m materialDo) Joins(fields ...field.RelationField) *materialDo { + for _, _f := range fields { + m = *m.withDO(m.DO.Joins(_f)) + } + return &m +} + +func (m materialDo) Preload(fields ...field.RelationField) *materialDo { + for _, _f := range fields { + m = *m.withDO(m.DO.Preload(_f)) + } + return &m +} + +func (m materialDo) FirstOrInit() (*model.Material, error) { + if result, err := m.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Material), nil + } +} + +func (m materialDo) FirstOrCreate() (*model.Material, error) { + if result, err := m.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Material), nil + } +} + +func (m materialDo) FindByPage(offset int, limit int) (result []*model.Material, count int64, err error) { + result, err = m.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = m.Offset(-1).Limit(-1).Count() + return +} + +func (m materialDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = m.Count() + if err != nil { + return + } + + err = m.Offset(offset).Limit(limit).Scan(result) + return +} + +func (m materialDo) Scan(result interface{}) (err error) { + return m.DO.Scan(result) +} + +func (m materialDo) Delete(models ...*model.Material) (result gen.ResultInfo, err error) { + return m.DO.Delete(models) +} + +func (m *materialDo) withDO(do gen.Dao) *materialDo { + m.DO = *do.(*gen.DO) + return m +} diff --git a/internal/repository/dao/module_statistics_eventflow.gen.go b/internal/repository/dao/module_statistics_eventflow.gen.go new file mode 100644 index 0000000..31f0006 --- /dev/null +++ b/internal/repository/dao/module_statistics_eventflow.gen.go @@ -0,0 +1,397 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newModuleStatisticsEventflow(db *gorm.DB, opts ...gen.DOOption) moduleStatisticsEventflow { + _moduleStatisticsEventflow := moduleStatisticsEventflow{} + + _moduleStatisticsEventflow.moduleStatisticsEventflowDo.UseDB(db, opts...) + _moduleStatisticsEventflow.moduleStatisticsEventflowDo.UseModel(&model.ModuleStatisticsEventflow{}) + + tableName := _moduleStatisticsEventflow.moduleStatisticsEventflowDo.TableName() + _moduleStatisticsEventflow.ALL = field.NewAsterisk(tableName) + _moduleStatisticsEventflow.ID = field.NewUint64(tableName, "id") + _moduleStatisticsEventflow.ProjectID = field.NewInt64(tableName, "project_id") + _moduleStatisticsEventflow.LinkID = field.NewInt64(tableName, "link_id") + _moduleStatisticsEventflow.CampaignID = field.NewInt64(tableName, "campaign_id") + _moduleStatisticsEventflow.DfpRecordID = field.NewInt64(tableName, "dfp_record_id") + _moduleStatisticsEventflow.PersonaID = field.NewInt64(tableName, "persona_id") + _moduleStatisticsEventflow.DeviceID = field.NewString(tableName, "device_id") + _moduleStatisticsEventflow.UserID = field.NewString(tableName, "user_id") + _moduleStatisticsEventflow.EventID = field.NewInt64(tableName, "event_id") + _moduleStatisticsEventflow.IPAddress = field.NewString(tableName, "ip_address") + _moduleStatisticsEventflow.Os = field.NewString(tableName, "os") + _moduleStatisticsEventflow.OsVersion = field.NewString(tableName, "os_version") + _moduleStatisticsEventflow.DeviceModel = field.NewString(tableName, "device_model") + _moduleStatisticsEventflow.CreatedTime = field.NewInt32(tableName, "created_time") + _moduleStatisticsEventflow.EventData = field.NewString(tableName, "event_data") + _moduleStatisticsEventflow.LinkHash = field.NewString(tableName, "link_hash") + _moduleStatisticsEventflow.EventKey = field.NewString(tableName, "event_key") + + _moduleStatisticsEventflow.fillFieldMap() + + return _moduleStatisticsEventflow +} + +type moduleStatisticsEventflow struct { + moduleStatisticsEventflowDo moduleStatisticsEventflowDo + + ALL field.Asterisk + ID field.Uint64 + ProjectID field.Int64 + LinkID field.Int64 + CampaignID field.Int64 + DfpRecordID field.Int64 + PersonaID field.Int64 + DeviceID field.String + UserID field.String + EventID field.Int64 + IPAddress field.String + Os field.String + OsVersion field.String + DeviceModel field.String + CreatedTime field.Int32 + EventData field.String + LinkHash field.String // 链接hash + EventKey field.String // 事件key + + fieldMap map[string]field.Expr +} + +func (m moduleStatisticsEventflow) Table(newTableName string) *moduleStatisticsEventflow { + m.moduleStatisticsEventflowDo.UseTable(newTableName) + return m.updateTableName(newTableName) +} + +func (m moduleStatisticsEventflow) As(alias string) *moduleStatisticsEventflow { + m.moduleStatisticsEventflowDo.DO = *(m.moduleStatisticsEventflowDo.As(alias).(*gen.DO)) + return m.updateTableName(alias) +} + +func (m *moduleStatisticsEventflow) updateTableName(table string) *moduleStatisticsEventflow { + m.ALL = field.NewAsterisk(table) + m.ID = field.NewUint64(table, "id") + m.ProjectID = field.NewInt64(table, "project_id") + m.LinkID = field.NewInt64(table, "link_id") + m.CampaignID = field.NewInt64(table, "campaign_id") + m.DfpRecordID = field.NewInt64(table, "dfp_record_id") + m.PersonaID = field.NewInt64(table, "persona_id") + m.DeviceID = field.NewString(table, "device_id") + m.UserID = field.NewString(table, "user_id") + m.EventID = field.NewInt64(table, "event_id") + m.IPAddress = field.NewString(table, "ip_address") + m.Os = field.NewString(table, "os") + m.OsVersion = field.NewString(table, "os_version") + m.DeviceModel = field.NewString(table, "device_model") + m.CreatedTime = field.NewInt32(table, "created_time") + m.EventData = field.NewString(table, "event_data") + m.LinkHash = field.NewString(table, "link_hash") + m.EventKey = field.NewString(table, "event_key") + + m.fillFieldMap() + + return m +} + +func (m *moduleStatisticsEventflow) WithContext(ctx context.Context) *moduleStatisticsEventflowDo { + return m.moduleStatisticsEventflowDo.WithContext(ctx) +} + +func (m moduleStatisticsEventflow) TableName() string { + return m.moduleStatisticsEventflowDo.TableName() +} + +func (m moduleStatisticsEventflow) Alias() string { return m.moduleStatisticsEventflowDo.Alias() } + +func (m *moduleStatisticsEventflow) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := m.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (m *moduleStatisticsEventflow) fillFieldMap() { + m.fieldMap = make(map[string]field.Expr, 17) + m.fieldMap["id"] = m.ID + m.fieldMap["project_id"] = m.ProjectID + m.fieldMap["link_id"] = m.LinkID + m.fieldMap["campaign_id"] = m.CampaignID + m.fieldMap["dfp_record_id"] = m.DfpRecordID + m.fieldMap["persona_id"] = m.PersonaID + m.fieldMap["device_id"] = m.DeviceID + m.fieldMap["user_id"] = m.UserID + m.fieldMap["event_id"] = m.EventID + m.fieldMap["ip_address"] = m.IPAddress + m.fieldMap["os"] = m.Os + m.fieldMap["os_version"] = m.OsVersion + m.fieldMap["device_model"] = m.DeviceModel + m.fieldMap["created_time"] = m.CreatedTime + m.fieldMap["event_data"] = m.EventData + m.fieldMap["link_hash"] = m.LinkHash + m.fieldMap["event_key"] = m.EventKey +} + +func (m moduleStatisticsEventflow) clone(db *gorm.DB) moduleStatisticsEventflow { + m.moduleStatisticsEventflowDo.ReplaceConnPool(db.Statement.ConnPool) + return m +} + +func (m moduleStatisticsEventflow) replaceDB(db *gorm.DB) moduleStatisticsEventflow { + m.moduleStatisticsEventflowDo.ReplaceDB(db) + return m +} + +type moduleStatisticsEventflowDo struct{ gen.DO } + +func (m moduleStatisticsEventflowDo) Debug() *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Debug()) +} + +func (m moduleStatisticsEventflowDo) WithContext(ctx context.Context) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.WithContext(ctx)) +} + +func (m moduleStatisticsEventflowDo) ReadDB() *moduleStatisticsEventflowDo { + return m.Clauses(dbresolver.Read) +} + +func (m moduleStatisticsEventflowDo) WriteDB() *moduleStatisticsEventflowDo { + return m.Clauses(dbresolver.Write) +} + +func (m moduleStatisticsEventflowDo) Session(config *gorm.Session) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Session(config)) +} + +func (m moduleStatisticsEventflowDo) Clauses(conds ...clause.Expression) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Clauses(conds...)) +} + +func (m moduleStatisticsEventflowDo) Returning(value interface{}, columns ...string) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Returning(value, columns...)) +} + +func (m moduleStatisticsEventflowDo) Not(conds ...gen.Condition) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Not(conds...)) +} + +func (m moduleStatisticsEventflowDo) Or(conds ...gen.Condition) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Or(conds...)) +} + +func (m moduleStatisticsEventflowDo) Select(conds ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Select(conds...)) +} + +func (m moduleStatisticsEventflowDo) Where(conds ...gen.Condition) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Where(conds...)) +} + +func (m moduleStatisticsEventflowDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *moduleStatisticsEventflowDo { + return m.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (m moduleStatisticsEventflowDo) Order(conds ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Order(conds...)) +} + +func (m moduleStatisticsEventflowDo) Distinct(cols ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Distinct(cols...)) +} + +func (m moduleStatisticsEventflowDo) Omit(cols ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Omit(cols...)) +} + +func (m moduleStatisticsEventflowDo) Join(table schema.Tabler, on ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Join(table, on...)) +} + +func (m moduleStatisticsEventflowDo) LeftJoin(table schema.Tabler, on ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.LeftJoin(table, on...)) +} + +func (m moduleStatisticsEventflowDo) RightJoin(table schema.Tabler, on ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.RightJoin(table, on...)) +} + +func (m moduleStatisticsEventflowDo) Group(cols ...field.Expr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Group(cols...)) +} + +func (m moduleStatisticsEventflowDo) Having(conds ...gen.Condition) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Having(conds...)) +} + +func (m moduleStatisticsEventflowDo) Limit(limit int) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Limit(limit)) +} + +func (m moduleStatisticsEventflowDo) Offset(offset int) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Offset(offset)) +} + +func (m moduleStatisticsEventflowDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Scopes(funcs...)) +} + +func (m moduleStatisticsEventflowDo) Unscoped() *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Unscoped()) +} + +func (m moduleStatisticsEventflowDo) Create(values ...*model.ModuleStatisticsEventflow) error { + if len(values) == 0 { + return nil + } + return m.DO.Create(values) +} + +func (m moduleStatisticsEventflowDo) CreateInBatches(values []*model.ModuleStatisticsEventflow, batchSize int) error { + return m.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (m moduleStatisticsEventflowDo) Save(values ...*model.ModuleStatisticsEventflow) error { + if len(values) == 0 { + return nil + } + return m.DO.Save(values) +} + +func (m moduleStatisticsEventflowDo) First() (*model.ModuleStatisticsEventflow, error) { + if result, err := m.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ModuleStatisticsEventflow), nil + } +} + +func (m moduleStatisticsEventflowDo) Take() (*model.ModuleStatisticsEventflow, error) { + if result, err := m.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ModuleStatisticsEventflow), nil + } +} + +func (m moduleStatisticsEventflowDo) Last() (*model.ModuleStatisticsEventflow, error) { + if result, err := m.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ModuleStatisticsEventflow), nil + } +} + +func (m moduleStatisticsEventflowDo) Find() ([]*model.ModuleStatisticsEventflow, error) { + result, err := m.DO.Find() + return result.([]*model.ModuleStatisticsEventflow), err +} + +func (m moduleStatisticsEventflowDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ModuleStatisticsEventflow, err error) { + buf := make([]*model.ModuleStatisticsEventflow, 0, batchSize) + err = m.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (m moduleStatisticsEventflowDo) FindInBatches(result *[]*model.ModuleStatisticsEventflow, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return m.DO.FindInBatches(result, batchSize, fc) +} + +func (m moduleStatisticsEventflowDo) Attrs(attrs ...field.AssignExpr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Attrs(attrs...)) +} + +func (m moduleStatisticsEventflowDo) Assign(attrs ...field.AssignExpr) *moduleStatisticsEventflowDo { + return m.withDO(m.DO.Assign(attrs...)) +} + +func (m moduleStatisticsEventflowDo) Joins(fields ...field.RelationField) *moduleStatisticsEventflowDo { + for _, _f := range fields { + m = *m.withDO(m.DO.Joins(_f)) + } + return &m +} + +func (m moduleStatisticsEventflowDo) Preload(fields ...field.RelationField) *moduleStatisticsEventflowDo { + for _, _f := range fields { + m = *m.withDO(m.DO.Preload(_f)) + } + return &m +} + +func (m moduleStatisticsEventflowDo) FirstOrInit() (*model.ModuleStatisticsEventflow, error) { + if result, err := m.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ModuleStatisticsEventflow), nil + } +} + +func (m moduleStatisticsEventflowDo) FirstOrCreate() (*model.ModuleStatisticsEventflow, error) { + if result, err := m.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ModuleStatisticsEventflow), nil + } +} + +func (m moduleStatisticsEventflowDo) FindByPage(offset int, limit int) (result []*model.ModuleStatisticsEventflow, count int64, err error) { + result, err = m.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = m.Offset(-1).Limit(-1).Count() + return +} + +func (m moduleStatisticsEventflowDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = m.Count() + if err != nil { + return + } + + err = m.Offset(offset).Limit(limit).Scan(result) + return +} + +func (m moduleStatisticsEventflowDo) Scan(result interface{}) (err error) { + return m.DO.Scan(result) +} + +func (m moduleStatisticsEventflowDo) Delete(models ...*model.ModuleStatisticsEventflow) (result gen.ResultInfo, err error) { + return m.DO.Delete(models) +} + +func (m *moduleStatisticsEventflowDo) withDO(do gen.Dao) *moduleStatisticsEventflowDo { + m.DO = *do.(*gen.DO) + return m +} diff --git a/internal/repository/dao/notify_url.gen.go b/internal/repository/dao/notify_url.gen.go new file mode 100644 index 0000000..c329d12 --- /dev/null +++ b/internal/repository/dao/notify_url.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newNotifyURL(db *gorm.DB, opts ...gen.DOOption) notifyURL { + _notifyURL := notifyURL{} + + _notifyURL.notifyURLDo.UseDB(db, opts...) + _notifyURL.notifyURLDo.UseModel(&model.NotifyURL{}) + + tableName := _notifyURL.notifyURLDo.TableName() + _notifyURL.ALL = field.NewAsterisk(tableName) + _notifyURL.ID = field.NewInt64(tableName, "id") + _notifyURL.CreatedAt = field.NewInt64(tableName, "created_at") + _notifyURL.UpdatedAt = field.NewInt64(tableName, "updated_at") + _notifyURL.IsDel = field.NewInt64(tableName, "is_del") + _notifyURL.ProjectID = field.NewInt64(tableName, "project_id") + _notifyURL.Title = field.NewString(tableName, "title") + _notifyURL.URL = field.NewString(tableName, "url") + _notifyURL.OldData = field.NewInt8(tableName, "old_data") + _notifyURL.Source = field.NewInt8(tableName, "source") + _notifyURL.Headers = field.NewString(tableName, "headers") + + _notifyURL.fillFieldMap() + + return _notifyURL +} + +type notifyURL struct { + notifyURLDo notifyURLDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int64 + ProjectID field.Int64 // 项目id(project表) + Title field.String // 地址名称 + URL field.String // 回调地址 + OldData field.Int8 // 是否旧数据(0-否,1-是) + Source field.Int8 // 数据来源(0-后台创建,1-奖品数据迁移,2-api创建) + Headers field.String // 请求头数据 + + fieldMap map[string]field.Expr +} + +func (n notifyURL) Table(newTableName string) *notifyURL { + n.notifyURLDo.UseTable(newTableName) + return n.updateTableName(newTableName) +} + +func (n notifyURL) As(alias string) *notifyURL { + n.notifyURLDo.DO = *(n.notifyURLDo.As(alias).(*gen.DO)) + return n.updateTableName(alias) +} + +func (n *notifyURL) updateTableName(table string) *notifyURL { + n.ALL = field.NewAsterisk(table) + n.ID = field.NewInt64(table, "id") + n.CreatedAt = field.NewInt64(table, "created_at") + n.UpdatedAt = field.NewInt64(table, "updated_at") + n.IsDel = field.NewInt64(table, "is_del") + n.ProjectID = field.NewInt64(table, "project_id") + n.Title = field.NewString(table, "title") + n.URL = field.NewString(table, "url") + n.OldData = field.NewInt8(table, "old_data") + n.Source = field.NewInt8(table, "source") + n.Headers = field.NewString(table, "headers") + + n.fillFieldMap() + + return n +} + +func (n *notifyURL) WithContext(ctx context.Context) *notifyURLDo { + return n.notifyURLDo.WithContext(ctx) +} + +func (n notifyURL) TableName() string { return n.notifyURLDo.TableName() } + +func (n notifyURL) Alias() string { return n.notifyURLDo.Alias() } + +func (n *notifyURL) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := n.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (n *notifyURL) fillFieldMap() { + n.fieldMap = make(map[string]field.Expr, 10) + n.fieldMap["id"] = n.ID + n.fieldMap["created_at"] = n.CreatedAt + n.fieldMap["updated_at"] = n.UpdatedAt + n.fieldMap["is_del"] = n.IsDel + n.fieldMap["project_id"] = n.ProjectID + n.fieldMap["title"] = n.Title + n.fieldMap["url"] = n.URL + n.fieldMap["old_data"] = n.OldData + n.fieldMap["source"] = n.Source + n.fieldMap["headers"] = n.Headers +} + +func (n notifyURL) clone(db *gorm.DB) notifyURL { + n.notifyURLDo.ReplaceConnPool(db.Statement.ConnPool) + return n +} + +func (n notifyURL) replaceDB(db *gorm.DB) notifyURL { + n.notifyURLDo.ReplaceDB(db) + return n +} + +type notifyURLDo struct{ gen.DO } + +func (n notifyURLDo) Debug() *notifyURLDo { + return n.withDO(n.DO.Debug()) +} + +func (n notifyURLDo) WithContext(ctx context.Context) *notifyURLDo { + return n.withDO(n.DO.WithContext(ctx)) +} + +func (n notifyURLDo) ReadDB() *notifyURLDo { + return n.Clauses(dbresolver.Read) +} + +func (n notifyURLDo) WriteDB() *notifyURLDo { + return n.Clauses(dbresolver.Write) +} + +func (n notifyURLDo) Session(config *gorm.Session) *notifyURLDo { + return n.withDO(n.DO.Session(config)) +} + +func (n notifyURLDo) Clauses(conds ...clause.Expression) *notifyURLDo { + return n.withDO(n.DO.Clauses(conds...)) +} + +func (n notifyURLDo) Returning(value interface{}, columns ...string) *notifyURLDo { + return n.withDO(n.DO.Returning(value, columns...)) +} + +func (n notifyURLDo) Not(conds ...gen.Condition) *notifyURLDo { + return n.withDO(n.DO.Not(conds...)) +} + +func (n notifyURLDo) Or(conds ...gen.Condition) *notifyURLDo { + return n.withDO(n.DO.Or(conds...)) +} + +func (n notifyURLDo) Select(conds ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.Select(conds...)) +} + +func (n notifyURLDo) Where(conds ...gen.Condition) *notifyURLDo { + return n.withDO(n.DO.Where(conds...)) +} + +func (n notifyURLDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *notifyURLDo { + return n.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (n notifyURLDo) Order(conds ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.Order(conds...)) +} + +func (n notifyURLDo) Distinct(cols ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.Distinct(cols...)) +} + +func (n notifyURLDo) Omit(cols ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.Omit(cols...)) +} + +func (n notifyURLDo) Join(table schema.Tabler, on ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.Join(table, on...)) +} + +func (n notifyURLDo) LeftJoin(table schema.Tabler, on ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.LeftJoin(table, on...)) +} + +func (n notifyURLDo) RightJoin(table schema.Tabler, on ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.RightJoin(table, on...)) +} + +func (n notifyURLDo) Group(cols ...field.Expr) *notifyURLDo { + return n.withDO(n.DO.Group(cols...)) +} + +func (n notifyURLDo) Having(conds ...gen.Condition) *notifyURLDo { + return n.withDO(n.DO.Having(conds...)) +} + +func (n notifyURLDo) Limit(limit int) *notifyURLDo { + return n.withDO(n.DO.Limit(limit)) +} + +func (n notifyURLDo) Offset(offset int) *notifyURLDo { + return n.withDO(n.DO.Offset(offset)) +} + +func (n notifyURLDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *notifyURLDo { + return n.withDO(n.DO.Scopes(funcs...)) +} + +func (n notifyURLDo) Unscoped() *notifyURLDo { + return n.withDO(n.DO.Unscoped()) +} + +func (n notifyURLDo) Create(values ...*model.NotifyURL) error { + if len(values) == 0 { + return nil + } + return n.DO.Create(values) +} + +func (n notifyURLDo) CreateInBatches(values []*model.NotifyURL, batchSize int) error { + return n.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (n notifyURLDo) Save(values ...*model.NotifyURL) error { + if len(values) == 0 { + return nil + } + return n.DO.Save(values) +} + +func (n notifyURLDo) First() (*model.NotifyURL, error) { + if result, err := n.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.NotifyURL), nil + } +} + +func (n notifyURLDo) Take() (*model.NotifyURL, error) { + if result, err := n.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.NotifyURL), nil + } +} + +func (n notifyURLDo) Last() (*model.NotifyURL, error) { + if result, err := n.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.NotifyURL), nil + } +} + +func (n notifyURLDo) Find() ([]*model.NotifyURL, error) { + result, err := n.DO.Find() + return result.([]*model.NotifyURL), err +} + +func (n notifyURLDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.NotifyURL, err error) { + buf := make([]*model.NotifyURL, 0, batchSize) + err = n.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (n notifyURLDo) FindInBatches(result *[]*model.NotifyURL, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return n.DO.FindInBatches(result, batchSize, fc) +} + +func (n notifyURLDo) Attrs(attrs ...field.AssignExpr) *notifyURLDo { + return n.withDO(n.DO.Attrs(attrs...)) +} + +func (n notifyURLDo) Assign(attrs ...field.AssignExpr) *notifyURLDo { + return n.withDO(n.DO.Assign(attrs...)) +} + +func (n notifyURLDo) Joins(fields ...field.RelationField) *notifyURLDo { + for _, _f := range fields { + n = *n.withDO(n.DO.Joins(_f)) + } + return &n +} + +func (n notifyURLDo) Preload(fields ...field.RelationField) *notifyURLDo { + for _, _f := range fields { + n = *n.withDO(n.DO.Preload(_f)) + } + return &n +} + +func (n notifyURLDo) FirstOrInit() (*model.NotifyURL, error) { + if result, err := n.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.NotifyURL), nil + } +} + +func (n notifyURLDo) FirstOrCreate() (*model.NotifyURL, error) { + if result, err := n.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.NotifyURL), nil + } +} + +func (n notifyURLDo) FindByPage(offset int, limit int) (result []*model.NotifyURL, count int64, err error) { + result, err = n.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = n.Offset(-1).Limit(-1).Count() + return +} + +func (n notifyURLDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = n.Count() + if err != nil { + return + } + + err = n.Offset(offset).Limit(limit).Scan(result) + return +} + +func (n notifyURLDo) Scan(result interface{}) (err error) { + return n.DO.Scan(result) +} + +func (n notifyURLDo) Delete(models ...*model.NotifyURL) (result gen.ResultInfo, err error) { + return n.DO.Delete(models) +} + +func (n *notifyURLDo) withDO(do gen.Dao) *notifyURLDo { + n.DO = *do.(*gen.DO) + return n +} diff --git a/internal/repository/dao/operate_log.gen.go b/internal/repository/dao/operate_log.gen.go new file mode 100644 index 0000000..a133905 --- /dev/null +++ b/internal/repository/dao/operate_log.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newOperateLog(db *gorm.DB, opts ...gen.DOOption) operateLog { + _operateLog := operateLog{} + + _operateLog.operateLogDo.UseDB(db, opts...) + _operateLog.operateLogDo.UseModel(&model.OperateLog{}) + + tableName := _operateLog.operateLogDo.TableName() + _operateLog.ALL = field.NewAsterisk(tableName) + _operateLog.ID = field.NewInt64(tableName, "id") + _operateLog.CreatedAt = field.NewInt64(tableName, "created_at") + _operateLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _operateLog.UserID = field.NewInt64(tableName, "user_id") + _operateLog.Mark = field.NewString(tableName, "mark") + _operateLog.MarkID = field.NewString(tableName, "mark_id") + _operateLog.Data = field.NewString(tableName, "data") + _operateLog.IP = field.NewString(tableName, "ip") + + _operateLog.fillFieldMap() + + return _operateLog +} + +type operateLog struct { + operateLogDo operateLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 员工表ID(user表) + Mark field.String // 操作标记 + MarkID field.String // 操作数据的id + Data field.String // 操作的数据 + IP field.String // 客户端ip地址 + + fieldMap map[string]field.Expr +} + +func (o operateLog) Table(newTableName string) *operateLog { + o.operateLogDo.UseTable(newTableName) + return o.updateTableName(newTableName) +} + +func (o operateLog) As(alias string) *operateLog { + o.operateLogDo.DO = *(o.operateLogDo.As(alias).(*gen.DO)) + return o.updateTableName(alias) +} + +func (o *operateLog) updateTableName(table string) *operateLog { + o.ALL = field.NewAsterisk(table) + o.ID = field.NewInt64(table, "id") + o.CreatedAt = field.NewInt64(table, "created_at") + o.UpdatedAt = field.NewInt64(table, "updated_at") + o.UserID = field.NewInt64(table, "user_id") + o.Mark = field.NewString(table, "mark") + o.MarkID = field.NewString(table, "mark_id") + o.Data = field.NewString(table, "data") + o.IP = field.NewString(table, "ip") + + o.fillFieldMap() + + return o +} + +func (o *operateLog) WithContext(ctx context.Context) *operateLogDo { + return o.operateLogDo.WithContext(ctx) +} + +func (o operateLog) TableName() string { return o.operateLogDo.TableName() } + +func (o operateLog) Alias() string { return o.operateLogDo.Alias() } + +func (o *operateLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := o.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (o *operateLog) fillFieldMap() { + o.fieldMap = make(map[string]field.Expr, 8) + o.fieldMap["id"] = o.ID + o.fieldMap["created_at"] = o.CreatedAt + o.fieldMap["updated_at"] = o.UpdatedAt + o.fieldMap["user_id"] = o.UserID + o.fieldMap["mark"] = o.Mark + o.fieldMap["mark_id"] = o.MarkID + o.fieldMap["data"] = o.Data + o.fieldMap["ip"] = o.IP +} + +func (o operateLog) clone(db *gorm.DB) operateLog { + o.operateLogDo.ReplaceConnPool(db.Statement.ConnPool) + return o +} + +func (o operateLog) replaceDB(db *gorm.DB) operateLog { + o.operateLogDo.ReplaceDB(db) + return o +} + +type operateLogDo struct{ gen.DO } + +func (o operateLogDo) Debug() *operateLogDo { + return o.withDO(o.DO.Debug()) +} + +func (o operateLogDo) WithContext(ctx context.Context) *operateLogDo { + return o.withDO(o.DO.WithContext(ctx)) +} + +func (o operateLogDo) ReadDB() *operateLogDo { + return o.Clauses(dbresolver.Read) +} + +func (o operateLogDo) WriteDB() *operateLogDo { + return o.Clauses(dbresolver.Write) +} + +func (o operateLogDo) Session(config *gorm.Session) *operateLogDo { + return o.withDO(o.DO.Session(config)) +} + +func (o operateLogDo) Clauses(conds ...clause.Expression) *operateLogDo { + return o.withDO(o.DO.Clauses(conds...)) +} + +func (o operateLogDo) Returning(value interface{}, columns ...string) *operateLogDo { + return o.withDO(o.DO.Returning(value, columns...)) +} + +func (o operateLogDo) Not(conds ...gen.Condition) *operateLogDo { + return o.withDO(o.DO.Not(conds...)) +} + +func (o operateLogDo) Or(conds ...gen.Condition) *operateLogDo { + return o.withDO(o.DO.Or(conds...)) +} + +func (o operateLogDo) Select(conds ...field.Expr) *operateLogDo { + return o.withDO(o.DO.Select(conds...)) +} + +func (o operateLogDo) Where(conds ...gen.Condition) *operateLogDo { + return o.withDO(o.DO.Where(conds...)) +} + +func (o operateLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *operateLogDo { + return o.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (o operateLogDo) Order(conds ...field.Expr) *operateLogDo { + return o.withDO(o.DO.Order(conds...)) +} + +func (o operateLogDo) Distinct(cols ...field.Expr) *operateLogDo { + return o.withDO(o.DO.Distinct(cols...)) +} + +func (o operateLogDo) Omit(cols ...field.Expr) *operateLogDo { + return o.withDO(o.DO.Omit(cols...)) +} + +func (o operateLogDo) Join(table schema.Tabler, on ...field.Expr) *operateLogDo { + return o.withDO(o.DO.Join(table, on...)) +} + +func (o operateLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *operateLogDo { + return o.withDO(o.DO.LeftJoin(table, on...)) +} + +func (o operateLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *operateLogDo { + return o.withDO(o.DO.RightJoin(table, on...)) +} + +func (o operateLogDo) Group(cols ...field.Expr) *operateLogDo { + return o.withDO(o.DO.Group(cols...)) +} + +func (o operateLogDo) Having(conds ...gen.Condition) *operateLogDo { + return o.withDO(o.DO.Having(conds...)) +} + +func (o operateLogDo) Limit(limit int) *operateLogDo { + return o.withDO(o.DO.Limit(limit)) +} + +func (o operateLogDo) Offset(offset int) *operateLogDo { + return o.withDO(o.DO.Offset(offset)) +} + +func (o operateLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *operateLogDo { + return o.withDO(o.DO.Scopes(funcs...)) +} + +func (o operateLogDo) Unscoped() *operateLogDo { + return o.withDO(o.DO.Unscoped()) +} + +func (o operateLogDo) Create(values ...*model.OperateLog) error { + if len(values) == 0 { + return nil + } + return o.DO.Create(values) +} + +func (o operateLogDo) CreateInBatches(values []*model.OperateLog, batchSize int) error { + return o.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (o operateLogDo) Save(values ...*model.OperateLog) error { + if len(values) == 0 { + return nil + } + return o.DO.Save(values) +} + +func (o operateLogDo) First() (*model.OperateLog, error) { + if result, err := o.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.OperateLog), nil + } +} + +func (o operateLogDo) Take() (*model.OperateLog, error) { + if result, err := o.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.OperateLog), nil + } +} + +func (o operateLogDo) Last() (*model.OperateLog, error) { + if result, err := o.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.OperateLog), nil + } +} + +func (o operateLogDo) Find() ([]*model.OperateLog, error) { + result, err := o.DO.Find() + return result.([]*model.OperateLog), err +} + +func (o operateLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.OperateLog, err error) { + buf := make([]*model.OperateLog, 0, batchSize) + err = o.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (o operateLogDo) FindInBatches(result *[]*model.OperateLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return o.DO.FindInBatches(result, batchSize, fc) +} + +func (o operateLogDo) Attrs(attrs ...field.AssignExpr) *operateLogDo { + return o.withDO(o.DO.Attrs(attrs...)) +} + +func (o operateLogDo) Assign(attrs ...field.AssignExpr) *operateLogDo { + return o.withDO(o.DO.Assign(attrs...)) +} + +func (o operateLogDo) Joins(fields ...field.RelationField) *operateLogDo { + for _, _f := range fields { + o = *o.withDO(o.DO.Joins(_f)) + } + return &o +} + +func (o operateLogDo) Preload(fields ...field.RelationField) *operateLogDo { + for _, _f := range fields { + o = *o.withDO(o.DO.Preload(_f)) + } + return &o +} + +func (o operateLogDo) FirstOrInit() (*model.OperateLog, error) { + if result, err := o.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.OperateLog), nil + } +} + +func (o operateLogDo) FirstOrCreate() (*model.OperateLog, error) { + if result, err := o.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.OperateLog), nil + } +} + +func (o operateLogDo) FindByPage(offset int, limit int) (result []*model.OperateLog, count int64, err error) { + result, err = o.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = o.Offset(-1).Limit(-1).Count() + return +} + +func (o operateLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = o.Count() + if err != nil { + return + } + + err = o.Offset(offset).Limit(limit).Scan(result) + return +} + +func (o operateLogDo) Scan(result interface{}) (err error) { + return o.DO.Scan(result) +} + +func (o operateLogDo) Delete(models ...*model.OperateLog) (result gen.ResultInfo, err error) { + return o.DO.Delete(models) +} + +func (o *operateLogDo) withDO(do gen.Dao) *operateLogDo { + o.DO = *do.(*gen.DO) + return o +} diff --git a/internal/repository/dao/project.gen.go b/internal/repository/dao/project.gen.go new file mode 100644 index 0000000..bcb4763 --- /dev/null +++ b/internal/repository/dao/project.gen.go @@ -0,0 +1,409 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProject(db *gorm.DB, opts ...gen.DOOption) project { + _project := project{} + + _project.projectDo.UseDB(db, opts...) + _project.projectDo.UseModel(&model.Project{}) + + tableName := _project.projectDo.TableName() + _project.ALL = field.NewAsterisk(tableName) + _project.ID = field.NewInt64(tableName, "id") + _project.CreatedAt = field.NewInt64(tableName, "created_at") + _project.UpdatedAt = field.NewInt64(tableName, "updated_at") + _project.IsDel = field.NewInt8(tableName, "is_del") + _project.CompanyID = field.NewInt64(tableName, "company_id") + _project.HashID = field.NewString(tableName, "hash_id") + _project.Title = field.NewString(tableName, "title") + _project.Domain = field.NewString(tableName, "domain") + _project.IsAll = field.NewInt8(tableName, "is_all") + _project.NotifyToken = field.NewString(tableName, "notify_token") + _project.EncryptStr = field.NewString(tableName, "encrypt_str") + _project.Scene = field.NewInt8(tableName, "scene") + _project.ThirdSecret = field.NewString(tableName, "third_secret") + _project.ThirdURL = field.NewString(tableName, "third_url") + _project.ThirdReboostURL = field.NewString(tableName, "third_reboost_url") + _project.PushLadder = field.NewInt8(tableName, "push_ladder") + _project.FissionCertType = field.NewInt8(tableName, "fission_cert_type") + _project.OpendAd = field.NewInt8(tableName, "opend_ad") + _project.CloseCopyShare = field.NewInt8(tableName, "close_copy_share") + _project.LogoURL = field.NewString(tableName, "logo_url") + _project.IsTest = field.NewInt8(tableName, "is_test") + + _project.fillFieldMap() + + return _project +} + +type project struct { + projectDo projectDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CompanyID field.Int64 // 企业id表 + HashID field.String // 访问key,用于对接 + Title field.String // 项目名称 + Domain field.String // 一级域名 + IsAll field.Int8 // 是否所有员工可看(0-否,1-是) + NotifyToken field.String // 项目回调token + EncryptStr field.String // 数据加密字符串 + Scene field.Int8 // 项目应用场景(1-app,2-web) + ThirdSecret field.String // 第三方开放平台密钥 + ThirdURL field.String // 开放平台回调地址 + ThirdReboostURL field.String // 开放平台reboot回调地址 + PushLadder field.Int8 // 是否开启转发推送 + FissionCertType field.Int8 // 活动用户认证方式(0-不认证,1-加密认证) + OpendAd field.Int8 // 开启广告(0-不开启,1-开启) + CloseCopyShare field.Int8 // 关闭复制分享文案(0-否,1-是) + LogoURL field.String // 项目logo地址 + IsTest field.Int8 // 是否测试项目(0-否,1-是) + + fieldMap map[string]field.Expr +} + +func (p project) Table(newTableName string) *project { + p.projectDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p project) As(alias string) *project { + p.projectDo.DO = *(p.projectDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *project) updateTableName(table string) *project { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.IsDel = field.NewInt8(table, "is_del") + p.CompanyID = field.NewInt64(table, "company_id") + p.HashID = field.NewString(table, "hash_id") + p.Title = field.NewString(table, "title") + p.Domain = field.NewString(table, "domain") + p.IsAll = field.NewInt8(table, "is_all") + p.NotifyToken = field.NewString(table, "notify_token") + p.EncryptStr = field.NewString(table, "encrypt_str") + p.Scene = field.NewInt8(table, "scene") + p.ThirdSecret = field.NewString(table, "third_secret") + p.ThirdURL = field.NewString(table, "third_url") + p.ThirdReboostURL = field.NewString(table, "third_reboost_url") + p.PushLadder = field.NewInt8(table, "push_ladder") + p.FissionCertType = field.NewInt8(table, "fission_cert_type") + p.OpendAd = field.NewInt8(table, "opend_ad") + p.CloseCopyShare = field.NewInt8(table, "close_copy_share") + p.LogoURL = field.NewString(table, "logo_url") + p.IsTest = field.NewInt8(table, "is_test") + + p.fillFieldMap() + + return p +} + +func (p *project) WithContext(ctx context.Context) *projectDo { return p.projectDo.WithContext(ctx) } + +func (p project) TableName() string { return p.projectDo.TableName() } + +func (p project) Alias() string { return p.projectDo.Alias() } + +func (p *project) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *project) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 21) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["is_del"] = p.IsDel + p.fieldMap["company_id"] = p.CompanyID + p.fieldMap["hash_id"] = p.HashID + p.fieldMap["title"] = p.Title + p.fieldMap["domain"] = p.Domain + p.fieldMap["is_all"] = p.IsAll + p.fieldMap["notify_token"] = p.NotifyToken + p.fieldMap["encrypt_str"] = p.EncryptStr + p.fieldMap["scene"] = p.Scene + p.fieldMap["third_secret"] = p.ThirdSecret + p.fieldMap["third_url"] = p.ThirdURL + p.fieldMap["third_reboost_url"] = p.ThirdReboostURL + p.fieldMap["push_ladder"] = p.PushLadder + p.fieldMap["fission_cert_type"] = p.FissionCertType + p.fieldMap["opend_ad"] = p.OpendAd + p.fieldMap["close_copy_share"] = p.CloseCopyShare + p.fieldMap["logo_url"] = p.LogoURL + p.fieldMap["is_test"] = p.IsTest +} + +func (p project) clone(db *gorm.DB) project { + p.projectDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p project) replaceDB(db *gorm.DB) project { + p.projectDo.ReplaceDB(db) + return p +} + +type projectDo struct{ gen.DO } + +func (p projectDo) Debug() *projectDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectDo) WithContext(ctx context.Context) *projectDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectDo) ReadDB() *projectDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectDo) WriteDB() *projectDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectDo) Session(config *gorm.Session) *projectDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectDo) Clauses(conds ...clause.Expression) *projectDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectDo) Returning(value interface{}, columns ...string) *projectDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectDo) Not(conds ...gen.Condition) *projectDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectDo) Or(conds ...gen.Condition) *projectDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectDo) Select(conds ...field.Expr) *projectDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectDo) Where(conds ...gen.Condition) *projectDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectDo) Order(conds ...field.Expr) *projectDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectDo) Distinct(cols ...field.Expr) *projectDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectDo) Omit(cols ...field.Expr) *projectDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectDo) Join(table schema.Tabler, on ...field.Expr) *projectDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectDo) Group(cols ...field.Expr) *projectDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectDo) Having(conds ...gen.Condition) *projectDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectDo) Limit(limit int) *projectDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectDo) Offset(offset int) *projectDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectDo) Unscoped() *projectDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectDo) Create(values ...*model.Project) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectDo) CreateInBatches(values []*model.Project, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectDo) Save(values ...*model.Project) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectDo) First() (*model.Project, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Project), nil + } +} + +func (p projectDo) Take() (*model.Project, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Project), nil + } +} + +func (p projectDo) Last() (*model.Project, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Project), nil + } +} + +func (p projectDo) Find() ([]*model.Project, error) { + result, err := p.DO.Find() + return result.([]*model.Project), err +} + +func (p projectDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Project, err error) { + buf := make([]*model.Project, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectDo) FindInBatches(result *[]*model.Project, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectDo) Attrs(attrs ...field.AssignExpr) *projectDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectDo) Assign(attrs ...field.AssignExpr) *projectDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectDo) Joins(fields ...field.RelationField) *projectDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectDo) Preload(fields ...field.RelationField) *projectDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectDo) FirstOrInit() (*model.Project, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Project), nil + } +} + +func (p projectDo) FirstOrCreate() (*model.Project, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Project), nil + } +} + +func (p projectDo) FindByPage(offset int, limit int) (result []*model.Project, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectDo) Delete(models ...*model.Project) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectDo) withDO(do gen.Dao) *projectDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_ad.gen.go b/internal/repository/dao/project_ad.gen.go new file mode 100644 index 0000000..d36a458 --- /dev/null +++ b/internal/repository/dao/project_ad.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectAd(db *gorm.DB, opts ...gen.DOOption) projectAd { + _projectAd := projectAd{} + + _projectAd.projectAdDo.UseDB(db, opts...) + _projectAd.projectAdDo.UseModel(&model.ProjectAd{}) + + tableName := _projectAd.projectAdDo.TableName() + _projectAd.ALL = field.NewAsterisk(tableName) + _projectAd.ID = field.NewString(tableName, "id") + _projectAd.CreatedAt = field.NewInt64(tableName, "created_at") + _projectAd.UpdatedAt = field.NewInt64(tableName, "updated_at") + _projectAd.ProjectID = field.NewInt64(tableName, "project_id") + _projectAd.OpenAd = field.NewInt8(tableName, "open_ad") + _projectAd.CampaignAd = field.NewInt8(tableName, "campaign_ad") + _projectAd.GaShowID = field.NewString(tableName, "ga_show_id") + _projectAd.GaEmbedID = field.NewString(tableName, "ga_embed_id") + _projectAd.GaDoubleID = field.NewString(tableName, "ga_double_id") + _projectAd.AdStatus = field.NewInt8(tableName, "ad_status") + _projectAd.AdCustomURL = field.NewInt8(tableName, "ad_custom_url") + + _projectAd.fillFieldMap() + + return _projectAd +} + +type projectAd struct { + projectAdDo projectAdDo + + ALL field.Asterisk + ID field.String + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id(project表) + OpenAd field.Int8 // 开启广告模块(0-不开启,1-开启) + CampaignAd field.Int8 // 开启活动广告(0-不开启,1-开启) + GaShowID field.String // 谷歌展示广告id + GaEmbedID field.String // 谷歌内嵌广告id + GaDoubleID field.String // 谷歌多重广告id + AdStatus field.Int8 // 广告状态(1-待审核,2-测试中,3-正式使用) + AdCustomURL field.Int8 // 开启广告自定义链接配置(0-不开启,1-开启) + + fieldMap map[string]field.Expr +} + +func (p projectAd) Table(newTableName string) *projectAd { + p.projectAdDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectAd) As(alias string) *projectAd { + p.projectAdDo.DO = *(p.projectAdDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectAd) updateTableName(table string) *projectAd { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewString(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.ProjectID = field.NewInt64(table, "project_id") + p.OpenAd = field.NewInt8(table, "open_ad") + p.CampaignAd = field.NewInt8(table, "campaign_ad") + p.GaShowID = field.NewString(table, "ga_show_id") + p.GaEmbedID = field.NewString(table, "ga_embed_id") + p.GaDoubleID = field.NewString(table, "ga_double_id") + p.AdStatus = field.NewInt8(table, "ad_status") + p.AdCustomURL = field.NewInt8(table, "ad_custom_url") + + p.fillFieldMap() + + return p +} + +func (p *projectAd) WithContext(ctx context.Context) *projectAdDo { + return p.projectAdDo.WithContext(ctx) +} + +func (p projectAd) TableName() string { return p.projectAdDo.TableName() } + +func (p projectAd) Alias() string { return p.projectAdDo.Alias() } + +func (p *projectAd) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectAd) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 11) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["open_ad"] = p.OpenAd + p.fieldMap["campaign_ad"] = p.CampaignAd + p.fieldMap["ga_show_id"] = p.GaShowID + p.fieldMap["ga_embed_id"] = p.GaEmbedID + p.fieldMap["ga_double_id"] = p.GaDoubleID + p.fieldMap["ad_status"] = p.AdStatus + p.fieldMap["ad_custom_url"] = p.AdCustomURL +} + +func (p projectAd) clone(db *gorm.DB) projectAd { + p.projectAdDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectAd) replaceDB(db *gorm.DB) projectAd { + p.projectAdDo.ReplaceDB(db) + return p +} + +type projectAdDo struct{ gen.DO } + +func (p projectAdDo) Debug() *projectAdDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectAdDo) WithContext(ctx context.Context) *projectAdDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectAdDo) ReadDB() *projectAdDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectAdDo) WriteDB() *projectAdDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectAdDo) Session(config *gorm.Session) *projectAdDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectAdDo) Clauses(conds ...clause.Expression) *projectAdDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectAdDo) Returning(value interface{}, columns ...string) *projectAdDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectAdDo) Not(conds ...gen.Condition) *projectAdDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectAdDo) Or(conds ...gen.Condition) *projectAdDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectAdDo) Select(conds ...field.Expr) *projectAdDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectAdDo) Where(conds ...gen.Condition) *projectAdDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectAdDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectAdDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectAdDo) Order(conds ...field.Expr) *projectAdDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectAdDo) Distinct(cols ...field.Expr) *projectAdDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectAdDo) Omit(cols ...field.Expr) *projectAdDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectAdDo) Join(table schema.Tabler, on ...field.Expr) *projectAdDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectAdDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectAdDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectAdDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectAdDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectAdDo) Group(cols ...field.Expr) *projectAdDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectAdDo) Having(conds ...gen.Condition) *projectAdDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectAdDo) Limit(limit int) *projectAdDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectAdDo) Offset(offset int) *projectAdDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectAdDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectAdDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectAdDo) Unscoped() *projectAdDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectAdDo) Create(values ...*model.ProjectAd) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectAdDo) CreateInBatches(values []*model.ProjectAd, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectAdDo) Save(values ...*model.ProjectAd) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectAdDo) First() (*model.ProjectAd, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectAd), nil + } +} + +func (p projectAdDo) Take() (*model.ProjectAd, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectAd), nil + } +} + +func (p projectAdDo) Last() (*model.ProjectAd, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectAd), nil + } +} + +func (p projectAdDo) Find() ([]*model.ProjectAd, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectAd), err +} + +func (p projectAdDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectAd, err error) { + buf := make([]*model.ProjectAd, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectAdDo) FindInBatches(result *[]*model.ProjectAd, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectAdDo) Attrs(attrs ...field.AssignExpr) *projectAdDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectAdDo) Assign(attrs ...field.AssignExpr) *projectAdDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectAdDo) Joins(fields ...field.RelationField) *projectAdDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectAdDo) Preload(fields ...field.RelationField) *projectAdDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectAdDo) FirstOrInit() (*model.ProjectAd, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectAd), nil + } +} + +func (p projectAdDo) FirstOrCreate() (*model.ProjectAd, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectAd), nil + } +} + +func (p projectAdDo) FindByPage(offset int, limit int) (result []*model.ProjectAd, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectAdDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectAdDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectAdDo) Delete(models ...*model.ProjectAd) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectAdDo) withDO(do gen.Dao) *projectAdDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_secret.gen.go b/internal/repository/dao/project_secret.gen.go new file mode 100644 index 0000000..c50c90e --- /dev/null +++ b/internal/repository/dao/project_secret.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectSecret(db *gorm.DB, opts ...gen.DOOption) projectSecret { + _projectSecret := projectSecret{} + + _projectSecret.projectSecretDo.UseDB(db, opts...) + _projectSecret.projectSecretDo.UseModel(&model.ProjectSecret{}) + + tableName := _projectSecret.projectSecretDo.TableName() + _projectSecret.ALL = field.NewAsterisk(tableName) + _projectSecret.ID = field.NewInt64(tableName, "id") + _projectSecret.CreatedAt = field.NewInt64(tableName, "created_at") + _projectSecret.UpdatedAt = field.NewInt64(tableName, "updated_at") + _projectSecret.IsDel = field.NewInt8(tableName, "is_del") + _projectSecret.CreatorID = field.NewInt64(tableName, "creator_id") + _projectSecret.ProjectID = field.NewInt64(tableName, "project_id") + _projectSecret.AccessSecret = field.NewString(tableName, "access_secret") + + _projectSecret.fillFieldMap() + + return _projectSecret +} + +type projectSecret struct { + projectSecretDo projectSecretDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + CreatorID field.Int64 // 创建人id(user表主键) + ProjectID field.Int64 // 项目id(project表主键) + AccessSecret field.String // 访问私钥 + + fieldMap map[string]field.Expr +} + +func (p projectSecret) Table(newTableName string) *projectSecret { + p.projectSecretDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectSecret) As(alias string) *projectSecret { + p.projectSecretDo.DO = *(p.projectSecretDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectSecret) updateTableName(table string) *projectSecret { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.IsDel = field.NewInt8(table, "is_del") + p.CreatorID = field.NewInt64(table, "creator_id") + p.ProjectID = field.NewInt64(table, "project_id") + p.AccessSecret = field.NewString(table, "access_secret") + + p.fillFieldMap() + + return p +} + +func (p *projectSecret) WithContext(ctx context.Context) *projectSecretDo { + return p.projectSecretDo.WithContext(ctx) +} + +func (p projectSecret) TableName() string { return p.projectSecretDo.TableName() } + +func (p projectSecret) Alias() string { return p.projectSecretDo.Alias() } + +func (p *projectSecret) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectSecret) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 7) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["is_del"] = p.IsDel + p.fieldMap["creator_id"] = p.CreatorID + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["access_secret"] = p.AccessSecret +} + +func (p projectSecret) clone(db *gorm.DB) projectSecret { + p.projectSecretDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectSecret) replaceDB(db *gorm.DB) projectSecret { + p.projectSecretDo.ReplaceDB(db) + return p +} + +type projectSecretDo struct{ gen.DO } + +func (p projectSecretDo) Debug() *projectSecretDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectSecretDo) WithContext(ctx context.Context) *projectSecretDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectSecretDo) ReadDB() *projectSecretDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectSecretDo) WriteDB() *projectSecretDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectSecretDo) Session(config *gorm.Session) *projectSecretDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectSecretDo) Clauses(conds ...clause.Expression) *projectSecretDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectSecretDo) Returning(value interface{}, columns ...string) *projectSecretDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectSecretDo) Not(conds ...gen.Condition) *projectSecretDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectSecretDo) Or(conds ...gen.Condition) *projectSecretDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectSecretDo) Select(conds ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectSecretDo) Where(conds ...gen.Condition) *projectSecretDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectSecretDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectSecretDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectSecretDo) Order(conds ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectSecretDo) Distinct(cols ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectSecretDo) Omit(cols ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectSecretDo) Join(table schema.Tabler, on ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectSecretDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectSecretDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectSecretDo) Group(cols ...field.Expr) *projectSecretDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectSecretDo) Having(conds ...gen.Condition) *projectSecretDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectSecretDo) Limit(limit int) *projectSecretDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectSecretDo) Offset(offset int) *projectSecretDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectSecretDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectSecretDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectSecretDo) Unscoped() *projectSecretDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectSecretDo) Create(values ...*model.ProjectSecret) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectSecretDo) CreateInBatches(values []*model.ProjectSecret, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectSecretDo) Save(values ...*model.ProjectSecret) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectSecretDo) First() (*model.ProjectSecret, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectSecret), nil + } +} + +func (p projectSecretDo) Take() (*model.ProjectSecret, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectSecret), nil + } +} + +func (p projectSecretDo) Last() (*model.ProjectSecret, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectSecret), nil + } +} + +func (p projectSecretDo) Find() ([]*model.ProjectSecret, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectSecret), err +} + +func (p projectSecretDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectSecret, err error) { + buf := make([]*model.ProjectSecret, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectSecretDo) FindInBatches(result *[]*model.ProjectSecret, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectSecretDo) Attrs(attrs ...field.AssignExpr) *projectSecretDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectSecretDo) Assign(attrs ...field.AssignExpr) *projectSecretDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectSecretDo) Joins(fields ...field.RelationField) *projectSecretDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectSecretDo) Preload(fields ...field.RelationField) *projectSecretDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectSecretDo) FirstOrInit() (*model.ProjectSecret, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectSecret), nil + } +} + +func (p projectSecretDo) FirstOrCreate() (*model.ProjectSecret, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectSecret), nil + } +} + +func (p projectSecretDo) FindByPage(offset int, limit int) (result []*model.ProjectSecret, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectSecretDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectSecretDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectSecretDo) Delete(models ...*model.ProjectSecret) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectSecretDo) withDO(do gen.Dao) *projectSecretDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user.gen.go b/internal/repository/dao/project_user.gen.go new file mode 100644 index 0000000..6bd4977 --- /dev/null +++ b/internal/repository/dao/project_user.gen.go @@ -0,0 +1,343 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUser(db *gorm.DB, opts ...gen.DOOption) projectUser { + _projectUser := projectUser{} + + _projectUser.projectUserDo.UseDB(db, opts...) + _projectUser.projectUserDo.UseModel(&model.ProjectUser{}) + + tableName := _projectUser.projectUserDo.TableName() + _projectUser.ALL = field.NewAsterisk(tableName) + _projectUser.ID = field.NewInt64(tableName, "id") + _projectUser.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUser.ProjectID = field.NewInt64(tableName, "project_id") + _projectUser.UserID = field.NewString(tableName, "user_id") + + _projectUser.fillFieldMap() + + return _projectUser +} + +type projectUser struct { + projectUserDo projectUserDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + ProjectID field.Int64 // 项目id(project表) + UserID field.String // 第三方的唯一用户id + + fieldMap map[string]field.Expr +} + +func (p projectUser) Table(newTableName string) *projectUser { + p.projectUserDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUser) As(alias string) *projectUser { + p.projectUserDo.DO = *(p.projectUserDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUser) updateTableName(table string) *projectUser { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.ProjectID = field.NewInt64(table, "project_id") + p.UserID = field.NewString(table, "user_id") + + p.fillFieldMap() + + return p +} + +func (p *projectUser) WithContext(ctx context.Context) *projectUserDo { + return p.projectUserDo.WithContext(ctx) +} + +func (p projectUser) TableName() string { return p.projectUserDo.TableName() } + +func (p projectUser) Alias() string { return p.projectUserDo.Alias() } + +func (p *projectUser) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUser) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 4) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["user_id"] = p.UserID +} + +func (p projectUser) clone(db *gorm.DB) projectUser { + p.projectUserDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUser) replaceDB(db *gorm.DB) projectUser { + p.projectUserDo.ReplaceDB(db) + return p +} + +type projectUserDo struct{ gen.DO } + +func (p projectUserDo) Debug() *projectUserDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserDo) WithContext(ctx context.Context) *projectUserDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserDo) ReadDB() *projectUserDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserDo) WriteDB() *projectUserDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserDo) Session(config *gorm.Session) *projectUserDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserDo) Clauses(conds ...clause.Expression) *projectUserDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserDo) Returning(value interface{}, columns ...string) *projectUserDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserDo) Not(conds ...gen.Condition) *projectUserDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserDo) Or(conds ...gen.Condition) *projectUserDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserDo) Select(conds ...field.Expr) *projectUserDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserDo) Where(conds ...gen.Condition) *projectUserDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserDo) Order(conds ...field.Expr) *projectUserDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserDo) Distinct(cols ...field.Expr) *projectUserDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserDo) Omit(cols ...field.Expr) *projectUserDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserDo) Join(table schema.Tabler, on ...field.Expr) *projectUserDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserDo) Group(cols ...field.Expr) *projectUserDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserDo) Having(conds ...gen.Condition) *projectUserDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserDo) Limit(limit int) *projectUserDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserDo) Offset(offset int) *projectUserDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserDo) Unscoped() *projectUserDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserDo) Create(values ...*model.ProjectUser) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserDo) CreateInBatches(values []*model.ProjectUser, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserDo) Save(values ...*model.ProjectUser) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserDo) First() (*model.ProjectUser, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUser), nil + } +} + +func (p projectUserDo) Take() (*model.ProjectUser, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUser), nil + } +} + +func (p projectUserDo) Last() (*model.ProjectUser, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUser), nil + } +} + +func (p projectUserDo) Find() ([]*model.ProjectUser, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUser), err +} + +func (p projectUserDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUser, err error) { + buf := make([]*model.ProjectUser, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserDo) FindInBatches(result *[]*model.ProjectUser, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserDo) Attrs(attrs ...field.AssignExpr) *projectUserDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserDo) Assign(attrs ...field.AssignExpr) *projectUserDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserDo) Joins(fields ...field.RelationField) *projectUserDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserDo) Preload(fields ...field.RelationField) *projectUserDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserDo) FirstOrInit() (*model.ProjectUser, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUser), nil + } +} + +func (p projectUserDo) FirstOrCreate() (*model.ProjectUser, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUser), nil + } +} + +func (p projectUserDo) FindByPage(offset int, limit int) (result []*model.ProjectUser, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserDo) Delete(models ...*model.ProjectUser) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserDo) withDO(do gen.Dao) *projectUserDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_coin.gen.go b/internal/repository/dao/project_user_coin.gen.go new file mode 100644 index 0000000..245c683 --- /dev/null +++ b/internal/repository/dao/project_user_coin.gen.go @@ -0,0 +1,379 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserCoin(db *gorm.DB, opts ...gen.DOOption) projectUserCoin { + _projectUserCoin := projectUserCoin{} + + _projectUserCoin.projectUserCoinDo.UseDB(db, opts...) + _projectUserCoin.projectUserCoinDo.UseModel(&model.ProjectUserCoin{}) + + tableName := _projectUserCoin.projectUserCoinDo.TableName() + _projectUserCoin.ALL = field.NewAsterisk(tableName) + _projectUserCoin.ID = field.NewInt64(tableName, "id") + _projectUserCoin.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserCoin.UpdatedAt = field.NewInt64(tableName, "updated_at") + _projectUserCoin.ProjectID = field.NewInt64(tableName, "project_id") + _projectUserCoin.UserID = field.NewInt64(tableName, "user_id") + _projectUserCoin.CoinNum = field.NewInt32(tableName, "coin_num") + _projectUserCoin.CoinUse = field.NewInt32(tableName, "coin_use") + _projectUserCoin.ExpiredAt = field.NewInt64(tableName, "expired_at") + _projectUserCoin.IsExpired = field.NewInt8(tableName, "is_expired") + _projectUserCoin.IsUsed = field.NewInt8(tableName, "is_used") + _projectUserCoin.Source = field.NewString(tableName, "source") + _projectUserCoin.SourceID = field.NewInt64(tableName, "source_id") + _projectUserCoin.SourceData = field.NewString(tableName, "source_data") + + _projectUserCoin.fillFieldMap() + + return _projectUserCoin +} + +type projectUserCoin struct { + projectUserCoinDo projectUserCoinDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id + UserID field.Int64 // 项目用户ID + CoinNum field.Int32 // 积分 + CoinUse field.Int32 // 可用积分 + ExpiredAt field.Int64 // 过期时间 + IsExpired field.Int8 // 是否会过期(1-是,0-否) + IsUsed field.Int8 // 是否使用完毕(1-是,0-否) + Source field.String // 来源 + SourceID field.Int64 // 来源唯一id + SourceData field.String // 来源数据 + + fieldMap map[string]field.Expr +} + +func (p projectUserCoin) Table(newTableName string) *projectUserCoin { + p.projectUserCoinDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserCoin) As(alias string) *projectUserCoin { + p.projectUserCoinDo.DO = *(p.projectUserCoinDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserCoin) updateTableName(table string) *projectUserCoin { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.ProjectID = field.NewInt64(table, "project_id") + p.UserID = field.NewInt64(table, "user_id") + p.CoinNum = field.NewInt32(table, "coin_num") + p.CoinUse = field.NewInt32(table, "coin_use") + p.ExpiredAt = field.NewInt64(table, "expired_at") + p.IsExpired = field.NewInt8(table, "is_expired") + p.IsUsed = field.NewInt8(table, "is_used") + p.Source = field.NewString(table, "source") + p.SourceID = field.NewInt64(table, "source_id") + p.SourceData = field.NewString(table, "source_data") + + p.fillFieldMap() + + return p +} + +func (p *projectUserCoin) WithContext(ctx context.Context) *projectUserCoinDo { + return p.projectUserCoinDo.WithContext(ctx) +} + +func (p projectUserCoin) TableName() string { return p.projectUserCoinDo.TableName() } + +func (p projectUserCoin) Alias() string { return p.projectUserCoinDo.Alias() } + +func (p *projectUserCoin) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserCoin) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 13) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["user_id"] = p.UserID + p.fieldMap["coin_num"] = p.CoinNum + p.fieldMap["coin_use"] = p.CoinUse + p.fieldMap["expired_at"] = p.ExpiredAt + p.fieldMap["is_expired"] = p.IsExpired + p.fieldMap["is_used"] = p.IsUsed + p.fieldMap["source"] = p.Source + p.fieldMap["source_id"] = p.SourceID + p.fieldMap["source_data"] = p.SourceData +} + +func (p projectUserCoin) clone(db *gorm.DB) projectUserCoin { + p.projectUserCoinDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserCoin) replaceDB(db *gorm.DB) projectUserCoin { + p.projectUserCoinDo.ReplaceDB(db) + return p +} + +type projectUserCoinDo struct{ gen.DO } + +func (p projectUserCoinDo) Debug() *projectUserCoinDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserCoinDo) WithContext(ctx context.Context) *projectUserCoinDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserCoinDo) ReadDB() *projectUserCoinDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserCoinDo) WriteDB() *projectUserCoinDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserCoinDo) Session(config *gorm.Session) *projectUserCoinDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserCoinDo) Clauses(conds ...clause.Expression) *projectUserCoinDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserCoinDo) Returning(value interface{}, columns ...string) *projectUserCoinDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserCoinDo) Not(conds ...gen.Condition) *projectUserCoinDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserCoinDo) Or(conds ...gen.Condition) *projectUserCoinDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserCoinDo) Select(conds ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserCoinDo) Where(conds ...gen.Condition) *projectUserCoinDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserCoinDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserCoinDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserCoinDo) Order(conds ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserCoinDo) Distinct(cols ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserCoinDo) Omit(cols ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserCoinDo) Join(table schema.Tabler, on ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserCoinDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserCoinDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserCoinDo) Group(cols ...field.Expr) *projectUserCoinDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserCoinDo) Having(conds ...gen.Condition) *projectUserCoinDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserCoinDo) Limit(limit int) *projectUserCoinDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserCoinDo) Offset(offset int) *projectUserCoinDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserCoinDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserCoinDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserCoinDo) Unscoped() *projectUserCoinDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserCoinDo) Create(values ...*model.ProjectUserCoin) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserCoinDo) CreateInBatches(values []*model.ProjectUserCoin, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserCoinDo) Save(values ...*model.ProjectUserCoin) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserCoinDo) First() (*model.ProjectUserCoin, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoin), nil + } +} + +func (p projectUserCoinDo) Take() (*model.ProjectUserCoin, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoin), nil + } +} + +func (p projectUserCoinDo) Last() (*model.ProjectUserCoin, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoin), nil + } +} + +func (p projectUserCoinDo) Find() ([]*model.ProjectUserCoin, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserCoin), err +} + +func (p projectUserCoinDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserCoin, err error) { + buf := make([]*model.ProjectUserCoin, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserCoinDo) FindInBatches(result *[]*model.ProjectUserCoin, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserCoinDo) Attrs(attrs ...field.AssignExpr) *projectUserCoinDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserCoinDo) Assign(attrs ...field.AssignExpr) *projectUserCoinDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserCoinDo) Joins(fields ...field.RelationField) *projectUserCoinDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserCoinDo) Preload(fields ...field.RelationField) *projectUserCoinDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserCoinDo) FirstOrInit() (*model.ProjectUserCoin, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoin), nil + } +} + +func (p projectUserCoinDo) FirstOrCreate() (*model.ProjectUserCoin, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoin), nil + } +} + +func (p projectUserCoinDo) FindByPage(offset int, limit int) (result []*model.ProjectUserCoin, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserCoinDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserCoinDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserCoinDo) Delete(models ...*model.ProjectUserCoin) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserCoinDo) withDO(do gen.Dao) *projectUserCoinDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_coin_deduct.gen.go b/internal/repository/dao/project_user_coin_deduct.gen.go new file mode 100644 index 0000000..2c2f513 --- /dev/null +++ b/internal/repository/dao/project_user_coin_deduct.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserCoinDeduct(db *gorm.DB, opts ...gen.DOOption) projectUserCoinDeduct { + _projectUserCoinDeduct := projectUserCoinDeduct{} + + _projectUserCoinDeduct.projectUserCoinDeductDo.UseDB(db, opts...) + _projectUserCoinDeduct.projectUserCoinDeductDo.UseModel(&model.ProjectUserCoinDeduct{}) + + tableName := _projectUserCoinDeduct.projectUserCoinDeductDo.TableName() + _projectUserCoinDeduct.ALL = field.NewAsterisk(tableName) + _projectUserCoinDeduct.ID = field.NewInt64(tableName, "id") + _projectUserCoinDeduct.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserCoinDeduct.UserID = field.NewInt64(tableName, "user_id") + _projectUserCoinDeduct.Source = field.NewString(tableName, "source") + _projectUserCoinDeduct.RelateMark = field.NewString(tableName, "relate_mark") + _projectUserCoinDeduct.RelateID = field.NewInt64(tableName, "relate_id") + _projectUserCoinDeduct.Operate = field.NewString(tableName, "operate") + _projectUserCoinDeduct.Num = field.NewInt32(tableName, "num") + + _projectUserCoinDeduct.fillFieldMap() + + return _projectUserCoinDeduct +} + +type projectUserCoinDeduct struct { + projectUserCoinDeductDo projectUserCoinDeductDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 + Source field.String // 扣除方式(sytem-系统,app-第三方应用) + RelateMark field.String // 关联标识 + RelateID field.Int64 // 关联id + Operate field.String // 操作标识 + Num field.Int32 // 扣除数量 + + fieldMap map[string]field.Expr +} + +func (p projectUserCoinDeduct) Table(newTableName string) *projectUserCoinDeduct { + p.projectUserCoinDeductDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserCoinDeduct) As(alias string) *projectUserCoinDeduct { + p.projectUserCoinDeductDo.DO = *(p.projectUserCoinDeductDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserCoinDeduct) updateTableName(table string) *projectUserCoinDeduct { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UserID = field.NewInt64(table, "user_id") + p.Source = field.NewString(table, "source") + p.RelateMark = field.NewString(table, "relate_mark") + p.RelateID = field.NewInt64(table, "relate_id") + p.Operate = field.NewString(table, "operate") + p.Num = field.NewInt32(table, "num") + + p.fillFieldMap() + + return p +} + +func (p *projectUserCoinDeduct) WithContext(ctx context.Context) *projectUserCoinDeductDo { + return p.projectUserCoinDeductDo.WithContext(ctx) +} + +func (p projectUserCoinDeduct) TableName() string { return p.projectUserCoinDeductDo.TableName() } + +func (p projectUserCoinDeduct) Alias() string { return p.projectUserCoinDeductDo.Alias() } + +func (p *projectUserCoinDeduct) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserCoinDeduct) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 8) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["user_id"] = p.UserID + p.fieldMap["source"] = p.Source + p.fieldMap["relate_mark"] = p.RelateMark + p.fieldMap["relate_id"] = p.RelateID + p.fieldMap["operate"] = p.Operate + p.fieldMap["num"] = p.Num +} + +func (p projectUserCoinDeduct) clone(db *gorm.DB) projectUserCoinDeduct { + p.projectUserCoinDeductDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserCoinDeduct) replaceDB(db *gorm.DB) projectUserCoinDeduct { + p.projectUserCoinDeductDo.ReplaceDB(db) + return p +} + +type projectUserCoinDeductDo struct{ gen.DO } + +func (p projectUserCoinDeductDo) Debug() *projectUserCoinDeductDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserCoinDeductDo) WithContext(ctx context.Context) *projectUserCoinDeductDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserCoinDeductDo) ReadDB() *projectUserCoinDeductDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserCoinDeductDo) WriteDB() *projectUserCoinDeductDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserCoinDeductDo) Session(config *gorm.Session) *projectUserCoinDeductDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserCoinDeductDo) Clauses(conds ...clause.Expression) *projectUserCoinDeductDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserCoinDeductDo) Returning(value interface{}, columns ...string) *projectUserCoinDeductDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserCoinDeductDo) Not(conds ...gen.Condition) *projectUserCoinDeductDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserCoinDeductDo) Or(conds ...gen.Condition) *projectUserCoinDeductDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserCoinDeductDo) Select(conds ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserCoinDeductDo) Where(conds ...gen.Condition) *projectUserCoinDeductDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserCoinDeductDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserCoinDeductDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserCoinDeductDo) Order(conds ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserCoinDeductDo) Distinct(cols ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserCoinDeductDo) Omit(cols ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserCoinDeductDo) Join(table schema.Tabler, on ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserCoinDeductDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserCoinDeductDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserCoinDeductDo) Group(cols ...field.Expr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserCoinDeductDo) Having(conds ...gen.Condition) *projectUserCoinDeductDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserCoinDeductDo) Limit(limit int) *projectUserCoinDeductDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserCoinDeductDo) Offset(offset int) *projectUserCoinDeductDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserCoinDeductDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserCoinDeductDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserCoinDeductDo) Unscoped() *projectUserCoinDeductDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserCoinDeductDo) Create(values ...*model.ProjectUserCoinDeduct) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserCoinDeductDo) CreateInBatches(values []*model.ProjectUserCoinDeduct, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserCoinDeductDo) Save(values ...*model.ProjectUserCoinDeduct) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserCoinDeductDo) First() (*model.ProjectUserCoinDeduct, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinDeduct), nil + } +} + +func (p projectUserCoinDeductDo) Take() (*model.ProjectUserCoinDeduct, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinDeduct), nil + } +} + +func (p projectUserCoinDeductDo) Last() (*model.ProjectUserCoinDeduct, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinDeduct), nil + } +} + +func (p projectUserCoinDeductDo) Find() ([]*model.ProjectUserCoinDeduct, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserCoinDeduct), err +} + +func (p projectUserCoinDeductDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserCoinDeduct, err error) { + buf := make([]*model.ProjectUserCoinDeduct, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserCoinDeductDo) FindInBatches(result *[]*model.ProjectUserCoinDeduct, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserCoinDeductDo) Attrs(attrs ...field.AssignExpr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserCoinDeductDo) Assign(attrs ...field.AssignExpr) *projectUserCoinDeductDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserCoinDeductDo) Joins(fields ...field.RelationField) *projectUserCoinDeductDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserCoinDeductDo) Preload(fields ...field.RelationField) *projectUserCoinDeductDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserCoinDeductDo) FirstOrInit() (*model.ProjectUserCoinDeduct, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinDeduct), nil + } +} + +func (p projectUserCoinDeductDo) FirstOrCreate() (*model.ProjectUserCoinDeduct, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinDeduct), nil + } +} + +func (p projectUserCoinDeductDo) FindByPage(offset int, limit int) (result []*model.ProjectUserCoinDeduct, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserCoinDeductDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserCoinDeductDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserCoinDeductDo) Delete(models ...*model.ProjectUserCoinDeduct) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserCoinDeductDo) withDO(do gen.Dao) *projectUserCoinDeductDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_coin_expired.gen.go b/internal/repository/dao/project_user_coin_expired.gen.go new file mode 100644 index 0000000..e14532f --- /dev/null +++ b/internal/repository/dao/project_user_coin_expired.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserCoinExpired(db *gorm.DB, opts ...gen.DOOption) projectUserCoinExpired { + _projectUserCoinExpired := projectUserCoinExpired{} + + _projectUserCoinExpired.projectUserCoinExpiredDo.UseDB(db, opts...) + _projectUserCoinExpired.projectUserCoinExpiredDo.UseModel(&model.ProjectUserCoinExpired{}) + + tableName := _projectUserCoinExpired.projectUserCoinExpiredDo.TableName() + _projectUserCoinExpired.ALL = field.NewAsterisk(tableName) + _projectUserCoinExpired.ID = field.NewInt64(tableName, "id") + _projectUserCoinExpired.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserCoinExpired.UpdatedAt = field.NewInt64(tableName, "updated_at") + _projectUserCoinExpired.UserID = field.NewInt64(tableName, "user_id") + _projectUserCoinExpired.CoinID = field.NewInt64(tableName, "coin_id") + _projectUserCoinExpired.DoneAt = field.NewInt64(tableName, "done_at") + _projectUserCoinExpired.IsWait = field.NewInt8(tableName, "is_wait") + + _projectUserCoinExpired.fillFieldMap() + + return _projectUserCoinExpired +} + +type projectUserCoinExpired struct { + projectUserCoinExpiredDo projectUserCoinExpiredDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + UserID field.Int64 // 用户id + CoinID field.Int64 // 积分id + DoneAt field.Int64 // 执行时间 + IsWait field.Int8 // 是否待执行 + + fieldMap map[string]field.Expr +} + +func (p projectUserCoinExpired) Table(newTableName string) *projectUserCoinExpired { + p.projectUserCoinExpiredDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserCoinExpired) As(alias string) *projectUserCoinExpired { + p.projectUserCoinExpiredDo.DO = *(p.projectUserCoinExpiredDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserCoinExpired) updateTableName(table string) *projectUserCoinExpired { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.UserID = field.NewInt64(table, "user_id") + p.CoinID = field.NewInt64(table, "coin_id") + p.DoneAt = field.NewInt64(table, "done_at") + p.IsWait = field.NewInt8(table, "is_wait") + + p.fillFieldMap() + + return p +} + +func (p *projectUserCoinExpired) WithContext(ctx context.Context) *projectUserCoinExpiredDo { + return p.projectUserCoinExpiredDo.WithContext(ctx) +} + +func (p projectUserCoinExpired) TableName() string { return p.projectUserCoinExpiredDo.TableName() } + +func (p projectUserCoinExpired) Alias() string { return p.projectUserCoinExpiredDo.Alias() } + +func (p *projectUserCoinExpired) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserCoinExpired) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 7) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["user_id"] = p.UserID + p.fieldMap["coin_id"] = p.CoinID + p.fieldMap["done_at"] = p.DoneAt + p.fieldMap["is_wait"] = p.IsWait +} + +func (p projectUserCoinExpired) clone(db *gorm.DB) projectUserCoinExpired { + p.projectUserCoinExpiredDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserCoinExpired) replaceDB(db *gorm.DB) projectUserCoinExpired { + p.projectUserCoinExpiredDo.ReplaceDB(db) + return p +} + +type projectUserCoinExpiredDo struct{ gen.DO } + +func (p projectUserCoinExpiredDo) Debug() *projectUserCoinExpiredDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserCoinExpiredDo) WithContext(ctx context.Context) *projectUserCoinExpiredDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserCoinExpiredDo) ReadDB() *projectUserCoinExpiredDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserCoinExpiredDo) WriteDB() *projectUserCoinExpiredDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserCoinExpiredDo) Session(config *gorm.Session) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserCoinExpiredDo) Clauses(conds ...clause.Expression) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserCoinExpiredDo) Returning(value interface{}, columns ...string) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserCoinExpiredDo) Not(conds ...gen.Condition) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserCoinExpiredDo) Or(conds ...gen.Condition) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserCoinExpiredDo) Select(conds ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserCoinExpiredDo) Where(conds ...gen.Condition) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserCoinExpiredDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserCoinExpiredDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserCoinExpiredDo) Order(conds ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserCoinExpiredDo) Distinct(cols ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserCoinExpiredDo) Omit(cols ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserCoinExpiredDo) Join(table schema.Tabler, on ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserCoinExpiredDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserCoinExpiredDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserCoinExpiredDo) Group(cols ...field.Expr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserCoinExpiredDo) Having(conds ...gen.Condition) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserCoinExpiredDo) Limit(limit int) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserCoinExpiredDo) Offset(offset int) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserCoinExpiredDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserCoinExpiredDo) Unscoped() *projectUserCoinExpiredDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserCoinExpiredDo) Create(values ...*model.ProjectUserCoinExpired) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserCoinExpiredDo) CreateInBatches(values []*model.ProjectUserCoinExpired, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserCoinExpiredDo) Save(values ...*model.ProjectUserCoinExpired) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserCoinExpiredDo) First() (*model.ProjectUserCoinExpired, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinExpired), nil + } +} + +func (p projectUserCoinExpiredDo) Take() (*model.ProjectUserCoinExpired, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinExpired), nil + } +} + +func (p projectUserCoinExpiredDo) Last() (*model.ProjectUserCoinExpired, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinExpired), nil + } +} + +func (p projectUserCoinExpiredDo) Find() ([]*model.ProjectUserCoinExpired, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserCoinExpired), err +} + +func (p projectUserCoinExpiredDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserCoinExpired, err error) { + buf := make([]*model.ProjectUserCoinExpired, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserCoinExpiredDo) FindInBatches(result *[]*model.ProjectUserCoinExpired, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserCoinExpiredDo) Attrs(attrs ...field.AssignExpr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserCoinExpiredDo) Assign(attrs ...field.AssignExpr) *projectUserCoinExpiredDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserCoinExpiredDo) Joins(fields ...field.RelationField) *projectUserCoinExpiredDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserCoinExpiredDo) Preload(fields ...field.RelationField) *projectUserCoinExpiredDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserCoinExpiredDo) FirstOrInit() (*model.ProjectUserCoinExpired, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinExpired), nil + } +} + +func (p projectUserCoinExpiredDo) FirstOrCreate() (*model.ProjectUserCoinExpired, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinExpired), nil + } +} + +func (p projectUserCoinExpiredDo) FindByPage(offset int, limit int) (result []*model.ProjectUserCoinExpired, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserCoinExpiredDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserCoinExpiredDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserCoinExpiredDo) Delete(models ...*model.ProjectUserCoinExpired) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserCoinExpiredDo) withDO(do gen.Dao) *projectUserCoinExpiredDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_coin_log.gen.go b/internal/repository/dao/project_user_coin_log.gen.go new file mode 100644 index 0000000..5dd2258 --- /dev/null +++ b/internal/repository/dao/project_user_coin_log.gen.go @@ -0,0 +1,395 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserCoinLog(db *gorm.DB, opts ...gen.DOOption) projectUserCoinLog { + _projectUserCoinLog := projectUserCoinLog{} + + _projectUserCoinLog.projectUserCoinLogDo.UseDB(db, opts...) + _projectUserCoinLog.projectUserCoinLogDo.UseModel(&model.ProjectUserCoinLog{}) + + tableName := _projectUserCoinLog.projectUserCoinLogDo.TableName() + _projectUserCoinLog.ALL = field.NewAsterisk(tableName) + _projectUserCoinLog.ID = field.NewInt64(tableName, "id") + _projectUserCoinLog.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserCoinLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _projectUserCoinLog.ProjectID = field.NewInt64(tableName, "project_id") + _projectUserCoinLog.UserID = field.NewInt64(tableName, "user_id") + _projectUserCoinLog.Source = field.NewString(tableName, "source") + _projectUserCoinLog.SourceID = field.NewInt64(tableName, "source_id") + _projectUserCoinLog.ReqURL = field.NewString(tableName, "req_url") + _projectUserCoinLog.Req = field.NewString(tableName, "req") + _projectUserCoinLog.Resp = field.NewString(tableName, "resp") + _projectUserCoinLog.RespCode = field.NewInt32(tableName, "resp_code") + _projectUserCoinLog.ReqTime = field.NewInt64(tableName, "req_time") + _projectUserCoinLog.ErrMsg = field.NewString(tableName, "err_msg") + _projectUserCoinLog.Token = field.NewString(tableName, "token") + _projectUserCoinLog.ReqHeader = field.NewString(tableName, "req_header") + _projectUserCoinLog.Num = field.NewInt32(tableName, "num") + _projectUserCoinLog.OtherData = field.NewString(tableName, "other_data") + + _projectUserCoinLog.fillFieldMap() + + return _projectUserCoinLog +} + +type projectUserCoinLog struct { + projectUserCoinLogDo projectUserCoinLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id(project_id) + UserID field.Int64 // 用户id(project_user表) + Source field.String // 来源标识 + SourceID field.Int64 // 来源id + ReqURL field.String // 请求地址 + Req field.String // 请求数据 + Resp field.String // 返回数据 + RespCode field.Int32 // 返回状态码 + ReqTime field.Int64 // 请求时长(单位:ms) + ErrMsg field.String // 错误信息 + Token field.String // 请求token + ReqHeader field.String // 请求头数据 + Num field.Int32 // 数量 + OtherData field.String // 其他数据信息 + + fieldMap map[string]field.Expr +} + +func (p projectUserCoinLog) Table(newTableName string) *projectUserCoinLog { + p.projectUserCoinLogDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserCoinLog) As(alias string) *projectUserCoinLog { + p.projectUserCoinLogDo.DO = *(p.projectUserCoinLogDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserCoinLog) updateTableName(table string) *projectUserCoinLog { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.ProjectID = field.NewInt64(table, "project_id") + p.UserID = field.NewInt64(table, "user_id") + p.Source = field.NewString(table, "source") + p.SourceID = field.NewInt64(table, "source_id") + p.ReqURL = field.NewString(table, "req_url") + p.Req = field.NewString(table, "req") + p.Resp = field.NewString(table, "resp") + p.RespCode = field.NewInt32(table, "resp_code") + p.ReqTime = field.NewInt64(table, "req_time") + p.ErrMsg = field.NewString(table, "err_msg") + p.Token = field.NewString(table, "token") + p.ReqHeader = field.NewString(table, "req_header") + p.Num = field.NewInt32(table, "num") + p.OtherData = field.NewString(table, "other_data") + + p.fillFieldMap() + + return p +} + +func (p *projectUserCoinLog) WithContext(ctx context.Context) *projectUserCoinLogDo { + return p.projectUserCoinLogDo.WithContext(ctx) +} + +func (p projectUserCoinLog) TableName() string { return p.projectUserCoinLogDo.TableName() } + +func (p projectUserCoinLog) Alias() string { return p.projectUserCoinLogDo.Alias() } + +func (p *projectUserCoinLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserCoinLog) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 17) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["user_id"] = p.UserID + p.fieldMap["source"] = p.Source + p.fieldMap["source_id"] = p.SourceID + p.fieldMap["req_url"] = p.ReqURL + p.fieldMap["req"] = p.Req + p.fieldMap["resp"] = p.Resp + p.fieldMap["resp_code"] = p.RespCode + p.fieldMap["req_time"] = p.ReqTime + p.fieldMap["err_msg"] = p.ErrMsg + p.fieldMap["token"] = p.Token + p.fieldMap["req_header"] = p.ReqHeader + p.fieldMap["num"] = p.Num + p.fieldMap["other_data"] = p.OtherData +} + +func (p projectUserCoinLog) clone(db *gorm.DB) projectUserCoinLog { + p.projectUserCoinLogDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserCoinLog) replaceDB(db *gorm.DB) projectUserCoinLog { + p.projectUserCoinLogDo.ReplaceDB(db) + return p +} + +type projectUserCoinLogDo struct{ gen.DO } + +func (p projectUserCoinLogDo) Debug() *projectUserCoinLogDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserCoinLogDo) WithContext(ctx context.Context) *projectUserCoinLogDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserCoinLogDo) ReadDB() *projectUserCoinLogDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserCoinLogDo) WriteDB() *projectUserCoinLogDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserCoinLogDo) Session(config *gorm.Session) *projectUserCoinLogDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserCoinLogDo) Clauses(conds ...clause.Expression) *projectUserCoinLogDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserCoinLogDo) Returning(value interface{}, columns ...string) *projectUserCoinLogDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserCoinLogDo) Not(conds ...gen.Condition) *projectUserCoinLogDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserCoinLogDo) Or(conds ...gen.Condition) *projectUserCoinLogDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserCoinLogDo) Select(conds ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserCoinLogDo) Where(conds ...gen.Condition) *projectUserCoinLogDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserCoinLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserCoinLogDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserCoinLogDo) Order(conds ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserCoinLogDo) Distinct(cols ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserCoinLogDo) Omit(cols ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserCoinLogDo) Join(table schema.Tabler, on ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserCoinLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserCoinLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserCoinLogDo) Group(cols ...field.Expr) *projectUserCoinLogDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserCoinLogDo) Having(conds ...gen.Condition) *projectUserCoinLogDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserCoinLogDo) Limit(limit int) *projectUserCoinLogDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserCoinLogDo) Offset(offset int) *projectUserCoinLogDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserCoinLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserCoinLogDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserCoinLogDo) Unscoped() *projectUserCoinLogDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserCoinLogDo) Create(values ...*model.ProjectUserCoinLog) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserCoinLogDo) CreateInBatches(values []*model.ProjectUserCoinLog, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserCoinLogDo) Save(values ...*model.ProjectUserCoinLog) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserCoinLogDo) First() (*model.ProjectUserCoinLog, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinLog), nil + } +} + +func (p projectUserCoinLogDo) Take() (*model.ProjectUserCoinLog, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinLog), nil + } +} + +func (p projectUserCoinLogDo) Last() (*model.ProjectUserCoinLog, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinLog), nil + } +} + +func (p projectUserCoinLogDo) Find() ([]*model.ProjectUserCoinLog, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserCoinLog), err +} + +func (p projectUserCoinLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserCoinLog, err error) { + buf := make([]*model.ProjectUserCoinLog, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserCoinLogDo) FindInBatches(result *[]*model.ProjectUserCoinLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserCoinLogDo) Attrs(attrs ...field.AssignExpr) *projectUserCoinLogDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserCoinLogDo) Assign(attrs ...field.AssignExpr) *projectUserCoinLogDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserCoinLogDo) Joins(fields ...field.RelationField) *projectUserCoinLogDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserCoinLogDo) Preload(fields ...field.RelationField) *projectUserCoinLogDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserCoinLogDo) FirstOrInit() (*model.ProjectUserCoinLog, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinLog), nil + } +} + +func (p projectUserCoinLogDo) FirstOrCreate() (*model.ProjectUserCoinLog, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinLog), nil + } +} + +func (p projectUserCoinLogDo) FindByPage(offset int, limit int) (result []*model.ProjectUserCoinLog, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserCoinLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserCoinLogDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserCoinLogDo) Delete(models ...*model.ProjectUserCoinLog) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserCoinLogDo) withDO(do gen.Dao) *projectUserCoinLogDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_coin_record.gen.go b/internal/repository/dao/project_user_coin_record.gen.go new file mode 100644 index 0000000..f343636 --- /dev/null +++ b/internal/repository/dao/project_user_coin_record.gen.go @@ -0,0 +1,367 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserCoinRecord(db *gorm.DB, opts ...gen.DOOption) projectUserCoinRecord { + _projectUserCoinRecord := projectUserCoinRecord{} + + _projectUserCoinRecord.projectUserCoinRecordDo.UseDB(db, opts...) + _projectUserCoinRecord.projectUserCoinRecordDo.UseModel(&model.ProjectUserCoinRecord{}) + + tableName := _projectUserCoinRecord.projectUserCoinRecordDo.TableName() + _projectUserCoinRecord.ALL = field.NewAsterisk(tableName) + _projectUserCoinRecord.ID = field.NewInt64(tableName, "id") + _projectUserCoinRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserCoinRecord.ProjectID = field.NewInt64(tableName, "project_id") + _projectUserCoinRecord.UserID = field.NewInt64(tableName, "user_id") + _projectUserCoinRecord.Source = field.NewString(tableName, "source") + _projectUserCoinRecord.SourceID = field.NewInt64(tableName, "source_id") + _projectUserCoinRecord.Type = field.NewInt8(tableName, "type") + _projectUserCoinRecord.Mark = field.NewString(tableName, "mark") + _projectUserCoinRecord.Num = field.NewInt32(tableName, "num") + _projectUserCoinRecord.ExpiredAt = field.NewInt64(tableName, "expired_at") + + _projectUserCoinRecord.fillFieldMap() + + return _projectUserCoinRecord +} + +type projectUserCoinRecord struct { + projectUserCoinRecordDo projectUserCoinRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + ProjectID field.Int64 + UserID field.Int64 + Source field.String + SourceID field.Int64 + Type field.Int8 + Mark field.String + Num field.Int32 + ExpiredAt field.Int64 + + fieldMap map[string]field.Expr +} + +func (p projectUserCoinRecord) Table(newTableName string) *projectUserCoinRecord { + p.projectUserCoinRecordDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserCoinRecord) As(alias string) *projectUserCoinRecord { + p.projectUserCoinRecordDo.DO = *(p.projectUserCoinRecordDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserCoinRecord) updateTableName(table string) *projectUserCoinRecord { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.ProjectID = field.NewInt64(table, "project_id") + p.UserID = field.NewInt64(table, "user_id") + p.Source = field.NewString(table, "source") + p.SourceID = field.NewInt64(table, "source_id") + p.Type = field.NewInt8(table, "type") + p.Mark = field.NewString(table, "mark") + p.Num = field.NewInt32(table, "num") + p.ExpiredAt = field.NewInt64(table, "expired_at") + + p.fillFieldMap() + + return p +} + +func (p *projectUserCoinRecord) WithContext(ctx context.Context) *projectUserCoinRecordDo { + return p.projectUserCoinRecordDo.WithContext(ctx) +} + +func (p projectUserCoinRecord) TableName() string { return p.projectUserCoinRecordDo.TableName() } + +func (p projectUserCoinRecord) Alias() string { return p.projectUserCoinRecordDo.Alias() } + +func (p *projectUserCoinRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserCoinRecord) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 10) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["user_id"] = p.UserID + p.fieldMap["source"] = p.Source + p.fieldMap["source_id"] = p.SourceID + p.fieldMap["type"] = p.Type + p.fieldMap["mark"] = p.Mark + p.fieldMap["num"] = p.Num + p.fieldMap["expired_at"] = p.ExpiredAt +} + +func (p projectUserCoinRecord) clone(db *gorm.DB) projectUserCoinRecord { + p.projectUserCoinRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserCoinRecord) replaceDB(db *gorm.DB) projectUserCoinRecord { + p.projectUserCoinRecordDo.ReplaceDB(db) + return p +} + +type projectUserCoinRecordDo struct{ gen.DO } + +func (p projectUserCoinRecordDo) Debug() *projectUserCoinRecordDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserCoinRecordDo) WithContext(ctx context.Context) *projectUserCoinRecordDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserCoinRecordDo) ReadDB() *projectUserCoinRecordDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserCoinRecordDo) WriteDB() *projectUserCoinRecordDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserCoinRecordDo) Session(config *gorm.Session) *projectUserCoinRecordDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserCoinRecordDo) Clauses(conds ...clause.Expression) *projectUserCoinRecordDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserCoinRecordDo) Returning(value interface{}, columns ...string) *projectUserCoinRecordDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserCoinRecordDo) Not(conds ...gen.Condition) *projectUserCoinRecordDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserCoinRecordDo) Or(conds ...gen.Condition) *projectUserCoinRecordDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserCoinRecordDo) Select(conds ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserCoinRecordDo) Where(conds ...gen.Condition) *projectUserCoinRecordDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserCoinRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserCoinRecordDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserCoinRecordDo) Order(conds ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserCoinRecordDo) Distinct(cols ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserCoinRecordDo) Omit(cols ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserCoinRecordDo) Join(table schema.Tabler, on ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserCoinRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserCoinRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserCoinRecordDo) Group(cols ...field.Expr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserCoinRecordDo) Having(conds ...gen.Condition) *projectUserCoinRecordDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserCoinRecordDo) Limit(limit int) *projectUserCoinRecordDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserCoinRecordDo) Offset(offset int) *projectUserCoinRecordDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserCoinRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserCoinRecordDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserCoinRecordDo) Unscoped() *projectUserCoinRecordDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserCoinRecordDo) Create(values ...*model.ProjectUserCoinRecord) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserCoinRecordDo) CreateInBatches(values []*model.ProjectUserCoinRecord, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserCoinRecordDo) Save(values ...*model.ProjectUserCoinRecord) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserCoinRecordDo) First() (*model.ProjectUserCoinRecord, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinRecord), nil + } +} + +func (p projectUserCoinRecordDo) Take() (*model.ProjectUserCoinRecord, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinRecord), nil + } +} + +func (p projectUserCoinRecordDo) Last() (*model.ProjectUserCoinRecord, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinRecord), nil + } +} + +func (p projectUserCoinRecordDo) Find() ([]*model.ProjectUserCoinRecord, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserCoinRecord), err +} + +func (p projectUserCoinRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserCoinRecord, err error) { + buf := make([]*model.ProjectUserCoinRecord, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserCoinRecordDo) FindInBatches(result *[]*model.ProjectUserCoinRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserCoinRecordDo) Attrs(attrs ...field.AssignExpr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserCoinRecordDo) Assign(attrs ...field.AssignExpr) *projectUserCoinRecordDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserCoinRecordDo) Joins(fields ...field.RelationField) *projectUserCoinRecordDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserCoinRecordDo) Preload(fields ...field.RelationField) *projectUserCoinRecordDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserCoinRecordDo) FirstOrInit() (*model.ProjectUserCoinRecord, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinRecord), nil + } +} + +func (p projectUserCoinRecordDo) FirstOrCreate() (*model.ProjectUserCoinRecord, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinRecord), nil + } +} + +func (p projectUserCoinRecordDo) FindByPage(offset int, limit int) (result []*model.ProjectUserCoinRecord, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserCoinRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserCoinRecordDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserCoinRecordDo) Delete(models ...*model.ProjectUserCoinRecord) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserCoinRecordDo) withDO(do gen.Dao) *projectUserCoinRecordDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_coin_use.gen.go b/internal/repository/dao/project_user_coin_use.gen.go new file mode 100644 index 0000000..7ef6a60 --- /dev/null +++ b/internal/repository/dao/project_user_coin_use.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserCoinUse(db *gorm.DB, opts ...gen.DOOption) projectUserCoinUse { + _projectUserCoinUse := projectUserCoinUse{} + + _projectUserCoinUse.projectUserCoinUseDo.UseDB(db, opts...) + _projectUserCoinUse.projectUserCoinUseDo.UseModel(&model.ProjectUserCoinUse{}) + + tableName := _projectUserCoinUse.projectUserCoinUseDo.TableName() + _projectUserCoinUse.ALL = field.NewAsterisk(tableName) + _projectUserCoinUse.ID = field.NewInt64(tableName, "id") + _projectUserCoinUse.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserCoinUse.UserID = field.NewInt64(tableName, "user_id") + _projectUserCoinUse.Num = field.NewInt32(tableName, "num") + _projectUserCoinUse.Source = field.NewString(tableName, "source") + _projectUserCoinUse.SourceID = field.NewInt64(tableName, "source_id") + _projectUserCoinUse.Operate = field.NewString(tableName, "operate") + _projectUserCoinUse.CoinIds = field.NewString(tableName, "coin_ids") + + _projectUserCoinUse.fillFieldMap() + + return _projectUserCoinUse +} + +type projectUserCoinUse struct { + projectUserCoinUseDo projectUserCoinUseDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UserID field.Int64 + Num field.Int32 + Source field.String // 使用来源(campaign-活动,center-任务中心) + SourceID field.Int64 // 使用来源id + Operate field.String // 操作标识 + CoinIds field.String // 扣除关联的积分id + + fieldMap map[string]field.Expr +} + +func (p projectUserCoinUse) Table(newTableName string) *projectUserCoinUse { + p.projectUserCoinUseDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserCoinUse) As(alias string) *projectUserCoinUse { + p.projectUserCoinUseDo.DO = *(p.projectUserCoinUseDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserCoinUse) updateTableName(table string) *projectUserCoinUse { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UserID = field.NewInt64(table, "user_id") + p.Num = field.NewInt32(table, "num") + p.Source = field.NewString(table, "source") + p.SourceID = field.NewInt64(table, "source_id") + p.Operate = field.NewString(table, "operate") + p.CoinIds = field.NewString(table, "coin_ids") + + p.fillFieldMap() + + return p +} + +func (p *projectUserCoinUse) WithContext(ctx context.Context) *projectUserCoinUseDo { + return p.projectUserCoinUseDo.WithContext(ctx) +} + +func (p projectUserCoinUse) TableName() string { return p.projectUserCoinUseDo.TableName() } + +func (p projectUserCoinUse) Alias() string { return p.projectUserCoinUseDo.Alias() } + +func (p *projectUserCoinUse) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserCoinUse) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 8) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["user_id"] = p.UserID + p.fieldMap["num"] = p.Num + p.fieldMap["source"] = p.Source + p.fieldMap["source_id"] = p.SourceID + p.fieldMap["operate"] = p.Operate + p.fieldMap["coin_ids"] = p.CoinIds +} + +func (p projectUserCoinUse) clone(db *gorm.DB) projectUserCoinUse { + p.projectUserCoinUseDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserCoinUse) replaceDB(db *gorm.DB) projectUserCoinUse { + p.projectUserCoinUseDo.ReplaceDB(db) + return p +} + +type projectUserCoinUseDo struct{ gen.DO } + +func (p projectUserCoinUseDo) Debug() *projectUserCoinUseDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserCoinUseDo) WithContext(ctx context.Context) *projectUserCoinUseDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserCoinUseDo) ReadDB() *projectUserCoinUseDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserCoinUseDo) WriteDB() *projectUserCoinUseDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserCoinUseDo) Session(config *gorm.Session) *projectUserCoinUseDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserCoinUseDo) Clauses(conds ...clause.Expression) *projectUserCoinUseDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserCoinUseDo) Returning(value interface{}, columns ...string) *projectUserCoinUseDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserCoinUseDo) Not(conds ...gen.Condition) *projectUserCoinUseDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserCoinUseDo) Or(conds ...gen.Condition) *projectUserCoinUseDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserCoinUseDo) Select(conds ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserCoinUseDo) Where(conds ...gen.Condition) *projectUserCoinUseDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserCoinUseDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserCoinUseDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserCoinUseDo) Order(conds ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserCoinUseDo) Distinct(cols ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserCoinUseDo) Omit(cols ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserCoinUseDo) Join(table schema.Tabler, on ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserCoinUseDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserCoinUseDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserCoinUseDo) Group(cols ...field.Expr) *projectUserCoinUseDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserCoinUseDo) Having(conds ...gen.Condition) *projectUserCoinUseDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserCoinUseDo) Limit(limit int) *projectUserCoinUseDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserCoinUseDo) Offset(offset int) *projectUserCoinUseDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserCoinUseDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserCoinUseDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserCoinUseDo) Unscoped() *projectUserCoinUseDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserCoinUseDo) Create(values ...*model.ProjectUserCoinUse) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserCoinUseDo) CreateInBatches(values []*model.ProjectUserCoinUse, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserCoinUseDo) Save(values ...*model.ProjectUserCoinUse) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserCoinUseDo) First() (*model.ProjectUserCoinUse, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinUse), nil + } +} + +func (p projectUserCoinUseDo) Take() (*model.ProjectUserCoinUse, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinUse), nil + } +} + +func (p projectUserCoinUseDo) Last() (*model.ProjectUserCoinUse, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinUse), nil + } +} + +func (p projectUserCoinUseDo) Find() ([]*model.ProjectUserCoinUse, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserCoinUse), err +} + +func (p projectUserCoinUseDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserCoinUse, err error) { + buf := make([]*model.ProjectUserCoinUse, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserCoinUseDo) FindInBatches(result *[]*model.ProjectUserCoinUse, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserCoinUseDo) Attrs(attrs ...field.AssignExpr) *projectUserCoinUseDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserCoinUseDo) Assign(attrs ...field.AssignExpr) *projectUserCoinUseDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserCoinUseDo) Joins(fields ...field.RelationField) *projectUserCoinUseDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserCoinUseDo) Preload(fields ...field.RelationField) *projectUserCoinUseDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserCoinUseDo) FirstOrInit() (*model.ProjectUserCoinUse, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinUse), nil + } +} + +func (p projectUserCoinUseDo) FirstOrCreate() (*model.ProjectUserCoinUse, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserCoinUse), nil + } +} + +func (p projectUserCoinUseDo) FindByPage(offset int, limit int) (result []*model.ProjectUserCoinUse, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserCoinUseDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserCoinUseDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserCoinUseDo) Delete(models ...*model.ProjectUserCoinUse) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserCoinUseDo) withDO(do gen.Dao) *projectUserCoinUseDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/project_user_info_log.gen.go b/internal/repository/dao/project_user_info_log.gen.go new file mode 100644 index 0000000..ac205c0 --- /dev/null +++ b/internal/repository/dao/project_user_info_log.gen.go @@ -0,0 +1,383 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newProjectUserInfoLog(db *gorm.DB, opts ...gen.DOOption) projectUserInfoLog { + _projectUserInfoLog := projectUserInfoLog{} + + _projectUserInfoLog.projectUserInfoLogDo.UseDB(db, opts...) + _projectUserInfoLog.projectUserInfoLogDo.UseModel(&model.ProjectUserInfoLog{}) + + tableName := _projectUserInfoLog.projectUserInfoLogDo.TableName() + _projectUserInfoLog.ALL = field.NewAsterisk(tableName) + _projectUserInfoLog.ID = field.NewInt64(tableName, "id") + _projectUserInfoLog.CreatedAt = field.NewInt64(tableName, "created_at") + _projectUserInfoLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _projectUserInfoLog.ProjectID = field.NewInt64(tableName, "project_id") + _projectUserInfoLog.UserID = field.NewInt64(tableName, "user_id") + _projectUserInfoLog.Source = field.NewString(tableName, "source") + _projectUserInfoLog.ReqURL = field.NewString(tableName, "req_url") + _projectUserInfoLog.Req = field.NewString(tableName, "req") + _projectUserInfoLog.Resp = field.NewString(tableName, "resp") + _projectUserInfoLog.RespCode = field.NewInt32(tableName, "resp_code") + _projectUserInfoLog.ReqTime = field.NewInt64(tableName, "req_time") + _projectUserInfoLog.ErrMsg = field.NewString(tableName, "err_msg") + _projectUserInfoLog.Token = field.NewString(tableName, "token") + _projectUserInfoLog.ReqHeader = field.NewString(tableName, "req_header") + + _projectUserInfoLog.fillFieldMap() + + return _projectUserInfoLog +} + +type projectUserInfoLog struct { + projectUserInfoLogDo projectUserInfoLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id(project_id) + UserID field.Int64 // 用户id(project_user表) + Source field.String // 来源标识 + ReqURL field.String // 请求地址 + Req field.String // 请求数据 + Resp field.String // 返回数据 + RespCode field.Int32 // 返回状态码 + ReqTime field.Int64 // 请求时长(单位:ms) + ErrMsg field.String // 错误信息 + Token field.String // 请求token + ReqHeader field.String // 请求头数据 + + fieldMap map[string]field.Expr +} + +func (p projectUserInfoLog) Table(newTableName string) *projectUserInfoLog { + p.projectUserInfoLogDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectUserInfoLog) As(alias string) *projectUserInfoLog { + p.projectUserInfoLogDo.DO = *(p.projectUserInfoLogDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectUserInfoLog) updateTableName(table string) *projectUserInfoLog { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt64(table, "id") + p.CreatedAt = field.NewInt64(table, "created_at") + p.UpdatedAt = field.NewInt64(table, "updated_at") + p.ProjectID = field.NewInt64(table, "project_id") + p.UserID = field.NewInt64(table, "user_id") + p.Source = field.NewString(table, "source") + p.ReqURL = field.NewString(table, "req_url") + p.Req = field.NewString(table, "req") + p.Resp = field.NewString(table, "resp") + p.RespCode = field.NewInt32(table, "resp_code") + p.ReqTime = field.NewInt64(table, "req_time") + p.ErrMsg = field.NewString(table, "err_msg") + p.Token = field.NewString(table, "token") + p.ReqHeader = field.NewString(table, "req_header") + + p.fillFieldMap() + + return p +} + +func (p *projectUserInfoLog) WithContext(ctx context.Context) *projectUserInfoLogDo { + return p.projectUserInfoLogDo.WithContext(ctx) +} + +func (p projectUserInfoLog) TableName() string { return p.projectUserInfoLogDo.TableName() } + +func (p projectUserInfoLog) Alias() string { return p.projectUserInfoLogDo.Alias() } + +func (p *projectUserInfoLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectUserInfoLog) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 14) + p.fieldMap["id"] = p.ID + p.fieldMap["created_at"] = p.CreatedAt + p.fieldMap["updated_at"] = p.UpdatedAt + p.fieldMap["project_id"] = p.ProjectID + p.fieldMap["user_id"] = p.UserID + p.fieldMap["source"] = p.Source + p.fieldMap["req_url"] = p.ReqURL + p.fieldMap["req"] = p.Req + p.fieldMap["resp"] = p.Resp + p.fieldMap["resp_code"] = p.RespCode + p.fieldMap["req_time"] = p.ReqTime + p.fieldMap["err_msg"] = p.ErrMsg + p.fieldMap["token"] = p.Token + p.fieldMap["req_header"] = p.ReqHeader +} + +func (p projectUserInfoLog) clone(db *gorm.DB) projectUserInfoLog { + p.projectUserInfoLogDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectUserInfoLog) replaceDB(db *gorm.DB) projectUserInfoLog { + p.projectUserInfoLogDo.ReplaceDB(db) + return p +} + +type projectUserInfoLogDo struct{ gen.DO } + +func (p projectUserInfoLogDo) Debug() *projectUserInfoLogDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectUserInfoLogDo) WithContext(ctx context.Context) *projectUserInfoLogDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectUserInfoLogDo) ReadDB() *projectUserInfoLogDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectUserInfoLogDo) WriteDB() *projectUserInfoLogDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectUserInfoLogDo) Session(config *gorm.Session) *projectUserInfoLogDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectUserInfoLogDo) Clauses(conds ...clause.Expression) *projectUserInfoLogDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectUserInfoLogDo) Returning(value interface{}, columns ...string) *projectUserInfoLogDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectUserInfoLogDo) Not(conds ...gen.Condition) *projectUserInfoLogDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectUserInfoLogDo) Or(conds ...gen.Condition) *projectUserInfoLogDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectUserInfoLogDo) Select(conds ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectUserInfoLogDo) Where(conds ...gen.Condition) *projectUserInfoLogDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectUserInfoLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *projectUserInfoLogDo { + return p.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (p projectUserInfoLogDo) Order(conds ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectUserInfoLogDo) Distinct(cols ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectUserInfoLogDo) Omit(cols ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectUserInfoLogDo) Join(table schema.Tabler, on ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectUserInfoLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectUserInfoLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectUserInfoLogDo) Group(cols ...field.Expr) *projectUserInfoLogDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectUserInfoLogDo) Having(conds ...gen.Condition) *projectUserInfoLogDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectUserInfoLogDo) Limit(limit int) *projectUserInfoLogDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectUserInfoLogDo) Offset(offset int) *projectUserInfoLogDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectUserInfoLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *projectUserInfoLogDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectUserInfoLogDo) Unscoped() *projectUserInfoLogDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectUserInfoLogDo) Create(values ...*model.ProjectUserInfoLog) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectUserInfoLogDo) CreateInBatches(values []*model.ProjectUserInfoLog, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectUserInfoLogDo) Save(values ...*model.ProjectUserInfoLog) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectUserInfoLogDo) First() (*model.ProjectUserInfoLog, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserInfoLog), nil + } +} + +func (p projectUserInfoLogDo) Take() (*model.ProjectUserInfoLog, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserInfoLog), nil + } +} + +func (p projectUserInfoLogDo) Last() (*model.ProjectUserInfoLog, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserInfoLog), nil + } +} + +func (p projectUserInfoLogDo) Find() ([]*model.ProjectUserInfoLog, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectUserInfoLog), err +} + +func (p projectUserInfoLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectUserInfoLog, err error) { + buf := make([]*model.ProjectUserInfoLog, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectUserInfoLogDo) FindInBatches(result *[]*model.ProjectUserInfoLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectUserInfoLogDo) Attrs(attrs ...field.AssignExpr) *projectUserInfoLogDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectUserInfoLogDo) Assign(attrs ...field.AssignExpr) *projectUserInfoLogDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectUserInfoLogDo) Joins(fields ...field.RelationField) *projectUserInfoLogDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectUserInfoLogDo) Preload(fields ...field.RelationField) *projectUserInfoLogDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectUserInfoLogDo) FirstOrInit() (*model.ProjectUserInfoLog, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserInfoLog), nil + } +} + +func (p projectUserInfoLogDo) FirstOrCreate() (*model.ProjectUserInfoLog, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectUserInfoLog), nil + } +} + +func (p projectUserInfoLogDo) FindByPage(offset int, limit int) (result []*model.ProjectUserInfoLog, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectUserInfoLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectUserInfoLogDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectUserInfoLogDo) Delete(models ...*model.ProjectUserInfoLog) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectUserInfoLogDo) withDO(do gen.Dao) *projectUserInfoLogDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/internal/repository/dao/redeem_mall.gen.go b/internal/repository/dao/redeem_mall.gen.go new file mode 100644 index 0000000..323a6b3 --- /dev/null +++ b/internal/repository/dao/redeem_mall.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRedeemMall(db *gorm.DB, opts ...gen.DOOption) redeemMall { + _redeemMall := redeemMall{} + + _redeemMall.redeemMallDo.UseDB(db, opts...) + _redeemMall.redeemMallDo.UseModel(&model.RedeemMall{}) + + tableName := _redeemMall.redeemMallDo.TableName() + _redeemMall.ALL = field.NewAsterisk(tableName) + _redeemMall.ID = field.NewInt64(tableName, "id") + _redeemMall.CreatedAt = field.NewInt64(tableName, "created_at") + _redeemMall.UpdatedAt = field.NewInt64(tableName, "updated_at") + _redeemMall.IsDel = field.NewInt8(tableName, "is_del") + _redeemMall.ProjectID = field.NewInt64(tableName, "project_id") + _redeemMall.Title = field.NewString(tableName, "title") + _redeemMall.Status = field.NewInt8(tableName, "status") + + _redeemMall.fillFieldMap() + + return _redeemMall +} + +type redeemMall struct { + redeemMallDo redeemMallDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否删除(0-否,1-是) + ProjectID field.Int64 // 项目id(project表) + Title field.String // 积分标题 + Status field.Int8 // 状态(1-暂未使用,2-使用中) + + fieldMap map[string]field.Expr +} + +func (r redeemMall) Table(newTableName string) *redeemMall { + r.redeemMallDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r redeemMall) As(alias string) *redeemMall { + r.redeemMallDo.DO = *(r.redeemMallDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *redeemMall) updateTableName(table string) *redeemMall { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.IsDel = field.NewInt8(table, "is_del") + r.ProjectID = field.NewInt64(table, "project_id") + r.Title = field.NewString(table, "title") + r.Status = field.NewInt8(table, "status") + + r.fillFieldMap() + + return r +} + +func (r *redeemMall) WithContext(ctx context.Context) *redeemMallDo { + return r.redeemMallDo.WithContext(ctx) +} + +func (r redeemMall) TableName() string { return r.redeemMallDo.TableName() } + +func (r redeemMall) Alias() string { return r.redeemMallDo.Alias() } + +func (r *redeemMall) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *redeemMall) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 7) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["is_del"] = r.IsDel + r.fieldMap["project_id"] = r.ProjectID + r.fieldMap["title"] = r.Title + r.fieldMap["status"] = r.Status +} + +func (r redeemMall) clone(db *gorm.DB) redeemMall { + r.redeemMallDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r redeemMall) replaceDB(db *gorm.DB) redeemMall { + r.redeemMallDo.ReplaceDB(db) + return r +} + +type redeemMallDo struct{ gen.DO } + +func (r redeemMallDo) Debug() *redeemMallDo { + return r.withDO(r.DO.Debug()) +} + +func (r redeemMallDo) WithContext(ctx context.Context) *redeemMallDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r redeemMallDo) ReadDB() *redeemMallDo { + return r.Clauses(dbresolver.Read) +} + +func (r redeemMallDo) WriteDB() *redeemMallDo { + return r.Clauses(dbresolver.Write) +} + +func (r redeemMallDo) Session(config *gorm.Session) *redeemMallDo { + return r.withDO(r.DO.Session(config)) +} + +func (r redeemMallDo) Clauses(conds ...clause.Expression) *redeemMallDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r redeemMallDo) Returning(value interface{}, columns ...string) *redeemMallDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r redeemMallDo) Not(conds ...gen.Condition) *redeemMallDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r redeemMallDo) Or(conds ...gen.Condition) *redeemMallDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r redeemMallDo) Select(conds ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r redeemMallDo) Where(conds ...gen.Condition) *redeemMallDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r redeemMallDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *redeemMallDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r redeemMallDo) Order(conds ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r redeemMallDo) Distinct(cols ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r redeemMallDo) Omit(cols ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r redeemMallDo) Join(table schema.Tabler, on ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r redeemMallDo) LeftJoin(table schema.Tabler, on ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r redeemMallDo) RightJoin(table schema.Tabler, on ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r redeemMallDo) Group(cols ...field.Expr) *redeemMallDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r redeemMallDo) Having(conds ...gen.Condition) *redeemMallDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r redeemMallDo) Limit(limit int) *redeemMallDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r redeemMallDo) Offset(offset int) *redeemMallDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r redeemMallDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *redeemMallDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r redeemMallDo) Unscoped() *redeemMallDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r redeemMallDo) Create(values ...*model.RedeemMall) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r redeemMallDo) CreateInBatches(values []*model.RedeemMall, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r redeemMallDo) Save(values ...*model.RedeemMall) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r redeemMallDo) First() (*model.RedeemMall, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMall), nil + } +} + +func (r redeemMallDo) Take() (*model.RedeemMall, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMall), nil + } +} + +func (r redeemMallDo) Last() (*model.RedeemMall, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMall), nil + } +} + +func (r redeemMallDo) Find() ([]*model.RedeemMall, error) { + result, err := r.DO.Find() + return result.([]*model.RedeemMall), err +} + +func (r redeemMallDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RedeemMall, err error) { + buf := make([]*model.RedeemMall, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r redeemMallDo) FindInBatches(result *[]*model.RedeemMall, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r redeemMallDo) Attrs(attrs ...field.AssignExpr) *redeemMallDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r redeemMallDo) Assign(attrs ...field.AssignExpr) *redeemMallDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r redeemMallDo) Joins(fields ...field.RelationField) *redeemMallDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r redeemMallDo) Preload(fields ...field.RelationField) *redeemMallDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r redeemMallDo) FirstOrInit() (*model.RedeemMall, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMall), nil + } +} + +func (r redeemMallDo) FirstOrCreate() (*model.RedeemMall, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMall), nil + } +} + +func (r redeemMallDo) FindByPage(offset int, limit int) (result []*model.RedeemMall, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r redeemMallDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r redeemMallDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r redeemMallDo) Delete(models ...*model.RedeemMall) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *redeemMallDo) withDO(do gen.Dao) *redeemMallDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/redeem_mall_item.gen.go b/internal/repository/dao/redeem_mall_item.gen.go new file mode 100644 index 0000000..e368a60 --- /dev/null +++ b/internal/repository/dao/redeem_mall_item.gen.go @@ -0,0 +1,407 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRedeemMallItem(db *gorm.DB, opts ...gen.DOOption) redeemMallItem { + _redeemMallItem := redeemMallItem{} + + _redeemMallItem.redeemMallItemDo.UseDB(db, opts...) + _redeemMallItem.redeemMallItemDo.UseModel(&model.RedeemMallItem{}) + + tableName := _redeemMallItem.redeemMallItemDo.TableName() + _redeemMallItem.ALL = field.NewAsterisk(tableName) + _redeemMallItem.ID = field.NewInt64(tableName, "id") + _redeemMallItem.CreatedAt = field.NewInt64(tableName, "created_at") + _redeemMallItem.UpdatedAt = field.NewInt64(tableName, "updated_at") + _redeemMallItem.IsDel = field.NewInt8(tableName, "is_del") + _redeemMallItem.MallID = field.NewInt64(tableName, "mall_id") + _redeemMallItem.RewardID = field.NewInt64(tableName, "reward_id") + _redeemMallItem.CoinNum = field.NewInt32(tableName, "coin_num") + _redeemMallItem.Stock = field.NewInt64(tableName, "stock") + _redeemMallItem.UseStock = field.NewInt64(tableName, "use_stock") + _redeemMallItem.UpType = field.NewInt8(tableName, "up_type") + _redeemMallItem.UpCustom = field.NewInt64(tableName, "up_custom") + _redeemMallItem.UpAt = field.NewInt64(tableName, "up_at") + _redeemMallItem.UpFrom = field.NewString(tableName, "up_from") + _redeemMallItem.UpShow = field.NewString(tableName, "up_show") + _redeemMallItem.DownType = field.NewInt8(tableName, "down_type") + _redeemMallItem.DownCustom = field.NewInt64(tableName, "down_custom") + _redeemMallItem.DownAt = field.NewInt64(tableName, "down_at") + _redeemMallItem.DownFrom = field.NewString(tableName, "down_from") + _redeemMallItem.DownShow = field.NewString(tableName, "down_show") + _redeemMallItem.Sort = field.NewInt32(tableName, "sort") + + _redeemMallItem.fillFieldMap() + + return _redeemMallItem +} + +type redeemMallItem struct { + redeemMallItemDo redeemMallItemDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否删除(0-否,1-是) + MallID field.Int64 // 商城id(redeem_mall表) + RewardID field.Int64 // 奖品id(reward表) + CoinNum field.Int32 // 所需积分数 + Stock field.Int64 // 总库存 + UseStock field.Int64 // 已使用库存(下架时候结算,-1未结算) + UpType field.Int8 // 上架类型(1-立即上架,2-指定时间) + UpCustom field.Int64 // 自定的上架时间 + UpAt field.Int64 // 上架时间 + UpFrom field.String // 上架来源 + UpShow field.String // 指定上架展示配置 + DownType field.Int8 // 下架类型(1-永久上架,2-指定时间下架) + DownCustom field.Int64 // 指定下架时间 + DownAt field.Int64 // 下架时间 + DownFrom field.String // 下架来源 + DownShow field.String // 指定下架展示配置 + Sort field.Int32 // 排序 + + fieldMap map[string]field.Expr +} + +func (r redeemMallItem) Table(newTableName string) *redeemMallItem { + r.redeemMallItemDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r redeemMallItem) As(alias string) *redeemMallItem { + r.redeemMallItemDo.DO = *(r.redeemMallItemDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *redeemMallItem) updateTableName(table string) *redeemMallItem { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.IsDel = field.NewInt8(table, "is_del") + r.MallID = field.NewInt64(table, "mall_id") + r.RewardID = field.NewInt64(table, "reward_id") + r.CoinNum = field.NewInt32(table, "coin_num") + r.Stock = field.NewInt64(table, "stock") + r.UseStock = field.NewInt64(table, "use_stock") + r.UpType = field.NewInt8(table, "up_type") + r.UpCustom = field.NewInt64(table, "up_custom") + r.UpAt = field.NewInt64(table, "up_at") + r.UpFrom = field.NewString(table, "up_from") + r.UpShow = field.NewString(table, "up_show") + r.DownType = field.NewInt8(table, "down_type") + r.DownCustom = field.NewInt64(table, "down_custom") + r.DownAt = field.NewInt64(table, "down_at") + r.DownFrom = field.NewString(table, "down_from") + r.DownShow = field.NewString(table, "down_show") + r.Sort = field.NewInt32(table, "sort") + + r.fillFieldMap() + + return r +} + +func (r *redeemMallItem) WithContext(ctx context.Context) *redeemMallItemDo { + return r.redeemMallItemDo.WithContext(ctx) +} + +func (r redeemMallItem) TableName() string { return r.redeemMallItemDo.TableName() } + +func (r redeemMallItem) Alias() string { return r.redeemMallItemDo.Alias() } + +func (r *redeemMallItem) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *redeemMallItem) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 20) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["is_del"] = r.IsDel + r.fieldMap["mall_id"] = r.MallID + r.fieldMap["reward_id"] = r.RewardID + r.fieldMap["coin_num"] = r.CoinNum + r.fieldMap["stock"] = r.Stock + r.fieldMap["use_stock"] = r.UseStock + r.fieldMap["up_type"] = r.UpType + r.fieldMap["up_custom"] = r.UpCustom + r.fieldMap["up_at"] = r.UpAt + r.fieldMap["up_from"] = r.UpFrom + r.fieldMap["up_show"] = r.UpShow + r.fieldMap["down_type"] = r.DownType + r.fieldMap["down_custom"] = r.DownCustom + r.fieldMap["down_at"] = r.DownAt + r.fieldMap["down_from"] = r.DownFrom + r.fieldMap["down_show"] = r.DownShow + r.fieldMap["sort"] = r.Sort +} + +func (r redeemMallItem) clone(db *gorm.DB) redeemMallItem { + r.redeemMallItemDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r redeemMallItem) replaceDB(db *gorm.DB) redeemMallItem { + r.redeemMallItemDo.ReplaceDB(db) + return r +} + +type redeemMallItemDo struct{ gen.DO } + +func (r redeemMallItemDo) Debug() *redeemMallItemDo { + return r.withDO(r.DO.Debug()) +} + +func (r redeemMallItemDo) WithContext(ctx context.Context) *redeemMallItemDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r redeemMallItemDo) ReadDB() *redeemMallItemDo { + return r.Clauses(dbresolver.Read) +} + +func (r redeemMallItemDo) WriteDB() *redeemMallItemDo { + return r.Clauses(dbresolver.Write) +} + +func (r redeemMallItemDo) Session(config *gorm.Session) *redeemMallItemDo { + return r.withDO(r.DO.Session(config)) +} + +func (r redeemMallItemDo) Clauses(conds ...clause.Expression) *redeemMallItemDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r redeemMallItemDo) Returning(value interface{}, columns ...string) *redeemMallItemDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r redeemMallItemDo) Not(conds ...gen.Condition) *redeemMallItemDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r redeemMallItemDo) Or(conds ...gen.Condition) *redeemMallItemDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r redeemMallItemDo) Select(conds ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r redeemMallItemDo) Where(conds ...gen.Condition) *redeemMallItemDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r redeemMallItemDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *redeemMallItemDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r redeemMallItemDo) Order(conds ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r redeemMallItemDo) Distinct(cols ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r redeemMallItemDo) Omit(cols ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r redeemMallItemDo) Join(table schema.Tabler, on ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r redeemMallItemDo) LeftJoin(table schema.Tabler, on ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r redeemMallItemDo) RightJoin(table schema.Tabler, on ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r redeemMallItemDo) Group(cols ...field.Expr) *redeemMallItemDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r redeemMallItemDo) Having(conds ...gen.Condition) *redeemMallItemDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r redeemMallItemDo) Limit(limit int) *redeemMallItemDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r redeemMallItemDo) Offset(offset int) *redeemMallItemDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r redeemMallItemDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *redeemMallItemDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r redeemMallItemDo) Unscoped() *redeemMallItemDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r redeemMallItemDo) Create(values ...*model.RedeemMallItem) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r redeemMallItemDo) CreateInBatches(values []*model.RedeemMallItem, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r redeemMallItemDo) Save(values ...*model.RedeemMallItem) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r redeemMallItemDo) First() (*model.RedeemMallItem, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItem), nil + } +} + +func (r redeemMallItemDo) Take() (*model.RedeemMallItem, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItem), nil + } +} + +func (r redeemMallItemDo) Last() (*model.RedeemMallItem, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItem), nil + } +} + +func (r redeemMallItemDo) Find() ([]*model.RedeemMallItem, error) { + result, err := r.DO.Find() + return result.([]*model.RedeemMallItem), err +} + +func (r redeemMallItemDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RedeemMallItem, err error) { + buf := make([]*model.RedeemMallItem, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r redeemMallItemDo) FindInBatches(result *[]*model.RedeemMallItem, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r redeemMallItemDo) Attrs(attrs ...field.AssignExpr) *redeemMallItemDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r redeemMallItemDo) Assign(attrs ...field.AssignExpr) *redeemMallItemDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r redeemMallItemDo) Joins(fields ...field.RelationField) *redeemMallItemDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r redeemMallItemDo) Preload(fields ...field.RelationField) *redeemMallItemDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r redeemMallItemDo) FirstOrInit() (*model.RedeemMallItem, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItem), nil + } +} + +func (r redeemMallItemDo) FirstOrCreate() (*model.RedeemMallItem, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItem), nil + } +} + +func (r redeemMallItemDo) FindByPage(offset int, limit int) (result []*model.RedeemMallItem, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r redeemMallItemDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r redeemMallItemDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r redeemMallItemDo) Delete(models ...*model.RedeemMallItem) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *redeemMallItemDo) withDO(do gen.Dao) *redeemMallItemDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/redeem_mall_item_task.gen.go b/internal/repository/dao/redeem_mall_item_task.gen.go new file mode 100644 index 0000000..3e5e46f --- /dev/null +++ b/internal/repository/dao/redeem_mall_item_task.gen.go @@ -0,0 +1,347 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRedeemMallItemTask(db *gorm.DB, opts ...gen.DOOption) redeemMallItemTask { + _redeemMallItemTask := redeemMallItemTask{} + + _redeemMallItemTask.redeemMallItemTaskDo.UseDB(db, opts...) + _redeemMallItemTask.redeemMallItemTaskDo.UseModel(&model.RedeemMallItemTask{}) + + tableName := _redeemMallItemTask.redeemMallItemTaskDo.TableName() + _redeemMallItemTask.ALL = field.NewAsterisk(tableName) + _redeemMallItemTask.ID = field.NewInt64(tableName, "id") + _redeemMallItemTask.CreatedAt = field.NewInt64(tableName, "created_at") + _redeemMallItemTask.ItemID = field.NewInt64(tableName, "item_id") + _redeemMallItemTask.DoAt = field.NewInt64(tableName, "do_at") + _redeemMallItemTask.Mark = field.NewString(tableName, "mark") + + _redeemMallItemTask.fillFieldMap() + + return _redeemMallItemTask +} + +type redeemMallItemTask struct { + redeemMallItemTaskDo redeemMallItemTaskDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + ItemID field.Int64 // 商城商品ID(redeem_mall_item表) + DoAt field.Int64 // 执行时间 + Mark field.String // 执行标识 + + fieldMap map[string]field.Expr +} + +func (r redeemMallItemTask) Table(newTableName string) *redeemMallItemTask { + r.redeemMallItemTaskDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r redeemMallItemTask) As(alias string) *redeemMallItemTask { + r.redeemMallItemTaskDo.DO = *(r.redeemMallItemTaskDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *redeemMallItemTask) updateTableName(table string) *redeemMallItemTask { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.ItemID = field.NewInt64(table, "item_id") + r.DoAt = field.NewInt64(table, "do_at") + r.Mark = field.NewString(table, "mark") + + r.fillFieldMap() + + return r +} + +func (r *redeemMallItemTask) WithContext(ctx context.Context) *redeemMallItemTaskDo { + return r.redeemMallItemTaskDo.WithContext(ctx) +} + +func (r redeemMallItemTask) TableName() string { return r.redeemMallItemTaskDo.TableName() } + +func (r redeemMallItemTask) Alias() string { return r.redeemMallItemTaskDo.Alias() } + +func (r *redeemMallItemTask) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *redeemMallItemTask) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 5) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["item_id"] = r.ItemID + r.fieldMap["do_at"] = r.DoAt + r.fieldMap["mark"] = r.Mark +} + +func (r redeemMallItemTask) clone(db *gorm.DB) redeemMallItemTask { + r.redeemMallItemTaskDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r redeemMallItemTask) replaceDB(db *gorm.DB) redeemMallItemTask { + r.redeemMallItemTaskDo.ReplaceDB(db) + return r +} + +type redeemMallItemTaskDo struct{ gen.DO } + +func (r redeemMallItemTaskDo) Debug() *redeemMallItemTaskDo { + return r.withDO(r.DO.Debug()) +} + +func (r redeemMallItemTaskDo) WithContext(ctx context.Context) *redeemMallItemTaskDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r redeemMallItemTaskDo) ReadDB() *redeemMallItemTaskDo { + return r.Clauses(dbresolver.Read) +} + +func (r redeemMallItemTaskDo) WriteDB() *redeemMallItemTaskDo { + return r.Clauses(dbresolver.Write) +} + +func (r redeemMallItemTaskDo) Session(config *gorm.Session) *redeemMallItemTaskDo { + return r.withDO(r.DO.Session(config)) +} + +func (r redeemMallItemTaskDo) Clauses(conds ...clause.Expression) *redeemMallItemTaskDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r redeemMallItemTaskDo) Returning(value interface{}, columns ...string) *redeemMallItemTaskDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r redeemMallItemTaskDo) Not(conds ...gen.Condition) *redeemMallItemTaskDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r redeemMallItemTaskDo) Or(conds ...gen.Condition) *redeemMallItemTaskDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r redeemMallItemTaskDo) Select(conds ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r redeemMallItemTaskDo) Where(conds ...gen.Condition) *redeemMallItemTaskDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r redeemMallItemTaskDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *redeemMallItemTaskDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r redeemMallItemTaskDo) Order(conds ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r redeemMallItemTaskDo) Distinct(cols ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r redeemMallItemTaskDo) Omit(cols ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r redeemMallItemTaskDo) Join(table schema.Tabler, on ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r redeemMallItemTaskDo) LeftJoin(table schema.Tabler, on ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r redeemMallItemTaskDo) RightJoin(table schema.Tabler, on ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r redeemMallItemTaskDo) Group(cols ...field.Expr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r redeemMallItemTaskDo) Having(conds ...gen.Condition) *redeemMallItemTaskDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r redeemMallItemTaskDo) Limit(limit int) *redeemMallItemTaskDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r redeemMallItemTaskDo) Offset(offset int) *redeemMallItemTaskDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r redeemMallItemTaskDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *redeemMallItemTaskDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r redeemMallItemTaskDo) Unscoped() *redeemMallItemTaskDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r redeemMallItemTaskDo) Create(values ...*model.RedeemMallItemTask) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r redeemMallItemTaskDo) CreateInBatches(values []*model.RedeemMallItemTask, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r redeemMallItemTaskDo) Save(values ...*model.RedeemMallItemTask) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r redeemMallItemTaskDo) First() (*model.RedeemMallItemTask, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItemTask), nil + } +} + +func (r redeemMallItemTaskDo) Take() (*model.RedeemMallItemTask, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItemTask), nil + } +} + +func (r redeemMallItemTaskDo) Last() (*model.RedeemMallItemTask, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItemTask), nil + } +} + +func (r redeemMallItemTaskDo) Find() ([]*model.RedeemMallItemTask, error) { + result, err := r.DO.Find() + return result.([]*model.RedeemMallItemTask), err +} + +func (r redeemMallItemTaskDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RedeemMallItemTask, err error) { + buf := make([]*model.RedeemMallItemTask, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r redeemMallItemTaskDo) FindInBatches(result *[]*model.RedeemMallItemTask, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r redeemMallItemTaskDo) Attrs(attrs ...field.AssignExpr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r redeemMallItemTaskDo) Assign(attrs ...field.AssignExpr) *redeemMallItemTaskDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r redeemMallItemTaskDo) Joins(fields ...field.RelationField) *redeemMallItemTaskDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r redeemMallItemTaskDo) Preload(fields ...field.RelationField) *redeemMallItemTaskDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r redeemMallItemTaskDo) FirstOrInit() (*model.RedeemMallItemTask, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItemTask), nil + } +} + +func (r redeemMallItemTaskDo) FirstOrCreate() (*model.RedeemMallItemTask, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallItemTask), nil + } +} + +func (r redeemMallItemTaskDo) FindByPage(offset int, limit int) (result []*model.RedeemMallItemTask, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r redeemMallItemTaskDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r redeemMallItemTaskDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r redeemMallItemTaskDo) Delete(models ...*model.RedeemMallItemTask) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *redeemMallItemTaskDo) withDO(do gen.Dao) *redeemMallItemTaskDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/redeem_mall_record.gen.go b/internal/repository/dao/redeem_mall_record.gen.go new file mode 100644 index 0000000..0428c4f --- /dev/null +++ b/internal/repository/dao/redeem_mall_record.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRedeemMallRecord(db *gorm.DB, opts ...gen.DOOption) redeemMallRecord { + _redeemMallRecord := redeemMallRecord{} + + _redeemMallRecord.redeemMallRecordDo.UseDB(db, opts...) + _redeemMallRecord.redeemMallRecordDo.UseModel(&model.RedeemMallRecord{}) + + tableName := _redeemMallRecord.redeemMallRecordDo.TableName() + _redeemMallRecord.ALL = field.NewAsterisk(tableName) + _redeemMallRecord.ID = field.NewInt64(tableName, "id") + _redeemMallRecord.CreatedAt = field.NewInt64(tableName, "created_at") + _redeemMallRecord.UpdatedAt = field.NewInt64(tableName, "updated_at") + _redeemMallRecord.MallID = field.NewInt64(tableName, "mall_id") + _redeemMallRecord.MallItemID = field.NewInt64(tableName, "mall_item_id") + _redeemMallRecord.CoinNum = field.NewInt64(tableName, "coin_num") + _redeemMallRecord.Status = field.NewInt8(tableName, "status") + _redeemMallRecord.FailType = field.NewString(tableName, "fail_type") + _redeemMallRecord.FailMsg = field.NewString(tableName, "fail_msg") + _redeemMallRecord.RewardID = field.NewInt64(tableName, "reward_id") + _redeemMallRecord.CustomRewardVal = field.NewString(tableName, "custom_reward_val") + + _redeemMallRecord.fillFieldMap() + + return _redeemMallRecord +} + +type redeemMallRecord struct { + redeemMallRecordDo redeemMallRecordDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + MallID field.Int64 // 商城id(redeem_mall表) + MallItemID field.Int64 // 商城商品ID(redeem_mall_item表) + CoinNum field.Int64 // 消耗的积分数 + Status field.Int8 // 奖品状态(1-处理成功,2-待推送,3-推送失败) + FailType field.String // 失败原因标识 + FailMsg field.String // 具体失败原因 + RewardID field.Int64 // 基础奖品id(reward表) + CustomRewardVal field.String // 回调后接收到的数据 + + fieldMap map[string]field.Expr +} + +func (r redeemMallRecord) Table(newTableName string) *redeemMallRecord { + r.redeemMallRecordDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r redeemMallRecord) As(alias string) *redeemMallRecord { + r.redeemMallRecordDo.DO = *(r.redeemMallRecordDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *redeemMallRecord) updateTableName(table string) *redeemMallRecord { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.MallID = field.NewInt64(table, "mall_id") + r.MallItemID = field.NewInt64(table, "mall_item_id") + r.CoinNum = field.NewInt64(table, "coin_num") + r.Status = field.NewInt8(table, "status") + r.FailType = field.NewString(table, "fail_type") + r.FailMsg = field.NewString(table, "fail_msg") + r.RewardID = field.NewInt64(table, "reward_id") + r.CustomRewardVal = field.NewString(table, "custom_reward_val") + + r.fillFieldMap() + + return r +} + +func (r *redeemMallRecord) WithContext(ctx context.Context) *redeemMallRecordDo { + return r.redeemMallRecordDo.WithContext(ctx) +} + +func (r redeemMallRecord) TableName() string { return r.redeemMallRecordDo.TableName() } + +func (r redeemMallRecord) Alias() string { return r.redeemMallRecordDo.Alias() } + +func (r *redeemMallRecord) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *redeemMallRecord) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 11) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["mall_id"] = r.MallID + r.fieldMap["mall_item_id"] = r.MallItemID + r.fieldMap["coin_num"] = r.CoinNum + r.fieldMap["status"] = r.Status + r.fieldMap["fail_type"] = r.FailType + r.fieldMap["fail_msg"] = r.FailMsg + r.fieldMap["reward_id"] = r.RewardID + r.fieldMap["custom_reward_val"] = r.CustomRewardVal +} + +func (r redeemMallRecord) clone(db *gorm.DB) redeemMallRecord { + r.redeemMallRecordDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r redeemMallRecord) replaceDB(db *gorm.DB) redeemMallRecord { + r.redeemMallRecordDo.ReplaceDB(db) + return r +} + +type redeemMallRecordDo struct{ gen.DO } + +func (r redeemMallRecordDo) Debug() *redeemMallRecordDo { + return r.withDO(r.DO.Debug()) +} + +func (r redeemMallRecordDo) WithContext(ctx context.Context) *redeemMallRecordDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r redeemMallRecordDo) ReadDB() *redeemMallRecordDo { + return r.Clauses(dbresolver.Read) +} + +func (r redeemMallRecordDo) WriteDB() *redeemMallRecordDo { + return r.Clauses(dbresolver.Write) +} + +func (r redeemMallRecordDo) Session(config *gorm.Session) *redeemMallRecordDo { + return r.withDO(r.DO.Session(config)) +} + +func (r redeemMallRecordDo) Clauses(conds ...clause.Expression) *redeemMallRecordDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r redeemMallRecordDo) Returning(value interface{}, columns ...string) *redeemMallRecordDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r redeemMallRecordDo) Not(conds ...gen.Condition) *redeemMallRecordDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r redeemMallRecordDo) Or(conds ...gen.Condition) *redeemMallRecordDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r redeemMallRecordDo) Select(conds ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r redeemMallRecordDo) Where(conds ...gen.Condition) *redeemMallRecordDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r redeemMallRecordDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *redeemMallRecordDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r redeemMallRecordDo) Order(conds ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r redeemMallRecordDo) Distinct(cols ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r redeemMallRecordDo) Omit(cols ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r redeemMallRecordDo) Join(table schema.Tabler, on ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r redeemMallRecordDo) LeftJoin(table schema.Tabler, on ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r redeemMallRecordDo) RightJoin(table schema.Tabler, on ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r redeemMallRecordDo) Group(cols ...field.Expr) *redeemMallRecordDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r redeemMallRecordDo) Having(conds ...gen.Condition) *redeemMallRecordDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r redeemMallRecordDo) Limit(limit int) *redeemMallRecordDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r redeemMallRecordDo) Offset(offset int) *redeemMallRecordDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r redeemMallRecordDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *redeemMallRecordDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r redeemMallRecordDo) Unscoped() *redeemMallRecordDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r redeemMallRecordDo) Create(values ...*model.RedeemMallRecord) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r redeemMallRecordDo) CreateInBatches(values []*model.RedeemMallRecord, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r redeemMallRecordDo) Save(values ...*model.RedeemMallRecord) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r redeemMallRecordDo) First() (*model.RedeemMallRecord, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRecord), nil + } +} + +func (r redeemMallRecordDo) Take() (*model.RedeemMallRecord, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRecord), nil + } +} + +func (r redeemMallRecordDo) Last() (*model.RedeemMallRecord, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRecord), nil + } +} + +func (r redeemMallRecordDo) Find() ([]*model.RedeemMallRecord, error) { + result, err := r.DO.Find() + return result.([]*model.RedeemMallRecord), err +} + +func (r redeemMallRecordDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RedeemMallRecord, err error) { + buf := make([]*model.RedeemMallRecord, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r redeemMallRecordDo) FindInBatches(result *[]*model.RedeemMallRecord, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r redeemMallRecordDo) Attrs(attrs ...field.AssignExpr) *redeemMallRecordDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r redeemMallRecordDo) Assign(attrs ...field.AssignExpr) *redeemMallRecordDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r redeemMallRecordDo) Joins(fields ...field.RelationField) *redeemMallRecordDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r redeemMallRecordDo) Preload(fields ...field.RelationField) *redeemMallRecordDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r redeemMallRecordDo) FirstOrInit() (*model.RedeemMallRecord, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRecord), nil + } +} + +func (r redeemMallRecordDo) FirstOrCreate() (*model.RedeemMallRecord, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRecord), nil + } +} + +func (r redeemMallRecordDo) FindByPage(offset int, limit int) (result []*model.RedeemMallRecord, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r redeemMallRecordDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r redeemMallRecordDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r redeemMallRecordDo) Delete(models ...*model.RedeemMallRecord) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *redeemMallRecordDo) withDO(do gen.Dao) *redeemMallRecordDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/redeem_mall_relate.gen.go b/internal/repository/dao/redeem_mall_relate.gen.go new file mode 100644 index 0000000..5c82c1c --- /dev/null +++ b/internal/repository/dao/redeem_mall_relate.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRedeemMallRelate(db *gorm.DB, opts ...gen.DOOption) redeemMallRelate { + _redeemMallRelate := redeemMallRelate{} + + _redeemMallRelate.redeemMallRelateDo.UseDB(db, opts...) + _redeemMallRelate.redeemMallRelateDo.UseModel(&model.RedeemMallRelate{}) + + tableName := _redeemMallRelate.redeemMallRelateDo.TableName() + _redeemMallRelate.ALL = field.NewAsterisk(tableName) + _redeemMallRelate.ID = field.NewInt64(tableName, "id") + _redeemMallRelate.CreatedAt = field.NewInt64(tableName, "created_at") + _redeemMallRelate.UpdatedAt = field.NewInt64(tableName, "updated_at") + _redeemMallRelate.MallID = field.NewInt64(tableName, "mall_id") + _redeemMallRelate.Source = field.NewInt8(tableName, "source") + _redeemMallRelate.RelateID = field.NewInt64(tableName, "relate_id") + _redeemMallRelate.RelateTable = field.NewString(tableName, "relate_table") + _redeemMallRelate.CancelTime = field.NewInt64(tableName, "cancel_time") + + _redeemMallRelate.fillFieldMap() + + return _redeemMallRelate +} + +type redeemMallRelate struct { + redeemMallRelateDo redeemMallRelateDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + MallID field.Int64 // 商城id(redeem_mall表) + Source field.Int8 // 来源(1-任务中心,2-活动) + RelateID field.Int64 // 关联id + RelateTable field.String // 关联表名 + CancelTime field.Int64 // 取消关联时间 + + fieldMap map[string]field.Expr +} + +func (r redeemMallRelate) Table(newTableName string) *redeemMallRelate { + r.redeemMallRelateDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r redeemMallRelate) As(alias string) *redeemMallRelate { + r.redeemMallRelateDo.DO = *(r.redeemMallRelateDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *redeemMallRelate) updateTableName(table string) *redeemMallRelate { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.MallID = field.NewInt64(table, "mall_id") + r.Source = field.NewInt8(table, "source") + r.RelateID = field.NewInt64(table, "relate_id") + r.RelateTable = field.NewString(table, "relate_table") + r.CancelTime = field.NewInt64(table, "cancel_time") + + r.fillFieldMap() + + return r +} + +func (r *redeemMallRelate) WithContext(ctx context.Context) *redeemMallRelateDo { + return r.redeemMallRelateDo.WithContext(ctx) +} + +func (r redeemMallRelate) TableName() string { return r.redeemMallRelateDo.TableName() } + +func (r redeemMallRelate) Alias() string { return r.redeemMallRelateDo.Alias() } + +func (r *redeemMallRelate) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *redeemMallRelate) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 8) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["mall_id"] = r.MallID + r.fieldMap["source"] = r.Source + r.fieldMap["relate_id"] = r.RelateID + r.fieldMap["relate_table"] = r.RelateTable + r.fieldMap["cancel_time"] = r.CancelTime +} + +func (r redeemMallRelate) clone(db *gorm.DB) redeemMallRelate { + r.redeemMallRelateDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r redeemMallRelate) replaceDB(db *gorm.DB) redeemMallRelate { + r.redeemMallRelateDo.ReplaceDB(db) + return r +} + +type redeemMallRelateDo struct{ gen.DO } + +func (r redeemMallRelateDo) Debug() *redeemMallRelateDo { + return r.withDO(r.DO.Debug()) +} + +func (r redeemMallRelateDo) WithContext(ctx context.Context) *redeemMallRelateDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r redeemMallRelateDo) ReadDB() *redeemMallRelateDo { + return r.Clauses(dbresolver.Read) +} + +func (r redeemMallRelateDo) WriteDB() *redeemMallRelateDo { + return r.Clauses(dbresolver.Write) +} + +func (r redeemMallRelateDo) Session(config *gorm.Session) *redeemMallRelateDo { + return r.withDO(r.DO.Session(config)) +} + +func (r redeemMallRelateDo) Clauses(conds ...clause.Expression) *redeemMallRelateDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r redeemMallRelateDo) Returning(value interface{}, columns ...string) *redeemMallRelateDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r redeemMallRelateDo) Not(conds ...gen.Condition) *redeemMallRelateDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r redeemMallRelateDo) Or(conds ...gen.Condition) *redeemMallRelateDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r redeemMallRelateDo) Select(conds ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r redeemMallRelateDo) Where(conds ...gen.Condition) *redeemMallRelateDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r redeemMallRelateDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *redeemMallRelateDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r redeemMallRelateDo) Order(conds ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r redeemMallRelateDo) Distinct(cols ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r redeemMallRelateDo) Omit(cols ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r redeemMallRelateDo) Join(table schema.Tabler, on ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r redeemMallRelateDo) LeftJoin(table schema.Tabler, on ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r redeemMallRelateDo) RightJoin(table schema.Tabler, on ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r redeemMallRelateDo) Group(cols ...field.Expr) *redeemMallRelateDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r redeemMallRelateDo) Having(conds ...gen.Condition) *redeemMallRelateDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r redeemMallRelateDo) Limit(limit int) *redeemMallRelateDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r redeemMallRelateDo) Offset(offset int) *redeemMallRelateDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r redeemMallRelateDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *redeemMallRelateDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r redeemMallRelateDo) Unscoped() *redeemMallRelateDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r redeemMallRelateDo) Create(values ...*model.RedeemMallRelate) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r redeemMallRelateDo) CreateInBatches(values []*model.RedeemMallRelate, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r redeemMallRelateDo) Save(values ...*model.RedeemMallRelate) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r redeemMallRelateDo) First() (*model.RedeemMallRelate, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRelate), nil + } +} + +func (r redeemMallRelateDo) Take() (*model.RedeemMallRelate, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRelate), nil + } +} + +func (r redeemMallRelateDo) Last() (*model.RedeemMallRelate, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRelate), nil + } +} + +func (r redeemMallRelateDo) Find() ([]*model.RedeemMallRelate, error) { + result, err := r.DO.Find() + return result.([]*model.RedeemMallRelate), err +} + +func (r redeemMallRelateDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RedeemMallRelate, err error) { + buf := make([]*model.RedeemMallRelate, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r redeemMallRelateDo) FindInBatches(result *[]*model.RedeemMallRelate, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r redeemMallRelateDo) Attrs(attrs ...field.AssignExpr) *redeemMallRelateDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r redeemMallRelateDo) Assign(attrs ...field.AssignExpr) *redeemMallRelateDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r redeemMallRelateDo) Joins(fields ...field.RelationField) *redeemMallRelateDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r redeemMallRelateDo) Preload(fields ...field.RelationField) *redeemMallRelateDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r redeemMallRelateDo) FirstOrInit() (*model.RedeemMallRelate, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRelate), nil + } +} + +func (r redeemMallRelateDo) FirstOrCreate() (*model.RedeemMallRelate, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RedeemMallRelate), nil + } +} + +func (r redeemMallRelateDo) FindByPage(offset int, limit int) (result []*model.RedeemMallRelate, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r redeemMallRelateDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r redeemMallRelateDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r redeemMallRelateDo) Delete(models ...*model.RedeemMallRelate) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *redeemMallRelateDo) withDO(do gen.Dao) *redeemMallRelateDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/register.gen.go b/internal/repository/dao/register.gen.go new file mode 100644 index 0000000..9402515 --- /dev/null +++ b/internal/repository/dao/register.gen.go @@ -0,0 +1,373 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRegister(db *gorm.DB, opts ...gen.DOOption) register { + _register := register{} + + _register.registerDo.UseDB(db, opts...) + _register.registerDo.UseModel(&model.Register{}) + + tableName := _register.registerDo.TableName() + _register.ALL = field.NewAsterisk(tableName) + _register.ID = field.NewInt64(tableName, "id") + _register.CreatedAt = field.NewInt64(tableName, "created_at") + _register.UpdatedAt = field.NewInt64(tableName, "updated_at") + _register.IsDel = field.NewInt8(tableName, "is_del") + _register.HashID = field.NewString(tableName, "hash_id") + _register.Username = field.NewString(tableName, "username") + _register.Passwd = field.NewString(tableName, "passwd") + _register.AuditType = field.NewInt8(tableName, "audit_type") + _register.Email = field.NewString(tableName, "email") + _register.ShortName = field.NewString(tableName, "short_name") + _register.Phone = field.NewString(tableName, "phone") + _register.AppName = field.NewString(tableName, "app_name") + + _register.fillFieldMap() + + return _register +} + +type register struct { + registerDo registerDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 对外id + Username field.String // 注册账号(申请通过后超级管理员登陆的账号) + Passwd field.String // 申请通过后超级管理员登陆的密码 + AuditType field.Int8 // 审核状态(1-待审核,2-已通过,3-已拒绝) + Email field.String // 注册邮箱 + ShortName field.String // 申请通过后公司显示的简称 + Phone field.String // 申请通过后公司显示手机号 + AppName field.String // 申请通过后公司站点名称 + + fieldMap map[string]field.Expr +} + +func (r register) Table(newTableName string) *register { + r.registerDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r register) As(alias string) *register { + r.registerDo.DO = *(r.registerDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *register) updateTableName(table string) *register { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.IsDel = field.NewInt8(table, "is_del") + r.HashID = field.NewString(table, "hash_id") + r.Username = field.NewString(table, "username") + r.Passwd = field.NewString(table, "passwd") + r.AuditType = field.NewInt8(table, "audit_type") + r.Email = field.NewString(table, "email") + r.ShortName = field.NewString(table, "short_name") + r.Phone = field.NewString(table, "phone") + r.AppName = field.NewString(table, "app_name") + + r.fillFieldMap() + + return r +} + +func (r *register) WithContext(ctx context.Context) *registerDo { return r.registerDo.WithContext(ctx) } + +func (r register) TableName() string { return r.registerDo.TableName() } + +func (r register) Alias() string { return r.registerDo.Alias() } + +func (r *register) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *register) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 12) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["is_del"] = r.IsDel + r.fieldMap["hash_id"] = r.HashID + r.fieldMap["username"] = r.Username + r.fieldMap["passwd"] = r.Passwd + r.fieldMap["audit_type"] = r.AuditType + r.fieldMap["email"] = r.Email + r.fieldMap["short_name"] = r.ShortName + r.fieldMap["phone"] = r.Phone + r.fieldMap["app_name"] = r.AppName +} + +func (r register) clone(db *gorm.DB) register { + r.registerDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r register) replaceDB(db *gorm.DB) register { + r.registerDo.ReplaceDB(db) + return r +} + +type registerDo struct{ gen.DO } + +func (r registerDo) Debug() *registerDo { + return r.withDO(r.DO.Debug()) +} + +func (r registerDo) WithContext(ctx context.Context) *registerDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r registerDo) ReadDB() *registerDo { + return r.Clauses(dbresolver.Read) +} + +func (r registerDo) WriteDB() *registerDo { + return r.Clauses(dbresolver.Write) +} + +func (r registerDo) Session(config *gorm.Session) *registerDo { + return r.withDO(r.DO.Session(config)) +} + +func (r registerDo) Clauses(conds ...clause.Expression) *registerDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r registerDo) Returning(value interface{}, columns ...string) *registerDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r registerDo) Not(conds ...gen.Condition) *registerDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r registerDo) Or(conds ...gen.Condition) *registerDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r registerDo) Select(conds ...field.Expr) *registerDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r registerDo) Where(conds ...gen.Condition) *registerDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r registerDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *registerDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r registerDo) Order(conds ...field.Expr) *registerDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r registerDo) Distinct(cols ...field.Expr) *registerDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r registerDo) Omit(cols ...field.Expr) *registerDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r registerDo) Join(table schema.Tabler, on ...field.Expr) *registerDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r registerDo) LeftJoin(table schema.Tabler, on ...field.Expr) *registerDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r registerDo) RightJoin(table schema.Tabler, on ...field.Expr) *registerDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r registerDo) Group(cols ...field.Expr) *registerDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r registerDo) Having(conds ...gen.Condition) *registerDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r registerDo) Limit(limit int) *registerDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r registerDo) Offset(offset int) *registerDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r registerDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *registerDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r registerDo) Unscoped() *registerDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r registerDo) Create(values ...*model.Register) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r registerDo) CreateInBatches(values []*model.Register, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r registerDo) Save(values ...*model.Register) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r registerDo) First() (*model.Register, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Register), nil + } +} + +func (r registerDo) Take() (*model.Register, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Register), nil + } +} + +func (r registerDo) Last() (*model.Register, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Register), nil + } +} + +func (r registerDo) Find() ([]*model.Register, error) { + result, err := r.DO.Find() + return result.([]*model.Register), err +} + +func (r registerDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Register, err error) { + buf := make([]*model.Register, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r registerDo) FindInBatches(result *[]*model.Register, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r registerDo) Attrs(attrs ...field.AssignExpr) *registerDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r registerDo) Assign(attrs ...field.AssignExpr) *registerDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r registerDo) Joins(fields ...field.RelationField) *registerDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r registerDo) Preload(fields ...field.RelationField) *registerDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r registerDo) FirstOrInit() (*model.Register, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Register), nil + } +} + +func (r registerDo) FirstOrCreate() (*model.Register, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Register), nil + } +} + +func (r registerDo) FindByPage(offset int, limit int) (result []*model.Register, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r registerDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r registerDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r registerDo) Delete(models ...*model.Register) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *registerDo) withDO(do gen.Dao) *registerDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/register_audit.gen.go b/internal/repository/dao/register_audit.gen.go new file mode 100644 index 0000000..b9a006f --- /dev/null +++ b/internal/repository/dao/register_audit.gen.go @@ -0,0 +1,359 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRegisterAudit(db *gorm.DB, opts ...gen.DOOption) registerAudit { + _registerAudit := registerAudit{} + + _registerAudit.registerAuditDo.UseDB(db, opts...) + _registerAudit.registerAuditDo.UseModel(&model.RegisterAudit{}) + + tableName := _registerAudit.registerAuditDo.TableName() + _registerAudit.ALL = field.NewAsterisk(tableName) + _registerAudit.ID = field.NewInt64(tableName, "id") + _registerAudit.CreatedAt = field.NewInt64(tableName, "created_at") + _registerAudit.UpdatedAt = field.NewInt64(tableName, "updated_at") + _registerAudit.IsDel = field.NewInt8(tableName, "is_del") + _registerAudit.RegisterID = field.NewInt64(tableName, "register_id") + _registerAudit.Pass = field.NewInt8(tableName, "pass") + _registerAudit.Desc = field.NewString(tableName, "desc") + _registerAudit.OperatorID = field.NewInt64(tableName, "operator_id") + + _registerAudit.fillFieldMap() + + return _registerAudit +} + +type registerAudit struct { + registerAuditDo registerAuditDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + RegisterID field.Int64 // 注册记录id(register表主键) + Pass field.Int8 // 是否通过(1-是,0-否) + Desc field.String // 备注信息 + OperatorID field.Int64 // 审核人id + + fieldMap map[string]field.Expr +} + +func (r registerAudit) Table(newTableName string) *registerAudit { + r.registerAuditDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r registerAudit) As(alias string) *registerAudit { + r.registerAuditDo.DO = *(r.registerAuditDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *registerAudit) updateTableName(table string) *registerAudit { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.IsDel = field.NewInt8(table, "is_del") + r.RegisterID = field.NewInt64(table, "register_id") + r.Pass = field.NewInt8(table, "pass") + r.Desc = field.NewString(table, "desc") + r.OperatorID = field.NewInt64(table, "operator_id") + + r.fillFieldMap() + + return r +} + +func (r *registerAudit) WithContext(ctx context.Context) *registerAuditDo { + return r.registerAuditDo.WithContext(ctx) +} + +func (r registerAudit) TableName() string { return r.registerAuditDo.TableName() } + +func (r registerAudit) Alias() string { return r.registerAuditDo.Alias() } + +func (r *registerAudit) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *registerAudit) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 8) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["is_del"] = r.IsDel + r.fieldMap["register_id"] = r.RegisterID + r.fieldMap["pass"] = r.Pass + r.fieldMap["desc"] = r.Desc + r.fieldMap["operator_id"] = r.OperatorID +} + +func (r registerAudit) clone(db *gorm.DB) registerAudit { + r.registerAuditDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r registerAudit) replaceDB(db *gorm.DB) registerAudit { + r.registerAuditDo.ReplaceDB(db) + return r +} + +type registerAuditDo struct{ gen.DO } + +func (r registerAuditDo) Debug() *registerAuditDo { + return r.withDO(r.DO.Debug()) +} + +func (r registerAuditDo) WithContext(ctx context.Context) *registerAuditDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r registerAuditDo) ReadDB() *registerAuditDo { + return r.Clauses(dbresolver.Read) +} + +func (r registerAuditDo) WriteDB() *registerAuditDo { + return r.Clauses(dbresolver.Write) +} + +func (r registerAuditDo) Session(config *gorm.Session) *registerAuditDo { + return r.withDO(r.DO.Session(config)) +} + +func (r registerAuditDo) Clauses(conds ...clause.Expression) *registerAuditDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r registerAuditDo) Returning(value interface{}, columns ...string) *registerAuditDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r registerAuditDo) Not(conds ...gen.Condition) *registerAuditDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r registerAuditDo) Or(conds ...gen.Condition) *registerAuditDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r registerAuditDo) Select(conds ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r registerAuditDo) Where(conds ...gen.Condition) *registerAuditDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r registerAuditDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *registerAuditDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r registerAuditDo) Order(conds ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r registerAuditDo) Distinct(cols ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r registerAuditDo) Omit(cols ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r registerAuditDo) Join(table schema.Tabler, on ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r registerAuditDo) LeftJoin(table schema.Tabler, on ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r registerAuditDo) RightJoin(table schema.Tabler, on ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r registerAuditDo) Group(cols ...field.Expr) *registerAuditDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r registerAuditDo) Having(conds ...gen.Condition) *registerAuditDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r registerAuditDo) Limit(limit int) *registerAuditDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r registerAuditDo) Offset(offset int) *registerAuditDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r registerAuditDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *registerAuditDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r registerAuditDo) Unscoped() *registerAuditDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r registerAuditDo) Create(values ...*model.RegisterAudit) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r registerAuditDo) CreateInBatches(values []*model.RegisterAudit, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r registerAuditDo) Save(values ...*model.RegisterAudit) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r registerAuditDo) First() (*model.RegisterAudit, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RegisterAudit), nil + } +} + +func (r registerAuditDo) Take() (*model.RegisterAudit, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RegisterAudit), nil + } +} + +func (r registerAuditDo) Last() (*model.RegisterAudit, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RegisterAudit), nil + } +} + +func (r registerAuditDo) Find() ([]*model.RegisterAudit, error) { + result, err := r.DO.Find() + return result.([]*model.RegisterAudit), err +} + +func (r registerAuditDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RegisterAudit, err error) { + buf := make([]*model.RegisterAudit, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r registerAuditDo) FindInBatches(result *[]*model.RegisterAudit, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r registerAuditDo) Attrs(attrs ...field.AssignExpr) *registerAuditDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r registerAuditDo) Assign(attrs ...field.AssignExpr) *registerAuditDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r registerAuditDo) Joins(fields ...field.RelationField) *registerAuditDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r registerAuditDo) Preload(fields ...field.RelationField) *registerAuditDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r registerAuditDo) FirstOrInit() (*model.RegisterAudit, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RegisterAudit), nil + } +} + +func (r registerAuditDo) FirstOrCreate() (*model.RegisterAudit, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RegisterAudit), nil + } +} + +func (r registerAuditDo) FindByPage(offset int, limit int) (result []*model.RegisterAudit, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r registerAuditDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r registerAuditDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r registerAuditDo) Delete(models ...*model.RegisterAudit) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *registerAuditDo) withDO(do gen.Dao) *registerAuditDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/reward.gen.go b/internal/repository/dao/reward.gen.go new file mode 100644 index 0000000..8fd8fce --- /dev/null +++ b/internal/repository/dao/reward.gen.go @@ -0,0 +1,389 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newReward(db *gorm.DB, opts ...gen.DOOption) reward { + _reward := reward{} + + _reward.rewardDo.UseDB(db, opts...) + _reward.rewardDo.UseModel(&model.Reward{}) + + tableName := _reward.rewardDo.TableName() + _reward.ALL = field.NewAsterisk(tableName) + _reward.ID = field.NewInt64(tableName, "id") + _reward.CreatedAt = field.NewInt64(tableName, "created_at") + _reward.UpdatedAt = field.NewInt64(tableName, "updated_at") + _reward.IsDel = field.NewInt8(tableName, "is_del") + _reward.ProjectID = field.NewInt64(tableName, "project_id") + _reward.ReceiveType = field.NewInt8(tableName, "receive_type") + _reward.KvData = field.NewString(tableName, "kv_data") + _reward.KvMark = field.NewString(tableName, "kv_mark") + _reward.URLID = field.NewInt64(tableName, "url_id") + _reward.FormID = field.NewInt64(tableName, "form_id") + _reward.Contact = field.NewString(tableName, "contact") + _reward.RewardTitle = field.NewString(tableName, "reward_title") + _reward.TitleDefault = field.NewInt8(tableName, "title_default") + _reward.OldData = field.NewInt8(tableName, "old_data") + _reward.DyRewardType = field.NewInt8(tableName, "dy_reward_type") + _reward.Source = field.NewInt8(tableName, "source") + + _reward.fillFieldMap() + + return _reward +} + +type reward struct { + rewardDo rewardDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 + ProjectID field.Int64 // 项目id(project表) + ReceiveType field.Int8 // 发放类型(1-系统发放,2-联系客服,3-客户端发放,4-表单) + KvData field.String // 回调的键值数据 + KvMark field.String // 键值标识 + URLID field.Int64 // 回调地址id + FormID field.Int64 // 表单ID + Contact field.String // 联系方式 + RewardTitle field.String // 奖品标题,用户后台功能统一展示 + TitleDefault field.Int8 // 奖品标题是否使用的是默认语言的奖品名称(0-否,1-是) + OldData field.Int8 // 同步的旧数据 + DyRewardType field.Int8 // 动态奖品内容类型(0-无,1-兑换码) + Source field.Int8 // 数据来源(0-后台创建,1-奖品数据迁移,2-api创建) + + fieldMap map[string]field.Expr +} + +func (r reward) Table(newTableName string) *reward { + r.rewardDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r reward) As(alias string) *reward { + r.rewardDo.DO = *(r.rewardDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *reward) updateTableName(table string) *reward { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.IsDel = field.NewInt8(table, "is_del") + r.ProjectID = field.NewInt64(table, "project_id") + r.ReceiveType = field.NewInt8(table, "receive_type") + r.KvData = field.NewString(table, "kv_data") + r.KvMark = field.NewString(table, "kv_mark") + r.URLID = field.NewInt64(table, "url_id") + r.FormID = field.NewInt64(table, "form_id") + r.Contact = field.NewString(table, "contact") + r.RewardTitle = field.NewString(table, "reward_title") + r.TitleDefault = field.NewInt8(table, "title_default") + r.OldData = field.NewInt8(table, "old_data") + r.DyRewardType = field.NewInt8(table, "dy_reward_type") + r.Source = field.NewInt8(table, "source") + + r.fillFieldMap() + + return r +} + +func (r *reward) WithContext(ctx context.Context) *rewardDo { return r.rewardDo.WithContext(ctx) } + +func (r reward) TableName() string { return r.rewardDo.TableName() } + +func (r reward) Alias() string { return r.rewardDo.Alias() } + +func (r *reward) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *reward) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 16) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["is_del"] = r.IsDel + r.fieldMap["project_id"] = r.ProjectID + r.fieldMap["receive_type"] = r.ReceiveType + r.fieldMap["kv_data"] = r.KvData + r.fieldMap["kv_mark"] = r.KvMark + r.fieldMap["url_id"] = r.URLID + r.fieldMap["form_id"] = r.FormID + r.fieldMap["contact"] = r.Contact + r.fieldMap["reward_title"] = r.RewardTitle + r.fieldMap["title_default"] = r.TitleDefault + r.fieldMap["old_data"] = r.OldData + r.fieldMap["dy_reward_type"] = r.DyRewardType + r.fieldMap["source"] = r.Source +} + +func (r reward) clone(db *gorm.DB) reward { + r.rewardDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r reward) replaceDB(db *gorm.DB) reward { + r.rewardDo.ReplaceDB(db) + return r +} + +type rewardDo struct{ gen.DO } + +func (r rewardDo) Debug() *rewardDo { + return r.withDO(r.DO.Debug()) +} + +func (r rewardDo) WithContext(ctx context.Context) *rewardDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r rewardDo) ReadDB() *rewardDo { + return r.Clauses(dbresolver.Read) +} + +func (r rewardDo) WriteDB() *rewardDo { + return r.Clauses(dbresolver.Write) +} + +func (r rewardDo) Session(config *gorm.Session) *rewardDo { + return r.withDO(r.DO.Session(config)) +} + +func (r rewardDo) Clauses(conds ...clause.Expression) *rewardDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r rewardDo) Returning(value interface{}, columns ...string) *rewardDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r rewardDo) Not(conds ...gen.Condition) *rewardDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r rewardDo) Or(conds ...gen.Condition) *rewardDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r rewardDo) Select(conds ...field.Expr) *rewardDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r rewardDo) Where(conds ...gen.Condition) *rewardDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r rewardDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *rewardDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r rewardDo) Order(conds ...field.Expr) *rewardDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r rewardDo) Distinct(cols ...field.Expr) *rewardDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r rewardDo) Omit(cols ...field.Expr) *rewardDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r rewardDo) Join(table schema.Tabler, on ...field.Expr) *rewardDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r rewardDo) LeftJoin(table schema.Tabler, on ...field.Expr) *rewardDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r rewardDo) RightJoin(table schema.Tabler, on ...field.Expr) *rewardDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r rewardDo) Group(cols ...field.Expr) *rewardDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r rewardDo) Having(conds ...gen.Condition) *rewardDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r rewardDo) Limit(limit int) *rewardDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r rewardDo) Offset(offset int) *rewardDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r rewardDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *rewardDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r rewardDo) Unscoped() *rewardDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r rewardDo) Create(values ...*model.Reward) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r rewardDo) CreateInBatches(values []*model.Reward, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r rewardDo) Save(values ...*model.Reward) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r rewardDo) First() (*model.Reward, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.Reward), nil + } +} + +func (r rewardDo) Take() (*model.Reward, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.Reward), nil + } +} + +func (r rewardDo) Last() (*model.Reward, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.Reward), nil + } +} + +func (r rewardDo) Find() ([]*model.Reward, error) { + result, err := r.DO.Find() + return result.([]*model.Reward), err +} + +func (r rewardDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.Reward, err error) { + buf := make([]*model.Reward, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r rewardDo) FindInBatches(result *[]*model.Reward, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r rewardDo) Attrs(attrs ...field.AssignExpr) *rewardDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r rewardDo) Assign(attrs ...field.AssignExpr) *rewardDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r rewardDo) Joins(fields ...field.RelationField) *rewardDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r rewardDo) Preload(fields ...field.RelationField) *rewardDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r rewardDo) FirstOrInit() (*model.Reward, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.Reward), nil + } +} + +func (r rewardDo) FirstOrCreate() (*model.Reward, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.Reward), nil + } +} + +func (r rewardDo) FindByPage(offset int, limit int) (result []*model.Reward, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r rewardDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r rewardDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r rewardDo) Delete(models ...*model.Reward) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *rewardDo) withDO(do gen.Dao) *rewardDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/reward_lang.gen.go b/internal/repository/dao/reward_lang.gen.go new file mode 100644 index 0000000..b00ce17 --- /dev/null +++ b/internal/repository/dao/reward_lang.gen.go @@ -0,0 +1,387 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRewardLang(db *gorm.DB, opts ...gen.DOOption) rewardLang { + _rewardLang := rewardLang{} + + _rewardLang.rewardLangDo.UseDB(db, opts...) + _rewardLang.rewardLangDo.UseModel(&model.RewardLang{}) + + tableName := _rewardLang.rewardLangDo.TableName() + _rewardLang.ALL = field.NewAsterisk(tableName) + _rewardLang.ID = field.NewInt64(tableName, "id") + _rewardLang.CreatedAt = field.NewInt64(tableName, "created_at") + _rewardLang.UpdatedAt = field.NewInt64(tableName, "updated_at") + _rewardLang.IsDel = field.NewInt64(tableName, "is_del") + _rewardLang.ProjectID = field.NewInt64(tableName, "project_id") + _rewardLang.RewardID = field.NewInt64(tableName, "reward_id") + _rewardLang.Mark = field.NewString(tableName, "mark") + _rewardLang.Title = field.NewString(tableName, "title") + _rewardLang.ImgURL = field.NewString(tableName, "img_url") + _rewardLang.IsDefault = field.NewInt8(tableName, "is_default") + _rewardLang.OpenToUse = field.NewInt8(tableName, "open_to_use") + _rewardLang.WebURL = field.NewString(tableName, "web_url") + _rewardLang.AppParam = field.NewString(tableName, "app_param") + _rewardLang.ImageID = field.NewInt64(tableName, "image_id") + _rewardLang.PcParam = field.NewString(tableName, "pc_param") + + _rewardLang.fillFieldMap() + + return _rewardLang +} + +type rewardLang struct { + rewardLangDo rewardLangDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int64 + ProjectID field.Int64 // 项目id(project表) + RewardID field.Int64 // 奖品id(reward表) + Mark field.String // 语种标识 + Title field.String // 奖品名称 + ImgURL field.String // 奖品图片 + IsDefault field.Int8 // 是否默认语言(0-否,1-是) + OpenToUse field.Int8 // 开启去使用(0-否,1-是) + WebURL field.String // Web端的跳转地址 + AppParam field.String // App端的跳转参数 + ImageID field.Int64 // 图片素材id + PcParam field.String // pc端的跳转参数 + + fieldMap map[string]field.Expr +} + +func (r rewardLang) Table(newTableName string) *rewardLang { + r.rewardLangDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r rewardLang) As(alias string) *rewardLang { + r.rewardLangDo.DO = *(r.rewardLangDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *rewardLang) updateTableName(table string) *rewardLang { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.IsDel = field.NewInt64(table, "is_del") + r.ProjectID = field.NewInt64(table, "project_id") + r.RewardID = field.NewInt64(table, "reward_id") + r.Mark = field.NewString(table, "mark") + r.Title = field.NewString(table, "title") + r.ImgURL = field.NewString(table, "img_url") + r.IsDefault = field.NewInt8(table, "is_default") + r.OpenToUse = field.NewInt8(table, "open_to_use") + r.WebURL = field.NewString(table, "web_url") + r.AppParam = field.NewString(table, "app_param") + r.ImageID = field.NewInt64(table, "image_id") + r.PcParam = field.NewString(table, "pc_param") + + r.fillFieldMap() + + return r +} + +func (r *rewardLang) WithContext(ctx context.Context) *rewardLangDo { + return r.rewardLangDo.WithContext(ctx) +} + +func (r rewardLang) TableName() string { return r.rewardLangDo.TableName() } + +func (r rewardLang) Alias() string { return r.rewardLangDo.Alias() } + +func (r *rewardLang) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *rewardLang) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 15) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["is_del"] = r.IsDel + r.fieldMap["project_id"] = r.ProjectID + r.fieldMap["reward_id"] = r.RewardID + r.fieldMap["mark"] = r.Mark + r.fieldMap["title"] = r.Title + r.fieldMap["img_url"] = r.ImgURL + r.fieldMap["is_default"] = r.IsDefault + r.fieldMap["open_to_use"] = r.OpenToUse + r.fieldMap["web_url"] = r.WebURL + r.fieldMap["app_param"] = r.AppParam + r.fieldMap["image_id"] = r.ImageID + r.fieldMap["pc_param"] = r.PcParam +} + +func (r rewardLang) clone(db *gorm.DB) rewardLang { + r.rewardLangDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r rewardLang) replaceDB(db *gorm.DB) rewardLang { + r.rewardLangDo.ReplaceDB(db) + return r +} + +type rewardLangDo struct{ gen.DO } + +func (r rewardLangDo) Debug() *rewardLangDo { + return r.withDO(r.DO.Debug()) +} + +func (r rewardLangDo) WithContext(ctx context.Context) *rewardLangDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r rewardLangDo) ReadDB() *rewardLangDo { + return r.Clauses(dbresolver.Read) +} + +func (r rewardLangDo) WriteDB() *rewardLangDo { + return r.Clauses(dbresolver.Write) +} + +func (r rewardLangDo) Session(config *gorm.Session) *rewardLangDo { + return r.withDO(r.DO.Session(config)) +} + +func (r rewardLangDo) Clauses(conds ...clause.Expression) *rewardLangDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r rewardLangDo) Returning(value interface{}, columns ...string) *rewardLangDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r rewardLangDo) Not(conds ...gen.Condition) *rewardLangDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r rewardLangDo) Or(conds ...gen.Condition) *rewardLangDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r rewardLangDo) Select(conds ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r rewardLangDo) Where(conds ...gen.Condition) *rewardLangDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r rewardLangDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *rewardLangDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r rewardLangDo) Order(conds ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r rewardLangDo) Distinct(cols ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r rewardLangDo) Omit(cols ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r rewardLangDo) Join(table schema.Tabler, on ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r rewardLangDo) LeftJoin(table schema.Tabler, on ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r rewardLangDo) RightJoin(table schema.Tabler, on ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r rewardLangDo) Group(cols ...field.Expr) *rewardLangDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r rewardLangDo) Having(conds ...gen.Condition) *rewardLangDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r rewardLangDo) Limit(limit int) *rewardLangDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r rewardLangDo) Offset(offset int) *rewardLangDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r rewardLangDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *rewardLangDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r rewardLangDo) Unscoped() *rewardLangDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r rewardLangDo) Create(values ...*model.RewardLang) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r rewardLangDo) CreateInBatches(values []*model.RewardLang, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r rewardLangDo) Save(values ...*model.RewardLang) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r rewardLangDo) First() (*model.RewardLang, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RewardLang), nil + } +} + +func (r rewardLangDo) Take() (*model.RewardLang, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RewardLang), nil + } +} + +func (r rewardLangDo) Last() (*model.RewardLang, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RewardLang), nil + } +} + +func (r rewardLangDo) Find() ([]*model.RewardLang, error) { + result, err := r.DO.Find() + return result.([]*model.RewardLang), err +} + +func (r rewardLangDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RewardLang, err error) { + buf := make([]*model.RewardLang, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r rewardLangDo) FindInBatches(result *[]*model.RewardLang, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r rewardLangDo) Attrs(attrs ...field.AssignExpr) *rewardLangDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r rewardLangDo) Assign(attrs ...field.AssignExpr) *rewardLangDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r rewardLangDo) Joins(fields ...field.RelationField) *rewardLangDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r rewardLangDo) Preload(fields ...field.RelationField) *rewardLangDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r rewardLangDo) FirstOrInit() (*model.RewardLang, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RewardLang), nil + } +} + +func (r rewardLangDo) FirstOrCreate() (*model.RewardLang, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RewardLang), nil + } +} + +func (r rewardLangDo) FindByPage(offset int, limit int) (result []*model.RewardLang, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r rewardLangDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r rewardLangDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r rewardLangDo) Delete(models ...*model.RewardLang) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *rewardLangDo) withDO(do gen.Dao) *rewardLangDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/reward_push.gen.go b/internal/repository/dao/reward_push.gen.go new file mode 100644 index 0000000..028189f --- /dev/null +++ b/internal/repository/dao/reward_push.gen.go @@ -0,0 +1,391 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRewardPush(db *gorm.DB, opts ...gen.DOOption) rewardPush { + _rewardPush := rewardPush{} + + _rewardPush.rewardPushDo.UseDB(db, opts...) + _rewardPush.rewardPushDo.UseModel(&model.RewardPush{}) + + tableName := _rewardPush.rewardPushDo.TableName() + _rewardPush.ALL = field.NewAsterisk(tableName) + _rewardPush.ID = field.NewString(tableName, "id") + _rewardPush.CreatedAt = field.NewInt64(tableName, "created_at") + _rewardPush.UpdatedAt = field.NewInt64(tableName, "updated_at") + _rewardPush.Source = field.NewString(tableName, "source") + _rewardPush.FirstID = field.NewInt64(tableName, "first_id") + _rewardPush.SecondID = field.NewInt64(tableName, "second_id") + _rewardPush.RelateID = field.NewInt64(tableName, "relate_id") + _rewardPush.RewardID = field.NewInt64(tableName, "reward_id") + _rewardPush.UserID = field.NewString(tableName, "user_id") + _rewardPush.Param = field.NewString(tableName, "param") + _rewardPush.Sync = field.NewInt8(tableName, "sync") + _rewardPush.Status = field.NewInt8(tableName, "status") + _rewardPush.FailType = field.NewString(tableName, "fail_type") + _rewardPush.FailMsg = field.NewString(tableName, "fail_msg") + _rewardPush.PushNum = field.NewInt32(tableName, "push_num") + _rewardPush.RespData = field.NewString(tableName, "resp_data") + + _rewardPush.fillFieldMap() + + return _rewardPush +} + +type rewardPush struct { + rewardPushDo rewardPushDo + + ALL field.Asterisk + ID field.String + CreatedAt field.Int64 + UpdatedAt field.Int64 + Source field.String // 来源标识 + FirstID field.Int64 // 来源一级id + SecondID field.Int64 // 来源二级id + RelateID field.Int64 // 关联记录id + RewardID field.Int64 // 奖品id(reward表) + UserID field.String // 第三方应用用户ID + Param field.String // 推送参数 + Sync field.Int8 // 是否同步请求(0-否,1-是) + Status field.Int8 // 状态(1-推送中,2-完成,3-失败) + FailType field.String // 失败原因标识 + FailMsg field.String // 具体失败原因 + PushNum field.Int32 // 推送次数 + RespData field.String // 成功后返回的数据 + + fieldMap map[string]field.Expr +} + +func (r rewardPush) Table(newTableName string) *rewardPush { + r.rewardPushDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r rewardPush) As(alias string) *rewardPush { + r.rewardPushDo.DO = *(r.rewardPushDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *rewardPush) updateTableName(table string) *rewardPush { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewString(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.Source = field.NewString(table, "source") + r.FirstID = field.NewInt64(table, "first_id") + r.SecondID = field.NewInt64(table, "second_id") + r.RelateID = field.NewInt64(table, "relate_id") + r.RewardID = field.NewInt64(table, "reward_id") + r.UserID = field.NewString(table, "user_id") + r.Param = field.NewString(table, "param") + r.Sync = field.NewInt8(table, "sync") + r.Status = field.NewInt8(table, "status") + r.FailType = field.NewString(table, "fail_type") + r.FailMsg = field.NewString(table, "fail_msg") + r.PushNum = field.NewInt32(table, "push_num") + r.RespData = field.NewString(table, "resp_data") + + r.fillFieldMap() + + return r +} + +func (r *rewardPush) WithContext(ctx context.Context) *rewardPushDo { + return r.rewardPushDo.WithContext(ctx) +} + +func (r rewardPush) TableName() string { return r.rewardPushDo.TableName() } + +func (r rewardPush) Alias() string { return r.rewardPushDo.Alias() } + +func (r *rewardPush) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *rewardPush) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 16) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["source"] = r.Source + r.fieldMap["first_id"] = r.FirstID + r.fieldMap["second_id"] = r.SecondID + r.fieldMap["relate_id"] = r.RelateID + r.fieldMap["reward_id"] = r.RewardID + r.fieldMap["user_id"] = r.UserID + r.fieldMap["param"] = r.Param + r.fieldMap["sync"] = r.Sync + r.fieldMap["status"] = r.Status + r.fieldMap["fail_type"] = r.FailType + r.fieldMap["fail_msg"] = r.FailMsg + r.fieldMap["push_num"] = r.PushNum + r.fieldMap["resp_data"] = r.RespData +} + +func (r rewardPush) clone(db *gorm.DB) rewardPush { + r.rewardPushDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r rewardPush) replaceDB(db *gorm.DB) rewardPush { + r.rewardPushDo.ReplaceDB(db) + return r +} + +type rewardPushDo struct{ gen.DO } + +func (r rewardPushDo) Debug() *rewardPushDo { + return r.withDO(r.DO.Debug()) +} + +func (r rewardPushDo) WithContext(ctx context.Context) *rewardPushDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r rewardPushDo) ReadDB() *rewardPushDo { + return r.Clauses(dbresolver.Read) +} + +func (r rewardPushDo) WriteDB() *rewardPushDo { + return r.Clauses(dbresolver.Write) +} + +func (r rewardPushDo) Session(config *gorm.Session) *rewardPushDo { + return r.withDO(r.DO.Session(config)) +} + +func (r rewardPushDo) Clauses(conds ...clause.Expression) *rewardPushDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r rewardPushDo) Returning(value interface{}, columns ...string) *rewardPushDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r rewardPushDo) Not(conds ...gen.Condition) *rewardPushDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r rewardPushDo) Or(conds ...gen.Condition) *rewardPushDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r rewardPushDo) Select(conds ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r rewardPushDo) Where(conds ...gen.Condition) *rewardPushDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r rewardPushDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *rewardPushDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r rewardPushDo) Order(conds ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r rewardPushDo) Distinct(cols ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r rewardPushDo) Omit(cols ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r rewardPushDo) Join(table schema.Tabler, on ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r rewardPushDo) LeftJoin(table schema.Tabler, on ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r rewardPushDo) RightJoin(table schema.Tabler, on ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r rewardPushDo) Group(cols ...field.Expr) *rewardPushDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r rewardPushDo) Having(conds ...gen.Condition) *rewardPushDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r rewardPushDo) Limit(limit int) *rewardPushDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r rewardPushDo) Offset(offset int) *rewardPushDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r rewardPushDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *rewardPushDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r rewardPushDo) Unscoped() *rewardPushDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r rewardPushDo) Create(values ...*model.RewardPush) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r rewardPushDo) CreateInBatches(values []*model.RewardPush, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r rewardPushDo) Save(values ...*model.RewardPush) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r rewardPushDo) First() (*model.RewardPush, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RewardPush), nil + } +} + +func (r rewardPushDo) Take() (*model.RewardPush, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RewardPush), nil + } +} + +func (r rewardPushDo) Last() (*model.RewardPush, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RewardPush), nil + } +} + +func (r rewardPushDo) Find() ([]*model.RewardPush, error) { + result, err := r.DO.Find() + return result.([]*model.RewardPush), err +} + +func (r rewardPushDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RewardPush, err error) { + buf := make([]*model.RewardPush, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r rewardPushDo) FindInBatches(result *[]*model.RewardPush, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r rewardPushDo) Attrs(attrs ...field.AssignExpr) *rewardPushDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r rewardPushDo) Assign(attrs ...field.AssignExpr) *rewardPushDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r rewardPushDo) Joins(fields ...field.RelationField) *rewardPushDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r rewardPushDo) Preload(fields ...field.RelationField) *rewardPushDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r rewardPushDo) FirstOrInit() (*model.RewardPush, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RewardPush), nil + } +} + +func (r rewardPushDo) FirstOrCreate() (*model.RewardPush, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RewardPush), nil + } +} + +func (r rewardPushDo) FindByPage(offset int, limit int) (result []*model.RewardPush, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r rewardPushDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r rewardPushDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r rewardPushDo) Delete(models ...*model.RewardPush) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *rewardPushDo) withDO(do gen.Dao) *rewardPushDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/reward_push_log.gen.go b/internal/repository/dao/reward_push_log.gen.go new file mode 100644 index 0000000..9a8dcf4 --- /dev/null +++ b/internal/repository/dao/reward_push_log.gen.go @@ -0,0 +1,375 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRewardPushLog(db *gorm.DB, opts ...gen.DOOption) rewardPushLog { + _rewardPushLog := rewardPushLog{} + + _rewardPushLog.rewardPushLogDo.UseDB(db, opts...) + _rewardPushLog.rewardPushLogDo.UseModel(&model.RewardPushLog{}) + + tableName := _rewardPushLog.rewardPushLogDo.TableName() + _rewardPushLog.ALL = field.NewAsterisk(tableName) + _rewardPushLog.ID = field.NewInt64(tableName, "id") + _rewardPushLog.CreatedAt = field.NewInt64(tableName, "created_at") + _rewardPushLog.UpdatedAt = field.NewInt64(tableName, "updated_at") + _rewardPushLog.PushID = field.NewString(tableName, "push_id") + _rewardPushLog.ReqURL = field.NewString(tableName, "req_url") + _rewardPushLog.Req = field.NewString(tableName, "req") + _rewardPushLog.Resp = field.NewString(tableName, "resp") + _rewardPushLog.RespCode = field.NewInt32(tableName, "resp_code") + _rewardPushLog.ReqTime = field.NewInt64(tableName, "req_time") + _rewardPushLog.ErrMsg = field.NewString(tableName, "err_msg") + _rewardPushLog.Token = field.NewString(tableName, "token") + _rewardPushLog.ReqHeader = field.NewString(tableName, "req_header") + + _rewardPushLog.fillFieldMap() + + return _rewardPushLog +} + +type rewardPushLog struct { + rewardPushLogDo rewardPushLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + PushID field.String // 推送id(reward_push表) + ReqURL field.String // 请求地址 + Req field.String // 请求数据 + Resp field.String // 返回数据 + RespCode field.Int32 // 返回状态码 + ReqTime field.Int64 // 请求时长(单位:ms) + ErrMsg field.String // 错误信息 + Token field.String // 请求token + ReqHeader field.String // 请求头数据 + + fieldMap map[string]field.Expr +} + +func (r rewardPushLog) Table(newTableName string) *rewardPushLog { + r.rewardPushLogDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r rewardPushLog) As(alias string) *rewardPushLog { + r.rewardPushLogDo.DO = *(r.rewardPushLogDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *rewardPushLog) updateTableName(table string) *rewardPushLog { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.PushID = field.NewString(table, "push_id") + r.ReqURL = field.NewString(table, "req_url") + r.Req = field.NewString(table, "req") + r.Resp = field.NewString(table, "resp") + r.RespCode = field.NewInt32(table, "resp_code") + r.ReqTime = field.NewInt64(table, "req_time") + r.ErrMsg = field.NewString(table, "err_msg") + r.Token = field.NewString(table, "token") + r.ReqHeader = field.NewString(table, "req_header") + + r.fillFieldMap() + + return r +} + +func (r *rewardPushLog) WithContext(ctx context.Context) *rewardPushLogDo { + return r.rewardPushLogDo.WithContext(ctx) +} + +func (r rewardPushLog) TableName() string { return r.rewardPushLogDo.TableName() } + +func (r rewardPushLog) Alias() string { return r.rewardPushLogDo.Alias() } + +func (r *rewardPushLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *rewardPushLog) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 12) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["push_id"] = r.PushID + r.fieldMap["req_url"] = r.ReqURL + r.fieldMap["req"] = r.Req + r.fieldMap["resp"] = r.Resp + r.fieldMap["resp_code"] = r.RespCode + r.fieldMap["req_time"] = r.ReqTime + r.fieldMap["err_msg"] = r.ErrMsg + r.fieldMap["token"] = r.Token + r.fieldMap["req_header"] = r.ReqHeader +} + +func (r rewardPushLog) clone(db *gorm.DB) rewardPushLog { + r.rewardPushLogDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r rewardPushLog) replaceDB(db *gorm.DB) rewardPushLog { + r.rewardPushLogDo.ReplaceDB(db) + return r +} + +type rewardPushLogDo struct{ gen.DO } + +func (r rewardPushLogDo) Debug() *rewardPushLogDo { + return r.withDO(r.DO.Debug()) +} + +func (r rewardPushLogDo) WithContext(ctx context.Context) *rewardPushLogDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r rewardPushLogDo) ReadDB() *rewardPushLogDo { + return r.Clauses(dbresolver.Read) +} + +func (r rewardPushLogDo) WriteDB() *rewardPushLogDo { + return r.Clauses(dbresolver.Write) +} + +func (r rewardPushLogDo) Session(config *gorm.Session) *rewardPushLogDo { + return r.withDO(r.DO.Session(config)) +} + +func (r rewardPushLogDo) Clauses(conds ...clause.Expression) *rewardPushLogDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r rewardPushLogDo) Returning(value interface{}, columns ...string) *rewardPushLogDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r rewardPushLogDo) Not(conds ...gen.Condition) *rewardPushLogDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r rewardPushLogDo) Or(conds ...gen.Condition) *rewardPushLogDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r rewardPushLogDo) Select(conds ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r rewardPushLogDo) Where(conds ...gen.Condition) *rewardPushLogDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r rewardPushLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *rewardPushLogDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r rewardPushLogDo) Order(conds ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r rewardPushLogDo) Distinct(cols ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r rewardPushLogDo) Omit(cols ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r rewardPushLogDo) Join(table schema.Tabler, on ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r rewardPushLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r rewardPushLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r rewardPushLogDo) Group(cols ...field.Expr) *rewardPushLogDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r rewardPushLogDo) Having(conds ...gen.Condition) *rewardPushLogDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r rewardPushLogDo) Limit(limit int) *rewardPushLogDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r rewardPushLogDo) Offset(offset int) *rewardPushLogDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r rewardPushLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *rewardPushLogDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r rewardPushLogDo) Unscoped() *rewardPushLogDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r rewardPushLogDo) Create(values ...*model.RewardPushLog) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r rewardPushLogDo) CreateInBatches(values []*model.RewardPushLog, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r rewardPushLogDo) Save(values ...*model.RewardPushLog) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r rewardPushLogDo) First() (*model.RewardPushLog, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushLog), nil + } +} + +func (r rewardPushLogDo) Take() (*model.RewardPushLog, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushLog), nil + } +} + +func (r rewardPushLogDo) Last() (*model.RewardPushLog, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushLog), nil + } +} + +func (r rewardPushLogDo) Find() ([]*model.RewardPushLog, error) { + result, err := r.DO.Find() + return result.([]*model.RewardPushLog), err +} + +func (r rewardPushLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RewardPushLog, err error) { + buf := make([]*model.RewardPushLog, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r rewardPushLogDo) FindInBatches(result *[]*model.RewardPushLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r rewardPushLogDo) Attrs(attrs ...field.AssignExpr) *rewardPushLogDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r rewardPushLogDo) Assign(attrs ...field.AssignExpr) *rewardPushLogDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r rewardPushLogDo) Joins(fields ...field.RelationField) *rewardPushLogDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r rewardPushLogDo) Preload(fields ...field.RelationField) *rewardPushLogDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r rewardPushLogDo) FirstOrInit() (*model.RewardPushLog, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushLog), nil + } +} + +func (r rewardPushLogDo) FirstOrCreate() (*model.RewardPushLog, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushLog), nil + } +} + +func (r rewardPushLogDo) FindByPage(offset int, limit int) (result []*model.RewardPushLog, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r rewardPushLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r rewardPushLogDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r rewardPushLogDo) Delete(models ...*model.RewardPushLog) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *rewardPushLogDo) withDO(do gen.Dao) *rewardPushLogDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/reward_push_task.gen.go b/internal/repository/dao/reward_push_task.gen.go new file mode 100644 index 0000000..0136fed --- /dev/null +++ b/internal/repository/dao/reward_push_task.gen.go @@ -0,0 +1,343 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRewardPushTask(db *gorm.DB, opts ...gen.DOOption) rewardPushTask { + _rewardPushTask := rewardPushTask{} + + _rewardPushTask.rewardPushTaskDo.UseDB(db, opts...) + _rewardPushTask.rewardPushTaskDo.UseModel(&model.RewardPushTask{}) + + tableName := _rewardPushTask.rewardPushTaskDo.TableName() + _rewardPushTask.ALL = field.NewAsterisk(tableName) + _rewardPushTask.ID = field.NewInt64(tableName, "id") + _rewardPushTask.CreatedAt = field.NewInt64(tableName, "created_at") + _rewardPushTask.DoTime = field.NewInt64(tableName, "do_time") + _rewardPushTask.PushID = field.NewString(tableName, "push_id") + + _rewardPushTask.fillFieldMap() + + return _rewardPushTask +} + +type rewardPushTask struct { + rewardPushTaskDo rewardPushTaskDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + DoTime field.Int64 // 执行时间 + PushID field.String // 推送id(reward_push表) + + fieldMap map[string]field.Expr +} + +func (r rewardPushTask) Table(newTableName string) *rewardPushTask { + r.rewardPushTaskDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r rewardPushTask) As(alias string) *rewardPushTask { + r.rewardPushTaskDo.DO = *(r.rewardPushTaskDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *rewardPushTask) updateTableName(table string) *rewardPushTask { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.DoTime = field.NewInt64(table, "do_time") + r.PushID = field.NewString(table, "push_id") + + r.fillFieldMap() + + return r +} + +func (r *rewardPushTask) WithContext(ctx context.Context) *rewardPushTaskDo { + return r.rewardPushTaskDo.WithContext(ctx) +} + +func (r rewardPushTask) TableName() string { return r.rewardPushTaskDo.TableName() } + +func (r rewardPushTask) Alias() string { return r.rewardPushTaskDo.Alias() } + +func (r *rewardPushTask) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *rewardPushTask) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 4) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["do_time"] = r.DoTime + r.fieldMap["push_id"] = r.PushID +} + +func (r rewardPushTask) clone(db *gorm.DB) rewardPushTask { + r.rewardPushTaskDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r rewardPushTask) replaceDB(db *gorm.DB) rewardPushTask { + r.rewardPushTaskDo.ReplaceDB(db) + return r +} + +type rewardPushTaskDo struct{ gen.DO } + +func (r rewardPushTaskDo) Debug() *rewardPushTaskDo { + return r.withDO(r.DO.Debug()) +} + +func (r rewardPushTaskDo) WithContext(ctx context.Context) *rewardPushTaskDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r rewardPushTaskDo) ReadDB() *rewardPushTaskDo { + return r.Clauses(dbresolver.Read) +} + +func (r rewardPushTaskDo) WriteDB() *rewardPushTaskDo { + return r.Clauses(dbresolver.Write) +} + +func (r rewardPushTaskDo) Session(config *gorm.Session) *rewardPushTaskDo { + return r.withDO(r.DO.Session(config)) +} + +func (r rewardPushTaskDo) Clauses(conds ...clause.Expression) *rewardPushTaskDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r rewardPushTaskDo) Returning(value interface{}, columns ...string) *rewardPushTaskDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r rewardPushTaskDo) Not(conds ...gen.Condition) *rewardPushTaskDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r rewardPushTaskDo) Or(conds ...gen.Condition) *rewardPushTaskDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r rewardPushTaskDo) Select(conds ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r rewardPushTaskDo) Where(conds ...gen.Condition) *rewardPushTaskDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r rewardPushTaskDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *rewardPushTaskDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r rewardPushTaskDo) Order(conds ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r rewardPushTaskDo) Distinct(cols ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r rewardPushTaskDo) Omit(cols ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r rewardPushTaskDo) Join(table schema.Tabler, on ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r rewardPushTaskDo) LeftJoin(table schema.Tabler, on ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r rewardPushTaskDo) RightJoin(table schema.Tabler, on ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r rewardPushTaskDo) Group(cols ...field.Expr) *rewardPushTaskDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r rewardPushTaskDo) Having(conds ...gen.Condition) *rewardPushTaskDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r rewardPushTaskDo) Limit(limit int) *rewardPushTaskDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r rewardPushTaskDo) Offset(offset int) *rewardPushTaskDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r rewardPushTaskDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *rewardPushTaskDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r rewardPushTaskDo) Unscoped() *rewardPushTaskDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r rewardPushTaskDo) Create(values ...*model.RewardPushTask) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r rewardPushTaskDo) CreateInBatches(values []*model.RewardPushTask, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r rewardPushTaskDo) Save(values ...*model.RewardPushTask) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r rewardPushTaskDo) First() (*model.RewardPushTask, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushTask), nil + } +} + +func (r rewardPushTaskDo) Take() (*model.RewardPushTask, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushTask), nil + } +} + +func (r rewardPushTaskDo) Last() (*model.RewardPushTask, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushTask), nil + } +} + +func (r rewardPushTaskDo) Find() ([]*model.RewardPushTask, error) { + result, err := r.DO.Find() + return result.([]*model.RewardPushTask), err +} + +func (r rewardPushTaskDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RewardPushTask, err error) { + buf := make([]*model.RewardPushTask, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r rewardPushTaskDo) FindInBatches(result *[]*model.RewardPushTask, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r rewardPushTaskDo) Attrs(attrs ...field.AssignExpr) *rewardPushTaskDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r rewardPushTaskDo) Assign(attrs ...field.AssignExpr) *rewardPushTaskDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r rewardPushTaskDo) Joins(fields ...field.RelationField) *rewardPushTaskDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r rewardPushTaskDo) Preload(fields ...field.RelationField) *rewardPushTaskDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r rewardPushTaskDo) FirstOrInit() (*model.RewardPushTask, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushTask), nil + } +} + +func (r rewardPushTaskDo) FirstOrCreate() (*model.RewardPushTask, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RewardPushTask), nil + } +} + +func (r rewardPushTaskDo) FindByPage(offset int, limit int) (result []*model.RewardPushTask, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r rewardPushTaskDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r rewardPushTaskDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r rewardPushTaskDo) Delete(models ...*model.RewardPushTask) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *rewardPushTaskDo) withDO(do gen.Dao) *rewardPushTaskDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/reward_related.gen.go b/internal/repository/dao/reward_related.gen.go new file mode 100644 index 0000000..8486ca1 --- /dev/null +++ b/internal/repository/dao/reward_related.gen.go @@ -0,0 +1,355 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newRewardRelated(db *gorm.DB, opts ...gen.DOOption) rewardRelated { + _rewardRelated := rewardRelated{} + + _rewardRelated.rewardRelatedDo.UseDB(db, opts...) + _rewardRelated.rewardRelatedDo.UseModel(&model.RewardRelated{}) + + tableName := _rewardRelated.rewardRelatedDo.TableName() + _rewardRelated.ALL = field.NewAsterisk(tableName) + _rewardRelated.ID = field.NewInt64(tableName, "id") + _rewardRelated.CreatedAt = field.NewInt64(tableName, "created_at") + _rewardRelated.UpdatedAt = field.NewInt64(tableName, "updated_at") + _rewardRelated.RewardID = field.NewInt64(tableName, "reward_id") + _rewardRelated.RelateID = field.NewInt64(tableName, "relate_id") + _rewardRelated.RelateTable = field.NewString(tableName, "relate_table") + _rewardRelated.CancelTime = field.NewInt64(tableName, "cancel_time") + + _rewardRelated.fillFieldMap() + + return _rewardRelated +} + +type rewardRelated struct { + rewardRelatedDo rewardRelatedDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + RewardID field.Int64 // 奖品id(reward表) + RelateID field.Int64 // 关联id + RelateTable field.String // 关联表名 + CancelTime field.Int64 // 取消关联时间 + + fieldMap map[string]field.Expr +} + +func (r rewardRelated) Table(newTableName string) *rewardRelated { + r.rewardRelatedDo.UseTable(newTableName) + return r.updateTableName(newTableName) +} + +func (r rewardRelated) As(alias string) *rewardRelated { + r.rewardRelatedDo.DO = *(r.rewardRelatedDo.As(alias).(*gen.DO)) + return r.updateTableName(alias) +} + +func (r *rewardRelated) updateTableName(table string) *rewardRelated { + r.ALL = field.NewAsterisk(table) + r.ID = field.NewInt64(table, "id") + r.CreatedAt = field.NewInt64(table, "created_at") + r.UpdatedAt = field.NewInt64(table, "updated_at") + r.RewardID = field.NewInt64(table, "reward_id") + r.RelateID = field.NewInt64(table, "relate_id") + r.RelateTable = field.NewString(table, "relate_table") + r.CancelTime = field.NewInt64(table, "cancel_time") + + r.fillFieldMap() + + return r +} + +func (r *rewardRelated) WithContext(ctx context.Context) *rewardRelatedDo { + return r.rewardRelatedDo.WithContext(ctx) +} + +func (r rewardRelated) TableName() string { return r.rewardRelatedDo.TableName() } + +func (r rewardRelated) Alias() string { return r.rewardRelatedDo.Alias() } + +func (r *rewardRelated) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := r.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (r *rewardRelated) fillFieldMap() { + r.fieldMap = make(map[string]field.Expr, 7) + r.fieldMap["id"] = r.ID + r.fieldMap["created_at"] = r.CreatedAt + r.fieldMap["updated_at"] = r.UpdatedAt + r.fieldMap["reward_id"] = r.RewardID + r.fieldMap["relate_id"] = r.RelateID + r.fieldMap["relate_table"] = r.RelateTable + r.fieldMap["cancel_time"] = r.CancelTime +} + +func (r rewardRelated) clone(db *gorm.DB) rewardRelated { + r.rewardRelatedDo.ReplaceConnPool(db.Statement.ConnPool) + return r +} + +func (r rewardRelated) replaceDB(db *gorm.DB) rewardRelated { + r.rewardRelatedDo.ReplaceDB(db) + return r +} + +type rewardRelatedDo struct{ gen.DO } + +func (r rewardRelatedDo) Debug() *rewardRelatedDo { + return r.withDO(r.DO.Debug()) +} + +func (r rewardRelatedDo) WithContext(ctx context.Context) *rewardRelatedDo { + return r.withDO(r.DO.WithContext(ctx)) +} + +func (r rewardRelatedDo) ReadDB() *rewardRelatedDo { + return r.Clauses(dbresolver.Read) +} + +func (r rewardRelatedDo) WriteDB() *rewardRelatedDo { + return r.Clauses(dbresolver.Write) +} + +func (r rewardRelatedDo) Session(config *gorm.Session) *rewardRelatedDo { + return r.withDO(r.DO.Session(config)) +} + +func (r rewardRelatedDo) Clauses(conds ...clause.Expression) *rewardRelatedDo { + return r.withDO(r.DO.Clauses(conds...)) +} + +func (r rewardRelatedDo) Returning(value interface{}, columns ...string) *rewardRelatedDo { + return r.withDO(r.DO.Returning(value, columns...)) +} + +func (r rewardRelatedDo) Not(conds ...gen.Condition) *rewardRelatedDo { + return r.withDO(r.DO.Not(conds...)) +} + +func (r rewardRelatedDo) Or(conds ...gen.Condition) *rewardRelatedDo { + return r.withDO(r.DO.Or(conds...)) +} + +func (r rewardRelatedDo) Select(conds ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.Select(conds...)) +} + +func (r rewardRelatedDo) Where(conds ...gen.Condition) *rewardRelatedDo { + return r.withDO(r.DO.Where(conds...)) +} + +func (r rewardRelatedDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *rewardRelatedDo { + return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (r rewardRelatedDo) Order(conds ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.Order(conds...)) +} + +func (r rewardRelatedDo) Distinct(cols ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.Distinct(cols...)) +} + +func (r rewardRelatedDo) Omit(cols ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.Omit(cols...)) +} + +func (r rewardRelatedDo) Join(table schema.Tabler, on ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.Join(table, on...)) +} + +func (r rewardRelatedDo) LeftJoin(table schema.Tabler, on ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.LeftJoin(table, on...)) +} + +func (r rewardRelatedDo) RightJoin(table schema.Tabler, on ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.RightJoin(table, on...)) +} + +func (r rewardRelatedDo) Group(cols ...field.Expr) *rewardRelatedDo { + return r.withDO(r.DO.Group(cols...)) +} + +func (r rewardRelatedDo) Having(conds ...gen.Condition) *rewardRelatedDo { + return r.withDO(r.DO.Having(conds...)) +} + +func (r rewardRelatedDo) Limit(limit int) *rewardRelatedDo { + return r.withDO(r.DO.Limit(limit)) +} + +func (r rewardRelatedDo) Offset(offset int) *rewardRelatedDo { + return r.withDO(r.DO.Offset(offset)) +} + +func (r rewardRelatedDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *rewardRelatedDo { + return r.withDO(r.DO.Scopes(funcs...)) +} + +func (r rewardRelatedDo) Unscoped() *rewardRelatedDo { + return r.withDO(r.DO.Unscoped()) +} + +func (r rewardRelatedDo) Create(values ...*model.RewardRelated) error { + if len(values) == 0 { + return nil + } + return r.DO.Create(values) +} + +func (r rewardRelatedDo) CreateInBatches(values []*model.RewardRelated, batchSize int) error { + return r.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (r rewardRelatedDo) Save(values ...*model.RewardRelated) error { + if len(values) == 0 { + return nil + } + return r.DO.Save(values) +} + +func (r rewardRelatedDo) First() (*model.RewardRelated, error) { + if result, err := r.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.RewardRelated), nil + } +} + +func (r rewardRelatedDo) Take() (*model.RewardRelated, error) { + if result, err := r.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.RewardRelated), nil + } +} + +func (r rewardRelatedDo) Last() (*model.RewardRelated, error) { + if result, err := r.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.RewardRelated), nil + } +} + +func (r rewardRelatedDo) Find() ([]*model.RewardRelated, error) { + result, err := r.DO.Find() + return result.([]*model.RewardRelated), err +} + +func (r rewardRelatedDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.RewardRelated, err error) { + buf := make([]*model.RewardRelated, 0, batchSize) + err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (r rewardRelatedDo) FindInBatches(result *[]*model.RewardRelated, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return r.DO.FindInBatches(result, batchSize, fc) +} + +func (r rewardRelatedDo) Attrs(attrs ...field.AssignExpr) *rewardRelatedDo { + return r.withDO(r.DO.Attrs(attrs...)) +} + +func (r rewardRelatedDo) Assign(attrs ...field.AssignExpr) *rewardRelatedDo { + return r.withDO(r.DO.Assign(attrs...)) +} + +func (r rewardRelatedDo) Joins(fields ...field.RelationField) *rewardRelatedDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Joins(_f)) + } + return &r +} + +func (r rewardRelatedDo) Preload(fields ...field.RelationField) *rewardRelatedDo { + for _, _f := range fields { + r = *r.withDO(r.DO.Preload(_f)) + } + return &r +} + +func (r rewardRelatedDo) FirstOrInit() (*model.RewardRelated, error) { + if result, err := r.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.RewardRelated), nil + } +} + +func (r rewardRelatedDo) FirstOrCreate() (*model.RewardRelated, error) { + if result, err := r.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.RewardRelated), nil + } +} + +func (r rewardRelatedDo) FindByPage(offset int, limit int) (result []*model.RewardRelated, count int64, err error) { + result, err = r.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = r.Offset(-1).Limit(-1).Count() + return +} + +func (r rewardRelatedDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = r.Count() + if err != nil { + return + } + + err = r.Offset(offset).Limit(limit).Scan(result) + return +} + +func (r rewardRelatedDo) Scan(result interface{}) (err error) { + return r.DO.Scan(result) +} + +func (r rewardRelatedDo) Delete(models ...*model.RewardRelated) (result gen.ResultInfo, err error) { + return r.DO.Delete(models) +} + +func (r *rewardRelatedDo) withDO(do gen.Dao) *rewardRelatedDo { + r.DO = *do.(*gen.DO) + return r +} diff --git a/internal/repository/dao/server_whitelist.gen.go b/internal/repository/dao/server_whitelist.gen.go new file mode 100644 index 0000000..c6397ed --- /dev/null +++ b/internal/repository/dao/server_whitelist.gen.go @@ -0,0 +1,335 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newServerWhitelist(db *gorm.DB, opts ...gen.DOOption) serverWhitelist { + _serverWhitelist := serverWhitelist{} + + _serverWhitelist.serverWhitelistDo.UseDB(db, opts...) + _serverWhitelist.serverWhitelistDo.UseModel(&model.ServerWhitelist{}) + + tableName := _serverWhitelist.serverWhitelistDo.TableName() + _serverWhitelist.ALL = field.NewAsterisk(tableName) + _serverWhitelist.ID = field.NewInt64(tableName, "id") + _serverWhitelist.IP = field.NewString(tableName, "ip") + + _serverWhitelist.fillFieldMap() + + return _serverWhitelist +} + +type serverWhitelist struct { + serverWhitelistDo serverWhitelistDo + + ALL field.Asterisk + ID field.Int64 + IP field.String + + fieldMap map[string]field.Expr +} + +func (s serverWhitelist) Table(newTableName string) *serverWhitelist { + s.serverWhitelistDo.UseTable(newTableName) + return s.updateTableName(newTableName) +} + +func (s serverWhitelist) As(alias string) *serverWhitelist { + s.serverWhitelistDo.DO = *(s.serverWhitelistDo.As(alias).(*gen.DO)) + return s.updateTableName(alias) +} + +func (s *serverWhitelist) updateTableName(table string) *serverWhitelist { + s.ALL = field.NewAsterisk(table) + s.ID = field.NewInt64(table, "id") + s.IP = field.NewString(table, "ip") + + s.fillFieldMap() + + return s +} + +func (s *serverWhitelist) WithContext(ctx context.Context) *serverWhitelistDo { + return s.serverWhitelistDo.WithContext(ctx) +} + +func (s serverWhitelist) TableName() string { return s.serverWhitelistDo.TableName() } + +func (s serverWhitelist) Alias() string { return s.serverWhitelistDo.Alias() } + +func (s *serverWhitelist) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := s.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (s *serverWhitelist) fillFieldMap() { + s.fieldMap = make(map[string]field.Expr, 2) + s.fieldMap["id"] = s.ID + s.fieldMap["ip"] = s.IP +} + +func (s serverWhitelist) clone(db *gorm.DB) serverWhitelist { + s.serverWhitelistDo.ReplaceConnPool(db.Statement.ConnPool) + return s +} + +func (s serverWhitelist) replaceDB(db *gorm.DB) serverWhitelist { + s.serverWhitelistDo.ReplaceDB(db) + return s +} + +type serverWhitelistDo struct{ gen.DO } + +func (s serverWhitelistDo) Debug() *serverWhitelistDo { + return s.withDO(s.DO.Debug()) +} + +func (s serverWhitelistDo) WithContext(ctx context.Context) *serverWhitelistDo { + return s.withDO(s.DO.WithContext(ctx)) +} + +func (s serverWhitelistDo) ReadDB() *serverWhitelistDo { + return s.Clauses(dbresolver.Read) +} + +func (s serverWhitelistDo) WriteDB() *serverWhitelistDo { + return s.Clauses(dbresolver.Write) +} + +func (s serverWhitelistDo) Session(config *gorm.Session) *serverWhitelistDo { + return s.withDO(s.DO.Session(config)) +} + +func (s serverWhitelistDo) Clauses(conds ...clause.Expression) *serverWhitelistDo { + return s.withDO(s.DO.Clauses(conds...)) +} + +func (s serverWhitelistDo) Returning(value interface{}, columns ...string) *serverWhitelistDo { + return s.withDO(s.DO.Returning(value, columns...)) +} + +func (s serverWhitelistDo) Not(conds ...gen.Condition) *serverWhitelistDo { + return s.withDO(s.DO.Not(conds...)) +} + +func (s serverWhitelistDo) Or(conds ...gen.Condition) *serverWhitelistDo { + return s.withDO(s.DO.Or(conds...)) +} + +func (s serverWhitelistDo) Select(conds ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.Select(conds...)) +} + +func (s serverWhitelistDo) Where(conds ...gen.Condition) *serverWhitelistDo { + return s.withDO(s.DO.Where(conds...)) +} + +func (s serverWhitelistDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *serverWhitelistDo { + return s.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (s serverWhitelistDo) Order(conds ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.Order(conds...)) +} + +func (s serverWhitelistDo) Distinct(cols ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.Distinct(cols...)) +} + +func (s serverWhitelistDo) Omit(cols ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.Omit(cols...)) +} + +func (s serverWhitelistDo) Join(table schema.Tabler, on ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.Join(table, on...)) +} + +func (s serverWhitelistDo) LeftJoin(table schema.Tabler, on ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.LeftJoin(table, on...)) +} + +func (s serverWhitelistDo) RightJoin(table schema.Tabler, on ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.RightJoin(table, on...)) +} + +func (s serverWhitelistDo) Group(cols ...field.Expr) *serverWhitelistDo { + return s.withDO(s.DO.Group(cols...)) +} + +func (s serverWhitelistDo) Having(conds ...gen.Condition) *serverWhitelistDo { + return s.withDO(s.DO.Having(conds...)) +} + +func (s serverWhitelistDo) Limit(limit int) *serverWhitelistDo { + return s.withDO(s.DO.Limit(limit)) +} + +func (s serverWhitelistDo) Offset(offset int) *serverWhitelistDo { + return s.withDO(s.DO.Offset(offset)) +} + +func (s serverWhitelistDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *serverWhitelistDo { + return s.withDO(s.DO.Scopes(funcs...)) +} + +func (s serverWhitelistDo) Unscoped() *serverWhitelistDo { + return s.withDO(s.DO.Unscoped()) +} + +func (s serverWhitelistDo) Create(values ...*model.ServerWhitelist) error { + if len(values) == 0 { + return nil + } + return s.DO.Create(values) +} + +func (s serverWhitelistDo) CreateInBatches(values []*model.ServerWhitelist, batchSize int) error { + return s.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (s serverWhitelistDo) Save(values ...*model.ServerWhitelist) error { + if len(values) == 0 { + return nil + } + return s.DO.Save(values) +} + +func (s serverWhitelistDo) First() (*model.ServerWhitelist, error) { + if result, err := s.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ServerWhitelist), nil + } +} + +func (s serverWhitelistDo) Take() (*model.ServerWhitelist, error) { + if result, err := s.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ServerWhitelist), nil + } +} + +func (s serverWhitelistDo) Last() (*model.ServerWhitelist, error) { + if result, err := s.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ServerWhitelist), nil + } +} + +func (s serverWhitelistDo) Find() ([]*model.ServerWhitelist, error) { + result, err := s.DO.Find() + return result.([]*model.ServerWhitelist), err +} + +func (s serverWhitelistDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ServerWhitelist, err error) { + buf := make([]*model.ServerWhitelist, 0, batchSize) + err = s.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (s serverWhitelistDo) FindInBatches(result *[]*model.ServerWhitelist, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return s.DO.FindInBatches(result, batchSize, fc) +} + +func (s serverWhitelistDo) Attrs(attrs ...field.AssignExpr) *serverWhitelistDo { + return s.withDO(s.DO.Attrs(attrs...)) +} + +func (s serverWhitelistDo) Assign(attrs ...field.AssignExpr) *serverWhitelistDo { + return s.withDO(s.DO.Assign(attrs...)) +} + +func (s serverWhitelistDo) Joins(fields ...field.RelationField) *serverWhitelistDo { + for _, _f := range fields { + s = *s.withDO(s.DO.Joins(_f)) + } + return &s +} + +func (s serverWhitelistDo) Preload(fields ...field.RelationField) *serverWhitelistDo { + for _, _f := range fields { + s = *s.withDO(s.DO.Preload(_f)) + } + return &s +} + +func (s serverWhitelistDo) FirstOrInit() (*model.ServerWhitelist, error) { + if result, err := s.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ServerWhitelist), nil + } +} + +func (s serverWhitelistDo) FirstOrCreate() (*model.ServerWhitelist, error) { + if result, err := s.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ServerWhitelist), nil + } +} + +func (s serverWhitelistDo) FindByPage(offset int, limit int) (result []*model.ServerWhitelist, count int64, err error) { + result, err = s.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = s.Offset(-1).Limit(-1).Count() + return +} + +func (s serverWhitelistDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = s.Count() + if err != nil { + return + } + + err = s.Offset(offset).Limit(limit).Scan(result) + return +} + +func (s serverWhitelistDo) Scan(result interface{}) (err error) { + return s.DO.Scan(result) +} + +func (s serverWhitelistDo) Delete(models ...*model.ServerWhitelist) (result gen.ResultInfo, err error) { + return s.DO.Delete(models) +} + +func (s *serverWhitelistDo) withDO(do gen.Dao) *serverWhitelistDo { + s.DO = *do.(*gen.DO) + return s +} diff --git a/internal/repository/dao/slow_log.gen.go b/internal/repository/dao/slow_log.gen.go new file mode 100644 index 0000000..9581cb2 --- /dev/null +++ b/internal/repository/dao/slow_log.gen.go @@ -0,0 +1,353 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newSlowLog(db *gorm.DB, opts ...gen.DOOption) slowLog { + _slowLog := slowLog{} + + _slowLog.slowLogDo.UseDB(db, opts...) + _slowLog.slowLogDo.UseModel(&model.SlowLog{}) + + tableName := _slowLog.slowLogDo.TableName() + _slowLog.ALL = field.NewAsterisk(tableName) + _slowLog.ID = field.NewInt64(tableName, "id") + _slowLog.CreatedAt = field.NewInt64(tableName, "created_at") + _slowLog.Method = field.NewString(tableName, "method") + _slowLog.Req = field.NewString(tableName, "req") + _slowLog.Res = field.NewString(tableName, "res") + _slowLog.Sec = field.NewInt64(tableName, "sec") + _slowLog.TraceID = field.NewString(tableName, "trace_id") + + _slowLog.fillFieldMap() + + return _slowLog +} + +type slowLog struct { + slowLogDo slowLogDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + Method field.String // 执行的方法标识 + Req field.String // 处理的数据 + Res field.String // 处理后返回的结果 + Sec field.Int64 // 耗时(单位:ms) + TraceID field.String // 全局追踪id + + fieldMap map[string]field.Expr +} + +func (s slowLog) Table(newTableName string) *slowLog { + s.slowLogDo.UseTable(newTableName) + return s.updateTableName(newTableName) +} + +func (s slowLog) As(alias string) *slowLog { + s.slowLogDo.DO = *(s.slowLogDo.As(alias).(*gen.DO)) + return s.updateTableName(alias) +} + +func (s *slowLog) updateTableName(table string) *slowLog { + s.ALL = field.NewAsterisk(table) + s.ID = field.NewInt64(table, "id") + s.CreatedAt = field.NewInt64(table, "created_at") + s.Method = field.NewString(table, "method") + s.Req = field.NewString(table, "req") + s.Res = field.NewString(table, "res") + s.Sec = field.NewInt64(table, "sec") + s.TraceID = field.NewString(table, "trace_id") + + s.fillFieldMap() + + return s +} + +func (s *slowLog) WithContext(ctx context.Context) *slowLogDo { return s.slowLogDo.WithContext(ctx) } + +func (s slowLog) TableName() string { return s.slowLogDo.TableName() } + +func (s slowLog) Alias() string { return s.slowLogDo.Alias() } + +func (s *slowLog) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := s.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (s *slowLog) fillFieldMap() { + s.fieldMap = make(map[string]field.Expr, 7) + s.fieldMap["id"] = s.ID + s.fieldMap["created_at"] = s.CreatedAt + s.fieldMap["method"] = s.Method + s.fieldMap["req"] = s.Req + s.fieldMap["res"] = s.Res + s.fieldMap["sec"] = s.Sec + s.fieldMap["trace_id"] = s.TraceID +} + +func (s slowLog) clone(db *gorm.DB) slowLog { + s.slowLogDo.ReplaceConnPool(db.Statement.ConnPool) + return s +} + +func (s slowLog) replaceDB(db *gorm.DB) slowLog { + s.slowLogDo.ReplaceDB(db) + return s +} + +type slowLogDo struct{ gen.DO } + +func (s slowLogDo) Debug() *slowLogDo { + return s.withDO(s.DO.Debug()) +} + +func (s slowLogDo) WithContext(ctx context.Context) *slowLogDo { + return s.withDO(s.DO.WithContext(ctx)) +} + +func (s slowLogDo) ReadDB() *slowLogDo { + return s.Clauses(dbresolver.Read) +} + +func (s slowLogDo) WriteDB() *slowLogDo { + return s.Clauses(dbresolver.Write) +} + +func (s slowLogDo) Session(config *gorm.Session) *slowLogDo { + return s.withDO(s.DO.Session(config)) +} + +func (s slowLogDo) Clauses(conds ...clause.Expression) *slowLogDo { + return s.withDO(s.DO.Clauses(conds...)) +} + +func (s slowLogDo) Returning(value interface{}, columns ...string) *slowLogDo { + return s.withDO(s.DO.Returning(value, columns...)) +} + +func (s slowLogDo) Not(conds ...gen.Condition) *slowLogDo { + return s.withDO(s.DO.Not(conds...)) +} + +func (s slowLogDo) Or(conds ...gen.Condition) *slowLogDo { + return s.withDO(s.DO.Or(conds...)) +} + +func (s slowLogDo) Select(conds ...field.Expr) *slowLogDo { + return s.withDO(s.DO.Select(conds...)) +} + +func (s slowLogDo) Where(conds ...gen.Condition) *slowLogDo { + return s.withDO(s.DO.Where(conds...)) +} + +func (s slowLogDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *slowLogDo { + return s.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (s slowLogDo) Order(conds ...field.Expr) *slowLogDo { + return s.withDO(s.DO.Order(conds...)) +} + +func (s slowLogDo) Distinct(cols ...field.Expr) *slowLogDo { + return s.withDO(s.DO.Distinct(cols...)) +} + +func (s slowLogDo) Omit(cols ...field.Expr) *slowLogDo { + return s.withDO(s.DO.Omit(cols...)) +} + +func (s slowLogDo) Join(table schema.Tabler, on ...field.Expr) *slowLogDo { + return s.withDO(s.DO.Join(table, on...)) +} + +func (s slowLogDo) LeftJoin(table schema.Tabler, on ...field.Expr) *slowLogDo { + return s.withDO(s.DO.LeftJoin(table, on...)) +} + +func (s slowLogDo) RightJoin(table schema.Tabler, on ...field.Expr) *slowLogDo { + return s.withDO(s.DO.RightJoin(table, on...)) +} + +func (s slowLogDo) Group(cols ...field.Expr) *slowLogDo { + return s.withDO(s.DO.Group(cols...)) +} + +func (s slowLogDo) Having(conds ...gen.Condition) *slowLogDo { + return s.withDO(s.DO.Having(conds...)) +} + +func (s slowLogDo) Limit(limit int) *slowLogDo { + return s.withDO(s.DO.Limit(limit)) +} + +func (s slowLogDo) Offset(offset int) *slowLogDo { + return s.withDO(s.DO.Offset(offset)) +} + +func (s slowLogDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *slowLogDo { + return s.withDO(s.DO.Scopes(funcs...)) +} + +func (s slowLogDo) Unscoped() *slowLogDo { + return s.withDO(s.DO.Unscoped()) +} + +func (s slowLogDo) Create(values ...*model.SlowLog) error { + if len(values) == 0 { + return nil + } + return s.DO.Create(values) +} + +func (s slowLogDo) CreateInBatches(values []*model.SlowLog, batchSize int) error { + return s.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (s slowLogDo) Save(values ...*model.SlowLog) error { + if len(values) == 0 { + return nil + } + return s.DO.Save(values) +} + +func (s slowLogDo) First() (*model.SlowLog, error) { + if result, err := s.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.SlowLog), nil + } +} + +func (s slowLogDo) Take() (*model.SlowLog, error) { + if result, err := s.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.SlowLog), nil + } +} + +func (s slowLogDo) Last() (*model.SlowLog, error) { + if result, err := s.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.SlowLog), nil + } +} + +func (s slowLogDo) Find() ([]*model.SlowLog, error) { + result, err := s.DO.Find() + return result.([]*model.SlowLog), err +} + +func (s slowLogDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.SlowLog, err error) { + buf := make([]*model.SlowLog, 0, batchSize) + err = s.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (s slowLogDo) FindInBatches(result *[]*model.SlowLog, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return s.DO.FindInBatches(result, batchSize, fc) +} + +func (s slowLogDo) Attrs(attrs ...field.AssignExpr) *slowLogDo { + return s.withDO(s.DO.Attrs(attrs...)) +} + +func (s slowLogDo) Assign(attrs ...field.AssignExpr) *slowLogDo { + return s.withDO(s.DO.Assign(attrs...)) +} + +func (s slowLogDo) Joins(fields ...field.RelationField) *slowLogDo { + for _, _f := range fields { + s = *s.withDO(s.DO.Joins(_f)) + } + return &s +} + +func (s slowLogDo) Preload(fields ...field.RelationField) *slowLogDo { + for _, _f := range fields { + s = *s.withDO(s.DO.Preload(_f)) + } + return &s +} + +func (s slowLogDo) FirstOrInit() (*model.SlowLog, error) { + if result, err := s.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.SlowLog), nil + } +} + +func (s slowLogDo) FirstOrCreate() (*model.SlowLog, error) { + if result, err := s.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.SlowLog), nil + } +} + +func (s slowLogDo) FindByPage(offset int, limit int) (result []*model.SlowLog, count int64, err error) { + result, err = s.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = s.Offset(-1).Limit(-1).Count() + return +} + +func (s slowLogDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = s.Count() + if err != nil { + return + } + + err = s.Offset(offset).Limit(limit).Scan(result) + return +} + +func (s slowLogDo) Scan(result interface{}) (err error) { + return s.DO.Scan(result) +} + +func (s slowLogDo) Delete(models ...*model.SlowLog) (result gen.ResultInfo, err error) { + return s.DO.Delete(models) +} + +func (s *slowLogDo) withDO(do gen.Dao) *slowLogDo { + s.DO = *do.(*gen.DO) + return s +} diff --git a/internal/repository/dao/sub_table.go b/internal/repository/dao/sub_table.go new file mode 100644 index 0000000..80b9b8f --- /dev/null +++ b/internal/repository/dao/sub_table.go @@ -0,0 +1,19 @@ +package dao + +import ( + "fmt" +) + +func (f fissionUser) SubTable(cpnId int64) *fissionUser { + var tableName = fmt.Sprintf("%s_%d", f.TableName(), cpnId%100) + + f.fissionUserDo.UseTable(tableName) + return f.updateTableName(tableName) +} + +func (f fissionRewardRecord) SubTable(cpnId int64) *fissionRewardRecord { + var tableName = fmt.Sprintf("%s_%d", f.TableName(), cpnId%100) + + f.fissionRewardRecordDo.UseTable(tableName) + return f.updateTableName(tableName) +} diff --git a/internal/repository/dao/t_coin.gen.go b/internal/repository/dao/t_coin.gen.go new file mode 100644 index 0000000..9453d6f --- /dev/null +++ b/internal/repository/dao/t_coin.gen.go @@ -0,0 +1,353 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newTCoin(db *gorm.DB, opts ...gen.DOOption) tCoin { + _tCoin := tCoin{} + + _tCoin.tCoinDo.UseDB(db, opts...) + _tCoin.tCoinDo.UseModel(&model.TCoin{}) + + tableName := _tCoin.tCoinDo.TableName() + _tCoin.ALL = field.NewAsterisk(tableName) + _tCoin.ID = field.NewInt64(tableName, "id") + _tCoin.CreatedAt = field.NewInt64(tableName, "created_at") + _tCoin.UpdatedAt = field.NewInt64(tableName, "updated_at") + _tCoin.ProjectID = field.NewInt64(tableName, "project_id") + _tCoin.Title = field.NewString(tableName, "title") + _tCoin.OpenPush = field.NewInt8(tableName, "open_push") + _tCoin.ExpSelect = field.NewString(tableName, "exp_select") + + _tCoin.fillFieldMap() + + return _tCoin +} + +type tCoin struct { + tCoinDo tCoinDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + ProjectID field.Int64 // 项目id(project表) + Title field.String // 积分标题 + OpenPush field.Int8 // 开启积分获得推送 + ExpSelect field.String // 有效期选项 + + fieldMap map[string]field.Expr +} + +func (t tCoin) Table(newTableName string) *tCoin { + t.tCoinDo.UseTable(newTableName) + return t.updateTableName(newTableName) +} + +func (t tCoin) As(alias string) *tCoin { + t.tCoinDo.DO = *(t.tCoinDo.As(alias).(*gen.DO)) + return t.updateTableName(alias) +} + +func (t *tCoin) updateTableName(table string) *tCoin { + t.ALL = field.NewAsterisk(table) + t.ID = field.NewInt64(table, "id") + t.CreatedAt = field.NewInt64(table, "created_at") + t.UpdatedAt = field.NewInt64(table, "updated_at") + t.ProjectID = field.NewInt64(table, "project_id") + t.Title = field.NewString(table, "title") + t.OpenPush = field.NewInt8(table, "open_push") + t.ExpSelect = field.NewString(table, "exp_select") + + t.fillFieldMap() + + return t +} + +func (t *tCoin) WithContext(ctx context.Context) *tCoinDo { return t.tCoinDo.WithContext(ctx) } + +func (t tCoin) TableName() string { return t.tCoinDo.TableName() } + +func (t tCoin) Alias() string { return t.tCoinDo.Alias() } + +func (t *tCoin) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := t.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (t *tCoin) fillFieldMap() { + t.fieldMap = make(map[string]field.Expr, 7) + t.fieldMap["id"] = t.ID + t.fieldMap["created_at"] = t.CreatedAt + t.fieldMap["updated_at"] = t.UpdatedAt + t.fieldMap["project_id"] = t.ProjectID + t.fieldMap["title"] = t.Title + t.fieldMap["open_push"] = t.OpenPush + t.fieldMap["exp_select"] = t.ExpSelect +} + +func (t tCoin) clone(db *gorm.DB) tCoin { + t.tCoinDo.ReplaceConnPool(db.Statement.ConnPool) + return t +} + +func (t tCoin) replaceDB(db *gorm.DB) tCoin { + t.tCoinDo.ReplaceDB(db) + return t +} + +type tCoinDo struct{ gen.DO } + +func (t tCoinDo) Debug() *tCoinDo { + return t.withDO(t.DO.Debug()) +} + +func (t tCoinDo) WithContext(ctx context.Context) *tCoinDo { + return t.withDO(t.DO.WithContext(ctx)) +} + +func (t tCoinDo) ReadDB() *tCoinDo { + return t.Clauses(dbresolver.Read) +} + +func (t tCoinDo) WriteDB() *tCoinDo { + return t.Clauses(dbresolver.Write) +} + +func (t tCoinDo) Session(config *gorm.Session) *tCoinDo { + return t.withDO(t.DO.Session(config)) +} + +func (t tCoinDo) Clauses(conds ...clause.Expression) *tCoinDo { + return t.withDO(t.DO.Clauses(conds...)) +} + +func (t tCoinDo) Returning(value interface{}, columns ...string) *tCoinDo { + return t.withDO(t.DO.Returning(value, columns...)) +} + +func (t tCoinDo) Not(conds ...gen.Condition) *tCoinDo { + return t.withDO(t.DO.Not(conds...)) +} + +func (t tCoinDo) Or(conds ...gen.Condition) *tCoinDo { + return t.withDO(t.DO.Or(conds...)) +} + +func (t tCoinDo) Select(conds ...field.Expr) *tCoinDo { + return t.withDO(t.DO.Select(conds...)) +} + +func (t tCoinDo) Where(conds ...gen.Condition) *tCoinDo { + return t.withDO(t.DO.Where(conds...)) +} + +func (t tCoinDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *tCoinDo { + return t.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (t tCoinDo) Order(conds ...field.Expr) *tCoinDo { + return t.withDO(t.DO.Order(conds...)) +} + +func (t tCoinDo) Distinct(cols ...field.Expr) *tCoinDo { + return t.withDO(t.DO.Distinct(cols...)) +} + +func (t tCoinDo) Omit(cols ...field.Expr) *tCoinDo { + return t.withDO(t.DO.Omit(cols...)) +} + +func (t tCoinDo) Join(table schema.Tabler, on ...field.Expr) *tCoinDo { + return t.withDO(t.DO.Join(table, on...)) +} + +func (t tCoinDo) LeftJoin(table schema.Tabler, on ...field.Expr) *tCoinDo { + return t.withDO(t.DO.LeftJoin(table, on...)) +} + +func (t tCoinDo) RightJoin(table schema.Tabler, on ...field.Expr) *tCoinDo { + return t.withDO(t.DO.RightJoin(table, on...)) +} + +func (t tCoinDo) Group(cols ...field.Expr) *tCoinDo { + return t.withDO(t.DO.Group(cols...)) +} + +func (t tCoinDo) Having(conds ...gen.Condition) *tCoinDo { + return t.withDO(t.DO.Having(conds...)) +} + +func (t tCoinDo) Limit(limit int) *tCoinDo { + return t.withDO(t.DO.Limit(limit)) +} + +func (t tCoinDo) Offset(offset int) *tCoinDo { + return t.withDO(t.DO.Offset(offset)) +} + +func (t tCoinDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *tCoinDo { + return t.withDO(t.DO.Scopes(funcs...)) +} + +func (t tCoinDo) Unscoped() *tCoinDo { + return t.withDO(t.DO.Unscoped()) +} + +func (t tCoinDo) Create(values ...*model.TCoin) error { + if len(values) == 0 { + return nil + } + return t.DO.Create(values) +} + +func (t tCoinDo) CreateInBatches(values []*model.TCoin, batchSize int) error { + return t.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (t tCoinDo) Save(values ...*model.TCoin) error { + if len(values) == 0 { + return nil + } + return t.DO.Save(values) +} + +func (t tCoinDo) First() (*model.TCoin, error) { + if result, err := t.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.TCoin), nil + } +} + +func (t tCoinDo) Take() (*model.TCoin, error) { + if result, err := t.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.TCoin), nil + } +} + +func (t tCoinDo) Last() (*model.TCoin, error) { + if result, err := t.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.TCoin), nil + } +} + +func (t tCoinDo) Find() ([]*model.TCoin, error) { + result, err := t.DO.Find() + return result.([]*model.TCoin), err +} + +func (t tCoinDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.TCoin, err error) { + buf := make([]*model.TCoin, 0, batchSize) + err = t.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (t tCoinDo) FindInBatches(result *[]*model.TCoin, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return t.DO.FindInBatches(result, batchSize, fc) +} + +func (t tCoinDo) Attrs(attrs ...field.AssignExpr) *tCoinDo { + return t.withDO(t.DO.Attrs(attrs...)) +} + +func (t tCoinDo) Assign(attrs ...field.AssignExpr) *tCoinDo { + return t.withDO(t.DO.Assign(attrs...)) +} + +func (t tCoinDo) Joins(fields ...field.RelationField) *tCoinDo { + for _, _f := range fields { + t = *t.withDO(t.DO.Joins(_f)) + } + return &t +} + +func (t tCoinDo) Preload(fields ...field.RelationField) *tCoinDo { + for _, _f := range fields { + t = *t.withDO(t.DO.Preload(_f)) + } + return &t +} + +func (t tCoinDo) FirstOrInit() (*model.TCoin, error) { + if result, err := t.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.TCoin), nil + } +} + +func (t tCoinDo) FirstOrCreate() (*model.TCoin, error) { + if result, err := t.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.TCoin), nil + } +} + +func (t tCoinDo) FindByPage(offset int, limit int) (result []*model.TCoin, count int64, err error) { + result, err = t.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = t.Offset(-1).Limit(-1).Count() + return +} + +func (t tCoinDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = t.Count() + if err != nil { + return + } + + err = t.Offset(offset).Limit(limit).Scan(result) + return +} + +func (t tCoinDo) Scan(result interface{}) (err error) { + return t.DO.Scan(result) +} + +func (t tCoinDo) Delete(models ...*model.TCoin) (result gen.ResultInfo, err error) { + return t.DO.Delete(models) +} + +func (t *tCoinDo) withDO(do gen.Dao) *tCoinDo { + t.DO = *do.(*gen.DO) + return t +} diff --git a/internal/repository/dao/t_coin_lang.gen.go b/internal/repository/dao/t_coin_lang.gen.go new file mode 100644 index 0000000..258a01a --- /dev/null +++ b/internal/repository/dao/t_coin_lang.gen.go @@ -0,0 +1,363 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newTCoinLang(db *gorm.DB, opts ...gen.DOOption) tCoinLang { + _tCoinLang := tCoinLang{} + + _tCoinLang.tCoinLangDo.UseDB(db, opts...) + _tCoinLang.tCoinLangDo.UseModel(&model.TCoinLang{}) + + tableName := _tCoinLang.tCoinLangDo.TableName() + _tCoinLang.ALL = field.NewAsterisk(tableName) + _tCoinLang.ID = field.NewInt64(tableName, "id") + _tCoinLang.CreatedAt = field.NewInt64(tableName, "created_at") + _tCoinLang.UpdatedAt = field.NewInt64(tableName, "updated_at") + _tCoinLang.TCoinID = field.NewInt64(tableName, "t_coin_id") + _tCoinLang.LangMark = field.NewString(tableName, "lang_mark") + _tCoinLang.Title = field.NewString(tableName, "title") + _tCoinLang.ImgURL = field.NewString(tableName, "img_url") + _tCoinLang.Rule = field.NewString(tableName, "rule") + _tCoinLang.IsDefault = field.NewInt8(tableName, "is_default") + + _tCoinLang.fillFieldMap() + + return _tCoinLang +} + +type tCoinLang struct { + tCoinLangDo tCoinLangDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + TCoinID field.Int64 // 积分配置id(t_coin表) + LangMark field.String // 语言标识 + Title field.String // 积分标题 + ImgURL field.String // 积分图片 + Rule field.String // 积分规则 + IsDefault field.Int8 // 是否默认 + + fieldMap map[string]field.Expr +} + +func (t tCoinLang) Table(newTableName string) *tCoinLang { + t.tCoinLangDo.UseTable(newTableName) + return t.updateTableName(newTableName) +} + +func (t tCoinLang) As(alias string) *tCoinLang { + t.tCoinLangDo.DO = *(t.tCoinLangDo.As(alias).(*gen.DO)) + return t.updateTableName(alias) +} + +func (t *tCoinLang) updateTableName(table string) *tCoinLang { + t.ALL = field.NewAsterisk(table) + t.ID = field.NewInt64(table, "id") + t.CreatedAt = field.NewInt64(table, "created_at") + t.UpdatedAt = field.NewInt64(table, "updated_at") + t.TCoinID = field.NewInt64(table, "t_coin_id") + t.LangMark = field.NewString(table, "lang_mark") + t.Title = field.NewString(table, "title") + t.ImgURL = field.NewString(table, "img_url") + t.Rule = field.NewString(table, "rule") + t.IsDefault = field.NewInt8(table, "is_default") + + t.fillFieldMap() + + return t +} + +func (t *tCoinLang) WithContext(ctx context.Context) *tCoinLangDo { + return t.tCoinLangDo.WithContext(ctx) +} + +func (t tCoinLang) TableName() string { return t.tCoinLangDo.TableName() } + +func (t tCoinLang) Alias() string { return t.tCoinLangDo.Alias() } + +func (t *tCoinLang) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := t.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (t *tCoinLang) fillFieldMap() { + t.fieldMap = make(map[string]field.Expr, 9) + t.fieldMap["id"] = t.ID + t.fieldMap["created_at"] = t.CreatedAt + t.fieldMap["updated_at"] = t.UpdatedAt + t.fieldMap["t_coin_id"] = t.TCoinID + t.fieldMap["lang_mark"] = t.LangMark + t.fieldMap["title"] = t.Title + t.fieldMap["img_url"] = t.ImgURL + t.fieldMap["rule"] = t.Rule + t.fieldMap["is_default"] = t.IsDefault +} + +func (t tCoinLang) clone(db *gorm.DB) tCoinLang { + t.tCoinLangDo.ReplaceConnPool(db.Statement.ConnPool) + return t +} + +func (t tCoinLang) replaceDB(db *gorm.DB) tCoinLang { + t.tCoinLangDo.ReplaceDB(db) + return t +} + +type tCoinLangDo struct{ gen.DO } + +func (t tCoinLangDo) Debug() *tCoinLangDo { + return t.withDO(t.DO.Debug()) +} + +func (t tCoinLangDo) WithContext(ctx context.Context) *tCoinLangDo { + return t.withDO(t.DO.WithContext(ctx)) +} + +func (t tCoinLangDo) ReadDB() *tCoinLangDo { + return t.Clauses(dbresolver.Read) +} + +func (t tCoinLangDo) WriteDB() *tCoinLangDo { + return t.Clauses(dbresolver.Write) +} + +func (t tCoinLangDo) Session(config *gorm.Session) *tCoinLangDo { + return t.withDO(t.DO.Session(config)) +} + +func (t tCoinLangDo) Clauses(conds ...clause.Expression) *tCoinLangDo { + return t.withDO(t.DO.Clauses(conds...)) +} + +func (t tCoinLangDo) Returning(value interface{}, columns ...string) *tCoinLangDo { + return t.withDO(t.DO.Returning(value, columns...)) +} + +func (t tCoinLangDo) Not(conds ...gen.Condition) *tCoinLangDo { + return t.withDO(t.DO.Not(conds...)) +} + +func (t tCoinLangDo) Or(conds ...gen.Condition) *tCoinLangDo { + return t.withDO(t.DO.Or(conds...)) +} + +func (t tCoinLangDo) Select(conds ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.Select(conds...)) +} + +func (t tCoinLangDo) Where(conds ...gen.Condition) *tCoinLangDo { + return t.withDO(t.DO.Where(conds...)) +} + +func (t tCoinLangDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *tCoinLangDo { + return t.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (t tCoinLangDo) Order(conds ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.Order(conds...)) +} + +func (t tCoinLangDo) Distinct(cols ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.Distinct(cols...)) +} + +func (t tCoinLangDo) Omit(cols ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.Omit(cols...)) +} + +func (t tCoinLangDo) Join(table schema.Tabler, on ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.Join(table, on...)) +} + +func (t tCoinLangDo) LeftJoin(table schema.Tabler, on ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.LeftJoin(table, on...)) +} + +func (t tCoinLangDo) RightJoin(table schema.Tabler, on ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.RightJoin(table, on...)) +} + +func (t tCoinLangDo) Group(cols ...field.Expr) *tCoinLangDo { + return t.withDO(t.DO.Group(cols...)) +} + +func (t tCoinLangDo) Having(conds ...gen.Condition) *tCoinLangDo { + return t.withDO(t.DO.Having(conds...)) +} + +func (t tCoinLangDo) Limit(limit int) *tCoinLangDo { + return t.withDO(t.DO.Limit(limit)) +} + +func (t tCoinLangDo) Offset(offset int) *tCoinLangDo { + return t.withDO(t.DO.Offset(offset)) +} + +func (t tCoinLangDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *tCoinLangDo { + return t.withDO(t.DO.Scopes(funcs...)) +} + +func (t tCoinLangDo) Unscoped() *tCoinLangDo { + return t.withDO(t.DO.Unscoped()) +} + +func (t tCoinLangDo) Create(values ...*model.TCoinLang) error { + if len(values) == 0 { + return nil + } + return t.DO.Create(values) +} + +func (t tCoinLangDo) CreateInBatches(values []*model.TCoinLang, batchSize int) error { + return t.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (t tCoinLangDo) Save(values ...*model.TCoinLang) error { + if len(values) == 0 { + return nil + } + return t.DO.Save(values) +} + +func (t tCoinLangDo) First() (*model.TCoinLang, error) { + if result, err := t.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.TCoinLang), nil + } +} + +func (t tCoinLangDo) Take() (*model.TCoinLang, error) { + if result, err := t.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.TCoinLang), nil + } +} + +func (t tCoinLangDo) Last() (*model.TCoinLang, error) { + if result, err := t.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.TCoinLang), nil + } +} + +func (t tCoinLangDo) Find() ([]*model.TCoinLang, error) { + result, err := t.DO.Find() + return result.([]*model.TCoinLang), err +} + +func (t tCoinLangDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.TCoinLang, err error) { + buf := make([]*model.TCoinLang, 0, batchSize) + err = t.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (t tCoinLangDo) FindInBatches(result *[]*model.TCoinLang, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return t.DO.FindInBatches(result, batchSize, fc) +} + +func (t tCoinLangDo) Attrs(attrs ...field.AssignExpr) *tCoinLangDo { + return t.withDO(t.DO.Attrs(attrs...)) +} + +func (t tCoinLangDo) Assign(attrs ...field.AssignExpr) *tCoinLangDo { + return t.withDO(t.DO.Assign(attrs...)) +} + +func (t tCoinLangDo) Joins(fields ...field.RelationField) *tCoinLangDo { + for _, _f := range fields { + t = *t.withDO(t.DO.Joins(_f)) + } + return &t +} + +func (t tCoinLangDo) Preload(fields ...field.RelationField) *tCoinLangDo { + for _, _f := range fields { + t = *t.withDO(t.DO.Preload(_f)) + } + return &t +} + +func (t tCoinLangDo) FirstOrInit() (*model.TCoinLang, error) { + if result, err := t.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.TCoinLang), nil + } +} + +func (t tCoinLangDo) FirstOrCreate() (*model.TCoinLang, error) { + if result, err := t.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.TCoinLang), nil + } +} + +func (t tCoinLangDo) FindByPage(offset int, limit int) (result []*model.TCoinLang, count int64, err error) { + result, err = t.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = t.Offset(-1).Limit(-1).Count() + return +} + +func (t tCoinLangDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = t.Count() + if err != nil { + return + } + + err = t.Offset(offset).Limit(limit).Scan(result) + return +} + +func (t tCoinLangDo) Scan(result interface{}) (err error) { + return t.DO.Scan(result) +} + +func (t tCoinLangDo) Delete(models ...*model.TCoinLang) (result gen.ResultInfo, err error) { + return t.DO.Delete(models) +} + +func (t *tCoinLangDo) withDO(do gen.Dao) *tCoinLangDo { + t.DO = *do.(*gen.DO) + return t +} diff --git a/internal/repository/dao/user.gen.go b/internal/repository/dao/user.gen.go new file mode 100644 index 0000000..fc650e9 --- /dev/null +++ b/internal/repository/dao/user.gen.go @@ -0,0 +1,369 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newUser(db *gorm.DB, opts ...gen.DOOption) user { + _user := user{} + + _user.userDo.UseDB(db, opts...) + _user.userDo.UseModel(&model.User{}) + + tableName := _user.userDo.TableName() + _user.ALL = field.NewAsterisk(tableName) + _user.ID = field.NewInt64(tableName, "id") + _user.CreatedAt = field.NewInt64(tableName, "created_at") + _user.UpdatedAt = field.NewInt64(tableName, "updated_at") + _user.IsDel = field.NewInt8(tableName, "is_del") + _user.HashID = field.NewString(tableName, "hash_id") + _user.CompanyID = field.NewInt64(tableName, "company_id") + _user.Username = field.NewString(tableName, "username") + _user.ShowName = field.NewString(tableName, "show_name") + _user.Passwd = field.NewString(tableName, "passwd") + _user.IsAdmin = field.NewInt8(tableName, "is_admin") + _user.Email = field.NewString(tableName, "email") + + _user.fillFieldMap() + + return _user +} + +type user struct { + userDo userDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + HashID field.String // 对外id + CompanyID field.Int64 // 企业id表 + Username field.String // 用户登陆账号 + ShowName field.String // 用户显示名称 + Passwd field.String // 用户密码 + IsAdmin field.Int8 // 是否超级管理员(0-否,1-是) + Email field.String // 邮箱 + + fieldMap map[string]field.Expr +} + +func (u user) Table(newTableName string) *user { + u.userDo.UseTable(newTableName) + return u.updateTableName(newTableName) +} + +func (u user) As(alias string) *user { + u.userDo.DO = *(u.userDo.As(alias).(*gen.DO)) + return u.updateTableName(alias) +} + +func (u *user) updateTableName(table string) *user { + u.ALL = field.NewAsterisk(table) + u.ID = field.NewInt64(table, "id") + u.CreatedAt = field.NewInt64(table, "created_at") + u.UpdatedAt = field.NewInt64(table, "updated_at") + u.IsDel = field.NewInt8(table, "is_del") + u.HashID = field.NewString(table, "hash_id") + u.CompanyID = field.NewInt64(table, "company_id") + u.Username = field.NewString(table, "username") + u.ShowName = field.NewString(table, "show_name") + u.Passwd = field.NewString(table, "passwd") + u.IsAdmin = field.NewInt8(table, "is_admin") + u.Email = field.NewString(table, "email") + + u.fillFieldMap() + + return u +} + +func (u *user) WithContext(ctx context.Context) *userDo { return u.userDo.WithContext(ctx) } + +func (u user) TableName() string { return u.userDo.TableName() } + +func (u user) Alias() string { return u.userDo.Alias() } + +func (u *user) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := u.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (u *user) fillFieldMap() { + u.fieldMap = make(map[string]field.Expr, 11) + u.fieldMap["id"] = u.ID + u.fieldMap["created_at"] = u.CreatedAt + u.fieldMap["updated_at"] = u.UpdatedAt + u.fieldMap["is_del"] = u.IsDel + u.fieldMap["hash_id"] = u.HashID + u.fieldMap["company_id"] = u.CompanyID + u.fieldMap["username"] = u.Username + u.fieldMap["show_name"] = u.ShowName + u.fieldMap["passwd"] = u.Passwd + u.fieldMap["is_admin"] = u.IsAdmin + u.fieldMap["email"] = u.Email +} + +func (u user) clone(db *gorm.DB) user { + u.userDo.ReplaceConnPool(db.Statement.ConnPool) + return u +} + +func (u user) replaceDB(db *gorm.DB) user { + u.userDo.ReplaceDB(db) + return u +} + +type userDo struct{ gen.DO } + +func (u userDo) Debug() *userDo { + return u.withDO(u.DO.Debug()) +} + +func (u userDo) WithContext(ctx context.Context) *userDo { + return u.withDO(u.DO.WithContext(ctx)) +} + +func (u userDo) ReadDB() *userDo { + return u.Clauses(dbresolver.Read) +} + +func (u userDo) WriteDB() *userDo { + return u.Clauses(dbresolver.Write) +} + +func (u userDo) Session(config *gorm.Session) *userDo { + return u.withDO(u.DO.Session(config)) +} + +func (u userDo) Clauses(conds ...clause.Expression) *userDo { + return u.withDO(u.DO.Clauses(conds...)) +} + +func (u userDo) Returning(value interface{}, columns ...string) *userDo { + return u.withDO(u.DO.Returning(value, columns...)) +} + +func (u userDo) Not(conds ...gen.Condition) *userDo { + return u.withDO(u.DO.Not(conds...)) +} + +func (u userDo) Or(conds ...gen.Condition) *userDo { + return u.withDO(u.DO.Or(conds...)) +} + +func (u userDo) Select(conds ...field.Expr) *userDo { + return u.withDO(u.DO.Select(conds...)) +} + +func (u userDo) Where(conds ...gen.Condition) *userDo { + return u.withDO(u.DO.Where(conds...)) +} + +func (u userDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *userDo { + return u.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (u userDo) Order(conds ...field.Expr) *userDo { + return u.withDO(u.DO.Order(conds...)) +} + +func (u userDo) Distinct(cols ...field.Expr) *userDo { + return u.withDO(u.DO.Distinct(cols...)) +} + +func (u userDo) Omit(cols ...field.Expr) *userDo { + return u.withDO(u.DO.Omit(cols...)) +} + +func (u userDo) Join(table schema.Tabler, on ...field.Expr) *userDo { + return u.withDO(u.DO.Join(table, on...)) +} + +func (u userDo) LeftJoin(table schema.Tabler, on ...field.Expr) *userDo { + return u.withDO(u.DO.LeftJoin(table, on...)) +} + +func (u userDo) RightJoin(table schema.Tabler, on ...field.Expr) *userDo { + return u.withDO(u.DO.RightJoin(table, on...)) +} + +func (u userDo) Group(cols ...field.Expr) *userDo { + return u.withDO(u.DO.Group(cols...)) +} + +func (u userDo) Having(conds ...gen.Condition) *userDo { + return u.withDO(u.DO.Having(conds...)) +} + +func (u userDo) Limit(limit int) *userDo { + return u.withDO(u.DO.Limit(limit)) +} + +func (u userDo) Offset(offset int) *userDo { + return u.withDO(u.DO.Offset(offset)) +} + +func (u userDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *userDo { + return u.withDO(u.DO.Scopes(funcs...)) +} + +func (u userDo) Unscoped() *userDo { + return u.withDO(u.DO.Unscoped()) +} + +func (u userDo) Create(values ...*model.User) error { + if len(values) == 0 { + return nil + } + return u.DO.Create(values) +} + +func (u userDo) CreateInBatches(values []*model.User, batchSize int) error { + return u.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (u userDo) Save(values ...*model.User) error { + if len(values) == 0 { + return nil + } + return u.DO.Save(values) +} + +func (u userDo) First() (*model.User, error) { + if result, err := u.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.User), nil + } +} + +func (u userDo) Take() (*model.User, error) { + if result, err := u.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.User), nil + } +} + +func (u userDo) Last() (*model.User, error) { + if result, err := u.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.User), nil + } +} + +func (u userDo) Find() ([]*model.User, error) { + result, err := u.DO.Find() + return result.([]*model.User), err +} + +func (u userDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.User, err error) { + buf := make([]*model.User, 0, batchSize) + err = u.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (u userDo) FindInBatches(result *[]*model.User, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return u.DO.FindInBatches(result, batchSize, fc) +} + +func (u userDo) Attrs(attrs ...field.AssignExpr) *userDo { + return u.withDO(u.DO.Attrs(attrs...)) +} + +func (u userDo) Assign(attrs ...field.AssignExpr) *userDo { + return u.withDO(u.DO.Assign(attrs...)) +} + +func (u userDo) Joins(fields ...field.RelationField) *userDo { + for _, _f := range fields { + u = *u.withDO(u.DO.Joins(_f)) + } + return &u +} + +func (u userDo) Preload(fields ...field.RelationField) *userDo { + for _, _f := range fields { + u = *u.withDO(u.DO.Preload(_f)) + } + return &u +} + +func (u userDo) FirstOrInit() (*model.User, error) { + if result, err := u.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.User), nil + } +} + +func (u userDo) FirstOrCreate() (*model.User, error) { + if result, err := u.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.User), nil + } +} + +func (u userDo) FindByPage(offset int, limit int) (result []*model.User, count int64, err error) { + result, err = u.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = u.Offset(-1).Limit(-1).Count() + return +} + +func (u userDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = u.Count() + if err != nil { + return + } + + err = u.Offset(offset).Limit(limit).Scan(result) + return +} + +func (u userDo) Scan(result interface{}) (err error) { + return u.DO.Scan(result) +} + +func (u userDo) Delete(models ...*model.User) (result gen.ResultInfo, err error) { + return u.DO.Delete(models) +} + +func (u *userDo) withDO(do gen.Dao) *userDo { + u.DO = *do.(*gen.DO) + return u +} diff --git a/internal/repository/dao/user_behavior.gen.go b/internal/repository/dao/user_behavior.gen.go new file mode 100644 index 0000000..92b878d --- /dev/null +++ b/internal/repository/dao/user_behavior.gen.go @@ -0,0 +1,371 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newUserBehavior(db *gorm.DB, opts ...gen.DOOption) userBehavior { + _userBehavior := userBehavior{} + + _userBehavior.userBehaviorDo.UseDB(db, opts...) + _userBehavior.userBehaviorDo.UseModel(&model.UserBehavior{}) + + tableName := _userBehavior.userBehaviorDo.TableName() + _userBehavior.ALL = field.NewAsterisk(tableName) + _userBehavior.ID = field.NewInt64(tableName, "id") + _userBehavior.CreatedAt = field.NewInt64(tableName, "created_at") + _userBehavior.APIURL = field.NewString(tableName, "api_url") + _userBehavior.Desc = field.NewString(tableName, "desc") + _userBehavior.CompanyID = field.NewInt64(tableName, "company_id") + _userBehavior.UserID = field.NewInt64(tableName, "user_id") + _userBehavior.ProjectID = field.NewString(tableName, "project_id") + _userBehavior.IP = field.NewString(tableName, "ip") + _userBehavior.UaData = field.NewString(tableName, "ua_data") + _userBehavior.Req = field.NewString(tableName, "req") + _userBehavior.Res = field.NewString(tableName, "res") + + _userBehavior.fillFieldMap() + + return _userBehavior +} + +type userBehavior struct { + userBehaviorDo userBehaviorDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + APIURL field.String // 请求的接口 + Desc field.String // 接口描述 + CompanyID field.Int64 // 公司id + UserID field.Int64 // 用户id + ProjectID field.String // 项目hash_id + IP field.String // 操作ip + UaData field.String // 部分ua头数据 + Req field.String // 请求数据 + Res field.String // 操作结果 + + fieldMap map[string]field.Expr +} + +func (u userBehavior) Table(newTableName string) *userBehavior { + u.userBehaviorDo.UseTable(newTableName) + return u.updateTableName(newTableName) +} + +func (u userBehavior) As(alias string) *userBehavior { + u.userBehaviorDo.DO = *(u.userBehaviorDo.As(alias).(*gen.DO)) + return u.updateTableName(alias) +} + +func (u *userBehavior) updateTableName(table string) *userBehavior { + u.ALL = field.NewAsterisk(table) + u.ID = field.NewInt64(table, "id") + u.CreatedAt = field.NewInt64(table, "created_at") + u.APIURL = field.NewString(table, "api_url") + u.Desc = field.NewString(table, "desc") + u.CompanyID = field.NewInt64(table, "company_id") + u.UserID = field.NewInt64(table, "user_id") + u.ProjectID = field.NewString(table, "project_id") + u.IP = field.NewString(table, "ip") + u.UaData = field.NewString(table, "ua_data") + u.Req = field.NewString(table, "req") + u.Res = field.NewString(table, "res") + + u.fillFieldMap() + + return u +} + +func (u *userBehavior) WithContext(ctx context.Context) *userBehaviorDo { + return u.userBehaviorDo.WithContext(ctx) +} + +func (u userBehavior) TableName() string { return u.userBehaviorDo.TableName() } + +func (u userBehavior) Alias() string { return u.userBehaviorDo.Alias() } + +func (u *userBehavior) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := u.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (u *userBehavior) fillFieldMap() { + u.fieldMap = make(map[string]field.Expr, 11) + u.fieldMap["id"] = u.ID + u.fieldMap["created_at"] = u.CreatedAt + u.fieldMap["api_url"] = u.APIURL + u.fieldMap["desc"] = u.Desc + u.fieldMap["company_id"] = u.CompanyID + u.fieldMap["user_id"] = u.UserID + u.fieldMap["project_id"] = u.ProjectID + u.fieldMap["ip"] = u.IP + u.fieldMap["ua_data"] = u.UaData + u.fieldMap["req"] = u.Req + u.fieldMap["res"] = u.Res +} + +func (u userBehavior) clone(db *gorm.DB) userBehavior { + u.userBehaviorDo.ReplaceConnPool(db.Statement.ConnPool) + return u +} + +func (u userBehavior) replaceDB(db *gorm.DB) userBehavior { + u.userBehaviorDo.ReplaceDB(db) + return u +} + +type userBehaviorDo struct{ gen.DO } + +func (u userBehaviorDo) Debug() *userBehaviorDo { + return u.withDO(u.DO.Debug()) +} + +func (u userBehaviorDo) WithContext(ctx context.Context) *userBehaviorDo { + return u.withDO(u.DO.WithContext(ctx)) +} + +func (u userBehaviorDo) ReadDB() *userBehaviorDo { + return u.Clauses(dbresolver.Read) +} + +func (u userBehaviorDo) WriteDB() *userBehaviorDo { + return u.Clauses(dbresolver.Write) +} + +func (u userBehaviorDo) Session(config *gorm.Session) *userBehaviorDo { + return u.withDO(u.DO.Session(config)) +} + +func (u userBehaviorDo) Clauses(conds ...clause.Expression) *userBehaviorDo { + return u.withDO(u.DO.Clauses(conds...)) +} + +func (u userBehaviorDo) Returning(value interface{}, columns ...string) *userBehaviorDo { + return u.withDO(u.DO.Returning(value, columns...)) +} + +func (u userBehaviorDo) Not(conds ...gen.Condition) *userBehaviorDo { + return u.withDO(u.DO.Not(conds...)) +} + +func (u userBehaviorDo) Or(conds ...gen.Condition) *userBehaviorDo { + return u.withDO(u.DO.Or(conds...)) +} + +func (u userBehaviorDo) Select(conds ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.Select(conds...)) +} + +func (u userBehaviorDo) Where(conds ...gen.Condition) *userBehaviorDo { + return u.withDO(u.DO.Where(conds...)) +} + +func (u userBehaviorDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *userBehaviorDo { + return u.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (u userBehaviorDo) Order(conds ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.Order(conds...)) +} + +func (u userBehaviorDo) Distinct(cols ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.Distinct(cols...)) +} + +func (u userBehaviorDo) Omit(cols ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.Omit(cols...)) +} + +func (u userBehaviorDo) Join(table schema.Tabler, on ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.Join(table, on...)) +} + +func (u userBehaviorDo) LeftJoin(table schema.Tabler, on ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.LeftJoin(table, on...)) +} + +func (u userBehaviorDo) RightJoin(table schema.Tabler, on ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.RightJoin(table, on...)) +} + +func (u userBehaviorDo) Group(cols ...field.Expr) *userBehaviorDo { + return u.withDO(u.DO.Group(cols...)) +} + +func (u userBehaviorDo) Having(conds ...gen.Condition) *userBehaviorDo { + return u.withDO(u.DO.Having(conds...)) +} + +func (u userBehaviorDo) Limit(limit int) *userBehaviorDo { + return u.withDO(u.DO.Limit(limit)) +} + +func (u userBehaviorDo) Offset(offset int) *userBehaviorDo { + return u.withDO(u.DO.Offset(offset)) +} + +func (u userBehaviorDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *userBehaviorDo { + return u.withDO(u.DO.Scopes(funcs...)) +} + +func (u userBehaviorDo) Unscoped() *userBehaviorDo { + return u.withDO(u.DO.Unscoped()) +} + +func (u userBehaviorDo) Create(values ...*model.UserBehavior) error { + if len(values) == 0 { + return nil + } + return u.DO.Create(values) +} + +func (u userBehaviorDo) CreateInBatches(values []*model.UserBehavior, batchSize int) error { + return u.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (u userBehaviorDo) Save(values ...*model.UserBehavior) error { + if len(values) == 0 { + return nil + } + return u.DO.Save(values) +} + +func (u userBehaviorDo) First() (*model.UserBehavior, error) { + if result, err := u.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.UserBehavior), nil + } +} + +func (u userBehaviorDo) Take() (*model.UserBehavior, error) { + if result, err := u.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.UserBehavior), nil + } +} + +func (u userBehaviorDo) Last() (*model.UserBehavior, error) { + if result, err := u.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.UserBehavior), nil + } +} + +func (u userBehaviorDo) Find() ([]*model.UserBehavior, error) { + result, err := u.DO.Find() + return result.([]*model.UserBehavior), err +} + +func (u userBehaviorDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.UserBehavior, err error) { + buf := make([]*model.UserBehavior, 0, batchSize) + err = u.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (u userBehaviorDo) FindInBatches(result *[]*model.UserBehavior, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return u.DO.FindInBatches(result, batchSize, fc) +} + +func (u userBehaviorDo) Attrs(attrs ...field.AssignExpr) *userBehaviorDo { + return u.withDO(u.DO.Attrs(attrs...)) +} + +func (u userBehaviorDo) Assign(attrs ...field.AssignExpr) *userBehaviorDo { + return u.withDO(u.DO.Assign(attrs...)) +} + +func (u userBehaviorDo) Joins(fields ...field.RelationField) *userBehaviorDo { + for _, _f := range fields { + u = *u.withDO(u.DO.Joins(_f)) + } + return &u +} + +func (u userBehaviorDo) Preload(fields ...field.RelationField) *userBehaviorDo { + for _, _f := range fields { + u = *u.withDO(u.DO.Preload(_f)) + } + return &u +} + +func (u userBehaviorDo) FirstOrInit() (*model.UserBehavior, error) { + if result, err := u.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.UserBehavior), nil + } +} + +func (u userBehaviorDo) FirstOrCreate() (*model.UserBehavior, error) { + if result, err := u.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.UserBehavior), nil + } +} + +func (u userBehaviorDo) FindByPage(offset int, limit int) (result []*model.UserBehavior, count int64, err error) { + result, err = u.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = u.Offset(-1).Limit(-1).Count() + return +} + +func (u userBehaviorDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = u.Count() + if err != nil { + return + } + + err = u.Offset(offset).Limit(limit).Scan(result) + return +} + +func (u userBehaviorDo) Scan(result interface{}) (err error) { + return u.DO.Scan(result) +} + +func (u userBehaviorDo) Delete(models ...*model.UserBehavior) (result gen.ResultInfo, err error) { + return u.DO.Delete(models) +} + +func (u *userBehaviorDo) withDO(do gen.Dao) *userBehaviorDo { + u.DO = *do.(*gen.DO) + return u +} diff --git a/internal/repository/dao/user_project_relate.gen.go b/internal/repository/dao/user_project_relate.gen.go new file mode 100644 index 0000000..3fcf9d0 --- /dev/null +++ b/internal/repository/dao/user_project_relate.gen.go @@ -0,0 +1,351 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dao + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joybuywork/internal/repository/model" +) + +func newUserProjectRelate(db *gorm.DB, opts ...gen.DOOption) userProjectRelate { + _userProjectRelate := userProjectRelate{} + + _userProjectRelate.userProjectRelateDo.UseDB(db, opts...) + _userProjectRelate.userProjectRelateDo.UseModel(&model.UserProjectRelate{}) + + tableName := _userProjectRelate.userProjectRelateDo.TableName() + _userProjectRelate.ALL = field.NewAsterisk(tableName) + _userProjectRelate.ID = field.NewInt64(tableName, "id") + _userProjectRelate.CreatedAt = field.NewInt64(tableName, "created_at") + _userProjectRelate.UpdatedAt = field.NewInt64(tableName, "updated_at") + _userProjectRelate.IsDel = field.NewInt8(tableName, "is_del") + _userProjectRelate.UserID = field.NewInt64(tableName, "user_id") + _userProjectRelate.ProjectID = field.NewInt64(tableName, "project_id") + + _userProjectRelate.fillFieldMap() + + return _userProjectRelate +} + +type userProjectRelate struct { + userProjectRelateDo userProjectRelateDo + + ALL field.Asterisk + ID field.Int64 + CreatedAt field.Int64 + UpdatedAt field.Int64 + IsDel field.Int8 // 是否已删除(1-是,0-否) + UserID field.Int64 // 企业员工id(user表主键) + ProjectID field.Int64 // 项目id + + fieldMap map[string]field.Expr +} + +func (u userProjectRelate) Table(newTableName string) *userProjectRelate { + u.userProjectRelateDo.UseTable(newTableName) + return u.updateTableName(newTableName) +} + +func (u userProjectRelate) As(alias string) *userProjectRelate { + u.userProjectRelateDo.DO = *(u.userProjectRelateDo.As(alias).(*gen.DO)) + return u.updateTableName(alias) +} + +func (u *userProjectRelate) updateTableName(table string) *userProjectRelate { + u.ALL = field.NewAsterisk(table) + u.ID = field.NewInt64(table, "id") + u.CreatedAt = field.NewInt64(table, "created_at") + u.UpdatedAt = field.NewInt64(table, "updated_at") + u.IsDel = field.NewInt8(table, "is_del") + u.UserID = field.NewInt64(table, "user_id") + u.ProjectID = field.NewInt64(table, "project_id") + + u.fillFieldMap() + + return u +} + +func (u *userProjectRelate) WithContext(ctx context.Context) *userProjectRelateDo { + return u.userProjectRelateDo.WithContext(ctx) +} + +func (u userProjectRelate) TableName() string { return u.userProjectRelateDo.TableName() } + +func (u userProjectRelate) Alias() string { return u.userProjectRelateDo.Alias() } + +func (u *userProjectRelate) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := u.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (u *userProjectRelate) fillFieldMap() { + u.fieldMap = make(map[string]field.Expr, 6) + u.fieldMap["id"] = u.ID + u.fieldMap["created_at"] = u.CreatedAt + u.fieldMap["updated_at"] = u.UpdatedAt + u.fieldMap["is_del"] = u.IsDel + u.fieldMap["user_id"] = u.UserID + u.fieldMap["project_id"] = u.ProjectID +} + +func (u userProjectRelate) clone(db *gorm.DB) userProjectRelate { + u.userProjectRelateDo.ReplaceConnPool(db.Statement.ConnPool) + return u +} + +func (u userProjectRelate) replaceDB(db *gorm.DB) userProjectRelate { + u.userProjectRelateDo.ReplaceDB(db) + return u +} + +type userProjectRelateDo struct{ gen.DO } + +func (u userProjectRelateDo) Debug() *userProjectRelateDo { + return u.withDO(u.DO.Debug()) +} + +func (u userProjectRelateDo) WithContext(ctx context.Context) *userProjectRelateDo { + return u.withDO(u.DO.WithContext(ctx)) +} + +func (u userProjectRelateDo) ReadDB() *userProjectRelateDo { + return u.Clauses(dbresolver.Read) +} + +func (u userProjectRelateDo) WriteDB() *userProjectRelateDo { + return u.Clauses(dbresolver.Write) +} + +func (u userProjectRelateDo) Session(config *gorm.Session) *userProjectRelateDo { + return u.withDO(u.DO.Session(config)) +} + +func (u userProjectRelateDo) Clauses(conds ...clause.Expression) *userProjectRelateDo { + return u.withDO(u.DO.Clauses(conds...)) +} + +func (u userProjectRelateDo) Returning(value interface{}, columns ...string) *userProjectRelateDo { + return u.withDO(u.DO.Returning(value, columns...)) +} + +func (u userProjectRelateDo) Not(conds ...gen.Condition) *userProjectRelateDo { + return u.withDO(u.DO.Not(conds...)) +} + +func (u userProjectRelateDo) Or(conds ...gen.Condition) *userProjectRelateDo { + return u.withDO(u.DO.Or(conds...)) +} + +func (u userProjectRelateDo) Select(conds ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.Select(conds...)) +} + +func (u userProjectRelateDo) Where(conds ...gen.Condition) *userProjectRelateDo { + return u.withDO(u.DO.Where(conds...)) +} + +func (u userProjectRelateDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *userProjectRelateDo { + return u.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) +} + +func (u userProjectRelateDo) Order(conds ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.Order(conds...)) +} + +func (u userProjectRelateDo) Distinct(cols ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.Distinct(cols...)) +} + +func (u userProjectRelateDo) Omit(cols ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.Omit(cols...)) +} + +func (u userProjectRelateDo) Join(table schema.Tabler, on ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.Join(table, on...)) +} + +func (u userProjectRelateDo) LeftJoin(table schema.Tabler, on ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.LeftJoin(table, on...)) +} + +func (u userProjectRelateDo) RightJoin(table schema.Tabler, on ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.RightJoin(table, on...)) +} + +func (u userProjectRelateDo) Group(cols ...field.Expr) *userProjectRelateDo { + return u.withDO(u.DO.Group(cols...)) +} + +func (u userProjectRelateDo) Having(conds ...gen.Condition) *userProjectRelateDo { + return u.withDO(u.DO.Having(conds...)) +} + +func (u userProjectRelateDo) Limit(limit int) *userProjectRelateDo { + return u.withDO(u.DO.Limit(limit)) +} + +func (u userProjectRelateDo) Offset(offset int) *userProjectRelateDo { + return u.withDO(u.DO.Offset(offset)) +} + +func (u userProjectRelateDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *userProjectRelateDo { + return u.withDO(u.DO.Scopes(funcs...)) +} + +func (u userProjectRelateDo) Unscoped() *userProjectRelateDo { + return u.withDO(u.DO.Unscoped()) +} + +func (u userProjectRelateDo) Create(values ...*model.UserProjectRelate) error { + if len(values) == 0 { + return nil + } + return u.DO.Create(values) +} + +func (u userProjectRelateDo) CreateInBatches(values []*model.UserProjectRelate, batchSize int) error { + return u.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (u userProjectRelateDo) Save(values ...*model.UserProjectRelate) error { + if len(values) == 0 { + return nil + } + return u.DO.Save(values) +} + +func (u userProjectRelateDo) First() (*model.UserProjectRelate, error) { + if result, err := u.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.UserProjectRelate), nil + } +} + +func (u userProjectRelateDo) Take() (*model.UserProjectRelate, error) { + if result, err := u.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.UserProjectRelate), nil + } +} + +func (u userProjectRelateDo) Last() (*model.UserProjectRelate, error) { + if result, err := u.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.UserProjectRelate), nil + } +} + +func (u userProjectRelateDo) Find() ([]*model.UserProjectRelate, error) { + result, err := u.DO.Find() + return result.([]*model.UserProjectRelate), err +} + +func (u userProjectRelateDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.UserProjectRelate, err error) { + buf := make([]*model.UserProjectRelate, 0, batchSize) + err = u.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (u userProjectRelateDo) FindInBatches(result *[]*model.UserProjectRelate, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return u.DO.FindInBatches(result, batchSize, fc) +} + +func (u userProjectRelateDo) Attrs(attrs ...field.AssignExpr) *userProjectRelateDo { + return u.withDO(u.DO.Attrs(attrs...)) +} + +func (u userProjectRelateDo) Assign(attrs ...field.AssignExpr) *userProjectRelateDo { + return u.withDO(u.DO.Assign(attrs...)) +} + +func (u userProjectRelateDo) Joins(fields ...field.RelationField) *userProjectRelateDo { + for _, _f := range fields { + u = *u.withDO(u.DO.Joins(_f)) + } + return &u +} + +func (u userProjectRelateDo) Preload(fields ...field.RelationField) *userProjectRelateDo { + for _, _f := range fields { + u = *u.withDO(u.DO.Preload(_f)) + } + return &u +} + +func (u userProjectRelateDo) FirstOrInit() (*model.UserProjectRelate, error) { + if result, err := u.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.UserProjectRelate), nil + } +} + +func (u userProjectRelateDo) FirstOrCreate() (*model.UserProjectRelate, error) { + if result, err := u.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.UserProjectRelate), nil + } +} + +func (u userProjectRelateDo) FindByPage(offset int, limit int) (result []*model.UserProjectRelate, count int64, err error) { + result, err = u.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = u.Offset(-1).Limit(-1).Count() + return +} + +func (u userProjectRelateDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = u.Count() + if err != nil { + return + } + + err = u.Offset(offset).Limit(limit).Scan(result) + return +} + +func (u userProjectRelateDo) Scan(result interface{}) (err error) { + return u.DO.Scan(result) +} + +func (u userProjectRelateDo) Delete(models ...*model.UserProjectRelate) (result gen.ResultInfo, err error) { + return u.DO.Delete(models) +} + +func (u *userProjectRelateDo) withDO(do gen.Dao) *userProjectRelateDo { + u.DO = *do.(*gen.DO) + return u +} diff --git a/internal/repository/dbcheck/db_check.go b/internal/repository/dbcheck/db_check.go new file mode 100644 index 0000000..a26178d --- /dev/null +++ b/internal/repository/dbcheck/db_check.go @@ -0,0 +1,27 @@ +package dbcheck + +import ( + "errors" + grds "github.com/go-redis/redis/v8" + "gorm.io/gorm" +) + +// DbError 是否是要直接返回的db错误 (gorm.ErrRecordNotFound is not a error) +func DbError(err error) error { + //没找到不算一个错误,判断返回结构体未nil来做处理 + if errors.Is(err, gorm.ErrRecordNotFound) { + return nil + } + + return err +} + +// RdError 是否是要直接返回的redis错误 (grds.Nil is not a error) +func RdError(err error) error { + //没找到不算一个错误,判断返回结构体未nil来做处理 + if errors.Is(err, grds.Nil) { + return nil + } + + return err +} diff --git a/internal/repository/dbcheck/db_check_test.go b/internal/repository/dbcheck/db_check_test.go new file mode 100644 index 0000000..27b447f --- /dev/null +++ b/internal/repository/dbcheck/db_check_test.go @@ -0,0 +1,15 @@ +package dbcheck + +import ( + "gorm.io/gorm" + "testing" +) + +func TestDbError(t *testing.T) { + + var err = gorm.ErrRecordNotFound + + t.Log(DbError(err)) + + t.Log(err) +} diff --git a/internal/repository/finder/finder.go b/internal/repository/finder/finder.go new file mode 100644 index 0000000..ae665ea --- /dev/null +++ b/internal/repository/finder/finder.go @@ -0,0 +1,98 @@ +package finder + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "reflect" +) + +// User 用户id类型字段找一条数据 +// +// params: val id, hash_id +func User(ctx context.Context, val ...any) (*model.User, error) { + cu := cache.NewUser(ctx) + for _, v := range val { + kind := reflect.TypeOf(v).Kind() + if kind == reflect.Int64 && v.(int64) > 0 { + return cu.FindById(v.(int64)) + } + + if kind == reflect.String && v.(string) != "" { + return cu.FindByHashId(v.(string)) + } + } + return nil, nil +} + +// Project 项目id类型字段找一条数据 +// +// params: val id, hash_id +func Project(ctx context.Context, val ...any) (*model.Project, error) { + cu := cache.NewProject(ctx) + for _, v := range val { + kind := reflect.TypeOf(v).Kind() + if kind == reflect.Int64 && v.(int64) > 0 { + return cu.FindById(v.(int64)) + } + + if kind == reflect.String && v.(string) != "" { + return cu.FindByHashId(v.(string)) + } + } + return nil, nil +} + +// Campaign 活动id类型字段找一条数据 +// +// params: val id, link_hash_id +func Campaign(ctx context.Context, val ...any) (*model.FissionCampaign, error) { + cu := cache.NewCampaign(ctx) + for _, v := range val { + kind := reflect.TypeOf(v).Kind() + if kind == reflect.Int64 && v.(int64) > 0 { + return cu.FindById(v.(int64)) + } + + if kind == reflect.String && v.(string) != "" { + return cu.FindByHashId(v.(string)) + } + } + return nil, nil +} + +// FissionUser 参与用户id类型字段找一条数据 +// +// params: val id, link_hash_id +func FissionUser(ctx context.Context, campaignId int64, val ...any) (*model.FissionUser, error) { + cu := cache.NewFissionUser(ctx, campaignId) + for _, v := range val { + kind := reflect.TypeOf(v).Kind() + if kind == reflect.Int64 && v.(int64) > 0 { + return cu.FindById(v.(int64)) + } + + if kind == reflect.String && v.(string) != "" { + return cu.FindByHashId(v.(string)) + } + } + return nil, nil +} + +// FissionTemp 参与用户id类型字段找一条数据 +// +// params: val id, link_hash_id +func FissionTemp(ctx context.Context, val ...any) (*model.FissionTemp, error) { + cu := cache.NewFissionTemp(ctx) + for _, v := range val { + kind := reflect.TypeOf(v).Kind() + if kind == reflect.Int64 && v.(int64) > 0 { + return cu.FindById(v.(int64)) + } + + if kind == reflect.String && v.(string) != "" { + return cu.FindByHashId(v.(string)) + } + } + return nil, nil +} diff --git a/internal/repository/finder/fuser_layer.go b/internal/repository/finder/fuser_layer.go new file mode 100644 index 0000000..63fe0ea --- /dev/null +++ b/internal/repository/finder/fuser_layer.go @@ -0,0 +1,216 @@ +package finder + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "fmt" + "strings" +) + +type IFuserLayer interface { + DST() (dft, spt string) // 默认支持数据,所有支持数据 +} + +type FuserLayer struct { + rewardGroup int8 + + lang Lang + level Level + langLevel LangLevel + country Country +} + +// NewFuserLayer 用户分层结构 +func NewFuserLayer(conf *model.FissionCampaignConfig) (ful FuserLayer) { + switch conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel: + ful.level.Default = utils.StrToInt64(conf.DefaultRewardMark) + var srm = strings.Split(conf.SupportRewardMark, ",") + ful.level.Support = make([]int64, 0, len(srm)) + for _, v := range srm { + ful.level.Support = append(ful.level.Support, utils.StrToInt64(v)) + } + case mtype.FissionRewardGroupLang: + ful.lang.Support = strings.Split(conf.SupportRewardMark, ",") + ful.lang.Default = conf.DefaultRewardMark + case mtype.FissionRewardGroupLangAndUserLevel: + var dfs = strings.Split(conf.DefaultRewardMark, ",") + ful.langLevel.Default = make([]DefaultLangLevel, 0, len(dfs)) + for _, v := range dfs { + lang, level, _ := strings.Cut(v, "_") + ful.langLevel.Default = append(ful.langLevel.Default, DefaultLangLevel{ + Lang: lang, + Level: utils.StrToInt64(level), + }) + } + + var srm = strings.Split(conf.SupportRewardMark, ";") + ful.langLevel.Support = make([]SupportLangLevel, 0, len(srm)) + for _, v := range srm { + lang, levels, _ := strings.Cut(v, "=") + + one := SupportLangLevel{ + Lang: lang, + Level: make([]int64, 0, len(levels)), + } + + uls := strings.Split(levels, ",") + for _, ul := range uls { + one.Level = append(one.Level, utils.StrToInt64(ul)) + } + + ful.langLevel.Support = append(ful.langLevel.Support, one) + } + case mtype.FissionRewardGroupCountry: + ful.country.Support = strings.Split(conf.SupportRewardMark, ",") + ful.country.Default = conf.DefaultRewardMark + case mtype.FissionRewardGroupNormal: + + } + + ful.rewardGroup = conf.RewardGroup + return +} + +func (s *FuserLayer) Lang() Lang { return s.lang } +func (s *FuserLayer) Level() Level { return s.level } +func (s *FuserLayer) LangLevel() LangLevel { return s.langLevel } +func (s *FuserLayer) Country() Country { return s.country } + +// GetFirstSupportLang 获取首层的语言支持 +func (s *FuserLayer) GetFirstSupportLang() []string { + switch s.rewardGroup { + case mtype.FissionRewardGroupLang: + return s.lang.Support + case mtype.FissionRewardGroupLangAndUserLevel: + var spt = make([]string, 0, len(s.langLevel.Support)) + for _, v := range s.langLevel.Support { + spt = append(spt, v.Lang) + } + return spt + } + return nil +} + +type Lang struct { + Default string + Support []string +} + +func (s Lang) DST() (dft, spt string) { return s.Default, split(s.Support, ",") } + +func (s Lang) Selected(lang string) (string, bool) { + for _, v := range s.Support { + if v == lang { + return lang, false + } + } + + return s.Default, true +} + +type Level struct { + Default int64 + Support []int64 +} + +func (s Level) DST() (dft, spt string) { return fmt.Sprint(s.Default), split(s.Support, ",") } + +func (s Level) Selected(level int64) (int64, bool) { + for _, v := range s.Support { + if v == level { + return level, false + } + } + + return s.Default, true +} + +type DefaultLangLevel struct { + Lang string + Level int64 +} +type SupportLangLevel struct { + Lang string + Level []int64 +} + +type LangLevel struct { + Default []DefaultLangLevel + Support []SupportLangLevel +} + +func (s LangLevel) DST() (dft, spt string) { + for _, v := range s.Default { + dft += fmt.Sprintf("%s_%d,", v.Lang, v.Level) + } + + for _, v := range s.Support { + spt += fmt.Sprintf("%s=%s;", v.Lang, split(v.Level, ",")) + } + + return strings.TrimSuffix(dft, ","), strings.TrimSuffix(spt, ";") +} + +func (s LangLevel) Selected(lang string, level int64) (alang string, alevel int64, dflang, dflevel bool) { + alang, dflang = s.GetLang(lang) + + alevel, dflevel = s.GetLevel(alang, level) + return +} + +func (s LangLevel) GetLang(lang string) (string, bool) { + for _, v := range s.Default { + if v.Lang == lang { + return v.Lang, false + } + } + + return s.Default[0].Lang, true +} + +func (s LangLevel) GetLevel(lang string, level int64) (int64, bool) { + for _, v := range s.Support { + if v.Lang != lang { + continue + } + + for _, lv := range v.Level { + if lv == level { + return lv, false + } + } + + return v.Level[0], true + } + + return s.Default[0].Level, true +} + +type Country struct { + Default string + Support []string +} + +func (s Country) DST() (dft, spt string) { return s.Default, split(s.Support, ",") } + +func (s Country) Selected(country string) (string, bool) { + for _, v := range s.Support { + if v == country { + return country, false + } + } + + return s.Default, true +} + +func split[T any](vals []T, sep string) (st string) { + if len(vals) == 0 { + return + } + for _, v := range vals { + st += fmt.Sprintf("%v%s", v, sep) + } + return strings.TrimSuffix(st, sep) +} diff --git a/internal/repository/model/company.gen.go b/internal/repository/model/company.gen.go new file mode 100644 index 0000000..e71a595 --- /dev/null +++ b/internal/repository/model/company.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameCompany = "company" + +// Company mapped from table +type Company struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(18);not null;comment:对外id" json:"hash_id"` + Uscid string `gorm:"column:uscid;type:varchar(255);not null;comment:营业执照编号" json:"uscid"` + ShortName string `gorm:"column:short_name;type:varchar(128);not null;comment:企业简称" json:"short_name"` + Phone string `gorm:"column:phone;type:varchar(18);not null;comment:申请通过后公司显示手机号" json:"phone"` + AppName string `gorm:"column:app_name;type:varchar(255);not null;comment:申请通过后公司站点名称" json:"app_name"` + FullName string `gorm:"column:full_name;type:varchar(255);not null;comment:企业全称" json:"full_name"` + IsCert int8 `gorm:"column:is_cert;type:tinyint;not null;comment:是否为认证企业(0-否,1-是)" json:"is_cert"` +} + +// TableName Company's table name +func (*Company) TableName() string { + return TableNameCompany +} diff --git a/internal/repository/model/company_made.gen.go b/internal/repository/model/company_made.gen.go new file mode 100644 index 0000000..2fd65b8 --- /dev/null +++ b/internal/repository/model/company_made.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameCompanyMade = "company_made" + +// CompanyMade mapped from table +type CompanyMade struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CompanyID int64 `gorm:"column:company_id;type:bigint;not null;uniqueIndex:uniq_company_id_mark,priority:1;comment:企业id" json:"company_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_company_id_mark,priority:2;comment:功能标识" json:"mark"` + Params string `gorm:"column:params;type:varchar(255);not null;comment:参数" json:"params"` +} + +// TableName CompanyMade's table name +func (*CompanyMade) TableName() string { + return TableNameCompanyMade +} diff --git a/internal/repository/model/company_made.go b/internal/repository/model/company_made.go new file mode 100644 index 0000000..bc523be --- /dev/null +++ b/internal/repository/model/company_made.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (m *CompanyMade) SetParams(val any) { + m.Params, _ = jsonm.MarshalToString(val) +} + +func (m *CompanyMade) GetFissionTemp() (val []string) { + _ = jsonm.StrUnmarshal(m.Params, &val) + return +} diff --git a/internal/repository/model/cron_log.gen.go b/internal/repository/model/cron_log.gen.go new file mode 100644 index 0000000..36c4df7 --- /dev/null +++ b/internal/repository/model/cron_log.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameCronLog = "cron_log" + +// CronLog mapped from table +type CronLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + ExecAt int64 `gorm:"column:exec_at;type:bigint;not null;index:idx_exec_at_status,priority:1;comment:执行时间" json:"exec_at"` + Desc string `gorm:"column:desc;type:varchar(64);not null;index:idx_desc_exec_at,priority:1;comment:执行任务" json:"desc"` + Machine string `gorm:"column:machine;type:varchar(32);not null;comment:执行机器IP" json:"machine"` + Total int64 `gorm:"column:total;type:bigint;not null;comment:处理总数据行数" json:"total"` + SuccessNum int64 `gorm:"column:success_num;type:bigint;not null;comment:成功总数据行数" json:"success_num"` + FailNum int64 `gorm:"column:fail_num;type:bigint;not null;comment:失败总数据行数" json:"fail_num"` + ExecStatus int8 `gorm:"column:exec_status;type:tinyint;not null;index:idx_exec_at_status,priority:2;comment:执行状态(1-成功,2-失败)" json:"exec_status"` + ExecFail string `gorm:"column:exec_fail;type:varchar(255);not null;comment:执行错误信息" json:"exec_fail"` + EndAt int64 `gorm:"column:end_at;type:bigint;not null;comment:结束时间" json:"end_at"` +} + +// TableName CronLog's table name +func (*CronLog) TableName() string { + return TableNameCronLog +} diff --git a/internal/repository/model/err_log.gen.go b/internal/repository/model/err_log.gen.go new file mode 100644 index 0000000..af17cea --- /dev/null +++ b/internal/repository/model/err_log.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameErrLog = "err_log" + +// ErrLog mapped from table +type ErrLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_created_at,priority:1" json:"created_at"` + APIURL string `gorm:"column:api_url;type:varchar(64);not null;index:idx_api_url,priority:1;comment:请求的接口" json:"api_url"` + Data string `gorm:"column:data;type:text;not null;comment:请求数据" json:"data"` + LinkURL string `gorm:"column:link_url;type:varchar(500);not null;comment:当前页面地址" json:"link_url"` + Msg string `gorm:"column:msg;type:varchar(255);not null;comment:返回数据" json:"msg"` +} + +// TableName ErrLog's table name +func (*ErrLog) TableName() string { + return TableNameErrLog +} diff --git a/internal/repository/model/export_task.gen.go b/internal/repository/model/export_task.gen.go new file mode 100644 index 0000000..ba5651f --- /dev/null +++ b/internal/repository/model/export_task.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameExportTask = "export_task" + +// ExportTask mapped from table +type ExportTask struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_Id,priority:1;comment:对外id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;comment:用户ID(user表主键)" json:"user_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;comment:导出标识" json:"mark"` + Cond string `gorm:"column:cond;type:varchar(1000);not null;comment:条件数据" json:"cond"` + EptStatus int8 `gorm:"column:ept_status;type:tinyint;not null;comment:状态(1-导出中,2-导出成功,3-导出失败,4-已过期)" json:"ept_status"` + ExpiredAt int64 `gorm:"column:expired_at;type:bigint;not null;index:idx_expired_at,priority:1;comment:文件过期时间(0-不过期)" json:"expired_at"` + Filename string `gorm:"column:filename;type:varchar(255);not null;comment:文件存储名称" json:"filename"` + FailMsg string `gorm:"column:fail_msg;type:varchar(255);not null;comment:导出失败原因" json:"fail_msg"` +} + +// TableName ExportTask's table name +func (*ExportTask) TableName() string { + return TableNameExportTask +} diff --git a/internal/repository/model/fission_action.gen.go b/internal/repository/model/fission_action.gen.go new file mode 100644 index 0000000..614ba21 --- /dev/null +++ b/internal/repository/model/fission_action.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionAction = "fission_action" + +// FissionAction mapped from table +type FissionAction struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_type_user_mark,priority:1;comment:活动id" json:"campaign_id"` + UserMark string `gorm:"column:user_mark;type:varchar(20);not null;index:idx_campaign_id_type_user_mark,priority:3;comment:用户唯一标识" json:"user_mark"` + UserMarkSource int8 `gorm:"column:user_mark_source;type:tinyint;not null;comment:用户标识来源(1-fission_user表,2-ua头获得的id)" json:"user_mark_source"` + Type int32 `gorm:"column:type;type:int;not null;index:idx_campaign_id_type_user_mark,priority:2;comment:用户行为类型" json:"type"` + ActionTime int64 `gorm:"column:action_time;type:bigint;not null;index:idx_campaign_id_type_action_time,priority:3;comment:用户行为时间" json:"action_time"` + Dimension string `gorm:"column:dimension;type:json;not null;comment:维度数据" json:"dimension"` + OtherData string `gorm:"column:other_data;type:varchar(2000);not null;comment:其他数据(如自定义数据,用户标识计算的原始数据)" json:"other_data"` +} + +// TableName FissionAction's table name +func (*FissionAction) TableName() string { + return TableNameFissionAction +} diff --git a/internal/repository/model/fission_action.go b/internal/repository/model/fission_action.go new file mode 100644 index 0000000..ab539d7 --- /dev/null +++ b/internal/repository/model/fission_action.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionAction) SetDimension(val *mtype.Dimension) { + m.Dimension, _ = jsonm.MarshalToString(val) +} + +func (m *FissionAction) GetDimension() (val mtype.Dimension) { + _ = jsonm.StrUnmarshal(m.Dimension, &val) + return +} diff --git a/internal/repository/model/fission_archive_task.gen.go b/internal/repository/model/fission_archive_task.gen.go new file mode 100644 index 0000000..6efbc37 --- /dev/null +++ b/internal/repository/model/fission_archive_task.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionArchiveTask = "fission_archive_task" + +// FissionArchiveTask mapped from table +type FissionArchiveTask struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:uniq_campaign_id_mark,priority:1;comment:活动id" json:"campaign_id"` + EndTime int64 `gorm:"column:end_time;type:bigint;not null;index:idx_end_time_mark,priority:1;comment:任务结束时间" json:"end_time"` + Mark string `gorm:"column:mark;type:varchar(30);not null;index:uniq_campaign_id_mark,priority:2;comment:任务标识" json:"mark"` + IsStop int8 `gorm:"column:is_stop;type:tinyint;not null;comment:是否停止统计(0-否,1-是)" json:"is_stop"` +} + +// TableName FissionArchiveTask's table name +func (*FissionArchiveTask) TableName() string { + return TableNameFissionArchiveTask +} diff --git a/internal/repository/model/fission_ballot.gen.go b/internal/repository/model/fission_ballot.gen.go new file mode 100644 index 0000000..3dbcf8a --- /dev/null +++ b/internal/repository/model/fission_ballot.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionBallot = "fission_ballot" + +// FissionBallot mapped from table +type FissionBallot struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽签数" json:"chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽签数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionBallot's table name +func (*FissionBallot) TableName() string { + return TableNameFissionBallot +} diff --git a/internal/repository/model/fission_ballot_log.gen.go b/internal/repository/model/fission_ballot_log.gen.go new file mode 100644 index 0000000..f302743 --- /dev/null +++ b/internal/repository/model/fission_ballot_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionBallotLog = "fission_ballot_log" + +// FissionBallotLog mapped from table +type FissionBallotLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + BallotID int64 `gorm:"column:ballot_id;type:bigint;not null;index:idx_ballot_id_type_created_at,priority:1;comment:玩家id(fission_ballot表id)" json:"ballot_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_ballot_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionBallotLog's table name +func (*FissionBallotLog) TableName() string { + return TableNameFissionBallotLog +} diff --git a/internal/repository/model/fission_behavior.gen.go b/internal/repository/model/fission_behavior.gen.go new file mode 100644 index 0000000..da3aa42 --- /dev/null +++ b/internal/repository/model/fission_behavior.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionBehavior = "fission_behavior" + +// FissionBehavior mapped from table +type FissionBehavior struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + BehaviorType int32 `gorm:"column:behavior_type;type:int;not null;index:idx_campaign_behavior,priority:2;comment:用户行为类型" json:"behavior_type"` + BehaviorTime int64 `gorm:"column:behavior_time;type:bigint;not null;index:idx_campaign_id_mark_behavior_time,priority:3;comment:用户行为时间" json:"behavior_time"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_mark_user_mark,priority:1;comment:活动id" json:"campaign_id"` + UserMark string `gorm:"column:user_mark;type:char(32);not null;index:idx_campaign_id_mark_user_mark,priority:3;comment:用户唯一标识(用户ip,os,os_version,device_model的顺序哈希值)" json:"user_mark"` + OtherData string `gorm:"column:other_data;type:varchar(2000);not null;comment:其他数据(如自定义事件行为时,存的自定义事件的数据)" json:"other_data"` + Mark string `gorm:"column:mark;type:varchar(32);not null;index:idx_campaign_id_mark_user_mark,priority:2;comment:用户行为标识" json:"mark"` +} + +// TableName FissionBehavior's table name +func (*FissionBehavior) TableName() string { + return TableNameFissionBehavior +} diff --git a/internal/repository/model/fission_blind.gen.go b/internal/repository/model/fission_blind.gen.go new file mode 100644 index 0000000..1692da0 --- /dev/null +++ b/internal/repository/model/fission_blind.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionBlind = "fission_blind" + +// FissionBlind mapped from table +type FissionBlind struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的抽奖次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的次数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionBlind's table name +func (*FissionBlind) TableName() string { + return TableNameFissionBlind +} diff --git a/internal/repository/model/fission_blind_log.gen.go b/internal/repository/model/fission_blind_log.gen.go new file mode 100644 index 0000000..4b878e8 --- /dev/null +++ b/internal/repository/model/fission_blind_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionBlindLog = "fission_blind_log" + +// FissionBlindLog mapped from table +type FissionBlindLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + BlindID int64 `gorm:"column:blind_id;type:bigint;not null;index:idx_blind_id_type_created_at,priority:1;comment:玩家id(fission_prize_wheel表id)" json:"blind_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_blind_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionBlindLog's table name +func (*FissionBlindLog) TableName() string { + return TableNameFissionBlindLog +} diff --git a/internal/repository/model/fission_blind_log.go b/internal/repository/model/fission_blind_log.go new file mode 100644 index 0000000..9173c0b --- /dev/null +++ b/internal/repository/model/fission_blind_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionBlindLog) SetVal(val mtype.LotteryLogVal) { + m.Val, _ = jsonm.MarshalToString(val) +} + +func (m *FissionBlindLog) GetVal() (val mtype.LotteryLogVal) { + _ = jsonm.StrUnmarshal(m.Val, &val) + return +} diff --git a/internal/repository/model/fission_blind_lucky.gen.go b/internal/repository/model/fission_blind_lucky.gen.go new file mode 100644 index 0000000..7c62a52 --- /dev/null +++ b/internal/repository/model/fission_blind_lucky.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionBlindLucky = "fission_blind_lucky" + +// FissionBlindLucky mapped from table +type FissionBlindLucky struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外hash_id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Win int8 `gorm:"column:win;type:tinyint;not null;comment:是否中奖(1-是,0-否)" json:"win"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品ID" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionBlindLucky's table name +func (*FissionBlindLucky) TableName() string { + return TableNameFissionBlindLucky +} diff --git a/internal/repository/model/fission_campaign.gen.go b/internal/repository/model/fission_campaign.gen.go new file mode 100644 index 0000000..b4f722f --- /dev/null +++ b/internal/repository/model/fission_campaign.gen.go @@ -0,0 +1,40 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaign = "fission_campaign" + +// FissionCampaign mapped from table +type FissionCampaign struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(25);not null;index:idx_link_hash_id,priority:1;comment:活动对外hash_id" json:"hash_id"` + FissionID int64 `gorm:"column:fission_id;type:bigint;not null;index:idx_project_id_fission_id,priority:2;comment:玩法ID(fission表主键)" json:"fission_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_fission_id,priority:1;comment:项目ID(clintproject表主键)" json:"project_id"` + CreatorID int64 `gorm:"column:creator_id;type:bigint;not null;comment:创建用户ID(user表主键)" json:"creator_id"` + LanguagePkgID int64 `gorm:"column:language_pkg_id;type:bigint;not null;comment:语言包ID(languagepackage表主键)" json:"language_pkg_id"` + TemplateID int64 `gorm:"column:template_id;type:bigint;not null;comment:活动模板ID" json:"template_id"` + Title string `gorm:"column:title;type:varchar(35);not null;comment:活动标题" json:"title"` + Status int8 `gorm:"column:status;type:tinyint;not null;comment:发布状态(1-待发布,2-已发布,3-已下线)" json:"status"` + StartTime int64 `gorm:"column:start_time;type:bigint;not null;index:idx_start_time,priority:1;comment:开始时间" json:"start_time"` + EndTime int64 `gorm:"column:end_time;type:bigint;not null;index:idx_end_time,priority:1;comment:结束时间" json:"end_time"` + CoverURL string `gorm:"column:cover_url;type:varchar(128);not null;comment:活动封面图" json:"cover_url"` + TOffset int32 `gorm:"column:t_offset;type:int;not null;comment:时间偏移量" json:"t_offset"` + TStart int64 `gorm:"column:t_start;type:bigint;not null;comment:提交的开始时间(+8时区算出来的时间戳)" json:"t_start"` + TEnd int64 `gorm:"column:t_end;type:bigint;not null;comment:提交的结束时间(+8时区算出来的时间戳)" json:"t_end"` + LangTypes string `gorm:"column:lang_types;type:varchar(255);not null;comment:支持的语种标识" json:"lang_types"` + Target int8 `gorm:"column:target;type:tinyint;not null;comment:活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告;5-子活动)" json:"target"` + ReportType int8 `gorm:"column:report_type;type:tinyint;not null;comment:报表类型(1-旧版报表,2-广告报表,3-新版活动内报表)" json:"report_type"` + PreToRun int64 `gorm:"column:pre_to_run;type:bigint;not null;index:idx_pre_to_run,priority:1;comment:预发布转正式时间" json:"pre_to_run"` + Pid int64 `gorm:"column:pid;type:bigint;not null;index:idx_pid,priority:1;comment:上级活动id" json:"pid"` + ChildType int8 `gorm:"column:child_type;type:tinyint;not null;comment:子活动类型" json:"child_type"` +} + +// TableName FissionCampaign's table name +func (*FissionCampaign) TableName() string { + return TableNameFissionCampaign +} diff --git a/internal/repository/model/fission_campaign.go b/internal/repository/model/fission_campaign.go new file mode 100644 index 0000000..8504b75 --- /dev/null +++ b/internal/repository/model/fission_campaign.go @@ -0,0 +1,39 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCampaign) SetLangTypes(val []int8) { + s.LangTypes, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaign) GetLangTypes() (val []int8) { + _ = jsonm.StrUnmarshal(s.LangTypes, &val) + return +} + +func (s *FissionCampaign) GetLangMarks() (val []string) { + for _, v := range s.GetLangTypes() { + val = append(val, mtype.FissionLangTypeToMark[v]) + } + return +} + +func (s *FissionCampaign) GetDefaultLangType() int8 { + langTypes := s.GetLangTypes() + if len(langTypes) == 0 { + return 0 + } + return langTypes[0] +} + +func (s *FissionCampaign) GetDefaultLangMark() string { + return mtype.FissionLangTypeToMark[s.GetDefaultLangType()] +} + +// IsPub 是否已经发布了 +func (s *FissionCampaign) IsPub() bool { + return s.Status == mtype.FissionCampaignStatusPub || s.Status == mtype.FissionCampaignStatusPubPre +} diff --git a/internal/repository/model/fission_campaign_ballot.gen.go b/internal/repository/model/fission_campaign_ballot.gen.go new file mode 100644 index 0000000..9059063 --- /dev/null +++ b/internal/repository/model/fission_campaign_ballot.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignBallot = "fission_campaign_ballot" + +// FissionCampaignBallot mapped from table +type FissionCampaignBallot struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始抽签数" json:"init_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽签数" json:"day_chance"` +} + +// TableName FissionCampaignBallot's table name +func (*FissionCampaignBallot) TableName() string { + return TableNameFissionCampaignBallot +} diff --git a/internal/repository/model/fission_campaign_blind.gen.go b/internal/repository/model/fission_campaign_blind.gen.go new file mode 100644 index 0000000..617a525 --- /dev/null +++ b/internal/repository/model/fission_campaign_blind.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignBlind = "fission_campaign_blind" + +// FissionCampaignBlind mapped from table +type FissionCampaignBlind struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始答题机会次数" json:"init_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的抽奖机会次数" json:"chance"` + Odds int32 `gorm:"column:odds;type:int;not null;comment:中奖概率" json:"odds"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽奖次数" json:"day_chance"` +} + +// TableName FissionCampaignBlind's table name +func (*FissionCampaignBlind) TableName() string { + return TableNameFissionCampaignBlind +} diff --git a/internal/repository/model/fission_campaign_blind_reward.gen.go b/internal/repository/model/fission_campaign_blind_reward.gen.go new file mode 100644 index 0000000..dbc00ea --- /dev/null +++ b/internal/repository/model/fission_campaign_blind_reward.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignBlindReward = "fission_campaign_blind_reward" + +// FissionCampaignBlindReward mapped from table +type FissionCampaignBlindReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + BlindID int64 `gorm:"column:blind_id;type:bigint;not null;index:idx_ blind_id,priority:1;comment:盲盒配置ID(fission_campaign_blind主键)" json:"blind_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + Stock int32 `gorm:"column:stock;type:int;not null;comment:奖品库存" json:"stock"` + JumpURL string `gorm:"column:jump_url;type:varchar(255);not null;comment:跳转链接" json:"jump_url"` + CustomParams string `gorm:"column:custom_params;type:varchar(2000);not null;comment:自定义参数" json:"custom_params"` + UseStock int32 `gorm:"column:use_stock;type:int;not null;comment:已发放奖品数" json:"use_stock"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionCampaignBlindReward's table name +func (*FissionCampaignBlindReward) TableName() string { + return TableNameFissionCampaignBlindReward +} diff --git a/internal/repository/model/fission_campaign_cash.gen.go b/internal/repository/model/fission_campaign_cash.gen.go new file mode 100644 index 0000000..06e1535 --- /dev/null +++ b/internal/repository/model/fission_campaign_cash.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignCash = "fission_campaign_cash" + +// FissionCampaignCash mapped from table +type FissionCampaignCash struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + ExpiredDay int32 `gorm:"column:expired_day;type:int;not null;comment:任务重置天数" json:"expired_day"` + Price int32 `gorm:"column:price;type:int;not null;comment:单位奖品总价值" json:"price"` + PriceNum int32 `gorm:"column:price_num;type:int;not null;comment:奖品总份额" json:"price_num"` + Lack int8 `gorm:"column:lack;type:tinyint;not null;comment:缺乏库存" json:"lack"` + Currency int8 `gorm:"column:currency;type:tinyint;not null;default:1;comment:货币单位" json:"currency"` + LoopNum int32 `gorm:"column:loop_num;type:int;not null;comment:用户可循环次数" json:"loop_num"` +} + +// TableName FissionCampaignCash's table name +func (*FissionCampaignCash) TableName() string { + return TableNameFissionCampaignCash +} diff --git a/internal/repository/model/fission_campaign_channel.gen.go b/internal/repository/model/fission_campaign_channel.gen.go new file mode 100644 index 0000000..7aa0990 --- /dev/null +++ b/internal/repository/model/fission_campaign_channel.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignChannel = "fission_campaign_channel" + +// FissionCampaignChannel mapped from table +type FissionCampaignChannel struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + IsDefault int8 `gorm:"column:is_default;type:tinyint;not null;comment:是否是默认值(0-否,1-是)" json:"is_default"` + Mark string `gorm:"column:mark;type:char(2);not null;uniqueIndex:uniq_campaign_id_mark,priority:2;comment:渠道标识" json:"mark"` + Title string `gorm:"column:title;type:varchar(128);not null;comment:渠道名称" json:"title"` + CType int8 `gorm:"column:c_type;type:tinyint;not null;comment:渠道类型(1-站内渠道,2-站外渠道)" json:"c_type"` + Code string `gorm:"column:code;type:varchar(20);not null;comment:口令字符串" json:"code"` + ShortLink string `gorm:"column:short_link;type:varchar(255);not null;comment:短链地址" json:"short_link"` +} + +// TableName FissionCampaignChannel's table name +func (*FissionCampaignChannel) TableName() string { + return TableNameFissionCampaignChannel +} diff --git a/internal/repository/model/fission_campaign_chat.gen.go b/internal/repository/model/fission_campaign_chat.gen.go new file mode 100644 index 0000000..b5bd48b --- /dev/null +++ b/internal/repository/model/fission_campaign_chat.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignChat = "fission_campaign_chat" + +// FissionCampaignChat mapped from table +type FissionCampaignChat struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:uniq_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + HeaderImg string `gorm:"column:header_img;type:varchar(128);not null;comment:头像地址" json:"header_img"` + ChatBg string `gorm:"column:chat_bg;type:varchar(128);not null;comment:聊天背景图" json:"chat_bg"` + DayLimit int32 `gorm:"column:day_limit;type:int;not null;comment:每日聊天上限" json:"day_limit"` +} + +// TableName FissionCampaignChat's table name +func (*FissionCampaignChat) TableName() string { + return TableNameFissionCampaignChat +} diff --git a/internal/repository/model/fission_campaign_child.gen.go b/internal/repository/model/fission_campaign_child.gen.go new file mode 100644 index 0000000..74ff0ff --- /dev/null +++ b/internal/repository/model/fission_campaign_child.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignChild = "fission_campaign_child" + +// FissionCampaignChild mapped from table +type FissionCampaignChild struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:uniq_campaign_id_type,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + ChildID int64 `gorm:"column:child_id;type:bigint;not null;index:idx_child_id,priority:1;comment:子活动id(fission_campaign表)" json:"child_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:uniq_campaign_id_type,priority:2;comment:活动类型" json:"type"` +} + +// TableName FissionCampaignChild's table name +func (*FissionCampaignChild) TableName() string { + return TableNameFissionCampaignChild +} diff --git a/internal/repository/model/fission_campaign_chop.gen.go b/internal/repository/model/fission_campaign_chop.gen.go new file mode 100644 index 0000000..a004cb9 --- /dev/null +++ b/internal/repository/model/fission_campaign_chop.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignChop = "fission_campaign_chop" + +// FissionCampaignChop mapped from table +type FissionCampaignChop struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + ShowBar int8 `gorm:"column:show_bar;type:tinyint;not null;comment:是否显示进度条(1-是,0-否)" json:"show_bar"` + HelpRule int8 `gorm:"column:help_rule;type:tinyint;not null;default:1;comment:助力规则(1-助力行为奖品唯一,2-助力行为用户唯一)" json:"help_rule"` +} + +// TableName FissionCampaignChop's table name +func (*FissionCampaignChop) TableName() string { + return TableNameFissionCampaignChop +} diff --git a/internal/repository/model/fission_campaign_coin.gen.go b/internal/repository/model/fission_campaign_coin.gen.go new file mode 100644 index 0000000..1d1041b --- /dev/null +++ b/internal/repository/model/fission_campaign_coin.gen.go @@ -0,0 +1,33 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignCoin = "fission_campaign_coin" + +// FissionCampaignCoin mapped from table +type FissionCampaignCoin struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + CoinImg string `gorm:"column:coin_img;type:varchar(128);not null;comment:金币图片" json:"coin_img"` + OpenDays int32 `gorm:"column:open_days;type:int;not null;comment:开奖天数" json:"open_days"` + OpenLimit int32 `gorm:"column:open_limit;type:int;not null;comment:开奖次数限制" json:"open_limit"` + InitCoin int32 `gorm:"column:init_coin;type:int;not null;comment:初始金币数" json:"init_coin"` + InitUse int32 `gorm:"column:init_use;type:int;not null;comment:初始投放次数" json:"init_use"` + UseCoin int32 `gorm:"column:use_coin;type:int;not null;comment:单次投放消耗金币数" json:"use_coin"` + UseLimit int32 `gorm:"column:use_limit;type:int;not null;comment:单次瓜分最多投放次数" json:"use_limit"` + URLID int64 `gorm:"column:url_id;type:bigint;not null;comment:回调地址id" json:"url_id"` + LackBtn string `gorm:"column:lack_btn;type:varchar(255);not null;comment:金币不足展示的按钮(1-做任务,2-自定义按钮)" json:"lack_btn"` + CustomBtnText string `gorm:"column:custom_btn_text;type:varchar(64);not null;comment:自定义按钮文案" json:"custom_btn_text"` + CustomWebURL string `gorm:"column:custom_web_url;type:varchar(255);not null;comment:自定义web端url" json:"custom_web_url"` + CustomExtraParam string `gorm:"column:custom_extra_param;type:varchar(255);not null;comment:自定义app附加参数" json:"custom_extra_param"` + CustomPcParam string `gorm:"column:custom_pc_param;type:varchar(255);not null;comment:自定义pc端附加参数" json:"custom_pc_param"` +} + +// TableName FissionCampaignCoin's table name +func (*FissionCampaignCoin) TableName() string { + return TableNameFissionCampaignCoin +} diff --git a/internal/repository/model/fission_campaign_coin.go b/internal/repository/model/fission_campaign_coin.go new file mode 100644 index 0000000..a6c593e --- /dev/null +++ b/internal/repository/model/fission_campaign_coin.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (m *FissionCampaignCoin) SetLackBtn(val []int32) { + m.LackBtn, _ = jsonm.MarshalToString(val) +} + +func (m *FissionCampaignCoin) GetLackBtn() (val []int32) { + _ = jsonm.StrUnmarshal(m.LackBtn, &val) + return +} diff --git a/internal/repository/model/fission_campaign_cond.gen.go b/internal/repository/model/fission_campaign_cond.gen.go new file mode 100644 index 0000000..fe5c3b0 --- /dev/null +++ b/internal/repository/model/fission_campaign_cond.gen.go @@ -0,0 +1,50 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignCond = "fission_campaign_cond" + +// FissionCampaignCond mapped from table +type FissionCampaignCond struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_event_event_key,priority:1;comment:项目id(project表)" json:"project_id"` + Event string `gorm:"column:event;type:varchar(255);not null;index:idx_project_id_event_event_key,priority:2;comment:事件关键字" json:"event"` + EventKey string `gorm:"column:event_key;type:varchar(255);not null;index:idx_project_id_event_event_key,priority:3;comment:事件key" json:"event_key"` + EventVal string `gorm:"column:event_val;type:varchar(255);not null;comment:事件值" json:"event_val"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:条件描述" json:"desc"` + IfCond int8 `gorm:"column:if_cond;type:tinyint;not null;comment:等式(0-等于,1-大于等于,2-累计)" json:"if_cond"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:触发次数" json:"num"` + UserNum int64 `gorm:"column:user_num;type:bigint;not null;comment:触发人数" json:"user_num"` + Total float64 `gorm:"column:total;type:decimal(18,2);not null;comment:值累计总数,仅当累计等式有值" json:"total"` + TriggetType int8 `gorm:"column:trigget_type;type:tinyint;not null;default:1;comment:事件触发条件(1-点击去完成按钮,2-全局监听)" json:"trigget_type"` + DelUse int8 `gorm:"column:del_use;type:tinyint;not null;comment:下线后使用数据(0-否,1-是)" json:"del_use"` + EventType int8 `gorm:"column:event_type;type:tinyint;not null;default:1;comment:事件类型(1-自定义事件,2-广告事件,3-标准时间,4-活动时间)" json:"event_type"` + ViewType int8 `gorm:"column:view_type;type:tinyint;not null;default:1;comment:观看广告路径" json:"view_type"` + WatchSec int32 `gorm:"column:watch_sec;type:int;not null;comment:观看秒数" json:"watch_sec"` + OpenJump int8 `gorm:"column:open_jump;type:tinyint;not null;comment:事件跳转(0-否,1-是)" json:"open_jump"` + WebURL string `gorm:"column:web_url;type:varchar(255);not null;comment:web端url长度" json:"web_url"` + ExtraParam string `gorm:"column:extra_param;type:varchar(255);not null;comment:附加参数" json:"extra_param"` + PcParam string `gorm:"column:pc_param;type:varchar(255);not null;comment:pc端附加参数" json:"pc_param"` + GoShow int8 `gorm:"column:go_show;type:tinyint;not null;comment:是否显示“去完成”按钮(0-否,1-是)" json:"go_show"` + AdsStrategyID string `gorm:"column:ads_strategy_id;type:varchar(20);not null;comment:策略id" json:"ads_strategy_id"` + IsSuper int8 `gorm:"column:is_super;type:tinyint;not null;comment:是否超级任务(0-否,1-是)" json:"is_super"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + OpenPush int8 `gorm:"column:open_push;type:tinyint;not null;comment:是否开启完成推送(0-否,1-是)" json:"open_push"` + GoText string `gorm:"column:go_text;type:varchar(128);not null;comment:去完成按钮文案" json:"go_text"` + ClickEffectOpen int8 `gorm:"column:click_effect_open;type:tinyint;not null;comment:开启点击有效(0-关,1开)" json:"click_effect_open"` + ClickEffect int32 `gorm:"column:click_effect;type:int;not null;comment:点击有效值" json:"click_effect"` + ClickEffectUnit string `gorm:"column:click_effect_unit;type:varchar(10);not null;comment:点击有效单位(min-分钟,hour-小时,day-天)" json:"click_effect_unit"` + PullInvite int8 `gorm:"column:pull_invite;type:tinyint;not null;comment:是否拉起邀新(0-否,1-是)" json:"pull_invite"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id" json:"reward_id"` +} + +// TableName FissionCampaignCond's table name +func (*FissionCampaignCond) TableName() string { + return TableNameFissionCampaignCond +} diff --git a/internal/repository/model/fission_campaign_config.gen.go b/internal/repository/model/fission_campaign_config.gen.go new file mode 100644 index 0000000..29a8d74 --- /dev/null +++ b/internal/repository/model/fission_campaign_config.gen.go @@ -0,0 +1,85 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignConfig = "fission_campaign_config" + +// FissionCampaignConfig mapped from table +type FissionCampaignConfig struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RuleTextColor string `gorm:"column:rule_text_color;type:varchar(10);not null;comment:规则文字颜色" json:"rule_text_color"` + RuleBgColor string `gorm:"column:rule_bg_color;type:varchar(10);not null;comment:规则背景颜色" json:"rule_bg_color"` + RuleTimeOpen int8 `gorm:"column:rule_time_open;type:tinyint;not null;comment:是否展示规则中的活动时间" json:"rule_time_open"` + ShareText string `gorm:"column:share_text;type:varchar(255);not null;comment:分享文案" json:"share_text"` + ShareImg string `gorm:"column:share_img;type:varchar(64);not null;comment:分享图片" json:"share_img"` + HasRank int8 `gorm:"column:has_rank;type:tinyint;not null;comment:是否显示排行榜(1-是,0-否)" json:"has_rank"` + RankBackgroundColor string `gorm:"column:rank_background_color;type:varchar(10);not null;comment:排行榜背景颜色" json:"rank_background_color"` + RankTextColor string `gorm:"column:rank_text_color;type:varchar(10);not null;comment:排行榜字体颜色" json:"rank_text_color"` + DownloadPageImage string `gorm:"column:download_page_image;type:varchar(128);not null;comment:下载引导页的图片" json:"download_page_image"` + IsDefaultDownload int8 `gorm:"column:is_default_download;type:tinyint;not null;comment:是否使用默认下载图(0-否,1-是)" json:"is_default_download"` + WechatPageImage string `gorm:"column:wechat_page_image;type:varchar(128);not null;comment:微信引导页的图片" json:"wechat_page_image"` + IsDefaultWechat int8 `gorm:"column:is_default_wechat;type:tinyint;not null;comment:是否使用默认微信引导图(0-否,1-是)" json:"is_default_wechat"` + ImageMain string `gorm:"column:image_main;type:varchar(128);not null;comment:活动主图" json:"image_main"` + IsDefaultMain int8 `gorm:"column:is_default_main;type:tinyint;not null;comment:是否使用默认主图(0-否,1-是)" json:"is_default_main"` + ImagePreview string `gorm:"column:image_preview;type:varchar(128);not null;comment:预览页图" json:"image_preview"` + LinkBtnTextColor string `gorm:"column:link_btn_text_color;type:varchar(10);not null;comment:分享链接按钮文字颜色" json:"link_btn_text_color"` + LinkBtnBgColor string `gorm:"column:link_btn_bg_color;type:varchar(10);not null;comment:分享链接按钮背景颜色" json:"link_btn_bg_color"` + LinkTextColor string `gorm:"column:link_text_color;type:varchar(10);not null;comment:分享链接文字颜色" json:"link_text_color"` + OpenShare int8 `gorm:"column:open_share;type:tinyint;not null;comment:是否开启分享模块" json:"open_share"` + ShowShare int8 `gorm:"column:show_share;type:tinyint;not null;comment:是否显示分享社交媒体(0-否,1-是)" json:"show_share"` + Share string `gorm:"column:share;type:varchar(255);not null;comment:要分享的社交媒体,例如[1,2,3]" json:"share"` + CampaignData string `gorm:"column:campaign_data;type:varchar(5000);not null;comment:前端组件位置偏移数据" json:"campaign_data"` + PageTitle string `gorm:"column:page_title;type:varchar(255);not null;comment:页面标题" json:"page_title"` + DmShow int8 `gorm:"column:dm_show;type:tinyint;not null;comment:是否显示弹幕(0-否,1-是)" json:"dm_show"` + HasWeb int8 `gorm:"column:has_web;type:tinyint;not null;comment:是否有站外活动(0-否,1-是)" json:"has_web"` + WebBgImg string `gorm:"column:web_bg_img;type:varchar(128);not null;comment:站外背景图地址" json:"web_bg_img"` + HasWarmUp int8 `gorm:"column:has_warm_up;type:tinyint;not null;comment:是否开启预热(0-否,1-是)" json:"has_warm_up"` + WarmUpImg string `gorm:"column:warm_up_img;type:varchar(128);not null;comment:预热海报图" json:"warm_up_img"` + WarmUpEnd int32 `gorm:"column:warm_up_end;type:int;not null;comment:活动开始前多少分钟结束预热" json:"warm_up_end"` + Target int8 `gorm:"column:target;type:tinyint;not null;comment:活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)" json:"target"` + Option int8 `gorm:"column:option;type:tinyint;not null;comment:标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗)" json:"option"` + AppEvent int8 `gorm:"column:app_event;type:tinyint;not null;comment:目标选择类型为1(option=1)的选项(1-安装;2-注册)\n" json:"app_event"` + BothType int8 `gorm:"column:both_type;type:tinyint;not null;comment:满足条件(1-所有条件满足,2-任一条件满足)\n" json:"both_type"` + IconType int8 `gorm:"column:icon_type;type:tinyint;not null;comment:活动挂件类型(用于前端挂件选用判断)" json:"icon_type"` + IconBgColor string `gorm:"column:icon_bg_color;type:varchar(10);not null;comment:活动挂件背景色" json:"icon_bg_color"` + DlType int8 `gorm:"column:dl_type;type:tinyint;not null;comment:下载引导页类型(1-通用,2-自定义多媒体)" json:"dl_type"` + DlBannerType int8 `gorm:"column:dl_banner_type;type:tinyint;not null;comment:下载页横幅类型(1-默认,2-自定义)" json:"dl_banner_type"` + DlBannerImg string `gorm:"column:dl_banner_img;type:varchar(255);not null;comment:下载页横幅自定义图" json:"dl_banner_img"` + DlBannerAppLogo string `gorm:"column:dl_banner_app_logo;type:varchar(255);not null;comment:下载页横幅applogo图片" json:"dl_banner_app_logo"` + DlBannerAppName string `gorm:"column:dl_banner_app_name;type:varchar(64);not null;comment:下载页横幅app名称" json:"dl_banner_app_name"` + DlBannerAppBtn string `gorm:"column:dl_banner_app_btn;type:varchar(64);not null;comment:下载页横幅app按钮文案" json:"dl_banner_app_btn"` + DlBannerPosition int8 `gorm:"column:dl_banner_position;type:tinyint;not null;comment:下载页横幅位置(1-顶部,2-底部)" json:"dl_banner_position"` + TopicColor string `gorm:"column:topic_color;type:varchar(10);not null;comment:主题颜色" json:"topic_color"` + WindowCover int8 `gorm:"column:window_cover;type:tinyint;not null;comment:是否开启全屏封面(0-关闭,1-开启)" json:"window_cover"` + RewardGroup int8 `gorm:"column:reward_group;type:tinyint;not null;comment:奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品)" json:"reward_group"` + SupportRewardMark string `gorm:"column:support_reward_mark;type:varchar(5000);not null;comment:支持使用的奖品标识" json:"support_reward_mark"` + DefaultRewardMark string `gorm:"column:default_reward_mark;type:varchar(500);not null;comment:默认使用奖品标识" json:"default_reward_mark"` + PlayRule string `gorm:"column:play_rule;type:text;not null" json:"play_rule"` + IconOpen string `gorm:"column:icon_open;type:varchar(64);not null;comment:开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友)" json:"icon_open"` + HasLongImg int8 `gorm:"column:has_long_img;type:tinyint;not null;comment:是否支持长图(0-否,1-是)" json:"has_long_img"` + HasWhite int8 `gorm:"column:has_white;type:tinyint;not null;comment:是否开启白名单" json:"has_white"` + WhiteList string `gorm:"column:white_list;type:varchar(1000);not null;comment:白名单列表" json:"white_list"` + PcBg string `gorm:"column:pc_bg;type:varchar(64);not null;comment:Pc适配背景图" json:"pc_bg"` + AdsType int8 `gorm:"column:ads_type;type:tinyint;not null;comment:广告状态(0-不启用广告,1-跟随项目配置,2-活动开启)" json:"ads_type"` + Countdown int32 `gorm:"column:countdown;type:int;not null;comment:开奖倒计时" json:"countdown"` + PlayType int8 `gorm:"column:play_type;type:tinyint;not null;comment:玩法类型,根据不同子活动有不同意义" json:"play_type"` + PointsUse int8 `gorm:"column:points_use;type:tinyint;not null;comment:开启积分使用(0-否,1-是)" json:"points_use"` + LinkTempID string `gorm:"column:link_temp_id;type:varchar(10);not null;comment:模版id" json:"link_temp_id"` + OutsideTask int8 `gorm:"column:outside_task;type:tinyint;not null;comment:是否外显任务(0-否,1-是)" json:"outside_task"` + ShowToUse int8 `gorm:"column:show_to_use;type:tinyint;not null;comment:是否展示奖品弹窗的去使用(0-不展示,1-展示)" json:"show_to_use"` + OpenChat int8 `gorm:"column:open_chat;type:tinyint;not null;comment:是否开启ai聊天" json:"open_chat"` + RuleType int8 `gorm:"column:rule_type;type:tinyint;not null;comment:规则展示类型(0-文本,1-图片)" json:"rule_type"` + RuleOutside int8 `gorm:"column:rule_outside;type:tinyint;not null;comment:规则是否外显(0-否,1-是)" json:"rule_outside"` + DeviceOnce int8 `gorm:"column:device_once;type:tinyint;not null;comment:设备唯一" json:"device_once"` +} + +// TableName FissionCampaignConfig's table name +func (*FissionCampaignConfig) TableName() string { + return TableNameFissionCampaignConfig +} diff --git a/internal/repository/model/fission_campaign_config.go b/internal/repository/model/fission_campaign_config.go new file mode 100644 index 0000000..aade15e --- /dev/null +++ b/internal/repository/model/fission_campaign_config.go @@ -0,0 +1,41 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" + "strings" +) + +func (m *FissionCampaignConfig) SetCampaignData(kv []*mtype.KV) { + m.CampaignData, _ = jsonm.MarshalToString(kv) +} + +func (m *FissionCampaignConfig) GetCampaignData() (campaignData []*mtype.KV) { + _ = jsonm.StrUnmarshal(m.CampaignData, &campaignData) + return +} + +func (m *FissionCampaignConfig) SetShare(val []int64) { + m.Share, _ = jsonm.MarshalToString(val) +} + +func (m *FissionCampaignConfig) GetShare() (val []int64) { + _ = jsonm.StrUnmarshal(m.Share, &val) + return +} + +func (m *FissionCampaignConfig) SetIconOpen(val []int32) { + m.IconOpen, _ = jsonm.MarshalToString(val) +} + +func (m *FissionCampaignConfig) GetIconOpen() (val []int32) { + _ = jsonm.StrUnmarshal(m.IconOpen, &val) + return +} + +func (m *FissionCampaignConfig) GetWhileList() (val []string) { + if m.WhiteList == "" { + return + } + return strings.Split(m.WhiteList, ";") +} diff --git a/internal/repository/model/fission_campaign_dice.gen.go b/internal/repository/model/fission_campaign_dice.gen.go new file mode 100644 index 0000000..2a46765 --- /dev/null +++ b/internal/repository/model/fission_campaign_dice.gen.go @@ -0,0 +1,37 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignDice = "fission_campaign_dice" + +// FissionCampaignDice mapped from table +type FissionCampaignDice struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始骰子数" json:"init_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的骰子数" json:"chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的骰子数" json:"day_chance"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + FixDice int8 `gorm:"column:fix_dice;type:tinyint;not null;comment:开启固定骰子(0-不开启,1-开启)" json:"fix_dice"` + FixDiceTarget int32 `gorm:"column:fix_dice_target;type:int;not null;comment:获得固定骰子需要邀请的人数" json:"fix_dice_target"` + FixDiceLimit int32 `gorm:"column:fix_dice_limit;type:int;not null;comment:固定骰子限制获取数" json:"fix_dice_limit"` + FixDiceCond int8 `gorm:"column:fix_dice_cond;type:tinyint;not null;comment:邀请事件(1-安装,2-注册)" json:"fix_dice_cond"` + CustomDice string `gorm:"column:custom_dice;type:varchar(64);not null;comment:自定义骰子图片" json:"custom_dice"` + OpenMapPoint int8 `gorm:"column:open_map_point;type:tinyint;not null;comment:开启自定义底座(0-不开启,1-开启)" json:"open_map_point"` + MapPoint string `gorm:"column:map_point;type:varchar(255);not null;comment:自定义底座数据" json:"map_point"` + AwardType int8 `gorm:"column:award_type;type:tinyint;not null;default:1;comment:奖品碎片收集方式(1-随机收集,2-概率收集)" json:"award_type"` + Odds int32 `gorm:"column:odds;type:int;not null;comment:概率收集方式的中奖概率" json:"odds"` + OpenInvite int8 `gorm:"column:open_invite;type:tinyint;not null;comment:开启邀请挂件(0-关闭,1-开启)" json:"open_invite"` + RollAgain int8 `gorm:"column:roll_again;type:tinyint;not null;comment:开启再摇一次(0-关闭,1-开启)" json:"roll_again"` + PlayImg string `gorm:"column:play_img;type:varchar(128);not null;comment:play按钮图" json:"play_img"` + CloudImg string `gorm:"column:cloud_img;type:varchar(128);not null;comment:云朵图" json:"cloud_img"` +} + +// TableName FissionCampaignDice's table name +func (*FissionCampaignDice) TableName() string { + return TableNameFissionCampaignDice +} diff --git a/internal/repository/model/fission_campaign_dice.go b/internal/repository/model/fission_campaign_dice.go new file mode 100644 index 0000000..7132b16 --- /dev/null +++ b/internal/repository/model/fission_campaign_dice.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCampaignDice) SetMapPoint(val *mtype.MapPoint) { + s.MapPoint, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignDice) GetMapPoint() (val mtype.MapPoint) { + _ = jsonm.StrUnmarshal(s.MapPoint, &val) + return +} diff --git a/internal/repository/model/fission_campaign_event.gen.go b/internal/repository/model/fission_campaign_event.gen.go new file mode 100644 index 0000000..bbb3438 --- /dev/null +++ b/internal/repository/model/fission_campaign_event.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignEvent = "fission_campaign_event" + +// FissionCampaignEvent mapped from table +type FissionCampaignEvent struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(64);not null;uniqueIndex:uniq_campaign_id_mark,priority:2;comment:标识(推送标识)" json:"mark"` + Open int8 `gorm:"column:open;type:tinyint;not null;comment:是否开启(0-否,1-是)" json:"open"` + Rewards string `gorm:"column:rewards;type:varchar(255);not null;comment:奖励" json:"rewards"` +} + +// TableName FissionCampaignEvent's table name +func (*FissionCampaignEvent) TableName() string { + return TableNameFissionCampaignEvent +} diff --git a/internal/repository/model/fission_campaign_event.go b/internal/repository/model/fission_campaign_event.go new file mode 100644 index 0000000..3a1b656 --- /dev/null +++ b/internal/repository/model/fission_campaign_event.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionCampaignEvent) SetRewards(vals []*mtype.EventReward) { + m.Rewards, _ = jsonm.ToSliceString(vals) +} + +func (m *FissionCampaignEvent) GetRewards() (vals []*mtype.EventReward) { + _ = jsonm.StrUnmarshal(m.Rewards, &vals) + return +} diff --git a/internal/repository/model/fission_campaign_flip.gen.go b/internal/repository/model/fission_campaign_flip.gen.go new file mode 100644 index 0000000..64d9cab --- /dev/null +++ b/internal/repository/model/fission_campaign_flip.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignFlip = "fission_campaign_flip" + +// FissionCampaignFlip mapped from table +type FissionCampaignFlip struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始答题机会次数" json:"init_chance"` + CardImg string `gorm:"column:card_img;type:varchar(128);not null;comment:牌子封面" json:"card_img"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽奖次数" json:"day_chance"` +} + +// TableName FissionCampaignFlip's table name +func (*FissionCampaignFlip) TableName() string { + return TableNameFissionCampaignFlip +} diff --git a/internal/repository/model/fission_campaign_gashapon.gen.go b/internal/repository/model/fission_campaign_gashapon.gen.go new file mode 100644 index 0000000..ca6bf8a --- /dev/null +++ b/internal/repository/model/fission_campaign_gashapon.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignGashapon = "fission_campaign_gashapon" + +// FissionCampaignGashapon mapped from table +type FissionCampaignGashapon struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始抽奖机会次数" json:"init_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽奖次数" json:"day_chance"` +} + +// TableName FissionCampaignGashapon's table name +func (*FissionCampaignGashapon) TableName() string { + return TableNameFissionCampaignGashapon +} diff --git a/internal/repository/model/fission_campaign_gold.gen.go b/internal/repository/model/fission_campaign_gold.gen.go new file mode 100644 index 0000000..0c29a96 --- /dev/null +++ b/internal/repository/model/fission_campaign_gold.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignGold = "fission_campaign_gold" + +// FissionCampaignGold mapped from table +type FissionCampaignGold struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + GoldNum int32 `gorm:"column:gold_num;type:int;not null;comment:获得奖品需要的金币数" json:"gold_num"` + ExpiredDay int32 `gorm:"column:expired_day;type:int;not null;comment:任务重置天数" json:"expired_day"` + Price float64 `gorm:"column:price;type:decimal(10,2);not null;default:0.00;comment:单位奖品总价值" json:"price"` + PriceNum int32 `gorm:"column:price_num;type:int;not null;comment:奖品总份额" json:"price_num"` + Lack int8 `gorm:"column:lack;type:tinyint;not null;comment:缺乏库存" json:"lack"` + Currency int8 `gorm:"column:currency;type:tinyint;not null;comment:货币单位" json:"currency"` +} + +// TableName FissionCampaignGold's table name +func (*FissionCampaignGold) TableName() string { + return TableNameFissionCampaignGold +} diff --git a/internal/repository/model/fission_campaign_grid.gen.go b/internal/repository/model/fission_campaign_grid.gen.go new file mode 100644 index 0000000..73d7b2e --- /dev/null +++ b/internal/repository/model/fission_campaign_grid.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignGrid = "fission_campaign_grid" + +// FissionCampaignGrid mapped from table +type FissionCampaignGrid struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始答题机会次数" json:"init_chance"` + Odds int32 `gorm:"column:odds;type:int;not null;comment:中奖概率" json:"odds"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽奖次数" json:"day_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的抽奖机会次数" json:"chance"` +} + +// TableName FissionCampaignGrid's table name +func (*FissionCampaignGrid) TableName() string { + return TableNameFissionCampaignGrid +} diff --git a/internal/repository/model/fission_campaign_grid_reward.gen.go b/internal/repository/model/fission_campaign_grid_reward.gen.go new file mode 100644 index 0000000..cb01e8a --- /dev/null +++ b/internal/repository/model/fission_campaign_grid_reward.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignGridReward = "fission_campaign_grid_reward" + +// FissionCampaignGridReward mapped from table +type FissionCampaignGridReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + GridID int64 `gorm:"column:grid_id;type:bigint;not null;index:idx_grid_id,priority:1;comment:九宫格配置ID(fission_campaign_grid主键)" json:"grid_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + Stock int32 `gorm:"column:stock;type:int;not null;comment:奖品库存" json:"stock"` + JumpURL string `gorm:"column:jump_url;type:varchar(255);not null;comment:跳转链接" json:"jump_url"` + CustomParams string `gorm:"column:custom_params;type:varchar(2000);not null;comment:跳转链接自定义参数" json:"custom_params"` + UseStock int32 `gorm:"column:use_stock;type:int;not null;comment:已发放奖品数" json:"use_stock"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionCampaignGridReward's table name +func (*FissionCampaignGridReward) TableName() string { + return TableNameFissionCampaignGridReward +} diff --git a/internal/repository/model/fission_campaign_grow.gen.go b/internal/repository/model/fission_campaign_grow.gen.go new file mode 100644 index 0000000..8c8f58a --- /dev/null +++ b/internal/repository/model/fission_campaign_grow.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignGrow = "fission_campaign_grow" + +// FissionCampaignGrow mapped from table +type FissionCampaignGrow struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + AutoHour int32 `gorm:"column:auto_hour;type:int;not null;comment:自动生产成长道具小时数" json:"auto_hour"` + AutoNum int32 `gorm:"column:auto_num;type:int;not null;comment:生产的成长道具数" json:"auto_num"` + GrowNum int32 `gorm:"column:grow_num;type:int;not null;comment:邀请可获得的成长道具数量" json:"grow_num"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:获得成长道具需要邀请的人数" json:"target_num"` + Revive int8 `gorm:"column:revive;type:tinyint;not null;comment:是否支持复活(0-否,1-是)" json:"revive"` + ReviveNum int32 `gorm:"column:revive_num;type:int;not null;comment:复活需要邀请的好友数" json:"revive_num"` + DieHour int32 `gorm:"column:die_hour;type:int;not null;comment:未获得成长道具导致的死亡时间" json:"die_hour"` + InitNum int32 `gorm:"column:init_num;type:int;not null;comment:初始成长道具数量" json:"init_num"` +} + +// TableName FissionCampaignGrow's table name +func (*FissionCampaignGrow) TableName() string { + return TableNameFissionCampaignGrow +} diff --git a/internal/repository/model/fission_campaign_grow_step.gen.go b/internal/repository/model/fission_campaign_grow_step.gen.go new file mode 100644 index 0000000..11bdd51 --- /dev/null +++ b/internal/repository/model/fission_campaign_grow_step.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignGrowStep = "fission_campaign_grow_step" + +// FissionCampaignGrowStep mapped from table +type FissionCampaignGrowStep struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + Step int32 `gorm:"column:step;type:int;not null;comment:阶段" json:"step"` + Num int32 `gorm:"column:num;type:int;not null;comment:需要的养成道具数量" json:"num"` +} + +// TableName FissionCampaignGrowStep's table name +func (*FissionCampaignGrowStep) TableName() string { + return TableNameFissionCampaignGrowStep +} diff --git a/internal/repository/model/fission_campaign_keep.gen.go b/internal/repository/model/fission_campaign_keep.gen.go new file mode 100644 index 0000000..b148a80 --- /dev/null +++ b/internal/repository/model/fission_campaign_keep.gen.go @@ -0,0 +1,37 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignKeep = "fission_campaign_keep" + +// FissionCampaignKeep mapped from table +type FissionCampaignKeep struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Collect int32 `gorm:"column:collect;type:int;not null;comment:获得最终奖品需要的总收集数" json:"collect"` + CollectSecond int32 `gorm:"column:collect_second;type:int;not null;comment:单个收集需要的二级资源数" json:"collect_second"` + OpenInvite int8 `gorm:"column:open_invite;type:tinyint;not null;comment:开启邀请(0-关闭,1-开启)" json:"open_invite"` + Invite string `gorm:"column:invite;type:varchar(2000);not null;comment:邀请数据" json:"invite"` + InitGet int32 `gorm:"column:init_get;type:int;not null;comment:初始道具数" json:"init_get"` + SecGet float64 `gorm:"column:sec_get;type:decimal(6,2);not null;default:0.00;comment:每秒获得道具数" json:"sec_get"` + FeedNum int32 `gorm:"column:feed_num;type:int;not null;comment:每次使用道具数" json:"feed_num"` + FeedCycle int32 `gorm:"column:feed_cycle;type:int;not null;comment:喂养周期(单位:天)" json:"feed_cycle"` + TalkText string `gorm:"column:talk_text;type:varchar(2000);not null;comment:对话文案" json:"talk_text"` + MaxFeed int32 `gorm:"column:max_feed;type:int;not null;comment:最大可领养次数" json:"max_feed"` + FeedGet int32 `gorm:"column:feed_get;type:int;not null;comment:喂养能得到的道具数" json:"feed_get"` + FeedGetNum int32 `gorm:"column:feed_get_num;type:int;not null;comment:得到喂养道具需要的喂养次数" json:"feed_get_num"` + SecGetDayLimit float64 `gorm:"column:sec_get_day_limit;type:decimal(6,2);not null;default:0.00;comment:每秒获得道具每日上限" json:"sec_get_day_limit"` + MachineType int8 `gorm:"column:machine_type;type:tinyint;not null;comment:狗粮机类型(1-在线收益,2-离线收益)" json:"machine_type"` + OfflineMin int32 `gorm:"column:offline_min;type:int;not null;comment:离线分钟时长" json:"offline_min"` + OfflineGet int32 `gorm:"column:offline_get;type:int;not null;comment:离线收益最大值" json:"offline_get"` + OfflineLimit int32 `gorm:"column:offline_limit;type:int;not null;comment:离线收益单日最大领取次数" json:"offline_limit"` +} + +// TableName FissionCampaignKeep's table name +func (*FissionCampaignKeep) TableName() string { + return TableNameFissionCampaignKeep +} diff --git a/internal/repository/model/fission_campaign_keep.go b/internal/repository/model/fission_campaign_keep.go new file mode 100644 index 0000000..4b19b09 --- /dev/null +++ b/internal/repository/model/fission_campaign_keep.go @@ -0,0 +1,24 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCampaignKeep) SetInvite(val *mtype.KeepInvite) { + s.Invite, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignKeep) GetInvite() (val *mtype.KeepInvite) { + _ = jsonm.StrUnmarshal(s.Invite, &val) + return +} + +func (s *FissionCampaignKeep) SetKeepTalk(val []*mtype.KeepTalk) { + s.TalkText, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignKeep) GetKeepTalk() (val []*mtype.KeepTalk) { + _ = jsonm.StrUnmarshal(s.TalkText, &val) + return +} diff --git a/internal/repository/model/fission_campaign_keep_step.gen.go b/internal/repository/model/fission_campaign_keep_step.gen.go new file mode 100644 index 0000000..7278409 --- /dev/null +++ b/internal/repository/model/fission_campaign_keep_step.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignKeepStep = "fission_campaign_keep_step" + +// FissionCampaignKeepStep mapped from table +type FissionCampaignKeepStep struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + Step int32 `gorm:"column:step;type:int;not null;comment:阶段" json:"step"` + Percent int32 `gorm:"column:percent;type:int;not null;comment:对应的进度条数值" json:"percent"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-成长道具,2-奖品)" json:"reward_type"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id" json:"reward_id"` + RewardNum int32 `gorm:"column:reward_num;type:int;not null;comment:发放道具数量" json:"reward_num"` +} + +// TableName FissionCampaignKeepStep's table name +func (*FissionCampaignKeepStep) TableName() string { + return TableNameFissionCampaignKeepStep +} diff --git a/internal/repository/model/fission_campaign_lang.gen.go b/internal/repository/model/fission_campaign_lang.gen.go new file mode 100644 index 0000000..751f909 --- /dev/null +++ b/internal/repository/model/fission_campaign_lang.gen.go @@ -0,0 +1,53 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignLang = "fission_campaign_lang" + +// FissionCampaignLang mapped from table +type FissionCampaignLang struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外hash_id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_lang_mark,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + LangMark string `gorm:"column:lang_mark;type:varchar(8);not null;index:idx_campaign_id_lang_mark,priority:2;comment:语言对应的唯一标识" json:"lang_mark"` + PageTitle string `gorm:"column:page_title;type:varchar(255);not null;comment:页面标题" json:"page_title"` + ImageMain string `gorm:"column:image_main;type:varchar(128);not null;comment:活动主图" json:"image_main"` + DownloadPageImage string `gorm:"column:download_page_image;type:varchar(128);not null;comment:下载引导页的图片" json:"download_page_image"` + WechatPageImage string `gorm:"column:wechat_page_image;type:varchar(128);not null;comment:微信引导页的图片" json:"wechat_page_image"` + ContentImg string `gorm:"column:content_img;type:varchar(128);not null;comment:内容背景图" json:"content_img"` + WebBgImg string `gorm:"column:web_bg_img;type:varchar(128);not null;comment:站外背景图地址" json:"web_bg_img"` + WarmUpImg string `gorm:"column:warm_up_img;type:varchar(128);not null;comment:预热海报图" json:"warm_up_img"` + DlBgImg string `gorm:"column:dl_bg_img;type:varchar(128);not null;comment:引导页背景图" json:"dl_bg_img"` + DlBannerImg string `gorm:"column:dl_banner_img;type:varchar(255);not null;comment:下载页横幅自定义图" json:"dl_banner_img"` + DlBannerAppLogo string `gorm:"column:dl_banner_app_logo;type:varchar(255);not null;comment:下载页横幅applogo图片" json:"dl_banner_app_logo"` + DlBannerAppName string `gorm:"column:dl_banner_app_name;type:varchar(64);not null;comment:下载页横幅app名称" json:"dl_banner_app_name"` + DlBannerAppBtn string `gorm:"column:dl_banner_app_btn;type:varchar(64);not null;comment:下载页横幅app按钮文案" json:"dl_banner_app_btn"` + ShareText string `gorm:"column:share_text;type:varchar(255);not null;comment:分享文案" json:"share_text"` + ShareImg string `gorm:"column:share_img;type:varchar(64);not null;comment:分享图片" json:"share_img"` + Rule string `gorm:"column:rule;type:text;not null;comment:活动规则" json:"rule"` + RuleImg string `gorm:"column:rule_img;type:varchar(128);not null;comment:活动规则图片" json:"rule_img"` + Conds string `gorm:"column:conds;type:json;not null;comment:事件驱动的条件描述" json:"conds"` + Quit string `gorm:"column:quit;type:json;not null;comment:谁是冠军选项数据" json:"quit"` + Questions string `gorm:"column:questions;type:json;not null;comment:题目数据" json:"questions"` + QaGroup string `gorm:"column:qa_group;type:json;not null;comment:题库数据" json:"qa_group"` + LongImg string `gorm:"column:long_img;type:json;not null;comment:长图数据" json:"long_img"` + Cash string `gorm:"column:cash;type:varchar(128);not null;comment:现金抽奖数据" json:"cash"` + Gold string `gorm:"column:gold;type:varchar(128);not null;comment:金币任务数据" json:"gold"` + TOffset int32 `gorm:"column:t_offset;type:int;not null;comment:时间偏移量" json:"t_offset"` + TalkText string `gorm:"column:talk_text;type:varchar(2000);not null;comment:对话文案" json:"talk_text"` + Coin string `gorm:"column:coin;type:varchar(255);not null;comment:金币池数据" json:"coin"` + TopicColor string `gorm:"column:topic_color;type:varchar(10);not null;comment:主题色" json:"topic_color"` + PcBg string `gorm:"column:pc_bg;type:varchar(64);not null" json:"pc_bg"` + Vs string `gorm:"column:vs;type:json;not null;comment:赛事竞猜数据" json:"vs"` + Uno string `gorm:"column:uno;type:json;not null;comment:uno卡牌数据" json:"uno"` +} + +// TableName FissionCampaignLang's table name +func (*FissionCampaignLang) TableName() string { + return TableNameFissionCampaignLang +} diff --git a/internal/repository/model/fission_campaign_lang.go b/internal/repository/model/fission_campaign_lang.go new file mode 100644 index 0000000..dcd4778 --- /dev/null +++ b/internal/repository/model/fission_campaign_lang.go @@ -0,0 +1,101 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCampaignLang) SetConds(val []*mtype.LangCond) { + s.Conds, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetConds() (val []*mtype.LangCond) { + _ = jsonm.StrUnmarshal(s.Conds, &val) + return +} + +func (s *FissionCampaignLang) SetQuit(val *mtype.LangQuit) { + s.Quit, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetQuit() (val *mtype.LangQuit) { + _ = jsonm.StrUnmarshal(s.Quit, &val) + return +} + +func (s *FissionCampaignLang) SetQuestions(val []*mtype.LangQuestions) { + s.Questions, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetQuestions() (val []*mtype.LangQuestions) { + _ = jsonm.StrUnmarshal(s.Questions, &val) + return +} + +func (s *FissionCampaignLang) SetLongImg(val []*mtype.LangLongImg) { + s.LongImg, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetLongImg() (val []*mtype.LangLongImg) { + _ = jsonm.StrUnmarshal(s.LongImg, &val) + return +} + +func (s *FissionCampaignLang) SetCash(val *mtype.LangCash) { + s.Cash, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetCash() (val *mtype.LangCash) { + _ = jsonm.StrUnmarshal(s.Cash, &val) + return +} + +func (s *FissionCampaignLang) GetGold() (val *mtype.LangGold) { + _ = jsonm.StrUnmarshal(s.Gold, &val) + return +} + +func (s *FissionCampaignLang) SetQaGroup(val *mtype.LangQaGroup) { + s.QaGroup, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetQaGroup() (val *mtype.LangQaGroup) { + _ = jsonm.StrUnmarshal(s.QaGroup, &val) + return +} + +func (s *FissionCampaignLang) SetKeepTalk(val []*mtype.KeepTalk) { + s.TalkText, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetKeepTalk() (val []*mtype.KeepTalk) { + _ = jsonm.StrUnmarshal(s.TalkText, &val) + return +} + +func (s *FissionCampaignLang) SetLangCoin(val *mtype.LangCoin) { + s.Coin, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignLang) GetLangCoin() (val *mtype.LangCoin) { + _ = jsonm.StrUnmarshal(s.Coin, &val) + return +} + +func (s *FissionCampaignLang) SetVs(val []*mtype.VsSchedule) { + s.Vs, _ = jsonm.ToSliceString(val) +} + +func (s *FissionCampaignLang) GetVs() (val []*mtype.VsSchedule) { + _ = jsonm.StrUnmarshal(s.Vs, &val) + return +} + +func (s *FissionCampaignLang) SetUno(val *mtype.LangUno) { + s.Uno, _ = jsonm.ToObjString(val) +} + +func (s *FissionCampaignLang) GetUno() (val *mtype.LangUno) { + _ = jsonm.StrUnmarshal(s.Uno, &val) + return +} diff --git a/internal/repository/model/fission_campaign_long_img.gen.go b/internal/repository/model/fission_campaign_long_img.gen.go new file mode 100644 index 0000000..b3d54c7 --- /dev/null +++ b/internal/repository/model/fission_campaign_long_img.gen.go @@ -0,0 +1,30 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignLongImg = "fission_campaign_long_img" + +// FissionCampaignLongImg mapped from table +type FissionCampaignLongImg struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_lang_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + LangID int64 `gorm:"column:lang_id;type:bigint;not null;index:idx_campaign_id_lang_id,priority:2;comment:语言ID(fission_campaign_lang表)" json:"lang_id"` + LangSourceID int64 `gorm:"column:lang_source_id;type:bigint;not null;comment:语言长途源ID" json:"lang_source_id"` + ClickType int8 `gorm:"column:click_type;type:tinyint;not null;default:1;comment:点击类型(1-整图点击,2-区域点击)" json:"click_type"` + ImgURL string `gorm:"column:img_url;type:varchar(64);not null;comment:图片地址" json:"img_url"` + WebURL string `gorm:"column:web_url;type:varchar(255);not null;comment:Web跳转地址" json:"web_url"` + AppParam string `gorm:"column:app_param;type:varchar(255);not null;comment:App跳转参数" json:"app_param"` + PcParam string `gorm:"column:pc_param;type:varchar(255);not null;comment:pc跳转参数" json:"pc_param"` + TargetType int8 `gorm:"column:target_type;type:tinyint;not null;comment:跳转目标(1-指定地址,2-活动)" json:"target_type"` + TargetID int64 `gorm:"column:target_id;type:bigint;not null;comment:目标id" json:"target_id"` +} + +// TableName FissionCampaignLongImg's table name +func (*FissionCampaignLongImg) TableName() string { + return TableNameFissionCampaignLongImg +} diff --git a/internal/repository/model/fission_campaign_long_img_zone.gen.go b/internal/repository/model/fission_campaign_long_img_zone.gen.go new file mode 100644 index 0000000..a4294f1 --- /dev/null +++ b/internal/repository/model/fission_campaign_long_img_zone.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignLongImgZone = "fission_campaign_long_img_zone" + +// FissionCampaignLongImgZone mapped from table +type FissionCampaignLongImgZone struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + ImgID int64 `gorm:"column:img_id;type:bigint;not null;index:idx_img_id,priority:1;comment:长图ID(fission_campaign_long_img表)" json:"img_id"` + WebURL string `gorm:"column:web_url;type:varchar(255);not null;comment:Web跳转地址" json:"web_url"` + AppParam string `gorm:"column:app_param;type:varchar(255);not null;comment:App跳转参数" json:"app_param"` + PcParam string `gorm:"column:pc_param;type:varchar(255);not null;comment:pc跳转参数" json:"pc_param"` + ClickX float64 `gorm:"column:click_x;type:decimal(6,2);not null;comment:点击区域x" json:"click_x"` + ClickY float64 `gorm:"column:click_y;type:decimal(6,2);not null;comment:点击区域y" json:"click_y"` + ClickH float64 `gorm:"column:click_h;type:decimal(6,2);not null;comment:点击区域h" json:"click_h"` + ClickW float64 `gorm:"column:click_w;type:decimal(6,2);not null;comment:点击区域w" json:"click_w"` + TargetType int8 `gorm:"column:target_type;type:tinyint;not null;comment:跳转目标(1-指定地址,2-活动)" json:"target_type"` + TargetID int64 `gorm:"column:target_id;type:bigint;not null;comment:目标id" json:"target_id"` +} + +// TableName FissionCampaignLongImgZone's table name +func (*FissionCampaignLongImgZone) TableName() string { + return TableNameFissionCampaignLongImgZone +} diff --git a/internal/repository/model/fission_campaign_points_use.gen.go b/internal/repository/model/fission_campaign_points_use.gen.go new file mode 100644 index 0000000..1816c91 --- /dev/null +++ b/internal/repository/model/fission_campaign_points_use.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignPointsUse = "fission_campaign_points_use" + +// FissionCampaignPointsUse mapped from table +type FissionCampaignPointsUse struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Icon string `gorm:"column:icon;type:varchar(128);not null;comment:积分图" json:"icon"` + URLID int64 `gorm:"column:url_id;type:bigint;not null;comment:积分回调地址id" json:"url_id"` + UseNum int32 `gorm:"column:use_num;type:int;not null;comment:单次兑换使用积分数字" json:"use_num"` + DayLimit int32 `gorm:"column:day_limit;type:int;not null;comment:每日可兑换次数" json:"day_limit"` + TotalLimit int32 `gorm:"column:total_limit;type:int;not null;comment:总兑换次数" json:"total_limit"` +} + +// TableName FissionCampaignPointsUse's table name +func (*FissionCampaignPointsUse) TableName() string { + return TableNameFissionCampaignPointsUse +} diff --git a/internal/repository/model/fission_campaign_push.gen.go b/internal/repository/model/fission_campaign_push.gen.go new file mode 100644 index 0000000..97e2f87 --- /dev/null +++ b/internal/repository/model/fission_campaign_push.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignPush = "fission_campaign_push" + +// FissionCampaignPush mapped from table +type FissionCampaignPush struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(64);not null;uniqueIndex:uniq_campaign_id_mark,priority:2;comment:标识(推送标识)" json:"mark"` + Cond string `gorm:"column:cond;type:varchar(255);not null;comment:推送条件" json:"cond"` + Open int8 `gorm:"column:open;type:tinyint;not null;comment:是否开启(0-否,1-是)" json:"open"` +} + +// TableName FissionCampaignPush's table name +func (*FissionCampaignPush) TableName() string { + return TableNameFissionCampaignPush +} diff --git a/internal/repository/model/fission_campaign_push.go b/internal/repository/model/fission_campaign_push.go new file mode 100644 index 0000000..49df7b7 --- /dev/null +++ b/internal/repository/model/fission_campaign_push.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionCampaignPush) SetCond(vals []*mtype.PushCond) { + m.Cond, _ = jsonm.ToSliceString(vals) +} + +func (m *FissionCampaignPush) GetCond() (vals []*mtype.PushCond) { + _ = jsonm.StrUnmarshal(m.Cond, &vals) + return +} diff --git a/internal/repository/model/fission_campaign_qa.gen.go b/internal/repository/model/fission_campaign_qa.gen.go new file mode 100644 index 0000000..ae96c78 --- /dev/null +++ b/internal/repository/model/fission_campaign_qa.gen.go @@ -0,0 +1,29 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQa = "fission_campaign_qa" + +// FissionCampaignQa mapped from table +type FissionCampaignQa struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始答题机会次数" json:"init_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的答题机会次数" json:"chance"` + QuestionAskTime int32 `gorm:"column:question_ask_time;type:int;not null;comment:答题时间限制(单位:S,如:1 就是1秒)" json:"question_ask_time"` + QaGroupID int64 `gorm:"column:qa_group_id;type:bigint;not null;comment:题库id(library_qa_group表)" json:"qa_group_id"` + QaNum int32 `gorm:"column:qa_num;type:int;not null;comment:题库选题数量" json:"qa_num"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的答题数" json:"day_chance"` + OpenGuide int8 `gorm:"column:open_guide;type:tinyint;not null;comment:是否开启引导" json:"open_guide"` + GuideGroupID int64 `gorm:"column:guide_group_id;type:bigint;not null;comment:引导题库id" json:"guide_group_id"` +} + +// TableName FissionCampaignQa's table name +func (*FissionCampaignQa) TableName() string { + return TableNameFissionCampaignQa +} diff --git a/internal/repository/model/fission_campaign_qa_option.gen.go b/internal/repository/model/fission_campaign_qa_option.gen.go new file mode 100644 index 0000000..3419b8d --- /dev/null +++ b/internal/repository/model/fission_campaign_qa_option.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQaOption = "fission_campaign_qa_option" + +// FissionCampaignQaOption mapped from table +type FissionCampaignQaOption struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + QuestionID int64 `gorm:"column:question_id;type:bigint;not null;index:idx_question_id,priority:1;comment:问题id(fission_campaign_quiz_question表)" json:"question_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:答案" json:"title"` + IsRight int8 `gorm:"column:is_right;type:tinyint;not null;comment:是否正确答案" json:"is_right"` +} + +// TableName FissionCampaignQaOption's table name +func (*FissionCampaignQaOption) TableName() string { + return TableNameFissionCampaignQaOption +} diff --git a/internal/repository/model/fission_campaign_qa_question.gen.go b/internal/repository/model/fission_campaign_qa_question.gen.go new file mode 100644 index 0000000..978640f --- /dev/null +++ b/internal/repository/model/fission_campaign_qa_question.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQaQuestion = "fission_campaign_qa_question" + +// FissionCampaignQaQuestion mapped from table +type FissionCampaignQaQuestion struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;comment:活动id(fission_campaign表)" json:"campaign_id"` + QaID int64 `gorm:"column:qa_id;type:bigint;not null;index:idx_qa_id,priority:1;comment:趣味问答配置ID(fission_campaign_qa主键)" json:"qa_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:题目" json:"title"` + Score int32 `gorm:"column:score;type:int;not null;comment:可获得的分数" json:"score"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` +} + +// TableName FissionCampaignQaQuestion's table name +func (*FissionCampaignQaQuestion) TableName() string { + return TableNameFissionCampaignQaQuestion +} diff --git a/internal/repository/model/fission_campaign_qa_reward.gen.go b/internal/repository/model/fission_campaign_qa_reward.gen.go new file mode 100644 index 0000000..b017c80 --- /dev/null +++ b/internal/repository/model/fission_campaign_qa_reward.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQaReward = "fission_campaign_qa_reward" + +// FissionCampaignQaReward mapped from table +type FissionCampaignQaReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + QaID int64 `gorm:"column:qa_id;type:bigint;not null;index:idx_qa_id,priority:1;comment:趣味问答配置ID(fission_campaign_qa主键)" json:"qa_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + Stock int32 `gorm:"column:stock;type:int;not null;comment:奖品库存" json:"stock"` + CustomParams string `gorm:"column:custom_params;type:varchar(2000);not null;comment:跳转链接自定义参数" json:"custom_params"` + UseStock int32 `gorm:"column:use_stock;type:int;not null;comment:已发放奖品数" json:"use_stock"` + Score int32 `gorm:"column:score;type:int;not null;comment:领取奖品的分数" json:"score"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionCampaignQaReward's table name +func (*FissionCampaignQaReward) TableName() string { + return TableNameFissionCampaignQaReward +} diff --git a/internal/repository/model/fission_campaign_quiz.gen.go b/internal/repository/model/fission_campaign_quiz.gen.go new file mode 100644 index 0000000..aac64e0 --- /dev/null +++ b/internal/repository/model/fission_campaign_quiz.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQuiz = "fission_campaign_quiz" + +// FissionCampaignQuiz mapped from table +type FissionCampaignQuiz struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始投票机会次数" json:"init_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的投票机会次数" json:"chance"` + RewardRule int8 `gorm:"column:reward_rule;type:tinyint;not null;comment:奖励规则(1-投票结果排名,2-自定义竞猜结果)" json:"reward_rule"` + OpenPrize int64 `gorm:"column:open_prize;type:bigint;not null;index:idx_open_prize,priority:1;comment:开奖时间" json:"open_prize"` + OpenType int8 `gorm:"column:open_type;type:tinyint;not null;comment:开奖状态(1-未开奖,2-已开奖,3-不开奖)" json:"open_type"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:选项标题" json:"title"` + TOpen int64 `gorm:"column:t_open;type:bigint;not null;comment:提交上来的时间" json:"t_open"` +} + +// TableName FissionCampaignQuiz's table name +func (*FissionCampaignQuiz) TableName() string { + return TableNameFissionCampaignQuiz +} diff --git a/internal/repository/model/fission_campaign_quiz_option.gen.go b/internal/repository/model/fission_campaign_quiz_option.gen.go new file mode 100644 index 0000000..eca2972 --- /dev/null +++ b/internal/repository/model/fission_campaign_quiz_option.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQuizOption = "fission_campaign_quiz_option" + +// FissionCampaignQuizOption mapped from table +type FissionCampaignQuizOption struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:选项标题" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(255);not null;comment:选项图片" json:"img_url"` + IsRight int8 `gorm:"column:is_right;type:tinyint;not null;comment:是否正确选项(0-否,1-是)" json:"is_right"` + VoteNum int64 `gorm:"column:vote_num;type:bigint;not null;comment:投票数" json:"vote_num"` +} + +// TableName FissionCampaignQuizOption's table name +func (*FissionCampaignQuizOption) TableName() string { + return TableNameFissionCampaignQuizOption +} diff --git a/internal/repository/model/fission_campaign_quiz_reward.gen.go b/internal/repository/model/fission_campaign_quiz_reward.gen.go new file mode 100644 index 0000000..bd5ef85 --- /dev/null +++ b/internal/repository/model/fission_campaign_quiz_reward.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignQuizReward = "fission_campaign_quiz_reward" + +// FissionCampaignQuizReward mapped from table +type FissionCampaignQuizReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + CustomParams string `gorm:"column:custom_params;type:varchar(2000);not null;comment:跳转链接自定义参数" json:"custom_params"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` +} + +// TableName FissionCampaignQuizReward's table name +func (*FissionCampaignQuizReward) TableName() string { + return TableNameFissionCampaignQuizReward +} diff --git a/internal/repository/model/fission_campaign_referral.gen.go b/internal/repository/model/fission_campaign_referral.gen.go new file mode 100644 index 0000000..710ef3c --- /dev/null +++ b/internal/repository/model/fission_campaign_referral.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignReferral = "fission_campaign_referral" + +// FissionCampaignReferral mapped from table +type FissionCampaignReferral struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + RewardLimit int32 `gorm:"column:reward_limit;type:int;not null;comment:活动总奖励上限" json:"reward_limit"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:发奖方式(1-系统发放,2-联系用户发放)" json:"reward_type"` + Connect string `gorm:"column:connect;type:varchar(255);not null;comment:发奖联系方式" json:"connect"` + RewardRule int8 `gorm:"column:reward_rule;type:tinyint;not null;comment:用户奖励规则(1-阶梯,2-非阶梯)" json:"reward_rule"` + InviteLimit int32 `gorm:"column:invite_limit;type:int;not null;comment:邀请超过多少人不能再获得奖励" json:"invite_limit"` + StepLoop int8 `gorm:"column:step_loop;type:tinyint;not null;comment:阶梯是否支持循环(0-不支持,1-支持)" json:"step_loop"` +} + +// TableName FissionCampaignReferral's table name +func (*FissionCampaignReferral) TableName() string { + return TableNameFissionCampaignReferral +} diff --git a/internal/repository/model/fission_campaign_referral_reward.gen.go b/internal/repository/model/fission_campaign_referral_reward.gen.go new file mode 100644 index 0000000..8f8d7b8 --- /dev/null +++ b/internal/repository/model/fission_campaign_referral_reward.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignReferralReward = "fission_campaign_referral_reward" + +// FissionCampaignReferralReward mapped from table +type FissionCampaignReferralReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + ReferralID int64 `gorm:"column:referral_id;type:bigint;not null;index:idx_referral_id,priority:1;comment:老带新配置ID(fission_campaign_referral表)" json:"referral_id"` + Step int32 `gorm:"column:step;type:int;not null;comment:奖励阶段" json:"step"` + InviteNum int32 `gorm:"column:invite_num;type:int;not null;comment:需要邀请的人数" json:"invite_num"` + RewardNum int32 `gorm:"column:reward_num;type:int;not null;comment:获得的奖品数量" json:"reward_num"` + RewardTitle string `gorm:"column:reward_title;type:varchar(255);not null;comment:奖品名称" json:"reward_title"` + KvData string `gorm:"column:kv_data;type:varchar(2000);not null;comment:键值数据" json:"kv_data"` + IsExtra int8 `gorm:"column:is_extra;type:tinyint;not null;comment:是否额外的奖励(0-否,1-是)" json:"is_extra"` +} + +// TableName FissionCampaignReferralReward's table name +func (*FissionCampaignReferralReward) TableName() string { + return TableNameFissionCampaignReferralReward +} diff --git a/internal/repository/model/fission_campaign_reward.gen.go b/internal/repository/model/fission_campaign_reward.gen.go new file mode 100644 index 0000000..a55510c --- /dev/null +++ b/internal/repository/model/fission_campaign_reward.gen.go @@ -0,0 +1,50 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignReward = "fission_campaign_reward" + +// FissionCampaignReward mapped from table +type FissionCampaignReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + Stock int32 `gorm:"column:stock;type:int;not null;comment:奖品库存" json:"stock"` + KvData string `gorm:"column:kv_data;type:varchar(2000);not null;comment:跳转链接自定义参数" json:"kv_data"` + UseStock int32 `gorm:"column:use_stock;type:int;not null;comment:已发放奖品数" json:"use_stock"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品)" json:"reward_type"` + Step int32 `gorm:"column:step;type:int;not null;comment:奖励阶段" json:"step"` + InviteNum int32 `gorm:"column:invite_num;type:int;not null;comment:需要邀请的人数" json:"invite_num"` + RewardNum int32 `gorm:"column:reward_num;type:int;not null;comment:获得的奖品数量" json:"reward_num"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` + Score int32 `gorm:"column:score;type:int;not null;comment:领取奖品的分数" json:"score"` + OldID int64 `gorm:"column:old_id;type:bigint;not null;comment:迁移前旧id" json:"old_id"` + SignDay int32 `gorm:"column:sign_day;type:int;not null;comment:签到天数" json:"sign_day"` + CollectNum int32 `gorm:"column:collect_num;type:int;not null;comment:收集碎片数" json:"collect_num"` + CollectRule string `gorm:"column:collect_rule;type:varchar(255);not null;comment:收集规则" json:"collect_rule"` + IsSuper int8 `gorm:"column:is_super;type:tinyint;not null;comment:是否超级大奖" json:"is_super"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id(reward表)" json:"reward_id"` + LangMark string `gorm:"column:lang_mark;type:varchar(10);not null;comment:奖品归属语言标识" json:"lang_mark"` + LevelID int64 `gorm:"column:level_id;type:bigint;not null;comment:奖品归属用户等级id(fission_user_level表)" json:"level_id"` + Odds int32 `gorm:"column:odds;type:int;not null;comment:中奖概率" json:"odds"` + CountryMark string `gorm:"column:country_mark;type:varchar(4);not null;comment:奖品归属国家标识" json:"country_mark"` + JumpURL string `gorm:"column:jump_url;type:varchar(255);not null;comment:跳转地址" json:"jump_url"` + HasRule int8 `gorm:"column:has_rule;type:tinyint;not null;comment:是否有领奖规则(0-否,1-是)" json:"has_rule"` + InitPercent float64 `gorm:"column:init_percent;type:decimal(5,2);not null;default:0.00;comment:初始助力进度" json:"init_percent"` + PropMark string `gorm:"column:prop_mark;type:varchar(255);not null;comment:道具类型(reward-奖品,chance-活动道具,point-积分)" json:"prop_mark"` + ExpiredDay string `gorm:"column:expired_day;type:varchar(10);not null;comment:过期天数" json:"expired_day"` + OpenAdd int8 `gorm:"column:open_add;type:tinyint;not null;comment:是否开启动态库存" json:"open_add"` + OpenTask int8 `gorm:"column:open_task;type:tinyint;not null;comment:开启任务解锁" json:"open_task"` +} + +// TableName FissionCampaignReward's table name +func (*FissionCampaignReward) TableName() string { + return TableNameFissionCampaignReward +} diff --git a/internal/repository/model/fission_campaign_reward.go b/internal/repository/model/fission_campaign_reward.go new file mode 100644 index 0000000..b42a21f --- /dev/null +++ b/internal/repository/model/fission_campaign_reward.go @@ -0,0 +1,50 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/verify" + "strconv" + "time" +) + +func (s *FissionCampaignReward) SetKvData(val []*mtype.KV) { + s.KvData, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignReward) GetKvData() (val []*mtype.KV) { + _ = jsonm.StrUnmarshal(s.KvData, &val) + return +} + +func (s *FissionCampaignReward) GetWin() bool { + // 不是谢谢参与,或者不是固定的配置奖品,都是赢了奖品 + return s.IsThank == mtype.No || !verify.InArray(s.RewardID, -1, -2) +} + +func (s *FissionCampaignReward) SetCollectRule(val mtype.CollectRule) { + s.CollectRule, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignReward) GetCollectRule() (val mtype.CollectRule) { + _ = jsonm.StrUnmarshal(s.CollectRule, &val) + return +} + +func (s *FissionCampaignReward) ExpiredAt() int64 { + if s.ExpiredDay == "0" || s.ExpiredDay == "" { + return time.Now().AddDate(20, 0, 0).Unix() + } + + day, _ := strconv.Atoi(s.ExpiredDay) + + return time.Now().AddDate(0, 0, day).Unix() +} + +func (s *FissionCampaignReward) IsExpired() int8 { + if s.ExpiredDay == "0" || s.ExpiredDay == "" { + return mtype.No + } + + return mtype.Yes +} diff --git a/internal/repository/model/fission_campaign_reward_add.gen.go b/internal/repository/model/fission_campaign_reward_add.gen.go new file mode 100644 index 0000000..c5b9db9 --- /dev/null +++ b/internal/repository/model/fission_campaign_reward_add.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignRewardAdd = "fission_campaign_reward_add" + +// FissionCampaignRewardAdd mapped from table +type FissionCampaignRewardAdd struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id" json:"reward_id"` + Start int64 `gorm:"column:start;type:bigint;not null;index:idx_start_finish_at,priority:1;comment:开始时间" json:"start"` + End int64 `gorm:"column:end;type:bigint;not null;comment:结束时间" json:"end"` + DayNum int32 `gorm:"column:day_num;type:int;not null;comment:每多少天" json:"day_num"` + DayAdd int32 `gorm:"column:day_add;type:int;not null;comment:追加库存数量" json:"day_add"` + FinishAt int64 `gorm:"column:finish_at;type:bigint;not null;index:idx_start_finish_at,priority:2;comment:完成时间" json:"finish_at"` +} + +// TableName FissionCampaignRewardAdd's table name +func (*FissionCampaignRewardAdd) TableName() string { + return TableNameFissionCampaignRewardAdd +} diff --git a/internal/repository/model/fission_campaign_reward_add_log.gen.go b/internal/repository/model/fission_campaign_reward_add_log.gen.go new file mode 100644 index 0000000..06c74f1 --- /dev/null +++ b/internal/repository/model/fission_campaign_reward_add_log.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignRewardAddLog = "fission_campaign_reward_add_log" + +// FissionCampaignRewardAddLog mapped from table +type FissionCampaignRewardAddLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id" json:"reward_id"` + AddAt int64 `gorm:"column:add_at;type:bigint;not null;comment:追加的日期" json:"add_at"` + DayAdd int32 `gorm:"column:day_add;type:int;not null;comment:追加库存数量" json:"day_add"` + BeforeAdd int32 `gorm:"column:before_add;type:int;not null;comment:追加前库存数量" json:"before_add"` +} + +// TableName FissionCampaignRewardAddLog's table name +func (*FissionCampaignRewardAddLog) TableName() string { + return TableNameFissionCampaignRewardAddLog +} diff --git a/internal/repository/model/fission_campaign_reward_help.gen.go b/internal/repository/model/fission_campaign_reward_help.gen.go new file mode 100644 index 0000000..f567503 --- /dev/null +++ b/internal/repository/model/fission_campaign_reward_help.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignRewardHelp = "fission_campaign_reward_help" + +// FissionCampaignRewardHelp mapped from table +type FissionCampaignRewardHelp struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id(fission_campaign_reward表)" json:"reward_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;comment:助力标识" json:"mark"` + Percent float64 `gorm:"column:percent;type:decimal(5,2);not null;default:0.00;comment:助力进度" json:"percent"` + LimitPercent float64 `gorm:"column:limit_percent;type:decimal(5,2);not null;default:0.00;comment:最大获取助力进度" json:"limit_percent"` +} + +// TableName FissionCampaignRewardHelp's table name +func (*FissionCampaignRewardHelp) TableName() string { + return TableNameFissionCampaignRewardHelp +} diff --git a/internal/repository/model/fission_campaign_reward_rule.gen.go b/internal/repository/model/fission_campaign_reward_rule.gen.go new file mode 100644 index 0000000..e6bc29c --- /dev/null +++ b/internal/repository/model/fission_campaign_reward_rule.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignRewardRule = "fission_campaign_reward_rule" + +// FissionCampaignRewardRule mapped from table +type FissionCampaignRewardRule struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;uniqueIndex:uniq_reward_id,priority:1;comment:奖品id(fission_campaign_reward表)" json:"reward_id"` + CampaignLimit int32 `gorm:"column:campaign_limit;type:int;not null;comment:活动内单个用户可获得奖品数限制" json:"campaign_limit"` +} + +// TableName FissionCampaignRewardRule's table name +func (*FissionCampaignRewardRule) TableName() string { + return TableNameFissionCampaignRewardRule +} diff --git a/internal/repository/model/fission_campaign_sign.gen.go b/internal/repository/model/fission_campaign_sign.gen.go new file mode 100644 index 0000000..4db8f97 --- /dev/null +++ b/internal/repository/model/fission_campaign_sign.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignSign = "fission_campaign_sign" + +// FissionCampaignSign mapped from table +type FissionCampaignSign struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + SignType int8 `gorm:"column:sign_type;type:tinyint;not null;comment:签到类型(1-普通签到,2-阶梯签到,3-周期签到)" json:"sign_type"` + IsContinue int8 `gorm:"column:is_continue;type:tinyint;not null;comment:是否连续签到(1-是,0-否)" json:"is_continue"` + HasCard int8 `gorm:"column:has_card;type:tinyint;not null;comment:是否开启签到卡(1-开启,0-不开启)" json:"has_card"` + InviteNum int32 `gorm:"column:invite_num;type:int;not null;comment:邀请好友数可获得签到卡" json:"invite_num"` + IsLoop int8 `gorm:"column:is_loop;type:tinyint;not null;comment:是否支持阶梯可循环(0-否,1-是)" json:"is_loop"` + SignCycle int32 `gorm:"column:sign_cycle;type:int;not null;comment:签到周期" json:"sign_cycle"` + RecycleType int8 `gorm:"column:recycle_type;type:tinyint;not null;comment:重新签到模式(1-断签重签,2-周期重签)" json:"recycle_type"` + Color string `gorm:"column:color;type:varchar(10);not null;comment:主题颜色" json:"color"` +} + +// TableName FissionCampaignSign's table name +func (*FissionCampaignSign) TableName() string { + return TableNameFissionCampaignSign +} diff --git a/internal/repository/model/fission_campaign_slot.gen.go b/internal/repository/model/fission_campaign_slot.gen.go new file mode 100644 index 0000000..4e25eb2 --- /dev/null +++ b/internal/repository/model/fission_campaign_slot.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignSlot = "fission_campaign_slot" + +// FissionCampaignSlot mapped from table +type FissionCampaignSlot struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始抽奖机会次数" json:"init_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的抽奖机会次数" json:"chance"` + Odds int32 `gorm:"column:odds;type:int;not null;comment:中奖概率" json:"odds"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽奖次数" json:"day_chance"` +} + +// TableName FissionCampaignSlot's table name +func (*FissionCampaignSlot) TableName() string { + return TableNameFissionCampaignSlot +} diff --git a/internal/repository/model/fission_campaign_slot_reward.gen.go b/internal/repository/model/fission_campaign_slot_reward.gen.go new file mode 100644 index 0000000..47979ba --- /dev/null +++ b/internal/repository/model/fission_campaign_slot_reward.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignSlotReward = "fission_campaign_slot_reward" + +// FissionCampaignSlotReward mapped from table +type FissionCampaignSlotReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + SlotID int64 `gorm:"column:slot_id;type:bigint;not null;index:idx_slot_id,priority:1;comment:老虎机配置ID(fission_campaign_slot主键)" json:"slot_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + Stock int32 `gorm:"column:stock;type:int;not null;comment:奖品库存" json:"stock"` + JumpURL string `gorm:"column:jump_url;type:varchar(255);not null;comment:跳转链接" json:"jump_url"` + CustomParams string `gorm:"column:custom_params;type:varchar(2000);not null;comment:跳转链接自定义参数" json:"custom_params"` + UseStock int32 `gorm:"column:use_stock;type:int;not null;comment:已发放奖品数" json:"use_stock"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionCampaignSlotReward's table name +func (*FissionCampaignSlotReward) TableName() string { + return TableNameFissionCampaignSlotReward +} diff --git a/internal/repository/model/fission_campaign_style.gen.go b/internal/repository/model/fission_campaign_style.gen.go new file mode 100644 index 0000000..6baf31a --- /dev/null +++ b/internal/repository/model/fission_campaign_style.gen.go @@ -0,0 +1,52 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignStyle = "fission_campaign_style" + +// FissionCampaignStyle mapped from table +type FissionCampaignStyle struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:uniq_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RuleTextColor string `gorm:"column:rule_text_color;type:varchar(10);not null;comment:规则文字颜色" json:"rule_text_color"` + RuleBgColor string `gorm:"column:rule_bg_color;type:varchar(10);not null;comment:规则背景颜色" json:"rule_bg_color"` + ShareText string `gorm:"column:share_text;type:varchar(255);not null;comment:分享文案" json:"share_text"` + ShareImg string `gorm:"column:share_img;type:varchar(64);not null;comment:分享图片" json:"share_img"` + RankBackgroundColor string `gorm:"column:rank_background_color;type:varchar(10);not null;comment:排行榜背景颜色" json:"rank_background_color"` + RankTextColor string `gorm:"column:rank_text_color;type:varchar(10);not null;comment:排行榜字体颜色" json:"rank_text_color"` + LinkBtnTextColor string `gorm:"column:link_btn_text_color;type:varchar(10);not null;comment:分享链接按钮文字颜色" json:"link_btn_text_color"` + LinkBtnBgColor string `gorm:"column:link_btn_bg_color;type:varchar(10);not null;comment:分享链接按钮背景颜色" json:"link_btn_bg_color"` + LinkTextColor string `gorm:"column:link_text_color;type:varchar(10);not null;comment:分享链接文字颜色" json:"link_text_color"` + PageTitle string `gorm:"column:page_title;type:varchar(255);not null;comment:页面标题" json:"page_title"` + IconType int8 `gorm:"column:icon_type;type:tinyint;not null;comment:活动挂件样式(用于前端挂件选用判断)" json:"icon_type"` + IconBgColor string `gorm:"column:icon_bg_color;type:varchar(10);not null;comment:活动挂件背景色" json:"icon_bg_color"` + IconTextColor string `gorm:"column:icon_text_color;type:varchar(10);not null;comment:活动挂件文字颜色" json:"icon_text_color"` + MainImg string `gorm:"column:main_img;type:varchar(128);not null;comment:活动背景图" json:"main_img"` + WechatImg string `gorm:"column:wechat_img;type:varchar(128);not null;comment:微信引导页" json:"wechat_img"` + DownloadImg string `gorm:"column:download_img;type:varchar(128);not null;comment:下载引导页" json:"download_img"` + WebImg string `gorm:"column:web_img;type:varchar(128);not null;comment:站外活动背景图" json:"web_img"` + Share string `gorm:"column:share;type:varchar(255);not null;comment:要分享的社交媒体,例如[1,2,3]" json:"share"` + WarmUpImg string `gorm:"column:warm_up_img;type:varchar(128);not null;comment:预热海报图" json:"warm_up_img"` + WarmUpEnd int32 `gorm:"column:warm_up_end;type:int;not null;comment:活动开始前多少分钟结束预热" json:"warm_up_end"` + DlBannerImg string `gorm:"column:dl_banner_img;type:varchar(255);not null;comment:下载页横幅自定义图" json:"dl_banner_img"` + DlBannerAppLogo string `gorm:"column:dl_banner_app_logo;type:varchar(255);not null;comment:下载页横幅applogo图片" json:"dl_banner_app_logo"` + DlBannerAppName string `gorm:"column:dl_banner_app_name;type:varchar(64);not null;comment:下载页横幅app名称" json:"dl_banner_app_name"` + DlBannerAppBtn string `gorm:"column:dl_banner_app_btn;type:varchar(64);not null;comment:下载页横幅app按钮文案" json:"dl_banner_app_btn"` + DlBannerPosition int8 `gorm:"column:dl_banner_position;type:tinyint;not null;comment:下载页横幅位置(1-顶部,2-底部)" json:"dl_banner_position"` + TopicColor string `gorm:"column:topic_color;type:varchar(10);not null;comment:主题颜色" json:"topic_color"` + IconOpen string `gorm:"column:icon_open;type:varchar(64);not null;comment:开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友)" json:"icon_open"` + PcBg string `gorm:"column:pc_bg;type:varchar(64);not null;comment:Pc适配背景图" json:"pc_bg"` + CustomStyle string `gorm:"column:custom_style;type:text;not null;comment:自定义样式数据" json:"custom_style"` + PlayRule string `gorm:"column:play_rule;type:text;not null;comment:活动规则" json:"play_rule"` + RuleImg string `gorm:"column:rule_img;type:varchar(128);not null;comment:活动规则图片" json:"rule_img"` + BgImg string `gorm:"column:bg_img;type:varchar(128);not null;comment:玩法背景图(如:问题背景图)" json:"bg_img"` +} + +// TableName FissionCampaignStyle's table name +func (*FissionCampaignStyle) TableName() string { + return TableNameFissionCampaignStyle +} diff --git a/internal/repository/model/fission_campaign_style.go b/internal/repository/model/fission_campaign_style.go new file mode 100644 index 0000000..a56c3b7 --- /dev/null +++ b/internal/repository/model/fission_campaign_style.go @@ -0,0 +1,60 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionCampaignStyle) SetShare(val []int64) { + m.Share, _ = jsonm.MarshalToString(val) +} + +func (m *FissionCampaignStyle) GetShare() (val []int64) { + _ = jsonm.StrUnmarshal(m.Share, &val) + return +} + +func (m *FissionCampaignStyle) SetIconOpen(val []int32) { + m.IconOpen, _ = jsonm.MarshalToString(val) +} + +func (m *FissionCampaignStyle) GetIconOpen() (val []int32) { + _ = jsonm.StrUnmarshal(m.IconOpen, &val) + return +} + +func (m *FissionCampaignStyle) SetWheelStyle(val mtype.WheelStyle) { + m.CustomStyle, _ = jsonm.ToObjString(val) +} + +func (m *FissionCampaignStyle) GetWheelStyle() (val mtype.WheelStyle) { + _ = jsonm.StrUnmarshal(m.CustomStyle, &val) + return +} + +func (m *FissionCampaignStyle) SetGridStyle(val mtype.GridStyle) { + m.CustomStyle, _ = jsonm.ToObjString(val) +} + +func (m *FissionCampaignStyle) GetGridStyle() (val mtype.GridStyle) { + _ = jsonm.StrUnmarshal(m.CustomStyle, &val) + return +} + +func (m *FissionCampaignStyle) SetFlipStyle(val mtype.FlipStyle) { + m.CustomStyle, _ = jsonm.ToObjString(val) +} + +func (m *FissionCampaignStyle) GetFlipStyle() (val mtype.FlipStyle) { + _ = jsonm.StrUnmarshal(m.CustomStyle, &val) + return +} + +func (m *FissionCampaignStyle) SetGashaponStyle(val mtype.GashaponStyle) { + m.CustomStyle, _ = jsonm.ToObjString(val) +} + +func (m *FissionCampaignStyle) GetGashaponStyle() (val mtype.GashaponStyle) { + _ = jsonm.StrUnmarshal(m.CustomStyle, &val) + return +} diff --git a/internal/repository/model/fission_campaign_task.gen.go b/internal/repository/model/fission_campaign_task.gen.go new file mode 100644 index 0000000..3c653c4 --- /dev/null +++ b/internal/repository/model/fission_campaign_task.gen.go @@ -0,0 +1,40 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignTask = "fission_campaign_task" + +// FissionCampaignTask mapped from table +type FissionCampaignTask struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_type_mark,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + TaskType int8 `gorm:"column:task_type;type:tinyint;not null;comment:任务类型(1-下载app,2-注册-app,3-满足所有自定义条件,4-满足特定自定义条件)" json:"task_type"` + TaskMark string `gorm:"column:task_mark;type:varchar(32);not null;index:idx_campaign_id_type_mark,priority:2;comment:任务类型标识" json:"task_mark"` + PropMark string `gorm:"column:prop_mark;type:varchar(32);not null;comment:发放的道具标识(chance-次数,fixed_roll-幸运骰,reward-奖品)" json:"prop_mark"` + Num int32 `gorm:"column:num;type:int;not null;comment:完成所需要的触发次数" json:"num"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:完成发放的次数(如:骰子数)" json:"chance"` + ChanceLimit int32 `gorm:"column:chance_limit;type:int;not null;comment:最大可发放的次数" json:"chance_limit"` + TaskLimit int32 `gorm:"column:task_limit;type:int;not null;comment:任务最大可完成次数" json:"task_limit"` + Percent float64 `gorm:"column:percent;type:double(10,6);not null;default:0.000000;comment:完成发放的百分比值" json:"percent"` + PercentLimit float64 `gorm:"column:percent_limit;type:decimal(10,6);not null;default:0.000000;comment:最大获得的百分比值" json:"percent_limit"` + DayLimit int32 `gorm:"column:day_limit;type:int;not null;comment:每日可完成任务的次数(0为不限制)" json:"day_limit"` + LevelLimit string `gorm:"column:level_limit;type:varchar(1000);not null;default:0;comment:用户等级ID集合" json:"level_limit"` + LangMarks string `gorm:"column:lang_marks;type:varchar(255);not null;comment:语言限制集合" json:"lang_marks"` + WeekLimit int32 `gorm:"column:week_limit;type:int;not null;comment:每周限制数" json:"week_limit"` + WeekNum int8 `gorm:"column:week_num;type:tinyint;not null;comment:周几刷新" json:"week_num"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:发放的奖励id" json:"reward_id"` + HasPre int8 `gorm:"column:has_pre;type:tinyint;not null;comment:是否有前置条件(0-否,1-是)" json:"has_pre"` + PreCond int32 `gorm:"column:pre_cond;type:int;not null;comment:前置条件" json:"pre_cond"` + ExpiredMin int32 `gorm:"column:expired_min;type:int;not null;comment:过期分钟" json:"expired_min"` + AwardMode int8 `gorm:"column:award_mode;type:tinyint;not null;comment:领奖模式(0-自动领奖,1-手动领奖)" json:"award_mode"` +} + +// TableName FissionCampaignTask's table name +func (*FissionCampaignTask) TableName() string { + return TableNameFissionCampaignTask +} diff --git a/internal/repository/model/fission_campaign_task.go b/internal/repository/model/fission_campaign_task.go new file mode 100644 index 0000000..fcad75b --- /dev/null +++ b/internal/repository/model/fission_campaign_task.go @@ -0,0 +1,23 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (s *FissionCampaignTask) SetLevelLimit(ids []int64) { + s.LevelLimit, _ = jsonm.ToSliceString(ids) +} + +func (s *FissionCampaignTask) GetLevelLimit() (ids []int64) { + _ = jsonm.StrUnmarshal(s.LevelLimit, &ids) + return +} + +func (s *FissionCampaignTask) SetLangMarks(ids []string) { + s.LangMarks, _ = jsonm.ToSliceString(ids) +} + +func (s *FissionCampaignTask) GetLangMarks() (ids []string) { + _ = jsonm.StrUnmarshal(s.LangMarks, &ids) + return +} diff --git a/internal/repository/model/fission_campaign_ticket.gen.go b/internal/repository/model/fission_campaign_ticket.gen.go new file mode 100644 index 0000000..6708b8f --- /dev/null +++ b/internal/repository/model/fission_campaign_ticket.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignTicket = "fission_campaign_ticket" + +// FissionCampaignTicket mapped from table +type FissionCampaignTicket struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:uniq_campaign_id_mark,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(12);not null;index:uniq_campaign_id_mark,priority:2;comment:支持规则标识(fixed-固定事件,custom-自定义事件,reward_help-奖品助力)" json:"mark"` + Open int8 `gorm:"column:open;type:tinyint;not null;comment:开启状态(0-未开启,1-开启)" json:"open"` + AppEvent int8 `gorm:"column:app_event;type:tinyint;not null;comment:固定事件选项(1-安装;2-注册)" json:"app_event"` + BothType int8 `gorm:"column:both_type;type:tinyint;not null;comment:自定义事件满足条件(1-所有条件满足,2-任一条件满足)\n" json:"both_type"` + HelpEvent string `gorm:"column:help_event;type:varchar(255);not null;comment:支持助力事件(help_install,help_register,help_click,help_open)" json:"help_event"` + PreEvent int8 `gorm:"column:pre_event;type:tinyint;not null;comment:自定义事件前置事件(1-安装;2-注册)" json:"pre_event"` +} + +// TableName FissionCampaignTicket's table name +func (*FissionCampaignTicket) TableName() string { + return TableNameFissionCampaignTicket +} diff --git a/internal/repository/model/fission_campaign_ticket.go b/internal/repository/model/fission_campaign_ticket.go new file mode 100644 index 0000000..1cd8a1a --- /dev/null +++ b/internal/repository/model/fission_campaign_ticket.go @@ -0,0 +1,9 @@ +package model + +import ( + "strings" +) + +func (s *FissionCampaignTicket) GetHelpEvent() (val []string) { + return strings.Split(s.HelpEvent, ",") +} diff --git a/internal/repository/model/fission_campaign_uno.gen.go b/internal/repository/model/fission_campaign_uno.gen.go new file mode 100644 index 0000000..758d0c7 --- /dev/null +++ b/internal/repository/model/fission_campaign_uno.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignUno = "fission_campaign_uno" + +// FissionCampaignUno mapped from table +type FissionCampaignUno struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始投票次数" json:"init_chance"` + PropMarks string `gorm:"column:prop_marks;type:varchar(255);not null;comment:开启的道具(three-+3道具卡,five-+5道具卡,fix-固定颜色道具卡)" json:"prop_marks"` +} + +// TableName FissionCampaignUno's table name +func (*FissionCampaignUno) TableName() string { + return TableNameFissionCampaignUno +} diff --git a/internal/repository/model/fission_campaign_uno.go b/internal/repository/model/fission_campaign_uno.go new file mode 100644 index 0000000..1450a11 --- /dev/null +++ b/internal/repository/model/fission_campaign_uno.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (s *FissionCampaignUno) SetPropMarks(val []string) { + s.PropMarks, _ = jsonm.ToSliceString(val) +} + +func (s *FissionCampaignUno) GetPropMarks() (val []string) { + _ = jsonm.StrUnmarshal(s.PropMarks, &val) + return +} diff --git a/internal/repository/model/fission_campaign_uno_card.gen.go b/internal/repository/model/fission_campaign_uno_card.gen.go new file mode 100644 index 0000000..fa25625 --- /dev/null +++ b/internal/repository/model/fission_campaign_uno_card.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignUnoCard = "fission_campaign_uno_card" + +// FissionCampaignUnoCard mapped from table +type FissionCampaignUnoCard struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark_ card_no,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(10);not null;comment:牌色标识" json:"mark"` + CardNo int32 `gorm:"column:card_no;type:int;not null;uniqueIndex:uniq_campaign_id_mark_ card_no,priority:2;comment:牌号" json:"card_no"` + Title string `gorm:"column:title;type:varchar(64);not null;comment:跳转按钮文案" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:图片地址" json:"img_url"` + WebURL string `gorm:"column:web_url;type:varchar(255);not null;comment:Web跳转地址" json:"web_url"` + AppParam string `gorm:"column:app_param;type:varchar(255);not null;comment:App跳转参数" json:"app_param"` + PcParam string `gorm:"column:pc_param;type:varchar(255);not null;comment:pc跳转参数" json:"pc_param"` +} + +// TableName FissionCampaignUnoCard's table name +func (*FissionCampaignUnoCard) TableName() string { + return TableNameFissionCampaignUnoCard +} diff --git a/internal/repository/model/fission_campaign_uno_group.gen.go b/internal/repository/model/fission_campaign_uno_group.gen.go new file mode 100644 index 0000000..6e58988 --- /dev/null +++ b/internal/repository/model/fission_campaign_uno_group.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignUnoGroup = "fission_campaign_uno_group" + +// FissionCampaignUnoGroup mapped from table +type FissionCampaignUnoGroup struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(10);not null;uniqueIndex:uniq_campaign_id_mark,priority:2;comment:牌色标识" json:"mark"` + Odds string `gorm:"column:odds;type:varchar(20);not null;comment:获得牌型概率" json:"odds"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id" json:"reward_id"` + OpenRule int8 `gorm:"column:open_rule;type:tinyint;not null;comment:是否开启得派规则(0-否,1-时)" json:"open_rule"` + LimitRule string `gorm:"column:limit_rule;type:varchar(255);not null;comment:上限规则" json:"limit_rule"` + CustomCard int8 `gorm:"column:custom_card;type:tinyint;not null;comment:自定义卡牌(0-否,1-是)" json:"custom_card"` +} + +// TableName FissionCampaignUnoGroup's table name +func (*FissionCampaignUnoGroup) TableName() string { + return TableNameFissionCampaignUnoGroup +} diff --git a/internal/repository/model/fission_campaign_uno_group.go b/internal/repository/model/fission_campaign_uno_group.go new file mode 100644 index 0000000..e7ec34d --- /dev/null +++ b/internal/repository/model/fission_campaign_uno_group.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCampaignUnoGroup) SetLimitRule(val mtype.UnoLimitRule) { + s.LimitRule, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCampaignUnoGroup) GetLimitRule() (val mtype.UnoLimitRule) { + _ = jsonm.StrUnmarshal(s.LimitRule, &val) + return +} diff --git a/internal/repository/model/fission_campaign_vs.gen.go b/internal/repository/model/fission_campaign_vs.gen.go new file mode 100644 index 0000000..6a97c94 --- /dev/null +++ b/internal/repository/model/fission_campaign_vs.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignV = "fission_campaign_vs" + +// FissionCampaignV mapped from table +type FissionCampaignV struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始投票次数" json:"init_chance"` + EachLimitNum int32 `gorm:"column:each_limit_num;type:int;not null;comment:每场可投票次数" json:"each_limit_num"` + OpenPoint int8 `gorm:"column:open_point;type:tinyint;not null;comment:是否开启积分(0-否,1-时)" json:"open_point"` + PointsNum int32 `gorm:"column:points_num;type:int;not null;comment:投票扣除积分数" json:"points_num"` + MallOpen int8 `gorm:"column:mall_open;type:tinyint;not null;comment:是否使用积分商城(0-否,1-是)" json:"mall_open"` + MallID int64 `gorm:"column:mall_id;type:bigint;not null;comment:兑换商城id" json:"mall_id"` + VsTz int32 `gorm:"column:vs_tz;type:int;not null;comment:比赛时区" json:"vs_tz"` + ClaimType int8 `gorm:"column:claim_type;type:tinyint;not null;comment:领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖)" json:"claim_type"` + IconMall string `gorm:"column:icon_mall;type:varchar(128);not null;comment:商城图标" json:"icon_mall"` + IconReward string `gorm:"column:icon_reward;type:varchar(128);not null;comment:奖励记录图标" json:"icon_reward"` + IconSchedule string `gorm:"column:icon_schedule;type:varchar(128);not null;comment:赛程图标" json:"icon_schedule"` +} + +// TableName FissionCampaignV's table name +func (*FissionCampaignV) TableName() string { + return TableNameFissionCampaignV +} diff --git a/internal/repository/model/fission_campaign_vs_schedule.gen.go b/internal/repository/model/fission_campaign_vs_schedule.gen.go new file mode 100644 index 0000000..da7448d --- /dev/null +++ b/internal/repository/model/fission_campaign_vs_schedule.gen.go @@ -0,0 +1,35 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignVsSchedule = "fission_campaign_vs_schedule" + +// FissionCampaignVsSchedule mapped from table +type FissionCampaignVsSchedule struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_vs_idx,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + VsIdx int32 `gorm:"column:vs_idx;type:int;not null;index:idx_campaign_id_vs_idx,priority:2;comment:赛程" json:"vs_idx"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id(fission_campaign_reward表)" json:"reward_id"` + VsTeamIds string `gorm:"column:vs_team_ids;type:varchar(255);not null;comment:对战队伍id" json:"vs_team_ids"` + VoteStart int64 `gorm:"column:vote_start;type:bigint;not null;comment:投票开始时间" json:"vote_start"` + VoteEnd int64 `gorm:"column:vote_end;type:bigint;not null;comment:投票结束时间" json:"vote_end"` + VsAt int64 `gorm:"column:vs_at;type:bigint;not null;comment:开赛时间" json:"vs_at"` + VsImg string `gorm:"column:vs_img;type:varchar(128);not null;comment:对战图" json:"vs_img"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:标题描述" json:"desc"` + IsSettlement int8 `gorm:"column:is_settlement;type:tinyint;not null;comment:是否已经结算(0-否,1-是)" json:"is_settlement"` + OtherVote string `gorm:"column:other_vote;type:varchar(255);not null;comment:额外投票选项" json:"other_vote"` + Settlement string `gorm:"column:settlement;type:text;not null;comment:结算数据" json:"settlement"` + OpenOdds int8 `gorm:"column:open_odds;type:tinyint;not null;comment:开启赔率" json:"open_odds"` + OddsLeft string `gorm:"column:odds_left;type:varchar(10);not null;comment:左边赔率" json:"odds_left"` + OddsRight string `gorm:"column:odds_right;type:varchar(10);not null;comment:右边赔率" json:"odds_right"` + OddsDraw string `gorm:"column:odds_draw;type:varchar(10);not null;comment:平局赔率" json:"odds_draw"` +} + +// TableName FissionCampaignVsSchedule's table name +func (*FissionCampaignVsSchedule) TableName() string { + return TableNameFissionCampaignVsSchedule +} diff --git a/internal/repository/model/fission_campaign_vs_schedule.go b/internal/repository/model/fission_campaign_vs_schedule.go new file mode 100644 index 0000000..523d15e --- /dev/null +++ b/internal/repository/model/fission_campaign_vs_schedule.go @@ -0,0 +1,93 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" + "time" +) + +func (s *FissionCampaignVsSchedule) GetVsTeamIds() (val []int64) { + _ = jsonm.StrUnmarshal(s.VsTeamIds, &val) + return +} + +func (s *FissionCampaignVsSchedule) SetVsTeamIds(val []int64) { + s.VsTeamIds, _ = jsonm.ToSliceString(val) +} + +func (s *FissionCampaignVsSchedule) GetOtherVote() (val []string) { + _ = jsonm.StrUnmarshal(s.OtherVote, &val) + return +} + +func (s *FissionCampaignVsSchedule) SetOtherVote(val []string) { + s.OtherVote, _ = jsonm.ToSliceString(val) +} + +func (s *FissionCampaignVsSchedule) GetStatus() int32 { + if s.IsSettlement == mtype.Yes { + return mtype.FissionCampaignVsScheduleStatusSettlement + } + + if (s.VoteStart == 0 && s.VoteEnd == 0) || s.VsAt == 0 { + return mtype.FissionCampaignVsScheduleStatusNotFinish + } + + now := time.Now().Unix() + + if s.VoteStart <= now && s.VoteEnd > now { + return mtype.FissionCampaignVsScheduleStatusVote + } + + if s.VoteStart > now { + return mtype.FissionCampaignVsScheduleStatusWait + } + + if s.IsSettlement == mtype.No && s.VsAt < now { + return mtype.FissionCampaignVsScheduleStatusRunning + } + + if s.IsSettlement == mtype.No && s.VsAt >= now { + return mtype.FissionCampaignVsScheduleStatusWaitVs + } + + return mtype.FissionCampaignVsScheduleStatusNotFinish +} + +func (s *FissionCampaignVsSchedule) SetSettlement(val *mtype.FissionCampaignVsScheduleSettlement) { + s.Settlement, _ = jsonm.ToObjString(val) +} + +func (s *FissionCampaignVsSchedule) GetSettlement() (val mtype.FissionCampaignVsScheduleSettlement) { + _ = jsonm.StrUnmarshal(s.Settlement, &val) + return +} + +func (s *FissionCampaignVsSchedule) GetOdds() (val string) { + if s.OpenOdds == mtype.No { + return "1" + } + + slt := s.GetSettlement() + + if slt.WinType == mtype.FissionCampaignVsScheduleWinTypeDraw { + return s.OddsDraw + } + + if slt.WinType == mtype.FissionCampaignVsScheduleWinTypeWin { + for i, v := range s.GetVsTeamIds() { + if v != slt.WinTeamId { + continue + } + + switch i { + case 0: + return s.OddsLeft + case 1: + return s.OddsRight + } + } + } + + return "1" +} diff --git a/internal/repository/model/fission_campaign_vs_team.gen.go b/internal/repository/model/fission_campaign_vs_team.gen.go new file mode 100644 index 0000000..ca02263 --- /dev/null +++ b/internal/repository/model/fission_campaign_vs_team.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignVsTeam = "fission_campaign_vs_team" + +// FissionCampaignVsTeam mapped from table +type FissionCampaignVsTeam struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Name string `gorm:"column:name;type:varchar(64);not null;comment:队伍名称" json:"name"` + LogoImg string `gorm:"column:logo_img;type:varchar(128);not null;comment:队伍图标" json:"logo_img"` +} + +// TableName FissionCampaignVsTeam's table name +func (*FissionCampaignVsTeam) TableName() string { + return TableNameFissionCampaignVsTeam +} diff --git a/internal/repository/model/fission_campaign_wheel.gen.go b/internal/repository/model/fission_campaign_wheel.gen.go new file mode 100644 index 0000000..73d18f5 --- /dev/null +++ b/internal/repository/model/fission_campaign_wheel.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignWheel = "fission_campaign_wheel" + +// FissionCampaignWheel mapped from table +type FissionCampaignWheel struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID" json:"campaign_id"` + TargetNum int32 `gorm:"column:target_num;type:int;not null;comment:达标条件需要的新用户个数" json:"target_num"` + InitChance int32 `gorm:"column:init_chance;type:int;not null;comment:初始答题机会次数" json:"init_chance"` + Odds int32 `gorm:"column:odds;type:int;not null;comment:中奖概率" json:"odds"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日获得的抽奖次数" json:"day_chance"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:达标获得的抽奖机会次数" json:"chance"` +} + +// TableName FissionCampaignWheel's table name +func (*FissionCampaignWheel) TableName() string { + return TableNameFissionCampaignWheel +} diff --git a/internal/repository/model/fission_campaign_wheel_reward.gen.go b/internal/repository/model/fission_campaign_wheel_reward.gen.go new file mode 100644 index 0000000..7838661 --- /dev/null +++ b/internal/repository/model/fission_campaign_wheel_reward.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignWheelReward = "fission_campaign_wheel_reward" + +// FissionCampaignWheelReward mapped from table +type FissionCampaignWheelReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + WheelID int64 `gorm:"column:wheel_id;type:bigint;not null;index:idx_wheel_id,priority:1;comment:大转盘配置ID(fission_campaign_wheel主键)" json:"wheel_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + Stock int32 `gorm:"column:stock;type:int;not null;comment:奖品库存" json:"stock"` + JumpURL string `gorm:"column:jump_url;type:varchar(255);not null;comment:跳转链接" json:"jump_url"` + CustomParams string `gorm:"column:custom_params;type:varchar(2000);not null;comment:跳转链接自定义参数" json:"custom_params"` + UseStock int32 `gorm:"column:use_stock;type:int;not null;comment:已发放奖品数" json:"use_stock"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与(0-否,1-是)" json:"is_thank"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionCampaignWheelReward's table name +func (*FissionCampaignWheelReward) TableName() string { + return TableNameFissionCampaignWheelReward +} diff --git a/internal/repository/model/fission_campaign_win.gen.go b/internal/repository/model/fission_campaign_win.gen.go new file mode 100644 index 0000000..2dea38f --- /dev/null +++ b/internal/repository/model/fission_campaign_win.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignWin = "fission_campaign_win" + +// FissionCampaignWin mapped from table +type FissionCampaignWin struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + RewardLimit int32 `gorm:"column:reward_limit;type:int;not null;comment:活动总奖励上限" json:"reward_limit"` + RewardRule int8 `gorm:"column:reward_rule;type:tinyint;not null;comment:用户奖励规则(1-阶梯,2-非阶梯)" json:"reward_rule"` + InviteLimit int32 `gorm:"column:invite_limit;type:int;not null;comment:邀请超过多少人不能再获得奖励" json:"invite_limit"` + NewcomerCond int8 `gorm:"column:newcomer_cond;type:tinyint;not null;default:1;comment:新人条件(1-新安装,2-助力成功,3-新安装且助力成功)" json:"newcomer_cond"` + StepLoop int8 `gorm:"column:step_loop;type:tinyint;not null;comment:阶梯是否支持循环(0-不支持,1-支持)" json:"step_loop"` +} + +// TableName FissionCampaignWin's table name +func (*FissionCampaignWin) TableName() string { + return TableNameFissionCampaignWin +} diff --git a/internal/repository/model/fission_campaign_win_reward.gen.go b/internal/repository/model/fission_campaign_win_reward.gen.go new file mode 100644 index 0000000..55ac3cb --- /dev/null +++ b/internal/repository/model/fission_campaign_win_reward.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCampaignWinReward = "fission_campaign_win_reward" + +// FissionCampaignWinReward mapped from table +type FissionCampaignWinReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Step int32 `gorm:"column:step;type:int;not null;comment:奖励阶段" json:"step"` + InviteNum int32 `gorm:"column:invite_num;type:int;not null;comment:需要邀请的人数" json:"invite_num"` + RewardNum int32 `gorm:"column:reward_num;type:int;not null;comment:获得的奖品数量" json:"reward_num"` + RewardTitle string `gorm:"column:reward_title;type:varchar(255);not null;comment:奖品名称" json:"reward_title"` + KvData string `gorm:"column:kv_data;type:varchar(2000);not null;comment:键值数据" json:"kv_data"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-任务奖品,2-额外奖,3-新人奖)" json:"reward_type"` +} + +// TableName FissionCampaignWinReward's table name +func (*FissionCampaignWinReward) TableName() string { + return TableNameFissionCampaignWinReward +} diff --git a/internal/repository/model/fission_cash.gen.go b/internal/repository/model/fission_cash.gen.go new file mode 100644 index 0000000..9457528 --- /dev/null +++ b/internal/repository/model/fission_cash.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCash = "fission_cash" + +// FissionCash mapped from table +type FissionCash struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_expired_in,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + LotteryNum int8 `gorm:"column:lottery_num;type:tinyint;not null;comment:抽奖次数" json:"lottery_num"` + NextStep string `gorm:"column:next_step;type:varchar(32);not null;default:0;comment:下一节点要做的动作(open_gift-开礼品盒,trigger_share-用户需要触发分享,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品,none-没有任何节点需要完成了,invite_spin-等待完成邀请获得最后一次抽奖)" json:"next_step"` + Energy int32 `gorm:"column:energy;type:int;not null;comment:剩余能量数" json:"energy"` + ShowPrice float64 `gorm:"column:show_price;type:decimal(10,2);not null;default:0.00;comment:展示的金额" json:"show_price"` + ExpiredIn int64 `gorm:"column:expired_in;type:bigint;not null;index:idx_campaign_id_expired_in,priority:2;comment:任务重置时间" json:"expired_in"` + IsExpired int8 `gorm:"column:is_expired;type:tinyint;not null;comment:任务是否已过期(0-否,1-是)" json:"is_expired"` + Lang string `gorm:"column:lang;type:varchar(5);not null;comment:语种" json:"lang"` +} + +// TableName FissionCash's table name +func (*FissionCash) TableName() string { + return TableNameFissionCash +} diff --git a/internal/repository/model/fission_cash_record.gen.go b/internal/repository/model/fission_cash_record.gen.go new file mode 100644 index 0000000..cd81ac5 --- /dev/null +++ b/internal/repository/model/fission_cash_record.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCashRecord = "fission_cash_record" + +// FissionCashRecord mapped from table +type FissionCashRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_type,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CashID int64 `gorm:"column:cash_id;type:bigint;not null;index:idx_cash_id,priority:1;comment:现金抽奖玩家数据id(fission_cash表)" json:"cash_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_campaign_id_type,priority:2;comment:记录类型(1-邀请,2-金额情况,3-能量情况,4-奖品记录)" json:"type"` + Data string `gorm:"column:data;type:json;not null;comment:数据内容" json:"data"` +} + +// TableName FissionCashRecord's table name +func (*FissionCashRecord) TableName() string { + return TableNameFissionCashRecord +} diff --git a/internal/repository/model/fission_cash_record.go b/internal/repository/model/fission_cash_record.go new file mode 100644 index 0000000..df3b79a --- /dev/null +++ b/internal/repository/model/fission_cash_record.go @@ -0,0 +1,42 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCashRecord) GetDataReward() (val mtype.RecordTypeReward) { + _ = jsonm.StrUnmarshal(s.Data, &val) + return +} + +func (s *FissionCashRecord) SetDataReward(val mtype.RecordTypeReward) { + s.Data, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCashRecord) GetDataInvite() (val mtype.RecordTypeInvite) { + _ = jsonm.StrUnmarshal(s.Data, &val) + return +} + +func (s *FissionCashRecord) SetDataInvite(val mtype.RecordTypeInvite) { + s.Data, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCashRecord) GetDataCash() (val mtype.RecordTypeCash) { + _ = jsonm.StrUnmarshal(s.Data, &val) + return +} + +func (s *FissionCashRecord) SetDataCash(val mtype.RecordTypeCash) { + s.Data, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCashRecord) GetDataEnergy() (val mtype.RecordTypeEnergy) { + _ = jsonm.StrUnmarshal(s.Data, &val) + return +} + +func (s *FissionCashRecord) SetDataEnergy(val mtype.RecordTypeEnergy) { + s.Data, _ = jsonm.MarshalToString(val) +} diff --git a/internal/repository/model/fission_channel_behavior.gen.go b/internal/repository/model/fission_channel_behavior.gen.go new file mode 100644 index 0000000..8e64264 --- /dev/null +++ b/internal/repository/model/fission_channel_behavior.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChannelBehavior = "fission_channel_behavior" + +// FissionChannelBehavior mapped from table +type FissionChannelBehavior struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;comment:创建时间" json:"created_at"` + ChannelID int64 `gorm:"column:channel_id;type:bigint;not null;comment:渠道id(fission_campaign_channel表)" json:"channel_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;comment:活动id(fission_campaign表)" json:"campaign_id"` + BehaviorMark string `gorm:"column:behavior_mark;type:varchar(32);not null;comment:行为标识" json:"behavior_mark"` + UserMark string `gorm:"column:user_mark;type:varchar(32);not null;comment:用户唯一标识" json:"user_mark"` + CType int8 `gorm:"column:c_type;type:tinyint;not null;comment:渠道类型(1-站内,2-站外)" json:"c_type"` +} + +// TableName FissionChannelBehavior's table name +func (*FissionChannelBehavior) TableName() string { + return TableNameFissionChannelBehavior +} diff --git a/internal/repository/model/fission_chat.gen.go b/internal/repository/model/fission_chat.gen.go new file mode 100644 index 0000000..e0c1d7f --- /dev/null +++ b/internal/repository/model/fission_chat.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChat = "fission_chat" + +// FissionChat mapped from table +type FissionChat struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:idx_user_id_cancel_time,priority:1;comment:用户ID(fission_user表)" json:"user_id"` + CancelTime int64 `gorm:"column:cancel_time;type:bigint;not null;uniqueIndex:idx_user_id_cancel_time,priority:2;comment:关闭时间" json:"cancel_time"` + Character string `gorm:"column:character;type:text;not null;comment:性格" json:"character"` +} + +// TableName FissionChat's table name +func (*FissionChat) TableName() string { + return TableNameFissionChat +} diff --git a/internal/repository/model/fission_chat_msg.gen.go b/internal/repository/model/fission_chat_msg.gen.go new file mode 100644 index 0000000..4a47a8e --- /dev/null +++ b/internal/repository/model/fission_chat_msg.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChatMsg = "fission_chat_msg" + +// FissionChatMsg mapped from table +type FissionChatMsg struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:用户ID(fission_user表)" json:"user_id"` + ChatID int64 `gorm:"column:chat_id;type:bigint;not null;index:idx_chat_id_source_created_at,priority:1;comment:聊天窗ID(fission_chat)" json:"chat_id"` + Source string `gorm:"column:source;type:varchar(32);not null;index:idx_chat_id_source_created_at,priority:2;comment:来源" json:"source"` + MsgType int8 `gorm:"column:msg_type;type:tinyint;not null;comment:消息类型" json:"msg_type"` + Val string `gorm:"column:val;type:text;not null;comment:消息数据" json:"val"` +} + +// TableName FissionChatMsg's table name +func (*FissionChatMsg) TableName() string { + return TableNameFissionChatMsg +} diff --git a/internal/repository/model/fission_chat_msg.go b/internal/repository/model/fission_chat_msg.go new file mode 100644 index 0000000..6a3e70e --- /dev/null +++ b/internal/repository/model/fission_chat_msg.go @@ -0,0 +1,16 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionChatMsg) SetVal(val mtype.ChatMsgVal) { + s.Val, _ = jsonm.ToObjString(val) + return +} + +func (s *FissionChatMsg) GetVal() (val mtype.ChatMsgVal) { + _ = jsonm.StrUnmarshal(s.Val, &val) + return +} diff --git a/internal/repository/model/fission_child_user.gen.go b/internal/repository/model/fission_child_user.gen.go new file mode 100644 index 0000000..96a4322 --- /dev/null +++ b/internal/repository/model/fission_child_user.gen.go @@ -0,0 +1,32 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChildUser = "fission_child_user" + +// FissionChildUser mapped from table +type FissionChildUser struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + PCpnID int64 `gorm:"column:p_cpn_id;type:bigint;not null;index:idx_p_cpn_id,priority:1;comment:父级活动ID(fission_campaign表)" json:"p_cpn_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_user_id_campaign_id,priority:2;index:idx_campaign_id_join_time,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_campaign_id,priority:1;comment:用户id(fisison_user表)" json:"user_id"` + ParentID int64 `gorm:"column:parent_id;type:bigint;not null;comment:父级用户id(fission_user表)" json:"parent_id"` + ChildType int8 `gorm:"column:child_type;type:tinyint;not null;comment:子活动类型" json:"child_type"` + LastDone int64 `gorm:"column:last_done;type:bigint;not null;comment:最后参与时间" json:"last_done"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id(fission_campaign_reward表)" json:"reward_id"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:奖品记录id(fission_reward_record表)" json:"record_id"` + ContinueSign int32 `gorm:"column:continue_sign;type:int;not null;comment:连续签到天数" json:"continue_sign"` + SignDay int32 `gorm:"column:sign_day;type:int;not null;comment:签到天数" json:"sign_day"` + InviteNum int64 `gorm:"column:invite_num;type:bigint;not null;comment:邀请人数" json:"invite_num"` + LuckyReward string `gorm:"column:lucky_reward;type:varchar(255);not null;comment:每日抽奖中奖的奖品id" json:"lucky_reward"` + JoinTime int64 `gorm:"column:join_time;type:bigint;not null;index:idx_campaign_id_join_time,priority:2;comment:参与活动时间" json:"join_time"` +} + +// TableName FissionChildUser's table name +func (*FissionChildUser) TableName() string { + return TableNameFissionChildUser +} diff --git a/internal/repository/model/fission_child_user.go b/internal/repository/model/fission_child_user.go new file mode 100644 index 0000000..336cf1a --- /dev/null +++ b/internal/repository/model/fission_child_user.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/utils" +) + +func (s *FissionChildUser) GetLuckyReward() (val []int64) { + if s.LuckyReward == "" { + return + } + + val = utils.SplitToInt64(s.LuckyReward, ",") + return +} diff --git a/internal/repository/model/fission_child_user_record.gen.go b/internal/repository/model/fission_child_user_record.gen.go new file mode 100644 index 0000000..fed9da9 --- /dev/null +++ b/internal/repository/model/fission_child_user_record.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChildUserRecord = "fission_child_user_record" + +// FissionChildUserRecord mapped from table +type FissionChildUserRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + PCpnID int64 `gorm:"column:p_cpn_id;type:bigint;not null;index:idx_p_cpn_id,priority:1;comment:父级活动ID(fission_campaign表)" json:"p_cpn_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_user_id_campaign_id,priority:2;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_campaign_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + PlayerID int64 `gorm:"column:player_id;type:bigint;not null;comment:玩家数据id(fission_child_user表)" json:"player_id"` + ChildType int8 `gorm:"column:child_type;type:tinyint;not null;comment:子活动类型" json:"child_type"` + Mark string `gorm:"column:mark;type:varchar(64);not null;comment:日志源" json:"mark"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:奖品记录id(fission_reward_record表)" json:"record_id"` +} + +// TableName FissionChildUserRecord's table name +func (*FissionChildUserRecord) TableName() string { + return TableNameFissionChildUserRecord +} diff --git a/internal/repository/model/fission_chop.gen.go b/internal/repository/model/fission_chop.gen.go new file mode 100644 index 0000000..1c07a7d --- /dev/null +++ b/internal/repository/model/fission_chop.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChop = "fission_chop" + +// FissionChop mapped from table +type FissionChop struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + ChopRewardID int64 `gorm:"column:chop_reward_id;type:bigint;not null;comment:选择的助力奖品id(fission_chop_reward表)" json:"chop_reward_id"` +} + +// TableName FissionChop's table name +func (*FissionChop) TableName() string { + return TableNameFissionChop +} diff --git a/internal/repository/model/fission_chop_help.gen.go b/internal/repository/model/fission_chop_help.gen.go new file mode 100644 index 0000000..28d6523 --- /dev/null +++ b/internal/repository/model/fission_chop_help.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChopHelp = "fission_chop_help" + +// FissionChopHelp mapped from table +type FissionChopHelp struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + ChopRewardID int64 `gorm:"column:chop_reward_id;type:bigint;not null;uniqueIndex:uniq_chop_reward_id_mark_user_mark,priority:1;comment:选择的奖品id(fission_chop_reward表)" json:"chop_reward_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_chop_reward_id_mark_user_mark,priority:2;comment:助力标识" json:"mark"` + Percent float64 `gorm:"column:percent;type:decimal(5,2);not null;default:0.00;comment:助力进度" json:"percent"` + UserMark string `gorm:"column:user_mark;type:varchar(255);not null;uniqueIndex:uniq_chop_reward_id_mark_user_mark,priority:3;comment:事件人标识" json:"user_mark"` +} + +// TableName FissionChopHelp's table name +func (*FissionChopHelp) TableName() string { + return TableNameFissionChopHelp +} diff --git a/internal/repository/model/fission_chop_reward.gen.go b/internal/repository/model/fission_chop_reward.gen.go new file mode 100644 index 0000000..623d371 --- /dev/null +++ b/internal/repository/model/fission_chop_reward.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionChopReward = "fission_chop_reward" + +// FissionChopReward mapped from table +type FissionChopReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:选择的助力奖品id(fission_campaign_reward表)" json:"reward_id"` + InitPercent float64 `gorm:"column:init_percent;type:decimal(5,2);not null;default:0.00;comment:获得的初始进度" json:"init_percent"` + Percent float64 `gorm:"column:percent;type:decimal(5,2);not null;default:0.00;comment:当前获奖进度" json:"percent"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:奖品记录id(fission_reward_record表)" json:"record_id"` +} + +// TableName FissionChopReward's table name +func (*FissionChopReward) TableName() string { + return TableNameFissionChopReward +} diff --git a/internal/repository/model/fission_client_reward.gen.go b/internal/repository/model/fission_client_reward.gen.go new file mode 100644 index 0000000..f69bc06 --- /dev/null +++ b/internal/repository/model/fission_client_reward.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionClientReward = "fission_client_reward" + +// FissionClientReward mapped from table +type FissionClientReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UserID string `gorm:"column:user_id;type:varchar(50);not null;index:idx_user_id_receive_at_project_id_campaign_id,priority:1;comment:用户id" json:"user_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_user_id_receive_at_project_id_campaign_id,priority:3;comment:项目id" json:"project_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_user_id_receive_at_project_id_campaign_id,priority:4;comment:活动id" json:"campaign_id"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:发奖记录id" json:"record_id"` + ReceiveAt int64 `gorm:"column:receive_at;type:bigint;not null;index:idx_user_id_receive_at_project_id_campaign_id,priority:2;comment:接收时间" json:"receive_at"` +} + +// TableName FissionClientReward's table name +func (*FissionClientReward) TableName() string { + return TableNameFissionClientReward +} diff --git a/internal/repository/model/fission_coin.gen.go b/internal/repository/model/fission_coin.gen.go new file mode 100644 index 0000000..fe4edc8 --- /dev/null +++ b/internal/repository/model/fission_coin.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCoin = "fission_coin" + +// FissionCoin mapped from table +type FissionCoin struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;uniqueIndex:uniq_scene_id_created_at_user_id,priority:2;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_scene_id_created_at_user_id,priority:3;index:idx_user_id,priority:1;comment:用户id" json:"user_id"` + SceneID int64 `gorm:"column:scene_id;type:bigint;not null;uniqueIndex:uniq_scene_id_created_at_user_id,priority:1;comment:场次id" json:"scene_id"` + UseNum int32 `gorm:"column:use_num;type:int;not null;comment:投放次数" json:"use_num"` + UseCoin int32 `gorm:"column:use_coin;type:int;not null;comment:投放金币总数" json:"use_coin"` + GetCoin int32 `gorm:"column:get_coin;type:int;not null;comment:领取的金币数" json:"get_coin"` + Status int8 `gorm:"column:status;type:tinyint;not null;comment:状态(1-未参与,2-待领取,3-已领取,4-未领取)" json:"status"` + PreSceneOk int8 `gorm:"column:pre_scene_ok;type:tinyint;not null;comment:上一场活动是否结算完毕(0-否,1-是)" json:"pre_scene_ok"` +} + +// TableName FissionCoin's table name +func (*FissionCoin) TableName() string { + return TableNameFissionCoin +} diff --git a/internal/repository/model/fission_coin_log.gen.go b/internal/repository/model/fission_coin_log.gen.go new file mode 100644 index 0000000..df1406e --- /dev/null +++ b/internal/repository/model/fission_coin_log.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCoinLog = "fission_coin_log" + +// FissionCoinLog mapped from table +type FissionCoinLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:用户id" json:"user_id"` + CoinID int64 `gorm:"column:coin_id;type:bigint;not null;index:idx_coin_id_type_created_at,priority:1;comment:金币池玩家id(fission_coin)" json:"coin_id"` + SceneID int64 `gorm:"column:scene_id;type:bigint;not null;index:idx_secen_type_created_at,priority:1;comment:场次id(fission_coin_scene表)" json:"scene_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_secen_type_created_at,priority:2;comment:日志类型(1-消耗金币,2-获得金币,3-获得奖品)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:数据对象" json:"val"` +} + +// TableName FissionCoinLog's table name +func (*FissionCoinLog) TableName() string { + return TableNameFissionCoinLog +} diff --git a/internal/repository/model/fission_coin_log.go b/internal/repository/model/fission_coin_log.go new file mode 100644 index 0000000..96535ea --- /dev/null +++ b/internal/repository/model/fission_coin_log.go @@ -0,0 +1,23 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionCoinLog) GetVal() (val mtype.CoinLogVal) { + _ = jsonm.StrUnmarshal(s.Val, &val) + return +} + +func (s *FissionCoinLog) SetVal(val mtype.CoinLogVal) { + s.Val, _ = jsonm.MarshalToString(val) +} + +func (s *FissionCoinLog) GetTypeTitle() string { + return mtype.FissionCoinLogType[s.Type] +} + +func (s *FissionCoinLog) GetSourceTitle() string { + return mtype.FissionCoinLogSource[s.Source] +} diff --git a/internal/repository/model/fission_coin_scene.gen.go b/internal/repository/model/fission_coin_scene.gen.go new file mode 100644 index 0000000..efce854 --- /dev/null +++ b/internal/repository/model/fission_coin_scene.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCoinScene = "fission_coin_scene" + +// FissionCoinScene mapped from table +type FissionCoinScene struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_reward_time_campaign_id,priority:2;comment:活动id(fission_campaign表)" json:"campaign_id"` + OpenTime int64 `gorm:"column:open_time;type:bigint;not null;index:idx_campaign_id_open_time,priority:2;comment:开奖时间" json:"open_time"` + InitCoin int32 `gorm:"column:init_coin;type:int;not null;comment:结算完毕后时奖池初始金额" json:"init_coin"` + InitUse int32 `gorm:"column:init_use;type:int;not null;comment:结算完毕后初始投放次数" json:"init_use"` + UserCoin int64 `gorm:"column:user_coin;type:bigint;not null;comment:用户投入的金币总数" json:"user_coin"` + RewardTime int64 `gorm:"column:reward_time;type:bigint;not null;index:idx_reward_time_campaign_id,priority:1;comment:领奖结束时间" json:"reward_time"` + JoinNum int64 `gorm:"column:join_num;type:bigint;not null;comment:投放总数" json:"join_num"` + JoinUserNum int64 `gorm:"column:join_user_num;type:bigint;not null;comment:投放人数" json:"join_user_num"` + GetNum int64 `gorm:"column:get_num;type:bigint;not null;comment:领奖总人数" json:"get_num"` + GetCoin int64 `gorm:"column:get_coin;type:bigint;not null;comment:领取的总金币数" json:"get_coin"` + PreScene int64 `gorm:"column:pre_scene;type:bigint;not null;comment:上一场id" json:"pre_scene"` + IsArchive int8 `gorm:"column:is_archive;type:tinyint;not null;comment:是否已经归档" json:"is_archive"` +} + +// TableName FissionCoinScene's table name +func (*FissionCoinScene) TableName() string { + return TableNameFissionCoinScene +} diff --git a/internal/repository/model/fission_config.gen.go b/internal/repository/model/fission_config.gen.go new file mode 100644 index 0000000..6b0c19a --- /dev/null +++ b/internal/repository/model/fission_config.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionConfig = "fission_config" + +// FissionConfig mapped from table +type FissionConfig struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;uniqueIndex:uniq_project_id,priority:1;comment:项目ID(clintproject表主键)" json:"project_id"` + DynamicCampaign int64 `gorm:"column:dynamic_campaign;type:bigint;not null;comment:动态下载页关联活动" json:"dynamic_campaign"` + LvURLID int64 `gorm:"column:lv_url_id;type:bigint;not null;comment:用户类型关联访问地址" json:"lv_url_id"` + PushVisit int8 `gorm:"column:push_visit;type:tinyint;not null;comment:用户访问推送(0-否,1-是)" json:"push_visit"` + PushCampaignTask int8 `gorm:"column:push_campaign_task;type:tinyint;not null;default:1;comment:活动任务完成推送(0-否,1-是)" json:"push_campaign_task"` +} + +// TableName FissionConfig's table name +func (*FissionConfig) TableName() string { + return TableNameFissionConfig +} diff --git a/internal/repository/model/fission_custom_btn.gen.go b/internal/repository/model/fission_custom_btn.gen.go new file mode 100644 index 0000000..0ac1d3e --- /dev/null +++ b/internal/repository/model/fission_custom_btn.gen.go @@ -0,0 +1,20 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionCustomBtn = "fission_custom_btn" + +// FissionCustomBtn mapped from table +type FissionCustomBtn struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_btn_text,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + BtnText string `gorm:"column:btn_text;type:varchar(64);not null;uniqueIndex:uniq_campaign_id_btn_text,priority:2;comment:按钮文案" json:"btn_text"` +} + +// TableName FissionCustomBtn's table name +func (*FissionCustomBtn) TableName() string { + return TableNameFissionCustomBtn +} diff --git a/internal/repository/model/fission_dice.gen.go b/internal/repository/model/fission_dice.gen.go new file mode 100644 index 0000000..2b5e52a --- /dev/null +++ b/internal/repository/model/fission_dice.gen.go @@ -0,0 +1,29 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDice = "fission_dice" + +// FissionDice mapped from table +type FissionDice struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:骰子数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:邀请达标获得的骰子数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的骰子数" json:"day_chance"` + MapID int64 `gorm:"column:map_id;type:bigint;not null;comment:当前所在地图位置id" json:"map_id"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + DmgID int64 `gorm:"column:dmg_id;type:bigint;not null;comment:地图组id(fission_dice_map_group表)" json:"dmg_id"` + GoStep int64 `gorm:"column:go_step;type:bigint;not null;comment:走过的总步数" json:"go_step"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionDice's table name +func (*FissionDice) TableName() string { + return TableNameFissionDice +} diff --git a/internal/repository/model/fission_dice_collect.gen.go b/internal/repository/model/fission_dice_collect.gen.go new file mode 100644 index 0000000..bc250f5 --- /dev/null +++ b/internal/repository/model/fission_dice_collect.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDiceCollect = "fission_dice_collect" + +// FissionDiceCollect mapped from table +type FissionDiceCollect struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_ reward_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;uniqueIndex:uniq_user_id_ reward_id,priority:2;comment:奖品id" json:"reward_id"` + Num int32 `gorm:"column:num;type:int;not null;comment:拥有的奖品碎片数量" json:"num"` + IntactNum int32 `gorm:"column:intact_num;type:int;not null;comment:完整奖品数" json:"intact_num"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:需要合成的奖品记录id(fission_reward_record表)" json:"record_id"` + SignNum int32 `gorm:"column:sign_num;type:int;not null;comment:已经签到天数" json:"sign_num"` +} + +// TableName FissionDiceCollect's table name +func (*FissionDiceCollect) TableName() string { + return TableNameFissionDiceCollect +} diff --git a/internal/repository/model/fission_dice_map.gen.go b/internal/repository/model/fission_dice_map.gen.go new file mode 100644 index 0000000..9697c12 --- /dev/null +++ b/internal/repository/model/fission_dice_map.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDiceMap = "fission_dice_map" + +// FissionDiceMap mapped from table +type FissionDiceMap struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + MarkType int8 `gorm:"column:mark_type;type:tinyint;not null;comment:格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几)" json:"mark_type"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id" json:"reward_id"` + DmgID int64 `gorm:"column:dmg_id;type:bigint;not null;comment:地图组id(fission_dice_map_group表)" json:"dmg_id"` +} + +// TableName FissionDiceMap's table name +func (*FissionDiceMap) TableName() string { + return TableNameFissionDiceMap +} diff --git a/internal/repository/model/fission_dice_map_group.gen.go b/internal/repository/model/fission_dice_map_group.gen.go new file mode 100644 index 0000000..3dacaf9 --- /dev/null +++ b/internal/repository/model/fission_dice_map_group.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDiceMapGroup = "fission_dice_map_group" + +// FissionDiceMapGroup mapped from table +type FissionDiceMapGroup struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + LevelID int64 `gorm:"column:level_id;type:bigint;not null;comment:用户类型id(fission_user_level表)" json:"level_id"` + LangMark string `gorm:"column:lang_mark;type:varchar(4);not null;comment:语言标识" json:"lang_mark"` + CountryMark string `gorm:"column:country_mark;type:varchar(8);not null;comment:国家标识" json:"country_mark"` +} + +// TableName FissionDiceMapGroup's table name +func (*FissionDiceMapGroup) TableName() string { + return TableNameFissionDiceMapGroup +} diff --git a/internal/repository/model/fission_dice_props.gen.go b/internal/repository/model/fission_dice_props.gen.go new file mode 100644 index 0000000..09a4bf7 --- /dev/null +++ b/internal/repository/model/fission_dice_props.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDiceProp = "fission_dice_props" + +// FissionDiceProp mapped from table +type FissionDiceProp struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_ mark,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_user_id_ mark,priority:2;comment:道具标识(chance-再来一次,fixed_roll-固定点数)" json:"mark"` + Num int32 `gorm:"column:num;type:int;not null;comment:道具卡数量" json:"num"` + TotalNum int32 `gorm:"column:total_num;type:int;not null;comment:道具获得总数" json:"total_num"` +} + +// TableName FissionDiceProp's table name +func (*FissionDiceProp) TableName() string { + return TableNameFissionDiceProp +} diff --git a/internal/repository/model/fission_dice_props_record.gen.go b/internal/repository/model/fission_dice_props_record.gen.go new file mode 100644 index 0000000..6b738a4 --- /dev/null +++ b/internal/repository/model/fission_dice_props_record.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDicePropsRecord = "fission_dice_props_record" + +// FissionDicePropsRecord mapped from table +type FissionDicePropsRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + PropsID int64 `gorm:"column:props_id;type:bigint;not null;index:idx_props_id,priority:1;comment:玩家道具id(fission_dice_props表)" json:"props_id"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:使用后等到的值" json:"val"` +} + +// TableName FissionDicePropsRecord's table name +func (*FissionDicePropsRecord) TableName() string { + return TableNameFissionDicePropsRecord +} diff --git a/internal/repository/model/fission_dice_record.gen.go b/internal/repository/model/fission_dice_record.gen.go new file mode 100644 index 0000000..704b465 --- /dev/null +++ b/internal/repository/model/fission_dice_record.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDiceRecord = "fission_dice_record" + +// FissionDiceRecord mapped from table +type FissionDiceRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_mark,priority:1;comment:活动用户id(fission_user表)" json:"user_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;index:idx_user_id_mark,priority:2;comment:记录标识(roll-掷骰子,get_roll_sys-参与活动获得骰子,get_roll_all-完成所有任务获得骰子,get_roll_task-完成任务获得骰子,get_roll_register-完成好友注册任务获得骰子,get_roll_install-完成邀请好友下载获得骰子,roll_collect-获得碎片,roll_chance-再摇一次,lucky-使用幸运骰,lucky_chance-使用幸运骰获得再来一次,lucky_collect-使用幸运骰获得碎片,get_lucky-获得幸运骰,reward-获取奖品,sign-签到获得骰子)" json:"mark"` + Data string `gorm:"column:data;type:varchar(500);not null;comment:记录数据" json:"data"` +} + +// TableName FissionDiceRecord's table name +func (*FissionDiceRecord) TableName() string { + return TableNameFissionDiceRecord +} diff --git a/internal/repository/model/fission_dice_record.go b/internal/repository/model/fission_dice_record.go new file mode 100644 index 0000000..b28758c --- /dev/null +++ b/internal/repository/model/fission_dice_record.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionDiceRecord) SetData(val *mtype.DiceRecord) { + s.Data, _ = jsonm.MarshalToString(val) +} + +func (s *FissionDiceRecord) GetData() (val mtype.DiceRecord) { + _ = jsonm.StrUnmarshal(s.Data, &val) + return +} diff --git a/internal/repository/model/fission_dice_run.gen.go b/internal/repository/model/fission_dice_run.gen.go new file mode 100644 index 0000000..29f0a6e --- /dev/null +++ b/internal/repository/model/fission_dice_run.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionDiceRun = "fission_dice_run" + +// FissionDiceRun mapped from table +type FissionDiceRun struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_dmg_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + DmgID int64 `gorm:"column:dmg_id;type:bigint;not null;uniqueIndex:uniq_user_id_dmg_id,priority:2;comment:地图组id(fission_dice_map_group表)" json:"dmg_id"` + MapID int64 `gorm:"column:map_id;type:bigint;not null;comment:当前所在地图位置id" json:"map_id"` + MapHashID string `gorm:"column:map_hash_id;type:varchar(20);not null;comment:地图hash_id" json:"map_hash_id"` + GoStep int64 `gorm:"column:go_step;type:bigint;not null;comment:当前地图走过的总步数" json:"go_step"` +} + +// TableName FissionDiceRun's table name +func (*FissionDiceRun) TableName() string { + return TableNameFissionDiceRun +} diff --git a/internal/repository/model/fission_flip.gen.go b/internal/repository/model/fission_flip.gen.go new file mode 100644 index 0000000..3e800a3 --- /dev/null +++ b/internal/repository/model/fission_flip.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionFlip = "fission_flip" + +// FissionFlip mapped from table +type FissionFlip struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的抽奖次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽奖次数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionFlip's table name +func (*FissionFlip) TableName() string { + return TableNameFissionFlip +} diff --git a/internal/repository/model/fission_flip_log.gen.go b/internal/repository/model/fission_flip_log.gen.go new file mode 100644 index 0000000..e5bd973 --- /dev/null +++ b/internal/repository/model/fission_flip_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionFlipLog = "fission_flip_log" + +// FissionFlipLog mapped from table +type FissionFlipLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + FlipID int64 `gorm:"column:flip_id;type:bigint;not null;index:idx_flip_id_type_created_at,priority:1;comment:玩家id(fission_flip表id)" json:"flip_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_flip_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionFlipLog's table name +func (*FissionFlipLog) TableName() string { + return TableNameFissionFlipLog +} diff --git a/internal/repository/model/fission_flip_log.go b/internal/repository/model/fission_flip_log.go new file mode 100644 index 0000000..9e633a0 --- /dev/null +++ b/internal/repository/model/fission_flip_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionFlipLog) SetVal(val mtype.LotteryLogVal) { + m.Val, _ = jsonm.MarshalToString(val) +} + +func (m *FissionFlipLog) GetVal() (val mtype.LotteryLogVal) { + _ = jsonm.StrUnmarshal(m.Val, &val) + return +} diff --git a/internal/repository/model/fission_gashapon.gen.go b/internal/repository/model/fission_gashapon.gen.go new file mode 100644 index 0000000..4e59877 --- /dev/null +++ b/internal/repository/model/fission_gashapon.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGashapon = "fission_gashapon" + +// FissionGashapon mapped from table +type FissionGashapon struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的抽奖次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽奖次数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionGashapon's table name +func (*FissionGashapon) TableName() string { + return TableNameFissionGashapon +} diff --git a/internal/repository/model/fission_gashapon_log.gen.go b/internal/repository/model/fission_gashapon_log.gen.go new file mode 100644 index 0000000..c355f85 --- /dev/null +++ b/internal/repository/model/fission_gashapon_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGashaponLog = "fission_gashapon_log" + +// FissionGashaponLog mapped from table +type FissionGashaponLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + GashaponID int64 `gorm:"column:gashapon_id;type:bigint;not null;index:idx_gashapon_source_created_at,priority:1;comment:玩家id(fission_gashapon表id)" json:"gashapon_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;index:idx_gashapon_source_created_at,priority:2;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:数据对象" json:"val"` +} + +// TableName FissionGashaponLog's table name +func (*FissionGashaponLog) TableName() string { + return TableNameFissionGashaponLog +} diff --git a/internal/repository/model/fission_gashapon_log.go b/internal/repository/model/fission_gashapon_log.go new file mode 100644 index 0000000..a54f143 --- /dev/null +++ b/internal/repository/model/fission_gashapon_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionGashaponLog) GetVal() (val mtype.LotteryLogVal) { + _ = jsonm.StrUnmarshal(s.Val, &val) + return +} + +func (s *FissionGashaponLog) SetVal(val mtype.LotteryLogVal) { + s.Val, _ = jsonm.MarshalToString(val) +} diff --git a/internal/repository/model/fission_gold.gen.go b/internal/repository/model/fission_gold.gen.go new file mode 100644 index 0000000..d141529 --- /dev/null +++ b/internal/repository/model/fission_gold.gen.go @@ -0,0 +1,29 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGold = "fission_gold" + +// FissionGold mapped from table +type FissionGold struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_expired_in,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + GoldNum int32 `gorm:"column:gold_num;type:int;not null;comment:获得的金币数" json:"gold_num"` + LotteryNum int8 `gorm:"column:lottery_num;type:tinyint;not null;comment:抽奖次数" json:"lottery_num"` + NextStep string `gorm:"column:next_step;type:varchar(32);not null;comment:下一节点要做的动作(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, giveaway-赠送能量,none-没有任何节点需要完成了)" json:"next_step"` + Energy int32 `gorm:"column:energy;type:int;not null;comment:剩余能量数" json:"energy"` + ShowPrice float64 `gorm:"column:show_price;type:decimal(10,2);not null;default:0.00;comment:展示的金额" json:"show_price"` + ExpiredIn int64 `gorm:"column:expired_in;type:bigint;not null;index:idx_campaign_id_expired_in,priority:2;comment:任务重置时间" json:"expired_in"` + IsExpired int8 `gorm:"column:is_expired;type:tinyint;not null;comment:任务是否已过期(0-否,1-是)" json:"is_expired"` + Lang string `gorm:"column:lang;type:varchar(5);not null;comment:语种" json:"lang"` +} + +// TableName FissionGold's table name +func (*FissionGold) TableName() string { + return TableNameFissionGold +} diff --git a/internal/repository/model/fission_gold_log.gen.go b/internal/repository/model/fission_gold_log.gen.go new file mode 100644 index 0000000..f564b2d --- /dev/null +++ b/internal/repository/model/fission_gold_log.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGoldLog = "fission_gold_log" + +// FissionGoldLog mapped from table +type FissionGoldLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + GoldID int64 `gorm:"column:gold_id;type:bigint;not null;index:idx_gold_id_type_created_at,priority:1;comment:金币任务玩家id(fission_gold表)" json:"gold_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_gold_id_type_created_at,priority:2;comment:日志类型(1-打开盒子,2-抽奖,3-完成任务,4-获得奖品)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:数据对象" json:"val"` +} + +// TableName FissionGoldLog's table name +func (*FissionGoldLog) TableName() string { + return TableNameFissionGoldLog +} diff --git a/internal/repository/model/fission_gold_log.go b/internal/repository/model/fission_gold_log.go new file mode 100644 index 0000000..45f19b4 --- /dev/null +++ b/internal/repository/model/fission_gold_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionGoldLog) GetVal() (val mtype.GoldLogVal) { + _ = jsonm.StrUnmarshal(s.Val, &val) + return +} + +func (s *FissionGoldLog) SetVal(val mtype.GoldLogVal) { + s.Val, _ = jsonm.MarshalToString(val) +} diff --git a/internal/repository/model/fission_grid.gen.go b/internal/repository/model/fission_grid.gen.go new file mode 100644 index 0000000..82a055d --- /dev/null +++ b/internal/repository/model/fission_grid.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGrid = "fission_grid" + +// FissionGrid mapped from table +type FissionGrid struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的抽奖次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽奖次数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionGrid's table name +func (*FissionGrid) TableName() string { + return TableNameFissionGrid +} diff --git a/internal/repository/model/fission_grid_log.gen.go b/internal/repository/model/fission_grid_log.gen.go new file mode 100644 index 0000000..614dbac --- /dev/null +++ b/internal/repository/model/fission_grid_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGridLog = "fission_grid_log" + +// FissionGridLog mapped from table +type FissionGridLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + GridID int64 `gorm:"column:grid_id;type:bigint;not null;index:idx_grid_id_type_created_at,priority:1;comment:玩家id(fission_grid表id)" json:"grid_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_grid_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionGridLog's table name +func (*FissionGridLog) TableName() string { + return TableNameFissionGridLog +} diff --git a/internal/repository/model/fission_grid_log.go b/internal/repository/model/fission_grid_log.go new file mode 100644 index 0000000..cfd05a0 --- /dev/null +++ b/internal/repository/model/fission_grid_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionGridLog) SetVal(val mtype.LotteryLogVal) { + m.Val, _ = jsonm.MarshalToString(val) +} + +func (m *FissionGridLog) GetVal() (val mtype.LotteryLogVal) { + _ = jsonm.StrUnmarshal(m.Val, &val) + return +} diff --git a/internal/repository/model/fission_grid_lucky.gen.go b/internal/repository/model/fission_grid_lucky.gen.go new file mode 100644 index 0000000..2087572 --- /dev/null +++ b/internal/repository/model/fission_grid_lucky.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGridLucky = "fission_grid_lucky" + +// FissionGridLucky mapped from table +type FissionGridLucky struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的唯一id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Win int8 `gorm:"column:win;type:tinyint;not null;comment:是否中奖(1-是,0-否)" json:"win"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品ID" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionGridLucky's table name +func (*FissionGridLucky) TableName() string { + return TableNameFissionGridLucky +} diff --git a/internal/repository/model/fission_grow.gen.go b/internal/repository/model/fission_grow.gen.go new file mode 100644 index 0000000..8146bbc --- /dev/null +++ b/internal/repository/model/fission_grow.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGrow = "fission_grow" + +// FissionGrow mapped from table +type FissionGrow struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + GrowNum int32 `gorm:"column:grow_num;type:int;not null;comment:成长道具数量" json:"grow_num"` + TaskNum int32 `gorm:"column:task_num;type:int;not null;comment:邀请获得的成长道具数" json:"task_num"` + AutoNum int32 `gorm:"column:auto_num;type:int;not null;comment:自动生成获取的道具数" json:"auto_num"` + PropsTime int64 `gorm:"column:props_time;type:bigint;not null;comment:下次领取道具时间" json:"props_time"` +} + +// TableName FissionGrow's table name +func (*FissionGrow) TableName() string { + return TableNameFissionGrow +} diff --git a/internal/repository/model/fission_grow_life.gen.go b/internal/repository/model/fission_grow_life.gen.go new file mode 100644 index 0000000..bf6e3d1 --- /dev/null +++ b/internal/repository/model/fission_grow_life.gen.go @@ -0,0 +1,29 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGrowLife = "fission_grow_life" + +// FissionGrowLife mapped from table +type FissionGrowLife struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:名称" json:"title"` + Num int32 `gorm:"column:num;type:int;not null;comment:成长道具数量" json:"num"` + Step int32 `gorm:"column:step;type:int;not null;comment:等级" json:"step"` + DieTime int64 `gorm:"column:die_time;type:bigint;not null;comment:死亡时间" json:"die_time"` + IsGrow int8 `gorm:"column:is_grow;type:tinyint;not null;comment:是否当前种植(1-是,0-否)" json:"is_grow"` + IsDie int8 `gorm:"column:is_die;type:tinyint;not null;comment:是否已死亡" json:"is_die"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:对应的奖品id(fission_campaign_reward表)" json:"reward_id"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:奖品记录id(fission_reward_record表)" json:"record_id"` +} + +// TableName FissionGrowLife's table name +func (*FissionGrowLife) TableName() string { + return TableNameFissionGrowLife +} diff --git a/internal/repository/model/fission_grow_record.gen.go b/internal/repository/model/fission_grow_record.gen.go new file mode 100644 index 0000000..e63272f --- /dev/null +++ b/internal/repository/model/fission_grow_record.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionGrowRecord = "fission_grow_record" + +// FissionGrowRecord mapped from table +type FissionGrowRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_mark,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(20);not null;index:idx_user_id_mark,priority:2;comment:记录数据标识" json:"mark"` + VarData string `gorm:"column:var_data;type:varchar(500);not null;comment:变量数据" json:"var_data"` +} + +// TableName FissionGrowRecord's table name +func (*FissionGrowRecord) TableName() string { + return TableNameFissionGrowRecord +} diff --git a/internal/repository/model/fission_grow_record.go b/internal/repository/model/fission_grow_record.go new file mode 100644 index 0000000..bfd13ae --- /dev/null +++ b/internal/repository/model/fission_grow_record.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionGrowRecord) SetVarData(val []*mtype.GrowVarData) { + s.VarData, _ = jsonm.MarshalToString(val) +} + +func (s *FissionGrowRecord) GetVarData() (val []*mtype.GrowVarData) { + _ = jsonm.StrUnmarshal(s.VarData, &val) + return +} diff --git a/internal/repository/model/fission_keep.gen.go b/internal/repository/model/fission_keep.gen.go new file mode 100644 index 0000000..14326e8 --- /dev/null +++ b/internal/repository/model/fission_keep.gen.go @@ -0,0 +1,36 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionKeep = "fission_keep" + +// FissionKeep mapped from table +type FissionKeep struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id" json:"user_id"` + Num int32 `gorm:"column:num;type:int;not null;comment:剩余总道具数" json:"num"` + MachineNum float64 `gorm:"column:machine_num;type:decimal(6,2);not null;default:0.00;comment:机器产生的道具数" json:"machine_num"` + CollectNum int32 `gorm:"column:collect_num;type:int;not null;comment:获得的总一级道具数量" json:"collect_num"` + Collect int32 `gorm:"column:collect;type:int;not null;comment:可收集的一级道具数量" json:"collect"` + SecondNum int32 `gorm:"column:second_num;type:int;not null;comment:收集的二级道具数量" json:"second_num"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:选择的奖品id(fission_campaign_reward表)" json:"reward_id"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:选择奖品的获奖记录id(fission_reward_record表)" json:"record_id"` + FeedGetAt int64 `gorm:"column:feed_get_at;type:bigint;not null;comment:最后一次获喂养道具的时间" json:"feed_get_at"` + Step int32 `gorm:"column:step;type:int;not null;comment:养成阶段" json:"step"` + ExpiredAt int64 `gorm:"column:expired_at;type:bigint;not null;comment:过期时间戳(单位:s)" json:"expired_at"` + Guided int8 `gorm:"column:guided;type:tinyint;not null;comment:是否已经进行了引导" json:"guided"` + InviteLimit int8 `gorm:"column:invite_limit;type:tinyint;not null;comment:是否达到邀请上限(0-否,1-是)" json:"invite_limit"` + ReselectAt int64 `gorm:"column:reselect_at;type:bigint;not null;comment:重新下一个奖品时间" json:"reselect_at"` + CancelReward int8 `gorm:"column:cancel_reward;type:tinyint;not null;index:idx_campaign_id_expired_at_cancel_reward,priority:1;comment:是否取消了奖品(0-否,1-是)" json:"cancel_reward"` + ReceiveOffline int64 `gorm:"column:receive_offline;type:bigint;not null;comment:最近一次领取离线狗粮时间" json:"receive_offline"` +} + +// TableName FissionKeep's table name +func (*FissionKeep) TableName() string { + return TableNameFissionKeep +} diff --git a/internal/repository/model/fission_keep_log.gen.go b/internal/repository/model/fission_keep_log.gen.go new file mode 100644 index 0000000..bb886ba --- /dev/null +++ b/internal/repository/model/fission_keep_log.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionKeepLog = "fission_keep_log" + +// FissionKeepLog mapped from table +type FissionKeepLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + KeepID int64 `gorm:"column:keep_id;type:bigint;not null;index:idx_keep_id_get_type_created_at,priority:1;comment:玩家id(fission_keep表id)" json:"keep_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_keep_id_get_type_created_at,priority:2;comment:日志类型(1-收集爱心,2-获得狗粮,3-喂养狗粮)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(20);not null;comment:展示的数值" json:"val"` + ValSource string `gorm:"column:val_source;type:varchar(255);not null;comment:数据追溯参数" json:"val_source"` +} + +// TableName FissionKeepLog's table name +func (*FissionKeepLog) TableName() string { + return TableNameFissionKeepLog +} diff --git a/internal/repository/model/fission_lang_module.gen.go b/internal/repository/model/fission_lang_module.gen.go new file mode 100644 index 0000000..9e19a54 --- /dev/null +++ b/internal/repository/model/fission_lang_module.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionLangModule = "fission_lang_module" + +// FissionLangModule mapped from table +type FissionLangModule struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + Mark string `gorm:"column:mark;type:varchar(64);not null;uniqueIndex:uniq_mark,priority:1;comment:组件标识" json:"mark"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:描述(用于描述用途或者一些使用提示)" json:"desc"` + Parts string `gorm:"column:parts;type:json;not null;comment:使用的语言字段" json:"parts"` +} + +// TableName FissionLangModule's table name +func (*FissionLangModule) TableName() string { + return TableNameFissionLangModule +} diff --git a/internal/repository/model/fission_lang_module.go b/internal/repository/model/fission_lang_module.go new file mode 100644 index 0000000..77c57f9 --- /dev/null +++ b/internal/repository/model/fission_lang_module.go @@ -0,0 +1,11 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionLangModule) GetParts() (val []*mtype.LangKv) { + _ = jsonm.StrUnmarshal(s.Parts, &val) + return +} diff --git a/internal/repository/model/fission_notify.gen.go b/internal/repository/model/fission_notify.gen.go new file mode 100644 index 0000000..b97b9bf --- /dev/null +++ b/internal/repository/model/fission_notify.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionNotify = "fission_notify" + +// FissionNotify mapped from table +type FissionNotify struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;comment:对外hash_id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;index:idx_record_id,priority:1;comment:玩法奖品记录id(fission_reward_record表)" json:"record_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id(活动下对应的用户奖品表id)" json:"reward_id"` + NotifyType int8 `gorm:"column:notify_type;type:tinyint;not null;comment:回调类型(1-服务端回调,2-客户端监听)" json:"notify_type"` + NotifyURL string `gorm:"column:notify_url;type:varchar(255);not null;comment:回调地址" json:"notify_url"` + Token string `gorm:"column:token;type:varchar(40);not null;comment:回调的token" json:"token"` + Body string `gorm:"column:body;type:varchar(10000);not null;comment:推送数据" json:"body"` + PushNum int32 `gorm:"column:push_num;type:int;not null;comment:推送次数" json:"push_num"` + IsOk int8 `gorm:"column:is_ok;type:tinyint;not null;comment:是否推送成功(0-否,1-是)" json:"is_ok"` + PushLadder int8 `gorm:"column:push_ladder;type:tinyint;not null;comment:是否开启转发推送" json:"push_ladder"` + Headers string `gorm:"column:headers;type:json;not null;comment:请求头数据" json:"headers"` +} + +// TableName FissionNotify's table name +func (*FissionNotify) TableName() string { + return TableNameFissionNotify +} diff --git a/internal/repository/model/fission_notify.go b/internal/repository/model/fission_notify.go new file mode 100644 index 0000000..ad60927 --- /dev/null +++ b/internal/repository/model/fission_notify.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionNotify) SetHeaders(val []*mtype.Header) { + s.Headers, _ = jsonm.MarshalToString(val) +} + +func (s *FissionNotify) GetHeaders() (val []*mtype.Header) { + _ = jsonm.StrUnmarshal(s.Headers, &val) + return +} diff --git a/internal/repository/model/fission_notify_resp.gen.go b/internal/repository/model/fission_notify_resp.gen.go new file mode 100644 index 0000000..ed2f4b6 --- /dev/null +++ b/internal/repository/model/fission_notify_resp.gen.go @@ -0,0 +1,21 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionNotifyResp = "fission_notify_resp" + +// FissionNotifyResp mapped from table +type FissionNotifyResp struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + NotifyID int64 `gorm:"column:notify_id;type:bigint;not null;index:idx_notify_id,priority:1;comment:回调记录id(fission_notify表)" json:"notify_id"` + Resp string `gorm:"column:resp;type:varchar(500);not null;comment:回调结果" json:"resp"` +} + +// TableName FissionNotifyResp's table name +func (*FissionNotifyResp) TableName() string { + return TableNameFissionNotifyResp +} diff --git a/internal/repository/model/fission_notify_task.gen.go b/internal/repository/model/fission_notify_task.gen.go new file mode 100644 index 0000000..3dca912 --- /dev/null +++ b/internal/repository/model/fission_notify_task.gen.go @@ -0,0 +1,20 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionNotifyTask = "fission_notify_task" + +// FissionNotifyTask mapped from table +type FissionNotifyTask struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + DoTime int64 `gorm:"column:do_time;type:bigint;not null;index:idx_do_time,priority:1;comment:执行时间" json:"do_time"` + NotifyID int64 `gorm:"column:notify_id;type:bigint;not null;comment:回调id(fission_notify表)" json:"notify_id"` + Reward string `gorm:"column:reward;type:varchar(2000);not null;comment:奖品推送内容" json:"reward"` +} + +// TableName FissionNotifyTask's table name +func (*FissionNotifyTask) TableName() string { + return TableNameFissionNotifyTask +} diff --git a/internal/repository/model/fission_point_deduct.gen.go b/internal/repository/model/fission_point_deduct.gen.go new file mode 100644 index 0000000..0829a4a --- /dev/null +++ b/internal/repository/model/fission_point_deduct.gen.go @@ -0,0 +1,20 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionPointDeduct = "fission_point_deduct" + +// FissionPointDeduct mapped from table +type FissionPointDeduct struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id,priority:1" json:"user_id"` + Num int32 `gorm:"column:num;type:int;not null;comment:扣除数量" json:"num"` +} + +// TableName FissionPointDeduct's table name +func (*FissionPointDeduct) TableName() string { + return TableNameFissionPointDeduct +} diff --git a/internal/repository/model/fission_points_log.gen.go b/internal/repository/model/fission_points_log.gen.go new file mode 100644 index 0000000..faab1ec --- /dev/null +++ b/internal/repository/model/fission_points_log.gen.go @@ -0,0 +1,33 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionPointsLog = "fission_points_log" + +// FissionPointsLog mapped from table +type FissionPointsLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_state,priority:1;comment:用户id(fission_user表)" json:"user_id"` + State string `gorm:"column:state;type:varchar(10);not null;index:idx_user_id_state,priority:2;comment:类型(deduct - 扣除, gain - 获得)" json:"state"` + Num int32 `gorm:"column:num;type:int;not null;comment:数量" json:"num"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + ReqURL string `gorm:"column:req_url;type:varchar(255);not null;comment:请求地址" json:"req_url"` + Req string `gorm:"column:req;type:varchar(255);not null;comment:请求数据" json:"req"` + Resp string `gorm:"column:resp;type:varchar(255);not null;comment:返回数据" json:"resp"` + RespCode int32 `gorm:"column:resp_code;type:int;not null;comment:返回状态码" json:"resp_code"` + ReqTime int64 `gorm:"column:req_time;type:bigint;not null;comment:请求时长(单位:ms)" json:"req_time"` + ErrMsg string `gorm:"column:err_msg;type:varchar(255);not null;comment:错误信息" json:"err_msg"` + OtherData string `gorm:"column:other_data;type:varchar(255);not null;comment:其他数据信息" json:"other_data"` + Token string `gorm:"column:token;type:varchar(255);not null;comment:请求token" json:"token"` + ReqHeader string `gorm:"column:req_header;type:varchar(255);not null;comment:请求头数据" json:"req_header"` +} + +// TableName FissionPointsLog's table name +func (*FissionPointsLog) TableName() string { + return TableNameFissionPointsLog +} diff --git a/internal/repository/model/fission_points_log.go b/internal/repository/model/fission_points_log.go new file mode 100644 index 0000000..b12c2ff --- /dev/null +++ b/internal/repository/model/fission_points_log.go @@ -0,0 +1,24 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionPointsLog) SetOtherData(val mtype.PointsLogOther) { + m.OtherData, _ = jsonm.MarshalToString(val) +} + +func (m *FissionPointsLog) GetOtherData() (val mtype.PointsLogOther) { + _ = jsonm.StrUnmarshal(m.OtherData, &val) + return +} + +func (m *FissionPointsLog) SetReq(val mtype.PointsLogReq) { + m.Req, _ = jsonm.MarshalToString(val) +} + +func (m *FissionPointsLog) GetReq() (val mtype.PointsLogReq) { + _ = jsonm.StrUnmarshal(m.Req, &val) + return +} diff --git a/internal/repository/model/fission_prize_wheel.gen.go b/internal/repository/model/fission_prize_wheel.gen.go new file mode 100644 index 0000000..3c08f0b --- /dev/null +++ b/internal/repository/model/fission_prize_wheel.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionPrizeWheel = "fission_prize_wheel" + +// FissionPrizeWheel mapped from table +type FissionPrizeWheel struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的抽奖次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽奖次数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionPrizeWheel's table name +func (*FissionPrizeWheel) TableName() string { + return TableNameFissionPrizeWheel +} diff --git a/internal/repository/model/fission_prize_wheel_log.gen.go b/internal/repository/model/fission_prize_wheel_log.gen.go new file mode 100644 index 0000000..7f884a1 --- /dev/null +++ b/internal/repository/model/fission_prize_wheel_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionPrizeWheelLog = "fission_prize_wheel_log" + +// FissionPrizeWheelLog mapped from table +type FissionPrizeWheelLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_wheel_id_type_created_at,priority:3" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + WheelID int64 `gorm:"column:wheel_id;type:bigint;not null;index:idx_wheel_id_type_created_at,priority:1;comment:玩家id(fission_prize_wheel表id)" json:"wheel_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_wheel_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionPrizeWheelLog's table name +func (*FissionPrizeWheelLog) TableName() string { + return TableNameFissionPrizeWheelLog +} diff --git a/internal/repository/model/fission_prize_wheel_log.go b/internal/repository/model/fission_prize_wheel_log.go new file mode 100644 index 0000000..e6f8f53 --- /dev/null +++ b/internal/repository/model/fission_prize_wheel_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionPrizeWheelLog) SetVal(val mtype.LotteryLogVal) { + m.Val, _ = jsonm.MarshalToString(val) +} + +func (m *FissionPrizeWheelLog) GetVal() (val mtype.LotteryLogVal) { + _ = jsonm.StrUnmarshal(m.Val, &val) + return +} diff --git a/internal/repository/model/fission_prize_wheel_lucky.gen.go b/internal/repository/model/fission_prize_wheel_lucky.gen.go new file mode 100644 index 0000000..fb24eeb --- /dev/null +++ b/internal/repository/model/fission_prize_wheel_lucky.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionPrizeWheelLucky = "fission_prize_wheel_lucky" + +// FissionPrizeWheelLucky mapped from table +type FissionPrizeWheelLucky struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的hash_id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Win int8 `gorm:"column:win;type:tinyint;not null;comment:是否中奖(1-是,0-否)" json:"win"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品ID" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionPrizeWheelLucky's table name +func (*FissionPrizeWheelLucky) TableName() string { + return TableNameFissionPrizeWheelLucky +} diff --git a/internal/repository/model/fission_qa.gen.go b/internal/repository/model/fission_qa.gen.go new file mode 100644 index 0000000..0d187b1 --- /dev/null +++ b/internal/repository/model/fission_qa.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionQa = "fission_qa" + +// FissionQa mapped from table +type FissionQa struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:答题机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的答题次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽签数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionQa's table name +func (*FissionQa) TableName() string { + return TableNameFissionQa +} diff --git a/internal/repository/model/fission_qa_answer.gen.go b/internal/repository/model/fission_qa_answer.gen.go new file mode 100644 index 0000000..cb347af --- /dev/null +++ b/internal/repository/model/fission_qa_answer.gen.go @@ -0,0 +1,29 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionQaAnswer = "fission_qa_answer" + +// FissionQaAnswer mapped from table +type FissionQaAnswer struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的唯一id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Win int8 `gorm:"column:win;type:tinyint;not null;comment:是否达标(1-是,0-否)" json:"win"` + Score int32 `gorm:"column:score;type:int;not null;comment:答题分数" json:"score"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品ID" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` + Answer string `gorm:"column:answer;type:varchar(2000);not null;comment:答卷内容" json:"answer"` +} + +// TableName FissionQaAnswer's table name +func (*FissionQaAnswer) TableName() string { + return TableNameFissionQaAnswer +} diff --git a/internal/repository/model/fission_qa_log.gen.go b/internal/repository/model/fission_qa_log.gen.go new file mode 100644 index 0000000..8747f2b --- /dev/null +++ b/internal/repository/model/fission_qa_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionQaLog = "fission_qa_log" + +// FissionQaLog mapped from table +type FissionQaLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + QaID int64 `gorm:"column:qa_id;type:bigint;not null;index:idx_qa_id_type_created_at,priority:1;comment:玩家id(fission_qa表id)" json:"qa_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_qa_id_type_created_at,priority:2;comment:日志类型(1-获得答题机会,2-答题)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionQaLog's table name +func (*FissionQaLog) TableName() string { + return TableNameFissionQaLog +} diff --git a/internal/repository/model/fission_quiz.gen.go b/internal/repository/model/fission_quiz.gen.go new file mode 100644 index 0000000..cdceaa9 --- /dev/null +++ b/internal/repository/model/fission_quiz.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionQuiz = "fission_quiz" + +// FissionQuiz mapped from table +type FissionQuiz struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:投票机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的投票机会次数" json:"task_chance"` + OptionID int64 `gorm:"column:option_id;type:bigint;not null;comment:选项id(fission_campaign_quiz_option表)" json:"option_id"` + IsWin int8 `gorm:"column:is_win;type:tinyint;not null;comment:是否赢得竞猜(0-否,1-是)" json:"is_win"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionQuiz's table name +func (*FissionQuiz) TableName() string { + return TableNameFissionQuiz +} diff --git a/internal/repository/model/fission_quiz_log.gen.go b/internal/repository/model/fission_quiz_log.gen.go new file mode 100644 index 0000000..0042b0f --- /dev/null +++ b/internal/repository/model/fission_quiz_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionQuizLog = "fission_quiz_log" + +// FissionQuizLog mapped from table +type FissionQuizLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + QuizID int64 `gorm:"column:quiz_id;type:bigint;not null;index:idx_quiz_id_type_created_at,priority:1;comment:玩家id(fission_quiz表id)" json:"quiz_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_quiz_id_type_created_at,priority:2;comment:日志类型(1-获得投票机会,2-投票,3-获得奖品)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:数据对象" json:"val"` +} + +// TableName FissionQuizLog's table name +func (*FissionQuizLog) TableName() string { + return TableNameFissionQuizLog +} diff --git a/internal/repository/model/fission_quiz_reward.gen.go b/internal/repository/model/fission_quiz_reward.gen.go new file mode 100644 index 0000000..c1faaf4 --- /dev/null +++ b/internal/repository/model/fission_quiz_reward.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionQuizReward = "fission_quiz_reward" + +// FissionQuizReward mapped from table +type FissionQuizReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的唯一id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_reward_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品ID" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` +} + +// TableName FissionQuizReward's table name +func (*FissionQuizReward) TableName() string { + return TableNameFissionQuizReward +} diff --git a/internal/repository/model/fission_referral.gen.go b/internal/repository/model/fission_referral.gen.go new file mode 100644 index 0000000..08d69b8 --- /dev/null +++ b/internal/repository/model/fission_referral.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionReferral = "fission_referral" + +// FissionReferral mapped from table +type FissionReferral struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + LimitStatus int8 `gorm:"column:limit_status;type:tinyint;not null;comment:任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制)" json:"limit_status"` + BindInstall int8 `gorm:"column:bind_install;type:tinyint;not null;comment:是否绑定了安装事件(0-否,1-是)" json:"bind_install"` + BindRegister int8 `gorm:"column:bind_register;type:tinyint;not null;comment:是否绑定了注册事件(0-否,1-是)" json:"bind_register"` + NextStep int32 `gorm:"column:next_step;type:int;not null;comment:可领取的下一阶段奖品" json:"next_step"` + LoopInvite int32 `gorm:"column:loop_invite;type:int;not null;comment:当前循环的数" json:"loop_invite"` +} + +// TableName FissionReferral's table name +func (*FissionReferral) TableName() string { + return TableNameFissionReferral +} diff --git a/internal/repository/model/fission_referral_reward.gen.go b/internal/repository/model/fission_referral_reward.gen.go new file mode 100644 index 0000000..f1289eb --- /dev/null +++ b/internal/repository/model/fission_referral_reward.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionReferralReward = "fission_referral_reward" + +// FissionReferralReward mapped from table +type FissionReferralReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的hash_id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id(fission_campaign_referral_reward表)" json:"reward_id"` + Num int32 `gorm:"column:num;type:int;not null;comment:获得的奖品数量" json:"num"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + Step int32 `gorm:"column:step;type:int;not null;comment:奖励阶段" json:"step"` + IsExtra int8 `gorm:"column:is_extra;type:tinyint;not null;comment:是否额外的奖励(0-否,1-是)" json:"is_extra"` +} + +// TableName FissionReferralReward's table name +func (*FissionReferralReward) TableName() string { + return TableNameFissionReferralReward +} diff --git a/internal/repository/model/fission_reward_record.gen.go b/internal/repository/model/fission_reward_record.gen.go new file mode 100644 index 0000000..386c547 --- /dev/null +++ b/internal/repository/model/fission_reward_record.gen.go @@ -0,0 +1,40 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionRewardRecord = "fission_reward_record" + +// FissionRewardRecord mapped from table +type FissionRewardRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(22);not null;uniqueIndex:uniq_hash_id,priority:1;comment:奖品对外id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户id(fission_user表)" json:"user_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id(fission_campaign_reward表)" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(32);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品)" json:"reward_type"` + RewardNum int32 `gorm:"column:reward_num;type:int;not null;comment:获得的奖品数量" json:"reward_num"` + Step int32 `gorm:"column:step;type:int;not null;comment:奖励阶段" json:"step"` + IsThank int8 `gorm:"column:is_thank;type:tinyint;not null;comment:是否谢谢参与奖(0-否,1-是)" json:"is_thank"` + Score int32 `gorm:"column:score;type:int;not null;comment:领取奖品的分数" json:"score"` + Answer string `gorm:"column:answer;type:varchar(2000);not null;comment:答卷内容" json:"answer"` + Status int8 `gorm:"column:status;type:tinyint;not null;comment:奖品状态(1-处理成功,2-待推送,3-推送失败,4-手动发放,5-待填写表单,6-已填写表单)" json:"status"` + FailType string `gorm:"column:fail_type;type:varchar(20);not null;comment:失败原因标识" json:"fail_type"` + FailMsg string `gorm:"column:fail_msg;type:varchar(500);not null;comment:具体失败原因" json:"fail_msg"` + BaseRewardID int64 `gorm:"column:base_reward_id;type:bigint;not null;comment:基础奖品id(reward表)" json:"base_reward_id"` + CustomRewardVal string `gorm:"column:custom_reward_val;type:varchar(255);not null;comment:回调后接收到的数据" json:"custom_reward_val"` + PropMark string `gorm:"column:prop_mark;type:varchar(255);not null;comment:道具类型(reward-奖品,chance-活动道具)" json:"prop_mark"` + ChildID int64 `gorm:"column:child_id;type:bigint;not null;index:idx_child_id,priority:1;comment:子活动id" json:"child_id"` + MallRecordID int64 `gorm:"column:mall_record_id;type:bigint;not null;comment:商城商品id" json:"mall_record_id"` + ExchangePoints int32 `gorm:"column:exchange_points;type:int;not null;comment:兑换所需积分" json:"exchange_points"` +} + +// TableName FissionRewardRecord's table name +func (*FissionRewardRecord) TableName() string { + return TableNameFissionRewardRecord +} diff --git a/internal/repository/model/fission_reward_record.go b/internal/repository/model/fission_reward_record.go new file mode 100644 index 0000000..1adda6c --- /dev/null +++ b/internal/repository/model/fission_reward_record.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionRewardRecord) SetAnswer(val []*mtype.RewardRecordQaAnswer) { + m.Answer, _ = jsonm.MarshalToString(val) +} + +func (m *FissionRewardRecord) GetAnswer() (val []*mtype.RewardRecordQaAnswer) { + _ = jsonm.StrUnmarshal(m.Answer, &val) + return +} diff --git a/internal/repository/model/fission_reward_record_form.gen.go b/internal/repository/model/fission_reward_record_form.gen.go new file mode 100644 index 0000000..91b28e4 --- /dev/null +++ b/internal/repository/model/fission_reward_record_form.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionRewardRecordForm = "fission_reward_record_form" + +// FissionRewardRecordForm mapped from table +type FissionRewardRecordForm struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;comment:活动id(fission_campaign表)" json:"campaign_id"` + RecordID int64 `gorm:"column:record_id;type:bigint;not null;comment:奖品记录ID(fission_reward_record_form)" json:"record_id"` + FormID int64 `gorm:"column:form_id;type:bigint;not null;comment:表单id(form表)" json:"form_id"` + Items string `gorm:"column:items;type:json;not null;comment:表单数据" json:"items"` +} + +// TableName FissionRewardRecordForm's table name +func (*FissionRewardRecordForm) TableName() string { + return TableNameFissionRewardRecordForm +} diff --git a/internal/repository/model/fission_reward_record_form.go b/internal/repository/model/fission_reward_record_form.go new file mode 100644 index 0000000..51328ac --- /dev/null +++ b/internal/repository/model/fission_reward_record_form.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionRewardRecordForm) SetItems(val []*mtype.SubmitFormItem) { + s.Items, _ = jsonm.MarshalToString(val) +} + +func (s *FissionRewardRecordForm) GetItems() (val []*mtype.SubmitFormItem) { + _ = jsonm.StrUnmarshal(s.Items, &val) + return +} diff --git a/internal/repository/model/fission_sign.gen.go b/internal/repository/model/fission_sign.gen.go new file mode 100644 index 0000000..ba30290 --- /dev/null +++ b/internal/repository/model/fission_sign.gen.go @@ -0,0 +1,30 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionSign = "fission_sign" + +// FissionSign mapped from table +type FissionSign struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + SignDay int32 `gorm:"column:sign_day;type:int;not null;comment:签到天数" json:"sign_day"` + SignContinue int32 `gorm:"column:sign_continue;type:int;not null;comment:连续签到天数" json:"sign_continue"` + CardNum int32 `gorm:"column:card_num;type:int;not null;comment:签到卡数量" json:"card_num"` + TaskCard int32 `gorm:"column:task_card;type:int;not null;comment:邀请获得的签到卡数" json:"task_card"` + SignStart int64 `gorm:"column:sign_start;type:bigint;not null;comment:开始签到时间" json:"sign_start"` + MaxContinue int32 `gorm:"column:max_continue;type:int;not null;comment:最大连签天数" json:"max_continue"` + LoopNum int32 `gorm:"column:loop_num;type:int;not null;comment:完成的循环数" json:"loop_num"` + NextStep int32 `gorm:"column:next_step;type:int;not null;comment:下一阶完成" json:"next_step"` + CycleStart int64 `gorm:"column:cycle_start;type:bigint;not null;comment:周期开始时间" json:"cycle_start"` +} + +// TableName FissionSign's table name +func (*FissionSign) TableName() string { + return TableNameFissionSign +} diff --git a/internal/repository/model/fission_sign_day.gen.go b/internal/repository/model/fission_sign_day.gen.go new file mode 100644 index 0000000..7a2d7da --- /dev/null +++ b/internal/repository/model/fission_sign_day.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionSignDay = "fission_sign_day" + +// FissionSignDay mapped from table +type FissionSignDay struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_sign_date,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + SignDate string `gorm:"column:sign_date;type:char(8);not null;uniqueIndex:uniq_user_id_sign_date,priority:2;comment:签到日期" json:"sign_date"` + SignType int8 `gorm:"column:sign_type;type:tinyint;not null;comment:签到类型(1-正常签到,2-漏签,3-补签)" json:"sign_type"` + RecordIds string `gorm:"column:record_ids;type:varchar(255);not null;comment:关联的奖品记录id(fission_reward_record表)" json:"record_ids"` +} + +// TableName FissionSignDay's table name +func (*FissionSignDay) TableName() string { + return TableNameFissionSignDay +} diff --git a/internal/repository/model/fission_sign_day.go b/internal/repository/model/fission_sign_day.go new file mode 100644 index 0000000..5b83fdb --- /dev/null +++ b/internal/repository/model/fission_sign_day.go @@ -0,0 +1,26 @@ +package model + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/utils" + "strings" +) + +func (m *FissionSignDay) SetRecordIds(ids []int64) { + if len(ids) >= 0 { + m.RecordIds = utils.Join(ids, consts.JoinComma) + } + +} + +func (m *FissionSignDay) GetRecordIds() (ids []int64) { + if m.RecordIds == "" { + return + } + + idStr := strings.Split(m.RecordIds, consts.JoinComma) + for _, v := range idStr { + ids = append(ids, utils.StrToInt64(v)) + } + return +} diff --git a/internal/repository/model/fission_sign_log.gen.go b/internal/repository/model/fission_sign_log.gen.go new file mode 100644 index 0000000..7944fe4 --- /dev/null +++ b/internal/repository/model/fission_sign_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionSignLog = "fission_sign_log" + +// FissionSignLog mapped from table +type FissionSignLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_type,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + SignID int64 `gorm:"column:sign_id;type:bigint;not null;index:idx_sign_id,priority:1;comment:玩家id(fission_sign表id)" json:"sign_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_user_id_type,priority:2;comment:日志类型(1-签到,2-获得奖品,4-补签卡状态)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:数据对象" json:"val"` +} + +// TableName FissionSignLog's table name +func (*FissionSignLog) TableName() string { + return TableNameFissionSignLog +} diff --git a/internal/repository/model/fission_slot.gen.go b/internal/repository/model/fission_slot.gen.go new file mode 100644 index 0000000..131971b --- /dev/null +++ b/internal/repository/model/fission_slot.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionSlot = "fission_slot" + +// FissionSlot mapped from table +type FissionSlot struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + TaskChance int32 `gorm:"column:task_chance;type:int;not null;comment:完成任务获取的抽奖次数" json:"task_chance"` + DayChance int32 `gorm:"column:day_chance;type:int;not null;comment:每日签到获得的抽奖次数" json:"day_chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` +} + +// TableName FissionSlot's table name +func (*FissionSlot) TableName() string { + return TableNameFissionSlot +} diff --git a/internal/repository/model/fission_slot_log.gen.go b/internal/repository/model/fission_slot_log.gen.go new file mode 100644 index 0000000..e3bbaf7 --- /dev/null +++ b/internal/repository/model/fission_slot_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionSlotLog = "fission_slot_log" + +// FissionSlotLog mapped from table +type FissionSlotLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + SlotID int64 `gorm:"column:slot_id;type:bigint;not null;index:idx_slot_id_type_created_at,priority:1;comment:玩家id(fission_slot表id)" json:"slot_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_slot_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionSlotLog's table name +func (*FissionSlotLog) TableName() string { + return TableNameFissionSlotLog +} diff --git a/internal/repository/model/fission_slot_log.go b/internal/repository/model/fission_slot_log.go new file mode 100644 index 0000000..c554c3f --- /dev/null +++ b/internal/repository/model/fission_slot_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionSlotLog) SetVal(val mtype.LotteryLogVal) { + m.Val, _ = jsonm.MarshalToString(val) +} + +func (m *FissionSlotLog) GetVal() (val mtype.LotteryLogVal) { + _ = jsonm.StrUnmarshal(m.Val, &val) + return +} diff --git a/internal/repository/model/fission_slot_lucky.gen.go b/internal/repository/model/fission_slot_lucky.gen.go new file mode 100644 index 0000000..419b092 --- /dev/null +++ b/internal/repository/model/fission_slot_lucky.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionSlotLucky = "fission_slot_lucky" + +// FissionSlotLucky mapped from table +type FissionSlotLucky struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的唯一id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Win int8 `gorm:"column:win;type:tinyint;not null;comment:是否中奖(1-是,0-否)" json:"win"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品ID" json:"reward_id"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(128);not null;comment:奖品图片" json:"img_url"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-站内奖品,2-站外奖品)" json:"reward_type"` +} + +// TableName FissionSlotLucky's table name +func (*FissionSlotLucky) TableName() string { + return TableNameFissionSlotLucky +} diff --git a/internal/repository/model/fission_stat_channel.gen.go b/internal/repository/model/fission_stat_channel.gen.go new file mode 100644 index 0000000..42bf429 --- /dev/null +++ b/internal/repository/model/fission_stat_channel.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionStatChannel = "fission_stat_channel" + +// FissionStatChannel mapped from table +type FissionStatChannel struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + ChannelID int64 `gorm:"column:channel_id;type:bigint;not null;uniqueIndex:uniq_channel_id_mark,priority:1;comment:渠道id" json:"channel_id"` + StatTime int64 `gorm:"column:stat_time;type:bigint;not null;comment:统计时间" json:"stat_time"` + InstallNum int64 `gorm:"column:install_num;type:bigint;not null;comment:通过活动安装次数" json:"install_num"` + ViewNum int64 `gorm:"column:view_num;type:bigint;not null;comment:浏览活动页面次数" json:"view_num"` + ViewUserNum int64 `gorm:"column:view_user_num;type:bigint;not null;comment:浏览活动页面人数" json:"view_user_num"` + OpenNum int64 `gorm:"column:open_num;type:bigint;not null;comment:打开app次数" json:"open_num"` + OpenUserNum int64 `gorm:"column:open_user_num;type:bigint;not null;comment:打开app人数" json:"open_user_num"` + InstallUserNum int64 `gorm:"column:install_user_num;type:bigint;not null;comment:通过活动安装人数" json:"install_user_num"` +} + +// TableName FissionStatChannel's table name +func (*FissionStatChannel) TableName() string { + return TableNameFissionStatChannel +} diff --git a/internal/repository/model/fission_stat_cycle.gen.go b/internal/repository/model/fission_stat_cycle.gen.go new file mode 100644 index 0000000..54f1990 --- /dev/null +++ b/internal/repository/model/fission_stat_cycle.gen.go @@ -0,0 +1,36 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionStatCycle = "fission_stat_cycle" + +// FissionStatCycle mapped from table +type FissionStatCycle struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + StatTime int64 `gorm:"column:stat_time;type:bigint;not null;uniqueIndex:idx_campaign_stat,priority:3;index:idx_stat,priority:1;comment:统计时间" json:"stat_time"` + StatType int8 `gorm:"column:stat_type;type:tinyint;not null;uniqueIndex:idx_campaign_stat,priority:2;comment:统计类型: 1小时统计 2天统计" json:"stat_type"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:idx_campaign_stat,priority:1;comment:活动id" json:"campaign_id"` + ViewNum int64 `gorm:"column:view_num;type:bigint;not null;comment:浏览活动页面次数" json:"view_num"` + ViewUserNum int64 `gorm:"column:view_user_num;type:bigint;not null;comment:浏览活动页面人数" json:"view_user_num"` + ButtonClickNum int64 `gorm:"column:button_click_num;type:bigint;not null;comment:活动按钮点击次数" json:"button_click_num"` + ButtonClickUserNum int64 `gorm:"column:button_click_user_num;type:bigint;not null;comment:活动按钮点击人数" json:"button_click_user_num"` + ShareNum int64 `gorm:"column:share_num;type:bigint;not null;comment:活动分享按钮点击次数" json:"share_num"` + ShareUserNum int64 `gorm:"column:share_user_num;type:bigint;not null;comment:活动分享按钮点击人数" json:"share_user_num"` + ViewDownloadNum int64 `gorm:"column:view_download_num;type:bigint;not null;comment:浏览下载页次数" json:"view_download_num"` + ViewDownloadUserNum int64 `gorm:"column:view_download_user_num;type:bigint;not null;comment:浏览下载页人数" json:"view_download_user_num"` + ClickDownloadNum int64 `gorm:"column:click_download_num;type:bigint;not null;comment:点击下载按钮次数" json:"click_download_num"` + ClickDownloadUserNum int64 `gorm:"column:click_download_user_num;type:bigint;not null;comment:点击下载按钮人数" json:"click_download_user_num"` + ViewWechatNum int64 `gorm:"column:view_wechat_num;type:bigint;not null;comment:微信页访问次数" json:"view_wechat_num"` + ViewWechatUserNum int64 `gorm:"column:view_wechat_user_num;type:bigint;not null;comment:微信页访问人数" json:"view_wechat_user_num"` + InstallNum int64 `gorm:"column:install_num;type:bigint;not null;comment:通过活动安装次数" json:"install_num"` + InstallUserNum int64 `gorm:"column:install_user_num;type:bigint;not null;comment:通过活动安装人数" json:"install_user_num"` + ViewDownloadWechatNum int64 `gorm:"column:view_download_wechat_num;type:bigint;not null;comment:浏览通过微信分享打开的下载页次数" json:"view_download_wechat_num"` + ViewDownloadWechatUserNum int64 `gorm:"column:view_download_wechat_user_num;type:bigint;not null;comment:浏览通过微信分享打开的下载页人数" json:"view_download_wechat_user_num"` +} + +// TableName FissionStatCycle's table name +func (*FissionStatCycle) TableName() string { + return TableNameFissionStatCycle +} diff --git a/internal/repository/model/fission_stat_media.gen.go b/internal/repository/model/fission_stat_media.gen.go new file mode 100644 index 0000000..ab2fa12 --- /dev/null +++ b/internal/repository/model/fission_stat_media.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionStatMedium = "fission_stat_media" + +// FissionStatMedium mapped from table +type FissionStatMedium struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_media_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + MediaID int64 `gorm:"column:media_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_media_id,priority:2;comment:社媒id" json:"media_id"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:点击次数" json:"num"` + UserNum int64 `gorm:"column:user_num;type:bigint;not null;comment:点击人数" json:"user_num"` +} + +// TableName FissionStatMedium's table name +func (*FissionStatMedium) TableName() string { + return TableNameFissionStatMedium +} diff --git a/internal/repository/model/fission_stat_other.gen.go b/internal/repository/model/fission_stat_other.gen.go new file mode 100644 index 0000000..93bfdc3 --- /dev/null +++ b/internal/repository/model/fission_stat_other.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionStatOther = "fission_stat_other" + +// FissionStatOther mapped from table +type FissionStatOther struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_campaign_id_mark,priority:2;comment:统计标识" json:"mark"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:统计数量" json:"num"` +} + +// TableName FissionStatOther's table name +func (*FissionStatOther) TableName() string { + return TableNameFissionStatOther +} diff --git a/internal/repository/model/fission_stat_summary.gen.go b/internal/repository/model/fission_stat_summary.gen.go new file mode 100644 index 0000000..b273b6e --- /dev/null +++ b/internal/repository/model/fission_stat_summary.gen.go @@ -0,0 +1,36 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionStatSummary = "fission_stat_summary" + +// FissionStatSummary mapped from table +type FissionStatSummary struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:idx_campaign,priority:1;comment:活动id" json:"campaign_id"` + ViewNum int64 `gorm:"column:view_num;type:bigint;not null;comment:浏览活动页面次数" json:"view_num"` + ViewUserNum int64 `gorm:"column:view_user_num;type:bigint;not null;comment:浏览活动页面人数" json:"view_user_num"` + ButtonClickNum int64 `gorm:"column:button_click_num;type:bigint;not null;comment:活动按钮点击次数" json:"button_click_num"` + ButtonClickUserNum int64 `gorm:"column:button_click_user_num;type:bigint;not null;comment:活动按钮点击人数" json:"button_click_user_num"` + ShareNum int64 `gorm:"column:share_num;type:bigint;not null;comment:活动分享按钮点击次数" json:"share_num"` + ShareUserNum int64 `gorm:"column:share_user_num;type:bigint;not null;comment:活动分享按钮点击人数" json:"share_user_num"` + ViewDownloadNum int64 `gorm:"column:view_download_num;type:bigint;not null;comment:浏览下载页次数" json:"view_download_num"` + ViewDownloadUserNum int64 `gorm:"column:view_download_user_num;type:bigint;not null;comment:浏览下载页人数" json:"view_download_user_num"` + ClickDownloadNum int64 `gorm:"column:click_download_num;type:bigint;not null;comment:点击下载按钮次数" json:"click_download_num"` + ClickDownloadUserNum uint64 `gorm:"column:click_download_user_num;type:bigint unsigned;not null;comment:点击下载按钮人数" json:"click_download_user_num"` + ViewWechatNum int64 `gorm:"column:view_wechat_num;type:bigint;not null;comment:微信页访问次数" json:"view_wechat_num"` + ViewWechatUserNum int64 `gorm:"column:view_wechat_user_num;type:bigint;not null;comment:微信页访问人数" json:"view_wechat_user_num"` + InstallNum int64 `gorm:"column:install_num;type:bigint;not null;comment:通过活动安装次数" json:"install_num"` + InstallUserNum int64 `gorm:"column:install_user_num;type:bigint;not null;comment:通过活动安装人数" json:"install_user_num"` + ViewDownloadWechatNum int64 `gorm:"column:view_download_wechat_num;type:bigint;not null;comment:浏览通过微信分享打开的下载页次数" json:"view_download_wechat_num"` + ViewDownloadWechatUserNum int64 `gorm:"column:view_download_wechat_user_num;type:bigint;not null;comment:浏览通过微信分享打开的下载页人数" json:"view_download_wechat_user_num"` +} + +// TableName FissionStatSummary's table name +func (*FissionStatSummary) TableName() string { + return TableNameFissionStatSummary +} diff --git a/internal/repository/model/fission_target_record.gen.go b/internal/repository/model/fission_target_record.gen.go new file mode 100644 index 0000000..e1e37a7 --- /dev/null +++ b/internal/repository/model/fission_target_record.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTargetRecord = "fission_target_record" + +// FissionTargetRecord mapped from table +type FissionTargetRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_finish_time,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_num,priority:1;comment:用户id(fission_user表)" json:"user_id"` + Num int32 `gorm:"column:num;type:int;not null;index:idx_user_id_num,priority:2;comment:第几次达标" json:"num"` + CondID string `gorm:"column:cond_id;type:varchar(255);not null;comment:完成的事件所以达标,多个用,分割" json:"cond_id"` + FinishTime int64 `gorm:"column:finish_time;type:bigint;not null;index:idx_campaign_id_finish_time,priority:2;comment:完成时间" json:"finish_time"` +} + +// TableName FissionTargetRecord's table name +func (*FissionTargetRecord) TableName() string { + return TableNameFissionTargetRecord +} diff --git a/internal/repository/model/fission_temp.gen.go b/internal/repository/model/fission_temp.gen.go new file mode 100644 index 0000000..6febc39 --- /dev/null +++ b/internal/repository/model/fission_temp.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTemp = "fission_temp" + +// FissionTemp mapped from table +type FissionTemp struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:模版对外id" json:"hash_id"` + FissionID int64 `gorm:"column:fission_id;type:bigint;not null;index:idx_fission_id,priority:1;comment:玩法id(fission表主键)" json:"fission_id"` + GroupID int64 `gorm:"column:group_id;type:bigint;not null;index:uniq_group_id_lang_type,priority:1;comment:模版组id(fission_temp_group表)" json:"group_id"` + LangType int8 `gorm:"column:lang_type;type:tinyint;not null;index:uniq_group_id_lang_type,priority:2;comment:语言(1-中文,2-英文)" json:"lang_type"` + TextType int8 `gorm:"column:text_type;type:tinyint;not null;comment:文字模板(1-汉字模板,2-拉丁语系模板)" json:"text_type"` +} + +// TableName FissionTemp's table name +func (*FissionTemp) TableName() string { + return TableNameFissionTemp +} diff --git a/internal/repository/model/fission_temp_group.gen.go b/internal/repository/model/fission_temp_group.gen.go new file mode 100644 index 0000000..b94c51d --- /dev/null +++ b/internal/repository/model/fission_temp_group.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTempGroup = "fission_temp_group" + +// FissionTempGroup mapped from table +type FissionTempGroup struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + FissionID int64 `gorm:"column:fission_id;type:bigint;not null;index:idx_fission_id,priority:1;comment:玩法id(fission表主键)" json:"fission_id"` + CoverURL string `gorm:"column:cover_url;type:varchar(128);not null;comment:模版组封面" json:"cover_url"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_mark,priority:1;comment:模版组标识" json:"mark"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序(越小越前)" json:"sort"` + ConvertCoverURL string `gorm:"column:convert_cover_url;type:varchar(128);not null;comment:事件转化封面" json:"convert_cover_url"` + LangParts string `gorm:"column:lang_parts;type:varchar(255);not null;comment:支持玩法组件翻译" json:"lang_parts"` + IsPrivate int8 `gorm:"column:is_private;type:tinyint;not null;comment:是否私有模板(0-否,1-是)" json:"is_private"` +} + +// TableName FissionTempGroup's table name +func (*FissionTempGroup) TableName() string { + return TableNameFissionTempGroup +} diff --git a/internal/repository/model/fission_temp_group_lang.gen.go b/internal/repository/model/fission_temp_group_lang.gen.go new file mode 100644 index 0000000..14654db --- /dev/null +++ b/internal/repository/model/fission_temp_group_lang.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTempGroupLang = "fission_temp_group_lang" + +// FissionTempGroupLang mapped from table +type FissionTempGroupLang struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + GroupID int64 `gorm:"column:group_id;type:bigint;not null;uniqueIndex:uniq_group_id_mark,priority:1;comment:模版组id" json:"group_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_group_id_mark,priority:2;comment:翻译键值" json:"mark"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:说明" json:"desc"` + LangMark string `gorm:"column:lang_mark;type:varchar(64);not null;comment:语言包对应的标识" json:"lang_mark"` +} + +// TableName FissionTempGroupLang's table name +func (*FissionTempGroupLang) TableName() string { + return TableNameFissionTempGroupLang +} diff --git a/internal/repository/model/fission_temp_image.gen.go b/internal/repository/model/fission_temp_image.gen.go new file mode 100644 index 0000000..d04cf24 --- /dev/null +++ b/internal/repository/model/fission_temp_image.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTempImage = "fission_temp_image" + +// FissionTempImage mapped from table +type FissionTempImage struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + TempID int64 `gorm:"column:temp_id;type:bigint;not null;uniqueIndex:uniq_temp_id_mark,priority:1;comment:模版id" json:"temp_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_temp_id_mark,priority:2;comment:模版键值" json:"mark"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:值" json:"val"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:描述" json:"desc"` +} + +// TableName FissionTempImage's table name +func (*FissionTempImage) TableName() string { + return TableNameFissionTempImage +} diff --git a/internal/repository/model/fission_temp_lang.gen.go b/internal/repository/model/fission_temp_lang.gen.go new file mode 100644 index 0000000..0f75502 --- /dev/null +++ b/internal/repository/model/fission_temp_lang.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTempLang = "fission_temp_lang" + +// FissionTempLang mapped from table +type FissionTempLang struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + TempID int64 `gorm:"column:temp_id;type:bigint;not null;uniqueIndex:uniq_temp_id_mark,priority:1;comment:模版id" json:"temp_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_temp_id_mark,priority:2;comment:翻译键值" json:"mark"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:值" json:"val"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:说明" json:"desc"` +} + +// TableName FissionTempLang's table name +func (*FissionTempLang) TableName() string { + return TableNameFissionTempLang +} diff --git a/internal/repository/model/fission_total.gen.go b/internal/repository/model/fission_total.gen.go new file mode 100644 index 0000000..a874fd6 --- /dev/null +++ b/internal/repository/model/fission_total.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTotal = "fission_total" + +// FissionTotal mapped from table +type FissionTotal struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_mark,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_campaign_id_mark,priority:2;comment:用户行为标识" json:"mark"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:次数" json:"num"` + UserNum int64 `gorm:"column:user_num;type:bigint;not null;comment:人数" json:"user_num"` + BehaviorType int32 `gorm:"column:behavior_type;type:int;not null;comment:用户行为类型" json:"behavior_type"` +} + +// TableName FissionTotal's table name +func (*FissionTotal) TableName() string { + return TableNameFissionTotal +} diff --git a/internal/repository/model/fission_total_cycle.gen.go b/internal/repository/model/fission_total_cycle.gen.go new file mode 100644 index 0000000..459c597 --- /dev/null +++ b/internal/repository/model/fission_total_cycle.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionTotalCycle = "fission_total_cycle" + +// FissionTotalCycle mapped from table +type FissionTotalCycle struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;comment:活动id(fission_campaign表)" json:"campaign_id"` + StatTime int64 `gorm:"column:stat_time;type:bigint;not null;comment:统计时间" json:"stat_time"` + StatType int8 `gorm:"column:stat_type;type:tinyint;not null;comment:统计类型(1-小时,2-天)" json:"stat_type"` + Mark string `gorm:"column:mark;type:varchar(32);not null;comment:用户行为标识" json:"mark"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:次数" json:"num"` + UserNum int64 `gorm:"column:user_num;type:bigint;not null;comment:人数" json:"user_num"` + BehaviorType int32 `gorm:"column:behavior_type;type:int;not null;comment:用户行为类型" json:"behavior_type"` +} + +// TableName FissionTotalCycle's table name +func (*FissionTotalCycle) TableName() string { + return TableNameFissionTotalCycle +} diff --git a/internal/repository/model/fission_unlock_reward.gen.go b/internal/repository/model/fission_unlock_reward.gen.go new file mode 100644 index 0000000..f4defda --- /dev/null +++ b/internal/repository/model/fission_unlock_reward.gen.go @@ -0,0 +1,21 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUnlockReward = "fission_unlock_reward" + +// FissionUnlockReward mapped from table +type FissionUnlockReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_user_id_reward_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_user_id_reward_id,priority:2;comment:活动用户ID(fission_user表主键)" json:"user_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_user_id_reward_id,priority:3;comment:活动奖品id" json:"reward_id"` +} + +// TableName FissionUnlockReward's table name +func (*FissionUnlockReward) TableName() string { + return TableNameFissionUnlockReward +} diff --git a/internal/repository/model/fission_uno.gen.go b/internal/repository/model/fission_uno.gen.go new file mode 100644 index 0000000..f503479 --- /dev/null +++ b/internal/repository/model/fission_uno.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUno = "fission_uno" + +// FissionUno mapped from table +type FissionUno struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:抽奖机会数" json:"chance"` + LastSign string `gorm:"column:last_sign;type:char(8);not null;comment:最后签到日期" json:"last_sign"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` + ThreeNum int32 `gorm:"column:three_num;type:int;not null;comment:+3道具牌数量" json:"three_num"` + FiveNum int32 `gorm:"column:five_num;type:int;not null;comment:+5道具牌数量" json:"five_num"` + FixNum int32 `gorm:"column:fix_num;type:int;not null;comment:固定颜色道具牌数量" json:"fix_num"` +} + +// TableName FissionUno's table name +func (*FissionUno) TableName() string { + return TableNameFissionUno +} diff --git a/internal/repository/model/fission_uno_collect.gen.go b/internal/repository/model/fission_uno_collect.gen.go new file mode 100644 index 0000000..ac1f854 --- /dev/null +++ b/internal/repository/model/fission_uno_collect.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUnoCollect = "fission_uno_collect" + +// FissionUnoCollect mapped from table +type FissionUnoCollect struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UnoID int64 `gorm:"column:uno_id;type:bigint;not null;uniqueIndex:uniq_uno_id_mark,priority:1;comment:玩家id(fission_uno表)" json:"uno_id"` + Mark string `gorm:"column:mark;type:varchar(10);not null;uniqueIndex:uniq_uno_id_mark,priority:2;comment:收集颜色标识" json:"mark"` + SignNum int32 `gorm:"column:sign_num;type:int;not null;comment:已经签到天数" json:"sign_num"` + IntactNum int32 `gorm:"column:intact_num;type:int;not null;comment:完整奖品数" json:"intact_num"` + PreIntactNum int32 `gorm:"column:pre_intact_num;type:int;not null;comment:待合成奖品数" json:"pre_intact_num"` + CardInfo string `gorm:"column:card_info;type:varchar(255);not null;comment:卡片数据" json:"card_info"` +} + +// TableName FissionUnoCollect's table name +func (*FissionUnoCollect) TableName() string { + return TableNameFissionUnoCollect +} diff --git a/internal/repository/model/fission_uno_collect_log.go b/internal/repository/model/fission_uno_collect_log.go new file mode 100644 index 0000000..8dce8b1 --- /dev/null +++ b/internal/repository/model/fission_uno_collect_log.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (m *FissionUnoCollect) SetCardInfo(val []int32) { + m.CardInfo, _ = jsonm.ToSliceString(val) +} + +func (m *FissionUnoCollect) GetCardInfo() (val []int32) { + _ = jsonm.StrUnmarshal(m.CardInfo, &val) + return +} diff --git a/internal/repository/model/fission_uno_log.gen.go b/internal/repository/model/fission_uno_log.gen.go new file mode 100644 index 0000000..85e0cbc --- /dev/null +++ b/internal/repository/model/fission_uno_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUnoLog = "fission_uno_log" + +// FissionUnoLog mapped from table +type FissionUnoLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UnoID int64 `gorm:"column:uno_id;type:bigint;not null;index:idx_uno_id_type_created_at,priority:1;comment:玩家id(fission_uno表id)" json:"uno_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_uno_id_type_created_at,priority:2;comment:日志类型(1-获得抽奖机会,2-抽奖)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionUnoLog's table name +func (*FissionUnoLog) TableName() string { + return TableNameFissionUnoLog +} diff --git a/internal/repository/model/fission_uno_log.go b/internal/repository/model/fission_uno_log.go new file mode 100644 index 0000000..7e77009 --- /dev/null +++ b/internal/repository/model/fission_uno_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionUnoLog) SetVal(val mtype.UnoLogVal) { + m.Val, _ = jsonm.MarshalToString(val) +} + +func (m *FissionUnoLog) GetVal() (val mtype.UnoLogVal) { + _ = jsonm.StrUnmarshal(m.Val, &val) + return +} diff --git a/internal/repository/model/fission_user.gen.go b/internal/repository/model/fission_user.gen.go new file mode 100644 index 0000000..6a689b7 --- /dev/null +++ b/internal/repository/model/fission_user.gen.go @@ -0,0 +1,45 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUser = "fission_user" + +// FissionUser mapped from table +type FissionUser struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_created_at_campaign_id,priority:1" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外hash_id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_sub_user_id_campaign_id,priority:2;comment:活动ID(campaign表主键)" json:"campaign_id"` + ChannelID int64 `gorm:"column:channel_id;type:bigint;not null;comment:渠道id(fission_campaign_channel表)" json:"channel_id"` + ParentID int64 `gorm:"column:parent_id;type:bigint;not null;index:idx_parent_id,priority:1;comment:上级ID" json:"parent_id"` + Deep int32 `gorm:"column:deep;type:smallint;not null;comment:推广深度" json:"deep"` + IsNew int8 `gorm:"column:is_new;type:tinyint;not null;comment:是否新安装用户(1-是,0-否)" json:"is_new"` + SubUserID string `gorm:"column:sub_user_id;type:varchar(50);not null;index:idx_sub_user_id_campaign_id,priority:1;comment:关注用户ID" json:"sub_user_id"` + DeviceID string `gorm:"column:device_id;type:varchar(50);not null;index:idx_device_id_campaign_id,priority:1;comment:设备ID" json:"device_id"` + UserMark string `gorm:"column:user_mark;type:varchar(50);not null;index:idx_campaign_id_user_mark,priority:2;comment:用户标识(当sub_user_id为空取device_id)" json:"user_mark"` + UserType int8 `gorm:"column:user_type;type:tinyint;not null;comment:用户类型(1-访客,2-参与用户)" json:"user_type"` + ParentIds string `gorm:"column:parent_ids;type:varchar(2000);not null;comment:祖上ID(父级以上,不包括父级)" json:"parent_ids"` + IsView int8 `gorm:"column:is_view;type:tinyint;not null;comment:是否为预览用户(1-是,0-否)" json:"is_view"` + ShareLink string `gorm:"column:share_link;type:varchar(128);not null;comment:分享链接" json:"share_link"` + Source int8 `gorm:"column:source;type:tinyint;not null;comment:来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件,6-动态下载页,7-网页端首次打开,8-支付事件)" json:"source"` + IsHelp int8 `gorm:"column:is_help;type:tinyint;not null;comment:是否助力成功(0-否,1-是)" json:"is_help"` + LangMark string `gorm:"column:lang_mark;type:varchar(10);not null;comment:活动语言标识" json:"lang_mark"` + LevelMark string `gorm:"column:level_mark;type:varchar(255);not null;comment:请求带过来的等级标识" json:"level_mark"` + UserLevelMark string `gorm:"column:user_level_mark;type:varchar(64);not null;comment:用户等级标识" json:"user_level_mark"` + UserLevel int64 `gorm:"column:user_level;type:bigint;not null;comment:用户等级id标识" json:"user_level"` + FixedUserLevel int8 `gorm:"column:fixed_user_level;type:tinyint;not null;comment:用户等级是否已经固定(0-否,1-是)" json:"fixed_user_level"` + UserLang string `gorm:"column:user_lang;type:varchar(10);not null;comment:用户语言标识" json:"user_lang"` + UserCountry string `gorm:"column:user_country;type:varchar(10);not null;comment:用户国家标识" json:"user_country"` + JoinAt int64 `gorm:"column:join_at;type:bigint;not null;comment:进入活动的时间" json:"join_at"` + InstallAt int64 `gorm:"column:install_at;type:bigint;not null;comment:首次安装时间" json:"install_at"` + RegisterAt int64 `gorm:"column:register_at;type:bigint;not null;comment:首次注册时间" json:"register_at"` +} + +// TableName FissionUser's table name +func (*FissionUser) TableName() string { + return TableNameFissionUser +} diff --git a/internal/repository/model/fission_user.go b/internal/repository/model/fission_user.go new file mode 100644 index 0000000..8407f09 --- /dev/null +++ b/internal/repository/model/fission_user.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (m *FissionUser) SetParentIds(val []int64) { + m.ParentIds, _ = jsonm.MarshalToString(val) +} + +func (m *FissionUser) GetParentIds() (val []int64) { + _ = jsonm.StrUnmarshal(m.ParentIds, &val) + return +} diff --git a/internal/repository/model/fission_user_active.gen.go b/internal/repository/model/fission_user_active.gen.go new file mode 100644 index 0000000..0d75ffe --- /dev/null +++ b/internal/repository/model/fission_user_active.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserActive = "fission_user_active" + +// FissionUserActive mapped from table +type FissionUserActive struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_user_id_campaign_id,priority:2;index:idx_campaign_id,priority:1;comment:活动Id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_campaign_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + LastActive int64 `gorm:"column:last_active;type:bigint;not null;comment:最后活跃时间" json:"last_active"` +} + +// TableName FissionUserActive's table name +func (*FissionUserActive) TableName() string { + return TableNameFissionUserActive +} diff --git a/internal/repository/model/fission_user_attr.gen.go b/internal/repository/model/fission_user_attr.gen.go new file mode 100644 index 0000000..99b5802 --- /dev/null +++ b/internal/repository/model/fission_user_attr.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserAttr = "fission_user_attr" + +// FissionUserAttr mapped from table +type FissionUserAttr struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_attr,priority:1;comment:活动ID(campaign表主键)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_attr,priority:1;comment:用户ID(fission_user表)" json:"user_id"` + Attr string `gorm:"column:attr;type:varchar(32);not null;uniqueIndex:uniq_user_id_attr,priority:2;index:idx_campaign_id_attr,priority:2;comment:属性标识" json:"attr"` + Value string `gorm:"column:value;type:varchar(64);not null;comment:属性值" json:"value"` + Values string `gorm:"column:values;type:varchar(255);not null;comment:多属性值" json:"values"` +} + +// TableName FissionUserAttr's table name +func (*FissionUserAttr) TableName() string { + return TableNameFissionUserAttr +} diff --git a/internal/repository/model/fission_user_attr.go b/internal/repository/model/fission_user_attr.go new file mode 100644 index 0000000..24d1d64 --- /dev/null +++ b/internal/repository/model/fission_user_attr.go @@ -0,0 +1,16 @@ +package model + +import ( + "strings" +) + +func (m *FissionUserAttr) SetValues(values []string) { + m.Values = strings.Join(values, ",") +} + +func (m *FissionUserAttr) GetValues() (values []string) { + if m.Values == "" { + return + } + return strings.Split(m.Values, ",") +} diff --git a/internal/repository/model/fission_user_attr_total.gen.go b/internal/repository/model/fission_user_attr_total.gen.go new file mode 100644 index 0000000..cde4f7f --- /dev/null +++ b/internal/repository/model/fission_user_attr_total.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserAttrTotal = "fission_user_attr_total" + +// FissionUserAttrTotal mapped from table +type FissionUserAttrTotal struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_attr_val,priority:1;comment:活动ID(campaign表主键)" json:"campaign_id"` + Attr string `gorm:"column:attr;type:varchar(32);not null;uniqueIndex:uniq_campaign_id_attr_val,priority:2;comment:属性标识" json:"attr"` + Val string `gorm:"column:val;type:varchar(64);not null;uniqueIndex:uniq_campaign_id_attr_val,priority:3;comment:属性值" json:"val"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:人数" json:"num"` +} + +// TableName FissionUserAttrTotal's table name +func (*FissionUserAttrTotal) TableName() string { + return TableNameFissionUserAttrTotal +} diff --git a/internal/repository/model/fission_user_cond.gen.go b/internal/repository/model/fission_user_cond.gen.go new file mode 100644 index 0000000..e294de2 --- /dev/null +++ b/internal/repository/model/fission_user_cond.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserCond = "fission_user_cond" + +// FissionUserCond mapped from table +type FissionUserCond struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_Id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + CondID int64 `gorm:"column:cond_id;type:bigint;not null;index:idx_cond_id,priority:1;comment:条件事件id(fission_campaign_cond表)" json:"cond_id"` + Num int64 `gorm:"column:num;type:bigint;not null;comment:完成次数" json:"num"` + Total string `gorm:"column:total;type:varchar(255);not null;comment:累计值(当条件完成事累积型的时候,非空)" json:"total"` + CountNum int64 `gorm:"column:count_num;type:bigint;not null;comment:可计算的完成次数" json:"count_num"` + TotalExp int64 `gorm:"column:total_exp;type:bigint;not null;comment:可计算值的过期时间" json:"total_exp"` +} + +// TableName FissionUserCond's table name +func (*FissionUserCond) TableName() string { + return TableNameFissionUserCond +} diff --git a/internal/repository/model/fission_user_cond_record.gen.go b/internal/repository/model/fission_user_cond_record.gen.go new file mode 100644 index 0000000..14f6cee --- /dev/null +++ b/internal/repository/model/fission_user_cond_record.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserCondRecord = "fission_user_cond_record" + +// FissionUserCondRecord mapped from table +type FissionUserCondRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_Id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + CondID int64 `gorm:"column:cond_id;type:bigint;not null;index:idx_cond_id,priority:1;comment:条件事件id(fission_campaign_cond表)" json:"cond_id"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:完成的触发值" json:"val"` + IsUse int8 `gorm:"column:is_use;type:tinyint;not null;comment:是否已被计算(0-否,1-是)" json:"is_use"` + BehaviorTime int64 `gorm:"column:behavior_time;type:bigint;not null;comment:行为发生时间" json:"behavior_time"` +} + +// TableName FissionUserCondRecord's table name +func (*FissionUserCondRecord) TableName() string { + return TableNameFissionUserCondRecord +} diff --git a/internal/repository/model/fission_user_cond_record.go b/internal/repository/model/fission_user_cond_record.go new file mode 100644 index 0000000..9b3fb32 --- /dev/null +++ b/internal/repository/model/fission_user_cond_record.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *FissionUserTaskRecord) SetIndicatorData(val *mtype.IndicatorData) { + s.IndicatorData, _ = jsonm.MarshalToString(val) +} + +func (s *FissionUserTaskRecord) GetIndicatorData() (val *mtype.IndicatorData, err error) { + err = jsonm.StrUnmarshal(s.IndicatorData, &val) + return +} diff --git a/internal/repository/model/fission_user_ctlink.gen.go b/internal/repository/model/fission_user_ctlink.gen.go new file mode 100644 index 0000000..6de6d0f --- /dev/null +++ b/internal/repository/model/fission_user_ctlink.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserCtlink = "fission_user_ctlink" + +// FissionUserCtlink mapped from table +type FissionUserCtlink struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的唯一id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;comment:活动id" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_mark_id_mark,priority:1;comment:用户id" json:"user_id"` + Mark string `gorm:"column:mark;type:varchar(10);not null;uniqueIndex:uniq_user_id_mark_id_mark,priority:3;comment:内容类型(qa-问题)" json:"mark"` + MarkID int64 `gorm:"column:mark_id;type:bigint;not null;uniqueIndex:uniq_user_id_mark_id_mark,priority:2;comment:内容类型对应的数据id" json:"mark_id"` + LinkURL string `gorm:"column:link_url;type:varchar(255);not null;comment:链接" json:"link_url"` +} + +// TableName FissionUserCtlink's table name +func (*FissionUserCtlink) TableName() string { + return TableNameFissionUserCtlink +} diff --git a/internal/repository/model/fission_user_dylink.gen.go b/internal/repository/model/fission_user_dylink.gen.go new file mode 100644 index 0000000..6636d8b --- /dev/null +++ b/internal/repository/model/fission_user_dylink.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserDylink = "fission_user_dylink" + +// FissionUserDylink mapped from table +type FissionUserDylink struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;index:uniq_hash_id,priority:1;comment:对外hash_id" json:"hash_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(campaign表主键)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:uniq_user_id_link_mark,priority:1;comment:用户id" json:"user_id"` + LinkMark string `gorm:"column:link_mark;type:varchar(32);not null;index:uniq_user_id_link_mark,priority:2;comment:链接参数唯一标识" json:"link_mark"` + Params string `gorm:"column:params;type:json;not null;comment:动态参数数据" json:"params"` + LinkURL string `gorm:"column:link_url;type:varchar(255);not null;comment:跳转地址" json:"link_url"` +} + +// TableName FissionUserDylink's table name +func (*FissionUserDylink) TableName() string { + return TableNameFissionUserDylink +} diff --git a/internal/repository/model/fission_user_dylink.go b/internal/repository/model/fission_user_dylink.go new file mode 100644 index 0000000..060b483 --- /dev/null +++ b/internal/repository/model/fission_user_dylink.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *FissionUserDylink) SetParams(params *mtype.FissionUserDyLinkParams) { + m.Params, _ = jsonm.MarshalToString(params) +} + +func (m *FissionUserDylink) GetParams() (params mtype.FissionUserDyLinkParams) { + _ = jsonm.StrUnmarshal(m.Params, ¶ms) + return +} diff --git a/internal/repository/model/fission_user_event.gen.go b/internal/repository/model/fission_user_event.gen.go new file mode 100644 index 0000000..e0079e6 --- /dev/null +++ b/internal/repository/model/fission_user_event.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserEvent = "fission_user_event" + +// FissionUserEvent mapped from table +type FissionUserEvent struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动Id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_mark,priority:1;comment:用户id(fission_user表)" json:"user_id"` + Mark string `gorm:"column:mark;type:varchar(64);not null;uniqueIndex:uniq_user_id_mark,priority:2;comment:标识(推送标识)" json:"mark"` + EventData string `gorm:"column:event_data;type:text;not null;comment:事件数据" json:"event_data"` +} + +// TableName FissionUserEvent's table name +func (*FissionUserEvent) TableName() string { + return TableNameFissionUserEvent +} diff --git a/internal/repository/model/fission_user_jattr.gen.go b/internal/repository/model/fission_user_jattr.gen.go new file mode 100644 index 0000000..0b652ad --- /dev/null +++ b/internal/repository/model/fission_user_jattr.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserJattr = "fission_user_jattr" + +// FissionUserJattr mapped from table +type FissionUserJattr struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_attr,priority:1;comment:活动ID(campaign表主键)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_attr,priority:1;comment:用户ID(fission_user表)" json:"user_id"` + Attr string `gorm:"column:attr;type:varchar(32);not null;uniqueIndex:uniq_user_id_attr,priority:2;index:idx_campaign_id_attr,priority:2;comment:属性标识" json:"attr"` + Value string `gorm:"column:value;type:text;not null;comment:属性值" json:"value"` + Values string `gorm:"column:values;type:text;not null;comment:多属性值" json:"values"` +} + +// TableName FissionUserJattr's table name +func (*FissionUserJattr) TableName() string { + return TableNameFissionUserJattr +} diff --git a/internal/repository/model/fission_user_jattr.go b/internal/repository/model/fission_user_jattr.go new file mode 100644 index 0000000..d5c8beb --- /dev/null +++ b/internal/repository/model/fission_user_jattr.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "strings" +) + +func (m *FissionUserJattr) SetValues(values []string) { + m.Values = strings.Join(values, ",") +} + +func (m *FissionUserJattr) GetValues() (values []string) { + _ = jsonm.StrUnmarshal(m.Values, &values) + return +} diff --git a/internal/repository/model/fission_user_level.gen.go b/internal/repository/model/fission_user_level.gen.go new file mode 100644 index 0000000..0b29b4e --- /dev/null +++ b/internal/repository/model/fission_user_level.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserLevel = "fission_user_level" + +// FissionUserLevel mapped from table +type FissionUserLevel struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + DeletedAt int64 `gorm:"column:deleted_at;type:bigint;not null;uniqueIndex:uniq_mark_deleted_at_project_id,priority:2" json:"deleted_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;uniqueIndex:uniq_mark_deleted_at_project_id,priority:3;index:idx_project_id,priority:1;comment:项目id" json:"project_id"` + Mark string `gorm:"column:mark;type:varchar(20);not null;uniqueIndex:uniq_mark_deleted_at_project_id,priority:1;comment:用户等级标识" json:"mark"` + Title string `gorm:"column:title;type:varchar(64);not null;comment:用户等级" json:"title"` +} + +// TableName FissionUserLevel's table name +func (*FissionUserLevel) TableName() string { + return TableNameFissionUserLevel +} diff --git a/internal/repository/model/fission_user_level_related.gen.go b/internal/repository/model/fission_user_level_related.gen.go new file mode 100644 index 0000000..b878c2f --- /dev/null +++ b/internal/repository/model/fission_user_level_related.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserLevelRelated = "fission_user_level_related" + +// FissionUserLevelRelated mapped from table +type FissionUserLevelRelated struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + LevelID int64 `gorm:"column:level_id;type:bigint;not null;uniqueIndex:uniq_level_id_relate_id_relate_table,priority:1;comment:用户等级id(fission_user_level表)" json:"level_id"` + RelateID int64 `gorm:"column:relate_id;type:bigint;not null;uniqueIndex:uniq_level_id_relate_id_relate_table,priority:2;comment:关联id" json:"relate_id"` + RelateTable string `gorm:"column:relate_table;type:varchar(64);not null;uniqueIndex:uniq_level_id_relate_id_relate_table,priority:3;comment:关联表名" json:"relate_table"` + CancelTime int64 `gorm:"column:cancel_time;type:bigint;not null;uniqueIndex:uniq_level_id_relate_id_relate_table,priority:4;comment:取消关联时间" json:"cancel_time"` +} + +// TableName FissionUserLevelRelated's table name +func (*FissionUserLevelRelated) TableName() string { + return TableNameFissionUserLevelRelated +} diff --git a/internal/repository/model/fission_user_pre_cond.gen.go b/internal/repository/model/fission_user_pre_cond.gen.go new file mode 100644 index 0000000..8616c6b --- /dev/null +++ b/internal/repository/model/fission_user_pre_cond.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserPreCond = "fission_user_pre_cond" + +// FissionUserPreCond mapped from table +type FissionUserPreCond struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_pre_cond_expired_at,priority:1;comment:用户id" json:"user_id"` + PreCond int32 `gorm:"column:pre_cond;type:int;not null;uniqueIndex:uniq_user_id_pre_cond_expired_at,priority:2;comment:完成的前置任务" json:"pre_cond"` + ExpiredAt int64 `gorm:"column:expired_at;type:bigint;not null;uniqueIndex:uniq_user_id_pre_cond_expired_at,priority:3;comment:前置任务过期时间" json:"expired_at"` +} + +// TableName FissionUserPreCond's table name +func (*FissionUserPreCond) TableName() string { + return TableNameFissionUserPreCond +} diff --git a/internal/repository/model/fission_user_stat.gen.go b/internal/repository/model/fission_user_stat.gen.go new file mode 100644 index 0000000..756ccff --- /dev/null +++ b/internal/repository/model/fission_user_stat.gen.go @@ -0,0 +1,33 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserStat = "fission_user_stat" + +// FissionUserStat mapped from table +type FissionUserStat struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel uint8 `gorm:"column:is_del;type:tinyint unsigned;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + DirectNum int64 `gorm:"column:direct_num;type:bigint;not null;comment:直接裂变人数" json:"direct_num"` + IndirectNum int64 `gorm:"column:indirect_num;type:bigint;not null;comment:间接裂变人数" json:"indirect_num"` + EffectiveNum int64 `gorm:"column:effective_num;type:bigint;not null;comment:有效邀请人数" json:"effective_num"` + IndirectEffectiveNum int64 `gorm:"column:indirect_effective_num;type:bigint;not null;comment:间接有效邀请人数" json:"indirect_effective_num"` + TargetNum int64 `gorm:"column:target_num;type:bigint;not null;comment:达标次数" json:"target_num"` + IndirectTargetNum int64 `gorm:"column:indirect_target_num;type:bigint;not null;comment:间接达标次数" json:"indirect_target_num"` + SignNum int64 `gorm:"column:sign_num;type:bigint;not null;comment:签到次数" json:"sign_num"` + SignRewardNum int64 `gorm:"column:sign_reward_num;type:bigint;not null;comment:领奖签到奖次数" json:"sign_reward_num"` + GrowNum int64 `gorm:"column:grow_num;type:bigint;not null;comment:领养次数" json:"grow_num"` + GrowRewardNum int64 `gorm:"column:grow_reward_num;type:bigint;not null;comment:养成次数" json:"grow_reward_num"` + HelpNum int64 `gorm:"column:help_num;type:bigint;not null;comment:助力次数" json:"help_num"` +} + +// TableName FissionUserStat's table name +func (*FissionUserStat) TableName() string { + return TableNameFissionUserStat +} diff --git a/internal/repository/model/fission_user_tag.gen.go b/internal/repository/model/fission_user_tag.gen.go new file mode 100644 index 0000000..1890a0b --- /dev/null +++ b/internal/repository/model/fission_user_tag.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserTag = "fission_user_tag" + +// FissionUserTag mapped from table +type FissionUserTag struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_mark,priority:1;comment:用户id" json:"user_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;uniqueIndex:uniq_user_id_mark,priority:2;comment:标签标识" json:"mark"` + Val string `gorm:"column:val;type:varchar(255);not null;comment:标签值" json:"val"` +} + +// TableName FissionUserTag's table name +func (*FissionUserTag) TableName() string { + return TableNameFissionUserTag +} diff --git a/internal/repository/model/fission_user_task_record.gen.go b/internal/repository/model/fission_user_task_record.gen.go new file mode 100644 index 0000000..4bbd3bc --- /dev/null +++ b/internal/repository/model/fission_user_task_record.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserTaskRecord = "fission_user_task_record" + +// FissionUserTaskRecord mapped from table +type FissionUserTaskRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + TaskID int64 `gorm:"column:task_id;type:bigint;not null;index:idx_task_id,priority:1;comment:任务表(fission_campaign_task表)" json:"task_id"` + IndicatorData string `gorm:"column:indicator_data;type:json;not null;comment:完成任务的指标数据,如:下载数" json:"indicator_data"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:发放的骰子数" json:"chance"` + LimitProp int8 `gorm:"column:limit_prop;type:tinyint;not null;comment:是否因为限制而不发道具(0-否,1-是)" json:"limit_prop"` +} + +// TableName FissionUserTaskRecord's table name +func (*FissionUserTaskRecord) TableName() string { + return TableNameFissionUserTaskRecord +} diff --git a/internal/repository/model/fission_user_task_reward.gen.go b/internal/repository/model/fission_user_task_reward.gen.go new file mode 100644 index 0000000..9fc38f0 --- /dev/null +++ b/internal/repository/model/fission_user_task_reward.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserTaskReward = "fission_user_task_reward" + +// FissionUserTaskReward mapped from table +type FissionUserTaskReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_campaign_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_receive_time_task_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + TaskID int64 `gorm:"column:task_id;type:bigint;not null;index:idx_user_id_receive_time_task_id,priority:3;comment:任务ID(fission_campaign_task表)" json:"task_id"` + ReceiveTime int64 `gorm:"column:receive_time;type:bigint;not null;index:idx_user_id_receive_time_task_id,priority:2;comment:领取时间" json:"receive_time"` + TaskRecordID int64 `gorm:"column:task_record_id;type:bigint;not null;comment:任务完成记录ID(fission_user_task_record表)" json:"task_record_id"` +} + +// TableName FissionUserTaskReward's table name +func (*FissionUserTaskReward) TableName() string { + return TableNameFissionUserTaskReward +} diff --git a/internal/repository/model/fission_user_task_valid.gen.go b/internal/repository/model/fission_user_task_valid.gen.go new file mode 100644 index 0000000..cbbdaca --- /dev/null +++ b/internal/repository/model/fission_user_task_valid.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionUserTaskValid = "fission_user_task_valid" + +// FissionUserTaskValid mapped from table +type FissionUserTaskValid struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_user_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_task_id_user_id,priority:1;comment:活动用户id(fission_user表)" json:"user_id"` + TaskID int64 `gorm:"column:task_id;type:bigint;not null;index:idx_task_id_user_id,priority:2;comment:任务id" json:"task_id"` + Ideq string `gorm:"column:ideq;type:varchar(32);not null;uniqueIndex:uniq_ideq,priority:1;comment:幂等字符串" json:"ideq"` + IdeqParam string `gorm:"column:ideq_param;type:varchar(255);not null;comment:加密参数" json:"ideq_param"` +} + +// TableName FissionUserTaskValid's table name +func (*FissionUserTaskValid) TableName() string { + return TableNameFissionUserTaskValid +} diff --git a/internal/repository/model/fission_user_task_valid.go b/internal/repository/model/fission_user_task_valid.go new file mode 100644 index 0000000..2f0f8e3 --- /dev/null +++ b/internal/repository/model/fission_user_task_valid.go @@ -0,0 +1,21 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/utils" + "fmt" +) + +func (m *FissionUserTaskValid) SetIdeq(ideq ...string) { + data := make(map[string]string, len(ideq)/2) + + var mdp string + for i := 0; i < len(ideq)/2; i += 2 { + data[ideq[i]] = ideq[i+1] + mdp = fmt.Sprintf("%s:%s", ideq[i], ideq[i+1]) + } + + m.IdeqParam, _ = jsonm.ToObjString(data) + + m.Ideq = utils.Md5String(fmt.Sprintf("%d:%d:%d:%s", m.CampaignID, m.UserID, m.TaskID, mdp)) +} diff --git a/internal/repository/model/fission_vs.gen.go b/internal/repository/model/fission_vs.gen.go new file mode 100644 index 0000000..32e11da --- /dev/null +++ b/internal/repository/model/fission_vs.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionV = "fission_vs" + +// FissionV mapped from table +type FissionV struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + Chance int32 `gorm:"column:chance;type:int;not null;comment:投票机会数" json:"chance"` + UsePoint int64 `gorm:"column:use_point;type:bigint;not null;comment:使用积分数" json:"use_point"` + SetInit int8 `gorm:"column:set_init;type:tinyint;not null;comment:是否被设置过初始次数(0-否,1-是)" json:"set_init"` + VoteNum int32 `gorm:"column:vote_num;type:int;not null;comment:投票次数" json:"vote_num"` + CoinGet int32 `gorm:"column:coin_get;type:int;not null;comment:获得积分数" json:"coin_get"` + CoinUse int32 `gorm:"column:coin_use;type:int;not null;comment:使用积分数" json:"coin_use"` +} + +// TableName FissionV's table name +func (*FissionV) TableName() string { + return TableNameFissionV +} diff --git a/internal/repository/model/fission_vs_log.gen.go b/internal/repository/model/fission_vs_log.gen.go new file mode 100644 index 0000000..41a450f --- /dev/null +++ b/internal/repository/model/fission_vs_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionVsLog = "fission_vs_log" + +// FissionVsLog mapped from table +type FissionVsLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_vs_id_type_created_at,priority:3" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_created_at,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + VsID int64 `gorm:"column:vs_id;type:bigint;not null;index:idx_vs_id_type_created_at,priority:1;comment:玩家id(fission_prize_wheel表id)" json:"vs_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_vs_id_type_created_at,priority:2;comment:日志类型(1-获得投票机会,2-投票)" json:"type"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + Val string `gorm:"column:val;type:varchar(255);not null;default:0;comment:数据对象" json:"val"` +} + +// TableName FissionVsLog's table name +func (*FissionVsLog) TableName() string { + return TableNameFissionVsLog +} diff --git a/internal/repository/model/fission_vs_vote.gen.go b/internal/repository/model/fission_vs_vote.gen.go new file mode 100644 index 0000000..ba037fb --- /dev/null +++ b/internal/repository/model/fission_vs_vote.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionVsVote = "fission_vs_vote" + +// FissionVsVote mapped from table +type FissionVsVote struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + VsID int64 `gorm:"column:vs_id;type:bigint;not null;index:idx_vs_id_schedule_id,priority:1;comment:赛事竞猜玩家id" json:"vs_id"` + ScheduleID int64 `gorm:"column:schedule_id;type:bigint;not null;index:idx_vs_id_schedule_id,priority:2;comment:赛程id" json:"schedule_id"` + WinType int8 `gorm:"column:win_type;type:tinyint;not null;index:idx_schedule_id_win_type_win_team_id,priority:2;comment:获胜方式(1-胜利,2-平局)" json:"win_type"` + WinTeamID int64 `gorm:"column:win_team_id;type:bigint;not null;index:idx_schedule_id_win_type_win_team_id,priority:3;comment:选择的获胜队伍" json:"win_team_id"` + IsWin int8 `gorm:"column:is_win;type:tinyint;not null;comment:是否赢得奖励" json:"is_win"` + FreeVote int32 `gorm:"column:free_vote;type:int;not null;comment:免费投票数" json:"free_vote"` + PointVote int32 `gorm:"column:point_vote;type:int;not null;comment:积分投票数" json:"point_vote"` +} + +// TableName FissionVsVote's table name +func (*FissionVsVote) TableName() string { + return TableNameFissionVsVote +} diff --git a/internal/repository/model/fission_vs_vote_settlement.gen.go b/internal/repository/model/fission_vs_vote_settlement.gen.go new file mode 100644 index 0000000..4efb12d --- /dev/null +++ b/internal/repository/model/fission_vs_vote_settlement.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionVsVoteSettlement = "fission_vs_vote_settlement" + +// FissionVsVoteSettlement mapped from table +type FissionVsVoteSettlement struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动id(fission_campaign表)" json:"campaign_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + ScheduleID int64 `gorm:"column:schedule_id;type:bigint;not null;comment:赛程id" json:"schedule_id"` + VsID int64 `gorm:"column:vs_id;type:bigint;not null;index:idx_vs_id_tip_at,priority:1;comment:赛事竞猜玩家id" json:"vs_id"` + VoteID int64 `gorm:"column:vote_id;type:bigint;not null;comment:投票记录(fission_vs_vote表)" json:"vote_id"` + AcceptAt int64 `gorm:"column:accept_at;type:bigint;not null;comment:接收时间" json:"accept_at"` + RecordIds string `gorm:"column:record_ids;type:text;not null;comment:奖励记录id" json:"record_ids"` + TipAt int64 `gorm:"column:tip_at;type:bigint;not null;index:idx_vs_id_tip_at,priority:2;comment:提示时间" json:"tip_at"` + Odds string `gorm:"column:odds;type:varchar(10);not null;default:1;comment:赔率" json:"odds"` +} + +// TableName FissionVsVoteSettlement's table name +func (*FissionVsVoteSettlement) TableName() string { + return TableNameFissionVsVoteSettlement +} diff --git a/internal/repository/model/fission_vs_vote_settlement.go b/internal/repository/model/fission_vs_vote_settlement.go new file mode 100644 index 0000000..2341f37 --- /dev/null +++ b/internal/repository/model/fission_vs_vote_settlement.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (m *FissionVsVoteSettlement) SetRecordIds(vals []int64) { + m.RecordIds, _ = jsonm.ToSliceString(vals) +} + +func (m *FissionVsVoteSettlement) GetRecordIds() (vals []int64) { + _ = jsonm.StrUnmarshal(m.RecordIds, &vals) + return +} diff --git a/internal/repository/model/fission_web_user.gen.go b/internal/repository/model/fission_web_user.gen.go new file mode 100644 index 0000000..3bdfe96 --- /dev/null +++ b/internal/repository/model/fission_web_user.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionWebUser = "fission_web_user" + +// FissionWebUser mapped from table +type FissionWebUser struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;uniqueIndex:uniq_campaign_id_web_id,priority:1;comment:活动ID(campaign表主键)" json:"campaign_id"` + ChannelID int64 `gorm:"column:channel_id;type:bigint;not null;index:idx_channel_id,priority:1;comment:渠道id(fission_campaign_channel表)" json:"channel_id"` + WebID string `gorm:"column:web_id;type:varchar(20);not null;uniqueIndex:uniq_campaign_id_web_id,priority:2;comment:浏览器唯一id" json:"web_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:用户id(fission_user表)" json:"user_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:抽奖的奖品id" json:"reward_id"` + Score int32 `gorm:"column:score;type:int;not null;comment:答题分数" json:"score"` + Answer string `gorm:"column:answer;type:varchar(2000);not null;comment:答卷内容" json:"answer"` + IP string `gorm:"column:ip;type:varchar(15);not null;comment:用户ip地址" json:"ip"` + IPCity string `gorm:"column:ip_city;type:varchar(128);not null;comment:Ip的国家地区" json:"ip_city"` +} + +// TableName FissionWebUser's table name +func (*FissionWebUser) TableName() string { + return TableNameFissionWebUser +} diff --git a/internal/repository/model/fission_win.gen.go b/internal/repository/model/fission_win.gen.go new file mode 100644 index 0000000..dcee1dc --- /dev/null +++ b/internal/repository/model/fission_win.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionWin = "fission_win" + +// FissionWin mapped from table +type FissionWin struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + LimitStatus int8 `gorm:"column:limit_status;type:tinyint;not null;comment:任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制)" json:"limit_status"` + BindInstall int8 `gorm:"column:bind_install;type:tinyint;not null;comment:是否绑定了安装事件(0-否,1-是)" json:"bind_install"` + BindRegister int8 `gorm:"column:bind_register;type:tinyint;not null;comment:是否绑定了注册事件(0-否,1-是)" json:"bind_register"` + IsNewcomer int8 `gorm:"column:is_newcomer;type:tinyint;not null;comment:是否新人用户(0-否,1-是)" json:"is_newcomer"` + NextStep int32 `gorm:"column:next_step;type:int;not null;comment:可领取的下一阶段奖品" json:"next_step"` + LoopInvite int32 `gorm:"column:loop_invite;type:int;not null;comment:当前循环的邀请数" json:"loop_invite"` +} + +// TableName FissionWin's table name +func (*FissionWin) TableName() string { + return TableNameFissionWin +} diff --git a/internal/repository/model/fission_win_reward.gen.go b/internal/repository/model/fission_win_reward.gen.go new file mode 100644 index 0000000..9a311be --- /dev/null +++ b/internal/repository/model/fission_win_reward.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameFissionWinReward = "fission_win_reward" + +// FissionWinReward mapped from table +type FissionWinReward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外的hash_id" json:"hash_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:活动用户ID(fission_user表主键)" json:"user_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id,priority:1;comment:活动ID(fission_campaign表)" json:"campaign_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;index:idx_reward_id,priority:1;comment:奖品id(fission_campaign_win_reward表)" json:"reward_id"` + Num int32 `gorm:"column:num;type:int;not null;comment:获得的奖品数量" json:"num"` + Title string `gorm:"column:title;type:varchar(65);not null;comment:奖品名称" json:"title"` + Step int32 `gorm:"column:step;type:int;not null;comment:奖励阶段" json:"step"` + RewardType int8 `gorm:"column:reward_type;type:tinyint;not null;comment:奖品类型(1-任务奖品,2-额外奖,3-新人奖)" json:"reward_type"` +} + +// TableName FissionWinReward's table name +func (*FissionWinReward) TableName() string { + return TableNameFissionWinReward +} diff --git a/internal/repository/model/form.gen.go b/internal/repository/model/form.gen.go new file mode 100644 index 0000000..c5c6f61 --- /dev/null +++ b/internal/repository/model/form.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameForm = "form" + +// Form mapped from table
+type Form struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id,priority:1;comment:项目id(project表)" json:"project_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:表单标题" json:"title"` + Items string `gorm:"column:items;type:json;not null;comment:表单项" json:"items"` +} + +// TableName Form's table name +func (*Form) TableName() string { + return TableNameForm +} diff --git a/internal/repository/model/form.go b/internal/repository/model/form.go new file mode 100644 index 0000000..712f328 --- /dev/null +++ b/internal/repository/model/form.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *Form) SetItems(vals []*mtype.FormItem) { + m.Items, _ = jsonm.MarshalToString(vals) +} + +func (m *Form) GetItems() (vals []*mtype.FormItem) { + _ = jsonm.StrUnmarshal(m.Items, &vals) + return +} diff --git a/internal/repository/model/game_action.gen.go b/internal/repository/model/game_action.gen.go new file mode 100644 index 0000000..93dc1a3 --- /dev/null +++ b/internal/repository/model/game_action.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameGameAction = "game_action" + +// GameAction mapped from table +type GameAction struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_game_id_type_action_time,priority:1;comment:项目id" json:"project_id"` + GameID int64 `gorm:"column:game_id;type:bigint;not null;index:idx_project_id_game_id_type_action_time,priority:2;comment:游戏id" json:"game_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_type_action_time,priority:1;comment:用户id" json:"user_id"` + LinkID int64 `gorm:"column:link_id;type:bigint;not null;index:idx_link_id_user_id_type,priority:1;comment:链接id" json:"link_id"` + Type int32 `gorm:"column:type;type:int;not null;index:idx_user_id_type_action_time,priority:2;comment:用户行为类型" json:"type"` + ActionTime int64 `gorm:"column:action_time;type:bigint;not null;index:idx_user_id_type_action_time,priority:3;comment:用户行为时间" json:"action_time"` + Dimension string `gorm:"column:dimension;type:json;not null;comment:维度数据" json:"dimension"` +} + +// TableName GameAction's table name +func (*GameAction) TableName() string { + return TableNameGameAction +} diff --git a/internal/repository/model/game_action.go b/internal/repository/model/game_action.go new file mode 100644 index 0000000..4479ab5 --- /dev/null +++ b/internal/repository/model/game_action.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *GameAction) SetDimension(val *mtype.GameDimension) { + m.Dimension, _ = jsonm.MarshalToString(val) +} + +func (m *GameAction) GetDimension() (val mtype.GameDimension) { + _ = jsonm.StrUnmarshal(m.Dimension, &val) + return +} diff --git a/internal/repository/model/game_link.gen.go b/internal/repository/model/game_link.gen.go new file mode 100644 index 0000000..60c02dc --- /dev/null +++ b/internal/repository/model/game_link.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameGameLink = "game_link" + +// GameLink mapped from table +type GameLink struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1" json:"hash_id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_game_id,priority:1;comment:项目id" json:"project_id"` + GameID int64 `gorm:"column:game_id;type:bigint;not null;index:idx_project_id_game_id,priority:2;comment:游戏id" json:"game_id"` + Title string `gorm:"column:title;type:varchar(64);not null;comment:标题" json:"title"` + IsDefault int8 `gorm:"column:is_default;type:tinyint;not null;comment:是否默认(0-否,1-是)" json:"is_default"` +} + +// TableName GameLink's table name +func (*GameLink) TableName() string { + return TableNameGameLink +} diff --git a/internal/repository/model/game_total.gen.go b/internal/repository/model/game_total.gen.go new file mode 100644 index 0000000..f20bfba --- /dev/null +++ b/internal/repository/model/game_total.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameGameTotal = "game_total" + +// GameTotal mapped from table +type GameTotal struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_link_id_game_id_project_id,priority:3;comment:项目id" json:"project_id"` + GameID int64 `gorm:"column:game_id;type:bigint;not null;index:idx_link_id_game_id_project_id,priority:2;comment:游戏id" json:"game_id"` + LinkID int64 `gorm:"column:link_id;type:bigint;not null;index:idx_link_id_game_id_project_id,priority:1;comment:链接id" json:"link_id"` + Pv int64 `gorm:"column:pv;type:bigint;not null" json:"pv"` + Uv int64 `gorm:"column:uv;type:bigint;not null" json:"uv"` + Psec int64 `gorm:"column:psec;type:bigint;not null" json:"psec"` +} + +// TableName GameTotal's table name +func (*GameTotal) TableName() string { + return TableNameGameTotal +} diff --git a/internal/repository/model/game_total_date.gen.go b/internal/repository/model/game_total_date.gen.go new file mode 100644 index 0000000..8660505 --- /dev/null +++ b/internal/repository/model/game_total_date.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameGameTotalDate = "game_total_date" + +// GameTotalDate mapped from table +type GameTotalDate struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_link_id_game_id_project_id_ymd,priority:3;comment:项目id" json:"project_id"` + GameID int64 `gorm:"column:game_id;type:bigint;not null;index:idx_link_id_game_id_project_id_ymd,priority:2;comment:游戏id" json:"game_id"` + LinkID int64 `gorm:"column:link_id;type:bigint;not null;index:idx_link_id_game_id_project_id_ymd,priority:1;comment:链接id" json:"link_id"` + Ymd string `gorm:"column:ymd;type:varchar(10);not null;index:idx_link_id_game_id_project_id_ymd,priority:4;comment:日期" json:"ymd"` + Pv int64 `gorm:"column:pv;type:bigint;not null" json:"pv"` + Uv int64 `gorm:"column:uv;type:bigint;not null" json:"uv"` + Psec int64 `gorm:"column:psec;type:bigint;not null" json:"psec"` +} + +// TableName GameTotalDate's table name +func (*GameTotalDate) TableName() string { + return TableNameGameTotalDate +} diff --git a/internal/repository/model/game_user.gen.go b/internal/repository/model/game_user.gen.go new file mode 100644 index 0000000..ec707d9 --- /dev/null +++ b/internal/repository/model/game_user.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameGameUser = "game_user" + +// GameUser mapped from table +type GameUser struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1" json:"hash_id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_game_id_sub_user_id,priority:1;comment:项目id" json:"project_id"` + GameID int64 `gorm:"column:game_id;type:bigint;not null;index:idx_project_id_game_id_sub_user_id,priority:2;comment:游戏id" json:"game_id"` + IP string `gorm:"column:ip;type:varchar(255);not null" json:"ip"` + Os string `gorm:"column:os;type:varchar(255);not null" json:"os"` + Ver string `gorm:"column:ver;type:varchar(255);not null" json:"ver"` + DModel string `gorm:"column:d_model;type:varchar(255);not null" json:"d_model"` + SubUserID string `gorm:"column:sub_user_id;type:varchar(50);not null;index:idx_project_id_game_id_sub_user_id,priority:3;comment:用户id" json:"sub_user_id"` + IovdMark string `gorm:"column:iovd_mark;type:varchar(32);not null;index:idx_project_id_game_id_iovd_mark,priority:3;comment:App用户唯一标识" json:"iovd_mark"` +} + +// TableName GameUser's table name +func (*GameUser) TableName() string { + return TableNameGameUser +} diff --git a/internal/repository/model/lang.gen.go b/internal/repository/model/lang.gen.go new file mode 100644 index 0000000..aaa895a --- /dev/null +++ b/internal/repository/model/lang.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameLang = "lang" + +// Lang mapped from table +type Lang struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + Mark string `gorm:"column:mark;type:varchar(4);not null;uniqueIndex:uniq_lang_mark_mark,priority:2;index:idx_mark,priority:1;comment:语种标识" json:"mark"` + LangMark string `gorm:"column:lang_mark;type:varchar(64);not null;uniqueIndex:uniq_lang_mark_mark,priority:1;comment:语言唯一标识" json:"lang_mark"` + LangText string `gorm:"column:lang_text;type:varchar(255);not null;comment:对应语种的翻译文案" json:"lang_text"` +} + +// TableName Lang's table name +func (*Lang) TableName() string { + return TableNameLang +} diff --git a/internal/repository/model/lang_text_mark.gen.go b/internal/repository/model/lang_text_mark.gen.go new file mode 100644 index 0000000..099e929 --- /dev/null +++ b/internal/repository/model/lang_text_mark.gen.go @@ -0,0 +1,21 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameLangTextMark = "lang_text_mark" + +// LangTextMark mapped from table +type LangTextMark struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + Mark string `gorm:"column:mark;type:varchar(64);not null;uniqueIndex:uniq_mark,priority:1;comment:语言唯一标识" json:"mark"` + Text string `gorm:"column:text;type:varchar(255);not null;uniqueIndex:uniq_text,priority:1;comment:对应语种的翻译文案" json:"text"` +} + +// TableName LangTextMark's table name +func (*LangTextMark) TableName() string { + return TableNameLangTextMark +} diff --git a/internal/repository/model/library_qa.gen.go b/internal/repository/model/library_qa.gen.go new file mode 100644 index 0000000..21a4e07 --- /dev/null +++ b/internal/repository/model/library_qa.gen.go @@ -0,0 +1,30 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameLibraryQa = "library_qa" + +// LibraryQa mapped from table +type LibraryQa struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外hash_id" json:"hash_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;comment:项目id(project表)" json:"project_id"` + GroupID int64 `gorm:"column:group_id;type:bigint;not null;index:idx_group_id,priority:1;comment:题库组id(libary_qa_group表)" json:"group_id"` + Mark string `gorm:"column:mark;type:varchar(10);not null;comment:问题类型(image_text-图文,video-视频,audio-音频)" json:"mark"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:题目" json:"title"` + LinkURL string `gorm:"column:link_url;type:varchar(500);not null;comment:附件链接地址" json:"link_url"` + CoverURL string `gorm:"column:cover_url;type:varchar(64);not null;comment:封面图地址" json:"cover_url"` + ExplainText string `gorm:"column:explain_text;type:varchar(1000);not null;comment:答案讲解文本" json:"explain_text"` + ExplainImg string `gorm:"column:explain_img;type:varchar(255);not null;comment:答案讲解图" json:"explain_img"` + AnswerMark string `gorm:"column:answer_mark;type:varchar(10);not null;comment:答案类型(image_text-图文,text-文本)" json:"answer_mark"` +} + +// TableName LibraryQa's table name +func (*LibraryQa) TableName() string { + return TableNameLibraryQa +} diff --git a/internal/repository/model/library_qa_group.gen.go b/internal/repository/model/library_qa_group.gen.go new file mode 100644 index 0000000..d569742 --- /dev/null +++ b/internal/repository/model/library_qa_group.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameLibraryQaGroup = "library_qa_group" + +// LibraryQaGroup mapped from table +type LibraryQaGroup struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;uniqueIndex:uniq_hash_id,priority:1;comment:对外hash_id" json:"hash_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;uniqueIndex:uniq_project_id_title_del_time,priority:1;comment:项目id(project表)" json:"project_id"` + Title string `gorm:"column:title;type:varchar(255);not null;uniqueIndex:uniq_project_id_title_del_time,priority:2;comment:题库标题" json:"title"` + DelTime int64 `gorm:"column:del_time;type:bigint;not null;uniqueIndex:uniq_project_id_title_del_time,priority:3;comment:删除时间" json:"del_time"` +} + +// TableName LibraryQaGroup's table name +func (*LibraryQaGroup) TableName() string { + return TableNameLibraryQaGroup +} diff --git a/internal/repository/model/library_qa_option.gen.go b/internal/repository/model/library_qa_option.gen.go new file mode 100644 index 0000000..66153ad --- /dev/null +++ b/internal/repository/model/library_qa_option.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameLibraryQaOption = "library_qa_option" + +// LibraryQaOption mapped from table +type LibraryQaOption struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + QaID int64 `gorm:"column:qa_id;type:bigint;not null;index:idx_qa_id,priority:1;comment:问题id(libary_qa表)" json:"qa_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:答案" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(255);not null;comment:图片地址" json:"img_url"` + IsRight int8 `gorm:"column:is_right;type:tinyint;not null;comment:是否正确答案" json:"is_right"` +} + +// TableName LibraryQaOption's table name +func (*LibraryQaOption) TableName() string { + return TableNameLibraryQaOption +} diff --git a/internal/repository/model/lv_api_log.gen.go b/internal/repository/model/lv_api_log.gen.go new file mode 100644 index 0000000..9a657d2 --- /dev/null +++ b/internal/repository/model/lv_api_log.gen.go @@ -0,0 +1,30 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameLvAPILog = "lv_api_log" + +// LvAPILog mapped from table +type LvAPILog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:idx_campaign_id_user_id,priority:1;comment:活动id" json:"campaign_id"` + Source string `gorm:"column:source;type:varchar(32);not null;comment:来源" json:"source"` + UserID string `gorm:"column:user_id;type:varchar(50);not null;index:idx_campaign_id_user_id,priority:2;comment:用户id" json:"user_id"` + ReqURL string `gorm:"column:req_url;type:varchar(255);not null;comment:请求地址" json:"req_url"` + Req string `gorm:"column:req;type:text;not null;comment:请求数据" json:"req"` + Resp string `gorm:"column:resp;type:text;not null;comment:返回数据" json:"resp"` + RespCode int32 `gorm:"column:resp_code;type:int;not null;comment:返回状态码" json:"resp_code"` + ReqTime int64 `gorm:"column:req_time;type:bigint;not null;comment:请求时长(单位:ms)" json:"req_time"` + ErrMsg string `gorm:"column:err_msg;type:varchar(255);not null;comment:错误信息" json:"err_msg"` + Token string `gorm:"column:token;type:varchar(255);not null;comment:请求token" json:"token"` + ReqHeader string `gorm:"column:req_header;type:varchar(255);not null;comment:请求头数据" json:"req_header"` +} + +// TableName LvAPILog's table name +func (*LvAPILog) TableName() string { + return TableNameLvAPILog +} diff --git a/internal/repository/model/lv_api_log.go b/internal/repository/model/lv_api_log.go new file mode 100644 index 0000000..035ee58 --- /dev/null +++ b/internal/repository/model/lv_api_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *LvAPILog) SetReq(val mtype.LvApiLogReq) { + m.Req, _ = jsonm.MarshalToString(val) +} + +func (m *LvAPILog) GetReq() (val mtype.LvApiLogReq) { + _ = jsonm.StrUnmarshal(m.Req, &val) + return +} diff --git a/internal/repository/model/material.gen.go b/internal/repository/model/material.gen.go new file mode 100644 index 0000000..77b2005 --- /dev/null +++ b/internal/repository/model/material.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameMaterial = "material" + +// Material mapped from table +type Material struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_project_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_created_at,priority:1;comment:项目id(project表)" json:"project_id"` + MaterialType int8 `gorm:"column:material_type;type:tinyint;not null;comment:素材类型" json:"material_type"` + MaterialData string `gorm:"column:material_data;type:varchar(255);not null;comment:素材数据" json:"material_data"` +} + +// TableName Material's table name +func (*Material) TableName() string { + return TableNameMaterial +} diff --git a/internal/repository/model/module_statistics_eventflow.gen.go b/internal/repository/model/module_statistics_eventflow.gen.go new file mode 100644 index 0000000..7312ff9 --- /dev/null +++ b/internal/repository/model/module_statistics_eventflow.gen.go @@ -0,0 +1,33 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameModuleStatisticsEventflow = "module_statistics_eventflow" + +// ModuleStatisticsEventflow mapped from table +type ModuleStatisticsEventflow struct { + ID uint64 `gorm:"column:id;type:bigint unsigned;primaryKey;autoIncrement:true" json:"id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:project_event_index,priority:1" json:"project_id"` + LinkID int64 `gorm:"column:link_id;type:bigint;not null;index:createdtime_linkid_campaignid_index,priority:2" json:"link_id"` + CampaignID int64 `gorm:"column:campaign_id;type:bigint;not null;index:createdtime_linkid_campaignid_index,priority:3" json:"campaign_id"` + DfpRecordID int64 `gorm:"column:dfp_record_id;type:bigint;not null" json:"dfp_record_id"` + PersonaID int64 `gorm:"column:persona_id;type:bigint;not null" json:"persona_id"` + DeviceID string `gorm:"column:device_id;type:varchar(40);not null;index:created_time_project_device_id_index,priority:3" json:"device_id"` + UserID string `gorm:"column:user_id;type:varchar(40);not null" json:"user_id"` + EventID int64 `gorm:"column:event_id;type:bigint;not null;index:project_event_index,priority:2" json:"event_id"` + IPAddress string `gorm:"column:ip_address;type:char(39);not null" json:"ip_address"` + Os string `gorm:"column:os;type:varchar(15);not null" json:"os"` + OsVersion string `gorm:"column:os_version;type:varchar(10);not null" json:"os_version"` + DeviceModel string `gorm:"column:device_model;type:varchar(32);not null" json:"device_model"` + CreatedTime int32 `gorm:"column:created_time;type:int;not null;index:project_event_index,priority:3" json:"created_time"` + EventData string `gorm:"column:event_data;type:varchar(200);not null" json:"event_data"` + LinkHash string `gorm:"column:link_hash;type:varchar(22);not null;comment:链接hash" json:"link_hash"` + EventKey string `gorm:"column:event_key;type:varchar(50);not null;comment:事件key" json:"event_key"` +} + +// TableName ModuleStatisticsEventflow's table name +func (*ModuleStatisticsEventflow) TableName() string { + return TableNameModuleStatisticsEventflow +} diff --git a/internal/repository/model/notify_url.gen.go b/internal/repository/model/notify_url.gen.go new file mode 100644 index 0000000..c987bea --- /dev/null +++ b/internal/repository/model/notify_url.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameNotifyURL = "notify_url" + +// NotifyURL mapped from table +type NotifyURL struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int64 `gorm:"column:is_del;type:bigint;not null" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_Id,priority:1;comment:项目id(project表)" json:"project_id"` + Title string `gorm:"column:title;type:varchar(64);not null;comment:地址名称" json:"title"` + URL string `gorm:"column:url;type:varchar(255);not null;comment:回调地址" json:"url"` + OldData int8 `gorm:"column:old_data;type:tinyint;not null;comment:是否旧数据(0-否,1-是)" json:"old_data"` + Source int8 `gorm:"column:source;type:tinyint;not null;comment:数据来源(0-后台创建,1-奖品数据迁移,2-api创建)" json:"source"` + Headers string `gorm:"column:headers;type:json;not null;comment:请求头数据" json:"headers"` +} + +// TableName NotifyURL's table name +func (*NotifyURL) TableName() string { + return TableNameNotifyURL +} diff --git a/internal/repository/model/notify_url.go b/internal/repository/model/notify_url.go new file mode 100644 index 0000000..823cacf --- /dev/null +++ b/internal/repository/model/notify_url.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *NotifyURL) SetHeaders(val []*mtype.Header) { + s.Headers, _ = jsonm.MarshalToString(val) +} + +func (s *NotifyURL) GetHeaders() (val []*mtype.Header) { + _ = jsonm.StrUnmarshal(s.Headers, &val) + return +} diff --git a/internal/repository/model/operate_log.gen.go b/internal/repository/model/operate_log.gen.go new file mode 100644 index 0000000..45be826 --- /dev/null +++ b/internal/repository/model/operate_log.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameOperateLog = "operate_log" + +// OperateLog mapped from table +type OperateLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:员工表ID(user表)" json:"user_id"` + Mark string `gorm:"column:mark;type:varchar(32);not null;index:idx_mark_id_mark,priority:2;comment:操作标记" json:"mark"` + MarkID string `gorm:"column:mark_id;type:varchar(32);not null;index:idx_mark_id_mark,priority:1;comment:操作数据的id" json:"mark_id"` + Data string `gorm:"column:data;type:json;not null;comment:操作的数据" json:"data"` + IP string `gorm:"column:ip;type:varchar(20);not null;comment:客户端ip地址" json:"ip"` +} + +// TableName OperateLog's table name +func (*OperateLog) TableName() string { + return TableNameOperateLog +} diff --git a/internal/repository/model/permission.gen.go b/internal/repository/model/permission.gen.go new file mode 100644 index 0000000..8548b5d --- /dev/null +++ b/internal/repository/model/permission.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNamePermission = "permission" + +// Permission mapped from table +type Permission struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + GroupName string `gorm:"column:group_name;type:varchar(64);not null;comment:分组" json:"group_name"` + Group string `gorm:"column:group;type:varchar(128);not null;index:idx_group,priority:1;comment:分组名称" json:"group"` + Route string `gorm:"column:route;type:varchar(255);not null;uniqueIndex:uniq_route,priority:1;comment:api 路由" json:"route"` + RouteDesc string `gorm:"column:route_desc;type:varchar(255);not null;comment:路由说明" json:"route_desc"` +} + +// TableName Permission's table name +func (*Permission) TableName() string { + return TableNamePermission +} diff --git a/internal/repository/model/project.gen.go b/internal/repository/model/project.gen.go new file mode 100644 index 0000000..895f151 --- /dev/null +++ b/internal/repository/model/project.gen.go @@ -0,0 +1,37 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProject = "project" + +// Project mapped from table +type Project struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CompanyID int64 `gorm:"column:company_id;type:bigint;not null;index:idx_company_id,priority:1;comment:企业id表" json:"company_id"` + HashID string `gorm:"column:hash_id;type:varchar(22);not null;uniqueIndex:uniq_hash_id,priority:1;comment:访问key,用于对接" json:"hash_id"` + Title string `gorm:"column:title;type:varchar(128);not null;comment:项目名称" json:"title"` + Domain string `gorm:"column:domain;type:varchar(32);not null;index:idx_domain,priority:1;comment:一级域名" json:"domain"` + IsAll int8 `gorm:"column:is_all;type:tinyint;not null;comment:是否所有员工可看(0-否,1-是)" json:"is_all"` + NotifyToken string `gorm:"column:notify_token;type:varchar(40);not null;comment:项目回调token" json:"notify_token"` + EncryptStr string `gorm:"column:encrypt_str;type:varchar(40);not null;comment:数据加密字符串" json:"encrypt_str"` + Scene int8 `gorm:"column:scene;type:tinyint;not null;comment:项目应用场景(1-app,2-web)" json:"scene"` + ThirdSecret string `gorm:"column:third_secret;type:varchar(40);not null;comment:第三方开放平台密钥" json:"third_secret"` + ThirdURL string `gorm:"column:third_url;type:varchar(300);not null;comment:开放平台回调地址" json:"third_url"` + ThirdReboostURL string `gorm:"column:third_reboost_url;type:varchar(300);not null;comment:开放平台reboot回调地址" json:"third_reboost_url"` + PushLadder int8 `gorm:"column:push_ladder;type:tinyint;not null;comment:是否开启转发推送" json:"push_ladder"` + FissionCertType int8 `gorm:"column:fission_cert_type;type:tinyint;not null;comment:活动用户认证方式(0-不认证,1-加密认证)" json:"fission_cert_type"` + OpendAd int8 `gorm:"column:opend_ad;type:tinyint;not null;comment:开启广告(0-不开启,1-开启)" json:"opend_ad"` + CloseCopyShare int8 `gorm:"column:close_copy_share;type:tinyint;not null;comment:关闭复制分享文案(0-否,1-是)" json:"close_copy_share"` + LogoURL string `gorm:"column:logo_url;type:varchar(128);not null;comment:项目logo地址" json:"logo_url"` + IsTest int8 `gorm:"column:is_test;type:tinyint;not null;comment:是否测试项目(0-否,1-是)" json:"is_test"` +} + +// TableName Project's table name +func (*Project) TableName() string { + return TableNameProject +} diff --git a/internal/repository/model/project_ad.gen.go b/internal/repository/model/project_ad.gen.go new file mode 100644 index 0000000..0bc4d82 --- /dev/null +++ b/internal/repository/model/project_ad.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectAd = "project_ad" + +// ProjectAd mapped from table +type ProjectAd struct { + ID string `gorm:"column:id;type:char(16);primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;uniqueIndex:uniq_project_id,priority:1;comment:项目id(project表)" json:"project_id"` + OpenAd int8 `gorm:"column:open_ad;type:tinyint;not null;comment:开启广告模块(0-不开启,1-开启)" json:"open_ad"` + CampaignAd int8 `gorm:"column:campaign_ad;type:tinyint;not null;comment:开启活动广告(0-不开启,1-开启)" json:"campaign_ad"` + GaShowID string `gorm:"column:ga_show_id;type:varchar(32);not null;comment:谷歌展示广告id" json:"ga_show_id"` + GaEmbedID string `gorm:"column:ga_embed_id;type:varchar(32);not null;comment:谷歌内嵌广告id" json:"ga_embed_id"` + GaDoubleID string `gorm:"column:ga_double_id;type:varchar(32);not null;comment:谷歌多重广告id" json:"ga_double_id"` + AdStatus int8 `gorm:"column:ad_status;type:tinyint;not null;default:1;comment:广告状态(1-待审核,2-测试中,3-正式使用)" json:"ad_status"` + AdCustomURL int8 `gorm:"column:ad_custom_url;type:tinyint;not null;comment:开启广告自定义链接配置(0-不开启,1-开启)" json:"ad_custom_url"` +} + +// TableName ProjectAd's table name +func (*ProjectAd) TableName() string { + return TableNameProjectAd +} diff --git a/internal/repository/model/project_secret.gen.go b/internal/repository/model/project_secret.gen.go new file mode 100644 index 0000000..9ec7bcb --- /dev/null +++ b/internal/repository/model/project_secret.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectSecret = "project_secret" + +// ProjectSecret mapped from table +type ProjectSecret struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + CreatorID int64 `gorm:"column:creator_id;type:bigint;not null;comment:创建人id(user表主键)" json:"creator_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id,priority:1;comment:项目id(project表主键)" json:"project_id"` + AccessSecret string `gorm:"column:access_secret;type:varchar(32);not null;index:idx_access_secret,priority:1;comment:访问私钥" json:"access_secret"` +} + +// TableName ProjectSecret's table name +func (*ProjectSecret) TableName() string { + return TableNameProjectSecret +} diff --git a/internal/repository/model/project_user.gen.go b/internal/repository/model/project_user.gen.go new file mode 100644 index 0000000..207a485 --- /dev/null +++ b/internal/repository/model/project_user.gen.go @@ -0,0 +1,20 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUser = "project_user" + +// ProjectUser mapped from table +type ProjectUser struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_project_id_created_at,priority:2" json:"created_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;uniqueIndex:uniq_user_id_project_id,priority:2;index:idx_project_id_created_at,priority:1;comment:项目id(project表)" json:"project_id"` + UserID string `gorm:"column:user_id;type:varchar(64);not null;uniqueIndex:uniq_user_id_project_id,priority:1;comment:第三方的唯一用户id" json:"user_id"` +} + +// TableName ProjectUser's table name +func (*ProjectUser) TableName() string { + return TableNameProjectUser +} diff --git a/internal/repository/model/project_user_coin.gen.go b/internal/repository/model/project_user_coin.gen.go new file mode 100644 index 0000000..17f7087 --- /dev/null +++ b/internal/repository/model/project_user_coin.gen.go @@ -0,0 +1,29 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserCoin = "project_user_coin" + +// ProjectUserCoin mapped from table +type ProjectUserCoin struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;comment:项目id" json:"project_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_expired_at_is_used,priority:1;comment:项目用户ID" json:"user_id"` + CoinNum int32 `gorm:"column:coin_num;type:int;not null;comment:积分" json:"coin_num"` + CoinUse int32 `gorm:"column:coin_use;type:int;not null;comment:可用积分" json:"coin_use"` + ExpiredAt int64 `gorm:"column:expired_at;type:bigint;not null;index:idx_user_id_expired_at_is_used,priority:2;comment:过期时间" json:"expired_at"` + IsExpired int8 `gorm:"column:is_expired;type:tinyint;not null;comment:是否会过期(1-是,0-否)" json:"is_expired"` + IsUsed int8 `gorm:"column:is_used;type:tinyint;not null;index:idx_user_id_expired_at_is_used,priority:3;comment:是否使用完毕(1-是,0-否)" json:"is_used"` + Source string `gorm:"column:source;type:varchar(32);not null;index:uniq_source_id_source,priority:2;comment:来源" json:"source"` + SourceID int64 `gorm:"column:source_id;type:bigint;not null;index:uniq_source_id_source,priority:1;comment:来源唯一id" json:"source_id"` + SourceData string `gorm:"column:source_data;type:text;not null;comment:来源数据" json:"source_data"` +} + +// TableName ProjectUserCoin's table name +func (*ProjectUserCoin) TableName() string { + return TableNameProjectUserCoin +} diff --git a/internal/repository/model/project_user_coin.go b/internal/repository/model/project_user_coin.go new file mode 100644 index 0000000..49bd4fc --- /dev/null +++ b/internal/repository/model/project_user_coin.go @@ -0,0 +1,9 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (s *ProjectUserCoin) SetSourceData(val map[string]string) { + s.SourceData, _ = jsonm.ToObjString(val) +} diff --git a/internal/repository/model/project_user_coin_deduct.gen.go b/internal/repository/model/project_user_coin_deduct.gen.go new file mode 100644 index 0000000..76b159e --- /dev/null +++ b/internal/repository/model/project_user_coin_deduct.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserCoinDeduct = "project_user_coin_deduct" + +// ProjectUserCoinDeduct mapped from table +type ProjectUserCoinDeduct struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;uniqueIndex:uniq_user_id_relate_id_source,priority:1" json:"user_id"` + Source string `gorm:"column:source;type:varchar(32);not null;uniqueIndex:uniq_user_id_relate_id_source,priority:3;comment:扣除方式(sytem-系统,app-第三方应用)" json:"source"` + RelateMark string `gorm:"column:relate_mark;type:varchar(32);not null;comment:关联标识" json:"relate_mark"` + RelateID int64 `gorm:"column:relate_id;type:bigint;not null;uniqueIndex:uniq_user_id_relate_id_source,priority:2;comment:关联id" json:"relate_id"` + Operate string `gorm:"column:operate;type:varchar(64);not null;comment:操作标识" json:"operate"` + Num int32 `gorm:"column:num;type:int;not null;comment:扣除数量" json:"num"` +} + +// TableName ProjectUserCoinDeduct's table name +func (*ProjectUserCoinDeduct) TableName() string { + return TableNameProjectUserCoinDeduct +} diff --git a/internal/repository/model/project_user_coin_expired.gen.go b/internal/repository/model/project_user_coin_expired.gen.go new file mode 100644 index 0000000..12c3e09 --- /dev/null +++ b/internal/repository/model/project_user_coin_expired.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserCoinExpired = "project_user_coin_expired" + +// ProjectUserCoinExpired mapped from table +type ProjectUserCoinExpired struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;comment:用户id" json:"user_id"` + CoinID int64 `gorm:"column:coin_id;type:bigint;not null;comment:积分id" json:"coin_id"` + DoneAt int64 `gorm:"column:done_at;type:bigint;not null;index:idx_done_at_is_wait,priority:1;comment:执行时间" json:"done_at"` + IsWait int8 `gorm:"column:is_wait;type:tinyint;not null;index:idx_done_at_is_wait,priority:2;comment:是否待执行" json:"is_wait"` +} + +// TableName ProjectUserCoinExpired's table name +func (*ProjectUserCoinExpired) TableName() string { + return TableNameProjectUserCoinExpired +} diff --git a/internal/repository/model/project_user_coin_log.gen.go b/internal/repository/model/project_user_coin_log.gen.go new file mode 100644 index 0000000..a3f5581 --- /dev/null +++ b/internal/repository/model/project_user_coin_log.gen.go @@ -0,0 +1,33 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserCoinLog = "project_user_coin_log" + +// ProjectUserCoinLog mapped from table +type ProjectUserCoinLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_created_at,priority:1;comment:项目id(project_id)" json:"project_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:用户id(project_user表)" json:"user_id"` + Source string `gorm:"column:source;type:varchar(64);not null;index:idx_source_id_source,priority:2;comment:来源标识" json:"source"` + SourceID int64 `gorm:"column:source_id;type:bigint;not null;index:idx_source_id_source,priority:1;comment:来源id" json:"source_id"` + ReqURL string `gorm:"column:req_url;type:varchar(255);not null;comment:请求地址" json:"req_url"` + Req string `gorm:"column:req;type:varchar(255);not null;comment:请求数据" json:"req"` + Resp string `gorm:"column:resp;type:varchar(255);not null;comment:返回数据" json:"resp"` + RespCode int32 `gorm:"column:resp_code;type:int;not null;comment:返回状态码" json:"resp_code"` + ReqTime int64 `gorm:"column:req_time;type:bigint;not null;comment:请求时长(单位:ms)" json:"req_time"` + ErrMsg string `gorm:"column:err_msg;type:varchar(255);not null;comment:错误信息" json:"err_msg"` + Token string `gorm:"column:token;type:varchar(255);not null;comment:请求token" json:"token"` + ReqHeader string `gorm:"column:req_header;type:varchar(255);not null;comment:请求头数据" json:"req_header"` + Num int32 `gorm:"column:num;type:int;not null;comment:数量" json:"num"` + OtherData string `gorm:"column:other_data;type:varchar(255);not null;comment:其他数据信息" json:"other_data"` +} + +// TableName ProjectUserCoinLog's table name +func (*ProjectUserCoinLog) TableName() string { + return TableNameProjectUserCoinLog +} diff --git a/internal/repository/model/project_user_coin_log.go b/internal/repository/model/project_user_coin_log.go new file mode 100644 index 0000000..8103aaf --- /dev/null +++ b/internal/repository/model/project_user_coin_log.go @@ -0,0 +1,24 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *ProjectUserCoinLog) SetOtherData(val mtype.PointsLogOther) { + m.OtherData, _ = jsonm.MarshalToString(val) +} + +func (m *ProjectUserCoinLog) GetOtherData() (val mtype.PointsLogOther) { + _ = jsonm.StrUnmarshal(m.OtherData, &val) + return +} + +func (m *ProjectUserCoinLog) SetReq(val mtype.PointsLogReq) { + m.Req, _ = jsonm.MarshalToString(val) +} + +func (m *ProjectUserCoinLog) GetReq() (val mtype.PointsLogReq) { + _ = jsonm.StrUnmarshal(m.Req, &val) + return +} diff --git a/internal/repository/model/project_user_coin_record.gen.go b/internal/repository/model/project_user_coin_record.gen.go new file mode 100644 index 0000000..ad0bde1 --- /dev/null +++ b/internal/repository/model/project_user_coin_record.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserCoinRecord = "project_user_coin_record" + +// ProjectUserCoinRecord mapped from table +type ProjectUserCoinRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_source_id_type_created_at,priority:4" json:"created_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_created_at,priority:1" json:"project_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_source_id_type_created_at,priority:1" json:"user_id"` + Source string `gorm:"column:source;type:varchar(32);not null;index:idx_user_id_source_id_source_mark,priority:3" json:"source"` + SourceID int64 `gorm:"column:source_id;type:bigint;not null;index:idx_user_id_source_id_type_created_at,priority:2" json:"source_id"` + Type int8 `gorm:"column:type;type:tinyint;not null;index:idx_user_id_source_id_type_created_at,priority:3" json:"type"` + Mark string `gorm:"column:mark;type:varchar(32);not null;index:idx_user_id_source_id_source_mark,priority:4" json:"mark"` + Num int32 `gorm:"column:num;type:int;not null" json:"num"` + ExpiredAt int64 `gorm:"column:expired_at;type:bigint;not null" json:"expired_at"` +} + +// TableName ProjectUserCoinRecord's table name +func (*ProjectUserCoinRecord) TableName() string { + return TableNameProjectUserCoinRecord +} diff --git a/internal/repository/model/project_user_coin_use.gen.go b/internal/repository/model/project_user_coin_use.gen.go new file mode 100644 index 0000000..9b2282e --- /dev/null +++ b/internal/repository/model/project_user_coin_use.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserCoinUse = "project_user_coin_use" + +// ProjectUserCoinUse mapped from table +type ProjectUserCoinUse struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1" json:"user_id"` + Num int32 `gorm:"column:num;type:int;not null" json:"num"` + Source string `gorm:"column:source;type:varchar(32);not null;index:idx_source_id_source,priority:2;comment:使用来源(campaign-活动,center-任务中心)" json:"source"` + SourceID int64 `gorm:"column:source_id;type:bigint;not null;index:idx_source_id_source,priority:1;comment:使用来源id" json:"source_id"` + Operate string `gorm:"column:operate;type:varchar(64);not null;comment:操作标识" json:"operate"` + CoinIds string `gorm:"column:coin_ids;type:text;not null;comment:扣除关联的积分id" json:"coin_ids"` +} + +// TableName ProjectUserCoinUse's table name +func (*ProjectUserCoinUse) TableName() string { + return TableNameProjectUserCoinUse +} diff --git a/internal/repository/model/project_user_coin_use.go b/internal/repository/model/project_user_coin_use.go new file mode 100644 index 0000000..6abf201 --- /dev/null +++ b/internal/repository/model/project_user_coin_use.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (s *ProjectUserCoinUse) SetCoinIds(val []int64) { + s.CoinIds, _ = jsonm.MarshalToString(val) +} + +func (s *ProjectUserCoinUse) GetCoinIds() (val []int64) { + _ = jsonm.StrUnmarshal(s.CoinIds, &val) + return +} diff --git a/internal/repository/model/project_user_info_log.gen.go b/internal/repository/model/project_user_info_log.gen.go new file mode 100644 index 0000000..664e0ec --- /dev/null +++ b/internal/repository/model/project_user_info_log.gen.go @@ -0,0 +1,30 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameProjectUserInfoLog = "project_user_info_log" + +// ProjectUserInfoLog mapped from table +type ProjectUserInfoLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_user_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_created_at,priority:1;comment:项目id(project_id)" json:"project_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id_created_at,priority:1;comment:用户id(project_user表)" json:"user_id"` + Source string `gorm:"column:source;type:varchar(64);not null;comment:来源标识" json:"source"` + ReqURL string `gorm:"column:req_url;type:varchar(255);not null;comment:请求地址" json:"req_url"` + Req string `gorm:"column:req;type:varchar(255);not null;comment:请求数据" json:"req"` + Resp string `gorm:"column:resp;type:varchar(255);not null;comment:返回数据" json:"resp"` + RespCode int32 `gorm:"column:resp_code;type:int;not null;comment:返回状态码" json:"resp_code"` + ReqTime int64 `gorm:"column:req_time;type:bigint;not null;comment:请求时长(单位:ms)" json:"req_time"` + ErrMsg string `gorm:"column:err_msg;type:varchar(255);not null;comment:错误信息" json:"err_msg"` + Token string `gorm:"column:token;type:varchar(255);not null;comment:请求token" json:"token"` + ReqHeader string `gorm:"column:req_header;type:varchar(255);not null;comment:请求头数据" json:"req_header"` +} + +// TableName ProjectUserInfoLog's table name +func (*ProjectUserInfoLog) TableName() string { + return TableNameProjectUserInfoLog +} diff --git a/internal/repository/model/project_user_info_log.go b/internal/repository/model/project_user_info_log.go new file mode 100644 index 0000000..5cf7f3b --- /dev/null +++ b/internal/repository/model/project_user_info_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *ProjectUserInfoLog) SetReq(val mtype.ProjectUserInfoReq) { + m.Req, _ = jsonm.MarshalToString(val) +} + +func (m *ProjectUserInfoLog) GetReq() (val mtype.ProjectUserInfoReq) { + _ = jsonm.StrUnmarshal(m.Req, &val) + return +} diff --git a/internal/repository/model/redeem_mall.gen.go b/internal/repository/model/redeem_mall.gen.go new file mode 100644 index 0000000..6247a27 --- /dev/null +++ b/internal/repository/model/redeem_mall.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRedeemMall = "redeem_mall" + +// RedeemMall mapped from table +type RedeemMall struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否删除(0-否,1-是)" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id,priority:1;comment:项目id(project表)" json:"project_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:积分标题" json:"title"` + Status int8 `gorm:"column:status;type:tinyint;not null;comment:状态(1-暂未使用,2-使用中)" json:"status"` +} + +// TableName RedeemMall's table name +func (*RedeemMall) TableName() string { + return TableNameRedeemMall +} diff --git a/internal/repository/model/redeem_mall_item.gen.go b/internal/repository/model/redeem_mall_item.gen.go new file mode 100644 index 0000000..35e1147 --- /dev/null +++ b/internal/repository/model/redeem_mall_item.gen.go @@ -0,0 +1,36 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRedeemMallItem = "redeem_mall_item" + +// RedeemMallItem mapped from table +type RedeemMallItem struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;index:idx_mall_id_down_at_is_del,priority:3;comment:是否删除(0-否,1-是)" json:"is_del"` + MallID int64 `gorm:"column:mall_id;type:bigint;not null;index:idx_mall_id_down_at_is_del,priority:1;comment:商城id(redeem_mall表)" json:"mall_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id(reward表)" json:"reward_id"` + CoinNum int32 `gorm:"column:coin_num;type:int;not null;comment:所需积分数" json:"coin_num"` + Stock int64 `gorm:"column:stock;type:bigint;not null;comment:总库存" json:"stock"` + UseStock int64 `gorm:"column:use_stock;type:bigint;not null;comment:已使用库存(下架时候结算,-1未结算)" json:"use_stock"` + UpType int8 `gorm:"column:up_type;type:tinyint;not null;comment:上架类型(1-立即上架,2-指定时间)" json:"up_type"` + UpCustom int64 `gorm:"column:up_custom;type:bigint;not null;comment:自定的上架时间" json:"up_custom"` + UpAt int64 `gorm:"column:up_at;type:bigint;not null;comment:上架时间" json:"up_at"` + UpFrom string `gorm:"column:up_from;type:varchar(32);not null;comment:上架来源" json:"up_from"` + UpShow string `gorm:"column:up_show;type:varchar(255);not null;comment:指定上架展示配置" json:"up_show"` + DownType int8 `gorm:"column:down_type;type:tinyint;not null;comment:下架类型(1-永久上架,2-指定时间下架)" json:"down_type"` + DownCustom int64 `gorm:"column:down_custom;type:bigint;not null;comment:指定下架时间" json:"down_custom"` + DownAt int64 `gorm:"column:down_at;type:bigint;not null;index:idx_mall_id_down_at_is_del,priority:2;comment:下架时间" json:"down_at"` + DownFrom string `gorm:"column:down_from;type:varchar(32);not null;comment:下架来源" json:"down_from"` + DownShow string `gorm:"column:down_show;type:varchar(255);not null;comment:指定下架展示配置" json:"down_show"` + Sort int32 `gorm:"column:sort;type:int;not null;comment:排序" json:"sort"` +} + +// TableName RedeemMallItem's table name +func (*RedeemMallItem) TableName() string { + return TableNameRedeemMallItem +} diff --git a/internal/repository/model/redeem_mall_item.go b/internal/repository/model/redeem_mall_item.go new file mode 100644 index 0000000..4207bdb --- /dev/null +++ b/internal/repository/model/redeem_mall_item.go @@ -0,0 +1,57 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/verify" + "time" +) + +func (s *RedeemMallItem) SetUpShow(val []string) { + s.UpShow, _ = jsonm.ToSliceString(val) +} + +func (s *RedeemMallItem) GetUpShow() (val []string) { + _ = jsonm.StrUnmarshal(s.UpShow, &val) + return +} + +func (s *RedeemMallItem) SetDownShow(val []string) { + s.DownShow, _ = jsonm.ToSliceString(val) +} + +func (s *RedeemMallItem) GetDownShow() (val []string) { + _ = jsonm.StrUnmarshal(s.DownShow, &val) + return +} + +func (s *RedeemMallItem) GetStatus() int32 { + if s.IsDel == mtype.Yes { + return mtype.RedeemMallItemStatusDel + } + + if s.DownAt > 0 || (s.DownType == mtype.RedeemMallItemDownTypeCustom && s.DownCustom <= time.Now().Unix()) { + return mtype.RedeemMallItemStatusDown + } + + if s.UpAt > time.Now().Unix() { + return mtype.RedeemMallItemStatusWait + } + + return mtype.RedeemMallItemStatusUp +} + +func (s *RedeemMallItem) IsShow() bool { + + switch s.GetStatus() { + case mtype.RedeemMallItemStatusWait: + if verify.InArray[string](mtype.RedeemMallItemUpShowClient, s.GetUpShow()...) { + return true + } + return false + case mtype.RedeemMallItemStatusUp: + return true + default: + return false + } +} diff --git a/internal/repository/model/redeem_mall_item_task.gen.go b/internal/repository/model/redeem_mall_item_task.gen.go new file mode 100644 index 0000000..80f88e7 --- /dev/null +++ b/internal/repository/model/redeem_mall_item_task.gen.go @@ -0,0 +1,21 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRedeemMallItemTask = "redeem_mall_item_task" + +// RedeemMallItemTask mapped from table +type RedeemMallItemTask struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + ItemID int64 `gorm:"column:item_id;type:bigint;not null;comment:商城商品ID(redeem_mall_item表)" json:"item_id"` + DoAt int64 `gorm:"column:do_at;type:bigint;not null;index:idx_do_at,priority:1;comment:执行时间" json:"do_at"` + Mark string `gorm:"column:mark;type:varchar(32);not null;comment:执行标识" json:"mark"` +} + +// TableName RedeemMallItemTask's table name +func (*RedeemMallItemTask) TableName() string { + return TableNameRedeemMallItemTask +} diff --git a/internal/repository/model/redeem_mall_record.gen.go b/internal/repository/model/redeem_mall_record.gen.go new file mode 100644 index 0000000..d1eb78c --- /dev/null +++ b/internal/repository/model/redeem_mall_record.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRedeemMallRecord = "redeem_mall_record" + +// RedeemMallRecord mapped from table +type RedeemMallRecord struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_mall_item_id_created_at,priority:2" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + MallID int64 `gorm:"column:mall_id;type:bigint;not null;index:idx_mall_id_created_at,priority:1;comment:商城id(redeem_mall表)" json:"mall_id"` + MallItemID int64 `gorm:"column:mall_item_id;type:bigint;not null;index:idx_mall_item_id_created_at,priority:1;comment:商城商品ID(redeem_mall_item表)" json:"mall_item_id"` + CoinNum int64 `gorm:"column:coin_num;type:bigint;not null;comment:消耗的积分数" json:"coin_num"` + Status int8 `gorm:"column:status;type:tinyint;not null;comment:奖品状态(1-处理成功,2-待推送,3-推送失败)" json:"status"` + FailType string `gorm:"column:fail_type;type:varchar(20);not null;comment:失败原因标识" json:"fail_type"` + FailMsg string `gorm:"column:fail_msg;type:varchar(500);not null;comment:具体失败原因" json:"fail_msg"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:基础奖品id(reward表)" json:"reward_id"` + CustomRewardVal string `gorm:"column:custom_reward_val;type:varchar(255);not null;comment:回调后接收到的数据" json:"custom_reward_val"` +} + +// TableName RedeemMallRecord's table name +func (*RedeemMallRecord) TableName() string { + return TableNameRedeemMallRecord +} diff --git a/internal/repository/model/redeem_mall_relate.gen.go b/internal/repository/model/redeem_mall_relate.gen.go new file mode 100644 index 0000000..32eb6d5 --- /dev/null +++ b/internal/repository/model/redeem_mall_relate.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRedeemMallRelate = "redeem_mall_relate" + +// RedeemMallRelate mapped from table +type RedeemMallRelate struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + MallID int64 `gorm:"column:mall_id;type:bigint;not null;uniqueIndex:uniq_mall_id_relate_id_relate_table,priority:1;index:idx_mall_id_cancel_time,priority:1;comment:商城id(redeem_mall表)" json:"mall_id"` + Source int8 `gorm:"column:source;type:tinyint;not null;comment:来源(1-任务中心,2-活动)" json:"source"` + RelateID int64 `gorm:"column:relate_id;type:bigint;not null;uniqueIndex:uniq_mall_id_relate_id_relate_table,priority:2;index:idx_relate_id_relate_table,priority:1;comment:关联id" json:"relate_id"` + RelateTable string `gorm:"column:relate_table;type:varchar(64);not null;uniqueIndex:uniq_mall_id_relate_id_relate_table,priority:3;index:idx_relate_id_relate_table,priority:2;comment:关联表名" json:"relate_table"` + CancelTime int64 `gorm:"column:cancel_time;type:bigint;not null;uniqueIndex:uniq_mall_id_relate_id_relate_table,priority:4;index:idx_mall_id_cancel_time,priority:2;comment:取消关联时间" json:"cancel_time"` +} + +// TableName RedeemMallRelate's table name +func (*RedeemMallRelate) TableName() string { + return TableNameRedeemMallRelate +} diff --git a/internal/repository/model/register.gen.go b/internal/repository/model/register.gen.go new file mode 100644 index 0000000..0aa3a4a --- /dev/null +++ b/internal/repository/model/register.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRegister = "register" + +// Register mapped from table +type Register struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(20);not null;index:idx_hash_id,priority:1;comment:对外id" json:"hash_id"` + Username string `gorm:"column:username;type:varchar(64);not null;index:idx_username,priority:1;comment:注册账号(申请通过后超级管理员登陆的账号)" json:"username"` + Passwd string `gorm:"column:passwd;type:varchar(255);not null;comment:申请通过后超级管理员登陆的密码" json:"passwd"` + AuditType int8 `gorm:"column:audit_type;type:tinyint;not null;comment:审核状态(1-待审核,2-已通过,3-已拒绝)" json:"audit_type"` + Email string `gorm:"column:email;type:varchar(64);not null;comment:注册邮箱" json:"email"` + ShortName string `gorm:"column:short_name;type:varchar(255);not null;comment:申请通过后公司显示的简称" json:"short_name"` + Phone string `gorm:"column:phone;type:varchar(18);not null;comment:申请通过后公司显示手机号" json:"phone"` + AppName string `gorm:"column:app_name;type:varchar(255);not null;comment:申请通过后公司站点名称" json:"app_name"` +} + +// TableName Register's table name +func (*Register) TableName() string { + return TableNameRegister +} diff --git a/internal/repository/model/register_audit.gen.go b/internal/repository/model/register_audit.gen.go new file mode 100644 index 0000000..271870e --- /dev/null +++ b/internal/repository/model/register_audit.gen.go @@ -0,0 +1,24 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRegisterAudit = "register_audit" + +// RegisterAudit mapped from table +type RegisterAudit struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + RegisterID int64 `gorm:"column:register_id;type:bigint;not null;index:idx_register_id,priority:1;comment:注册记录id(register表主键)" json:"register_id"` + Pass int8 `gorm:"column:pass;type:tinyint;not null;comment:是否通过(1-是,0-否)" json:"pass"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:备注信息" json:"desc"` + OperatorID int64 `gorm:"column:operator_id;type:bigint;not null;comment:审核人id" json:"operator_id"` +} + +// TableName RegisterAudit's table name +func (*RegisterAudit) TableName() string { + return TableNameRegisterAudit +} diff --git a/internal/repository/model/reward.gen.go b/internal/repository/model/reward.gen.go new file mode 100644 index 0000000..4f95165 --- /dev/null +++ b/internal/repository/model/reward.gen.go @@ -0,0 +1,32 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameReward = "reward" + +// Reward mapped from table +type Reward struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id_kv_mark,priority:1;comment:项目id(project表)" json:"project_id"` + ReceiveType int8 `gorm:"column:receive_type;type:tinyint;not null;comment:发放类型(1-系统发放,2-联系客服,3-客户端发放,4-表单)" json:"receive_type"` + KvData string `gorm:"column:kv_data;type:varchar(2000);not null;comment:回调的键值数据" json:"kv_data"` + KvMark string `gorm:"column:kv_mark;type:varchar(32);not null;index:idx_project_id_kv_mark,priority:2;comment:键值标识" json:"kv_mark"` + URLID int64 `gorm:"column:url_id;type:bigint;not null;index:idx_url_id,priority:1;comment:回调地址id" json:"url_id"` + FormID int64 `gorm:"column:form_id;type:bigint;not null;index:idx_form_id,priority:1;comment:表单ID" json:"form_id"` + Contact string `gorm:"column:contact;type:varchar(255);not null;comment:联系方式" json:"contact"` + RewardTitle string `gorm:"column:reward_title;type:varchar(255);not null;comment:奖品标题,用户后台功能统一展示" json:"reward_title"` + TitleDefault int8 `gorm:"column:title_default;type:tinyint;not null;comment:奖品标题是否使用的是默认语言的奖品名称(0-否,1-是)" json:"title_default"` + OldData int8 `gorm:"column:old_data;type:tinyint;not null;comment:同步的旧数据" json:"old_data"` + DyRewardType int8 `gorm:"column:dy_reward_type;type:tinyint;not null;comment:动态奖品内容类型(0-无,1-兑换码)" json:"dy_reward_type"` + Source int8 `gorm:"column:source;type:tinyint;not null;comment:数据来源(0-后台创建,1-奖品数据迁移,2-api创建)" json:"source"` +} + +// TableName Reward's table name +func (*Reward) TableName() string { + return TableNameReward +} diff --git a/internal/repository/model/reward.go b/internal/repository/model/reward.go new file mode 100644 index 0000000..200cc2d --- /dev/null +++ b/internal/repository/model/reward.go @@ -0,0 +1,20 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (s *Reward) SetKvData(val []*mtype.RewardKV) { + s.KvData, _ = jsonm.MarshalToString(val) +} + +func (s *Reward) GetKvData() (val []*mtype.RewardKV) { + _ = jsonm.StrUnmarshal(s.KvData, &val) + return +} + +func (s *Reward) GetJustKvData() (val []*mtype.KV) { + _ = jsonm.StrUnmarshal(s.KvData, &val) + return +} diff --git a/internal/repository/model/reward_lang.gen.go b/internal/repository/model/reward_lang.gen.go new file mode 100644 index 0000000..fd5f424 --- /dev/null +++ b/internal/repository/model/reward_lang.gen.go @@ -0,0 +1,31 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRewardLang = "reward_lang" + +// RewardLang mapped from table +type RewardLang struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int64 `gorm:"column:is_del;type:bigint;not null" json:"is_del"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id,priority:1;comment:项目id(project表)" json:"project_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;uniqueIndex:uniq_reward_id_mark,priority:1;comment:奖品id(reward表)" json:"reward_id"` + Mark string `gorm:"column:mark;type:varchar(6);not null;uniqueIndex:uniq_reward_id_mark,priority:2;comment:语种标识" json:"mark"` + Title string `gorm:"column:title;type:varchar(64);not null;comment:奖品名称" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(255);not null;comment:奖品图片" json:"img_url"` + IsDefault int8 `gorm:"column:is_default;type:tinyint;not null;comment:是否默认语言(0-否,1-是)" json:"is_default"` + OpenToUse int8 `gorm:"column:open_to_use;type:tinyint;not null;comment:开启去使用(0-否,1-是)" json:"open_to_use"` + WebURL string `gorm:"column:web_url;type:varchar(255);not null;comment:Web端的跳转地址" json:"web_url"` + AppParam string `gorm:"column:app_param;type:varchar(255);not null;comment:App端的跳转参数" json:"app_param"` + ImageID int64 `gorm:"column:image_id;type:bigint;not null;comment:图片素材id" json:"image_id"` + PcParam string `gorm:"column:pc_param;type:varchar(255);not null;comment:pc端的跳转参数" json:"pc_param"` +} + +// TableName RewardLang's table name +func (*RewardLang) TableName() string { + return TableNameRewardLang +} diff --git a/internal/repository/model/reward_push.gen.go b/internal/repository/model/reward_push.gen.go new file mode 100644 index 0000000..741b0f1 --- /dev/null +++ b/internal/repository/model/reward_push.gen.go @@ -0,0 +1,32 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRewardPush = "reward_push" + +// RewardPush mapped from table +type RewardPush struct { + ID string `gorm:"column:id;type:char(20);primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + Source string `gorm:"column:source;type:varchar(32);not null;uniqueIndex:uniq_relate_id_first_id_source_second_id,priority:3;index:idx_first_id_source_second_id,priority:2;comment:来源标识" json:"source"` + FirstID int64 `gorm:"column:first_id;type:bigint;not null;uniqueIndex:uniq_relate_id_first_id_source_second_id,priority:2;index:idx_first_id_source_second_id,priority:1;comment:来源一级id" json:"first_id"` + SecondID int64 `gorm:"column:second_id;type:bigint;not null;uniqueIndex:uniq_relate_id_first_id_source_second_id,priority:4;index:idx_first_id_source_second_id,priority:3;comment:来源二级id" json:"second_id"` + RelateID int64 `gorm:"column:relate_id;type:bigint;not null;uniqueIndex:uniq_relate_id_first_id_source_second_id,priority:1;comment:关联记录id" json:"relate_id"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;comment:奖品id(reward表)" json:"reward_id"` + UserID string `gorm:"column:user_id;type:varchar(64);not null;comment:第三方应用用户ID" json:"user_id"` + Param string `gorm:"column:param;type:text;not null;comment:推送参数" json:"param"` + Sync int8 `gorm:"column:sync;type:tinyint;not null;comment:是否同步请求(0-否,1-是)" json:"sync"` + Status int8 `gorm:"column:status;type:tinyint;not null;comment:状态(1-推送中,2-完成,3-失败)" json:"status"` + FailType string `gorm:"column:fail_type;type:varchar(20);not null;comment:失败原因标识" json:"fail_type"` + FailMsg string `gorm:"column:fail_msg;type:varchar(255);not null;comment:具体失败原因" json:"fail_msg"` + PushNum int32 `gorm:"column:push_num;type:int;not null;comment:推送次数" json:"push_num"` + RespData string `gorm:"column:resp_data;type:varchar(255);not null;comment:成功后返回的数据" json:"resp_data"` +} + +// TableName RewardPush's table name +func (*RewardPush) TableName() string { + return TableNameRewardPush +} diff --git a/internal/repository/model/reward_push.go b/internal/repository/model/reward_push.go new file mode 100644 index 0000000..11c1bd1 --- /dev/null +++ b/internal/repository/model/reward_push.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *RewardPush) SetParam(val mtype.RewardPushParam) { + m.Param, _ = jsonm.MarshalToString(val) +} + +func (m *RewardPush) GetParam() (val mtype.RewardPushParam) { + _ = jsonm.StrUnmarshal(m.Param, &val) + return +} diff --git a/internal/repository/model/reward_push_log.gen.go b/internal/repository/model/reward_push_log.gen.go new file mode 100644 index 0000000..d2b7121 --- /dev/null +++ b/internal/repository/model/reward_push_log.gen.go @@ -0,0 +1,28 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRewardPushLog = "reward_push_log" + +// RewardPushLog mapped from table +type RewardPushLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + PushID string `gorm:"column:push_id;type:char(20);not null;comment:推送id(reward_push表)" json:"push_id"` + ReqURL string `gorm:"column:req_url;type:varchar(255);not null;comment:请求地址" json:"req_url"` + Req string `gorm:"column:req;type:text;not null;comment:请求数据" json:"req"` + Resp string `gorm:"column:resp;type:text;not null;comment:返回数据" json:"resp"` + RespCode int32 `gorm:"column:resp_code;type:int;not null;comment:返回状态码" json:"resp_code"` + ReqTime int64 `gorm:"column:req_time;type:bigint;not null;comment:请求时长(单位:ms)" json:"req_time"` + ErrMsg string `gorm:"column:err_msg;type:varchar(255);not null;comment:错误信息" json:"err_msg"` + Token string `gorm:"column:token;type:varchar(255);not null;comment:请求token" json:"token"` + ReqHeader string `gorm:"column:req_header;type:varchar(255);not null;comment:请求头数据" json:"req_header"` +} + +// TableName RewardPushLog's table name +func (*RewardPushLog) TableName() string { + return TableNameRewardPushLog +} diff --git a/internal/repository/model/reward_push_log.go b/internal/repository/model/reward_push_log.go new file mode 100644 index 0000000..8fba838 --- /dev/null +++ b/internal/repository/model/reward_push_log.go @@ -0,0 +1,15 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +func (m *RewardPushLog) SetReq(val mtype.RewardPushLogReq) { + m.Req, _ = jsonm.MarshalToString(val) +} + +func (m *RewardPushLog) GetReq() (val mtype.RewardPushLogReq) { + _ = jsonm.StrUnmarshal(m.Req, &val) + return +} diff --git a/internal/repository/model/reward_push_task.gen.go b/internal/repository/model/reward_push_task.gen.go new file mode 100644 index 0000000..fbd7083 --- /dev/null +++ b/internal/repository/model/reward_push_task.gen.go @@ -0,0 +1,20 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRewardPushTask = "reward_push_task" + +// RewardPushTask mapped from table +type RewardPushTask struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + DoTime int64 `gorm:"column:do_time;type:bigint;not null;index:idx_do_time,priority:1;comment:执行时间" json:"do_time"` + PushID string `gorm:"column:push_id;type:char(20);not null;comment:推送id(reward_push表)" json:"push_id"` +} + +// TableName RewardPushTask's table name +func (*RewardPushTask) TableName() string { + return TableNameRewardPushTask +} diff --git a/internal/repository/model/reward_related.gen.go b/internal/repository/model/reward_related.gen.go new file mode 100644 index 0000000..17d5309 --- /dev/null +++ b/internal/repository/model/reward_related.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameRewardRelated = "reward_related" + +// RewardRelated mapped from table +type RewardRelated struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + RewardID int64 `gorm:"column:reward_id;type:bigint;not null;uniqueIndex:uniq_reward_id_relate_id_relate_table,priority:1;index:idx_relate_id_relate_table,priority:1;comment:奖品id(reward表)" json:"reward_id"` + RelateID int64 `gorm:"column:relate_id;type:bigint;not null;uniqueIndex:uniq_reward_id_relate_id_relate_table,priority:2;index:idx_relate_id_relate_table,priority:2;comment:关联id" json:"relate_id"` + RelateTable string `gorm:"column:relate_table;type:varchar(64);not null;uniqueIndex:uniq_reward_id_relate_id_relate_table,priority:3;comment:关联表名" json:"relate_table"` + CancelTime int64 `gorm:"column:cancel_time;type:bigint;not null;uniqueIndex:uniq_reward_id_relate_id_relate_table,priority:4;comment:取消关联时间" json:"cancel_time"` +} + +// TableName RewardRelated's table name +func (*RewardRelated) TableName() string { + return TableNameRewardRelated +} diff --git a/internal/repository/model/server_whitelist.gen.go b/internal/repository/model/server_whitelist.gen.go new file mode 100644 index 0000000..c11f8dc --- /dev/null +++ b/internal/repository/model/server_whitelist.gen.go @@ -0,0 +1,18 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameServerWhitelist = "server_whitelist" + +// ServerWhitelist mapped from table +type ServerWhitelist struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + IP string `gorm:"column:ip;type:varchar(255);not null" json:"ip"` +} + +// TableName ServerWhitelist's table name +func (*ServerWhitelist) TableName() string { + return TableNameServerWhitelist +} diff --git a/internal/repository/model/slow_log.gen.go b/internal/repository/model/slow_log.gen.go new file mode 100644 index 0000000..7b0f139 --- /dev/null +++ b/internal/repository/model/slow_log.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameSlowLog = "slow_log" + +// SlowLog mapped from table +type SlowLog struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_created_at_method,priority:1" json:"created_at"` + Method string `gorm:"column:method;type:varchar(64);not null;index:idx_created_at_method,priority:2;comment:执行的方法标识" json:"method"` + Req string `gorm:"column:req;type:json;not null;comment:处理的数据" json:"req"` + Res string `gorm:"column:res;type:json;not null;comment:处理后返回的结果" json:"res"` + Sec int64 `gorm:"column:sec;type:bigint;not null;comment:耗时(单位:ms)" json:"sec"` + TraceID string `gorm:"column:trace_id;type:varchar(20);not null;uniqueIndex:uniq_trace_id,priority:1;comment:全局追踪id" json:"trace_id"` +} + +// TableName SlowLog's table name +func (*SlowLog) TableName() string { + return TableNameSlowLog +} diff --git a/internal/repository/model/t_coin.gen.go b/internal/repository/model/t_coin.gen.go new file mode 100644 index 0000000..18387dc --- /dev/null +++ b/internal/repository/model/t_coin.gen.go @@ -0,0 +1,23 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameTCoin = "t_coin" + +// TCoin mapped from table +type TCoin struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id,priority:1;comment:项目id(project表)" json:"project_id"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:积分标题" json:"title"` + OpenPush int8 `gorm:"column:open_push;type:tinyint;not null;comment:开启积分获得推送" json:"open_push"` + ExpSelect string `gorm:"column:exp_select;type:varchar(255);not null;comment:有效期选项" json:"exp_select"` +} + +// TableName TCoin's table name +func (*TCoin) TableName() string { + return TableNameTCoin +} diff --git a/internal/repository/model/t_coin.go b/internal/repository/model/t_coin.go new file mode 100644 index 0000000..d3d7971 --- /dev/null +++ b/internal/repository/model/t_coin.go @@ -0,0 +1,14 @@ +package model + +import ( + "joybuywork/internal/plugins/jsonm" +) + +func (s *TCoin) SetExpSelect(val []string) { + s.ExpSelect, _ = jsonm.ToSliceString(val) +} + +func (s *TCoin) GetExpSelect() (val []string) { + _ = jsonm.StrUnmarshal(s.ExpSelect, &val) + return +} diff --git a/internal/repository/model/t_coin_lang.gen.go b/internal/repository/model/t_coin_lang.gen.go new file mode 100644 index 0000000..5e84099 --- /dev/null +++ b/internal/repository/model/t_coin_lang.gen.go @@ -0,0 +1,25 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameTCoinLang = "t_coin_lang" + +// TCoinLang mapped from table +type TCoinLang struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + TCoinID int64 `gorm:"column:t_coin_id;type:bigint;not null;uniqueIndex:uniq_t_coin_id_lang_mark,priority:1;comment:积分配置id(t_coin表)" json:"t_coin_id"` + LangMark string `gorm:"column:lang_mark;type:varchar(12);not null;uniqueIndex:uniq_t_coin_id_lang_mark,priority:2;comment:语言标识" json:"lang_mark"` + Title string `gorm:"column:title;type:varchar(255);not null;comment:积分标题" json:"title"` + ImgURL string `gorm:"column:img_url;type:varchar(255);not null;comment:积分图片" json:"img_url"` + Rule string `gorm:"column:rule;type:text;not null;comment:积分规则" json:"rule"` + IsDefault int8 `gorm:"column:is_default;type:tinyint;not null;comment:是否默认" json:"is_default"` +} + +// TableName TCoinLang's table name +func (*TCoinLang) TableName() string { + return TableNameTCoinLang +} diff --git a/internal/repository/model/user.gen.go b/internal/repository/model/user.gen.go new file mode 100644 index 0000000..84061af --- /dev/null +++ b/internal/repository/model/user.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameUser = "user" + +// User mapped from table +type User struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + HashID string `gorm:"column:hash_id;type:varchar(22);not null;index:idx_hash_id,priority:1;comment:对外id" json:"hash_id"` + CompanyID int64 `gorm:"column:company_id;type:bigint;not null;index:idx_company_id,priority:1;comment:企业id表" json:"company_id"` + Username string `gorm:"column:username;type:varchar(64);not null;comment:用户登陆账号" json:"username"` + ShowName string `gorm:"column:show_name;type:varchar(255);not null;comment:用户显示名称" json:"show_name"` + Passwd string `gorm:"column:passwd;type:varchar(255);not null;comment:用户密码" json:"passwd"` + IsAdmin int8 `gorm:"column:is_admin;type:tinyint;not null;comment:是否超级管理员(0-否,1-是)" json:"is_admin"` + Email string `gorm:"column:email;type:varchar(64);not null;comment:邮箱" json:"email"` +} + +// TableName User's table name +func (*User) TableName() string { + return TableNameUser +} diff --git a/internal/repository/model/user_behavior.gen.go b/internal/repository/model/user_behavior.gen.go new file mode 100644 index 0000000..34b3362 --- /dev/null +++ b/internal/repository/model/user_behavior.gen.go @@ -0,0 +1,27 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameUserBehavior = "user_behavior" + +// UserBehavior mapped from table +type UserBehavior struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null;index:idx_project_id_created_at,priority:2" json:"created_at"` + APIURL string `gorm:"column:api_url;type:varchar(64);not null;index:idx_company_id_api_url_created_at,priority:1;comment:请求的接口" json:"api_url"` + Desc string `gorm:"column:desc;type:varchar(255);not null;comment:接口描述" json:"desc"` + CompanyID int64 `gorm:"column:company_id;type:bigint;not null;index:idx_company_id_user_id_created_at,priority:1;comment:公司id" json:"company_id"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_company_id_user_id_created_at,priority:2;comment:用户id" json:"user_id"` + ProjectID string `gorm:"column:project_id;type:varchar(22);not null;index:idx_project_id_created_at,priority:1;comment:项目hash_id" json:"project_id"` + IP string `gorm:"column:ip;type:varchar(255);not null;comment:操作ip" json:"ip"` + UaData string `gorm:"column:ua_data;type:varchar(255);not null;comment:部分ua头数据" json:"ua_data"` + Req string `gorm:"column:req;type:text;not null;comment:请求数据" json:"req"` + Res string `gorm:"column:res;type:text;not null;comment:操作结果" json:"res"` +} + +// TableName UserBehavior's table name +func (*UserBehavior) TableName() string { + return TableNameUserBehavior +} diff --git a/internal/repository/model/user_project_relate.gen.go b/internal/repository/model/user_project_relate.gen.go new file mode 100644 index 0000000..2d3dcf4 --- /dev/null +++ b/internal/repository/model/user_project_relate.gen.go @@ -0,0 +1,22 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +const TableNameUserProjectRelate = "user_project_relate" + +// UserProjectRelate mapped from table +type UserProjectRelate struct { + ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"` + CreatedAt int64 `gorm:"column:created_at;type:bigint;not null" json:"created_at"` + UpdatedAt int64 `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"` + IsDel int8 `gorm:"column:is_del;type:tinyint;not null;comment:是否已删除(1-是,0-否)" json:"is_del"` + UserID int64 `gorm:"column:user_id;type:bigint;not null;index:idx_user_id,priority:1;comment:企业员工id(user表主键)" json:"user_id"` + ProjectID int64 `gorm:"column:project_id;type:bigint;not null;index:idx_project_id,priority:1;comment:项目id" json:"project_id"` +} + +// TableName UserProjectRelate's table name +func (*UserProjectRelate) TableName() string { + return TableNameUserProjectRelate +} diff --git a/internal/repository/mtype/map.go b/internal/repository/mtype/map.go new file mode 100644 index 0000000..7fca057 --- /dev/null +++ b/internal/repository/mtype/map.go @@ -0,0 +1,233 @@ +package mtype + +// BehaviorTypeToMark 行为类型对应的标识 +var BehaviorTypeToMark = map[int32]string{ + FissionBehaviorTypeView: FissionBehaviorMarkView, // 访问链接行为 + FissionBehaviorTypeClickPlay: FissionBehaviorMarkClickPlay, // 活动分享按钮点击行为 + FissionBehaviorTypeClickShare: FissionBehaviorMarkClickShare, // 浏览下载页行为 + FissionBehaviorTypeViewDownload: FissionBehaviorMarkViewDownload, // 点击下载按钮行为 + FissionBehaviorTypeClickDownload: FissionBehaviorMarkClickDownload, // 浏览微信页行为 + FissionBehaviorTypeViewWechat: FissionBehaviorMarkViewWechat, // 用户安装app行为 + FissionBehaviorTypeAppInstall: FissionBehaviorMarkAppInstall, // 用户打开app行为 + FissionBehaviorTypeAppOpen: FissionBehaviorMarkAppOpen, // 浏览从微信页过来的下载页行为 + FissionBehaviorTypeViewDownloadByWx: FissionBehaviorMarkViewDownloadByWx, // 浏览从微信页过来的下载页行为 + FissionBehaviorTypeAppRegister: FissionBehaviorMarkAppRegister, // 用户打开app注册 + FissionBehaviorTypeCustom: FissionBehaviorMarkCustom, // 自定义行为 + FissionBehaviorTypeFinishTask: FissionBehaviorMarkFinishTask, // 完成任务行为 + FissionBehaviorTypeFinishCond: FissionBehaviorMarkFinishCond, // 完成活动条件行为 + FissionBehaviorTypeClickMedia: FissionBehaviorMarkClickMedia, // 点击社媒 + FissionBehaviorTypeChannelView: FissionBehaviorMarkChannelView, // 访问渠道 + FissionBehaviorTypeChannelOpen: FissionBehaviorMarkChannelOpen, // 用户有渠道打开app行为 + FissionBehaviorTypeChannelInstall: FissionBehaviorMarkChannelInstall, // 用户有渠道安装app行为 + FissionBehaviorTypeViewHot: FissionBehaviorMarkViewHot, // 浏览预热活动页行为 + FissionBehaviorTypeClickIcon: FissionBehaviorMarkClickIcon, // 点击图标行为 + FissionBehaviorTypeViewWeb: FissionBehaviorMarkViewWeb, // 访问站外活动行为 + FissionBehaviorTypeSign: FissionBehaviorMarkSign, // 用户签到行为 + FissionBehaviorTypeSignTarget: FissionBehaviorMarkSignTarget, // 用户签到达标行为 + FissionBehaviorTypeSignCard: FissionBehaviorMarkSignCard, // 用户补签行为 + FissionBehaviorTypeGrow: FissionBehaviorMarkGrow, // 用户领养行为 + FissionBehaviorTypeGrowOk: FissionBehaviorMarkGrowOk, // 用户养殖成功行为 + FissionBehaviorTypeRewardWeb: FissionBehaviorMarkRewardWeb, // 站外获取奖品 + FissionBehaviorTypeRewardApp: FissionBehaviorMarkRewardApp, // 站内领取奖品 + FissionBehaviorTypeWebFirstOpen: FissionBehaviorMarkWebFirstOpen, // web首次打开 + FissionBehaviorTypePurchase: FissionBehaviorMarkPurchase, // 支付事件 +} + +// BehaviorMarkToType 行为标识对应的类型 +var BehaviorMarkToType = map[string]int32{ + FissionBehaviorMarkView: FissionBehaviorTypeView, // 访问链接行为 + FissionBehaviorMarkClickPlay: FissionBehaviorTypeClickPlay, // 活动分享按钮点击行为 + FissionBehaviorMarkClickShare: FissionBehaviorTypeClickShare, // 浏览下载页行为 + FissionBehaviorMarkViewDownload: FissionBehaviorTypeViewDownload, // 点击下载按钮行为 + FissionBehaviorMarkClickDownload: FissionBehaviorTypeClickDownload, // 浏览微信页行为 + FissionBehaviorMarkViewWechat: FissionBehaviorTypeViewWechat, // 用户安装app行为 + FissionBehaviorMarkAppInstall: FissionBehaviorTypeAppInstall, // 用户打开app行为 + FissionBehaviorMarkAppOpen: FissionBehaviorTypeAppOpen, // 浏览从微信页过来的下载页行为 + FissionBehaviorMarkViewDownloadByWx: FissionBehaviorTypeViewDownloadByWx, // 浏览从微信页过来的下载页行为 + FissionBehaviorMarkAppRegister: FissionBehaviorTypeAppRegister, // 用户打开app注册 + FissionBehaviorMarkCustom: FissionBehaviorTypeCustom, // 自定义行为 + FissionBehaviorMarkFinishTask: FissionBehaviorTypeFinishTask, // 完成任务行为 + FissionBehaviorMarkFinishCond: FissionBehaviorTypeFinishCond, // 完成活动条件行为 + FissionBehaviorMarkClickMedia: FissionBehaviorTypeClickMedia, // 点击社媒 + FissionBehaviorMarkChannelView: FissionBehaviorTypeChannelView, // 访问渠道 + FissionBehaviorMarkChannelOpen: FissionBehaviorTypeChannelOpen, // 用户有渠道打开app行为 + FissionBehaviorMarkChannelInstall: FissionBehaviorTypeChannelInstall, // 用户有渠道安装app行为 + FissionBehaviorMarkViewHot: FissionBehaviorTypeViewHot, // 浏览预热活动页行为 + FissionBehaviorMarkClickIcon: FissionBehaviorTypeClickIcon, // 点击图标行为 + FissionBehaviorMarkViewWeb: FissionBehaviorTypeViewWeb, // 访问站外活动行为 + FissionBehaviorMarkSign: FissionBehaviorTypeSign, // 用户签到行为 + FissionBehaviorMarkSignTarget: FissionBehaviorTypeSignTarget, // 用户签到达标行为 + FissionBehaviorMarkSignCard: FissionBehaviorTypeSignCard, // 用户补签行为 + FissionBehaviorMarkGrow: FissionBehaviorTypeGrow, // 用户领养行为 + FissionBehaviorMarkGrowOk: FissionBehaviorTypeGrowOk, // 用户养殖成功行为 + FissionBehaviorMarkRewardWeb: FissionBehaviorTypeRewardWeb, // 站外获取奖品 + FissionBehaviorMarkRewardApp: FissionBehaviorTypeRewardApp, // 站内领取奖品 + FissionBehaviorMarkWebFirstOpen: FissionBehaviorTypeWebFirstOpen, // web首次打开 + FissionBehaviorMarkPurchase: FissionBehaviorTypePurchase, // 支付事件 +} + +// FissionLangTypeToMark 语种数字标识对应的iso标准 +var FissionLangTypeToMark = map[int8]string{ + FissionLangTypeZh: LangZh, + FissionLangTypeEn: LangEn, + FissionLangTypeRu: LangRu, + FissionLangTypeFr: LangFr, + FissionLangTypePt: LangPt, + FissionLangTypeJa: LangJa, + FissionLangTypeAr: LangAr, + FissionLangTypeDe: LangDe, + FissionLangTypeEs: LangEs, + FissionLangTypeId: LangId, + FissionLangTypeIt: LangIt, + FissionLangTypeTr: LangTr, + FissionLangTypeKo: LangKo, + FissionLangTypeTh: LangTh, + FissionLangTypeZhTw: LangZhTW, + FissionLangTypeVi: LangVi, + FissionLangTypeHu: LangHu, + FissionLangTypeCs: LangCs, + FissionLangTypeNl: LangNl, + FissionLangTypePl: LangPl, + FissionLangTypeRo: LangRo, +} + +// MarkToLangType iso标准对应的语种数字标识 +var MarkToLangType = map[string]int8{ + LangZh: FissionLangTypeZh, + LangEn: FissionLangTypeEn, + LangRu: FissionLangTypeRu, + LangFr: FissionLangTypeFr, + LangPt: FissionLangTypePt, + LangJa: FissionLangTypeJa, + LangAr: FissionLangTypeAr, + LangDe: FissionLangTypeDe, + LangEs: FissionLangTypeEs, + LangId: FissionLangTypeId, + LangIt: FissionLangTypeIt, + LangTr: FissionLangTypeTr, + LangKo: FissionLangTypeKo, + LangTh: FissionLangTypeTh, + LangZhTW: FissionLangTypeZhTw, + LangVi: FissionLangTypeVi, + LangHu: FissionLangTypeHu, + LangCs: FissionLangTypeCs, + LangNl: FissionLangTypeNl, + LangPl: FissionLangTypePl, + LangRo: FissionLangTypeRo, +} + +// FissionLangTypeTextType 语种数字标识对应的字体模版 +var FissionLangTypeTextType = map[int8]int8{ + FissionLangTypeZh: FissionTempTextTypeZh, + FissionLangTypeZhTw: FissionTempTextTypeZh, + FissionLangTypeEn: FissionTempTextTypeEn, + FissionLangTypeRu: FissionTempTextTypeEn, + FissionLangTypeFr: FissionTempTextTypeEn, + FissionLangTypePt: FissionTempTextTypeEn, + FissionLangTypeJa: FissionTempTextTypeZh, + FissionLangTypeAr: FissionTempTextTypeAr, + FissionLangTypeDe: FissionTempTextTypeEn, + FissionLangTypeEs: FissionTempTextTypeEn, + FissionLangTypeId: FissionTempTextTypeEn, + FissionLangTypeIt: FissionTempTextTypeEn, + FissionLangTypeTr: FissionTempTextTypeEn, + FissionLangTypeKo: FissionTempTextTypeZh, + FissionLangTypeTh: FissionTempTextTypeEn, + FissionLangTypeVi: FissionTempTextTypeEn, + FissionLangTypeHu: FissionTempTextTypeEn, + FissionLangTypeCs: FissionTempTextTypeEn, + FissionLangTypeNl: FissionTempTextTypeEn, + FissionLangTypePl: FissionTempTextTypeEn, + FissionLangTypeRo: FissionTempTextTypeEn, +} + +// FissionDiceRecordClumpMap 大富翁骰子记录集合对照map +var FissionDiceRecordClumpMap = map[int32][]string{ + FissionDiceRecordClumpRoll: { + FissionDiceRecordMarkRoll, + FissionDiceRecordMarkGetRollAll, + FissionDiceRecordMarkGetRollTask, + FissionDiceRecordMarkRollChance, + FissionDiceRecordMarkLucky, + FissionDiceRecordMarkGetLucky, + FissionDiceRecordMarkRollCollect, + FissionDiceRecordMarkSign, + FissionDiceRecordMarkGetRollRegister, + FissionDiceRecordMarkGetRollInstall, + FissionDiceRecordMarkLuckyChance, + FissionDiceRecordMarkLuckyCollect, + FissionDiceRecordMarkGetRollSys, + FissionDiceRecordMarkPointsUse, + }, + FissionDiceRecordClumpReward: { + FissionDiceRecordMarkRollCollect, + FissionDiceRecordMarkReward, + FissionDiceRecordMarkLuckyCollect, + }, +} + +var FissionUserSource = map[int8]string{ + FissionUserSourceVisit: "访问活动", + FissionUserSourceOpen: "打开事件", + FissionUserSourceInstall: "安装事件", + FissionUserSourceRegister: "注册事件", + FissionUserSourceCustom: "自定义事件", + FissionUserSourceDynamic: "动态下载页生成", + FissionUserSourceWebFirstOpen: "网页端首次打开", + FissionUserSourcePay: "支付事件", +} + +var FissionRewardRecordStatus = map[int8]string{ + FissionRewardRecordStatusSuccess: "成功", + FissionRewardRecordStatusWait: "待发奖", + FissionRewardRecordStatusFail: "失败", + FissionRewardRecordStatusManual: "手动发放", + FissionRewardRecordStatusWaitForm: "待提交表单", + FissionRewardRecordStatusSubmitForm: "已提交表单", +} + +var FissionCoinLogType = map[int8]string{ + FissionCoinLogTypeAdd: "领取", + FissionCoinLogTypeUse: "扣除", +} + +var FissionCoinLogSource = map[string]string{ + FissionCoinLogSourceGetExpired: "过期未领取", + FissionCoinLogSourceGetOk: "领取成功", + FissionCoinLogSourcePutIn: "扣除成功", +} + +var FissionCampaignRewardTypeTitle = map[int8]string{ + FissionCampaignRewardTypeChild: "子活动奖品", + FissionCampaignRewardTypeApp: "活动奖", + FissionCampaignRewardTypeTask: "任务奖", + FissionCampaignRewardTypeExtra: "额外奖", + FissionCampaignRewardTypeNewcomer: "新人奖", + FissionCampaignRewardTypeGrowStep: "阶梯奖", + FissionCampaignRewardTypeWeb: "站外奖", + FissionCampaignRewardTypeExchange: "积分兑换奖", +} + +var LangChineseTitle = map[string]string{ + LangZh: "中文", + LangEn: "英文", + LangRu: "俄语", + LangFr: "法语", + LangPt: "葡萄牙语", + LangJa: "日语", + LangAr: "阿拉伯语", + LangDe: "德语", + LangEs: "西班牙语", + LangId: "印尼语", + LangIt: "意大利语", + LangTr: "土耳其语", + LangKo: "韩语", + LangTh: "泰语", + LangZhTW: "繁体中文", + LangVi: "越南语", + LangHu: "匈牙利语", + LangCs: "捷克语", + LangNl: "荷兰语", + LangPl: "波兰语", + LangRo: "罗马尼亚语", +} diff --git a/internal/repository/mtype/mtype.go b/internal/repository/mtype/mtype.go new file mode 100644 index 0000000..6c53d61 --- /dev/null +++ b/internal/repository/mtype/mtype.go @@ -0,0 +1,1102 @@ +package mtype + +// 是与否的字段 +const ( + No = iota //不是 + Yes //是 +) + +const ( + RegisterAuditTypeWait = iota + 1 //待通过 + RegisterAuditTypePass //通过 + RegisterAuditTypeReject //拒绝 +) + +const ( + FissionCampaignStatusWait = iota + 1 //待发布 + FissionCampaignStatusPub //已发布 + FissionCampaignStatusCancel //已下线 + FissionCampaignStatusPubPre //已发布,预发布 +) + +const ( + FissionCampaignChildTypeInvite = iota + 1 // 邀请竞赛 + FissionCampaignChildTypeSign // 签到 + FissionCampaignChildTypeLucky // 抽奖 + FissionCampaignChildTypeBlind // 盲盒 + FissionCampaignChildTypeTask // 任务 +) + +const ( + FissionTotalCycleTypeHour = iota + 1 //小时统计 + FissionTotalCycleTypeDay //天统计 +) + +const ( + FissionUserTypeVisitor = iota + 1 //访客 + FissionUserTypePlay //参与用户 +) + +const ( + FissionReferralRewardRuleStep = iota + 1 //阶梯规则 + FissionReferralRewardRuleCycle //循环发放规则 +) + +const ( + FissionReferralLimitStatusNone = iota //没有限制 + FissionReferralLimitStatusFinish //完成了所有阶段任务 + FissionReferralLimitStatusBudget //总预算限制 + FissionReferralLimitStatusInvite //总邀请数限制 +) + +const ( + FissionBehaviorTypeView = iota + 1 // 访问链接行为 + FissionBehaviorTypeClickPlay // 活动按钮点击行为 + FissionBehaviorTypeClickShare // 活动分享按钮点击行为 + FissionBehaviorTypeViewDownload // 浏览下载页行为 + FissionBehaviorTypeClickDownload // 点击下载按钮行为 + FissionBehaviorTypeViewWechat // 浏览微信页行为 + FissionBehaviorTypeAppInstall // 用户安装app行为 + FissionBehaviorTypeAppOpen // 用户打开app行为 + FissionBehaviorTypeViewDownloadByWx // 浏览从微信页过来的下载页行为 + FissionBehaviorTypeAppRegister // 用户注册app行为 + FissionBehaviorTypeCustom // 自定义行为 + FissionBehaviorTypeFinishTask // 完成任务行为 + FissionBehaviorTypeFinishCond // 完成活动条件行为 + FissionBehaviorTypeClickMedia // 点击社媒 + FissionBehaviorTypeChannelView // 访问渠道 + FissionBehaviorTypeChannelOpen // 用户有渠道打开app行为 + FissionBehaviorTypeChannelInstall // 用户有渠道安装app行为 + FissionBehaviorTypeViewHot // 浏览预热活动页行为 + FissionBehaviorTypeClickIcon // 点击图标行为 + FissionBehaviorTypeViewWeb // 访问站外链接行为 + FissionBehaviorTypeSign // 用户签到行为 + FissionBehaviorTypeSignTarget // 用户签到达标行为 + FissionBehaviorTypeSignCard // 用户补签行为 + FissionBehaviorTypeGrow // 用户领养行为 + FissionBehaviorTypeGrowOk // 用户养成行为 + FissionBehaviorTypeRewardWeb // 站外获取奖品 + FissionBehaviorTypeRewardApp // 站内领取奖品 + FissionBehaviorTypeWebFirstOpen // WEB首次打开 + FissionBehaviorTypePurchase // 用户支付 +) + +const ( + FissionBehaviorMarkView = "view" // 访问活动 + FissionBehaviorMarkClickPlay = "click_play" // 按钮点击(活动中玩的按钮) + FissionBehaviorMarkClickShare = "click_share" // 点击分享按钮 + FissionBehaviorMarkViewDownload = "view_download" // 浏览下载页 + FissionBehaviorMarkClickDownload = "click_download" // 点击下载按钮 + FissionBehaviorMarkViewWechat = "view_wechat" // 浏览微信页 + FissionBehaviorMarkAppInstall = "app_install" // app安装 + FissionBehaviorMarkAppRegister = "app_register" // app注册 + FissionBehaviorMarkAppOpen = "app_open" // app打开 + FissionBehaviorMarkViewDownloadByWx = "view_download_by_wx" // 浏览微信来源的下载页 + FissionBehaviorMarkCustom = "custom" // 触发自定义事件 + FissionBehaviorMarkFinishTask = "finish_task" // 完成任务(活动条件达标) + FissionBehaviorMarkFinishCond = "finish_cond" // 完成活动某个条件 + FissionBehaviorMarkClickMedia = "click_media" // 点击活动某个社媒 + FissionBehaviorMarkChannelView = "channel_view" // 访问某个渠道 + FissionBehaviorMarkChannelOpen = "channel_open" // 某个渠道打开app行为 + FissionBehaviorMarkChannelInstall = "channel_install" // 某个渠道安装app行为 + FissionBehaviorMarkViewHot = "view_hot" // 浏览预热活动页 + FissionBehaviorMarkClickIcon = "click_icon" // 点击某个图标 + FissionBehaviorMarkViewWeb = "view_web" // 访问站外活动 + FissionBehaviorMarkSign = "sign" // 用户签到行为 + FissionBehaviorMarkSignTarget = "sign_target" // 用户签到达标行为 + FissionBehaviorMarkSignCard = "sign_card" // 用户补签行为 + FissionBehaviorMarkGrow = "grow" // 用户领养行为 + FissionBehaviorMarkGrowOk = "grow_ok" // 用户养殖成功行为 + FissionBehaviorMarkRewardWeb = "reward_web" // 站外获取奖品 + FissionBehaviorMarkRewardApp = "reward_app" // 站内领取奖品 + FissionBehaviorMarkWebFirstOpen = "web_first_open" // WEB首次打开 + FissionBehaviorMarkPurchase = "purchase" // 用户支付 +) + +const ( + FissionStatOtherNoChanceClickBtn = "no_chance_click_btn" //用户没有抽奖次数点击互动按钮次数 + FissionStatOtherNoChanceClickBtnUser = "no_chance_click_btn_user" //用户没有抽奖次数点击互动按钮人数 + FissionStatOtherInviteShow = "invite_show" //拉起邀请框次数 + FissionStatOtherInviteShowUser = "invite_show_user" //拉起邀请框人数 +) + +const ( + FissionNotifyTypeServer = iota + 1 //服务端推送 + FissionNotifyTypeClient //客户端监听 +) + +const ( + FissionCampaignQuizRewardRuleVote = iota + 1 //投票赢奖 + FissionCampaignQuizRewardRuleRight //正确答案领奖 +) + +const ( + FissionCampaignQuizOpenTypeWait = iota + 1 //等待开奖 + FissionCampaignQuizOpenTypeOpen //已开奖 + FissionCampaignQuizOpenTypeNone //不开奖(当所有选项都没有被投票的时候就不开奖) +) + +const ( + FissionCampaignChannelTypeApp = iota + 1 //站内渠道 + FissionCampaignChannelTypeWeb //站外渠道 +) + +const ( + FissionStatChannelClick = "click_num" //点击链接|预览页面 + FissionStatChannelInstall = "install_num" //安装数 + FissionStatChannelOpen = "open_num" //打开app +) + +const ( + FissionUserSourceVisit = iota + 1 // 直接访问 + FissionUserSourceOpen // 打开事件 + FissionUserSourceInstall // 安装事件 + FissionUserSourceRegister // 注册事件 + FissionUserSourceCustom // 自定义事件 + FissionUserSourceDynamic // 动态下载页链接 + FissionUserSourceWebFirstOpen // 网页端首次打开 + FissionUserSourcePay // 支付事件 +) + +const ( + FissionCampaignConfigTargetApp = iota + 1 // app下载/注册 + FissionCampaignConfigTargetUp // 提升关键指标转化率 + FissionCampaignConfigTargetRetain // app活跃/留存 + FissionCampaignConfigTargetAdsGame // 广告互动 + FissionCampaignConfigTargetChild // 子活动 +) + +const ( + FissionCampaignConfigTargetOptionApp = iota + 1 // app下载/注册 + FissionCampaignConfigTargetOptionFriend // 好友完成指定事件 + FissionCampaignConfigTargetOptionSelf // 指定事件达标 + FissionCampaignConfigTargetOptionUse // 拉充值/积分消耗 + FissionCampaignConfigTargetOptionTask // 用户完成指定任务 +) + +const ( + FissionCampaignConfigTargetAppEventInstall = iota + 1 // 安装 + FissionCampaignConfigTargetAppEventRegister // 注册 +) + +const ( + FissionCampaignConfigTargetBothTypeAll = iota + 1 // 所有条件满足 + FissionCampaignConfigTargetBothTypeOne //任一条件满足 +) + +const ( + FissionCampaignConfigPlayTypeContinue = iota + 1 // 连续签到 + FissionCampaignConfigPlayTypeSign //次数签到 +) + +const ( + FissionCampaignConfigPlayTypeRand = iota + 1 // 随机 + FissionCampaignConfigPlayTypeRate // 概率 +) + +const ( + FissionCampaignCondIfCondEq = iota + FissionCampaignCondIfCondGte + FissionCampaignCondIfCondTotal +) + +const ( + FissionCampaignRewardTypeApp = iota + 1 // 活动主奖品 + FissionCampaignRewardTypeWeb // 站外活动奖品 + FissionCampaignRewardTypeExtra // 额外奖品 + FissionCampaignRewardTypeNewcomer // 新人奖 + FissionCampaignRewardTypeGrowStep // 养成阶段奖励 + FissionCampaignRewardTypeTask // 任务奖励 + FissionCampaignRewardTypeChild // 子活动 + FissionCampaignRewardTypeExchange // 兑换 + FissionCampaignRewardTypeCampaignEvent // 活动事件 +) + +const ( + FissionCampaignRewardPropMarkReward = "reward" // 奖品库奖品 + FissionCampaignRewardPropMarkChance = "chance" // 活动道具 + FissionCampaignRewardPropMarkPoint = "point" // 积分 +) + +const ( + FissionCampaignRewardCollectRuleResetNone = iota + 1 // 不重置 + FissionCampaignRewardCollectRuleResetGet //领奖后重置 +) + +const ( + FissionRewardRecordStatusSuccess = iota + 1 // 发送成功 + FissionRewardRecordStatusWait // 待发送 + FissionRewardRecordStatusFail // 发送失败 + FissionRewardRecordStatusManual // 手动发放 + FissionRewardRecordStatusWaitForm // 待填写表单 + FissionRewardRecordStatusSubmitForm // 已填写表单 +) + +const ( + FissionRewardRecordFailTypeSys = "system" // 系统错误 + FissionRewardRecordFailTypeCli = "client" // 客户端错误 + FissionRewardRecordFailTypeUndefined = "undefined" // 未定义错误 + FissionRewardRecordFailTypeIneligible = "ineligible" // 不符合条件 +) + +const ( + FissionRewardRecordFailTypeCliLackMsg = "库存不足" + FissionRewardRecordFailTypeCliRule = "超过设置的可领取最大奖品数" + FissionRewardRecordFailTypeNotInstall = "用户非新下载,无法领奖" + FissionRewardRecordFailTypeLongTime = "已超时发放,建议手动补发" +) + +const ( + FissionArchiveTaskMarkCampaignHour = "campaign_hour" // 活动按小时归档 + FissionArchiveTaskMarkCampaignDay = "campaign_day" // 活动按天归档 + FissionArchiveTaskMarkCondHour = "cond_hour" // 条件按小时归档 + FissionArchiveTaskMarkCondDay = "cond_day" // 条件按天归档 + FissionArchiveTaskMarkAdsHour = "ads_hour" // 广告按小时归档 + FissionArchiveTaskMarkAdsDay = "ads_day" // 广告按天归档 +) + +const FissionNotifyPushNumMax int32 = 5 // 回调最大次数 + +const ( + ProjectSceneApp = iota + 1 // App端 + ProjectSceneWeb // Web端 +) + +const ( + FissionUserDyLinkMediaTypeImgText = "ImageText" // 图文 +) + +const ( + FissionCampaignSignTypeNormal = iota + 1 // 普通签到 + FissionCampaignSignTypeStep // 阶梯签到 + FissionCampaignSignTypeCycle // 周期签到 +) + +const ( + FissionCampaignRecycleTypeContinue = iota + 1 // 断签重签 + FissionCampaignRecycleTypeCycle // 周期重签 +) + +const ( + FissionSignTypeOk = iota + 1 // 正常签到 + FissionSignTypeMiss // 漏签 + FissionSignTypeRemedy // 补签 +) + +const ( + FissionDicePropMarkChance = "chance" + FissionDicePropMarkFixedRoll = "fixed_roll" +) + +// 格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几) +const ( + FissionDiceMapMarkTypeNone = iota + FissionDiceMapMarkTypeNormal + FissionDiceMapMarkTypeSuper + FissionDiceMapMarkTypeChance + FissionDiceMapMarkTypeFixedRoll +) + +const ( + FissionGrowRecordFeed = "feed" //喂养 + FissionGrowRecordGetGrow = "get_grow" //领取生命体 + FissionGrowRecordLvUp = "lv_up" //升级 + FissionGrowRecordGetReward = "get_reward" //领奖 + FissionGrowRecordGetDie = "die" //死亡 + FissionGrowRecordGetRevive = "revive" //复活 +) + +const ( + LibraryQaMarkImageText = "image_text" //图文 + LibraryQaMarkAudio = "audio" //视频 + LibraryQaMarkVideo = "video" //音频 +) + +const ( + FissionUserCtLinkMarkQa = "qa" + FissionUserCtLinkMarkBallot = "ballot" + FissionUserCtLinkMarkChop = "Chop" +) + +const ( + ExportTaskEptStatusDoing = iota + 1 //导出中 + ExportTaskEptStatusOk //导出成功 + ExportTaskEptStatusFail //导出失败 +) + +const ( + ExportTaskMarkCampaignReport = "campaign_report" // 活动报告导出 + ExportTaskMarkFissionUser = "fission_user" // 活动用户导出 + ExportTaskMarkFissionRewardRecord = "fission_reward_record" // 活动奖品导出 + ExportTaskMarkFissionUserStat = "fission_user_stat" // 活动排行榜导出 + ExportTaskMarkAdsTable = "ads_table" // ads报表数据导出 + ExportTaskMarkNewUserList = "new_user_list" // 新版用户列表 + ExportTaskMarkCoinRecord = "coin_record" // 金币池领扣记录 + ExportTaskMarkChildList = "child_list" // 子活动用户列表 +) + +const ( + FissionCampaignRewardHelpMarkInstall = "install" //安装 + FissionCampaignRewardHelpMarkOpen = "open" //打开 + FissionCampaignRewardHelpMarkClick = "click" //点击 + FissionCampaignRewardHelpMarkRegister = "register" //注册 +) + +const ( + FissionLangTypeZh = iota + 1 //中文 + FissionLangTypeEn //英文 + FissionLangTypeRu //俄语 + FissionLangTypeFr //法语 + FissionLangTypePt //葡萄牙语 + FissionLangTypeJa //日语 + FissionLangTypeAr //阿拉伯语 + FissionLangTypeDe //德语 + FissionLangTypeEs //西班牙语 + FissionLangTypeId //印尼语 + FissionLangTypeIt //意大利语 + FissionLangTypeTr //土耳其语 + FissionLangTypeKo //韩语 + FissionLangTypeTh //泰语 + FissionLangTypeZhTw //繁体中文 + FissionLangTypeVi //越南语 + FissionLangTypeHu //匈牙利语 + FissionLangTypeCs //捷克语 + FissionLangTypeNl //荷兰语 + FissionLangTypePl //波兰语 + FissionLangTypeRo //罗马尼亚语 +) + +// 国际语言标识(ISO 639-1代码) +const ( + LangZh = "zh" + LangEn = "en" + LangRu = "ru" + LangFr = "fr" + LangPt = "pt" + LangJa = "ja" + LangAr = "ar" + LangDe = "de" + LangEs = "es" + LangId = "id" + LangIt = "it" + LangTr = "tr" + LangKo = "ko" + LangTh = "th" + LangZhTW = "zh-TW" + LangVi = "vi" + LangHu = "hu" + LangCs = "cs" + LangNl = "nl" + LangPl = "pl" + LangRo = "ro" +) + +const ( + FissionTempTextTypeZh = iota + 1 // 汉字模版 + FissionTempTextTypeEn // 拉丁系模版 + FissionTempTextTypeAr // 阿拉伯模板 +) + +const ( + FissionRewardGroupNormal = iota + 1 // 常规分组 + FissionRewardGroupUserLevel // 用户类型分组 + FissionRewardGroupLang // 语言分组 + FissionRewardGroupLangAndUserLevel // 语言+用户类型分组 + FissionRewardGroupCountry // 国家 +) + +const ( + RewardReceiveTypeNone = iota // 无操作 + RewardReceiveTypeNotify // 回调 + RewardReceiveTypeContact // 联系方式发放 + RewardReceiveTypeClient // 客户端回调推送 + RewardReceiveTypeForm // 提交表单 +) + +const ( + FissionCampaignTaskTypeInstall = iota + 1 // 安装 + FissionCampaignTaskTypeRegister // 注册 + FissionCampaignTaskTypeCondAll // 完成所有事件 + FissionCampaignTaskTypeCondOne // 完成一个事件 + FissionCampaignTaskTypeOpen // 打开 + FissionCampaignTaskTypeClick // 点击邀请链接 +) + +const ( + FissionCampaignTaskMarkInstall = "install" // 安装 + FissionCampaignTaskMarkRegister = "register" // 注册 + FissionCampaignTaskMarkCondAll = "cond_all" // 完成所有事件 + FissionCampaignTaskMarkCondOne = "cond_one" // 完成一个事件 + FissionCampaignTaskMarkRewardOne = "reward_one" // 奖品对应的事件 +) + +const ( + FissionCampaignTaskPropMarkChance = "chance" // 玩法通用道具,一个玩法没有多种道具的时候就用这个标识 (抽奖次数、骰子个数、喂养道具、助力进度) + FissionCampaignTaskPropMarkFixedRoll = "fixed_roll" // 幸运骰子 + FissionCampaignTaskPropMarkRevive = "revive" // 复活生命体 + FissionCampaignTaskPropMarkReward = "reward" // 奖品 + FissionCampaignTaskPropMarkPoint = "point" // 积分 + FissionCampaignTaskPropMarkUnoThree = "uno_three" // uno +3道具牌 + FissionCampaignTaskPropMarkUnoFive = "uno_five" // uno +5道具牌 + FissionCampaignTaskPropMarkUnoFix = "uno_fix" // uno 固定颜色道具牌 + FissionCampaignTaskPropMarkUnlockReward = "unlock_reward" // 解锁 +) + +const ( + OperateLogMarkUpdateRunningStock = "update_running_stock" // 更新活动奖品库存 + OperateLogMarkUpdateRunningOdds = "update_running_odds" // 更新活动奖品概率 + OperateLogMarkUpdateRunningInitPercent = "update_running_init_percent" // 更新活动奖品的初始助力进度 + OperateLogMarkUpdateRunningDiceInit = "update_running_dice_init" // 更新活动奖品大富翁初始化次数 + OperateLogMarkUpdateRunningDiceDay = "update_running_dice_day" // 更新活动奖品大富翁每日次数 + OperateLogMarkUpdateRunningCashStock = "update_running_cash_stock" // 更新现金抽奖库存 + OperateLogMarkUpdateRunningGoldStock = "update_running_gold_stock" // 更新金币任务库存 + OperateLogMarkUpdateRunningRewardRule = "update_running_reward_rule" // 更新奖品限制规则 + OperateLogMarkUpdateRunningAdsStrategy = "update_running_ads_strategy" // 更新更新广告策略 + OperateLogMarkUpdateCampaignAdsType = "update_campaign_ads_type" // 更新活动广告类型 + OperateLogMarkProjectAds = "project_ads" // 更新项目广告 + OperateLogMarkProjectCpnAds = "project_cpn_ads" // 更新项目活动广告 + OperateLogMarkTaskLimitRule = "task_limit_rule" // 更新任务限制规则 + OperateLogMarkUpdateRunningTriggetType = "update_running_trigget_type" // 更新监听方式 + OperateLogMarkCampaignSave = "campaign_save" // 活动保持动作 +) + +const ( + FissionCampaignTicketFixed = "fixed" // 固定事件 + FissionCampaignTicketCustom = "custom" // 自定义事件 + FissionCampaignTicketRewardHelp = "reward_help" // 奖品助力 +) + +const ( + FissionCampaignTicketHelpEventInstall = "help_install" // 安装助力 + FissionCampaignTicketHelpEventRegister = "help_register" // 注册助力 + FissionCampaignTicketHelpEventOpen = "help_open" // 打开助力 + FissionCampaignTicketHelpEventClick = "help_click" // 点击助力 +) + +const ( + FissionCampaignTicketAppEventInstall = iota + 1 // 安装 + FissionCampaignTicketAppEventRegister // 注册 +) + +const ( + FissionCampaignTicketPreEventNone = iota // 任意 + FissionCampaignTicketPreEventInstall // 安装 + FissionCampaignTicketPreEventRegister // 注册 +) + +const ( + FissionCampaignTicketBothTypeAll = iota + 1 // 所有条件满足 + FissionCampaignTicketBothTypeOne //任一条件满足 +) + +const ( + FissionCashNextStepNone = "none" // 没有节点需要完成了 + FissionCashNextStepOpenGift = "open_gift" // 开礼品盒 + FissionCashNextStepTriggerShare = "trigger_share" // 用户触发分享 + FissionCashNextStepShowReward = "show_reward" // 展示奖品 + FissionCashNextStepLastSpin = "last_spin" // 弹窗还差最后一次抽奖获得奖品 + FissionCashNextStepInviteSpin = "invite_spin" // 按钮提示还差最后一次抽奖获得奖品 +) + +const ( + FissionCashRecordTypeInvite = iota + 1 // 邀请记录 + FissionCashRecordTypeCash // 金额记录 + FissionCashRecordTypeEnergy // 能量记录 + FissionCashRecordTypeReward // 领奖记录 +) + +const ( + FissionCashRecordDataDec = "dec" + FissionCashRecordDataAdd = "add" +) + +const ( + FissionDiceRecordMarkRoll = "roll" // 掷骰子 + FissionDiceRecordMarkGetRollAll = "get_roll_all" // 完成所有任务获得骰子 + FissionDiceRecordMarkGetManualRollAll = "get_manual_roll_all" // 手动领取完成所有任务获得骰子 + FissionDiceRecordMarkGetRollTask = "get_roll_task" // 完成任务获得骰子 + FissionDiceRecordMarkGetManualRollTask = "get_manual_roll_task" // 手动领取完成任务获得骰子 + FissionDiceRecordMarkGetRollRegister = "get_roll_register" // 完成好友注册任务获得骰子 + FissionDiceRecordMarkGetRollInstall = "get_roll_install" // 完成邀请好友下载获得骰子 + FissionDiceRecordMarkRollCollect = "roll_collect" // 获得碎片 + FissionDiceRecordMarkRollChance = "roll_chance" // 再来一次 + FissionDiceRecordMarkLucky = "lucky" // 使用幸运骰 + FissionDiceRecordMarkLuckyChance = "lucky_chance" // 使用幸运骰获得再来一次 + FissionDiceRecordMarkLuckyCollect = "lucky_collect" // 使用幸运骰活动碎片 + FissionDiceRecordMarkGetLucky = "get_lucky" // 获得幸运骰 + FissionDiceRecordMarkReward = "reward" // 获得奖品 + FissionDiceRecordMarkSign = "sign" // 签到获得骰子 + FissionDiceRecordMarkGetRollSys = "get_roll_sys" // 参与活动初始次数 + FissionDiceRecordMarkPointsUse = "points_use" // 使用积分 +) + +const ( + FissionDiceRecordClumpRoll = iota + 1 // 骰子记录集合 + FissionDiceRecordClumpReward // 奖励记录集合 +) + +const ( + FissionCampaignCondTriggerTypeClick = iota + 1 //点击去完成 + FissionCampaignCondTriggerTypeGlobal // 全局监听 + FissionCampaignCondTriggerTypePage // 进入页面监听 +) + +const ( + FissionActionTypeView = iota + 1 // 访问活动行为 + FissionActionTypeAppInstall // 用户安装app行为 + FissionActionTypeAppOpen // 用户打开app行为 + FissionActionTypeAppRegister // 用户注册app行为 + FissionActionTypeClickPlay // 活动按钮点击行为 + FissionActionTypeClickShare // 活动分享按钮点击行为 + FissionActionTypeViewDownload // 浏览下载页行为 + FissionActionTypeClickDownload // 点击下载按钮行为 + FissionActionTypeViewWechat // 浏览微信页行为 + FissionActionTypeClickCond // 点击去完成活动条件行为 + FissionActionTypeFinishCond // 完成活动条件行为 + FissionActionTypeViewWeb // 访问站外链接行为 + FissionActionTypeClickPlayWeb // 活动站外按钮点击行为 + FissionActionTypeSign // 用户每日签到行为 + FissionActionTypeUseProp // 用户使用道具行为 + FissionActionTypeGrow // 用户领养行为 + FissionActionTypeWebToApp // 站外引流到了站内 + FissionActionTypeToUse // 去使用按钮 + FissionActionTypeClickLongImg // 点击长图 + FissionActionTypeFinishTask // 完成任务 + FissionActionTypeClickMyTask // 点击我的任务弹窗 + FissionActionTypeClickMyReward // 点击奖励记录 + FissionActionTypeClickRule // 点击规则 + FissionActionTypeFormShow // 打开填写表单页 + FissionActionTypeFormSubmit // 填写表单页 + FissionActionTypeCopyContact // 复制客服联系方式 + FissionActionTypeInAppOpenLink // 站内打开链接 + FissionActionTypeReward // 获得一个奖品 + FissionActionTypeShowWindow // 展示弹窗 + FissionActionTypeGrowOk // 用户养成行为 + FissionActionTypeAnswerQa // 回答问题 + FissionActionTypeSubmitQa // 提交答卷 + FissionActionTypeSelectReward // 选择奖品 + FissionActionTypeHelp // 用户助力行为 + FissionActionTypeNewcomer // 用户完成新人任务 + FissionActionTypeWebFirstOpen // 用户首次打开web活动行为 + FissionActionTypeClickFlip // 点击立即翻牌 + FissionActionTypeUseCoin // 投放金币 + FissionActionTypeGetCoin // 领取金币 + FissionActionTypeClickCustomBtn // 点击自定义按钮 + FissionActionTypePay // 支付 + FissionActionTypeClickChild // 点击子活动入口 + FissionActionTypeJoinChild // 参与了子活动 + FissionActionTypeChildShow // 子活动入口打开 + FissionActionTypeChildSign // 子活动签到 + FissionActionTypeChildLottery // 子活动抽奖 + FissionActionTypeChildInvite // 子活动邀请成功 + FissionActionTypeChildGetReward // 子活动获得奖品 + FissionActionTypePointsUse // 积分使用行为 + FissionActionTypeManualTask // 手动领取任务奖励 + FissionActionTypeClickShareLink // 分享连接点击 + FissionActionTypeCenterDrainage // 任务中心引流 + FissionActionTypeClickChat // 进入ai对话 + FissionActionTypeVsVote // 赛事竞猜投票行为 + FissionActionTypeVsAcceptReward // 赛事竞猜领奖 + FissionActionTypeMallRedeem // 兑换积分商城商品 + FissionActionTypeClickUnoCard // 点击uno自定义卡 + FissionActionTypeCollectUnoCard // 集齐uno卡牌 + FissionActionTypeVsWin // 赛事竞猜比赛获胜 + FissionActionTypeGetProp // 用户获取道具行为 + FissionActionTypeUnlockReward // 用户解锁奖励行为 +) + +const ( + FissionActionDimensionPlatformKey = "platform" + FissionActionDimensionChannelKey = "channel_id" + FissionActionDimensionLangKey = "lang" + FissionActionDimensionUserLvKey = "user_lv" + FissionActionDimensionCountryKey = "country" + FissionActionDimensionCondKey = "cond_id" + FissionActionDimensionMediaKey = "media_id" + FissionActionDimensionRewardKey = "reward_id" + FissionActionDimensionDownloadFromKey = "download_from" + FissionActionDimensionImgUrlKey = "img_url" + FissionActionDimensionFromKey = "from" +) + +const ( + FissionActionUserMarkSourceFissionUser = iota + 1 // 用户表id + FissionActionUserMarkSourceUaWebId // 浏览器id + FissionActionUserMarkSourceChild // 子活动 +) + +const ( + FissionCampaignReportTypeOld = iota + 1 // 旧站内活动报表 + FissionCampaignReportTypeNew // 新站内活动报表 +) + +const ( + FissionUserAttrMarkPlatform = "platform" // 操作系统 + FissionUserAttrMarkLang = "lang" // 用户语言 + FissionUserAttrMarkUserLv = "user_lv" // 用户类型 + FissionUserAttrMarkCountry = "country" // 国家 + FissionUserAttrMarkWebChannel = "web_channel" // 站外渠道 + FissionUserAttrMarkDayFirst = "day_first" // 当天首次有效邀请用户 + FissionUserAttrMarkCustomParam = "custom_param" // 自定义参数 + FissionUserAttrMarkCenter = "center" // 任务中心 + FissionUserAttrMarkCenterModule = "center_module" // 任务中心模块 +) + +const ( + FissionCampaignConfigAdsTypeClose = iota // 该活动不开启广告 + FissionCampaignConfigAdsTypeProject // 跟随项目配置 + FissionCampaignConfigAdsTypeOpen // 该活动开启广告 +) + +const ( + FissionCampaignCondEventTypeCustom = iota + 1 // 事件来源于自定义事件 + FissionCampaignCondEventTypeAds // 事件来源于广告 + FissionCampaignCondEventTypeStandard // 事件来源于标准事件 +) + +const ( + ProjectAdStatusWait = iota + 1 // 待审核 + ProjectAdStatusTest // 测试阶段 + ProjectAdStatusProd // 生产阶段 +) + +const ( + FissionNewcomerCondInstall = iota + 1 // 新安装 + FissionNewcomerCondHelp // 助力成功 + FissionNewcomerCondInstallAndHelp // 新安装且助力成功 +) + +const ( + FissionCampaignDiceAwardTypeCollect = iota + 1 // 收集碎片 + FissionCampaignDiceAwardTypeOdds // 概率 +) + +const ( + FissionCampaignDiceFixDiceCondInstall = iota + 1 // 安装 + FissionCampaignDiceFixDiceCondRegister // 注册 +) + +const ( + RewardDyRewardTypeNone = iota // 无 + RewardDyRewardTypeCode // 兑换码 +) + +const ( + FissionCampaignChopHelpRuleUniqReward = iota + 1 // 每个行为对每个奖品只能助力一次 + FissionCampaignChopHelpRuleUniqUser // 每个行为的助力一个用户只能生效一次 +) + +const ( + FissionCampaignKeepStepRewardTypeProp = iota + 1 // 成长道具 + FissionCampaignKeepStepRewardTypeReward // 奖品 +) + +const ( + FissionKeepLogTypeLove = iota + 1 // 收集爱心 + FissionKeepLogTypeProp // 收集道具 + FissionKeepLogTypeFeed // 喂养 + FissionKeepLogTypeGuided // 引导 + FissionKeepLogTypeReward // 获得奖品 +) + +const ( + FissionKeepLogSourceInitGet = "init_get" // 参与活动获得 + FissionKeepLogSourceCollect = "collect" // 点击收集爱心动作 + FissionKeepLogSourceStep = "step" // 阶梯奖励 + FissionKeepLogSourceFeed = "feed" // 点击喂养动作 + FissionKeepLogSourceMachine = "machine" // 狗粮机 + FissionKeepLogSourceFeedProp = "feed_prop" // 多次喂养获得的道具 + FissionKeepLogSourceFinishTask = "finish_task" // 完成任务 + FissionKeepLogSourceFinishAllTask = "finish_all_task" // 完成所有任务 + FissionKeepLogSourceMachineOffline = "machine_offline" // 离线狗粮机 + + // 被邀请人给上级发狗粮的来源 + FissionKeepLogSourceThird = "third_feed" // 被邀请人喂养三次 + FissionKeepLogSourceDayFirstThird = "day_first_third_feed" // 每日第一个邀请喂养三次 + FissionKeepLogSourceSelect = "select_reward" // 被邀请人选择奖品 + FissionKeepLogSourceDayFirstSelect = "day_first_select_reward" // 每日第一个邀请选择奖品 + FissionKeepLogSourceEffectInvite = "effect_invite" // 有效邀请 + FissionKeepLogSourceDayFirstEffectInvite = "day_first_effect_invite" // 每日第一个有效邀请 + + // 子活动来源 + FissionKeepLogSourceChildInvite = "child_invite" // 完成邀请类子活动 + FissionKeepLogSourceChildBlind = "child_blind" // 完成每日盲盒 + FissionKeepLogSourceChildLucky = "child_lucky" // 完成每日抽奖 + FissionKeepLogSourceChildSign = "child_sign" // 完成每日签到 + FissionKeepLogSourceChildTask = "child_task" // 完成超级任务 +) + +const ( + FissionCampaignTaskPreCondClickIcon = iota + 1 // 点击任务图标 + FissionCampaignTaskPreCondTask1 // 完成一个任务 + FissionCampaignTaskPreCondTask2 // 完成两个任务 + FissionCampaignTaskPreCondWait30s // 进入活动30s +) + +const ( + FissionCampaignPushMarkTaskReset = "task_reset" // 活动任务重制 + FissionCampaignPushMarkActive = "active" // 用户活跃 + FissionCampaignPushMarkOffline = "offline" // 离线提醒 + FissionCampaignPushMarkCompleteTask = "complete_task" // 完成任务 + FissionCampaignPushMarkVisit = "visit" // 访问活动 +) + +const ( + NotifyUrlHeaderMarkLang = "lang" +) + +const ( + FissionChildUserRecordSourceLucky = "lucky" // 每日抽奖 + FissionChildUserRecordSourceBlind = "blind" // 每日盲盒 + FissionChildUserRecordSourceSign = "sign" // 每日签到 + FissionChildUserRecordSourceInviteOne = "invite_one" // 成功邀请一个人 + FissionChildUserRecordSourceInvite = "invite" // 排行榜结算 +) + +const ( + LotteryFissionTypeAdd = iota + 1 // 获得抽奖机会 + LotteryFissionTypeDecr // 消耗抽奖机会 + LotteryFissionTypeUnlock // 解锁抽奖奖励 +) + +const ( + FissionQaLogTypeAdd = iota + 1 // 获得答题机会 + FissionQaLogTypeDecr // 消耗答题机会 +) + +const ( + FissionCampaignLongImgClickTypeAll = iota + 1 // 整图点击 + FissionCampaignLongImgClickTypeZone // 区域点击 +) + +const ( + FissionQuizLogTypeAdd = iota + 1 // 获得投票机会 + FissionQuizLogTypeDecr // 消耗投票机会 +) + +const ( + FissionGoldNextStepNone = "none" // 没有节点需要完成了 + FissionGoldNextStepOpenGift = "open_gift" // 开礼品盒 + FissionGoldNextStepTriggerShare = "trigger_share" // 赠送能量 + FissionGoldNextStepShowReward = "show_reward" // 展示奖品 + FissionGoldNextStepLastSpin = "last_spin" // 弹窗还差最后一次抽奖获得奖品 + FissionGoldNextStepGoldRain = "gold_rain" // 金币雨 +) + +const ( + FissionGoldLogTypeOpenGift = iota + 1 // 金额改变 + FissionGoldLogTypeLottery // 抽奖 + FissionGoldLogTypeDoTask // 完成任务 + FissionGoldLogTypeReward // 获得奖品 +) + +const ( + FissionGoldLogSourceOpenGift = "open_gift" // 打开盒子 + FissionGoldLogSourceLottery = "lottery" // 抽奖 + FissionGoldLogSourceReward = "reward" // 获得奖品 +) + +const ( + FissionLogSourceInit = "init" // 系统默认赠送 + FissionLogSourceSign = "sign" // 每日签到 + FissionLogSourceVote = "vote" // 投票 + FissionLogSourceLottery = "lottery" // 抽奖 + FissionLogSourceAnswer = "answer" // 答题 + FissionLogSourceInstall = "install" // 安装拉新任务 + FissionLogSourceRegister = "register" // 注册拉新任务 + FissionLogSourceCondAll = "cond_all" // 完成配置任务 + FissionLogSourceCondOne = "cond_one" // 完成指定任务 + FissionLogSourceManualCondAll = "manual_cond_all" // 手动领取完成配置任务 + FissionLogSourceManualCondOne = "manual_cond_one" // 手动领取完成的指定任务 + FissionLogSourcePointsUse = "points_use" // 消耗积分 + FissionLogSourceSettlement = "settlement" // 结算奖励 + FissionLogSourceFirstVisit = "first_visit" // 首次访问 + FissionLogSourceExchange = "exchange" // 积分兑换 + FissionLogSourceCompensate = "compensate" // 补偿 +) + +const ( + FissionCampaignKeepMachineTypeOnline = iota + 1 // 在线收益 + FissionCampaignKeepMachineTypeOffline // 离线收益 +) + +const ( + FissionCampaignLongImgTargetTypeCustom = iota + 1 // 指定地址 + FissionCampaignLongImgTargetTypeCampaign // 活动 +) + +const ( + FissionCampaignCoinLackBtnTask = iota + 1 // 做任务 + FissionCampaignCoinLackBtnCustom // 自定义 +) + +const ( + FissionCoinStatusWait = iota + 1 // 未参与 + FissionCoinStatusJoin // 已参与待瓜分 + FissionCoinStatusOk // 已领取瓜分奖励 + FissionCoinStatusExpired // 过期未领取 +) + +const ( + FissionCoinLogTypeUse = iota + 1 // 消耗金币 + FissionCoinLogTypeAdd // 增加金币 + FissionCoinLogTypeReward // 获得奖品 +) + +const ( + FissionCoinLogSourcePutIn = "put_in" // 投入金币到金币池 + FissionCoinLogSourceGetExpired = "get_expired" // 过期未领取 + FissionCoinLogSourceGetOk = "get_ok" // 领取成功 + FissionCoinLogSourceFinishTask = "finish_task" // 完成任务 + FissionCoinLogSourceFinishAllTask = "finish_all_task" // 完成所有任务 +) + +const ( + FissionPointsLogStateDeduct = "deduct" // 扣除 + FissionPointsLogStateGain = "gain" // 获得 +) + +const ( + FissionPointsLogSourceCoin = "coin" // 金币池 + FissionPointsLogSourceWheel = "wheel" // 转盘 + FissionPointsLogSourceDice = "dice" // 大富翁 + FissionPointsLogSourceGashapon = "gashapon" // 扭蛋机 +) + +const ( + FissionSignLogTypeSign = iota + 1 // 签到 + FissionSignLogTypeGetReward // 获得奖品 + FissionSignLogTypeSignCard // 补签卡状态 +) + +const ( + FissionSignLogSourceAutoSign = "auto_sign" // 自动签到 + FissionSignLogSourceManualSign = "manual_sign" // 手动签到 + FissionSignLogSourceSignReward = "sign_reward" // 正常签到获得奖品 + FissionSignLogSourceCardReward = "card_reward" // 补签获得奖品 + FissionSignLogSourceGetCard = "get_card" // 获得补签卡 + FissionSignLogSourceUseCard = "use_card" // 使用补签卡 +) + +const ( + FissionCampaignConfigIconOpenRewardList = iota + 1 // 奖品列表 + FissionCampaignConfigIconOpenInviteRecord // 邀请记录 + FissionCampaignConfigIconOpenRewardRecord // 奖励记录 + FissionCampaignConfigIconOpenRewardInvite // 邀请好友 +) + +const ( + FissionCampaignTaskAwardModeAuto = iota // 自动发放 + FissionCampaignTaskAwardModeManual // 手动领取 +) + +const ( + FissionUserStateDataCondInstall = iota + 1 // 安装 + FissionUserStateDataCondRegister //注册 +) + +const ( + RewardPushStatusWait = iota + 1 // 推送中 + RewardPushStatusOk // 完成 + RewardPushStatusFail // 失败 +) + +const ( + RewardPushFailTypeSys = "system" // 系统错误 + RewardPushFailTypeCli = "client" // 客户端错误 + RewardPushFailTypeUndefined = "undefined" // 未定义错误 +) + +const ( + RewardPushSourceWall = "wall" // 积分墙 + RewardPushSourceCenter = "center" // 任务中心 +) + +const ( + CompanyMadeMarkLvApi = "lv_api" // 用户类型api + CompanyMadeMarkFissionTemp = "fission_temp" // 玩法模版 +) + +const ( + LVApiLogSourceVisitUser = "visit_user" + LVApiLogSourceNotifyUser = "notify_user" +) + +const ( + FissionChatMsgSourceInput = "input" // 输入文本 + FissionChatMsgSourceOutput = "output" // 回复文本 + FissionChatMsgSourceSystem = "system" // 系统文本 +) + +const ( + FissionChatMsgTypeText = iota + 1 // 文本消息 + FissionChatMsgTypeFix // 固定文案 +) + +const ( + RedeemMallStatusUsed = iota + 1 // 使用中 + RedeemMallStatusWait //暂未使用 +) + +const ( + RedeemMallRelateSourceCenter = iota + 1 // 任务中心 + RedeemMallRelateSourceCampaign // 活动 +) + +const ( + RedeemMallItemUpTypeNow = iota + 1 // 立即上架 + RedeemMallItemUpTypeCustom // 自定义上架时间 +) + +const ( + RedeemMallItemUpFromNow = "now" // 立即上架 + RedeemMallItemUpFromManual = "manual" // 手动上架 + RedeemMallItemUpFromTiming = "timing" // 定时上架 +) + +const ( + RedeemMallItemDownTypeNone = iota + 1 // 永不下架 + RedeemMallItemDownTypeCustom // 自定义下架时间 +) + +const ( + RedeemMallItemDownFromManual = "manual" // 手动下架 + RedeemMallItemDownFromTiming = "timing" // 定时下架 + RedeemMallItemDownFromDel = "del" // 删除 +) + +const ( + RedeemMallItemStatusUp = iota + 1 // 上架 + RedeemMallItemStatusWait // 待上架 + RedeemMallItemStatusDown // 下架 + RedeemMallItemStatusDel // 删除 +) + +const ( + RedeemMallItemTaskMarkDown = "down" // 下架 +) + +const ( + RedeemMallItemUpShowClient = "client" // 展示到客户端 + RedeemMallItemUpShowCountdown = "countdown" // 展示倒计时 +) + +const ( + ProjectUserCoinLogStateDeduct = "deduct" // 扣除 + ProjectUserCoinLogStateGain = "gain" // 获得 +) + +const ( + ProjectUserCoinDeductSourceApp = "app" // 第三方应用 + ProjectUserCoinDeductSourceSystem = "system" // 系统扣除 +) + +const ( + ProjectUserCoinUseSourceCampaign = "campaign" // 活动使用 + ProjectUserCoinUseSourceCenter = "center" // 任务中心使用 +) + +const ( + ProjectUserCoinDerMall = "mall" // 商城兑换 + ProjectUserCoinDerVote = "vote" // 投票 + ProjectUserCoinDerExpired = "expired" // 过期 + + ProjectUserCoinAddReward = "reward" // 奖励 + ProjectUserCoinAddTask = "task" // 任务奖励 + ProjectUserCoinAddCompensate = "compensate" // 补偿奖励 +) + +const ( + ProjectUserCoinLogSourceCenterExchange = "center_exchange" // 任务中心兑换积分 +) + +const ( + RedeemMallRecordStatusOk = iota + 1 // 成功 + RedeemMallRecordStatusWait // 待处理 + RedeemMallRecordStatusFail // 失败 +) + +const ( + ProjectUserCoinSourceCenter = "center" + ProjectUserCoinSourceCampaign = "campaign" +) + +const ( + ProjectUserCoinRecordTypeAdd = iota + 1 + ProjectUserCoinRecordTypeDer +) + +const ( + FissionCampaignVsScheduleStatusNotFinish = iota // 未定义完全比赛 + FissionCampaignVsScheduleStatusWait // 即将投票 + FissionCampaignVsScheduleStatusVote // 投票中 + FissionCampaignVsScheduleStatusRunning // 比赛中 + FissionCampaignVsScheduleStatusSettlement // 已结算 + FissionCampaignVsScheduleStatusWaitVs // 待开赛 +) + +const ( + FissionCampaignVsScheduleWinTypeWin = iota + 1 // 胜利 + FissionCampaignVsScheduleWinTypeDraw // 平局 +) + +const ( + FissionCampaignVsScheduleOtherVoteDraw = "draw" // 平局 +) + +const ( + FissionVsLogTypeAddVote = iota + 1 // 增加投票机会 + FissionVsLogTypeVote // 投票 + FissionVsLogTypeAddPoint // 增加积分 + FissionVsLogTypeReward // 获得奖励 + FissionVsLogTypeSettlement // 结算奖励 + FissionVsLogTypeExchange // 积分兑换 +) + +const ( + FissionCampaignVsClaimTypeAuto = iota + 1 // 发放 + FissionCampaignVsClaimTypePage // 进入活动发奖 +) + +const ( + FissionCampaignUnoGroupRed = "red" // 红牌 + FissionCampaignUnoGroupBlue = "blue" // 蓝牌 + FissionCampaignUnoGroupGreen = "green" // 绿色牌 + FissionCampaignUnoGroupYellow = "yellow" // 黄色牌 +) + +const ( + FissionCampaignUnoGroupResetTypeNone = iota + 1 // 不重置 + FissionCampaignUnoGroupResetTypeReward //获奖后重置 +) + +const ( + FissionCampaignUnoPropMarkThree = "three" // +3道具牌 + FissionCampaignUnoPropMarkFive = "five" // +5道具牌 + FissionCampaignUnoPropMarkFix = "fix" // 固定颜色道具牌 +) + +const ( + FissionUnoLogTypeAdd = iota + 1 // 获得抽奖机会 + FissionUnoLogTypeDecr // 消耗抽奖机会 + FissionUnoLogTypeProp // 获得道具 + FissionUnoLogTypePropUse // 使用道具 + FissionUnoLogTypeClaim // 收集道具奖励 + FissionUnoLogTypeResetRule // 重置规则 +) + +const ( + FissionUnoLogSourceThreeUse = "three_use" // 使用+3道具 + FissionUnoLogSourceFiveUse = "five_use" // 使用+5道具 + FissionUnoLogSourceFixUse = "fix_use" // 使用固定颜色道具 + FissionUnoLogSourceClaim = "claim" // 收集道具奖励 +) + +const ( + FissionCampaignEventMarkFirstVisit = "first_visit" // 首次访问 +) + +const ( + GameActionTypeVisit = iota + 1 // 访问游戏 + GameActionTypeStay // 玩家停留 +) diff --git a/internal/repository/mtype/struct.go b/internal/repository/mtype/struct.go new file mode 100644 index 0000000..ad6767e --- /dev/null +++ b/internal/repository/mtype/struct.go @@ -0,0 +1,607 @@ +package mtype + +type FissionTemplateConfig struct { + WinRate int64 `json:"win_rate"` //中奖概率(20230602:这个字段没什么用的,就是为了让前端有个默认值,但前端自己处理就好了) + ImageEnd string `json:"image_end"` //活动结束图片 + ImageMain string `json:"image_main"` //活动主图 + ImageWechat string `json:"image_wechat"` //微信背景图 + ImageLanding string `json:"image_landing"` //落地页背景图 + ImagePreview string `json:"image_preview"` //预览页图 + ImageDownload string `json:"image_download"` //下载图片 + ImageStatusItem string `json:"image_status_item"` //按钮图片 + ButtonColorDefault string `json:"button_color_default"` //按钮默认颜色 + ImageStatusBackground string `json:"image_status_background"` //战绩背景图(一般在按钮上方显示数据的小面板) +} + +type FissionCampaignRule struct { + PlayRule []string `json:"play_rule" ` //玩法规则 + MustKnown []string `json:"must_known" ` //活动需知 + WordDesc []string `json:"word_desc" ` //名词需知 + Contact []string `json:"contact" ` //联系方式 +} + +type PrizeQuizReward struct { + Score int32 `json:"score" ` //分数线(获取奖励最低分数线) + Title string `json:"title" ` //奖品名称 + ImgUrl string `json:"img_url" ` //奖品图片(相对路径) + JumpUrl string `json:"jump_url" ` //开奖页面跳转url + CustomParams []*KV `json:"custom_params" ` //奖品自定义参数数据 +} + +type KV struct { + Key string `json:"key" ` //键名字 + Value string `json:"value" ` //键对应的值 +} + +type Question struct { + Title string `json:"title" ` //题目 + Score int32 `json:"score" ` //得分 + CheckedType int32 `json:"checked_type" ` //题目选择类型(1-单选,2-多选) + SortType int32 `json:"sort_type" ` //题目选择类型(1-大写英文,2-小写英文,3-数字) + Options []*QuestionOption `json:"options" ` //选项 +} + +type QuestionOption struct { + Title string `json:"title" ` //题目 + RightKey int32 `json:"right_key" ` //是否正确答案(1-是,0-否) +} + +type FissionUserDyLinkParams struct { + MediaType string `json:"media_type"` //媒体类型 ImageText(图文) + ImageText []*ImageText `json:"image_text,omitempty"` //图文信息 +} + +type ImageText struct { + NickName string `json:"nick_name"` //用户昵称 + Avatar string `json:"avatar"` //用户头像 + Title string `json:"title"` //内容标题 + Desc string `json:"desc"` //内容描述 + Image string `json:"image"` //内容封面 +} + +type LangKv struct { + Key string `json:"key"` + Value string `json:"value"` + Desc string `json:"desc"` +} + +type LangCond struct { + CondId int64 `json:"cond_id"` // 条件ID + Desc string `json:"desc"` // 语言描述 + WebURL string `json:"web_url"` + ExtraParam string `json:"extra_param"` + PcParam string `json:"pc_param"` + GoText string `json:"go_text"` +} + +type LangReward struct { + RewardId int64 `json:"reward_id"` // 奖品ID + Title string `json:"title"` // 奖品名称 + ImgUrl string `json:"img_url,omitempty"` // 奖品图片 +} + +type LangQuit struct { + Title string `json:"title"` // 标题 + Options []*LangOption `json:"options"` //选项集合 +} + +type LangOption struct { + OptionId int64 `json:"option_id"` // 选项id + Title string `json:"title"` // 选项标题 + ImgUrl string `json:"img_url,omitempty"` // 选项图片 +} + +type LangQuestions struct { + QaId int64 `json:"qa_id"` //问题id + Title string `json:"title"` //题目 + Options []*LangOption `json:"options"` //选项集合 +} + +type LangCash struct { + Price int32 `json:"price"` // 单位奖品总价值 + Currency int32 `json:"currency"` // 货币id标识 +} + +type LangGold struct { + Price float64 `json:"price"` // 单位奖品总价值 + Currency int32 `json:"currency"` // 货币id标识 +} + +type LangCoin struct { + CustomBtnText string `json:"custom_btn_text"` // 自定义按钮文案 + CustomWebUrl string `json:"custom_web_url"` // 自定义web端url + CustomExtraParam string `json:"custom_extra_param"` // 自定义app附加参数 + CustomPcParam string `json:"custom_pc_param"` // 自定义pc附加参数 +} + +type LangQaGroup struct { + QaGroupId string `json:"qa_group_id"` // 题库hash_id + QaNum int32 `json:"qa_num"` // 题库选取数量 + GuideGroupId string `json:"guide_group_id"` // 引导组hash_id +} + +type GrowVarData struct { + Key string `json:"key" ` //键名字 + Value string `json:"value" ` //键对应的值 + IdMark int64 `json:"id_mark"` //数字id标识 +} + +type IndicatorData struct { + InstallNum int64 `json:"install_num,omitempty"` // 有效下载安装数 + RegisterNum int64 `json:"register_num,omitempty"` // 有效注册数 +} + +type RecordTypeInvite struct { + UserId int64 `json:"user_id"` // 被邀请人id + Help bool `json:"help"` // 是否助力成功 +} + +type RecordTypeCash struct { + TitleMark string `json:"title_mark"` // 语言包对应的翻译标识 + DecOrAdd string `json:"dec_or_add"` // 减或者加(dec-减,add-加) + Cash float64 `json:"cash"` // 获取金额 +} + +type RecordTypeEnergy struct { + TitleMark string `json:"title_mark"` // 语言包对应的翻译标识 + DecOrAdd string `json:"dec_or_add"` // 减或者加(dec-减,add-加) + Energy float64 `json:"energy"` // 获取能量 +} + +type RecordTypeReward struct { + Ids []int64 `json:"ids"` +} + +type MapPoint struct { + Blank string `json:"blank"` // 空白底座 + Again string `json:"again"` // 再来一次底座 + Normal string `json:"normal"` // 普通奖品底座 + Supper string `json:"supper"` // 超级大奖底座 +} + +type DiceRecord struct { + Point int32 `json:"point,omitempty"` // 掷骰子点数 + RewardId int64 `json:"reward_id,omitempty"` // 活动奖品id(fission_campaign_reward表) + RecordId int64 `json:"record_id,omitempty"` // 活动奖品获取记录id(fission_reward_record表) + Chance int32 `json:"chance,omitempty"` // 获得的骰子个数 + LuckyChance int32 `json:"lucky_chance,omitempty"` // 获得的幸运骰个数 + TaskId int64 `json:"task_id,omitempty"` // 任务id(fission_campaign_task表) + CondId int64 `json:"cond_id,omitempty"` // 条件id(fission_campaign_cond表) + PointsNum int32 `json:"points_num,omitempty"` // 积分数量 +} + +type FormItem struct { + Name string `json:"name"` // 表单项名称(用于后台全局显示) + Trans []*FormItemTran `json:"trans,omitempty"` // 语言下表单项数据 +} + +// GetTranName 获取翻译后的名称 +func (s FormItem) GetTranName(mark string) string { + if len(s.Trans) == 0 { + return s.Name + } + + var df string + for _, t := range s.Trans { + if t.Name == mark { + return t.Name + } + + if t.IsDefault == Yes { + df = t.Name + } + } + + return df +} + +type FormItemTran struct { + Mark string `json:"mark"` // 语言标识 + Name string `json:"name"` // 语言对应的表单名称 + IsDefault int32 `json:"is_default"` // 是否是默认表单项 +} + +type SubmitFormItem struct { + Name string `json:"name"` // 提交表达是显示的表单名称 + Key string `json:"key"` // 表单项名称 + Value string `json:"value"` // 填写的值 +} + +type RewardKV struct { + Key string `json:"key" ` //键名字 + Value string `json:"value" ` //键对应的值 + IsShow int32 `json:"is_show,omitempty" ` //是否展示(0-否,1-是) +} + +type LangLongImg struct { + ImgUrl string `json:"img_url"` //图片地址 + WebUrl string `json:"web_url"` //web端跳转参数 + AppParam string `json:"app_param"` //app端监听参数 +} + +type Dimension struct { + Platform string `json:"platform"` // 来源 android,ios,web + ChannelId int64 `json:"channel_id"` // 渠道id + ParentId int64 `json:"parent_id"` // 上级id + Lang string `json:"lang"` // 语言标识 + LevelMark string `json:"level_mark"` // 用户标签 + UserLv int64 `json:"user_lv"` // 用户等级Id + Country string `json:"country"` // 国家标识 + FirstAction bool `json:"first_action"` // 是否首次触发事件 + DimensionOption // 可选维度 +} + +type DimensionOption struct { + CondId int64 `json:"cond_id,omitempty"` // 完成事件id + MediaId int64 `json:"media_id,omitempty"` // 社媒id + RewardRecordId int64 `json:"reward_record_id,omitempty"` // 奖品记录id + RewardId int64 `json:"reward_id,omitempty"` // 活动奖品id + RewardType int32 `json:"reward_type,omitempty"` // 奖品类型 + RewardNum int32 `json:"reward_num,omitempty"` // 奖品数量 + DownloadFrom string `json:"download_from,omitempty"` // 下载页来源 + PropName string `json:"prop_name,omitempty"` // 道具标识 + PropNum int32 `json:"prop_num,omitempty"` // 道具数量 + FromWebId string `json:"from_web_id,omitempty"` // 关联的站外浏览器id + CpnFirst string `json:"cpn_first,omitempty"` // 通过该事件参与的活动 + UTM string `json:"utm,omitempty"` // 计算的UTM时区 + SignDate string `json:"sign_date,omitempty"` // 触发签到日(已根据时区计算) + ImgUrl string `json:"img_url,omitempty"` // 图片地址 + ImgId int64 `json:"img_id,omitempty"` // 长图id + ZoneId int64 `json:"zone_id,omitempty"` // 热区id + TaskId int64 `json:"task_id,omitempty"` // 任务id + From string `json:"from,omitempty"` // 事件来源 + FromStatus string `json:"from_status,omitempty"` // 事件状态 + Blackbox string `json:"blackbox,omitempty"` // 黑盒数据 + Uid string `json:"uid,omitempty"` // 第三方用户id + QaId int64 `json:"qa_id,omitempty"` // 题目id + QaOptionId int64 `json:"qa_option_id,omitempty"` // 选择的选项id + QaOptionRight int32 `json:"qa_option_right,omitempty"` // 是否选择了正确答案 + QaNum int32 `json:"qa_num,omitempty"` // 答题数量 + QaPoint string `json:"qa_point,omitempty"` // 答题分数 + QaGroupId int64 `json:"qa_group_id,omitempty"` // 题库id + ChildId int64 `json:"child_id,omitempty"` // 子活动id + ChildType int32 `json:"child_type,omitempty"` // 子活动类型 + SceneId int64 `json:"scene_id,omitempty"` // 场次Id + UseTimes int64 `json:"use_times,omitempty"` // 投放次数 + CustomBtnId int64 `json:"custom_btn_id,omitempty"` // 自定义按钮id + PayCount int64 `json:"pay_count,omitempty"` // 支付金额 + PayCurrency string `json:"pay_currency,omitempty"` // 支付金额货币 + PCpnId int64 `json:"p_cpn_id,omitempty"` // 父亲活动id + PointsUse int32 `json:"points_use,omitempty"` // 使用积分数量 + CenterHashId string `json:"center_hash_id,omitempty"` // 任务中心hash_id + CenterModuleId string `json:"center_module_id,omitempty"` // 任务中心模块id + ChatFrom string `json:"chat_from,omitempty"` // 进入AI对话的来源 + ChatTipMsg string `json:"chat_tip_msg,omitempty"` // 来源为tip的内容 + ScheduleId int64 `json:"schedule_id,omitempty"` // 赛程id + WinType int32 `json:"win_type,omitempty"` // 赢家类型 + WinTeamId int64 `json:"win_team_id,omitempty"` // 赢家队伍id + VoteNum int32 `json:"vote_num,omitempty"` // 投票次数 + MallId int64 `json:"mall_id,omitempty"` // 商城id + MallItemId int64 `json:"mall_item_id,omitempty"` // 商品id + CardNo string `json:"card_no,omitempty"` // 牌型 + UnoCardId int64 `json:"uno_card_id,omitempty"` // uno卡Id + CardColor string `json:"card_color,omitempty"` // 卡颜色 +} + +type KeepInvite struct { + InviteType int32 `json:"invite_type"` //邀请类型(1-下载,2-安装) + InviteGet int32 `json:"invite_get"` //邀请可获得的道具数量 + RewardSelected int32 `json:"reward_selected"` //选择礼品可获得的道具数 + FeedThird int32 `json:"feed_third"` //喂养3次可获得的道具数 + DayFirstInvite int32 `json:"day_first_invite"` //是否开启每日首次拉新(0-否,1-是) + DayFirstGet int32 `json:"day_first_get"` //每日首次拉新可获得的道具数 + DayFirstSelected int32 `json:"day_first_selected"` //每日首日选择礼物可获得的道具数 + DayFirstThird int32 `json:"day_first_third"` //每日首次喂养三次可获得的道具数 + InviteMaxGet int32 `json:"invite_max_get"` //邀请人可获得的最大道具数 +} + +type KeepTalk struct { + TextType int32 `json:"text_type" form:"text_type"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `json:"content" form:"content"` //内容 +} + +type PushCond struct { + Mark string `json:"mark"` // 条件标识 + Val string `json:"val"` // 条件标识值 +} + +type Header struct { + Key string `json:"key" ` //键名字 + Mark string `json:"mark" ` //数据标识 + Val string `json:"val" ` //键对应的值 +} + +type WheelStyle struct { + TopicMark string `json:"topic_mark,omitempty"` //主题标识 + MainImg string `json:"main_img,omitempty"` //活动背景图 + BgColor string `json:"bg_color,omitempty"` //背景颜色 + Bottom1 string `json:"bottom1,omitempty"` //底部颜色1 + Bottom2 string `json:"bottom2,omitempty"` //底部颜色2 + Bottom3 string `json:"bottom3,omitempty"` //底部颜色3 + Pointer string `json:"pointer,omitempty"` //指针图片 + PlayBtn string `json:"play_btn,omitempty"` //玩法按钮图片 + BorderImg string `json:"border_img,omitempty"` //边框图片 + ButtonColor string `json:"button_color,omitempty"` //按钮颜色 + WheelTextColor string `json:"wheel_text_color,omitempty"` //转盘文字颜色 +} + +type GridStyle struct { + TopicMark string `json:"topic_mark,omitempty"` //主题标识 + MainImg string `json:"main_img,omitempty"` //活动背景图 + BgColor string `json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `json:"button_color,omitempty"` //按钮颜色 + PlayImg string `json:"play_img,omitempty"` //Go按钮图 + DisablePlayImg string `json:"disable_play_img,omitempty"` //Go按钮禁用 + MachineImg string `json:"machine_img,omitempty"` //机器图 + GridImg string `json:"grid_img,omitempty"` //方格图 + ActivateImg string `json:"activate_img,omitempty"` //方格激活图 +} + +type FlipStyle struct { + TopicMark string `json:"topic_mark,omitempty"` //主题标识 + MainImg string `json:"main_img,omitempty"` //活动背景图 + BgColor string `json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `json:"button_color,omitempty"` //按钮颜色 + PlayImg string `json:"play_img,omitempty"` //Go按钮图 + CardImg string `json:"card_img,omitempty"` //卡片素材 +} + +type GashaponStyle struct { + TopicMark string `json:"topic_mark,omitempty"` //主题标识 + MainImg string `json:"main_img,omitempty"` //活动背景图 + BgColor string `json:"bg_color,omitempty"` //背景颜色 + MachineImg string `json:"machine_img,omitempty"` //机器图 + PlayImg string `json:"play_img,omitempty"` //Go按钮图 + EggType int32 `json:"egg_type,omitempty"` //类型 + EggImgs []string `json:"egg_imgs,omitempty"` //扭蛋素材 +} + +type LotteryLogVal struct { + TaskId int64 `json:"task_id,omitempty"` + Chance int32 `json:"chance,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` + RecordId int64 `json:"record_id,omitempty"` + PointsNum int32 `json:"points_num,omitempty"` +} + +type KeepLogValSource struct { + TaskId int64 `json:"task_id,omitempty"` + Chance int32 `json:"chance,omitempty"` + Step int32 `json:"step,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` +} + +type GoldLogVal struct { + Cash float64 `json:"cash,omitempty"` + TaskId int64 `json:"task_id,omitempty"` + CondId int64 `json:"cond_id,omitempty"` + RecordIds []int64 `json:"record_ids,omitempty"` + Chance int32 `json:"chance,omitempty"` +} + +type CoinLogVal struct { + CoinNum int64 `json:"coin_num,omitempty"` + RelateId string `json:"relate_id,omitempty"` + TaskId int64 `json:"task_id,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` +} + +type PointsLogOther struct { + PlayerId int64 `json:"player_id,omitempty"` + DeductId int64 `json:"deduct_id,omitempty"` + SceneId int64 `json:"scene_id,omitempty"` + MallItemId int64 `json:"mall_item_id,omitempty"` +} + +type PointsLogReq struct { + State string `json:"state"` // 状态 (deduct - 扣除, gain - 获得) + Num int32 `json:"num"` // 数量 + UserId string `json:"user_id"` // 第三方的用户id + Source string `json:"source"` // 来源枚举(coin - 瓜分金币活动) + CampaignId string `json:"campaign_id"` // 活动hash_id + Title string `json:"title"` // 活动标题 + GainId string `json:"gain_id,omitempty"` // 领取唯一凭证,再处理为重复请求 + DeductId string `json:"deduct_id,omitempty"` // 消耗唯一凭证,再处理为重复请求 +} + +type SignLogVal struct { + CardNum int32 `json:"card_num,omitempty"` // 签到卡数量 + TOffset int32 `json:"t_offset,omitempty"` // 时区 + SignDate string `json:"sign_date,omitempty"` // 当前时区的日期 + RecordId int64 `json:"record_id,omitempty"` // 奖品记录id + RewardId int64 `json:"reward_id,omitempty"` // 活动奖品id +} + +type StateData struct { + InstallTime int64 `json:"install_time,omitempty"` // 首次完成安装时间 + RegisterTime int64 `json:"register_time,omitempty"` // 首次完成注册时间 +} + +func (s StateData) InstallTimeName() string { + return "install_time" +} + +func (s StateData) RegisterTimeName() string { + return "register_time" +} + +type AnswerLogVal struct { + TaskId int64 `json:"task_id,omitempty"` + Chance int32 `json:"chance,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` + RecordId int64 `json:"record_id,omitempty"` + Score int32 `json:"score,omitempty"` +} + +type QuizLogVal struct { + TaskId int64 `json:"task_id,omitempty"` + VoteNum int32 `json:"vote_num,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` + RecordId int64 `json:"record_id,omitempty"` + OptionId int64 `json:"option_id,omitempty"` +} + +type CollectRule struct { + Open int32 `json:"open"` // 是否开启碎片规则 + InitCollect int32 `json:"init_collect"` // 初始的最大可获得碎片数 + SignDay int32 `json:"sign_day"` // 签到天数 + AddCollect int32 `json:"add_collect"` // 完成条件可获得最大碎片数 + ResetType int32 `json:"reset_type"` // 重置规则(1-不重置,2-获奖后重置) +} + +type RewardPushParam struct { + SourceHashId string `json:"source_hash_id,omitempty"` + RelateHashId string `json:"relate_hash_id,omitempty"` + UserId string `json:"user_id,omitempty"` + UserPlatform string `json:"user_platform,omitempty"` + ParentUserId string `json:"parent_user_id,omitempty"` + ParentUserPlatform string `json:"parent_user_platform,omitempty"` + Num int32 `json:"num,omitempty"` + Lang string `json:"lang,omitempty"` + Title string `json:"title,omitempty"` + RewardType int32 `json:"reward_type,omitempty"` + RewardId string `json:"reward_id,omitempty"` + CampaignId int64 `json:"campaign_id,omitempty"` +} + +type RewardPushLogReq struct { + TaskId string `json:"task_id"` // 回调任务ID + UserId string `json:"user_id"` // 用户id + Source string `json:"source"` // 来源标识 wall-积分墙,center-任务中心 + CampaignId string `json:"campaign_id"` // 活动id + WallId string `json:"wall_id"` // 积分墙id + CenterId string `json:"center_id"` // 任务中心id + RewardId string `json:"reward_id"` + RewardTitle string `json:"reward_title"` // 设置奖品名称 + RewardNum int32 `json:"reward_num"` // 发放数量 + KvData map[string]string `json:"kv_data"` // 活动奖励配置的键值数据,也就是奖品的标识 + UserPid string `json:"user_pid"` // 用户上级id + Lang string `json:"lang"` // 语言 + Title string `json:"title"` // 标题信息 + UserPlatform string `json:"user_platform"` // 用户系统 + ParentPlatform string `json:"parent_platform"` // 上级用户系统 + RewardType int32 `json:"reward_type"` // 奖品类型(1-活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励,7-子活动奖励,8-兑换奖励) +} + +type LvApiLogReq struct { + UserId string `json:"user_id"` // 用户id + CampaignId string `json:"campaign_id"` // 活动id + Title string `json:"title"` // 活动标题 + State string `json:"state"` // 请求类型 + TlSettingUserType []string `json:"tl_setting_user_type"` // 后台设置的用户类型 +} + +type ChatMsgVal struct { + Text string `json:"text,omitempty"` +} + +type ProjectUserInfoReq struct { + UserId string `json:"user_id"` // 第三方用户id +} + +type VsTeam struct { + Id int64 `json:"id"` + Name string `json:"name"` + LogoImg string `json:"logo_img"` +} + +type VsSchedule struct { + Id int32 `json:"id"` + PkTeams []*VsSchedulePkTeam `json:"pk_teams"` +} + +type VsSchedulePkTeam struct { + Id int64 `json:"id"` + Teams []*VsTeam `json:"teams"` + Desc string `json:"desc"` + VsImg string `json:"vs_img"` +} + +type FissionCampaignVsScheduleSettlement struct { + WinType int32 `json:"win_type"` + WinTeamId int64 `json:"win_team_id"` + Scores []*FissionCampaignVsScheduleSettlementScore `json:"scores"` +} + +type FissionCampaignVsScheduleSettlementScore struct { + TeamId int64 `json:"team_id"` + Score string `json:"score"` +} + +type VsLogVal struct { + TaskId int64 `json:"task_id,omitempty"` + Chance int32 `json:"chance,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` + RecordId int64 `json:"record_id,omitempty"` + PointsNum int32 `json:"points_num,omitempty"` + ScheduleId int64 `json:"schedule_id,omitempty"` + WinType int8 `json:"win_type,omitempty"` + WinTeamId int64 `json:"win_team_id,omitempty"` + Odds string `json:"odds,omitempty"` + Num int32 `json:"num,omitempty"` + MallId int64 `json:"mall_id,omitempty"` + MallItemId int64 `json:"mall_item_id,omitempty"` +} + +type UnoLimitRule struct { + InitNum int32 `json:"init_num"` // 初始的最大可获得牌型数 + SignDay int32 `json:"sign_day"` // 签到天数 + AddNum int32 `json:"add_num"` // 完成条件可获得最大牌型数 + ResetType int32 `json:"reset_type"` // 重置规则(1-不重置,2-获奖后重置) +} + +type LangUno struct { + Red []*UnoCard `json:"red"` + Blue []*UnoCard `json:"blue"` + Green []*UnoCard `json:"green"` + Yellow []*UnoCard `json:"yellow"` +} +type UnoCard struct { + CardNo int32 `json:"card_no"` + Title string `json:"title"` + ImgURL string `json:"img_url"` + WebURL string `json:"web_url"` + AppParam string `json:"app_param"` + PcParam string `json:"pc_param"` +} + +type UnoLogVal struct { + TaskId int64 `json:"task_id,omitempty"` + Chance int32 `json:"chance,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` + RecordId int64 `json:"record_id,omitempty"` + PropMark string `json:"prop_mark,omitempty"` + Cards []*UnoLogValCard `json:"cards,omitempty"` +} + +type UnoLogValCard struct { + CardNo int32 `json:"card_no"` + Mark string `json:"mark"` +} + +type EventReward struct { + Id int64 `json:"id,omitempty"` + PropMark string `json:"prop_mark,omitempty"` + RewardId int64 `json:"reward_id,omitempty"` + Chance int32 `json:"chance,omitempty"` +} + +type EventData struct{} + +type GameDimension struct { + GameDimensionOption // 可选维度 +} + +type GameDimensionOption struct { + StaySec int32 `json:"stay_sec,omitempty"` // 玩家停留时间(秒) + StayId int64 `json:"stay_id,omitempty"` // 玩家停留id + Ip string `json:"ip,omitempty"` // ip + Os string `json:"os,omitempty"` // 系统 + OsVersion string `json:"os_version,omitempty"` // 系统版本 + DeviceModel string `json:"device_model,omitempty"` // 设备类型 +} + +type RewardRecordQaAnswer struct { + QID int64 `json:"qid"` + AID []int64 `json:"aid"` +} diff --git a/internal/repository/withdefault/with_default.go b/internal/repository/withdefault/with_default.go new file mode 100644 index 0000000..6d3d6de --- /dev/null +++ b/internal/repository/withdefault/with_default.go @@ -0,0 +1,1693 @@ +package withdefault + +import ( + "joybuywork/internal/plugins/encrypt" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" +) + +// FissionCampaignReward 活动奖品默认值处理 +func FissionCampaignReward(model *model.FissionCampaignReward) *model.FissionCampaignReward { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.PropMark == "" { + model.PropMark = mtype.FissionCampaignRewardPropMarkReward + } + + if model.RewardType == 0 { + model.RewardType = mtype.FissionCampaignRewardTypeApp + } + + if model.RewardNum == 0 { + model.RewardNum = 1 + } + + return model +} + +func FissionPrizeWheelLog(model *model.FissionPrizeWheelLog) *model.FissionPrizeWheelLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionBlindLog(model *model.FissionBlindLog) *model.FissionBlindLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGridLog(model *model.FissionGridLog) *model.FissionGridLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionFlipLog(model *model.FissionFlipLog) *model.FissionFlipLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionSlotLog(model *model.FissionSlotLog) *model.FissionSlotLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionKeepLog(model *model.FissionKeepLog) *model.FissionKeepLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignLongImg(model *model.FissionCampaignLongImg) *model.FissionCampaignLongImg { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.TargetType == 0 { + model.TargetType = mtype.FissionCampaignLongImgTargetTypeCustom + } + + return model +} + +func FissionCampaignLongImgZone(model *model.FissionCampaignLongImgZone) *model.FissionCampaignLongImgZone { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.TargetType == 0 { + model.TargetType = mtype.FissionCampaignLongImgTargetTypeCustom + } + + return model +} + +func FissionRewardRecord(model *model.FissionRewardRecord) *model.FissionRewardRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + if model.Status == 0 { + model.Status = mtype.FissionRewardRecordStatusWait + } + + if model.PropMark == "" { + model.PropMark = mtype.FissionCampaignRewardPropMarkReward + } + + return model +} + +func FissionGold(model *model.FissionGold) *model.FissionGold { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGoldLog(model *model.FissionGoldLog) *model.FissionGoldLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func User(model *model.User) *model.User { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func Project(model *model.Project) *model.Project { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + hashId := hashid.Id() + model.HashID = hashId + model.NotifyToken = encrypt.ProjectToken() + model.EncryptStr = encrypt.ProjectEncryptStr(hashId) + model.ThirdSecret = encrypt.ProjectThirdSecret(hashId) + } + + return model +} + +func ProjectSecret(model *model.ProjectSecret) *model.ProjectSecret { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func UserProjectRelate(model *model.UserProjectRelate) *model.UserProjectRelate { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RegisterAudit(model *model.RegisterAudit) *model.RegisterAudit { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func Company(model *model.Company) *model.Company { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.IdBase16() + } + + return model +} + +func Register(model *model.Register) *model.Register { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func ExportTask(model *model.ExportTask) *model.ExportTask { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + if model.EptStatus == 0 { + model.EptStatus = mtype.ExportTaskEptStatusDoing + } + + return model +} + +func FissionArchiveTask(model *model.FissionArchiveTask) *model.FissionArchiveTask { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionBallot(model *model.FissionBallot) *model.FissionBallot { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionBehavior(model *model.FissionBehavior) *model.FissionBehavior { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionBlind(model *model.FissionBlind) *model.FissionBlind { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaign(model *model.FissionCampaign) *model.FissionCampaign { + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + if model.ReportType == 0 { + model.ReportType = mtype.FissionCampaignReportTypeNew + } + + if model.Status == 0 { + model.Status = mtype.FissionCampaignStatusWait + } + + return model +} + +func FissionCampaignConfig(model *model.FissionCampaignConfig) *model.FissionCampaignConfig { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignStyle(model *model.FissionCampaignStyle) *model.FissionCampaignStyle { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignBallot(model *model.FissionCampaignBallot) *model.FissionCampaignBallot { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignBlind(model *model.FissionCampaignBlind) *model.FissionCampaignBlind { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignCash(model *model.FissionCampaignCash) *model.FissionCampaignCash { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignChannel(model *model.FissionCampaignChannel) *model.FissionCampaignChannel { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignChild(model *model.FissionCampaignChild) *model.FissionCampaignChild { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignChop(model *model.FissionCampaignChop) *model.FissionCampaignChop { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignCond(model *model.FissionCampaignCond) *model.FissionCampaignCond { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignDice(model *model.FissionCampaignDice) *model.FissionCampaignDice { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignFlip(model *model.FissionCampaignFlip) *model.FissionCampaignFlip { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignGold(model *model.FissionCampaignGold) *model.FissionCampaignGold { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignGrid(model *model.FissionCampaignGrid) *model.FissionCampaignGrid { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignGrow(model *model.FissionCampaignGrow) *model.FissionCampaignGrow { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignGrowStep(model *model.FissionCampaignGrowStep) *model.FissionCampaignGrowStep { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignKeep(model *model.FissionCampaignKeep) *model.FissionCampaignKeep { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignKeepStep(model *model.FissionCampaignKeepStep) *model.FissionCampaignKeepStep { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignLang(model *model.FissionCampaignLang) *model.FissionCampaignLang { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func FissionCampaignPush(model *model.FissionCampaignPush) *model.FissionCampaignPush { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignQa(model *model.FissionCampaignQa) *model.FissionCampaignQa { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignQaOption(model *model.FissionCampaignQaOption) *model.FissionCampaignQaOption { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignQaQuestion(model *model.FissionCampaignQaQuestion) *model.FissionCampaignQaQuestion { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignQuiz(model *model.FissionCampaignQuiz) *model.FissionCampaignQuiz { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignQuizOption(model *model.FissionCampaignQuizOption) *model.FissionCampaignQuizOption { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignReferral(model *model.FissionCampaignReferral) *model.FissionCampaignReferral { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignRewardRule(model *model.FissionCampaignRewardRule) *model.FissionCampaignRewardRule { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignSign(model *model.FissionCampaignSign) *model.FissionCampaignSign { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignSlot(model *model.FissionCampaignSlot) *model.FissionCampaignSlot { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignTask(model *model.FissionCampaignTask) *model.FissionCampaignTask { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignTicket(model *model.FissionCampaignTicket) *model.FissionCampaignTicket { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignWheel(model *model.FissionCampaignWheel) *model.FissionCampaignWheel { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignWin(model *model.FissionCampaignWin) *model.FissionCampaignWin { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCash(model *model.FissionCash) *model.FissionCash { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCashRecord(model *model.FissionCashRecord) *model.FissionCashRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChildUser(model *model.FissionChildUser) *model.FissionChildUser { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChildUserRecord(model *model.FissionChildUserRecord) *model.FissionChildUserRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChop(model *model.FissionChop) *model.FissionChop { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChopHelp(model *model.FissionChopHelp) *model.FissionChopHelp { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChopReward(model *model.FissionChopReward) *model.FissionChopReward { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionConfig(model *model.FissionConfig) *model.FissionConfig { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionDice(model *model.FissionDice) *model.FissionDice { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionDiceCollect(model *model.FissionDiceCollect) *model.FissionDiceCollect { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionDiceMap(model *model.FissionDiceMap) *model.FissionDiceMap { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func FissionDiceMapGroup(model *model.FissionDiceMapGroup) *model.FissionDiceMapGroup { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionDiceProp(model *model.FissionDiceProp) *model.FissionDiceProp { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionDiceRecord(model *model.FissionDiceRecord) *model.FissionDiceRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionDiceRun(model *model.FissionDiceRun) *model.FissionDiceRun { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionFlip(model *model.FissionFlip) *model.FissionFlip { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGrid(model *model.FissionGrid) *model.FissionGrid { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGrow(model *model.FissionGrow) *model.FissionGrow { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGrowLife(model *model.FissionGrowLife) *model.FissionGrowLife { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGrowRecord(model *model.FissionGrowRecord) *model.FissionGrowRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionKeep(model *model.FissionKeep) *model.FissionKeep { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionLangModule(model *model.FissionLangModule) *model.FissionLangModule { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionNotify(model *model.FissionNotify) *model.FissionNotify { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionNotifyResp(model *model.FissionNotifyResp) *model.FissionNotifyResp { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionNotifyTask(model *model.FissionNotifyTask) *model.FissionNotifyTask { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionPrizeWheel(model *model.FissionPrizeWheel) *model.FissionPrizeWheel { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionQa(model *model.FissionQa) *model.FissionQa { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionQuiz(model *model.FissionQuiz) *model.FissionQuiz { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionReferral(model *model.FissionReferral) *model.FissionReferral { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionRewardRecordForm(model *model.FissionRewardRecordForm) *model.FissionRewardRecordForm { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionSign(model *model.FissionSign) *model.FissionSign { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionSignDay(model *model.FissionSignDay) *model.FissionSignDay { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionSlot(model *model.FissionSlot) *model.FissionSlot { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTargetRecord(model *model.FissionTargetRecord) *model.FissionTargetRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTemp(model *model.FissionTemp) *model.FissionTemp { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func FissionTempGroup(model *model.FissionTempGroup) *model.FissionTempGroup { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTempGroupLang(model *model.FissionTempGroupLang) *model.FissionTempGroupLang { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTempImage(model *model.FissionTempImage) *model.FissionTempImage { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTempLang(model *model.FissionTempLang) *model.FissionTempLang { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTotal(model *model.FissionTotal) *model.FissionTotal { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionTotalCycle(model *model.FissionTotalCycle) *model.FissionTotalCycle { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUser(model *model.FissionUser) *model.FissionUser { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func FissionUserActive(model *model.FissionUserActive) *model.FissionUserActive { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserAttr(model *model.FissionUserAttr) *model.FissionUserAttr { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserJattr(model *model.FissionUserJattr) *model.FissionUserJattr { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserCond(model *model.FissionUserCond) *model.FissionUserCond { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserCondRecord(model *model.FissionUserCondRecord) *model.FissionUserCondRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserCtlink(model *model.FissionUserCtlink) *model.FissionUserCtlink { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func FissionUserDylink(model *model.FissionUserDylink) *model.FissionUserDylink { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func FissionUserLevel(model *model.FissionUserLevel) *model.FissionUserLevel { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserLevelRelated(model *model.FissionUserLevelRelated) *model.FissionUserLevelRelated { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserPreCond(model *model.FissionUserPreCond) *model.FissionUserPreCond { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserStat(model *model.FissionUserStat) *model.FissionUserStat { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserTaskRecord(model *model.FissionUserTaskRecord) *model.FissionUserTaskRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionWebUser(model *model.FissionWebUser) *model.FissionWebUser { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionWin(model *model.FissionWin) *model.FissionWin { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func Form(model *model.Form) *model.Form { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func Lang(model *model.Lang) *model.Lang { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func LangTextMark(model *model.LangTextMark) *model.LangTextMark { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func LibraryQa(model *model.LibraryQa) *model.LibraryQa { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func LibraryQaGroup(model *model.LibraryQaGroup) *model.LibraryQaGroup { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func LibraryQaOption(model *model.LibraryQaOption) *model.LibraryQaOption { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func Material(model *model.Material) *model.Material { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func NotifyURL(model *model.NotifyURL) *model.NotifyURL { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func OperateLog(model *model.OperateLog) *model.OperateLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectAd(model *model.ProjectAd) *model.ProjectAd { + if model.ID == "" { + model.ID = hashid.IdBase16() + } + + return model +} + +func ProjectUser(model *model.ProjectUser) *model.ProjectUser { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func Reward(model *model.Reward) *model.Reward { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RewardLang(model *model.RewardLang) *model.RewardLang { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RewardRelated(model *model.RewardRelated) *model.RewardRelated { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ErrLog(model *model.ErrLog) *model.ErrLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignCoin(model *model.FissionCampaignCoin) *model.FissionCampaignCoin { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCoin(model *model.FissionCoin) *model.FissionCoin { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.Status == 0 { + model.Status = mtype.FissionCoinStatusWait + } + + return model +} + +func FissionCoinScene(model *model.FissionCoinScene) *model.FissionCoinScene { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCoinLog(model *model.FissionCoinLog) *model.FissionCoinLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionPointsLog(model *model.FissionPointsLog) *model.FissionPointsLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCustomBtn(model *model.FissionCustomBtn) *model.FissionCustomBtn { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionSignLog(model *model.FissionSignLog) *model.FissionSignLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserTaskReward(model *model.FissionUserTaskReward) *model.FissionUserTaskReward { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserAttrTotal(model *model.FissionUserAttrTotal) *model.FissionUserAttrTotal { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func UserBehavior(model *model.UserBehavior) *model.UserBehavior { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionBallotLog(model *model.FissionBallotLog) *model.FissionBallotLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionQaLog(model *model.FissionQaLog) *model.FissionQaLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionQuizLog(model *model.FissionQuizLog) *model.FissionQuizLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RewardPush(model *model.RewardPush) *model.RewardPush { + if model.ID == "" { + model.ID = hashid.Id() + } + + if model.Status == 0 { + model.Status = mtype.RewardPushStatusWait + } + + return model +} + +func RewardPushLog(model *model.RewardPushLog) *model.RewardPushLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RewardPushTask(model *model.RewardPushTask) *model.RewardPushTask { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionPointsDeduct(model *model.FissionPointDeduct) *model.FissionPointDeduct { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func CompanyMade(model *model.CompanyMade) *model.CompanyMade { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func LvApiLog(model *model.LvAPILog) *model.LvAPILog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionClientReward(model *model.FissionClientReward) *model.FissionClientReward { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignPointsUse(model *model.FissionCampaignPointsUse) *model.FissionCampaignPointsUse { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUserTaskValid(model *model.FissionUserTaskValid) *model.FissionUserTaskValid { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignChat(model *model.FissionCampaignChat) *model.FissionCampaignChat { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChat(model *model.FissionChat) *model.FissionChat { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionChatMsg(model *model.FissionChatMsg, val mtype.ChatMsgVal) *model.FissionChatMsg { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetVal(val) + + return model +} + +func TCoin(model *model.TCoin) *model.TCoin { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func TCoinLang(model *model.TCoinLang) *model.TCoinLang { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RedeemMall(model *model.RedeemMall) *model.RedeemMall { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.Status == 0 { + model.Status = mtype.RedeemMallStatusWait + } + + return model +} + +func RedeemMallItem(model *model.RedeemMallItem) *model.RedeemMallItem { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.UseStock == 0 { + model.UseStock = -1 + } + + return model +} + +func RedeemMallItemTask(model *model.RedeemMallItemTask) *model.RedeemMallItemTask { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectUserCoin(model *model.ProjectUserCoin, sourceData map[string]string) *model.ProjectUserCoin { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetSourceData(sourceData) + + return model +} + +func RedeemMallRelate(model *model.RedeemMallRelate) *model.RedeemMallRelate { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectUserInfoLog(model *model.ProjectUserInfoLog) *model.ProjectUserInfoLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectUserCoinLog(model *model.ProjectUserCoinLog) *model.ProjectUserCoinLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectUserCoinDeduct(model *model.ProjectUserCoinDeduct) *model.ProjectUserCoinDeduct { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func RedeemMallRecord(model *model.RedeemMallRecord) *model.RedeemMallRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.Status == 0 { + model.Status = mtype.RedeemMallStatusWait + } + + return model +} + +func ProjectUserCoinExpired(model *model.ProjectUserCoinExpired) *model.ProjectUserCoinExpired { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignVs(model *model.FissionCampaignV) *model.FissionCampaignV { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignVsSchedule(model *model.FissionCampaignVsSchedule, vsTeamIds []int64, otherVote []string) *model.FissionCampaignVsSchedule { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetVsTeamIds(vsTeamIds) + model.SetOtherVote(otherVote) + + return model +} + +func FissionCampaignVsTeam(model *model.FissionCampaignVsTeam) *model.FissionCampaignVsTeam { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionVs(model *model.FissionV) *model.FissionV { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionVsVote(model *model.FissionVsVote) *model.FissionVsVote { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionVsLog(model *model.FissionVsLog) *model.FissionVsLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionVsVoteSettlement(model *model.FissionVsVoteSettlement) *model.FissionVsVoteSettlement { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectUserCoinUse(model *model.ProjectUserCoinUse, ids []int64) *model.ProjectUserCoinUse { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetCoinIds(ids) + + return model +} + +func FissionCampaignUno(model *model.FissionCampaignUno, propMarks []string) *model.FissionCampaignUno { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetPropMarks(propMarks) + + return model +} + +func FissionCampaignUnoGroup(model *model.FissionCampaignUnoGroup, rule mtype.UnoLimitRule) *model.FissionCampaignUnoGroup { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetLimitRule(rule) + + return model +} + +func FissionCampaignUnoCard(model *model.FissionCampaignUnoCard) *model.FissionCampaignUnoCard { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUnoLog(model *model.FissionUnoLog, val mtype.UnoLogVal) *model.FissionUnoLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetVal(val) + + return model +} + +func FissionUno(model *model.FissionUno) *model.FissionUno { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUnoCollect(model *model.FissionUnoCollect, cardInfo []int32) *model.FissionUnoCollect { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetCardInfo(cardInfo) + + return model +} + +func FissionCampaignEvent(model *model.FissionCampaignEvent, rewards []*mtype.EventReward) *model.FissionCampaignEvent { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + model.SetRewards(rewards) + + return model +} + +func FissionUserEvent(model *model.FissionUserEvent) *model.FissionUserEvent { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func GameLink(model *model.GameLink) *model.GameLink { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func GameUser(model *model.GameUser) *model.GameUser { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + if model.HashID == "" { + model.HashID = hashid.Id() + } + + return model +} + +func GameTotal(model *model.GameTotal) *model.GameTotal { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func GameTotalDate(model *model.GameTotalDate) *model.GameTotalDate { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func ProjectUserCoinRecord(model *model.ProjectUserCoinRecord) *model.ProjectUserCoinRecord { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGashaponLog(model *model.FissionGashaponLog) *model.FissionGashaponLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionGashapon(model *model.FissionGashapon) *model.FissionGashapon { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignGashapon(model *model.FissionCampaignGashapon) *model.FissionCampaignGashapon { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignRewardAdd(model *model.FissionCampaignRewardAdd) *model.FissionCampaignRewardAdd { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionCampaignRewardAddLog(model *model.FissionCampaignRewardAddLog) *model.FissionCampaignRewardAddLog { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} + +func FissionUnlockReward(model *model.FissionUnlockReward) *model.FissionUnlockReward { + if model.ID == 0 { + model.ID = hashid.IdBigint() + } + + return model +} diff --git a/internal/server/depend/micro.go b/internal/server/depend/micro.go new file mode 100644 index 0000000..baaec7f --- /dev/null +++ b/internal/server/depend/micro.go @@ -0,0 +1,7 @@ +package depend + +import ( + "gits.branchcn.com/backend/microcode/micro" +) + +var M micro.Micro diff --git a/internal/server/server.go b/internal/server/server.go new file mode 100644 index 0000000..2e8dd09 --- /dev/null +++ b/internal/server/server.go @@ -0,0 +1,126 @@ +package server + +import ( + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/handler" + "joybuywork/internal/server/depend" + w_campaignpb "joybuywork/proto/go_proto/w_campaign" + w_campaign_statpb "joybuywork/proto/go_proto/w_campaign_stat" + w_campaign_userpb "joybuywork/proto/go_proto/w_campaign_user" + w_coinpb "joybuywork/proto/go_proto/w_coin" + w_commonpb "joybuywork/proto/go_proto/w_common" + w_fissionpb "joybuywork/proto/go_proto/w_fission" + w_fission_webpb "joybuywork/proto/go_proto/w_fission_web" + w_gamespb "joybuywork/proto/go_proto/w_games" + w_librarypb "joybuywork/proto/go_proto/w_library" + w_mallpb "joybuywork/proto/go_proto/w_mall" + w_open_platformpb "joybuywork/proto/go_proto/w_open_platform" + w_projectpb "joybuywork/proto/go_proto/w_project" + w_project_userpb "joybuywork/proto/go_proto/w_project_user" + w_registerpb "joybuywork/proto/go_proto/w_register" + w_rewardpb "joybuywork/proto/go_proto/w_reward" + w_scriptpb "joybuywork/proto/go_proto/w_script" + w_userpb "joybuywork/proto/go_proto/w_user" + + "gits.branchcn.com/backend/microcode/micro" + "go-micro.dev/v4/client" + "go-micro.dev/v4/server" +) + +func Run() (err error) { + depend.M = micro.Grpc(micro.GrpcConfig{ + ServerName: consts.ServiceName, + EtcdAddress: config.Config.Etcd.Address, + CallWrapper: []client.CallWrapper{ + CallWrapper(), + }, + HandlerWrapper: []server.HandlerWrapper{ + TradeWrapper(), + Recover(), + HandlerWrapper(), + }, + //Profile: http.NewProfile(profile.Name(consts.ServiceName)), + }) + + err = w_userpb.RegisterWUserHandler(depend.M.Server(), new(handler.WUserServer)) + if err != nil { + return + } + err = w_registerpb.RegisterWRegisterHandler(depend.M.Server(), new(handler.WRegisterServer)) + if err != nil { + return + } + err = w_projectpb.RegisterWProjectHandler(depend.M.Server(), new(handler.WProjectServer)) + if err != nil { + return + } + err = w_commonpb.RegisterWCommonHandler(depend.M.Server(), new(handler.WCommonServer)) + if err != nil { + return + } + err = w_fissionpb.RegisterWFissionHandler(depend.M.Server(), new(handler.WFissionServer)) + if err != nil { + return + } + err = w_campaignpb.RegisterWCampaignHandler(depend.M.Server(), new(handler.WCampaignServer)) + if err != nil { + return + } + err = w_campaign_statpb.RegisterWCampaignStatHandler(depend.M.Server(), new(handler.WCampaignStatServer)) + if err != nil { + return + } + err = w_campaign_userpb.RegisterWCampaignUserHandler(depend.M.Server(), new(handler.WCampaignUserServer)) + if err != nil { + return + } + err = w_scriptpb.RegisterWScriptHandler(depend.M.Server(), new(handler.WScriptServer)) + if err != nil { + return + } + err = w_fission_webpb.RegisterWFissionWebHandler(depend.M.Server(), new(handler.WFissionWebServer)) + if err != nil { + return + } + err = w_librarypb.RegisterWLibraryHandler(depend.M.Server(), new(handler.WLibraryServer)) + if err != nil { + return + } + err = w_rewardpb.RegisterWRewardHandler(depend.M.Server(), new(handler.WRewardServer)) + if err != nil { + return + } + err = w_open_platformpb.RegisterWOpenPlatformHandler(depend.M.Server(), new(handler.WOpenPlatformServer)) + if err != nil { + return + } + err = w_coinpb.RegisterWCoinHandler(depend.M.Server(), new(handler.WCoinServer)) + if err != nil { + return + } + + err = w_mallpb.RegisterWMallHandler(depend.M.Server(), new(handler.WMallServer)) + if err != nil { + return + } + + err = w_project_userpb.RegisterWProjectUserHandler(depend.M.Server(), new(handler.WProjectUserServer)) + if err != nil { + return + } + + err = w_gamespb.RegisterWGamesHandler(depend.M.Server(), new(handler.WGamesServer)) + if err != nil { + return + } + + go func() { + err = depend.M.Run() + if err != nil { + panic(err) + } + }() + + return +} diff --git a/internal/server/wrapper.go b/internal/server/wrapper.go new file mode 100644 index 0000000..a493b9a --- /dev/null +++ b/internal/server/wrapper.go @@ -0,0 +1,102 @@ +package server + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/plugins/printer" + "joybuywork/proto/go_proto/workerr" + "fmt" + "github.com/rs/xid" + "go-micro.dev/v4/client" + "go-micro.dev/v4/metadata" + "go-micro.dev/v4/registry" + "go-micro.dev/v4/server" + "time" +) + +func Recover() server.HandlerWrapper { + return func(handlerFunc server.HandlerFunc) server.HandlerFunc { + return func(ctx context.Context, req server.Request, rsp interface{}) (err error) { + defer func() { + if r := recover(); r != nil { + body, _ := jsonm.Marshal(req.Body()) + // 捕获后发送到微信处理 + var errMsg string + errMsg += "环境:" + config.Config.Server.Env + "\n" + errMsg += "请求服务:[" + string(req.Service()) + "]" + req.Endpoint() + "\n" + errMsg += "请求rawData:" + body.ToString() + "\n" + errMsg += "错误内容:" + fmt.Sprintf("%s", r) + app.Logger.ErrorWithStack(ctx, errMsg) + err = workerr.ServerError + } + }() + + return handlerFunc(ctx, req, rsp) + } + } +} + +func HandlerWrapper() server.HandlerWrapper { + return func(handlerFunc server.HandlerFunc) server.HandlerFunc { + return func(ctx context.Context, req server.Request, rsp interface{}) (err error) { + + start := time.Now() + rbody, _ := jsonm.Marshal(req.Body()) + sl := printer.NewSlowLog(ctx) + uri := fmt.Sprintf("%s/%s", req.Service(), req.Method()) + app.Collect(uri) + + sl.Start(fmt.Sprintf("uri: %s, req: %s", uri, rbody.ToString())) + defer func() { + body, _ := jsonm.Marshal(rsp) + sl.End( + fmt.Sprintf("res: %s, err: %v, time: %12v", body.ToString(), err, time.Since(start)), + err, + uri, + rbody.ToString(), + body.ToString(), + ) + }() + + return handlerFunc(ctx, req, rsp) + } + } +} + +func TradeWrapper() server.HandlerWrapper { + return func(handlerFunc server.HandlerFunc) server.HandlerFunc { + return func(ctx context.Context, req server.Request, rsp interface{}) error { + if tradeId, ok := metadata.Get(ctx, consts.TraceIdKey); ok && tradeId != "" { + ctx = context.WithValue(ctx, consts.TraceIdKey, tradeId) + } else { + ctx = context.WithValue(ctx, consts.TraceIdKey, xid.New().String()) + } + + ctx = context.WithValue(ctx, consts.CtxReqId, xid.New().String()) + + return handlerFunc(ctx, req, rsp) + } + } +} + +// CallWrapper 中间件 +func CallWrapper() client.CallWrapper { + return func(callFunc client.CallFunc) client.CallFunc { + return func(ctx context.Context, node *registry.Node, req client.Request, rsp interface{}, opts client.CallOptions) (err error) { + start := time.Now() + defer func() { + latency := time.Since(start) + body, _ := jsonm.Marshal(rsp) + printer.Print(ctx, fmt.Sprintf("cres: %s, err: %v, time: %12v", body.ToString(), err, latency), err) + }() + + body, _ := jsonm.Marshal(req.Body()) + printer.Print(ctx, fmt.Sprintf("uri: %s_%s, creq: %s", req.Service(), req.Method(), body.ToString()), nil) + + return callFunc(ctx, node, req, rsp, opts) + } + } +} diff --git a/internal/service/cmm/cmm.go b/internal/service/cmm/cmm.go new file mode 100644 index 0000000..45e7d55 --- /dev/null +++ b/internal/service/cmm/cmm.go @@ -0,0 +1,658 @@ +package cmm + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + pr "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + "strings" + "time" + + deventpb "gits.branchcn.com/backend/deeplink/proto/go_proto/devent" + bi_analyzepb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_analyze" + "gits.branchcn.com/backend/microcode/plugins/derivative/bucket" + linkpb "gits.branchcn.com/backend/shortlink/proto/go_proto/link" + "gorm.io/gen" + "gorm.io/gen/field" +) + +type CMM struct { + ctx context.Context + be *merr.BusinessError + dao *dao.Query +} + +func NewCMM(ctx context.Context, dao *dao.Query) *CMM { + return &CMM{ + ctx: ctx, + be: merr.NewBE(ctx), + dao: dao, + } +} + +// GetDomain 获取项目域名 +func (s *CMM) GetDomain() (domain string) { + domain = app.NewLastingBucket(s.ctx, ckey.ProjectDomainBucket(), func(ctx context.Context) string { + return utils.GetRandEnStr(6) + }, bucket.UseCheckValue(func(ctx context.Context, val string) bool { + m := dao.Project + + exist, err := m.WithContext(ctx).Where(m.Domain.Eq(val)).Take() + if err = dbcheck.DbError(err); err != nil || exist != nil { + return false + } + + return true + })).BucketOnly().GetValue() + + return +} + +// GetFissionConfig 获取玩法配置 +func (s *CMM) GetFissionConfig(projectId int64) (conf *model.FissionConfig, err error) { + m := s.dao.FissionConfig + + conf, err = m.WithContext(s.ctx).Where(m.ProjectID.Eq(projectId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if conf != nil { + return + } + + lc := app.NewRedisLock(s.ctx, ckey.FissionConfigOnce(projectId)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + conf, err = m.WithContext(s.ctx).Where(m.ProjectID.Eq(projectId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if conf != nil { + return + } + + conf = withdefault.FissionConfig(&model.FissionConfig{ + ProjectID: projectId, + DynamicCampaign: 0, + }) + + if err = m.WithContext(s.ctx).Create(conf); err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +// CreateContentLink 创建带内容的链接 +func (s *CMM) CreateContentLink(user *model.FissionUser, markId int64, mark string) (ct *model.FissionUserCtlink, err error) { + lc := app.NewRedisLock(s.ctx, ckey.FissionUserContentLinkStoreOnce(user.ID, markId, mark)) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.OnceLockError + return + } + + m := s.dao.FissionUserCtlink + ct, err = m.WithContext(s.ctx).Where(m.UserID.Eq(user.ID), m.MarkID.Eq(markId), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if ct != nil { + return + } + + cpn, err := finder.Campaign(s.ctx, user.CampaignID) + if err != nil { + err = s.be.CacheError(err) + return + } + + project, err := finder.Project(s.ctx, cpn.ProjectID) + if err != nil { + err = s.be.CacheError(err) + return + } + + channelM := s.dao.FissionCampaignChannel + channel, err := channelM.WithContext(s.ctx).Where(channelM.ID.Eq(user.ChannelID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = dbcheck.DbError(err) + return + } + + ct = withdefault.FissionUserCtlink(&model.FissionUserCtlink{ + CampaignID: user.CampaignID, + UserID: user.ID, + Mark: mark, + MarkID: markId, + }) + + link := blink.NewCampaignLink(project.Domain, cpn.HashID, channel.Mark, blink.SetSubUserId(user.SubUserID), blink.SetCtLinkId(ct.HashID)).CampaignContentLink() + data, _ := app.NewShortLinkNameLink().CreateShortLink(s.ctx, &linkpb.CreateShortLinkReq{ + LongLink: link, + Domain: project.Domain, + }) + + if data.GetShortLink() == "" { + return + } + + ct.LinkURL = data.GetShortLink() + + err = m.WithContext(s.ctx).Create(ct) + if err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +// UserCampaignType 获取活动对应的用户所属类型数据 +func (s *CMM) UserCampaignType(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, langMark, lvMark, countryMark string) (uct consts.CampaignUserType, err error) { + var userLang, userLevelMark, userCountry string + var userLevel int64 + defer func() { + + if userLevel > 0 && userLevelMark == "" { + level, _ := cache.NewFissionUserLevel(s.ctx).FindById(userLevel) + userLevelMark = level.Mark + } + + uct.LangMark, uct.LevelId, uct.LevelMark, uct.CountryMark = userLang, userLevel, userLevelMark, userCountry + }() + + ful := finder.NewFuserLayer(conf) + + switch conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel: + var dfId int64 + lvMarks := strings.Split(lvMark, ",") + for _, mark := range lvMarks { + var lvId int64 + lvId, err = cache.NewFissionUserLevel(s.ctx).FindByMarkId(cpn.ProjectID, mark) + if err != nil { + err = s.be.CacheError(err) + return + } + + if lvId == 0 { + continue + } + + if dfId == 0 { + dfId = lvId + } + + _, df := ful.Level().Selected(lvId) + if !df { + userLevel = lvId + userLevelMark = mark + break + } + + } + + if userLevel == 0 { + userLevel, _ = ful.Level().Selected(0) + } + + case mtype.FissionRewardGroupLang: + userLang, _ = ful.Lang().Selected(langMark) + case mtype.FissionRewardGroupLangAndUserLevel: + + userLang, _ = ful.LangLevel().GetLang(langMark) + + var dfId int64 + lvMarks := strings.Split(lvMark, ",") + for _, mark := range lvMarks { + var lvId int64 + lvId, err = cache.NewFissionUserLevel(s.ctx).FindByMarkId(cpn.ProjectID, mark) + if err != nil { + err = s.be.CacheError(err) + return + } + + if lvId == 0 { + continue + } + + if dfId == 0 { + dfId = lvId + } + + _, df := ful.LangLevel().GetLevel(userLang, lvId) + if !df { + userLevel = lvId + userLevelMark = mark + } + } + + if userLevel == 0 { + userLevel, _ = ful.LangLevel().GetLevel(userLang, 0) + } + + case mtype.FissionRewardGroupCountry: + userCountry, _ = ful.Country().Selected(countryMark) + } + + return +} + +// UserBindChannel 获取用户要绑定的站内渠道 +func (s *CMM) UserBindChannel(cpnId int64, cmark string) (channel *model.FissionCampaignChannel, err error) { + clM := s.dao.FissionCampaignChannel + if cmark != "" { + channel, err = cache.NewCampaignChannel(s.ctx).FindByMark(cpnId, cmark) + if err != nil { + err = s.be.CacheError(err) + return + } + + if channel != nil { + return + } + } + + data, err := lockdo.Bytes(s.ctx, ckey.FissionDefaultAppChannel(cpnId), func() (num []byte, err error) { + //找不到 渠道就用默认渠道 + channel, err = clM.WithContext(s.ctx).Where( + clM.CampaignID.Eq(cpnId), + clM.IsDefault.Eq(mtype.Yes), + clM.IsDel.Eq(mtype.No), + clM.CType.Eq(mtype.FissionCampaignChannelTypeApp), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + return jsonm.MarshalCkZero(channel) + }) + + if err != nil { + err = s.be.CacheError(err) + return + } + + channel = &model.FissionCampaignChannel{} + _ = jsonm.Unmarshal(data, channel) + + return +} + +// UserAppReward 获取用户在app内的活动奖品 +func (s *CMM) UserAppReward(user *model.FissionUser, orders ...field.Expr) (list []*model.FissionCampaignReward, err error) { + conf, err := cache.NewCampaignConfig(s.ctx).FindByCampaignId(user.CampaignID) + if err != nil { + err = s.be.CacheError(err) + return + } + + userLang, userLevel, userCountry := user.UserLang, user.UserLevel, user.UserCountry + + m := s.dao.FissionCampaignReward + var conds = []gen.Condition{ + m.CampaignID.Eq(user.CampaignID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + m.IsDel.Eq(mtype.No), + } + + switch conf.RewardGroup { + case mtype.FissionRewardGroupLang: + conds = append(conds, m.LangMark.Eq(userLang)) + case mtype.FissionRewardGroupUserLevel: + conds = append(conds, m.LevelID.Eq(userLevel)) + case mtype.FissionRewardGroupLangAndUserLevel: + conds = append(conds, m.LangMark.Eq(userLang), m.LevelID.Eq(userLevel)) + case mtype.FissionRewardGroupCountry: + conds = append(conds, m.CountryMark.Eq(userCountry)) + default: + + } + + query := m.WithContext(s.ctx).Where(conds...) + if len(orders) > 0 { + query = query.Order(orders...) + } else { + query = query.Order(m.Sort, m.ID) + } + + list, err = query.Find() + if err != nil { + err = s.be.MysqlError(err) + return + } + return +} + +type UserAppRewardInfo struct { + RewardId int64 + Title string + ImgUrl string +} + +// UserAppRewardInfo 获取用户在app内的活动奖品信息 +func (s *CMM) UserAppRewardInfo(cpn *model.FissionCampaign, user *model.FissionUser) (list map[int64]*UserAppRewardInfo, err error) { + rewards, err := s.UserAppReward(user) + if err != nil { + return + } + + var brIds []int64 + var dm = make(map[int64][]int64) + for _, reward := range rewards { + if _, ok := dm[reward.RewardID]; !ok { + brIds = append(brIds, reward.RewardID) + } + dm[reward.RewardID] = append(dm[reward.RewardID], reward.ID) + } + + preward, err := pr.NewRewards(s.ctx, cpn.ProjectID, brIds...) + if err != nil { + return + } + + list = make(map[int64]*UserAppRewardInfo) + for brid, rewardIds := range dm { + info := preward.AutoLang(brid, user.LangMark) + for _, v := range rewardIds { + list[v] = &UserAppRewardInfo{ + RewardId: v, + Title: info.Title, + ImgUrl: info.ImgUrl, + } + } + } + + return +} + +// CampaignCancelTask 活动下线要处理一些任务 +func (s *CMM) CampaignCancelTask(cpn *model.FissionCampaign, archiveTask bool) (err error) { + cpnId, projectId := cpn.ID, cpn.ProjectID + + // 需要更新一下统计任务的归档时间 + if archiveTask { + archiveTaskM := s.dao.FissionArchiveTask + _, err = archiveTaskM.WithContext(s.ctx). + Where(archiveTaskM.CampaignID.Eq(cpnId)). + UpdateSimple(archiveTaskM.EndTime.Value(utils.CampaignArchiveEnd(time.Now().Unix()).Unix())) + if err != nil { + return s.be.MysqlError(err) + } + + if cpn.ReportType == mtype.FissionCampaignReportTypeNew { + // 同步到统计服务去 + err = s.AnalyzeCampaign(projectId, cpnId, cpn.StartTime, time.Now().Unix(), 0) + if err != nil { + return + } + } + } + + condM := s.dao.FissionCampaignCond + _, err = condM.WithContext(s.ctx).Where( + condM.CampaignID.Eq(cpnId), + condM.IsDel.Eq(mtype.No), + ).UpdateSimple(condM.DelUse.Value(mtype.Yes), condM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.be.MysqlError(err) + } + + // 把关联的奖品数据取消关联 + relatedM := s.dao.RewardRelated + _, err = relatedM.WithContext(s.ctx).Where( + relatedM.RelateID.Eq(cpnId), + relatedM.RelateTable.Eq(dao.FissionCampaign.TableName()), + ).UpdateSimple(relatedM.CancelTime.Value(time.Now().Unix())) + if err != nil { + return s.be.MysqlError(err) + } + + // 把关联的用户登记数据取消关联 + lvRelatedM := s.dao.FissionUserLevelRelated + _, err = lvRelatedM.WithContext(s.ctx).Where( + lvRelatedM.RelateID.Eq(cpnId), + lvRelatedM.RelateTable.Eq(dao.FissionCampaign.TableName()), + ).UpdateSimple(lvRelatedM.CancelTime.Value(time.Now().Unix())) + if err != nil { + return s.be.MysqlError(err) + } + + rewardAddM := s.dao.FissionCampaignRewardAdd + _, err = rewardAddM.WithContext(s.ctx).Where( + rewardAddM.CampaignID.Eq(cpnId), + rewardAddM.IsDel.Eq(mtype.No), + ).UpdateSimple(rewardAddM.FinishAt.Value(time.Now().Unix())) + if err != nil { + return s.be.MysqlError(err) + } + + err = s.SaveEventCampaignTrigger(projectId) + if err != nil { + return + } + + return +} + +// SaveEventCampaignTrigger 同步事件触发 +func (s *CMM) SaveEventCampaignTrigger(projectId int64) (err error) { + m := s.dao.FissionCampaignCond + + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(projectId), + m.EventType.In(mtype.FissionCampaignCondEventTypeCustom), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.be.MysqlError(err) + return + } + + var eventMap = make(map[string]bool) + for _, v := range list { + isGlobal, ok := eventMap[v.Event] + if !ok || !isGlobal { + eventMap[v.Event] = verify.InArray[int8](v.TriggetType, mtype.FissionCampaignCondTriggerTypeGlobal, mtype.FissionCampaignCondTriggerTypePage) + } + } + + var eventInfo = make([]*deventpb.SaveEventCampaignTriggerReq_EventInfo, 0, len(eventMap)) + for event, isGlobal := range eventMap { + eventInfo = append(eventInfo, &deventpb.SaveEventCampaignTriggerReq_EventInfo{ + Event: event, + HaveGlobal: utils.Ternary[int32](isGlobal, 1, 0), + }) + } + + _, err = app.NewDeepLinkEvent().SaveEventCampaignTrigger(s.ctx, &deventpb.SaveEventCampaignTriggerReq{ + ProjectId: projectId, + EventInfo: eventInfo, + }) + + return +} + +// EventCanTotal 事件是否可以被计算 +func (s *CMM) EventCanTotal(cond *model.FissionCampaignCond, subUserId string, adsCondId, joinAt, actionTime int64) (can bool) { + if cond.TriggetType == mtype.FissionCampaignCondTriggerTypeGlobal { + return true + } + + if cond.TriggetType == mtype.FissionCampaignCondTriggerTypePage { + return joinAt > 0 && joinAt <= actionTime + } + + if cond.EventType == mtype.FissionCampaignCondEventTypeAds { + return cond.ID == adsCondId + } + + _, err := app.NewDeepLinkEvent().FindCampaignTaskClick(s.ctx, &deventpb.FindCampaignTaskClickReq{ + ProjectId: cond.ProjectID, + UserId: subUserId, + EventName: cond.Event, + CondId: cond.ID, + }) + + return err == nil +} + +// AnalyzeCampaign 分析活动报表 +func (s *CMM) AnalyzeCampaign(projectId, cpnId, startTime, endTime, idxId int64) (err error) { + _, err = app.NewFissionBiAnalyze().Campaign(s.ctx, &bi_analyzepb.CampaignReq{ + ProjectId: projectId, + CampaignId: cpnId, + StartTime: startTime, + EndTime: endTime, + IdxId: idxId, + }) + + return +} + +// GetUserMap 获取用户地图 +func (s *CMM) GetUserMap(user *model.FissionUser) (run *model.FissionDiceRun, err error) { + m := s.dao.FissionDiceMapGroup + + dmg, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.LangMark.Eq(user.UserLang), + m.LevelID.Eq(user.UserLevel), + m.CountryMark.Eq(user.UserCountry), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if dmg == nil { + err = workerr.NotFound("not found dice map") + return + } + + lc := app.NewFollower(s.ctx, ckey.FissionUserRunCreateOnce(user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + runM := s.dao.FissionDiceRun + run, err = runM.WithContext(s.ctx).Where(runM.UserID.Eq(user.ID), runM.DmgID.Eq(dmg.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if run != nil { + return + } + + run = withdefault.FissionDiceRun(&model.FissionDiceRun{ + CampaignID: user.CampaignID, + UserID: user.ID, + DmgID: dmg.ID, + }) + + if err = runM.WithContext(s.ctx).Create(run); err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +// LifeStatus 生命体状态修改 +func (s *CMM) LifeStatus(life *model.FissionGrowLife, die bool, nextDie int64) (err error) { + var up []field.AssignExpr + var isDie int8 = mtype.No + var mark = mtype.FissionGrowRecordGetRevive + if die { + isDie = mtype.Yes + mark = mtype.FissionGrowRecordGetDie + } + + lifeM := s.dao.FissionGrowLife + up = append(up, lifeM.IsDie.Value(isDie)) + if nextDie > 0 { + up = append(up, lifeM.DieTime.Value(nextDie)) + } + + _, err = lifeM.WithContext(s.ctx).Where(lifeM.ID.Eq(life.ID)).UpdateSimple(up...) + if err != nil { + err = s.be.MysqlError(err) + return + } + + recordM := s.dao.FissionGrowRecord + err = recordM.WithContext(s.ctx).Create(withdefault.FissionGrowRecord(&model.FissionGrowRecord{ + UserID: life.UserID, + CampaignID: life.CampaignID, + Mark: mark, + VarData: "", + })) + if err != nil { + err = s.be.MysqlError(err) + return + } + return +} + +func (s *CMM) GetCoinInfo(projectId int64, langMark string) (title, imgUrl, rewardTitle string, err error) { + coin, err := cache.NewTCoin(s.ctx).FindByProjectId(projectId) + if err != nil { + err = s.be.CacheError(err) + return + } + + if coin == nil { + return + } + + m := s.dao.TCoinLang + lang, err := m.WithContext(s.ctx).Where(m.TCoinID.Eq(coin.ID), m.LangMark.Eq(langMark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if lang == nil { + lang, err = m.WithContext(s.ctx).Where(m.TCoinID.Eq(coin.ID), m.IsDefault.Eq(mtype.Yes)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if lang == nil { + return + } + } + + return lang.Title, lang.ImgURL, coin.Title, nil +} diff --git a/internal/service/cmm/data_cache.go b/internal/service/cmm/data_cache.go new file mode 100644 index 0000000..fdcd90f --- /dev/null +++ b/internal/service/cmm/data_cache.go @@ -0,0 +1,85 @@ +package cmm + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/merr" + "fmt" + "gorm.io/gen/field" +) + +type UserAppReward struct { + ctx context.Context + be *merr.BusinessError +} + +func NewUserAppReward(ctx context.Context) UserAppReward { + return UserAppReward{ + ctx: ctx, + be: merr.NewBE(ctx), + } +} + +func (s UserAppReward) Get(dao *dao.Query, user *model.FissionUser, orders ...field.Expr) (list []*model.FissionCampaignReward, err error) { + conf, err := cache.NewCampaignConfig(s.ctx).FindByCampaignId(user.CampaignID) + if err != nil { + err = s.be.CacheError(err) + return + } + + userLang, userLevel, userCountry := user.UserLang, user.UserLevel, user.UserCountry + + var mark string + switch conf.RewardGroup { + case mtype.FissionRewardGroupLang: + mark += ":lang_" + userLang + case mtype.FissionRewardGroupUserLevel: + mark += ":lv_" + fmt.Sprint(userLevel) + case mtype.FissionRewardGroupLangAndUserLevel: + mark += fmt.Sprintf(":lang_%s:lv_%d", userLang, userLevel) + case mtype.FissionRewardGroupCountry: + mark += ":country_" + userCountry + default: + + } + + key := ckey.DataUserAppReward(user.CampaignID, mark) + + data, err := lockdo.Bytes(s.ctx, key, func() (data []byte, err error) { + rewards, err1 := NewCMM(s.ctx, dao).UserAppReward(user, orders...) + if err1 != nil { + return nil, err1 + } + + return jsonm.MarshalCkZero(rewards) + }) + + err = jsonm.Unmarshal(data, &list) + + return +} + +func (s UserAppReward) Delete(cpnId int64, rewardGroup int8, lang string, lv int64, country string) (err error) { + var mark string + switch rewardGroup { + case mtype.FissionRewardGroupLang: + mark += ":lang_" + lang + case mtype.FissionRewardGroupUserLevel: + mark += ":lv_" + fmt.Sprint(lv) + case mtype.FissionRewardGroupLangAndUserLevel: + mark += fmt.Sprintf(":lang_%s:lv_%d", lang, lv) + case mtype.FissionRewardGroupCountry: + mark += ":country_" + country + default: + + } + + return app.Redis.Cache.Del(s.ctx, ckey.DataUserAppReward(cpnId, mark)).Err() +} diff --git a/internal/service/cmm/first_create.go b/internal/service/cmm/first_create.go new file mode 100644 index 0000000..b22f1d5 --- /dev/null +++ b/internal/service/cmm/first_create.go @@ -0,0 +1,302 @@ +package cmm + +import ( + "context" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/merr" + "github.com/golang-module/carbon/v2" +) + +type FirstCreate struct { + ctx context.Context + be *merr.BusinessError + dao *dao.Query +} + +func NewFirstCreate(ctx context.Context, dao *dao.Query) *FirstCreate { + return &FirstCreate{ + ctx: ctx, + be: merr.NewBE(ctx), + dao: dao, + } +} + +func (s *FirstCreate) FissionUserStat(user *model.FissionUser) (stat *model.FissionUserStat, err error) { + statM := s.dao.FissionUserStat + stat, err = statM.WithContext(s.ctx).Where(statM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if stat == nil { + stat = withdefault.FissionUserStat(&model.FissionUserStat{ + UserID: user.ID, + CampaignID: user.CampaignID, + }) + + err = statM.WithContext(s.ctx).Create(stat) + if err != nil { + err = s.be.MysqlError(err) + return + } + } + + return +} + +func (s *FirstCreate) FissionDice(user *model.FissionUser) (player *model.FissionDice, err error) { + playerM := s.dao.FissionDice + player, err = playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if player != nil { + return + } + + confM := s.dao.FissionCampaignDice + conf, err := confM.WithContext(s.ctx).Where(confM.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if conf == nil { + return + } + + player = withdefault.FissionDice(&model.FissionDice{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: conf.InitChance, + }) + + err = playerM.WithContext(s.ctx).Create(player) + if err != nil { + err = s.be.MysqlError(err) + return + } + + if conf.InitChance == 0 { + return + } + + // 看看需不需要骰子记录 + record := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + Mark: mtype.FissionDiceRecordMarkGetRollSys, + }) + + record.SetData(&mtype.DiceRecord{ + Chance: conf.InitChance, + }) + + err = s.dao.FissionDiceRecord.WithContext(s.ctx).Create(record) + if err != nil { + err = s.be.MysqlError(err) + } + + return +} + +func (s *FirstCreate) FissionDiceProp(user *model.FissionUser, mark string) (prop *model.FissionDiceProp, err error) { + m := s.dao.FissionDiceProp + prop, err = m.WithContext(s.ctx).Where(m.UserID.Eq(user.ID), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if prop == nil { + prop = withdefault.FissionDiceProp(&model.FissionDiceProp{ + UserID: user.ID, + CampaignID: user.CampaignID, + Mark: mark, + Num: 0, + TotalNum: 0, + }) + if err = m.WithContext(s.ctx).Create(prop); err != nil { + err = s.be.MysqlError(err) + return + } + } + + return +} + +func (s *FirstCreate) FissionGrow(user *model.FissionUser) (player *model.FissionGrow, err error) { + playerM := s.dao.FissionGrow + player, err = playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if player != nil { + return + } + + confM := s.dao.FissionCampaignGrow + conf, err := confM.WithContext(s.ctx).Where(confM.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if conf == nil { + return + } + + player = withdefault.FissionGrow(&model.FissionGrow{ + UserID: user.ID, + CampaignID: user.CampaignID, + GrowNum: conf.InitNum, + PropsTime: carbon.Now().AddHours(int(conf.AutoHour)).Timestamp(), + }) + + err = playerM.WithContext(s.ctx).Create(player) + if err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +func (s *FirstCreate) FissionQa(user *model.FissionUser) (player *model.FissionQa, err error) { + playerM := s.dao.FissionQa + player, err = playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if player != nil { + return + } + + confM := s.dao.FissionCampaignQa + conf, err := confM.WithContext(s.ctx).Where(confM.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if conf == nil { + return + } + + player = withdefault.FissionQa(&model.FissionQa{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: conf.InitChance, + }) + + err = playerM.WithContext(s.ctx).Create(player) + if err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +func (s *FirstCreate) FissionBallot(user *model.FissionUser) (player *model.FissionBallot, err error) { + playerM := s.dao.FissionBallot + player, err = playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if player != nil { + return + } + + confM := s.dao.FissionCampaignBallot + conf, err := confM.WithContext(s.ctx).Where(confM.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if conf == nil { + return + } + + player = withdefault.FissionBallot(&model.FissionBallot{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: conf.InitChance, + }) + + err = playerM.WithContext(s.ctx).Create(player) + if err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +func (s *FirstCreate) FissionWin(user *model.FissionUser) (player *model.FissionWin, err error) { + playerM := s.dao.FissionWin + player, err = playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if player != nil { + return + } + + player = withdefault.FissionWin(&model.FissionWin{ + UserID: user.ID, + CampaignID: user.CampaignID, + NextStep: 1, + }) + + err = playerM.WithContext(s.ctx).Create(player) + if err != nil { + err = s.be.MysqlError(err) + return + } + + return +} + +func (s *FirstCreate) FissionReferral(user *model.FissionUser) (player *model.FissionReferral, err error) { + playerM := s.dao.FissionReferral + player, err = playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.be.MysqlError(err) + return + } + + if player != nil { + return + } + + player = withdefault.FissionReferral(&model.FissionReferral{ + UserID: user.ID, + CampaignID: user.CampaignID, + NextStep: 1, + }) + + err = playerM.WithContext(s.ctx).Create(player) + if err != nil { + err = s.be.MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/c_test.go b/internal/service/containers/c_test.go new file mode 100644 index 0000000..c9f3f9b --- /dev/null +++ b/internal/service/containers/c_test.go @@ -0,0 +1,433 @@ +package containers + +import ( + "context" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/containers/campaign" + "joybuywork/internal/service/containers/campaignuser" + "joybuywork/internal/utils/logic" + cpb "joybuywork/proto/go_proto/w_campaign" + pb "joybuywork/proto/go_proto/w_campaign_user" + lpb "joybuywork/proto/go_proto/w_library" + rpb "joybuywork/proto/go_proto/w_reward" + "testing" + + "github.com/golang-module/carbon/v2" + + _ "joybuywork/test" +) + +func TestCampaignUserSignIn(t *testing.T) { + res := &pb.SignInRes{} + + container := new(campaignuser.SignIn) + { + container.Init(context.Background()) + container.Req = &pb.SignInReq{ + UserId: 15706, + NowMouth: "", + PageType: 0, + } + container.Res = res + } + + t.Log(res.SignDate, container.Run()) +} + +func TestCampaignUserVisit(t *testing.T) { + res := &pb.VisitRes{} + + container := new(campaignuser.Visit) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.VisitReq{ + Hid: "coh2uberdj7n1v8728s0", + Uid: "", + Cid: "sS", + Wid: "", + Lang: "", + } + container.Res = res + } + + t.Log(container.Run(), res, carbon.NewCarbon().Parse("").Timestamp()) +} + +func TestRewardList(t *testing.T) { + res := &rpb.ListRes{} + + container := new(RewardList) + { + container.Init(context.Background()) + container.Req = &rpb.ListReq{ + Page: 1, + PerPage: 10, + PageLang: "zh", + ProjectHashId: "clr8qhurdj7o3ecsbai0", + Title: "", + LangMark: "", + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestCampaignStore(t *testing.T) { + res := &cpb.StoreRes{} + + container := new(campaign.Store) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &cpb.StoreReq{ + ProjectId: "X5c6Zz8CeUcwim82YXtsh9", + TemplateId: "6c309b2490001a4", + UserId: 0, + Title: "123123", + StartTime: 1711445937, + EndTime: 1717171200, + CoverUrl: "", + Config: &cpb.StoreReq_Config{ + RuleTextColor: "#FFF", + RuleBgColor: "#FFB423", + ShareText: "邀请好友 一起赢奖励 点击链接为好友助力", + HasRank: 0, + RankBackgroundColor: "", + RankTextColor: "", + DownloadPageImage: "", + IsDefaultDownload: 0, + WechatPageImage: "", + IsDefaultWechat: 0, + ImageMain: "ftg/wheel/main.png", + IsDefaultMain: 0, + ImagePreview: "", + LinkBtnTextColor: "#FFF", + LinkBtnBgColor: "#FFB752", + LinkTextColor: "#A2A2AE", + ShowShare: 1, + Share: nil, + PlayRule: "

111

", + PageTitle: "3123", + DmShow: 0, + WebBgImg: "", + HasWarmUp: 0, + WarmUpImg: "", + WarmUpEnd: 0, + IconType: 1, + IconBgColor: "#000", + DlType: 1, + DlBannerType: 1, + DlBannerImg: "", + DlBannerAppLogo: "", + DlBannerAppName: "", + DlBannerAppBtn: "", + DlBannerPosition: 1, + TopicColor: "#FF4E77", + WindowCover: 0, + }, + CampaignData: nil, + PrizeWheel: &cpb.StoreReq_LotteryConfig{ + TargetNum: 1, + InitChance: 1, + Chance: 1, + }, + Slot: nil, + Blind: nil, + Grid: nil, + Referral: nil, + QuestionAnswer: nil, + Quiz: nil, + Win: nil, + TOffset: 8, + Target: &cpb.StoreReq_Target{ + Target: 1, + Option: 1, + AppEvent: 1, + BothType: 1, + Cond: nil, + }, + Sign: nil, + Dice: nil, + Grow: nil, + Ballot: nil, + Chop: nil, + Rewards: &cpb.StoreReq_Rewards{ + RewardGroup: 1, + Normal: []*cpb.StoreReq_Reward{ + { + RewardId: 1, + Stock: 1, + InviteNum: 0, + RewardNum: 0, + IsThank: 1, + Score: 0, + SignDay: 0, + CollectNum: 0, + IsSuper: 0, + }, + { + RewardId: 6, + Stock: 1, + InviteNum: 1, + RewardNum: 0, + IsThank: 0, + Score: 0, + SignDay: 0, + CollectNum: 0, + IsSuper: 0, + }, + }, + UserLevel: nil, + Langs: nil, + LangUserLevel: nil, + }, + RewardsWeb: nil, + RewardsExtra: nil, + RewardsNewcomer: nil, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestCampaignUpdate(t *testing.T) { + res := &cpb.UpdateRes{} + + container := new(campaign.Update) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &cpb.UpdateReq{ + Id: 0, + HashId: "cparbgerdj7ll37rq060", + Title: "123", + StartTime: 1717065840, + EndTime: 1717152240, + CoverUrl: "ftg/cash/cover_url.png", + Config: &cpb.UpdateReq_Config{ + RuleTextColor: "#FFF", + RuleBgColor: "#FFB423", + ShareText: "邀请好友 一起赢奖励 点击链接为好友助力", + HasRank: 0, + RankBackgroundColor: "", + RankTextColor: "", + DownloadPageImage: "", + IsDefaultDownload: 0, + WechatPageImage: "", + IsDefaultWechat: 0, + ImageMain: "ftg/cash/main_zh.png", + IsDefaultMain: 0, + ImagePreview: "", + LinkBtnTextColor: "#FFF", + LinkBtnBgColor: "#FFB752", + LinkTextColor: "#A2A2AE", + ShowShare: 1, + Share: nil, + PlayRule: "

111

", + PageTitle: "3123", + DmShow: 0, + WebBgImg: "", + HasWarmUp: 0, + WarmUpImg: "", + WarmUpEnd: 0, + IconType: 1, + IconBgColor: "#000", + DlType: 1, + DlBannerType: 1, + DlBannerImg: "", + DlBannerAppLogo: "dynamic/logo.png", + DlBannerAppName: "", + DlBannerAppBtn: "", + DlBannerPosition: 1, + TopicColor: "#FF4E77", + WindowCover: 0, + }, + TOffset: 8, + Rewards: &cpb.UpdateReq_Rewards{ + RewardGroup: 2, + Normal: nil, + UserLevel: &cpb.UpdateReq_UserLevel{ + DefaultLevelId: 7, + LevelList: []*cpb.UpdateReq_UserLevelOne{ + { + LevelId: 7, + Rewards: []*cpb.UpdateReq_Reward{ + { + Id: 6378, + RewardId: 109335324832083968, + }, + }, + }, + { + LevelId: 8, + Rewards: []*cpb.UpdateReq_Reward{ + { + Id: 6379, + RewardId: 109333950685818880, + }, + }, + }, + }, + }, + }, + UserId: 1, + Ip: "1", + TargetOption: &cpb.UpdateReq_TargetOption{ + Target: 1, + Fixed: &cpb.UpdateReq_Fixed{ + Open: 1, + AppEvent: 1, + TargetNum: 1, + Chance: 0, + ChanceLimit: 0, + Percent: 1, + }, + Custom: nil, + }, + Cash: &cpb.UpdateReq_Cash{ + ExpiredDay: 3, + Price: 200, + PriceNum: 0, + }, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestCampaignShow(t *testing.T) { + res := &cpb.ShowRes{} + + container := new(campaign.Show) + { + container.Init(context.Background()) + container.Req = &cpb.ShowReq{ + HashId: "d5kv96mrdj7kpgfc8h40", + NotReward: false, + } + container.Res = res + } + + t.Log(container.Run(), res.TargetOption) +} + +func TestCampaignShowReward(t *testing.T) { + res := &cpb.ShowRewardRes{} + + container := new(campaign.ShowReward) + { + container.Init(context.Background()) + container.Req = &cpb.ShowRewardReq{ + CampaignId: 2714, + LangMark: "en", + LevelMark: "", + ShowLang: "", + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestCampaignRewardDetail(t *testing.T) { + res := &cpb.RewardDetailRes{} + + container := new(campaign.RewardDetail) + { + container.Init(context.Background()) + container.Req = &cpb.RewardDetailReq{ + HashId: "d1uqlumrdj7iim4807h0", + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestName(t *testing.T) { + ctx := context.Background() + + user, err := finder.FissionUser(ctx, 1, "coeg5vurdj7ssimb4u6g") + if err != nil { + return + } + + if user == nil { + t.Log(123123) + return + } + + dmgM := dao.Q.FissionDiceMapGroup + dmg, err := dmgM.WithContext(ctx).Where(dmgM.CampaignID.Eq(user.CampaignID), dmgM.LangMark.Eq(user.UserLang), dmgM.LevelID.Eq(user.UserLevel)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + m := dao.Q.FissionDiceMap + list, err := m.WithContext(ctx).Where(m.CampaignID.Eq(user.CampaignID), m.DmgID.Eq(dmg.ID)).Find() + if err != nil { + return + } + + if len(list) == 0 { + return + } + + cpn, err := finder.Campaign(ctx, user.CampaignID) + if err != nil { + return + } + + rewardMap, err := cmm.NewCMM(ctx, dao.Q).UserAppRewardInfo(cpn, user) + if err != nil { + return + } + + var ll []*pb.DiceMapRes_One + + var add = func(i int) { + v := list[i] + one := &pb.DiceMapRes_One{ + MapHashId: v.HashID, + MarkType: int32(v.MarkType), + RewardTitle: "", + ImgUrl: "", + } + + if reward, ok := rewardMap[v.RewardID]; ok { + one.RewardTitle = reward.Title + one.ImgUrl = reward.ImgUrl + one.RewardId = reward.RewardId + } + + ll = append(ll, one) + } + + for i := 0; i < 6; i++ { + add(i) + } + + t.Log(ll) +} + +func TestLibraryQaRand(t *testing.T) { + res := &lpb.QaRandRes{} + + container := new(LibraryQaRand) + { + container.Init(context.Background()) + container.Req = &lpb.QaRandReq{ + CampaignId: 5017, + GroupHashId: "ctfsrrerdj7qqih3vml0", + LangMark: "en", + UserId: 314377173277581312, + } + container.Res = res + } + + t.Log(container.Run(), res) +} diff --git a/internal/service/containers/campaign/ads_show.go b/internal/service/containers/campaign/ads_show.go new file mode 100644 index 0000000..1c5f79d --- /dev/null +++ b/internal/service/containers/campaign/ads_show.go @@ -0,0 +1,196 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" +) + +type AdsShow struct { + logic.Logic + Req *pb.AdsShowReq + Res *pb.AdsShowRes + + project *model.Project + temp *model.FissionTemp +} + +func (s *AdsShow) Run() error { + return logic.Run(s) +} + +func (s *AdsShow) Exec() (err error) { + cpn, err := s.setCampaign() + if err != nil { + return + } + + err = s.setDelayLinkData(cpn) + if err != nil { + return + } + + err = s.serReward(cpn) + if err != nil { + return + } + + err = s.fission(cpn) + if err != nil { + return + } + + return +} + +// 设置活动数据 +func (s *AdsShow) setCampaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetHashId()) + if err != nil { + return nil, s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("campaign not found") + return + } + + cc := cache.NewCampaignConfig(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + s.Res.Title = cpn.Title + s.Res.TempId = cpn.TemplateID + s.Res.ProjectId = cpn.ProjectID + s.Res.FissionMark = consts.FissionIdMap[cpn.FissionID] + s.Res.Status = int32(cpn.Status) + s.Res.PageTitle = conf.PageTitle + s.Res.BgImg = conf.ImageMain + s.Res.TOffset = cpn.TOffset + s.Res.TStart = cpn.TStart + s.Res.TEnd = cpn.TEnd + s.Res.CoverUrl = cpn.CoverURL + s.Res.Target = int32(cpn.Target) + s.Res.Countdown = conf.Countdown + s.Res.FissionId = cpn.FissionID + + return + }) + + return +} + +// 设置延迟深度链接数据 +func (s *AdsShow) setDelayLinkData(cpn *model.FissionCampaign) (err error) { + res, err := app.NewDeepLinkLink().GetCampaignDataList(s.Ctx, &dlinkpb.GetCampaignDataListReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + }) + if err != nil { + return + } + + s.Res.DelayLinkData = make([]*pb.AdsShowRes_KV, 0, len(res.GetList())) + for _, v := range res.GetList() { + s.Res.DelayLinkData = append(s.Res.DelayLinkData, &pb.AdsShowRes_KV{ + Key: v.GetKey(), + Value: v.GetVal(), + }) + } + + return +} + +func (s *AdsShow) serReward(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bIds []int64 + for _, v := range list { + bIds = append(bIds, v.RewardID) + } + + prewards, err := provider.NewRewards(s.Ctx, cpn.ProjectID, bIds...) + if err != nil { + return + } + + langMark := cpn.GetLangMarks()[0] + + s.AddAfterRun(func() (err error) { + s.Res.Rewards = make([]*pb.AdsShowRes_Reward, 0, len(list)) + for _, v := range list { + info, _ := prewards.InfoAutoLang(v.RewardID, langMark) + + one := &pb.AdsShowRes_Reward{ + Id: v.ID, + RewardId: v.RewardID, + Odds: v.Odds, + Title: info.Title, + ImgUrl: info.ImgUrl, + KvData: make([]*pb.AdsShowRes_KV, 0, len(info.KvData)), + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Url: info.Url, + } + + for _, kv := range info.KvData { + one.KvData = append(one.KvData, &pb.AdsShowRes_KV{ + Key: kv.Key, + Value: kv.Value, + }) + } + + s.Res.Rewards = append(s.Res.Rewards, one) + + } + + return + }) + + return +} + +func (s *AdsShow) fission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdAdsFlip: + return s._flip(cpn) + default: + return + } +} + +func (s *AdsShow) _flip(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignFlip + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf != nil { + s.Res.Flip = &pb.AdsShowRes_Flip{CardImg: conf.CardImg} + } + + return +} diff --git a/internal/service/containers/campaign/ads_store.go b/internal/service/containers/campaign/ads_store.go new file mode 100644 index 0000000..0344fbf --- /dev/null +++ b/internal/service/containers/campaign/ads_store.go @@ -0,0 +1,347 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + "time" +) + +type AdsStore struct { + logic.Logic + Req *pb.AdsStoreReq + Res *pb.AdsStoreRes + + project *model.Project + temp *model.FissionTemp +} + +func (s *AdsStore) Run() error { + return logic.Run(s) +} + +func (s *AdsStore) Exec() (err error) { + err = s.depend() + if err != nil { + return + } + + cpn, err := s.create() + if err != nil { + return + } + + err = s.createConfig(cpn) + if err != nil { + return + } + + err = s.createDefault(cpn) + if err != nil { + return + } + + err = s.createReward(cpn) + if err != nil { + return + } + + err = s.fission(cpn) + if err != nil { + return + } + + err = s.createLink(cpn) + if err != nil { + return + } + + err = s.saveDelayLinkData(cpn) + if err != nil { + return + } + + return +} + +func (s *AdsStore) depend() (err error) { + project, err := finder.Project(s.Ctx, s.Req.GetProjectId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + + tempM := s.GetDao().FissionTemp + + temp, err := tempM.WithContext(s.Ctx).Where(tempM.HashID.Eq(s.Req.GetTemplateId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil { + return workerr.NotFound("temp not found") + } + + s.project = project + s.temp = temp + + return +} + +// 创建活动 +func (s *AdsStore) create() (cpn *model.FissionCampaign, err error) { + startTime := time.Now().Unix() + cpn = withdefault.FissionCampaign(&model.FissionCampaign{ + FissionID: s.temp.FissionID, + ProjectID: s.project.ID, + CreatorID: s.Req.GetUserId(), + TemplateID: s.temp.ID, + StartTime: timez.GMT(startTime, 8), + TOffset: 8, + TStart: startTime, + Title: s.Req.GetTitle(), + Status: mtype.FissionCampaignStatusPub, + Target: mtype.FissionCampaignConfigTargetAdsGame, + }) + + cpn.CoverURL, err = s._getCoverUrl() + if err != nil { + return + } + + cpn.SetLangTypes([]int8{s.temp.LangType}) + + m := s.GetDao().FissionCampaign + if err = m.WithContext(s.Ctx).Create(cpn); err != nil { + return nil, s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + return + }) + + return +} + +// 创建配置 +func (s *AdsStore) createConfig(cpn *model.FissionCampaign) (err error) { + conf := withdefault.FissionCampaignConfig(&model.FissionCampaignConfig{ + CampaignID: cpn.ID, + ImageMain: s.Req.GetBgImg(), + PageTitle: s.Req.GetPageTitle(), + Countdown: s.Req.GetCountdown(), + }) + + m := s.GetDao().FissionCampaignConfig + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + style := withdefault.FissionCampaignStyle(&model.FissionCampaignStyle{ + CampaignID: cpn.ID, + MainImg: s.Req.GetBgImg(), + PageTitle: s.Req.GetPageTitle(), + }) + + styleM := s.GetDao().FissionCampaignStyle + if err = styleM.WithContext(s.Ctx).Create(style); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建奖品 +func (s *AdsStore) createReward(cpn *model.FissionCampaign) (err error) { + var relateIds []int64 + var relateMap = make(map[int64]string) + var add = make([]*model.FissionCampaignReward, 0, len(s.Req.GetRewards())) + for _, v := range s.Req.GetRewards() { + add = append(add, withdefault.FissionCampaignReward(&model.FissionCampaignReward{ + CampaignID: cpn.ID, + RewardID: v.GetRewardId(), + Odds: v.GetOdds(), + })) + + if _, ok := relateMap[v.GetRewardId()]; !ok && v.GetRewardId() > 0 { + relateMap[v.GetRewardId()] = "" + relateIds = append(relateIds, v.GetRewardId()) + } + } + + if len(add) == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + + var relates []*model.RewardRelated + for _, v := range relateIds { + relates = append(relates, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: v, + RelateID: cpn.ID, + RelateTable: s.GetDao().FissionCampaign.TableName(), + })) + } + + relateM := s.GetDao().RewardRelated + if err = relateM.WithContext(s.Ctx).Create(relates...); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 创建默认数据 +func (s *AdsStore) createDefault(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignChannel + + // 默认站内渠道 + var mark = utils.GetRandEnStr(consts.ChannelMarkLen) + var chs = []*model.FissionCampaignChannel{ + withdefault.FissionCampaignChannel(&model.FissionCampaignChannel{ + CampaignID: cpn.ID, + IsDefault: mtype.Yes, + Mark: mark, + Title: consts.ChannelDefaultName, + CType: mtype.FissionCampaignChannelTypeApp, + }), + } + + err = m.WithContext(s.Ctx).Create(chs...) + if err != nil { + return s.BE().MysqlError(err) + } + + // 统计任务 + var atMarks = []string{mtype.FissionArchiveTaskMarkAdsHour, mtype.FissionArchiveTaskMarkAdsDay} + var archiveTasks = make([]*model.FissionArchiveTask, 0, len(atMarks)) + for _, v := range atMarks { + archiveTasks = append(archiveTasks, withdefault.FissionArchiveTask(&model.FissionArchiveTask{ + CampaignID: cpn.ID, + EndTime: 0, + Mark: v, + IsStop: mtype.Yes, + })) + } + + atm := s.GetDao().FissionArchiveTask + err = atm.WithContext(s.Ctx).Create(archiveTasks...) + if err != nil { + return s.BE().MysqlError(err) + } + + err = cmm.NewCMM(s.Ctx, s.GetDao()).AnalyzeCampaign(cpn.ProjectID, cpn.ID, cpn.StartTime, cpn.EndTime, 0) + if err != nil { + return + } + + return +} + +// 创建访问链接 +func (s *AdsStore) createLink(cpn *model.FissionCampaign) (err error) { + _, err = app.NewDeepLinkLink().CreateCampaignLinkOne(s.Ctx, &dlinkpb.CreateCampaignLinkOneReq{ + ProjectId: s.project.ID, + CampaignId: cpn.ID, + CreatedTime: cpn.CreatedAt, + }) + + if err != nil { + return + } + + return +} + +// 设置延迟深度链接数据 +func (s *AdsStore) saveDelayLinkData(cpn *model.FissionCampaign) (err error) { + var data = &dlinkpb.SaveCampaignDataListReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + Data: make([]*dlinkpb.SaveCampaignDataListReq_Data, 0, len(s.Req.GetDelayLinkData())), + } + + for _, v := range s.Req.GetDelayLinkData() { + data.Data = append(data.Data, &dlinkpb.SaveCampaignDataListReq_Data{ + Key: v.GetKey(), + Val: v.GetValue(), + }) + } + + _, err = app.NewDeepLinkLink().SaveCampaignDataList(s.Ctx, data) + if err != nil { + return + } + + return +} + +func (s *AdsStore) _getCoverUrl() (coverUrl string, err error) { + m := s.GetDao().FissionTempImage + img, err := m.WithContext(s.Ctx).Where(m.TempID.Eq(s.temp.ID), m.Mark.Eq("main")).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if img.Val != s.Req.GetBgImg() { + return s.Req.GetBgImg(), nil + } + + group, err := cache.NewFissionTempGroup(s.Ctx).FindById(s.temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return group.CoverURL, nil +} + +func (s *AdsStore) fission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdAdsFlip: + return s._flip(cpn) + default: + return + } +} + +func (s *AdsStore) _flip(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignFlip + + err = m.WithContext(s.Ctx).Create(withdefault.FissionCampaignFlip(&model.FissionCampaignFlip{ + CampaignID: cpn.ID, + InitChance: 0, + CardImg: s.Req.GetFlip().GetCardImg(), + DayChance: 0, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/campaign/ads_update.go b/internal/service/containers/campaign/ads_update.go new file mode 100644 index 0000000..40dce1d --- /dev/null +++ b/internal/service/containers/campaign/ads_update.go @@ -0,0 +1,353 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + "time" +) + +type AdsUpdate struct { + logic.Logic + Req *pb.AdsUpdateReq + Res *pb.AdsUpdateRes +} + +func (s *AdsUpdate) Run() error { + return logic.Run(s) +} + +func (s *AdsUpdate) Exec() (err error) { + cpn, err := s.update() + if err != nil { + return + } + + err = s.updateReward(cpn) + if err != nil { + return + } + + err = s.saveDelayLinkData(cpn) + if err != nil { + return + } + + err = s.fission(cpn) + if err != nil { + return + } + + return +} + +// 更新活动数据 +func (s *AdsUpdate) update() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("nof found campaign") + } + + coverUrl, err := s._getCoverUrl(cpn) + if err != nil { + return + } + + m := s.GetDao().FissionCampaign + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple( + m.Title.Value(s.Req.GetTitle()), + m.CoverURL.Value(coverUrl), + ) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cc := cache.NewCampaignConfig(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + confM := s.GetDao().FissionCampaignConfig + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple( + confM.ImageMain.Value(s.Req.GetBgImg()), + confM.PageTitle.Value(s.Req.GetPageTitle()), + confM.Countdown.Value(s.Req.GetCountdown()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + scc := cache.NewCampaignStyle(s.Ctx) + style, err := scc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + styleM := s.GetDao().FissionCampaignStyle + _, err = styleM.WithContext(s.Ctx).Where(styleM.ID.Eq(style.ID)).UpdateSimple( + styleM.MainImg.Value(s.Req.GetBgImg()), + styleM.PageTitle.Value(s.Req.GetPageTitle()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + + _ = cache.NewCampaign(s.Ctx).Clear(cpn) + _ = cc.Clear(conf) + _ = scc.Clear(style) + + return + }) + + return +} + +// 更新奖品 +func (s *AdsUpdate) updateReward(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return + } + + var oldMap = make(map[int64]*model.FissionCampaignReward, len(list)) + for _, v := range list { + oldMap[v.ID] = v + } + + var add []*model.FissionCampaignReward + for _, v := range s.Req.GetRewards() { + old, ok := oldMap[v.GetId()] + if !ok { + add = append(add, withdefault.FissionCampaignReward(&model.FissionCampaignReward{ + RewardID: v.GetRewardId(), + Odds: v.GetOdds(), + })) + continue + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple( + m.RewardID.Value(v.GetRewardId()), + m.Odds.Value(v.GetOdds()), + ) + if err != nil { + return s.BE().RedisError(err) + } + + delete(oldMap, v.GetId()) + } + + var delIds = make([]int64, 0, len(oldMap)) + for id := range oldMap { + delIds = append(delIds, id) + } + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s._updateRelate(cpn.ID) +} + +func (s *AdsUpdate) _updateRelate(cpnId int64) (err error) { + m := s.GetDao().RewardRelated + list, err := m.WithContext(s.Ctx).Where(m.RelateID.Eq(cpnId), m.RelateTable.Eq(s.GetDao().FissionCampaign.TableName())).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.RewardRelated, len(list)) + for _, v := range list { + oldMap[v.RewardID] = v + } + + var newIdsMap = make(map[int64]struct{}) + for _, v := range s.Req.GetRewards() { + if _, ok := newIdsMap[v.GetRewardId()]; !ok { + newIdsMap[v.GetRewardId()] = struct{}{} + } + } + + var add []*model.RewardRelated + for id := range newIdsMap { + relate, ok := oldMap[id] + + if !ok { + add = append(add, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: id, + RelateID: cpnId, + RelateTable: s.GetDao().FissionCampaign.TableName(), + CancelTime: 0, + })) + continue + } + + if relate.CancelTime > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(relate.ID)).UpdateSimple(m.CancelTime.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + delete(oldMap, id) + } + + var delIds = make([]int64, 0, len(oldMap)) + for _, v := range oldMap { + delIds = append(delIds, v.ID) + } + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 设置延迟深度链接数据 +func (s *AdsUpdate) saveDelayLinkData(cpn *model.FissionCampaign) (err error) { + var data = &dlinkpb.SaveCampaignDataListReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + Data: make([]*dlinkpb.SaveCampaignDataListReq_Data, 0, len(s.Req.GetDelayLinkData())), + } + + for _, v := range s.Req.GetDelayLinkData() { + data.Data = append(data.Data, &dlinkpb.SaveCampaignDataListReq_Data{ + Key: v.GetKey(), + Val: v.GetValue(), + }) + } + + _, err = app.NewDeepLinkLink().SaveCampaignDataList(s.Ctx, data) + if err != nil { + return + } + + return +} + +func (s *AdsUpdate) _getCoverUrl(cpn *model.FissionCampaign) (coverUrl string, err error) { + tempM := s.GetDao().FissionTemp + + temp, err := tempM.WithContext(s.Ctx).Where(tempM.ID.Eq(cpn.TemplateID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if temp == nil { + err = workerr.NotFound("not found temp") + return + } + + m := s.GetDao().FissionTempImage + img, err := m.WithContext(s.Ctx).Where(m.TempID.Eq(temp.ID), m.Mark.Eq("main")).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if img.Val != s.Req.GetBgImg() { + return s.Req.GetBgImg(), nil + } + + group, err := cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return group.CoverURL, nil +} + +func (s *AdsUpdate) fission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdAdsFlip: + return s._flip(cpn) + default: + return + } +} + +func (s *AdsUpdate) _flip(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignFlip + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf == nil { + err = m.WithContext(s.Ctx).Create(withdefault.FissionCampaignFlip(&model.FissionCampaignFlip{ + CampaignID: cpn.ID, + InitChance: 0, + CardImg: s.Req.GetFlip().GetCardImg(), + DayChance: 0, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } + + if conf.CardImg == s.Req.GetFlip().GetCardImg() || s.Req.GetFlip().GetCardImg() == "" { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(m.CardImg.Value(s.Req.GetFlip().GetCardImg())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/campaign/barrage.go b/internal/service/containers/campaign/barrage.go new file mode 100644 index 0000000..159f8f3 --- /dev/null +++ b/internal/service/containers/campaign/barrage.go @@ -0,0 +1,670 @@ +package campaign + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/randext" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "fmt" + "math" + "math/rand" + "time" + + "gorm.io/gen" +) + +type Barrage struct { + logic.Logic + Req *pb.BarrageReq + Res *pb.BarrageRes +} + +func (s *Barrage) Run() error { + return logic.Run(s) +} + +func (s *Barrage) Exec() (err error) { + cpn, conf, err := s.campaign() + if err != nil { + return + } + + return s.barrage(cpn, conf) +} + +// 活动数据 +func (s *Barrage) campaign() (cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("cpn not found") + return + } + + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +// 奖品处理 +func (s *Barrage) barrage(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + switch cpn.FissionID { + case consts.IdWinTogether, consts.IdReferral: //一起赢 + return s._invite(cpn, conf) + case consts.IdCash: + return s._cash(cpn) + case consts.IdGold: + return s._gold(cpn) + case consts.IdChop: + return s._chop(cpn) + case consts.IdKeep: + return s._keep(cpn) + case consts.IdFlip: + return s._flip(cpn) + case consts.IdCoin: + return s._coin(cpn) + } + + return +} + +func (s *Barrage) _reward(rewardTitle []string) { + for i := 0; i < 15; i++ { + idx := i % len(rewardTitle) + s.Res.Content = append(s.Res.Content, fmt.Sprintf("%s****%s %s", utils.GetRandEnStr(3), utils.GetRandEnStr(3), rewardTitle[idx])) + } +} + +func (s *Barrage) _invite(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + rewardM := s.GetDao().FissionCampaignReward + var conds = []gen.Condition{ + rewardM.CampaignID.Eq(cpn.ID), + rewardM.RewardType.Neq(mtype.FissionCampaignRewardTypeNewcomer), + rewardM.IsDel.Eq(mtype.No), + } + + // 获取活动对应的用户等级和用户的语言 + uct, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserCampaignType(cpn, conf, s.Req.GetLangMark(), s.Req.GetLv(), s.Req.GetCountryMark()) + if err != nil { + return + } + + userLang, userLevel := uct.LangMark, uct.LevelId + + switch conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel: + conds = append(conds, rewardM.LevelID.Eq(userLevel)) + case mtype.FissionRewardGroupLangAndUserLevel: + conds = append(conds, rewardM.LevelID.Eq(userLevel), rewardM.LangMark.Eq(userLang)) + case mtype.FissionRewardGroupLang: + conds = append(conds, rewardM.LangMark.Eq(userLang)) + } + + list, err := rewardM.WithContext(s.Ctx).Where(conds...).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + if len(list) == 0 { + return + } + + var rewardTitle []string + defer func() { + s._reward(rewardTitle) + }() + + var ids []int64 + for _, v := range list { + ids = append(ids, v.RewardID) + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, ids...) + if err != nil { + return + } + + var showLang = utils.NotExistGetFirst(s.Req.GetShowLang(), cpn.GetLangMarks()) + + for _, v := range list { + data, _ := preward.InfoAutoLang(v.RewardID, showLang) + rewardTitle = append(rewardTitle, fmt.Sprintf("%d %s", v.RewardNum, data.Title)) + } + + return +} + +func (s *Barrage) _cash(cpn *model.FissionCampaign) (err error) { + var price int32 + + spl := cpn.GetLangMarks() + + lm := utils.NotExistGetFirst(s.Req.GetShowLang(), spl) + if lm == spl[0] { + m := s.GetDao().FissionCampaignCash + var conf *model.FissionCampaignCash + conf, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if conf == nil { + return + } + + price = conf.Price + } else { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, lm) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + return + } + + if cash := lang.GetCash(); cash != nil { + price = cash.Price + } + } + + var mark = []string{"victory_tip", "min_won_barrage", "won_barrage", "closer_to_prize", "shine_arrived"} + l := len(mark) * 5 + + s.Res.TranContent = make([]*pb.BarrageRes_TranContent, 0, l) + + for i := 0; i < l; i++ { + key := mark[i%5] + one := &pb.BarrageRes_TranContent{ + Mark: fmt.Sprintf("barrage:%s", key), + ReplaceKv: nil, + } + + switch key { + case "won_barrage": + one.ReplaceKv = append(one.ReplaceKv, &pb.BarrageRes_KV{ + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, &pb.BarrageRes_KV{ + Key: "{{cash}}", + Value: fmt.Sprintf("$%d", price), + }) + case "min_won_barrage": + one.ReplaceKv = append(one.ReplaceKv, &pb.BarrageRes_KV{ + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, &pb.BarrageRes_KV{ + Key: "{{cash}}", + Value: fmt.Sprintf("$%d", price), + }, &pb.BarrageRes_KV{ + Key: "{{min}}", + Value: fmt.Sprintf("%d", rand.Intn(9)+1), + }) + } + + s.Res.TranContent = append(s.Res.TranContent, one) + } + + return +} + +func (s *Barrage) _chop(cpn *model.FissionCampaign) (err error) { + user, err := cache.NewFissionUser(s.Ctx, cpn.ID).FindById(s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(user) + if err != nil { + return + } + + var bIds []int64 + var randReward = make(map[int64]*model.FissionCampaignReward) + for _, reward := range rewards { + randReward[reward.ID] = reward + bIds = append(bIds, reward.RewardID) + } + + m := s.GetDao().FissionCampaignTicket + ticket, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.Eq(mtype.FissionCampaignTicketRewardHelp), + m.Open.Eq(mtype.Yes), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if ticket == nil { + err = workerr.NotFound("not found reward_help ticket") + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, bIds...) + if err != nil { + return + } + + var showLang = utils.NotExistGetFirst(s.Req.GetShowLang(), cpn.GetLangMarks()) + var marks = ticket.GetHelpEvent() + var markL = len(marks) + + // 20条数据 + var randMap = make(map[int]*pb.BarrageRes_TranContent, 20) + var idx int + for i := 1; i <= 20; i++ { + // 5条一组 + switch a := i % 5; { + case a < 3: // 3个奖品 + var rewardTitle string + for _, reward := range randReward { + info, _ := preward.InfoAutoLang(reward.RewardID, showLang) + rewardTitle = info.Title + } + + s.Res.TranContent = append(s.Res.TranContent) + + randMap[i] = &pb.BarrageRes_TranContent{ + Mark: "barrage:get_reward", + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + { + Key: "{{reward_title}}", + Value: rewardTitle, + }, + }, + } + + default: // 1个助力 + for j := 0; j < 2; j++ { + randMap[i] = &pb.BarrageRes_TranContent{ + Mark: fmt.Sprintf("barrage:%s", marks[idx]), + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + }, + } + + idx++ + if idx >= markL { + idx = 0 + } + } + } + } + + // 打乱一下 + for _, content := range randMap { + s.Res.TranContent = append(s.Res.TranContent, content) + } + + return +} + +func (s *Barrage) _keep(cpn *model.FissionCampaign) (err error) { + randReward, preward, showLang, err := s._rewardDepend(cpn) + if err != nil { + return + } + + // 20条数据 + s.Res.TranContent = make([]*pb.BarrageRes_TranContent, 20) + for i := 0; i < 20; i++ { + var rewardTitle, imgUrl string + for _, reward := range randReward { + info, _ := preward.InfoAutoLang(reward.RewardID, showLang) + rewardTitle, imgUrl = info.Title, info.ImgUrl + } + + s.Res.TranContent[i] = &pb.BarrageRes_TranContent{ + Mark: "barrage:get_reward", + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + { + Key: "{{reward_title}}", + Value: rewardTitle, + }, + }, + RewardImg: imgUrl, + } + } + + return +} + +func (s *Barrage) _gold(cpn *model.FissionCampaign) (err error) { + var price float64 + + spl := cpn.GetLangMarks() + + lm := utils.NotExistGetFirst(s.Req.GetShowLang(), spl) + if lm == spl[0] { + var conf *model.FissionCampaignGold + conf, err = cache.NewCampaignGold(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return + } + + price = conf.Price + } else { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, lm) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + return + } + + if gold := lang.GetGold(); gold != nil { + price = gold.Price + } + } + + var mark = []string{"victory_tip", "min_won_barrage", "won_barrage", "closer_to_prize", "shine_arrived"} + l := len(mark) * 5 + + s.Res.TranContent = make([]*pb.BarrageRes_TranContent, 0, l) + + for i := 0; i < l; i++ { + key := mark[i%5] + one := &pb.BarrageRes_TranContent{ + Mark: fmt.Sprintf("barrage:%s", key), + ReplaceKv: nil, + } + + var val = fmt.Sprintf("%.2f", price) + + if price == math.Trunc(price) { + val = fmt.Sprintf("%d", int32(price)) + } + + switch key { + case "won_barrage": + one.ReplaceKv = append(one.ReplaceKv, &pb.BarrageRes_KV{ + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, &pb.BarrageRes_KV{ + Key: "{{cash}}", + Value: val, + }) + case "min_won_barrage": + one.ReplaceKv = append(one.ReplaceKv, &pb.BarrageRes_KV{ + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, &pb.BarrageRes_KV{ + Key: "{{cash}}", + Value: val, + }, &pb.BarrageRes_KV{ + Key: "{{min}}", + Value: fmt.Sprintf("%d", rand.Intn(9)+1), + }) + } + + s.Res.TranContent = append(s.Res.TranContent, one) + } + + return +} + +func (s *Barrage) _flip(cpn *model.FissionCampaign) (err error) { + randReward, preward, showLang, err := s._rewardDepend(cpn) + if err != nil { + return + } + + var idx = 20 + var ids []int64 + for _, reward := range randReward { + if (reward.Odds == 0 && reward.IsThank == mtype.Yes) || reward.RewardID < 0 { // 客户设置的概率为0的谢谢参与不显示,默认的谢谢参与奖也不显示 + delete(randReward, reward.ID) + continue + } + + if reward.Odds == 0 { + ids = append(ids, reward.ID) + idx-- + } + } + + for _, reward := range randReward { + if reward.Odds == 0 { + continue + } + + g := float64(idx) * (float64(reward.Odds) / 1000) + + var n = int(g) + if n < 1 { + n = 1 + } + + for i := 0; i < n; i++ { + ids = append(ids, reward.ID) + } + + } + + l := len(ids) + idxL := l + for { + if l >= 10 { + break + } + for _, id := range ids[:idxL] { + ids = append(ids, id) + l++ + } + } + + // 20条数据 + s.Res.TranContent = make([]*pb.BarrageRes_TranContent, l) + + for i, id := range ids { + reward := randReward[id] + info, _ := preward.InfoAutoLang(reward.RewardID, showLang) + rewardTitle, imgUrl := info.Title, info.ImgUrl + + s.Res.TranContent[i] = &pb.BarrageRes_TranContent{ + Mark: "barrage:get_reward", + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + { + Key: "{{reward_title}}", + Value: rewardTitle, + }, + }, + RewardImg: imgUrl, + } + } + + return +} + +func (s *Barrage) _rewardDepend(cpn *model.FissionCampaign) (randReward map[int64]*model.FissionCampaignReward, preward *provider.Rewards, showLang string, err error) { + user, err := cache.NewFissionUser(s.Ctx, cpn.ID).FindById(s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(user) + if err != nil { + return + } + + var bIds []int64 + randReward = make(map[int64]*model.FissionCampaignReward) + for _, reward := range rewards { + randReward[reward.ID] = reward + bIds = append(bIds, reward.RewardID) + } + + preward, err = provider.NewRewards(s.Ctx, cpn.ProjectID, bIds...) + if err != nil { + return + } + + showLang = utils.NotExistGetFirst(s.Req.GetShowLang(), cpn.GetLangMarks()) + + return +} + +func (s *Barrage) _coin(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignCoin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionCoinScene + scenes, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().CacheError(err) + return + } + + var opL int32 + for _, scene := range scenes { + if scene.OpenTime <= time.Now().Unix() { + opL++ + } + } + + num := rand.Intn(int(conf.UseLimit)) + 1 + var nm = make(map[int]struct{}, num) + for i := 1; i < num; i++ { + nm[i] = struct{}{} + } + + if opL == 0 { + for i := 0; i < 20; i++ { + var n int + for k := range nm { + n = k + } + s.Res.TranContent = append(s.Res.TranContent, &pb.BarrageRes_TranContent{ + Mark: "barrage:join_coin_num", + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + { + Key: "{{num}}", + Value: fmt.Sprint(n), + }, + }, + }) + } + + return + } + + var scene *model.FissionCoinScene + if len(scenes) == 1 { + scene = scenes[0] + } else { + scene = scenes[len(scenes)-2] + } + + key := ckey.FissionCoinSceneData(scene.ID) + sceneData, err := cachecurd.NewHMap(s.Ctx, key, + cachecurd.SetCoinSceneBuild(cpn.ID, scene.ID), + cachecurd.SetHMapExp(time.Duration(conf.OpenDays+1)*consts.TimeDay), + ) + if err != nil { + err = s.BE().CacheError(err) + return + } + + userCoin, _ := sceneData.GetInt64(cachecurd.CoinSceneUserCoin) + joinNum, _ := sceneData.GetInt64(cachecurd.CoinSceneJoinNum) + + var getNum int64 + if joinNum > 0 { + getNum = userCoin / joinNum + } + + for i := 0; i < 20; i++ { + var n int + for k := range nm { + n = k + } + + if i%2 == 0 { + s.Res.TranContent = append(s.Res.TranContent, &pb.BarrageRes_TranContent{ + Mark: "barrage:get_coin", + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + { + Key: "{{num}}", + Value: fmt.Sprintf("%d", (getNum+int64(conf.UseCoin))*int64(n)), + }, + }, + }) + continue + } + + s.Res.TranContent = append(s.Res.TranContent, &pb.BarrageRes_TranContent{ + Mark: "barrage:join_coin_num", + ReplaceKv: []*pb.BarrageRes_KV{ + { + Key: "{{name}}", + Value: fmt.Sprintf("%s***%s", randext.RandLetters(1), randext.RandLetters(1)), + }, + { + Key: "{{num}}", + Value: fmt.Sprint(n), + }, + }, + }) + } + + return +} diff --git a/internal/service/containers/campaign/c_test.go b/internal/service/containers/campaign/c_test.go new file mode 100644 index 0000000..e47c83f --- /dev/null +++ b/internal/service/containers/campaign/c_test.go @@ -0,0 +1,67 @@ +package campaign + +import ( + "context" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/server/depend" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + _ "joybuywork/test" + "encoding/json" + "os" + "testing" + + "gits.branchcn.com/backend/microcode/micro" +) + +func TestTT(t *testing.T) { + res := &pb.StoreRes{} + req := &pb.StoreReq{} + const reqJSON = `{"project_id":"X5c6Zz8CeUcwim82YXtsh9","template_id":"d9u3qmmrdj7suicsn710","user_id":133,"title":"2121","start_time":1786607700,"end_time":1788681300,"config":{"rule_text_color":"#FF6778","rule_bg_color":"#FFF","share_text":"邀请好友 一起赢奖励 点击链接为好友助力","image_main":"/resource/2026/08/13/d9ujgm6rdj7suictg1a0.png","image_preview":"/resource/2026/08/13/d9ujgsmrdj7suictg1eg.png","link_btn_text_color":"#FFF","link_btn_bg_color":"#FFB752","link_text_color":"#A2A2AE","show_share":1,"play_rule":"\u003cp\u003e12212111\u003c/p\u003e","page_title":"2121","dm_show":1,"icon_type":1,"icon_bg_color":"#000","dl_type":1,"dl_banner_type":1,"dl_banner_app_logo":"/dynamic/logo.png","dl_banner_position":1,"topic_color":"#FF4E77","icon_open":[1,2,3,4],"pc_bg":"/web/sdk/img/campBg.png","link_temp_id":"1054","rule_time_open":1,"outside_task":1,"icon_text_color":"#000","open_share":1,"show_to_use":1},"question_answer":{"init_chance":1,"question_ask_time":600,"group_hash_id":"cmia16erdj7vs0jqlbv0","qa_num":10,"day_chance":1,"open_guide":1,"guide_group_hash_id":"cmia16erdj7vs0jqlbv0"},"t_offset":8,"target":{"target":1,"option":1,"app_event":1},"rewards":{"reward_group":1,"normal":[{"reward_id":-2,"stock":1,"reward_num":1,"is_thank":1,"score":1,"collect_num":1,"odds":1000,"collect_rule":{},"open_add":{}},{"reward_id":320229033112907776,"stock":111,"reward_num":1,"score":100,"collect_num":1,"collect_rule":{},"open_add":{}}]},"target_option":{"target":1,"fixed":{"open":1,"app_event":1,"target_num":11,"chance":11},"custom":{"open":1,"both_type":2,"cond":[{"event":"subscribe","event_key":"subscribe1","event_val":"11","desc":"xx","chance":1,"trigger_type":1,"event_type":1,"view_type":2,"go_show":1,"prop_mark":"chance","sort":1,"go_text":"去完成","click_effect":5,"click_effect_unit":"min"}],"both_all":{}}},"copy_campaign_id":"d9umfamrdj7mrtlnndi0","ip":"120.229.5.148","push":{"visit":{"open":1}}}` + if err := json.Unmarshal([]byte(reqJSON), req); err != nil { + t.Fatalf("unmarshal StoreReq: %v", err) + } + + t.Logf("%+v \r\n", req.GetTargetOption().GetFixed()) + + container := new(Store) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = req + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestLangs(t *testing.T) { + res := &pb.LangsRes{} + + container := new(Langs) + { + container.Init(context.Background()) + container.Req = &pb.LangsReq{ + CampaignHashId: "d7tvciurdj7hbvco20g0", + } + container.Res = res + } + + t.Log(container.Run()) + for _, v := range res.Langs { + t.Logf("%+v", v) + } + t.Log("------------------") + for _, v := range res.NotSupport { + t.Logf("%+v", v) + } +} + +func rpc() { + os.Args = []string{} + + depend.M = micro.Grpc(micro.GrpcConfig{ + ServerName: consts.ServiceName, + EtcdAddress: config.Config.Etcd.Address, + }) +} diff --git a/internal/service/containers/campaign/channel_create.go b/internal/service/containers/campaign/channel_create.go new file mode 100644 index 0000000..652dfa1 --- /dev/null +++ b/internal/service/containers/campaign/channel_create.go @@ -0,0 +1,245 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" + "time" + + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + linkpb "gits.branchcn.com/backend/shortlink/proto/go_proto/link" +) + +type ChannelCreate struct { + logic.Logic + Req *pb.ChannelCreateReq + Res *pb.ChannelCreateRes +} + +func (s *ChannelCreate) Run() error { + return logic.Run(s) +} + +func (s *ChannelCreate) Exec() (err error) { + cpn, project, err := s.campaign() + if err != nil { + return + } + + defer s.afterDone(cpn) + + if s.Req.GetCType() == mtype.FissionCampaignChannelTypeApp { + return s.createApp(cpn, project) + } + + return s.createWeb(cpn, project) +} + +func (s *ChannelCreate) campaign() (cpn *model.FissionCampaign, project *model.Project, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = s.BE().VerifyError("not found campaign") + return + } + + project, err = finder.Project(s.Ctx, cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = s.BE().VerifyError("not found project") + return + } + + if s.Req.GetCType() == mtype.FissionCampaignChannelTypeWeb { + if project.Scene == mtype.ProjectSceneWeb { // web项目不允许创建站外渠道 + err = s.BE().VerifyError("web project not allow") + return + } + if cpn.Target == mtype.FissionCampaignConfigTargetAdsGame { // 广告项目不允许创建站外 + err = s.BE().VerifyError("ads campaign not allow") + return + } + } + + return +} + +func (s *ChannelCreate) _mark(cpnId int64) (mark string, err error) { + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleMap = make(map[string]struct{}) + var markMap = make(map[string]struct{}, len(list)) + for _, v := range list { + markMap[strings.ToLower(v.Mark)] = struct{}{} + if v.IsDel == mtype.No { + titleMap[fmt.Sprintf("%s_%d", v.Title, v.CType)] = struct{}{} + } + } + + for i := 0; i < 100; i++ { + mark = utils.GetRandEnStr(consts.ChannelMarkLen) + if _, ok := markMap[strings.ToLower(mark)]; !ok { + break + } + mark = "" + } + + if mark == "" { + err = workerr.BusyError + return + } + + if _, ok := titleMap[fmt.Sprintf("%s_%d", s.Req.GetTitle(), s.Req.GetCType())]; ok { + err = workerr.CChanelExistError + return + } + + return +} + +func (s *ChannelCreate) createApp(cpn *model.FissionCampaign, project *model.Project) (err error) { + mark, err := s._mark(cpn.ID) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignChannel + cl := withdefault.FissionCampaignChannel(&model.FissionCampaignChannel{ + CampaignID: cpn.ID, + Mark: mark, + Title: s.Req.GetTitle(), + CType: mtype.FissionCampaignChannelTypeApp, + }) + + if err = m.WithContext(s.Ctx).Create(cl); err != nil { + return s.BE().MysqlError(err) + } + + var url string + switch cpn.Target { + case mtype.FissionCampaignConfigTargetAdsGame: + url = blink.NewAdsLink(project.Domain, cpn.HashID, cl.Mark).CampaignShareLink() + default: + url = blink.NewCampaignLink(project.Domain, cpn.HashID, cl.Mark).CampaignShareLink() + } + + s.Res.Id = cl.ID + s.Res.Url = url + + return +} + +func (s *ChannelCreate) createWeb(cpn *model.FissionCampaign, project *model.Project) (err error) { + mark, err := s._mark(cpn.ID) + if err != nil { + return + } + + code, err := s._linkCode(cpn, project, mark) + if err != nil { + return + } + + shortLink, err := s._shortLink(cpn, project, mark) + + m := s.GetDao().FissionCampaignChannel + cl := withdefault.FissionCampaignChannel(&model.FissionCampaignChannel{ + CampaignID: cpn.ID, + Mark: mark, + Title: s.Req.GetTitle(), + CType: mtype.FissionCampaignChannelTypeWeb, + Code: code, + ShortLink: shortLink, + }) + + if err = m.WithContext(s.Ctx).Create(cl); err != nil { + return s.BE().MysqlError(err) + } + + s.Res.Id = cl.ID + s.Res.Url = blink.NewCampaignLink(project.Domain, cpn.HashID, cl.Mark).CampaignWebLink() + + return +} + +func (s *ChannelCreate) _shortLink(cpn *model.FissionCampaign, project *model.Project, mark string) (link string, err error) { + res, err := app.NewShortLinkNameLink().CreateShortLink(s.Ctx, &linkpb.CreateShortLinkReq{ + LongLink: blink.NewCampaignLink(project.Domain, cpn.HashID, mark).CampaignWebLink(), + Domain: project.Domain, + }) + if err != nil { + return + } + return res.GetShortLink(), nil +} + +func (s *ChannelCreate) _linkCode(cpn *model.FissionCampaign, project *model.Project, mark string) (code string, err error) { + m := s.GetDao().FissionCampaignChannel + dfc, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.CType.Eq(mtype.FissionCampaignChannelTypeApp), + m.IsDefault.Eq(mtype.Yes), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if dfc == nil { + err = s.BE().VerifyError("not found default channel") + return + } + + lk, err := app.NewDeepLinkLink().GetCampaignLinkShortInfo(s.Ctx, &dlinkpb.GetCampaignLinkShortInfoReq{ + ProjectId: project.ID, + CampaignId: cpn.ID, + }) + + if err != nil { + return + } + + codeInfo, err := app.NewDeepLinkLink().CreateCampaignLinkCode(s.Ctx, &dlinkpb.CreateCampaignLinkCodeReq{ + ProjectId: project.ID, + LinkId: lk.GetLinkId(), + Channel: mark, + RedirectUrl: blink.NewCampaignLink(project.Domain, cpn.HashID, dfc.Mark, blink.SetCwMark(mark)).CampaignCodeLink(), + }) + + if err != nil { + return + } + + return codeInfo.GetCode(), nil +} + +func (s *ChannelCreate) afterDone(cpn *model.FissionCampaign) { + m := s.GetDao().FissionCampaign + m.WithContext(s.Ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(m.UpdatedAt.Value(time.Now().Unix())) + _ = cache.NewCampaign(s.Ctx).Clear(cpn) +} diff --git a/internal/service/containers/campaign/child_show.go b/internal/service/containers/campaign/child_show.go new file mode 100644 index 0000000..ed77795 --- /dev/null +++ b/internal/service/containers/campaign/child_show.go @@ -0,0 +1,183 @@ +package campaign + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" +) + +type ChildShow struct { + logic.Logic + Req *pb.ChildShowReq + Res *pb.ChildShowRes + + ruleMap map[int64]*model.FissionCampaignRewardRule +} + +func (s *ChildShow) Run() error { + return logic.Run(s) +} + +func (s *ChildShow) Exec() (err error) { + cpn, err := s.setCampaign() + if err != nil { + return + } + + err = s.setRewards(cpn) + if err != nil { + return + } + + return +} + +func (s *ChildShow) setCampaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Title = cpn.Title + s.Res.ChildType = int32(cpn.ChildType) + s.Res.FissionId = cpn.FissionID + s.Res.TStart = cpn.TStart + s.Res.TEnd = cpn.TEnd + s.Res.PlayType = int32(conf.PlayType) + + return + }) + + return +} + +func (s *ChildShow) setRewards(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.IsDel.Eq(mtype.No), + ).Order(m.Sort).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + s.Res.Rewards = make([]*pb.ChildShowRes_Reward, 0, len(list)) + + var rewardIds []int64 + for _, v := range list { + rewardIds = append(rewardIds, v.RewardID) + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, rewardIds...) + if err != nil { + return + } + + var langMark string + if cpn.Pid > 0 { + var pcpn *model.FissionCampaign + pcpn, err = cache.NewCampaign(s.Ctx).FindById(cpn.Pid) + if err != nil { + err = s.BE().CacheError(err) + return + } + + langMark = mtype.FissionLangTypeToMark[pcpn.GetLangTypes()[0]] + } + + for _, v := range list { + one := &pb.ChildShowRes_Reward{ + Id: v.ID, + RewardId: v.RewardID, + Stock: v.Stock, + InviteNum: v.InviteNum, + RewardNum: v.RewardNum, + IsThank: int32(v.IsThank), + Score: v.Score, + SignDay: v.SignDay, + CollectNum: v.CollectNum, + IsSuper: int32(v.IsSuper), + KvData: nil, + Title: "", + ImgUrl: "", + ReceiveType: 0, + Contact: "", + Url: "", + Help: 0, + HelpPercent: 0, + Click: 0, + ClickPercent: 0, + ClickPercentLimit: 0, + Open: 0, + OpenPercent: 0, + OpenPercentLimit: 0, + LangMark: "", + Odds: v.Odds, + JumpUrl: v.JumpURL, + FormTitle: "", + CampaignLimit: 0, + Register: 0, + RegisterPercent: 0, + InitPercent: v.InitPercent, + PropMark: v.PropMark, + } + info, _ := preward.InfoAutoLang(v.RewardID, langMark) + + one.ReceiveType = info.ReceiveType + one.Contact = info.Contact + one.Url = info.Url + one.FormTitle = info.FormTitle + + for _, kv := range info.KvData { + one.KvData = append(one.KvData, &pb.ChildShowRes_KV{ + Key: kv.Key, + Value: kv.Value, + }) + } + + one.Title, one.ImgUrl, one.LangMark = info.Title, info.ImgUrl, info.Mark + + if rule, ok := s.ruleMap[v.ID]; ok { + one.CampaignLimit = rule.CampaignLimit + } + + s.Res.Rewards = append(s.Res.Rewards, one) + } + + return +} + +func (s *ChildShow) _ruleMap(cpn *model.FissionCampaign) (err error) { + ruleM := s.GetDao().FissionCampaignRewardRule + rules, err := ruleM.WithContext(s.Ctx).Where(ruleM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ruleMap = make(map[int64]*model.FissionCampaignRewardRule, len(rules)) + for _, v := range rules { + ruleMap[v.RewardID] = v + } + + s.ruleMap = ruleMap + + return +} diff --git a/internal/service/containers/campaign/child_store.go b/internal/service/containers/campaign/child_store.go new file mode 100644 index 0000000..4dc5fde --- /dev/null +++ b/internal/service/containers/campaign/child_store.go @@ -0,0 +1,226 @@ +package campaign + +import ( + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" +) + +type ChildStore struct { + logic.Logic + Req *pb.ChildStoreReq + Res *pb.ChildStoreRes + + project *model.Project + + otherReward []*model.FissionCampaignReward + otherRelateIds []int64 + otherRelateMap map[int64]struct{} +} + +func (s *ChildStore) Run() error { + return logic.Run(s) +} + +func (s *ChildStore) Exec() (err error) { + err = s.depend() + if err != nil { + return + } + + cpn, err := s.create() + if err != nil { + return + } + + err = s.createConfig(cpn) + if err != nil { + return + } + + err = s.createTask(cpn) + if err != nil { + return + } + + err = s.createReward(cpn) + if err != nil { + return + } + + return +} + +func (s *ChildStore) depend() (err error) { + project, err := finder.Project(s.Ctx, s.Req.GetProjectId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + + s.otherRelateMap = make(map[int64]struct{}) + s.project = project + + s.AddAfterRun(func() (err error) { + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).CampaignSave(s.Res.GetId(), s.Req) + return + }) + + return +} + +// 创建活动 +func (s *ChildStore) create() (cpn *model.FissionCampaign, err error) { + cpn = withdefault.FissionCampaign(&model.FissionCampaign{ + FissionID: s.Req.GetFissionId(), + ProjectID: s.project.ID, + CreatorID: s.Req.GetUserId(), + Title: s.Req.GetTitle(), + Status: mtype.FissionCampaignStatusWait, + TStart: s.Req.GetStartTime(), + TEnd: s.Req.GetEndTime(), + Target: mtype.FissionCampaignConfigTargetChild, + ChildType: int8(s.Req.GetChildType()), + }) + + if s.Req.GetStartTime() == 0 { + cpn.Status = mtype.FissionCampaignStatusPub + } + + m := s.GetDao().FissionCampaign + + if err = m.WithContext(s.Ctx).Create(cpn); err != nil { + return nil, s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + return + }) + + return +} + +func (s *ChildStore) createConfig(cpn *model.FissionCampaign) (err error) { + conf := withdefault.FissionCampaignConfig(&model.FissionCampaignConfig{ + CampaignID: cpn.ID, + PlayType: int8(s.Req.GetPlayType()), + RewardGroup: mtype.FissionRewardGroupNormal, + Target: mtype.FissionCampaignConfigTargetChild, + }) + + err = s.GetDao().FissionCampaignConfig.WithContext(s.Ctx).Create(conf) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *ChildStore) createTask(cpn *model.FissionCampaign) (err error) { + // todo 创建超级任务 + return +} + +func (s *ChildStore) createReward(cpn *model.FissionCampaign) (err error) { + var add = s.otherReward + var addRules []*model.FissionCampaignRewardRule + var relateMap = s.otherRelateMap + var relateIds = s.otherRelateIds + for i, one := range s.Req.GetRewards() { + var step = int32(i) + 1 + + var id = hashid.IdBigint() + + add = append(add, withdefault.FissionCampaignReward(&model.FissionCampaignReward{ + ID: id, + CampaignID: cpn.ID, + Stock: one.GetStock(), + Sort: int32(i), + RewardType: mtype.FissionCampaignRewardTypeChild, + Step: step, + InviteNum: one.GetInviteNum(), + RewardNum: one.GetRewardNum(), + IsThank: int8(one.GetIsThank()), + Score: one.GetScore(), + SignDay: step, + CollectNum: one.GetCollectNum(), + IsSuper: int8(one.GetIsSuper()), + RewardID: one.GetRewardId(), + Odds: one.GetOdds(), + JumpURL: one.GetJumpUrl(), + HasRule: utils.Ternary[int8](one.GetCampaignLimit() > 0, mtype.Yes, mtype.No), + InitPercent: one.GetInitPercent(), + PropMark: one.GetPropMark(), + })) + + if one.GetCampaignLimit() > 0 { + addRules = append(addRules, withdefault.FissionCampaignRewardRule(&model.FissionCampaignRewardRule{ + CampaignID: cpn.ID, + RewardID: id, + CampaignLimit: one.GetCampaignLimit(), + })) + } + + if _, ok := relateMap[one.GetRewardId()]; !ok && one.GetRewardId() > 0 { + relateMap[one.GetRewardId()] = struct{}{} + relateIds = append(relateIds, one.GetRewardId()) + } + } + + if len(add) == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + + var relates []*model.RewardRelated + for _, v := range relateIds { + relates = append(relates, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: v, + RelateID: cpn.ID, + RelateTable: s.GetDao().FissionCampaign.TableName(), + })) + } + + relateM := s.GetDao().RewardRelated + if err = relateM.WithContext(s.Ctx).Create(relates...); err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(addRules) > 0 { + ruleM := s.GetDao().FissionCampaignRewardRule + err = ruleM.WithContext(s.Ctx).Create(addRules...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 其他形式的奖品追加 +func (s *ChildStore) _otherAppendReward(reward *model.FissionCampaignReward) { + if _, ok := s.otherRelateMap[reward.RewardID]; !ok && reward.RewardID > 0 { + s.otherRelateMap[reward.RewardID] = struct{}{} + s.otherRelateIds = append(s.otherRelateIds, reward.RewardID) + } + + s.otherReward = append(s.otherReward, reward) +} diff --git a/internal/service/containers/campaign/child_update.go b/internal/service/containers/campaign/child_update.go new file mode 100644 index 0000000..d770f4c --- /dev/null +++ b/internal/service/containers/campaign/child_update.go @@ -0,0 +1,460 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "time" + + "gorm.io/gen/field" +) + +type ChildUpdate struct { + logic.Logic + Req *pb.ChildUpdateReq + Res *pb.ChildUpdateRes + + project *model.Project + + otherReward []*model.FissionCampaignReward + otherRelateIds []int64 + otherRelateMap map[int64]struct{} +} + +func (s *ChildUpdate) Run() error { + return logic.Run(s) +} + +func (s *ChildUpdate) Exec() (err error) { + cpn, err := s.update() + if err != nil { + return + } + + err = s.updateConfig(cpn) + if err != nil { + return + } + + err = s.updateReward(cpn) + if err != nil { + return + } + + return +} + +func (s *ChildUpdate) update() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("nof found campaign") + return + } + + s.otherRelateMap = make(map[int64]struct{}) + + m := s.GetDao().FissionCampaign + var data = []field.AssignExpr{ + m.Title.Value(s.Req.GetTitle()), + m.TEnd.Value(s.Req.GetEndTime()), + } + + var pcpn *model.FissionCampaign + if cpn.Pid > 0 { + pcpn, err = cache.NewCampaign(s.Ctx).FindById(cpn.Pid) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if pcpn != nil { + if s.Req.GetEndTime() == 0 { + data = append(data, m.EndTime.Value(0)) + } else { + var endTime = timez.GMT(s.Req.GetEndTime(), pcpn.TOffset) + data = append(data, m.EndTime.Value(endTime)) + } + } + + // 待发布状态可以更新的数据 + if cpn.Status == mtype.FissionCampaignStatusWait { + data = append(data, + m.TStart.Value(s.Req.GetStartTime()), + ) + + if pcpn != nil { + var start int64 + if s.Req.GetStartTime() == 0 { + data = append(data, m.StartTime.Value(0)) + } else { + start = timez.GMT(s.Req.GetStartTime(), pcpn.TOffset) + data = append(data, m.StartTime.Value(start)) + } + + // 已经开始了活动 + if start <= time.Now().Unix() { + data = append(data, m.Status.Value(mtype.FissionCampaignStatusPub)) + } + } + + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(data...) + if err != nil { + return nil, s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + + _ = cache.NewCampaign(s.Ctx).Clear(cpn) + + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).CampaignSave(cpn.ID, s.Req) + + return + }) + + return +} + +func (s *ChildUpdate) updateConfig(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf.PlayType == int8(s.Req.GetPlayType()) { + return + } + + m := s.GetDao().FissionCampaignConfig + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(m.PlayType.Value(int8(s.Req.GetPlayType()))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *ChildUpdate) updateReward(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var add = s.otherReward + var delIds []int64 + + adds, dels, err := s._updateRewards(s.Req.GetRewards(), list, cpn, mtype.FissionCampaignRewardTypeChild) + if err != nil { + return + } + + add = append(add, adds...) + delIds = append(delIds, dels...) + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + err = s._updateRule(cpn.ID) + if err != nil { + return + } + + return s._updateRelated(cpn.ID) +} + +// 更新奖品数据 +func (s *ChildUpdate) _updateRewards(newList []*pb.ChildUpdateReq_Reward, oldList []*model.FissionCampaignReward, cpn *model.FissionCampaign, rt int8) (add []*model.FissionCampaignReward, delIds []int64, err error) { + if len(oldList) == 0 && len(newList) == 0 { + return + } + + var oldMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range oldList { + if v.RewardType == rt { + oldMap[v.ID] = v + } + } + + var delKey []string + m := s.GetDao().FissionCampaignReward + for i, v := range newList { + var step = int32(i) + 1 + + hashRule := utils.Ternary[int8](v.GetCampaignLimit() > 0, mtype.Yes, mtype.No) + sort := int32(i) + old, ok := oldMap[v.GetId()] + if !ok { + id := hashid.IdBigint() + add = append(add, withdefault.FissionCampaignReward(&model.FissionCampaignReward{ + ID: id, + CampaignID: cpn.ID, + Stock: v.GetStock(), + Sort: sort, + RewardType: rt, + Step: step, + InviteNum: v.GetInviteNum(), + RewardNum: v.GetRewardNum(), + IsThank: int8(v.GetIsThank()), + Score: v.GetStock(), + SignDay: step, + CollectNum: v.GetCollectNum(), + IsSuper: int8(v.GetIsSuper()), + RewardID: v.GetRewardId(), + Odds: v.GetOdds(), + JumpURL: v.GetJumpUrl(), + HasRule: hashRule, + InitPercent: v.GetInitPercent(), + PropMark: v.GetPropMark(), + })) + + newList[i].Id = id + continue + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple( + m.Stock.Value(v.GetStock()), + m.Sort.Value(sort), + m.Step.Value(step), + m.InviteNum.Value(v.GetInviteNum()), + m.RewardNum.Value(v.GetRewardNum()), + m.IsThank.Value(int8(v.GetIsThank())), + m.Score.Value(v.GetScore()), + m.SignDay.Value(v.GetSignDay()), + m.CollectNum.Value(v.GetCollectNum()), + m.IsSuper.Value(int8(v.GetIsSuper())), + m.RewardID.Value(v.GetRewardId()), + m.Odds.Value(v.GetOdds()), + m.JumpURL.Value(v.GetJumpUrl()), + m.HasRule.Value(hashRule), + m.InitPercent.Value(v.GetInitPercent()), + m.PropMark.Value(v.GetPropMark()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if old.Stock != v.GetStock() && verify.InArray(cpn.Status, mtype.FissionCampaignStatusPubPre, mtype.FissionCampaignStatusPub) { + delKey = append(delKey, + ckey.FissionCampaignRewardPool(v.GetId()), + ckey.FissionCampaignPreRewardPool(v.GetId()), + ) + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).UpdateRunningStock(old.ID, old.Stock, v.GetStock()) + } + + delete(oldMap, old.ID) + } + + s.AddAfterRun(func() (err error) { + if len(delKey) > 0 { + app.Redis.Cache.Del(s.Ctx, delKey...) + } + return + }) + + if len(oldMap) == 0 { + return + } + + for _, v := range oldMap { + delIds = append(delIds, v.ID) + } + + return +} + +func (s *ChildUpdate) _updateRule(cpnId int64) (err error) { + m := s.GetDao().FissionCampaignRewardRule + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.FissionCampaignRewardRule, len(list)) + for _, v := range list { + oldMap[v.RewardID] = v + } + + olUser := s.OL().User(s.Req.GetUserId(), s.Req.GetIp()) + + var delIds []int64 + var add []*model.FissionCampaignRewardRule + + for _, v := range s.Req.GetRewards() { + + old, ok := oldMap[v.GetId()] + if !ok { + if v.GetCampaignLimit() > 0 { + id := hashid.IdBigint() + add = append(add, withdefault.FissionCampaignRewardRule(&model.FissionCampaignRewardRule{ + CampaignID: cpnId, + RewardID: v.GetId(), + CampaignLimit: v.GetCampaignLimit(), + })) + olUser.UpdateRunningRewardRule(id, 0, v.GetCampaignLimit()) + } + continue + } + + if v.GetCampaignLimit() > 0 { + if v.GetCampaignLimit() != old.CampaignLimit { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(m.CampaignLimit.Value(v.GetCampaignLimit())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + olUser.UpdateRunningRewardRule(v.GetId(), old.CampaignLimit, v.GetCampaignLimit()) + } + continue + } + + delIds = append(delIds, old.ID) + olUser.UpdateRunningRewardRule(v.GetId(), old.CampaignLimit, 0) + } + + if len(add) > 0 { + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + } + } + + if len(delIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + } + } + + s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignRewardRule(s.Ctx).Clear(list...) + return + }) + + return +} + +// 更新奖品关联 +func (s *ChildUpdate) _updateRelated(cpnId int64) (err error) { + m := s.GetDao().RewardRelated + list, err := m.WithContext(s.Ctx).Where(m.RelateID.Eq(cpnId), m.RelateTable.Eq(dao.FissionCampaign.TableName())).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var relateMap = make(map[int64]struct{}) + var oldMap = make(map[int64]*model.RewardRelated) + for _, v := range list { + oldMap[v.RewardID] = v + relateMap[v.RewardID] = struct{}{} + } + + var orIds []int64 + var add []*model.RewardRelated + for _, rewardId := range s.otherRelateIds { + _, ok := relateMap[rewardId] + if !ok { + add = append(add, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: rewardId, + RelateID: cpnId, + RelateTable: dao.FissionCampaign.TableName(), + CancelTime: 0, + })) + relateMap[rewardId] = struct{}{} + continue + } + + old, ok1 := oldMap[rewardId] + if ok1 && old.CancelTime > 0 { + orIds = append(orIds, old.ID) + } + + delete(oldMap, rewardId) + } + + for _, v := range s.Req.GetRewards() { + _, ok := relateMap[v.GetRewardId()] + if !ok { + add = append(add, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: v.GetRewardId(), + RelateID: cpnId, + RelateTable: dao.FissionCampaign.TableName(), + CancelTime: 0, + })) + relateMap[v.GetRewardId()] = struct{}{} + continue + } + + old, ok1 := oldMap[v.GetRewardId()] + if ok1 && old.CancelTime > 0 { + orIds = append(orIds, old.ID) + } + delete(oldMap, v.GetRewardId()) + } + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(orIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(orIds...)).UpdateSimple(m.CancelTime.Value(0)); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(oldMap) == 0 { + return + } + + var cancelIds []int64 + for _, v := range oldMap { + cancelIds = append(cancelIds, v.ID) + } + + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(cancelIds...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/campaign/langs.go b/internal/service/containers/campaign/langs.go new file mode 100644 index 0000000..5676cac --- /dev/null +++ b/internal/service/containers/campaign/langs.go @@ -0,0 +1,1517 @@ +package campaign + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" +) + +type campaignLangsPrizeQuiz struct { + quit *model.FissionCampaignQuiz + options []*model.FissionCampaignQuizOption +} + +type campaignLangsPrizeAnswer struct { + questions []*model.FissionCampaignQaQuestion + optionMap map[int64][]*model.FissionCampaignQaOption +} + +type campaignLangsRewards struct { + webIds, extraIds, newcomerIds, ids []int64 + userLevel []*campaignLangsLevelIds + country []*campaignLangsCountryMarks + preward *provider.Rewards +} + +type campaignLangsLevelIds struct { + LevelId int64 + ids []int64 +} + +type campaignLangsCountryMarks struct { + countryMark string + ids []int64 +} + +type Langs struct { + logic.Logic + Req *pb.LangsReq + Res *pb.LangsRes + + prizeQuiz *campaignLangsPrizeQuiz + prizeAnswer *campaignLangsPrizeAnswer + + conds []*model.FissionCampaignCond + condMap map[int64]*model.FissionCampaignCond + + levelMap map[int64]string // 等级名称map + ful finder.FuserLayer + + rewards map[string]*campaignLangsRewards // 语言对应的奖品数据 + rewardData struct { + rewardList []*model.FissionCampaignReward + prewards *provider.Rewards + } // 依赖的奖品数据 + + // 长图数据 + longImgs map[int64][]*model.FissionCampaignLongImg + imgZoneMap map[int64][]*model.FissionCampaignLongImgZone + + // 现金抽奖配置 + cashConf *model.FissionCampaignCash + + // 金币任务配置 + goldConf *model.FissionCampaignGold + + // 金币池配置 + coinConf *model.FissionCampaignCoin + + // 答题配置 + qaConf *model.FissionCampaignQa + + // 养狗配置 + keepConf *model.FissionCampaignKeep + + // 题库 + qaGroup map[string]*model.LibraryQaGroup + defaultQaGroup *model.LibraryQaGroup + + vsSchedule map[int32][]*model.FissionCampaignVsSchedule + vsTeam []*model.FissionCampaignVsTeam + + unoCardMap map[string][]*model.FissionCampaignUnoCard + + temp *model.FissionTemp + group *model.FissionTempGroup +} + +func (s *Langs) Run() error { + return logic.Run(s) +} + +func (s *Langs) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *Langs) Exec() (err error) { + cpn, conf, style, err := s.campaign() + if err != nil { + return + } + + notSupport, err := s.setLangs(cpn, conf, style) + if err != nil { + return + } + + err = s.notSupport(cpn, conf, style, notSupport) + if err != nil { + return + } + + return +} + +func (s *Langs) campaign() (cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, style *model.FissionCampaignStyle, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + style, err = cache.NewCampaignStyle(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + temp, err := cache.NewFissionTemp(s.Ctx).FindById(cpn.TemplateID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var group *model.FissionTempGroup + if temp != nil { + group, err = cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + s.rewards = make(map[string]*campaignLangsRewards) + s.qaGroup = make(map[string]*model.LibraryQaGroup) + + s.ful = finder.NewFuserLayer(conf) + + s.Res.HasWeb = conf.HasWeb == mtype.Yes + s.Res.HasWarn = conf.HasWarmUp == mtype.Yes + s.Res.HasLongImg = conf.HasLongImg == mtype.Yes + s.Res.DlType = int32(conf.DlType) + s.Res.DlBannerType = int32(conf.DlBannerType) + s.Res.WindowCover = int32(conf.WindowCover) + s.Res.RewardGroup = int32(conf.RewardGroup) + s.Res.FissionMark = consts.FissionIdMap[cpn.FissionID] + s.Res.RuleType = int32(conf.RuleType) + s.Res.Title = cpn.Title + s.Res.FissionMarkTitle = consts.FissionTitle[consts.LangZhCn][s.Res.FissionMark] + + if group != nil { + s.Res.TempGroupMark = group.Mark + } + + return +} + +func (s *Langs) setLangs(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, style *model.FissionCampaignStyle) (notSupport map[string]struct{}, err error) { + tempM := s.GetDao().FissionTemp + temp, err := tempM.WithContext(s.Ctx).Where(tempM.ID.Eq(cpn.TemplateID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if temp == nil { + err = workerr.NotFound("not found temp") + return + } + + m := s.GetDao().FissionCampaignLang + langs, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Order(m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 处理长图数据 + err = s._preLongImgs(conf) + if err != nil { + return + } + + notSupport = make(map[string]struct{}, len(mtype.MarkToLangType)) + for mark := range mtype.MarkToLangType { + notSupport[mark] = struct{}{} + } + + s.Res.Langs = make([]*pb.LangsRes_Lang, 0, len(langs)+1) + var appendLang = func(lang *pb.LangsRes_Lang) { + s.Res.Langs = append(s.Res.Langs, lang) + delete(notSupport, lang.LangMark) + } + + tempMark := mtype.FissionLangTypeToMark[temp.LangType] + dLang, err := s.dLang(cpn, conf, style, tempMark) + if err != nil { + return + } + + err = s.setReward(cpn, dLang, conf, tempMark, nil) + if err != nil { + return + } + + appendLang(dLang) + + for _, lang := range langs { + one := s.setLang(cpn, lang) + + err = s.setReward(cpn, one, conf, lang.LangMark, nil) + if err != nil { + return + } + + appendLang(one) + } + + if verify.InArray[int8](conf.RewardGroup, mtype.FissionRewardGroupNormal, mtype.FissionRewardGroupUserLevel) { + return + } + + var spMap = make(map[string]struct{}) + for _, v := range cpn.GetLangTypes() { + spMap[mtype.FissionLangTypeToMark[v]] = struct{}{} + } + + for _, mark := range s.ful.GetFirstSupportLang() { + if _, ok := spMap[mark]; ok { + continue + } + + dLang, err = s.dLang(cpn, conf, style, mark) + if err != nil { + return + } + + err = s.setReward(cpn, dLang, conf, mark, nil) + if err != nil { + return + } + + // 待支持的标识 + dLang.Wait = true + dLang.IsDefault = false + + appendLang(dLang) + } + + return +} + +func (s *Langs) notSupport(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, style *model.FissionCampaignStyle, notSupport map[string]struct{}) (err error) { + s.Res.NotSupport = make([]*pb.LangsRes_Lang, 0, len(notSupport)) + + rlm := cpn.GetLangMarks()[0] + var rewards *campaignLangsRewards + for mark := range notSupport { + var dLang *pb.LangsRes_Lang + dLang, err = s.dLang(cpn, conf, style, mark) + if err != nil { + return + } + + dLang.IsDefault = false + + if !verify.InArray(conf.RewardGroup, mtype.FissionRewardGroupLang, mtype.FissionRewardGroupLangAndUserLevel) { + rlm = mark + } + + // 找活动对应支持的奖品 + rewards, err = s._getRewards(cpn, conf, rlm) + if err != nil { + return + } + + // 根据模板语言来去翻译数据 + err = s.setReward(cpn, dLang, conf, mark, rewards) + if err != nil { + return + } + + s.Res.NotSupport = append(s.Res.NotSupport, dLang) + } + return +} + +// 默认语言处理 +func (s *Langs) setLang(cpn *model.FissionCampaign, lang *model.FissionCampaignLang) (dLang *pb.LangsRes_Lang) { + dLang = &pb.LangsRes_Lang{ + HashId: lang.HashID, + IsDefault: false, + LangMark: lang.LangMark, + LangType: int32(mtype.MarkToLangType[lang.LangMark]), + PageTitle: lang.PageTitle, + ImageMain: lang.ImageMain, + DownloadPageImage: lang.DownloadPageImage, + WechatPageImage: lang.WechatPageImage, + ContentImg: lang.ContentImg, + WebBgImg: lang.WebBgImg, + WarmUpImg: lang.WarmUpImg, + DlBgImg: lang.DlBgImg, + DlBannerImg: lang.DlBannerImg, + DlBannerAppLogo: lang.DlBannerAppLogo, + DlBannerAppName: lang.DlBannerAppName, + DlBannerAppBtn: lang.DlBannerAppBtn, + ShareText: lang.ShareText, + ShareImg: lang.ShareImg, + Rule: lang.Rule, + Conds: nil, + Quit: nil, + Questions: nil, + Wait: false, + Rewards: nil, + RewardsWeb: nil, + RewardsExtra: nil, + RewardsNewcomer: nil, + LongImgs: nil, + Cash: nil, + TOffset: lang.TOffset, + TStart: cpn.TStart, + TEnd: cpn.TEnd, + QaGroup: nil, + TalkText: nil, + Gold: nil, + Coin: nil, + TopicColor: lang.TopicColor, + PcBg: lang.PcBg, + RuleImg: lang.RuleImg, + Schedules: nil, + } + + conds, _ := s._getConds(cpn) + + var setCondMap = make(map[int64]*mtype.LangCond) + for _, v := range lang.GetConds() { + setCondMap[v.CondId] = v + } + + for _, cond := range conds { + one := &pb.LangsRes_Cond{ + CondId: cond.ID, + Desc: cond.Desc, + OpenJump: int32(cond.OpenJump), + WebUrl: cond.WebURL, + ExtraParam: cond.ExtraParam, + PcParam: cond.PcParam, + GoText: cond.GoText, + } + + if c, ok := setCondMap[cond.ID]; ok { + one.Desc = c.Desc + one.WebUrl = c.WebURL + one.ExtraParam = c.ExtraParam + one.PcParam = c.PcParam + one.GoText = c.GoText + } + + dLang.Conds = append(dLang.Conds, one) + } + + for _, v := range s.longImgs[lang.ID] { + one := &pb.LangsRes_LongImg{ + ImgUrl: v.ImgURL, + WebUrl: v.WebURL, + AppParam: v.AppParam, + Id: v.ID, + ClickType: int32(v.ClickType), + HotZone: make([]*pb.LangsRes_HotZone, 0, len(s.imgZoneMap[v.ID])), + TargetType: int32(v.TargetType), + TargetId: v.TargetID, + PcParam: v.PcParam, + LangSourceId: v.LangSourceID, + } + + for _, zone := range s.imgZoneMap[v.ID] { + one.HotZone = append(one.HotZone, &pb.LangsRes_HotZone{ + Id: zone.ID, + WebUrl: zone.WebURL, + AppParam: zone.AppParam, + ClickX: zone.ClickX, + ClickY: zone.ClickY, + ClickW: zone.ClickW, + ClickH: zone.ClickH, + TargetType: int32(zone.TargetType), + TargetId: zone.TargetID, + PcParam: zone.PcParam, + }) + } + + dLang.LongImgs = append(dLang.LongImgs, one) + } + + switch cpn.FissionID { + case consts.IdPrizeQuiz: + if quit := lang.GetQuit(); quit != nil { + dLang.Quit = &pb.LangsRes_Quit{ + Title: quit.Title, + Options: make([]*pb.LangsRes_Option, 0, len(quit.Options)), + } + + for _, option := range quit.Options { + dLang.Quit.Options = append(dLang.Quit.Options, &pb.LangsRes_Option{ + OptionId: option.OptionId, + Title: option.Title, + ImgUrl: option.ImgUrl, + }) + } + } + case consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: + if qaGroup := lang.GetQaGroup(); qaGroup != nil { + var title string + group, _ := s._getQaGroup(qaGroup.QaGroupId) + if group != nil { + title = group.Title + } + + conf, _ := s._getQaConf(cpn.ID) + + dLang.QaGroup = &pb.LangsRes_QaGroup{ + QaGroupId: qaGroup.QaGroupId, + QaNum: qaGroup.QaNum, + Title: title, + OpenGuide: int32(conf.OpenGuide), + GuideGroupId: qaGroup.GuideGroupId, + } + } + case consts.IdPrizeAnswer: + + _, tg, _ := s._tempGroup(cpn.TemplateID) + + if tg.Mark == "answer_tmb" { + + if qaGroup := lang.GetQaGroup(); qaGroup != nil { + var title string + group, _ := s._getQaGroup(qaGroup.QaGroupId) + if group != nil { + title = group.Title + } + + conf, _ := s._getQaConf(cpn.ID) + + dLang.QaGroup = &pb.LangsRes_QaGroup{ + QaGroupId: qaGroup.QaGroupId, + QaNum: qaGroup.QaNum, + Title: title, + OpenGuide: int32(conf.OpenGuide), + GuideGroupId: qaGroup.GuideGroupId, + } + } + + } else { + for _, question := range lang.GetQuestions() { + q := &pb.LangsRes_Question{ + QaId: question.QaId, + Title: question.Title, + Options: make([]*pb.LangsRes_Option, 0, len(question.Options)), + } + + for _, option := range question.Options { + q.Options = append(q.Options, &pb.LangsRes_Option{ + OptionId: option.OptionId, + Title: option.Title, + ImgUrl: option.ImgUrl, + }) + } + + dLang.Questions = append(dLang.Questions, q) + } + } + + case consts.IdCash: + if cash := lang.GetCash(); cash != nil { + dLang.Cash = &pb.LangsRes_Cash{ + Price: cash.Price, + Currency: cash.Currency, + } + } + case consts.IdKeep: + dLang.TalkText = make([]*pb.LangsRes_Talk, 0) + + _ = jsonm.StrUnmarshal(lang.TalkText, &dLang.TalkText) + + case consts.IdCoin: + + var coinConf *model.FissionCampaignCoin + coinConf, _ = s._getCoinConf(cpn.ID) + + if verify.InArray[int32](mtype.FissionCampaignCoinLackBtnCustom, coinConf.GetLackBtn()...) { + if coin := lang.GetLangCoin(); coin != nil { + dLang.Coin = &pb.LangsRes_Coin{ + CustomBtnText: coin.CustomBtnText, + CustomWebUrl: coin.CustomWebUrl, + CustomExtraParam: coin.CustomExtraParam, + CustomPcParam: coin.CustomPcParam, + } + } else { + dLang.Coin = &pb.LangsRes_Coin{ + CustomBtnText: coinConf.CustomBtnText, + CustomWebUrl: coinConf.CustomWebURL, + CustomExtraParam: coinConf.CustomExtraParam, + CustomPcParam: coinConf.CustomPcParam, + } + } + } + + case consts.IdVs: + + langVs := lang.GetVs() + var langScheduleMap = make(map[int64]*pb.LangsRes_PkTeam, len(langVs)) + + for _, schedule := range langVs { + for _, pkTeam := range schedule.PkTeams { + var teams = make([]*pb.LangsRes_Team, 0, len(pkTeam.Teams)) + for _, team := range pkTeam.Teams { + teams = append(teams, &pb.LangsRes_Team{ + Id: team.Id, + Name: team.Name, + LogoImg: team.LogoImg, + }) + } + + langScheduleMap[pkTeam.Id] = &pb.LangsRes_PkTeam{ + Id: pkTeam.Id, + Teams: teams, + VsImg: pkTeam.VsImg, + Desc: pkTeam.Desc, + } + } + } + + vsTeam, _ := s._getVsTeam(cpn.ID) + var vsTeamMap = make(map[int64]*pb.LangsRes_Team, len(vsTeam)) + for _, v := range vsTeam { + vsTeamMap[v.ID] = &pb.LangsRes_Team{ + Id: v.ID, + Name: v.Name, + LogoImg: v.LogoImg, + } + } + + vsSchedule, _ := s._getVsSchedule(cpn.ID) + dLang.Schedules = make([]*pb.LangsRes_Schedule, len(vsSchedule)) + for idx, schedules := range vsSchedule { + one := &pb.LangsRes_Schedule{ + Id: idx, + PkTeams: make([]*pb.LangsRes_PkTeam, 0, len(schedules)), + } + + for _, schedule := range schedules { + two := &pb.LangsRes_PkTeam{ + Id: schedule.ID, + Desc: schedule.Desc, + VsImg: schedule.VsImg, + } + + for _, teamId := range schedule.GetVsTeamIds() { + if teamId > 0 { + two.Teams = append(two.Teams, vsTeamMap[teamId]) + } else { + two.Teams = append(two.Teams, &pb.LangsRes_Team{ + Id: teamId, + }) + } + } + + if scd, ok := langScheduleMap[schedule.ID]; ok { + two.Desc = scd.Desc + two.VsImg = scd.VsImg + for i, team := range scd.Teams { + if team.Id > 0 || two.Teams[i] == nil || two.Teams[i].Id < 0 { + two.Teams[i] = team + } + } + } + + one.PkTeams = append(one.PkTeams, two) + } + + dLang.Schedules[idx] = one + } + case consts.IdUno: + langUno := lang.GetUno() + dLang.Uno = &pb.LangsRes_Uno{ + Red: s._unoCard(mtype.FissionCampaignUnoGroupRed, cpn.ID, langUno.Red), + Yellow: s._unoCard(mtype.FissionCampaignUnoGroupYellow, cpn.ID, langUno.Yellow), + Blue: s._unoCard(mtype.FissionCampaignUnoGroupBlue, cpn.ID, langUno.Blue), + Green: s._unoCard(mtype.FissionCampaignUnoGroupGreen, cpn.ID, langUno.Green), + } + default: + + } + + return +} + +// 默认处理 +func (s *Langs) dLang(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, style *model.FissionCampaignStyle, langMark string) (dLang *pb.LangsRes_Lang, err error) { + dLang = &pb.LangsRes_Lang{ + HashId: "", + IsDefault: true, + LangMark: langMark, + LangType: int32(mtype.MarkToLangType[langMark]), + PageTitle: style.PageTitle, + ImageMain: style.MainImg, + DownloadPageImage: utils.Ternary[string](style.DownloadImg == "", style.MainImg, style.DownloadImg), + WechatPageImage: utils.Ternary[string](style.WechatImg == "", style.MainImg, style.WechatImg), + ContentImg: style.BgImg, + WebBgImg: style.WechatImg, + WarmUpImg: style.WarmUpImg, + DlBgImg: style.DownloadImg, + DlBannerImg: style.DlBannerImg, + DlBannerAppLogo: style.DlBannerAppLogo, + DlBannerAppName: style.DlBannerAppName, + DlBannerAppBtn: style.DlBannerAppBtn, + ShareText: style.ShareText, + ShareImg: style.ShareImg, + Rule: style.PlayRule, + Conds: nil, + Quit: nil, + Questions: nil, + Wait: false, + Rewards: nil, + RewardsWeb: nil, + RewardsExtra: nil, + RewardsNewcomer: nil, + LongImgs: nil, + Cash: nil, + TOffset: cpn.TOffset, + TStart: cpn.TStart, + TEnd: cpn.TEnd, + QaGroup: nil, + TalkText: nil, + Gold: nil, + Coin: nil, + TopicColor: style.TopicColor, + PcBg: style.PcBg, + RuleImg: style.RuleImg, + Schedules: nil, + } + + if conf.Option != mtype.FissionCampaignConfigTargetOptionApp { + var conds []*model.FissionCampaignCond + conds, err = s._getConds(cpn) + if err != nil { + return + } + + dLang.Conds = make([]*pb.LangsRes_Cond, 0, len(conds)) + for _, v := range conds { + dLang.Conds = append(dLang.Conds, &pb.LangsRes_Cond{ + CondId: v.ID, + Desc: v.Desc, + OpenJump: int32(v.OpenJump), + WebUrl: v.WebURL, + ExtraParam: v.ExtraParam, + PcParam: v.PcParam, + GoText: v.GoText, + }) + } + } + + switch cpn.FissionID { + case consts.IdPrizeQuiz: + var prizeQuiz *campaignLangsPrizeQuiz + prizeQuiz, err = s._getPrizeQuiz(cpn) + if err != nil { + return + } + + dLang.Quit = &pb.LangsRes_Quit{ + Title: prizeQuiz.quit.Title, + Options: make([]*pb.LangsRes_Option, 0, len(prizeQuiz.options)), + } + + for _, v := range prizeQuiz.options { + dLang.Quit.Options = append(dLang.Quit.Options, &pb.LangsRes_Option{ + OptionId: v.ID, + Title: v.Title, + ImgUrl: v.ImgURL, + }) + } + case consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: + var qaConf *model.FissionCampaignQa + qaConf, err = s._getQaConf(cpn.ID) + if err != nil { + return + } + + var qaGroup *model.LibraryQaGroup + qaGroup, err = s._getDefaultQaGroup(qaConf.QaGroupID) + if err != nil { + return + } + + var guideGroupHashId string + if qaConf.GuideGroupID > 0 { + var guideGroup *model.LibraryQaGroup + guideGroup, err = s._getDefaultQaGroup(qaConf.QaGroupID) + if err != nil { + return + } + if guideGroup != nil { + guideGroupHashId = guideGroup.HashID + } + } + + dLang.QaGroup = &pb.LangsRes_QaGroup{ + QaGroupId: qaGroup.HashID, + QaNum: qaConf.QaNum, + Title: qaGroup.Title, + OpenGuide: int32(qaConf.OpenGuide), + GuideGroupId: guideGroupHashId, + } + case consts.IdPrizeAnswer: + + _, tg, _ := s._tempGroup(cpn.TemplateID) + + if tg.Mark == "answer_tmb" { + var qaConf *model.FissionCampaignQa + qaConf, err = s._getQaConf(cpn.ID) + if err != nil { + return + } + + var qaGroup *model.LibraryQaGroup + qaGroup, err = s._getDefaultQaGroup(qaConf.QaGroupID) + if err != nil { + return + } + + var guideGroupHashId string + if qaConf.GuideGroupID > 0 { + var guideGroup *model.LibraryQaGroup + guideGroup, err = s._getDefaultQaGroup(qaConf.QaGroupID) + if err != nil { + return + } + if guideGroup != nil { + guideGroupHashId = guideGroup.HashID + } + } + + dLang.QaGroup = &pb.LangsRes_QaGroup{ + QaGroupId: qaGroup.HashID, + QaNum: qaConf.QaNum, + Title: qaGroup.Title, + OpenGuide: int32(qaConf.OpenGuide), + GuideGroupId: guideGroupHashId, + } + } else { + var prizeAnswer *campaignLangsPrizeAnswer + prizeAnswer, err = s._getPrizeAnswer(cpn) + if err != nil { + return + } + + dLang.Questions = make([]*pb.LangsRes_Question, 0, len(prizeAnswer.questions)) + + for _, v := range prizeAnswer.questions { + one := &pb.LangsRes_Question{ + QaId: v.ID, + Title: v.Title, + Options: make([]*pb.LangsRes_Option, 0, len(prizeAnswer.optionMap[v.ID])), + } + + for _, option := range prizeAnswer.optionMap[v.ID] { + one.Options = append(one.Options, &pb.LangsRes_Option{ + OptionId: option.ID, + Title: option.Title, + }) + } + + dLang.Questions = append(dLang.Questions, one) + } + } + + case consts.IdCash: + var cashConf *model.FissionCampaignCash + cashConf, err = s._getCashConf(cpn.ID) + if err != nil { + return + } + + dLang.Cash = &pb.LangsRes_Cash{ + Price: cashConf.Price, + Currency: int32(cashConf.Currency), + } + case consts.IdKeep: + var keepConf *model.FissionCampaignKeep + keepConf, err = s._getKeepConf(cpn.ID) + if err != nil { + return + } + + talks := keepConf.GetKeepTalk() + dLang.TalkText = make([]*pb.LangsRes_Talk, 0, len(talks)) + for _, v := range talks { + dLang.TalkText = append(dLang.TalkText, &pb.LangsRes_Talk{ + TextType: v.TextType, + Content: v.Content, + }) + } + case consts.IdGold: + var goldConf *model.FissionCampaignGold + goldConf, err = s._getGoldConf(cpn.ID) + if err != nil { + return + } + + dLang.Gold = &pb.LangsRes_Gold{ + Price: goldConf.Price, + Currency: int32(goldConf.Currency), + } + + case consts.IdCoin: + var coinConf *model.FissionCampaignCoin + coinConf, err = s._getCoinConf(cpn.ID) + if err != nil { + return + } + + if verify.InArray[int32](mtype.FissionCampaignCoinLackBtnCustom, coinConf.GetLackBtn()...) { + dLang.Coin = &pb.LangsRes_Coin{ + CustomBtnText: coinConf.CustomBtnText, + CustomWebUrl: coinConf.CustomWebURL, + CustomExtraParam: coinConf.CustomExtraParam, + CustomPcParam: coinConf.CustomPcParam, + } + } + case consts.IdVs: + var vsTeam []*model.FissionCampaignVsTeam + vsTeam, err = s._getVsTeam(cpn.ID) + if err != nil { + return + } + + var vsTeamMap = make(map[int64]*pb.LangsRes_Team, len(vsTeam)) + for _, v := range vsTeam { + vsTeamMap[v.ID] = &pb.LangsRes_Team{ + Id: v.ID, + Name: v.Name, + LogoImg: v.LogoImg, + } + } + + var vsSchedule map[int32][]*model.FissionCampaignVsSchedule + vsSchedule, err = s._getVsSchedule(cpn.ID) + if err != nil { + return + } + + dLang.Schedules = make([]*pb.LangsRes_Schedule, len(vsSchedule)) + for idx, schedules := range vsSchedule { + one := &pb.LangsRes_Schedule{ + Id: idx, + PkTeams: make([]*pb.LangsRes_PkTeam, 0, len(schedules)), + } + + for _, schedule := range schedules { + two := &pb.LangsRes_PkTeam{ + Id: schedule.ID, + Teams: make([]*pb.LangsRes_Team, 0, len(schedule.GetVsTeamIds())), + VsImg: schedule.VsImg, + Desc: schedule.Desc, + } + + for _, teamId := range schedule.GetVsTeamIds() { + if teamId > 0 { + two.Teams = append(two.Teams, vsTeamMap[teamId]) + } else { + two.Teams = append(two.Teams, &pb.LangsRes_Team{ + Id: teamId, + }) + } + } + + one.PkTeams = append(one.PkTeams, two) + } + + dLang.Schedules[idx] = one + } + case consts.IdUno: + dLang.Uno = &pb.LangsRes_Uno{ + Red: s._unoCard(mtype.FissionCampaignUnoGroupRed, cpn.ID, nil), + Yellow: s._unoCard(mtype.FissionCampaignUnoGroupYellow, cpn.ID, nil), + Blue: s._unoCard(mtype.FissionCampaignUnoGroupBlue, cpn.ID, nil), + Green: s._unoCard(mtype.FissionCampaignUnoGroupGreen, cpn.ID, nil), + } + default: + + } + + dLang.LongImgs = make([]*pb.LangsRes_LongImg, 0, len(s.longImgs[0])) + for _, v := range s.longImgs[0] { + one := &pb.LangsRes_LongImg{ + ImgUrl: v.ImgURL, + WebUrl: v.WebURL, + AppParam: v.AppParam, + Id: v.ID, + ClickType: int32(v.ClickType), + HotZone: make([]*pb.LangsRes_HotZone, 0, len(s.imgZoneMap[v.ID])), + TargetType: int32(v.TargetType), + TargetId: v.TargetID, + PcParam: v.PcParam, + LangSourceId: v.ID, + } + + for _, click := range s.imgZoneMap[v.ID] { + one.HotZone = append(one.HotZone, &pb.LangsRes_HotZone{ + Id: click.ID, + WebUrl: click.WebURL, + AppParam: click.AppParam, + ClickX: click.ClickX, + ClickY: click.ClickY, + ClickW: click.ClickW, + ClickH: click.ClickH, + TargetType: int32(click.TargetType), + TargetId: click.TargetID, + PcParam: click.PcParam, + }) + } + + dLang.LongImgs = append(dLang.LongImgs, one) + } + + return +} + +// 设置要返回的奖品信息 +func (s *Langs) setReward(cpn *model.FissionCampaign, lang *pb.LangsRes_Lang, conf *model.FissionCampaignConfig, langMark string, rewards *campaignLangsRewards) (err error) { + if rewards == nil { + rewards, err = s._getRewards(cpn, conf, langMark) + if err != nil { + return + } + } + + preward := rewards.preward + + s._appendReward(preward, rewards.webIds, &lang.RewardsWeb, langMark) + s._appendReward(preward, rewards.extraIds, &lang.RewardsExtra, langMark) + s._appendReward(preward, rewards.newcomerIds, &lang.RewardsNewcomer, langMark) + + lang.Rewards = &pb.LangsRes_Rewards{ + Normal: nil, + UserLevel: nil, + Langs: nil, + LangUserLevel: nil, + Country: nil, + } + + switch conf.RewardGroup { + case mtype.FissionRewardGroupNormal: + s._appendReward(preward, rewards.ids, &lang.Rewards.Normal, langMark) + case mtype.FissionRewardGroupLang: + s._appendReward(preward, rewards.ids, &lang.Rewards.Langs, langMark) + case mtype.FissionRewardGroupUserLevel: + s._appendUserLevel(preward, rewards.userLevel, &lang.Rewards.UserLevel, langMark) + case mtype.FissionRewardGroupLangAndUserLevel: + s._appendUserLevel(preward, rewards.userLevel, &lang.Rewards.LangUserLevel, langMark) + case mtype.FissionRewardGroupCountry: + s._appendCountry(preward, rewards.country, &lang.Rewards.Country, langMark) + } + + return +} + +func (s *Langs) _getPrizeQuiz(cpn *model.FissionCampaign) (prizeQuiz *campaignLangsPrizeQuiz, err error) { + if s.prizeQuiz == nil { + s.prizeQuiz = &campaignLangsPrizeQuiz{ + quit: nil, + options: nil, + } + + quitM := s.GetDao().FissionCampaignQuiz + s.prizeQuiz.quit, err = quitM.WithContext(s.Ctx).Where(quitM.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + optionM := s.GetDao().FissionCampaignQuizOption + s.prizeQuiz.options, err = optionM.WithContext(s.Ctx).Where(optionM.CampaignID.Eq(cpn.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.prizeQuiz, nil +} + +func (s *Langs) _getPrizeAnswer(cpn *model.FissionCampaign) (prizeAnswer *campaignLangsPrizeAnswer, err error) { + if s.prizeAnswer == nil { + s.prizeAnswer = &campaignLangsPrizeAnswer{ + questions: nil, + optionMap: make(map[int64][]*model.FissionCampaignQaOption), + } + questionM := s.GetDao().FissionCampaignQaQuestion + s.prizeAnswer.questions, err = questionM.WithContext(s.Ctx).Where(questionM.CampaignID.Eq(cpn.ID), questionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var ids []int64 + for _, v := range s.prizeAnswer.questions { + ids = append(ids, v.ID) + } + + optionM := s.GetDao().FissionCampaignQaOption + var options []*model.FissionCampaignQaOption + options, err = optionM.WithContext(s.Ctx).Where(optionM.QuestionID.In(ids...), optionM.IsDel.Eq(mtype.No)).Order(optionM.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range options { + s.prizeAnswer.optionMap[v.QuestionID] = append(s.prizeAnswer.optionMap[v.QuestionID], v) + } + } + + return s.prizeAnswer, nil +} + +func (s *Langs) _getConds(cpn *model.FissionCampaign) (conds []*model.FissionCampaignCond, err error) { + if s.conds == nil { + condM := s.GetDao().FissionCampaignCond + s.conds, err = condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpn.ID), condM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.condMap = make(map[int64]*model.FissionCampaignCond, len(s.conds)) + for _, cond := range s.conds { + s.condMap[cond.ID] = cond + } + + } + + return s.conds, nil +} + +func (s *Langs) _getRewards(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, langMark string) (rewards *campaignLangsRewards, err error) { + + if _, ok := s.rewards[langMark]; ok { + return s.rewards[langMark], nil + } + + rewards = &campaignLangsRewards{ + webIds: nil, + extraIds: nil, + newcomerIds: nil, + ids: nil, + preward: nil, + } + + list, prewards, err := s._getRewardData(cpn) + if err != nil { + return + } + + var appList []*model.FissionCampaignReward + for _, v := range list { + switch v.RewardType { + case mtype.FissionCampaignRewardTypeExtra: + rewards.extraIds = append(rewards.extraIds, v.RewardID) + case mtype.FissionCampaignRewardTypeNewcomer: + rewards.newcomerIds = append(rewards.newcomerIds, v.RewardID) + case mtype.FissionCampaignRewardTypeWeb: + rewards.webIds = append(rewards.webIds, v.RewardID) + case mtype.FissionCampaignRewardTypeApp: + appList = append(appList, v) + } + } + + switch conf.RewardGroup { + case mtype.FissionRewardGroupNormal: + rewards.ids = s._rewardIds(appList, nil) + case mtype.FissionRewardGroupLang: + mark, _ := s.ful.Lang().Selected(langMark) + rewards.ids = s._rewardIds(appList, func(lang string) bool { return lang == mark }) + case mtype.FissionRewardGroupUserLevel: + rewards.userLevel = s._addUserLevel(appList, nil) + case mtype.FissionRewardGroupLangAndUserLevel: + mark, _ := s.ful.LangLevel().GetLang(langMark) + rewards.userLevel = s._addUserLevel(appList, func(lang string) bool { return lang == mark }) + case mtype.FissionRewardGroupCountry: + rewards.country = s._addCountry(appList, nil) + } + + rewards.preward = prewards + + s.rewards[langMark] = rewards + + return +} + +func (s *Langs) _rewardIds(appList []*model.FissionCampaignReward, langOk func(lang string) bool) (ids []int64) { + ids = make([]int64, 0, len(appList)) + for _, v := range appList { + if langOk != nil && !langOk(v.LangMark) { + continue + } + ids = append(ids, v.RewardID) + } + return +} + +func (s *Langs) _addUserLevel(appList []*model.FissionCampaignReward, langOk func(lang string) bool) (userLevel []*campaignLangsLevelIds) { + var idx int + var levelIdx = make(map[int64]int) + var levelIds []int64 + + for _, v := range appList { + if langOk != nil && !langOk(v.LangMark) { + continue + } + + if lidx, ok := levelIdx[v.LevelID]; ok { + userLevel[lidx].ids = append(userLevel[lidx].ids, v.RewardID) + } else { + userLevel = append(userLevel, &campaignLangsLevelIds{ + LevelId: v.LevelID, + ids: []int64{v.RewardID}, + }) + levelIdx[v.LevelID] = idx + idx++ + levelIds = append(levelIds, v.LevelID) + } + } + + if len(levelIds) == 0 { + return + } + + levelM := s.GetDao().FissionUserLevel + levelList, err := levelM.WithContext(s.Ctx).Where(levelM.ID.In(levelIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.levelMap = make(map[int64]string, len(levelList)) + for _, v := range levelList { + s.levelMap[v.ID] = v.Title + } + + return +} + +func (s *Langs) _appendReward(preward *provider.Rewards, ids []int64, out *[]*pb.LangsRes_Reward, langMark string) { + *out = make([]*pb.LangsRes_Reward, 0, len(ids)) + inMap, _ := preward.InfoMap(ids...) + + for _, rewardId := range ids { + reward, ok := inMap[rewardId] + if !ok && reward == nil { + continue + } + + one := &pb.LangsRes_Reward{ + RewardId: reward.Id, + Title: "", + ImgUrl: "", + FindDefault: false, + } + + langInfo := preward.AutoLang(rewardId, langMark) + one.Title, one.ImgUrl, one.FindDefault = langInfo.Title, langInfo.ImgUrl, langInfo.FindDefault + + *out = append(*out, one) + } +} + +func (s *Langs) _appendUserLevel(preward *provider.Rewards, levelIds []*campaignLangsLevelIds, out *[]*pb.LangsRes_UserLevelOne, langMark string) { + *out = make([]*pb.LangsRes_UserLevelOne, 0, len(levelIds)) + for _, v := range levelIds { + one := &pb.LangsRes_UserLevelOne{ + LevelId: v.LevelId, + LevelTitle: s.levelMap[v.LevelId], + Rewards: nil, + } + s._appendReward(preward, v.ids, &one.Rewards, langMark) + *out = append(*out, one) + } +} + +func (s *Langs) _appendCountry(preward *provider.Rewards, countryMarks []*campaignLangsCountryMarks, out *[]*pb.LangsRes_CountryOne, langMark string) { + *out = make([]*pb.LangsRes_CountryOne, 0, len(countryMarks)) + for _, v := range countryMarks { + one := &pb.LangsRes_CountryOne{ + CountryMark: v.countryMark, + Rewards: nil, + } + s._appendReward(preward, v.ids, &one.Rewards, langMark) + *out = append(*out, one) + } +} + +func (s *Langs) _addCountry(appList []*model.FissionCampaignReward, langOk func(lang string) bool) (country []*campaignLangsCountryMarks) { + var idx int + var countryIdx = make(map[string]int) + + for _, v := range appList { + if langOk != nil && !langOk(v.LangMark) { + continue + } + + if lidx, ok := countryIdx[v.CountryMark]; ok { + country[lidx].ids = append(country[lidx].ids, v.RewardID) + } else { + country = append(country, &campaignLangsCountryMarks{ + countryMark: v.CountryMark, + ids: []int64{v.RewardID}, + }) + countryIdx[v.CountryMark] = idx + idx++ + } + } + + return +} + +func (s *Langs) _getRewardData(cpn *model.FissionCampaign) (list []*model.FissionCampaignReward, prewards *provider.Rewards, err error) { + if len(s.rewardData.rewardList) == 0 { + m := s.GetDao().FissionCampaignReward + s.rewardData.rewardList, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + } + + var idMap = make(map[int64]struct{}) + var ids []int64 + + for _, v := range list { + if _, ok := idMap[v.RewardID]; !ok { + ids = append(ids, v.RewardID) + } + } + + s.rewardData.prewards, err = provider.NewRewards(s.Ctx, cpn.ProjectID, ids...) + if err != nil { + return + } + + } + + return s.rewardData.rewardList, s.rewardData.prewards, nil +} + +func (s *Langs) _preLongImgs(conf *model.FissionCampaignConfig) (err error) { + if conf.HasLongImg == mtype.No { + return + } + + m := s.GetDao().FissionCampaignLongImg + imgs, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(conf.CampaignID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.longImgs = make(map[int64][]*model.FissionCampaignLongImg) + + var imgZoneIds []int64 + for _, v := range imgs { + if v.ClickType == mtype.FissionCampaignLongImgClickTypeZone { + imgZoneIds = append(imgZoneIds, v.ID) + } + s.longImgs[v.LangID] = append(s.longImgs[v.LangID], v) + } + + s.imgZoneMap = make(map[int64][]*model.FissionCampaignLongImgZone) + + if len(imgZoneIds) == 0 { + return + } + + zoneM := s.GetDao().FissionCampaignLongImgZone + zones, err := zoneM.WithContext(s.Ctx).Where(zoneM.ImgID.In(imgZoneIds...), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range zones { + s.imgZoneMap[v.ImgID] = append(s.imgZoneMap[v.ImgID], v) + } + + return +} + +func (s *Langs) _getCashConf(cpnId int64) (cashConf *model.FissionCampaignCash, err error) { + if s.cashConf == nil { + s.cashConf, err = cache.NewCampaignCash(s.Ctx).FindByCampaignId(cpnId) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.cashConf, nil +} + +func (s *Langs) _getGoldConf(cpnId int64) (cashConf *model.FissionCampaignGold, err error) { + if s.goldConf == nil { + s.goldConf, err = cache.NewCampaignGold(s.Ctx).FindByCampaignId(cpnId) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return s.goldConf, nil +} + +func (s *Langs) _getCoinConf(cpnId int64) (cashConf *model.FissionCampaignCoin, err error) { + if s.coinConf == nil { + s.coinConf, err = cache.NewCampaignCoin(s.Ctx).FindByCampaignId(cpnId) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return s.coinConf, nil +} + +func (s *Langs) _getQaConf(cpnId int64) (qaConf *model.FissionCampaignQa, err error) { + if s.qaConf == nil { + m := s.GetDao().FissionCampaignQa + s.qaConf, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.qaConf, nil +} + +func (s *Langs) _getQaGroup(qaGroupHashId string) (qaGroup *model.LibraryQaGroup, err error) { + if s.qaGroup[qaGroupHashId] == nil { + m := s.GetDao().LibraryQaGroup + s.qaGroup[qaGroupHashId], err = m.WithContext(s.Ctx).Where(m.HashID.Eq(qaGroupHashId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.qaGroup[qaGroupHashId], nil +} + +func (s *Langs) _getDefaultQaGroup(qaGroupId int64) (qaGroup *model.LibraryQaGroup, err error) { + if s.defaultQaGroup == nil { + m := s.GetDao().LibraryQaGroup + s.defaultQaGroup, err = m.WithContext(s.Ctx).Where(m.ID.Eq(qaGroupId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.defaultQaGroup, nil +} + +func (s *Langs) _getKeepConf(cpnId int64) (qaConf *model.FissionCampaignKeep, err error) { + if s.keepConf == nil { + m := s.GetDao().FissionCampaignKeep + s.keepConf, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.keepConf, nil +} + +func (s *Langs) _getVsTeam(cpnId int64) (teams []*model.FissionCampaignVsTeam, err error) { + if len(s.vsTeam) == 0 { + m := s.GetDao().FissionCampaignVsTeam + s.vsTeam, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s.vsTeam, nil +} + +func (s *Langs) _getVsSchedule(cpnId int64) (data map[int32][]*model.FissionCampaignVsSchedule, err error) { + if s.vsSchedule == nil { + m := s.GetDao().FissionCampaignVsSchedule + var list []*model.FissionCampaignVsSchedule + list, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.vsSchedule = make(map[int32][]*model.FissionCampaignVsSchedule) + for _, v := range list { + s.vsSchedule[v.VsIdx] = append(s.vsSchedule[v.VsIdx], v) + } + } + + return s.vsSchedule, nil +} + +func (s *Langs) _getUnoCard(mark string, cpnId int64) (data []*model.FissionCampaignUnoCard, err error) { + if s.unoCardMap == nil { + s.unoCardMap = make(map[string][]*model.FissionCampaignUnoCard) + + cardM := s.GetDao().FissionCampaignUnoCard + var cards []*model.FissionCampaignUnoCard + cards, err = cardM.WithContext(s.Ctx).Where(cardM.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range cards { + s.unoCardMap[v.Mark] = append(s.unoCardMap[v.Mark], v) + } + } + + return s.unoCardMap[mark], nil +} + +func (s *Langs) _unoCard(mark string, cpnId int64, langCards []*mtype.UnoCard) []*pb.LangsRes_UnoCard { + var langMap = make(map[int32]*mtype.UnoCard, len(langCards)) + for _, v := range langCards { + langMap[v.CardNo] = v + } + + cards, _ := s._getUnoCard(mark, cpnId) + + data := make([]*pb.LangsRes_UnoCard, 0, len(cards)) + for _, card := range cards { + one := &pb.LangsRes_UnoCard{ + Id: card.ID, + Title: card.Title, + ImgUrl: card.ImgURL, + WebUrl: card.WebURL, + AppParam: card.AppParam, + PcParam: card.PcParam, + } + + if lang, ok := langMap[card.CardNo]; ok { + one.Title = lang.Title + one.ImgUrl = lang.ImgURL + one.WebUrl = lang.WebURL + one.AppParam = lang.AppParam + one.PcParam = lang.PcParam + } + + data = append(data, one) + } + + return data +} + +func (s *Langs) _tempGroup(tempId int64) (temp *model.FissionTemp, group *model.FissionTempGroup, err error) { + if s.temp == nil || s.group == nil { + + s.temp, err = cache.NewFissionTemp(s.Ctx).FindById(tempId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.group, err = cache.NewFissionTempGroup(s.Ctx).FindById(s.temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return s.temp, s.group, nil +} diff --git a/internal/service/containers/campaign/list.go b/internal/service/containers/campaign/list.go new file mode 100644 index 0000000..cb1d4d0 --- /dev/null +++ b/internal/service/containers/campaign/list.go @@ -0,0 +1,570 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + + bi_fission_actionpb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_fission_action" + "gorm.io/gen" + "gorm.io/gen/field" +) + +type List struct { + logic.Logic + Req *pb.ListReq + Res *pb.ListRes +} + +func (s *List) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *List) Run() error { + return logic.Run(s) +} + +func (s *List) Exec() (err error) { + project, err := s.project() + if err != nil { + return + } + + if project == nil { + return + } + + err = s.list(project) + if err != nil { + return + } + + return +} + +func (s *List) project() (project *model.Project, err error) { + project, err = finder.Project(s.Ctx, s.Req.GetProjectHashId(), s.Req.GetProjectId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *List) list(project *model.Project) (err error) { + list, total, err := s._find(project.ID) + if err != nil || total == 0 { + return + } + + s.Res.List = make([]*pb.ListRes_One, 0, len(list)) + s.Res.Total = total + + var projectIds, campaignIds, tempIds, cpnIdsOldReport, cpnIdsNewReport, creatorIds []int64 //项目ID集合,活动ID集,模版id集合 + var projectMap = make(map[int64]string) //项目id对应的domain + var tempMap = make(map[int64]*model.FissionTemp) //模板id对应的模板数据 + var creatorMap = make(map[int64]*model.User) + for _, v := range list { + campaignIds = append(campaignIds, v.ID) + if _, ok := projectMap[v.ProjectID]; !ok { + projectMap[v.ProjectID] = "" + projectIds = append(projectIds, v.ProjectID) + } + if _, ok := tempMap[v.TemplateID]; !ok { + tempMap[v.TemplateID] = nil + tempIds = append(tempIds, v.TemplateID) + } + + if _, ok := creatorMap[v.CreatorID]; !ok { + creatorIds = append(creatorIds, v.CreatorID) + creatorMap[v.CreatorID] = nil + } + + if v.ReportType == mtype.FissionCampaignReportTypeOld { + cpnIdsOldReport = append(cpnIdsOldReport, v.ID) + } else { + cpnIdsNewReport = append(cpnIdsNewReport, v.ID) + } + } + + // 活动统计 + statMap, err := s._statMap(cpnIdsOldReport, cpnIdsNewReport) + if err != nil { + return + } + + //活动模板 + tgtMap, err := s._tempInfo(tempIds, tempMap) + if err != nil { + return + } + + // 渠道数据 + clMap, err := s._clInfo(campaignIds) + if err != nil { + return + } + + // 配置数据 + confMap, err := s._conf(campaignIds) + if err != nil { + return + } + + // 语言 + langMap, err := s._langs(campaignIds) + if err != nil { + return + } + + channelMap, err := s._channel(campaignIds) + if err != nil { + return + } + + condMap, err := s._conds(campaignIds) + if err != nil { + return + } + + err = s._creator(creatorMap, creatorIds) + if err != nil { + return + } + + ads, err := cache.NewProjectAd(s.Ctx).FindByProjectId(project.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + CoverUrl: v.CoverURL, + TempGroupMark: "", + TempHashId: "", + FissionId: v.FissionID, + FissionMark: "", + StartTime: v.TStart, + EndTime: v.TEnd, + ShareLink: "", + VisitorNum: 0, + DownloadNum: 0, + Status: int32(v.Status), + ViewLink: "", + TOffset: v.TOffset, + LangTypes: nil, + TempLangType: 0, + Target: int32(v.Target), + HasWeb: 0, + HasWarmUp: 0, + PreRunTime: v.PreToRun, + AdsType: 0, + NewReport: verify.InArray[int64](v.FissionID, consts.NewReportFission...) && v.ReportType == mtype.FissionCampaignReportTypeNew, + LangTz: []*pb.ListRes_LangTz{ + { + LangMark: v.GetDefaultLangMark(), + TOffset: v.TOffset, + Status: int32(v.Status), + }, + }, + CreatedAt: v.CreatedAt, + WhileList: nil, + UpdatedAt: v.UpdatedAt, + } + + for _, lt := range v.GetLangTypes() { + one.LangTypes = append(one.LangTypes, int32(lt)) + } + + switch v.Target { + case mtype.FissionCampaignConfigTargetAdsGame: + linkObj := blink.NewAdsLink(project.Domain, v.HashID, clMap[v.ID]) + one.ShareLink = linkObj.CampaignShareLink() + one.ViewLink = linkObj.AddOption(blink.SetAdsUserId(consts.FissionViewer)).CampaignShareLink() + default: + linkObj := blink.NewCampaignLink(project.Domain, v.HashID, clMap[v.ID]) + one.ShareLink = linkObj.CampaignShareLink() + one.ViewLink = linkObj.AddOption(blink.SetView(), blink.SetUserId(consts.FissionViewer)).CampaignShareLink() + } + + if mark, ok := consts.FissionIdMap[v.FissionID]; ok { + one.FissionMark = mark + } + + if stat, ok := statMap[v.ID]; ok && stat != nil { + one.VisitorNum = stat[mtype.FissionBehaviorMarkView] + one.DownloadNum = stat[mtype.FissionBehaviorMarkAppInstall] + } + + if temp, ok := tempMap[v.TemplateID]; ok && temp != nil { + one.TempHashId = temp.HashID + one.TempGroupMark = tgtMap[temp.GroupID] + one.TempLangType = int32(temp.LangType) + } + + if conf, ok := confMap[v.ID]; ok { + one.HasWeb = int32(conf.HasWeb) + one.HasWarmUp = int32(conf.HasWarmUp) + one.WhileList = conf.GetWhileList() + + if ads != nil && ads.OpenAd == mtype.Yes { + one.AdsType = int32(conf.AdsType) + } + } + + if creator, ok := creatorMap[v.CreatorID]; ok && creator != nil { + one.CreatorName = creator.ShowName + one.CreatorAccount = creator.Username + } + + for _, lang := range langMap[v.ID] { + tz := provider.NewCampaignTZ(s.Ctx, v, lang.LangMark) + + one.LangTz = append(one.LangTz, &pb.ListRes_LangTz{ + LangMark: lang.LangMark, + TOffset: lang.TOffset, + Status: tz.GetStatus(), + LangType: int32(mtype.MarkToLangType[lang.LangMark]), + }) + } + + for _, channel := range channelMap[v.ID] { + switch channel.CType { + case mtype.FissionCampaignChannelTypeApp: + var url string + switch v.Target { + case mtype.FissionCampaignConfigTargetAdsGame: + url = blink.NewAdsLink(project.Domain, v.HashID, channel.Mark).CampaignShareLink() + default: + url = blink.NewCampaignLink(project.Domain, v.HashID, channel.Mark).CampaignShareLink() + } + + one.ChannelList = append(one.ChannelList, &pb.ListRes_Channel{ + Title: channel.Title, + Url: url, + CType: int32(channel.CType), + }) + case mtype.FissionCampaignChannelTypeWeb: + url := channel.ShortLink + if url == "" { + url = blink.NewCampaignLink(project.Domain, v.HashID, channel.Mark).CampaignWebLink() + } + one.ChannelList = append(one.ChannelList, &pb.ListRes_Channel{ + Title: channel.Title, + Url: url, + CType: int32(channel.CType), + }) + } + } + + for _, cond := range condMap[v.ID] { + one.CondList = append(one.CondList, &pb.ListRes_Cond{ + Event: cond.Event, + Key: cond.EventKey, + Val: cond.EventVal, + }) + } + + s.Res.List = append(s.Res.List, one) + } + return +} + +// 模板数据 +func (s *List) _tempInfo(tempIds []int64, tempMap map[int64]*model.FissionTemp) (tgtMap map[int64]string, err error) { + tempM := s.GetDao().FissionTemp + tempL, err := tempM.WithContext(s.Ctx).Where(tempM.ID.In(tempIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var tgtIds []int64 + tgtMap = make(map[int64]string) //模版组id对应的模板组标识 + for _, v := range tempL { + tempMap[v.ID] = v + if _, ok := tgtMap[v.GroupID]; !ok { + tgtMap[v.GroupID] = "" + tgtIds = append(tgtIds, v.GroupID) + } + } + + tgtM := s.GetDao().FissionTempGroup + tgtL, err := tgtM.WithContext(s.Ctx).Where(tgtM.ID.In(tgtIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range tgtL { + tgtMap[v.ID] = v.Mark + } + + return +} + +func (s *List) _conf(cpnIds []int64) (confMap map[int64]*model.FissionCampaignConfig, err error) { + confM := s.GetDao().FissionCampaignConfig + confMap = make(map[int64]*model.FissionCampaignConfig) + confs, err := confM.WithContext(s.Ctx).Where(confM.CampaignID.In(cpnIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range confs { + confMap[v.CampaignID] = v + } + return +} + +// 渠道数据 +func (s *List) _clInfo(cpnIds []int64) (clMap map[int64]string, err error) { + clMap = make(map[int64]string) + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.In(cpnIds...), + m.CType.Eq(mtype.FissionCampaignChannelTypeApp), + m.IsDefault.Eq(mtype.Yes), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range list { + clMap[v.CampaignID] = v.Mark + } + return +} + +// 统计数据 +func (s *List) _statMap(cpnIdsOldReport, cpnIdsNewReport []int64) (statMap map[int64]map[string]int64, err error) { + // 活动统计 + statMap = make(map[int64]map[string]int64) //活动id对应的统计数据 + + if len(cpnIdsOldReport) > 0 { + statM := s.GetDao().FissionTotal + stats, err1 := statM.WithContext(s.Ctx).Where(statM.CampaignID.In(cpnIdsOldReport...), + statM.Mark.In(mtype.FissionBehaviorMarkView, mtype.FissionBehaviorMarkAppInstall)). + Find() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + for _, v := range stats { + switch v.Mark { + case mtype.FissionBehaviorMarkView: + if _, ok := statMap[v.CampaignID]; ok { + statMap[v.CampaignID][v.Mark] = v.UserNum + } else { + statMap[v.CampaignID] = map[string]int64{ + v.Mark: v.UserNum, + } + } + case mtype.FissionBehaviorMarkAppInstall: + if _, ok := statMap[v.CampaignID]; ok { + statMap[v.CampaignID][v.Mark] = v.UserNum + } else { + statMap[v.CampaignID] = map[string]int64{ + v.Mark: v.UserNum, + } + } + } + } + } + + if len(cpnIdsNewReport) > 0 { + view, _ := app.NewFissionBiFissionAction().CampaignsTotal(s.Ctx, &bi_fission_actionpb.CampaignsTotalReq{ + Type: mtype.FissionActionTypeView, + CampaignIds: cpnIdsNewReport, + }) + + for _, v := range view.GetList() { + if _, ok := statMap[v.GetCampaignId()]; ok { + statMap[v.GetCampaignId()][mtype.FissionBehaviorMarkView] = v.UserNum + } else { + statMap[v.GetCampaignId()] = map[string]int64{ + mtype.FissionBehaviorMarkView: v.UserNum, + } + } + } + + install, _ := app.NewFissionBiFissionAction().CampaignsTotal(s.Ctx, &bi_fission_actionpb.CampaignsTotalReq{ + Type: mtype.FissionActionTypeAppInstall, + CampaignIds: cpnIdsNewReport, + }) + + for _, v := range install.GetList() { + if _, ok := statMap[v.GetCampaignId()]; ok { + statMap[v.GetCampaignId()][mtype.FissionBehaviorMarkAppInstall] = v.UserNum + } else { + statMap[v.GetCampaignId()] = map[string]int64{ + mtype.FissionBehaviorMarkAppInstall: v.UserNum, + } + } + } + } + + return +} + +// 找数据 +func (s *List) _find(projectId int64) (list []*model.FissionCampaign, total int64, err error) { + m := s.GetDao().FissionCampaign + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.ProjectID.Eq(projectId), + } + + if s.Req.GetTitle() != "" { + cond = append(cond, m.Title.Like(utils.DbAllLike(s.Req.GetTitle()))) + } + + if s.Req.GetLink() != "" { + hashId := blink.GetUrlCampaignHashId(s.Req.GetLink()) + cond = append(cond, m.HashID.Eq(hashId)) + } + + if len(s.Req.GetStatus()) != 0 { + var status = make([]int8, 0, len(s.Req.GetStatus())) + for _, v := range s.Req.GetStatus() { + status = append(status, int8(v)) + } + cond = append(cond, m.Status.In(status...)) + } + + if len(s.Req.GetFissionId()) != 0 { + cond = append(cond, m.FissionID.In(s.Req.GetFissionId()...)) + } + + if s.Req.GetStart() > 0 { + cond = append(cond, m.TStart.Gte(s.Req.GetStart())) + } + + if s.Req.GetEnd() > 0 { + cond = append(cond, m.TEnd.Lte(s.Req.GetEnd())) + } + + if len(s.Req.GetTargets()) > 0 { + var targets = make([]int8, 0, len(s.Req.GetTargets())) + for _, v := range s.Req.GetTargets() { + targets = append(targets, int8(v)) + } + cond = append(cond, m.Target.In(targets...)) + } else { + cond = append(cond, m.TStart.Neq(mtype.FissionCampaignConfigTargetChild)) + } + + if s.Req.GetUpdatedStart() > 0 { + cond = append(cond, m.UpdatedAt.Gte(s.Req.GetUpdatedStart())) + } + + if s.Req.GetUpdatedEnd() > 0 { + cond = append(cond, m.UpdatedAt.Lte(s.Req.GetUpdatedEnd())) + } + + var orderBy []field.Expr + if s.Req.GetOrderById() { + orderBy = append(orderBy, m.ID) + } else { + orderBy = append(orderBy, m.ID.Desc()) + } + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err = m.WithContext(s.Ctx).Where(cond...).Order(orderBy...).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *List) _langs(ids []int64) (langMap map[int64][]*model.FissionCampaignLang, err error) { + langMap = make(map[int64][]*model.FissionCampaignLang) + m := s.GetDao().FissionCampaignLang + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.In(ids...), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + langMap[v.CampaignID] = append(langMap[v.CampaignID], v) + } + + return +} + +func (s *List) _channel(ids []int64) (channelMap map[int64][]*model.FissionCampaignChannel, err error) { + channelMap = make(map[int64][]*model.FissionCampaignChannel) + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.In(ids...), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + channelMap[v.CampaignID] = append(channelMap[v.CampaignID], v) + } + + return +} + +func (s *List) _conds(ids []int64) (condMap map[int64][]*model.FissionCampaignCond, err error) { + condMap = make(map[int64][]*model.FissionCampaignCond) + m := s.GetDao().FissionCampaignCond + list, err := m.WithContext(s.Ctx). + Where( + m.CampaignID.In(ids...), + m.EventType.Eq(mtype.FissionCampaignCondEventTypeCustom), + m.WithContext(s.Ctx).Where(m.IsDel.Eq(mtype.No)).Or(m.DelUse.Eq(mtype.Yes)), + ). + Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + condMap[v.CampaignID] = append(condMap[v.CampaignID], v) + } + + return +} + +func (s *List) _creator(creatorMap map[int64]*model.User, ids []int64) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().User + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + creatorMap[v.ID] = v + } + + return +} diff --git a/internal/service/containers/campaign/reward_detail.go b/internal/service/containers/campaign/reward_detail.go new file mode 100644 index 0000000..d94d6c4 --- /dev/null +++ b/internal/service/containers/campaign/reward_detail.go @@ -0,0 +1,1155 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "gorm.io/gen/field" +) + +type RewardDetail struct { + logic.Logic + Req *pb.RewardDetailReq + Res *pb.RewardDetailRes + + rewardLangList []*model.RewardLang + + levelMap map[int64]string + + helpMap map[int64][]*model.FissionCampaignRewardHelp + + ruleMap map[int64]*model.FissionCampaignRewardRule +} + +func (s *RewardDetail) Run() error { + return logic.Run(s) +} + +func (s *RewardDetail) Exec() (err error) { + cpn, conf, err := s.campaign() + if err != nil { + return + } + + err = s.reward(cpn, conf) + if err != nil { + return + } + + err = s.fission(cpn) + if err != nil { + return + } + + err = s.task(cpn) + if err != nil { + return + } + + return +} + +func (s *RewardDetail) campaign() (cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.Res.RewardGroup = int32(conf.RewardGroup) + + return +} + +func (s *RewardDetail) task(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.RewardType.Eq(mtype.FissionCampaignRewardTypeTask), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + s._hasTask() + + titleMap, stockMap, selectMap, err := s._mapData(list, false) + if err != nil { + return + } + + var rewardIds []int64 + for _, reward := range list { + rewardIds = append(rewardIds, reward.ID) + } + + taskM := s.GetDao().FissionCampaignTask + tasks, err := taskM.WithContext(s.Ctx).Where(taskM.CampaignID.Eq(cpn.ID), taskM.RewardID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var condIds []int64 + var condRewardMap = make(map[int64]int64) + for _, task := range tasks { + condId := utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark) + condIds = append(condIds, condId) + condRewardMap[condId] = task.RewardID + + } + + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.ID.In(condIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardTaskMap = make(map[int64]string, len(conds)) + for _, cond := range conds { + rewardTaskMap[condRewardMap[cond.ID]] = cond.Desc + } + + s.Res.TaskReward = make([]*pb.RewardDetailRes_Reward, 0, len(list)) + for _, reward := range list { + one := s._one(reward, stockMap[reward.ID], selectMap[reward.ID], titleMap[reward.RewardID], false) + + one.TaskTitle = rewardTaskMap[reward.ID] + + s.Res.TaskReward = append(s.Res.TaskReward, one) + } + + return +} + +func (s *RewardDetail) reward(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + if verify.InArray[int64](cpn.FissionID, consts.IdCoin, consts.IdVs, consts.IdUno) { + return + } + + if cpn.FissionID == consts.IdSignIn { + s._hasAppSign() + } else { + s._hasApp() + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(conf.CampaignID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + m.IsDel.Eq(mtype.No), + ).Order(m.Step, m.Sort, m.ID).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + if len(list) == 0 { + return + } + + showSelect := verify.InArray[int64](cpn.FissionID, consts.IdKeep) + + titleMap, stockMap, selectMap, err := s._mapData(list, showSelect) + if err != nil { + return + } + + switch conf.RewardGroup { + case mtype.FissionRewardGroupNormal: + return s._normal(list, stockMap, selectMap, titleMap, showSelect) + case mtype.FissionRewardGroupUserLevel: + return s._userLv(cpn, list, stockMap, selectMap, titleMap, showSelect) + case mtype.FissionRewardGroupLang: + return s._lang(list, stockMap, selectMap, titleMap, showSelect) + case mtype.FissionRewardGroupLangAndUserLevel: + return s._langUserLv(cpn, list, stockMap, selectMap, titleMap, showSelect) + case mtype.FissionRewardGroupCountry: + return s._country(list, stockMap, selectMap, titleMap, showSelect) + } + + return +} + +func (s *RewardDetail) _normal(list []*model.FissionCampaignReward, stockMap, selectMap map[int64]int64, titleMap map[int64]string, showSelect bool) (err error) { + s.Res.Normal = make([]*pb.RewardDetailRes_Reward, 0, len(list)) + for _, reward := range list { + s.Res.Normal = append(s.Res.Normal, s._one(reward, stockMap[reward.ID], selectMap[reward.ID], titleMap[reward.RewardID], showSelect)) + } + + return +} + +func (s *RewardDetail) _userLv(cpn *model.FissionCampaign, list []*model.FissionCampaignReward, stockMap, selectMap map[int64]int64, titleMap map[int64]string, showSelect bool) (err error) { + m := s.GetDao().FissionUserLevel + lvList, err := m.WithContext(s.Ctx).Where(m.ProjectID.Eq(cpn.ProjectID), m.DeletedAt.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + lvMap := make(map[int64]string, len(lvList)) + for _, v := range lvList { + lvMap[v.ID] = v.Title + } + + var levelIds []int64 + var levelRewardMap = make(map[int64][]*model.FissionCampaignReward) + for _, v := range list { + if _, ok := levelRewardMap[v.LevelID]; !ok { + levelIds = append(levelIds, v.LevelID) + } + + levelRewardMap[v.LevelID] = append(levelRewardMap[v.LevelID], v) + } + + s.Res.UserLevel = make([]*pb.RewardDetailRes_UserLevelOne, 0, len(levelIds)) + for _, v := range levelIds { + one := &pb.RewardDetailRes_UserLevelOne{ + LevelId: v, + LevelTitle: lvMap[v], + Rewards: make([]*pb.RewardDetailRes_Reward, 0, len(levelRewardMap[v])), + } + for _, reward := range levelRewardMap[v] { + one.Rewards = append(one.Rewards, s._one(reward, stockMap[reward.ID], selectMap[reward.ID], titleMap[reward.RewardID], showSelect)) + } + s.Res.UserLevel = append(s.Res.UserLevel, one) + } + + return +} + +func (s *RewardDetail) _lang(list []*model.FissionCampaignReward, stockMap, selectMap map[int64]int64, titleMap map[int64]string, showSelect bool) (err error) { + var langMarks []string + var langRewardMap = make(map[string][]*model.FissionCampaignReward) + for _, v := range list { + if _, ok := langRewardMap[v.LangMark]; !ok { + langMarks = append(langMarks, v.LangMark) + } + + langRewardMap[v.LangMark] = append(langRewardMap[v.LangMark], v) + } + + s.Res.Langs = make([]*pb.RewardDetailRes_LangOne, 0, len(langMarks)) + for _, v := range langMarks { + one := &pb.RewardDetailRes_LangOne{ + LangMark: v, + Rewards: make([]*pb.RewardDetailRes_Reward, 0, len(langRewardMap[v])), + } + for _, reward := range langRewardMap[v] { + one.Rewards = append(one.Rewards, s._one(reward, stockMap[reward.ID], selectMap[reward.ID], titleMap[reward.RewardID], showSelect)) + } + s.Res.Langs = append(s.Res.Langs, one) + } + + return +} + +func (s *RewardDetail) _langUserLv(cpn *model.FissionCampaign, list []*model.FissionCampaignReward, stockMap, selectMap map[int64]int64, titleMap map[int64]string, showSelect bool) (err error) { + m := s.GetDao().FissionUserLevel + lvList, err := m.WithContext(s.Ctx).Where(m.ProjectID.Eq(cpn.ProjectID), m.DeletedAt.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + lvMap := make(map[int64]string, len(lvList)) + for _, v := range lvList { + lvMap[v.ID] = v.Title + } + + var langMarks []string + var langUserLv = make(map[string][]int64) + var langUserLvRewardMap = make(map[string]map[int64][]*model.FissionCampaignReward) + + for _, v := range list { + + if _, ok := langUserLv[v.LangMark]; !ok { + langMarks = append(langMarks, v.LangMark) + langUserLv[v.LangMark] = nil + langUserLvRewardMap[v.LangMark] = make(map[int64][]*model.FissionCampaignReward) + } + + if _, ok := langUserLvRewardMap[v.LangMark][v.LevelID]; !ok { + langUserLv[v.LangMark] = append(langUserLv[v.LangMark], v.LevelID) + } + + langUserLvRewardMap[v.LangMark][v.LevelID] = append(langUserLvRewardMap[v.LangMark][v.LevelID], v) + } + + s.Res.LangUserLevel = make([]*pb.RewardDetailRes_LangUserLevelOne, 0, len(langMarks)) + for _, v := range langMarks { + one := &pb.RewardDetailRes_LangUserLevelOne{ + LangMark: v, + LevelList: make([]*pb.RewardDetailRes_UserLevelOne, 0, len(langUserLv[v])), + } + + for _, lvId := range langUserLv[v] { + two := &pb.RewardDetailRes_UserLevelOne{ + LevelId: lvId, + LevelTitle: lvMap[lvId], + Rewards: make([]*pb.RewardDetailRes_Reward, 0, len(langUserLvRewardMap[v][lvId])), + } + + for _, reward := range langUserLvRewardMap[v][lvId] { + two.Rewards = append(two.Rewards, s._one(reward, stockMap[reward.ID], selectMap[reward.ID], titleMap[reward.RewardID], showSelect)) + } + + one.LevelList = append(one.LevelList, two) + } + + s.Res.LangUserLevel = append(s.Res.LangUserLevel, one) + } + + return +} + +func (s *RewardDetail) _country(list []*model.FissionCampaignReward, stockMap, selectMap map[int64]int64, titleMap map[int64]string, showSelect bool) (err error) { + var countryMarks []string + var countryRewardMap = make(map[string][]*model.FissionCampaignReward) + for _, v := range list { + if _, ok := countryRewardMap[v.CountryMark]; !ok { + countryMarks = append(countryMarks, v.CountryMark) + } + + countryRewardMap[v.CountryMark] = append(countryRewardMap[v.CountryMark], v) + } + + s.Res.Country = make([]*pb.RewardDetailRes_CountryOne, 0, len(countryMarks)) + for _, v := range countryMarks { + one := &pb.RewardDetailRes_CountryOne{ + CountryMark: v, + Rewards: make([]*pb.RewardDetailRes_Reward, 0, len(countryRewardMap[v])), + } + for _, reward := range countryRewardMap[v] { + one.Rewards = append(one.Rewards, s._one(reward, stockMap[reward.ID], selectMap[reward.ID], titleMap[reward.RewardID], showSelect)) + } + s.Res.Country = append(s.Res.Country, one) + } + + return +} + +func (s *RewardDetail) fission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdKeep: + return s._keep(cpn) + case consts.IdWinTogether: + return s._win(cpn) + case consts.IdReferral: + return s._referral(cpn) + case consts.IdCoin: + return s._coin(cpn) + case consts.IdCash: + return s._cash(cpn) + case consts.IdGold: + return s._gold(cpn) + case consts.IdVs: + return s._vs(cpn) + case consts.IdUno: + return s._uno(cpn) + } + return +} + +func (s *RewardDetail) _uno(cpn *model.FissionCampaign) (err error) { + s._hasUno() + + m := s.GetDao().FissionCampaignUnoGroup + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range list { + rewardIds = append(rewardIds, v.RewardID) + } + + // 奖品 + rewardM := s.GetDao().FissionCampaignReward + rewardList, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewardList)) + for _, v := range rewardList { + rewardMap[v.ID] = v + } + + titleMap, stockMap, _, err := s._mapData(rewardList, false) + if err != nil { + return + } + + s.Res.UnoCards = make([]*pb.RewardDetailRes_UnoCard, 0, len(list)) + + type num struct { + Mark string `json:"mark"` + PreIntactNum int64 `json:"pre_intact_num"` + IntactNum int64 `json:"intact_num"` + } + + collectM := s.GetDao().FissionUnoCollect + var nums []*num + err = collectM.WithContext(s.Ctx). + Select( + collectM.Mark, + collectM.PreIntactNum.Sum().As("pre_intact_num"), + collectM.IntactNum.Sum().As("intact_num"), + ). + Where(collectM.CampaignID.Eq(cpn.ID)). + Group(collectM.Mark). + Scan(&nums) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 合并 + var numMap = make(map[string]*num) + for _, v := range nums { + numMap[v.Mark] = v + } + + for _, v := range list { + var stock, useStock int64 + var title string + if reward, ok := rewardMap[v.RewardID]; ok { + stock, useStock = int64(reward.Stock), stockMap[reward.ID] + title = titleMap[reward.RewardID] + } + + var piNum, iNum int64 + if n, ok := numMap[v.Mark]; ok { + piNum = n.PreIntactNum + iNum = n.IntactNum + } + + s.Res.UnoCards = append(s.Res.UnoCards, &pb.RewardDetailRes_UnoCard{ + Id: v.ID, + Mark: v.Mark, + Title: title, + Stock: stock, + Remain: utils.Ternary[int64](stock < useStock, 0, stock-useStock), + PreIntactNum: piNum, + IntactNum: iNum, + }) + } + + return +} + +func (s *RewardDetail) _vs(cpn *model.FissionCampaign) (err error) { + s._hasSchedule() + + conf, err := cache.NewCampaignVs(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + teamM := s.GetDao().FissionCampaignVsTeam + teamList, err := teamM.WithContext(s.Ctx).Where(teamM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamMap = make(map[int64]*model.FissionCampaignVsTeam, len(teamList)) + for _, v := range teamList { + teamMap[v.ID] = v + } + + m := s.GetDao().FissionCampaignVsSchedule + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.VsAt.Gt(0)).Order(m.VsAt.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var scheduleIds []int64 + for _, v := range list { + scheduleIds = append(scheduleIds, v.ID) + } + + type voteNum struct { + ScheduleId int64 `json:"schedule_id"` + WinType int32 `json:"win_type"` + WinTeamId int64 `json:"win_team_id"` + Num int64 `json:"num"` + UserNum int64 `json:"user_num"` + } + + var votes []*voteNum + + voteM := s.GetDao().FissionVsVote + voteNumField := field.NewUnsafeFieldRaw("free_vote + point_vote") + err = voteM.WithContext(s.Ctx). + Select( + voteM.ScheduleID, + voteM.WinType, + voteM.WinTeamID, + voteNumField.Sum().As("num"), + voteM.ID.Count().As("user_num"), + ). + Where(voteM.CampaignID.Eq(cpn.ID), voteM.ScheduleID.In(scheduleIds...)). + Group(voteM.ScheduleID, voteM.WinType, voteM.WinTeamID). + Scan(&votes) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + type num struct { + ScheduleId int64 `json:"schedule_id"` + Num int64 `json:"num"` + } + + var preRewardNum []*num + stlM := s.GetDao().FissionVsVoteSettlement + err = stlM.WithContext(s.Ctx).Select( + stlM.ScheduleID, + stlM.ID.Count().As("num"), + ).Where(stlM.ScheduleID.In(scheduleIds...)).Group(stlM.ScheduleID).Scan(&preRewardNum) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var preRewardNumMap = make(map[int64]int64, len(preRewardNum)) + for _, v := range preRewardNum { + preRewardNumMap[v.ScheduleId] = v.Num + } + + var rewardNum []*num + err = stlM.WithContext(s.Ctx).Select( + stlM.ScheduleID, + stlM.ID.Count().As("num"), + ).Where(stlM.ScheduleID.In(scheduleIds...), stlM.AcceptAt.Gt(0)).Group(stlM.ScheduleID).Scan(&rewardNum) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardNumMap = make(map[int64]int64, len(rewardNum)) + for _, v := range rewardNum { + rewardNumMap[v.ScheduleId] = v.Num + } + + var voteNumMap = make(map[int64][]*voteNum, len(votes)) + for _, v := range votes { + voteNumMap[v.ScheduleId] = append(voteNumMap[v.ScheduleId], v) + } + + for _, v := range list { + + stl := v.GetSettlement() + one := &pb.RewardDetailRes_Schedule{ + Id: v.ID, + VsAt: v.VsAt, + VoteStart: v.VoteStart, + VoteEnd: v.VoteEnd, + Teams: nil, + WinType: stl.WinType, + WinTeamId: stl.WinTeamId, + PreRewardNum: preRewardNumMap[v.ID], + RewardNum: rewardNumMap[v.ID], + Tz: conf.VsTz, + Votes: nil, + } + + var drawNum, drawUserNum int64 + var teamNum = make(map[int64]int64) + var teamUserNumMap = make(map[int64]int64) + for _, vote := range voteNumMap[v.ID] { + switch vote.WinType { + case mtype.FissionCampaignVsScheduleWinTypeDraw: + drawNum = vote.Num + drawUserNum = vote.UserNum + default: + teamNum[vote.WinTeamId] = vote.Num + teamUserNumMap[vote.WinTeamId] = vote.UserNum + } + } + + for _, id := range v.GetVsTeamIds() { + if team, ok := teamMap[id]; ok { + one.Teams = append(one.Teams, &pb.RewardDetailRes_Team{ + Id: team.ID, + Name: team.Name, + LogoImg: team.LogoImg, + }) + } else { + one.Teams = append(one.Teams, &pb.RewardDetailRes_Team{ + Id: id, + }) + } + + one.Votes = append(one.Votes, &pb.RewardDetailRes_Vote{ + WinType: mtype.FissionCampaignVsScheduleWinTypeWin, + WinTeamId: id, + VoteNum: teamNum[id], + VoteUserNum: teamUserNumMap[id], + }) + } + + if verify.InArray[string](mtype.FissionCampaignVsScheduleOtherVoteDraw, v.GetOtherVote()...) { + one.Votes = append(one.Votes, &pb.RewardDetailRes_Vote{ + WinType: mtype.FissionCampaignVsScheduleWinTypeDraw, + VoteNum: drawNum, + VoteUserNum: drawUserNum, + }) + } + + s.Res.Schedules = append(s.Res.Schedules, one) + } + + return +} + +func (s *RewardDetail) _mapData(list []*model.FissionCampaignReward, showSelect bool) (titleMap map[int64]string, stockMap, selectMap map[int64]int64, err error) { + var ids, rewardIds []int64 + var existMap = make(map[int64]struct{}) + for _, v := range list { + ids = append(ids, v.ID) + if _, ok := existMap[v.RewardID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + existMap[v.RewardID] = struct{}{} + } + } + + titleMap, err = s._titleMap(rewardIds) + if err != nil { + return + } + + stockMap, selectMap = make(map[int64]int64, len(ids)), make(map[int64]int64, len(ids)) + + stock, err := stocks.NewCampaignReward(s.Ctx, ids...) + if err != nil { + return + } + stockMap, _ = stock.AllUseStock() + + if !showSelect { + return + } + + selectStock, err := stocks.NewCampaignRewardSelect(s.Ctx, ids...) + if err != nil { + return + } + selectMap, _ = selectStock.AllUseStock() + + return +} + +func (s *RewardDetail) _one(reward *model.FissionCampaignReward, useStock, selectNum int64, title string, showSelect bool) *pb.RewardDetailRes_Reward { + stock := int64(reward.Stock) + + remain := utils.Ternary[int64](showSelect, stock-selectNum, stock-useStock) + if remain < 0 { + remain = 0 + } + + return &pb.RewardDetailRes_Reward{ + Id: reward.ID, + Title: title, + Stock: stock, + Remain: remain, + Given: useStock, + CanUp: reward.IsThank == mtype.No, + IsThank: int32(reward.IsThank), + SelectNum: selectNum, + SignDay: reward.SignDay, + } +} + +func (s *RewardDetail) _titleMap(rewardIds []int64) (titleMap map[int64]string, err error) { + titleMap = make(map[int64]string, len(rewardIds)) + if len(rewardIds) == 0 { + return + } + + rewardM := s.GetDao().Reward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, reward := range rewards { + titleMap[reward.ID] = reward.RewardTitle + } + + for _, reward := range app.FissionFixRewards { + titleMap[reward.Id] = reward.RewardTitle + } + return +} + +type RewardDetailNum struct { + RewardId int64 `json:"reward_id"` + Num int64 `json:"num"` +} + +func (s *RewardDetail) _dbNum(cpnId int64, ids []int64) (numMap map[int64]int64, err error) { + var nums []*RewardDetailNum + m := s.GetDao().FissionRewardRecord.SubTable(cpnId) + err = m.WithContext(s.Ctx).Select(m.RewardID, m.ID.Count().As("num")).Where(m.RewardID.In(ids...)).Group(m.RewardID).Scan(&nums) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + numMap = make(map[int64]int64, len(ids)) + + for _, num := range nums { + numMap[num.RewardId] = num.Num + } + return +} + +func (s *RewardDetail) _coin(cpn *model.FissionCampaign) (err error) { + s._hasPool() + + m := s.GetDao().FissionCoinScene + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Order(m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Pools = make([]*pb.RewardDetailRes_Pool, 0, len(list)) + + gmt := utils.Ternary[string](cpn.TOffset < 0, fmt.Sprint(cpn.TOffset), fmt.Sprintf("+%d", cpn.TOffset)) + + conf, err := cache.NewCampaignCoin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + l := len(list) + var notRunId = make(map[int64]struct{}) + for i, scene := range list { + if i+1 >= l { + break + } + + if scene.OpenTime > time.Now().Unix() && list[i+1].OpenTime > time.Now().Unix() { + notRunId[scene.ID] = struct{}{} + } + + } + + for _, v := range list { + day, _, _ := timez.GMTStartAndEndTs(cpn.TOffset, v.OpenTime) + + var status int32 = 3 + initCoin := v.InitCoin + userCoin := v.UserCoin + initUse := v.InitUse + joinNum := v.JoinNum + joinUserNum := v.JoinUserNum + getNum := v.GetNum + getCoin := v.GetCoin + + noOpen := v.OpenTime > time.Now().Unix() // 还没到开奖时间 + gotReward := v.RewardTime < time.Now().Unix() // 已经领完奖了 + if noOpen { + // 进行中 + scene, _ := cachecurd.NewHMap(s.Ctx, + ckey.FissionCoinSceneData(v.ID), + cachecurd.SetCoinSceneBuild(cpn.ID, v.ID), + cachecurd.SetHMapExp(time.Duration(conf.OpenDays+1)*consts.TimeDay), + ) + + initCoin = conf.InitCoin + initUse = conf.InitUse + userCoin, _ = scene.GetInt64(cachecurd.CoinSceneUserCoin) + joinNum, _ = scene.GetInt64(cachecurd.CoinSceneJoinNum) + joinUserNum, _ = scene.GetInt64(cachecurd.CoinSceneJoinUserNum) + + status = 1 + if _, ok := notRunId[v.ID]; ok { + status = 4 + } + } else if !gotReward { // 领奖中 + scene, _ := cachecurd.NewHMap(s.Ctx, + ckey.FissionCoinSceneData(v.ID), + cachecurd.SetCoinSceneBuild(cpn.ID, v.ID), + cachecurd.SetHMapExp(time.Duration(conf.OpenDays+1)*consts.TimeDay), + ) + + userCoin, _ = scene.GetInt64(cachecurd.CoinSceneUserCoin) + joinNum, _ = scene.GetInt64(cachecurd.CoinSceneJoinNum) + joinUserNum, _ = scene.GetInt64(cachecurd.CoinSceneJoinUserNum) + getNum, _ = scene.GetInt64(cachecurd.CoinSceneGetNum) + getCoin, _ = scene.GetInt64(cachecurd.CoinSceneGetTotal) + + status = 2 + } + + var oneUseCoin, joinAvg int64 + if joinNum > 0 { + oneUseCoin = (userCoin + int64(initCoin)) / (joinNum + int64(initUse)) + joinAvg = (joinNum + int64(initUse)) / joinUserNum + } + + s.Res.Pools = append(s.Res.Pools, &pb.RewardDetailRes_Pool{ + Id: v.ID, + Title: fmt.Sprintf("%s(GMT%s)", day, gmt), + Status: status, + InitCoin: initCoin, + UserCoin: userCoin, + InitUse: initUse, + JoinNum: joinNum, + OneUseCoin: oneUseCoin, + JoinUserNum: joinUserNum, + GetNum: getNum, + JoinAvg: joinAvg, + GetCoin: getCoin, + }) + } + + return +} + +func (s *RewardDetail) _keep(cpn *model.FissionCampaign) (err error) { + s._hasStep() + s._showSelect() + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.RewardType.Eq(mtype.FissionCampaignRewardTypeGrowStep), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids, rewardIds []int64 + var existMap = make(map[int64]struct{}) + for _, v := range list { + ids = append(ids, v.ID) + if _, ok := existMap[v.RewardID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + existMap[v.RewardID] = struct{}{} + } + } + + titleMap, err := s._titleMap(rewardIds) + if err != nil { + return + } + + stockMap, err := s._dbNum(cpn.ID, ids) + if err != nil { + return + } + + s.Res.StepReward = make([]*pb.RewardDetailRes_Reward, 0, len(list)) + + for _, reward := range list { + stock, useStock := int64(reward.Stock), stockMap[reward.ID] + + s.Res.StepReward = append(s.Res.StepReward, &pb.RewardDetailRes_Reward{ + Id: reward.ID, + Title: titleMap[reward.RewardID], + Stock: stock, + Remain: utils.Ternary[int64](stock < stockMap[reward.ID], 0, stock-useStock), + Given: useStock, + CanUp: reward.IsThank == mtype.No, + IsThank: int32(reward.IsThank), + SelectNum: 0, + }) + } + + return +} + +func (s *RewardDetail) _win(cpn *model.FissionCampaign) (err error) { + s._hasNewcomer() + s._showAll() + s._showSelect() + + conf, err := cache.NewCampaignWin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + stock, err := stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + s.Res.All = int64(conf.RewardLimit) + s.Res.AllUse, _ = stock.GetUseStock(cpn.ID) + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.RewardType.In(mtype.FissionCampaignRewardTypeExtra, mtype.FissionCampaignRewardTypeNewcomer), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids, rewardIds []int64 + var existMap = make(map[int64]struct{}) + var hasExtra bool + for _, v := range list { + ids = append(ids, v.ID) + if _, ok := existMap[v.RewardID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + existMap[v.RewardID] = struct{}{} + } + + if !hasExtra && v.RewardType == mtype.FissionCampaignRewardTypeExtra { + hasExtra = true + } + } + + if hasExtra { + s._hasStep() + } + + titleMap, err := s._titleMap(rewardIds) + if err != nil { + return + } + + stockMap, err := s._dbNum(cpn.ID, ids) + if err != nil { + return + } + + for _, reward := range list { + useStock := stockMap[reward.ID] + + switch reward.RewardType { + case mtype.FissionCampaignRewardTypeExtra: + s.Res.ExtraReward = append(s.Res.ExtraReward, &pb.RewardDetailRes_Reward{ + Id: reward.ID, + Title: titleMap[reward.RewardID], + Given: useStock, + CanUp: reward.IsThank == mtype.No, + IsThank: int32(reward.IsThank), + SelectNum: 0, + }) + case mtype.FissionCampaignRewardTypeNewcomer: + s.Res.NewcomerReward = append(s.Res.NewcomerReward, &pb.RewardDetailRes_Reward{ + Id: reward.ID, + Title: titleMap[reward.RewardID], + Given: useStock, + CanUp: reward.IsThank == mtype.No, + IsThank: int32(reward.IsThank), + SelectNum: 0, + }) + } + } + + return +} + +func (s *RewardDetail) _referral(cpn *model.FissionCampaign) (err error) { + s._showAll() + s._showSelect() + + conf, err := cache.NewCampaignReferral(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + stock, err := stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + s.Res.All = int64(conf.RewardLimit) + s.Res.AllUse, _ = stock.GetUseStock(cpn.ID) + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.RewardType.In(mtype.FissionCampaignRewardTypeExtra), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + s._hasExtra() + + var ids, rewardIds []int64 + var existMap = make(map[int64]struct{}) + for _, v := range list { + ids = append(ids, v.ID) + if _, ok := existMap[v.RewardID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + existMap[v.RewardID] = struct{}{} + } + } + + titleMap, err := s._titleMap(rewardIds) + if err != nil { + return + } + + stockMap, err := s._dbNum(cpn.ID, ids) + if err != nil { + return + } + + for _, reward := range list { + useStock := stockMap[reward.ID] + + s.Res.ExtraReward = append(s.Res.ExtraReward, &pb.RewardDetailRes_Reward{ + Id: reward.ID, + Title: titleMap[reward.RewardID], + Given: useStock, + CanUp: reward.IsThank == mtype.No, + IsThank: int32(reward.IsThank), + SelectNum: 0, + }) + } + + return +} + +func (s *RewardDetail) _cash(cpn *model.FissionCampaign) (err error) { + s._showAll() + s._showSelect() + + conf, err := cache.NewCampaignCash(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + stock, err := stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + s.Res.All = int64(conf.PriceNum) + s.Res.AllUse, _ = stock.GetUseStock(cpn.ID) + + return +} + +func (s *RewardDetail) _gold(cpn *model.FissionCampaign) (err error) { + s._showAll() + s._showSelect() + + conf, err := cache.NewCampaignGold(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + stock, err := stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + s.Res.All = int64(conf.PriceNum) + s.Res.AllUse, _ = stock.GetUseStock(cpn.ID) + + return +} + +// 显示额外奖品模块 +func (s *RewardDetail) _hasExtra() { + s.Res.RewardType = append(s.Res.RewardType, "extra") +} + +// 显示活动主奖励模块 +func (s *RewardDetail) _hasApp() { + s.Res.RewardType = append(s.Res.RewardType, "app") +} + +// 显示活动主奖励模块 +func (s *RewardDetail) _hasAppSign() { + s.Res.RewardType = append(s.Res.RewardType, "app_sign") +} + +// 显示任务奖品模块 +func (s *RewardDetail) _hasTask() { + s.Res.RewardType = append(s.Res.RewardType, "task") +} + +// 显示奖池记录模块 +func (s *RewardDetail) _hasPool() { + s.Res.RewardType = append(s.Res.RewardType, "pool") +} + +// 显示阶梯奖品模块 +func (s *RewardDetail) _hasStep() { + s.Res.RewardType = append(s.Res.RewardType, "step") +} + +// 显示新人奖品模块 +func (s *RewardDetail) _hasNewcomer() { + s.Res.RewardType = append(s.Res.RewardType, "newcomer") +} + +// 显示赛程模块 +func (s *RewardDetail) _hasSchedule() { + s.Res.RewardType = append(s.Res.RewardType, "schedule") +} + +// 显示Uno模块 +func (s *RewardDetail) _hasUno() { + s.Res.RewardType = append(s.Res.RewardType, "uno") +} + +// 显示总预算模块 +func (s *RewardDetail) _showAll() { + s.Res.ShowAll = 1 +} + +// 显示活动主奖励模块要展示“选择数”的列 +func (s *RewardDetail) _showSelect() { + s.Res.ShowSelect = 1 +} diff --git a/internal/service/containers/campaign/save_lang.go b/internal/service/containers/campaign/save_lang.go new file mode 100644 index 0000000..aa3f946 --- /dev/null +++ b/internal/service/containers/campaign/save_lang.go @@ -0,0 +1,514 @@ +package campaign + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen/field" +) + +type SaveLang struct { + logic.Logic + Req *pb.SaveLangReq + Res *pb.SaveLangRes +} + +func (s *SaveLang) Run() error { + return logic.Run(s) +} + +func (s *SaveLang) Exec() (err error) { + cpn, conf, err := s.campaign() + if err != nil { + return + } + + return s.save(cpn, conf) +} + +// 活动数据 +func (s *SaveLang) campaign() (cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("cpn not found") + return + } + + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *SaveLang) save(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + m := s.GetDao().FissionCampaignLang + lang, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.LangMark.Eq(s.Req.GetLangMark()), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if s.Req.ToView { + channelM := s.GetDao().FissionCampaignChannel + var channel *model.FissionCampaignChannel + channel, err = channelM.WithContext(s.Ctx).Where(channelM.CampaignID.Eq(cpn.ID), channelM.IsDefault.Eq(mtype.Yes), channelM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var project *model.Project + project, err = cache.NewProject(s.Ctx).FindById(cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if channel != nil { + linkObj := blink.NewCampaignLink(project.Domain, cpn.HashID, channel.Mark, + blink.SetView(), + blink.SetLang(s.Req.GetLangMark()), + blink.SetUserId(consts.FissionViewer), + ) + s.Res.ViewLink = linkObj.CampaignShareLink() + } + } + + if lang == nil { + return s._create(cpn, conf) + } + + return s._update(lang, conf) +} + +func (s *SaveLang) _create(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + langTypes := cpn.GetLangTypes() + nt := mtype.MarkToLangType[s.Req.GetLangMark()] + for _, v := range langTypes { + if v == nt { + err = s.BE().VerifyError("lang exist") + return + } + } + + conds, _ := jsonm.ToSliceString(s.Req.GetConds()) + quit, _ := jsonm.ToObjString(s.Req.GetQuit()) + questions, _ := jsonm.ToSliceString(s.Req.GetQuestions()) + cash, _ := jsonm.ToObjString(s.Req.GetCash()) + gold, _ := jsonm.ToObjString(s.Req.GetGold()) + coin, _ := jsonm.ToObjString(s.Req.GetCoin()) + qaGroup, _ := jsonm.ToObjString(s.Req.GetQaGroup()) + talkText, _ := jsonm.ToSliceString(s.Req.GetTalkText()) + vs, _ := jsonm.ToSliceString(s.Req.GetSchedules()) + + lang := withdefault.FissionCampaignLang(&model.FissionCampaignLang{ + CampaignID: cpn.ID, + LangMark: s.Req.GetLangMark(), + PageTitle: s.Req.GetPageTitle(), + ImageMain: s.Req.GetImageMain(), + DownloadPageImage: s.Req.GetDownloadPageImage(), + WechatPageImage: s.Req.GetWechatPageImage(), + ContentImg: s.Req.GetContentImg(), + WebBgImg: s.Req.GetWebBgImg(), + WarmUpImg: s.Req.GetWarmUpImg(), + DlBgImg: s.Req.GetDlBgImg(), + DlBannerImg: s.Req.GetDlBannerImg(), + DlBannerAppLogo: s.Req.GetDlBannerAppLogo(), + DlBannerAppName: s.Req.GetDlBannerAppName(), + DlBannerAppBtn: s.Req.GetDlBannerAppBtn(), + ShareText: s.Req.GetShareText(), + ShareImg: s.Req.GetShareImg(), + Rule: s.Req.GetRule(), + Conds: conds, + Quit: quit, + Questions: questions, + QaGroup: qaGroup, + LongImg: "[]", + Cash: cash, + Gold: gold, + TOffset: s.Req.GetTOffset(), + TalkText: talkText, + Coin: coin, + TopicColor: s.Req.GetTopicColor(), + PcBg: s.Req.GetPcBg(), + RuleImg: s.Req.GetRuleImg(), + Vs: vs, + Uno: "{}", + }) + + if uno := s.Req.GetUno(); uno != nil { + lang.SetUno(&mtype.LangUno{ + Red: s._unoCard(uno.GetRed()), + Blue: s._unoCard(uno.GetBlue()), + Green: s._unoCard(uno.GetGreen()), + Yellow: s._unoCard(uno.GetYellow()), + }) + } + + err = s.GetDao().FissionCampaignLang.WithContext(s.Ctx).Create(lang) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf.HasLongImg == mtype.Yes { + var zones []*model.FissionCampaignLongImgZone + var imgs = make([]*model.FissionCampaignLongImg, 0, len(s.Req.GetLongImgs())) + for _, v := range s.Req.GetLongImgs() { + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: cpn.ID, + LangID: lang.ID, + ClickType: int8(v.ClickType), + ImgURL: v.ImgUrl, + WebURL: v.WebUrl, + AppParam: v.AppParam, + PcParam: v.PcParam, + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + LangSourceID: v.GetLangSourceId(), + }) + + for _, zone := range v.GetHotZone() { + zones = append(zones, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: cpn.ID, + ImgID: one.ID, + WebURL: zone.WebUrl, + AppParam: zone.AppParam, + ClickX: zone.ClickX, + ClickY: zone.ClickY, + ClickH: zone.ClickH, + ClickW: zone.ClickW, + TargetType: int8(zone.GetTargetType()), + TargetID: zone.GetTargetId(), + PcParam: zone.GetPcParam(), + })) + } + + imgs = append(imgs, one) + } + + err = s.GetDao().FissionCampaignLongImg.WithContext(s.Ctx).Create(imgs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(zones) > 0 { + err = s.GetDao().FissionCampaignLongImgZone.WithContext(s.Ctx).Create(zones...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + } + + langTypes = append(langTypes, nt) + + m := s.GetDao().FissionCampaign + lt, _ := jsonm.MarshalToString(langTypes) + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(m.LangTypes.Value(lt)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaign(s.Ctx).Clear(cpn) + }) + + return +} + +func (s *SaveLang) _unoCard(in []*pb.SaveLangReq_UnoCard) []*mtype.UnoCard { + out := make([]*mtype.UnoCard, 0, len(in)) + for i, v := range in { + out = append(out, &mtype.UnoCard{ + CardNo: int32(i) + 1, + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + PcParam: v.GetPcParam(), + }) + } + + return out +} + +func (s *SaveLang) _update(lang *model.FissionCampaignLang, conf *model.FissionCampaignConfig) (err error) { + conds, _ := jsonm.ToSliceString(s.Req.GetConds()) + quit, _ := jsonm.ToObjString(s.Req.GetQuit()) + questions, _ := jsonm.ToSliceString(s.Req.GetQuestions()) + cash, _ := jsonm.ToObjString(s.Req.GetCash()) + gold, _ := jsonm.ToObjString(s.Req.GetGold()) + coin, _ := jsonm.ToObjString(s.Req.GetCoin()) + qaGroup, _ := jsonm.ToObjString(s.Req.GetQaGroup()) + talkText, _ := jsonm.ToSliceString(s.Req.GetTalkText()) + vs, _ := jsonm.ToSliceString(s.Req.GetSchedules()) + + m := s.GetDao().FissionCampaignLang + var upData = []field.AssignExpr{ + m.PageTitle.Value(s.Req.GetPageTitle()), + m.ImageMain.Value(s.Req.GetImageMain()), + m.DownloadPageImage.Value(s.Req.GetDownloadPageImage()), + m.WechatPageImage.Value(s.Req.GetWechatPageImage()), + m.WebBgImg.Value(s.Req.GetWebBgImg()), + m.WarmUpImg.Value(s.Req.GetWarmUpImg()), + m.ContentImg.Value(s.Req.GetContentImg()), + m.DlBgImg.Value(s.Req.GetDlBgImg()), + m.DlBannerImg.Value(s.Req.GetDlBannerImg()), + m.DlBannerAppLogo.Value(s.Req.GetDlBannerAppLogo()), + m.DlBannerAppName.Value(s.Req.GetDlBannerAppName()), + m.DlBannerAppBtn.Value(s.Req.GetDlBannerAppBtn()), + m.ShareText.Value(s.Req.GetShareText()), + m.ShareImg.Value(s.Req.GetShareImg()), + m.Rule.Value(s.Req.GetRule()), + m.Cash.Value(cash), + m.Gold.Value(gold), + m.Coin.Value(coin), + m.TOffset.Value(s.Req.GetTOffset()), + m.TopicColor.Value(s.Req.GetTopicColor()), + m.PcBg.Value(s.Req.GetPcBg()), + m.RuleImg.Value(s.Req.GetRuleImg()), + m.Vs.Value(vs), + } + + if uno := s.Req.GetUno(); uno != nil { + unoVal, _ := jsonm.ToObjString(&mtype.LangUno{ + Red: s._unoCard(uno.GetRed()), + Blue: s._unoCard(uno.GetBlue()), + Green: s._unoCard(uno.GetGreen()), + Yellow: s._unoCard(uno.GetYellow()), + }) + upData = append(upData, m.Uno.Value(unoVal)) + } + + upData = append(upData, m.Conds.Value(conds), m.Questions.Value(questions), m.Quit.Value(quit), m.QaGroup.Value(qaGroup), m.TalkText.Value(talkText)) + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(lang.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignLang(s.Ctx).Clear(lang) + }) + + if conf.HasLongImg == mtype.No { + return + } + + imgM := s.GetDao().FissionCampaignLongImg + imgs, err := imgM.WithContext(s.Ctx).Where(imgM.CampaignID.Eq(lang.CampaignID), imgM.LangID.Eq(lang.ID), imgM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.FissionCampaignLongImg) + for _, v := range imgs { + oldMap[v.ID] = v + } + + zoneM := s.GetDao().FissionCampaignLongImgZone + var zone []*model.FissionCampaignLongImgZone + var add = make([]*model.FissionCampaignLongImg, 0) + var zoneDelIds []int64 + for _, v := range s.Req.GetLongImgs() { + old, ok := oldMap[v.GetId()] + if !ok { + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: conf.CampaignID, + LangID: lang.ID, + ClickType: int8(v.GetClickType()), + ImgURL: v.GetImgUrl(), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + PcParam: v.GetPcParam(), + }) + + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: one.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + PcParam: hotZone.GetPcParam(), + })) + } + } + + add = append(add, one) + + continue + } + + _, err = imgM.WithContext(s.Ctx).Where(imgM.ID.Eq(old.ID)).UpdateSimple( + imgM.ClickType.Value(int8(v.GetClickType())), + imgM.ImgURL.Value(v.GetImgUrl()), + imgM.WebURL.Value(v.GetWebUrl()), + imgM.AppParam.Value(v.GetAppParam()), + imgM.TargetType.Value(int8(v.GetTargetType())), + imgM.TargetID.Value(v.GetTargetId()), + imgM.PcParam.Value(v.GetPcParam()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + delete(oldMap, old.ID) + + switch old.ClickType { + case mtype.FissionCampaignLongImgClickTypeAll: + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: old.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + PcParam: hotZone.GetPcParam(), + })) + } + } + case mtype.FissionCampaignLongImgClickTypeZone: + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeAll { + _, err = zoneM.WithContext(s.Ctx).Where(zoneM.ImgID.Eq(old.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } else if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + var zones []*model.FissionCampaignLongImgZone + zones, err = zoneM.WithContext(s.Ctx).Where(zoneM.ImgID.Eq(old.ID), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldZoneMap = make(map[int64]*model.FissionCampaignLongImgZone, len(zones)) + for _, click := range zones { + oldZoneMap[click.ID] = click + } + + for _, hotZone := range v.GetHotZone() { + oldZone, ok1 := oldZoneMap[hotZone.GetId()] + if !ok1 { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: old.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + PcParam: hotZone.GetPcParam(), + })) + + continue + } + + _, err = zoneM.WithContext(s.Ctx).Where(zoneM.ID.Eq(oldZone.ID)).UpdateSimple( + zoneM.WebURL.Value(hotZone.GetWebUrl()), + zoneM.AppParam.Value(hotZone.GetAppParam()), + zoneM.ClickX.Value(hotZone.GetClickX()), + zoneM.ClickY.Value(hotZone.GetClickY()), + zoneM.ClickH.Value(hotZone.GetClickH()), + zoneM.ClickW.Value(hotZone.GetClickW()), + zoneM.TargetType.Value(int8(hotZone.GetTargetType())), + zoneM.TargetID.Value(hotZone.GetTargetId()), + zoneM.PcParam.Value(hotZone.GetPcParam()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + delete(oldZoneMap, oldZone.ID) + } + + for id := range oldZoneMap { + zoneDelIds = append(zoneDelIds, id) + } + } + } + } + + var imgDelIds []int64 + for id := range oldMap { + imgDelIds = append(imgDelIds, id) + } + + if len(add) > 0 { + err = imgM.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(zone) > 0 { + err = zoneM.WithContext(s.Ctx).Create(zone...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(imgDelIds) > 0 { + _, err = imgM.WithContext(s.Ctx).Where(imgM.ID.In(imgDelIds...)).UpdateSimple(imgM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(zoneDelIds) > 0 { + _, err = zoneM.WithContext(s.Ctx).Where(zoneM.ID.In(zoneDelIds...)).UpdateSimple(zoneM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} diff --git a/internal/service/containers/campaign/show.go b/internal/service/containers/campaign/show.go new file mode 100644 index 0000000..bcdf719 --- /dev/null +++ b/internal/service/containers/campaign/show.go @@ -0,0 +1,2480 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + "gorm.io/gen" +) + +type Show struct { + logic.Logic + Req *pb.ShowReq + Res *pb.ShowRes + + rewardLangList []*model.RewardLang + + levelMap map[int64]string + + helpMap map[int64][]*model.FissionCampaignTask + + ruleMap map[int64]*model.FissionCampaignRewardRule + + rewardAddMap map[int64]*pb.ShowRes_OpenAdd + rewardTaskMap map[int64]*pb.ShowRes_RewardTask +} + +func (s *Show) Run() error { + return logic.Run(s) +} + +func (s *Show) Exec() (err error) { + cpn, err := s.setCampaign() + if err != nil { + return + } + + conf, err := s.setConf(cpn) + if err != nil { + return + } + + err = s.setTargetOption(cpn, conf) + if err != nil { + return + } + + err = s.setFission(cpn) + if err != nil { + return + } + + err = s.setPush(cpn) + if err != nil { + return + } + + err = s.setEvent(cpn) + if err != nil { + return + } + + err = s.setChild(cpn) + if err != nil { + return + } + + err = s.setDelayLinkData(cpn) + if err != nil { + return + } + + if !s.Req.GetNotReward() { + err = s.setReward(cpn, conf) + if err != nil { + return + } + } + + return +} + +// 设置活动数据 +func (s *Show) setCampaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + return nil, s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("campaign not found") + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + s.Res.Title = cpn.Title + s.Res.TempId = cpn.TemplateID + s.Res.ProjectId = cpn.ProjectID + s.Res.FissionMark = consts.FissionIdMap[cpn.FissionID] + s.Res.Status = int32(cpn.Status) + s.Res.CoverUrl = cpn.CoverURL + s.Res.TOffset = cpn.TOffset + s.Res.StartTime = cpn.StartTime + s.Res.TStart = cpn.TStart + s.Res.EndTime = cpn.EndTime + s.Res.TEnd = cpn.TEnd + s.Res.LangMarks = cpn.GetLangMarks() + s.Res.FissionId = cpn.FissionID + + return + }) + + return +} + +// 设置活动配置数据 +func (s *Show) setConf(cpn *model.FissionCampaign) (conf *model.FissionCampaignConfig, err error) { + cc := cache.NewCampaignConfig(s.Ctx) + conf, err = cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + project, err := finder.Project(s.Ctx, cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var targetChannelMap = make(map[int64]*model.FissionCampaignChannel) + var targetCpnMap = make(map[int64]*model.FissionCampaign) + var zoneMap = make(map[int64][]*model.FissionCampaignLongImgZone) + var longImgs []*model.FissionCampaignLongImg + if conf.HasLongImg == mtype.Yes { + longImgM := s.GetDao().FissionCampaignLongImg + longImgs, err = longImgM.WithContext(s.Ctx).Where( + longImgM.CampaignID.Eq(cpn.ID), + longImgM.IsDel.Eq(mtype.No), + longImgM.LangID.Eq(0), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cpnIds []int64 + var zoneImgIds []int64 + for _, longImg := range longImgs { + if longImg.ClickType == mtype.FissionCampaignLongImgClickTypeZone { + zoneImgIds = append(zoneImgIds, longImg.ID) + } + + if longImg.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + cpnIds = append(cpnIds, longImg.TargetID) + } + } + + if len(zoneImgIds) > 0 { + zoneM := s.GetDao().FissionCampaignLongImgZone + var zones []*model.FissionCampaignLongImgZone + zones, err = zoneM.WithContext(s.Ctx).Where(zoneM.ImgID.In(zoneImgIds...), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, zone := range zones { + zoneMap[zone.ImgID] = append(zoneMap[zone.ImgID], zone) + if zone.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + cpnIds = append(cpnIds, zone.TargetID) + } + } + } + + if len(cpnIds) > 0 { + cpnM := s.GetDao().FissionCampaign + var cpns []*model.FissionCampaign + cpns, err = cpnM.WithContext(s.Ctx).Where(cpnM.ID.In(cpnIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range cpns { + targetCpnMap[v.ID] = v + } + + channelM := s.GetDao().FissionCampaignChannel + var channels []*model.FissionCampaignChannel + channels, err = channelM.WithContext(s.Ctx).Where(channelM.CampaignID.In(cpnIds...), channelM.IsDefault.Eq(mtype.Yes), channelM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, channel := range channels { + targetChannelMap[channel.CampaignID] = channel + } + + } + } + + style, err := cache.NewCampaignStyle(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var pointsUse *model.FissionCampaignPointsUse + if conf.PointsUse == mtype.Yes { + pointsUse, err = cache.NewCampaignPointsUse(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + chat, err := cache.NewCampaignChat(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.AddAfterRun(func() (err error) { + + // 一般配置 + s.Res.Config = &pb.ShowRes_Config{ + RuleTextColor: conf.RuleTextColor, + RuleBgColor: conf.RuleBgColor, + ShareText: conf.ShareText, + ShareImg: conf.ShareImg, + HasRank: int32(conf.HasRank), + RankBackgroundColor: conf.RankBackgroundColor, + RankTextColor: conf.RankTextColor, + DownloadPageImage: conf.DownloadPageImage, + IsDefaultDownload: int32(conf.IsDefaultDownload), + WechatPageImage: conf.WechatPageImage, + IsDefaultWechat: int32(conf.IsDefaultWechat), + ImageMain: conf.ImageMain, + IsDefaultMain: int32(conf.IsDefaultMain), + ImagePreview: conf.ImagePreview, + LinkBtnTextColor: conf.LinkBtnTextColor, + LinkBtnBgColor: conf.LinkBtnBgColor, + LinkTextColor: conf.LinkTextColor, + ShowShare: int32(conf.ShowShare), + Share: conf.GetShare(), + PlayRule: conf.PlayRule, + PageTitle: conf.PageTitle, + DmShow: int32(conf.DmShow), + WebBgImg: conf.WebBgImg, + HasWeb: int32(conf.HasWeb), + HasWarmUp: int32(conf.HasWarmUp), + WarmUpImg: conf.WarmUpImg, + WarmUpEnd: conf.WarmUpEnd, + IconType: int32(conf.IconType), + IconBgColor: conf.IconBgColor, + DlType: int32(conf.DlType), + DlBannerType: int32(conf.DlBannerType), + DlBannerImg: conf.DlBannerImg, + DlBannerAppLogo: conf.DlBannerAppLogo, + DlBannerAppName: conf.DlBannerAppName, + DlBannerAppBtn: conf.DlBannerAppBtn, + DlBannerPosition: int32(conf.DlBannerPosition), + TopicColor: conf.TopicColor, + WindowCover: int32(conf.WindowCover), + OpenAd: 0, + CloseCopyShare: int32(project.CloseCopyShare), + IconOpen: conf.GetIconOpen(), + HasWhite: int32(conf.HasWhite), + WhiteList: conf.WhiteList, + PcBg: conf.PcBg, + AdsType: int32(conf.AdsType), + LinkTempId: conf.LinkTempID, + RuleTimeOpen: int32(conf.RuleTimeOpen), + OutsideTask: int32(conf.OutsideTask), + IconTextColor: "", + OpenShare: int32(conf.OpenShare), + ShowToUse: int32(conf.ShowToUse), + RuleType: int32(conf.RuleType), + RuleImg: "", + RuleOutside: int32(conf.RuleOutside), + DeviceOnce: int32(conf.DeviceOnce), + } + + if style != nil { + switch cpn.FissionID { + case consts.IdPrizeWheel: + custom := style.GetWheelStyle() + s.Res.WheelStyle = &pb.ShowRes_WheelStyle{ + TopicMark: custom.TopicMark, + MainImg: custom.MainImg, + BgColor: custom.BgColor, + Bottom1: custom.Bottom1, + Bottom2: custom.Bottom2, + Bottom3: custom.Bottom3, + Pointer: custom.Pointer, + PlayBtn: custom.PlayBtn, + BorderImg: custom.BorderImg, + ButtonColor: custom.ButtonColor, + WheelTextColor: custom.WheelTextColor, + } + case consts.IdLuckyGrid: + custom := style.GetGridStyle() + s.Res.GridStyle = &pb.ShowRes_GridStyle{ + TopicMark: custom.TopicMark, + MainImg: custom.MainImg, + BgColor: custom.BgColor, + ButtonColor: custom.ButtonColor, + PlayImg: custom.PlayImg, + DisablePlayImg: custom.DisablePlayImg, + MachineImg: custom.MachineImg, + GridImg: custom.GridImg, + ActivateImg: custom.ActivateImg, + } + case consts.IdFlip: + custom := style.GetFlipStyle() + s.Res.FlipStyle = &pb.ShowRes_FlipStyle{ + TopicMark: custom.TopicMark, + MainImg: custom.MainImg, + BgColor: custom.BgColor, + ButtonColor: custom.ButtonColor, + PlayImg: custom.PlayImg, + CardImg: custom.CardImg, + } + case consts.IdGashapon: + custom := style.GetGashaponStyle() + s.Res.GashaponStyle = &pb.ShowRes_GashaponStyle{ + TopicMark: custom.TopicMark, + MainImg: custom.MainImg, + BgColor: custom.BgColor, + MachineImg: custom.MachineImg, + PlayImg: custom.PlayImg, + EggType: custom.EggType, + EggImgs: custom.EggImgs, + } + } + + s.Res.Config.IconTextColor = style.IconTextColor + s.Res.Config.RuleImg = style.RuleImg + } + + ads, err := cache.NewProjectAd(s.Ctx).FindByProjectId(cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 开启广告 + if ads != nil && ads.OpenAd == mtype.Yes { + if ads.CampaignAd == mtype.Yes && conf.AdsType == mtype.FissionCampaignConfigAdsTypeProject { + s.Res.Config.OpenAd = mtype.Yes + } else if conf.AdsType == mtype.FissionCampaignConfigAdsTypeOpen { + s.Res.Config.OpenAd = mtype.Yes + } + } + + // 键值配置 + cd := conf.GetCampaignData() + s.Res.CampaignData = make([]*pb.ShowRes_KV, 0, len(cd)) + for _, v := range cd { + s.Res.CampaignData = append(s.Res.CampaignData, &pb.ShowRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + + // 社媒配置 + var share = conf.GetShare() + s.Res.Share = make([]*pb.ShowRes_Share, 0, len(share)) + var shareMap = consts.ShareMap + for _, v := range share { + if sh, ok := shareMap[v]; ok { + s.Res.Share = append(s.Res.Share, &pb.ShowRes_Share{ + Id: sh.Id, + Title: sh.Title, + Logo: sh.Logo, + Scheme: sh.Scheme, + IosScheme: sh.IosScheme, + }) + } + } + + // 长图 + s.Res.LongImgs = make([]*pb.ShowRes_LongImg, 0, len(longImgs)) + for _, v := range longImgs { + one := &pb.ShowRes_LongImg{ + ImgUrl: v.ImgURL, + WebUrl: v.WebURL, + AppParam: v.AppParam, + Id: v.ID, + ClickType: int32(v.ClickType), + HotZone: make([]*pb.ShowRes_HotZone, 0, len(zoneMap[v.ID])), + TargetType: int32(v.TargetType), + TargetId: v.TargetID, + TargetUrl: "", + PcParam: v.PcParam, + } + + if v.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + one.TargetUrl = blink.NewCampaignLink(project.Domain, targetCpnMap[v.TargetID].HashID, targetChannelMap[v.TargetID].Mark).CampaignShareLink() + } + + for _, zone := range zoneMap[v.ID] { + two := &pb.ShowRes_HotZone{ + Id: zone.ID, + WebUrl: zone.WebURL, + AppParam: zone.AppParam, + ClickX: zone.ClickX, + ClickY: zone.ClickY, + ClickW: zone.ClickW, + ClickH: zone.ClickH, + TargetType: int32(zone.TargetType), + TargetId: zone.TargetID, + TargetUrl: "", + PcParam: zone.PcParam, + } + + if zone.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + two.TargetUrl = blink.NewCampaignLink(project.Domain, targetCpnMap[zone.TargetID].HashID, targetChannelMap[zone.TargetID].Mark).CampaignShareLink() + } + + one.HotZone = append(one.HotZone, two) + + } + + s.Res.LongImgs = append(s.Res.LongImgs, one) + } + + if pointsUse != nil { + s.Res.PointsUse = &pb.ShowRes_PointsUse{ + Open: int32(conf.PointsUse), + Icon: pointsUse.Icon, + UrlId: pointsUse.URLID, + UseNum: pointsUse.UseNum, + DayLimit: pointsUse.DayLimit, + TotalLimit: pointsUse.TotalLimit, + } + } + + if chat != nil { + s.Res.Chat = &pb.ShowRes_Chat{ + Open: int32(conf.OpenChat), + HeaderImg: chat.HeaderImg, + ChatBg: chat.ChatBg, + DayLimit: chat.DayLimit, + } + } + + return + }) + + return +} + +func (s *Show) setTargetOption(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + + condM := s.GetDao().FissionCampaignCond + var cond = []gen.Condition{ + condM.CampaignID.Eq(cpn.ID), + condM.RewardID.Eq(0), + } + if cpn.Status == mtype.FissionCampaignStatusCancel { + cond = append(cond, condM.DelUse.Eq(mtype.Yes)) + } else { + cond = append(cond, condM.IsDel.Eq(mtype.No)) + } + + list, err := condM.WithContext(s.Ctx).Where(cond...).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + ticketM := s.GetDao().FissionCampaignTicket + tickets, err := ticketM.WithContext(s.Ctx).Where(ticketM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + taskM := s.GetDao().FissionCampaignTask + taskList, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(cpn.ID), + taskM.PropMark.In( + mtype.FissionCampaignTaskPropMarkChance, + mtype.FissionCampaignTaskPropMarkReward, + mtype.FissionCampaignTaskPropMarkPoint, + mtype.FissionCampaignTaskPropMarkUnoThree, + mtype.FissionCampaignTaskPropMarkUnoFix, + mtype.FissionCampaignTaskPropMarkUnoFive, + ), + taskM.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + var taskMap = make(map[string]*model.FissionCampaignTask, len(taskList)) + for _, task := range taskList { + taskMap[task.TaskMark] = task + rewardIds = append(rewardIds, task.RewardID) + } + + var rewardMap = make(map[int64]*pb.ShowRes_Reward, len(rewardIds)) + if len(rewardIds) > 0 { + rewardM := s.GetDao().FissionCampaignReward + var rewards []*model.FissionCampaignReward + rewards, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var brids []int64 + for _, reward := range rewards { + brids = append(brids, reward.RewardID) + } + + var preward *provider.Rewards + preward, err = provider.NewRewards(s.Ctx, cpn.ProjectID, brids...) + if err != nil { + return + } + + for _, v := range rewards { + info, _ := preward.InfoAutoLang(v.RewardID) + rewardMap[v.ID] = &pb.ShowRes_Reward{ + Id: v.ID, + RewardId: v.RewardID, + Stock: v.Stock, + RewardNum: v.RewardNum, + Title: info.RewardTitle, + ImgUrl: info.ImgUrl, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Url: info.Url, + FormTitle: info.FormTitle, + LangMark: info.Mark, + ExpiredDay: v.ExpiredDay, + } + + for _, datum := range info.KvData { + rewardMap[v.ID].KvData = append(rewardMap[v.ID].KvData, &pb.ShowRes_KV{ + Key: datum.Key, + Value: datum.Value, + }) + } + } + + } + + s.AddAfterRun(func() (err error) { + + if consts.NewEventCpn(cpn.FissionID) { + s.Res.TargetOption = &pb.ShowRes_TargetOption{ + Target: int32(conf.Target), + Fixed: nil, + Custom: nil, + Option: int32(conf.Option), + } + + for _, ticket := range tickets { + switch ticket.Mark { + case mtype.FissionCampaignTicketFixed: + fixed := &pb.ShowRes_Fixed{ + Open: int32(ticket.Open), + AppEvent: int32(ticket.AppEvent), + TargetNum: 0, + Chance: 0, + ChanceLimit: 0, + Percent: 0, + } + + switch ticket.AppEvent { + case mtype.FissionCampaignTicketAppEventInstall: + if task, ok := taskMap[mtype.FissionCampaignTaskMarkInstall]; ok { + fixed.TargetNum = task.Num + fixed.Chance = task.Chance + fixed.ChanceLimit = task.ChanceLimit + fixed.Percent = task.Percent + } + case mtype.FissionCampaignTicketAppEventRegister: + if task, ok := taskMap[mtype.FissionCampaignTaskMarkRegister]; ok { + fixed.TargetNum = task.Num + fixed.Chance = task.Chance + fixed.ChanceLimit = task.ChanceLimit + fixed.Percent = task.Percent + } + } + + s.Res.TargetOption.Fixed = fixed + case mtype.FissionCampaignTicketCustom: + custom := &pb.ShowRes_Custom{ + Open: int32(ticket.Open), + BothType: int32(ticket.BothType), + Cond: nil, + BothAll: nil, + PreEvent: int32(ticket.PreEvent), + } + + for _, v := range list { + one := &pb.ShowRes_Cond{ + Id: v.ID, + Event: v.Event, + EventKey: v.EventKey, + EventVal: v.EventVal, + Desc: v.Desc, + IfCond: int32(v.IfCond), + TaskLimit: 0, + Chance: 0, + TriggerType: int32(v.TriggetType), + DayLimit: 0, + LevelIds: nil, + EventType: int32(v.EventType), + ViewType: int32(v.ViewType), + LangMarks: nil, + WatchSec: v.WatchSec, + WeekLimit: 0, + WeekNum: 0, + OpenJump: int32(v.OpenJump), + WebUrl: v.WebURL, + ExtraParam: v.ExtraParam, + GoShow: int32(v.GoShow), + AdsStrategyId: v.AdsStrategyID, + AdsStrategyTitle: "", + IsSuper: int32(v.IsSuper), + HasPre: 0, + PreCond: 0, + ExpiredMin: 0, + Reward: nil, + PropMark: "", + Sort: v.Sort, + OpenPush: int32(v.OpenPush), + PcParam: v.PcParam, + AwardMode: 0, + GoText: v.GoText, + ClickEffectOpen: int32(v.ClickEffectOpen), + ClickEffect: v.ClickEffect, + ClickEffectUnit: v.ClickEffectUnit, + ExpiredDay: "", + PullInvite: int32(v.PullInvite), + } + + if task, ok := taskMap[utils.FissionCampaignTaskMarkCondOneVal(v.ID)]; ok { + one.TaskLimit = task.TaskLimit + one.DayLimit = task.DayLimit + one.Chance = task.Chance + one.LevelIds = task.GetLevelLimit() + one.LangMarks = task.GetLangMarks() + one.WeekLimit = task.WeekLimit + one.WeekNum = int32(task.WeekNum) + one.HasPre = int32(task.HasPre) + one.PreCond = task.PreCond + one.ExpiredMin = task.ExpiredMin + one.PropMark = task.PropMark + one.Reward = rewardMap[task.RewardID] + one.AwardMode = int32(task.AwardMode) + one.ExpiredDay = one.GetReward().GetExpiredDay() + } + + custom.Cond = append(custom.Cond, one) + } + + if task, ok := taskMap[mtype.FissionCampaignTaskMarkCondAll]; ok { + custom.BothAll = &pb.ShowRes_BothAll{ + TaskLimit: task.TaskLimit, + Chance: task.Chance, + DayLimit: task.DayLimit, + LevelIds: task.GetLevelLimit(), + LangMarks: task.GetLangMarks(), + WeekLimit: task.WeekLimit, + WeekNum: int32(task.WeekNum), + Reward: nil, + PropMark: task.PropMark, + ExpiredDay: "", + } + + if reward, ok1 := rewardMap[task.RewardID]; ok1 && reward != nil { + custom.BothAll.Reward = reward + custom.BothAll.ExpiredDay = reward.ExpiredDay + } + + } + s.Res.TargetOption.Custom = custom + } + } + + return + } + + // 目标配置 + s.Res.Target = &pb.ShowRes_Target{ + Target: int32(cpn.Target), + Option: int32(conf.Option), + AppEvent: int32(conf.AppEvent), + BothType: int32(conf.BothType), + Cond: make([]*pb.ShowRes_Cond, 0, len(list)), + } + + for _, v := range list { + one := &pb.ShowRes_Cond{ + Id: v.ID, + Event: v.Event, + EventKey: v.EventKey, + EventVal: v.EventVal, + Desc: v.Desc, + IfCond: int32(v.IfCond), + TriggerType: int32(v.TriggetType), + EventType: int32(v.EventType), + } + + if task, ok := taskMap[utils.FissionCampaignTaskMarkCondOneVal(v.ID)]; ok { + one.TaskLimit = task.TaskLimit + one.Chance = task.Chance + } + + s.Res.Target.Cond = append(s.Res.Target.Cond, one) + } + + return + }) + + return +} + +// 设置玩法特有数据 +func (s *Show) setFission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdPrizeWheel: //大转盘 + return s._setPrizeWheel(cpn) + case consts.IdSlotMachine: //老虎机 + return s._setSlotMachine(cpn) + case consts.IdLuckyGrid: //九宫格 + return s._setLuckyGrid(cpn) + case consts.IdBlindBox: //盲盒 + return s._setBlindBox(cpn) + case consts.IdReferral: //老带新 + return s._setReferral(cpn) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo: //趣味问答 + return s._setPrizeAnswer(cpn) + case consts.IdPrizeQuiz: //有奖竞猜 + return s._setPrizeQuiz(cpn) + case consts.IdWinTogether: //老带新 + return s._setWinTogether(cpn) + case consts.IdSignIn: //签到 + return s._setSignIn(cpn) + case consts.IdDice: //大富翁 + return s._setDice(cpn) + case consts.IdGrow: //农场 + return s._setGrow(cpn) + case consts.IdBallot: //抽签 + return s._setBallot(cpn) + case consts.IdChop: //砍一刀 + return s._setChop(cpn) + case consts.IdCash: //现金抽奖 + return s._setCash(cpn) + case consts.IdFlip: //翻牌活动 + return s._setFlip(cpn) + case consts.IdKeep: //激励养成 + return s._setKeep(cpn) + case consts.IdGold: //金币任务 + return s._setGold(cpn) + case consts.IdCoin: //金币池 + return s._setCoin(cpn) + case consts.IdVs: + return s._setVs(cpn) + case consts.IdUno: + return s._setUno(cpn) + case consts.IdGashapon: //扭蛋机 + return s._setGashapon(cpn) + default: + + } + return +} + +// 设置赛事竞猜 +func (s *Show) _setPrizeQuiz(cpn *model.FissionCampaign) (err error) { + + fcq, err := cache.NewCampaignQuiz(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if fcq == nil { + return workerr.NotFound("not found quiz") + } + + optionM := s.GetDao().FissionCampaignQuizOption + options, err := optionM.WithContext(s.Ctx).Where(optionM.CampaignID.Eq(cpn.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.Quiz = &pb.ShowRes_Quiz{ + TargetNum: fcq.TargetNum, + InitChance: fcq.InitChance, + Chance: fcq.Chance, + RewardRule: int32(fcq.RewardRule), + OpenPrize: fcq.OpenPrize, + Title: fcq.Title, + OpenType: int32(fcq.OpenType), + Options: make([]*pb.ShowRes_QuizOption, 0, len(options)), + TOpen: fcq.TOpen, + } + + for _, v := range options { + s.Res.Quiz.Options = append(s.Res.Quiz.Options, &pb.ShowRes_QuizOption{ + Id: v.ID, + Title: v.Title, + ImgUrl: v.ImgURL, + IsRight: int32(v.IsRight), + VoteNum: v.VoteNum, + }) + } + + return + }) + + return +} + +// 大转盘数据 +func (s *Show) _setPrizeWheel(cpn *model.FissionCampaign) error { + cc := cache.NewCampaignWheel(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if conf == nil { + return workerr.NotFound("not found wheel conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.PrizeWheel = &pb.ShowRes_LotteryConfig{ + TargetNum: conf.TargetNum, + InitChance: conf.InitChance, + Chance: conf.Chance, + DayChance: conf.DayChance, + } + return + }) + + return nil +} + +func (s *Show) _setReferral(cpn *model.FissionCampaign) (err error) { + rfl, err := cache.NewCampaignReferral(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if rfl == nil { + return workerr.NotFound("not found") + } + + s.AddAfterRun(func() (err error) { + s.Res.Referral = &pb.ShowRes_InviteConfig{ + RewardLimit: rfl.RewardLimit, + RewardRule: int32(rfl.RewardRule), + InviteLimit: rfl.InviteLimit, + StepLoop: int32(rfl.StepLoop), + } + + return + }) + + return +} + +func (s *Show) _setSlotMachine(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignSlot(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found blind conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Slot = &pb.ShowRes_LotteryConfig{ + TargetNum: conf.TargetNum, + InitChance: conf.InitChance, + Chance: conf.Chance, + DayChance: conf.DayChance, + } + + return + }) + + return +} + +func (s *Show) _setLuckyGrid(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignGrid(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found grid conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Grid = &pb.ShowRes_LotteryConfig{ + TargetNum: conf.TargetNum, + InitChance: conf.InitChance, + Chance: conf.Chance, + DayChance: conf.DayChance, + } + + return + }) + + return +} + +func (s *Show) _setBlindBox(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignBlind(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found blind conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Blind = &pb.ShowRes_LotteryConfig{ + TargetNum: conf.TargetNum, + InitChance: conf.InitChance, + Chance: conf.Chance, + DayChance: conf.DayChance, + } + + return + }) + + return +} + +func (s *Show) _setPrizeAnswer(cpn *model.FissionCampaign) (err error) { + qa, err := cache.NewCampaignQa(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if qa == nil { + return workerr.NotFound("not found qa") + } + + var ( + questions []*model.FissionCampaignQaQuestion + options []*model.FissionCampaignQaOption + qoMap = make(map[int64][]*model.FissionCampaignQaOption) + groupHashId, guideGroupHashId string + ) + + if cpn.FissionID == consts.IdPrizeAnswer { + cqqM := s.GetDao().FissionCampaignQaQuestion + questions, err = cqqM.WithContext(s.Ctx).Where(cqqM.QaID.Eq(qa.ID), cqqM.IsDel.Eq(mtype.No)).Order(cqqM.Sort).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var qids []int64 + for _, v := range questions { + qids = append(qids, v.ID) + } + + cqoM := s.GetDao().FissionCampaignQaOption + options, err = cqoM.WithContext(s.Ctx).Where(cqoM.QuestionID.In(qids...), cqoM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range options { + qoMap[v.QuestionID] = append(qoMap[v.QuestionID], v) + } + } + + if qa.QaGroupID > 0 { + var group *model.LibraryQaGroup + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.ID.Eq(qa.QaGroupID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group != nil { + groupHashId = group.HashID + } + } + + if qa.GuideGroupID > 0 { + var group *model.LibraryQaGroup + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.ID.Eq(qa.GuideGroupID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group != nil { + guideGroupHashId = group.HashID + } + } + + s.AddAfterRun(func() (err error) { + + s.Res.QuestionAnswer = &pb.ShowRes_QuestionAnswer{ + TargetNum: qa.TargetNum, + Chance: qa.Chance, + InitChance: qa.InitChance, + QuestionAskTime: qa.QuestionAskTime, + Questions: make([]*pb.ShowRes_QaQuestion, 0, len(questions)), + GroupHashId: groupHashId, + QaNum: qa.QaNum, + DayChance: qa.DayChance, + OpenGuide: int32(qa.OpenGuide), + GuideGroupHashId: guideGroupHashId, + } + + for _, v := range questions { + one := &pb.ShowRes_QaQuestion{ + Id: v.ID, + Title: v.Title, + Score: v.Score, + Options: nil, + } + + if ops, ok := qoMap[v.ID]; ok { + one.Options = make([]*pb.ShowRes_QaOption, 0, len(ops)) + for _, op := range ops { + one.Options = append(one.Options, &pb.ShowRes_QaOption{ + Id: op.ID, + Title: op.Title, + IsRight: int32(op.IsRight), + }) + } + } + + s.Res.QuestionAnswer.Questions = append(s.Res.QuestionAnswer.Questions, one) + } + + return + }) + + return +} + +func (s *Show) _setWinTogether(cpn *model.FissionCampaign) (err error) { + + fcw, err := cache.NewCampaignWin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if fcw == nil { + return workerr.NotFound("not found fcw") + } + + s.AddAfterRun(func() (err error) { + s.Res.Win = &pb.ShowRes_InviteConfig{ + RewardLimit: fcw.RewardLimit, + RewardRule: int32(fcw.RewardRule), + InviteLimit: fcw.InviteLimit, + NewcomerCond: int32(fcw.NewcomerCond), + StepLoop: int32(fcw.StepLoop), + } + + return + }) + + return +} + +func (s *Show) _setSignIn(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignSign(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found") + } + + s.AddAfterRun(func() (err error) { + s.Res.Sign = &pb.ShowRes_Sign{ + SignType: int32(conf.SignType), + IsContinue: int32(conf.IsContinue), + HasCard: int32(conf.HasCard), + InviteNum: conf.InviteNum, + LimitCardNum: 0, + IsLoop: int32(conf.IsLoop), + SignCycle: conf.SignCycle, + RecycleType: int32(conf.RecycleType), + Color: conf.Color, + } + + return + }) + + return +} + +func (s *Show) _setDice(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignDice + fcd, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if fcd == nil { + return workerr.NotFound("not found") + } + + s.AddAfterRun(func() (err error) { + s.Res.Dice = &pb.ShowRes_Dice{ + InitChance: fcd.InitChance, + DayChance: fcd.DayChance, + FixDice: int32(fcd.FixDice), + FixDiceTarget: fcd.FixDiceTarget, + FixDiceLimit: fcd.FixDiceLimit, + CustomDice: fcd.CustomDice, + OpenMapPoint: int32(fcd.OpenMapPoint), + MapPoint: &pb.ShowRes_MapPoint{ + Blank: fcd.GetMapPoint().Blank, + Again: fcd.GetMapPoint().Again, + Normal: fcd.GetMapPoint().Normal, + Supper: fcd.GetMapPoint().Supper, + }, + AwardType: int32(fcd.AwardType), + OpenInvite: int32(fcd.OpenInvite), + RollAgain: int32(fcd.RollAgain), + FixDiceCond: int32(fcd.FixDiceCond), + Odds: fcd.Odds, + PlayImg: fcd.PlayImg, + CloudImg: fcd.CloudImg, + } + + return + }) + + return +} + +func (s *Show) _setGrow(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignGrow + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if conf == nil { + return workerr.NotFound("not found") + } + + stepM := s.GetDao().FissionCampaignGrowStep + + steps, err := stepM.WithContext(s.Ctx).Where(stepM.CampaignID.Eq(cpn.ID), stepM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Grow = &pb.ShowRes_Grow{ + AutoHour: conf.AutoHour, + AutoNum: conf.AutoNum, + GrowNum: conf.GrowNum, + TargetNum: conf.TargetNum, + Revive: int32(conf.Revive), + ReviveNum: conf.ReviveNum, + DieHour: conf.DieHour, + Steps: make([]*pb.ShowRes_GrowStep, 0, len(steps)), + InitNum: conf.InitNum, + } + + for _, step := range steps { + s.Res.Grow.Steps = append(s.Res.Grow.Steps, &pb.ShowRes_GrowStep{ + Id: step.ID, + Num: step.Num, + }) + } + + return + }) + + return +} + +func (s *Show) _setBallot(cpn *model.FissionCampaign) (err error) { + + conf, err := cache.NewCampaignBallot(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + if conf == nil { + return workerr.NotFound("not found") + } + + s.AddAfterRun(func() (err error) { + s.Res.Ballot = &pb.ShowRes_Ballot{ + InitChance: conf.InitChance, + DayChance: conf.DayChance, + } + + return + }) + + return +} + +func (s *Show) _setChop(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignChop(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if conf == nil { + return workerr.NotFound("not found chop conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Chop = &pb.ShowRes_Chop{ + ShowBar: int32(conf.ShowBar), + } + + return + }) + + return +} + +// 设置延迟深度链接数据 +func (s *Show) setDelayLinkData(cpn *model.FissionCampaign) (err error) { + res, err := app.NewDeepLinkLink().GetCampaignDataList(s.Ctx, &dlinkpb.GetCampaignDataListReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + }) + if err != nil { + return + } + + s.Res.DelayLinkData = make([]*pb.ShowRes_KV, 0, len(res.GetList())) + for _, v := range res.GetList() { + s.Res.DelayLinkData = append(s.Res.DelayLinkData, &pb.ShowRes_KV{ + Key: v.GetKey(), + Value: v.GetVal(), + }) + } + + return +} + +// 设置奖品数据 +func (s *Show) setReward(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + err = s._helpMap(cpn) + if err != nil { + return + } + err = s._ruleMap(cpn) + if err != nil { + return + } + + tempM := s.GetDao().FissionTemp + temp, err := tempM.WithContext(s.Ctx).Where(tempM.ID.Eq(cpn.TemplateID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if temp == nil { + err = workerr.NotFound("temp not found") + return + } + + tempMark := mtype.FissionLangTypeToMark[temp.LangType] + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(conf.CampaignID), + m.IsDel.Eq(mtype.No), + ).Order(m.Step, m.Sort, m.ID).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + if len(list) == 0 { + return + } + + err = s._rewardAddMap(cpn.ID, cpn.TOffset) + if err != nil { + return + } + + err = s._rewardTaskMap(cpn.ID) + if err != nil { + return + } + + var rewardIds []int64 + var rewardInfoMap = make(map[int64]*provider.RewardInfo) + var webList, extraList, newcomerList, appList []*model.FissionCampaignReward + for _, v := range list { + if _, ok := rewardInfoMap[v.RewardID]; !ok { + rewardInfoMap[v.RewardID] = nil + rewardIds = append(rewardIds, v.RewardID) + } + + switch v.RewardType { + case mtype.FissionCampaignRewardTypeApp: + appList = append(appList, v) + case mtype.FissionCampaignRewardTypeWeb: + webList = append(webList, v) + case mtype.FissionCampaignRewardTypeExtra: + extraList = append(extraList, v) + case mtype.FissionCampaignRewardTypeNewcomer: + newcomerList = append(newcomerList, v) + } + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, rewardIds...) + if err != nil { + return + } + + rewardInfoMap, err = preward.InfoMap() + if err != nil { + return + } + + langMark := mtype.FissionLangTypeToMark[cpn.GetLangTypes()[0]] + + s._appendReward(preward, webList, &s.Res.RewardsWeb, langMark) + s._appendReward(preward, extraList, &s.Res.RewardsExtra, langMark) + s._appendReward(preward, newcomerList, &s.Res.RewardsNewcomer, langMark) + + s.Res.Rewards = &pb.ShowRes_Rewards{ + RewardGroup: int32(conf.RewardGroup), + Normal: nil, + UserLevel: nil, + Langs: nil, + LangUserLevel: nil, + } + + ful := finder.NewFuserLayer(conf) + + switch conf.RewardGroup { + case mtype.FissionRewardGroupNormal: + s._appendReward(preward, appList, &s.Res.Rewards.Normal, langMark) + case mtype.FissionRewardGroupUserLevel: + var levelMap = make(map[int64]string) + levelMap, err = s._getLevelMap(cpn.ProjectID) + if err != nil { + return + } + + dlId := ful.Level().Default + s.Res.Rewards.UserLevel = &pb.ShowRes_UserLevel{ + DefaultLevelId: dlId, + DefaultLevelTitle: levelMap[dlId], + LevelList: nil, + } + + var levelIds []int64 + var levelRewardMap = make(map[int64][]*model.FissionCampaignReward) + for _, v := range appList { + if _, ok := levelRewardMap[v.LevelID]; !ok { + levelIds = append(levelIds, v.LevelID) + } + + levelRewardMap[v.LevelID] = append(levelRewardMap[v.LevelID], v) + } + + s._appendUserLevel(preward, levelIds, levelRewardMap, &s.Res.Rewards.UserLevel.LevelList, langMark) + case mtype.FissionRewardGroupLang: + var langMarks []string + var langRewardMap = make(map[string][]*model.FissionCampaignReward) + for _, v := range appList { + if _, ok := langRewardMap[v.LangMark]; !ok { + langMarks = append(langMarks, v.LangMark) + } + langRewardMap[v.LangMark] = append(langRewardMap[v.LangMark], v) + } + + s.Res.Rewards.Langs = make([]*pb.ShowRes_Lang, 0, len(langMarks)) + for _, mark := range langMarks { + one := &pb.ShowRes_Lang{ + LangType: int32(mtype.MarkToLangType[mark]), + LangMark: mark, + DefaultLang: mark == tempMark, + Rewards: nil, + } + + s._appendReward(preward, langRewardMap[mark], &one.Rewards, mark) + s.Res.Rewards.Langs = append(s.Res.Rewards.Langs, one) + } + case mtype.FissionRewardGroupLangAndUserLevel: + dms := ful.LangLevel().Default + var dmMap = make(map[string]int64) + for _, dm := range dms { + dmMap[dm.Lang] = dm.Level + } + + var langMarks []string + var langLevelMap = make(map[string][]int64) + + var levelRewardMap = make(map[string]map[int64][]*model.FissionCampaignReward) + for _, v := range appList { + if _, ok := langLevelMap[v.LangMark]; !ok { + langMarks = append(langMarks, v.LangMark) + levelRewardMap[v.LangMark] = make(map[int64][]*model.FissionCampaignReward) + } + + if _, ok := levelRewardMap[v.LangMark][v.LevelID]; !ok { + langLevelMap[v.LangMark] = append(langLevelMap[v.LangMark], v.LevelID) + } + + levelRewardMap[v.LangMark][v.LevelID] = append(levelRewardMap[v.LangMark][v.LevelID], v) + } + + s.Res.Rewards.LangUserLevel = make([]*pb.ShowRes_LangUserLevel, 0, len(langMarks)) + + var levelMap = make(map[int64]string) + levelMap, err = s._getLevelMap(cpn.ProjectID) + if err != nil { + return + } + + for _, mark := range langMarks { + var levelIds = langLevelMap[mark] + + one := &pb.ShowRes_LangUserLevel{ + LangMark: mark, + LangType: int32(mtype.MarkToLangType[mark]), + DefaultLang: mark == tempMark, + DefaultLevelId: dmMap[mark], + DefaultLevelTitle: levelMap[dmMap[mark]], + LevelList: make([]*pb.ShowRes_UserLevelOne, 0, len(levelIds)), + } + + s._appendUserLevel(preward, levelIds, levelRewardMap[mark], &one.LevelList, mark) + s.Res.Rewards.LangUserLevel = append(s.Res.Rewards.LangUserLevel, one) + } + case mtype.FissionRewardGroupCountry: + s.Res.Rewards.Country = &pb.ShowRes_Country{ + DefaultCountryMark: ful.Country().Default, + CountryList: nil, + } + + var countryIds []string + var countryRewardMap = make(map[string][]*model.FissionCampaignReward) + for _, v := range appList { + if _, ok := countryRewardMap[v.CountryMark]; !ok { + countryIds = append(countryIds, v.CountryMark) + } + + countryRewardMap[v.CountryMark] = append(countryRewardMap[v.CountryMark], v) + } + + s._appendCountry(preward, countryIds, countryRewardMap, &s.Res.Rewards.Country.CountryList, langMark) + } + return +} + +func (s *Show) _appendReward(preward *provider.Rewards, in []*model.FissionCampaignReward, out *[]*pb.ShowRes_Reward, langMark string) { + *out = make([]*pb.ShowRes_Reward, 0, len(in)) + + for _, v := range in { + one := &pb.ShowRes_Reward{ + Id: v.ID, + RewardId: v.RewardID, + Stock: v.Stock, + InviteNum: v.InviteNum, + RewardNum: v.RewardNum, + IsThank: int32(v.IsThank), + Score: v.Score, + SignDay: v.SignDay, + CollectNum: v.CollectNum, + IsSuper: int32(v.IsSuper), + KvData: nil, + Title: "", + ImgUrl: "", + ReceiveType: 0, + Contact: "", + Url: "", + Help: 0, + HelpPercent: 0, + Click: 0, + ClickPercent: 0, + ClickPercentLimit: 0, + Open: 0, + OpenPercent: 0, + OpenPercentLimit: 0, + LangMark: "", + Odds: v.Odds, + JumpUrl: v.JumpURL, + FormTitle: "", + CampaignLimit: 0, + Register: 0, + RegisterPercent: 0, + InitPercent: v.InitPercent, + CollectRule: nil, + OpenAdd: nil, + RewardTask: nil, + } + + if add, ok := s.rewardAddMap[v.ID]; ok { + one.OpenAdd = add + one.OpenAdd.Open = int32(v.OpenAdd) + } + + if task, ok := s.rewardTaskMap[v.ID]; ok { + one.RewardTask = task + one.RewardTask.Open = int32(v.OpenTask) + } + + if v.CollectRule != "" { + collectRule := v.GetCollectRule() + one.CollectRule = &pb.ShowRes_CollectRule{ + Open: collectRule.Open, + InitCollect: collectRule.InitCollect, + SignDay: collectRule.SignDay, + AddCollect: collectRule.AddCollect, + ResetType: collectRule.ResetType, + } + } + + info, _ := preward.Info(v.RewardID) + if info != nil { + one.ReceiveType = info.ReceiveType + one.Contact = info.Contact + one.Url = info.Url + one.FormTitle = info.FormTitle + + for _, kv := range info.KvData { + one.KvData = append(one.KvData, &pb.ShowRes_KV{ + Key: kv.Key, + Value: kv.Value, + }) + } + } + + lang := preward.AutoLang(v.RewardID, langMark) + one.Title, one.ImgUrl, one.LangMark = lang.Title, lang.ImgUrl, lang.Mark + + for _, help := range s.helpMap[v.ID] { + switch help.TaskType { + case mtype.FissionCampaignTaskTypeInstall: + one.Help = mtype.Yes + one.HelpPercent = help.Percent + case mtype.FissionCampaignTaskTypeOpen: + one.Open = mtype.Yes + one.OpenPercent = help.Percent + one.OpenPercentLimit = help.PercentLimit + case mtype.FissionCampaignTaskTypeClick: + one.Click = mtype.Yes + one.ClickPercent = help.Percent + one.ClickPercentLimit = help.PercentLimit + case mtype.FissionCampaignTaskTypeRegister: + one.Register = mtype.Yes + one.RegisterPercent = help.Percent + } + } + + if rule, ok := s.ruleMap[v.ID]; ok { + one.CampaignLimit = rule.CampaignLimit + } + + *out = append(*out, one) + } +} + +func (s *Show) _rewardAddMap(campaignID int64, tOffset int32) (err error) { + m := s.GetDao().FissionCampaignRewardAdd + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(campaignID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.rewardAddMap = make(map[int64]*pb.ShowRes_OpenAdd, len(list)) + for _, v := range list { + s.rewardAddMap[v.RewardID] = &pb.ShowRes_OpenAdd{ + Start: timez.STZ(v.Start, tOffset), + End: timez.STZ(v.End, tOffset), + DayNum: v.DayNum, + DayAdd: v.DayAdd, + } + } + + return +} + +func (s *Show) _rewardTaskMap(campaignID int64) (err error) { + m := s.GetDao().FissionCampaignCond + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(campaignID), m.IsDel.Eq(mtype.No), m.RewardID.Gt(0)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.rewardTaskMap = make(map[int64]*pb.ShowRes_RewardTask, len(list)) + for _, v := range list { + s.rewardTaskMap[v.RewardID] = &pb.ShowRes_RewardTask{ + Event: v.Event, + EventKey: v.EventKey, + EventVal: v.EventVal, + IfCond: int32(v.IfCond), + TriggerType: int32(v.TriggetType), + EventType: int32(v.EventType), + OpenPush: int32(v.OpenPush), + } + } + + return +} + +func (s *Show) _appendUserLevel(preward *provider.Rewards, levelIds []int64, levelRewardMap map[int64][]*model.FissionCampaignReward, out *[]*pb.ShowRes_UserLevelOne, langMark string) { + *out = make([]*pb.ShowRes_UserLevelOne, 0, len(levelIds)) + + levelMap, _ := s._getLevelMap(preward.GetProjectId()) + + for _, id := range levelIds { + one := &pb.ShowRes_UserLevelOne{ + LevelId: id, + LevelTitle: levelMap[id], + Rewards: nil, + } + + s._appendReward(preward, levelRewardMap[id], &one.Rewards, langMark) + *out = append(*out, one) + } +} + +func (s *Show) _appendCountry(preward *provider.Rewards, countryMarks []string, countryRewardMap map[string][]*model.FissionCampaignReward, out *[]*pb.ShowRes_CountryOne, langMark string) { + *out = make([]*pb.ShowRes_CountryOne, 0, len(countryMarks)) + for _, id := range countryMarks { + one := &pb.ShowRes_CountryOne{ + CountryMark: id, + Rewards: nil, + } + + s._appendReward(preward, countryRewardMap[id], &one.Rewards, langMark) + *out = append(*out, one) + } +} + +func (s *Show) _getLevelMap(projectId int64) (data map[int64]string, err error) { + + if s.levelMap != nil { + return s.levelMap, nil + } + + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.Ctx).Where(m.ProjectID.Eq(projectId), m.DeletedAt.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + data = make(map[int64]string, len(list)) + for _, v := range list { + data[v.ID] = v.Title + } + + s.levelMap = data + + return +} + +func (s *Show) _helpMap(cpn *model.FissionCampaign) (err error) { + var helpMap = make(map[int64][]*model.FissionCampaignTask) + + defer func() { + s.helpMap = helpMap + }() + + if cpn.FissionID != consts.IdChop { + return + } + + helpM := s.GetDao().FissionCampaignTask + helps, err := helpM.WithContext(s.Ctx).Where(helpM.CampaignID.Eq(cpn.ID), helpM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range helps { + rewardId := utils.FissionCampaignTaskMarkRewardOneRewardId(v.TaskMark) + if rewardId <= 0 { + continue + } + + helpMap[rewardId] = append(helpMap[rewardId], v) + } + + return +} + +func (s *Show) _ruleMap(cpn *model.FissionCampaign) (err error) { + ruleM := s.GetDao().FissionCampaignRewardRule + rules, err := ruleM.WithContext(s.Ctx).Where(ruleM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var ruleMap = make(map[int64]*model.FissionCampaignRewardRule, len(rules)) + for _, v := range rules { + ruleMap[v.RewardID] = v + } + + s.ruleMap = ruleMap + + return +} + +func (s *Show) _setCash(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignCash(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found") + } + + s.AddAfterRun(func() (err error) { + s.Res.Cash = &pb.ShowRes_Cash{ + ExpiredDay: conf.ExpiredDay, + Price: conf.Price, + PriceNum: conf.PriceNum, + SpinCash: make([]*pb.ShowRes_SpinCash, 0, len(consts.FissionCashSpin)), + Lack: int32(conf.Lack), + Currency: int32(conf.Currency), + LoopNum: conf.LoopNum, + } + + for _, v := range consts.FissionCashSpin { + s.Res.Cash.SpinCash = append(s.Res.Cash.SpinCash, &pb.ShowRes_SpinCash{ + Id: v.Id, + Cash: v.Cash, + }) + } + + return + }) + + return +} + +func (s *Show) _setFlip(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignFlip(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found flip conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Flip = &pb.ShowRes_Flip{ + InitChance: conf.InitChance, + CardImg: conf.CardImg, + DayChance: conf.DayChance, + } + + return + }) + + return +} + +func (s *Show) _setKeep(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignKeep(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found conf") + } + + m := s.GetDao().FissionCampaignKeepStep + steps, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range steps { + if v.RewardID > 0 { + rewardIds = append(rewardIds, v.RewardID) + } + } + + var rewardMap = make(map[int64]*pb.ShowRes_Reward) + if len(rewardIds) > 0 { + rewardM := s.GetDao().FissionCampaignReward + var rewardList []*model.FissionCampaignReward + rewardList, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bIds []int64 + for _, v := range rewardList { + bIds = append(bIds, v.RewardID) + } + + brewards, _ := provider.NewRewards(s.Ctx, cpn.ProjectID, bIds...) + for _, v := range rewardList { + info, _ := brewards.InfoAutoLang(v.RewardID) + rewardMap[v.ID] = &pb.ShowRes_Reward{ + Id: v.ID, + RewardId: v.RewardID, + Stock: v.Stock, + RewardNum: v.RewardNum, + Title: info.RewardTitle, + ImgUrl: info.ImgUrl, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Url: info.Url, + FormTitle: info.FormTitle, + LangMark: info.Mark, + } + + for _, datum := range info.KvData { + rewardMap[v.ID].KvData = append(rewardMap[v.ID].KvData, &pb.ShowRes_KV{ + Key: datum.Key, + Value: datum.Value, + }) + } + + } + + } + + s.AddAfterRun(func() (err error) { + s.Res.KeepDog = &pb.ShowRes_Keep{ + Collect: conf.Collect, + CollectSecond: conf.CollectSecond, + OpenInvite: int32(conf.OpenInvite), + Invite: nil, + InitGet: conf.InitGet, + SecGet: conf.SecGet, + FeedNum: conf.FeedNum, + FeedCycle: conf.FeedCycle, + MaxFeed: conf.MaxFeed, + FeedGet: conf.FeedGet, + FeedGetNum: conf.FeedGetNum, + TalkText: nil, + Steps: make([]*pb.ShowRes_KeepStep, 0, len(steps)), + SecGetDayLimit: conf.SecGetDayLimit, + MachineType: int32(conf.MachineType), + OfflineMin: conf.OfflineMin, + OfflineGet: conf.OfflineGet, + OfflineLimit: conf.OfflineLimit, + } + + _ = jsonm.StrUnmarshal(conf.Invite, &s.Res.KeepDog.Invite) + _ = jsonm.StrUnmarshal(conf.TalkText, &s.Res.KeepDog.TalkText) + + for _, v := range steps { + s.Res.KeepDog.Steps = append(s.Res.KeepDog.Steps, &pb.ShowRes_KeepStep{ + Step: v.Step, + Percent: v.Percent, + RewardType: int32(v.RewardType), + Reward: rewardMap[v.RewardID], + RewardNum: v.RewardNum, + }) + } + + return + }) + + return +} + +func (s *Show) setPush(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignPush + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Push = &pb.ShowRes_Push{} + + for _, v := range list { + if v.Open == mtype.No { + continue + } + switch v.Mark { + case mtype.FissionCampaignPushMarkActive: + s.Res.Push.Active = &pb.ShowRes_PushOne{ + Open: mtype.Yes, + PushCond: nil, + } + + _ = jsonm.StrUnmarshal(v.Cond, &s.Res.Push.Active.PushCond) + case mtype.FissionCampaignPushMarkTaskReset: + s.Res.Push.TaskReset = &pb.ShowRes_PushOne{ + Open: mtype.Yes, + PushCond: nil, + } + + _ = jsonm.StrUnmarshal(v.Cond, &s.Res.Push.TaskReset.PushCond) + + case mtype.FissionCampaignPushMarkOffline: + s.Res.Push.Offline = &pb.ShowRes_PushOne{ + Open: mtype.Yes, + PushCond: nil, + } + + _ = jsonm.StrUnmarshal(v.Cond, &s.Res.Push.Offline.PushCond) + case mtype.FissionCampaignPushMarkVisit: + s.Res.Push.Visit = &pb.ShowRes_PushOne{ + Open: mtype.Yes, + } + } + + } + + return +} + +func (s *Show) setChild(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignChild + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ChildID) + } + + cpnM := s.GetDao().FissionCampaign + childs, err := cpnM.WithContext(s.Ctx).Where(cpnM.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Child = make([]*pb.ShowRes_Child, 0, len(childs)) + + for _, v := range childs { + s.Res.Child = append(s.Res.Child, &pb.ShowRes_Child{ + HashId: v.HashID, + ChildType: int32(v.ChildType), + }) + } + + return +} + +func (s *Show) _setGold(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignGold(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found gold conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Gold = &pb.ShowRes_Gold{ + GoldNum: conf.GoldNum, + ExpiredDay: conf.ExpiredDay, + Price: conf.Price, + PriceNum: conf.PriceNum, + Currency: int32(conf.Currency), + SpinCash: make([]*pb.ShowRes_SpinCash, 0, len(consts.FissionCashSpin)), + Lack: int32(conf.Lack), + } + + for _, v := range consts.FissionCashSpin { + s.Res.Gold.SpinCash = append(s.Res.Gold.SpinCash, &pb.ShowRes_SpinCash{ + Id: v.Id, + Cash: v.Cash, + }) + } + + return + }) + + return +} + +func (s *Show) _setCoin(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignCoin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found gold conf") + } + + var customBtnId int64 + if verify.InArray[int32](mtype.FissionCampaignCoinLackBtnCustom, conf.GetLackBtn()...) { + var customBtn *model.FissionCustomBtn + customBtn, err = cache.NewFissionCustomBtn(s.Ctx).FindByUniq(cpn.ID, conf.CustomBtnText) + if err != nil { + return s.BE().CacheError(err) + } + + if customBtn != nil { + customBtnId = customBtn.ID + } + } + + s.AddAfterRun(func() (err error) { + s.Res.Coin = &pb.ShowRes_Coin{ + CoinImg: conf.CoinImg, + OpenDays: conf.OpenDays, + OpenLimit: conf.OpenLimit, + InitCoin: conf.InitCoin, + InitUse: conf.InitUse, + UseCoin: conf.UseCoin, + UseLimit: conf.UseLimit, + UrlId: conf.URLID, + LackBtn: conf.GetLackBtn(), + CustomBtnText: conf.CustomBtnText, + CustomWebUrl: conf.CustomWebURL, + CustomExtraParam: conf.CustomExtraParam, + CustomBtnId: customBtnId, + CustomPcParam: conf.CustomPcParam, + } + + return + }) + + return +} + +func (s *Show) _setVs(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignVs(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found vs conf") + } + + m := s.GetDao().FissionCampaignVsSchedule + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range list { + rewardIds = append(rewardIds, v.RewardID) + } + + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewards)) + for _, v := range rewards { + rewardMap[v.ID] = v + } + + teamM := s.GetDao().FissionCampaignVsTeam + teams, err := teamM.WithContext(s.Ctx).Where(teamM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamMap = make(map[int64]*model.FissionCampaignVsTeam, len(teams)) + for _, v := range teams { + teamMap[v.ID] = v + } + + var scheduleMap = make(map[int32][]*pb.ShowRes_PkTeam) + for _, v := range list { + one := &pb.ShowRes_PkTeam{ + Id: v.ID, + Teams: nil, + VoteStart: v.VoteStart, + VoteEnd: v.VoteEnd, + VsAt: v.VsAt, + VsImg: v.VsImg, + Desc: v.Desc, + PropMark: "", + RewardId: 0, + PropNum: 0, + ExpiredDay: "", + IsSettlement: int32(v.IsSettlement), + OtherVote: v.GetOtherVote(), + OpenOdds: int32(v.OpenOdds), + OddsLeft: v.OddsLeft, + OddsRight: v.OddsRight, + OddsDraw: v.OddsDraw, + Status: v.GetStatus(), + } + + for _, id := range v.GetVsTeamIds() { + if team, ok := teamMap[id]; ok { + one.Teams = append(one.Teams, &pb.ShowRes_Team{ + Id: team.ID, + Name: team.Name, + LogoImg: team.LogoImg, + }) + } else { + one.Teams = append(one.Teams, &pb.ShowRes_Team{ + Id: -1, + }) + } + } + + if reward, ok := rewardMap[v.RewardID]; ok { + one.PropMark = reward.PropMark + one.RewardId = reward.RewardID + one.PropNum = reward.RewardNum + one.ExpiredDay = reward.ExpiredDay + } + + scheduleMap[v.VsIdx] = append(scheduleMap[v.VsIdx], one) + } + + var schedules = make([]*pb.ShowRes_Schedule, len(scheduleMap)) + for k, v := range scheduleMap { + schedules[k] = &pb.ShowRes_Schedule{ + Id: k, + PkTeams: v, + } + } + + s.AddAfterRun(func() (err error) { + s.Res.Vs = &pb.ShowRes_Vs{ + InitChance: conf.InitChance, + EachLimitNum: conf.EachLimitNum, + OpenPoint: int32(conf.OpenPoint), + PointsNum: conf.PointsNum, + MallOpen: int32(conf.MallOpen), + MallId: conf.MallID, + VsTz: conf.VsTz, + ClaimType: int32(conf.ClaimType), + Schedules: schedules, + IconMall: conf.IconMall, + IconReward: conf.IconReward, + IconSchedule: conf.IconSchedule, + } + return + }) + + return +} + +func (s *Show) _setUno(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignUno(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found uno conf") + } + + m := s.GetDao().FissionCampaignUnoGroup + groups, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, group := range groups { + rewardIds = append(rewardIds, group.RewardID) + } + + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bids []int64 + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewards)) + for _, v := range rewards { + rewardMap[v.ID] = v + bids = append(bids, v.RewardID) + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, bids...) + if err != nil { + return + } + + langMark := mtype.FissionLangTypeToMark[cpn.GetLangTypes()[0]] + + cardM := s.GetDao().FissionCampaignUnoCard + cards, err := cardM.WithContext(s.Ctx).Where(cardM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cardMap = make(map[string][]*model.FissionCampaignUnoCard) + for _, v := range cards { + cardMap[v.Mark] = append(cardMap[v.Mark], v) + } + + s.AddAfterRun(func() (err error) { + s.Res.Uno = &pb.ShowRes_Uno{ + InitChance: conf.InitChance, + PropMarks: conf.GetPropMarks(), + Red: nil, + Yellow: nil, + Blue: nil, + Green: nil, + } + + for _, v := range groups { + lr := v.GetLimitRule() + g := &pb.ShowRes_UnoGroup{ + Id: v.ID, + Odds: v.Odds, + Reward: nil, + OpenRule: int32(v.OpenRule), + LimitRule: &pb.ShowRes_UnoLimitRule{ + InitNum: lr.InitNum, + SignDay: lr.SignDay, + AddNum: lr.AddNum, + ResetType: lr.ResetType, + }, + CustomCard: int32(v.CustomCard), + Cards: make([]*pb.ShowRes_UnoCard, 0, len(cardMap[v.Mark])), + } + + for _, cd := range cardMap[v.Mark] { + g.Cards = append(g.Cards, &pb.ShowRes_UnoCard{ + Id: cd.ID, + Title: cd.Title, + ImgUrl: cd.ImgURL, + WebUrl: cd.WebURL, + AppParam: cd.AppParam, + PcParam: cd.PcParam, + CardNo: cd.CardNo, + }) + } + + if r, ok := rewardMap[v.RewardID]; ok { + info, _ := preward.InfoAutoLang(r.RewardID, langMark) + g.Reward = &pb.ShowRes_Reward{ + Id: r.ID, + RewardId: r.RewardID, + Stock: r.Stock, + RewardNum: r.RewardNum, + KvData: make([]*pb.ShowRes_KV, 0, len(info.KvData)), + Title: info.Title, + ImgUrl: info.ImgUrl, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Url: info.Url, + FormTitle: info.FormTitle, + } + for _, datum := range info.KvData { + g.Reward.KvData = append(g.Reward.KvData, &pb.ShowRes_KV{ + Key: datum.Key, + Value: datum.Value, + }) + } + } + + switch v.Mark { + case mtype.FissionCampaignUnoGroupRed: + s.Res.Uno.Red = g + case mtype.FissionCampaignUnoGroupYellow: + s.Res.Uno.Yellow = g + case mtype.FissionCampaignUnoGroupBlue: + s.Res.Uno.Blue = g + case mtype.FissionCampaignUnoGroupGreen: + s.Res.Uno.Green = g + } + } + + return + }) + + return +} + +func (s *Show) setEvent(cpn *model.FissionCampaign) (err error) { + + m := s.GetDao().FissionCampaignEvent + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range list { + for _, reward := range v.GetRewards() { + if reward.RewardId > 0 { + rewardIds = append(rewardIds, reward.RewardId) + } + } + } + + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewards)) + var brids []int64 + for _, v := range rewards { + brids = append(brids, v.RewardID) + rewardMap[v.ID] = v + } + + var preward *provider.Rewards + if len(brids) > 0 { + preward, err = provider.NewRewards(s.Ctx, cpn.ProjectID, brids...) + if err != nil { + return + } + } + + s.Res.Event = &pb.ShowRes_Event{} + + var fn = func(rewards []*mtype.EventReward) []*pb.ShowRes_EventReward { + + r := make([]*pb.ShowRes_EventReward, 0, len(rewards)) + for _, v := range rewards { + var reward *pb.ShowRes_Reward + + switch v.PropMark { + case mtype.FissionCampaignRewardPropMarkReward: + cr := rewardMap[v.RewardId] + info, _ := preward.InfoAutoLang(cr.RewardID, cpn.GetLangMarks()[0]) + reward = &pb.ShowRes_Reward{ + Id: cr.ID, + RewardId: cr.RewardID, + Stock: cr.Stock, + RewardNum: cr.RewardNum, + KvData: make([]*pb.ShowRes_KV, 0, len(info.KvData)), + Title: info.Title, + ImgUrl: info.ImgUrl, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Url: info.Url, + FormTitle: info.FormTitle, + } + + for _, v := range info.KvData { + reward.KvData = append(reward.KvData, &pb.ShowRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + + case mtype.FissionCampaignRewardPropMarkPoint: + cr := rewardMap[v.RewardId] + reward = &pb.ShowRes_Reward{ + Id: cr.ID, + RewardId: cr.RewardID, + Stock: cr.Stock, + RewardNum: cr.RewardNum, + ExpiredDay: cr.ExpiredDay, + } + case mtype.FissionCampaignRewardPropMarkChance: + + } + + r = append(r, &pb.ShowRes_EventReward{ + Id: reward.GetId(), + PropMark: v.PropMark, + Reward: reward, + Chance: v.Chance, + ExpiredDay: reward.GetExpiredDay(), + }) + } + + return r + } + + for _, v := range list { + one := &pb.ShowRes_EventOne{ + Open: int32(v.Open), + Rewards: fn(v.GetRewards()), + } + switch v.Mark { + case mtype.FissionCampaignEventMarkFirstVisit: + s.Res.Event.FirstVisit = one + } + } + + return +} + +func (s *Show) _setGashapon(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignGashapon(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found blind conf") + } + + s.AddAfterRun(func() (err error) { + s.Res.Gashapon = &pb.ShowRes_LotteryConfig{ + InitChance: conf.InitChance, + DayChance: conf.DayChance, + } + + return + }) + + return + +} diff --git a/internal/service/containers/campaign/show_reward.go b/internal/service/containers/campaign/show_reward.go new file mode 100644 index 0000000..4d76ea4 --- /dev/null +++ b/internal/service/containers/campaign/show_reward.go @@ -0,0 +1,223 @@ +package campaign + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" +) + +type ShowReward struct { + logic.Logic + Req *pb.ShowRewardReq + Res *pb.ShowRewardRes + helpMap map[int64][]*model.FissionCampaignTask +} + +func (s *ShowReward) Run() error { + return logic.Run(s) +} + +func (s *ShowReward) Exec() (err error) { + cpn, conf, err := s.cpn() + if err != nil { + return + } + + err = s.set(cpn, conf) + if err != nil { + return + } + + return +} + +func (s *ShowReward) cpn() (cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if cpn == nil { + err = workerr.NotFound("not found campaign") + return + } + + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = s._helpMap(cpn) + if err != nil { + return + } + + return +} + +func (s *ShowReward) set(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx). + Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)). + Order(m.Step, m.Sort, m.ID). + Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var groupMap = make(map[int8][]*model.FissionCampaignReward) + var rewardIds []int64 + var rewardMap = make(map[int64]*provider.RewardInfo) + for _, v := range list { + if _, ok := rewardMap[v.RewardID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + rewardMap[v.RewardID] = nil + } + groupMap[v.RewardType] = append(groupMap[v.RewardType], v) + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, rewardIds...) + if err != nil { + return + } + + // 获取活动对应的用户等级和用户的语言 + uct, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserCampaignType(cpn, conf, s.Req.GetLangMark(), s.Req.GetLevelMark(), s.Req.GetCountryMark()) + if err != nil { + return + } + + showLang := s.Req.GetShowLang() + s.add(&s.Res.RewardsWeb, groupMap[mtype.FissionCampaignRewardTypeWeb], preward, showLang, nil) + s.add(&s.Res.RewardsExtra, groupMap[mtype.FissionCampaignRewardTypeExtra], preward, showLang, nil) + s.add(&s.Res.RewardsNewcomer, groupMap[mtype.FissionCampaignRewardTypeNewcomer], preward, showLang, nil) + + var ok addOk + switch conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel: + ok = func(langMark string, levelId int64, countryMark string) bool { return levelId == uct.LevelId } + case mtype.FissionRewardGroupLang: + ok = func(langMark string, levelId int64, countryMark string) bool { return langMark == uct.LangMark } + case mtype.FissionRewardGroupLangAndUserLevel: + ok = func(langMark string, levelId int64, countryMark string) bool { + return langMark == uct.LangMark && levelId == uct.LevelId + } + case mtype.FissionRewardGroupCountry: + ok = func(langMark string, levelId int64, countryMark string) bool { return countryMark == uct.CountryMark } + } + + s.add(&s.Res.Rewards, groupMap[mtype.FissionCampaignRewardTypeApp], preward, showLang, ok) + + return +} + +type addOk func(langMark string, levelId int64, countryMark string) bool + +func (s *ShowReward) add(outList *[]*pb.ShowRewardRes_Reward, inList []*model.FissionCampaignReward, preward *provider.Rewards, langMark string, ok addOk) { + *outList = make([]*pb.ShowRewardRes_Reward, 0, len(inList)) + for _, v := range inList { + + if ok != nil && !ok(v.LangMark, v.LevelID, v.CountryMark) { + continue + } + + one := &pb.ShowRewardRes_Reward{ + Id: v.ID, + Title: "", + ImgUrl: "", + Stock: v.Stock, + InviteNum: v.InviteNum, + RewardNum: v.RewardNum, + IsThank: int32(v.IsThank), + Score: v.Score, + SignDay: v.SignDay, + CollectNum: v.CollectNum, + IsSuper: int32(v.IsSuper), + ReceiveType: 0, + KvData: nil, + Contact: "", + Url: "", + Help: 0, + HelpPercent: 0, + Click: 0, + ClickPercent: 0, + ClickPercentLimit: 0, + Open: 0, + OpenPercent: 0, + OpenPercentLimit: 0, + JumpUrl: v.JumpURL, + RewardId: v.RewardID, + } + + info, _ := preward.InfoAutoLang(v.RewardID, langMark) + one.ReceiveType = info.ReceiveType + one.Contact = info.Contact + one.Url = info.Url + one.KvData = make([]*pb.ShowRewardRes_KV, 0, len(info.KvData)) + for _, kv := range info.KvData { + one.KvData = append(one.KvData, &pb.ShowRewardRes_KV{ + Key: kv.Key, + Value: kv.Value, + }) + } + one.Title = info.Title + one.ImgUrl = info.ImgUrl + + for _, help := range s.helpMap[v.ID] { + switch help.TaskType { + case mtype.FissionCampaignTaskTypeInstall: + one.Help = mtype.Yes + one.HelpPercent = help.Percent + case mtype.FissionCampaignTaskTypeOpen: + one.Open = mtype.Yes + one.OpenPercent = help.Percent + one.OpenPercentLimit = help.PercentLimit + case mtype.FissionCampaignTaskTypeClick: + one.Click = mtype.Yes + one.ClickPercent = help.Percent + one.ClickPercentLimit = help.PercentLimit + case mtype.FissionCampaignTaskTypeRegister: + one.Register = mtype.Yes + one.RegisterPercent = help.Percent + } + } + + *outList = append(*outList, one) + } +} + +func (s *ShowReward) _helpMap(cpn *model.FissionCampaign) (err error) { + var helpMap = make(map[int64][]*model.FissionCampaignTask) + + defer func() { + s.helpMap = helpMap + }() + + if cpn.FissionID != consts.IdChop { + return + } + + taskM := s.GetDao().FissionCampaignTask + tasks, err := taskM.WithContext(s.Ctx).Where(taskM.CampaignID.Eq(cpn.ID), taskM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range tasks { + rewardId := utils.FissionCampaignTaskMarkRewardOneRewardId(v.TaskMark) + helpMap[rewardId] = append(helpMap[rewardId], v) + } + + return +} diff --git a/internal/service/containers/campaign/store.go b/internal/service/containers/campaign/store.go new file mode 100644 index 0000000..4d06956 --- /dev/null +++ b/internal/service/containers/campaign/store.go @@ -0,0 +1,3510 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "strings" + "time" + + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + linkpb "gits.branchcn.com/backend/shortlink/proto/go_proto/link" +) + +type Store struct { + logic.Logic + Req *pb.StoreReq + Res *pb.StoreRes + + project *model.Project + temp *model.FissionTemp + group *model.FissionTempGroup + + appMark, webMark string + otherReward []*model.FissionCampaignReward + otherRelateIds []int64 + otherRelateMap map[int64]struct{} + + helpInstall, helpRegister, helpOpen, helpClick bool + + langSourceMap map[string]int64 + + rewardAdd map[int64]*pb.StoreReq_OpenAdd + rewardTask map[int64]*pb.StoreReq_RewardTask +} + +func (s *Store) Run() error { + return logic.Run(s) +} + +func (s *Store) Exec() (err error) { + err = s.depend() + if err != nil { + return + } + + cpn, err := s.create() + if err != nil { + return + } + + err = s.createConfig(cpn) + if err != nil { + return + } + + err = s.createDefault(cpn) + if err != nil { + return + } + + err = s.createFission(cpn) + if err != nil { + return + } + + err = s.createEvent(cpn) + if err != nil { + return + } + + err = s.createReward(cpn) + if err != nil { + return + } + + err = s.createRewardAdd(cpn) + if err != nil { + return + } + + err = s.createRewardTask(cpn) + if err != nil { + return + } + + err = s.createPush(cpn) + if err != nil { + return + } + + err = s.createChild(cpn) + if err != nil { + return + } + + err = s.copyLangs(cpn) + if err != nil { + return + } + + err = s.createLink(cpn) + if err != nil { + return + } + + err = s.syncEvent(cpn) + if err != nil { + return + } + + err = s.saveDelayLinkData(cpn) + if err != nil { + return + } + + return +} + +// 创建活动 +func (s *Store) create() (cpn *model.FissionCampaign, err error) { + cpn = withdefault.FissionCampaign(&model.FissionCampaign{ + FissionID: s.temp.FissionID, + ProjectID: s.project.ID, + CreatorID: s.Req.GetUserId(), + TemplateID: s.temp.ID, + Title: s.Req.GetTitle(), + StartTime: timez.GMT(s.Req.GetStartTime(), s.Req.GetTOffset()), + EndTime: timez.GMT(s.Req.GetEndTime(), s.Req.GetTOffset()), + CoverURL: s.Req.GetCoverUrl(), + TOffset: s.Req.GetTOffset(), + TStart: s.Req.GetStartTime(), + TEnd: s.Req.GetEndTime(), + Target: utils.Ternary[int8]( + verify.InArray(s.temp.FissionID, consts.IdDice, consts.IdCash, consts.IdGrow), + int8(s.Req.GetTargetOption().GetTarget()), + int8(s.Req.GetTarget().GetTarget()), + ), + ReportType: mtype.FissionCampaignReportTypeNew, + }) + + cpn.SetLangTypes([]int8{s.temp.LangType}) + + if s.Req.GetCoverUrl() == "" { + cpn.CoverURL = s.group.CoverURL + } + + // 已经开始了活动 + if cpn.StartTime <= time.Now().Unix() { + cpn.Status = utils.Ternary[int8](s.Req.GetConfig().GetHasWhite() == mtype.Yes, mtype.FissionCampaignStatusPubPre, mtype.FissionCampaignStatusPub) + if cpn.FissionID == consts.IdDice { + s.AddAfterRun(func() (err error) { + producer.NewCampaignNotice(s.Ctx).CampaignDiceMap(types.CampaignDiceMap{CampaignId: cpn.ID}) + return + }) + } + } + + m := s.GetDao().FissionCampaign + + if err = m.WithContext(s.Ctx).Create(cpn); err != nil { + return nil, s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + return + }) + + return +} + +// 创建配置 +func (s *Store) createConfig(cpn *model.FissionCampaign) (err error) { + // 一般配置 + var reqConf = s.Req.GetConfig() + var target = s.Req.GetTarget() + + conf := withdefault.FissionCampaignConfig(&model.FissionCampaignConfig{ + CampaignID: cpn.ID, + RuleTextColor: reqConf.GetRuleTextColor(), + RuleBgColor: reqConf.GetRuleBgColor(), + ShareText: reqConf.GetShareText(), + ShareImg: reqConf.GetShareImg(), + HasRank: int8(reqConf.HasRank), + RankBackgroundColor: reqConf.GetRankBackgroundColor(), + RankTextColor: reqConf.GetRankTextColor(), + DownloadPageImage: reqConf.GetDownloadPageImage(), + IsDefaultDownload: int8(reqConf.GetIsDefaultDownload()), + WechatPageImage: reqConf.GetWechatPageImage(), + IsDefaultWechat: int8(reqConf.GetIsDefaultWechat()), + ImageMain: reqConf.GetImageMain(), + IsDefaultMain: int8(reqConf.GetIsDefaultMain()), + ImagePreview: reqConf.GetImagePreview(), + LinkBtnTextColor: reqConf.GetLinkBtnTextColor(), + LinkBtnBgColor: reqConf.GetLinkBtnBgColor(), + LinkTextColor: reqConf.GetLinkTextColor(), + ShowShare: int8(reqConf.GetShowShare()), + Share: "", + CampaignData: "", + PageTitle: reqConf.GetPageTitle(), + DmShow: int8(reqConf.GetDmShow()), + HasWeb: utils.Ternary[int8](len(s.Req.GetRewardsWeb()) > 0, mtype.Yes, mtype.No), + WebBgImg: reqConf.GetWebBgImg(), + HasWarmUp: int8(reqConf.GetHasWarmUp()), + WarmUpImg: reqConf.GetWarmUpImg(), + WarmUpEnd: reqConf.GetWarmUpEnd(), + Target: int8(target.GetTarget()), + Option: int8(target.GetOption()), + AppEvent: int8(target.GetAppEvent()), + BothType: int8(target.GetBothType()), + IconType: int8(reqConf.GetIconType()), + IconBgColor: reqConf.GetIconBgColor(), + DlType: int8(reqConf.GetDlType()), + DlBannerType: int8(reqConf.GetDlBannerType()), + DlBannerImg: reqConf.GetDlBannerImg(), + DlBannerAppLogo: reqConf.GetDlBannerAppLogo(), + DlBannerAppName: reqConf.GetDlBannerAppName(), + DlBannerAppBtn: reqConf.GetDlBannerAppBtn(), + DlBannerPosition: int8(reqConf.GetDlBannerPosition()), + TopicColor: reqConf.GetTopicColor(), + WindowCover: int8(reqConf.GetWindowCover()), + RewardGroup: 0, + SupportRewardMark: "", + DefaultRewardMark: "", + PlayRule: reqConf.GetPlayRule(), + IconOpen: "", + HasLongImg: utils.Ternary[int8](len(s.Req.GetLongImgs()) > 0, mtype.Yes, mtype.No), + HasWhite: int8(reqConf.GetHasWhite()), + WhiteList: reqConf.GetWhiteList(), + PcBg: reqConf.GetPcBg(), + AdsType: mtype.FissionCampaignConfigAdsTypeClose, + LinkTempID: reqConf.GetLinkTempId(), + RuleTimeOpen: int8(reqConf.GetRuleTimeOpen()), + OutsideTask: int8(reqConf.GetOutsideTask()), + OpenShare: utils.Ternary[int8](verify.InArray[int64](cpn.FissionID, + consts.IdSignIn, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo, consts.IdPrizeQuiz, consts.IdPrizeAnswer), int8(reqConf.GetOpenShare()), 1), + ShowToUse: int8(reqConf.GetShowToUse()), + PointsUse: int8(s.Req.GetPointsUse().GetOpen()), + OpenChat: int8(s.Req.GetChat().GetOpen()), + RuleType: int8(reqConf.GetRuleType()), + RuleOutside: int8(reqConf.GetRuleOutside()), + DeviceOnce: int8(reqConf.GetDeviceOnce()), + }) + + ads, err := cache.NewProjectAd(s.Ctx).FindByProjectId(cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if ads != nil && ads.OpenAd == mtype.Yes { + conf.AdsType = int8(reqConf.GetAdsType()) + } + + // 设置奖品的配置 + s._setRewardConfig(conf) + + // 设置长图 + err = s._setLongImg(conf) + if err != nil { + return + } + + // 设置样式 + err = s._createStyle(cpn) + if err != nil { + return + } + + err = s._createPointsUse(cpn) + if err != nil { + return + } + + err = s._createChat(cpn) + if err != nil { + return + } + + if reqConf.GetShare() != nil { + conf.SetShare(reqConf.GetShare()) + } + + if reqConf.GetIconOpen() != nil { + conf.SetIconOpen(reqConf.GetIconOpen()) + } + + var kvs []*mtype.KV + for _, v := range s.Req.GetCampaignData() { + kvs = append(kvs, &mtype.KV{ + Key: v.Key, + Value: v.Value, + }) + } + + conf.SetCampaignData(kvs) + + //新活动配置 + if consts.NewEventCpn(cpn.FissionID) { + conf.Target = int8(s.Req.GetTargetOption().GetTarget()) + conf.AppEvent = int8(s.Req.GetTargetOption().GetFixed().GetAppEvent()) + conf.BothType = int8(s.Req.GetTargetOption().GetCustom().GetBothType()) + conf.Option = mtype.FissionCampaignConfigTargetOptionApp + if s.Req.GetTargetOption().GetCustom().GetOpen() == mtype.Yes { + conf.Option = utils.Ternary[int8]( + !verify.InArray[int64](cpn.FissionID, consts.IdWinTogether, consts.IdReferral), + mtype.FissionCampaignConfigTargetOptionTask, mtype.FissionCampaignConfigTargetOptionFriend) + } + + // 创建参与票获取规则 + err = s._createTicket(cpn) + if err != nil { + return + } + } + + m := s.GetDao().FissionCampaignConfig + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + //新活动配置完毕,不走下面老活动目标的逻辑 + if consts.NewEventCpn(cpn.FissionID) { + return + } + + // 创建目标条件 + var targetCond = make([]*model.FissionCampaignCond, 0, len(target.GetCond())) + for _, cond := range target.GetCond() { + targetCond = append(targetCond, withdefault.FissionCampaignCond(&model.FissionCampaignCond{ + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: cond.GetEvent(), + EventKey: cond.GetEventKey(), + EventVal: cond.GetEventVal(), + Desc: cond.GetDesc(), + IfCond: int8(cond.GetIfCond()), + TriggetType: int8(utils.NewGlobalTrigger(cpn.FissionID, cond.GetTriggerType())), + })) + } + + if len(targetCond) > 0 { + condM := s.GetDao().FissionCampaignCond + + err = condM.WithContext(s.Ctx).Create(targetCond...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +func (s *Store) _createTicket(cpn *model.FissionCampaign) (err error) { + var target = s.Req.GetTargetOption() + + var ticket []*model.FissionCampaignTicket + var tasks []*model.FissionCampaignTask + + var fixed = target.GetFixed() + if fixed.GetOpen() == mtype.Yes { + ticket = append(ticket, withdefault.FissionCampaignTicket(&model.FissionCampaignTicket{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignTicketFixed, + Open: mtype.Yes, + AppEvent: int8(fixed.GetAppEvent()), + })) + + one := withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: 0, + TaskMark: "", + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: utils.Ternary[int32](verify.InArray[int64](cpn.FissionID, consts.IdReferral, consts.IdWinTogether), 1, fixed.GetTargetNum()), + Chance: fixed.GetChance(), + ChanceLimit: fixed.GetChanceLimit(), + TaskLimit: 0, + Percent: fixed.GetPercent(), + }) + + switch fixed.GetAppEvent() { + case mtype.FissionCampaignTicketAppEventInstall: + one.TaskType = mtype.FissionCampaignTaskTypeInstall + one.TaskMark = mtype.FissionCampaignTaskMarkInstall + case mtype.FissionCampaignTicketAppEventRegister: + one.TaskType = mtype.FissionCampaignTaskTypeRegister + one.TaskMark = mtype.FissionCampaignTaskMarkRegister + } + + tasks = append(tasks, one) + } + + // 创建目标条件 + var targetCond = make([]*model.FissionCampaignCond, 0, len(target.GetCustom().GetCond())) + var custom = target.GetCustom() + if custom.GetOpen() == mtype.Yes { + ticket = append(ticket, withdefault.FissionCampaignTicket(&model.FissionCampaignTicket{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignTicketCustom, + Open: mtype.Yes, + BothType: int8(custom.GetBothType()), + PreEvent: int8(custom.GetPreEvent()), + })) + + for _, cond := range custom.GetCond() { + targetCond = append(targetCond, withdefault.FissionCampaignCond(&model.FissionCampaignCond{ + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: cond.GetEvent(), + EventKey: cond.GetEventKey(), + EventVal: cond.GetEventVal(), + Desc: cond.GetDesc(), + IfCond: int8(cond.GetIfCond()), + Num: 0, + UserNum: 0, + Total: 0, + TriggetType: int8(cond.GetTriggerType()), + DelUse: 0, + EventType: int8(cond.GetEventType()), + ViewType: int8(cond.GetViewType()), + WatchSec: cond.GetWatchSec(), + OpenJump: int8(cond.GetOpenJump()), + WebURL: cond.GetWebUrl(), + ExtraParam: cond.GetExtraParam(), + PcParam: cond.GetPcParam(), + GoShow: int8(cond.GetGoShow()), + AdsStrategyID: cond.GetAdsStrategyId(), + IsSuper: int8(cond.GetIsSuper()), + Sort: cond.GetSort(), + OpenPush: int8(cond.GetOpenPush()), + GoText: cond.GetGoText(), + ClickEffectOpen: int8(cond.GetClickEffectOpen()), + ClickEffect: cond.GetClickEffect(), + ClickEffectUnit: cond.GetClickEffectUnit(), + PullInvite: int8(cond.GetPullInvite()), + })) + } + + switch custom.GetBothType() { + case mtype.FissionCampaignTicketBothTypeAll: + var rewardId int64 + var propMark = custom.GetBothAll().GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: custom.GetBothAll().GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: custom.GetBothAll().GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: custom.GetBothAll().GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: custom.GetBothAll().GetExpiredDay(), + }) + } + + ll, _ := jsonm.ToSliceString(custom.GetBothAll().GetLevelIds()) + lm, _ := jsonm.ToSliceString(custom.GetBothAll().GetLangMarks()) + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondAll, + TaskMark: mtype.FissionCampaignTaskMarkCondAll, + PropMark: propMark, + Num: 1, + Chance: custom.GetBothAll().GetChance(), + ChanceLimit: 0, + TaskLimit: custom.GetBothAll().GetTaskLimit(), + DayLimit: custom.GetBothAll().GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: custom.GetBothAll().GetWeekLimit(), + WeekNum: int8(custom.GetBothAll().GetWeekNum()), + RewardID: rewardId, + })) + case mtype.FissionCampaignTicketBothTypeOne: + for i, cond := range custom.GetCond() { + var rewardId int64 + var propMark = cond.GetPropMark() + + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: cond.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: cond.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: cond.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: cond.GetExpiredDay(), + }) + } + + ll, _ := jsonm.ToSliceString(cond.GetLevelIds()) + lm, _ := jsonm.ToSliceString(cond.GetLangMarks()) + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + PropMark: propMark, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(targetCond[i].ID), + Num: 1, + Chance: cond.GetChance(), + ChanceLimit: 0, + TaskLimit: cond.GetTaskLimit(), + DayLimit: cond.GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: cond.GetWeekLimit(), + WeekNum: int8(cond.GetWeekNum()), + HasPre: int8(cond.GetHasPre()), + PreCond: cond.GetPreCond(), + ExpiredMin: cond.GetExpiredMin(), + RewardID: rewardId, + AwardMode: int8(cond.GetAwardMode()), + })) + } + } + } + + if len(ticket) > 0 { + ticketM := s.GetDao().FissionCampaignTicket + err = ticketM.WithContext(s.Ctx).Create(ticket...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(targetCond) > 0 { + condM := s.GetDao().FissionCampaignCond + err = condM.WithContext(s.Ctx).Create(targetCond...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(tasks) > 0 { + taskM := s.GetDao().FissionCampaignTask + err = taskM.WithContext(s.Ctx).Create(tasks...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 奖品配置 +func (s *Store) _setRewardConfig(conf *model.FissionCampaignConfig) { + conf.RewardGroup = int8(s.Req.GetRewards().GetRewardGroup()) + + switch conf.RewardGroup { + case mtype.FissionRewardGroupLang: + var lang = finder.Lang{ + Default: mtype.FissionLangTypeToMark[s.temp.LangType], + Support: make([]string, 0, len(s.Req.GetRewards().GetLangs())), + } + + for _, v := range s.Req.GetRewards().GetLangs() { + lang.Support = append(lang.Support, v.GetLangMark()) + } + + conf.DefaultRewardMark, conf.SupportRewardMark = lang.DST() + case mtype.FissionRewardGroupUserLevel: + var level = finder.Level{ + Default: s.Req.GetRewards().GetUserLevel().GetDefaultLevelId(), + Support: make([]int64, 0, len(s.Req.GetRewards().GetUserLevel().GetLevelList())), + } + + for _, v := range s.Req.GetRewards().GetUserLevel().GetLevelList() { + level.Support = append(level.Support, v.GetLevelId()) + } + + conf.DefaultRewardMark, conf.SupportRewardMark = level.DST() + + case mtype.FissionRewardGroupLangAndUserLevel: + var langLevel = finder.LangLevel{ + Default: make([]finder.DefaultLangLevel, 0, len(s.Req.GetRewards().GetLangUserLevel())), + Support: make([]finder.SupportLangLevel, 0, len(s.Req.GetRewards().GetLangUserLevel())), + } + + for _, v := range s.Req.GetRewards().GetLangUserLevel() { + langLevel.Default = append(langLevel.Default, finder.DefaultLangLevel{ + Lang: v.GetLangMark(), + Level: v.GetDefaultLevelId(), + }) + + one := finder.SupportLangLevel{ + Lang: v.GetLangMark(), + Level: make([]int64, 0, len(v.GetLevelList())), + } + for _, level := range v.GetLevelList() { + one.Level = append(one.Level, level.GetLevelId()) + } + + langLevel.Support = append(langLevel.Support, one) + } + conf.DefaultRewardMark, conf.SupportRewardMark = langLevel.DST() + case mtype.FissionRewardGroupCountry: + var country = finder.Country{ + Default: s.Req.GetRewards().GetCountry().GetDefaultCountryMark(), + Support: make([]string, 0, len(s.Req.GetRewards().GetCountry().GetCountryList())), + } + + for _, v := range s.Req.GetRewards().GetCountry().GetCountryList() { + country.Support = append(country.Support, v.GetCountryMark()) + } + + conf.DefaultRewardMark, conf.SupportRewardMark = country.DST() + default: + + } + +} + +// 创建默认数据 +func (s *Store) createDefault(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignChannel + + // 默认站内渠道 + var mark = utils.GetRandEnStr(consts.ChannelMarkLen) + var chs = []*model.FissionCampaignChannel{ + withdefault.FissionCampaignChannel(&model.FissionCampaignChannel{ + CampaignID: cpn.ID, + IsDefault: mtype.Yes, + Mark: mark, + Title: consts.ChannelDefaultName, + CType: mtype.FissionCampaignChannelTypeApp, + }), + } + + s.appMark = mark + + // 创建默认站外渠道 + if s.project.Scene == mtype.ProjectSceneApp { + var webMark string + var idx int + for { + webMark = utils.GetRandEnStr(consts.ChannelMarkLen) + if strings.ToLower(webMark) != strings.ToLower(mark) { + break + } + + if idx > 99 { + return workerr.BusyError + } + + idx++ + } + + s.webMark = webMark + + chs = append(chs, withdefault.FissionCampaignChannel(&model.FissionCampaignChannel{ + CampaignID: cpn.ID, + IsDefault: mtype.Yes, + Mark: webMark, + Title: consts.ChannelWebDefaultName, + CType: mtype.FissionCampaignChannelTypeWeb, + })) + } + + err = m.WithContext(s.Ctx).Create(chs...) + if err != nil { + return s.BE().MysqlError(err) + } + // 渠道短链 + for _, v := range chs { + if v.CType == mtype.FissionCampaignChannelTypeWeb { + var link = blink.NewCampaignLink(s.project.Domain, cpn.HashID, v.Mark).CampaignWebLink() + res, e := app.NewShortLinkNameLink().CreateShortLink(s.Ctx, &linkpb.CreateShortLinkReq{ + LongLink: link, + Domain: s.project.Domain, + }) + if e == nil { + m.WithContext(s.Ctx).Where(m.ID.Eq(v.ID)).UpdateSimple(m.ShortLink.Value(res.GetShortLink())) + } + } + } + + archiveEnd := utils.CampaignArchiveEnd(cpn.EndTime) + + // 统计任务 + var atMarks = []string{mtype.FissionArchiveTaskMarkCampaignHour, mtype.FissionArchiveTaskMarkCampaignDay} + if s.Req.GetTargetOption().GetCustom().GetOpen() == mtype.Yes || + verify.InArray(s.Req.GetTarget().GetOption(), mtype.FissionCampaignConfigTargetOptionUse, mtype.FissionCampaignConfigTargetOptionFriend, + mtype.FissionCampaignConfigTargetOptionSelf, mtype.FissionCampaignConfigTargetOptionTask) { + atMarks = append(atMarks, mtype.FissionArchiveTaskMarkCondDay, mtype.FissionArchiveTaskMarkCondHour) + } + + var archiveTasks = make([]*model.FissionArchiveTask, 0, len(atMarks)) + for _, v := range atMarks { + archiveTasks = append(archiveTasks, withdefault.FissionArchiveTask(&model.FissionArchiveTask{ + CampaignID: cpn.ID, + EndTime: archiveEnd.Unix(), + Mark: v, + })) + } + + atm := s.GetDao().FissionArchiveTask + err = atm.WithContext(s.Ctx).Create(archiveTasks...) + if err != nil { + return s.BE().MysqlError(err) + } + + err = cmm.NewCMM(s.Ctx, s.GetDao()).AnalyzeCampaign(cpn.ProjectID, cpn.ID, cpn.StartTime, cpn.EndTime, 0) + if err != nil { + return + } + + return +} + +// 创建访问链接 +func (s *Store) createLink(cpn *model.FissionCampaign) (err error) { + res, err := app.NewDeepLinkLink().CreateCampaignLinkOne(s.Ctx, &dlinkpb.CreateCampaignLinkOneReq{ + ProjectId: s.project.ID, + CampaignId: cpn.ID, + CreatedTime: cpn.CreatedAt, + TemplateKey: s.Req.GetConfig().GetLinkTempId(), + }) + + if err != nil { + return + } + + codeInfo, err := app.NewDeepLinkLink().CreateCampaignLinkCode(s.Ctx, &dlinkpb.CreateCampaignLinkCodeReq{ + ProjectId: cpn.ProjectID, + LinkId: res.GetId(), + Channel: s.webMark, + RedirectUrl: blink.NewCampaignLink(s.project.Domain, cpn.HashID, s.appMark, blink.SetCwMark(s.webMark)).CampaignCodeLink(), + }) + + if err != nil { + return + } + + m := s.GetDao().FissionCampaignChannel + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Mark.Eq(s.webMark)).UpdateSimple(m.Code.Value(codeInfo.GetCode())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 创建玩法特有数据 +func (s *Store) createFission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdPrizeWheel: //大转盘 + return s._createPrizeWheel(cpn) + case consts.IdSlotMachine: //老虎机 + return s._createSlotMachine(cpn) + case consts.IdLuckyGrid: //九宫格 + return s._createLuckyGrid(cpn) + case consts.IdBlindBox: //盲盒 + return s._createBlindBox(cpn) + case consts.IdReferral: //老带新 + return s._createReferral(cpn) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo: //趣味问答 + return s._createPrizeAnswer(cpn) + case consts.IdPrizeQuiz: //有奖竞猜 + return s._createPrizeQuiz(cpn) + case consts.IdWinTogether: //一起赢奖励 + return s._createWinTogether(cpn) + case consts.IdSignIn: //签到 + return s._createSignIn(cpn) + case consts.IdDice: //大富翁 + return s._createDice(cpn) + case consts.IdGrow: //农场¬ + return s._createGrow(cpn) + case consts.IdBallot: //抽签 + return s._createBallot(cpn) + case consts.IdChop: //砍一刀 + return s._createChop(cpn) + case consts.IdCash: //现金抽奖 + return s._createCash(cpn) + case consts.IdFlip: //翻牌活动 + return s._createFlip(cpn) + case consts.IdKeep: //激励养成 + return s._createKeep(cpn) + case consts.IdGold: //金币任务 + return s._createGold(cpn) + case consts.IdCoin: //金币池 + return s._createCoin(cpn) + case consts.IdVs: + return s._createVs(cpn) + case consts.IdUno: + return s._createUno(cpn) + case consts.IdGashapon: //扭蛋机 + return s._createGashapon(cpn) + default: + + } + return +} + +// 创建大转盘 +func (s *Store) _createPrizeWheel(cpn *model.FissionCampaign) (err error) { + + wheel := s.Req.GetPrizeWheel() + + if wheel == nil { + return s.BE().VerifyError("please set prize_wheel") + } + + prizeWheel := withdefault.FissionCampaignWheel(&model.FissionCampaignWheel{ + CampaignID: cpn.ID, + TargetNum: wheel.GetTargetNum(), + InitChance: wheel.GetInitChance(), + Chance: wheel.GetChance(), + DayChance: wheel.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignWheel + + if err = m.WithContext(s.Ctx).Create(prizeWheel); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建老虎机 +func (s *Store) _createSlotMachine(cpn *model.FissionCampaign) (err error) { + slot := s.Req.GetSlot() + + if slot == nil { + return s.BE().VerifyError("please set slot") + } + + fcs := withdefault.FissionCampaignSlot(&model.FissionCampaignSlot{ + CampaignID: cpn.ID, + TargetNum: slot.GetTargetNum(), + InitChance: slot.GetInitChance(), + Chance: slot.GetChance(), + DayChance: slot.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignSlot + + if err = m.WithContext(s.Ctx).Create(fcs); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建九宫格 +func (s *Store) _createLuckyGrid(cpn *model.FissionCampaign) (err error) { + grid := s.Req.GetGrid() + + if grid == nil { + return s.BE().VerifyError("please set grid") + } + + fcg := withdefault.FissionCampaignGrid(&model.FissionCampaignGrid{ + CampaignID: cpn.ID, + TargetNum: grid.GetTargetNum(), + InitChance: grid.GetInitChance(), + Chance: grid.GetChance(), + DayChance: grid.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignGrid + + if err = m.WithContext(s.Ctx).Create(fcg); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建盲盒 +func (s *Store) _createBlindBox(cpn *model.FissionCampaign) (err error) { + blind := s.Req.GetBlind() + + if blind == nil { + return s.BE().VerifyError("please set blind") + } + + fcb := withdefault.FissionCampaignBlind(&model.FissionCampaignBlind{ + CampaignID: cpn.ID, + TargetNum: blind.GetTargetNum(), + InitChance: blind.GetInitChance(), + Chance: blind.GetChance(), + DayChance: blind.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignBlind + + if err = m.WithContext(s.Ctx).Create(fcb); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建趣味问答 +func (s *Store) _createPrizeAnswer(cpn *model.FissionCampaign) (err error) { + qac := s.Req.GetQuestionAnswer() + + if qac == nil { + return s.BE().VerifyError("please set question_answer") + } + + qa := withdefault.FissionCampaignQa(&model.FissionCampaignQa{ + CampaignID: cpn.ID, + TargetNum: qac.GetTargetNum(), + InitChance: qac.GetInitChance(), + Chance: qac.GetChance(), + QuestionAskTime: qac.GetQuestionAskTime(), + QaNum: qac.GetQaNum(), + DayChance: qac.GetDayChance(), + OpenGuide: int8(qac.GetOpenGuide()), + }) + + if qac.GetGroupHashId() != "" { + var group *model.LibraryQaGroup + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.HashID.Eq(qac.GetGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil { + return s.BE().VerifyError("qa group params error") + } + qa.QaGroupID = group.ID + } + + if qac.GetGuideGroupHashId() != "" { + var group *model.LibraryQaGroup + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.HashID.Eq(qac.GetGuideGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil { + return s.BE().VerifyError("qa group params error") + } + qa.GuideGroupID = group.ID + } + + //创建数据 + m := s.GetDao().FissionCampaignQa + if err = m.WithContext(s.Ctx).Create(qa); err != nil { + return s.BE().MysqlError(err) + } + + //设置问题 + var qs = make([]*model.FissionCampaignQaQuestion, 0, len(qac.GetQuestions())) + var ops = make([]*model.FissionCampaignQaOption, 0) + for i, v := range qac.GetQuestions() { + qsOne := withdefault.FissionCampaignQaQuestion(&model.FissionCampaignQaQuestion{ + CampaignID: cpn.ID, + QaID: qa.ID, + Title: v.GetTitle(), + Score: v.GetScore(), + Sort: int32(i), + }) + + for _, v1 := range v.GetOptions() { + ops = append(ops, withdefault.FissionCampaignQaOption(&model.FissionCampaignQaOption{ + QuestionID: qsOne.ID, + Title: v1.GetTitle(), + IsRight: int8(v1.GetIsRight()), + })) + } + + qs = append(qs, qsOne) + } + + if len(qs) > 0 { + cqqM := s.GetDao().FissionCampaignQaQuestion + if err = cqqM.WithContext(s.Ctx).Create(qs...); err != nil { + return s.BE().MysqlError(err) + } + } + + if len(ops) > 0 { + cqoM := s.GetDao().FissionCampaignQaOption + if err = cqoM.WithContext(s.Ctx).Create(ops...); err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 创建赛事竞猜 +func (s *Store) _createPrizeQuiz(cpn *model.FissionCampaign) (err error) { + quiz := s.Req.GetQuiz() + + if quiz == nil { + return s.BE().VerifyError("please set quiz") + } + + fcq := withdefault.FissionCampaignQuiz(&model.FissionCampaignQuiz{ + CampaignID: cpn.ID, + TargetNum: quiz.GetTargetNum(), + InitChance: quiz.GetInitChance(), + Chance: quiz.GetChance(), + RewardRule: int8(quiz.GetRewardRule()), + OpenPrize: timez.GMT(quiz.GetOpenPrize(), s.Req.GetTOffset()), + OpenType: mtype.FissionCampaignQuizOpenTypeWait, + Title: quiz.GetTitle(), + TOpen: quiz.GetOpenPrize(), + }) + + m := s.GetDao().FissionCampaignQuiz + + if err = m.WithContext(s.Ctx).Create(fcq); err != nil { + return s.BE().MysqlError(err) + } + + var options = make([]*model.FissionCampaignQuizOption, 0, len(quiz.GetOptions())) + for _, v := range quiz.GetOptions() { + options = append(options, withdefault.FissionCampaignQuizOption(&model.FissionCampaignQuizOption{ + CampaignID: cpn.ID, + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + IsRight: int8(v.GetIsRight()), + })) + } + + optionM := s.GetDao().FissionCampaignQuizOption + + if err = optionM.WithContext(s.Ctx).Create(options...); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建老带新 +func (s *Store) _createReferral(cpn *model.FissionCampaign) (err error) { + rfl := s.Req.GetReferral() + + if rfl == nil { + return s.BE().VerifyError("please set referral") + } + + referral := withdefault.FissionCampaignReferral(&model.FissionCampaignReferral{ + CampaignID: cpn.ID, + RewardLimit: rfl.GetRewardLimit(), + RewardRule: int8(rfl.GetRewardRule()), + InviteLimit: rfl.GetInviteLimit(), + StepLoop: int8(rfl.GetStepLoop()), + }) + + m := s.GetDao().FissionCampaignReferral + + if err = m.WithContext(s.Ctx).Create(referral); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 创建一起赢你奖励 +func (s *Store) _createWinTogether(cpn *model.FissionCampaign) (err error) { + win := s.Req.GetWin() + + if win == nil { + return s.BE().VerifyError("please set win") + } + + fcw := withdefault.FissionCampaignWin(&model.FissionCampaignWin{ + CampaignID: cpn.ID, + RewardLimit: win.GetRewardLimit(), + RewardRule: int8(win.GetRewardRule()), + InviteLimit: win.GetInviteLimit(), + NewcomerCond: int8(win.GetNewcomerCond()), + StepLoop: int8(win.GetStepLoop()), + }) + + m := s.GetDao().FissionCampaignWin + + if err = m.WithContext(s.Ctx).Create(fcw); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 同步事件推送 +func (s *Store) syncEvent(cpn *model.FissionCampaign) (err error) { + err = cmm.NewCMM(s.Ctx, s.GetDao()).SaveEventCampaignTrigger(cpn.ProjectID) + if err != nil { + return + } + + return +} + +// 创建签到玩法配置 +func (s *Store) _createSignIn(cpn *model.FissionCampaign) (err error) { + sign := s.Req.GetSign() + + if sign == nil { + return s.BE().VerifyError("please set sign") + } + + fcs := withdefault.FissionCampaignSign(&model.FissionCampaignSign{ + CampaignID: cpn.ID, + SignType: int8(sign.GetSignType()), + IsContinue: int8(sign.GetIsContinue()), + HasCard: int8(sign.GetHasCard()), + InviteNum: sign.GetInviteNum(), + IsLoop: int8(sign.GetIsLoop()), + SignCycle: sign.GetSignCycle(), + RecycleType: int8(sign.GetRecycleType()), + Color: sign.GetColor(), + }) + + if sign.GetSignType() == mtype.FissionCampaignSignTypeStep { + fcs.IsContinue = mtype.Yes + } + + m := s.GetDao().FissionCampaignSign + if err = m.WithContext(s.Ctx).Create(fcs); err != nil { + return s.BE().MysqlError(err) + } + + if fcs.HasCard == mtype.No { + return + } + + task := withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: mtype.FissionCampaignTaskMarkInstall, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: fcs.InviteNum, + Chance: 1, + }) + + err = s.GetDao().FissionCampaignTask.WithContext(s.Ctx).Create(task) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) _createDice(cpn *model.FissionCampaign) (err error) { + dice := s.Req.GetDice() + + if dice == nil { + return s.BE().VerifyError("please set dice") + } + + fcd := withdefault.FissionCampaignDice(&model.FissionCampaignDice{ + CampaignID: cpn.ID, + InitChance: dice.GetInitChance(), + DayChance: dice.GetDayChance(), + FixDice: int8(dice.GetFixDice()), + FixDiceTarget: dice.GetFixDiceTarget(), + FixDiceLimit: dice.GetFixDiceLimit(), + FixDiceCond: int8(dice.GetFixDiceCond()), + CustomDice: dice.GetCustomDice(), + OpenMapPoint: int8(dice.GetOpenMapPoint()), + MapPoint: "", + AwardType: int8(dice.GetAwardType()), + Odds: dice.GetOdds(), + OpenInvite: int8(dice.GetOpenInvite()), + RollAgain: int8(dice.GetRollAgain()), + PlayImg: dice.GetPlayImg(), + CloudImg: dice.GetCloudImg(), + }) + + fcd.SetMapPoint(&mtype.MapPoint{ + Blank: dice.GetMapPoint().GetBlank(), + Again: dice.GetMapPoint().GetAgain(), + Normal: dice.GetMapPoint().GetNormal(), + Supper: dice.GetMapPoint().GetSupper(), + }) + + m := s.GetDao().FissionCampaignDice + + if err = m.WithContext(s.Ctx).Create(fcd); err != nil { + return s.BE().MysqlError(err) + } + + if fcd.FixDice != mtype.Yes { + return + } + + taskM := s.GetDao().FissionCampaignTask + + err = taskM.WithContext(s.Ctx).Create(withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: utils.Ternary[int8](fcd.FixDiceCond == mtype.FissionCampaignDiceFixDiceCondInstall, mtype.FissionCampaignTaskTypeInstall, mtype.FissionCampaignTaskTypeRegister), + TaskMark: utils.Ternary[string](fcd.FixDiceCond == mtype.FissionCampaignDiceFixDiceCondInstall, mtype.FissionCampaignTaskMarkInstall, mtype.FissionCampaignTaskMarkRegister), + PropMark: mtype.FissionCampaignTaskPropMarkFixedRoll, + Num: dice.GetFixDiceTarget(), + Chance: 1, + ChanceLimit: dice.GetFixDiceLimit(), + TaskLimit: 0, + })) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) _createGrow(cpn *model.FissionCampaign) (err error) { + grow := s.Req.GetGrow() + + if grow == nil { + return s.BE().VerifyError("please set grow") + } + + conf := withdefault.FissionCampaignGrow(&model.FissionCampaignGrow{ + CampaignID: cpn.ID, + AutoHour: grow.GetAutoHour(), + AutoNum: grow.GetAutoNum(), + GrowNum: grow.GetGrowNum(), + TargetNum: grow.GetTargetNum(), + Revive: int8(grow.GetRevive()), + ReviveNum: grow.GetReviveNum(), + DieHour: grow.GetDieHour(), + InitNum: grow.GetInitNum(), + }) + + m := s.GetDao().FissionCampaignGrow + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + var steps = make([]*model.FissionCampaignGrowStep, 0, len(grow.GetSteps())) + for i, step := range grow.GetSteps() { + steps = append(steps, withdefault.FissionCampaignGrowStep(&model.FissionCampaignGrowStep{ + CampaignID: cpn.ID, + Step: int32(i + 1), + Num: step.Num, + })) + } + + stepM := s.GetDao().FissionCampaignGrowStep + if err = stepM.WithContext(s.Ctx).Create(steps...); err != nil { + return s.BE().MysqlError(err) + } + + //复活任务 + err = s._createGrowReviveTask(cpn) + if err != nil { + return err + } + + return +} + +func (s *Store) _createGrowReviveTask(cpn *model.FissionCampaign) (err error) { + grow := s.Req.GetGrow() + + if grow.GetRevive() == mtype.Yes { + task := withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: mtype.FissionCampaignTaskMarkInstall, + PropMark: mtype.FissionCampaignTaskPropMarkRevive, + Num: grow.GetReviveNum(), + Chance: 1, + }) + + taskM := s.GetDao().FissionCampaignTask + err = taskM.WithContext(s.Ctx).Create(task) + if err != nil { + return s.BE().MysqlError(err) + } + + } + return +} + +func (s *Store) _createBallot(cpn *model.FissionCampaign) (err error) { + ballot := s.Req.GetBallot() + + if ballot == nil { + return s.BE().VerifyError("please set ballot") + } + + conf := withdefault.FissionCampaignBallot(&model.FissionCampaignBallot{ + CampaignID: cpn.ID, + InitChance: ballot.GetInitChance(), + DayChance: ballot.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignBallot + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) _createChop(cpn *model.FissionCampaign) (err error) { + chop := s.Req.GetChop() + + if chop == nil { + return s.BE().VerifyError("please set chop") + } + + conf := withdefault.FissionCampaignChop(&model.FissionCampaignChop{ + CampaignID: cpn.ID, + ShowBar: int8(chop.GetShowBar()), + HelpRule: mtype.FissionCampaignChopHelpRuleUniqUser, + }) + + m := s.GetDao().FissionCampaignChop + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 设置延迟深度链接数据 +func (s *Store) saveDelayLinkData(cpn *model.FissionCampaign) (err error) { + var data = &dlinkpb.SaveCampaignDataListReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + Data: make([]*dlinkpb.SaveCampaignDataListReq_Data, 0, len(s.Req.GetDelayLinkData())), + } + + for _, v := range s.Req.GetDelayLinkData() { + data.Data = append(data.Data, &dlinkpb.SaveCampaignDataListReq_Data{ + Key: v.GetKey(), + Val: v.GetValue(), + }) + } + + _, err = app.NewDeepLinkLink().SaveCampaignDataList(s.Ctx, data) + if err != nil { + return + } + + return +} + +// 创建奖品 +func (s *Store) createReward(cpn *model.FissionCampaign) (err error) { + var addRules []*model.FissionCampaignRewardRule + var addTasks []*model.FissionCampaignTask + var add = s.otherReward + var relateIds = s.otherRelateIds + var relateMap = s.otherRelateMap + var appendFn = func(rt int8, list []*pb.StoreReq_Reward, t consts.CampaignUserType) { + for i, one := range list { + var step int32 + + // 如果是老带新和一起奖励,额外奖或者是阶梯奖励规则,都要设置阶梯 + if (verify.InArray(cpn.FissionID, consts.IdWinTogether, consts.IdReferral) && + (rt == mtype.FissionCampaignRewardTypeExtra || + (rt == mtype.FissionCampaignRewardTypeApp && + (s.Req.GetReferral().GetRewardRule() == mtype.FissionReferralRewardRuleStep || + s.Req.GetWin().GetRewardRule() == mtype.FissionReferralRewardRuleStep)))) || + cpn.FissionID == consts.IdSignIn { + step = int32(i) + 1 + } + + var id = hashid.IdBigint() + + rewardOne := &model.FissionCampaignReward{ + ID: id, + CampaignID: cpn.ID, + Stock: one.GetStock(), + Sort: int32(i), + RewardType: rt, + Step: step, + InviteNum: one.GetInviteNum(), + RewardNum: one.GetRewardNum(), + IsThank: int8(one.GetIsThank()), + Score: one.GetScore(), + SignDay: one.GetSignDay(), + CollectNum: one.GetCollectNum(), + IsSuper: int8(one.GetIsSuper()), + RewardID: one.GetRewardId(), + LangMark: t.LangMark, + LevelID: t.LevelId, + Odds: one.GetOdds(), + CountryMark: t.CountryMark, + JumpURL: one.GetJumpUrl(), + HasRule: utils.Ternary[int8](one.GetCampaignLimit() > 0, mtype.Yes, mtype.No), + InitPercent: one.GetInitPercent(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + OpenAdd: int8(one.GetOpenAdd().GetOpen()), + OpenTask: int8(one.GetRewardTask().GetOpen()), + } + + s.rewardAdd[id] = one.GetOpenAdd() + s.rewardTask[id] = one.GetRewardTask() + + if cpn.FissionID == consts.IdDice && rt == mtype.FissionCampaignRewardTypeApp { + rewardOne.SetCollectRule(mtype.CollectRule{ + Open: one.GetCollectRule().GetOpen(), + InitCollect: one.GetCollectRule().GetInitCollect(), + SignDay: one.GetCollectRule().GetSignDay(), + AddCollect: one.GetCollectRule().GetAddCollect(), + ResetType: one.GetCollectRule().GetResetType(), + }) + } + + add = append(add, rewardOne) + + addTasks = append(addTasks, s._appendRewardHelp(cpn.ID, id, one)...) + + if one.GetCampaignLimit() > 0 { + addRules = append(addRules, withdefault.FissionCampaignRewardRule(&model.FissionCampaignRewardRule{ + CampaignID: cpn.ID, + RewardID: id, + CampaignLimit: one.GetCampaignLimit(), + })) + } + + if _, ok := relateMap[one.GetRewardId()]; !ok && one.GetRewardId() > 0 { + relateMap[one.GetRewardId()] = struct{}{} + relateIds = append(relateIds, one.GetRewardId()) + } + } + } + + var lvRelateMap = make(map[int64]struct{}) + var lvRelate []*model.FissionUserLevelRelated + var lvRelateFn = func(lvId int64) { + if _, ok := lvRelateMap[lvId]; !ok { + lvRelateMap[lvId] = struct{}{} + lvRelate = append(lvRelate, withdefault.FissionUserLevelRelated(&model.FissionUserLevelRelated{ + LevelID: lvId, + RelateID: cpn.ID, + RelateTable: s.Dao().FissionCampaign.TableName(), + CancelTime: 0, + })) + } + } + + appendFn(mtype.FissionCampaignRewardTypeWeb, s.Req.GetRewardsWeb(), consts.CampaignUserType{}) + appendFn(mtype.FissionCampaignRewardTypeNewcomer, s.Req.GetRewardsNewcomer(), consts.CampaignUserType{}) + appendFn(mtype.FissionCampaignRewardTypeExtra, s.Req.GetRewardsExtra(), consts.CampaignUserType{}) + + switch s.Req.GetRewards().GetRewardGroup() { + case mtype.FissionRewardGroupNormal: + appendFn(mtype.FissionCampaignRewardTypeApp, s.Req.GetRewards().GetNormal(), consts.CampaignUserType{}) + case mtype.FissionRewardGroupLang: + for _, lang := range s.Req.GetRewards().GetLangs() { + appendFn(mtype.FissionCampaignRewardTypeApp, lang.GetRewards(), consts.CampaignUserType{LangMark: lang.GetLangMark()}) + } + case mtype.FissionRewardGroupUserLevel: + for _, level := range s.Req.GetRewards().GetUserLevel().GetLevelList() { + appendFn(mtype.FissionCampaignRewardTypeApp, level.GetRewards(), consts.CampaignUserType{LevelId: level.GetLevelId()}) + lvRelateFn(level.GetLevelId()) + } + case mtype.FissionRewardGroupLangAndUserLevel: + for _, lang := range s.Req.GetRewards().GetLangUserLevel() { + for _, level := range lang.GetLevelList() { + appendFn(mtype.FissionCampaignRewardTypeApp, level.GetRewards(), consts.CampaignUserType{LangMark: lang.GetLangMark(), LevelId: level.GetLevelId()}) + lvRelateFn(level.GetLevelId()) + } + } + case mtype.FissionRewardGroupCountry: + for _, country := range s.Req.GetRewards().GetCountry().GetCountryList() { + appendFn(mtype.FissionCampaignRewardTypeApp, country.GetRewards(), consts.CampaignUserType{CountryMark: country.GetCountryMark()}) + } + } + + if len(add) == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + + var relates []*model.RewardRelated + for _, v := range relateIds { + relates = append(relates, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: v, + RelateID: cpn.ID, + RelateTable: s.GetDao().FissionCampaign.TableName(), + })) + } + + relateM := s.GetDao().RewardRelated + if err = relateM.WithContext(s.Ctx).Create(relates...); err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(addTasks) > 0 { + helpM := s.GetDao().FissionCampaignTask + if err = helpM.WithContext(s.Ctx).Create(addTasks...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(lvRelate) > 0 { + lvRelateM := s.GetDao().FissionUserLevelRelated + if err = lvRelateM.WithContext(s.Ctx).Create(lvRelate...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(addRules) > 0 { + ruleM := s.GetDao().FissionCampaignRewardRule + err = ruleM.WithContext(s.Ctx).Create(addRules...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return s._createHelpTicket(cpn) +} + +func (s *Store) depend() (err error) { + project, err := finder.Project(s.Ctx, s.Req.GetProjectId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + + tempM := s.GetDao().FissionTemp + + temp, err := tempM.WithContext(s.Ctx).Where(tempM.HashID.Eq(s.Req.GetTemplateId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil || temp.IsDel == mtype.Yes { + return workerr.NotFound("The template has been removed. Please use the new template.") + } + + group, err := cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if group.IsPrivate == mtype.Yes && !provider.NewCompanyMade(s.Ctx, project.CompanyID).OkTemp(group.Mark) { + return workerr.NotFound("group not open") + } + + s.project = project + s.temp = temp + s.group = group + s.otherRelateMap = make(map[int64]struct{}) + s.rewardAdd = make(map[int64]*pb.StoreReq_OpenAdd) + s.rewardTask = make(map[int64]*pb.StoreReq_RewardTask) + + switch temp.FissionID { + case consts.IdKeep: + invite := s.Req.GetKeepDog() + s.Req.TargetOption.Fixed = &pb.StoreReq_Fixed{ + Open: invite.GetOpenInvite(), + AppEvent: invite.GetInvite().GetInviteType(), + TargetNum: 1, + Chance: invite.GetInvite().GetInviteGet(), + Percent: 0, + } + case consts.IdPrizeQuiz: + s.Req.TargetOption.Fixed = &pb.StoreReq_Fixed{ + Open: 1, + AppEvent: 1, + TargetNum: s.Req.GetQuiz().GetTargetNum(), + Chance: s.Req.GetQuiz().GetChance(), + Percent: 0, + } + } + + if !verify.InArray[int64](temp.FissionID, consts.IdReferral, consts.IdWinTogether) { + if s.Req.TargetOption != nil && s.Req.TargetOption.Custom != nil { + s.Req.TargetOption.Custom.PreEvent = 0 + } + } + + s.AddAfterRun(func() (err error) { + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).CampaignSave(s.Res.GetId(), s.Req) + return + }) + + return +} + +func (s *Store) _createCash(cpn *model.FissionCampaign) (err error) { + cash := s.Req.GetCash() + + if cash == nil { + return s.BE().VerifyError("please set cash") + } + + conf := withdefault.FissionCampaignCash(&model.FissionCampaignCash{ + CampaignID: cpn.ID, + ExpiredDay: cash.GetExpiredDay(), + Price: cash.GetPrice(), + PriceNum: cash.GetPriceNum(), + Currency: int8(cash.GetCurrency()), + LoopNum: cash.GetLoopNum(), + }) + + m := s.GetDao().FissionCampaignCash + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) _setLongImg(conf *model.FissionCampaignConfig) (err error) { + if len(s.Req.GetLongImgs()) == 0 { + return + } + + s.langSourceMap = make(map[string]int64, len(s.Req.GetLongImgs())) + var zone []*model.FissionCampaignLongImgZone + var add = make([]*model.FissionCampaignLongImg, 0, len(s.Req.GetLongImgs())) + for _, v := range s.Req.GetLongImgs() { + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: conf.CampaignID, + ClickType: int8(v.GetClickType()), + ImgURL: v.GetImgUrl(), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + PcParam: v.GetPcParam(), + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + }) + + s.langSourceMap[v.GetImgUrl()] = one.ID + + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: one.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + })) + } + } + + add = append(add, one) + } + + err = s.GetDao().FissionCampaignLongImg.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(zone) == 0 { + return + } + + err = s.GetDao().FissionCampaignLongImgZone.WithContext(s.Ctx).Create(zone...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Store) _appendRewardHelp(campaignId, id int64, one *pb.StoreReq_Reward) (addTasks []*model.FissionCampaignTask) { + taskMark := utils.FissionCampaignTaskMarkRewardOneVal(id) + + if one.Help == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: campaignId, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: 1, + Percent: one.HelpPercent, + })) + + s.helpInstall = true + } + if one.Open == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: campaignId, + TaskType: mtype.FissionCampaignTaskTypeOpen, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: 1, + Percent: one.OpenPercent, + PercentLimit: one.OpenPercentLimit, + })) + + s.helpOpen = true + } + if one.Click == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: campaignId, + TaskType: mtype.FissionCampaignTaskTypeClick, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: 1, + Percent: one.ClickPercent, + PercentLimit: one.ClickPercentLimit, + })) + + s.helpClick = true + } + if one.Register == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: campaignId, + TaskType: mtype.FissionCampaignTaskTypeRegister, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: 1, + Percent: one.RegisterPercent, + })) + + s.helpRegister = true + } + + return +} + +func (s *Store) _createFlip(cpn *model.FissionCampaign) (err error) { + flip := s.Req.GetFlip() + + if flip == nil { + return s.BE().VerifyError("please set flip") + } + + conf := withdefault.FissionCampaignFlip(&model.FissionCampaignFlip{ + CampaignID: cpn.ID, + InitChance: flip.GetInitChance(), + CardImg: flip.GetCardImg(), + DayChance: flip.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignFlip + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 助力规则 +func (s *Store) _createHelpTicket(cpn *model.FissionCampaign) (err error) { + var helpEvent []string + + if s.helpInstall { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventInstall) + } + + if s.helpRegister { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventRegister) + } + + if s.helpOpen { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventOpen) + } + + if s.helpClick { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventClick) + } + + if len(helpEvent) == 0 { + return + } + + err = s.GetDao().FissionCampaignTicket.WithContext(s.Ctx).Create(withdefault.FissionCampaignTicket(&model.FissionCampaignTicket{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignTicketRewardHelp, + Open: mtype.Yes, + HelpEvent: strings.Join(helpEvent, ","), + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Store) copyLangs(cpn *model.FissionCampaign) (err error) { + if s.Req.GetCopyCampaignId() == "" { + return + } + + source, err := finder.Campaign(s.Ctx, s.Req.GetCopyCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + langMarks := source.GetLangMarks() + if len(langMarks) <= 1 { + return + } + + copyConds, err := s._copyCond(source.ID, cpn.ID) + if err != nil { + return + } + + copyQt, err := s._copyQuit(cpn, source.ID) + if err != nil { + return + } + + copyQa, err := s._copyQuestion(cpn, source.ID) + if err != nil { + return + } + + copyTalkText, err := s._copyTalkText(cpn, source.ID) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignLang + langs, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(source.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var imgMap = make(map[string][]*model.FissionCampaignLongImg) + var zoneMap = make(map[string][]*model.FissionCampaignLongImgZone) + var langMap = make(map[string]*model.FissionCampaignLang) + for _, lang := range langs { + langMap[lang.LangMark] = lang + imgs, zones, err1 := s._copyImg(cpn.ID, source.ID, lang.ID) + if err1 != nil { + err = err1 + return + } + imgMap[lang.LangMark] = imgs + zoneMap[lang.LangMark] = zones + + } + + var addImgs []*model.FissionCampaignLongImg + var addZones []*model.FissionCampaignLongImgZone + var add []*model.FissionCampaignLang + for _, lang := range langMarks { + + old, ok := langMap[lang] + if !ok { + continue + } + + langCond := old.GetConds() + var condMap = make(map[int64]*mtype.LangCond) + for _, cond := range langCond { + condMap[cond.CondId] = cond + } + + var conds []*mtype.LangCond + var quit *mtype.LangQuit + var questions []*mtype.LangQuestions + var talks []*mtype.KeepTalk + for _, cpc := range copyConds { + + one := cpc.cond + + if oldCond, ok1 := condMap[cpc.copyId]; ok1 { + + if one.Desc == "" { + one.Desc = oldCond.Desc + } + + if one.WebURL == "" { + one.WebURL = oldCond.WebURL + } + + if one.ExtraParam == "" { + one.ExtraParam = oldCond.ExtraParam + } + + if one.PcParam == "" { + one.PcParam = oldCond.PcParam + } + + if one.GoText == "" { + one.GoText = oldCond.GoText + } + } + + conds = append(conds, &one) + } + + switch cpn.FissionID { + case consts.IdPrizeQuiz: + langQuit := old.GetQuit() + quit = &mtype.LangQuit{ + Title: copyQt.title, + Options: make([]*mtype.LangOption, 0, len(copyQt.options)), + } + + if quit.Title == "" { + quit.Title = langQuit.Title + } + + var titleMap = make(map[int64]*mtype.LangOption) + for _, option := range langQuit.Options { + titleMap[option.OptionId] = option + } + + for _, cpo := range copyQt.options { + one := cpo.option + if oqo, ok1 := titleMap[cpo.copyId]; ok1 { + if one.Title == "" { + one.Title = oqo.Title + } + + if one.ImgUrl == "" { + one.ImgUrl = oqo.ImgUrl + } + } + + quit.Options = append(quit.Options, one) + } + case consts.IdPrizeAnswer: + langQuestions := old.GetQuestions() + var qMap = make(map[int64]*mtype.LangQuestions) + var qoMap = make(map[int64]*mtype.LangOption) + for _, question := range langQuestions { + qMap[question.QaId] = question + for _, option := range question.Options { + qoMap[option.OptionId] = option + } + } + + for _, qa := range copyQa { + one := qa.qa + if oqa, ok1 := qMap[qa.copyId]; ok1 { + if one.Title == "" { + one.Title = oqa.Title + } + + for _, option := range qa.options { + if oqo, ok2 := qoMap[option.copyId]; ok2 { + if option.option.Title == "" { + option.option.Title = oqo.Title + } + } + one.Options = append(one.Options, option.option) + } + } + + questions = append(questions, one) + } + + case consts.IdKeep: + talkText := old.GetKeepTalk() + var oldTalkTextMap = make(map[int32]string, len(talkText)) + for _, talk := range talkText { + oldTalkTextMap[talk.TextType] = talk.Content + } + + for _, v := range copyTalkText { + var text = v.content + if content, ok1 := oldTalkTextMap[v.textType]; ok1 && text == "" { + text = content + } + + talks = append(talks, &mtype.KeepTalk{ + TextType: v.textType, + Content: text, + }) + } + } + + condsStr, _ := jsonm.ToSliceString(conds) + quitStr, _ := jsonm.ToObjString(quit) + questionsStr, _ := jsonm.ToSliceString(questions) + talksStr, _ := jsonm.ToSliceString(talks) + + one := withdefault.FissionCampaignLang(&model.FissionCampaignLang{ + CampaignID: cpn.ID, + LangMark: lang, + PageTitle: old.PageTitle, + ImageMain: old.ImageMain, + DownloadPageImage: old.DownloadPageImage, + WechatPageImage: old.WechatPageImage, + ContentImg: old.ContentImg, + WebBgImg: old.DlBgImg, + WarmUpImg: old.WarmUpImg, + DlBgImg: old.DlBgImg, + DlBannerImg: old.DlBannerImg, + DlBannerAppLogo: old.DlBannerAppLogo, + DlBannerAppName: old.DlBannerAppName, + DlBannerAppBtn: old.DlBannerAppBtn, + ShareText: old.ShareText, + ShareImg: old.ShareImg, + Rule: old.Rule, + RuleImg: "", + Conds: condsStr, + Quit: quitStr, + Questions: questionsStr, + QaGroup: old.QaGroup, + LongImg: old.LongImg, + Cash: old.Cash, + Gold: "", + TOffset: old.TOffset, + TalkText: talksStr, + Coin: "", + TopicColor: "", + PcBg: "", + Vs: "[]", + Uno: utils.Ternary[string](old.Uno != "", old.Uno, "{}"), + }) + + for _, img := range imgMap[lang] { + img.LangID = one.ID + addImgs = append(addImgs, img) + } + + addZones = append(addZones, zoneMap[lang]...) + add = append(add, one) + + } + + if len(add) == 0 { + return + } + + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cpnM := s.GetDao().FissionCampaign + _, err = cpnM.WithContext(s.Ctx).Where(cpnM.ID.Eq(cpn.ID)).UpdateSimple(cpnM.LangTypes.Value(source.LangTypes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(addImgs) > 0 { + err = s.GetDao().FissionCampaignLongImg.WithContext(s.Ctx).Create(addImgs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(addZones) > 0 { + err = s.GetDao().FissionCampaignLongImgZone.WithContext(s.Ctx).Create(addZones...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +type copyCond struct { + copyId int64 + cond mtype.LangCond +} + +func (s *Store) _copyCond(oldCpnId, cpnId int64) (conds []copyCond, err error) { + condM := s.GetDao().FissionCampaignCond + oldCond, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(oldCpnId), condM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleMap = make(map[string][]*model.FissionCampaignCond) + for _, cond := range oldCond { + titleMap[cond.Desc] = append(titleMap[cond.Desc], cond) + } + + newCond, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpnId), condM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleIdx = make(map[string]int) + for _, cond := range newCond { + one := copyCond{ + copyId: 0, + cond: mtype.LangCond{ + CondId: cond.ID, + Desc: cond.Desc, + WebURL: cond.WebURL, + ExtraParam: cond.ExtraParam, + PcParam: cond.PcParam, + GoText: cond.GoText, + }, + } + + if olds, ok := titleMap[cond.Desc]; ok { + if len(olds) > titleIdx[cond.Desc] { + old := olds[titleIdx[cond.Desc]] + + one.copyId = old.ID + if cond.Desc == old.Desc { + one.cond.Desc = "" + } + + if cond.WebURL == old.WebURL { + one.cond.WebURL = "" + } + + if cond.ExtraParam == old.ExtraParam { + one.cond.ExtraParam = "" + } + + if cond.PcParam == old.PcParam { + one.cond.PcParam = "" + } + + if cond.GoText == old.GoText { + one.cond.GoText = "" + } + + titleIdx[cond.Desc]++ + } + } + + conds = append(conds, one) + } + + return +} + +type copyQuit struct { + title string + options []*copyOption //选项集合 +} + +type copyOption struct { + copyId int64 + option *mtype.LangOption +} + +func (s *Store) _copyQuit(cpn *model.FissionCampaign, oldCpnId int64) (quit *copyQuit, err error) { + if cpn.FissionID != consts.IdPrizeQuiz { + return + } + + m := s.GetDao().FissionCampaignQuiz + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(oldCpnId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + quit = ©Quit{ + title: s.Req.GetQuiz().GetTitle(), + options: nil, + } + + if conf.Title == s.Req.GetQuiz().GetTitle() { + quit.title = "" + } + + optionM := s.GetDao().FissionCampaignQuizOption + oldOption, err := optionM.WithContext(s.Ctx).Where(optionM.CampaignID.Eq(oldCpnId), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleMap = make(map[string][]*model.FissionCampaignQuizOption) + for _, option := range oldOption { + titleMap[option.Title] = append(titleMap[option.Title], option) + } + + options, err := optionM.WithContext(s.Ctx).Where(optionM.CampaignID.Eq(cpn.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleIdx = make(map[string]int) + for _, option := range options { + one := ©Option{ + copyId: 0, + option: &mtype.LangOption{ + OptionId: option.ID, + Title: option.Title, + ImgUrl: option.ImgURL, + }, + } + + if cpo, ok := titleMap[option.Title]; ok { + if len(cpo) > titleIdx[option.Title] { + old := cpo[titleIdx[option.Title]] + + one.copyId = old.ID + + if option.Title == old.Title { + one.option.Title = "" + } + + if option.ImgURL == old.ImgURL { + one.option.ImgUrl = "" + } + + titleIdx[option.Title]++ + } + + } + + quit.options = append(quit.options, one) + } + + return +} + +type copyQuestion struct { + copyId int64 + qa *mtype.LangQuestions + options []*copyOption //选项集合 +} + +func (s *Store) _copyQuestion(cpn *model.FissionCampaign, oldCpnId int64) (questions []*copyQuestion, err error) { + if cpn.FissionID != consts.IdPrizeAnswer { + return + } + + m := s.GetDao().FissionCampaignQaQuestion + oldQuestion, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(oldCpnId), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleMap = make(map[string][]*model.FissionCampaignQaQuestion) + var oldIds []int64 + for _, old := range oldQuestion { + oldIds = append(oldIds, old.ID) + titleMap[old.Title] = append(titleMap[old.Title], old) + } + + optionM := s.GetDao().FissionCampaignQaOption + oldOption, err := optionM.WithContext(s.Ctx).Where(optionM.QuestionID.In(oldIds...), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldOptionMap = make(map[int64][]*model.FissionCampaignQaOption) + for _, option := range oldOption { + oldOptionMap[option.QuestionID] = append(oldOptionMap[option.QuestionID], option) + } + + question, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ids []int64 + for _, v := range question { + ids = append(ids, v.ID) + } + + options, err := optionM.WithContext(s.Ctx).Where(optionM.QuestionID.In(ids...), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var optionMap = make(map[int64][]*model.FissionCampaignQaOption) + for _, option := range options { + optionMap[option.QuestionID] = append(optionMap[option.QuestionID], option) + } + + var titleIdx = make(map[string]int) + questions = make([]*copyQuestion, 0, len(question)) + for _, qa := range question { + one := ©Question{ + copyId: 0, + qa: &mtype.LangQuestions{}, + options: make([]*copyOption, 0, len(optionMap[qa.ID])), + } + + for _, option := range optionMap[qa.ID] { + one.options = append(one.options, ©Option{ + copyId: 0, + option: &mtype.LangOption{ + OptionId: option.ID, + Title: option.Title, + }, + }) + } + + if cpq, ok := titleMap[qa.Title]; ok { + if len(cpq) > titleIdx[qa.Title] { + old := cpq[titleIdx[qa.Title]] + + one.copyId = old.ID + if qa.Title == old.Title { + one.qa.Title = "" + } + + ops := oldOptionMap[old.ID] + var opsTitleMap = make(map[string][]*model.FissionCampaignQaOption) + for _, op := range ops { + opsTitleMap[op.Title] = append(opsTitleMap[op.Title], op) + } + + var opsTitleIdx = make(map[string]int) + for i, v := range one.options { + if cpo, ok1 := opsTitleMap[v.option.Title]; ok1 { + + if len(cpo) > opsTitleIdx[v.option.Title] { + odo := cpo[opsTitleIdx[v.option.Title]] + + one.options[i].copyId = odo.ID + + if v.option.Title == odo.Title { + one.options[i].option.Title = "" + } + } + + opsTitleIdx[v.option.Title]++ + } + } + + titleIdx[qa.Title]++ + } + } + + questions = append(questions, one) + } + + return +} + +func (s *Store) _createKeep(cpn *model.FissionCampaign) (err error) { + keep := s.Req.GetKeepDog() + + if keep == nil { + return s.BE().VerifyError("please set keep") + } + + invite, _ := jsonm.MarshalToString(keep.GetInvite()) + talkText, _ := jsonm.MarshalToString(keep.GetTalkText()) + + conf := withdefault.FissionCampaignKeep(&model.FissionCampaignKeep{ + CampaignID: cpn.ID, + Collect: keep.GetCollect(), + CollectSecond: keep.GetCollectSecond(), + OpenInvite: int8(keep.GetOpenInvite()), + Invite: invite, + InitGet: keep.GetInitGet(), + SecGet: keep.GetSecGet(), + FeedNum: keep.GetFeedNum(), + FeedCycle: keep.GetFeedCycle(), + TalkText: talkText, + MaxFeed: keep.GetMaxFeed(), + FeedGet: keep.GetFeedGet(), + FeedGetNum: keep.GetFeedGetNum(), + SecGetDayLimit: keep.GetSecGetDayLimit(), + MachineType: int8(keep.GetMachineType()), + OfflineMin: keep.GetOfflineMin(), + OfflineGet: keep.GetOfflineGet(), + OfflineLimit: keep.GetOfflineLimit(), + }) + + m := s.GetDao().FissionCampaignKeep + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + var steps []*model.FissionCampaignKeepStep + for _, v := range keep.GetSteps() { + step := withdefault.FissionCampaignKeepStep(&model.FissionCampaignKeepStep{ + CampaignID: cpn.ID, + Step: v.GetStep(), + Percent: v.GetPercent(), + RewardType: int8(v.GetRewardType()), + RewardID: 0, + RewardNum: v.GetRewardNum(), + }) + + if v.GetRewardType() == mtype.FissionCampaignKeepStepRewardTypeReward { + + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: v.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeGrowStep, + Step: v.GetStep(), + RewardNum: 1, + RewardID: v.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + + step.RewardID = rewardId + } + + steps = append(steps, step) + } + + err = s.GetDao().FissionCampaignKeepStep.WithContext(s.Ctx).Create(steps...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +type copyTalk struct { + textType int32 + content string +} + +func (s *Store) _copyTalkText(cpn *model.FissionCampaign, oldCpnId int64) (talks []*copyTalk, err error) { + if cpn.FissionID != consts.IdKeep { + return + } + + m := s.GetDao().FissionCampaignKeep + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(oldCpnId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + + return + } + + oldTalks := conf.GetKeepTalk() + var oldMap = make(map[int32]string, len(oldTalks)) + for _, oldTalk := range oldTalks { + oldMap[oldTalk.TextType] = oldTalk.Content + } + + for _, talk := range s.Req.GetKeepDog().GetTalkText() { + var text string + content, ok := oldMap[talk.GetTextType()] + if !ok || content != talk.Content { + text = talk.Content + } + + talks = append(talks, ©Talk{ + textType: talk.GetTextType(), + content: text, + }) + } + + return +} + +func (s *Store) createPush(cpn *model.FissionCampaign) (err error) { + var add []*model.FissionCampaignPush + if s.Req.GetPush().GetTaskReset().GetOpen() == mtype.Yes { + cond, _ := jsonm.ToSliceString(s.Req.GetPush().GetTaskReset().GetPushCond()) + add = append(add, &model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkTaskReset, + Cond: cond, + Open: mtype.Yes, + }) + } + + if s.Req.GetPush().GetActive().GetOpen() == mtype.Yes { + cond, _ := jsonm.ToSliceString(s.Req.GetPush().GetActive().GetPushCond()) + add = append(add, withdefault.FissionCampaignPush(&model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkActive, + Cond: cond, + Open: mtype.Yes, + })) + } + + if s.Req.GetPush().GetOffline().GetOpen() == mtype.Yes { + cond, _ := jsonm.ToSliceString(s.Req.GetPush().GetOffline().GetPushCond()) + add = append(add, &model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkOffline, + Cond: cond, + Open: mtype.Yes, + }) + } + + if s.Req.GetPush().GetVisit().GetOpen() == mtype.Yes { + add = append(add, &model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkVisit, + Cond: "{}", + Open: mtype.Yes, + }) + } + + if len(add) > 0 { + err = s.GetDao().FissionCampaignPush.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 其他形式的奖品追加 +func (s *Store) _otherAppendReward(reward *model.FissionCampaignReward) { + if _, ok := s.otherRelateMap[reward.RewardID]; !ok && reward.RewardID > 0 { + s.otherRelateMap[reward.RewardID] = struct{}{} + s.otherRelateIds = append(s.otherRelateIds, reward.RewardID) + } + + s.otherReward = append(s.otherReward, withdefault.FissionCampaignReward(reward)) +} + +func (s *Store) createChild(cpn *model.FissionCampaign) (err error) { + if len(s.Req.GetChild()) == 0 { + return + } + + var hashIds []string + for _, child := range s.Req.GetChild() { + if child.GetHashId() == "" { + continue + } + hashIds = append(hashIds, child.GetHashId()) + } + + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.Ctx).Where(m.HashID.In(hashIds...), m.Target.Eq(mtype.FissionCampaignConfigTargetChild), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + var add []*model.FissionCampaignChild + for _, v := range list { + if v.Pid > 0 { + continue + } + + add = append(add, withdefault.FissionCampaignChild(&model.FissionCampaignChild{ + CampaignID: cpn.ID, + ChildID: v.ID, + Type: v.ChildType, + })) + + var status = v.Status + + var start, end int64 + if v.TStart > 0 { + start = timez.GMT(v.TStart, cpn.TOffset) + if start >= time.Now().Unix() { + status = mtype.FissionCampaignStatusPub + } + } + + if v.TEnd > 0 { + end = timez.GMT(v.TEnd, cpn.TOffset) + if end <= time.Now().Unix() { + status = mtype.FissionCampaignStatusCancel + } + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(v.ID)).UpdateSimple( + m.StartTime.Value(start), + m.EndTime.Value(end), + m.Pid.Value(cpn.ID), + m.Status.Value(status), + m.TOffset.Value(cpn.TOffset), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = cm.AnalyzeCampaign(v.ProjectID, v.ID, start, end, 0) + if err != nil { + return + } + + } + + err = s.GetDao().FissionCampaignChild.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 创建活动样式配置 +func (s *Store) _createStyle(cpn *model.FissionCampaign) (err error) { + // 一般配置 + var reqConf = s.Req.GetConfig() + + style := withdefault.FissionCampaignStyle(&model.FissionCampaignStyle{ + CampaignID: cpn.ID, + RuleTextColor: reqConf.GetRuleTextColor(), + RuleBgColor: reqConf.GetRuleBgColor(), + ShareText: reqConf.GetShareText(), + ShareImg: reqConf.GetShareImg(), + RankBackgroundColor: reqConf.GetRankBackgroundColor(), + RankTextColor: reqConf.GetRankTextColor(), + LinkBtnTextColor: reqConf.GetLinkBtnTextColor(), + LinkBtnBgColor: reqConf.GetLinkBtnBgColor(), + LinkTextColor: reqConf.GetLinkTextColor(), + PageTitle: reqConf.GetPageTitle(), + IconType: int8(reqConf.GetIconType()), + IconBgColor: reqConf.GetIconBgColor(), + MainImg: reqConf.GetImageMain(), + WechatImg: reqConf.GetWechatPageImage(), + DownloadImg: reqConf.GetDownloadPageImage(), + WebImg: reqConf.GetWebBgImg(), + Share: "", + WarmUpImg: reqConf.GetWarmUpImg(), + WarmUpEnd: reqConf.GetWarmUpEnd(), + DlBannerImg: reqConf.GetDlBannerImg(), + DlBannerAppLogo: reqConf.GetDlBannerAppLogo(), + DlBannerAppName: reqConf.GetDlBannerAppName(), + DlBannerAppBtn: reqConf.GetDlBannerAppBtn(), + DlBannerPosition: int8(reqConf.GetDlBannerPosition()), + TopicColor: reqConf.GetTopicColor(), + IconOpen: "", + PcBg: reqConf.GetPcBg(), + CustomStyle: "", + PlayRule: reqConf.GetPlayRule(), + RuleImg: reqConf.GetRuleImg(), + BgImg: reqConf.GetImagePreview(), + IconTextColor: reqConf.GetIconTextColor(), + }) + + if reqConf.GetShare() != nil { + style.SetShare(reqConf.GetShare()) + } + + if reqConf.GetIconOpen() != nil { + style.SetIconOpen(reqConf.GetIconOpen()) + } + + switch cpn.FissionID { + case consts.IdPrizeWheel: + custom := s.Req.GetWheelStyle() + style.SetWheelStyle(mtype.WheelStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + Bottom1: custom.GetBottom1(), + Bottom2: custom.GetBottom2(), + Bottom3: custom.GetBottom3(), + Pointer: custom.GetPointer(), + PlayBtn: custom.GetPlayBtn(), + BorderImg: custom.GetBorderImg(), + ButtonColor: custom.GetButtonColor(), + WheelTextColor: custom.GetWheelTextColor(), + }) + case consts.IdLuckyGrid: + custom := s.Req.GetGridStyle() + style.SetGridStyle(mtype.GridStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + ButtonColor: custom.GetButtonColor(), + PlayImg: custom.GetPlayImg(), + DisablePlayImg: custom.GetDisablePlayImg(), + MachineImg: custom.GetMachineImg(), + GridImg: custom.GetGridImg(), + ActivateImg: custom.GetActivateImg(), + }) + case consts.IdFlip: + custom := s.Req.GetFlipStyle() + style.SetFlipStyle(mtype.FlipStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + ButtonColor: custom.GetButtonColor(), + PlayImg: custom.GetPlayImg(), + CardImg: custom.GetCardImg(), + }) + case consts.IdGashapon: + custom := s.Req.GetGashaponStyle() + + style.SetGashaponStyle(mtype.GashaponStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + MachineImg: custom.GetMachineImg(), + PlayImg: custom.GetPlayImg(), + EggType: custom.GetEggType(), + EggImgs: custom.GetEggImgs(), + }) + } + + err = s.GetDao().FissionCampaignStyle.WithContext(s.Ctx).Create(style) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Store) _createGold(cpn *model.FissionCampaign) (err error) { + gold := s.Req.GetGold() + + if gold == nil { + return s.BE().VerifyError("please set gold") + } + + conf := withdefault.FissionCampaignGold(&model.FissionCampaignGold{ + CampaignID: cpn.ID, + GoldNum: gold.GetGoldNum(), + ExpiredDay: gold.GetExpiredDay(), + Price: gold.GetPrice(), + PriceNum: gold.GetPriceNum(), + Currency: int8(gold.GetCurrency()), + }) + + m := s.GetDao().FissionCampaignGold + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) _createCoin(cpn *model.FissionCampaign) (err error) { + coin := s.Req.GetCoin() + + if coin == nil { + return s.BE().VerifyError("please set coin") + } + + lackBtn, _ := jsonm.ToSliceString(coin.GetLackBtn()) + conf := withdefault.FissionCampaignCoin(&model.FissionCampaignCoin{ + CampaignID: cpn.ID, + CoinImg: coin.GetCoinImg(), + OpenDays: coin.GetOpenDays(), + OpenLimit: coin.GetOpenLimit(), + InitCoin: coin.GetInitCoin(), + InitUse: coin.GetInitUse(), + UseCoin: coin.GetUseCoin(), + UseLimit: coin.GetUseLimit(), + URLID: coin.GetUrlId(), + LackBtn: lackBtn, + CustomBtnText: coin.GetCustomBtnText(), + CustomWebURL: coin.GetCustomWebUrl(), + CustomExtraParam: coin.GetCustomExtraParam(), + CustomPcParam: coin.GetCustomPcParam(), + }) + + m := s.GetDao().FissionCampaignCoin + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + _, dayStart, _ := timez.GMTStartAndEndTs(cpn.TOffset, cpn.StartTime) + _, nowStart, _ := timez.GMTStartAndEndTs(cpn.TOffset) + if dayStart < nowStart { + dayStart = nowStart + } + + openTime := dayStart + int64(coin.OpenDays*consts.DaySec) + rewardTime := openTime + consts.DaySec + + scene := withdefault.FissionCoinScene(&model.FissionCoinScene{ + CampaignID: cpn.ID, + OpenTime: openTime, + InitCoin: coin.GetInitCoin(), + InitUse: coin.GetInitUse(), + RewardTime: rewardTime, + }) + + if err = s.GetDao().FissionCoinScene.WithContext(s.Ctx).Create(scene); err != nil { + return s.BE().MysqlError(err) + } + + if !verify.InArray[int32](mtype.FissionCampaignCoinLackBtnCustom, coin.GetLackBtn()...) { + return + } + + customBtn := withdefault.FissionCustomBtn(&model.FissionCustomBtn{ + CampaignID: cpn.ID, + BtnText: coin.GetCustomBtnText(), + }) + + if err = s.GetDao().FissionCustomBtn.WithContext(s.Ctx).Create(customBtn); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) _copyImg(cpnId, copyId, langId int64) (imgs []*model.FissionCampaignLongImg, zones []*model.FissionCampaignLongImgZone, err error) { + + if len(s.Req.GetLongImgs()) == 0 { + return + } + + newImgs := s.Req.GetLongImgs() + + m := s.GetDao().FissionCampaignLongImg + oldImgs, err := m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(copyId), + m.LangID.Eq(0), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[string]*model.FissionCampaignLongImg, len(oldImgs)) + for _, v := range oldImgs { + oldMap[v.ImgURL] = v + } + + langImgs, err := m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(copyId), + m.LangID.Eq(langId), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var langMap = make(map[int64]*model.FissionCampaignLongImg, len(langImgs)) + for _, v := range langImgs { + + if v.LangSourceID > 0 { + langMap[v.LangSourceID] = v + + continue + } + + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: cpnId, + LangID: 0, + ClickType: v.ClickType, + ImgURL: v.ImgURL, + WebURL: v.WebURL, + AppParam: v.AppParam, + PcParam: v.PcParam, + TargetType: v.TargetType, + TargetID: v.TargetID, + }) + + if v.ClickType == mtype.FissionCampaignLongImgClickTypeZone { + zoneM := s.GetDao().FissionCampaignLongImgZone + + var oldZones []*model.FissionCampaignLongImgZone + oldZones, err = zoneM.WithContext(s.Ctx).Where(zoneM.CampaignID.Eq(copyId), zoneM.ImgID.Eq(v.ID), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, hotZone := range oldZones { + zones = append(zones, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: cpnId, + ImgID: one.ID, + WebURL: hotZone.WebURL, + AppParam: hotZone.AppParam, + PcParam: hotZone.PcParam, + ClickX: hotZone.ClickX, + ClickY: hotZone.ClickY, + ClickH: hotZone.ClickH, + ClickW: hotZone.ClickW, + TargetType: hotZone.TargetType, + TargetID: hotZone.TargetID, + })) + } + } + + } + + for _, v := range newImgs { + + copyImg, ok := oldMap[v.GetImgUrl()] + if !ok { + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: cpnId, + LangID: 0, + LangSourceID: s.langSourceMap[v.GetImgUrl()], + ClickType: int8(v.GetClickType()), + ImgURL: v.GetImgUrl(), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + PcParam: v.GetPcParam(), + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + }) + + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zones = append(zones, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: cpnId, + ImgID: one.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + })) + } + } + + imgs = append(imgs, one) + + continue + } + + old, ok := langMap[copyImg.ID] + if !ok { + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: cpnId, + LangID: 0, + LangSourceID: s.langSourceMap[v.GetImgUrl()], + ClickType: int8(v.GetClickType()), + ImgURL: v.GetImgUrl(), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + PcParam: v.GetPcParam(), + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + }) + + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zones = append(zones, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: cpnId, + ImgID: one.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + })) + } + } + + imgs = append(imgs, one) + + continue + } + + var targetType = old.TargetType + var targetId = old.TargetID + + if old.TargetID != v.GetTargetId() { + targetType = int8(v.GetTargetType()) + targetId = v.GetTargetId() + } + + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: cpnId, + LangID: 0, + LangSourceID: s.langSourceMap[v.GetImgUrl()], + ClickType: int8(v.GetClickType()), + ImgURL: old.ImgURL, + WebURL: old.WebURL, + AppParam: old.AppParam, + PcParam: old.PcParam, + TargetType: targetType, + TargetID: targetId, + }) + + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + + switch old.ClickType { + case mtype.FissionCampaignLongImgClickTypeZone: + zoneM := s.GetDao().FissionCampaignLongImgZone + + var oldZones []*model.FissionCampaignLongImgZone + oldZones, err = zoneM.WithContext(s.Ctx).Where(zoneM.CampaignID.Eq(copyId), zoneM.ImgID.Eq(old.ID), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, hotZone := range oldZones { + zones = append(zones, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: cpnId, + ImgID: one.ID, + WebURL: hotZone.WebURL, + AppParam: hotZone.AppParam, + PcParam: hotZone.PcParam, + ClickX: hotZone.ClickX, + ClickY: hotZone.ClickY, + ClickH: hotZone.ClickH, + ClickW: hotZone.ClickW, + TargetType: hotZone.TargetType, + TargetID: hotZone.TargetID, + })) + } + + case mtype.FissionCampaignLongImgClickTypeAll: + for _, hotZone := range v.GetHotZone() { + zones = append(zones, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: cpnId, + ImgID: one.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + })) + } + } + } + + } + + return +} + +func (s *Store) _createPointsUse(cpn *model.FissionCampaign) (err error) { + req := s.Req.GetPointsUse() + if req.GetOpen() != mtype.Yes { + return + } + + pointUse := withdefault.FissionCampaignPointsUse(&model.FissionCampaignPointsUse{ + CampaignID: cpn.ID, + Icon: req.GetIcon(), + URLID: req.GetUrlId(), + UseNum: req.GetUseNum(), + DayLimit: req.GetDayLimit(), + TotalLimit: req.GetTotalLimit(), + }) + + err = s.GetDao().FissionCampaignPointsUse.WithContext(s.Ctx).Create(pointUse) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Store) _createChat(cpn *model.FissionCampaign) (err error) { + req := s.Req.GetChat() + if req.GetOpen() != mtype.Yes { + return + } + + chat := withdefault.FissionCampaignChat(&model.FissionCampaignChat{ + CampaignID: cpn.ID, + HeaderImg: req.GetHeaderImg(), + ChatBg: req.GetChatBg(), + DayLimit: req.GetDayLimit(), + }) + + err = s.GetDao().FissionCampaignChat.WithContext(s.Ctx).Create(chat) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Store) _createVs(cpn *model.FissionCampaign) (err error) { + vs := s.Req.GetVs() + + conf := withdefault.FissionCampaignVs(&model.FissionCampaignV{ + CampaignID: cpn.ID, + InitChance: vs.GetInitChance(), + EachLimitNum: vs.GetEachLimitNum(), + OpenPoint: int8(vs.GetOpenPoint()), + PointsNum: vs.GetPointsNum(), + MallOpen: int8(vs.GetMallOpen()), + MallID: vs.GetMallId(), + VsTz: vs.GetVsTz(), + ClaimType: int8(vs.GetClaimType()), + IconMall: vs.GetIconMall(), + IconReward: vs.GetIconReward(), + IconSchedule: vs.GetIconSchedule(), + }) + + m := s.GetDao().FissionCampaignV + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + err = s.BE().MysqlError(err) + return + } + + var emptyId int64 = -1 + var schedules []*model.FissionCampaignVsSchedule + var teams []*model.FissionCampaignVsTeam + for i, v := range vs.GetSchedules() { + for _, pk := range v.GetPkTeams() { + + var vsTeamIds []int64 + for _, team := range pk.GetTeams() { + + if team.GetName() == "" && team.GetLogoImg() == "" { + vsTeamIds = append(vsTeamIds, emptyId) + emptyId-- + continue + } + + one := withdefault.FissionCampaignVsTeam(&model.FissionCampaignVsTeam{ + CampaignID: cpn.ID, + Name: team.GetName(), + LogoImg: team.GetLogoImg(), + }) + + vsTeamIds = append(vsTeamIds, one.ID) + teams = append(teams, one) + } + + var rewardNum int32 = 1 + if pk.GetPropMark() == mtype.FissionCampaignRewardPropMarkPoint { + rewardNum = pk.GetPropNum() + } + + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: -1, + RewardType: mtype.FissionCampaignRewardTypeApp, + RewardNum: rewardNum, + RewardID: pk.GetRewardId(), + PropMark: pk.GetPropMark(), + ExpiredDay: pk.GetExpiredDay(), + }) + + voteStart, _ := timez.YmdHiParse(pk.GetVoteStart(), vs.GetVsTz()) + voteEnd, _ := timez.YmdHiParse(pk.GetVoteEnd(), vs.GetVsTz()) + vsAt, _ := timez.YmdHiParse(pk.GetVsDate(), vs.GetVsTz()) + + schedules = append(schedules, withdefault.FissionCampaignVsSchedule(&model.FissionCampaignVsSchedule{ + CampaignID: cpn.ID, + VsIdx: int32(i), + RewardID: rewardId, + VsTeamIds: "", + VoteStart: voteStart.Unix(), + VoteEnd: voteEnd.Unix(), + VsAt: vsAt.Unix(), + VsImg: pk.GetVsImg(), + Desc: pk.GetDesc(), + OpenOdds: int8(pk.GetOpenOdds()), + OddsLeft: pk.GetOddsLeft(), + OddsRight: pk.GetOddsRight(), + OddsDraw: pk.GetOddsDraw(), + }, vsTeamIds, pk.GetOtherVote())) + } + } + + if err = s.GetDao().FissionCampaignVsSchedule.WithContext(s.Ctx).Create(schedules...); err != nil { + err = s.BE().MysqlError(err) + return + } + + if err = s.GetDao().FissionCampaignVsTeam.WithContext(s.Ctx).Create(teams...); err != nil { + err = s.BE().MysqlError(err) + return + } + + if vs.GetMallOpen() == mtype.No { + return + } + + relate, err := malls.NewRelate(s.Ctx, cpn.ID, s.GetDao().FissionCampaign.TableName(), logic.WithDao(s.GetDao())) + if err != nil { + return + } + + return relate.Related(mtype.RedeemMallRelateSourceCampaign, vs.GetMallId()) +} + +func (s *Store) _createUno(cpn *model.FissionCampaign) (err error) { + uno := s.Req.GetUno() + + conf := withdefault.FissionCampaignUno(&model.FissionCampaignUno{ + CampaignID: cpn.ID, + InitChance: uno.GetInitChance(), + }, uno.GetPropMarks()) + + m := s.GetDao().FissionCampaignUno + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + err = s.BE().MysqlError(err) + return + } + + var groups []*model.FissionCampaignUnoGroup + var cards []*model.FissionCampaignUnoCard + + var fn = func(mark string, unoG *pb.StoreReq_UnoGroup) { + + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeApp, + RewardID: unoG.GetReward().GetRewardId(), + Stock: unoG.GetReward().GetStock(), + }) + + group := withdefault.FissionCampaignUnoGroup(&model.FissionCampaignUnoGroup{ + CampaignID: cpn.ID, + Mark: mark, + Odds: unoG.GetOdds(), + RewardID: rewardId, + OpenRule: int8(unoG.GetOpenRule()), + LimitRule: "", + CustomCard: int8(unoG.GetCustomCard()), + }, mtype.UnoLimitRule{ + InitNum: unoG.GetLimitRule().GetInitNum(), + SignDay: unoG.GetLimitRule().GetSignDay(), + AddNum: unoG.GetLimitRule().GetAddNum(), + ResetType: unoG.GetLimitRule().GetResetType(), + }) + + groups = append(groups, group) + + if unoG.GetCustomCard() == mtype.No { + return + } + + for i, card := range unoG.GetCards() { + cards = append(cards, withdefault.FissionCampaignUnoCard(&model.FissionCampaignUnoCard{ + CampaignID: cpn.ID, + Mark: mark, + CardNo: int32(i) + 1, + Title: card.GetTitle(), + ImgURL: card.GetImgUrl(), + WebURL: card.GetWebUrl(), + AppParam: card.GetAppParam(), + PcParam: card.GetPcParam(), + })) + } + } + + fn(mtype.FissionCampaignUnoGroupRed, uno.GetRed()) + fn(mtype.FissionCampaignUnoGroupYellow, uno.GetYellow()) + fn(mtype.FissionCampaignUnoGroupBlue, uno.GetBlue()) + fn(mtype.FissionCampaignUnoGroupGreen, uno.GetGreen()) + + if len(groups) > 0 { + if err = s.GetDao().FissionCampaignUnoGroup.WithContext(s.Ctx).Create(groups...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(cards) > 0 { + if err = s.GetDao().FissionCampaignUnoCard.WithContext(s.Ctx).Create(cards...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Store) createEvent(cpn *model.FissionCampaign) (err error) { + events := s.Req.GetEvent() + + var add []*model.FissionCampaignEvent + + if event := events.GetFirstVisit(); event.GetOpen() == mtype.Yes { + var rewards = make([]*mtype.EventReward, 0, len(event.GetRewards())) + for _, reward := range event.GetRewards() { + switch reward.GetPropMark() { + case mtype.FissionCampaignRewardPropMarkReward: + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: reward.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeCampaignEvent, + RewardNum: 1, + RewardID: reward.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + + rewards = append(rewards, &mtype.EventReward{ + Id: hashid.IdBigint(), + PropMark: reward.GetPropMark(), + RewardId: rewardId, + }) + case mtype.FissionCampaignRewardPropMarkPoint: + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: -1, + RewardType: mtype.FissionCampaignRewardTypeCampaignEvent, + RewardNum: reward.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: reward.GetExpiredDay(), + }) + rewards = append(rewards, &mtype.EventReward{ + Id: hashid.IdBigint(), + PropMark: reward.GetPropMark(), + RewardId: rewardId, + Chance: reward.GetChance(), + }) + case mtype.FissionCampaignRewardPropMarkChance: + rewards = append(rewards, &mtype.EventReward{ + Id: hashid.IdBigint(), + PropMark: reward.GetPropMark(), + Chance: reward.GetChance(), + }) + } + } + + add = append(add, withdefault.FissionCampaignEvent(&model.FissionCampaignEvent{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignEventMarkFirstVisit, + Open: mtype.Yes, + }, rewards)) + } + + if len(add) > 0 { + err = s.GetDao().FissionCampaignEvent.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Store) _createGashapon(cpn *model.FissionCampaign) (err error) { + gashapon := s.Req.GetGashapon() + + if gashapon == nil { + return s.BE().VerifyError("please set gashapon") + } + + conf := withdefault.FissionCampaignGashapon(&model.FissionCampaignGashapon{ + CampaignID: cpn.ID, + InitChance: gashapon.GetInitChance(), + DayChance: gashapon.GetDayChance(), + }) + + m := s.GetDao().FissionCampaignGashapon + + if err = m.WithContext(s.Ctx).Create(conf); err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) createRewardAdd(cpn *model.FissionCampaign) (err error) { + var list = make([]*model.FissionCampaignRewardAdd, 0, len(s.rewardAdd)) + for id, add := range s.rewardAdd { + + if add.GetOpen() == mtype.No { + continue + } + + list = append(list, withdefault.FissionCampaignRewardAdd(&model.FissionCampaignRewardAdd{ + CampaignID: cpn.ID, + RewardID: id, + Start: timez.GMT(add.GetStart(), cpn.TOffset), + End: timez.GMT(add.End, cpn.TOffset), + DayNum: add.GetDayNum(), + DayAdd: add.GetDayAdd(), + })) + + } + + if len(list) == 0 { + return + } + + err = s.GetDao().FissionCampaignRewardAdd.WithContext(s.Ctx).Create(list...) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Store) createRewardTask(cpn *model.FissionCampaign) (err error) { + var conds = make([]*model.FissionCampaignCond, 0, len(s.rewardTask)) + var tasks = make([]*model.FissionCampaignTask, 0, len(s.rewardTask)) + for id, add := range s.rewardTask { + + if add.GetOpen() == mtype.No { + continue + } + + one := withdefault.FissionCampaignCond(&model.FissionCampaignCond{ + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: add.GetEvent(), + EventKey: add.GetEventKey(), + EventVal: add.GetEventVal(), + IfCond: int8(add.GetIfCond()), + TriggetType: int8(add.GetTriggerType()), + EventType: int8(add.GetEventType()), + OpenPush: int8(add.GetOpenPush()), + RewardID: id, + }) + + conds = append(conds, one) + + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(one.ID), + PropMark: mtype.FissionCampaignTaskPropMarkUnlockReward, + Num: 1, + Chance: 1, + RewardID: id, + })) + } + + if len(conds) == 0 { + return + } + + err = s.GetDao().FissionCampaignCond.WithContext(s.Ctx).Create(conds...) + if err != nil { + return s.BE().MysqlError(err) + } + + err = s.GetDao().FissionCampaignTask.WithContext(s.Ctx).Create(tasks...) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} diff --git a/internal/service/containers/campaign/update.go b/internal/service/containers/campaign/update.go new file mode 100644 index 0000000..dd6ea8f --- /dev/null +++ b/internal/service/containers/campaign/update.go @@ -0,0 +1,6814 @@ +package campaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" + "time" + + dlinkpb "gits.branchcn.com/backend/deeplink/proto/go_proto/dlink" + "gits.branchcn.com/backend/microcode/plugins/derivative/vercontrol" + "gorm.io/gen/field" +) + +type Update struct { + logic.Logic + Req *pb.UpdateReq + Res *pb.UpdateRes + + justUpdatePart bool // 只能更新部分数据数据 + + // 统计任务结束时间修改,统计任务的达标条件统计要删除,统计任务的达标条件统计要添加,修改了进行中活动的监听方式 + taskEndChange, taskCondDel, taskCondAdd bool + + helpInstall, helpRegister, helpOpen, helpClick bool + + otherReward []*model.FissionCampaignReward + otherRelateIds []int64 + otherRelateMap map[int64]struct{} + + changeTemp bool + + rewardAdd map[int64]*pb.UpdateReq_OpenAdd + rewardTask map[int64]*pb.UpdateReq_RewardTask +} + +func (s *Update) Run() error { + return logic.Run(s) +} + +func (s *Update) Exec() (err error) { + cpn, err := s.update() + if err != nil { + return + } + + err = s.updateConfig(cpn) + if err != nil { + return + } + + err = s.updateFission(cpn) + if err != nil { + return + } + + err = s.updateEvent(cpn) + if err != nil { + return + } + + err = s.updateReward(cpn) + if err != nil { + return + } + + err = s.updateRewardAdd(cpn) + if err != nil { + return + } + + err = s.updateRewardTask(cpn) + if err != nil { + return + } + + err = s.updateTask(cpn) + if err != nil { + return + } + + err = s.updatePush(cpn) + if err != nil { + return + } + + err = s.updateChild(cpn) + if err != nil { + return + } + + err = s.syncEvent(cpn) + if err != nil { + return + } + + err = s.syncLinkTemp(cpn) + if err != nil { + return + } + + err = s.saveDelayLinkData(cpn) + if err != nil { + return + } + + return +} + +// 更新活动数据 +func (s *Update) update() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + return nil, s.BE().MysqlError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("nof found campaign") + } + + s.otherRelateMap = make(map[int64]struct{}) + s.rewardAdd = make(map[int64]*pb.UpdateReq_OpenAdd) + s.rewardTask = make(map[int64]*pb.UpdateReq_RewardTask) + + var endTime = timez.GMT(s.Req.GetEndTime(), s.Req.GetTOffset()) + m := s.GetDao().FissionCampaign + var data = []field.AssignExpr{ + m.Title.Value(s.Req.GetTitle()), + m.TEnd.Value(s.Req.GetEndTime()), + m.EndTime.Value(endTime), + } + + // 待发布状态可以更新的数据 + if cpn.Status == mtype.FissionCampaignStatusWait { + start := timez.GMT(s.Req.GetStartTime(), s.Req.GetTOffset()) + + data = append(data, + m.TOffset.Value(s.Req.GetTOffset()), + m.TStart.Value(s.Req.GetStartTime()), + m.StartTime.Value(start), + ) + + // 已经开始了活动 + if start <= time.Now().Unix() { + status := utils.Ternary[int8](s.Req.GetConfig().GetHasWhite() == mtype.Yes, mtype.FissionCampaignStatusPubPre, mtype.FissionCampaignStatusPub) + data = append(data, m.Status.Value(status)) + if cpn.FissionID == consts.IdDice { + s.AddAfterRun(func() (err error) { + producer.NewCampaignNotice(s.Ctx).CampaignDiceMap(types.CampaignDiceMap{CampaignId: cpn.ID}) + return + }) + } + } + } else if cpn.Status == mtype.FissionCampaignStatusPubPre { + // 正式发布 + if s.Req.GetConfig().GetHasWhite() == mtype.No { + data = append(data, m.Status.Value(mtype.FissionCampaignStatusPub)) + } + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(data...) + if err != nil { + return nil, s.BE().MysqlError(err) + } + + if endTime != cpn.EndTime { + s.taskEndChange = true + } + + s.justUpdatePart = cpn.Status != mtype.FissionCampaignStatusWait && + !verify.InArray[int64](cpn.FissionID, consts.IdKeep, consts.IdCoin, consts.IdVs, consts.IdUno) + + switch cpn.FissionID { + case consts.IdKeep: + invite := s.Req.GetKeepDog() + s.Req.TargetOption.Fixed = &pb.UpdateReq_Fixed{ + Open: invite.GetOpenInvite(), + AppEvent: invite.GetInvite().GetInviteType(), + TargetNum: 1, + Chance: invite.GetInvite().GetInviteGet(), + Percent: 0, + } + case consts.IdPrizeAnswer: + s.Req.TargetOption.Fixed = &pb.UpdateReq_Fixed{ + Open: 1, + AppEvent: 1, + TargetNum: s.Req.GetQuestionAnswer().GetTargetNum(), + Chance: s.Req.GetQuestionAnswer().GetChance(), + Percent: 0, + } + case consts.IdPrizeQuiz: + s.Req.TargetOption.Fixed = &pb.UpdateReq_Fixed{ + Open: 1, + AppEvent: 1, + TargetNum: s.Req.GetQuiz().GetTargetNum(), + Chance: s.Req.GetQuiz().GetChance(), + Percent: 0, + } + } + + if !verify.InArray[int64](cpn.FissionID, consts.IdReferral, consts.IdWinTogether) { + if s.Req.TargetOption != nil && s.Req.TargetOption.Custom != nil { + s.Req.TargetOption.Custom.PreEvent = 0 + } + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = cpn.ID + s.Res.HashId = cpn.HashID + + _ = cache.NewCampaign(s.Ctx).Clear(cpn) + + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).CampaignSave(cpn.ID, s.Req) + + return + }) + + return +} + +// 默认的封面图 +func (s *Update) _defaultCoverUrl(tempId int64) (url string, err error) { + temp, err := cache.NewFissionTemp(s.Ctx).FindById(tempId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if temp == nil { + return + } + + group, err := cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return group.CoverURL, err +} + +// 更新配置 +func (s *Update) updateConfig(cpn *model.FissionCampaign) (err error) { + cc := cache.NewCampaignConfig(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + cf := s.Req.GetConfig() + m := s.GetDao().FissionCampaignConfig + + var data = []field.AssignExpr{ + m.RuleTextColor.Value(cf.GetRuleTextColor()), + m.RuleBgColor.Value(cf.GetRuleBgColor()), + m.ShareText.Value(cf.GetShareText()), + m.ShareImg.Value(cf.GetShareImg()), + m.HasRank.Value(int8(cf.GetHasRank())), + m.RankBackgroundColor.Value(cf.GetRankBackgroundColor()), + m.RankTextColor.Value(cf.GetRankTextColor()), + m.DownloadPageImage.Value(cf.GetDownloadPageImage()), + m.IsDefaultDownload.Value(int8(cf.GetIsDefaultDownload())), + m.WechatPageImage.Value(cf.GetWechatPageImage()), + m.IsDefaultWechat.Value(int8(cf.GetIsDefaultWechat())), + m.ImageMain.Value(cf.GetImageMain()), + m.IsDefaultMain.Value(int8(cf.GetIsDefaultMain())), + m.ImagePreview.Value(cf.GetImagePreview()), + m.LinkBtnTextColor.Value(cf.GetLinkBtnTextColor()), + m.LinkBtnBgColor.Value(cf.GetLinkBtnBgColor()), + m.LinkTextColor.Value(cf.GetLinkTextColor()), + m.ShowShare.Value(int8(cf.GetShowShare())), + m.PageTitle.Value(cf.GetPageTitle()), + m.DmShow.Value(int8(cf.GetDmShow())), + m.WebBgImg.Value(cf.GetWebBgImg()), + m.IconType.Value(int8(cf.GetIconType())), + m.IconBgColor.Value(cf.GetIconBgColor()), + m.DlType.Value(int8(cf.GetDlType())), + m.DlBannerType.Value(int8(cf.GetDlBannerType())), + m.DlBannerImg.Value(cf.GetDlBannerImg()), + m.DlBannerAppLogo.Value(cf.GetDlBannerAppLogo()), + m.DlBannerAppName.Value(cf.GetDlBannerAppName()), + m.DlBannerAppBtn.Value(cf.GetDlBannerAppBtn()), + m.DlBannerPosition.Value(int8(cf.GetDlBannerPosition())), + m.TopicColor.Value(cf.GetTopicColor()), + m.WindowCover.Value(int8(cf.GetWindowCover())), + m.PlayRule.Value(cf.GetPlayRule()), + m.HasLongImg.Value(utils.Ternary[int8](len(s.Req.GetLongImgs()) > 0, mtype.Yes, mtype.No)), + m.HasWhite.Value(int8(cf.GetHasWhite())), + m.WhiteList.Value(cf.GetWhiteList()), + m.PcBg.Value(cf.GetPcBg()), + m.LinkTempID.Value(cf.GetLinkTempId()), + m.RuleTimeOpen.Value(int8(cf.GetRuleTimeOpen())), + m.OutsideTask.Value(int8(cf.GetOutsideTask())), + m.OpenShare.Value(utils.Ternary[int8](verify.InArray[int64](cpn.FissionID, + consts.IdSignIn, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo, consts.IdPrizeQuiz, consts.IdPrizeAnswer), int8(cf.GetOpenShare()), 1)), + m.ShowToUse.Value(int8(cf.GetShowToUse())), + m.PointsUse.Value(int8(s.Req.GetPointsUse().GetOpen())), + m.OpenChat.Value(int8(s.Req.GetChat().GetOpen())), + m.RuleType.Value(int8(cf.GetRuleType())), + m.RuleOutside.Value(int8(cf.GetRuleOutside())), + m.DeviceOnce.Value(int8(cf.GetDeviceOnce())), + } + + defer func() { + if err != nil { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.changeTemp = conf.LinkTempID != cf.GetLinkTempId() + + s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignConfig(s.Ctx).Clear(conf) + return + }) + + }() + + // 更新长图 + err = s._updateLongImg(conf) + if err != nil { + return + } + + // 更新样式 + err = s._updateStyle(cpn) + if err != nil { + return + } + + err = s._updatePointsUse(cpn) + if err != nil { + return + } + + err = s._updateChat(cpn) + if err != nil { + return + } + + // 社媒分享 + share, _ := jsonm.MarshalToString(cf.GetShare()) + data = append(data, m.Share.Value(share)) + + // 开启的挂件 + iconOpen, _ := jsonm.MarshalToString(cf.GetIconOpen()) + data = append(data, m.IconOpen.Value(iconOpen)) + + // link_data + var kvData []*mtype.KV + for _, v := range s.Req.GetCampaignData() { + kvData = append(kvData, &mtype.KV{ + Key: v.Key, + Value: v.Value, + }) + } + + kv, _ := jsonm.MarshalToString(kvData) + data = append(data, m.CampaignData.Value(kv)) + + ads, err := cache.NewProjectAd(s.Ctx).FindByProjectId(cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if ads != nil && ads.OpenAd == mtype.Yes && conf.AdsType != int8(cf.GetAdsType()) { + data = append(data, m.AdsType.Value(int8(cf.GetAdsType()))) + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).UpdateCampaignAdsType(cpn.ID, conf.AdsType, int8(cf.GetAdsType())) + } + + // 活动进行中的数据修改 + if s.justUpdatePart { + + // 更新任务名称 + err = s._updateRunningCond(cpn) + if err != nil { + return + } + + return + } + + project, err := finder.Project(s.Ctx, cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + hasWeb := utils.Ternary(len(s.Req.GetRewardsWeb()) > 0 && project.Scene == mtype.ProjectSceneApp, int8(mtype.Yes), mtype.No) + data = append(data, + m.HasWeb.Value(hasWeb), + m.HasWarmUp.Value(int8(cf.GetHasWarmUp())), + m.WarmUpImg.Value(cf.GetWarmUpImg()), + m.WarmUpEnd.Value(cf.GetWarmUpEnd()), + ) + + // 重置短链接 + if conf.HasWeb != hasWeb { + userM := s.GetDao().FissionUser + _, err = userM.WithContext(s.Ctx).Where(userM.CampaignID.Eq(cpn.ID)).UpdateSimple(userM.ShareLink.Value("")) + if err != nil { + return + } + + userMS := s.GetDao().FissionUser.SubTable(cpn.ID) + _, err = userMS.WithContext(s.Ctx).Where(userMS.CampaignID.Eq(cpn.ID)).UpdateSimple(userMS.ShareLink.Value("")) + if err != nil { + return + } + } + + // 设置奖品的配置 + rewardData, err := s._setRewardConfig(cpn, conf.RewardGroup) + if err != nil { + return + } + data = append(data, rewardData...) + + // 处理活动目标 + if consts.NewEventCpn(cpn.FissionID) { + data = append(data, + m.Target.Value(int8(s.Req.GetTargetOption().GetTarget())), + m.AppEvent.Value(int8(s.Req.GetTargetOption().GetFixed().GetAppEvent())), + m.BothType.Value(int8(s.Req.GetTargetOption().GetCustom().GetBothType())), + ) + if s.Req.GetTargetOption().GetCustom().GetOpen() == mtype.Yes { + + option := utils.Ternary[int8]( + !verify.InArray[int64](cpn.FissionID, consts.IdWinTogether, consts.IdReferral), + mtype.FissionCampaignConfigTargetOptionTask, mtype.FissionCampaignConfigTargetOptionFriend) + + data = append(data, m.Option.Value(option)) + } else { + data = append(data, m.Option.Value(mtype.FissionCampaignConfigTargetOptionApp)) + } + + err = s._updateTargetOption(cpn) + if err != nil { + return + } + + return + } + + data = append(data, + m.Target.Value(int8(s.Req.GetTarget().GetTarget())), + m.AppEvent.Value(int8(s.Req.GetTarget().GetAppEvent())), + m.BothType.Value(int8(s.Req.GetTarget().GetBothType())), + m.Option.Value(int8(s.Req.GetTarget().GetOption())), + ) + + err = s._updateTargetCond(cpn) + if err != nil { + return + } + + // 以前是事件触发的内容,现在变成了非事件触发,就要把统计任务删掉 + if conf.Option != mtype.FissionCampaignConfigTargetOptionApp && s.Req.GetTarget().GetOption() == mtype.FissionCampaignConfigTargetOptionApp { + s.taskCondDel = true + } + + if conf.Option == mtype.FissionCampaignConfigTargetOptionApp && + verify.InArray(s.Req.GetTarget().GetOption(), + mtype.FissionCampaignConfigTargetOptionFriend, + mtype.FissionCampaignConfigTargetOptionUse, + mtype.FissionCampaignConfigTargetOptionSelf, + mtype.FissionCampaignConfigTargetOptionTask, + ) { + s.taskCondAdd = true + } + + return +} + +// 奖品配置 +func (s *Update) _setRewardConfig(cpn *model.FissionCampaign, oldRewardGroup int8) (data []field.AssignExpr, err error) { + + // 切换奖品类型,就要把站内的奖全删了 + if int32(oldRewardGroup) != s.Req.GetRewards().GetRewardGroup() { + m := s.GetDao().FissionCampaignReward + _, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + m.IsDel.Eq(mtype.No), + ).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + m := s.GetDao().FissionCampaignConfig + data = append(data, m.RewardGroup.Value(int8(s.Req.GetRewards().GetRewardGroup()))) + + switch s.Req.GetRewards().GetRewardGroup() { + case mtype.FissionRewardGroupLang: + var lang = finder.Lang{ + Default: mtype.FissionLangTypeToMark[cpn.GetLangTypes()[0]], + Support: make([]string, 0, len(s.Req.GetRewards().GetLangs())), + } + + for _, v := range s.Req.GetRewards().GetLangs() { + lang.Support = append(lang.Support, v.GetLangMark()) + } + + dft, spt := lang.DST() + data = append(data, m.DefaultRewardMark.Value(dft), m.SupportRewardMark.Value(spt)) + case mtype.FissionRewardGroupUserLevel: + var level = finder.Level{ + Default: s.Req.GetRewards().GetUserLevel().GetDefaultLevelId(), + Support: make([]int64, 0, len(s.Req.GetRewards().GetUserLevel().GetLevelList())), + } + + for _, v := range s.Req.GetRewards().GetUserLevel().GetLevelList() { + level.Support = append(level.Support, v.GetLevelId()) + } + + dft, spt := level.DST() + data = append(data, m.DefaultRewardMark.Value(dft), m.SupportRewardMark.Value(spt)) + + case mtype.FissionRewardGroupLangAndUserLevel: + var langLevel = finder.LangLevel{ + Default: make([]finder.DefaultLangLevel, 0, len(s.Req.GetRewards().GetLangUserLevel())), + Support: make([]finder.SupportLangLevel, 0, len(s.Req.GetRewards().GetLangUserLevel())), + } + + for _, v := range s.Req.GetRewards().GetLangUserLevel() { + langLevel.Default = append(langLevel.Default, finder.DefaultLangLevel{ + Lang: v.GetLangMark(), + Level: v.GetDefaultLevelId(), + }) + + one := finder.SupportLangLevel{ + Lang: v.GetLangMark(), + Level: make([]int64, 0, len(v.GetLevelList())), + } + for _, level := range v.GetLevelList() { + one.Level = append(one.Level, level.GetLevelId()) + } + + langLevel.Support = append(langLevel.Support, one) + } + dft, spt := langLevel.DST() + data = append(data, m.DefaultRewardMark.Value(dft), m.SupportRewardMark.Value(spt)) + + case mtype.FissionRewardGroupCountry: + var country = finder.Country{ + Default: s.Req.GetRewards().GetCountry().GetDefaultCountryMark(), + Support: make([]string, 0, len(s.Req.GetRewards().GetCountry().GetCountryList())), + } + + for _, v := range s.Req.GetRewards().GetCountry().GetCountryList() { + country.Support = append(country.Support, v.GetCountryMark()) + } + + dft, spt := country.DST() + data = append(data, m.DefaultRewardMark.Value(dft), m.SupportRewardMark.Value(spt)) + } + + // 更新等级关系 + err = s._updateLvRelated(cpn, oldRewardGroup) + if err != nil { + return + } + + return +} + +func (s *Update) _updateLvRelated(cpn *model.FissionCampaign, oldRewardGroup int8) (err error) { + m := s.GetDao().FissionUserLevelRelated + if verify.InArray(oldRewardGroup, mtype.FissionRewardGroupUserLevel, mtype.FissionRewardGroupLangAndUserLevel) && + !verify.InArray(s.Req.GetRewards().GetRewardGroup(), mtype.FissionRewardGroupUserLevel, mtype.FissionRewardGroupLangAndUserLevel) { + _, err = m.WithContext(s.Ctx). + Where(m.RelateID.Eq(cpn.ID), m.RelateTable.Eq(s.GetDao().FissionCampaign.TableName())). + UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + list, err := m.WithContext(s.Ctx).Where(m.RelateID.Eq(cpn.ID), m.RelateTable.Eq(s.GetDao().FissionCampaign.TableName())).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.FissionUserLevelRelated, len(list)) + for _, v := range list { + oldMap[v.LevelID] = v + } + + var add []*model.FissionUserLevelRelated + var cancelIds, orIds []int64 + + var fn = func(list []*pb.UpdateReq_UserLevelOne) { + for _, v := range list { + old, ok := oldMap[v.GetLevelId()] + if !ok { + add = append(add, withdefault.FissionUserLevelRelated(&model.FissionUserLevelRelated{ + LevelID: v.GetLevelId(), + RelateID: cpn.ID, + RelateTable: s.GetDao().FissionCampaign.TableName(), + CancelTime: 0, + })) + continue + } + + if old.CancelTime > 0 { + orIds = append(orIds, old.ID) + } + + delete(oldMap, v.GetLevelId()) + } + } + + switch s.Req.GetRewards().GetRewardGroup() { + case mtype.FissionRewardGroupUserLevel: + fn(s.Req.GetRewards().GetUserLevel().GetLevelList()) + case mtype.FissionRewardGroupLangAndUserLevel: + for _, v := range s.Req.GetRewards().GetLangUserLevel() { + fn(v.GetLevelList()) + } + } + + for _, v := range oldMap { + cancelIds = append(cancelIds, v.ID) + } + + if len(add) > 0 { + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(orIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(orIds...)).UpdateSimple(m.CancelTime.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(cancelIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(cancelIds...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 更新目标配置 +func (s *Update) _updateTargetOption(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignTicket + tickets, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + return + } + + var ticketMap = make(map[string]*model.FissionCampaignTicket, len(tickets)) + for _, ticket := range tickets { + ticketMap[ticket.Mark] = ticket + } + + taskM := s.GetDao().FissionCampaignTask + oldTasks, err := taskM.WithContext(s.Ctx).Where(taskM.CampaignID.Eq(cpn.ID), taskM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + var oldTaskMap = make(map[string]*model.FissionCampaignTask, len(oldTasks)) + for _, oldTask := range oldTasks { + oldTaskMap[oldTask.TaskMark] = oldTask + if oldTask.RewardID > 0 { + rewardIds = append(rewardIds, oldTask.RewardID) + } + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewardIds)) + rewardM := s.GetDao().FissionCampaignReward + if len(rewardIds) > 0 { + var rewards []*model.FissionCampaignReward + rewards, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, reward := range rewards { + rewardMap[reward.ID] = reward + } + } + + var addTicket []*model.FissionCampaignTicket + var tasks []*model.FissionCampaignTask + var addReward []*model.FissionCampaignReward + var delRewardIds []int64 + fixedAddTicket, fixedAddTask, err := s._updateTargetOptionFixed(cpn, ticketMap[mtype.FissionCampaignTicketFixed], oldTaskMap) + if err != nil { + return + } + addTicket = append(addTicket, fixedAddTicket...) + tasks = append(tasks, fixedAddTask...) + + customAddTicket, customAddTask, customAddReward, customDelRewardIds, err := s._updateTargetOptionCustom(cpn, ticketMap[mtype.FissionCampaignTicketCustom], oldTaskMap, rewardMap) + if err != nil { + return + } + + addTicket = append(addTicket, customAddTicket...) + tasks = append(tasks, customAddTask...) + addReward = append(addReward, customAddReward...) + delRewardIds = append(delRewardIds, customDelRewardIds...) + + if len(addTicket) > 0 { + err = m.WithContext(s.Ctx).Create(addTicket...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(tasks) > 0 { + err = taskM.WithContext(s.Ctx).Create(tasks...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(addReward) > 0 { + err = rewardM.WithContext(s.Ctx).Create(addReward...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(delRewardIds) > 0 { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(delRewardIds...)).UpdateSimple(rewardM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新邀请规则 +func (s *Update) _updateTargetOptionFixed(cpn *model.FissionCampaign, fixedTicket *model.FissionCampaignTicket, oldTaskMap map[string]*model.FissionCampaignTask) (addTicket []*model.FissionCampaignTicket, tasks []*model.FissionCampaignTask, err error) { + + var fixed = s.Req.GetTargetOption().GetFixed() + if fixedTicket == nil { + + if fixed.GetOpen() == mtype.No { + return + } + + addTicket = append(addTicket, withdefault.FissionCampaignTicket(&model.FissionCampaignTicket{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignTicketFixed, + Open: mtype.Yes, + AppEvent: int8(fixed.GetAppEvent()), + })) + + one := withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: 0, + TaskMark: "", + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: utils.Ternary[int32](verify.InArray(cpn.FissionID, consts.IdReferral, consts.IdWinTogether), 1, fixed.GetTargetNum()), + Chance: fixed.GetChance(), + ChanceLimit: fixed.GetChanceLimit(), + TaskLimit: 0, + Percent: fixed.GetPercent(), + }) + + switch fixed.GetAppEvent() { + case mtype.FissionCampaignTicketAppEventInstall: + one.TaskType = mtype.FissionCampaignTaskTypeInstall + one.TaskMark = mtype.FissionCampaignTaskMarkInstall + case mtype.FissionCampaignTicketAppEventRegister: + one.TaskType = mtype.FissionCampaignTaskTypeRegister + one.TaskMark = mtype.FissionCampaignTaskMarkRegister + } + + tasks = append(tasks, one) + + return + } + + if fixedTicket.Open == mtype.No && fixed.GetOpen() == mtype.No { + return + } + + taskM := s.GetDao().FissionCampaignTask + m := s.GetDao().FissionCampaignTicket + + _, err = m.WithContext(s.Ctx). + Where(m.ID.Eq(fixedTicket.ID)). + UpdateSimple( + m.Open.Value(int8(fixed.GetOpen())), + m.AppEvent.Value(int8(fixed.GetAppEvent())), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignTicket(s.Ctx).Clear(fixedTicket) + return + }) + + var task *model.FissionCampaignTask + switch fixedTicket.AppEvent { + case mtype.FissionCampaignTicketAppEventInstall: + task = oldTaskMap[mtype.FissionCampaignTaskMarkInstall] + case mtype.FissionCampaignTicketAppEventRegister: + task = oldTaskMap[mtype.FissionCampaignTaskMarkRegister] + } + + if task == nil { + + one := withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: 0, + TaskMark: "", + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: utils.Ternary[int32](verify.InArray(cpn.FissionID, consts.IdReferral, consts.IdWinTogether), 1, fixed.GetTargetNum()), + Chance: fixed.GetChance(), + ChanceLimit: fixed.GetChanceLimit(), + TaskLimit: 0, + Percent: fixed.GetPercent(), + }) + + switch fixed.GetAppEvent() { + case mtype.FissionCampaignTicketAppEventInstall: + one.TaskType = mtype.FissionCampaignTaskTypeInstall + one.TaskMark = mtype.FissionCampaignTaskMarkInstall + case mtype.FissionCampaignTicketAppEventRegister: + one.TaskType = mtype.FissionCampaignTaskTypeRegister + one.TaskMark = mtype.FissionCampaignTaskMarkRegister + } + + tasks = append(tasks, one) + + return + } + + var appEvent = utils.STernary(fixed.GetAppEvent(), 0, int32(fixedTicket.AppEvent)) + var taskType int8 + var taskMark string + switch appEvent { + case mtype.FissionCampaignTicketAppEventInstall: + taskType = mtype.FissionCampaignTaskTypeInstall + taskMark = mtype.FissionCampaignTaskMarkInstall + case mtype.FissionCampaignTicketAppEventRegister: + taskType = mtype.FissionCampaignTaskTypeRegister + taskMark = mtype.FissionCampaignTaskMarkRegister + } + + var isDel int8 = mtype.No + if fixed.GetOpen() == mtype.No { + isDel = mtype.Yes + } + + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple( + taskM.TaskType.Value(taskType), + taskM.TaskMark.Value(taskMark), + taskM.Chance.Value(fixed.GetChance()), + taskM.ChanceLimit.Value(fixed.GetChanceLimit()), + taskM.IsDel.Value(isDel), + taskM.Percent.Value(fixed.GetPercent()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Update) _updateTargetOptionCustom(cpn *model.FissionCampaign, customTicket *model.FissionCampaignTicket, oldTaskMap map[string]*model.FissionCampaignTask, rewardMap map[int64]*model.FissionCampaignReward) (addTicket []*model.FissionCampaignTicket, tasks []*model.FissionCampaignTask, addReward []*model.FissionCampaignReward, delRewardIds []int64, err error) { + + condM := s.GetDao().FissionCampaignCond + taskM := s.GetDao().FissionCampaignTask + rewardM := s.GetDao().FissionCampaignReward + var custom = s.Req.GetTargetOption().GetCustom() + var targetCond = make([]*model.FissionCampaignCond, 0, len(custom.GetCond())) + var delCond []int64 + var delTaskIds []int64 + defer func() { + if err != nil { + return + } + + if len(delTaskIds) > 0 { + _, err = taskM.WithContext(s.Ctx).Where( + taskM.ID.In(delTaskIds...), + ).UpdateSimple(taskM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delCond) > 0 { + _, err = condM.WithContext(s.Ctx).Where( + condM.CampaignID.Eq(cpn.ID), + condM.ID.In(delCond...), + ).UpdateSimple(condM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(targetCond) > 0 { + err = condM.WithContext(s.Ctx).Create(targetCond...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if (customTicket == nil || customTicket.Open == mtype.No) && custom.GetOpen() == mtype.Yes { + s.taskCondAdd = true + } else if customTicket != nil && customTicket.Open == mtype.Yes && custom.GetOpen() == mtype.No { + s.taskCondDel = true + } + }() + + if customTicket == nil { + if custom.GetOpen() == mtype.No { + return + } + + addTicket = append(addTicket, &model.FissionCampaignTicket{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignTicketCustom, + Open: mtype.Yes, + BothType: int8(custom.GetBothType()), + }) + + for _, cond := range custom.GetCond() { + targetCond = append(targetCond, withdefault.FissionCampaignCond(&model.FissionCampaignCond{ + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: cond.GetEvent(), + EventKey: cond.GetEventKey(), + EventVal: cond.GetEventVal(), + Desc: cond.GetDesc(), + IfCond: int8(cond.GetIfCond()), + TriggetType: int8(cond.GetTriggerType()), + EventType: int8(cond.GetEventType()), + ViewType: int8(cond.GetViewType()), + WatchSec: cond.GetWatchSec(), + OpenJump: int8(cond.GetOpenJump()), + WebURL: cond.GetWebUrl(), + ExtraParam: cond.GetExtraParam(), + GoShow: int8(cond.GetGoShow()), + AdsStrategyID: cond.GetAdsStrategyId(), + IsSuper: int8(cond.GetIsSuper()), + Sort: cond.GetSort(), + OpenPush: int8(cond.GetOpenPush()), + PcParam: cond.GetPcParam(), + GoText: cond.GetGoText(), + ClickEffectOpen: int8(cond.GetClickEffectOpen()), + ClickEffect: cond.GetClickEffect(), + ClickEffectUnit: cond.GetClickEffectUnit(), + PullInvite: int8(cond.GetPullInvite()), + })) + } + + switch custom.GetBothType() { + case mtype.FissionCampaignTicketBothTypeAll: + var rewardId int64 + var propMark = custom.GetBothAll().GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: custom.GetBothAll().GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: custom.GetBothAll().GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: custom.GetBothAll().GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: custom.GetBothAll().GetExpiredDay(), + }) + } + + ll, _ := jsonm.ToSliceString(custom.GetBothAll().GetLevelIds()) + lm, _ := jsonm.ToSliceString(custom.GetBothAll().GetLangMarks()) + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondAll, + TaskMark: mtype.FissionCampaignTaskMarkCondAll, + PropMark: propMark, + Num: 1, + Chance: custom.GetBothAll().GetChance(), + ChanceLimit: 0, + TaskLimit: custom.GetBothAll().GetTaskLimit(), + DayLimit: custom.GetBothAll().GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: custom.GetBothAll().GetWeekLimit(), + WeekNum: int8(custom.GetBothAll().GetWeekNum()), + RewardID: rewardId, + })) + case mtype.FissionCampaignTicketBothTypeOne: + for i, cond := range custom.GetCond() { + var rewardId int64 + var propMark = cond.GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: cond.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: cond.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: cond.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: cond.GetExpiredDay(), + }) + } + + ll, _ := jsonm.ToSliceString(cond.GetLevelIds()) + lm, _ := jsonm.ToSliceString(cond.GetLangMarks()) + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + PropMark: propMark, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(targetCond[i].ID), + Num: 1, + Chance: cond.GetChance(), + ChanceLimit: 0, + TaskLimit: cond.GetTaskLimit(), + DayLimit: cond.GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: cond.GetWeekLimit(), + WeekNum: int8(cond.GetWeekNum()), + HasPre: int8(cond.GetHasPre()), + PreCond: cond.GetPreCond(), + ExpiredMin: cond.GetExpiredMin(), + RewardID: rewardId, + AwardMode: int8(cond.GetAwardMode()), + })) + } + } + + return + } + + if customTicket.Open == mtype.No && custom.GetOpen() == mtype.No { + return + } + + list, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpn.ID), condM.IsDel.Eq(mtype.No), condM.RewardID.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 旧条件 + var oldCond = make(map[int64]*model.FissionCampaignCond, len(list)) + for _, cond := range list { + oldCond[cond.ID] = cond + } + + m := s.GetDao().FissionCampaignTicket + + _, err = m.WithContext(s.Ctx). + Where(m.ID.Eq(customTicket.ID)). + UpdateSimple( + m.Open.Value(int8(custom.GetOpen())), + m.BothType.Value(int8(custom.GetBothType())), + m.PreEvent.Value(int8(custom.GetPreEvent())), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignTicket(s.Ctx).Clear(customTicket) + return + }) + + if customTicket.Open == mtype.Yes && custom.GetOpen() == mtype.No { + for _, v := range list { + delCond = append(delCond, v.ID) + if customTicket.BothType == mtype.FissionCampaignTicketBothTypeOne { + if task, ok := oldTaskMap[utils.FissionCampaignTaskMarkCondOneVal(v.ID)]; ok { + delTaskIds = append(delTaskIds, task.ID) + + if reward, ok1 := rewardMap[task.RewardID]; ok1 { + delRewardIds = append(delRewardIds, reward.ID) + } + + } + } + } + + if customTicket.BothType == mtype.FissionCampaignTicketBothTypeAll { + if task, ok := oldTaskMap[mtype.FissionCampaignTaskMarkCondAll]; ok { + delTaskIds = append(delTaskIds, task.ID) + if reward, ok1 := rewardMap[task.RewardID]; ok1 { + delRewardIds = append(delRewardIds, reward.ID) + } + } + } + + return + } + + var condCache []*model.FissionCampaignCond + s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignCond(s.Ctx).Clear(condCache...) + return + }) + + for _, cond := range custom.GetCond() { + //用户ID限制 + ll, _ := jsonm.ToSliceString(cond.GetLevelIds()) + //语言限制 + lm, _ := jsonm.ToSliceString(cond.GetLangMarks()) + old, ok1 := oldCond[cond.GetId()] + if !ok1 { // 要创建条件数据和任务数据 + condId := hashid.IdBigint() + targetCond = append(targetCond, &model.FissionCampaignCond{ + ID: condId, + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: cond.GetEvent(), + EventKey: cond.GetEventKey(), + EventVal: cond.GetEventVal(), + Desc: cond.GetDesc(), + IfCond: int8(cond.GetIfCond()), + TriggetType: int8(cond.GetTriggerType()), + EventType: int8(cond.GetEventType()), + ViewType: int8(cond.GetViewType()), + WatchSec: cond.GetWatchSec(), + OpenJump: int8(cond.GetOpenJump()), + WebURL: cond.GetWebUrl(), + ExtraParam: cond.GetExtraParam(), + GoShow: int8(cond.GetGoShow()), + AdsStrategyID: cond.GetAdsStrategyId(), + IsSuper: int8(cond.GetIsSuper()), + Sort: cond.GetSort(), + OpenPush: int8(cond.GetOpenPush()), + PcParam: cond.GetPcParam(), + GoText: cond.GetGoText(), + ClickEffectOpen: int8(cond.GetClickEffectOpen()), + ClickEffect: cond.GetClickEffect(), + ClickEffectUnit: cond.GetClickEffectUnit(), + PullInvite: int8(cond.GetPullInvite()), + }) + + if custom.GetBothType() == mtype.FissionCampaignTicketBothTypeOne { + var rewardId int64 + var propMark = cond.GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: cond.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: cond.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: cond.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: cond.GetExpiredDay(), + }) + } + + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(condId), + PropMark: propMark, + Num: 1, + Chance: cond.GetChance(), + ChanceLimit: 0, + TaskLimit: cond.GetTaskLimit(), + DayLimit: cond.GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: cond.GetWeekLimit(), + WeekNum: int8(cond.GetWeekNum()), + HasPre: int8(cond.GetHasPre()), + PreCond: cond.GetPreCond(), + ExpiredMin: cond.GetExpiredMin(), + RewardID: rewardId, + AwardMode: int8(cond.GetAwardMode()), + })) + } + + continue + } + + var upCond = []field.AssignExpr{ + condM.Event.Value(cond.GetEvent()), + condM.EventKey.Value(cond.GetEventKey()), + condM.EventVal.Value(cond.GetEventVal()), + condM.Desc.Value(cond.GetDesc()), + condM.IfCond.Value(int8(cond.GetIfCond())), + condM.TriggetType.Value(int8(cond.GetTriggerType())), + condM.EventType.Value(int8(cond.GetEventType())), + condM.ViewType.Value(int8(cond.GetViewType())), + condM.WatchSec.Value(cond.GetWatchSec()), + condM.OpenJump.Value(int8(cond.GetOpenJump())), + condM.WebURL.Value(cond.GetWebUrl()), + condM.ExtraParam.Value(cond.GetExtraParam()), + condM.GoShow.Value(int8(cond.GetGoShow())), + condM.AdsStrategyID.Value(cond.GetAdsStrategyId()), + condM.IsSuper.Value(int8(cond.GetIsSuper())), + condM.Sort.Value(cond.GetSort()), + condM.OpenPush.Value(int8(cond.GetOpenPush())), + condM.PcParam.Value(cond.GetPcParam()), + condM.GoText.Value(cond.GetGoText()), + condM.ClickEffectOpen.Value(int8(cond.GetClickEffectOpen())), + condM.ClickEffect.Value(cond.GetClickEffect()), + condM.ClickEffectUnit.Value(cond.GetClickEffectUnit()), + condM.PullInvite.Value(int8(cond.GetPullInvite())), + } + _, err = condM.WithContext(s.Ctx).Where(condM.ID.Eq(old.ID)).UpdateSimple(upCond...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + condCache = append(condCache, old) + + switch customTicket.BothType { + case mtype.FissionCampaignTicketBothTypeOne: + + switch custom.GetBothType() { + case mtype.FissionCampaignTicketBothTypeOne: + task, ok := oldTaskMap[utils.FissionCampaignTaskMarkCondOneVal(old.ID)] + if ok { + var rewardId int64 + var propMark = cond.GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + + reward := rewardMap[task.RewardID] + + if reward == nil || reward.RewardID != cond.GetReward().GetRewardId() { + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: cond.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: cond.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + if reward != nil { + delRewardIds = append(delRewardIds, reward.ID) + } + } else { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(reward.ID)).UpdateSimple(rewardM.Stock.Value(cond.GetReward().GetStock())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + rewardId = reward.ID + + s.AddAfterRun(func() (err error) { + st, _ := stocks.NewCampaignReward(s.Ctx, reward.ID) + st.Clear() + return + }) + } + + case mtype.FissionCampaignTaskPropMarkPoint: + + reward := rewardMap[task.RewardID] + + if reward == nil { + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: cond.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: cond.GetExpiredDay(), + }) + } else { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(reward.ID)).UpdateSimple( + rewardM.RewardNum.Value(cond.GetChance()), + rewardM.ExpiredDay.Value(cond.GetExpiredDay()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + rewardId = reward.ID + } + } + + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple( + taskM.PropMark.Value(propMark), + taskM.Chance.Value(cond.GetChance()), + taskM.TaskLimit.Value(cond.GetTaskLimit()), + taskM.DayLimit.Value(cond.GetDayLimit()), + taskM.LevelLimit.Value(ll), + taskM.LangMarks.Value(lm), + taskM.WeekLimit.Value(cond.GetWeekLimit()), + taskM.WeekNum.Value(int8(cond.GetWeekNum())), + taskM.HasPre.Value(int8(cond.GetHasPre())), + taskM.PreCond.Value(cond.GetPreCond()), + taskM.ExpiredMin.Value(cond.GetExpiredMin()), + taskM.RewardID.Value(rewardId), + taskM.AwardMode.Value(int8(cond.GetAwardMode())), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + } else { + var rewardId int64 + var propMark = cond.GetPropMark() + + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: cond.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: cond.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: cond.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: cond.GetExpiredDay(), + }) + } + + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(old.ID), + PropMark: propMark, + Num: 1, + Chance: cond.GetChance(), + ChanceLimit: 0, + TaskLimit: cond.GetTaskLimit(), + DayLimit: cond.GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: cond.GetWeekLimit(), + WeekNum: int8(cond.GetWeekNum()), + HasPre: int8(cond.GetHasPre()), + PreCond: cond.GetPreCond(), + ExpiredMin: cond.GetExpiredMin(), + RewardID: rewardId, + AwardMode: int8(cond.GetAwardMode()), + })) + } + + case mtype.FissionCampaignTicketBothTypeAll: + task, ok := oldTaskMap[utils.FissionCampaignTaskMarkCondOneVal(old.ID)] + if ok { + delTaskIds = append(delTaskIds, task.ID) + if task.RewardID > 0 { + delRewardIds = append(delRewardIds, task.RewardID) + } + } + } + case mtype.FissionCampaignTicketBothTypeAll: + switch custom.GetBothType() { + case mtype.FissionCampaignTicketBothTypeOne: + var rewardId int64 + var propMark = cond.GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: cond.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: cond.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: cond.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: cond.GetExpiredDay(), + }) + } + + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(old.ID), + PropMark: propMark, + Num: 1, + Chance: cond.GetChance(), + ChanceLimit: 0, + TaskLimit: cond.GetTaskLimit(), + DayLimit: cond.GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: cond.GetWeekLimit(), + WeekNum: int8(cond.GetWeekNum()), + HasPre: int8(cond.GetHasPre()), + PreCond: cond.GetPreCond(), + ExpiredMin: cond.GetExpiredMin(), + RewardID: rewardId, + AwardMode: int8(cond.GetAwardMode()), + })) + } + + } + + delete(oldCond, old.ID) + } + + switch customTicket.BothType { + case mtype.FissionCampaignTicketBothTypeOne: + switch custom.GetBothType() { + case mtype.FissionCampaignTicketBothTypeOne: // 如果旧的数据已经不在新的数据里面,并且以前的数据还是任意条件,那旧要把任务都删了 + for id := range oldCond { + delCond = append(delCond, id) + if task, ok := oldTaskMap[utils.FissionCampaignTaskMarkCondOneVal(id)]; ok { + delTaskIds = append(delTaskIds, task.ID) + if task.RewardID > 0 { + delRewardIds = append(delRewardIds, task.RewardID) + } + } + } + case mtype.FissionCampaignTicketBothTypeAll: // 从任意任务完成切换到所有任务完成,要生成一条所有任务完成产生的任务数据 + var rewardId int64 + var propMark = custom.GetBothAll().GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: custom.GetBothAll().GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: custom.GetBothAll().GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: custom.GetBothAll().GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: custom.GetBothAll().GetExpiredDay(), + }) + } + + ll, _ := jsonm.ToSliceString(custom.GetBothAll().GetLevelIds()) + lm, _ := jsonm.ToSliceString(custom.GetBothAll().GetLangMarks()) + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondAll, + TaskMark: mtype.FissionCampaignTaskMarkCondAll, + PropMark: propMark, + Num: 1, + Chance: custom.GetBothAll().GetChance(), + ChanceLimit: 0, + TaskLimit: custom.GetBothAll().GetTaskLimit(), + DayLimit: custom.GetBothAll().GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: custom.GetBothAll().GetWeekLimit(), + WeekNum: int8(custom.GetBothAll().GetWeekNum()), + RewardID: rewardId, + })) + } + case mtype.FissionCampaignTicketBothTypeAll: + switch custom.GetBothType() { + case mtype.FissionCampaignTicketBothTypeOne: // 从所有任务完成切换到任意任务完成,要把所有任务完成产生的任务数据删掉 + if task, ok := oldTaskMap[mtype.FissionCampaignTaskMarkCondAll]; ok { + delTaskIds = append(delTaskIds, task.ID) + if task.RewardID > 0 { + delRewardIds = append(delRewardIds, task.RewardID) + } + } + case mtype.FissionCampaignTicketBothTypeAll: // 所有任务完成 都没切换的时候,要更新任务数据 + task, ok := oldTaskMap[mtype.FissionCampaignTaskMarkCondAll] + if ok { + var rewardId int64 + var propMark = custom.GetBothAll().GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + + reward := rewardMap[task.RewardID] + + if reward == nil || reward.RewardID != custom.GetBothAll().GetReward().GetRewardId() { + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: custom.GetBothAll().GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: custom.GetBothAll().GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + if reward != nil { + delRewardIds = append(delRewardIds, reward.ID) + } + } else { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(reward.ID)).UpdateSimple( + rewardM.Stock.Value(custom.GetBothAll().GetReward().GetStock()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + rewardId = reward.ID + + s.AddAfterRun(func() (err error) { + st, _ := stocks.NewCampaignReward(s.Ctx, reward.ID) + st.Clear() + return + }) + } + case mtype.FissionCampaignTaskPropMarkPoint: + reward := rewardMap[task.RewardID] + + if reward == nil { + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: custom.GetBothAll().GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: custom.GetBothAll().GetExpiredDay(), + }) + } else { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(reward.ID)).UpdateSimple( + rewardM.RewardNum.Value(custom.GetBothAll().GetChance()), + rewardM.ExpiredDay.Value(custom.GetBothAll().GetExpiredDay()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + rewardId = reward.ID + } + } + + ll, _ := jsonm.ToSliceString(custom.GetBothAll().GetLevelIds()) + lm, _ := jsonm.ToSliceString(custom.GetBothAll().GetLangMarks()) + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)). + UpdateSimple( + taskM.PropMark.Value(propMark), + taskM.Chance.Value(custom.GetBothAll().GetChance()), + taskM.TaskLimit.Value(custom.GetBothAll().GetTaskLimit()), + taskM.DayLimit.Value(custom.GetBothAll().GetDayLimit()), + taskM.LevelLimit.Value(ll), + taskM.LangMarks.Value(lm), + taskM.WeekLimit.Value(custom.GetBothAll().GetWeekLimit()), + taskM.WeekNum.Value(int8(custom.GetBothAll().GetWeekNum())), + taskM.RewardID.Value(rewardId), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } else { + var rewardId int64 + var propMark = custom.GetBothAll().GetPropMark() + switch propMark { + case mtype.FissionCampaignTaskPropMarkReward: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: custom.GetBothAll().GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: 1, + RewardID: custom.GetBothAll().GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + case mtype.FissionCampaignTaskPropMarkPoint: + rewardId = hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + RewardType: mtype.FissionCampaignRewardTypeTask, + RewardNum: custom.GetBothAll().GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: custom.GetBothAll().GetExpiredDay(), + }) + } + + ll, _ := jsonm.ToSliceString(custom.GetBothAll().GetLevelIds()) + lm, _ := jsonm.ToSliceString(custom.GetBothAll().GetLangMarks()) + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondAll, + TaskMark: mtype.FissionCampaignTaskMarkCondAll, + PropMark: propMark, + Num: 1, + Chance: custom.GetBothAll().GetChance(), + ChanceLimit: 0, + TaskLimit: custom.GetBothAll().GetTaskLimit(), + DayLimit: custom.GetBothAll().GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: custom.GetBothAll().GetWeekLimit(), + WeekNum: int8(custom.GetBothAll().GetWeekNum()), + RewardID: rewardId, + })) + } + + } + } + + return +} + +// 更新目标配置(即将弃用) +func (s *Update) _updateTargetCond(cpn *model.FissionCampaign) (err error) { + // 目标配置 + condM := s.GetDao().FissionCampaignCond + list, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpn.ID), condM.IsDel.Eq(mtype.No), condM.RewardID.Eq(0)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + // 旧条件 + var oldCond = make(map[int64]*model.FissionCampaignCond, len(list)) + for _, cond := range list { + oldCond[cond.ID] = cond + } + + target := s.Req.GetTarget() + + var condCache []*model.FissionCampaignCond + defer s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignCond(s.Ctx).Clear(condCache...) + return + }) + var addCond []*model.FissionCampaignCond + var newIdx int + var newCond = make(map[int]*pb.UpdateReq_Cond) + for _, cond := range target.GetCond() { + tt := int8(utils.NewGlobalTrigger(cpn.FissionID, cond.GetTriggerType())) + old, ok := oldCond[cond.GetId()] + if !ok { + addCond = append(addCond, &model.FissionCampaignCond{ + ID: hashid.IdBigint(), + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: cond.GetEvent(), + EventKey: cond.GetEventKey(), + EventVal: cond.GetEventVal(), + Desc: cond.GetDesc(), + IfCond: int8(cond.GetIfCond()), + TriggetType: tt, + EventType: int8(cond.GetEventType()), + }) + newCond[newIdx] = cond + newIdx++ + continue + } + + var upCond = []field.AssignExpr{ + condM.Event.Value(cond.GetEvent()), + condM.EventKey.Value(cond.GetEventKey()), + condM.EventVal.Value(cond.GetEventVal()), + condM.Desc.Value(cond.GetDesc()), + condM.IfCond.Value(int8(cond.GetIfCond())), + condM.TriggetType.Value(tt), + condM.EventType.Value(int8(cond.GetEventType())), + } + _, err = condM.WithContext(s.Ctx).Where(condM.ID.Eq(old.ID)).UpdateSimple(upCond...) + if err != nil { + return s.BE().MysqlError(err) + } + + delete(oldCond, cond.GetId()) + condCache = append(condCache, old) + } + + var del []int64 + for id := range oldCond { + del = append(del, id) + } + + if len(addCond) > 0 { + err = condM.WithContext(s.Ctx).Create(addCond...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(del) > 0 { + _, err = condM.WithContext(s.Ctx).Where(condM.ID.In(del...), condM.CampaignID.Eq(cpn.ID)).UpdateSimple(condM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +func (s *Update) _updateRunningCond(cpn *model.FissionCampaign) (err error) { + + m := s.GetDao().FissionCampaignCond + if !consts.NewEventCpn(cpn.FissionID) { + var condCache = make([]*model.FissionCampaignCond, 0, len(s.Req.GetTarget().GetCond())) + defer s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignCond(s.Ctx).Clear(condCache...) + return + }) + for _, cond := range s.Req.GetTarget().GetCond() { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cond.GetId())).UpdateSimple( + m.Desc.Value(cond.GetDesc()), + m.ViewType.Value(int8(cond.GetViewType())), + m.GoText.Value(cond.GetGoText()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + condCache = append(condCache, &model.FissionCampaignCond{ID: cond.GetId()}) + } + return + } + + ticketM := s.GetDao().FissionCampaignTicket + ticket, err := ticketM.WithContext(s.Ctx).Where( + ticketM.CampaignID.Eq(cpn.ID), + ticketM.Open.Eq(mtype.Yes), + ticketM.Mark.Eq(mtype.FissionCampaignTicketCustom), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if ticket == nil { + return + } + + var ids []int64 + var reqCond = s.Req.GetTargetOption().GetCustom().GetCond() + for _, v := range reqCond { + ids = append(ids, v.GetId()) + } + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldCondMap = make(map[int64]*model.FissionCampaignCond) + for _, cond := range list { + oldCondMap[cond.ID] = cond + } + + var condCache = make([]*model.FissionCampaignCond, 0, len(list)) + defer s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignCond(s.Ctx).Clear(condCache...) + return + }) + + taskM := s.GetDao().FissionCampaignTask + + var addCond []*model.FissionCampaignCond + defer func() { + if len(addCond) > 0 && err == nil { + err = m.WithContext(s.Ctx).Create(addCond...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(cpn.GetLangTypes()) > 1 { + s.Res.AddTask = true + } + } + }() + + var addTask []*model.FissionCampaignTask + defer func() { + if len(addTask) > 0 && err == nil { + err = taskM.WithContext(s.Ctx).Create(addTask...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + }() + + var taskMark = make(map[string]*pb.UpdateReq_Cond, len(reqCond)) + for _, cond := range reqCond { + + taskMark[utils.FissionCampaignTaskMarkCondOneVal(cond.GetId())] = cond + + old, ok := oldCondMap[cond.GetId()] + if !ok { + aCond := withdefault.FissionCampaignCond(&model.FissionCampaignCond{ + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: cond.GetEvent(), + EventKey: cond.GetEventKey(), + EventVal: cond.GetEventVal(), + Desc: cond.GetDesc(), + IfCond: int8(cond.GetIfCond()), + TriggetType: int8(cond.GetTriggerType()), + EventType: int8(cond.GetEventType()), + ViewType: int8(cond.GetViewType()), + WatchSec: cond.GetWatchSec(), + OpenJump: int8(cond.GetOpenJump()), + WebURL: cond.GetWebUrl(), + ExtraParam: cond.GetExtraParam(), + GoShow: int8(cond.GetGoShow()), + AdsStrategyID: cond.GetAdsStrategyId(), + Sort: cond.GetSort(), + OpenPush: int8(cond.GetOpenPush()), + PcParam: cond.GetPcParam(), + GoText: cond.GetGoText(), + ClickEffectOpen: int8(cond.GetClickEffectOpen()), + ClickEffect: cond.GetClickEffect(), + ClickEffectUnit: cond.GetClickEffectUnit(), + PullInvite: int8(cond.GetPullInvite()), + }) + + if ticket.BothType == mtype.FissionCampaignTicketBothTypeOne { + //用户ID限制 + ll, _ := jsonm.ToSliceString(cond.GetLevelIds()) + //语言限制 + lm, _ := jsonm.ToSliceString(cond.GetLangMarks()) + + addTask = append(addTask, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(aCond.ID), + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: 1, + Chance: cond.GetChance(), + ChanceLimit: 0, + TaskLimit: cond.GetTaskLimit(), + DayLimit: cond.GetDayLimit(), + LevelLimit: ll, + LangMarks: lm, + WeekLimit: cond.GetWeekLimit(), + WeekNum: int8(cond.GetWeekNum()), + AwardMode: int8(cond.GetAwardMode()), + })) + } + + addCond = append(addCond, aCond) + + continue + } + + var upData []field.AssignExpr + + if old.Desc != cond.GetDesc() { + upData = append(upData, m.Desc.Value(cond.GetDesc())) + } + + if old.EventVal != cond.GetEventVal() { + upData = append(upData, m.EventVal.Value(cond.GetEventVal())) + } + + if old.OpenJump != int8(cond.GetOpenJump()) { + upData = append(upData, m.OpenJump.Value(int8(cond.GetOpenJump()))) + } + + if old.WebURL != cond.GetWebUrl() { + upData = append(upData, m.WebURL.Value(cond.GetWebUrl())) + } + + if old.ExtraParam != cond.GetExtraParam() { + upData = append(upData, m.ExtraParam.Value(cond.GetExtraParam())) + } + + if old.PcParam != cond.GetPcParam() { + upData = append(upData, m.PcParam.Value(cond.GetPcParam())) + } + + if old.TriggetType != int8(cond.GetTriggerType()) { + upData = append(upData, m.TriggetType.Value(int8(cond.GetTriggerType()))) + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).UpdateRunningTriggetType(old.ID, old.TriggetType, cond.GetTriggerType()) + } + + if old.ViewType != int8(cond.GetViewType()) { + upData = append(upData, m.ViewType.Value(int8(cond.GetViewType()))) + } + + if old.GoShow != int8(cond.GetGoShow()) { + upData = append(upData, m.GoShow.Value(int8(cond.GetGoShow()))) + } + + if old.GoText != cond.GetGoText() { + upData = append(upData, m.GoText.Value(cond.GetGoText())) + } + + if old.AdsStrategyID != cond.GetAdsStrategyId() { + upData = append(upData, m.AdsStrategyID.Value(cond.GetAdsStrategyId())) + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).UpdateRunningAdsStrategy(old.ID, old.AdsStrategyID, cond.GetAdsStrategyId()) + } + + if old.WatchSec != cond.GetWatchSec() { + upData = append(upData, m.WatchSec.Value(cond.GetWatchSec())) + } + + if old.Sort != cond.GetSort() { + upData = append(upData, m.Sort.Value(cond.GetSort())) + } + + if old.OpenPush != int8(cond.GetOpenPush()) { + upData = append(upData, m.OpenPush.Value(int8(cond.GetOpenPush()))) + } + + if old.ClickEffectOpen != int8(cond.GetClickEffectOpen()) { + upData = append(upData, m.ClickEffectOpen.Value(int8(cond.GetClickEffectOpen()))) + } + + if old.ClickEffect != cond.GetClickEffect() { + upData = append(upData, m.ClickEffect.Value(cond.GetClickEffect())) + } + + if old.ClickEffectUnit != cond.GetClickEffectUnit() { + upData = append(upData, m.ClickEffectUnit.Value(cond.GetClickEffectUnit())) + } + + if old.PullInvite != int8(cond.GetPullInvite()) { + upData = append(upData, m.PullInvite.Value(int8(cond.GetPullInvite()))) + } + + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cond.GetId())).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + condCache = append(condCache, old) + } + } + + // 更新限制 + + switch ticket.BothType { + case mtype.FissionCampaignTicketBothTypeAll: + var task *model.FissionCampaignTask + task, err = taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(cpn.ID), + taskM.TaskMark.Eq(mtype.FissionCampaignTaskMarkCondAll), + taskM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var operateLogKvs []string + var up []field.AssignExpr + ba := s.Req.GetTargetOption().GetCustom().GetBothAll() + dayLimit, taskLimit, levelLimit := ba.GetDayLimit(), ba.GetTaskLimit(), ba.GetLevelIds() + if task != nil { + if task.DayLimit != dayLimit { + up = append(up, taskM.DayLimit.Value(dayLimit)) + operateLogKvs = append(operateLogKvs, + "day", + fmt.Sprintf("%d->%d", task.DayLimit, dayLimit), + ) + } + + if task.TaskLimit != taskLimit { + up = append(up, taskM.TaskLimit.Value(taskLimit)) + operateLogKvs = append(operateLogKvs, + "task", + fmt.Sprintf("%d->%d", task.TaskLimit, taskLimit), + ) + } + + if !verify.SliceEq(task.GetLevelLimit(), levelLimit) { + ll, _ := jsonm.ToSliceString(levelLimit) + up = append(up, taskM.LevelLimit.Value(ll)) + operateLogKvs = append(operateLogKvs, + "level", + fmt.Sprintf("%s->%s", task.LevelLimit, ll), + ) + } + + if !verify.SliceEq(task.GetLangMarks(), ba.GetLangMarks()) { + lm, _ := jsonm.ToSliceString(ba.GetLangMarks()) + up = append(up, taskM.LangMarks.Value(lm)) + operateLogKvs = append(operateLogKvs, + "lang", + fmt.Sprintf("%s->%s", task.LangMarks, lm), + ) + } + + if task.WeekLimit != ba.GetWeekLimit() || task.WeekNum != int8(ba.GetWeekNum()) { + up = append(up, taskM.WeekLimit.Value(ba.GetWeekLimit()), taskM.WeekNum.Value(int8(ba.GetWeekNum()))) + operateLogKvs = append(operateLogKvs, + "week", + fmt.Sprintf("%d_%d->%d_%d", task.WeekLimit, task.WeekNum, ba.GetWeekLimit(), ba.GetWeekNum()), + ) + } + + if len(up) > 0 { + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).TaskLimitRule(task.ID, operateLogKvs) + } + } + + case mtype.FissionCampaignTicketBothTypeOne: + var tasks []*model.FissionCampaignTask + tasks, err = taskM.WithContext(s.Ctx).Where(taskM.CampaignID.Eq(cpn.ID), taskM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, task := range tasks { + cond, ok := taskMark[task.TaskMark] + if !ok { + continue + } + + var operateLogKvs []string + var up []field.AssignExpr + + if task.AwardMode != int8(cond.GetAwardMode()) { + up = append(up, taskM.AwardMode.Value(int8(cond.GetAwardMode()))) + } + + if task.DayLimit != cond.GetDayLimit() { + up = append(up, taskM.DayLimit.Value(cond.GetDayLimit())) + operateLogKvs = append(operateLogKvs, + "day", + fmt.Sprintf("%d->%d", task.DayLimit, cond.GetDayLimit()), + ) + } + + if task.TaskLimit != cond.GetTaskLimit() { + up = append(up, taskM.TaskLimit.Value(cond.GetTaskLimit())) + operateLogKvs = append(operateLogKvs, + "task", + fmt.Sprintf("%d->%d", task.TaskLimit, cond.GetTaskLimit()), + ) + } + + if !verify.SliceEq(task.GetLevelLimit(), cond.GetLevelIds()) { + ll, _ := jsonm.ToSliceString(cond.GetLevelIds()) + up = append(up, taskM.LevelLimit.Value(ll)) + operateLogKvs = append(operateLogKvs, + "level", + fmt.Sprintf("%s->%s", task.LevelLimit, ll), + ) + } + + if !verify.SliceEq(task.GetLangMarks(), cond.GetLangMarks()) { + lm, _ := jsonm.ToSliceString(cond.GetLangMarks()) + up = append(up, taskM.LangMarks.Value(lm)) + operateLogKvs = append(operateLogKvs, + "lang", + fmt.Sprintf("%s->%s", task.LangMarks, lm), + ) + } + + if task.WeekLimit != cond.GetWeekLimit() || task.WeekNum != int8(cond.GetWeekNum()) { + up = append(up, taskM.WeekLimit.Value(cond.GetWeekLimit()), taskM.WeekNum.Value(int8(cond.GetWeekNum()))) + operateLogKvs = append(operateLogKvs, + "week", + fmt.Sprintf("%d_%d->%d_%d", task.WeekLimit, task.WeekNum, cond.GetWeekLimit(), cond.GetWeekNum()), + ) + } + + if len(up) > 0 { + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.OL().User(s.Req.GetUserId(), s.Req.GetIp()).TaskLimitRule(task.ID, operateLogKvs) + } + } + } + + return +} + +// 创建玩法特有数据 +func (s *Update) updateFission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdPrizeWheel: //大转盘 + return s.updatePrizeWheel(cpn) + case consts.IdSlotMachine: //老虎机 + return s.updateSlotMachine(cpn) + case consts.IdLuckyGrid: //九宫格 + return s.updateLuckyGrid(cpn) + case consts.IdBlindBox: //盲盒 + return s.updateBlindBox(cpn) + case consts.IdReferral: //老带新 + return s.updateReferral(cpn) + case consts.IdWinTogether: //一起赢 + return s.updateWinTogether(cpn) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo: //趣味问答 + return s.updatePrizeAnswer(cpn) + case consts.IdPrizeQuiz: //有奖竞猜 + return s.updatePrizeQuiz(cpn) + case consts.IdSignIn: //签到 + return s.updateSignIn(cpn) + case consts.IdDice: //大富翁 + return s.updateDice(cpn) + case consts.IdGrow: //农场 + return s.updateGrow(cpn) + case consts.IdBallot: //抽签 + return s.updateBallot(cpn) + case consts.IdChop: //砍一刀 + return s.updateChop(cpn) + case consts.IdCash: //现金抽奖 + return s.updateCash(cpn) + case consts.IdFlip: //翻牌活动 + return s.updateFlip(cpn) + case consts.IdKeep: //激励养成 + return s.updateKeep(cpn) + case consts.IdGold: //金币任务 + return s.updateGold(cpn) + case consts.IdCoin: //金币池 + return s.updateCoin(cpn) + case consts.IdVs: + return s.updateVs(cpn) + case consts.IdUno: + return s.updateUno(cpn) + case consts.IdGashapon: //扭蛋机 + return s.updateGashapon(cpn) + default: + + } + + return +} + +// 更新赛事竞猜配置 +func (s *Update) updatePrizeQuiz(cpn *model.FissionCampaign) (err error) { + quiz := s.Req.GetQuiz() + + cc := cache.NewCampaignQuiz(s.Ctx) + fcq, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if fcq == nil { + return workerr.NotFound("not found fcq") + } + + m := s.GetDao().FissionCampaignQuiz + var data = []field.AssignExpr{ + m.OpenPrize.Value(timez.GMT(quiz.GetOpenPrize(), s.Req.GetTOffset())), + m.TOpen.Value(quiz.GetOpenPrize()), + } + + defer func() { + if err != nil { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(fcq.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(fcq) + }() + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态只能改正确选项 + //选项更新 + optionM := s.GetDao().FissionCampaignQuizOption + for _, v := range quiz.GetOptions() { + _, err = optionM.WithContext(s.Ctx).Where(optionM.ID.Eq(v.GetId())).UpdateSimple(optionM.IsRight.Value(int8(v.GetIsRight()))) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return + } + + data = append(data, + m.TargetNum.Value(quiz.GetTargetNum()), + m.InitChance.Value(quiz.GetInitChance()), + m.Chance.Value(quiz.GetChance()), + m.RewardRule.Value(int8(quiz.GetRewardRule())), + m.Title.Value(quiz.GetTitle()), + ) + + //更新了初始投票机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if fcq.InitChance != quiz.GetInitChance() { + fqM := s.GetDao().FissionQuiz + _, err = fqM.WithContext(s.Ctx).Where(fqM.CampaignID.Eq(cpn.ID)).UpdateSimple(fqM.Chance.Value(quiz.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + var optAdd []*model.FissionCampaignQuizOption + var optDel []int64 + var optNewIds = make(map[int64]*pb.UpdateReq_QuizOption) + for _, v := range quiz.GetOptions() { + + if v.GetId() > 0 { + //修改数据 + optNewIds[v.GetId()] = v + continue + } + + //没有ID就是新增数据 + optAdd = append(optAdd, withdefault.FissionCampaignQuizOption(&model.FissionCampaignQuizOption{ + CampaignID: cpn.ID, + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + IsRight: int8(v.GetIsRight()), + })) + } + + //选项更新 + optionM := s.GetDao().FissionCampaignQuizOption + options, err := optionM.WithContext(s.Ctx).Where(optionM.CampaignID.Eq(cpn.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range options { + option, ok := optNewIds[v.ID] + if !ok { + optDel = append(optDel, v.ID) + continue + } + + var uData = []field.AssignExpr{ + optionM.Title.Value(option.GetTitle()), + optionM.ImgURL.Value(option.GetImgUrl()), + optionM.IsRight.Value(int8(option.GetIsRight())), + } + + _, err = optionM.WithContext(s.Ctx).Where(optionM.ID.Eq(v.ID)).UpdateSimple(uData...) + if err != nil { + return s.BE().MysqlError(err) + } + + } + + if len(optAdd) > 0 { + err = optionM.WithContext(s.Ctx).Create(optAdd...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(optDel) > 0 { + _, err = optionM.WithContext(s.Ctx).Where(optionM.ID.In(optDel...)).UpdateSimple(optionM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新大转盘 +func (s *Update) updatePrizeWheel(cpn *model.FissionCampaign) (err error) { + var wheel = s.Req.GetPrizeWheel() + + cc := cache.NewCampaignWheel(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found wheel conf") + } + + confM := s.GetDao().FissionCampaignWheel + var data = []field.AssignExpr{ + confM.DayChance.Value(wheel.GetDayChance()), + } + + defer func() { + if err != nil { + return + } + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(conf) + }() + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态不能修改配置 + return + } + + data = append(data, + confM.TargetNum.Value(wheel.GetTargetNum()), + confM.InitChance.Value(wheel.GetInitChance()), + confM.Chance.Value(wheel.GetChance()), + ) + + //更新了初次抽奖机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if conf.InitChance != wheel.GetInitChance() { + fpwM := s.GetDao().FissionPrizeWheel + _, err = fpwM.WithContext(s.Ctx).Where(fpwM.CampaignID.Eq(cpn.ID)).UpdateSimple(fpwM.Chance.Value(wheel.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新老虎机 +func (s *Update) updateSlotMachine(cpn *model.FissionCampaign) (err error) { + var slot = s.Req.GetSlot() + + cc := cache.NewCampaignSlot(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found slot conf") + } + + confM := s.GetDao().FissionCampaignSlot + var data = []field.AssignExpr{ + confM.DayChance.Value(slot.GetDayChance()), + } + + defer func() { + if err != nil { + return + } + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(conf) + }() + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态不能修改配置 + return + } + + data = append(data, + confM.TargetNum.Value(slot.GetTargetNum()), + confM.InitChance.Value(slot.GetInitChance()), + confM.Chance.Value(slot.GetChance()), + ) + + //更新了初次抽奖机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if conf.InitChance != slot.GetInitChance() { + fpwM := s.GetDao().FissionSlot + _, err = fpwM.WithContext(s.Ctx).Where(fpwM.CampaignID.Eq(cpn.ID)).UpdateSimple(fpwM.Chance.Value(slot.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新九宫格 +func (s *Update) updateLuckyGrid(cpn *model.FissionCampaign) (err error) { + var grid = s.Req.GetGrid() + + cc := cache.NewCampaignGrid(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found grid conf") + } + + confM := s.GetDao().FissionCampaignGrid + var data = []field.AssignExpr{ + confM.DayChance.Value(grid.GetDayChance()), + } + + defer func() { + if err != nil { + return + } + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(conf) + }() + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态不能修改配置 + return + } + + data = append(data, + confM.TargetNum.Value(grid.GetTargetNum()), + confM.InitChance.Value(grid.GetInitChance()), + confM.Chance.Value(grid.GetChance()), + ) + + //更新了初次抽奖机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if conf.InitChance != grid.GetInitChance() { + fpwM := s.GetDao().FissionGrid + _, err = fpwM.WithContext(s.Ctx).Where(fpwM.CampaignID.Eq(cpn.ID)).UpdateSimple(fpwM.Chance.Value(grid.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新盲盒 +func (s *Update) updateBlindBox(cpn *model.FissionCampaign) (err error) { + var blind = s.Req.GetBlind() + + cc := cache.NewCampaignBlind(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found blind conf") + } + + confM := s.GetDao().FissionCampaignBlind + var data = []field.AssignExpr{ + confM.DayChance.Value(blind.GetDayChance()), + } + + defer func() { + if err != nil { + return + } + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(conf) + }() + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态不能修改配置 + return + } + + data = append(data, + confM.TargetNum.Value(blind.GetTargetNum()), + confM.InitChance.Value(blind.GetInitChance()), + confM.Chance.Value(blind.GetChance()), + ) + + //更新了初次抽奖机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if conf.InitChance != blind.GetInitChance() { + fpwM := s.GetDao().FissionBlind + _, err = fpwM.WithContext(s.Ctx).Where(fpwM.CampaignID.Eq(cpn.ID)).UpdateSimple(fpwM.Chance.Value(blind.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新趣味问答 +func (s *Update) updatePrizeAnswer(cpn *model.FissionCampaign) (err error) { + + qac := s.Req.GetQuestionAnswer() + + cc := cache.NewCampaignQa(s.Ctx) + m := s.GetDao().FissionCampaignQa + qa, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if qa == nil { + return workerr.NotFound("not found qa") + } + + var data = []field.AssignExpr{ + m.QuestionAskTime.Value(qac.GetQuestionAskTime()), + m.QaNum.Value(qac.GetQaNum()), + m.OpenGuide.Value(int8(qac.GetOpenGuide())), + } + + if cpn.Status == mtype.FissionCampaignStatusWait { //不是待发布状态的直接返回 + data = append(data, + m.TargetNum.Value(qac.GetTargetNum()), + m.Chance.Value(qac.GetChance()), + m.InitChance.Value(qac.GetInitChance()), + m.DayChance.Value(qac.GetDayChance()), + ) + } + + if qac.GetGroupHashId() != "" { + var group *model.LibraryQaGroup + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.HashID.Eq(qac.GetGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil { + return s.BE().VerifyError("qa group params error") + } + data = append(data, m.QaGroupID.Value(group.ID)) + } + + if qac.GetGuideGroupHashId() != "" { + var group *model.LibraryQaGroup + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.HashID.Eq(qac.GetGuideGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil { + return s.BE().VerifyError("qa guide group params error") + } + data = append(data, m.GuideGroupID.Value(group.ID)) + } + + //配置数据更新 + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(qa.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + _ = cc.Clear(qa) + return + }) + + //更新了初次答题机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if qa.InitChance != qac.GetInitChance() { + fqM := s.GetDao().FissionQa + _, err = fqM.WithContext(s.Ctx).Where(fqM.CampaignID.Eq(cpn.ID)).UpdateSimple(fqM.Chance.Value(qac.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if cpn.FissionID != consts.IdPrizeAnswer { + return + } + + //问题数据更新 + var addCqq []*model.FissionCampaignQaQuestion + var delCqq []int64 + var newCqqIds = make(map[int64]*pb.UpdateReq_QaQuestion) + var sortCqq = make(map[int64]int32) + for i, v := range qac.GetQuestions() { + + if v.GetId() > 0 { + sortCqq[v.GetId()] = int32(i) + //修改数据 + newCqqIds[v.GetId()] = v + continue + } + + //没有ID就是新增数据 + addCqq = append(addCqq, withdefault.FissionCampaignQaQuestion(&model.FissionCampaignQaQuestion{ + CampaignID: cpn.ID, + QaID: qa.ID, + Title: v.GetTitle(), + Score: v.GetScore(), + Sort: int32(i), + })) + } + + cqqM := s.GetDao().FissionCampaignQaQuestion + cqqL, err := cqqM.WithContext(s.Ctx).Where(cqqM.QaID.Eq(qa.ID), cqqM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range cqqL { + cqq, ok := newCqqIds[v.ID] + if !ok { + delCqq = append(delCqq, v.ID) + continue + } + + var uData = []field.AssignExpr{ + cqqM.Title.Value(cqq.GetTitle()), + cqqM.Score.Value(cqq.GetScore()), + cqqM.Sort.Value(sortCqq[cqq.GetId()]), + } + + _, err = cqqM.WithContext(s.Ctx).Where(cqqM.ID.Eq(v.ID), cqqM.QaID.Eq(qa.ID)).UpdateSimple(uData...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(addCqq) > 0 { + err = cqqM.WithContext(s.Ctx).Create(addCqq...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(delCqq) > 0 { + _, err = cqqM.WithContext(s.Ctx).Where(cqqM.ID.In(delCqq...)).UpdateSimple(cqqM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + //答案数据更新 + var addCqo []*model.FissionCampaignQaOption + var delCqo []int64 + var newCqoIds = make(map[int64]*pb.UpdateReq_QaOption) + var idx int + var qids []int64 + for _, v1 := range qac.GetQuestions() { + //已有的题目 + if v1.GetId() > 0 { + qids = append(qids, v1.GetId()) + + for _, v := range v1.GetOptions() { + if v.GetId() > 0 { + //修改数据 + newCqoIds[v.GetId()] = v + continue + } + + //没有ID就是新增数据 + addCqo = append(addCqo, withdefault.FissionCampaignQaOption(&model.FissionCampaignQaOption{ + QuestionID: v1.GetId(), + Title: v.GetTitle(), + IsRight: int8(v.GetIsRight()), + })) + } + + continue + } + + //新创建的题目 + for _, v := range v1.GetOptions() { + //没有ID就是新增数据 + addCqo = append(addCqo, withdefault.FissionCampaignQaOption(&model.FissionCampaignQaOption{ + QuestionID: addCqq[idx].ID, + Title: v.GetTitle(), + IsRight: int8(v.GetIsRight()), + })) + } + //下一个新创建题目的下标 + idx++ + } + + cqoM := s.GetDao().FissionCampaignQaOption + if len(qids) > 0 { + var cqoL []*model.FissionCampaignQaOption + cqoL, err = cqoM.WithContext(s.Ctx).Where(cqoM.QuestionID.In(qids...), cqoM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range cqoL { + cqo, ok := newCqoIds[v.ID] + if !ok { + delCqo = append(delCqo, v.ID) + continue + } + + var uData = []field.AssignExpr{ + cqoM.Title.Value(cqo.GetTitle()), + cqoM.IsRight.Value(int8(cqo.GetIsRight())), + } + + _, err = cqoM.WithContext(s.Ctx).Where(cqoM.ID.Eq(v.ID)).UpdateSimple(uData...) + if err != nil { + return s.BE().MysqlError(err) + } + } + } + + if len(addCqo) > 0 { + err = cqoM.WithContext(s.Ctx).Create(addCqo...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(delCqo) > 0 { + _, err = cqoM.WithContext(s.Ctx).Where(cqoM.ID.In(delCqo...)).UpdateSimple(cqoM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新老带新 +func (s *Update) updateReferral(cpn *model.FissionCampaign) (err error) { + + cc := cache.NewCampaignReferral(s.Ctx) + crl, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if crl == nil { + return workerr.NotFound("not found crl") + } + + crlM := s.GetDao().FissionCampaignReferral + var ref = s.Req.GetReferral() + + var data = []field.AssignExpr{ + crlM.RewardLimit.Value(ref.GetRewardLimit()), + crlM.RewardRule.Value(int8(ref.GetRewardRule())), + crlM.InviteLimit.Value(ref.GetInviteLimit()), + crlM.StepLoop.Value(int8(ref.GetStepLoop())), + } + + _, err = crlM.WithContext(s.Ctx).Where(crlM.ID.Eq(crl.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + if crl.RewardLimit < ref.GetRewardLimit() && cpn.Status != mtype.FissionCampaignStatusWait { + + s.AddAfterRun(func() (err error) { + + _ = app.NewVerControl(s.Ctx, ckey.FissionRewardLimitUpVer(cpn.ID), vercontrol.SetExpire(time.Hour)).Create(time.Now(), func() error { + producer.NewCampaignNotice(s.Ctx).RewardLimitUp(types.RewardLimitUp{CampaignId: cpn.ID}) + return nil + }) + + return + }) + } + + s.AddAfterRun(func() (err error) { + _ = cc.Clear(crl) + return + }) + + return +} + +// 更新一起赢奖励 +func (s *Update) updateWinTogether(cpn *model.FissionCampaign) (err error) { + + cc := cache.NewCampaignWin(s.Ctx) + fcw, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if fcw == nil { + return workerr.NotFound("not found fcw") + } + + fcwM := s.GetDao().FissionCampaignWin + var win = s.Req.GetWin() + + var data = []field.AssignExpr{ + fcwM.RewardLimit.Value(win.GetRewardLimit()), + fcwM.RewardRule.Value(int8(win.GetRewardRule())), + fcwM.InviteLimit.Value(win.GetInviteLimit()), + fcwM.NewcomerCond.Value(int8(win.GetNewcomerCond())), + fcwM.StepLoop.Value(int8(win.GetStepLoop())), + } + + _, err = fcwM.WithContext(s.Ctx).Where(fcwM.ID.Eq(fcw.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + if fcw.RewardLimit < win.GetRewardLimit() && cpn.Status != mtype.FissionCampaignStatusWait { + s.AddAfterRun(func() (err error) { + + _ = app.NewVerControl(s.Ctx, ckey.FissionRewardLimitUpVer(cpn.ID), vercontrol.SetExpire(time.Hour)).Create(time.Now(), func() error { + producer.NewCampaignNotice(s.Ctx).RewardLimitUp(types.RewardLimitUp{CampaignId: cpn.ID}) + return nil + }) + + return + }) + } + + s.AddAfterRun(func() (err error) { + _ = cc.Clear(fcw) + return + }) + + return +} + +func (s *Update) syncEvent(cpn *model.FissionCampaign) (err error) { + err = cmm.NewCMM(s.Ctx, s.GetDao()).SaveEventCampaignTrigger(cpn.ProjectID) + if err != nil { + return + } + + return +} + +// 更新报表任务 +func (s *Update) updateTask(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionArchiveTask + + if s.taskCondAdd { + var endTime = utils.CampaignArchiveEnd(timez.GMT(s.Req.GetEndTime(), s.Req.GetTOffset())).Unix() + err = m.WithContext(s.Ctx).Create(withdefault.FissionArchiveTask(&model.FissionArchiveTask{ + CampaignID: cpn.ID, + EndTime: endTime, + Mark: mtype.FissionArchiveTaskMarkCondHour, + }), withdefault.FissionArchiveTask(&model.FissionArchiveTask{ + CampaignID: cpn.ID, + EndTime: endTime, + Mark: mtype.FissionArchiveTaskMarkCondDay, + })) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + if s.taskCondDel { + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Mark.In(mtype.FissionArchiveTaskMarkCondHour, mtype.FissionArchiveTaskMarkCondDay)).Delete() + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + if s.taskEndChange { + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).UpdateSimple(m.EndTime.Value(utils.CampaignArchiveEnd(timez.GMT(s.Req.GetEndTime(), s.Req.GetTOffset())).Unix())) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + err = cmm.NewCMM(s.Ctx, s.GetDao()).AnalyzeCampaign(cpn.ProjectID, cpn.ID, cpn.StartTime, cpn.EndTime, 0) + if err != nil { + return + } + + return +} + +// 更新签到 +func (s *Update) updateSignIn(cpn *model.FissionCampaign) (err error) { + cc := cache.NewCampaignSign(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found fcs") + } + + fcsM := s.GetDao().FissionCampaignSign + var sign = s.Req.GetSign() + + if cpn.Status != mtype.FissionCampaignStatusWait { + _, err = fcsM.WithContext(s.Ctx).Where(fcsM.ID.Eq(conf.ID)).UpdateSimple( + fcsM.Color.Value(sign.GetColor()), + fcsM.SignCycle.Value(sign.GetSignCycle()), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + return cc.Clear(conf) + }) + + return + } + + var data = []field.AssignExpr{ + fcsM.SignType.Value(int8(sign.GetSignType())), + fcsM.IsContinue.Value(int8(sign.GetIsContinue())), + fcsM.HasCard.Value(int8(sign.GetHasCard())), + fcsM.InviteNum.Value(sign.GetInviteNum()), + fcsM.IsLoop.Value(int8(sign.GetIsLoop())), + fcsM.SignCycle.Value(sign.GetSignCycle()), + fcsM.RecycleType.Value(int8(sign.GetRecycleType())), + fcsM.Color.Value(sign.GetColor()), + } + + _, err = fcsM.WithContext(s.Ctx).Where(fcsM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + return cc.Clear(conf) + }) + + if conf.HasCard == mtype.No && sign.GetHasCard() == mtype.No { + return + } + + if conf.HasCard == mtype.No && sign.GetHasCard() == mtype.Yes { + task := withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: mtype.FissionCampaignTaskMarkInstall, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Num: sign.GetInviteNum(), + Chance: 1, + }) + + err = s.GetDao().FissionCampaignTask.WithContext(s.Ctx).Create(task) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + taskM := s.GetDao().FissionCampaignTask + task, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(cpn.ID), + taskM.TaskType.Eq(mtype.FissionCampaignTaskTypeInstall), + taskM.PropMark.Eq(mtype.FissionCampaignTaskPropMarkChance), + ).Take() + if err != nil { + return + } + + if sign.GetHasCard() == mtype.No { + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(taskM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + return + } + + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(taskM.Num.Value(sign.GetInviteNum())) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Update) updateDice(cpn *model.FissionCampaign) (err error) { + var dice = s.Req.GetDice() + fcdM := s.GetDao().FissionCampaignDice + fcd, err := fcdM.WithContext(s.Ctx).Where(fcdM.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if fcd == nil { + return workerr.NotFound("not found fcd") + } + + var data = []field.AssignExpr{ + fcdM.InitChance.Value(dice.GetInitChance()), + fcdM.CustomDice.Value(dice.GetCustomDice()), + fcdM.DayChance.Value(dice.GetDayChance()), + fcdM.OpenMapPoint.Value(int8(dice.GetOpenMapPoint())), + fcdM.OpenInvite.Value(int8(dice.GetOpenInvite())), + fcdM.Odds.Value(dice.GetOdds()), + fcdM.PlayImg.Value(dice.GetPlayImg()), + fcdM.CloudImg.Value(dice.GetCloudImg()), + } + + mapPoint, _ := jsonm.MarshalToString(&mtype.MapPoint{ + Blank: dice.GetMapPoint().GetBlank(), + Again: dice.GetMapPoint().GetAgain(), + Normal: dice.GetMapPoint().GetNormal(), + Supper: dice.GetMapPoint().GetSupper(), + }) + + data = append(data, fcdM.MapPoint.Value(mapPoint)) + + // 更新数据 + defer func() { + _, err = fcdM.WithContext(s.Ctx).Where(fcdM.ID.Eq(fcd.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewCampaignDice(s.Ctx).Clear(fcd) + + if fcd.InitChance != dice.GetInitChance() { + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningDiceInit(fcd.ID, fcd.InitChance, dice.GetInitChance()) + } + + if fcd.DayChance != dice.GetDayChance() { + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningDiceDay(fcd.ID, fcd.DayChance, dice.GetDayChance()) + } + + }() + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态的直接返回 + return + } + + data = append(data, + fcdM.FixDiceTarget.Value(dice.GetFixDiceTarget()), + fcdM.FixDice.Value(int8(dice.GetFixDice())), + fcdM.FixDiceLimit.Value(dice.GetFixDiceLimit()), + fcdM.AwardType.Value(int8(dice.GetAwardType())), + fcdM.RollAgain.Value(int8(dice.GetRollAgain())), + fcdM.FixDiceCond.Value(int8(dice.GetFixDiceCond())), + ) + + if fcd.FixDice == mtype.No && dice.GetFixDice() == mtype.No { + return + } + + ntt := utils.Ternary[int8](dice.GetFixDiceCond() == mtype.FissionCampaignDiceFixDiceCondInstall, + mtype.FissionCampaignTaskTypeInstall, mtype.FissionCampaignTaskTypeRegister) + ntm := utils.Ternary[string](dice.GetFixDiceCond() == mtype.FissionCampaignDiceFixDiceCondInstall, + mtype.FissionCampaignTaskMarkInstall, mtype.FissionCampaignTaskMarkRegister) + + taskM := s.GetDao().FissionCampaignTask + if fcd.FixDice == mtype.No && dice.GetFixDice() == mtype.Yes { + err = taskM.WithContext(s.Ctx).Create(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: ntt, + TaskMark: ntm, + PropMark: mtype.FissionCampaignTaskPropMarkFixedRoll, + Num: dice.GetFixDiceTarget(), + Chance: 1, + ChanceLimit: dice.GetFixDiceLimit(), + TaskLimit: 0, + }) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + ott := utils.Ternary[string]( + fcd.FixDiceCond == mtype.FissionCampaignDiceFixDiceCondInstall, + mtype.FissionCampaignTaskMarkInstall, mtype.FissionCampaignTaskMarkRegister) + + task, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(cpn.ID), + taskM.TaskMark.Eq(ott), + taskM.PropMark.Eq(mtype.FissionCampaignTaskPropMarkFixedRoll), + taskM.IsDel.Eq(mtype.No), + ).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if fcd.FixDice == mtype.Yes && dice.GetFixDice() == mtype.No { + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(taskM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + if fcd.FixDice == mtype.Yes && dice.GetFixDice() == mtype.Yes { + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple( + taskM.TaskType.Value(ntt), + taskM.TaskMark.Value(ntm), + taskM.Num.Value(dice.GetFixDiceTarget()), + taskM.ChanceLimit.Value(dice.GetFixDiceLimit()), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + return +} + +func (s *Update) updateGrow(cpn *model.FissionCampaign) (err error) { + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态的直接返回 + return + } + + confM := s.GetDao().FissionCampaignGrow + + conf, err := confM.WithContext(s.Ctx).Where(confM.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if conf == nil { + return workerr.NotFound("not found grow conf") + } + var grow = s.Req.GetGrow() + + var data = []field.AssignExpr{ + confM.AutoHour.Value(grow.GetAutoHour()), + confM.AutoNum.Value(grow.GetAutoNum()), + confM.GrowNum.Value(grow.GetGrowNum()), + confM.TargetNum.Value(grow.GetTargetNum()), + confM.Revive.Value(int8(grow.GetRevive())), + confM.ReviveNum.Value(grow.GetReviveNum()), + confM.DieHour.Value(grow.GetDieHour()), + confM.InitNum.Value(grow.GetInitNum()), + } + + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + // 阶段更新 + var stepAdd []*model.FissionCampaignGrowStep + var stepDel []int64 + var stepNewIds = make(map[int64]*pb.UpdateReq_GrowStep) + var stepMap = make(map[int64]int32) + for i, v := range grow.GetSteps() { + if v.GetId() > 0 { + //修改数据 + stepNewIds[v.GetId()] = v + stepMap[v.GetId()] = int32(i + 1) + continue + } + + //没有ID就是新增数据 + stepAdd = append(stepAdd, withdefault.FissionCampaignGrowStep(&model.FissionCampaignGrowStep{ + CampaignID: cpn.ID, + Step: int32(i + 1), + Num: v.GetNum(), + })) + } + + stepM := s.GetDao().FissionCampaignGrowStep + steps, err := stepM.WithContext(s.Ctx).Where( + stepM.CampaignID.Eq(cpn.ID), + stepM.IsDel.Eq(mtype.No), + ).Order(stepM.Step).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range steps { + step, ok := stepNewIds[v.ID] + if !ok { + stepDel = append(stepDel, v.ID) + continue + } + + _, err = stepM.WithContext(s.Ctx).Where(stepM.ID.Eq(v.ID), stepM.CampaignID.Eq(cpn.ID)).UpdateSimple(stepM.Step.Value(stepMap[v.ID]), stepM.Num.Value(step.GetNum())) + if err != nil { + return s.BE().MysqlError(err) + } + + } + + if len(stepAdd) > 0 { + err = stepM.WithContext(s.Ctx).Create(stepAdd...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(stepDel) > 0 { + _, err = stepM.WithContext(s.Ctx).Where(stepM.ID.In(stepDel...), stepM.CampaignID.Eq(cpn.ID)).UpdateSimple(stepM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + //更新复活任务 + err = s._updateReviveTask(cpn) + if err != nil { + return err + } + + return +} + +func (s *Update) _updateReviveTask(cpn *model.FissionCampaign) error { + grow := s.Req.GetGrow() + taskM := s.GetDao().FissionCampaignTask + task, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(cpn.ID), + taskM.TaskMark.Eq(mtype.FissionCampaignTaskMarkInstall), + taskM.PropMark.Eq(mtype.FissionCampaignTaskPropMarkRevive), + taskM.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + switch grow.GetRevive() { + case mtype.Yes: + //如果没有复活任务则创建复活任务 + if task == nil { + task = withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: mtype.FissionCampaignTaskMarkInstall, + PropMark: mtype.FissionCampaignTaskPropMarkRevive, + Num: grow.GetReviveNum(), + Chance: 1, + }) + err = taskM.WithContext(s.Ctx).Create(task) + } else { + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(taskM.Num.Value(grow.GetReviveNum())) + } + if err != nil { + return err + } + case mtype.No: + //有任务则删除复活任务 + if task == nil { + return nil + } + _, err = taskM.WithContext(s.Ctx).Where(taskM.ID.Eq(task.ID)).UpdateSimple(taskM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + return nil +} + +func (s *Update) updateBallot(cpn *model.FissionCampaign) (err error) { + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态的直接返回 + return + } + + cc := cache.NewCampaignBallot(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found ballot conf") + } + + confM := s.GetDao().FissionCampaignBallot + var ballot = s.Req.GetBallot() + var data = []field.AssignExpr{ + confM.InitChance.Value(ballot.GetInitChance()), + confM.DayChance.Value(ballot.GetDayChance()), + } + + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *Update) updateChop(cpn *model.FissionCampaign) (err error) { + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态的直接返回 + return + } + + cc := cache.NewCampaignChop(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + if conf == nil { + return workerr.NotFound("not found chop conf") + } + + confM := s.GetDao().FissionCampaignChop + var chop = s.Req.GetChop() + + var data []field.AssignExpr + + if conf.ShowBar != int8(chop.GetShowBar()) { + data = append(data, confM.ShowBar.Value(int8(chop.GetShowBar()))) + } + + if len(data) == 0 { + return + } + + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + _ = cc.Clear(conf) + + return +} + +// 设置延迟深度链接数据 +func (s *Update) saveDelayLinkData(cpn *model.FissionCampaign) (err error) { + var data = &dlinkpb.SaveCampaignDataListReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + Data: make([]*dlinkpb.SaveCampaignDataListReq_Data, 0, len(s.Req.GetDelayLinkData())), + } + + for _, v := range s.Req.GetDelayLinkData() { + data.Data = append(data.Data, &dlinkpb.SaveCampaignDataListReq_Data{ + Key: v.GetKey(), + Val: v.GetValue(), + }) + } + + if len(data.Data) == 0 { + return + } + + _, err = app.NewDeepLinkLink().SaveCampaignDataList(s.Ctx, data) + if err != nil { + return + } + + return +} + +// 处理奖品数据 +func (s *Update) updateReward(cpn *model.FissionCampaign) (err error) { + + // 发布之后 + if s.justUpdatePart { + return s._updateRunningReward(cpn) + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var add = s.otherReward + var delIds []int64 + webAdd, webDelIds, err := s._updateRewards(s.Req.GetRewardsWeb(), list, cpn, mtype.FissionCampaignRewardTypeWeb, consts.CampaignUserType{}) + if err != nil { + return + } + + add = append(add, webAdd...) + delIds = append(delIds, webDelIds...) + + extraAdd, extraDelIds, err := s._updateRewards(s.Req.GetRewardsExtra(), list, cpn, mtype.FissionCampaignRewardTypeExtra, consts.CampaignUserType{}) + if err != nil { + return + } + + add = append(add, extraAdd...) + delIds = append(delIds, extraDelIds...) + + newcomerAdd, newcomerDelIds, err := s._updateRewards(s.Req.GetRewardsNewcomer(), list, cpn, mtype.FissionCampaignRewardTypeNewcomer, consts.CampaignUserType{}) + if err != nil { + return + } + + add = append(add, newcomerAdd...) + delIds = append(delIds, newcomerDelIds...) + + var appAdd []*model.FissionCampaignReward + var appDelIds []int64 + switch s.Req.GetRewards().GetRewardGroup() { + case mtype.FissionRewardGroupNormal: + appAdd, appDelIds, err = s._updateRewards(s.Req.GetRewards().GetNormal(), list, cpn, mtype.FissionCampaignRewardTypeApp, consts.CampaignUserType{}) + if err != nil { + return + } + + case mtype.FissionRewardGroupLang: + var langMarks []string + for _, langs := range s.Req.GetRewards().GetLangs() { + var langAdd []*model.FissionCampaignReward + var langDelIds []int64 + langAdd, langDelIds, err = s._updateRewards(langs.GetRewards(), list, cpn, mtype.FissionCampaignRewardTypeApp, consts.CampaignUserType{LangMark: langs.GetLangMark()}) + if err != nil { + return + } + + appAdd = append(appAdd, langAdd...) + appDelIds = append(appDelIds, langDelIds...) + langMarks = append(langMarks, langs.GetLangMark()) + } + + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.LangMark.NotIn(langMarks...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return + } + + case mtype.FissionRewardGroupUserLevel: + var levelIds []int64 + for _, level := range s.Req.GetRewards().GetUserLevel().GetLevelList() { + var levelAdd []*model.FissionCampaignReward + var levelDelIds []int64 + levelAdd, levelDelIds, err = s._updateRewards(level.GetRewards(), list, cpn, mtype.FissionCampaignRewardTypeApp, consts.CampaignUserType{LevelId: level.GetLevelId()}) + if err != nil { + return + } + appAdd = append(appAdd, levelAdd...) + appDelIds = append(appDelIds, levelDelIds...) + levelIds = append(levelIds, level.GetLevelId()) + } + + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.LevelID.NotIn(levelIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return + } + + case mtype.FissionRewardGroupLangAndUserLevel: + var langMarks []string + + for _, lang := range s.Req.GetRewards().GetLangUserLevel() { + var levelIds []int64 + for _, level := range lang.GetLevelList() { + var llAdd []*model.FissionCampaignReward + var llDelIds []int64 + llAdd, llDelIds, err = s._updateRewards(level.GetRewards(), list, cpn, mtype.FissionCampaignRewardTypeApp, consts.CampaignUserType{LevelId: level.GetLevelId(), LangMark: lang.GetLangMark()}) + if err != nil { + return + } + + appAdd = append(appAdd, llAdd...) + appDelIds = append(appDelIds, llDelIds...) + levelIds = append(levelIds, level.GetLevelId()) + } + + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.LangMark.Eq(lang.GetLangMark()), m.LevelID.NotIn(levelIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return + } + + langMarks = append(langMarks, lang.GetLangMark()) + } + + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.LangMark.NotIn(langMarks...), m.LevelID.Gt(0)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return + } + + case mtype.FissionRewardGroupCountry: + var countryMarks []string + for _, country := range s.Req.GetRewards().GetCountry().GetCountryList() { + var countryAdd []*model.FissionCampaignReward + var countryDelIds []int64 + countryAdd, countryDelIds, err = s._updateRewards(country.GetRewards(), list, cpn, mtype.FissionCampaignRewardTypeApp, consts.CampaignUserType{CountryMark: country.GetCountryMark()}) + if err != nil { + return + } + appAdd = append(appAdd, countryAdd...) + appDelIds = append(appDelIds, countryDelIds...) + countryMarks = append(countryMarks, country.GetCountryMark()) + } + + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.CountryMark.NotIn(countryMarks...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return + } + } + + add = append(add, appAdd...) + delIds = append(delIds, appDelIds...) + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + err = s._updateRelated(cpn.ID) + if err != nil { + return + } + + // 更新规则 + err = s._updateRule(cpn.ID) + if err != nil { + return + } + + if cpn.FissionID == consts.IdChop { + err = s._updateHelp(cpn.ID) + if err != nil { + return + } + } + + return s._updateHelpTicket(cpn) +} + +// 更新奖品数据 +func (s *Update) _updateRewards(newList []*pb.UpdateReq_Reward, oldList []*model.FissionCampaignReward, cpn *model.FissionCampaign, rt int8, t consts.CampaignUserType) (add []*model.FissionCampaignReward, delIds []int64, err error) { + if len(oldList) == 0 && len(newList) == 0 { + return + } + + var oldMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range oldList { + if v.RewardType == rt && v.LangMark == t.LangMark && v.LevelID == t.LevelId && v.CountryMark == t.CountryMark { + oldMap[v.ID] = v + } + } + + var delStockId []int64 + m := s.GetDao().FissionCampaignReward + for i, v := range newList { + var step int32 + // 如果是老带新和一起奖励,额外奖或者是阶梯奖励规则,都要设置阶梯 + if (verify.InArray(cpn.FissionID, consts.IdWinTogether, consts.IdReferral) && + (rt == mtype.FissionCampaignRewardTypeExtra || + (rt == mtype.FissionCampaignRewardTypeApp && + (s.Req.GetReferral().GetRewardRule() == mtype.FissionReferralRewardRuleStep || + s.Req.GetWin().GetRewardRule() == mtype.FissionReferralRewardRuleStep)))) || + cpn.FissionID == consts.IdSignIn { + step = int32(i) + 1 + } + + hashRule := utils.Ternary[int8](v.GetCampaignLimit() > 0, mtype.Yes, mtype.No) + sort := int32(i) + old, ok := oldMap[v.GetId()] + if !ok { + + one := withdefault.FissionCampaignReward(&model.FissionCampaignReward{ + CampaignID: cpn.ID, + Stock: v.GetStock(), + Sort: sort, + RewardType: rt, + Step: step, + InviteNum: v.GetInviteNum(), + RewardNum: v.GetRewardNum(), + IsThank: int8(v.GetIsThank()), + Score: v.GetScore(), + SignDay: v.GetSignDay(), + CollectNum: v.GetCollectNum(), + IsSuper: int8(v.GetIsSuper()), + RewardID: v.GetRewardId(), + LangMark: t.LangMark, + LevelID: t.LevelId, + Odds: v.GetOdds(), + CountryMark: t.CountryMark, + JumpURL: v.GetJumpUrl(), + HasRule: hashRule, + InitPercent: v.GetInitPercent(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + OpenAdd: int8(v.GetOpenAdd().GetOpen()), + OpenTask: int8(v.GetRewardTask().GetOpen()), + }) + + s.rewardAdd[one.ID] = v.GetOpenAdd() + s.rewardTask[one.ID] = v.GetRewardTask() + + if cpn.FissionID == consts.IdDice { + one.SetCollectRule(mtype.CollectRule{ + Open: v.GetCollectRule().GetOpen(), + InitCollect: v.GetCollectRule().GetInitCollect(), + SignDay: v.GetCollectRule().GetSignDay(), + AddCollect: v.GetCollectRule().GetAddCollect(), + ResetType: v.GetCollectRule().GetResetType(), + }) + } + + add = append(add, one) + + newList[i].Id = one.ID + continue + } + + delete(oldMap, old.ID) + s.rewardAdd[old.ID] = v.GetOpenAdd() + s.rewardTask[old.ID] = v.GetRewardTask() + + var upData []field.AssignExpr + + if old.Sort != sort { + upData = append(upData, m.Sort.Value(sort)) + } + + if old.Step != step { + upData = append(upData, m.Step.Value(step)) + } + + if old.Score != v.GetScore() { + upData = append(upData, m.Score.Value(v.GetScore())) + } + + if old.Odds != v.GetOdds() { + upData = append(upData, m.Odds.Value(v.GetOdds())) + } + + if old.Stock != v.GetStock() { + upData = append(upData, m.Stock.Value(v.GetStock())) + } + + if old.InitPercent != v.GetInitPercent() { + upData = append(upData, m.InitPercent.Value(v.GetInitPercent())) + } + + if old.OpenAdd != int8(v.GetOpenAdd().GetOpen()) { + upData = append(upData, m.OpenAdd.Value(int8(v.GetOpenAdd().GetOpen()))) + } + + if old.OpenTask != int8(v.GetRewardTask().GetOpen()) { + upData = append(upData, m.OpenTask.Value(int8(v.GetRewardTask().GetOpen()))) + } + + hasRule := utils.Ternary[int8](v.GetCampaignLimit() > 0, mtype.Yes, mtype.No) + if old.HasRule != hasRule { + upData = append(upData, m.HasRule.Value(hasRule)) + } + + if cpn.FissionID == consts.IdDice { + cr, _ := jsonm.MarshalToString(mtype.CollectRule{ + Open: v.GetCollectRule().GetOpen(), + InitCollect: v.GetCollectRule().GetInitCollect(), + SignDay: v.GetCollectRule().GetSignDay(), + AddCollect: v.GetCollectRule().GetAddCollect(), + ResetType: v.GetCollectRule().GetResetType(), + }) + + oldCr, newCr := utils.Md5Any(old.GetCollectRule()), utils.Md5String(cr) + if oldCr != newCr { + upData = append(upData, m.CollectRule.Value(cr)) + } + } + + if old.InviteNum != v.GetInviteNum() { + upData = append(upData, m.InviteNum.Value(v.GetInviteNum())) + } + + if old.RewardNum != v.GetRewardNum() { + upData = append(upData, m.RewardNum.Value(v.GetRewardNum())) + } + + if old.IsThank != int8(v.GetIsThank()) { + upData = append(upData, m.IsThank.Value(int8(v.GetIsThank()))) + } + + if old.SignDay != v.GetSignDay() { + upData = append(upData, m.SignDay.Value(v.GetSignDay())) + } + + if old.CollectNum != v.GetCollectNum() { + upData = append(upData, m.CollectNum.Value(v.GetCollectNum())) + } + + if old.IsSuper != int8(v.GetIsSuper()) { + upData = append(upData, m.IsSuper.Value(int8(v.GetIsSuper()))) + } + + if old.RewardID != v.GetRewardId() { + upData = append(upData, m.RewardID.Value(v.GetRewardId())) + } + + if old.JumpURL != v.GetJumpUrl() { + upData = append(upData, m.JumpURL.Value(v.GetJumpUrl())) + } + + if len(upData) == 0 { + continue + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if old.Stock != v.GetStock() && verify.InArray(cpn.Status, mtype.FissionCampaignStatusPubPre, mtype.FissionCampaignStatusPub) { + delStockId = append(delStockId, old.ID) + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningStock(old.ID, old.Stock, v.GetStock()) + } + + } + + s.AddAfterRun(func() (err error) { + if len(delStockId) > 0 { + stocks.NewCleaner(s.Ctx, delStockId...).ClearAllReward() + } + return + }) + + if len(oldMap) == 0 { + return + } + + for _, v := range oldMap { + delIds = append(delIds, v.ID) + } + + return +} + +// 更新奖品库存追加规则 +func (s *Update) updateRewardAdd(cpn *model.FissionCampaign) (err error) { + + m := s.GetDao().FissionCampaignRewardAdd + oldList, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + oldMap := make(map[int64]*model.FissionCampaignRewardAdd, len(oldList)) + for _, old := range oldList { + oldMap[old.RewardID] = old + } + + list := make([]*model.FissionCampaignRewardAdd, 0) + for rewardID, add := range s.rewardAdd { + if add.GetOpen() == mtype.No { + continue + } + + var start = timez.GMT(add.GetStart(), cpn.TOffset) + var end = timez.GMT(add.GetEnd(), cpn.TOffset) + + old, ok := oldMap[rewardID] + if ok { + var upData []field.AssignExpr + if old.DayNum != add.GetDayNum() { + upData = append(upData, m.DayNum.Value(add.GetDayNum())) + } + if old.DayAdd != add.GetDayAdd() { + upData = append(upData, m.DayAdd.Value(add.GetDayAdd())) + } + + if old.Start != start { + upData = append(upData, m.Start.Value(start)) + } + + if old.End != end { + upData = append(upData, m.End.Value(end)) + } + + if (old.Start != start || old.End != end) && old.FinishAt != 0 { + upData = append(upData, m.FinishAt.Value(0)) + } + + if len(upData) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(upData...); err != nil { + return s.BE().MysqlError(err) + } + } + + delete(oldMap, rewardID) + + continue + } + + list = append(list, withdefault.FissionCampaignRewardAdd(&model.FissionCampaignRewardAdd{ + CampaignID: cpn.ID, + RewardID: rewardID, + Start: start, + End: end, + DayNum: add.GetDayNum(), + DayAdd: add.GetDayAdd(), + })) + } + + if len(list) > 0 { + if err = m.WithContext(s.Ctx).Create(list...); err != nil { + return s.BE().MysqlError(err) + } + } + + var delIds []int64 + for _, v := range oldMap { + delIds = append(delIds, v.ID) + } + + if len(delIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)); err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新奖品任务 +func (s *Update) updateRewardTask(cpn *model.FissionCampaign) (err error) { + + m := s.GetDao().FissionCampaignCond + oldList, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No), m.RewardID.Gt(0)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + oldMap := make(map[int64]*model.FissionCampaignCond, len(oldList)) + for _, old := range oldList { + oldMap[old.RewardID] = old + } + + conds := make([]*model.FissionCampaignCond, 0) + tasks := make([]*model.FissionCampaignTask, 0) + + for rewardID, add := range s.rewardTask { + if add.GetOpen() == mtype.No { + continue + } + + old, ok := oldMap[rewardID] + if ok { + var upData []field.AssignExpr + if old.Event != add.GetEvent() { + upData = append(upData, m.Event.Value(add.GetEvent())) + } + + if old.EventKey != add.GetEventKey() { + upData = append(upData, m.EventKey.Value(add.GetEventKey())) + } + + if old.EventVal != add.GetEventVal() { + upData = append(upData, m.EventVal.Value(add.GetEventVal())) + } + + if old.EventType != int8(add.GetEventType()) { + upData = append(upData, m.EventType.Value(int8(add.GetEventType()))) + } + + if old.IfCond != int8(add.GetIfCond()) { + upData = append(upData, m.IfCond.Value(int8(add.GetIfCond()))) + } + + if old.TriggetType != int8(add.GetTriggerType()) { + upData = append(upData, m.OpenPush.Value(int8(add.GetOpenPush()))) + } + + if old.OpenPush != int8(add.GetOpenPush()) { + upData = append(upData, m.OpenPush.Value(int8(add.GetOpenPush()))) + } + + if len(upData) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(upData...); err != nil { + return s.BE().MysqlError(err) + } + } + + delete(oldMap, rewardID) + + continue + } + + one := withdefault.FissionCampaignCond(&model.FissionCampaignCond{ + CampaignID: cpn.ID, + ProjectID: cpn.ProjectID, + Event: add.GetEvent(), + EventKey: add.GetEventKey(), + EventVal: add.GetEventVal(), + IfCond: int8(add.GetIfCond()), + TriggetType: int8(add.GetTriggerType()), + EventType: int8(add.GetEventType()), + OpenPush: int8(add.GetOpenPush()), + RewardID: rewardID, + }) + + conds = append(conds, one) + + tasks = append(tasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpn.ID, + TaskType: mtype.FissionCampaignTaskTypeCondOne, + TaskMark: utils.FissionCampaignTaskMarkCondOneVal(one.ID), + PropMark: mtype.FissionCampaignTaskPropMarkUnlockReward, + Num: 1, + Chance: 1, + RewardID: rewardID, + })) + } + + if len(conds) > 0 { + if err = m.WithContext(s.Ctx).Create(conds...); err != nil { + return s.BE().MysqlError(err) + } + } + + if len(tasks) > 0 { + if err = s.GetDao().FissionCampaignTask.WithContext(s.Ctx).Create(tasks...); err != nil { + return s.BE().MysqlError(err) + } + } + + var delIds []int64 + for _, v := range oldMap { + delIds = append(delIds, v.ID) + } + + if len(delIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)); err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 更新奖品关联 +func (s *Update) _updateRelated(cpnId int64) (err error) { + m := s.GetDao().RewardRelated + list, err := m.WithContext(s.Ctx).Where(m.RelateID.Eq(cpnId), m.RelateTable.Eq(dao.FissionCampaign.TableName())).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var relateMap = make(map[int64]struct{}) + var oldMap = make(map[int64]*model.RewardRelated) + for _, v := range list { + oldMap[v.RewardID] = v + relateMap[v.RewardID] = struct{}{} + } + + var orIds []int64 + var add []*model.RewardRelated + + for _, rewardId := range s.otherRelateIds { + _, ok := relateMap[rewardId] + if !ok { + add = append(add, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: rewardId, + RelateID: cpnId, + RelateTable: dao.FissionCampaign.TableName(), + CancelTime: 0, + })) + relateMap[rewardId] = struct{}{} + continue + } + + old, ok1 := oldMap[rewardId] + if ok1 && old.CancelTime > 0 { + orIds = append(orIds, old.ID) + } + delete(oldMap, rewardId) + } + + var bfn = func(newList []*pb.UpdateReq_Reward) (err error) { + for _, v := range newList { + _, ok := relateMap[v.GetRewardId()] + if !ok { + add = append(add, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: v.GetRewardId(), + RelateID: cpnId, + RelateTable: dao.FissionCampaign.TableName(), + CancelTime: 0, + })) + relateMap[v.GetRewardId()] = struct{}{} + continue + } + + old, ok1 := oldMap[v.GetRewardId()] + if ok1 && old.CancelTime > 0 { + orIds = append(orIds, old.ID) + } + delete(oldMap, v.GetRewardId()) + } + return + } + + _ = bfn(s.Req.GetRewardsWeb()) + _ = bfn(s.Req.GetRewardsExtra()) + _ = bfn(s.Req.GetRewardsNewcomer()) + + _ = s._switchRewardGroupDo(bfn) + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(orIds) > 0 { + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(orIds...)).UpdateSimple(m.CancelTime.Value(0)); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(oldMap) == 0 { + return + } + + var cancelIds []int64 + for _, v := range oldMap { + cancelIds = append(cancelIds, v.ID) + } + + if _, err = m.WithContext(s.Ctx).Where(m.ID.In(cancelIds...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 更具奖品类型处理奖品 +func (s *Update) _switchRewardGroupDo(do func(rewards []*pb.UpdateReq_Reward) error) (err error) { + switch s.Req.GetRewards().GetRewardGroup() { + case mtype.FissionRewardGroupNormal: + return do(s.Req.GetRewards().GetNormal()) + case mtype.FissionRewardGroupLang: + for _, langs := range s.Req.GetRewards().GetLangs() { + err = do(langs.GetRewards()) + if err != nil { + return + } + } + case mtype.FissionRewardGroupUserLevel: + for _, level := range s.Req.GetRewards().GetUserLevel().GetLevelList() { + err = do(level.GetRewards()) + if err != nil { + return + } + } + + case mtype.FissionRewardGroupLangAndUserLevel: + for _, lang := range s.Req.GetRewards().GetLangUserLevel() { + for _, level := range lang.GetLevelList() { + err = do(level.GetRewards()) + if err != nil { + return + } + } + } + case mtype.FissionRewardGroupCountry: + for _, country := range s.Req.GetRewards().GetCountry().GetCountryList() { + err = do(country.GetRewards()) + if err != nil { + return + } + } + } + + return +} + +func (s *Update) _updateHelp(cpnId int64) (err error) { + m := s.GetDao().FissionCampaignTask + helps, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]map[int8]*model.FissionCampaignTask) + for _, v := range helps { + rewardId := utils.FissionCampaignTaskMarkRewardOneRewardId(v.TaskMark) + if rewardId <= 0 { + continue + } + + if _, ok := oldMap[rewardId]; !ok { + oldMap[rewardId] = map[int8]*model.FissionCampaignTask{ + v.TaskType: v, + } + } else { + oldMap[rewardId][v.TaskType] = v + } + } + + var delIds []int64 + var addTasks []*model.FissionCampaignTask + var bfn = func(newList []*pb.UpdateReq_Reward) (err error) { + for _, one := range newList { + rewardId := one.GetId() + oldHelps, ok := oldMap[rewardId] + taskMark := utils.FissionCampaignTaskMarkRewardOneVal(rewardId) + if !ok { + if one.GetHelp() == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetHelpPercent(), + })) + + s.helpInstall = true + } + if one.GetOpen() == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeOpen, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetOpenPercent(), + PercentLimit: one.GetOpenPercentLimit(), + })) + + s.helpOpen = true + } + if one.GetClick() == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeClick, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetClickPercent(), + PercentLimit: one.GetClickPercentLimit(), + })) + + s.helpClick = true + } + if one.GetRegister() == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeRegister, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetRegisterPercent(), + })) + + s.helpRegister = true + } + + continue + } + + open, exist := oldHelps[mtype.FissionCampaignTaskTypeOpen] + if exist && one.Open == mtype.No { + delIds = append(delIds, open.ID) + } else if !exist && one.Open == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeOpen, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetOpenPercent(), + PercentLimit: one.GetOpenPercentLimit(), + })) + s.helpOpen = true + } else if open != nil { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(open.ID)).UpdateSimple( + m.Percent.Value(one.GetOpenPercent()), + m.PercentLimit.Value(one.GetOpenPercentLimit()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.helpOpen = true + } + + install, has := oldHelps[mtype.FissionCampaignTaskTypeInstall] + if has && one.Help == mtype.No { + delIds = append(delIds, install.ID) + } else if !has && one.Help == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeInstall, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetHelpPercent(), + })) + s.helpInstall = true + } else if install != nil { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(install.ID)).UpdateSimple(m.Percent.Value(one.GetHelpPercent())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.helpInstall = true + } + + click, has := oldHelps[mtype.FissionCampaignTaskTypeClick] + if has && one.Click == mtype.No { + delIds = append(delIds, click.ID) + } else if !has && one.Click == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeClick, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetClickPercent(), + PercentLimit: one.GetClickPercentLimit(), + })) + s.helpClick = true + } else if click != nil { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(click.ID)).UpdateSimple( + m.Percent.Value(one.GetClickPercent()), + m.PercentLimit.Value(one.GetClickPercentLimit()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.helpClick = true + } + + register, has := oldHelps[mtype.FissionCampaignTaskTypeRegister] + if has && one.Register == mtype.No { + delIds = append(delIds, register.ID) + } else if !has && one.Register == mtype.Yes { + addTasks = append(addTasks, withdefault.FissionCampaignTask(&model.FissionCampaignTask{ + CampaignID: cpnId, + TaskType: mtype.FissionCampaignTaskTypeRegister, + TaskMark: taskMark, + PropMark: mtype.FissionCampaignTaskPropMarkChance, + Percent: one.GetRegisterPercent(), + })) + s.helpRegister = true + } else if register != nil { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(register.ID)).UpdateSimple(m.Percent.Value(one.GetRegisterPercent())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.helpRegister = true + } + } + return + } + + _ = s._switchRewardGroupDo(bfn) + + if len(addTasks) > 0 { + err = m.WithContext(s.Ctx).Create(addTasks...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Update) updateCash(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignCash + + conf, err := cache.NewCampaignCash(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found cash conf") + } + + var cash = s.Req.GetCash() + + var data = []field.AssignExpr{ + m.PriceNum.Value(cash.GetPriceNum()), + m.LoopNum.Value(cash.GetLoopNum()), + } + + if cpn.Status == mtype.FissionCampaignStatusWait { //待发布状态可以改所有数据 + data = append(data, + m.ExpiredDay.Value(cash.GetExpiredDay()), + m.Price.Value(cash.GetPrice()), + m.Currency.Value(int8(cash.GetCurrency())), + ) + } + + if conf.PriceNum != cash.GetPriceNum() { + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningCashStock(conf.ID, conf.PriceNum, cash.GetPriceNum()) + + data = append(data, m.Lack.Value(mtype.No)) + + s.AddAfterRun(func() (err error) { + stocks.NewCleaner(s.Ctx, cpn.ID).ClearCampaign() + return + }) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignCash(s.Ctx).Clear(conf) + }) + + return +} + +// 更新长图 +func (s *Update) _updateLongImg(conf *model.FissionCampaignConfig) (err error) { + if conf.HasLongImg == mtype.No && len(s.Req.GetLongImgs()) == 0 { + return + } + + m := s.GetDao().FissionCampaignLongImg + if conf.HasLongImg == mtype.Yes && len(s.Req.GetLongImgs()) == 0 { + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(conf.CampaignID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(conf.CampaignID), m.IsDel.Eq(mtype.No), m.LangID.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.FissionCampaignLongImg) + for _, v := range list { + oldMap[v.ID] = v + } + + zoneM := s.GetDao().FissionCampaignLongImgZone + var zone []*model.FissionCampaignLongImgZone + var add = make([]*model.FissionCampaignLongImg, 0) + var zoneDelIds []int64 + for _, v := range s.Req.GetLongImgs() { + old, ok := oldMap[v.GetId()] + if !ok { + one := withdefault.FissionCampaignLongImg(&model.FissionCampaignLongImg{ + CampaignID: conf.CampaignID, + ClickType: int8(v.GetClickType()), + ImgURL: v.GetImgUrl(), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + PcParam: v.GetPcParam(), + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + }) + + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: one.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(v.GetTargetType()), + TargetID: v.GetTargetId(), + })) + } + } + + add = append(add, one) + + continue + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple( + m.ClickType.Value(int8(v.GetClickType())), + m.ImgURL.Value(v.GetImgUrl()), + m.WebURL.Value(v.GetWebUrl()), + m.AppParam.Value(v.GetAppParam()), + m.PcParam.Value(v.GetPcParam()), + m.TargetType.Value(int8(v.GetTargetType())), + m.TargetID.Value(v.GetTargetId()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + delete(oldMap, old.ID) + + switch old.ClickType { + case mtype.FissionCampaignLongImgClickTypeAll: + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + for _, hotZone := range v.GetHotZone() { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: old.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + })) + } + } + case mtype.FissionCampaignLongImgClickTypeZone: + if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeAll { + _, err = zoneM.WithContext(s.Ctx).Where(zoneM.ImgID.Eq(old.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } else if v.GetClickType() == mtype.FissionCampaignLongImgClickTypeZone { + var zones []*model.FissionCampaignLongImgZone + zones, err = zoneM.WithContext(s.Ctx).Where(zoneM.ImgID.Eq(old.ID), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldZoneMap = make(map[int64]*model.FissionCampaignLongImgZone, len(zones)) + for _, click := range zones { + oldZoneMap[click.ID] = click + } + + for _, hotZone := range v.GetHotZone() { + oldZone, ok1 := oldZoneMap[hotZone.GetId()] + if !ok1 { + zone = append(zone, withdefault.FissionCampaignLongImgZone(&model.FissionCampaignLongImgZone{ + CampaignID: conf.CampaignID, + ImgID: old.ID, + WebURL: hotZone.GetWebUrl(), + AppParam: hotZone.GetAppParam(), + PcParam: hotZone.GetPcParam(), + ClickX: hotZone.GetClickX(), + ClickY: hotZone.GetClickY(), + ClickH: hotZone.GetClickH(), + ClickW: hotZone.GetClickW(), + TargetType: int8(hotZone.GetTargetType()), + TargetID: hotZone.GetTargetId(), + })) + + continue + } + + _, err = zoneM.WithContext(s.Ctx).Where(zoneM.ID.Eq(oldZone.ID)).UpdateSimple( + zoneM.WebURL.Value(hotZone.GetWebUrl()), + zoneM.AppParam.Value(hotZone.GetAppParam()), + zoneM.PcParam.Value(hotZone.GetPcParam()), + zoneM.ClickX.Value(hotZone.GetClickX()), + zoneM.ClickY.Value(hotZone.GetClickY()), + zoneM.ClickH.Value(hotZone.GetClickH()), + zoneM.ClickW.Value(hotZone.GetClickW()), + zoneM.TargetType.Value(int8(hotZone.GetTargetType())), + zoneM.TargetID.Value(hotZone.GetTargetId()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + delete(oldZoneMap, oldZone.ID) + } + + for id := range oldZoneMap { + zoneDelIds = append(zoneDelIds, id) + } + } + } + } + + var imgDelIds []int64 + for id := range oldMap { + imgDelIds = append(imgDelIds, id) + } + + if len(add) > 0 { + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(zone) > 0 { + err = zoneM.WithContext(s.Ctx).Create(zone...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(imgDelIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(imgDelIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(zoneDelIds) > 0 { + _, err = zoneM.WithContext(s.Ctx).Where(zoneM.ID.In(zoneDelIds...)).UpdateSimple(zoneM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Update) _updateRunningReward(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignReward + var up = func(list []*pb.UpdateReq_Reward) error { + var ids []int64 + for _, v := range list { + ids = append(ids, v.Id) + s.rewardAdd[v.GetId()] = v.GetOpenAdd() + s.rewardTask[v.GetId()] = v.GetRewardTask() + } + + rewards, err1 := m.WithContext(s.Ctx).Where(m.ID.In(ids...), m.CampaignID.Eq(cpn.ID)).Find() + if err1 != nil { + return s.BE().MysqlError(err1) + } + var oldMap = make(map[int64]*model.FissionCampaignReward, len(rewards)) + for _, v := range rewards { + oldMap[v.ID] = v + } + + var stockUpIds []int64 + var delStockId []int64 + for i, reward := range list { + old, ok := oldMap[reward.GetId()] + if !ok { + continue + } + + var upData []field.AssignExpr + + if old.Step != int32(i) { + upData = append(upData, m.Sort.Value(int32(i))) + } + + if old.Score != reward.GetScore() { + upData = append(upData, m.Score.Value(reward.GetScore())) + } + + if old.Odds != reward.GetOdds() { + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningOdds(old.ID, old.Odds, reward.GetOdds()) + + upData = append(upData, m.Odds.Value(reward.GetOdds())) + } + + if old.Stock != reward.GetStock() { + delStockId = append(delStockId, old.ID) + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningStock(old.ID, old.Stock, reward.GetStock()) + + if old.Stock < reward.GetStock() { + stockUpIds = append(stockUpIds, old.ID) + } + + upData = append(upData, m.Stock.Value(reward.GetStock())) + } + + if old.InitPercent != reward.GetInitPercent() { + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningInitPercent(old.ID, old.InitPercent, reward.GetInitPercent()) + + upData = append(upData, m.InitPercent.Value(reward.GetInitPercent())) + } + + if old.OpenAdd != int8(reward.GetOpenAdd().GetOpen()) { + upData = append(upData, m.OpenAdd.Value(int8(reward.GetOpenAdd().GetOpen()))) + } + + if old.OpenTask != int8(reward.GetRewardTask().GetOpen()) { + upData = append(upData, m.OpenTask.Value(int8(reward.GetRewardTask().GetOpen()))) + } + + hasRule := utils.Ternary[int8](reward.GetCampaignLimit() > 0, mtype.Yes, mtype.No) + if old.HasRule != hasRule { + upData = append(upData, m.HasRule.Value(hasRule)) + } + + if cpn.FissionID == consts.IdDice { + cr, _ := jsonm.MarshalToString(mtype.CollectRule{ + Open: reward.GetCollectRule().GetOpen(), + InitCollect: reward.GetCollectRule().GetInitCollect(), + SignDay: reward.GetCollectRule().GetSignDay(), + AddCollect: reward.GetCollectRule().GetAddCollect(), + ResetType: reward.GetCollectRule().GetResetType(), + }) + + oldCr, newCr := utils.Md5Any(old.GetCollectRule()), utils.Md5String(cr) + if oldCr != newCr { + upData = append(upData, m.CollectRule.Value(cr)) + } + } + + if len(upData) == 0 { + continue + } + + _, err1 = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(upData...) + if err1 != nil { + return s.BE().MysqlError(err1) + } + + s.AddAfterRun(func() (err error) { + _ = cmm.NewUserAppReward(s.Ctx).Delete(old.CampaignID, int8(s.Req.GetRewards().GetRewardGroup()), old.LangMark, old.LevelID, old.CountryMark) + return + }) + } + + s.AddAfterRun(func() (err error) { + if len(delStockId) > 0 { + stocks.NewCleaner(s.Ctx, delStockId...).ClearAllReward() + } + + if verify.InArray[int64](cpn.FissionID, consts.IdGrow) && len(stockUpIds) > 0 { + _ = app.NewVerControl(s.Ctx, ckey.FissionRewardLimitUpVer(cpn.ID), vercontrol.SetExpire(time.Hour)).Create(time.Now(), func() error { + producer.NewCampaignNotice(s.Ctx).RewardLimitUp(types.RewardLimitUp{CampaignId: cpn.ID, RewardIds: stockUpIds}) + return nil + }) + } + + return + }) + + return nil + } + + err = up(s.Req.GetRewards().GetNormal()) + if err != nil { + return + } + + for _, v := range s.Req.GetRewards().GetUserLevel().GetLevelList() { + err = up(v.GetRewards()) + if err != nil { + return + } + } + + for _, v := range s.Req.GetRewards().GetLangs() { + err = up(v.GetRewards()) + if err != nil { + return + } + } + + for _, v := range s.Req.GetRewards().GetLangUserLevel() { + for _, reward := range v.GetLevelList() { + err = up(reward.GetRewards()) + if err != nil { + return + } + } + } + + for _, v := range s.Req.GetRewards().GetCountry().GetCountryList() { + err = up(v.GetRewards()) + if err != nil { + return + } + } + + err = s._updateRule(cpn.ID) + if err != nil { + return + } + + if cpn.FissionID == consts.IdChop { + err = s._updateHelp(cpn.ID) + if err != nil { + return + } + } + + return s._updateHelpTicket(cpn) +} + +func (s *Update) _updateRule(cpnId int64) (err error) { + m := s.GetDao().FissionCampaignRewardRule + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.FissionCampaignRewardRule, len(list)) + for _, v := range list { + oldMap[v.RewardID] = v + } + + olUser := s.OL().User(s.Req.GetUserId(), s.Req.GetIp()) + var delIds []int64 + var add []*model.FissionCampaignRewardRule + var bfn = func(rewards []*pb.UpdateReq_Reward) (err error) { + for _, v := range rewards { + + old, ok := oldMap[v.GetId()] + if !ok { + if v.GetCampaignLimit() > 0 { + id := hashid.IdBigint() + add = append(add, withdefault.FissionCampaignRewardRule(&model.FissionCampaignRewardRule{ + CampaignID: cpnId, + RewardID: v.GetId(), + CampaignLimit: v.GetCampaignLimit(), + })) + olUser.UpdateRunningRewardRule(id, 0, v.GetCampaignLimit()) + } + continue + } + + if v.GetCampaignLimit() > 0 { + if v.GetCampaignLimit() != old.CampaignLimit { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(m.CampaignLimit.Value(v.GetCampaignLimit())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + olUser.UpdateRunningRewardRule(v.GetId(), old.CampaignLimit, v.GetCampaignLimit()) + } + continue + } + + delIds = append(delIds, old.ID) + olUser.UpdateRunningRewardRule(v.GetId(), old.CampaignLimit, 0) + } + return + } + + err = s._switchRewardGroupDo(bfn) + if err != nil { + return + } + + if len(add) > 0 { + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + } + } + + if len(delIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + } + } + + s.AddAfterRun(func() (err error) { + _ = cache.NewCampaignRewardRule(s.Ctx).Clear(list...) + return + }) + + return +} + +func (s *Update) updateFlip(cpn *model.FissionCampaign) (err error) { + var flip = s.Req.GetFlip() + + cc := cache.NewCampaignFlip(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found flip conf") + } + + confM := s.GetDao().FissionCampaignFlip + var data []field.AssignExpr + defer func() { + + if err == nil && len(data) > 0 { + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + _ = cc.Clear(conf) + }() + + data = append(data, + confM.CardImg.Value(flip.GetCardImg()), + confM.DayChance.Value(flip.GetDayChance()), + ) + + if cpn.Status != mtype.FissionCampaignStatusWait { //不是待发布状态不能修改配置 + return + } + + data = append(data, + confM.InitChance.Value(flip.GetInitChance()), + ) + + //更新了初次抽奖机会,要处理玩家数据,预防有一些人没开始就进入游戏了,要同步一下数据 + if conf.InitChance != flip.GetInitChance() { + fpwM := s.GetDao().FissionFlip + _, err = fpwM.WithContext(s.Ctx).Where(fpwM.CampaignID.Eq(cpn.ID)).UpdateSimple(fpwM.Chance.Value(flip.GetInitChance())) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +// 助力规则 +func (s *Update) _updateHelpTicket(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignTicket + + ticket, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.Eq(mtype.FissionCampaignTicketRewardHelp), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var helpEvent []string + if s.helpInstall { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventInstall) + } + + if s.helpRegister { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventRegister) + } + + if s.helpOpen { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventOpen) + } + + if s.helpClick { + helpEvent = append(helpEvent, mtype.FissionCampaignTicketHelpEventClick) + } + + if len(helpEvent) == 0 { + + if ticket != nil && ticket.Open == mtype.Yes { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(ticket.ID)).UpdateSimple(m.Open.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return + } + + if ticket == nil { + err = m.WithContext(s.Ctx).Create(withdefault.FissionCampaignTicket(&model.FissionCampaignTicket{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignTicketRewardHelp, + Open: mtype.Yes, + HelpEvent: strings.Join(helpEvent, ","), + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(ticket.ID)).UpdateSimple( + m.Open.Value(mtype.Yes), + m.HelpEvent.Value(strings.Join(helpEvent, ",")), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Update) updateKeep(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignKeep(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found conf") + } + + keep := s.Req.GetKeepDog() + + invite, _ := jsonm.MarshalToString(keep.GetInvite()) + talkText, _ := jsonm.MarshalToString(keep.GetTalkText()) + + m := s.GetDao().FissionCampaignKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple( + m.Collect.Value(keep.GetCollect()), + m.CollectSecond.Value(keep.GetCollectSecond()), + m.OpenInvite.Value(int8(keep.GetOpenInvite())), + m.Invite.Value(invite), + m.InitGet.Value(keep.GetInitGet()), + m.SecGet.Value(keep.GetSecGet()), + m.FeedNum.Value(keep.GetFeedNum()), + m.FeedCycle.Value(keep.GetFeedCycle()), + m.TalkText.Value(talkText), + m.MaxFeed.Value(keep.GetMaxFeed()), + m.FeedGet.Value(keep.GetFeedGet()), + m.FeedGetNum.Value(keep.GetFeedGetNum()), + m.SecGetDayLimit.Value(keep.GetSecGetDayLimit()), + m.MachineType.Value(int8(keep.GetMachineType())), + m.OfflineGet.Value(keep.GetOfflineGet()), + m.OfflineMin.Value(keep.GetOfflineMin()), + m.OfflineLimit.Value(keep.GetOfflineLimit()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignKeep(s.Ctx).Clear(conf) + }) + + inviteConf := conf.GetInvite() + if inviteConf != nil && inviteConf.InviteMaxGet > 0 && inviteConf.InviteMaxGet < keep.GetInvite().GetInviteMaxGet() { + keepM := s.GetDao().FissionKeep + _, err = keepM.WithContext(s.Ctx).Where( + keepM.CampaignID.Eq(cpn.ID), + keepM.InviteLimit.Eq(mtype.Yes), + ).UpdateSimple(keepM.InviteLimit.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 把没有参与离线狗粮机的数据都参与一下 + if conf.MachineType == mtype.FissionCampaignKeepMachineTypeOnline && keep.GetMachineType() == mtype.FissionCampaignKeepMachineTypeOffline { + keepM := s.GetDao().FissionKeep + _, err = keepM.WithContext(s.Ctx).Where( + keepM.CampaignID.Eq(cpn.ID), + keepM.RewardID.Gt(0), + keepM.RecordID.Eq(0), + keepM.ReceiveOffline.Eq(0), + ).UpdateSimple(keepM.ReceiveOffline.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + stepM := s.GetDao().FissionCampaignKeepStep + oldSteps, err := stepM.WithContext(s.Ctx).Where(stepM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + var oldMap = make(map[int32]*model.FissionCampaignKeepStep) + for _, v := range oldSteps { + oldMap[v.Step] = v + if v.RewardID > 0 { + rewardIds = append(rewardIds, v.RewardID) + } + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewardIds)) + if len(rewardIds) > 0 { + rewardM := s.GetDao().FissionCampaignReward + var rewards []*model.FissionCampaignReward + rewards, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range rewards { + rewardMap[v.ID] = v + } + } + + var delRewardIds []int64 + var steps []*model.FissionCampaignKeepStep + for _, v := range keep.GetSteps() { + old, ok := oldMap[v.GetStep()] + if !ok { + step := withdefault.FissionCampaignKeepStep(&model.FissionCampaignKeepStep{ + CampaignID: cpn.ID, + Step: v.GetStep(), + Percent: v.GetPercent(), + RewardType: int8(v.GetRewardType()), + RewardID: 0, + RewardNum: v.GetRewardNum(), + }) + + if v.GetRewardType() == mtype.FissionCampaignKeepStepRewardTypeReward { + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: v.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeGrowStep, + Step: v.GetStep(), + RewardNum: 1, + RewardID: v.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + step.RewardID = rewardId + } + + steps = append(steps, step) + continue + } + + var up = []field.AssignExpr{ + stepM.Percent.Value(v.GetPercent()), + stepM.RewardType.Value(int8(v.GetRewardType())), + stepM.RewardNum.Value(v.GetRewardNum()), + stepM.IsDel.Value(mtype.No), + } + if old.RewardType == mtype.FissionCampaignKeepStepRewardTypeProp && v.GetRewardType() == mtype.FissionCampaignKeepStepRewardTypeReward { + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: v.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeGrowStep, + Step: v.GetStep(), + RewardNum: 1, + RewardID: v.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + + up = append(up, stepM.RewardID.Value(rewardId)) + } else if old.RewardType == mtype.FissionCampaignKeepStepRewardTypeReward && v.GetRewardType() == mtype.FissionCampaignKeepStepRewardTypeProp { + delRewardIds = append(delRewardIds, old.RewardID) + up = append(up, stepM.RewardID.Value(0)) + } else if old.RewardType == mtype.FissionCampaignKeepStepRewardTypeReward && v.GetRewardType() == mtype.FissionCampaignKeepStepRewardTypeReward { + if rewardMap[old.RewardID].RewardID != v.GetReward().GetRewardId() { + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: v.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeGrowStep, + Step: v.GetStep(), + RewardNum: 1, + RewardID: v.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + + delRewardIds = append(delRewardIds, old.RewardID) + up = append(up, stepM.RewardID.Value(rewardId)) + } else { + rewardM := s.GetDao().FissionCampaignReward + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(old.RewardID)).UpdateSimple( + rewardM.Stock.Value(v.GetReward().GetStock()), + rewardM.Step.Value(v.GetStep()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + stocks.NewCleaner(s.Ctx, old.RewardID).ClearAllReward() + } + + } + + _, err = stepM.WithContext(s.Ctx).Where(stepM.ID.Eq(old.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + delete(oldMap, v.GetStep()) + } + + var delIds []int64 + for _, v := range oldMap { + delIds = append(delIds, v.ID) + } + + if len(delIds) > 0 { + _, err = stepM.WithContext(s.Ctx).Where(stepM.ID.In(delIds...)).UpdateSimple(stepM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(steps) > 0 { + err = stepM.WithContext(s.Ctx).Create(steps...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delRewardIds) > 0 { + rewardM := s.GetDao().FissionCampaignReward + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(delIds...)).UpdateSimple(rewardM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Update) updatePush(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignPush + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var pushMap = make(map[string]*model.FissionCampaignPush, len(list)) + for _, v := range list { + pushMap[v.Mark] = v + } + + var delKey []string + var add []*model.FissionCampaignPush + + if s.Req.GetPush().GetTaskReset().GetOpen() == mtype.Yes { + cond, _ := jsonm.ToSliceString(s.Req.GetPush().GetTaskReset().GetPushCond()) + + if push, ok := pushMap[mtype.FissionCampaignPushMarkTaskReset]; ok { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Cond.Value(cond), m.Open.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } else { + add = append(add, &model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkTaskReset, + Cond: cond, + Open: mtype.Yes, + }) + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(cpn.ID, mtype.FissionCampaignPushMarkTaskReset)) + } + } else { + if push, ok := pushMap[mtype.FissionCampaignPushMarkTaskReset]; ok && push.Open == mtype.Yes { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Open.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } + + } + + if s.Req.GetPush().GetActive().GetOpen() == mtype.Yes { + cond, _ := jsonm.ToSliceString(s.Req.GetPush().GetActive().GetPushCond()) + if push, ok := pushMap[mtype.FissionCampaignPushMarkActive]; ok { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Cond.Value(cond), m.Open.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } else { + add = append(add, withdefault.FissionCampaignPush(&model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkActive, + Cond: cond, + Open: mtype.Yes, + })) + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(cpn.ID, mtype.FissionCampaignPushMarkActive)) + } + } else { + if push, ok := pushMap[mtype.FissionCampaignPushMarkActive]; ok && push.Open == mtype.Yes { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Open.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } + } + + if s.Req.GetPush().GetOffline().GetOpen() == mtype.Yes { + cond, _ := jsonm.ToSliceString(s.Req.GetPush().GetOffline().GetPushCond()) + if push, ok := pushMap[mtype.FissionCampaignPushMarkOffline]; ok { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Cond.Value(cond), m.Open.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } else { + add = append(add, &model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkOffline, + Cond: cond, + Open: mtype.Yes, + }) + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(cpn.ID, mtype.FissionCampaignPushMarkOffline)) + } + } else { + if push, ok := pushMap[mtype.FissionCampaignPushMarkOffline]; ok && push.Open == mtype.Yes { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Open.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } + } + + if s.Req.GetPush().GetVisit().GetOpen() == mtype.Yes { + if push, ok := pushMap[mtype.FissionCampaignPushMarkVisit]; ok { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Open.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } else { + add = append(add, &model.FissionCampaignPush{ + CampaignID: cpn.ID, + Mark: mtype.FissionCampaignPushMarkVisit, + Cond: "{}", + Open: mtype.Yes, + }) + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(cpn.ID, mtype.FissionCampaignPushMarkVisit)) + } + } else { + if push, ok := pushMap[mtype.FissionCampaignPushMarkVisit]; ok && push.Open == mtype.Yes { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.Open.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + delKey = append(delKey, ckey.FissionRewardPushOpenOnce(push.CampaignID, push.Mark)) + } + } + + if len(add) > 0 { + err = s.GetDao().FissionCampaignPush.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delKey) > 0 { + app.Redis.Cache.Del(s.Ctx, delKey...) + } + + return +} + +func (s *Update) syncLinkTemp(cpn *model.FissionCampaign) (err error) { + if !s.changeTemp { + return + } + + _, err = app.NewDeepLinkLink().UpdateCampaignLinkOne(s.Ctx, &dlinkpb.UpdateCampaignLinkOneReq{ + ProjectId: cpn.ProjectID, + CampaignId: cpn.ID, + TemplateKey: s.Req.GetConfig().GetLinkTempId(), + }) + if err != nil { + return + } + + return +} + +// 其他形式的奖品追加 +func (s *Update) _otherAppendReward(rewards ...*model.FissionCampaignReward) { + for _, reward := range rewards { + if _, ok := s.otherRelateMap[reward.RewardID]; !ok && reward.RewardID > 0 { + s.otherRelateMap[reward.RewardID] = struct{}{} + s.otherRelateIds = append(s.otherRelateIds, reward.RewardID) + } + + s.otherReward = append(s.otherReward, reward) + } +} + +func (s *Update) updateChild(cpn *model.FissionCampaign) (err error) { + var hashIds []string + for _, child := range s.Req.GetChild() { + if child.GetHashId() == "" { + continue + } + hashIds = append(hashIds, child.GetHashId()) + } + + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.Ctx).Where(m.HashID.In(hashIds...), m.Target.Eq(mtype.FissionCampaignConfigTargetChild), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + childM := s.GetDao().FissionCampaignChild + childs, err := childM.WithContext(s.Ctx).Where(childM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]int64, len(childs)) + for _, v := range childs { + oldMap[v.ChildID] = v.ID + } + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + var add []*model.FissionCampaignChild + for _, v := range list { + if _, ok := oldMap[v.ID]; !ok { + add = append(add, withdefault.FissionCampaignChild(&model.FissionCampaignChild{ + CampaignID: cpn.ID, + ChildID: v.ID, + Type: v.ChildType, + })) + + var status = v.Status + var start, end int64 + if v.TStart > 0 { + start = timez.GMT(v.TStart, cpn.TOffset) + if start >= time.Now().Unix() { + status = mtype.FissionCampaignStatusPub + } + } + + if v.TEnd > 0 { + end = timez.GMT(v.TEnd, cpn.TOffset) + if end <= time.Now().Unix() { + status = mtype.FissionCampaignStatusCancel + } + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(v.ID)).UpdateSimple( + m.StartTime.Value(start), + m.EndTime.Value(end), + m.Pid.Value(cpn.ID), + m.Status.Value(status), + m.TOffset.Value(cpn.TOffset), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = cm.AnalyzeCampaign(v.ProjectID, v.ID, start, end, 0) + if err != nil { + return + } + + continue + } + + delete(oldMap, v.ID) + } + + var delIds []int64 + for _, id := range oldMap { + delIds = append(delIds, id) + } + + if len(delIds) > 0 { + _, err = childM.WithContext(s.Ctx).Where(childM.ID.In(delIds...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(add) > 0 { + err = childM.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignChild(s.Ctx).Clear(childs...) + }) + + return +} + +// 更新活动样式 +func (s *Update) _updateStyle(cpn *model.FissionCampaign) (err error) { + cc := cache.NewCampaignStyle(s.Ctx) + style, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + cf := s.Req.GetConfig() + m := s.GetDao().FissionCampaignStyle + + var data = []field.AssignExpr{ + m.RuleTextColor.Value(cf.GetRuleTextColor()), + m.RuleBgColor.Value(cf.GetRuleBgColor()), + m.ShareText.Value(cf.GetShareText()), + m.ShareImg.Value(cf.GetShareImg()), + m.RankBackgroundColor.Value(cf.GetRankBackgroundColor()), + m.RankTextColor.Value(cf.GetRankTextColor()), + m.DownloadImg.Value(cf.GetDownloadPageImage()), + m.WechatImg.Value(cf.GetWechatPageImage()), + m.MainImg.Value(cf.GetImageMain()), + m.BgImg.Value(cf.GetImagePreview()), + m.LinkBtnTextColor.Value(cf.GetLinkBtnTextColor()), + m.LinkBtnBgColor.Value(cf.GetLinkBtnBgColor()), + m.LinkTextColor.Value(cf.GetLinkTextColor()), + m.PageTitle.Value(cf.GetPageTitle()), + m.WebImg.Value(cf.GetWebBgImg()), + m.IconType.Value(int8(cf.GetIconType())), + m.IconBgColor.Value(cf.GetIconBgColor()), + m.DlBannerImg.Value(cf.GetDlBannerImg()), + m.DlBannerAppLogo.Value(cf.GetDlBannerAppLogo()), + m.DlBannerAppName.Value(cf.GetDlBannerAppName()), + m.DlBannerAppBtn.Value(cf.GetDlBannerAppBtn()), + m.DlBannerPosition.Value(int8(cf.GetDlBannerPosition())), + m.TopicColor.Value(cf.GetTopicColor()), + m.PlayRule.Value(cf.GetPlayRule()), + m.PcBg.Value(cf.GetPcBg()), + m.IconTextColor.Value(cf.GetIconTextColor()), + m.RuleImg.Value(cf.GetRuleImg()), + } + + share, _ := jsonm.MarshalToString(cf.GetShare()) + data = append(data, m.Share.Value(share)) + + iconOpen, _ := jsonm.MarshalToString(cf.GetIconOpen()) + data = append(data, m.IconOpen.Value(iconOpen)) + + switch cpn.FissionID { + case consts.IdPrizeWheel: + custom := s.Req.GetWheelStyle() + customStyle, _ := jsonm.ToObjString(mtype.WheelStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + Bottom1: custom.GetBottom1(), + Bottom2: custom.GetBottom2(), + Bottom3: custom.GetBottom3(), + Pointer: custom.GetPointer(), + PlayBtn: custom.GetPlayBtn(), + BorderImg: custom.GetBorderImg(), + ButtonColor: custom.GetButtonColor(), + WheelTextColor: custom.GetWheelTextColor(), + }) + data = append(data, m.CustomStyle.Value(customStyle)) + case consts.IdLuckyGrid: + custom := s.Req.GetGridStyle() + customStyle, _ := jsonm.ToObjString(mtype.GridStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + ButtonColor: custom.GetButtonColor(), + PlayImg: custom.GetPlayImg(), + DisablePlayImg: custom.GetDisablePlayImg(), + MachineImg: custom.GetMachineImg(), + GridImg: custom.GetGridImg(), + ActivateImg: custom.GetActivateImg(), + }) + + data = append(data, m.CustomStyle.Value(customStyle)) + case consts.IdFlip: + custom := s.Req.GetFlipStyle() + customStyle, _ := jsonm.ToObjString(mtype.FlipStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + ButtonColor: custom.GetButtonColor(), + PlayImg: custom.GetPlayImg(), + CardImg: custom.GetCardImg(), + }) + + data = append(data, m.CustomStyle.Value(customStyle)) + case consts.IdGashapon: + custom := s.Req.GetGashaponStyle() + customStyle, _ := jsonm.ToObjString(mtype.GashaponStyle{ + TopicMark: custom.GetTopicMark(), + MainImg: custom.GetMainImg(), + BgColor: custom.GetBgColor(), + MachineImg: custom.GetMachineImg(), + PlayImg: custom.GetPlayImg(), + EggType: custom.GetEggType(), + EggImgs: custom.GetEggImgs(), + }) + + data = append(data, m.CustomStyle.Value(customStyle)) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(style.ID)).UpdateSimple(data...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + _ = cc.Clear(style) + return + }) + + return +} + +func (s *Update) updateGold(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignGold + + conf, err := cache.NewCampaignGold(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found cash conf") + } + + var gold = s.Req.GetGold() + + var data = []field.AssignExpr{ + m.PriceNum.Value(gold.GetPriceNum()), + m.GoldNum.Value(gold.GetGoldNum()), + m.ExpiredDay.Value(gold.GetExpiredDay()), + m.Price.Value(gold.GetPrice()), + m.Currency.Value(int8(gold.GetCurrency())), + } + + if conf.PriceNum != gold.GetPriceNum() { + s.OL().User(s.Req.UserId, s.Req.Ip).UpdateRunningGoldStock(conf.ID, conf.PriceNum, gold.GetPriceNum()) + + data = append(data, m.Lack.Value(mtype.No)) + + s.AddAfterRun(func() (err error) { + + stocks.NewCleaner(s.Ctx, cpn.ID).ClearCampaign() + + return + }) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignGold(s.Ctx).Clear(conf) + }) + + return +} + +func (s *Update) updateCoin(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignCoin + + conf, err := cache.NewCampaignCoin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found cash conf") + } + + var coin = s.Req.GetCoin() + lackBtn, _ := jsonm.ToSliceString(coin.GetLackBtn()) + var data = []field.AssignExpr{ + m.CoinImg.Value(coin.GetCoinImg()), + m.OpenDays.Value(coin.GetOpenDays()), + m.OpenLimit.Value(coin.GetOpenLimit()), + m.InitCoin.Value(coin.GetInitCoin()), + m.InitUse.Value(coin.GetInitUse()), + m.UseCoin.Value(coin.GetUseCoin()), + m.UseLimit.Value(coin.GetUseLimit()), + m.URLID.Value(coin.GetUrlId()), + m.LackBtn.Value(lackBtn), + m.CustomBtnText.Value(coin.GetCustomBtnText()), + m.CustomWebURL.Value(coin.GetCustomWebUrl()), + m.CustomExtraParam.Value(coin.GetCustomExtraParam()), + m.CustomPcParam.Value(coin.GetCustomPcParam()), + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(data...) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignCoin(s.Ctx).Clear(conf) + }) + + // 创建自定义按钮 + if verify.InArray[int32](mtype.FissionCampaignCoinLackBtnCustom, coin.GetLackBtn()...) && conf.CustomBtnText != coin.GetCustomBtnText() { + var customBtn *model.FissionCustomBtn + customBtn, err = cache.NewFissionCustomBtn(s.Ctx).FindByUniq(cpn.ID, coin.GetCustomBtnText()) + if err != nil { + return s.BE().CacheError(err) + } + + if customBtn == nil { + customBtn = withdefault.FissionCustomBtn(&model.FissionCustomBtn{ + CampaignID: cpn.ID, + BtnText: coin.GetCustomBtnText(), + }) + + if err = s.GetDao().FissionCustomBtn.WithContext(s.Ctx).Create(customBtn); err != nil { + return s.BE().MysqlError(err) + } + } + + } + + if coin.GetOpenDays() == conf.OpenDays && + coin.GetInitCoin() == conf.InitCoin && + coin.GetInitUse() == conf.InitUse && + s.Req.GetStartTime() == cpn.TStart { + return + } + + sceneM := s.GetDao().FissionCoinScene + + // 如果活动没开始,改了开始时间,要重制场次 + if cpn.Status == mtype.FissionCampaignStatusWait && s.Req.GetStartTime() != cpn.TStart { + _, err = sceneM.WithContext(s.Ctx).Where(sceneM.CampaignID.Eq(cpn.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + start := timez.GMT(s.Req.GetStartTime(), s.Req.GetTOffset()) + _, dayStart, _ := timez.GMTStartAndEndTs(cpn.TOffset, start) + _, nowStart, _ := timez.GMTStartAndEndTs(cpn.TOffset) + if dayStart < nowStart { + dayStart = nowStart + } + + openTime := dayStart + int64(coin.OpenDays*consts.DaySec) + rewardTime := openTime + consts.DaySec + + scene := withdefault.FissionCoinScene(&model.FissionCoinScene{ + CampaignID: cpn.ID, + OpenTime: openTime, + InitCoin: coin.GetInitCoin(), + InitUse: coin.GetInitUse(), + RewardTime: rewardTime, + }) + + if err = s.GetDao().FissionCoinScene.WithContext(s.Ctx).Create(scene); err != nil { + return s.BE().MysqlError(err) + } + + return + } + + // 修改一些场次信息 + diffDay := coin.GetOpenDays() - conf.OpenDays + scenes, err := sceneM.WithContext(s.Ctx).Where(sceneM.CampaignID.Eq(cpn.ID), sceneM.OpenTime.Gt(time.Now().Unix())).Find() + if err != nil { + return + } + + for _, scene := range scenes { + var up []field.AssignExpr + + if diffDay != 0 { + newOpenTime := scene.OpenTime + int64(diffDay*consts.DaySec) + + // 如果开奖大于1天,才可以改时间 + if newOpenTime-scene.OpenTime > consts.DaySec { + up = append(up, sceneM.OpenTime.Value(newOpenTime), sceneM.RewardTime.Value(newOpenTime+consts.DaySec)) + } + } + + if coin.GetInitCoin() != conf.InitCoin { + up = append(up, sceneM.InitCoin.Value(coin.GetInitCoin())) + } + + if coin.GetInitUse() != conf.InitUse { + up = append(up, sceneM.InitUse.Value(coin.GetInitUse())) + } + + _, err = sceneM.WithContext(s.Ctx).Where(sceneM.ID.Eq(scene.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + } + + return +} + +func (s *Update) updateVs(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignVs(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found vs conf") + } + + vs := s.Req.GetVs() + + m := s.GetDao().FissionCampaignV + var up []field.AssignExpr + + if conf.EachLimitNum != vs.GetEachLimitNum() { + up = append(up, m.EachLimitNum.Value(vs.GetEachLimitNum())) + } + + if conf.OpenPoint != int8(vs.GetOpenPoint()) { + up = append(up, m.OpenPoint.Value(int8(vs.GetOpenPoint()))) + } + + if conf.InitChance != vs.GetInitChance() { + up = append(up, m.InitChance.Value(vs.GetInitChance())) + } + + if conf.PointsNum != vs.GetPointsNum() { + up = append(up, m.PointsNum.Value(vs.GetPointsNum())) + } + + if conf.MallOpen != int8(vs.GetMallOpen()) { + up = append(up, m.MallOpen.Value(int8(vs.GetMallOpen()))) + } + + if conf.MallID != vs.GetMallId() { + up = append(up, m.MallID.Value(vs.GetMallId())) + + var mallRelate *malls.Relate + mallRelate, err = malls.NewRelate(s.Ctx, cpn.ID, cpn.TableName(), logic.WithDao(s.GetDao())) + if err != nil { + return + } + + err = mallRelate.Related(mtype.RedeemMallRelateSourceCampaign, vs.GetMallId()) + if err != nil { + return + } + } + + if conf.VsTz != vs.GetVsTz() { + up = append(up, m.VsTz.Value(vs.GetVsTz())) + } + + if conf.ClaimType != int8(vs.GetClaimType()) { + up = append(up, m.ClaimType.Value(int8(vs.GetClaimType()))) + } + + if conf.IconMall != vs.GetIconMall() { + up = append(up, m.IconMall.Value(vs.GetIconMall())) + } + + if conf.IconReward != vs.GetIconReward() { + up = append(up, m.IconReward.Value(vs.GetIconReward())) + } + + if conf.IconSchedule != vs.GetIconSchedule() { + up = append(up, m.IconSchedule.Value(vs.GetIconSchedule())) + } + + if len(up) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignVs(s.Ctx).Clear(conf) + }) + } + + scheduleM := s.GetDao().FissionCampaignVsSchedule + oldSchedule, err := scheduleM.WithContext(s.Ctx).Where(scheduleM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldScheduleMap = make(map[int64]*model.FissionCampaignVsSchedule, len(oldSchedule)) + for _, schedule := range oldSchedule { + oldScheduleMap[schedule.ID] = schedule + } + + rewardM := s.GetDao().FissionCampaignReward + oldRewards, err := rewardM.WithContext(s.Ctx).Where( + rewardM.CampaignID.Eq(cpn.ID), + rewardM.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + rewardM.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldRewardMap = make(map[int64]*model.FissionCampaignReward, len(oldRewards)) + for _, reward := range oldRewards { + oldRewardMap[reward.ID] = reward + } + + teamM := s.GetDao().FissionCampaignVsTeam + oldTeams, err := teamM.WithContext(s.Ctx).Where(teamM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldTeamMap = make(map[int64]*model.FissionCampaignVsTeam, len(oldTeams)) + for _, team := range oldTeams { + oldTeamMap[team.ID] = team + } + + var emptyId int64 = -1 + var add []*model.FissionCampaignVsSchedule + var teams []*model.FissionCampaignVsTeam + for i, schedule := range vs.GetSchedules() { + + for _, pk := range schedule.GetPkTeams() { + voteStart, _ := timez.YmdHiParse(pk.GetVoteStart(), vs.GetVsTz()) + voteEnd, _ := timez.YmdHiParse(pk.GetVoteEnd(), vs.GetVsTz()) + vsAt, _ := timez.YmdHiParse(pk.GetVsDate(), vs.GetVsTz()) + + old, ok := oldScheduleMap[pk.GetId()] + if !ok { + + var vsTeamIds []int64 + for _, team := range pk.GetTeams() { + + if team.GetName() == "" && team.GetLogoImg() == "" { + vsTeamIds = append(vsTeamIds, emptyId) + emptyId-- + continue + } + + one := withdefault.FissionCampaignVsTeam(&model.FissionCampaignVsTeam{ + CampaignID: cpn.ID, + Name: team.GetName(), + LogoImg: team.GetLogoImg(), + }) + + vsTeamIds = append(vsTeamIds, one.ID) + teams = append(teams, one) + } + + var rewardNum int32 = 1 + if pk.GetPropMark() == mtype.FissionCampaignRewardPropMarkPoint { + rewardNum = pk.GetPropNum() + } + + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: -1, + RewardType: mtype.FissionCampaignRewardTypeApp, + RewardNum: rewardNum, + RewardID: pk.GetRewardId(), + PropMark: pk.GetPropMark(), + ExpiredDay: pk.GetExpiredDay(), + }) + + add = append(add, withdefault.FissionCampaignVsSchedule(&model.FissionCampaignVsSchedule{ + CampaignID: cpn.ID, + VsIdx: int32(i), + RewardID: rewardId, + VsTeamIds: "", + VsImg: pk.GetVsImg(), + VoteStart: voteStart.Unix(), + VoteEnd: voteEnd.Unix(), + VsAt: vsAt.Unix(), + Desc: pk.GetDesc(), + OpenOdds: int8(pk.GetOpenOdds()), + OddsLeft: pk.GetOddsLeft(), + OddsRight: pk.GetOddsRight(), + OddsDraw: pk.GetOddsDraw(), + }, vsTeamIds, pk.GetOtherVote())) + + continue + } + + delete(oldScheduleMap, pk.GetId()) + + var vsTeamIds []int64 + for _, team := range pk.GetTeams() { + oldTeam, ok1 := oldTeamMap[team.GetId()] + if !ok1 { + + if team.GetName() == "" && team.GetLogoImg() == "" { + vsTeamIds = append(vsTeamIds, emptyId) + emptyId-- + continue + } + + one := withdefault.FissionCampaignVsTeam(&model.FissionCampaignVsTeam{ + CampaignID: cpn.ID, + Name: team.GetName(), + LogoImg: team.GetLogoImg(), + }) + + vsTeamIds = append(vsTeamIds, one.ID) + teams = append(teams, one) + continue + } + + delete(oldTeamMap, team.GetId()) + + var upTeam []field.AssignExpr + + if oldTeam.Name != team.GetName() { + upTeam = append(upTeam, teamM.Name.Value(team.GetName())) + } + + if oldTeam.LogoImg != team.GetLogoImg() { + upTeam = append(upTeam, teamM.LogoImg.Value(team.GetLogoImg())) + } + + vsTeamIds = append(vsTeamIds, oldTeam.ID) + + if len(upTeam) > 0 { + _, err = teamM.WithContext(s.Ctx).Where(teamM.ID.Eq(oldTeam.ID)).UpdateSimple(upTeam...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + } + + var upSchedule []field.AssignExpr + + if old.VsIdx != int32(i) { + upSchedule = append(upSchedule, scheduleM.VsIdx.Value(int32(i))) + } + + if !verify.AllInArray[int64](vsTeamIds, old.GetVsTeamIds()) { + str, _ := jsonm.ToSliceString(vsTeamIds) + upSchedule = append(upSchedule, scheduleM.VsTeamIds.Value(str)) + } + + if !verify.AllInArray[string](pk.GetOtherVote(), old.GetOtherVote()) { + str, _ := jsonm.ToSliceString(pk.GetOtherVote()) + upSchedule = append(upSchedule, scheduleM.OtherVote.Value(str)) + } + + if old.VoteStart != voteStart.Unix() { + upSchedule = append(upSchedule, scheduleM.VoteStart.Value(voteStart.Unix())) + } + + if old.VoteEnd != voteEnd.Unix() { + upSchedule = append(upSchedule, scheduleM.VoteEnd.Value(voteEnd.Unix())) + } + + if old.VsAt != vsAt.Unix() { + upSchedule = append(upSchedule, scheduleM.VsAt.Value(vsAt.Unix())) + } + + if old.VsImg != pk.GetVsImg() { + upSchedule = append(upSchedule, scheduleM.VsImg.Value(pk.GetVsImg())) + } + + if old.Desc != pk.GetDesc() { + upSchedule = append(upSchedule, scheduleM.Desc.Value(pk.GetDesc())) + } + + if old.OpenOdds != int8(pk.GetOpenOdds()) { + upSchedule = append(upSchedule, scheduleM.OpenOdds.Value(int8(pk.GetOpenOdds()))) + } + + if old.OddsLeft != pk.GetOddsLeft() { + upSchedule = append(upSchedule, scheduleM.OddsLeft.Value(pk.GetOddsLeft())) + } + + if old.OddsRight != pk.GetOddsRight() { + upSchedule = append(upSchedule, scheduleM.OddsRight.Value(pk.GetOddsRight())) + } + + if old.OddsDraw != pk.GetOddsDraw() { + upSchedule = append(upSchedule, scheduleM.OddsDraw.Value(pk.GetOddsDraw())) + } + + oldReward, ok1 := oldRewardMap[old.RewardID] + if !ok1 || oldReward.PropMark != pk.GetPropMark() { + var rewardNum int32 = 1 + if pk.GetPropMark() == mtype.FissionCampaignRewardPropMarkPoint { + rewardNum = pk.GetPropNum() + } + + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: -1, + RewardType: mtype.FissionCampaignRewardTypeApp, + RewardNum: rewardNum, + RewardID: pk.GetRewardId(), + PropMark: pk.GetPropMark(), + ExpiredDay: pk.GetExpiredDay(), + }) + + upSchedule = append(upSchedule, scheduleM.RewardID.Value(rewardId)) + } else { + delete(oldRewardMap, old.RewardID) + + var upReward []field.AssignExpr + switch pk.GetPropMark() { + case mtype.FissionCampaignRewardPropMarkPoint: + if oldReward.RewardNum != pk.GetPropNum() { + upReward = append(upReward, rewardM.RewardNum.Value(pk.GetPropNum())) + } + + if oldReward.ExpiredDay != pk.GetExpiredDay() { + upReward = append(upReward, rewardM.ExpiredDay.Value(pk.GetExpiredDay())) + } + + case mtype.FissionCampaignRewardPropMarkReward: + if oldReward.RewardID != pk.GetRewardId() { + upReward = append(upReward, rewardM.RewardID.Value(pk.GetRewardId())) + } + } + + if len(upReward) > 0 { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(oldReward.ID)).UpdateSimple(upReward...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + } + + if len(upSchedule) > 0 { + _, err = scheduleM.WithContext(s.Ctx).Where(scheduleM.ID.Eq(old.ID)).UpdateSimple(upSchedule...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + } + } + + if len(add) > 0 { + if err = scheduleM.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(teams) > 0 { + if err = teamM.WithContext(s.Ctx).Create(teams...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + var delSchedule []int64 + for id := range oldScheduleMap { + delSchedule = append(delSchedule, id) + } + + if len(delSchedule) > 0 { + _, err = scheduleM.WithContext(s.Ctx).Where(scheduleM.ID.In(delSchedule...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + var delReward []int64 + for id := range oldRewardMap { + delReward = append(delReward, id) + } + + if len(delReward) > 0 { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(delReward...)).UpdateSimple(rewardM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + var delTeam []int64 + for id := range oldTeamMap { + delTeam = append(delTeam, id) + } + + if len(delTeam) > 0 { + _, err = teamM.WithContext(s.Ctx).Where(teamM.ID.In(delTeam...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Update) _updatePointsUse(cpn *model.FissionCampaign) (err error) { + req := s.Req.GetPointsUse() + if req.GetOpen() != mtype.Yes { + return + } + + pointUse, err := cache.NewCampaignPointsUse(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if pointUse == nil { + pointUse = withdefault.FissionCampaignPointsUse(&model.FissionCampaignPointsUse{ + CampaignID: cpn.ID, + Icon: req.GetIcon(), + URLID: req.GetUrlId(), + UseNum: req.GetUseNum(), + DayLimit: req.GetDayLimit(), + TotalLimit: req.GetTotalLimit(), + }) + + err = s.GetDao().FissionCampaignPointsUse.WithContext(s.Ctx).Create(pointUse) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + m := s.GetDao().FissionCampaignPointsUse + var up []field.AssignExpr + if pointUse.Icon != req.GetIcon() { + up = append(up, m.Icon.Value(req.GetIcon())) + } + + if pointUse.URLID != req.GetUrlId() { + up = append(up, m.URLID.Value(req.GetUrlId())) + } + + if pointUse.UseNum != req.GetUseNum() { + up = append(up, m.UseNum.Value(req.GetUseNum())) + } + + if pointUse.DayLimit != req.GetDayLimit() { + up = append(up, m.DayLimit.Value(req.GetDayLimit())) + } + + if pointUse.TotalLimit != req.GetTotalLimit() { + up = append(up, m.TotalLimit.Value(req.GetTotalLimit())) + } + + if len(up) == 0 { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(pointUse.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignPointsUse(s.Ctx).Clear(pointUse) + }) + + return +} + +func (s *Update) _updateChat(cpn *model.FissionCampaign) (err error) { + req := s.Req.GetChat() + if req.GetOpen() != mtype.Yes { + return + } + + chat, err := cache.NewCampaignChat(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if chat == nil { + chat = withdefault.FissionCampaignChat(&model.FissionCampaignChat{ + CampaignID: cpn.ID, + HeaderImg: req.GetHeaderImg(), + ChatBg: req.GetChatBg(), + DayLimit: req.GetDayLimit(), + }) + + err = s.GetDao().FissionCampaignChat.WithContext(s.Ctx).Create(chat) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + m := s.GetDao().FissionCampaignChat + var up []field.AssignExpr + if chat.HeaderImg != req.GetHeaderImg() { + up = append(up, m.HeaderImg.Value(req.GetHeaderImg())) + } + + if chat.ChatBg != req.GetChatBg() { + up = append(up, m.ChatBg.Value(req.GetChatBg())) + } + + if chat.DayLimit != req.GetDayLimit() { + up = append(up, m.DayLimit.Value(req.GetDayLimit())) + } + + if len(up) == 0 { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(chat.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignChat(s.Ctx).Clear(chat) + }) + + return +} + +func (s *Update) updateUno(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignUno(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found uno conf") + } + + uno := s.Req.GetUno() + + m := s.GetDao().FissionCampaignUno + var up []field.AssignExpr + + if conf.InitChance != uno.GetInitChance() { + up = append(up, m.InitChance.Value(uno.GetInitChance())) + } + + if !verify.AllInArray[string](uno.GetPropMarks(), conf.GetPropMarks()) { + str, _ := jsonm.ToSliceString(uno.GetPropMarks()) + up = append(up, m.PropMarks.Value(str)) + } + + if len(up) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateColumnSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignUno(s.Ctx).Clear(conf) + }) + } + + groupM := s.GetDao().FissionCampaignUnoGroup + groups, err := groupM.WithContext(s.Ctx).Where(groupM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var groupMap = make(map[int64]*model.FissionCampaignUnoGroup, len(groups)) + var rewardIds []int64 + for _, group := range groups { + groupMap[group.ID] = group + rewardIds = append(rewardIds, group.RewardID) + } + + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(rewards)) + for _, v := range rewards { + rewardMap[v.ID] = v + } + + cardM := s.GetDao().FissionCampaignUnoCard + cards, err := cardM.WithContext(s.Ctx).Where(cardM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cardMap = make(map[string][]*model.FissionCampaignUnoCard) + for _, v := range cards { + cardMap[v.Mark] = append(cardMap[v.Mark], v) + } + + var addCards []*model.FissionCampaignUnoCard + var stockIds []int64 + var fn = func(unoG *pb.UpdateReq_UnoGroup) { + old := groupMap[unoG.GetId()] + + var upG []field.AssignExpr + if old.Odds != unoG.GetOdds() { + upG = append(upG, groupM.Odds.Value(unoG.GetOdds())) + } + + if old.OpenRule != int8(unoG.GetOpenRule()) { + upG = append(upG, groupM.OpenRule.Value(int8(unoG.GetOpenRule()))) + } + + if old.CustomCard != int8(unoG.GetCustomCard()) { + upG = append(upG, groupM.CustomCard.Value(int8(unoG.GetCustomCard()))) + } + + oldRule, newRule := old.GetLimitRule(), unoG.GetLimitRule() + if oldRule.InitNum != newRule.GetInitNum() || + oldRule.SignDay != newRule.GetSignDay() || + oldRule.AddNum != newRule.GetAddNum() || + oldRule.ResetType != newRule.GetResetType() { + rule, _ := jsonm.ToObjString(newRule) + upG = append(upG, groupM.LimitRule.Value(rule)) + } + + if len(upG) > 0 { + _, err = groupM.WithContext(s.Ctx).Where(groupM.ID.Eq(old.ID)).UpdateSimple(upG...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + var upR []field.AssignExpr + oldReward := rewardMap[old.RewardID] + if oldReward.RewardID != unoG.GetReward().GetRewardId() { + upR = append(upR, rewardM.RewardID.Value(unoG.GetReward().GetRewardId())) + } + + if oldReward.Stock != unoG.GetReward().GetStock() { + upR = append(upR, rewardM.Stock.Value(unoG.GetReward().GetStock())) + stockIds = append(stockIds, oldReward.ID) + } + + if len(upR) > 0 { + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(oldReward.ID)).UpdateColumnSimple(upR...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if unoG.GetCustomCard() == mtype.No { + return + } + + oldCards, ok := cardMap[old.Mark] + if !ok { + for i, card := range unoG.GetCards() { + addCards = append(addCards, withdefault.FissionCampaignUnoCard(&model.FissionCampaignUnoCard{ + CampaignID: cpn.ID, + Mark: old.Mark, + CardNo: int32(i) + 1, + Title: card.GetTitle(), + ImgURL: card.GetImgUrl(), + WebURL: card.GetWebUrl(), + AppParam: card.GetAppParam(), + PcParam: card.GetPcParam(), + })) + } + + return + } + + oldCardMap := make(map[int64]*model.FissionCampaignUnoCard, len(oldCards)) + for _, v := range oldCards { + oldCardMap[v.ID] = v + } + + for _, v := range unoG.GetCards() { + old := oldCardMap[v.GetId()] + var upC []field.AssignExpr + if old.Title != v.GetTitle() { + upC = append(upC, cardM.Title.Value(v.GetTitle())) + } + + if old.ImgURL != v.GetImgUrl() { + upC = append(upC, cardM.ImgURL.Value(v.GetImgUrl())) + } + + if old.AppParam != v.GetAppParam() { + upC = append(upC, cardM.AppParam.Value(v.GetAppParam())) + } + + if old.PcParam != v.GetPcParam() { + upC = append(upC, cardM.PcParam.Value(v.GetPcParam())) + } + if old.WebURL != v.GetWebUrl() { + upC = append(upC, cardM.WebURL.Value(v.GetWebUrl())) + } + + if len(upC) > 0 { + _, err = cardM.WithContext(s.Ctx).Where(cardM.ID.Eq(old.ID)).UpdateColumnSimple(upC...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + } + + fn(uno.GetRed()) + fn(uno.GetYellow()) + fn(uno.GetBlue()) + fn(uno.GetGreen()) + + if len(addCards) > 0 { + if err = s.GetDao().FissionCampaignUnoCard.WithContext(s.Ctx).Create(addCards...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(stockIds) > 0 { + s.AddAfterRun(func() (err error) { + stock, _ := stocks.NewCampaignReward(s.Ctx, stockIds...) + stock.Clear() + return + }) + } + + return +} + +func (s *Update) updateEvent(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignEvent + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var eventMap = make(map[string]*model.FissionCampaignEvent, len(list)) + for _, v := range list { + eventMap[v.Mark] = v + } + + events := s.Req.GetEvent() + + var delRewardIds []int64 + var clearStockIds []int64 + var add []*model.FissionCampaignEvent + + var rewardFn = func(reward *pb.UpdateReq_EventReward) (eventReward *mtype.EventReward) { + switch reward.GetPropMark() { + case mtype.FissionCampaignRewardPropMarkReward: + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: reward.GetReward().GetStock(), + RewardType: mtype.FissionCampaignRewardTypeCampaignEvent, + RewardNum: 1, + RewardID: reward.GetReward().GetRewardId(), + PropMark: mtype.FissionCampaignRewardPropMarkReward, + }) + + eventReward = &mtype.EventReward{ + Id: hashid.IdBigint(), + PropMark: reward.GetPropMark(), + RewardId: rewardId, + } + case mtype.FissionCampaignRewardPropMarkPoint: + rewardId := hashid.IdBigint() + s._otherAppendReward(&model.FissionCampaignReward{ + ID: rewardId, + CampaignID: cpn.ID, + Stock: -1, + RewardType: mtype.FissionCampaignRewardTypeCampaignEvent, + RewardNum: reward.GetChance(), + PropMark: mtype.FissionCampaignRewardPropMarkPoint, + ExpiredDay: reward.GetExpiredDay(), + }) + eventReward = &mtype.EventReward{ + Id: hashid.IdBigint(), + PropMark: reward.GetPropMark(), + RewardId: rewardId, + Chance: reward.GetChance(), + } + case mtype.FissionCampaignRewardPropMarkChance: + eventReward = &mtype.EventReward{ + Id: hashid.IdBigint(), + PropMark: reward.GetPropMark(), + Chance: reward.GetChance(), + } + } + + return + } + + var fn = func(event *pb.UpdateReq_EventOne, mark string) (err error) { + old, ok := eventMap[mark] + if event.GetOpen() == mtype.No { + if ok && old.Open == mtype.Yes { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(m.Open.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return + } + + if !ok { + var rewards = make([]*mtype.EventReward, 0, len(event.GetRewards())) + for _, reward := range event.GetRewards() { + rewards = append(rewards, rewardFn(reward)) + } + + add = append(add, withdefault.FissionCampaignEvent(&model.FissionCampaignEvent{ + CampaignID: cpn.ID, + Mark: mark, + Open: mtype.Yes, + }, rewards)) + + return + } + + var oldReward = old.GetRewards() + var oldMap = make(map[int64]*mtype.EventReward, len(oldReward)) + for _, reward := range oldReward { + oldMap[reward.Id] = reward + } + + rewardM := s.GetDao().FissionCampaignReward + var rewards = make([]*mtype.EventReward, 0) + for _, reward := range event.GetRewards() { + + old, ok := oldMap[reward.GetId()] + if !ok { + rewards = append(rewards, rewardFn(reward)) + continue + } + + if old.PropMark != reward.GetPropMark() { + if verify.InArray[string](old.PropMark, mtype.FissionCampaignRewardPropMarkPoint, mtype.FissionCampaignRewardPropMarkReward) { + delRewardIds = append(delRewardIds, old.RewardId) + clearStockIds = append(clearStockIds, old.RewardId) + } + + rewards = append(rewards, rewardFn(reward)) + continue + } + + switch old.PropMark { + case mtype.FissionCampaignRewardPropMarkReward: + _, err = rewardM.WithContext(s.Ctx). + Where(rewardM.ID.Eq(old.RewardId)). + UpdateSimple( + rewardM.Stock.Value(reward.GetReward().GetStock()), + rewardM.RewardID.Value(reward.GetReward().GetRewardId()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + clearStockIds = append(clearStockIds, old.RewardId) + case mtype.FissionCampaignRewardPropMarkPoint: + _, err = rewardM.WithContext(s.Ctx). + Where(rewardM.ID.Eq(old.RewardId)). + UpdateSimple( + rewardM.RewardNum.Value(reward.GetChance()), + rewardM.ExpiredDay.Value(reward.GetExpiredDay()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + old.Chance = reward.GetChance() + case mtype.FissionCampaignRewardPropMarkChance: + old.Chance = reward.GetChance() + } + + rewards = append(rewards, old) + } + + old.Open = mtype.Yes + old.SetRewards(rewards) + + if err = m.WithContext(s.Ctx).Save(old); err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewCampaignEvent(s.Ctx).Clear(old) + }) + + return + } + + err = fn(events.GetFirstVisit(), mtype.FissionCampaignEventMarkFirstVisit) + if err != nil { + return + } + + if len(add) > 0 { + err = s.GetDao().FissionCampaignEvent.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delRewardIds) > 0 { + rewardM := s.GetDao().FissionCampaignReward + _, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(delRewardIds...)).UpdateSimple(rewardM.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + s.AddAfterRun(func() (err error) { + if len(clearStockIds) > 0 { + stocks.NewCleaner(s.Ctx, clearStockIds...).ClearAllReward() + } + + return + }) + + return +} + +func (s *Update) updateGashapon(cpn *model.FissionCampaign) (err error) { + var gashapon = s.Req.GetGashapon() + + cc := cache.NewCampaignGashapon(s.Ctx) + conf, err := cc.FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + return workerr.NotFound("not found gashapon conf") + } + + confM := s.GetDao().FissionCampaignGashapon + var up []field.AssignExpr + + if conf.DayChance != gashapon.GetDayChance() { + up = append(up, confM.DayChance.Value(gashapon.GetDayChance())) + } + + if conf.InitChance != gashapon.GetInitChance() { + up = append(up, confM.InitChance.Value(gashapon.GetInitChance())) + } + + if len(up) == 0 { + return + } + + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(conf) + + return +} diff --git a/internal/service/containers/campaign/vs_settlement.go b/internal/service/containers/campaign/vs_settlement.go new file mode 100644 index 0000000..1d284c5 --- /dev/null +++ b/internal/service/containers/campaign/vs_settlement.go @@ -0,0 +1,199 @@ +package campaign + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" +) + +type VsSettlement struct { + logic.Logic + + Req *pb.VsSettlementReq + Res *pb.VsSettlementRes +} + +func (s *VsSettlement) Run() (err error) { + return logic.Run(s) +} + +func (s *VsSettlement) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *VsSettlement) Exec() (err error) { + err = s.cpn() + if err != nil { + return + } + + schedule, err := s.settlement() + if err != nil { + return + } + + return s.autoNext(schedule) +} + +func (s *VsSettlement) cpn() (err error) { + cpn, err := finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.FissionID != consts.IdVs { + err = workerr.NotFound("not found cpn") + return + } + + return +} + +func (s *VsSettlement) settlement() (schedule *model.FissionCampaignVsSchedule, err error) { + m := s.GetDao().FissionCampaignVsSchedule + schedule, err = m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.GetScheduleId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if schedule == nil { + err = workerr.NotFound("not found schedule") + return + } + + if schedule.RewardID == 0 { + err = s.BE().VerifyError("not set reward") + return + } + + var scores []*mtype.FissionCampaignVsScheduleSettlementScore + for _, score := range s.Req.GetScores() { + scores = append(scores, &mtype.FissionCampaignVsScheduleSettlementScore{ + TeamId: score.GetTeamId(), + Score: score.GetScore(), + }) + } + + var winType int32 = mtype.FissionCampaignVsScheduleWinTypeDraw + if s.Req.GetWinTeamId() != 0 { + winType = mtype.FissionCampaignVsScheduleWinTypeWin + } + + schedule.IsSettlement = mtype.Yes + schedule.SetSettlement(&mtype.FissionCampaignVsScheduleSettlement{ + WinType: winType, + WinTeamId: s.Req.GetWinTeamId(), + Scores: scores, + }) + + err = m.WithContext(s.Ctx).Save(schedule) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + producer.NewCampaignNotice(s.Ctx).CampaignVsSettlement(types.CampaignVsSettlement{ + ScheduleId: schedule.ID, + }) + return + }) + + return +} + +func (s *VsSettlement) autoNext(schedule *model.FissionCampaignVsSchedule) (err error) { + if s.Req.GetWinTeamId() == 0 { + return + } + + m := s.GetDao().FissionCampaignVsSchedule + nextSchedules, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(schedule.CampaignID), + m.VsIdx.Eq(schedule.VsIdx+1), + ).Order(m.VsAt, m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(nextSchedules) == 0 { + return + } + + var nextSchedule *model.FissionCampaignVsSchedule + for _, next := range nextSchedules { + for _, v := range next.GetVsTeamIds() { + if v <= -1 { + nextSchedule = next + } + } + } + + if nextSchedule == nil { + return + } + + var vsTeamIds = nextSchedule.GetVsTeamIds() + for i, teamId := range vsTeamIds { + if teamId < 0 { + vsTeamIds[i] = s.Req.GetWinTeamId() + break + } + } + + nextSchedule.SetVsTeamIds(vsTeamIds) + + err = m.WithContext(s.Ctx).Save(nextSchedule) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + teamM := s.GetDao().FissionCampaignVsTeam + teams, err := teamM.WithContext(s.Ctx).Where(teamM.ID.In(vsTeamIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamMap = make(map[int64]*model.FissionCampaignVsTeam, len(teams)) + for _, team := range teams { + teamMap[team.ID] = team + } + + s.Res.ScheduleId = nextSchedule.VsIdx + s.Res.PkTeam = &pb.VsSettlementRes_PkTeam{ + Id: nextSchedule.ID, + Teams: make([]*pb.VsSettlementRes_Team, 0, len(vsTeamIds)), + } + + for _, id := range vsTeamIds { + team, ok := teamMap[id] + if ok { + s.Res.PkTeam.Teams = append(s.Res.PkTeam.Teams, &pb.VsSettlementRes_Team{ + Id: id, + Name: team.Name, + LogoImg: team.LogoImg, + }) + } else { + s.Res.PkTeam.Teams = append(s.Res.PkTeam.Teams, &pb.VsSettlementRes_Team{ + Id: id, + }) + } + + } + + return +} diff --git a/internal/service/containers/campaignstat/ads_reward.go b/internal/service/containers/campaignstat/ads_reward.go new file mode 100644 index 0000000..c7f2585 --- /dev/null +++ b/internal/service/containers/campaignstat/ads_reward.go @@ -0,0 +1,184 @@ +package campaignstat + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/decimal" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "strings" +) + +type AdsReward struct { + logic.Logic + Req *pb.AdsRewardReq + Res *pb.AdsRewardRes +} + +func (s *AdsReward) Run() error { + return logic.Run(s) +} + +func (s *AdsReward) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.reward(cpn) + if err != nil { + return + } + + return +} + +func (s *AdsReward) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found campaign") + return + } + + return +} + +func (s *AdsReward) reward(cpn *model.FissionCampaign) (err error) { + + adsRewards, marks, err := s._dependData(cpn) + if err != nil { + return + } + + m := s.GetDao().FissionTotal + totals, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Mark.In(marks...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var webChildren, appChildren []*decimal.Operator + var totalMap = make(map[string]int64, len(totals)) + var web, app int64 + for _, v := range totals { + totalMap[v.Mark] = v.UserNum + if strings.HasPrefix(v.Mark, mtype.FissionBehaviorMarkRewardWeb) { + web += v.UserNum + } else { + app += v.UserNum + } + } + + var webTotalMap = make(map[int64]int64, len(adsRewards)) + var appTotalMap = make(map[int64]int64, len(adsRewards)) + for _, v := range adsRewards { + var webNum, appNum int64 + + for _, reward := range v.rewards { + webNum += totalMap[utils.BehaviorFormatMark(mtype.FissionBehaviorTypeRewardWeb, reward.ID)] + appNum += totalMap[utils.BehaviorFormatMark(mtype.FissionBehaviorTypeRewardApp, reward.ID)] + } + + webTotalMap[v.id], appTotalMap[v.id] = webNum, appNum + + webChildren = append(webChildren, &decimal.Operator{ + Id: v.id, + Num: webNum, + }) + + appChildren = append(appChildren, &decimal.Operator{ + Id: v.id, + Num: appNum, + }) + } + + webMap, appMap := decimal.Percent2PointMap(webChildren, web), decimal.Percent2PointMap(appChildren, app) + + var list = make([]*pb.AdsRewardRes_Reward, 0, len(adsRewards)) + for _, v := range adsRewards { + webNum, appNum := webTotalMap[v.id], appTotalMap[v.id] + list = append(list, &pb.AdsRewardRes_Reward{ + Id: v.id, + Title: v.title, + WebNum: webNum, + WebCompare: webMap[v.id], + AppNum: appNum, + AppCompare: appMap[v.id], + Compare: decimal.Percent2PointMax9999(appNum, webNum), + }) + } + + s.AddAfterRun(func() (err error) { + + s.Res.WebNum = web + s.Res.AppNum = app + s.Res.Rewards = list + + return + }) + + return +} + +type adsReward struct { + id int64 + title string + rewards []*model.FissionCampaignReward +} + +func (s *AdsReward) _dependData(cpn *model.FissionCampaign) (list []*adsReward, marks []string, err error) { + m := s.GetDao().FissionCampaignReward + rewards, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var brewardMap = make(map[int64][]*model.FissionCampaignReward) + var bIds []int64 + var ids = make([]int64, 0, len(rewards)) + for _, reward := range rewards { + ids = append(ids, reward.ID) + + if _, ok := brewardMap[reward.RewardID]; !ok { + bIds = append(bIds, reward.RewardID) + } + + brewardMap[reward.RewardID] = append(brewardMap[reward.RewardID], reward) + } + + rewardM := s.GetDao().Reward + brewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(bIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + list = make([]*adsReward, 0, len(brewards)) + for _, reward := range brewards { + list = append(list, &adsReward{ + id: reward.ID, + title: reward.RewardTitle, + rewards: brewardMap[reward.ID], + }) + } + + marks = make([]string, 0, len(ids)*2) + for _, id := range ids { + marks = append(marks, + utils.BehaviorFormatMark(mtype.FissionBehaviorTypeRewardWeb, id), + utils.BehaviorFormatMark(mtype.FissionBehaviorTypeRewardApp, id), + ) + + } + + return +} diff --git a/internal/service/containers/campaignstat/ads_summary.go b/internal/service/containers/campaignstat/ads_summary.go new file mode 100644 index 0000000..c1dc93a --- /dev/null +++ b/internal/service/containers/campaignstat/ads_summary.go @@ -0,0 +1,205 @@ +package campaignstat + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/decimal" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "github.com/golang-module/carbon/v2" +) + +type AdsSummary struct { + logic.Logic + Req *pb.AdsSummaryReq + Res *pb.AdsSummaryRes +} + +func (s *AdsSummary) Run() error { + return logic.Run(s) +} + +func (s *AdsSummary) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.total(cpn) + if err != nil { + return + } + + err = s.today(cpn) + if err != nil { + return + } + + err = s.compare(cpn) + if err != nil { + return + } + + return +} + +func (s *AdsSummary) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found campaign") + return + } + + return +} + +func (s *AdsSummary) total(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionTotal + totals, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.In(mtype.FissionBehaviorMarkView, mtype.FissionBehaviorMarkAppInstall), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + for _, v := range totals { + switch v.Mark { + case mtype.FissionBehaviorMarkView: + s.Res.VisitorNum = v.Num + s.Res.VisitorUser = v.UserNum + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNum = v.Num + s.Res.InstallUser = v.UserNum + } + } + + return + }) + + return +} + +func (s *AdsSummary) today(cpn *model.FissionCampaign) (err error) { + pTotal := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + numMap, userMap, err := pTotal.CycleDay(carbon.Now(), mtype.FissionBehaviorMarkView, mtype.FissionBehaviorMarkAppInstall) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var marks = make([]string, 0, len(list)) + for _, v := range list { + marks = append(marks, utils.BehaviorFormatMark(mtype.FissionBehaviorTypeRewardApp, v.ID)) + } + + _, rewardUserMap, err := pTotal.CycleDay(carbon.Now(), marks...) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + + for mark, num := range numMap { + switch mark { + case mtype.FissionBehaviorMarkView: + s.Res.VisitorNumToday = num + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNumToday = num + } + + } + + for mark, num := range userMap { + switch mark { + case mtype.FissionBehaviorMarkView: + s.Res.VisitorUserToday = num + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallUserToday = num + } + } + + for _, num := range rewardUserMap { + s.Res.RewardUserAppToday += num + } + + return + }) + + return + +} + +func (s *AdsSummary) compare(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionTotalCycle + + day := carbon.Yesterday().StartOfDay() + yesterday := day.Timestamp() + before := day.Yesterday().Timestamp() + + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.In(mtype.FissionBehaviorMarkView, mtype.FissionBehaviorMarkAppInstall), + m.StatType.Eq(mtype.FissionTotalCycleTypeDay), + m.StatTime.In(yesterday, before), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + + var viewYesterday, viewBefore int64 + var installYesterday, installBefore int64 + for _, v := range list { + if v.StatTime == yesterday { + switch v.Mark { + case mtype.FissionBehaviorMarkView: + s.Res.VisitorNumYesterday = v.Num + s.Res.VisitorUserYesterday = v.UserNum + + viewYesterday = v.UserNum + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNumYesterday = v.Num + s.Res.InstallUserYesterday = v.UserNum + + installYesterday = v.UserNum + } + } + if v.StatTime == before { + switch v.Mark { + case mtype.FissionBehaviorMarkView: + viewBefore = v.UserNum + case mtype.FissionBehaviorMarkAppInstall: + installBefore = v.UserNum + } + } + } + + s.Res.VisitorUserDayCompareUp, s.Res.VisitorUserDayCompare = decimal.Chain1PointMax999(viewYesterday, viewBefore) + s.Res.InstallUserDayCompareUp, s.Res.InstallUserDayCompare = decimal.Chain1PointMax999(installYesterday, installBefore) + + return + }) + + return +} diff --git a/internal/service/containers/campaignstat/ads_table.go b/internal/service/containers/campaignstat/ads_table.go new file mode 100644 index 0000000..b2a9042 --- /dev/null +++ b/internal/service/containers/campaignstat/ads_table.go @@ -0,0 +1,194 @@ +package campaignstat + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/decimal" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "fmt" + "github.com/golang-module/carbon/v2" +) + +type AdsTable struct { + logic.Logic + Req *pb.AdsTableReq + Res *pb.AdsTableRes +} + +func (s *AdsTable) Run() error { + return logic.Run(s) +} + +func (s *AdsTable) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + start, end, statType := s._statParams() + + // 线数据 + err = s.line(cpn, start, end, statType) + if err != nil { + return + } + + err = s.change(cpn, start, end) + if err != nil { + return + } + + return +} + +func (s *AdsTable) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found campaign") + return + } + + return +} + +// 统计参数 +func (s *AdsTable) _statParams() (start, end carbon.Carbon, statType int8) { + start = utils.Ternary(s.Req.GetStartTime() != 0, carbon.CreateFromTimestamp(s.Req.GetStartTime()), carbon.Now().StartOfDay()) + end = utils.Ternary(s.Req.GetEndTime() != 0, carbon.CreateFromTimestamp(s.Req.GetEndTime()), carbon.Now()) + statType = mtype.FissionTotalCycleTypeHour + + if start.AddDay().Lt(end) { + statType = mtype.FissionTotalCycleTypeDay + } + + return +} + +func (s *AdsTable) line(cpn *model.FissionCampaign, start, end carbon.Carbon, statType int8) (err error) { + + marks := []string{mtype.FissionBehaviorMarkView, mtype.FissionBehaviorMarkAppInstall} + + m := s.GetDao().FissionTotalCycle + list, err := m.WithContext(s.Ctx). + Where( + m.StatTime.Gte(start.Timestamp()), + m.StatTime.Lte(end.Timestamp()), + m.CampaignID.Eq(cpn.ID), + m.StatType.Eq(statType), + m.Mark.In(marks...), + ).Find() + + var x []string + var xMap = make(map[string]int) + switch statType { + case mtype.FissionTotalCycleTypeHour: + hours := utils.BetweenHour(start, end) + x = make([]string, 0, len(hours)) + for k, v := range hours { + key := fmt.Sprintf("%dh", v) + x = append(x, key) + xMap[key] = k + } + case mtype.FissionTotalCycleTypeDay: + x = utils.BetweenDay(start, end) + for k, v := range x { + xMap[v] = k + } + } + + //人数 + xLen := len(x) + var lineMap = make(map[string]*pb.AdsTableRes_Y) + for _, mark := range marks { + lineMap[mark] = &pb.AdsTableRes_Y{ + Type: mark, + Data: make([]int64, xLen), + } + } + + for _, v := range list { + + var idx int + var t = carbon.CreateFromTimestamp(v.StatTime) + switch statType { + case mtype.FissionTotalCycleTypeHour: + idx = xMap[fmt.Sprintf("%dh", t.Hour())] + case mtype.FissionTotalCycleTypeDay: + idx = xMap[t.ToShortDateString()] + } + + lineMap[v.Mark].Data[idx] = v.UserNum + } + + // 即时数据 + pTotal := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var immUserNum map[string]int64 + var immIdx int + + now := carbon.Now() + switch statType { + case mtype.FissionTotalCycleTypeHour: + if now.StartOfDay().Eq(start.StartOfDay()) { // 当天的某一个小时 + immIdx = xMap[fmt.Sprintf("%dh", now.Hour())] + _, immUserNum, err = pTotal.CycleHour(now, marks...) + if err != nil { + return + } + } + case mtype.FissionTotalCycleTypeDay: + if end.Gte(now) { // 如果结束时间大于当前时间 + dayStr := now.ToShortDateString() + immIdx = xMap[dayStr] + _, immUserNum, err = pTotal.CycleDay(now, marks...) + if err != nil { + return + } + } + } + + // 实时数据 + for k, v := range immUserNum { + lineMap[k].Data[immIdx] = v + } + + s.AddAfterRun(func() (err error) { + s.Res.X = x + for _, v := range marks { + s.Res.Y = append(s.Res.Y, lineMap[v]) + } + + return + }) + + return +} + +func (s *AdsTable) change(cpn *model.FissionCampaign, start, end carbon.Carbon) (err error) { + total := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var ( + viewUser = total.UserNumType(mtype.FissionBehaviorTypeView, start, end) //活动页面访问人数 + installUser = total.UserNumType(mtype.FissionBehaviorTypeAppInstall, start, end) // 安装人数 + ) + + s.AddAfterRun(func() (err error) { + s.Res.VisitorUser = viewUser + s.Res.InstallUser = installUser + s.Res.InstallUserCompare = decimal.Percent2PointMax9999(installUser, viewUser) + + return + }) + + return +} diff --git a/internal/service/containers/campaignstat/c_test.go b/internal/service/containers/campaignstat/c_test.go new file mode 100644 index 0000000..d8e85b2 --- /dev/null +++ b/internal/service/containers/campaignstat/c_test.go @@ -0,0 +1,57 @@ +package campaignstat + +import ( + "context" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/server/depend" + pb "joybuywork/proto/go_proto/w_campaign_stat" + _ "joybuywork/test" + "gits.branchcn.com/backend/microcode/micro" + "os" + "testing" +) + +func TestReportInfo(t *testing.T) { + res := &pb.ReportInfoRes{} + + container := new(ReportInfo) + { + container.Init(context.Background()) + container.Req = &pb.ReportInfoReq{ + HashId: "crlsa3urdj7ivpdso7ag", + } + container.Res = res + } + + t.Log(container.Run()) + + t.Log(res) +} + +func TestUserCycle(t *testing.T) { + rpc() + res := &pb.UserCycleRes{} + + container := new(UserCycle) + { + container.Init(context.Background()) + container.Req = &pb.UserCycleReq{ + CampaignHashId: "cs2aqpmrdj7vlqngmp8g", + } + container.Res = res + } + + t.Log(container.Run()) + + t.Log(res) +} + +func rpc() { + os.Args = []string{} + + depend.M = micro.Grpc(micro.GrpcConfig{ + ServerName: consts.ServiceName, + EtcdAddress: config.Config.Etcd.Address, + }) +} diff --git a/internal/service/containers/campaignstat/campaign.go b/internal/service/containers/campaignstat/campaign.go new file mode 100644 index 0000000..728bcd9 --- /dev/null +++ b/internal/service/containers/campaignstat/campaign.go @@ -0,0 +1,331 @@ +package campaignstat + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "fmt" + "github.com/golang-module/carbon/v2" +) + +// 展示类型(1-活动访问,2-达标条件,3-签到) +const ( + statCampaignShowTypeVisit = iota + 1 + statCampaignShowTypeCond + statCampaignShowTypeSign + statCampaignShowTypeGrow +) + +type Campaign struct { + logic.Logic + Req *pb.CampaignReq + Res *pb.CampaignRes + + conf *model.FissionCampaignConfig +} + +func (s *Campaign) Run() error { + return logic.Run(s) +} + +func (s *Campaign) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + start, end, statType := s.statParams(cpn) + + err = s.line(cpn, start, end, statType) + if err != nil { + return + } + + err = s.change(cpn, start, end) + if err != nil { + return + } + + return +} + +// 活动数据 +func (s *Campaign) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + return +} + +// 统计参数 +func (s *Campaign) statParams(cpn *model.FissionCampaign) (start, end carbon.Carbon, statType int8) { + start = utils.Ternary(s.Req.GetStartTime() != 0, carbon.CreateFromTimestamp(s.Req.GetStartTime()), carbon.Now().StartOfDay()) + end = utils.Ternary(s.Req.GetEndTime() != 0, carbon.CreateFromTimestamp(s.Req.GetEndTime()), carbon.Now()) + statType = mtype.FissionTotalCycleTypeHour + + if start.AddDay().Lt(end) { + statType = mtype.FissionTotalCycleTypeDay + } + + // 自定义事件的统计标识 + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.conf = conf + + switch cpn.FissionID { + case consts.IdSignIn: + s.Res.ShowType = statCampaignShowTypeSign + case consts.IdGrow: + s.Res.ShowType = statCampaignShowTypeGrow + default: + s.Res.ShowType = utils.Ternary[int32](conf.Option == mtype.FissionCampaignConfigTargetOptionApp, statCampaignShowTypeVisit, statCampaignShowTypeCond) + } + s.Res.ReportUser = &pb.CampaignRes_Report{} + s.Res.ReportNum = &pb.CampaignRes_Report{} + + return +} + +// 线数据 +func (s *Campaign) line(cpn *model.FissionCampaign, start, end carbon.Carbon, statType int8) (err error) { + + marks, markName, err := s.lineMark(cpn) + if err != nil { + return + } + + m := s.GetDao().FissionTotalCycle + list, err := m.WithContext(s.Ctx). + Where( + m.StatTime.Gte(start.Timestamp()), + m.StatTime.Lte(end.Timestamp()), + m.CampaignID.Eq(cpn.ID), + m.StatType.Eq(statType), + m.Mark.In(marks...), + ).Find() + + var x []string + var xMap = make(map[string]int) + switch statType { + case mtype.FissionTotalCycleTypeHour: + hours := utils.BetweenHour(start, end) + x = make([]string, 0, len(hours)) + for k, v := range hours { + key := fmt.Sprintf("%dh", v) + x = append(x, key) + xMap[key] = k + } + case mtype.FissionTotalCycleTypeDay: + x = utils.BetweenDay(start, end) + for k, v := range x { + xMap[v] = k + } + } + + //人数 + xLen := len(x) + var nf, unf = "num", "user_num" + var lineMap = make(map[string]map[string]*pb.CampaignRes_Y) + for _, mark := range marks { + t := utils.BehaviorMarkToType(mark) + lineMap[mark] = map[string]*pb.CampaignRes_Y{ + nf: { + Type: t, + Name: markName[mark], + Data: make([]int64, xLen), + }, + unf: { + Type: t, + Name: markName[mark], + Data: make([]int64, xLen), + }, + } + } + + for _, v := range list { + + var idx int + var t = carbon.CreateFromTimestamp(v.StatTime) + switch statType { + case mtype.FissionTotalCycleTypeHour: + idx = xMap[fmt.Sprintf("%dh", t.Hour())] + case mtype.FissionTotalCycleTypeDay: + idx = xMap[t.ToShortDateString()] + } + + lineMap[v.Mark][nf].Data[idx] = v.Num + lineMap[v.Mark][unf].Data[idx] = v.UserNum + } + + // 即时数据 + pTotal := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var immNum, immUserNum map[string]int64 + var immIdx int + + now := carbon.Now() + switch statType { + case mtype.FissionTotalCycleTypeHour: + if now.StartOfDay().Eq(start.StartOfDay()) { // 当天的某一个小时 + immIdx = xMap[fmt.Sprintf("%dh", now.Hour())] + immNum, immUserNum, err = pTotal.CycleHour(now, marks...) + if err != nil { + return + } + } + case mtype.FissionTotalCycleTypeDay: + if end.Gte(now) { // 如果结束时间大于当前时间 + dayStr := now.ToShortDateString() + immIdx = xMap[dayStr] + immNum, immUserNum, err = pTotal.CycleDay(now, marks...) + if err != nil { + return + } + } + } + + for k, v := range immNum { + lineMap[k][nf].Data[immIdx] = v + } + for k, v := range immUserNum { + lineMap[k][unf].Data[immIdx] = v + } + + s.AddAfterRun(func() (err error) { + s.Res.X = x + for _, v := range marks { + s.Res.ReportNum.Y = append(s.Res.ReportNum.Y, lineMap[v][nf]) + s.Res.ReportUser.Y = append(s.Res.ReportUser.Y, lineMap[v][unf]) + } + + return + }) + + return +} + +func (s *Campaign) lineMark(cpn *model.FissionCampaign) (marks []string, markName map[string]string, err error) { + + switch cpn.FissionID { + case consts.IdSignIn: + marks = []string{ + mtype.FissionBehaviorMarkSign, + mtype.FissionBehaviorMarkSignTarget, + } + return + case consts.IdGrow: + marks = []string{ + mtype.FissionBehaviorMarkView, + mtype.FissionBehaviorMarkGrow, + } + return + } + + marks = []string{ + mtype.FissionBehaviorMarkView, + mtype.FissionBehaviorMarkClickShare, + } + + if s.conf.Option == mtype.FissionCampaignConfigTargetOptionApp && s.conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister { + marks = append(marks, mtype.FissionBehaviorMarkAppRegister) + } else { + marks = append(marks, mtype.FissionBehaviorMarkAppInstall) + } + + markName = make(map[string]string) + if s.conf.Option != mtype.FissionCampaignConfigTargetOptionApp { + condM := s.GetDao().FissionCampaignCond + var conds []*model.FissionCampaignCond + conds, err = condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpn.ID)). + Where( + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, cond := range conds { + mark := utils.BehaviorFormatMark(mtype.FissionBehaviorTypeFinishCond, cond.ID) + marks = append(marks, mark) + markName[mark] = cond.Event + } + + marks = append(marks, mtype.FissionBehaviorMarkFinishTask) + } + + return +} + +func (s *Campaign) change(cpn *model.FissionCampaign, start, end carbon.Carbon) (err error) { + total := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var ( + viewUser = total.UserNumType(mtype.FissionBehaviorTypeView, start, end) //活动页面访问人数 + viewNum = total.NumType(mtype.FissionBehaviorTypeView, start, end) //活动页面访问次数 + clickPlayUser = total.UserNumType(mtype.FissionBehaviorTypeClickPlay, start, end) //活动按钮点击人数 + clickPlayNum = total.NumType(mtype.FissionBehaviorTypeClickPlay, start, end) //活动按钮点击次数 + clickShareUser = total.UserNumType(mtype.FissionBehaviorTypeClickShare, start, end) //活动分享按钮点击人数 + clickShareNum = total.NumType(mtype.FissionBehaviorTypeClickShare, start, end) //活动分享按钮点击次数 + clickMediaUser = total.UserNumType(mtype.FissionBehaviorTypeClickMedia, start, end) //活动社媒点击人数 + clickMediaNum = total.NumType(mtype.FissionBehaviorTypeClickMedia, start, end) //活动社媒点击次数 + finishTaskUser = total.UserNumType(mtype.FissionBehaviorTypeFinishTask, start, end) //活动完成目标人数 + finishTaskNum = total.NumType(mtype.FissionBehaviorTypeFinishTask, start, end) //活动完成目标次数 + signUser = total.UserNumType(mtype.FissionBehaviorTypeSign, start, end) //活动签到人数 + signNum = total.NumType(mtype.FissionBehaviorTypeSign, start, end) //活动签到次数 + signTargetUser = total.UserNumType(mtype.FissionBehaviorTypeSignTarget, start, end) //活动签到达标人数 + signTargetNum = total.NumType(mtype.FissionBehaviorTypeSignTarget, start, end) //活动签到达标次数 + growOkUser = total.UserNumType(mtype.FissionBehaviorTypeGrow, start, end) //领养人数 + growOkNum = total.NumType(mtype.FissionBehaviorTypeGrow, start, end) //领养次数 + ) + + s.AddAfterRun(func() (err error) { + s.Res.ReportNum.TargetNum = finishTaskNum + s.Res.ReportUser.TargetNum = finishTaskUser + + s.Res.ReportNum.ViewNum = viewNum + s.Res.ReportUser.ViewNum = viewUser + + s.Res.ReportNum.SignNum = signNum + s.Res.ReportUser.SignNum = signUser + + s.Res.ReportNum.Change = utils.PercentNoZero(clickShareNum+clickMediaNum, viewNum) + s.Res.ReportUser.Change = utils.PercentNoZero(clickShareUser+clickMediaUser, viewUser) + + s.Res.ReportNum.Fun = utils.PercentNoZero(clickPlayNum, viewNum) + s.Res.ReportUser.Fun = utils.PercentNoZero(clickPlayUser, viewUser) + + s.Res.ReportNum.Target = utils.PercentNoZero(finishTaskNum, viewNum) + s.Res.ReportUser.Target = utils.PercentNoZero(finishTaskUser, viewUser) + + s.Res.ReportNum.Sign = utils.PercentNoZero(signTargetNum, signNum) + s.Res.ReportUser.Sign = utils.PercentNoZero(signTargetUser, signUser) + + s.Res.ReportNum.Grow = utils.PercentNoZero(growOkNum, viewNum) + s.Res.ReportUser.Grow = utils.PercentNoZero(growOkUser, viewUser) + + return + }) + + return +} diff --git a/internal/service/containers/campaignstat/dem_title.go b/internal/service/containers/campaignstat/dem_title.go new file mode 100644 index 0000000..9f4a604 --- /dev/null +++ b/internal/service/containers/campaignstat/dem_title.go @@ -0,0 +1,936 @@ +package campaignstat + +import ( + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" +) + +type DemTitle struct { + logic.Logic + Req *pb.DemTitleReq + Res *pb.DemTitleRes + + rewardMap map[int64]provider.RewardAutoLang +} + +func (s *DemTitle) Run() error { + return logic.Run(s) +} + +func (s *DemTitle) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.cond(cpn) + if err != nil { + return + } + + s.media() + + err = s.channel() + if err != nil { + return + } + + err = s.rewards() + if err != nil { + return + } + + err = s.userLv() + if err != nil { + return + } + + err = s.qa() + if err != nil { + return + } + + err = s.qaOption() + if err != nil { + return + } + + err = s.qaGroup() + if err != nil { + return + } + + err = s.scenes(cpn) + if err != nil { + return + } + + err = s.customBtn() + if err != nil { + return + } + + err = s.task(cpn) + if err != nil { + return + } + + err = s.parent(cpn) + if err != nil { + return + } + + err = s.img() + if err != nil { + return + } + + err = s.zone() + if err != nil { + return + } + + err = s.cpns() + if err != nil { + return + } + + err = s.schedules() + if err != nil { + return + } + + err = s.mall() + if err != nil { + return + } + + err = s.mallItem() + if err != nil { + return + } + + err = s.unoCards() + if err != nil { + return + } + + return +} + +// 活动数据 +func (s *DemTitle) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("campaign not found") + return + } + + s.Res.CampaignId = cpn.ID + s.Res.TOffect = cpn.TOffset + s.rewardMap = make(map[int64]provider.RewardAutoLang) + + return +} + +func (s *DemTitle) cond(cpn *model.FissionCampaign) (err error) { + if len(s.Req.GetCondIds()) == 0 { + return + } + + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.ID.In(s.Req.GetCondIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range conds { + rewardIds = append(rewardIds, v.RewardID) + } + + unlockRewardMap, err := s._getRewardMap(cpn.ProjectID, rewardIds) + if err != nil { + return + } + + s.Res.Conds = make([]*pb.DemTitleRes_Title, 0, len(conds)) + + for _, cond := range conds { + var title = cond.Desc + + if cond.RewardID > 0 { + title = fmt.Sprintf("解锁奖品%s", unlockRewardMap[cond.RewardID].RewardTitle) + } + + s.Res.Conds = append(s.Res.Conds, &pb.DemTitleRes_Title{ + Id: cond.ID, + Title: title, + }) + } + + return +} + +func (s *DemTitle) media() { + if len(s.Req.GetMediaIds()) == 0 { + return + } + s.Res.Media = make([]*pb.DemTitleRes_Title, 0, len(s.Req.GetMediaIds())) + + for _, mediaId := range s.Req.GetMediaIds() { + + if mediaId == -1 { + s.Res.Media = append(s.Res.Media, &pb.DemTitleRes_Title{ + Id: mediaId, + Title: "Copy Link", + SecondId: 0, + }) + continue + } + + title, ok := consts.ShareTitleMap[mediaId] + if !ok { + continue + } + + s.Res.Media = append(s.Res.Media, &pb.DemTitleRes_Title{ + Id: mediaId, + Title: title, + SecondId: 0, + }) + + } + +} + +func (s *DemTitle) channel() (err error) { + if len(s.Req.GetChannelIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetChannelIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Channel = make([]*pb.DemTitleRes_Title, 0, len(list)) + + for _, v := range list { + s.Res.Channel = append(s.Res.Channel, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + SecondId: int64(v.CType), + }) + } + return +} + +func (s *DemTitle) rewards() (err error) { + if len(s.Req.GetRewardIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetRewardIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var titleMap = make(map[int64]string) + var ids []int64 + for _, v := range list { + if _, ok := titleMap[v.RewardID]; !ok { + titleMap[v.RewardID] = "" + ids = append(ids, v.RewardID) + } + } + + rewardM := s.GetDao().Reward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range rewards { + titleMap[v.ID] = v.RewardTitle + } + + for _, v := range list { + one := &pb.DemTitleRes_Title{ + Id: v.ID, + Title: titleMap[v.RewardID], + SecondId: v.RewardID, + } + + if v.PropMark == mtype.FissionCampaignRewardPropMarkPoint { + one.Title = fmt.Sprintf("系统积分 * %d", v.RewardNum) + } else if v.PropMark == mtype.FissionCampaignRewardPropMarkChance { + one.Title = fmt.Sprintf("活动机会 * %d", v.RewardNum) + } else if v.RewardID < 0 { + one.Title = "谢谢参与" + } + + s.Res.Rewards = append(s.Res.Rewards, one) + } + + return +} + +func (s *DemTitle) userLv() (err error) { + if len(s.Req.GetLevelIds()) == 0 { + return + } + + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetLevelIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.Res.UserLv = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.UserLv = append(s.Res.UserLv, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + }) + } + return +} + +func (s *DemTitle) qa() (err error) { + if len(s.Req.GetQaIds()) == 0 { + return + } + + m := s.GetDao().LibraryQa + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetQaIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Qa = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.Qa = append(s.Res.Qa, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + }) + } + return +} + +func (s *DemTitle) qaOption() (err error) { + if len(s.Req.GetQaOptionIds()) == 0 { + return + } + + m := s.GetDao().LibraryQaOption + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetQaOptionIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.QaOption = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.QaOption = append(s.Res.QaOption, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + }) + } + + return +} + +func (s *DemTitle) qaGroup() (err error) { + if len(s.Req.GetQaGroupIds()) == 0 { + return + } + + m := s.GetDao().LibraryQaGroup + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetQaGroupIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.QaGroup = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.QaGroup = append(s.Res.QaGroup, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + }) + } + return +} + +func (s *DemTitle) scenes(cpn *model.FissionCampaign) (err error) { + if len(s.Req.GetSceneIds()) == 0 { + return + } + + switch cpn.FissionID { + case consts.IdCoin: + m := s.GetDao().FissionCoinScene + var scenes []*model.FissionCoinScene + scenes, err = m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetSceneIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + gmt := utils.Ternary[string](cpn.TOffset < 0, fmt.Sprint(cpn.TOffset), fmt.Sprintf("+%d", cpn.TOffset)) + s.Res.Scenes = make([]*pb.DemTitleRes_Title, 0, len(scenes)) + + for _, v := range scenes { + + day, _, _ := timez.GMTStartAndEndTs(cpn.TOffset, v.OpenTime) + + s.Res.Scenes = append(s.Res.Scenes, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: fmt.Sprintf("%s(GMT%s)", day, gmt), + }) + } + } + return +} + +func (s *DemTitle) customBtn() (err error) { + if len(s.Req.GetCustomBtnIds()) == 0 { + return + } + + m := s.GetDao().FissionCustomBtn + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetCustomBtnIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.QaGroup = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.QaGroup = append(s.Res.QaGroup, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.BtnText, + }) + } + + return +} + +func (s *DemTitle) task(cpn *model.FissionCampaign) (err error) { + if len(s.Req.GetTaskIds()) == 0 { + return + } + + taskM := s.GetDao().FissionCampaignTask + tasks, err := taskM.WithContext(s.Ctx).Where(taskM.ID.In(s.Req.GetTaskIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Tasks = make([]*pb.DemTitleRes_Title, 0, len(tasks)) + + var unlockRewardIds []int64 + var campaignMap = make(map[int64][]int64) + var condIds []int64 + for _, task := range tasks { + + if task.PropMark == mtype.FissionCampaignTaskPropMarkUnlockReward { + unlockRewardIds = append(unlockRewardIds, task.RewardID) + } + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeCondOne: + condIds = append(condIds, utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark)) + case mtype.FissionCampaignTaskTypeCondAll: + campaignMap[task.CampaignID] = append(campaignMap[task.CampaignID], task.ID) + default: + continue + } + } + + var condMap = make(map[int64]string, len(condIds)) + if len(condIds) > 0 { + var conds []*model.FissionCampaignCond + m := s.GetDao().FissionCampaignCond + conds, err = m.WithContext(s.Ctx).Where(m.ID.In(condIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range conds { + condMap[v.ID] = v.Desc + } + } + + var cpnMap = make(map[int64]string) + if len(campaignMap) > 0 { + m := s.GetDao().FissionCampaignCond + + for cpnId, taskIds := range campaignMap { + var conds []*model.FissionCampaignCond + conds, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var desc string + for _, cond := range conds { + desc += cond.Desc + ", " + } + + for _, v := range taskIds { + cpnMap[v] = strings.TrimRight(desc, ", ") + } + + } + } + + unlockRewardMap, err := s._getRewardMap(cpn.ProjectID, unlockRewardIds) + if err != nil { + return + } + + for _, task := range tasks { + one := &pb.DemTitleRes_Title{ + Id: task.ID, + } + switch task.TaskType { + case mtype.FissionCampaignTaskTypeCondOne: + one.Title = condMap[utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark)] + case mtype.FissionCampaignTaskTypeInstall: + one.Title = fmt.Sprintf("获得%d个安装事件助力", task.Num) + case mtype.FissionCampaignTaskTypeRegister: + one.Title = fmt.Sprintf("获得%d个注册事件助力", task.Num) + case mtype.FissionCampaignTaskTypeCondAll: + one.Title = cpnMap[task.ID] + case mtype.FissionCampaignTaskTypeOpen: + one.Title = fmt.Sprintf("获得%d个打开事件助力", task.Num) + case mtype.FissionCampaignTaskTypeClick: + one.Title = fmt.Sprintf("获得%d个点击邀请链接助力", task.Num) + } + + if task.PropMark == mtype.FissionCampaignTaskPropMarkUnlockReward { + one.Title = fmt.Sprintf("解锁奖品%s", unlockRewardMap[task.RewardID].RewardTitle) + } + + s.Res.Tasks = append(s.Res.Tasks, one) + } + + return +} + +func (s *DemTitle) parent(cpn *model.FissionCampaign) (err error) { + if len(s.Req.GetParentIds()) == 0 { + return + } + + m := s.GetDao().FissionUser.SubTable(cpn.ID) + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetParentIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Parents = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.Parents = append(s.Res.Parents, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.SubUserID, + }) + } + + return +} + +func (s *DemTitle) img() (err error) { + if len(s.Req.GetImgIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaignLongImg + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetImgIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cpnIds []int64 + for _, v := range list { + if v.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + cpnIds = append(cpnIds, v.TargetID) + } + } + + var cpnMap = make(map[int64]string) + if len(cpnIds) > 0 { + cpnM := s.GetDao().FissionCampaign + cpnList, err1 := cpnM.WithContext(s.Ctx).Where(cpnM.ID.In(cpnIds...)).Find() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + for _, v := range cpnList { + cpnMap[v.ID] = v.Title + } + } + + s.Res.Imgs = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + if v.ClickType == mtype.FissionCampaignLongImgClickTypeZone { + continue + } + + var title string + switch v.TargetType { + case mtype.FissionCampaignLongImgTargetTypeCustom: + title = "跳转指定地址" + if v.AppParam != "" { + title += fmt.Sprintf(";APP端参数: %s", v.AppParam) + } + if v.WebURL != "" { + title += fmt.Sprintf(";H5跳转url: %s", v.WebURL) + } + if v.PcParam != "" { + title += fmt.Sprintf(";PC端参数: %s", v.PcParam) + } + case mtype.FissionCampaignLongImgTargetTypeCampaign: + title = fmt.Sprintf("跳转到活动'%s'", cpnMap[v.CampaignID]) + } + + s.Res.Imgs = append(s.Res.Imgs, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: title, + }) + } + + return +} + +func (s *DemTitle) zone() (err error) { + if len(s.Req.GetZoneIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaignLongImgZone + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetZoneIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cpnIds []int64 + for _, v := range list { + if v.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + cpnIds = append(cpnIds, v.TargetID) + } + } + + var cpnMap = make(map[int64]string) + if len(cpnIds) > 0 { + cpnM := s.GetDao().FissionCampaign + cpnList, err1 := cpnM.WithContext(s.Ctx).Where(cpnM.ID.In(cpnIds...)).Find() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + for _, v := range cpnList { + cpnMap[v.ID] = v.Title + } + } + + s.Res.Zones = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + var title string + + switch v.TargetType { + case mtype.FissionCampaignLongImgTargetTypeCustom: + title = "跳转指定地址" + if v.AppParam != "" { + title += fmt.Sprintf(";APP端参数: %s", v.AppParam) + } + if v.WebURL != "" { + title += fmt.Sprintf(";H5跳转url: %s", v.WebURL) + } + if v.PcParam != "" { + title += fmt.Sprintf(";PC端参数: %s", v.PcParam) + } + case mtype.FissionCampaignLongImgTargetTypeCampaign: + title = fmt.Sprintf("跳转到活动'%s'", cpnMap[v.CampaignID]) + } + + s.Res.Zones = append(s.Res.Zones, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: title, + }) + } + + return +} + +func (s *DemTitle) cpns() (err error) { + if len(s.Req.GetCpnIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetCpnIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Cpns = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.Cpns = append(s.Res.Cpns, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + }) + } + + return +} + +func (s *DemTitle) schedules() (err error) { + if len(s.Req.GetScheduleIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaignVsSchedule + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetScheduleIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamIds []int64 + var teamMap = make(map[int64]*model.FissionCampaignVsTeam) + for _, v := range list { + for _, t := range v.GetVsTeamIds() { + if _, ok := teamMap[t]; !ok && t > 0 { + teamIds = append(teamIds, t) + } + } + } + + teamM := s.GetDao().FissionCampaignVsTeam + teamList, err := teamM.WithContext(s.Ctx).Where(teamM.ID.In(teamIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range teamList { + teamMap[v.ID] = v + } + + s.Res.Schedules = make([]*pb.DemTitleRes_Schedule, 0, len(list)) + for _, v := range list { + var teams = make([]*pb.DemTitleRes_Team, 2) + var t1 = "A队" + var t2 = "B队" + for i, t := range v.GetVsTeamIds() { + switch i { + case 0: + if _, ok := teamMap[t]; ok { + t1 = teamMap[t].Name + + if t1 == "" { + t1 = fmt.Sprintf("[%s%s]", config.Config.Upload.Host, teamMap[t].LogoImg) + } + + } + teams[0] = &pb.DemTitleRes_Team{ + Id: t, + Title: t1, + } + case 1: + if _, ok := teamMap[t]; ok { + t2 = teamMap[t].Name + + if t2 == "" { + t2 = fmt.Sprintf("[%s%s]", config.Config.Upload.Host, teamMap[t].LogoImg) + } + } + teams[1] = &pb.DemTitleRes_Team{ + Id: t, + Title: t2, + } + } + } + + s.Res.Schedules = append(s.Res.Schedules, &pb.DemTitleRes_Schedule{ + Id: v.ID, + Title: fmt.Sprintf("%s vs %s", t1, t2), + Teams: teams, + }) + } + + return +} + +func (s *DemTitle) mall() (err error) { + if len(s.Req.GetMallIds()) == 0 { + return + } + + m := s.GetDao().RedeemMall + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetMallIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Malls = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.Malls = append(s.Res.Malls, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: v.Title, + }) + } + + return +} + +func (s *DemTitle) mallItem() (err error) { + if len(s.Req.GetMallItemIds()) == 0 { + return + } + + m := s.GetDao().RedeemMallItem + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetMallItemIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + var rewardMap = make(map[int64]string) + for _, v := range list { + if _, ok := rewardMap[v.ID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + rewardMap[v.RewardID] = "" + } + } + + rewardM := s.GetDao().Reward + rewardList, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range rewardList { + rewardMap[v.ID] = v.RewardTitle + } + + s.Res.MallItems = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + s.Res.MallItems = append(s.Res.MallItems, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: rewardMap[v.RewardID], + }) + } + + return +} + +func (s *DemTitle) unoCards() (err error) { + if len(s.Req.GetUnoCardIds()) == 0 { + return + } + + m := s.GetDao().FissionCampaignUnoCard + list, err := m.WithContext(s.Ctx).Where(m.ID.In(s.Req.GetUnoCardIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.UnoCards = make([]*pb.DemTitleRes_Title, 0, len(list)) + for _, v := range list { + var title = fmt.Sprintf("图片[%s%s]", config.Config.Upload.Host, v.ImgURL) + if v.AppParam != "" { + title += fmt.Sprintf(";APP端参数: %s", v.AppParam) + } + if v.WebURL != "" { + title += fmt.Sprintf(";H5跳转url: %s", v.WebURL) + } + if v.PcParam != "" { + title += fmt.Sprintf(";PC端参数: %s", v.PcParam) + } + + s.Res.UnoCards = append(s.Res.UnoCards, &pb.DemTitleRes_Title{ + Id: v.ID, + Title: title, + }) + } + + return +} + +func (s *DemTitle) _getRewardMap(projectId int64, rewardIds []int64) (data map[int64]provider.RewardAutoLang, err error) { + + var newIds []int64 + for _, id := range rewardIds { + if _, ok := s.rewardMap[id]; !ok { + newIds = append(newIds, id) + } + } + + if len(newIds) == 0 { + return s.rewardMap, nil + } + + m := s.GetDao().FissionCampaignReward + var rewards []*model.FissionCampaignReward + rewards, err = m.WithContext(s.Ctx).Where(m.ID.In(newIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var bids []int64 + var brMap = make(map[int64]string) + for _, v := range rewards { + if _, ok := brMap[v.RewardID]; !ok { + bids = append(bids, v.RewardID) + brMap[v.RewardID] = "" + } + } + + prewards, err := provider.NewRewards(s.Ctx, projectId, bids...) + if err != nil { + return + } + + for _, v := range rewards { + s.rewardMap[v.ID], _ = prewards.InfoAutoLang(v.RewardID) + } + + return s.rewardMap, nil +} diff --git a/internal/service/containers/campaignstat/related.go b/internal/service/containers/campaignstat/related.go new file mode 100644 index 0000000..8591d45 --- /dev/null +++ b/internal/service/containers/campaignstat/related.go @@ -0,0 +1,261 @@ +package campaignstat + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "fmt" + "github.com/golang-module/carbon/v2" +) + +type Related struct { + logic.Logic + Req *pb.RelatedReq + Res *pb.RelatedRes +} + +func (s *Related) Run() error { + return logic.Run(s) +} + +func (s *Related) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + start, end, statType := s.statParams() + + err = s.line(cpn, start, end, statType) + if err != nil { + return + } + + err = s.change(cpn, start, end) + if err != nil { + return + } + + return +} + +// 活动数据 +func (s *Related) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + return +} + +// 统计参数 +func (s *Related) statParams() (start, end carbon.Carbon, statType int8) { + start = utils.Ternary(s.Req.GetStartTime() != 0, carbon.CreateFromTimestamp(s.Req.GetStartTime()), carbon.Now().StartOfDay()) + end = utils.Ternary(s.Req.GetEndTime() != 0, carbon.CreateFromTimestamp(s.Req.GetEndTime()), carbon.Now()) + statType = mtype.FissionTotalCycleTypeHour + + if start.AddDay().Lt(end) { + statType = mtype.FissionTotalCycleTypeDay + } + + s.Res.ReportUser = &pb.RelatedRes_Report{} + s.Res.ReportNum = &pb.RelatedRes_Report{} + + return +} + +// 线数据 +func (s *Related) line(cpn *model.FissionCampaign, start, end carbon.Carbon, statType int8) (err error) { + + var marks = []string{ + mtype.FissionBehaviorMarkClickShare, + mtype.FissionBehaviorMarkViewDownload, + mtype.FissionBehaviorMarkClickDownload, + mtype.FissionBehaviorMarkViewWechat, + } + + m := s.GetDao().FissionTotalCycle + list, err := m.WithContext(s.Ctx). + Where( + m.StatTime.Gte(start.Timestamp()), + m.StatTime.Lte(end.Timestamp()), + m.CampaignID.Eq(cpn.ID), + m.StatType.Eq(statType), + m.Mark.In(marks...), + ).Find() + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var x []string + var xMap = make(map[string]int) + switch statType { + case mtype.FissionTotalCycleTypeHour: + hours := utils.BetweenHour(start, end) + x = make([]string, 0, len(hours)) + for k, v := range hours { + key := fmt.Sprintf("%dh", v) + x = append(x, key) + xMap[key] = k + } + case mtype.FissionTotalCycleTypeDay: + x = utils.BetweenDay(start, end) + for k, v := range x { + xMap[v] = k + } + } + + //人数 + xLen := len(x) + var nf, unf = "num", "user_num" + var lineMap = make(map[string]map[string]*pb.RelatedRes_Y) + for _, mark := range marks { + t := mtype.BehaviorMarkToType[mark] + lineMap[mark] = map[string]*pb.RelatedRes_Y{ + nf: { + Type: t, + Data: make([]int64, xLen), + }, + unf: { + Type: t, + Data: make([]int64, xLen), + }, + } + } + + for _, v := range list { + + var idx int + var t = carbon.CreateFromTimestamp(v.StatTime) + switch statType { + case mtype.FissionTotalCycleTypeHour: + idx = xMap[fmt.Sprintf("%dh", t.Hour())] + case mtype.FissionTotalCycleTypeDay: + idx = xMap[t.ToShortDateString()] + } + + lineMap[v.Mark][nf].Data[idx] = v.Num + lineMap[v.Mark][unf].Data[idx] = v.UserNum + } + + // 即时数据 + pTotal := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var immNum, immUserNum map[string]int64 + var immIdx int + + now := carbon.Now() + switch statType { + case mtype.FissionTotalCycleTypeHour: + if carbon.Now().StartOfDay().Eq(start.StartOfDay()) { // 当天的某一个小时 + immIdx = xMap[fmt.Sprintf("%dh", carbon.Now().Hour())] + immNum, immUserNum, err = pTotal.CycleHour(now, marks...) + if err != nil { + return + } + + } + case mtype.FissionTotalCycleTypeDay: + if end.Gte(now) { // 如果结束时间大于当前时间 + dayStr := now.ToShortDateString() + immIdx = xMap[dayStr] + immNum, immUserNum, err = pTotal.CycleDay(now, marks...) + if err != nil { + return + } + } + } + + for k, v := range immNum { + lineMap[k][nf].Data[immIdx] = v + } + for k, v := range immUserNum { + lineMap[k][unf].Data[immIdx] = v + } + + s.AddAfterRun(func() (err error) { + s.Res.X = x + for _, v := range marks { + s.Res.ReportNum.Y = append(s.Res.ReportNum.Y, lineMap[v][nf]) + s.Res.ReportUser.Y = append(s.Res.ReportUser.Y, lineMap[v][unf]) + } + + return + }) + + return +} + +func (s *Related) change(cpn *model.FissionCampaign, start, end carbon.Carbon) (err error) { + total := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var ( + viewDownloadNum = total.NumType(mtype.FissionBehaviorTypeViewDownload, start, end) //下载页访问总次数 + viewDownloadUser = total.UserNumType(mtype.FissionBehaviorTypeViewDownload, start, end) //下载页访问总人数 + clickDownloadNum = total.NumType(mtype.FissionBehaviorTypeClickDownload, start, end) //下载按钮点击总次数 + clickDownloadUser = total.UserNumType(mtype.FissionBehaviorTypeClickDownload, start, end) //下载按钮点击人次数 + viewWechatNum = total.NumType(mtype.FissionBehaviorTypeViewWechat, start, end) //微信页访问总次数 + viewWechatUser = total.UserNumType(mtype.FissionBehaviorTypeViewWechat, start, end) //微信页访问总人数数 + clickShareNum = total.NumType(mtype.FissionBehaviorTypeClickShare, start, end) //点击分享按钮次数 + clickShareUser = total.UserNumType(mtype.FissionBehaviorTypeClickShare, start, end) //点击分享按钮人数 + clickMediaNum int64 //点击社媒次数 + clickMediaUser int64 //点击社媒人数 + ) + + var mediaDataNum []*pb.RelatedRes_MediaData + for _, v := range total.MarkNumType(mtype.FissionBehaviorTypeClickMedia, start, end) { + clickMediaNum += v.Total + mediaDataNum = append(mediaDataNum, &pb.RelatedRes_MediaData{ + Name: consts.ShareTitleMap[utils.StrToInt64(utils.BehaviorMarkId(v.Mark))], + Total: v.Total, + }) + } + + var mediaDataUser []*pb.RelatedRes_MediaData + for _, v := range total.MarkUserNumType(mtype.FissionBehaviorTypeClickMedia, start, end) { + clickMediaUser += v.Total + mediaDataUser = append(mediaDataUser, &pb.RelatedRes_MediaData{ + Name: consts.ShareTitleMap[utils.StrToInt64(utils.BehaviorMarkId(v.Mark))], + Total: v.Total, + }) + } + + s.AddAfterRun(func() (err error) { + + s.Res.ReportNum.MediaNum = clickMediaNum + s.Res.ReportUser.MediaNum = clickMediaUser + + s.Res.ReportNum.MediaData = mediaDataNum + s.Res.ReportUser.MediaData = mediaDataUser + + s.Res.ReportNum.Share = utils.PercentNoZero(viewDownloadNum, clickShareNum) + s.Res.ReportUser.Share = utils.PercentNoZero(viewDownloadUser, clickShareUser) + + s.Res.ReportNum.Wechat = utils.PercentNoZero(viewDownloadNum, viewWechatNum) + s.Res.ReportUser.Wechat = utils.PercentNoZero(viewDownloadUser, viewWechatUser) + + s.Res.ReportNum.Download = utils.PercentNoZero(clickDownloadNum, viewDownloadNum) + s.Res.ReportUser.Download = utils.PercentNoZero(clickDownloadUser, viewDownloadUser) + + s.Res.ReportNum.Media = utils.PercentNoZero(clickMediaNum, clickShareNum) + s.Res.ReportUser.Media = utils.PercentNoZero(clickMediaUser, clickShareUser) + + return + }) + + return +} diff --git a/internal/service/containers/campaignstat/report_info.go b/internal/service/containers/campaignstat/report_info.go new file mode 100644 index 0000000..e8b6d84 --- /dev/null +++ b/internal/service/containers/campaignstat/report_info.go @@ -0,0 +1,240 @@ +package campaignstat + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" +) + +type ReportInfo struct { + logic.Logic + Req *pb.ReportInfoReq + Res *pb.ReportInfoRes +} + +func (s *ReportInfo) Run() error { + return logic.Run(s) +} + +func (s *ReportInfo) Exec() (err error) { + cpn, conf, err := s.campaign() + if err != nil { + return + } + + err = s.langOffset(cpn) + if err != nil { + return + } + + err = s.ticket(cpn) + if err != nil { + return + } + + err = s.fission(cpn) + if err != nil { + return + } + + return s.events(cpn, conf) +} + +// 活动数据 +func (s *ReportInfo) campaign() (cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("campaign not found") + return + } + + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.Res.HashId = cpn.HashID + s.Res.Title = cpn.Title + s.Res.CoverUrl = cpn.CoverURL + s.Res.FissionMark = consts.FissionIdMap[cpn.FissionID] + s.Res.StartTime = cpn.TStart + s.Res.EndTime = cpn.TEnd + s.Res.Status = int32(cpn.Status) + s.Res.TOffset = cpn.TOffset + s.Res.Target = int32(cpn.Target) + s.Res.RewardType = []string{"app"} + + return +} + +// 语言时区 +func (s *ReportInfo) langOffset(cpn *model.FissionCampaign) (err error) { + if len(cpn.GetLangMarks()) == 1 { + return + } + + m := s.GetDao().FissionCampaignLang + langs, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.LangOffset = make([]*pb.ReportInfoRes_LangOffset, 0, len(langs)+2) + + s.Res.LangOffset = append(s.Res.LangOffset, &pb.ReportInfoRes_LangOffset{ + TOffset: cpn.TOffset, + LangMark: "", + }, &pb.ReportInfoRes_LangOffset{ + TOffset: cpn.TOffset, + LangMark: cpn.GetLangMarks()[0], + }) + + for _, lang := range langs { + s.Res.LangOffset = append(s.Res.LangOffset, &pb.ReportInfoRes_LangOffset{ + TOffset: lang.TOffset, + LangMark: lang.LangMark, + }) + } + + return +} + +func (s *ReportInfo) events(cpn *model.FissionCampaign, conf *model.FissionCampaignConfig) (err error) { + temp, err := cache.NewFissionTemp(s.Ctx).FindById(cpn.TemplateID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + group, err := cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + pfa := fissionaction.NewActionList(s.Ctx, cpn, conf, group) + fixDms := pfa.GetFixDimension() + + s.Res.FixDimensions = make([]*pb.ReportInfoRes_Dimension, 0, len(fixDms)) + for _, v := range fixDms { + s.Res.FixDimensions = append(s.Res.FixDimensions, &pb.ReportInfoRes_Dimension{ + Key: v, + }) + } + + actions := pfa.GetFissionAction() + s.Res.Events = make([]*pb.ReportInfoRes_Event, 0, len(actions)) + for _, v := range actions { + + dms := pfa.GetDimension(v) + one := &pb.ReportInfoRes_Event{ + Type: v, + Dimensions: make([]*pb.ReportInfoRes_Dimension, 0, len(dms)), + } + + for _, d := range dms { + one.Dimensions = append(one.Dimensions, &pb.ReportInfoRes_Dimension{ + Key: d, + }) + } + + s.Res.Events = append(s.Res.Events, one) + } + + return +} + +func (s *ReportInfo) ticket(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignTicket + + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Open.Eq(mtype.Yes)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + switch v.Mark { + case mtype.FissionCampaignTicketCustom: + s.Res.OpenCustom = 1 + case mtype.FissionCampaignTicketFixed: + s.Res.OpenFixed = 1 + } + } + + if verify.InArray[int64](cpn.FissionID, consts.IdWinTogether, consts.IdReferral) { + s.Res.OpenFixed = 1 + } + + return +} + +func (s *ReportInfo) fission(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdKeep: + return s._keep(cpn) + case consts.IdReferral: + return s._referral(cpn) + case consts.IdWinTogether: + return s._win(cpn) + } + + return +} + +func (s *ReportInfo) _keep(cpn *model.FissionCampaign) (err error) { + s.Res.RewardType = append(s.Res.RewardType, "step") + s.Res.ShowSelect = 1 + + return +} + +func (s *ReportInfo) _referral(cpn *model.FissionCampaign) (err error) { + s.Res.ShowAll = 1 + + m := s.GetDao().FissionCampaignReward + info, err := m.WithContext(s.Ctx).Select(m.ID).Where(m.CampaignID.Eq(cpn.ID), m.RewardType.Eq(mtype.FissionCampaignRewardTypeExtra), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if info != nil { + s.Res.RewardType = append(s.Res.RewardType, "extra") + } + + return +} + +func (s *ReportInfo) _win(cpn *model.FissionCampaign) (err error) { + s.Res.RewardType = append(s.Res.RewardType, "newcomer") + s.Res.ShowAll = 1 + + m := s.GetDao().FissionCampaignReward + info, err := m.WithContext(s.Ctx).Select(m.ID).Where(m.CampaignID.Eq(cpn.ID), m.RewardType.Eq(mtype.FissionCampaignRewardTypeExtra), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if info != nil { + s.Res.RewardType = append(s.Res.RewardType, "extra") + } + + return +} diff --git a/internal/service/containers/campaignstat/stat.go b/internal/service/containers/campaignstat/stat.go new file mode 100644 index 0000000..a850a2a --- /dev/null +++ b/internal/service/containers/campaignstat/stat.go @@ -0,0 +1,148 @@ +package campaignstat + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "github.com/golang-module/carbon/v2" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" +) + +type Stat struct { + logic.Logic + Req *pb.StatReq + Res *pb.StatRes +} + +func (s *Stat) Run() error { + return logic.Run(s) +} + +func (s *Stat) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + switch cpn.Target { + case mtype.FissionCampaignConfigTargetAdsGame: + err = s.adsBehavior(cpn) + if err != nil { + return + } + default: + } + + return +} + +// 活动数据 +func (s *Stat) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + //活动可处理时间 + endTime := utils.CampaignArchiveEnd(cpn.EndTime) + if endTime.Before(time.Now()) && cpn.Target != mtype.FissionCampaignConfigTargetAdsGame { + err = workerr.VerifyError("cpn stat end") + return + } + + return +} + +// w2a 互动广告统计 +func (s *Stat) adsBehavior(cpn *model.FissionCampaign) (err error) { + if s.Req.GetWid() == "" { + return + } + switch s.Req.BehaviorType { + case mtype.FissionBehaviorTypeView: + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: s.Req.GetBehaviorType(), + BehaviorTime: s.Req.GetBehaviorTime(), + UserMark: s.Req.GetWid(), + }) + + var channel *model.FissionCampaignChannel + channel, err = cmm.NewCMM(s.Ctx, s.GetDao()).UserBindChannel(cpn.ID, s.Req.GetCMark()) + if err != nil { + return + } + + if channel != nil { + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: mtype.FissionBehaviorTypeChannelView, + BehaviorTime: s.Req.GetBehaviorTime(), + UserMark: s.Req.GetWid(), + MarkId: fmt.Sprint(channel.ID), + }) + } + + default: + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: s.Req.GetBehaviorType(), + BehaviorTime: s.Req.GetBehaviorTime(), + UserMark: s.Req.GetWid(), + }) + } + + // 去触发定时任务统计 + t := carbon.CreateFromTimestamp(s.Req.GetBehaviorTime()) + hourStr, dayStr := t.Format(consts.YmdH), t.ToShortDateString() + hourEndTime, dayEndTime := t.AddHours(2).StartOfHour().Timestamp(), t.AddDays(2).StartOfDay().Timestamp() + + hourLock := app.NewRedisLock(s.Ctx, ckey.FissionAdsHourStat(cpn.ID, hourStr), lock.SetExpire(time.Duration(hourEndTime)*time.Second)) + dayLock := app.NewRedisLock(s.Ctx, ckey.FissionAdsDayStat(cpn.ID, dayStr), lock.SetExpire(time.Duration(dayEndTime)*time.Second)) + + if hourLock.SoftLock() { + err = s._fissionArchiveTask(cpn.ID, hourEndTime, mtype.FissionArchiveTaskMarkAdsHour) + if err != nil { + hourLock.Release() + } + } + + if dayLock.SoftLock() { + err = s._fissionArchiveTask(cpn.ID, dayEndTime, mtype.FissionArchiveTaskMarkAdsDay) + if err != nil { + dayLock.Release() + } + } + + return +} + +func (s *Stat) _fissionArchiveTask(cpnId, endTime int64, mark string) (err error) { + m := s.GetDao().FissionArchiveTask + + _, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.Mark.Eq(mark), m.EndTime.Lt(endTime)). + UpdateSimple(m.EndTime.Value(endTime), m.IsStop.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/containers/campaignstat/stat_event.go b/internal/service/containers/campaignstat/stat_event.go new file mode 100644 index 0000000..379846d --- /dev/null +++ b/internal/service/containers/campaignstat/stat_event.go @@ -0,0 +1,289 @@ +package campaignstat + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" +) + +type StatEvent struct { + logic.Logic + Req *pb.StatEventReq + Res *pb.StatEventRes +} + +func (s *StatEvent) Run() error { + return logic.Run(s) +} + +func (s *StatEvent) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + if cpn.Target == mtype.FissionCampaignConfigTargetChild { + return s.childEvent(cpn) + } + + return s.event(cpn) +} + +// 活动数据 +func (s *StatEvent) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + s.Res.CampaignId = cpn.ID + s.Res.TOffect = provider.NewCampaignTZ(s.Ctx, cpn, s.Req.GetLangMark()).GetTz() + + return +} + +func (s *StatEvent) event(cpn *model.FissionCampaign) (err error) { + + switch cpn.FissionID { + case consts.IdGrow, consts.IdKeep: + return s._grow(cpn) + case consts.IdQa, consts.IdQaVideo, consts.IdQaAudio, consts.IdPrizeAnswer: + return s._qa(cpn) + case consts.IdWinTogether: + return s._win(cpn) + case consts.IdCoin: + return s._coin(cpn) + case consts.IdSignIn: + return s._sign(cpn) + case consts.IdBallot: + return s._ballot(cpn) + default: + return s._normal(cpn) + } +} + +func (s *StatEvent) _normal(cpn *model.FissionCampaign) (err error) { + var eventIds = []int32{ + mtype.FissionActionTypeView, + } + + m := s.GetDao().FissionCampaignTicket + tickets, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.In(mtype.FissionCampaignTicketFixed, mtype.FissionCampaignTicketCustom, mtype.FissionCampaignTicketRewardHelp), + m.Open.Eq(mtype.Yes), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 保证一些顺序 顺序:固定事件->助力->自定义 + var sortMap = make(map[string]*model.FissionCampaignTicket) + for _, ticket := range tickets { + sortMap[ticket.Mark] = ticket + } + + var installEvent, registerEvent bool + + // 固定 + if ticket, ok := sortMap[mtype.FissionCampaignTicketFixed]; ok { + switch ticket.AppEvent { + case mtype.FissionCampaignTicketAppEventInstall: + eventIds = append(eventIds, + mtype.FissionActionTypeAppInstall, + mtype.FissionActionTypeWebFirstOpen, + mtype.FissionActionTypeClickDownload, + mtype.FissionActionTypeViewDownload, + ) + installEvent = true + case mtype.FissionCampaignTicketAppEventRegister: + eventIds = append(eventIds, mtype.FissionActionTypeAppRegister) + registerEvent = true + } + } + + // 助力 + if ticket, ok := sortMap[mtype.FissionCampaignTicketRewardHelp]; ok { + for _, mark := range ticket.GetHelpEvent() { + + s.Res.HelpEvent = append(s.Res.HelpEvent, mark) + + if mark == mtype.FissionCampaignTicketHelpEventInstall && !installEvent { + eventIds = append(eventIds, + mtype.FissionActionTypeAppInstall, + mtype.FissionActionTypeWebFirstOpen, + mtype.FissionActionTypeClickDownload, + mtype.FissionActionTypeViewDownload, + ) + installEvent = true + } else if mark == mtype.FissionCampaignTicketHelpEventRegister && !registerEvent { + eventIds = append(eventIds, mtype.FissionActionTypeAppRegister) + registerEvent = true + } + } + + eventIds = append(eventIds, mtype.FissionActionTypeHelp) + } + + // 自定义 + if ticket, ok := sortMap[mtype.FissionCampaignTicketCustom]; ok { + + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventRegister: + if !registerEvent { + eventIds = append(eventIds, mtype.FissionActionTypeAppRegister) + registerEvent = true + } + case mtype.FissionCampaignTicketPreEventInstall: + if !installEvent { + eventIds = append(eventIds, + mtype.FissionActionTypeAppInstall, + mtype.FissionActionTypeWebFirstOpen, + mtype.FissionActionTypeClickDownload, + mtype.FissionActionTypeViewDownload, + ) + installEvent = true + } + } + + eventIds = append(eventIds, mtype.FissionActionTypeFinishCond) + + err = s._getTask(cpn.ID) + if err != nil { + return + } + } + + s.Res.EventIds = eventIds + return +} + +func (s *StatEvent) _getTask(cpnId int64) (err error) { + condM := s.GetDao().FissionCampaignCond + var conds []*model.FissionCampaignCond + conds, err = condM.WithContext(s.Ctx). + Where( + condM.CampaignID.Eq(cpnId), + condM.RewardID.Eq(0), + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Tasks = make([]*pb.StatEventRes_Task, 0, len(conds)) + for _, cond := range conds { + s.Res.Tasks = append(s.Res.Tasks, &pb.StatEventRes_Task{ + Id: cond.ID, + Title: cond.Desc, + }) + } + + return +} + +func (s *StatEvent) _grow(cpn *model.FissionCampaign) (err error) { + err = s._normal(cpn) + if err != nil { + return + } + + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeGrow, mtype.FissionActionTypeGrowOk) + + return +} + +func (s *StatEvent) _qa(cpn *model.FissionCampaign) (err error) { + err = s._normal(cpn) + if err != nil { + return + } + + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeSubmitQa) + + return +} + +func (s *StatEvent) _win(cpn *model.FissionCampaign) (err error) { + err = s._normal(cpn) + if err != nil { + return + } + + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeNewcomer) + + return +} + +func (s *StatEvent) _coin(cpn *model.FissionCampaign) (err error) { + err = s._normal(cpn) + if err != nil { + return + } + + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeUseCoin) + + return +} + +func (s *StatEvent) _sign(cpn *model.FissionCampaign) (err error) { + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeSign) + + conf, err := cache.NewCampaignSign(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil || conf.HasCard == mtype.No { + return + } + + s.Res.EventIds = append(s.Res.EventIds, + mtype.FissionActionTypeAppInstall, + mtype.FissionActionTypeWebFirstOpen, + mtype.FissionActionTypeClickDownload, + mtype.FissionActionTypeViewDownload, + ) + + return +} + +func (s *StatEvent) childEvent(cpn *model.FissionCampaign) (err error) { + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeChildShow) + + switch cpn.ChildType { + case mtype.FissionCampaignChildTypeSign: + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeChildSign) + case mtype.FissionCampaignChildTypeInvite: + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeChildInvite) + case mtype.FissionCampaignChildTypeLucky, mtype.FissionCampaignChildTypeBlind: + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeChildLottery) + case mtype.FissionCampaignChildTypeTask: + + } + + return +} + +func (s *StatEvent) _ballot(cpn *model.FissionCampaign) (err error) { + s.Res.EventIds = append(s.Res.EventIds, mtype.FissionActionTypeView) + + return +} diff --git a/internal/service/containers/campaignstat/summary.go b/internal/service/containers/campaignstat/summary.go new file mode 100644 index 0000000..f954bdc --- /dev/null +++ b/internal/service/containers/campaignstat/summary.go @@ -0,0 +1,339 @@ +package campaignstat + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "github.com/golang-module/carbon/v2" + "gorm.io/gen" +) + +const ( + summaryTypeInstall = iota + 1 + summaryTypeRegister + summaryTypeEvent + summaryTypeSign + summaryTypeGrow +) + +type Summary struct { + logic.Logic + Req *pb.SummaryReq + Res *pb.SummaryRes +} + +func (s *Summary) Run() error { + return logic.Run(s) +} + +func (s *Summary) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.common(cpn) + if err != nil { + return + } + + err = s.scenes(cpn) + if err != nil { + return + } + + return +} + +func (s *Summary) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found campaign") + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Title = cpn.Title + s.Res.StartTime = cpn.StartTime + s.Res.EndTime = cpn.EndTime + s.Res.Status = int32(cpn.Status) + + return + }) + + return +} + +// 通用统计 +func (s *Summary) common(cpn *model.FissionCampaign) (err error) { + //裂变最深层级 + furM := s.GetDao().FissionUser.SubTable(cpn.ID) + var maxDeep struct { + Deep int64 `json:"deep"` + } + err = furM.WithContext(s.Ctx).Select(furM.Deep.Max().As("deep")).Where(furM.CampaignID.Eq(cpn.ID)).Scan(&maxDeep) + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + //当天数据 + dayNum, dayUserNum, err := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID).CycleDay(carbon.Now()) + if err != nil { + return + } + + switch cpn.FissionID { + case consts.IdGrow: + s.Res.Grow = &pb.SummaryRes_Grow{} + + s.AddAfterRun(func() (err error) { + s.Res.Grow.Today = dayUserNum[mtype.FissionBehaviorMarkGrow] + return + }) + + } + + s.AddAfterRun(func() (err error) { + + s.Res.MaxDeep = maxDeep.Deep + + s.Res.TodayViewNum = dayNum[mtype.FissionBehaviorMarkView] + s.Res.TodayUserNum = dayUserNum[mtype.FissionBehaviorMarkView] + + s.Res.TodaySignNum = dayUserNum[mtype.FissionBehaviorMarkSign] + s.Res.TodaySignTargetNum = dayUserNum[mtype.FissionBehaviorMarkSignTarget] + + return + }) + + return +} + +// 场景数据 +func (s *Summary) scenes(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var t int32 = summaryTypeEvent + defer s.AddAfterRun(func() (err error) { + s.Res.Target = int32(conf.Target) + s.Res.Option = int32(conf.Option) + s.Res.Type = t + + return + }) + + switch cpn.FissionID { + case consts.IdSignIn: + t = summaryTypeSign + + return s._sign(conf) + case consts.IdGrow: + t = summaryTypeGrow + + return s._grow(conf) + } + + switch conf.Option { + case mtype.FissionCampaignConfigTargetOptionApp: + t = utils.Ternary[int32](conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister, summaryTypeRegister, summaryTypeInstall) + } + + switch conf.Option { + case mtype.FissionCampaignConfigTargetOptionApp: + return s._optionApp(conf) + case mtype.FissionCampaignConfigTargetOptionFriend, mtype.FissionCampaignConfigTargetOptionSelf, + mtype.FissionCampaignConfigTargetOptionUse, mtype.FissionCampaignConfigTargetOptionTask: + return s._eventData(conf) + } + + return +} + +func (s *Summary) _optionApp(conf *model.FissionCampaignConfig) (err error) { + + m := s.GetDao().FissionTotal + var cond = []gen.Condition{ + m.CampaignID.Eq(conf.CampaignID), + } + + if conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister { + cond = append(cond, m.Mark.In(mtype.FissionBehaviorMarkAppRegister, mtype.FissionBehaviorMarkClickShare, mtype.FissionBehaviorMarkView)) + } else { + cond = append(cond, m.Mark.In(mtype.FissionBehaviorMarkAppInstall, mtype.FissionBehaviorMarkClickShare, mtype.FissionBehaviorMarkView)) + } + + total, err := m.WithContext(s.Ctx).Where(cond...).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + for _, v := range total { + + switch v.Mark { + case mtype.FissionBehaviorMarkView: + s.Res.ViewNum = v.Num + s.Res.ViewUserNum = v.UserNum + case mtype.FissionBehaviorMarkClickShare: + s.Res.ShareUserNum = v.UserNum + case mtype.FissionBehaviorMarkAppRegister, mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNum = v.Num + } + + } + + return + + }) + + return +} + +// 事件数据 +func (s *Summary) _eventData(conf *model.FissionCampaignConfig) (err error) { + m := s.GetDao().FissionTotal + total, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(conf.CampaignID), + m.Mark.In(mtype.FissionBehaviorMarkAppInstall, mtype.FissionBehaviorMarkView, mtype.FissionBehaviorMarkFinishTask), + ).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(conf.CampaignID)). + Where( + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.EventData = &pb.SummaryRes_EventData{ + TargetNum: 0, + TargetUserNum: 0, + Conds: make([]*pb.SummaryRes_Cond, 0, len(conds)), + } + + for _, v := range total { + + switch v.Mark { + case mtype.FissionBehaviorMarkFinishTask: + s.Res.EventData.TargetNum = v.Num + s.Res.EventData.TargetUserNum = v.UserNum + case mtype.FissionBehaviorMarkView: + s.Res.ViewNum = v.Num + s.Res.ViewUserNum = v.UserNum + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNum = v.Num + } + + } + + for _, v := range conds { + s.Res.EventData.Conds = append(s.Res.EventData.Conds, &pb.SummaryRes_Cond{ + Event: v.Event, + EventKey: v.EventKey, + Num: v.Num, + UserNum: v.UserNum, + Total: v.Total, + IfCond: int32(v.IfCond), + }) + } + + return + }) + + return +} + +func (s *Summary) _sign(conf *model.FissionCampaignConfig) (err error) { + m := s.GetDao().FissionTotal + var cond = []gen.Condition{ + m.CampaignID.Eq(conf.CampaignID), + m.Mark.In(mtype.FissionBehaviorMarkAppInstall, mtype.FissionBehaviorMarkSign, mtype.FissionBehaviorMarkSignTarget, mtype.FissionBehaviorMarkView), + } + + total, err := m.WithContext(s.Ctx).Where(cond...).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + for _, v := range total { + + switch v.Mark { + case mtype.FissionBehaviorMarkView: + s.Res.ViewNum = v.Num + s.Res.ViewUserNum = v.UserNum + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNum = v.Num + case mtype.FissionBehaviorMarkSign: + s.Res.SignNum = v.UserNum + case mtype.FissionBehaviorMarkSignTarget: + s.Res.SignTargetNum = v.UserNum + } + + } + + return + + }) + + return +} + +func (s *Summary) _grow(conf *model.FissionCampaignConfig) (err error) { + m := s.GetDao().FissionTotal + var cond = []gen.Condition{ + m.CampaignID.Eq(conf.CampaignID), + m.Mark.In(mtype.FissionBehaviorMarkAppInstall, mtype.FissionBehaviorMarkGrow, mtype.FissionBehaviorMarkView), + } + + total, err := m.WithContext(s.Ctx).Where(cond...).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + + for _, v := range total { + + switch v.Mark { + case mtype.FissionBehaviorMarkView: + s.Res.ViewNum = v.Num + s.Res.ViewUserNum = v.UserNum + case mtype.FissionBehaviorMarkAppInstall: + s.Res.InstallNum = v.Num + case mtype.FissionBehaviorMarkGrow: + s.Res.Grow.Total = v.UserNum + } + + } + + return + + }) + + return +} diff --git a/internal/service/containers/campaignstat/top_ten.go b/internal/service/containers/campaignstat/top_ten.go new file mode 100644 index 0000000..59ee561 --- /dev/null +++ b/internal/service/containers/campaignstat/top_ten.go @@ -0,0 +1,422 @@ +package campaignstat + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" +) + +type TopTen struct { + logic.Logic + Req *pb.TopTenReq + Res *pb.TopTenRes +} + +func (s *TopTen) Run() error { + return logic.Run(s) +} + +func (s *TopTen) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + return s.rank(cpn) +} + +// 活动数据 +func (s *TopTen) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + return +} + +func (s *TopTen) rank(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignTicket + tickets, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Open.Eq(mtype.Yes)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, ticket := range tickets { + switch ticket.Mark { + case mtype.FissionCampaignTicketFixed: + err = s._invite(cpn) + if err != nil { + return + } + case mtype.FissionCampaignTicketCustom: + err = s._event(cpn) + if err != nil { + return + } + + if s.Res.Invite == nil && verify.InArray[int64](cpn.FissionID, consts.IdReferral, consts.IdWinTogether) { + err = s._invite(cpn) + if err != nil { + return + } + } + } + + } + + switch cpn.FissionID { + case consts.IdGrow, consts.IdKeep: + err = s._grow(cpn) + if err != nil { + return + } + case consts.IdChop: + err = s._chop(cpn) + if err != nil { + return + } + case consts.IdSignIn: + err = s._sign(cpn) + if err != nil { + return + } + } + + return +} + +func (s *TopTen) _invite(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionUserStat + + list, err := m.WithContext(s.Ctx). + Where(m.CampaignID.Eq(cpn.ID), m.EffectiveNum.Gt(0)). + Order(m.EffectiveNum.Desc(), m.DirectNum.Desc(), m.ID). + Limit(10).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + userIdMap, err := s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var rank int32 = 1 + s.Res.Invite = make([]*pb.TopTenRes_Invite, 0, len(list)) + for _, v := range list { + s.Res.Invite = append(s.Res.Invite, &pb.TopTenRes_Invite{ + Rank: rank, + UserId: userIdMap[v.UserID], + EffectNum: v.EffectiveNum, + InviteNum: v.DirectNum, + }) + + rank++ + } + + //裂变最深层级 + furM := s.GetDao().FissionUser.SubTable(cpn.ID) + var maxDeep struct { + Deep int64 `json:"deep"` + } + err = furM.WithContext(s.Ctx).Select(furM.Deep.Max().As("deep")).Where(furM.CampaignID.Eq(cpn.ID)).Scan(&maxDeep) + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + s.Res.MaxLv = maxDeep.Deep + + return +} + +func (s *TopTen) _event(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionUserStat + list, err := m.WithContext(s.Ctx). + Where(m.CampaignID.Eq(cpn.ID), m.TargetNum.Gt(0)). + Order(m.TargetNum.Desc(), m.ID). + Limit(10).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + userIdMap, err := s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + userCondMap, err := s._getUserConds(cpn.ID, ids) + if err != nil { + return + } + + var rank int32 = 1 + s.Res.Event = make([]*pb.TopTenRes_Event, 0, len(list)) + for _, v := range list { + s.Res.Event = append(s.Res.Event, &pb.TopTenRes_Event{ + Rank: rank, + UserId: userIdMap[v.UserID], + Num: v.TargetNum, + Conds: userCondMap[v.UserID], + }) + + rank++ + } + + return +} + +func (s *TopTen) _getUserId(campaignId int64, ids []int64) (data map[int64]string, err error) { + + m := s.GetDao().FissionUser.SubTable(campaignId) + + userList, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + data = make(map[int64]string, len(userList)) + for _, v := range userList { + data[v.ID] = v.UserMark + } + return +} + +func (s *TopTen) _getUserConds(cpnId int64, ids []int64) (data map[int64][]*pb.TopTenRes_Cond, err error) { + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpnId)). + Where( + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + m := s.GetDao().FissionUserCond + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userCondMap = make(map[int64]map[int64]int64) + for _, v := range list { + + if _, ok := userCondMap[v.UserID]; !ok { + userCondMap[v.UserID] = map[int64]int64{ + v.CondID: v.Num, + } + } else { + userCondMap[v.UserID][v.CondID] = v.Num + } + + } + + data = make(map[int64][]*pb.TopTenRes_Cond, len(ids)) + for _, userId := range ids { + + for _, cond := range conds { + one := &pb.TopTenRes_Cond{ + Desc: cond.Desc, + Num: 0, + } + + if uc, ok := userCondMap[userId]; ok { + one.Num = uc[cond.ID] + } + + data[userId] = append(data[userId], one) + } + } + + return +} + +func (s *TopTen) _grow(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionUserStat + + list, err := m.WithContext(s.Ctx). + Where(m.CampaignID.Eq(cpn.ID), m.GrowRewardNum.Gt(0)). + Order(m.GrowRewardNum.Desc(), m.GrowNum.Desc(), m.ID). + Limit(10).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + userIdMap, err := s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var rank int32 = 1 + for _, v := range list { + s.Res.Grow = append(s.Res.Grow, &pb.TopTenRes_Grow{ + Rank: rank, + UserId: userIdMap[v.UserID], + GrowNum: v.GrowNum, + GrowRewardNum: v.GrowRewardNum, + }) + rank++ + } + + return +} + +type chopHelp struct { + UserId int64 `json:"user_id"` + Mark string `json:"mark"` + Num int64 `json:"num"` +} + +func (s *TopTen) _chop(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionUserStat + + list, err := m.WithContext(s.Ctx). + Where(m.CampaignID.Eq(cpn.ID), m.HelpNum.Gt(0)). + Order(m.HelpNum.Desc(), m.ID). + Limit(10).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + var helps []*chopHelp + helpM := s.GetDao().FissionChopHelp + err = helpM.WithContext(s.Ctx). + Select(helpM.ID.Count().As("num"), helpM.UserID, helpM.Mark). + Where(helpM.CampaignID.Eq(cpn.ID), helpM.UserID.In(ids...)). + Group(helpM.UserID, helpM.Mark). + Scan(&helps) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var helpMap = make(map[int64][]*chopHelp, len(list)) + for _, v := range helps { + helpMap[v.UserId] = append(helpMap[v.UserId], v) + } + + userIdMap, err := s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var rank int32 = 1 + for _, v := range list { + one := &pb.TopTenRes_Help{ + Rank: rank, + UserId: userIdMap[v.UserID], + Num: v.HelpNum, + Detail: make([]*pb.TopTenRes_Detail, 0, len(helpMap[v.UserID])), + } + + for _, help := range helpMap[v.UserID] { + + one.Detail = append(one.Detail, &pb.TopTenRes_Detail{ + Title: help.Mark, + Num: help.Num, + }) + } + + s.Res.Help = append(s.Res.Help, one) + rank++ + } + + return +} + +func (s *TopTen) _sign(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionUserStat + + list, err := m.WithContext(s.Ctx). + Where(m.CampaignID.Eq(cpn.ID), m.SignNum.Gt(0)). + Order(m.SignNum.Desc(), m.SignRewardNum.Desc(), m.ID). + Limit(10).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + userIdMap, err := s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var rank int32 = 1 + for _, v := range list { + s.Res.Sign = append(s.Res.Sign, &pb.TopTenRes_Sign{ + Rank: rank, + UserId: userIdMap[v.UserID], + SignDay: v.SignNum, + SignRewardNum: v.SignRewardNum, + }) + rank++ + } + + return +} diff --git a/internal/service/containers/campaignstat/user_cycle.go b/internal/service/containers/campaignstat/user_cycle.go new file mode 100644 index 0000000..ddcbc38 --- /dev/null +++ b/internal/service/containers/campaignstat/user_cycle.go @@ -0,0 +1,203 @@ +package campaignstat + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + + bi_fission_actionpb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_fission_action" +) + +type UserCycle struct { + logic.Logic + Req *pb.UserCycleReq + Res *pb.UserCycleRes +} + +func (s *UserCycle) Run() error { + return logic.Run(s) +} + +func (s *UserCycle) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.platform(cpn.ID) + if err != nil { + return + } + + err = s.channel(cpn.ID) + if err != nil { + return + } + + err = s.media(cpn.ID) + if err != nil { + return + } + + return +} + +// 活动数据 +func (s *UserCycle) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + return +} + +func (s *UserCycle) platform(cpnId int64) (err error) { + + m := s.GetDao().FissionUserAttrTotal + + num, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.Attr.Eq(mtype.FissionUserAttrMarkPlatform)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var pnMap = make(map[string]int64) + for _, v := range num { + pnMap[v.Val] = v.Num + } + + var platforms = []string{consts.PlatformIOS, consts.PlatformAndroid, consts.PlatformWeb, consts.PlatformIPad, consts.PlatformOther} + + var list = make([]*pb.UserCycleRes_Part, 0, len(platforms)) + for _, v := range platforms { + list = append(list, &pb.UserCycleRes_Part{ + Title: v, + Num: pnMap[v], + }) + } + + s.Res.List = append(s.Res.List, &pb.UserCycleRes_One{ + Mark: "platform", + Parts: list, + }) + + return +} + +func (s *UserCycle) channel(cpnId int64) (err error) { + channelM := s.GetDao().FissionCampaignChannel + cList, err := channelM.WithContext(s.Ctx). + Where( + channelM.CampaignID.Eq(cpnId), + channelM.CType.Eq(mtype.FissionCampaignChannelTypeApp), + channelM.IsDel.Eq(mtype.No), + ). + Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(cList) <= 1 { + return + } + + var num []struct { + ChannelID int64 `json:"channel_id"` + Num int64 `json:"num"` + } + + m := s.GetDao().FissionUser.SubTable(cpnId) + err = m.WithContext(s.Ctx).Select(m.ChannelID, m.ID.Count().As("num")). + Where(m.CampaignID.Eq(cpnId), m.IsView.Eq(mtype.No)). + Group(m.ChannelID).Scan(&num) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cnMap = make(map[int64]int64) + for _, v := range num { + cnMap[v.ChannelID] = v.Num + } + + var list = make([]*pb.UserCycleRes_Part, 0, len(cList)) + for _, v := range cList { + list = append(list, &pb.UserCycleRes_Part{ + Title: v.Title, + Num: cnMap[v.ID], + }) + } + + s.Res.List = append(s.Res.List, &pb.UserCycleRes_One{ + Mark: "channel", + Parts: list, + }) + + return +} + +func (s *UserCycle) media(cpnId int64) (err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpnId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + ms := conf.GetShare() + if len(ms) == 0 { + return + } + + res, err := app.NewFissionBiFissionAction().CampaignTotal(s.Ctx, &bi_fission_actionpb.CampaignTotalReq{ + CampaignId: cpnId, + Type: mtype.FissionActionTypeClickShare, + }) + if err != nil { + return + } + + var msMap = make(map[int64]int64) + for _, v := range res.GetList() { + msMap[utils.StrToInt64(v.Mark)] = v.Num + } + + ms = append(ms, -1) + var list = make([]*pb.UserCycleRes_Part, 0, len(ms)) + + for _, id := range ms { + + if id == -1 { + list = append(list, &pb.UserCycleRes_Part{ + Title: "Copy Link", + Num: msMap[id], + }) + continue + } + + list = append(list, &pb.UserCycleRes_Part{ + Title: consts.ShareMap[id].Title, + Num: msMap[id], + }) + } + + s.Res.List = append(s.Res.List, &pb.UserCycleRes_One{ + Mark: "media", + Parts: list, + }) + + return +} diff --git a/internal/service/containers/campaignuser/answer.go b/internal/service/containers/campaignuser/answer.go new file mode 100644 index 0000000..9ca73f3 --- /dev/null +++ b/internal/service/containers/campaignuser/answer.go @@ -0,0 +1,123 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "time" +) + +type Answer struct { + logic.Logic + Req *pb.AnswerReq + Res *pb.AnswerRes +} + +func (s *Answer) Run() error { + return logic.Run(s) +} + +func (s *Answer) Exec() (err error) { + user, cpn, err := s.user() + if err != nil { + return + } + + err = s.answer(user, cpn) + if err != nil { + return + } + + return +} + +// 用户信息 +func (s *Answer) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + if cpn.EndTime < time.Now().Unix() { + err = workerr.CEndError + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + //如果活动没开始,还不是预览用户,不允许玩 + if cpn.StartTime > time.Now().Unix() && user.IsView == mtype.No { + err = workerr.CStartError + return + } + + return +} + +func (s *Answer) answer(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewQa(s.Ctx, user, cpn.FissionID, players.SetCpn(cpn)) + if err != nil { + return + } + + var submits = make([]*players.QaAnswer, 0, len(s.Req.GetSubmits())) + for _, submit := range s.Req.GetSubmits() { + submits = append(submits, &players.QaAnswer{ + QID: submit.GetQid(), + AID: submit.GetAid(), + }) + } + + score, qaRightNum, win, reward, record, info, err := player.Answer(submits) + if err != nil { + return + } + + s.Res.Id = reward.ID + s.Res.Win = win + s.Res.Title = info.Title + s.Res.Img = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Score = score + s.Res.Contact = info.Contact + s.Res.OpenToUse = info.OpenToUse + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + s.Res.QaNum = player.GetConf().QaNum + s.Res.QaRightNum = qaRightNum + + if record != nil { + s.Res.RewardHashId = record.HashID + } + + s.Res.KvData = make([]*pb.AnswerRes_KV, 0, len(info.KvData)) + for _, v := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.AnswerRes_KV{ + Key: v.Key, + Value: v.Value, + IsShow: v.IsShow, + }) + } + + return +} diff --git a/internal/service/containers/campaignuser/c_test.go b/internal/service/containers/campaignuser/c_test.go new file mode 100644 index 0000000..760c753 --- /dev/null +++ b/internal/service/containers/campaignuser/c_test.go @@ -0,0 +1,243 @@ +package campaignuser + +import ( + "context" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "math/rand" + "testing" + "time" + + "github.com/rs/xid" + + _ "joybuywork/test" +) + +func TestCampaignUserLottery(t *testing.T) { + res := &pb.LotteryRes{} + + container := new(Lottery) + { + container.Init(context.Background()) + container.Req = &pb.LotteryReq{ + UserId: 201832, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestVisit(t *testing.T) { + res := &pb.VisitRes{} + + container := new(Visit) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.VisitReq{ + Hid: "csl0586rdj7rp2n6h7n0", + Uid: "1234", + Cid: "KB", + Wid: "", + Lang: "", + Lv: "", + Cert: nil, + Ip: "", + Platform: "android", + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestReward(t *testing.T) { + res := &pb.RewardRes{} + + container := new(Reward) + { + container.Init(context.Background()) + container.Req = &pb.RewardReq{ + CampaignHashId: "d2ekiu6rdj7p8kl0tet0", + IsChild: 1, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestTask(t *testing.T) { + res := &pb.TaskRes{} + + container := new(Task) + { + container.Init(context.Background()) + container.Req = &pb.TaskReq{ + CampaignId: 4522, + UserId: 264337141494427648, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestList(t *testing.T) { + res := &pb.ListRes{} + + container := new(List) + { + container.Init(context.Background()) + container.Req = &pb.ListReq{ + Page: 1, + PerPage: 10, + CampaignId: 3906, + CampaignHashId: "", + Pid: 0, + UserMark: "", + Start: 0, + End: 0, + OrderByTimeAsc: false, + ParentUserMark: "", + Source: 0, + LangMark: "", + TOffset: -100, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestAddUser(t *testing.T) { + + for k := 0; k < 60; k++ { + var add []*model.FissionUser + for i := 0; i < 1000; i++ { + id := xid.New().String() + add = append(add, withdefault.FissionUser(&model.FissionUser{ + CampaignID: 3906, + SubUserID: id, + UserMark: id, + UserType: 2, + Source: int8(rand.Int31n(3) + 1), + LangMark: "zh", + })) + } + + _ = dao.FissionUser.WithContext(context.Background()).Create(add...) + } +} + +func TestDice(t *testing.T) { + res := &pb.DiceRes{} + + container := new(Dice) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.DiceReq{ + UserId: 21637, + Mark: "", + Val: "", + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestChild(t *testing.T) { + res := &pb.ChildRes{} + + container := new(Child) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.ChildReq{ + CampaignId: 4661, + UserId: 282913349099614208, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestChildActive(t *testing.T) { + res := &pb.ChildActiveRes{} + + container := new(ChildActive) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.ChildActiveReq{ + CampaignId: 4281, + UserId: 238320997416517632, + ChildType: 3, + } + container.Res = res + } + + t.Log(container.Run(), res) +} + +func TestAnswer(t *testing.T) { + res := &pb.AnswerRes{} + + container := new(Answer) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.AnswerReq{ + UserId: 280395097341292544, + Submits: []*pb.AnswerReq_Submit{ + { + Qid: 280392988873060350, + Aid: []int64{4136701824}, + }, + { + Qid: 280393044183347200, + Aid: []int64{4136701824}, + }, + { + Qid: 280392735583236100, + Aid: []int64{4013027200}, + }, + { + Qid: 280392825710440450, + Aid: []int64{4057034626}, + }, + { + Qid: 280392916873637900, + Aid: []int64{4101545858}, + }, + }, + CampaignId: 4664, + LangMark: "", + } + container.Res = res + } + + t.Log(container.Run(), res) + +} + +func TestExchange(t *testing.T) { + + res := &pb.ExchangeRes{} + container := new(Exchange) + { + container.Init(context.Background(), logic.WithTran()) + container.Req = &pb.ExchangeReq{ + UserId: 400613822780043264, + CampaignId: 5495, + MallItemId: 394138082718736384, + } + container.Res = res + } + + t.Log(container.Run(), res) + + time.Sleep(3 * time.Second) +} diff --git a/internal/service/containers/campaignuser/chat.go b/internal/service/containers/campaignuser/chat.go new file mode 100644 index 0000000..f0267cb --- /dev/null +++ b/internal/service/containers/campaignuser/chat.go @@ -0,0 +1,248 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "fmt" + + chatpb "gits.branchcn.com/backend/deepai/proto/go_proto/ai_chat" +) + +const ( + chatOk = iota // 正常 + chatTokenLimit // token 不足 + chatDayLimit // 每日上限 +) + +type Chat struct { + logic.Logic + Req *pb.ChatReq + Res *pb.ChatRes + + tz *provider.CampaignTZ + + chatOk bool + + lastMsg *model.FissionChatMsg +} + +func (s *Chat) Run() error { + return logic.Run(s) +} + +func (s *Chat) Exec() (err error) { + cpn, user, err := s.user() + if err != nil { + return + } + + chat, err := s.chat(user) + if err != nil { + return + } + + err = s.msg(user, cpn, chat) + if err != nil { + return + } + + return +} + +func (s *Chat) user() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.tz = provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + return +} + +func (s *Chat) chat(user *model.FissionUser) (chat *model.FissionChat, err error) { + chat, err = cache.NewFissionChat(s.Ctx).FindByUniq(user.CampaignID, user.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *Chat) msg(user *model.FissionUser, cpn *model.FissionCampaign, chat *model.FissionChat) (err error) { + status, output, err := s._status(user, cpn, chat) + if err != nil { + return + } + + var inputMsg = withdefault.FissionChatMsg(&model.FissionChatMsg{ + CampaignID: cpn.ID, + UserID: user.ID, + ChatID: chat.ID, + Source: mtype.FissionChatMsgSourceInput, + MsgType: mtype.FissionChatMsgTypeText, + }, mtype.ChatMsgVal{ + Text: s.Req.GetInput(), + }) + + var content string + var msgType int8 + var source string + switch status { + case chatOk: + + content = output + source = mtype.FissionChatMsgSourceOutput + msgType = mtype.FissionChatMsgTypeText + case chatTokenLimit: + + content = "chat:token_limit" + source = mtype.FissionChatMsgSourceOutput + msgType = mtype.FissionChatMsgTypeFix + case chatDayLimit: + + content = "chat:day_limit" + source = mtype.FissionChatMsgSourceOutput + msgType = mtype.FissionChatMsgTypeFix + } + + var outputMsg = withdefault.FissionChatMsg(&model.FissionChatMsg{ + CampaignID: cpn.ID, + UserID: user.ID, + ChatID: chat.ID, + Source: source, + MsgType: msgType, + }, mtype.ChatMsgVal{ + Text: content, + }) + + m := s.GetDao().FissionChatMsg + if err = m.WithContext(s.Ctx).Create(inputMsg, outputMsg); err != nil { + err = s.BE().MysqlError(err) + return + } + + s.chatOk = true + s.Res.Status = status + s.Res.Source = source + s.Res.MsgType = int32(msgType) + s.Res.Content = content + s.Res.MsgId = outputMsg.ID + + return +} + +func (s *Chat) _status(user *model.FissionUser, cpn *model.FissionCampaign, chat *model.FissionChat) (status int32, output string, err error) { + limit, err := s._beLimit(user, cpn) + if err != nil { + return + } + + if limit { + status = chatDayLimit + return + } + + m := s.GetDao().FissionChatMsg + last, err := m.WithContext(s.Ctx).Where( + m.ChatID.Eq(chat.ID), + m.Source.Eq(mtype.FissionChatMsgSourceOutput), + m.MsgType.Eq(mtype.FissionChatMsgTypeText), + ).Last() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var assistant string + if last != nil { + val := last.GetVal() + assistant = val.Text + } + + msg, err := app.NewDeepAiChat().Npc(s.Ctx, &chatpb.NpcReq{ + ProjectId: cpn.ProjectID, + SourceType: 1, + SourceId: cpn.ID, + Assistant: assistant, + Character: fmt.Sprintf("%s,用%s回复,只回答与谈心相关的问题,可以提供一点建议,回复会带点情绪反馈,回复语句尽量在255个字符以内", chat.Character, mtype.LangChineseTitle[user.LangMark]), + Input: s.Req.GetInput(), + UserId: user.SubUserID, + }) + + if err != nil { + return + } + + if msg.Status == 1 { + status = chatTokenLimit + return + } + + output = msg.Output + + return +} + +func (s *Chat) _beLimit(user *model.FissionUser, cpn *model.FissionCampaign) (yes bool, err error) { + conf, err := cache.NewCampaignChat(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf.DayLimit == 0 { + return + } + + day, start, end := timez.GMTStartAndEndTs(s.tz.GetTz()) + dayKey := ckey.FissionChatDayTotal(user.ID, day) + dayNum, err := lockdo.Int64(s.Ctx, dayKey, func() (num int64, err error) { + m := s.GetDao().FissionChatMsg + return m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.CreatedAt.Between(start, end)).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if dayNum >= int64(conf.DayLimit) { + return true, nil + } + + s.AddAfterRun(func() (err error) { + if !s.chatOk { + return + } + + return app.Redis.Cache.Incr(s.Ctx, dayKey).Err() + }) + + return +} diff --git a/internal/service/containers/campaignuser/chat_list.go b/internal/service/containers/campaignuser/chat_list.go new file mode 100644 index 0000000..06d2697 --- /dev/null +++ b/internal/service/containers/campaignuser/chat_list.go @@ -0,0 +1,175 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + + "gits.branchcn.com/backend/joybuywork/proto/go_proto/workerr" + "gorm.io/gen" +) + +type ChatList struct { + logic.Logic + Req *pb.ChatListReq + Res *pb.ChatListRes + + newChat bool +} + +func (s *ChatList) Run() error { + return logic.Run(s) +} + +func (s *ChatList) Exec() (err error) { + cpn, user, err := s.user() + if err != nil { + return + } + + chat, err := s.chat(cpn, user) + if err != nil { + return + } + return s.list(chat) +} + +func (s *ChatList) user() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *ChatList) chat(cpn *model.FissionCampaign, user *model.FissionUser) (chat *model.FissionChat, err error) { + chat, err = cache.NewFissionChat(s.Ctx).FindByUniq(user.CampaignID, user.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if chat.Character != "" { + return + } + + temp, err := cache.NewFissionTemp(s.Ctx).FindById(cpn.TemplateID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if temp == nil { + return + } + + group, err := cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var character string + switch group.Mark { + case "cat": + character = "你是一只聪明的小猫" + case "panda_sister": + character = "你是一只可爱的小熊猫妹妹" + case "panda_brother": + character = "你是一只暖心的小熊猫哥哥" + default: + character = "你是一只聪明的小狗" + } + + m := s.GetDao().FissionChat + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(chat.ID)).UpdateSimple(m.Character.Value(character)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewFissionChat(s.Ctx).Clear(chat) + }) + + chat.Character = character + s.newChat = true + + return +} + +func (s *ChatList) list(chat *model.FissionChat) (err error) { + m := s.GetDao().FissionChatMsg + + var cond = []gen.Condition{ + m.ChatID.Eq(chat.ID), + } + + if s.Req.GetLastId() > 0 { + cond = append(cond, m.ID.Lt(s.Req.GetLastId())) + } + + list, err := m.WithContext(s.Ctx).Where(cond...).Limit(int(s.Req.GetPerPage())).Order(m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if s.newChat && len(list) == 0 { + msg := withdefault.FissionChatMsg(&model.FissionChatMsg{ + CampaignID: chat.CampaignID, + UserID: chat.UserID, + ChatID: chat.ID, + Source: mtype.FissionChatMsgSourceSystem, + MsgType: mtype.FissionChatMsgTypeFix, + Val: "", + }, mtype.ChatMsgVal{Text: "chat:sys_guide"}) + if err = m.WithContext(s.Ctx).Create(msg); err != nil { + err = s.BE().MysqlError(err) + return + } + + list = append(list, msg) + } + + var data = make([]*pb.ChatListRes_One, 0, len(list)) + for _, v := range list { + + var one = &pb.ChatListRes_One{ + Content: "", + Source: v.Source, + MsgType: int32(v.MsgType), + CreatedAt: v.CreatedAt, + MsgId: v.ID, + } + + val := v.GetVal() + switch v.MsgType { + case mtype.FissionChatMsgTypeText, mtype.FissionChatMsgTypeFix: + one.Content = val.Text + } + + data = append(data, one) + } + + s.Res.List = data + + return +} diff --git a/internal/service/containers/campaignuser/child.go b/internal/service/containers/campaignuser/child.go new file mode 100644 index 0000000..bd9c753 --- /dev/null +++ b/internal/service/containers/campaignuser/child.go @@ -0,0 +1,642 @@ +package campaignuser + +import ( + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "fmt" +) + +const ( + childStatusWait = iota + 1 // 待完成 + childStatusDone // 已完成 +) + +type Child struct { + logic.Logic + Req *pb.ChildReq + Res *pb.ChildRes + + recordMap map[int32]int64 +} + +func (s *Child) Run() error { + return logic.Run(s) +} + +func (s *Child) Exec() (err error) { + cpn, user, err := s.user() + if err != nil { + return + } + + return s.child(cpn, user) +} + +func (s *Child) user() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = cache.NewCampaign(s.Ctx).FindById(s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = cache.NewFissionUser(s.Ctx, s.Req.GetCampaignId()).FindById(s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + s.recordMap = make(map[int32]int64) + + return +} + +func (s *Child) child(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + m := s.GetDao().FissionCampaignChild + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + tz := provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + for _, child := range list { + switch child.Type { + case mtype.FissionCampaignChildTypeBlind: + err = s._blind(user, child, tz) + if err != nil { + return + } + case mtype.FissionCampaignChildTypeInvite: + err = s._invite(user, child, tz) + if err != nil { + return + } + case mtype.FissionCampaignChildTypeSign: + err = s._sign(user, child, tz) + if err != nil { + return + } + case mtype.FissionCampaignChildTypeLucky: + err = s._lucky(user, child, tz) + if err != nil { + return + } + case mtype.FissionCampaignChildTypeTask: + + } + } + + return s._setRecord(cpn.ProjectID, cpn.ID, user.LangMark) +} + +func (s *Child) _lucky(user *model.FissionUser, child *model.FissionCampaignChild, tz *provider.CampaignTZ) (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(child.ChildID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.Status == mtype.FissionCampaignStatusCancel || cpn.IsDel == mtype.Yes { + return + } + + player, err := s._player(user, cpn) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(child.ChildID), m.IsDel.Eq(mtype.No)).Order(m.IsSuper.Desc(), m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + status := utils.Ternary[int32](verify.Inside(player.LastDone, start, end), childStatusDone, childStatusWait) + + var getRewardsIds = utils.SplitToInt64(player.LuckyReward, ",") + var getMap = make(map[int64]struct{}, len(getRewardsIds)) + for _, id := range getRewardsIds { + getMap[id] = struct{}{} + } + + s.Res.Lucky = &pb.ChildRes_Lucky{ + Open: 1, + Status: status, + Rewards: s._reward(list, cpn.ProjectID, user.LangMark, getMap), + ChildHashId: cpn.HashID, + } + + if status == 2 { + s.recordMap[mtype.FissionCampaignChildTypeLucky] = player.RecordID + } + + return +} + +func (s *Child) _sign(user *model.FissionUser, child *model.FissionCampaignChild, tz *provider.CampaignTZ) (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(child.ChildID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.Status == mtype.FissionCampaignStatusCancel || cpn.IsDel == mtype.Yes { + return + } + + player, err := s._player(user, cpn) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(child.ChildID), m.IsDel.Eq(mtype.No)).Order(m.SignDay).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + _, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + var l int + var status int32 = childStatusWait + var getMap = make(map[int64]struct{}) + if verify.Inside(player.LastDone, start, end) { // 今天已经签到了 + status = childStatusDone + + signDay := player.SignDay + if conf.PlayType == mtype.FissionCampaignConfigPlayTypeContinue { + signDay = player.ContinueSign + } + + l = int(signDay) % len(list) + if l == 0 { + l = len(list) + } + + } else { // 今天没签到 + signDay := player.SignDay + if conf.PlayType == mtype.FissionCampaignConfigPlayTypeContinue { //连续签到,如果没连续签到,签到天数为0 + signDay = utils.Ternary(verify.Inside(player.LastDone, start-86400, end-86400), player.ContinueSign, 0) + } + l = int(signDay) % len(list) + } + + for i := 0; i < l; i++ { + getMap[list[i].ID] = struct{}{} + } + + s.Res.Sign = &pb.ChildRes_Sign{ + Open: 1, + Status: status, + Rewards: s._reward(list, cpn.ProjectID, user.LangMark, getMap), + Record: nil, + RewardId: player.RewardID, + ChildHashId: cpn.HashID, + } + + if status == childStatusDone { + s.recordMap[mtype.FissionCampaignChildTypeSign] = player.RecordID + } + + return +} + +func (s *Child) _invite(user *model.FissionUser, child *model.FissionCampaignChild, tz *provider.CampaignTZ) (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(child.ChildID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || !s._checkRun(cpn.TStart, 0, tz.GetTz()) || cpn.IsDel == mtype.Yes { + return + } + + player, err := s._player(user, cpn) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(child.ChildID), m.IsDel.Eq(mtype.No)).Order(m.Step).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + ranker, err := cachecurd.NewRanker(s.Ctx, ckey.FissionChildRank(cpn.ID), cachecurd.SetChildBuild(cpn.ID, cpn.ChildType)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + rankList, err := ranker.GetRank(10) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var status int32 = childStatusWait + if player.RecordID > 0 || cpn.Status == mtype.FissionCampaignStatusCancel { + status = childStatusDone + } + + if player.RecordID > 0 { + s.recordMap[mtype.FissionCampaignChildTypeInvite] = player.RecordID + } + + s.Res.Invite = &pb.ChildRes_Invite{ + Open: 1, + Status: status, + Start: cpn.TStart, + End: cpn.TEnd, + InviteNum: player.InviteNum, + Rank: "", + RankList: make([]*pb.ChildRes_RankOne, 10), + ChildHashId: cpn.HashID, + } + + rewards := s._reward(list, cpn.ProjectID, user.LangMark, nil) + + var userIds []int64 + for _, member := range rankList { + userIds = append(userIds, utils.StrToInt64(member.UserId)) + } + + userMap, err := s._userMap(userIds) + if err != nil { + return + } + + rankL := len(rankList) + rewardL := len(list) + + var stepS = rewardL // 排行榜阶梯切割点 + if rewardL > 4 { + stepS = 10 + } + + for i := 0; i < 10; i++ { + var rankOne = &cachecurd.RankMember{} + if i < rankL { + rankOne = rankList[i] + } + + one := &pb.ChildRes_RankOne{ + SubUserId: userMap[utils.StrToInt64(rankOne.UserId)], + InviteNum: int64(rankOne.Score), + } + + var rewardOne = &pb.ChildRes_Reward{} + if i < stepS { + if i >= 4 { + rewardOne = rewards[4] + } else { + rewardOne = rewards[i] + } + } + + one.RewardId = rewardOne.RewardId + one.Title = rewardOne.Title + one.Img = rewardOne.Img + one.PropMark = rewardOne.PropMark + one.RewardNum = rewardOne.RewardNum + + s.Res.Invite.RankList[i] = one + } + + if player.InviteNum == 0 { + return + } + + var rank int64 + rank, err = ranker.GetMemberRank(fmt.Sprint(player.UserID)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if rank > 9999 { + s.Res.Invite.Rank = "10000+" + } else { + s.Res.Invite.Rank = fmt.Sprintf("%d", rank+1) + } + + if status == childStatusDone { + return + } + + var between [][2]int64 + for i := 0; i < rewardL; i++ { + switch i { + case 6: + between = append(between, [2]int64{100, 9999}) + case 5: + between = append(between, [2]int64{10, 99}) + case 4: + between = append(between, [2]int64{4, 9}) + default: + between = append(between, [2]int64{int64(i), int64(i)}) + } + } + + for i, group := range between { + if verify.Inside(rank, group[0], group[1]) { + s.Res.Invite.Record = &pb.ChildRes_Record{ + RewardId: rewards[i].RewardId, + Title: rewards[i].Title, + KvData: nil, + Img: rewards[i].Img, + PropMark: rewards[i].PropMark, + RewardNum: rewards[i].RewardNum, + IsSuper: rewards[i].IsSuper, + } + } + } + + return +} + +func (s *Child) _blind(user *model.FissionUser, child *model.FissionCampaignChild, tz *provider.CampaignTZ) (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(child.ChildID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.Status == mtype.FissionCampaignStatusCancel || cpn.IsDel == mtype.Yes { + return + } + + player, err := s._player(user, cpn) + if err != nil { + return + } + + _, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + status := utils.Ternary[int32](verify.Inside(player.LastDone, start, end), childStatusDone, childStatusWait) + + s.Res.Blind = &pb.ChildRes_Blind{ + Open: 1, + Status: status, + ChildHashId: cpn.HashID, + } + + if status == childStatusDone { + s.recordMap[mtype.FissionCampaignChildTypeBlind] = player.RecordID + } + + return +} + +func (s *Child) _setRecord(projectId, cpnId int64, langMark string) (err error) { + if len(s.recordMap) == 0 { + return + } + + var recordIds []int64 + for _, v := range s.recordMap { + recordIds = append(recordIds, v) + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpnId) + list, err := m.WithContext(s.Ctx).Where(m.ID.In(recordIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds, brid []int64 + var bMap = make(map[int64]struct{}) + var recordMap = make(map[int64]*model.FissionRewardRecord) + var rewardMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range list { + if _, ok := bMap[v.BaseRewardID]; !ok && v.BaseRewardID > 0 { + bMap[v.BaseRewardID] = struct{}{} + brid = append(brid, v.BaseRewardID) + } + recordMap[v.ID] = v + + if _, ok := rewardMap[v.RewardID]; !ok { + rewardMap[v.RewardID] = nil + rewardIds = append(rewardIds, v.RewardID) + } + + } + + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range rewards { + rewardMap[v.ID] = v + } + + preward, _ := provider.NewRewards(s.Ctx, projectId, brid...) + for t, id := range s.recordMap { + record, ok := recordMap[id] + if !ok { + continue + } + switch t { + case mtype.FissionCampaignChildTypeBlind: + s.Res.Blind.Record = s._record(record, preward, rewardMap, langMark) + case mtype.FissionCampaignChildTypeInvite: + s.Res.Invite.Record = s._record(record, preward, rewardMap, langMark) + case mtype.FissionCampaignChildTypeSign: + s.Res.Sign.Record = s._record(record, preward, rewardMap, langMark) + case mtype.FissionCampaignChildTypeLucky: + s.Res.Lucky.Record = s._record(record, preward, rewardMap, langMark) + case mtype.FissionCampaignChildTypeTask: + + } + } + + return +} + +func (s *Child) _record(record *model.FissionRewardRecord, preward *provider.Rewards, rewardMap map[int64]*model.FissionCampaignReward, langMark string) *pb.ChildRes_Record { + if record.PropMark == mtype.FissionCampaignRewardPropMarkChance { + return &pb.ChildRes_Record{ + Id: record.ID, + HashId: record.HashID, + RewardId: record.RewardID, + PropMark: record.PropMark, + RewardNum: record.RewardNum, + IsSuper: int32(rewardMap[record.RewardID].IsSuper), + } + } + + info, _ := preward.InfoAutoLang(record.BaseRewardID, langMark) + + var kvData = make([]*pb.ChildRes_KV, 0, len(info.KvData)) + for _, v := range info.KvData { + kvData = append(kvData, &pb.ChildRes_KV{ + Key: v.Key, + Value: v.Value, + IsShow: v.IsShow, + }) + } + + return &pb.ChildRes_Record{ + Id: record.ID, + HashId: record.HashID, + RewardId: record.RewardID, + Title: info.Title, + KvData: kvData, + Img: info.ImgUrl, + Contact: info.Contact, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + DyRewardType: info.DyRewardType, + CustomRewardVal: record.CustomRewardVal, + PropMark: record.PropMark, + RewardNum: record.RewardNum, + IsSuper: int32(rewardMap[record.RewardID].IsSuper), + PcParam: info.PcParam, + ReceiveType: info.ReceiveType, + } +} + +func (s *Child) _player(user *model.FissionUser, cpn *model.FissionCampaign) (player *model.FissionChildUser, err error) { + player, err = cache.NewFissionChildUser(s.Ctx).FindByUniqIdx(user.ID, cpn.ID, cache.WithNilSet(func() ([]byte, error) { + info := withdefault.FissionChildUser(&model.FissionChildUser{ + PCpnID: cpn.Pid, + CampaignID: cpn.ID, + UserID: user.ID, + ParentID: user.ParentID, + ChildType: cpn.ChildType, + }) + + err = s.GetDao().FissionChildUser.WithContext(s.Ctx).Create(info) + if err != nil { + return nil, err + } + + return jsonm.Marshal(info) + })) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *Child) _reward(list []*model.FissionCampaignReward, projectId int64, langMark string, getMap map[int64]struct{}) (rewards []*pb.ChildRes_Reward) { + var brid []int64 + var bMap = make(map[int64]struct{}) + for _, v := range list { + if _, ok := bMap[v.RewardID]; !ok && v.RewardID > 0 { + bMap[v.RewardID] = struct{}{} + brid = append(brid, v.RewardID) + } + } + + var preward *provider.Rewards + if len(brid) > 0 { + preward, _ = provider.NewRewards(s.Ctx, projectId, brid...) + } + + for _, v := range list { + var isGet int32 + if getMap != nil { + if _, ok := getMap[v.ID]; ok { + isGet = 1 + } + } + + switch v.PropMark { + case mtype.FissionCampaignRewardPropMarkChance: + rewards = append(rewards, &pb.ChildRes_Reward{ + RewardId: v.ID, + PropMark: v.PropMark, + RewardNum: v.RewardNum, + IsSuper: int32(v.IsSuper), + IsGet: isGet, + }) + default: + if preward == nil { + continue + } + + info := preward.AutoLang(v.RewardID, langMark) + rewards = append(rewards, &pb.ChildRes_Reward{ + RewardId: v.ID, + Title: info.Title, + Img: info.ImgUrl, + PropMark: v.PropMark, + RewardNum: v.RewardNum, + IsSuper: int32(v.IsSuper), + IsGet: isGet, + }) + } + } + + return +} + +func (s *Child) _userMap(userIds []int64) (data map[int64]string, err error) { + data = make(map[int64]string, len(userIds)) + + if len(userIds) == 0 { + return + } + + m := s.GetDao().FissionUser + + list, err := m.WithContext(s.Ctx).Select(m.ID, m.SubUserID).Where(m.ID.In(userIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + data[v.ID] = v.SubUserID + } + + return +} + +func (s *Child) _checkRun(start, end int64, tOffset int32) bool { + return timez.GMTInsideEndless(tOffset, start, end) +} diff --git a/internal/service/containers/campaignuser/child_active.go b/internal/service/containers/campaignuser/child_active.go new file mode 100644 index 0000000..cfda50a --- /dev/null +++ b/internal/service/containers/campaignuser/child_active.go @@ -0,0 +1,566 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" + "gorm.io/gen/field" +) + +const ( + childActiveStatusWait = 1 + childActiveStatusLack = 2 + childActiveStatusSame = 3 +) + +type ChildActive struct { + logic.Logic + Req *pb.ChildActiveReq + Res *pb.ChildActiveRes + + recordMap map[int32]int64 + + childUserUp []field.AssignExpr +} + +func (s *ChildActive) Run() error { + return logic.Run(s) +} + +func (s *ChildActive) Exec() (err error) { + cpn, user, err := s.user() + if err != nil { + return + } + + reward, player, err := s.active(cpn, user) + if err != nil { + return + } + + if reward == nil { + s.Res.Status = childActiveStatusWait + return + } + + return s.getReward(cpn, user, reward, player) +} + +func (s *ChildActive) user() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = cache.NewCampaign(s.Ctx).FindById(s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = cache.NewFissionUser(s.Ctx, s.Req.GetCampaignId()).FindById(s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + s.recordMap = make(map[int32]int64) + + return +} + +func (s *ChildActive) active(cpn *model.FissionCampaign, user *model.FissionUser) (reward *model.FissionCampaignReward, player *model.FissionChildUser, err error) { + relate, err := cache.NewCampaignChild(s.Ctx).FindByUniqIdx(cpn.ID, int8(s.Req.GetChildType())) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if relate == nil { + err = workerr.NotFound("not found child") + return + } + + child, err := cache.NewCampaign(s.Ctx).FindById(relate.ChildID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if child == nil { + err = workerr.NotFound("not found child") + return + } + + player, err = cache.NewFissionChildUser(s.Ctx).FindByUniqIdx(user.ID, child.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if player == nil { + err = workerr.NotFound("not found player") + return + } + + switch s.Req.GetChildType() { + case mtype.FissionCampaignChildTypeInvite: + if player.RecordID > 0 { + err = s.done(cpn.ProjectID, cpn.ID, player.RecordID, user.LangMark) + if err != nil { + return + } + } + return + case mtype.FissionCampaignChildTypeSign: + reward, err = s._sign(cpn, user, player) + if err != nil { + return + } + return + case mtype.FissionCampaignChildTypeBlind: + reward, err = s._lottery(cpn, user, player) + if err != nil { + return + } + return + case mtype.FissionCampaignChildTypeLucky: + reward, err = s._lucky(cpn, user, player) + if err != nil { + return + } + return + case mtype.FissionCampaignChildTypeTask: + + } + return +} + +func (s *ChildActive) _sign(cpn *model.FissionCampaign, user *model.FissionUser, player *model.FissionChildUser) (reward *model.FissionCampaignReward, err error) { + tz := provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + _, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + if verify.Inside(player.LastDone, start, end) { + err = s.done(cpn.ProjectID, cpn.ID, player.RecordID, user.LangMark) + if err != nil { + return + } + return + } + + //如果是预览用户,随机返回一个奖品 + if user.IsView == mtype.Yes { + m := s.GetDao().FissionCampaignReward + reward, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID), m.SignDay.Eq(1), m.IsDel.Eq(mtype.No)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID), m.IsDel.Eq(mtype.No)).Order(m.SignDay).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var l = len(list) + + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(player.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + playerM := s.GetDao().FissionChildUser + s.childUserUp = append(s.childUserUp, playerM.SignDay.Add(1)) + if player.JoinTime == 0 { + s.childUserUp = append(s.childUserUp, playerM.JoinTime.Value(time.Now().Unix())) + } + + var idx int + switch conf.PlayType { + case mtype.FissionCampaignConfigPlayTypeSign: + idx = int(player.SignDay) % l + case mtype.FissionCampaignConfigPlayTypeContinue: + var continueSign = player.ContinueSign + 1 + if !verify.Inside(player.LastDone, start-86400, end-86400) { + continueSign = 1 + } + + s.childUserUp = append(s.childUserUp, playerM.ContinueSign.Value(continueSign)) + + idx = int(continueSign-1) % l + default: + return + } + + reward = list[idx] + + s.AddAfterRun(func() (err error) { + + fissionaction.NewMarkPoint(s.Ctx).InApp(user).JoinChild(time.Now().Unix(), player.CampaignID, player.ChildType) + fissionaction.NewMarkPoint(s.Ctx).Child(player, user).ChildSign(time.Now().Unix()) + + return + }) + + return +} + +func (s *ChildActive) _lucky(cpn *model.FissionCampaign, user *model.FissionUser, player *model.FissionChildUser) (reward *model.FissionCampaignReward, err error) { + reward, err = s._lottery(cpn, user, player) + if err != nil { + return + } + + if reward == nil { + return + } + + var luckyReward = player.LuckyReward + if reward.IsSuper == mtype.Yes { + luckyReward = "" + } else { + luckyReward = strings.Trim(fmt.Sprintf("%s,%d", luckyReward, reward.ID), ",") + } + + s.childUserUp = append(s.childUserUp, s.GetDao().FissionChildUser.LuckyReward.Value(luckyReward)) + + return +} + +// 抽奖 +func (s *ChildActive) _lottery(cpn *model.FissionCampaign, user *model.FissionUser, player *model.FissionChildUser) (reward *model.FissionCampaignReward, err error) { + tz := provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + _, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + if verify.Inside[int64](player.LastDone, start, end) { + err = s.done(cpn.ProjectID, cpn.ID, player.RecordID, user.LangMark) + if err != nil { + return + } + return + } + + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(player.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionCampaignReward + rewards, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + //如果是预览用户,随机返回一个奖品 + if user.IsView == mtype.Yes { + var dataMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rewards { + if v.Odds == 0 && conf.PlayType == mtype.FissionCampaignConfigPlayTypeRate { + continue + } + dataMap[v.ID] = v + } + + for _, v := range dataMap { + reward = v + } + + return + } + + s.AddAfterRun(func() (err error) { + + fissionaction.NewMarkPoint(s.Ctx).InApp(user).JoinChild(time.Now().Unix(), player.CampaignID, player.ChildType) + fissionaction.NewMarkPoint(s.Ctx).Child(player, user).ChildLottery(time.Now().Unix()) + + return + }) + + if player.JoinTime == 0 { + s.childUserUp = append(s.childUserUp, s.GetDao().FissionChildUser.JoinTime.Value(time.Now().Unix())) + } + + var ids []int64 + for _, v := range rewards { + if v.PropMark == mtype.FissionCampaignRewardPropMarkChance { + continue + } + ids = append(ids, v.ID) + } + + stock, err := stocks.NewCampaignReward(s.Ctx, ids...) + if err != nil { + return + } + useStockMap, _ := stock.AllUseStock() + + var filterMap = make(map[int64]struct{}) + for _, id := range player.GetLuckyReward() { + filterMap[id] = struct{}{} + } + + var hasReward bool + var rewardMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rewards { + + if v.PropMark == mtype.FissionCampaignRewardPropMarkReward && int64(v.Stock) <= useStockMap[v.ID] { + continue + } + + if _, ok := filterMap[v.ID]; ok { + continue + } + + oddo := v.Odds + if conf.PlayType == mtype.FissionCampaignConfigPlayTypeRand { + oddo = 1 + } + + v.Odds = oddo + + rewardMap[v.ID] = v + hasReward = true + } + + //奖品都发完了 + if !hasReward { + s.Res.Status = childActiveStatusLack + return + } + + //获取到了奖品 + for { + //构建抽奖机 + machine := s.lotteryMachine(rewardMap) + + //抽奖 + lcy, _ := machine.Lottery() + + getReward, ok := rewardMap[lcy.Int64()] + if !ok { + s.Res.Status = childActiveStatusLack + return + } + + if getReward.PropMark == mtype.FissionCampaignRewardPropMarkChance { + reward = getReward + return + } + + //中奖了 + var check bool + check, err = award.NewAwardIssVerify(s.Ctx, user, getReward).DeductStock().RuleFilter().IsOK() + if err != nil { + return + } + + //扣除库存成功 + if check { + reward = getReward + return + } + + //这个奖品这个人不能中了 + delete(rewardMap, lcy.Int64()) + } +} + +// 抽奖机 +func (s *ChildActive) lotteryMachine(selection map[int64]*model.FissionCampaignReward) *lucky.Discrete { + var prize []lucky.Reward + for _, v := range selection { + prize = append(prize, lucky.Reward{ + Share: int(v.Odds), + Mark: v.ID, + }) + } + + return lucky.NewDiscrete(s.Ctx, prize) +} + +func (s *ChildActive) _rsp(reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord) { + s.AddAfterRun(func() (err error) { + + res := &pb.ChildActiveRes_Record{ + RewardId: reward.ID, + PropMark: reward.PropMark, + RewardNum: reward.RewardNum, + IsSuper: int32(reward.IsSuper), + Title: info.Title, + KvData: make([]*pb.ChildActiveRes_KV, 0, len(info.KvData)), + Img: info.ImgUrl, + Contact: info.Contact, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + DyRewardType: info.DyRewardType, + Id: 0, + HashId: "", + CustomRewardVal: "", + PcParam: info.PcParam, + ReceiveType: info.ReceiveType, + } + + for _, v := range info.KvData { + res.KvData = append(res.KvData, &pb.ChildActiveRes_KV{ + Key: v.Key, + Value: v.Value, + IsShow: v.IsShow, + }) + } + + if record != nil { + res.Id = record.ID + res.HashId = record.HashID + res.CustomRewardVal = record.CustomRewardVal + res.PropMark = record.PropMark + res.RewardNum = record.RewardNum + } + + s.Res.Record = res + + return + }) +} + +func (s *ChildActive) getReward(cpn *model.FissionCampaign, user *model.FissionUser, reward *model.FissionCampaignReward, player *model.FissionChildUser) (err error) { + if user.IsView == mtype.Yes { + preward, _ := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + info, _ := preward.InfoAutoLang(reward.RewardID, user.LangMark) + + // 设置返回的数据 + s._rsp(reward, info, nil) + return + } + + if reward.PropMark == mtype.FissionCampaignRewardPropMarkChance { + switch cpn.FissionID { + case consts.IdKeep: + err = s._keepChance(user, reward) + if err != nil { + return + } + } + } + + record, info, _, err := award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).One(reward, true, award.RewardRecordChildId(player.CampaignID)) + if err != nil { + return + } + + m := s.GetDao().FissionChildUser + var up = s.childUserUp + up = append(up, m.LastDone.Value(record.CreatedAt), m.RewardID.Value(record.RewardID), m.RecordID.Value(record.ID)) + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var recordSource string + switch player.ChildType { + case mtype.FissionCampaignChildTypeLucky: + recordSource = mtype.FissionChildUserRecordSourceLucky + case mtype.FissionCampaignChildTypeBlind: + recordSource = mtype.FissionChildUserRecordSourceBlind + case mtype.FissionCampaignChildTypeSign: + recordSource = mtype.FissionChildUserRecordSourceSign + case mtype.FissionCampaignChildTypeInvite: + case mtype.FissionCampaignChildTypeTask: + } + + if recordSource != "" { + err = s.GetDao().FissionChildUserRecord.WithContext(s.Ctx).Create(withdefault.FissionChildUserRecord(&model.FissionChildUserRecord{ + PCpnID: player.PCpnID, + CampaignID: player.CampaignID, + UserID: player.UserID, + PlayerID: player.ID, + ChildType: player.ChildType, + Mark: recordSource, + RecordID: record.ID, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + s.AddAfterRun(func() (err error) { + return cache.NewFissionChildUser(s.Ctx).Clear(player) + }) + + // 返回数据 + s._rsp(reward, info, record) + + fissionaction.NewMarkPoint(s.Ctx).Child(player, user).ChildGetReward(time.Now().Unix(), record.RewardID, record.ID, record.RewardType) + + return +} + +func (s *ChildActive) _keepChance(user *model.FissionUser, reward *model.FissionCampaignReward) (err error) { + keepDog, err := players.NewKeepDog(s.Ctx, user) + if err != nil { + return + } + + return keepDog.ChildActive(reward.RewardNum, int8(s.Req.GetChildType())) +} + +func (s *ChildActive) done(projectId, cpnId, recordId int64, langMark string) (err error) { + m := s.GetDao().FissionRewardRecord.SubTable(cpnId) + record, err := m.WithContext(s.Ctx).Where(m.ID.Eq(recordId)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, projectId, record.BaseRewardID) + if err != nil { + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(record.RewardID)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + info, _ := preward.InfoAutoLang(reward.RewardID, langMark) + + s._rsp(reward, info, record) + + s.Res.Status = childActiveStatusSame + + return +} diff --git a/internal/service/containers/campaignuser/child_list.go b/internal/service/containers/campaignuser/child_list.go new file mode 100644 index 0000000..5bfb3f1 --- /dev/null +++ b/internal/service/containers/campaignuser/child_list.go @@ -0,0 +1,247 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + + "gorm.io/gen" +) + +type ChildList struct { + logic.Logic + Req *pb.ChildListReq + Res *pb.ChildListRes +} + +func (s *ChildList) Run() error { + return logic.Run(s) +} + +func (s *ChildList) Exec() (err error) { + cpn, err := s.campaign() + if err != nil || cpn == nil { + return + } + + return s.list(cpn) +} + +func (s *ChildList) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return + } + + tz := utils.STernary[int32](s.Req.GetTOffset(), consts.DefaultTz, cpn.TOffset) + + s.Req.Start = timez.GMT(s.Req.Start, tz) + s.Req.End = timez.GMT(s.Req.End, tz) + + s.Res.ChildType = int32(cpn.ChildType) + s.Res.TOffset = tz + + return +} + +// 用户信息 +func (s *ChildList) list(cpn *model.FissionCampaign) (err error) { + list, total, err := s._find(cpn) + + if err != nil || total == 0 { + return + } + + s.Res.List = make([]*pb.ChildListRes_One, 0, len(list)) + s.Res.Total = total + + var playerIds, userIds []int64 + var userMap = make(map[int64]string) + for _, v := range list { + + playerIds = append(playerIds, v.ID) + + if _, ok := userMap[v.UserID]; !ok && v.UserID > 0 { + userIds = append(userIds, v.UserID) + userMap[v.UserID] = "" + } + + if _, ok := userMap[v.ParentID]; !ok && v.ParentID > 0 { + userIds = append(userIds, v.UserID) + userMap[v.ParentID] = "" + } + + } + + err = s._userMap(cpn.Pid, userIds, userMap) + if err != nil { + return + } + + childData, err := s._child(cpn.ID, cpn.ChildType, playerIds) + if err != nil { + return + } + + for _, v := range list { + one := &pb.ChildListRes_One{ + Id: v.ID, + JoinAt: v.JoinTime, + SubUserId: userMap[v.UserID], + Parent: userMap[v.ParentID], + } + + switch cpn.ChildType { + case mtype.FissionCampaignChildTypeBlind: + one.Blind = &pb.ChildListRes_Num{Num: childData[v.ID]} + case mtype.FissionCampaignChildTypeInvite: + one.Invite = &pb.ChildListRes_Num{Num: childData[v.ID]} + case mtype.FissionCampaignChildTypeSign: + one.Sign = &pb.ChildListRes_Num{Num: childData[v.ID]} + case mtype.FissionCampaignChildTypeLucky: + one.Lottery = &pb.ChildListRes_Num{Num: childData[v.ID]} + case mtype.FissionCampaignChildTypeTask: + + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +// 找数据 +func (s *ChildList) _find(cpn *model.FissionCampaign) (list []*model.FissionChildUser, total int64, err error) { + m := s.GetDao().FissionChildUser + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.JoinTime.Gt(0), + } + + if !verify.EmptyString(s.Req.GetUserMark()) { + + var user *model.FissionUser + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + cond = append(cond, m.ID.Eq(-1)) + } else { + cond = append(cond, m.UserID.Eq(user.ID)) + } + + } + + if s.Req.GetStart() > 0 { + cond = append(cond, m.JoinTime.Gte(s.Req.GetStart())) + } + + if s.Req.GetEnd() > 0 { + cond = append(cond, m.JoinTime.Lte(s.Req.GetEnd())) + } + + if s.Req.GetPidType() == 0 && s.Req.GetParentUserMark() != "" { + var puser *model.FissionUser + puser, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetParentUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if puser == nil { + cond = append(cond, m.ID.Eq(-1)) + } else { + cond = append(cond, m.ParentID.Eq(puser.ID)) + } + } + + if s.Req.GetPidType() != 0 { + switch s.Req.GetPidType() { + case 1: + cond = append(cond, m.ParentID.Gt(0)) + case 2: + cond = append(cond, m.ParentID.Eq(0)) + } + } + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err = m.WithContext(s.Ctx).Where(cond...).Order(m.JoinTime.Desc()).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +type childListNum struct { + PlayerId int64 + Num int64 +} + +// 用户数据 +func (s *ChildList) _child(cpnId int64, childType int8, ids []int64) (childData map[int64]int64, err error) { + childData = make(map[int64]int64, len(ids)) + + var mark string + switch childType { + case mtype.FissionCampaignChildTypeBlind: + mark = mtype.FissionChildUserRecordSourceBlind + case mtype.FissionCampaignChildTypeInvite: + mark = mtype.FissionChildUserRecordSourceInviteOne + case mtype.FissionCampaignChildTypeSign: + mark = mtype.FissionChildUserRecordSourceSign + case mtype.FissionCampaignChildTypeLucky: + mark = mtype.FissionChildUserRecordSourceLucky + case mtype.FissionCampaignChildTypeTask: + + } + + m := s.GetDao().FissionChildUserRecord + var nums []*childListNum + err = m.WithContext(s.Ctx).Select(m.PlayerID, m.ID.Count().As("num")). + Where(m.CampaignID.Eq(cpnId), m.PlayerID.In(ids...), m.Mark.Eq(mark)). + Group(m.PlayerID). + Scan(&nums) + + for _, num := range nums { + childData[num.PlayerId] = num.Num + } + + return +} + +// 用户数据 +func (s *ChildList) _userMap(cpnId int64, ids []int64, userMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + m := s.GetDao().FissionUser.SubTable(cpnId) + + //找上级数据 + userList, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range userList { + userMap[v.ID] = v.UserMark + } + + return +} diff --git a/internal/service/containers/campaignuser/dice.go b/internal/service/containers/campaignuser/dice.go new file mode 100644 index 0000000..ce944ca --- /dev/null +++ b/internal/service/containers/campaignuser/dice.go @@ -0,0 +1,647 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" + "gorm.io/gen/field" +) + +type rollData struct { + MarkType int8 // 格子类型 + Step int32 // 下标数据 + RewardId int64 // 活动奖品id + MapId int64 // 地图int类型id + MapHashId string // 地图hash_id + RewardTitle string // 奖品名称 + ImgUrl string // 奖品地址 + Intact bool // 合成了奖品 + Lack bool // 缺库存 +} + +const ( + campaignUserDiceFailTypeNone = iota // 没有错误 + campaignUserDiceFailTypeLack // 缺骰子数 + campaignUserDiceFailTypeProps // 道具不足 +) + +type Dice struct { + logic.Logic + Req *pb.DiceReq + Res *pb.DiceRes + + isView bool //是否预览用户 + prop map[string]*model.FissionDiceProp + + user *model.FissionUser +} + +func (s *Dice) Run() error { + return logic.Run(s) +} + +func (s *Dice) Exec() (err error) { + player, run, err := s.player() + if err != nil { + return + } + + if s._isFixedRoll() { + return s.useFixedRoll(player, run) + } + + return s.normal(player, run) +} + +func (s *Dice) player() (player *model.FissionDice, run *model.FissionDiceRun, err error) { + cpn, err := finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.UnauthorizedError + return + } + + m := s.GetDao().FissionDice + player, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + err = workerr.NotFound("not found player") + return + } + + run, err = cmm.NewCMM(s.Ctx, s.GetDao()).GetUserMap(user) + if err != nil { + return + } + + s.isView = user.IsView == mtype.Yes + s.user = user + + return +} + +func (s *Dice) useFixedRoll(player *model.FissionDice, run *model.FissionDiceRun) (err error) { + m := s.GetDao().FissionDiceProp + prop, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.Mark.Eq(mtype.FissionDicePropMarkFixedRoll)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if prop == nil || prop.Num <= 0 { + s.Res.FailType = campaignUserDiceFailTypeProps + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(prop.ID)).UpdateSimple(m.Num.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + step := utils.StrToInt(s.Req.GetVal()) - 1 + + res, err := s._rollMap(run, step) + if err != nil || res == nil { + return + } + + // 记录日志 + err = s._diceRecord(player, res, true) + if err != nil { + return + } + + // 使用道具埋点 + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).UseProp(time.Now().Unix(), consts.PropNameFixedDice) + + return s._resp(run, res) +} + +func (s *Dice) normal(player *model.FissionDice, run *model.FissionDiceRun) (err error) { + if player.Chance <= 0 { + s.Res.FailType = campaignUserDiceFailTypeLack + return + } + + step := utils.RandNumber(6) + + res, err := s._rollMap(run, int(step)) + if err != nil || res == nil { + return + } + + // 不是预览用户要减次数,并且不是再来一次就减一次 + if !s.isView && res.MarkType != mtype.FissionDiceMapMarkTypeChance { + m := s.GetDao().FissionDice + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 记录日志 + err = s._diceRecord(player, res, false) + if err != nil { + return + } + + return s._resp(run, res) +} + +// 结果处理 +func (s *Dice) _resp(run *model.FissionDiceRun, res *rollData) (err error) { + + // 更新地图信息 + runM := s.GetDao().FissionDiceRun + _, err = runM.WithContext(s.Ctx).Where(runM.ID.Eq(run.ID)).UpdateSimple( + runM.MapID.Value(res.MapId), + runM.MapHashID.Value(res.MapHashId), + runM.GoStep.Add(int64(res.Step)+1), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.MarkType = int32(res.MarkType) + s.Res.MapHashId = res.MapHashId + s.Res.RewardTitle = res.RewardTitle + s.Res.ImgUrl = res.ImgUrl + s.Res.IsIntact = res.Intact + s.Res.RollNum = res.Step + 1 + s.Res.Lack = res.Lack + s.Res.RewardId = res.RewardId + + return +} + +func (s *Dice) _rollMap(run *model.FissionDiceRun, idx int) (res *rollData, err error) { + m := s.GetDao().FissionDiceMap + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(run.CampaignID), m.DmgID.Eq(run.DmgID), m.ID.Gt(run.MapID)).Limit(6).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) < 6 { + + back := 6 - len(list) + var backList []*model.FissionDiceMap + backList, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(run.CampaignID), m.DmgID.Eq(run.DmgID)).Limit(back).Order(m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range backList { + list = append(list, v) + } + + } + + if len(list) == 0 { + app.Logger.Error(s.Ctx, fmt.Sprintf("活动[%d]地图生成异常, 用户id[%d]", run.CampaignID, run.UserID)) + err = workerr.ServerError + return + } + + var loseMap = make(map[int]*model.FissionDiceMap) + for i, v := range list { + if verify.InArray(v.MarkType, mtype.FissionDiceMapMarkTypeNone, mtype.FissionDiceMapMarkTypeChance, mtype.FissionDiceMapMarkTypeFixedRoll) { + loseMap[i] = v + } + } + + var win, lose *rollData + + for i, v := range loseMap { + switch v.MarkType { + case mtype.FissionDiceMapMarkTypeNone, mtype.FissionDiceMapMarkTypeChance: + lose = &rollData{ + MarkType: v.MarkType, + Step: int32(i), + RewardId: v.RewardID, + MapId: v.ID, + MapHashId: v.HashID, + } + break + } + } + + win = &rollData{ + MarkType: list[idx].MarkType, + Step: int32(idx), + RewardId: list[idx].RewardID, + MapId: list[idx].ID, + MapHashId: list[idx].HashID, + } + + // 预览用户直接返回结果 + if s.isView { + return s._viewWin(run.CampaignID, win) + } + + // 不是固定骰子,要看看走不走概率 + if !s._isFixedRoll() { + confM := s.GetDao().FissionCampaignDice + var conf *model.FissionCampaignDice + conf, err = confM.WithContext(s.Ctx).Where(confM.CampaignID.Eq(run.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + // 走概率发奖 + if conf.AwardType == mtype.FissionCampaignDiceAwardTypeOdds { + + winner, _ := lucky.NewDiscrete(s.Ctx, []lucky.Reward{ + {Share: int(conf.Odds), Mark: true}, + {Share: 1000 - int(conf.Odds), Mark: false}, + }).Lottery() + + // 赢不了 + if !winner.Bool() { + return lose, nil + } + + return s._odds(run, list, win, lose) + } + } + + // 如果都没中奖品,那就不用做奖品处理 + if !verify.InArray(win.MarkType, mtype.FissionDiceMapMarkTypeNormal, mtype.FissionDiceMapMarkTypeSuper) { + return win, nil + } + + res, err = s._reward(run, win, lose) + if err != nil { + return + } + + return +} + +func (s *Dice) _reward(run *model.FissionDiceRun, win, lose *rollData) (res *rollData, err error) { + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where(m.ID.Eq(win.RewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil || reward.IsDel == mtype.Yes { + return lose, nil + } + + collect, err := s._getCollect(run, reward) + if err != nil { + return + } + + return s._rewardInDb(reward, collect, win, lose) +} + +// 完整的奖品处理 +func (s *Dice) _intactReward(cpn *model.FissionCampaign, reward *model.FissionCampaignReward, lack bool) (record *model.FissionRewardRecord, err error) { + var opts []award.RecordOption + if lack { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + record, _, async, err := award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, s.user).One(reward, false, opts...) + if lack { + return + } + + s.AddAfterRun(func() (err error) { + for _, do := range async { + do() + } + return + }) + + return +} + +// 概率获取奖品 +func (s *Dice) _odds(run *model.FissionDiceRun, diceMaps []*model.FissionDiceMap, win *rollData, lose *rollData) (res *rollData, err error) { + + var rewardMap = make(map[int64]*model.FissionCampaignReward) + var ids []int64 + var mapIdx = make(map[int]*model.FissionDiceMap) + for idx, v := range diceMaps { + if _, ok := rewardMap[v.RewardID]; !ok { + ids = append(ids, v.RewardID) + rewardMap[v.RewardID] = nil + } + mapIdx[idx] = v + } + + if len(ids) == 0 { + return win, nil + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var allOdds int + var prize []lucky.Reward + for _, v := range list { + odds := int(v.Odds) + prize = append(prize, lucky.Reward{ + Share: odds, + Mark: v.ID, + }) + + allOdds = allOdds + odds + rewardMap[v.ID] = v + } + + reward, err := lucky.NewDiscrete(s.Ctx, prize).Lottery() + if err != nil { + return + } + + id := reward.Int64() + + // 概率中奖了,就走到那个中奖的格子 + for idx, diceMap := range mapIdx { + if diceMap.RewardID == id { + win = &rollData{ + MarkType: diceMap.MarkType, + Step: int32(idx), + RewardId: diceMap.RewardID, + MapId: diceMap.ID, + MapHashId: diceMap.HashID, + } + break + } + } + + collect, err := s._getCollect(run, rewardMap[id]) + if err != nil { + return + } + + return s._rewardInDb(rewardMap[id], collect, win, lose) +} + +// 获取收集碎片的记录 +func (s *Dice) _getCollect(run *model.FissionDiceRun, reward *model.FissionCampaignReward) (collect *model.FissionDiceCollect, err error) { + collectM := s.GetDao().FissionDiceCollect + collect, err = collectM.WithContext(s.Ctx).Where(collectM.UserID.Eq(run.UserID), collectM.RewardID.Eq(reward.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if collect == nil { + collect = withdefault.FissionDiceCollect(&model.FissionDiceCollect{ + UserID: run.UserID, + CampaignID: run.CampaignID, + RewardID: reward.ID, + Num: 0, + IntactNum: 0, + }) + if err = collectM.WithContext(s.Ctx).Create(collect); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 奖品入库 +func (s *Dice) _rewardInDb(reward *model.FissionCampaignReward, collect *model.FissionDiceCollect, win, lose *rollData) (res *rollData, err error) { + var intact bool + var lack bool + if reward.CollectNum == collect.Num+1 { + + //中奖了 + var check bool + check, err = award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().RuleFilter().IsOK() + if err != nil { + return + } + + if !check && s.Req.GetMark() != mtype.FissionDicePropMarkFixedRoll { + return lose, nil + } + + intact = true + lack = !check + } + + cpn, err := finder.Campaign(s.Ctx, reward.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := preward.AutoLang(reward.RewardID, s.user.LangMark) + + collectM := s.GetDao().FissionDiceCollect + var up []field.AssignExpr + var record *model.FissionRewardRecord + if intact { + record, err = s._intactReward(cpn, reward, lack) + if err != nil { + return + } + + if lack { // 没有库存,那就不让客户看动画了 + up = append(up, collectM.Num.Value(0), collectM.IntactNum.Add(1)) + + s.AddAfterRun(func() (err error) { + + // 骰子记录 + var diceRecord = withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CreatedAt: record.CreatedAt, + CampaignID: record.CampaignID, + UserID: record.UserID, + Mark: mtype.FissionDiceRecordMarkReward, + Data: "", + }) + + diceRecord.SetData(&mtype.DiceRecord{ + RewardId: record.RewardID, + RecordId: record.ID, + }) + + // 这里事务已经提交了,不能用有事务的dao + err = s.Dao().FissionDiceRecord.WithContext(s.Ctx).Create(diceRecord) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + }) + + } else { // 有库存,让用户看到合成动画 + up = append(up, collectM.Num.Add(1), collectM.RecordID.Value(record.ID)) + } + + } else { // 没有收集完碎片,碎片数 +1 + up = append(up, collectM.Num.Add(1)) + } + + _, err = collectM.WithContext(s.Ctx).Where(collectM.ID.Eq(collect.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + win.RewardTitle = info.Title + win.ImgUrl = info.ImgUrl + win.Intact = intact + win.Lack = lack + + return win, nil +} + +// 预览用户返回的数据 +func (s *Dice) _viewWin(cpnId int64, rd *rollData) (win *rollData, err error) { + win = rd + + if win.RewardId == 0 { + return + } + + cpn, err := finder.Campaign(s.Ctx, cpnId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where(m.ID.Eq(win.RewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := preward.AutoLang(reward.RewardID, s.user.LangMark) + + win.RewardTitle = info.Title + win.ImgUrl = info.ImgUrl + + return +} + +// 加骰子记录 +func (s *Dice) _diceRecord(player *model.FissionDice, win *rollData, luckyProp bool) (err error) { + if s.Res.FailType != campaignUserDiceFailTypeNone { + return + } + + record := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + }) + + data := &mtype.DiceRecord{ + Point: win.Step + 1, + RewardId: win.RewardId, + } + + defer func() { + err = s.GetDao().FissionDiceRecord.WithContext(s.Ctx).Create(record) + if err != nil { + err = s.BE().MysqlError(err) + } + }() + + // 使用幸运骰子道具 + if luckyProp { + + switch win.MarkType { + case mtype.FissionDiceMapMarkTypeNone: + record.Mark = mtype.FissionDiceRecordMarkLucky + case mtype.FissionDiceMapMarkTypeChance: + record.Mark = mtype.FissionDiceRecordMarkLuckyChance + data.Chance = 1 + default: + record.Mark = mtype.FissionDiceRecordMarkLuckyCollect + } + + record.SetData(data) + + return + } + + switch win.MarkType { + case mtype.FissionDiceMapMarkTypeNone: + record.Mark = mtype.FissionDiceRecordMarkRoll + case mtype.FissionDiceMapMarkTypeChance: + record.Mark = mtype.FissionDiceRecordMarkRollChance + data.Chance = 1 + default: + record.Mark = mtype.FissionDiceRecordMarkRollCollect + } + + record.SetData(data) + + return +} + +// 是否固定骰子 +func (s *Dice) _isFixedRoll() bool { + return s.Req.GetMark() == mtype.FissionDicePropMarkFixedRoll +} diff --git a/internal/service/containers/campaignuser/dice_record.go b/internal/service/containers/campaignuser/dice_record.go new file mode 100644 index 0000000..221c1b8 --- /dev/null +++ b/internal/service/containers/campaignuser/dice_record.go @@ -0,0 +1,330 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen" +) + +type DiceRecord struct { + logic.Logic + Req *pb.DiceRecordReq + Res *pb.DiceRecordRes + + taskChance int32 +} + +func (s *DiceRecord) Run() error { + return logic.Run(s) +} + +func (s *DiceRecord) Exec() (err error) { + user, cpn, err := s.user() + if err != nil || user == nil { + return + } + + err = s.record(cpn, user) + if err != nil { + return + } + + return +} + +func (s *DiceRecord) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId(), s.Req.GetUserHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + return +} + +// diceRecordClumpMap 大富翁骰子记录集合对照map +var diceRecordClumpMap = map[int32][]string{ + 1: { + mtype.FissionDiceRecordMarkSign, + mtype.FissionDiceRecordMarkGetRollAll, + mtype.FissionDiceRecordMarkGetManualRollAll, + mtype.FissionDiceRecordMarkGetRollTask, + mtype.FissionDiceRecordMarkGetManualRollTask, + mtype.FissionDiceRecordMarkGetRollSys, + mtype.FissionDiceRecordMarkRollChance, + mtype.FissionDiceRecordMarkLuckyChance, + mtype.FissionDiceRecordMarkPointsUse, + }, + 2: { + mtype.FissionDiceRecordMarkReward, + }, + 3: { + mtype.FissionDiceRecordMarkRollCollect, + mtype.FissionDiceRecordMarkLuckyCollect, + }, + 4: { + mtype.FissionDiceRecordMarkGetLucky, + }, + 5: { + mtype.FissionDiceRecordMarkRoll, + mtype.FissionDiceRecordMarkRollCollect, + mtype.FissionDiceRecordMarkRollChance, + }, + 6: { + mtype.FissionDiceRecordMarkLucky, + mtype.FissionDiceRecordMarkLuckyCollect, + mtype.FissionDiceRecordMarkLuckyChance, + }, + 7: { + mtype.FissionDiceRecordMarkGetRollAll, + mtype.FissionDiceRecordMarkGetManualRollAll, + mtype.FissionDiceRecordMarkGetRollTask, + mtype.FissionDiceRecordMarkGetManualRollTask, + }, +} + +func (s *DiceRecord) record(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + + m := s.GetDao().FissionDiceRecord + var cond = []gen.Condition{ + m.UserID.Eq(user.ID), + } + + if s.Req.GetRecordType() > 0 && s.Req.GetMark() == "" { + cond = append(cond, m.Mark.In(mtype.FissionDiceRecordClumpMap[s.Req.GetRecordType()]...)) + } + + if s.Req.GetMark() != "" { + cond = append(cond, m.Mark.Eq(s.Req.Mark)) + } + + if len(s.Req.GetConds()) > 0 { + var marks []string + for _, v := range s.Req.GetConds() { + marks = append(marks, diceRecordClumpMap[v]...) + } + cond = append(cond, m.Mark.In(marks...)) + } + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err := m.WithContext(s.Ctx).Where(cond...).Order(m.CreatedAt.Desc(), m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + if total == 0 { + return + } + + s.Res.List = make([]*pb.DiceRecordRes_One, 0, len(list)) + s.Res.Total = total + + var rewardMap = make(map[int64]*provider.RewardAutoLang) + var condMap = make(map[int64]string) + var rewardIds, condIds, recordIds []int64 + var recordMap = make(map[int64]*model.FissionRewardRecord) + for _, v := range list { + data := v.GetData() + + if _, ok := rewardMap[data.RewardId]; !ok && data.RewardId > 0 { + rewardIds = append(rewardIds, data.RewardId) + rewardMap[data.RewardId] = nil + } + + if _, ok := condMap[data.CondId]; !ok && data.CondId > 0 { + condIds = append(condIds, data.CondId) + condMap[data.CondId] = "" + } + + if _, ok := recordMap[data.CondId]; !ok && data.RecordId > 0 { + recordIds = append(recordIds, data.RecordId) + recordMap[data.RecordId] = nil + } + } + + supperMap, err := s._rewardMap(cpn, user, rewardIds, rewardMap) + if err != nil { + return + } + + err = s._condMap(cpn, user, condIds, condMap) + if err != nil { + return + } + + err = s._recordMap(cpn.ID, recordIds, recordMap) + if err != nil { + return + } + + for _, v := range list { + data := v.GetData() + + oneData := &pb.DiceRecordRes_Data{ + Point: data.Point, + IsSupper: supperMap[data.RewardId], + Chance: data.Chance, + LuckyChance: data.LuckyChance, + TaskTitle: condMap[data.CondId], + PointsUseNum: data.PointsNum, + } + + if record, ok := recordMap[data.RecordId]; ok { + oneData.RewardHashId = record.HashID + oneData.Lack = record.FailMsg == mtype.FissionRewardRecordFailTypeCliLackMsg + oneData.CustomRewardVal = record.CustomRewardVal + } + + if reward, ok := rewardMap[data.RewardId]; ok && reward != nil { + oneData.RewardId = data.RewardId + oneData.Title = reward.RewardTitle + oneData.RewardTitle = reward.Title + oneData.RewardUrl = reward.ImgUrl + oneData.ReceiveType = reward.ReceiveType + oneData.Contact = reward.Contact + oneData.KvData = make([]*pb.DiceRecordRes_KV, 0, len(reward.KvData)) + oneData.OpenToUse = reward.OpenToUse + oneData.WebUrl = reward.WebUrl + oneData.AppParam = reward.AppParam + oneData.DyRewardType = reward.DyRewardType + oneData.PcParam = reward.PcParam + for _, kv := range reward.KvData { + oneData.KvData = append(oneData.KvData, &pb.DiceRecordRes_KV{ + Key: kv.Key, + Value: kv.Value, + IsShow: kv.IsShow, + }) + } + } + + s.Res.List = append(s.Res.List, &pb.DiceRecordRes_One{ + Id: v.ID, + Mark: v.Mark, + CreatedTime: v.CreatedAt, + Data: oneData, + }) + } + + return +} + +func (s *DiceRecord) _rewardMap(cpn *model.FissionCampaign, user *model.FissionUser, rewardIds []int64, rewardMap map[int64]*provider.RewardAutoLang) (supperMap map[int64]int32, err error) { + if len(rewardIds) == 0 { + return + } + + var rewards []*model.FissionCampaignReward + rewardM := s.GetDao().FissionCampaignReward + rewards, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + supperMap = make(map[int64]int32, len(rewards)) + var brIds []int64 + var brMap = make(map[int64]*provider.RewardAutoLang) + for _, v := range rewards { + if _, ok := brMap[v.RewardID]; !ok { + brIds = append(brIds, v.RewardID) + brMap[v.RewardID] = nil + } + supperMap[v.ID] = int32(v.IsSuper) + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, brIds...) + if err != nil { + return + } + + brMap, err = preward.InfoAutoLangMap(user.LangMark) + if err != nil { + return + } + + for _, v := range rewards { + rewardMap[v.ID] = brMap[v.RewardID] + } + + return +} + +func (s *DiceRecord) _condMap(cpn *model.FissionCampaign, user *model.FissionUser, condIds []int64, condMap map[int64]string) (err error) { + if len(condIds) == 0 { + return + } + + m := s.GetDao().FissionCampaignCond + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(condIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var dl = cpn.GetLangMarks()[0] == user.LangMark + if !dl { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, user.LangMark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang != nil { + for _, v := range lang.GetConds() { + condMap[v.CondId] = v.Desc + } + return + } + } + + for _, v := range list { + condMap[v.ID] = v.Desc + } + + return +} + +func (s *DiceRecord) _recordMap(cpnId int64, recordIds []int64, recordMap map[int64]*model.FissionRewardRecord) (err error) { + if len(recordIds) == 0 { + return + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpnId) + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(recordIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + recordMap[v.ID] = v + } + + return +} diff --git a/internal/service/containers/campaignuser/dynamic_link.go b/internal/service/containers/campaignuser/dynamic_link.go new file mode 100644 index 0000000..eb3ca84 --- /dev/null +++ b/internal/service/containers/campaignuser/dynamic_link.go @@ -0,0 +1,259 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + linkpb "gits.branchcn.com/backend/shortlink/proto/go_proto/link" +) + +type DynamicLink struct { + logic.Logic + Req *pb.DynamicLinkReq + Res *pb.DynamicLinkRes +} + +func (s *DynamicLink) Run() error { + return logic.Run(s) +} + +func (s *DynamicLink) Exec() (err error) { + project, cpn, channel, err := s.related() + if err != nil { + return + } + + user, err := s.user(cpn, channel) + if err != nil { + return + } + + err = s.link(cpn, user, project, channel) + if err != nil { + return + } + + return +} + +func (s *DynamicLink) related() (project *model.Project, cpn *model.FissionCampaign, channel *model.FissionCampaignChannel, err error) { + project, err = finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.DynamicNotRelatedError + return + } + + if s.Req.GetCampaignHashId() != "" { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } else { + var conf *model.FissionConfig + conf, err = cmm.NewCMM(s.Ctx, s.GetDao()).GetFissionConfig(project.ID) + if err != nil { + return + } + + cpn, err = finder.Campaign(s.Ctx, conf.DynamicCampaign) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.DynamicNotRelatedError + return + } + + channelM := s.GetDao().FissionCampaignChannel + + channel, err = channelM.WithContext(s.Ctx).Where( + channelM.CampaignID.Eq(cpn.ID), + channelM.CType.Eq(mtype.FissionCampaignChannelTypeApp), + channelM.IsDefault.Eq(mtype.Yes), + channelM.IsDel.Eq(mtype.No), + ).Take() + + return +} + +func (s *DynamicLink) user(cpn *model.FissionCampaign, channel *model.FissionCampaignChannel) (user *model.FissionUser, err error) { + if s.Req.GetSubUserId() == "" { + err = s.BE().VerifyError("sub_user_id empty") + return + } + + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user != nil { + return + } + + lc := app.NewRedisLock(s.Ctx, ckey.FissionUserStoreOnce(cpn.ID, s.Req.GetSubUserId())).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user != nil { + return + } + + user = withdefault.FissionUser(&model.FissionUser{ + CampaignID: cpn.ID, + ChannelID: channel.ID, + ParentID: 0, + Deep: 0, + IsNew: 0, + SubUserID: s.Req.GetSubUserId(), + DeviceID: "", + UserMark: s.Req.GetSubUserId(), + UserType: mtype.FissionUserTypePlay, + ParentIds: "", + IsView: 0, + ShareLink: "", + Source: mtype.FissionUserSourceDynamic, + IsHelp: 0, + }) + + m := s.GetDao().FissionUser + if err = m.WithContext(s.Ctx).Create(user); err != nil { + err = s.BE().MysqlError(err) + return + } + + ms := s.GetDao().FissionUser.SubTable(cpn.ID) + if err = ms.WithContext(s.Ctx).Create(user); err != nil { + err = s.BE().MysqlError(err) + return + } + + producer.NewCampaignNotice(s.Ctx).ProjectUser(types.ProjectUser{ + ProjectId: cpn.ProjectID, + UserId: user.SubUserID, + }) + + return +} + +func (s *DynamicLink) link(cpn *model.FissionCampaign, user *model.FissionUser, project *model.Project, channel *model.FissionCampaignChannel) (err error) { + params := &mtype.FissionUserDyLinkParams{ + MediaType: s.Req.GetMediaType(), + ImageText: nil, + } + + switch s.Req.GetMediaType() { + case mtype.FissionUserDyLinkMediaTypeImgText: + for _, v := range s.Req.GetImageText() { + params.ImageText = append(params.ImageText, &mtype.ImageText{ + NickName: v.GetNickName(), + Avatar: v.GetAvatar(), + Title: v.GetTitle(), + Desc: v.GetDesc(), + Image: v.GetImage(), + }) + } + } + + b, err := jsonm.Marshal(params) + if err != nil { + err = workerr.ServerError + return + } + + mark, _ := b.ToMd5() + + m := s.GetDao().FissionUserDylink + + lk, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.LinkMark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + defer func() { + if err != nil { + return + } + s.Res.LinkUrl = lk.LinkURL + }() + + if lk != nil { + return + } + + lc := app.NewRedisLock(s.Ctx, ckey.FissionUserDyLinkOnce(user.ID, mark)).Lock() + defer lc.Release() + if err != nil { + err = workerr.BusyError + return + } + + lk, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.LinkMark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if lk != nil { + return + } + + lk = withdefault.FissionUserDylink(&model.FissionUserDylink{ + CampaignID: cpn.ID, + UserID: user.ID, + LinkMark: mark, + Params: b.ToString(), + }) + + link := blink.NewCampaignLink(project.Domain, cpn.HashID, channel.Mark, blink.SetSubUserId(user.SubUserID), blink.SetDyLinkId(lk.HashID)).CampaignDynamicLink() + res, err := app.NewShortLinkNameLink().CreateShortLink(s.Ctx, &linkpb.CreateShortLinkReq{ + LongLink: link, + Domain: project.Domain, + }) + + if err != nil { + return + } + + lk.LinkURL = res.GetShortLink() + + if err = m.WithContext(s.Ctx).Create(lk); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/campaignuser/exchange.go b/internal/service/containers/campaignuser/exchange.go new file mode 100644 index 0000000..70b044b --- /dev/null +++ b/internal/service/containers/campaignuser/exchange.go @@ -0,0 +1,294 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "time" +) + +const ( + exchangeStatusOk = iota // 成功 + exchangeStatusLack // 库存不足 + exchangeStatusLimit // 兑换上限 + exchangeStatusDown // 商品已下架 + exchangeStatusPointLack // 积分不足 + exchangeStatusExchanging // 兑换中 + exchangeStatusFail // 兑换失败 +) + +type Exchange struct { + logic.Logic + + Req *pb.ExchangeReq + Res *pb.ExchangeRes +} + +func (s *Exchange) Run() (err error) { + return logic.Run(s) +} + +func (s *Exchange) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *Exchange) Exec() (err error) { + cpn, user, err := s.user() + if err != nil { + return + } + + pu, item, err := s.pu(cpn, user) + if err != nil || item == nil { + return + } + + err = s.checkItem(item) + if err != nil || s.Res.GetStatus() != exchangeStatusOk { + return + } + + exchanging := app.NewRedisLock(s.Ctx, ckey.MallItemExchanging(pu.GetProjectUser().ID)) + if !exchanging.SoftLock() { + s.Res.Status = exchangeStatusExchanging + return + } + defer exchanging.Release() + + return s.exchange(pu, item, user, cpn) +} + +func (s *Exchange) user() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.UnauthorizedError + return + } + + return +} + +func (s *Exchange) pu(cpn *model.FissionCampaign, user *model.FissionUser) (pu *projectuser.ProjectUser, item *model.RedeemMallItem, err error) { + pu, err = projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(cpn.ProjectID, user.SubUserID), projectuser.WithDao(s.GetDao())) + if err != nil { + return + } + + item, err = cache.NewRedeemMallItem(s.Ctx).FindById(s.Req.GetMallItemId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if item == nil { + s.Res.Status = exchangeStatusDown + return + } + + return + +} + +func (s *Exchange) checkItem(item *model.RedeemMallItem) (err error) { + if verify.InArray[int32](item.GetStatus(), mtype.RedeemMallItemStatusDel, mtype.RedeemMallItemStatusDown) { + s.Res.Status = exchangeStatusDown + return + } + + stock, err := stocks.NewMallItem(s.Ctx, item.ID) + if err != nil { + return + } + + ok, err := stock.DecrPoolAndAdd(item.ID, 1) + if err != nil { + return + } + + if !ok { + s.Res.Status = exchangeStatusLack + return + } + + s.AddErrRun(func() (err error) { + _, _ = stock.DecrPoolAndAdd(item.ID, -1) + return + }) + + s.AddErrRun(func() (err error) { + if s.Res.Status != exchangeStatusOk { + _, _ = stock.DecrPoolAndAdd(item.ID, -1) + } + return + }) + + return +} + +func (s *Exchange) exchange(pu *projectuser.ProjectUser, item *model.RedeemMallItem, user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + coin, err := pu.GetCoin() + if err != nil { + return + } + + if coin.Num < int64(item.CoinNum) { + s.Res.Status = exchangeStatusPointLack + return + } + + ok, err := pu.Deduct(mtype.ProjectUserCoinUseSourceCampaign, mtype.ProjectUserCoinDerMall, user.CampaignID, item.CoinNum) + if err != nil { + return + } + + if !ok { + s.Rollback("项目用户积分币不足") + s.Res.Status = exchangeStatusPointLack + return + } + + mall, err := malls.NewMall(s.Ctx, item.MallID) + if err != nil { + return + } + + reward, mallRecord, info, err := mall.ExchangeRecord(item, user.LangMark) + if err != nil { + return + } + + record := withdefault.FissionRewardRecord(&model.FissionRewardRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + RewardID: reward.ID, + Title: info.Title, + ImgURL: info.ImgUrl, + RewardType: mtype.FissionCampaignRewardTypeExchange, + RewardNum: 1, + BaseRewardID: reward.ID, + PropMark: mtype.FissionCampaignRewardPropMarkReward, + MallRecordID: mallRecord.ID, + ExchangePoints: int32(mallRecord.CoinNum), + }) + + err = s.GetDao().FissionRewardRecord.WithContext(s.Ctx).Create(record) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.GetDao().FissionRewardRecord.SubTable(user.CampaignID).WithContext(s.Ctx).Create(record) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.GetDao().FissionClientReward.WithContext(s.Ctx).Create(withdefault.FissionClientReward(&model.FissionClientReward{ + UserID: user.SubUserID, + ProjectID: pu.GetProjectUser().ProjectID, + CampaignID: user.CampaignID, + RecordID: record.ID, + CreatedAt: record.CreatedAt, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s._fissionCallback(cpn, user, item) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + bp := fissionaction.NewMarkPoint(s.Ctx).InApp(user) + if item.CoinNum > 0 { + bp.PointsUse(time.Now().Unix(), item.CoinNum) + } + bp.MallRedeem(time.Now().Unix(), item.MallID, item.ID, item.CoinNum) + + producer.NewCampaignNotice(s.Ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: user.CampaignID, + UserId: user.ID, + UserRewardId: record.ID, + }) + + return + }) + + s.Res.Status = exchangeStatusOk + s.Res.Id = record.ID + s.Res.RewardId = info.Id + s.Res.Title = info.Title + s.Res.ImgUrl = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Contact = info.Contact + s.Res.OpenToUse = info.OpenToUse + s.Res.CustomRewardVal = record.CustomRewardVal + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + s.Res.FailType = record.FailType + s.Res.FailMsg = record.FailMsg + s.Res.KvData = make([]*pb.ExchangeRes_KV, 0, len(info.KvData)) + + for _, datum := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.ExchangeRes_KV{ + Key: datum.Key, + Value: datum.Value, + IsShow: datum.IsShow, + }) + } + + return +} + +func (s *Exchange) _fissionCallback(cpn *model.FissionCampaign, user *model.FissionUser, item *model.RedeemMallItem) (err error) { + switch cpn.FissionID { + case consts.IdVs: + player, err1 := players.NewVs(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err1 != nil { + return err1 + } + err = player.Exchange(item) + if err != nil { + return + } + } + + return +} diff --git a/internal/service/containers/campaignuser/feed.go b/internal/service/containers/campaignuser/feed.go new file mode 100644 index 0000000..0aa667b --- /dev/null +++ b/internal/service/containers/campaignuser/feed.go @@ -0,0 +1,321 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "github.com/golang-module/carbon/v2" + "gorm.io/gen/field" +) + +const ( + feedFailTypeNone = iota //0-饲养成功 + feedFailTypeLack //1-道具不足 + feedFailTypeMax //2-不能继续升级 + feedFailTypeDie //3-生命体死亡 +) + +const ( + feedHasRewardNone = iota + feedHasRewardOk + feedHasRewardLack +) + +type Feed struct { + logic.Logic + Req *pb.FeedReq + Res *pb.FeedRes + + growRecords []*model.FissionGrowRecord +} + +func (s *Feed) Run() error { + return logic.Run(s) +} + +func (s *Feed) Exec() (err error) { + player, conf, err := s.player() + if err != nil || s.Res.FailType != feedFailTypeNone { + return + } + + err = s.feed(player, conf) + if err != nil || s.Res.FailType != feedFailTypeNone { + return + } + + return s.growRecord() +} + +func (s *Feed) player() (player *model.FissionGrow, conf *model.FissionCampaignGrow, err error) { + playerM := s.GetDao().FissionGrow + player, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.Req.GetUserId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + err = workerr.NotFound("not found player") + return + } + + if player.GrowNum < s.Req.GetNum() { + s.Res.FailType = feedFailTypeLack + return + } + + confM := s.GetDao().FissionCampaignGrow + conf, err = confM.WithContext(s.Ctx).Where(confM.CampaignID.Eq(player.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf == nil { + err = workerr.NotFound("not found grow conf") + return + } + + return +} + +func (s *Feed) feed(player *model.FissionGrow, conf *model.FissionCampaignGrow) (err error) { + + lifeM := s.GetDao().FissionGrowLife + life, err := lifeM.WithContext(s.Ctx).Where(lifeM.UserID.Eq(player.UserID), lifeM.IsGrow.Eq(mtype.Yes)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if life == nil { + err = workerr.NotFound("not found life") + return + } + + if life.IsDie == mtype.Yes { + s.Res.FailType = feedFailTypeDie + return + } + + //查找生命体剩余阶段 + stepM := s.GetDao().FissionCampaignGrowStep + steps, err := stepM.WithContext(s.Ctx).Where(stepM.CampaignID.Eq(player.CampaignID), stepM.Step.Gt(life.Step)).Order(stepM.Step).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(steps) == 0 { + s.Res.FailType = feedFailTypeMax + return + } + + s._setGrowRecord(player, mtype.FissionGrowRecordFeed, []*mtype.GrowVarData{{ + Key: "{{num}}", + Value: fmt.Sprint(s.Req.GetNum()), + }}) + + //喂了养料之后当前的阶段 + var num = life.Num + s.Req.GetNum() + var step *model.FissionCampaignGrowStep + for _, v := range steps { + if v.Num <= num { + step = v + break + } + } + + var lifeUp = []field.AssignExpr{ + lifeM.DieTime.Value(carbon.Now().AddHours(int(conf.DieHour)).Timestamp()), + } + + defer func() { + if err != nil { + return + } + _, err = lifeM.WithContext(s.Ctx).Where(lifeM.ID.Eq(life.ID)).UpdateSimple(lifeUp...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + }() + + //养料具体使用 + var useNum = s.Req.GetNum() + if step != nil { + //升级只消耗到达下一级别的养料 + lifeUp = append(lifeUp, lifeM.Step.Value(step.Step), lifeM.Num.Value(0)) + useNum = step.Num - life.Num + } else { + //不升级 + lifeUp = append(lifeUp, lifeM.Num.Add(s.Req.GetNum())) + } + + playerM := s.GetDao().FissionGrow + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.GrowNum.Sub(useNum)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Step = life.Step + + // 没升级 + if step == nil { + return + } + + s.Res.UpStep = step.Step + s.Res.LvUp = true + + // 升级了,但是不是最后一级 + if step.Step != steps[len(steps)-1].Step { + s._setGrowRecord(player, mtype.FissionGrowRecordLvUp, nil) + return + } + + // 最后一级直接领奖 + record, err := s._reward(player) + if err != nil { + return + } + + lifeUp = append(lifeUp, lifeM.RecordID.Value(record.ID)) + + return +} + +func (s *Feed) _reward(player *model.FissionGrow) (record *model.FissionRewardRecord, err error) { + cpn, err := finder.Campaign(s.Ctx, player.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + user, err := finder.FissionUser(s.Ctx, cpn.ID, player.UserID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + rewards, err := cm.UserAppReward(user) + if err != nil { + return + } + + if len(rewards) == 0 { + return + } + + reward := rewards[0] + ok, err := award.NewAwardIssVerify(s.Ctx, user, reward).DeductStock().IsOK() + if err != nil { + return + } + + var opts []award.RecordOption + if !ok { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + record, info, async, err := award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).One(reward, false, opts...) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.RewardTitle = record.Title + s.Res.RewardUrl = record.ImgURL + s.Res.RewardId = reward.ID + s.Res.Contact = info.Contact + s.Res.ReceiveType = info.ReceiveType + + if info.ReceiveType == mtype.RewardReceiveTypeClient { + s.Res.KvData = make([]*pb.FeedRes_KV, 0, len(info.KvData)) + for _, v := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.FeedRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + } + + if !ok { + s.Res.HasReward = feedHasRewardLack + return + } + + s.Res.HasReward = feedHasRewardOk + for _, do := range async { + do() + } + + return + }) + + statM := s.GetDao().FissionUserStat + _, err = statM.WithContext(s.Ctx).Where(statM.UserID.Eq(player.UserID)).UpdateSimple(statM.GrowRewardNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s._setGrowRecord(player, mtype.FissionGrowRecordGetReward, []*mtype.GrowVarData{{ + Key: "{{reward_title}}", + Value: record.Title, + IdMark: reward.ID, + }}) + + s.AddAfterRun(func() (err error) { + fissionaction.NewMarkPoint(s.Ctx).InApp(user).GrowOk(time.Now().Unix(), reward.ID, record.ID) + + return + }) + + return +} + +func (s *Feed) _setGrowRecord(player *model.FissionGrow, mark string, varData []*mtype.GrowVarData) { + feedRecord := withdefault.FissionGrowRecord(&model.FissionGrowRecord{ + UserID: player.UserID, + CampaignID: player.CampaignID, + Mark: mark, + VarData: "", + }) + feedRecord.SetVarData(varData) + s.growRecords = append(s.growRecords, feedRecord) +} + +func (s *Feed) growRecord() (err error) { + if len(s.growRecords) == 0 { + return + } + + recordM := s.GetDao().FissionGrowRecord + + err = recordM.WithContext(s.Ctx).Create(s.growRecords...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/campaignuser/list.go b/internal/service/containers/campaignuser/list.go new file mode 100644 index 0000000..25f6aee --- /dev/null +++ b/internal/service/containers/campaignuser/list.go @@ -0,0 +1,1164 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "fmt" + + "gorm.io/gen" + "gorm.io/gen/field" +) + +type List struct { + logic.Logic + Req *pb.ListReq + Res *pb.ListRes + + diceMap map[int64]*pb.ListRes_Dice + chopMap map[int64]*pb.ListRes_Chop + newcomerMap map[int64]*pb.ListRes_Win + keepDogMap map[int64]*pb.ListRes_Keep + cashMap map[int64]map[string]*pb.ListRes_Cash + goldMap map[int64]map[string]*pb.ListRes_Gold + helpFailMark map[int64]string + + coinMap map[int64]*pb.ListRes_Coin + + signMap map[int64]*pb.ListRes_Sign + + vsMap map[int64]*pb.ListRes_Vs + + unoMap map[int64]*pb.ListRes_Uno +} + +func (s *List) Run() error { + return logic.Run(s) +} + +func (s *List) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + if cpn == nil { + return + } + + err = s.list(cpn) + if err != nil { + return + } + + return +} + +// 活动数据 +func (s *List) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return + } + + tz := utils.STernary[int32](s.Req.GetTOffset(), consts.DefaultTz, cpn.TOffset) + + s.Req.Start = timez.GMT(s.Req.Start, tz) + s.Req.End = timez.GMT(s.Req.End, tz) + + s.Res.TOffset = tz + s.Res.FissionId = cpn.FissionID + s.Res.FissionMark = consts.FissionIdMap[cpn.FissionID] + + return +} + +func (s *List) list(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionUser.SubTable(cpn.ID) + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.IsView.Eq(mtype.No), + m.CampaignID.Eq(cpn.ID), + } + + if s.Req.GetPid() > 0 { + cond = append(cond, m.ParentID.Eq(s.Req.GetPid())) + } + + if !verify.EmptyString(s.Req.GetUserMark()) { + cond = append(cond, m.UserMark.Eq(s.Req.GetUserMark())) + } + + if s.Req.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(s.Req.GetStart())) + } + + if s.Req.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(s.Req.GetEnd())) + } + + if s.Req.GetSource() > 0 { + cond = append(cond, m.Source.Eq(int8(s.Req.GetSource()))) + } + + if s.Req.GetLangMark() != "" { + cond = append(cond, m.LangMark.Eq(s.Req.GetLangMark())) + } + + if s.Req.GetParentUserMark() != "" { + var puser *model.FissionUser + puser, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetParentUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if puser == nil { + cond = append(cond, m.ID.Eq(-1)) + } else { + cond = append(cond, m.ParentID.Eq(puser.ID)) + } + } + + if s.Req.GetPidType() != 0 { + switch s.Req.GetPidType() { + case 1: + cond = append(cond, m.ParentID.Gt(0)) + case 2: + cond = append(cond, m.ParentID.Eq(0)) + } + } + + if s.Req.GetJoinType() != 0 { + switch s.Req.GetJoinType() { + case 1: + cond = append(cond, m.JoinAt.Gt(0)) + case 2: + cond = append(cond, m.JoinAt.Eq(0)) + } + } + + if len(s.Req.GetUserCond()) > 0 { + for _, v := range s.Req.GetUserCond() { + switch v { + case mtype.FissionUserStateDataCondInstall: + cond = append(cond, m.InstallAt.Gt(0)) + case mtype.FissionUserStateDataCondRegister: + cond = append(cond, m.RegisterAt.Gt(0)) + default: + cond = append(cond, m.ID.Eq(0)) + } + } + } + + var orderBys []field.Expr + if s.Req.OrderByTimeAsc { + orderBys = append(orderBys, m.CreatedAt) + } + orderBys = append(orderBys, m.ID.Desc()) + + list, total, err := s._find(cpn.ID, cond, orderBys) + if err != nil || total == 0 { + return + } + + //找上级用户数据 + var ( + pids, ids, channelIds, lvIds []int64 + userMap = make(map[int64]string) + channelMap = make(map[int64]string) + platformMap = make(map[int64]string) + lvTitleMap = make(map[int64]string) + chanceMap = make(map[int64]int32) + statNumMap = make(map[int64]*model.FissionUserStat) + userCondMap = make(map[int64][]*pb.ListRes_Cond) + ) + for _, v := range list { + ids = append(ids, v.ID) + statNumMap[v.ID] = nil + chanceMap[v.ID] = 0 + userMap[v.ID] = v.UserMark + platformMap[v.ID] = "" + userCondMap[v.ID] = nil + + if _, ok := userMap[v.ParentID]; !ok && v.ParentID > 0 { + userMap[v.ParentID] = "" + pids = append(pids, v.ParentID) + } + + if _, ok := channelMap[v.ChannelID]; !ok && v.ChannelID > 0 { + channelMap[v.ChannelID] = "" + channelIds = append(channelIds, v.ChannelID) + } + + if _, ok := lvTitleMap[v.UserLevel]; !ok && v.UserLevel > 0 { + lvTitleMap[v.UserLevel] = "" + lvIds = append(lvIds, v.UserLevel) + } + } + + err = s._parentMap(cpn.ID, pids, userMap) + if err != nil { + return + } + + err = s._statMap(ids, statNumMap) + if err != nil { + return + } + + err = s._channelMap(channelIds, channelMap) + if err != nil { + return + } + + err = s._chanceMap(cpn, ids, chanceMap) + if err != nil { + return + } + + err = s._platformMap(cpn, ids, platformMap) + if err != nil { + return + } + + err = s._lvTitleMap(lvIds, lvTitleMap) + if err != nil { + return + } + + err = s._conds(cpn.ID, ids, userCondMap) + if err != nil { + return + } + + err = s._helpMap(cpn, list) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.List = make([]*pb.ListRes_One, 0, len(list)) + s.Res.Total = total + + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + HashId: v.HashID, + SubUserId: v.SubUserID, + Parent: userMap[v.ParentID], + ChildNum: 0, + IndirectNum: 0, + IsNew: int32(v.IsNew), + CreatedAt: v.CreatedAt, + Chance: chanceMap[v.ID], + IsHelp: 0, + Dice: nil, + ChannelTitle: channelMap[v.ChannelID], + Source: int32(v.Source), + EffectNum: 0, + LangMark: v.LangMark, + CountryMark: v.UserCountry, + LvTitle: lvTitleMap[v.UserLevel], + Platform: platformMap[v.ID], + UserMark: v.UserMark, + UserMarkSource: utils.Ternary[int32](v.SubUserID == "", 2, 1), + Conds: userCondMap[v.ID], + DeviceId: v.DeviceID, + JoinAt: v.JoinAt, + InstallAt: v.InstallAt, + RegisterAt: v.RegisterAt, + } + + if stat, ok := statNumMap[v.ID]; ok && stat != nil { + one.ChildNum = stat.DirectNum + one.IndirectNum = stat.IndirectNum + one.EffectNum = stat.EffectiveNum + } + + if v.ParentID > 0 { + one.IsHelp = utils.Ternary[int32](v.IsHelp == mtype.Yes, 1, 2) + one.FailMark = s.helpFailMark[v.ID] + } + + switch cpn.FissionID { + case consts.IdDice: + one.Dice = s.diceMap[v.ID] + case consts.IdChop: + one.Chop = s.chopMap[v.ID] + case consts.IdWinTogether: + one.Win = s.newcomerMap[v.ID] + case consts.IdKeep: + one.KeepDog = s.keepDogMap[v.ID] + case consts.IdCash: + if cash, ok := s.cashMap[v.ID][v.LangMark]; ok { + one.Cash = cash + } + case consts.IdGold: + if gold, ok := s.goldMap[v.ID][v.LangMark]; ok { + one.Gold = gold + } + case consts.IdCoin: + one.Coin = s.coinMap[v.ID] + case consts.IdSignIn: + one.Sign = s.signMap[v.ID] + case consts.IdVs: + one.Vs = s.vsMap[v.ID] + case consts.IdUno: + one.Uno = s.unoMap[v.ID] + default: + + } + + s.Res.List = append(s.Res.List, one) + } + + return + }) + + return +} + +func (s *List) _find(campaignId int64, cond []gen.Condition, orderBys []field.Expr) (list []*model.FissionUser, total int64, err error) { + + m := s.GetDao().FissionUser.SubTable(campaignId) + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + + total, err = m.WithContext(s.Ctx).Select(m.ID).Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + subId := field.NewInt64("a", "id") + subQuery := gen.Table(m.WithContext(s.Ctx).Select(m.ID).Where(cond...).Order(orderBys...).Offset(offset).Limit(limit).As("a")).Select(subId) + + qm := s.GetDao().FissionUser.SubTable(campaignId).As("qm") + list, err = qm.WithContext(s.Ctx).Where(qm.WithContext(s.Ctx).Columns(qm.ID).In(subQuery)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + +} + +// 父级数据 +func (s *List) _parentMap(cpnId int64, ids []int64, userMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + m := s.GetDao().FissionUser.SubTable(cpnId) + + //找上级数据 + userList, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range userList { + userMap[v.ID] = v.UserMark + } + + return +} + +// 统计数据 +func (s *List) _statMap(ids []int64, statNumMap map[int64]*model.FissionUserStat) (err error) { + if len(ids) == 0 { + return + } + + //统计数据 + statM := s.GetDao().FissionUserStat + statList, err := statM.WithContext(s.Ctx).Where(statM.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range statList { + statNumMap[v.UserID] = v + } + + return +} + +// 剩余活动次数 +func (s *List) _chanceMap(cpn *model.FissionCampaign, ids []int64, chanceMap map[int64]int32) (err error) { + + switch cpn.FissionID { + case consts.IdBlindBox: + m := s.GetDao().FissionBlind + var list []*model.FissionBlind + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdLuckyGrid: + m := s.GetDao().FissionGrid + var list []*model.FissionGrid + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdSlotMachine: + m := s.GetDao().FissionSlot + var list []*model.FissionSlot + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdPrizeWheel: + m := s.GetDao().FissionPrizeWheel + var list []*model.FissionPrizeWheel + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: + m := s.GetDao().FissionQa + var list []*model.FissionQa + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdPrizeQuiz: + m := s.GetDao().FissionQuiz + var list []*model.FissionQuiz + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdFlip: + m := s.GetDao().FissionFlip + var list []*model.FissionFlip + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdBallot: + m := s.GetDao().FissionBallot + var list []*model.FissionBallot + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.Chance + } + case consts.IdDice: + err = s._dice(ids) + if err != nil { + return + } + + m := s.GetDao().FissionCampaignDice + var conf *model.FissionCampaignDice + conf, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf != nil { + s.Res.FixDice = int32(conf.FixDice) + } + case consts.IdGrow: + m := s.GetDao().FissionGrow + var list []*model.FissionGrow + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = v.GrowNum + } + + case consts.IdChop: + err = s._chop(ids) + if err != nil { + return + } + case consts.IdWinTogether: + + s.newcomerMap = make(map[int64]*pb.ListRes_Win, len(ids)) + + m := s.GetDao().FissionWin + var list []*model.FissionWin + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + s.newcomerMap[v.UserID] = &pb.ListRes_Win{ + IsNewcomer: int32(v.IsNewcomer), + } + } + + case consts.IdKeep: + err = s._keep(ids) + if err != nil { + return + } + case consts.IdCash: + err = s._cash(ids) + if err != nil { + return + } + case consts.IdGold: + err = s._gold(ids) + if err != nil { + return + } + case consts.IdCoin: + err = s._coin(cpn, ids) + if err != nil { + return + } + case consts.IdSignIn: + err = s._sign(ids) + if err != nil { + return + } + case consts.IdVs: + err = s._vs(ids) + if err != nil { + return + } + case consts.IdUno: + err = s._uno(ids) + if err != nil { + return + } + + } + + return +} + +func (s *List) _sign(ids []int64) (err error) { + if s.signMap != nil || len(ids) == 0 { + return + } + + playerM := s.GetDao().FissionSign + list, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.signMap = make(map[int64]*pb.ListRes_Sign, len(ids)) + for _, v := range list { + s.signMap[v.UserID] = &pb.ListRes_Sign{ + SignDay: v.SignDay, + MaxContinue: v.MaxContinue, + } + } + + return +} + +func (s *List) _coin(cpn *model.FissionCampaign, ids []int64) (err error) { + if s.coinMap != nil || len(ids) == 0 { + return + } + + gmt := utils.Ternary[string](cpn.TOffset < 0, fmt.Sprint(cpn.TOffset), fmt.Sprintf("+%d", cpn.TOffset)) + + m := s.GetDao().FissionCoinScene + scenes, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + var sceneMap = make(map[int64]string, len(scenes)) + for _, scene := range scenes { + day, _, _ := timez.GMTStartAndEndTs(cpn.TOffset, scene.OpenTime) + sceneMap[scene.ID] = fmt.Sprintf("%s(GMT%s)", day, gmt) + } + + playerM := s.GetDao().FissionCoin + list, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.coinMap = make(map[int64]*pb.ListRes_Coin, len(ids)) + var playerMap = make(map[int64][]*model.FissionCoin, len(ids)) + for _, v := range list { + playerMap[v.UserID] = append(playerMap[v.UserID], v) + } + + for userId, players := range playerMap { + + var totalUse, totalCoin int32 + var userScenes []*pb.ListRes_CoinScene + for _, player := range players { + + userScenes = append(userScenes, &pb.ListRes_CoinScene{ + Title: sceneMap[player.SceneID], + UseNum: player.UseNum, + GetCoin: player.GetCoin, + }) + + totalUse += player.UseNum + totalCoin += player.GetCoin + } + + s.coinMap[userId] = &pb.ListRes_Coin{ + TotalUse: totalUse, + TotalNum: totalCoin, + Scenes: userScenes, + } + } + + return +} + +func (s *List) _keep(ids []int64) (err error) { + if s.keepDogMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionKeep + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var rewardMap = make(map[int64]string) + var rewardIds []int64 + for _, v := range list { + if _, ok := rewardMap[v.RewardID]; !ok { + rewardMap[v.RewardID] = "" + rewardIds = append(rewardIds, v.RewardID) + } + } + + rewardTitleMap, err := s._getRewardTitle(rewardIds) + if err != nil { + return + } + + s.keepDogMap = make(map[int64]*pb.ListRes_Keep, len(list)) + + for _, v := range list { + s.keepDogMap[v.UserID] = &pb.ListRes_Keep{ + CollectNum: v.CollectNum, + RewardTitle: rewardTitleMap[v.RewardID], + Chance: v.Num, + } + } + + return +} + +func (s *List) _dice(ids []int64) (err error) { + if s.diceMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionDice + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.diceMap = make(map[int64]*pb.ListRes_Dice, len(list)) + + for _, v := range list { + s.diceMap[v.UserID] = &pb.ListRes_Dice{ + Chance: v.Chance, + LuckyChance: 0, + } + } + + pm := s.GetDao().FissionDiceProp + plist, err := pm.WithContext(s.Ctx).Where(pm.UserID.In(ids...), pm.Mark.Eq(mtype.FissionDicePropMarkFixedRoll)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range plist { + s.diceMap[v.UserID].LuckyChance = v.Num + } + + return +} + +func (s *List) _chop(ids []int64) (err error) { + if s.chopMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionChop + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.chopMap = make(map[int64]*pb.ListRes_Chop, len(list)) + + var chopMap = make(map[int64]*model.FissionChopReward, len(list)) + var chopRewardMap = make(map[int64]string) + var chopRewardIds []int64 + for _, v := range list { + if v.ChopRewardID == 0 { + continue + } + chopRewardIds = append(chopRewardIds, v.ChopRewardID) + } + + if len(chopRewardIds) > 0 { + chopRewardM := s.GetDao().FissionChopReward + var chopRewardList []*model.FissionChopReward + chopRewardList, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.ID.In(chopRewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range chopRewardList { + rewardIds = append(rewardIds, v.RewardID) + chopMap[v.ID] = v + } + + var rewardTitleMap map[int64]string + rewardTitleMap, err = s._getRewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range chopRewardList { + chopRewardMap[v.ID] = rewardTitleMap[v.RewardID] + } + } + + s.chopMap = make(map[int64]*pb.ListRes_Chop, len(list)) + for _, v := range list { + if chop, ok := chopMap[v.ChopRewardID]; ok { + s.chopMap[v.UserID] = &pb.ListRes_Chop{ + ChopRewardId: v.ChopRewardID, + RewardTitle: chopRewardMap[chop.ID], + Percent: utils.PercentCutZero(chop.Percent), + } + } else { + s.chopMap[v.UserID] = &pb.ListRes_Chop{} + } + } + + return +} + +func (s *List) _channelMap(ids []int64, channelMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + channelMap[v.ID] = v.Title + } + return +} + +func (s *List) _platformMap(cpn *model.FissionCampaign, ids []int64, platformMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionUserAttr + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.UserID.In(ids...), m.Attr.Eq(mtype.FissionUserAttrMarkPlatform)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range list { + platformMap[v.UserID] = v.Value + } + + return +} + +func (s *List) _lvTitleMap(ids []int64, lvTitleMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + lvTitleMap[v.ID] = v.Title + } + return +} + +func (s *List) _conds(cpnId int64, ids []int64, data map[int64][]*pb.ListRes_Cond) (err error) { + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpnId)). + Where( + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(conds) == 0 { + return + } + + m := s.GetDao().FissionUserCond + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userCondMap = make(map[int64]map[int64]int64) + for _, v := range list { + + if _, ok := userCondMap[v.UserID]; !ok { + userCondMap[v.UserID] = map[int64]int64{ + v.CondID: v.Num, + } + } else { + userCondMap[v.UserID][v.CondID] = v.Num + } + } + + for _, userId := range ids { + + for _, cond := range conds { + one := &pb.ListRes_Cond{ + Desc: cond.Desc, + Num: 0, + } + + if uc, ok := userCondMap[userId]; ok { + one.Num = uc[cond.ID] + } + + data[userId] = append(data[userId], one) + } + } + + return +} + +func (s *List) _helpMap(cpn *model.FissionCampaign, users []*model.FissionUser) (err error) { + s.helpFailMark = make(map[int64]string, len(users)) + + if len(users) == 0 { + return + } + + key := ckey.FissionUserHelpFailMark(cpn.ID) + var ids []int64 + for _, user := range users { + + s.helpFailMark[user.ID] = "" + if user.ParentID == 0 || user.IsHelp == mtype.Yes { + continue + } + + failMark := app.Redis.Cache.HGet(s.Ctx, key, fmt.Sprint(user.ID)).Val() + if failMark == "" { + ids = append(ids, user.ID) + continue + } + + s.helpFailMark[user.ID] = failMark + } + + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignTicket + tickets, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Open.Eq(mtype.Yes)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, ticket := range tickets { + + if ticket.Mark == mtype.FissionCampaignTicketFixed { + var vals []string + for _, id := range ids { + failMark := utils.Ternary[string](ticket.AppEvent == mtype.FissionCampaignTicketAppEventInstall, consts.HelpStatusNotInstall, consts.HelpStatusNotRegister) + s.helpFailMark[id] = failMark + vals = append(vals, fmt.Sprint(id), failMark) + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + + return + } + + if ticket.Mark == mtype.FissionCampaignTicketCustom && verify.InArray(cpn.FissionID, consts.IdReferral, consts.IdWinTogether) { + + if ticket.PreEvent == mtype.FissionCampaignTicketPreEventNone { + var vals []string + for _, id := range ids { + failMark := consts.HelpStatusNotTask + s.helpFailMark[id] = failMark + vals = append(vals, fmt.Sprint(id), failMark) + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + + return + } + + switch cpn.FissionID { + case consts.IdReferral: + playerM := s.GetDao().FissionReferral + var list []*model.FissionReferral + list, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var vals []string + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventInstall: + + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotInstall) + s.helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + + case mtype.FissionCampaignTicketAppEventRegister: + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotRegister) + s.helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + + case consts.IdWinTogether: + playerM := s.GetDao().FissionWin + var list []*model.FissionWin + list, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var vals []string + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventInstall: + + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotInstall) + s.helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + + case mtype.FissionCampaignTicketAppEventRegister: + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotRegister) + s.helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + } + + return + } + + } + + return +} + +func (s *List) _getRewardTitle(rewardIds []int64) (data map[int64]string, err error) { + m := s.GetDao().FissionCampaignReward + rewards, err := m.WithContext(s.Ctx).Where(m.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bMap = make(map[int64]string) + var bIds []int64 + for _, v := range rewards { + if _, ok := bMap[v.RewardID]; !ok { + bIds = append(bIds, v.RewardID) + } + } + + rewardM := s.GetDao().Reward + + list, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(bIds...)).Find() + for _, v := range list { + bMap[v.ID] = v.RewardTitle + } + + data = make(map[int64]string, len(rewards)) + for _, v := range rewards { + data[v.ID] = bMap[v.RewardID] + } + return +} + +func (s *List) _cash(ids []int64) (err error) { + if s.cashMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionCash + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.cashMap = make(map[int64]map[string]*pb.ListRes_Cash, len(list)) + + for _, v := range list { + if _, ok := s.cashMap[v.ID]; !ok { + s.cashMap[v.UserID] = map[string]*pb.ListRes_Cash{ + v.Lang: {ExpiredAt: v.ExpiredIn}, + } + } else { + s.cashMap[v.UserID][v.Lang] = &pb.ListRes_Cash{ExpiredAt: v.ExpiredIn} + } + } + + return +} + +func (s *List) _gold(ids []int64) (err error) { + if s.goldMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionGold + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.goldMap = make(map[int64]map[string]*pb.ListRes_Gold, len(list)) + + for _, v := range list { + if _, ok := s.goldMap[v.ID]; !ok { + s.goldMap[v.UserID] = map[string]*pb.ListRes_Gold{ + v.Lang: { + GoldNum: v.GoldNum, + ExpiredAt: v.ExpiredIn, + }, + } + } else { + s.goldMap[v.UserID][v.Lang] = &pb.ListRes_Gold{ + GoldNum: v.GoldNum, + ExpiredAt: v.ExpiredIn, + } + } + } + + return +} + +func (s *List) _vs(ids []int64) (err error) { + if s.vsMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionV + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.vsMap = make(map[int64]*pb.ListRes_Vs, len(list)) + + for _, v := range list { + s.vsMap[v.UserID] = &pb.ListRes_Vs{ + Chance: v.Chance, + VoteNum: v.VoteNum, + CoinGet: v.CoinGet, + CoinUse: v.CoinUse, + } + } + + return +} + +func (s *List) _uno(ids []int64) (err error) { + if s.unoMap != nil || len(ids) == 0 { + return + } + + m := s.GetDao().FissionUno + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + s.unoMap = make(map[int64]*pb.ListRes_Uno, len(list)) + + for _, v := range list { + s.unoMap[v.UserID] = &pb.ListRes_Uno{ + Chance: v.Chance, + ThreeNum: v.ThreeNum, + FiveNum: v.FiveNum, + FixNum: v.FixNum, + } + } + + return +} diff --git a/internal/service/containers/campaignuser/lottery.go b/internal/service/containers/campaignuser/lottery.go new file mode 100644 index 0000000..f352804 --- /dev/null +++ b/internal/service/containers/campaignuser/lottery.go @@ -0,0 +1,271 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" +) + +type Lottery struct { + logic.Logic + Req *pb.LotteryReq + Res *pb.LotteryRes + + cpn *model.FissionCampaign +} + +func (s *Lottery) Run() error { + return logic.Run(s) +} + +func (s *Lottery) Exec() (err error) { + user, cpn, err := s.user() + if err != nil { + return + } + + err = s.lottery(user, cpn) + if err != nil { + return + } + + return +} + +// 用户信息 +func (s *Lottery) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + if cpn.EndTime < time.Now().Unix() { + err = workerr.CEndError + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + //如果活动没开始,还不是预览用户,不允许玩 + if cpn.StartTime > time.Now().Unix() && user.IsView == mtype.No { + err = workerr.CStartError + return + } + + s.cpn = cpn + + return +} + +// 抽奖机 +func (s *Lottery) lotteryMachine(selection map[int64]*model.FissionCampaignReward) *lucky.Discrete { + var prize []lucky.Reward + for _, v := range selection { + prize = append(prize, lucky.Reward{ + Share: int(v.Odds), + Mark: v.ID, + }) + } + + return lucky.NewDiscrete(s.Ctx, prize) +} + +func (s *Lottery) lottery(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdBlindBox: //盲盒 + return s.blindBox(user, cpn) + case consts.IdPrizeWheel: //大转盘 + return s.prizeWheel(user, cpn) + case consts.IdSlotMachine: //老虎机 + return s.slotMachine(user, cpn) + case consts.IdLuckyGrid: //九宫格 + return s.luckyGrid(user, cpn) + case consts.IdBallot: //抽签 + return s.ballot(user) + case consts.IdFlip: //翻牌 + return s.flip(user, cpn) + case consts.IdGashapon: //扭蛋机 + return s.gashapon(user, cpn) + default: + } + + return +} + +// 盲盒抽奖 +func (s *Lottery) blindBox(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewBlind(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, info, record, err := player.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} + +// 大转盘抽奖 +func (s *Lottery) prizeWheel(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewWheel(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, info, record, err := player.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} + +// 老虎机抽奖 +func (s *Lottery) slotMachine(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewSlot(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, info, record, err := player.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} + +// 九宫格抽奖 +func (s *Lottery) luckyGrid(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewGrid(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, info, record, err := player.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} + +func (s *Lottery) ballot(user *model.FissionUser) (err error) { + ballot, err := players.NewBallot(s.Ctx, user) + if err != nil { + return + } + + reward, info, record, err := ballot.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} + +func (s *Lottery) _rsp(reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord) { + s.AddAfterRun(func() (err error) { + + s.Res.Id = reward.ID + s.Res.Win = reward.GetWin() + s.Res.Title = info.Title + s.Res.Img = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Contact = info.Contact + s.Res.OpenToUse = info.OpenToUse + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + + if record != nil { + s.Res.RewardHashId = record.HashID + } + + s.Res.KvData = make([]*pb.LotteryRes_KV, 0, len(info.KvData)) + for _, v := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.LotteryRes_KV{ + Key: v.Key, + Value: v.Value, + IsShow: v.IsShow, + }) + } + + return + }) +} + +func (s *Lottery) flip(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewFlip(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, info, record, err := player.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} + +func (s *Lottery) gashapon(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := players.NewGashapon(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, info, record, err := player.Lottery() + if err != nil { + return + } + + // 返回数据 + s._rsp(reward, info, record) + + return +} diff --git a/internal/service/containers/campaignuser/lottery_log.go b/internal/service/containers/campaignuser/lottery_log.go new file mode 100644 index 0000000..fc31d3b --- /dev/null +++ b/internal/service/containers/campaignuser/lottery_log.go @@ -0,0 +1,527 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + + pb "joybuywork/proto/go_proto/w_campaign_user" +) + +type LotteryLog struct { + logic.Logic + Req *pb.LotteryLogReq + Res *pb.LotteryLogRes +} + +func (s *LotteryLog) Run() error { + return logic.Run(s) +} + +func (s *LotteryLog) Exec() (err error) { + cpn, err := s.cpn() + if err != nil { + return + } + + err = s.list(cpn) + if err != nil { + return + } + + return +} + +func (s *LotteryLog) cpn() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *LotteryLog) list(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdPrizeWheel: + return s.wheel(cpn) + case consts.IdFlip: + return s.flip(cpn) + case consts.IdBlindBox: + return s.blind(cpn) + case consts.IdLuckyGrid: + return s.grid(cpn) + case consts.IdSlotMachine: + return s.slot(cpn) + case consts.IdGashapon: + return s.gashapon(cpn) + } + + return +} + +func (s *LotteryLog) gashapon(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionGashaponLog + var list []*model.FissionGashaponLog + total, err := s._find(m.TableName(), cpn.ID, &list) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + var taskIds, rewardIds []int64 + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + + taskTitle, err := s._taskTitle(taskIds) + if err != nil { + return + } + + rewardTitle, err := s._rewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + s.Res.List = append(s.Res.List, &pb.LotteryLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Type: int32(v.Type), + Source: v.Source, + TaskTitle: taskTitle[val.TaskId], + RewardTitle: rewardTitle[val.RewardId], + Chance: val.Chance, + PointsUseNum: val.PointsNum, + }) + } + + return +} + +func (s *LotteryLog) slot(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionSlotLog + var list []*model.FissionSlotLog + total, err := s._find(m.TableName(), cpn.ID, &list) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + var taskIds, rewardIds []int64 + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + + taskTitle, err := s._taskTitle(taskIds) + if err != nil { + return + } + + rewardTitle, err := s._rewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + s.Res.List = append(s.Res.List, &pb.LotteryLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Type: int32(v.Type), + Source: v.Source, + TaskTitle: taskTitle[val.TaskId], + RewardTitle: rewardTitle[val.RewardId], + Chance: val.Chance, + PointsUseNum: val.PointsNum, + }) + } + + return +} + +func (s *LotteryLog) grid(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionGridLog + var list []*model.FissionGridLog + total, err := s._find(m.TableName(), cpn.ID, &list) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + var taskIds, rewardIds []int64 + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + + taskTitle, err := s._taskTitle(taskIds) + if err != nil { + return + } + + rewardTitle, err := s._rewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + s.Res.List = append(s.Res.List, &pb.LotteryLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Type: int32(v.Type), + Source: v.Source, + TaskTitle: taskTitle[val.TaskId], + RewardTitle: rewardTitle[val.RewardId], + Chance: val.Chance, + PointsUseNum: val.PointsNum, + }) + } + + return +} + +func (s *LotteryLog) blind(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionBlindLog + var list []*model.FissionBlindLog + total, err := s._find(m.TableName(), cpn.ID, &list) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + var taskIds, rewardIds []int64 + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + + taskTitle, err := s._taskTitle(taskIds) + if err != nil { + return + } + + rewardTitle, err := s._rewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + s.Res.List = append(s.Res.List, &pb.LotteryLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Type: int32(v.Type), + Source: v.Source, + TaskTitle: taskTitle[val.TaskId], + RewardTitle: rewardTitle[val.RewardId], + Chance: val.Chance, + PointsUseNum: val.PointsNum, + }) + } + + return +} + +func (s *LotteryLog) flip(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionFlipLog + var list []*model.FissionFlipLog + total, err := s._find(m.TableName(), cpn.ID, &list) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + var taskIds, rewardIds []int64 + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + + taskTitle, err := s._taskTitle(taskIds) + if err != nil { + return + } + + rewardTitle, err := s._rewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + s.Res.List = append(s.Res.List, &pb.LotteryLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Type: int32(v.Type), + Source: v.Source, + TaskTitle: taskTitle[val.TaskId], + RewardTitle: rewardTitle[val.RewardId], + Chance: val.Chance, + PointsUseNum: val.PointsNum, + }) + } + + return +} + +func (s *LotteryLog) wheel(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionPrizeWheelLog + var list []*model.FissionPrizeWheelLog + total, err := s._find(m.TableName(), cpn.ID, &list) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + var taskIds, rewardIds []int64 + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + for _, v := range list { + val := v.GetVal() + switch v.Source { + case mtype.FissionLogSourceLottery: + rewardIds = append(rewardIds, val.RewardId) + case mtype.FissionLogSourceCondOne, mtype.FissionLogSourceManualCondOne: + taskIds = append(taskIds, val.TaskId) + } + } + + taskTitle, err := s._taskTitle(taskIds) + if err != nil { + return + } + + rewardTitle, err := s._rewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + s.Res.List = append(s.Res.List, &pb.LotteryLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Type: int32(v.Type), + Source: v.Source, + TaskTitle: taskTitle[val.TaskId], + RewardTitle: rewardTitle[val.RewardId], + Chance: val.Chance, + PointsUseNum: val.PointsNum, + }) + } + + return +} + +func (s *LotteryLog) _find(tableName string, cpnId int64, list any) (total int64, err error) { + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + + query := app.DB.Client.Table(tableName).WithContext(s.Ctx) + + if s.Req.GetUserHashId() != "" || s.Req.GetSubUserId() != "" { + var user *model.FissionUser + if s.Req.GetUserHashId() != "" { + user, err = cache.NewFissionUser(s.Ctx, cpnId).FindByHashId(s.Req.GetUserHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } else { + user, err = cache.NewFissionUser(s.Ctx, cpnId).FindBySubUserId(s.Req.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + var userId int64 + if user != nil { + userId = user.ID + } + + query = query.Where("user_id = ?", userId) + } + + if len(s.Req.GetSource()) != 0 { + query = query.Where("source in ?", s.Req.GetSource()) + } + + err = query.Count(&total).Error + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = query.Order("id desc").Offset(offset).Limit(limit).Find(list).Error + if err != nil { + err = s.BE().CacheError(err) + return + } + return +} + +func (s *LotteryLog) _taskTitle(ids []int64) (data map[int64]string, err error) { + data = make(map[int64]string, len(ids)) + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignTask + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var condIds []int64 + var taskMap = make(map[int64]int64) + for _, v := range list { + id := utils.FissionCampaignTaskMarkCondOneCondId(v.TaskMark) + condIds = append(condIds, id) + taskMap[v.ID] = id + } + + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.ID.In(condIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var condMap = make(map[int64]string, len(conds)) + for _, v := range conds { + condMap[v.ID] = v.Desc + } + + for _, v := range list { + data[v.ID] = condMap[taskMap[v.ID]] + } + + return +} + +func (s *LotteryLog) _rewardTitle(ids []int64) (data map[int64]string, err error) { + data = make(map[int64]string, len(ids)) + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bids []int64 + var titleMap = make(map[int64]string) + for _, v := range list { + if _, ok := titleMap[v.RewardID]; !ok { + bids = append(bids, v.RewardID) + titleMap[v.RewardID] = "" + } + } + + rewardM := s.GetDao().Reward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(bids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range rewards { + titleMap[v.ID] = v.RewardTitle + } + + for _, v := range list { + data[v.ID] = titleMap[v.RewardID] + } + + return +} diff --git a/internal/service/containers/campaignuser/mall_list.go b/internal/service/containers/campaignuser/mall_list.go new file mode 100644 index 0000000..548a0f5 --- /dev/null +++ b/internal/service/containers/campaignuser/mall_list.go @@ -0,0 +1,164 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "time" +) + +type MallList struct { + logic.Logic + + Req *pb.MallListReq + Res *pb.MallListRes +} + +func (s *MallList) Run() (err error) { + return logic.Run(s) +} + +func (s *MallList) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *MallList) Exec() (err error) { + cpn, user, err := s.user() + if err != nil { + return + } + + mallId, err := s.getMallId(cpn) + if err != nil { + return + } + + return s.list(mallId, user.LangMark) +} + +func (s *MallList) user() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.UnauthorizedError + return + } + + return +} + +func (s *MallList) list(mallId int64, langMark string) (err error) { + mall, err := malls.NewMall(s.Ctx, mallId) + if err != nil { + return + } + + list, err := mall.UpItems() + if err != nil { + return + } + + var showList []*model.RedeemMallItem + for _, v := range list { + if v.IsShow() { + showList = append(showList, v) + } + } + + var rewardMap = make(map[int64]struct{}) + var rewardIds []int64 + var ids []int64 + for _, v := range showList { + ids = append(ids, v.ID) + if _, ok := rewardMap[v.ID]; !ok { + rewardMap[v.RewardID] = struct{}{} + rewardIds = append(rewardIds, v.RewardID) + } + } + + useStockMap, err := s._useStock(ids) + if err != nil { + return + } + + preward, err := provider.NewRewards(s.Ctx, mall.GetMall().ProjectID, rewardIds...) + if err != nil { + return + } + + s.Res.List = make([]*pb.MallListRes_One, 0, len(showList)) + + for _, v := range showList { + info, _ := preward.InfoAutoLang(v.RewardID, langMark) + s.Res.List = append(s.Res.List, &pb.MallListRes_One{ + Id: v.ID, + RewardId: v.RewardID, + Title: info.Title, + ImgUrl: info.ImgUrl, + Remain: v.Stock - useStockMap[v.ID], + Status: v.GetStatus(), + UpRemain: v.UpAt - time.Now().Unix(), + CoinNum: v.CoinNum, + }) + } + + return +} + +func (s *MallList) _useStock(ids []int64) (data map[int64]int64, err error) { + data = make(map[int64]int64) + if len(ids) == 0 { + return + } + + stock, err := stocks.NewMallItem(s.Ctx, ids...) + if err != nil { + return + } + + data, err = stock.AllUseStock() + if err != nil { + return + } + + return +} + +func (s *MallList) getMallId(cpn *model.FissionCampaign) (mallId int64, err error) { + switch cpn.FissionID { + case consts.IdVs: + conf, err1 := cache.NewCampaignVs(s.Ctx).FindByCampaignId(cpn.ID) + if err1 != nil { + err = s.BE().CacheError(err1) + return + } + mallId = conf.MallID + } + + return +} diff --git a/internal/service/containers/campaignuser/mix_reward.go b/internal/service/containers/campaignuser/mix_reward.go new file mode 100644 index 0000000..37f54a3 --- /dev/null +++ b/internal/service/containers/campaignuser/mix_reward.go @@ -0,0 +1,222 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" +) + +type MixReward struct { + logic.Logic + Req *pb.MixRewardReq + Res *pb.MixRewardRes + + taskChance int32 +} + +func (s *MixReward) Run() error { + return logic.Run(s) +} + +func (s *MixReward) Exec() (err error) { + user, err := s.user() + if err != nil { + return + } + + if user.IsView == mtype.Yes { + return s.viewMix(user) + } + + err = s.mix(user) + if err != nil { + return + } + + return +} + +func (s *MixReward) user() (user *model.FissionUser, err error) { + cpn, err := finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + return +} + +// 普通用户的合成 +func (s *MixReward) mix(user *model.FissionUser) (err error) { + m := s.GetDao().FissionDiceCollect + collect, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.RewardID.Eq(s.Req.GetRewardId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if collect == nil || collect.RecordID == 0 { + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(collect.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + // 完整度+1 + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(collect.ID)).UpdateSimple(m.IntactNum.Add(1), m.Num.Sub(reward.CollectNum), m.RecordID.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + recordM := s.GetDao().FissionRewardRecord.SubTable(user.CampaignID) + record, err := recordM.WithContext(s.Ctx).Where(recordM.ID.Eq(collect.RecordID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var lack bool + if record.FailType == mtype.FissionRewardRecordFailTypeCli && record.FailMsg == mtype.FissionRewardRecordFailTypeCliLackMsg { + lack = true + } + + // 骰子记录 + var diceRecord = withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CreatedAt: record.CreatedAt, + CampaignID: user.CampaignID, + UserID: user.ID, + Mark: mtype.FissionDiceRecordMarkReward, + Data: "", + }) + + diceRecord.SetData(&mtype.DiceRecord{ + RewardId: record.RewardID, + RecordId: record.ID, + }) + + err = s.GetDao().FissionDiceRecord.WithContext(s.Ctx).Create(diceRecord) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cpn, err := finder.Campaign(s.Ctx, user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, record.BaseRewardID) + if err != nil { + return + } + + info, _ := preward.InfoAutoLang(record.BaseRewardID, user.LangMark) + + s.AddAfterRun(func() (err error) { + s.Res.Lack = lack + s.Res.RewardId = record.RewardID + s.Res.RewardTitle = info.Title + s.Res.ImgUrl = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Contact = info.Contact + s.Res.KvData = make([]*pb.MixRewardRes_KV, 0, len(info.KvData)) + s.Res.RewardHashId = record.HashID + s.Res.OpenToUse = info.OpenToUse + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + + for _, v := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.MixRewardRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + + return + }) + + return +} + +// 预览用户的合成 +func (s *MixReward) viewMix(user *model.FissionUser) (err error) { + m := s.GetDao().FissionDiceCollect + collect, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.RewardID.Eq(s.Req.GetRewardId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(collect.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + cpn, err := finder.Campaign(s.Ctx, user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info, _ := preward.InfoAutoLang(reward.RewardID, user.LangMark) + + s.AddAfterRun(func() (err error) { + s.Res.RewardId = reward.RewardID + s.Res.RewardTitle = info.Title + s.Res.ImgUrl = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Contact = info.Contact + s.Res.KvData = make([]*pb.MixRewardRes_KV, 0, len(info.KvData)) + s.Res.OpenToUse = info.OpenToUse + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + + for _, v := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.MixRewardRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + + return + }) + + return +} diff --git a/internal/service/containers/campaignuser/play.go b/internal/service/containers/campaignuser/play.go new file mode 100644 index 0000000..6db4952 --- /dev/null +++ b/internal/service/containers/campaignuser/play.go @@ -0,0 +1,1428 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "strings" + "time" + + "github.com/golang-module/carbon/v2" +) + +type Play struct { + logic.Logic + Req *pb.PlayReq + Res *pb.PlayRes + + taskChance int32 + + cpnControl *provider.CampaignTZ +} + +func (s *Play) Run() error { + return logic.Run(s) +} + +func (s *Play) Exec() (err error) { + user, cpn, err := s.user() + if err != nil { + return + } + + err = s.play(user, cpn) + if err != nil { + return + } + + s.clue(user) + + return +} + +func (s *Play) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + var parentUserId string + if user.ParentID > 0 { + var puser *model.FissionUser + puser, err = finder.FissionUser(s.Ctx, cpn.ID, user.ParentID) + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + parentUserId = puser.SubUserID + } + + s.cpnControl = provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + s.AddAfterRun(func() (err error) { + s.Res.SubUserId = user.SubUserID + s.Res.ParentUserId = parentUserId + s.Res.DeviceId = user.DeviceID + s.Res.ShareLink = user.ShareLink + s.Res.FissionId = cpn.FissionID + + return + }) + + return +} + +func (s *Play) play(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdPrizeWheel: //大转盘 + return s._prizeWheel(user, cpn) + case consts.IdSlotMachine: //老虎机 + return s._slotMachine(user, cpn) + case consts.IdLuckyGrid: //九宫格 + return s._luckyGrid(user, cpn) + case consts.IdBlindBox: //盲盒 + return s._blindBox(user, cpn) + case consts.IdReferral: //老带新 + return s._referral(user, cpn) + case consts.IdWinTogether: //一起赢 + return s._winTogether(user, cpn) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: //趣味问答 + return s._prizeAnswer(user, cpn) + case consts.IdPrizeQuiz: //有奖竞猜 + return s._prizeQuiz(user, cpn) + case consts.IdSignIn: //签到 + return s._signIn(user) + case consts.IdDice: //大富翁 + return s._dice(user, cpn) + case consts.IdGrow: //农场 + return s._grow(user) + case consts.IdBallot: //抽签 + return s._ballot(user, cpn) + case consts.IdChop: //砍一刀 + return s._chop(user, cpn) + case consts.IdCash: //现金抽奖 + return s._cash(user, cpn) + case consts.IdFlip: //翻牌抽奖 + return s._flip(user, cpn) + case consts.IdKeep: //激励养成 + return s._keep(user, cpn) + case consts.IdGold: //金币任务 + return s._gold(user, cpn) + case consts.IdCoin: //瓜分金币 + return s._coin(user, cpn) + case consts.IdVs: //VS + return s._vs(user, cpn) + case consts.IdUno: //Uno + return s._uno(user, cpn) + case consts.IdGashapon: //翻牌 + return s._gashapon(user, cpn) + } + + return +} + +func (s *Play) _referral(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionReferral(user) + if err != nil { + return + } + + rcf, err := cache.NewCampaignReferral(s.Ctx).FindByCampaignId(user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return s._invitePlayer(user, cpn, rcf.RewardRule, player.LimitStatus, player.BindRegister, player.BindInstall, player.NextStep, player.LoopInvite) +} + +func (s *Play) _winTogether(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionWin(user) + if err != nil { + return + } + + fcw, err := cache.NewCampaignWin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = s._invitePlayer(user, cpn, fcw.RewardRule, player.LimitStatus, player.BindRegister, player.BindInstall, player.NextStep, player.LoopInvite) + if err != nil { + return + } + + // 新人奖通知 + recordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + records, err := recordM.WithContext(s.Ctx).Where(recordM.UserID.Eq(player.UserID), recordM.RewardType.Eq(mtype.FissionCampaignRewardTypeNewcomer)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 能不能拿新人奖 + s.AddAfterRun(func() (err error) { + if user.ParentID == 0 { + return + } + switch fcw.NewcomerCond { + case mtype.FissionNewcomerCondInstall: + s.Res.InvitePlayer.HasNewcomerReward = user.Source == mtype.FissionUserSourceInstall && len(records) == 0 + case mtype.FissionNewcomerCondHelp: + s.Res.InvitePlayer.HasNewcomerReward = user.IsHelp == mtype.No && len(records) == 0 + case mtype.FissionNewcomerCondInstallAndHelp: + s.Res.InvitePlayer.HasNewcomerReward = user.Source == mtype.FissionUserSourceInstall && user.IsHelp == mtype.No && len(records) == 0 + } + + return + }) + + var ntr *model.FissionRewardRecord + ntRecordId := provider.NewFissionClue(s.Ctx, user.ID).GetNewcomerReward() + + if ntRecordId == 0 { + return + } + + for _, v := range records { + if v.ID == ntRecordId { + ntr = v + break + } + } + + if ntr == nil { + return + } + + prewards, err := provider.NewRewards(s.Ctx, cpn.ProjectID, ntr.BaseRewardID) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + + info, _ := prewards.InfoAutoLang(ntr.BaseRewardID, user.LangMark) + + s.Res.InvitePlayer.NoticeReward = &pb.PlayRes_NoticeReward{ + HashId: ntr.HashID, + Title: info.Title, + RewardNum: ntr.RewardNum, + ReceiveType: info.ReceiveType, + KvData: nil, + RewardId: ntr.RewardID, + Contact: info.Contact, + } + + if info.ReceiveType == mtype.RewardReceiveTypeClient { + s.Res.InvitePlayer.NoticeReward.KvData = make([]*pb.PlayRes_KV, 0, len(info.KvData)) + for _, v := range info.KvData { + s.Res.InvitePlayer.NoticeReward.KvData = append(s.Res.InvitePlayer.NoticeReward.KvData, &pb.PlayRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + } + return + }) + + return +} + +func (s *Play) _invitePlayer(user *model.FissionUser, cpn *model.FissionCampaign, rewardRule, limitStatus, br, bi int8, nextStep, loopInvite int32) (err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var hasHelpTask bool + if conf.Option == mtype.FissionCampaignConfigTargetOptionFriend && user.IsHelp == mtype.No { + var ticket *model.FissionCampaignTicket + ticket, err = cache.NewCampaignTicket(s.Ctx).FindByMark(cpn.ID, mtype.FissionCampaignTicketCustom) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if ticket != nil && ticket.Open == mtype.Yes { + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventRegister: + hasHelpTask = br == mtype.Yes + case mtype.FissionCampaignTicketPreEventInstall: + hasHelpTask = bi == mtype.Yes + } + } + } + + stat, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionUserStat(user) + if err != nil { + return + } + + cms := cmm.NewCMM(s.Ctx, s.GetDao()) + appRewardList, err := cms.UserAppReward(user) + if err != nil { + return + } + + rewardM, recordM := s.GetDao().FissionCampaignReward, s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + + //常规奖励,旧非阶梯 + if rewardRule == mtype.FissionReferralRewardRuleCycle { + var extraReward *model.FissionCampaignReward + extraReward, err = rewardM.WithContext(s.Ctx).Where( + rewardM.CampaignID.Eq(cpn.ID), + rewardM.RewardType.Eq(mtype.FissionCampaignRewardTypeExtra), + rewardM.IsDel.Eq(mtype.No), + ).Order(rewardM.Step).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + reward := appRewardList[0] + + type numT struct { + RewardType int32 + Num int64 + } + + var nums []numT + if err = recordM.WithContext(s.Ctx). + Select(recordM.RewardType, recordM.RewardNum.Sum().As("num")). + Where(recordM.UserID.Eq(user.ID), recordM.RewardType.In(mtype.FissionCampaignRewardTypeExtra, mtype.FissionCampaignRewardTypeApp)). + Group(recordM.RewardType). + Scan(&nums); err != nil { + return s.BE().MysqlError(err) + } + + var num, extraNum numT + for _, v := range nums { + if v.RewardType == mtype.FissionCampaignRewardTypeExtra { + extraNum = v + } else { + num = v + } + } + + var ids = []int64{reward.RewardID} + if extraReward != nil { + ids = append(ids, extraReward.RewardID) + } + var prewards *provider.Rewards + prewards, err = provider.NewRewards(s.Ctx, cpn.ProjectID, ids...) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + info := prewards.AutoLang(reward.RewardID, user.LangMark) + s.Res.InvitePlayer = &pb.PlayRes_InvitePalyer{ + Id: user.ID, + InviteNum: stat.EffectiveNum, + NeedNum: int64(reward.InviteNum), + LimitStatus: int32(limitStatus), + Title: info.Title, + RewardNum: num.Num, + RewardRule: int32(rewardRule), + RewardId: reward.ID, + ExtraTitle: "", + ExtraRewardNum: 0, + HasHelpTask: hasHelpTask, + } + + if extraReward != nil { + extraInfo := prewards.AutoLang(extraReward.RewardID, user.LangMark) + s.Res.InvitePlayer.ExtraRewardId = extraReward.ID + s.Res.InvitePlayer.ExtraTitle = extraInfo.Title + s.Res.InvitePlayer.ExtraRewardNum = extraNum.Num + } + + return + }) + + return + } + + // 阶梯逻辑 + + // 被限制了 + if limitStatus != mtype.FissionReferralLimitStatusNone { + //找第一条数据来做单位,因为产品会保证每个阶梯都是同一种单位,后续有问题再处理 + reward := appRewardList[0] + + var num struct { + Num int64 + } + if err = recordM.WithContext(s.Ctx). + Select(recordM.RewardNum.Sum().As("num")). + Where(recordM.UserID.Eq(user.ID), recordM.RewardType.In(mtype.FissionCampaignRewardTypeExtra, mtype.FissionCampaignRewardTypeApp)). + Scan(&num); err != nil { + return s.BE().MysqlError(err) + } + + var prewards *provider.Rewards + prewards, err = provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + info := prewards.AutoLang(reward.RewardID, user.LangMark) + + s.Res.InvitePlayer = &pb.PlayRes_InvitePalyer{ + Id: user.ID, + InviteNum: stat.EffectiveNum, + NeedNum: int64(reward.InviteNum), + LimitStatus: int32(limitStatus), + Title: info.Title, + RewardNum: num.Num, + RewardRule: int32(rewardRule), + RewardId: reward.ID, + HasHelpTask: hasHelpTask, + } + + return + }) + + return + } + + var allInviteNum int32 + for _, reward := range appRewardList { + if reward.InviteNum > allInviteNum { + allInviteNum = reward.InviteNum + } + } + + var reward *model.FissionCampaignReward + for _, v := range appRewardList { + if v.Step == nextStep { + reward = v + break + } + } + + var title string + var rewardId, rewardNum, needNum int64 + + if reward != nil { + var prewards *provider.Rewards + prewards, err = provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := prewards.AutoLang(reward.RewardID, user.LangMark) + + rewardId = reward.ID + title = info.Title + rewardNum = int64(reward.RewardNum) + needNum = int64(reward.InviteNum) - (stat.EffectiveNum - int64(loopInvite*allInviteNum)) + } + + s.AddAfterRun(func() (err error) { + s.Res.InvitePlayer = &pb.PlayRes_InvitePalyer{ + Id: user.ID, + InviteNum: stat.EffectiveNum, + NeedNum: utils.Ternary(needNum > 0, needNum, 1), + LimitStatus: int32(limitStatus), + Title: title, + RewardNum: rewardNum, + RewardRule: int32(rewardRule), + RewardId: rewardId, + HasHelpTask: hasHelpTask, + } + + return + }) + + return +} + +func (s *Play) _prizeWheel(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + wheel, err := players.NewWheel(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = wheel.SetInit() + if err != nil { + return + } + + err = wheel.Sign() + if err != nil { + return + } + + player := wheel.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _chancePlayer(user *model.FissionUser, chance int32) (err error) { + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.Ctx).Where(statM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if stat == nil { + stat = withdefault.FissionUserStat(&model.FissionUserStat{ + UserID: user.ID, + CampaignID: user.CampaignID, + }) + err = statM.WithContext(s.Ctx).Create(stat) + if err != nil { + return s.BE().MysqlError(err) + } + } + + s.AddAfterRun(func() (err error) { + s.Res.ChancePlayer = &pb.PlayRes_ChancePlayer{ + Id: user.ID, + Chance: chance, + InviteNum: stat.DirectNum, + } + + return + }) + return +} + +func (s *Play) _prizeQuiz(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + quiz, err := players.NewQuiz(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + err = quiz.SetInit() + if err != nil { + return + } + + player, fcq := quiz.GetPlayer(), quiz.GetConf() + + //奖励 + var record *model.FissionRewardRecord + recordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err = recordM.WithContext(s.Ctx).Where(recordM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.Ctx).Where(statM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + + s.Res.Quiz = &pb.PlayRes_Quiz{ + Id: user.ID, + Chance: player.Chance, + OptionId: player.OptionID, + Win: player.IsWin == mtype.Yes, + Title: "", + ImgUrl: "", + InviteNum: stat.DirectNum, + RewardHashId: "", + ReceiveType: 0, + IsPush: false, + KvData: nil, + OpenType: mtype.FissionCampaignQuizOpenTypeWait, + } + + if fcq.OpenType == mtype.FissionCampaignQuizOpenTypeNone { //开奖了,但是不发奖励的开奖 + s.Res.Quiz.OpenType = mtype.FissionCampaignQuizOpenTypeNone + } + + if record != nil { + + s.Res.Quiz.OpenType = mtype.FissionCampaignQuizOpenTypeOpen + + s.Res.Quiz.Title = record.Title + s.Res.Quiz.ImgUrl = record.ImgURL + s.Res.Quiz.RewardHashId = record.HashID + s.Res.Quiz.IsPush = record.Status != mtype.FissionRewardRecordStatusWait + s.Res.Quiz.RewardId = record.RewardID + + prewards, _ := provider.NewRewards(s.Ctx, cpn.ProjectID, record.BaseRewardID) + + info, _ := prewards.InfoAutoLang(record.BaseRewardID, user.LangMark) + + s.Res.Quiz.Contact = info.Contact + s.Res.Quiz.ReceiveType = info.ReceiveType + + kvData := info.KvData + s.Res.Quiz.KvData = make([]*pb.PlayRes_KV, 0, len(kvData)) + for _, v := range kvData { + s.Res.Quiz.KvData = append(s.Res.Quiz.KvData, &pb.PlayRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + + } + + return + }) + + return +} + +func (s *Play) _slotMachine(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + flip, err := players.NewSlot(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = flip.SetInit() + if err != nil { + return + } + + err = flip.Sign() + if err != nil { + return + } + + player := flip.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _luckyGrid(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + grid, err := players.NewGrid(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = grid.SetInit() + if err != nil { + return + } + + err = grid.Sign() + if err != nil { + return + } + + player := grid.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _blindBox(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + blind, err := players.NewBlind(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = blind.SetInit() + if err != nil { + return + } + + err = blind.Sign() + if err != nil { + return + } + + player := blind.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _flip(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + flip, err := players.NewFlip(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = flip.SetInit() + if err != nil { + return + } + + err = flip.Sign() + if err != nil { + return + } + + player := flip.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _prizeAnswer(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + qa, err := players.NewQa(s.Ctx, user, cpn.FissionID, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = qa.SetInit() + if err != nil { + return + } + + err = qa.Sign() + if err != nil { + return + } + + player := qa.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _signIn(user *model.FissionUser) (err error) { + sign, err := players.NewSign(s.Ctx, user) + if err != nil { + return + } + + player := sign.GetPlayer() + status, err := sign.GetStatus() + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + + s.Res.Sign = &pb.PlayRes_Sign{ + Id: player.ID, + SignDay: player.SignDay, + ContinueDay: player.SignContinue, + InviteNum: status.DirectNum, + CardNum: player.CardNum, + MaxContinue: status.MaxContinue, + TodaySign: status.TodaySign, + CycleDay: status.CycleDay, + } + + return + }) + + return +} + +func (s *Play) _dice(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + dice, err := players.NewDice(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = dice.SetInit() + if err != nil { + return + } + + err = dice.Sign() + if err != nil { + return + } + + status, err := dice.Status() + if err != nil { + return + } + + player := dice.GetPlayer() + defer func() { + s.taskChance = player.TaskChance + }() + + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(user) + if err != nil { + return + } + + var brIds []int64 + for _, v := range rewards { + brIds = append(brIds, v.RewardID) + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, brIds...) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Dice = &pb.PlayRes_Dice{ + Id: player.ID, + Chance: player.Chance, + MapHashId: status.Run.MapHashID, + PropsChance: status.PropMap[mtype.FissionDicePropMarkChance], + PropsFixedRoll: status.PropMap[mtype.FissionDicePropMarkFixedRoll], + Collects: make([]*pb.PlayRes_Collect, 0, len(rewards)), + InviteNum: status.Stat.DirectNum, + FixedRollTaskFinish: status.FixedRollTaskFinish, + DmgId: status.Run.ID, + } + + for _, reward := range rewards { + info := preward.AutoLang(reward.RewardID, user.LangMark) + one := &pb.PlayRes_Collect{ + Id: reward.ID, + Num: status.CollectMap[reward.ID], + CollectNum: reward.CollectNum, + RewardTitle: info.Title, + ImgUrl: info.ImgUrl, + IsSuper: int32(reward.IsSuper), + } + + s.Res.Dice.Collects = append(s.Res.Dice.Collects, one) + } + + return + }) + + return +} + +func (s *Play) _diceDayChance(user *model.FissionUser, dayChance int32) (err error) { + if dayChance == 0 { + return + } + + // 看看需不需要骰子记录 + record := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + Mark: mtype.FissionDiceRecordMarkSign, + }) + + record.SetData(&mtype.DiceRecord{ + Chance: dayChance, + }) + + err = s.GetDao().FissionDiceRecord.WithContext(s.Ctx).Create(record) + if err != nil { + err = s.BE().MysqlError(err) + } + + return +} + +func (s *Play) _grow(user *model.FissionUser) (err error) { + + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionGrow(user) + if err != nil { + return + } + + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.Ctx).Where(statM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + now := carbon.Now() + next := carbon.CreateFromTimestamp(player.PropsTime) + + s.Res.Grow = &pb.PlayRes_Grow{ + Id: player.ID, + GrowNum: player.GrowNum, + InviteNum: stat.DirectNum, + HasProps: utils.Ternary(next.IsZero(), false, next.Lt(now)), + NextProps: utils.Ternary[int64](next.Lt(now), 0, now.DiffAbsInSeconds(next)), + } + + return + }) + + return +} + +func (s *Play) _ballot(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + ballot, err := players.NewBallot(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = ballot.SetInit() + if err != nil { + return + } + + err = ballot.Sign() + if err != nil { + return + } + + player := ballot.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} + +func (s *Play) _chop(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + chop, err := players.NewChop(s.Ctx, user) + if err != nil { + return + } + + player := chop.GetPlayer() + + if player.ChopRewardID == 0 { + s.AddAfterRun(func() (err error) { + s.Res.Chop = &pb.PlayRes_Chop{ + Id: player.ID, + } + + return + }) + return + } + + crm := s.GetDao().FissionChopReward + chopReward, err := crm.WithContext(s.Ctx).Where(crm.ID.Eq(player.ChopRewardID)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 是否有可选择的奖品 + canSelect, err := chop.ExistSelectReward() + if err != nil { + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(chopReward.RewardID)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + prewards, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := prewards.AutoLang(reward.RewardID, user.LangMark) + + s.AddAfterRun(func() (err error) { + s.Res.Chop = &pb.PlayRes_Chop{ + Id: player.ID, + ChopRewardId: chopReward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + Percent: chopReward.Percent, + Finish: chopReward.RecordID > 0, + RewardId: reward.ID, + RewardNone: !canSelect, + } + + return + }) + + return +} + +type UserTaskRecordTotal struct { + TaskId int64 `json:"task_id"` + Num int64 `json:"num"` +} + +func (s *Play) _cash(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + cash, err := players.NewCash(s.Ctx, user) + if err != nil { + return + } + + player := cash.GetPlayer() + + hasAgain, err := cash.HasAgain() + if err != nil { + return + } + + var rewards []*pb.PlayRes_GetReward + defer s.AddAfterRun(func() (err error) { + s.Res.Cash = &pb.PlayRes_Cash{ + Id: player.ID, + NextStep: player.NextStep, + Energy: player.Energy, + LotteryNum: int32(player.LotteryNum), + ShowPrice: player.ShowPrice, + ExpiredIn: carbon.NewCarbon().CreateFromTimestamp(player.ExpiredIn).DiffAbsInSeconds(), + Rewards: rewards, + HasAgain: hasAgain, + } + return + }) + + if player.LotteryNum != int8(len(consts.SpinGetId)) { + return + } + + m := s.GetDao().FissionCashRecord + record, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.CashID.Eq(player.ID), m.Type.Eq(mtype.FissionCashRecordTypeReward)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + return + } + + recordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + records, err := recordM.WithContext(s.Ctx).Where(recordM.ID.In(record.GetDataReward().Ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds, brIds []int64 + for _, v := range records { + brIds = append(brIds, v.BaseRewardID) + rewardIds = append(rewardIds, v.RewardID) + } + + rewardM := s.GetDao().FissionCampaignReward + rewardList, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var jumpUrlMap = make(map[int64]string, len(rewardList)) + for _, v := range rewardList { + jumpUrlMap[v.ID] = v.JumpURL + } + + preward, _ := provider.NewRewards(s.Ctx, cpn.ProjectID, brIds...) + for _, v := range records { + info, _ := preward.InfoAutoLang(v.BaseRewardID, user.LangMark) + + one := &pb.PlayRes_GetReward{ + HashId: v.HashID, + Title: info.Title, + Img: info.ImgUrl, + JumpUrl: jumpUrlMap[v.RewardID], + KvData: nil, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + CreatedAt: v.CreatedAt, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + } + + for _, datum := range info.KvData { + one.KvData = append(one.KvData, &pb.PlayRes_KV{ + Key: datum.Key, + Value: datum.Value, + }) + } + + rewards = append(rewards, one) + } + + return +} + +// 最后签到 +func (s *Play) _lastSign(lastSign string) (ok bool, day string) { + // 带时区的签到 + day, _, _ = timez.GMTStartAndEndTs(s.cpnControl.GetTz()) + day = strings.ReplaceAll(day, "-", "") + if lastSign == "" || day > lastSign { + return true, day + } + + return false, lastSign +} + +// 通知 +func (s *Play) clue(user *model.FissionUser) { + clueProvider := provider.NewFissionClue(s.Ctx, user.ID) + + chance := clueProvider.GetChance() + + if chance > 0 { + s.Res.Clue = append(s.Res.Clue, &pb.PlayRes_Clue{ + Type: 1, + Chance: chance, + }) + } + + preCond := clueProvider.GetPreCond() + if preCond > 0 { + s.Res.Clue = append(s.Res.Clue, &pb.PlayRes_Clue{ + Type: 2, + PreCond: preCond, + }) + } + + return +} + +func (s *Play) _keep(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + tz := provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + start, _ := timez.GMTTimeStart(tz.GetTz()) + + keepDog, err := players.NewKeepDog(s.Ctx, user) + if err != nil { + return + } + + status, err := keepDog.GetStatus() + if err != nil { + return + } + + player := keepDog.GetPlayer() + + s.Res.KeepDog = &pb.PlayRes_Keep{ + Id: player.ID, + Percent: status.Percent, + Num: player.Num, + MachineNum: player.MachineNum, + FeedLack: status.PropNeedFeed, + Collect: player.Collect, + SecondPercent: status.SecondPercent, + ExpiredSec: player.ExpiredAt - time.Now().Unix(), + Reward: nil, + LeftCollect: status.Left, + Guided: int32(player.Guided), + DayFirstInvite: status.DayFirstInvite, + DayFirstExpiredSec: start.Unix() - time.Now().Unix() + 86400, + MachineLimit: status.MachineLimit, + OfflineFull: status.OfflineFull, + } + + if player.RewardID == 0 { + return + } + + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(player.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = s.BE().VerifyError("not found reward") + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := preward.AutoLang(reward.RewardID, user.LangMark) + s.Res.KeepDog.Reward = &pb.PlayRes_KeepReward{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + RecordId: player.RecordID, + } + + return +} + +// 金币任务玩家 +func (s *Play) _gold(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + gold, err := players.NewGold(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + player, conf := gold.GetPlayer(), gold.GetConf() + clue := provider.NewFissionClue(s.Ctx, user.ID).GetGold() + + s.Res.Gold = &pb.PlayRes_Gold{ + Id: player.ID, + NextStep: player.NextStep, + Energy: player.Energy, + ShowPrice: player.ShowPrice, + ExpiredIn: carbon.NewCarbon().CreateFromTimestamp(player.ExpiredIn).DiffAbsInSeconds(), + GoldNum: player.GoldNum - int32(clue.Add), + Rewards: nil, + AddNum: int32(clue.Add), + HideCoins: 0, + } + + if player.GoldNum >= conf.GoldNum && player.NextStep != mtype.FissionGoldNextStepGoldRain { + s.Res.Gold.HideCoins = 1 + + // 做了任务了也不显示加金币 + s.Res.Gold.GoldNum = player.GoldNum + s.Res.Gold.AddNum = 0 + } + + if player.LotteryNum < 2 { + return + } + + m := s.GetDao().FissionGoldLog + record, err := m.WithContext(s.Ctx).Where(m.GoldID.Eq(player.ID), m.Type.Eq(mtype.FissionGoldLogTypeReward)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + return + } + + recordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + records, err := recordM.WithContext(s.Ctx).Where(recordM.ID.In(record.GetVal().RecordIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds, brIds []int64 + for _, v := range records { + brIds = append(brIds, v.BaseRewardID) + rewardIds = append(rewardIds, v.RewardID) + } + + preward, _ := provider.NewRewards(s.Ctx, cpn.ProjectID, brIds...) + for _, v := range records { + info, _ := preward.InfoAutoLang(v.BaseRewardID, user.LangMark) + + one := &pb.PlayRes_GetReward{ + HashId: v.HashID, + Title: info.Title, + Img: info.ImgUrl, + JumpUrl: "", + KvData: nil, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + CreatedAt: v.CreatedAt, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + } + + for _, datum := range info.KvData { + one.KvData = append(one.KvData, &pb.PlayRes_KV{ + Key: datum.Key, + Value: datum.Value, + }) + } + + s.Res.Gold.Rewards = append(s.Res.Gold.Rewards, one) + } + + return +} + +func (s *Play) _coin(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + coin, err := players.NewCoin(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + status, err := coin.GetStatus() + if err != nil { + return + } + + s.Res.Coin = &pb.PlayRes_Coin{ + GetCoin: status.GetCoin, + AllCoin: status.AllCoin, + OpenSec: status.OpenSec, + UseNum: status.UseNum, + CanGet: status.CanGet, + End: status.End, + } + + return +} + +func (s *Play) _vs(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + vs, err := players.NewVs(s.Ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + err = vs.SetInit() + if err != nil { + return + } + + player, conf := vs.GetPlayer(), vs.GetConf() + + s.Res.Vs = &pb.PlayRes_Vs{ + Chance: player.Chance, + } + + m := s.GetDao().FissionVsVoteSettlement + settlements, err := m.WithContext(s.Ctx).Where(m.VsID.Eq(player.ID), m.TipAt.Eq(0)).Find() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range settlements { + rewards, err1 := vs.SettlementReward(v) + if err1 != nil { + return + } + + for _, reward := range rewards { + one := &pb.PlayRes_GetReward{ + HashId: reward.RewardHashId, + Title: reward.Title, + Img: reward.Img, + KvData: make([]*pb.PlayRes_KV, 0, len(reward.KvData)), + ReceiveType: reward.ReceiveType, + Contact: reward.Contact, + CreatedAt: utils.Ternary[int64](v.AcceptAt == 0, time.Now().Unix(), v.AcceptAt), + OpenToUse: reward.OpenToUse, + WebUrl: reward.WebUrl, + AppParam: reward.AppParam, + PcParam: reward.PcParam, + PropMark: reward.PropMark, + RewardNum: reward.PropNum, + RewardId: reward.Id, + } + + for _, datum := range reward.KvData { + one.KvData = append(one.KvData, &pb.PlayRes_KV{ + Key: datum.Key, + Value: datum.Value, + IsShow: datum.IsShow, + }) + } + + s.Res.Vs.WinRewards = append(s.Res.Vs.WinRewards, one) + } + } + + if conf.OpenPoint == mtype.No && conf.MallOpen == mtype.No { + return + } + + s.Res.Vs.CoinNum, err = vs.GetTCoin() + if err != nil { + return + } + + s.Res.Vs.CoinTitle, s.Res.Vs.CoinImg, _, err = cmm.NewCMM(s.Ctx, s.GetDao()).GetCoinInfo(cpn.ProjectID, user.LangMark) + if err != nil { + return + } + + return +} + +func (s *Play) _uno(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + uno, err := players.NewUno(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = uno.SetInit() + if err != nil { + return + } + + cardInfo, err := uno.Cards() + if err != nil { + return + } + + err = uno.Sign() + if err != nil { + return + } + + player := uno.GetPlayer() + + var fn = func(in []*players.UnoCards) (out *pb.PlayRes_UnoGroup) { + out = &pb.PlayRes_UnoGroup{ + CollectNum: 0, + Cards: make([]*pb.PlayRes_UnoCard, 0, len(in)), + } + + for _, card := range in { + out.Cards = append(out.Cards, &pb.PlayRes_UnoCard{ + CardNo: card.CardNo, + CardNum: card.CardNum, + }) + if card.CardNum > 0 { + out.CollectNum++ + } + } + + return + } + + s.Res.Uno = &pb.PlayRes_Uno{ + Chance: player.Chance, + ThreeNum: player.ThreeNum, + FiveNum: player.FiveNum, + FixNum: player.FixNum, + Red: fn(cardInfo[mtype.FissionCampaignUnoGroupRed]), + Blue: fn(cardInfo[mtype.FissionCampaignUnoGroupBlue]), + Green: fn(cardInfo[mtype.FissionCampaignUnoGroupGreen]), + Yellow: fn(cardInfo[mtype.FissionCampaignUnoGroupYellow]), + } + + return +} + +func (s *Play) _gashapon(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + blind, err := players.NewGashapon(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + err = blind.SetInit() + if err != nil { + return + } + + err = blind.Sign() + if err != nil { + return + } + + player := blind.GetPlayer() + + return s._chancePlayer(user, player.Chance) +} diff --git a/internal/service/containers/campaignuser/reward.go b/internal/service/containers/campaignuser/reward.go new file mode 100644 index 0000000..a8af1c8 --- /dev/null +++ b/internal/service/containers/campaignuser/reward.go @@ -0,0 +1,368 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "gorm.io/gen" +) + +type Reward struct { + logic.Logic + Req *pb.RewardReq + Res *pb.RewardRes + + langMark string +} + +func (s *Reward) Run() error { + return logic.Run(s) +} + +func (s *Reward) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + return s.reward(cpn) +} + +// 活动数据 +func (s *Reward) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + tz := utils.STernary(s.Req.GetTOffset(), consts.DefaultTz, cpn.TOffset) + + s.Req.Start = timez.GMT(s.Req.Start, tz) + s.Req.End = timez.GMT(s.Req.End, tz) + + s.Res.TOffset = tz + + return +} + +// 奖品处理 +func (s *Reward) reward(cpn *model.FissionCampaign) (err error) { + + subCpnId, cond, err := s._findCond(cpn) + if err != nil { + return + } + m := s.GetDao().FissionRewardRecord.SubTable(subCpnId) + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err := m.WithContext(s.Ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + s.Res.Total = total + s.Res.List = make([]*pb.RewardRes_One, 0, len(list)) + + if total == 0 { + return + } + + var rewardIds []int64 + var rewardKvMap = make(map[int64][]*mtype.KV) + var userIds []int64 + var userMap = make(map[int64]string) + var brewardIds []int64 + var brewardMap = make(map[int64]*provider.RewardInfo) + var childIds []int64 + var childMap = make(map[int64]string) + for _, v := range list { + if _, ok := userMap[v.UserID]; !ok { + userIds = append(userIds, v.UserID) + userMap[v.UserID] = "" + } + + if v.BaseRewardID == 0 { + if _, ok := rewardKvMap[v.RewardID]; !ok { + rewardKvMap[v.RewardID] = nil + rewardIds = append(rewardIds, v.RewardID) + } + } else { + if _, ok := brewardMap[v.BaseRewardID]; !ok { + brewardMap[v.BaseRewardID] = nil + brewardIds = append(brewardIds, v.BaseRewardID) + } + } + + if _, ok := childMap[v.ChildID]; !ok && v.ChildID > 0 { + childIds = append(childIds, v.ChildID) + childMap[v.ChildID] = "" + } + } + + err = s._fillChildMap(childIds, childMap) + if err != nil { + return + } + + err = s._fillUserMap(subCpnId, userIds, userMap) + if err != nil { + return + } + + if len(rewardIds) > 0 { + err = s._rewardKv(rewardIds, rewardKvMap) + if err != nil { + return + } + } + + var preward *provider.Rewards + if len(brewardIds) > 0 { + preward, err = provider.NewRewards(s.Ctx, cpn.ID, brewardIds...) + if err != nil { + return + } + + brList, err1 := preward.InfoList() + if err1 != nil { + err = err1 + return + } + + for _, info := range brList { + brewardMap[info.Id] = info + } + + } + + for _, v := range list { + + var title = v.Title + + if verify.InArray(cpn.FissionID, consts.IdWinTogether, consts.IdReferral) { + title = fmt.Sprintf("%d %s", v.RewardNum, v.Title) + } + + one := &pb.RewardRes_One{ + SubUserId: userMap[v.UserID], + CreatedTime: v.CreatedAt, + Title: title, + KvData: nil, + Img: v.ImgURL, + IsPush: utils.Ternary[bool](v.Status == mtype.FissionRewardRecordStatusSuccess, true, false), + Id: v.ID, + HashId: v.HashID, + Status: int32(v.Status), + FailType: v.FailType, + FailMsg: v.FailMsg, + RewardTitle: title, + RewardId: v.RewardID, + CustomRewardVal: v.CustomRewardVal, + RewardType: int32(v.RewardType), + ChildTitle: childMap[v.ChildID], + PropMark: v.PropMark, + ChanceMark: consts.FissionPropMark[cpn.FissionID], + RewardNum: v.RewardNum, + } + + if v.Status == mtype.FissionRewardRecordStatusWait && v.CreatedAt+consts.DaySec <= time.Now().Unix() { + one.Status = mtype.FissionRewardRecordStatusFail + one.FailType = mtype.FissionRewardRecordFailTypeSys + one.FailMsg = mtype.FissionRewardRecordFailTypeLongTime + } + + if kvs, ok := rewardKvMap[v.RewardID]; ok && kvs != nil { + one.KvData = make([]*pb.RewardRes_KV, 0, len(kvs)) + for _, v1 := range kvs { + one.KvData = append(one.KvData, &pb.RewardRes_KV{ + Key: v1.Key, + Value: v1.Value, + }) + } + } + + if info, ok := brewardMap[v.BaseRewardID]; ok && info != nil { + one.RewardTitle = info.RewardTitle + one.ReceiveType = info.ReceiveType + one.Contact = info.Contact + one.KvData = make([]*pb.RewardRes_KV, 0, len(info.KvData)) + one.DyRewardType = info.DyRewardType + for _, v1 := range info.KvData { + one.KvData = append(one.KvData, &pb.RewardRes_KV{ + Key: v1.Key, + Value: v1.Value, + IsShow: v1.IsShow, + }) + } + + if s.langMark != "" && preward != nil { + lang := preward.AutoLang(info.Id, s.langMark) + one.Title = lang.Title + one.Img = lang.ImgUrl + one.OpenToUse = lang.OpenToUse + one.WebUrl = lang.WebUrl + one.AppParam = lang.AppParam + one.PcParam = lang.PcParam + } + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +func (s *Reward) _findCond(cpn *model.FissionCampaign) (subCpnId int64, cond []gen.Condition, err error) { + + subCpnId = cpn.ID + if s.Req.GetIsChild() == mtype.Yes { + subCpnId = cpn.Pid + } + + m := s.GetDao().FissionRewardRecord.SubTable(subCpnId) + + if s.Req.GetIsChild() == mtype.Yes { + cond = append(cond, m.CampaignID.Eq(subCpnId), m.ChildID.Eq(cpn.ID)) + } else { + cond = append( + cond, + m.CampaignID.Eq(subCpnId), + m.PropMark.Eq(mtype.FissionCampaignRewardPropMarkReward), + ) + } + + if s.Req.GetFuserId() > 0 { + cond = append(cond, m.UserID.Eq(s.Req.GetFuserId())) + + var user *model.FissionUser + user, err = finder.FissionUser(s.Ctx, subCpnId, s.Req.GetFuserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if user != nil { + s.langMark = user.LangMark + } + } + + if len(s.Req.GetStatus()) > 0 { + var status = make([]int8, 0, len(s.Req.GetStatus())) + for _, v := range s.Req.GetStatus() { + status = append(status, int8(v)) + } + + cond = append(cond, m.Status.In(status...)) + } + + if s.Req.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(s.Req.GetStart())) + } + + if s.Req.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(s.Req.GetEnd())) + } + + if !verify.EmptyString(s.Req.GetUserMark()) { + var userId int64 + var user *model.FissionUser + userM := s.GetDao().FissionUser.SubTable(subCpnId) + user, err = userM.WithContext(s.Ctx).Where(userM.CampaignID.Eq(subCpnId), userM.UserMark.Eq(s.Req.GetUserMark())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user != nil { + userId = user.ID + } + + cond = append(cond, m.UserID.Eq(userId)) + } + + if !verify.EmptyString(s.Req.GetRewardTitle()) { + rewardM := s.GetDao().Reward + var ids []int64 + err = rewardM.WithContext(s.Ctx).Where( + rewardM.ProjectID.Eq(cpn.ProjectID), + rewardM.RewardTitle.Like(utils.DbAllLike(s.Req.GetRewardTitle())), + rewardM.IsDel.Eq(mtype.No), + ).Pluck(rewardM.ID, &ids) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cond = append(cond, m.BaseRewardID.In(ids...)) + } + + return +} + +// 填充活动用户信息 +func (s *Reward) _fillUserMap(cpnId int64, userIds []int64, userMap map[int64]string) (err error) { + if len(userIds) == 0 { + return + } + + m := s.GetDao().FissionUser.SubTable(cpnId) + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(userIds...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + userMap[v.ID] = v.UserMark + } + + return +} + +// 填充子活动信息 +func (s *Reward) _fillChildMap(childIds []int64, childMap map[int64]string) (err error) { + if len(childIds) == 0 { + return + } + + m := s.GetDao().FissionCampaign + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(childIds...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + childMap[v.ID] = v.Title + } + + return +} + +func (s *Reward) _rewardKv(rewardIds []int64, data map[int64][]*mtype.KV) (err error) { + m := s.GetDao().FissionCampaignReward + rewards, err := m.WithContext(s.Ctx).Where(m.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range rewards { + data[v.ID] = v.GetKvData() + } + + return +} diff --git a/internal/service/containers/campaignuser/reward_form.go b/internal/service/containers/campaignuser/reward_form.go new file mode 100644 index 0000000..373d90d --- /dev/null +++ b/internal/service/containers/campaignuser/reward_form.go @@ -0,0 +1,151 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" +) + +type RewardForm struct { + logic.Logic + Req *pb.RewardFormReq + Res *pb.RewardFormRes + + langMark string +} + +func (s *RewardForm) Run() error { + return logic.Run(s) +} + +func (s *RewardForm) Exec() (err error) { + user, err := s.user() + if err != nil { + return + } + + if user.IsView == mtype.Yes { + return s.view() + } + + return s.form(user) +} + +func (s *RewardForm) user() (user *model.FissionUser, err error) { + user, err = finder.FissionUser(s.Ctx, s.Req.GetCampaignId(), s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + return +} + +// 预览用户表单 +func (s *RewardForm) view() (err error) { + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.GetCampaignId()), m.ID.Eq(s.Req.GetRewardId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = workerr.NotFound("not found reward") + return + } + + breward, err := cache.NewReward(s.Ctx).FindById(reward.RewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return s._res(false, breward.FormID, reward.ID, 0, nil) +} + +// 正常用户表单 +func (s *RewardForm) form(user *model.FissionUser) (err error) { + m := s.GetDao().FissionRewardRecord.SubTable(user.CampaignID) + record, err := m.WithContext(s.Ctx).Where(m.HashID.Eq(s.Req.GetRewardHashId()), m.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + err = workerr.NotFound("not found record") + return + } + + if record.Status == mtype.FissionRewardRecordStatusSubmitForm { + rfm := s.GetDao().FissionRewardRecordForm + var recordForm *model.FissionRewardRecordForm + recordForm, err = rfm.WithContext(s.Ctx).Where(rfm.RecordID.Eq(record.ID)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return s._res(true, recordForm.FormID, record.RewardID, record.ID, recordForm.GetItems()) + } + + breward, err := cache.NewReward(s.Ctx).FindById(record.BaseRewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if breward.ReceiveType != mtype.RewardReceiveTypeForm || record.Status != mtype.FissionRewardRecordStatusWaitForm { + return + } + + return s._res(false, breward.FormID, record.RewardID, record.ID, nil) +} + +// 结果 +func (s *RewardForm) _res(isSubmit bool, formId, rewardId, recordId int64, items []*mtype.SubmitFormItem) (err error) { + form, err := cache.NewForm(s.Ctx).FindById(formId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.Res.IsSubmit = isSubmit + s.Res.Title = form.Title + s.Res.Id = recordId + s.Res.RewardId = rewardId + + if isSubmit { + s.Res.Items = make([]*pb.RewardFormRes_Item, 0, len(items)) + for _, item := range items { + s.Res.Items = append(s.Res.Items, &pb.RewardFormRes_Item{ + Name: item.Name, + Key: item.Key, + Value: item.Value, + }) + } + + return + } + + for _, v := range form.GetItems() { + s.Res.Items = append(s.Res.Items, &pb.RewardFormRes_Item{ + Name: v.GetTranName(s.Req.GetLangMark()), + Key: v.Name, + Value: "", + }) + } + + return +} diff --git a/internal/service/containers/campaignuser/reward_user.go b/internal/service/containers/campaignuser/reward_user.go new file mode 100644 index 0000000..60ae35c --- /dev/null +++ b/internal/service/containers/campaignuser/reward_user.go @@ -0,0 +1,149 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" +) + +type RewardUser struct { + logic.Logic + Req *pb.RewardUserReq + Res *pb.RewardUserRes +} + +func (s *RewardUser) Run() error { + return logic.Run(s) +} + +func (s *RewardUser) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + return s.rewardUser(cpn) +} + +// 活动数据 +func (s *RewardUser) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId(), s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + return +} + +// 获取到奖品的用户 +func (s *RewardUser) rewardUser(cpn *model.FissionCampaign) (err error) { + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + m, rewardM := s.GetDao().FissionUser.SubTable(cpn.ID), s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + userList, total, err := m.WithContext(s.Ctx). + Join(rewardM, rewardM.UserID.EqCol(m.ID)). + Where(m.CampaignID.Eq(cpn.ID), rewardM.ID.IsNotNull(), rewardM.PropMark.Eq(mtype.FissionCampaignRewardPropMarkReward)). + FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + if total == 0 { + return + } + + s.Res.Total = total + s.Res.List = make([]*pb.RewardUserRes_One, 0, len(userList)) + + var ids []int64 + var parentIds []int64 + var parentMap = make(map[int64]string) + for _, v := range userList { + ids = append(ids, v.ID) + parentMap[v.ID] = v.SubUserID + if _, ok := parentMap[v.ParentID]; !ok { + parentIds = append(parentIds, v.ParentID) + } + } + + var rewardList []*model.FissionRewardRecord + rewardList, err = rewardM.WithContext(s.Ctx).Where(rewardM.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var rewardMap = make(map[int64][]*model.FissionRewardRecord) + for _, v := range rewardList { + rewardMap[v.UserID] = append(rewardMap[v.UserID], v) + } + + statMap := s._statMap(ids) + if len(parentIds) > 0 { + s._parentMap(cpn.ID, parentIds, parentMap) + } + + for _, v := range userList { + one := &pb.RewardUserRes_One{ + SubUserId: v.SubUserID, + PsuId: "", + DirectNum: 0, + IndirectNum: 0, + Rewards: nil, + } + + if psuId, ok := parentMap[v.ID]; ok { + one.PsuId = psuId + } + + if stat, ok := statMap[v.ID]; ok && stat != nil { + one.DirectNum = stat.DirectNum + one.IndirectNum = stat.IndirectNum + } + + if reward, ok := rewardMap[v.ID]; ok { + one.Rewards = make([]*pb.RewardUserRes_Reward, 0, len(reward)) + for _, v1 := range reward { + one.Rewards = append(one.Rewards, &pb.RewardUserRes_Reward{ + CreatedTime: v1.CreatedAt, + Title: v1.Title, + }) + } + } + + s.Res.List = append(s.Res.List, one) + } + return +} + +// 统计数据 +func (s *RewardUser) _statMap(userIds []int64) map[int64]*model.FissionUserStat { + m := s.GetDao().FissionUserStat + list, _ := m.WithContext(s.Ctx).Where(m.UserID.In(userIds...)).Find() + + var data = make(map[int64]*model.FissionUserStat) + for _, v := range list { + data[v.UserID] = v + } + + return data +} + +// 上级数据 +func (s *RewardUser) _parentMap(cpnId int64, userIds []int64, data map[int64]string) { + m := s.GetDao().FissionUser.SubTable(cpnId) + list, _ := m.WithContext(s.Ctx).Where(m.ID.In(userIds...)).Find() + + for _, v := range list { + data[v.ID] = v.SubUserID + } + + return +} diff --git a/internal/service/containers/campaignuser/task.go b/internal/service/containers/campaignuser/task.go new file mode 100644 index 0000000..4216190 --- /dev/null +++ b/internal/service/containers/campaignuser/task.go @@ -0,0 +1,984 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "strings" + "time" + + deventpb "gits.branchcn.com/backend/deeplink/proto/go_proto/devent" +) + +type Task struct { + logic.Logic + Req *pb.TaskReq + Res *pb.TaskRes + + cpnControl *provider.CampaignTZ + + lvLimitMap map[int64][]string +} + +func (s *Task) Run() error { + return logic.Run(s) +} + +func (s *Task) Exec() (err error) { + user, cpn, err := s.user() + if err != nil { + return + } + + return s.task(cpn, user) +} + +// 用户信息 +func (s *Task) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + s.cpnControl = provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + return +} + +func (s *Task) _newTask(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + m := s.GetDao().FissionCampaignTicket + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + taskM := s.GetDao().FissionCampaignTask + tasks, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(cpn.ID), + taskM.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var taskMap = make(map[string]*model.FissionCampaignTask, len(tasks)) + for _, task := range tasks { + taskMap[task.TaskMark] = task + } + + for _, v := range list { + switch v.Mark { + case mtype.FissionCampaignTicketCustom: + err = s._custom(user, cpn, v, taskMap) + if err != nil { + return + } + case mtype.FissionCampaignTicketFixed: + err = s._fixed(v, taskMap) + if err != nil { + return + } + } + } + + return +} + +func (s *Task) _custom(user *model.FissionUser, cpn *model.FissionCampaign, ticket *model.FissionCampaignTicket, taskMap map[string]*model.FissionCampaignTask) (err error) { + if ticket.Open == mtype.No { + return + } + + m := s.GetDao().FissionCampaignCond + conds, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.IsDel.Eq(mtype.No), + m.RewardID.Eq(0), + ).Order(m.Sort.Desc(), m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + condM := s.GetDao().FissionUserCond + list, err := condM.WithContext(s.Ctx).Where(condM.UserID.Eq(user.ID)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var userCondMap = make(map[int64]*model.FissionUserCond) + for _, v := range list { + userCondMap[v.CondID] = v + } + + // 用户当前语言是配置的语言 + var condLangMap = make(map[int64]*mtype.LangCond) + if verify.InArray[string](user.LangMark, cpn.GetLangMarks()...) { + lang, err1 := cache.NewCampaignLang(s.Ctx).FindByCampaignId(user.CampaignID, user.LangMark) + if err1 != nil { + err = s.BE().CacheError(err1) + return + } + + if lang != nil { + for _, v := range lang.GetConds() { + condLangMap[v.CondId] = v + } + } + } + + var doExp = make(map[int64]struct{}) + var dayExp, weekExp []*model.FissionCampaignTask + var dayLimitTaskIds []int64 // 有每日上限的任务 + var weekLimitTask []*model.FissionCampaignTask // 有每周上限的任务 + var taskIds = make([]int64, 0, len(taskMap)) + var levelLimit = make(map[int64][]int64) + var rewardIds []int64 + var receiveIds []int64 + for _, v := range taskMap { + taskIds = append(taskIds, v.ID) + if v.DayLimit > 0 { + dayLimitTaskIds = append(dayLimitTaskIds, v.ID) + if _, ok := doExp[v.ID]; !ok { + dayExp = append(dayExp, v) + doExp[v.ID] = struct{}{} + } + } + + if v.WeekLimit > 0 { // 这个一定要放在dayLimit 后面,因为doExp的顺序是 day > week + weekLimitTask = append(weekLimitTask, v) + if _, ok := doExp[v.ID]; !ok { + weekExp = append(weekExp, v) + doExp[v.ID] = struct{}{} + } + } + + if v.LevelLimit != "" { + levelLimit[v.ID] = v.GetLevelLimit() + } + + if v.RewardID > 0 { + rewardIds = append(rewardIds, v.RewardID) + } + + if v.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + receiveIds = append(receiveIds, v.ID) + } + + } + + // 完成任务获得的总次数 + var sumNum struct { + Num int32 + } + + taskM := s.GetDao().FissionUserTaskRecord + err = taskM.WithContext(s.Ctx). + Select(taskM.Chance.Sum().As("num")). + Where( + taskM.UserID.Eq(user.ID), + taskM.TaskID.In(taskIds...), + taskM.LimitProp.Eq(mtype.No), + ).Scan(&sumNum) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 全部任务完成的任务完成次数 + btAllFinish, err := s._btAllFinish(user, ticket, taskMap) + if err != nil { + return + } + + // 当天任务完成次数 + taskDayCount, err := s._taskDayCount(user, dayLimitTaskIds) + if err != nil { + return + } + + // 周任务完成次数 + taskWeekCount, err := s._taskWeekCount(user, weekLimitTask) + if err != nil { + return + } + + // 任务过期重置 + err = s._condExp(ticket.BothType, dayExp, weekExp, userCondMap) + if err != nil { + return + } + + // 任务限制 + err = s._levelLimit(levelLimit) + if err != nil { + return + } + + // 有前置任务 + preCond, err := s._preCond(user) + if err != nil { + return + } + + // 是否有领奖任务 + receiveMap, err := s._receive(user, receiveIds) + if err != nil { + return + } + + // 奖品 + rewardMap, err := s._reward(cpn.ProjectID, user.LangMark, rewardIds) + if err != nil { + return + } + + var projectId int64 + var condExtra = make(map[string]*deventpb.GetCustomEventListRes_Info) + var events []string + for _, v := range conds { + events = append(events, v.Event) + projectId = v.ProjectID + } + + if len(events) > 0 { + res, _ := app.NewDeepLinkEvent().GetCustomEventList(s.Ctx, &deventpb.GetCustomEventListReq{ + ProjectId: projectId, + EventKeyList: events, + LangMark: user.LangMark, + }) + for _, v := range res.GetList() { + condExtra[v.GetEventKey()] = v + } + } + + s.Res.Custom = &pb.TaskRes_Custom{ + Open: int32(ticket.Open), + BothType: int32(ticket.BothType), + Chance: sumNum.Num, + Cond: make([]*pb.TaskRes_Cond, 0, len(conds)), + BothAll: nil, + } + + for _, v := range conds { + var one = &pb.TaskRes_Cond{ + Id: v.ID, + Desc: v.Desc, + Num: 0, + IfCond: int32(v.IfCond), + Total: "", + Event: v.Event, + EventKey: v.EventKey, + EventVal: v.EventVal, + TaskChance: 0, + TaskLimit: 0, + CanDo: false, + WebUrl: v.WebURL, + AppParam: v.ExtraParam, + TomorrowCanDo: false, + EventType: int32(v.EventType), + ViewType: int32(v.ViewType), + WeekCanDo: 0, + WeekNum: 0, + GoShow: int32(v.GoShow), + AdsStrategyId: v.AdsStrategyID, + IsSuper: int32(v.IsSuper), + HasPre: 0, + Reward: nil, + PropMark: "", + ExpiredSec: 0, + PcParam: v.PcParam, + TaskId: 0, + HasReceive: 0, + TriggerType: int32(v.TriggetType), + GoText: v.GoText, + ClickEffectOpen: int32(v.ClickEffectOpen), + ClickEffect: v.ClickEffect, + ClickEffectUnit: v.ClickEffectUnit, + PullInvite: int32(v.PullInvite), + } + if condLang, ok := condLangMap[v.ID]; ok { + one.Desc = condLang.Desc + one.GoText = condLang.GoText + } + + if userCond, ok := userCondMap[v.ID]; ok { + one.Num = userCond.Num + one.Total = userCond.Total + } + + if v.OpenJump == mtype.Yes { + if condLang, ok := condLangMap[v.ID]; ok { + one.WebUrl = condLang.WebURL + one.AppParam = condLang.ExtraParam + one.PcParam = condLang.PcParam + } + } else { + if param, ok := condExtra[v.Event]; ok { + one.WebUrl = param.WebUrl + one.AppParam = param.ExtraParam + one.PcParam = param.PcParam + } + } + + if ticket.BothType == mtype.FissionCampaignTicketBothTypeAll { + if task, ok := taskMap[mtype.FissionCampaignTaskMarkCondAll]; ok { + if s._beLevelLimit(task.ID, user.LevelMark) { + continue + } + //语言限制 + if lm := task.GetLangMarks(); len(lm) > 0 && !verify.InArray(user.LangMark, lm...) { + continue + } + + one.CanDo, one.TomorrowCanDo, one.WeekCanDo = s._taskDo(task, btAllFinish, taskDayCount[task.ID], taskWeekCount[task.ID]) + one.WeekNum = int32(task.WeekNum) + one.TaskId = task.ID + one.HasReceive = receiveMap[task.ID] + } + } else { + if task, ok := taskMap[utils.FissionCampaignTaskMarkCondOneVal(v.ID)]; ok { + if s._beLevelLimit(task.ID, user.LevelMark) { + continue + } + + //语言限制 + if lm := task.GetLangMarks(); len(lm) > 0 && !verify.InArray(user.LangMark, lm...) { + continue + } + + // 需要前置任务 + if task.HasPre == mtype.Yes { + if exp, ok1 := preCond[task.PreCond]; !ok1 { + s.Res.PreCond = append(s.Res.PreCond, task.PreCond) + continue + } else if exp > 0 && exp <= time.Now().Unix() { + continue + } else { + one.ExpiredSec = exp - time.Now().Unix() + } + } + + one.HasPre = int32(task.HasPre) + one.TaskChance = task.Chance + one.TaskLimit = task.TaskLimit + one.CanDo, one.TomorrowCanDo, one.WeekCanDo = s._taskDo(task, one.Num, taskDayCount[task.ID], taskWeekCount[task.ID]) + one.WeekNum = int32(task.WeekNum) + one.Reward = rewardMap[task.RewardID] + one.PropMark = task.PropMark + one.TaskId = task.ID + one.HasReceive = receiveMap[task.ID] + } + } + + s.Res.Custom.Cond = append(s.Res.Custom.Cond, one) + } + + if ticket.BothType == mtype.FissionCampaignTicketBothTypeAll { + if task, ok := taskMap[mtype.FissionCampaignTaskMarkCondAll]; ok { + + s.Res.Custom.BothAll = &pb.TaskRes_BothAll{ + TaskChance: task.Chance, + TaskLimit: task.TaskLimit, + Finish: btAllFinish, + Reward: rewardMap[task.RewardID], + PropMark: task.PropMark, + } + } + } + + return +} + +// 周任务完成次数 +func (s *Task) _taskWeekCount(user *model.FissionUser, weekLimitTask []*model.FissionCampaignTask) (taskWeekCount map[int64]int64, err error) { + taskWeekCount = make(map[int64]int64, len(weekLimitTask)) + if len(weekLimitTask) == 0 { + return + } + + for _, task := range weekLimitTask { + start, end := timez.GetWeekEnd(s.cpnControl.GetTz(), int32(task.WeekNum)) + key := ckey.FissionUserWeekLimit(start, user.ID, task.ID) + taskWeekCount[task.ID], err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + taskRecordM := s.GetDao().FissionUserTaskRecord + return taskRecordM.WithContext(s.Ctx).Where( + taskRecordM.UserID.Eq(user.ID), + taskRecordM.TaskID.Eq(task.ID), + taskRecordM.CreatedAt.Between(start, end), + ).Count() + }) + } + + return +} + +// 当天任务完成次数 +func (s *Task) _taskDayCount(user *model.FissionUser, dayLimitTaskIds []int64) (taskDayCount map[int64]int64, err error) { + taskDayCount = make(map[int64]int64, len(dayLimitTaskIds)) + if len(dayLimitTaskIds) == 0 { + return + } + + day, start, end := timez.GMTStartAndEndTs(s.cpnControl.GetTz()) + for _, taskId := range dayLimitTaskIds { + key := ckey.FissionUserTaskDayLimit(day, user.ID, taskId) + taskDayCount[taskId], err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + taskRecordM := s.GetDao().FissionUserTaskRecord + return taskRecordM.WithContext(s.Ctx).Where( + taskRecordM.UserID.Eq(user.ID), + taskRecordM.TaskID.Eq(taskId), + taskRecordM.CreatedAt.Gte(start), + taskRecordM.CreatedAt.Lte(end), + ).Count() + }) + } + + return +} + +func (s *Task) _condExp(bothType int8, dayExp, weekExp []*model.FissionCampaignTask, userCondMap map[int64]*model.FissionUserCond) (err error) { + // 把要过期的 + + if bothType == mtype.FissionCampaignTicketBothTypeAll { + var start, end int64 + if len(dayExp) > 0 { + _, start, end = timez.GMTStartAndEndTs(s.cpnControl.GetTz()) + } else if len(weekExp) > 0 { + start, end = timez.GetWeekEnd(s.cpnControl.GetTz(), int32(weekExp[0].WeekNum)) + } + + if start == 0 { + return + } + + condM := s.GetDao().FissionUserCond + for _, cond := range userCondMap { + if cond.TotalExp >= start { + continue + } + _, err = condM.WithContext(s.Ctx).Where( + condM.ID.Eq(cond.ID), + condM.UpdatedAt.Eq(cond.UpdatedAt), + condM.TotalExp.Gt(0), + ).UpdateSimple( + condM.TotalExp.Value(end), + condM.Total.Value(""), + condM.CountNum.Value(0), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return + } + + // 任一任务完成的处理 + condM := s.GetDao().FissionUserCond + for _, task := range dayExp { + condId := utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark) + var start, end int64 + if len(dayExp) > 0 { + _, start, end = timez.GMTStartAndEndTs(s.cpnControl.GetTz()) + } else if len(weekExp) > 0 { + start, end = timez.GetWeekEnd(s.cpnControl.GetTz(), int32(weekExp[0].WeekNum)) + } + + if start == 0 { + continue + } + + cond, ok := userCondMap[condId] + if !ok || cond.TotalExp >= start { + continue + } + + _, err = condM.WithContext(s.Ctx).Where( + condM.ID.Eq(cond.ID), + condM.UpdatedAt.Eq(cond.UpdatedAt), + condM.TotalExp.Gt(0), + ).UpdateSimple( + condM.TotalExp.Value(end), + condM.Total.Value(""), + condM.CountNum.Value(0), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + } + + return +} + +// 完成所有任务的任务完成次数 +func (s *Task) _btAllFinish(user *model.FissionUser, ticket *model.FissionCampaignTicket, taskMap map[string]*model.FissionCampaignTask) (btAllFinish int64, err error) { + if ticket.BothType != mtype.FissionCampaignTicketBothTypeAll { + return + } + task, ok := taskMap[mtype.FissionCampaignTaskMarkCondAll] + if !ok { + return + } + + key := ckey.FissionUserTaskCpnLimit(user.ID, task.ID) + btAllFinish, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + taskRecordM := s.GetDao().FissionUserTaskRecord + return taskRecordM.WithContext(s.Ctx).Where(taskRecordM.UserID.Eq(user.ID), taskRecordM.TaskID.Eq(task.ID)).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + return +} + +func (s *Task) _taskDo(task *model.FissionCampaignTask, taskDoneNum, dayDoneNum, weekDoneNum int64) (canDo, tomorrowDo bool, weekDo int32) { + canDo = true + + // 总限制 + if task.TaskLimit > 0 && int64(task.TaskLimit) <= taskDoneNum { // 任务总限制不能做了 + canDo = false + return + } + + if task.WeekLimit > 0 && int64(task.WeekLimit) <= weekDoneNum { // 有周限制,本周不能做了 + canDo = false + + t, _ := timez.GMTTimeStart(s.cpnControl.GetTz()) + w := utils.Ternary[int32](t.Weekday() == 0, 7, int32(t.Weekday())) // 本周的周几 + + // 1-下周再来,2-周几再来 + weekDo = utils.Ternary[int32](w >= int32(task.WeekNum), 1, 2) + + return + } + + if task.DayLimit > 0 && int64(task.DayLimit) <= dayDoneNum { // 有每日限制,今天不能做了 + canDo, tomorrowDo = false, true + return + } + + return +} + +func (s *Task) _fixed(ticket *model.FissionCampaignTicket, taskMap map[string]*model.FissionCampaignTask) (err error) { + if ticket.Open == mtype.No { + return + } + + var task *model.FissionCampaignTask + switch ticket.AppEvent { + case mtype.FissionCampaignTicketAppEventRegister: + task = taskMap[mtype.FissionCampaignTaskMarkRegister] + case mtype.FissionCampaignTicketAppEventInstall: + task = taskMap[mtype.FissionCampaignTaskMarkInstall] + } + + if task == nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Fixed = &pb.TaskRes_Fixed{ + Open: int32(ticket.Open), + AppEvent: int32(ticket.AppEvent), + TargetNum: task.Num, + Chance: task.Chance, + ChanceLimit: task.ChanceLimit, + CanDo: true, + } + + return + }) + + return +} + +// 任务 +func (s *Task) task(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + if !consts.NewEventCpn(cpn.FissionID) { + return s._oldTask(cpn, user) + } + + err = s._newTask(cpn, user) + if err != nil { + return + } + + return s._day(cpn) +} + +// 兼容未升级的活动数据 +func (s *Task) _oldTask(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if !verify.InArray(conf.Option, mtype.FissionCampaignConfigTargetOptionUse, mtype.FissionCampaignConfigTargetOptionSelf, mtype.FissionCampaignConfigTargetOptionFriend) { + return + } + + m := s.GetDao().FissionCampaignCond + conds, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + condM := s.GetDao().FissionUserCond + list, err := condM.WithContext(s.Ctx).Where(condM.UserID.Eq(user.ID)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var userCondMap = make(map[int64]*model.FissionUserCond) + for _, v := range list { + userCondMap[v.CondID] = v + } + + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.Ctx).Where(statM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + // 用户当前语言是配置的语言 + var condLangMap = make(map[int64]string) + if verify.InArray(user.LangMark, cpn.GetLangMarks()[1:]...) { + lang, err1 := cache.NewCampaignLang(s.Ctx).FindByCampaignId(user.CampaignID, user.LangMark) + if err1 != nil { + err = s.BE().CacheError(err1) + return + } + + if lang != nil { + for _, v := range lang.GetConds() { + condLangMap[v.CondId] = v.Desc + } + } + } + + s.AddAfterRun(func() (err error) { + + s.Res.Custom = &pb.TaskRes_Custom{ + Open: 1, + BothType: int32(conf.BothType), + Chance: 0, + Cond: make([]*pb.TaskRes_Cond, 0, len(conds)), + BothAll: nil, + } + + for _, v := range conds { + one := &pb.TaskRes_Cond{ + Id: v.ID, + Desc: v.Desc, + IfCond: int32(v.IfCond), + Event: v.Event, + EventKey: v.EventKey, + EventVal: v.EventVal, + TaskChance: 0, + TaskLimit: 0, + CanDo: true, + } + if desc, ok := condLangMap[v.ID]; ok { + one.Desc = desc + } + + if userCond, ok := userCondMap[v.ID]; ok { + one.Num = userCond.Num + one.Total = userCond.Total + } + + s.Res.Custom.Cond = append(s.Res.Custom.Cond, one) + } + + if conf.BothType == mtype.FissionCampaignTicketBothTypeAll { + var bothAll = &pb.TaskRes_BothAll{ + TaskChance: 1, + } + if stat != nil { + bothAll.Finish = stat.TargetNum + } + + s.Res.Custom.BothAll = bothAll + } + + return + }) + + return +} + +// 每日任务 +func (s *Task) _day(cpn *model.FissionCampaign) (err error) { + + var chance int32 + switch cpn.FissionID { + case consts.IdDice: + m := s.GetDao().FissionCampaignDice + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + case consts.IdBlindBox: + m := s.GetDao().FissionCampaignBlind + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + case consts.IdSlotMachine: + m := s.GetDao().FissionCampaignSlot + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + case consts.IdLuckyGrid: + m := s.GetDao().FissionCampaignGrid + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + case consts.IdPrizeWheel: + m := s.GetDao().FissionCampaignWheel + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + case consts.IdFlip: + m := s.GetDao().FissionCampaignFlip + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + case consts.IdQa, consts.IdQaVideo, consts.IdQaAudio, consts.IdPrizeAnswer: + m := s.GetDao().FissionCampaignQa + conf, err1 := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if conf != nil { + chance = conf.DayChance + } + default: + + } + + s.AddAfterRun(func() (err error) { + s.Res.FixDay = &pb.TaskRes_Day{ + Open: utils.Ternary[int32](chance > 0, 1, 0), + Chance: chance, + CanDo: true, + } + + return + }) + + return +} + +// 用户等级限制 +func (s *Task) _levelLimit(taskLvIdMap map[int64][]int64) (err error) { + + var titleMap = make(map[int64]string) + var ids []int64 + for _, lvIds := range taskLvIdMap { + for _, lvId := range lvIds { + if _, ok := titleMap[lvId]; !ok { + titleMap[lvId] = "" + ids = append(ids, lvId) + } + } + } + + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...), m.DeletedAt.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + titleMap[v.ID] = v.Mark + } + + s.lvLimitMap = make(map[int64][]string) + for id, lvIds := range taskLvIdMap { + for _, lvId := range lvIds { + s.lvLimitMap[id] = append(s.lvLimitMap[id], titleMap[lvId]) + } + } + + return +} + +// 是不是等级限制 +func (s *Task) _beLevelLimit(taskId int64, levelMark string) bool { + marks, ok := s.lvLimitMap[taskId] + if !ok { + return false + } //没有证明没开限制 + + return !verify.OneInArray(marks, strings.Split(levelMark, ",")) +} + +// 前置任务 +func (s *Task) _preCond(user *model.FissionUser) (doneMap map[int32]int64, err error) { + m := s.GetDao().FissionUserPreCond + list, err := m.WithContext(s.Ctx).Select(m.PreCond, m.ExpiredAt).Where(m.UserID.Eq(user.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + doneMap = make(map[int32]int64, len(list)) + for _, v := range list { + doneMap[v.PreCond] = v.ExpiredAt + } + + return +} + +// 当天任务完成次数 +func (s *Task) _reward(projectId int64, langMark string, rewardIds []int64) (rewardMap map[int64]*pb.TaskRes_Reward, err error) { + rewardMap = make(map[int64]*pb.TaskRes_Reward, len(rewardIds)) + if len(rewardIds) == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var hasPoint bool + var bIds []int64 + for _, v := range list { + bIds = append(bIds, v.RewardID) + if !hasPoint && v.PropMark == mtype.FissionCampaignTaskPropMarkPoint { + hasPoint = true + } + } + + var pointTitle, pointImg string + if hasPoint { + pointTitle, pointImg, _, _ = cmm.NewCMM(s.Ctx, s.GetDao()).GetCoinInfo(projectId, langMark) + } + + bewards, err := provider.NewRewards(s.Ctx, projectId, bIds...) + if err != nil { + return + } + + for _, v := range list { + + one := &pb.TaskRes_Reward{ + Id: v.ID, + } + + switch v.PropMark { + case mtype.FissionCampaignTaskPropMarkPoint: + one.Title, one.ImgUrl = pointTitle, pointImg + case mtype.FissionCampaignTaskPropMarkReward: + info, _ := bewards.InfoAutoLang(v.RewardID, langMark) + one.Title, one.ImgUrl = info.Title, info.ImgUrl + } + + rewardMap[v.ID] = one + } + + return +} + +func (s *Task) _receive(user *model.FissionUser, taskIds []int64) (receiveMap map[int64]int32, err error) { + receiveMap = make(map[int64]int32, len(taskIds)) + + if len(taskIds) == 0 { + return + } + + for _, id := range taskIds { + receiveMap[id] = 0 + } + + m := s.GetDao().FissionUserTaskReward + list, err := m.WithContext(s.Ctx).Select(m.TaskID).Where(m.UserID.Eq(user.ID), m.ReceiveTime.Eq(0), m.TaskID.In(taskIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + receiveMap[v.TaskID] = 1 + } + + return +} diff --git a/internal/service/containers/campaignuser/uno_rand_card.go b/internal/service/containers/campaignuser/uno_rand_card.go new file mode 100644 index 0000000..7f34d1d --- /dev/null +++ b/internal/service/containers/campaignuser/uno_rand_card.go @@ -0,0 +1,113 @@ +package campaignuser + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/utils/logic" + + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" +) + +type UnoRandCard struct { + logic.Logic + Req *pb.UnoRandCardReq + Res *pb.UnoRandCardRes + + cpnControl *provider.CampaignTZ + + lvLimitMap map[int64][]string +} + +func (s *UnoRandCard) Run() error { + return logic.Run(s) +} + +func (s *UnoRandCard) Exec() (err error) { + user, cpn, err := s.user() + if err != nil { + return + } + + return s.rand(cpn, user) +} + +// 用户信息 +func (s *UnoRandCard) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + s.cpnControl = provider.NewCampaignTZ(s.Ctx, cpn, user.LangMark) + + return +} + +func (s *UnoRandCard) rand(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + if s.Req.GetPropMark() == "" { + return s._collect(cpn, user) + } + + return s._useProp(cpn, user) +} + +func (s *UnoRandCard) _useProp(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + player, err := players.NewUno(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + status, cards, err := player.UseProp(s.Req.GetPropMark(), s.Req.GetColorMark()) + if err != nil { + return + } + + s.Res.Status = status + s.Res.Cards = make([]*pb.UnoRandCardRes_Card, 0, len(cards)) + + for _, card := range cards { + s.Res.Cards = append(s.Res.Cards, &pb.UnoRandCardRes_Card{ + Mark: card.Mark, + CardNo: card.CardNo, + }) + } + + return +} + +func (s *UnoRandCard) _collect(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + player, err := players.NewUno(s.Ctx, user, players.SetCpn(cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + status, card, err := player.Collect() + if err != nil { + return + } + + if card != nil { + s.Res.Cards = append(s.Res.Cards, &pb.UnoRandCardRes_Card{ + Mark: card.Mark, + CardNo: card.CardNo, + }) + } + + s.Res.Status = status + return +} diff --git a/internal/service/containers/campaignuser/visit.go b/internal/service/containers/campaignuser/visit.go new file mode 100644 index 0000000..ca3f4ab --- /dev/null +++ b/internal/service/containers/campaignuser/visit.go @@ -0,0 +1,441 @@ +package campaignuser + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/pusher" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "strings" + "time" + + c_fuserpb "gits.branchcn.com/backend/certified/proto/go_proto/c_fuser" + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" + linkpb "gits.branchcn.com/backend/shortlink/proto/go_proto/link" +) + +type Visit struct { + logic.Logic + Req *pb.VisitReq + Res *pb.VisitRes + + clearUser bool // 是否已经清楚的用户缓存 + + changeLangMark, changeLvMark bool //一些数据是否有被更改 + + cpnControl *provider.CampaignTZ + + wbu *model.FissionWebUser + + device *ddevicepb.FindBlackboxRes +} + +func (s *Visit) Run() error { + return logic.Run(s) +} + +func (s *Visit) Exec() (err error) { + cpn, channel, err := s.campaign() + if err != nil { + return + } + + user, err := s.user(cpn, channel) + if err != nil { + return + } + + err = s.setLink(cpn, channel, user) + if err != nil { + return + } + + err = s.token(cpn, user) + if err != nil { + return + } + + return s.track(cpn, user) +} + +func (s *Visit) campaign() (cpn *model.FissionCampaign, channel *model.FissionCampaignChannel, err error) { + + cpn, err = finder.Campaign(s.Ctx, s.Req.GetHid()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + err = s._cert(cpn.ProjectID) + if err != nil { + return + } + + // 用户要绑定的渠道 + channel, err = cmm.NewCMM(s.Ctx, s.GetDao()).UserBindChannel(cpn.ID, s.Req.GetCid()) + if err != nil { + return + } + + if s.Req.GetLang() == "" { + s.Req.Lang = cpn.GetLangMarks()[0] + } + + if s.Req.GetWid() != "" { + s.wbu, err = cache.NewFissionWebUser(s.Ctx).FindByWebId(cpn.ID, s.Req.GetWid()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + s.cpnControl = provider.NewCampaignTZ(s.Ctx, cpn, s.Req.Lang) + + err = s._hasParent(cpn) + if err != nil { + return + } + + return +} + +func (s *Visit) user(cpn *model.FissionCampaign, channel *model.FissionCampaignChannel) (user *model.FissionUser, err error) { + defer func() { + if err == nil && user != nil && user.IsView != mtype.Yes { + s.Res.HasParent = user.ParentID > 0 + } + + if err == nil && user != nil && s.wbu == nil { + s.wbu, err = cache.NewFissionWebUser(s.Ctx).FindByUserId(cpn.ID, user.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + }() + + pfu := provider.NewFissionUser(s.Ctx, cpn, channel) + user, err = pfu.VisitUser( + s.Req.GetUid(), + s.Req.GetPlatform(), + s.Req.GetLang(), + s.Req.GetLv(), + s.Req.GetCustomParam(), + s.Req.GetIp(), + s.Req.GetCenterId(), + s.Req.GetModuleId(), + s._getDevice(cpn.ProjectID), + s.wbu, + ) + + if err != nil { + return + } + + s.changeLangMark, s.changeLvMark = pfu.GetChangeLangMark(), pfu.GetChangeLvMark() + + return +} + +func (s *Visit) token(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + res, err := app.NewCertifiedFUser().Token(s.Ctx, &c_fuserpb.TokenReq{ + Id: user.ID, + CampaignId: user.CampaignID, + ChannelId: user.ChannelID, + Pid: user.ParentID, + IsView: user.IsView == mtype.Yes, + Lang: utils.NotExistGetFirst[string](user.LangMark, cpn.GetLangMarks()), + Lv: user.UserLevelMark, + ShowLang: user.LangMark, + Country: user.UserCountry, + Tz: consts.CampaignTz, + TzOffset: s.cpnControl.GetTz(), + }) + + if err != nil { + return + } + + s.Res.Id = user.ID + s.Res.HashId = user.HashID + s.Res.Token = res.GetToken() + s.Res.Expired = res.GetExpired() + s.Res.IsView = int32(user.IsView) + + return +} + +func (s *Visit) setLink(cpn *model.FissionCampaign, channel *model.FissionCampaignChannel, user *model.FissionUser) (err error) { + if user.ShareLink != "" && !s.changeLvMark && !s.changeLangMark { + return + } + + project, err := finder.Project(s.Ctx, cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 把分享链接变成短链 + shareLink, err := s._shareLink(cpn, project, channel, user) + if err != nil { + return + } + + res, _ := app.NewShortLinkNameLink().CreateShortLink(s.Ctx, &linkpb.CreateShortLinkReq{ + LongLink: shareLink, + Domain: project.Domain, + }) + + if res.GetShortLink() == "" { + return + } + + m := s.GetDao().FissionUser + _, _ = m.WithContext(s.Ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(m.ShareLink.Value(res.GetShortLink())) + + ms := s.GetDao().FissionUser.SubTable(cpn.ID) + _, _ = ms.WithContext(s.Ctx).Where(ms.ID.Eq(user.ID)).UpdateSimple(ms.ShareLink.Value(res.GetShortLink())) + + s.AddAfterRun(func() (err error) { + if s.clearUser { + return + } + + // 清除缓存 + _ = cache.NewFissionUser(s.Ctx, cpn.ID).Clear(user) + s.clearUser = true + return + }) + + return +} + +// 获取分享链接 +func (s *Visit) _shareLink(cpn *model.FissionCampaign, project *model.Project, appChannel *model.FissionCampaignChannel, user *model.FissionUser) (link string, err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project.Scene == mtype.ProjectSceneWeb { + link = blink.NewCampaignLink( + project.Domain, cpn.HashID, appChannel.Mark, + blink.SetSubUserId(s.Req.GetUid()), + blink.SetScene(project.Scene), + blink.SetLang(user.LangMark), + blink.SetLevel(user.LevelMark), + ).CampaignWebShareLink() + return + } + + if conf.HasWeb == mtype.No { + link = blink.NewCampaignLink( + project.Domain, cpn.HashID, appChannel.Mark, + blink.SetSubUserId(s.Req.GetUid()), + blink.SetLang(user.LangMark), + blink.SetLevel(user.LevelMark), + ).CampaignDownloadLink() + return + } + + m := s.GetDao().FissionCampaignChannel + var webChannel *model.FissionCampaignChannel + if s.wbu == nil { + webChannel, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.IsDefault.Eq(mtype.Yes), + m.IsDel.Eq(mtype.No), + m.CType.Eq(mtype.FissionCampaignChannelTypeWeb), + ).Take() + } else { + webChannel, err = m.WithContext(s.Ctx).Where( + m.ID.Eq(s.wbu.ChannelID), + ).Take() + } + + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if webChannel == nil { + return + } + + link = blink.NewCampaignLink( + project.Domain, cpn.HashID, webChannel.Mark, + blink.SetSubUserId(s.Req.GetUid()), + blink.SetLang(user.LangMark), + blink.SetLevel(user.LevelMark), + ).CampaignWebLink() + + return +} + +func (s *Visit) _cert(project int64) (err error) { + if s.Req.GetUid() == consts.FissionViewer { + return + } + // 数据验签 + cert, err := app.NewCertifiedFUser().CertUser(s.Ctx, &c_fuserpb.CertUserReq{ + ProjectId: project, + UserId: s.Req.GetUid(), + Lv: s.Req.GetLv(), + Lang: s.Req.GetLang(), + Time: s.Req.GetCert().GetTime(), + Blackbox: s.Req.GetCert().GetBlackbox(), + Version: s.Req.GetCert().GetVersion(), + Platform: s.Req.GetCert().GetPlatform(), + Token: s.Req.GetCert().GetToken(), + }) + + if err != nil || !cert.GetOk() { + err = workerr.UnauthorizedError + return + } + return +} + +func (s *Visit) _white(conf *model.FissionCampaignConfig, userId string) (err error) { + if userId == consts.FissionViewer { + return + } + + if s.cpnControl.IsWait() && conf.HasWarmUp == mtype.No { + return workerr.CNotRunError + } + + if s.cpnControl.IsPre() { + userIdList := strings.Split(conf.WhiteList, ";") + for _, id := range userIdList { + if userId == id { + return + } + } + return workerr.CNotRunError + } + + return +} + +func (s *Visit) _getDevice(projectId int64) *ddevicepb.FindBlackboxRes { + if s.device == nil && s.Req.GetCert().GetBlackbox() != "" { + s.device, _ = app.NewDeepLinkDevice().FindBlackbox(s.Ctx, &ddevicepb.FindBlackboxReq{ + Blackbox: s.Req.GetCert().GetBlackbox(), + ProjectId: projectId, + }) + } + + return s.device +} + +// 是否有上级 +func (s *Visit) _hasParent(cpn *model.FissionCampaign) (err error) { + + device := s._getDevice(cpn.ProjectID) + if device == nil || device.GetDeviceId() == "" { + return + } + + //看看能不能找到device的参与数据 + cc := cache.NewFissionUser(s.Ctx, cpn.ID) + user, err := cc.FindByDeviceId(device.GetDeviceId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user != nil { + s.Res.HasParent = user.ParentID > 0 + return + } + + if device.GetLastParentUserId() == "" { + return + } + + // 怀疑没入库,好这个上级用户是不是这个活动的,是就认为他有上级 + user, err = cc.FindBySubUserId(device.GetLastParentUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.Res.HasParent = user != nil + + return +} + +func (s *Visit) track(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + inApp := fissionaction.NewMarkPoint(s.Ctx).InApp(user) + + if s.Req.GetCenterId() != "" { + inApp.CenterDrainage(time.Now().Unix(), s.Req.GetCenterId(), s.Req.GetModuleId()) + } + + inApp.View(time.Now().Unix(), s.Req.GetIp(), s.Req.GetOs(), s.Req.GetOsVersion(), s.Req.GetDeviceModel()) + + data, err := lockdo.Bytes(s.Ctx, ckey.FissionRewardPushOpenOnce(cpn.ID, mtype.FissionCampaignPushMarkVisit), func() (data []byte, err error) { + + pushM := s.GetDao().FissionCampaignPush + push, err := pushM.WithContext(s.Ctx).Where(pushM.CampaignID.Eq(cpn.ID), pushM.Mark.Eq(mtype.FissionCampaignPushMarkVisit)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if push == nil { + push = &model.FissionCampaignPush{} + } + + return jsonm.Marshal(push) + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + var push = &model.FissionCampaignPush{} + err = jsonm.Unmarshal(data, push) + if err != nil { + return + } + + if push.Open != mtype.Yes { + return + } + + p, err := pusher.NewPusher(s.Ctx, cpn) + if err != nil { + return + } + + err = p.Visit(user, time.Now()) + if err != nil { + err = s.BE().MysqlError(err) + } + + return +} diff --git a/internal/service/containers/campaignuser/vote.go b/internal/service/containers/campaignuser/vote.go new file mode 100644 index 0000000..22f9c52 --- /dev/null +++ b/internal/service/containers/campaignuser/vote.go @@ -0,0 +1,114 @@ +package campaignuser + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "time" +) + +type Vote struct { + logic.Logic + Req *pb.VoteReq + Res *pb.VoteRes +} + +func (s *Vote) Run() error { + return logic.Run(s) +} + +func (s *Vote) Exec() (err error) { + user, cpn, err := s.user() + if err != nil { + return + } + + err = s.vote(user, cpn) + if err != nil { + return + } + + return +} + +// 用户信息 +func (s *Vote) user() (user *model.FissionUser, cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + if cpn.EndTime < time.Now().Unix() { + err = workerr.CEndError + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + //如果活动没开始,还不是预览用户,不允许玩 + if cpn.StartTime > time.Now().Unix() && user.IsView == mtype.No { + err = workerr.CStartError + return + } + + return +} + +func (s *Vote) vote(user *model.FissionUser, cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdPrizeQuiz: //有奖竞猜 + return s.prizeQuiz(user) + case consts.IdVs: + return s.vs(user) + } + + return +} + +func (s *Vote) vs(user *model.FissionUser) (err error) { + vs, err := players.NewVs(s.Ctx, user) + if err != nil { + return + } + + s.Res.Status, err = vs.Vote(s.Req.GetScheduleId(), s.Req.GetTeamId()) + if err != nil { + return + } + + return +} + +func (s *Vote) prizeQuiz(user *model.FissionUser) (err error) { + quiz, err := players.NewQuiz(s.Ctx, user) + if err != nil { + return + } + + err = quiz.Vote(s.Req.GetOptionId(), s.Req.GetVoteNum()) + if err != nil { + return + } + + return +} diff --git a/internal/service/containers/coin_save.go b/internal/service/containers/coin_save.go new file mode 100644 index 0000000..ef507c7 --- /dev/null +++ b/internal/service/containers/coin_save.go @@ -0,0 +1,209 @@ +package containers + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_coin" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen/field" +) + +type CoinSave struct { + logic.Logic + + Req *pb.SaveReq + Res *pb.SaveRes +} + +func (s *CoinSave) Run() (err error) { + return logic.Run(s) +} + +func (s *CoinSave) Exec() (err error) { + project, err := s.project() + if err != nil { + return + } + + return s.coin(project) +} + +func (s *CoinSave) project() (project *model.Project, err error) { + project, err = finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + err = workerr.NotFound("project not found") + return + } + + return +} + +func (s *CoinSave) coin(project *model.Project) (err error) { + coin, err := cache.NewTCoin(s.Ctx).FindByProjectId(project.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if coin == nil { + return s._create(project) + } + + return s._update(coin) +} + +func (s *CoinSave) _update(coin *model.TCoin) (err error) { + expSelect, err := jsonm.ToSliceString(s.Req.GetExpSelect()) + if err != nil { + return + } + + m := s.GetDao().TCoin + var up []field.AssignExpr + if coin.Title != s.Req.GetTitle() { + up = append(up, m.Title.Value(s.Req.GetTitle())) + } + + if coin.ExpSelect != expSelect { + up = append(up, m.ExpSelect.Value(expSelect)) + } + + if int32(coin.OpenPush) != s.Req.GetOpenPush() { + up = append(up, m.OpenPush.Value(int8(s.Req.GetOpenPush()))) + } + + if len(up) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(coin.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewTCoin(s.Ctx).Clear(coin) + }) + } + + return s._saveLang(coin) +} + +func (s *CoinSave) _saveLang(coin *model.TCoin) (err error) { + m := s.GetDao().TCoinLang + langs, err := m.WithContext(s.Ctx).Where(m.TCoinID.Eq(coin.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var add []*model.TCoinLang + var oldLangs = make(map[string]*model.TCoinLang, len(langs)) + for _, lang := range langs { + oldLangs[lang.LangMark] = lang + } + + for _, v := range s.Req.GetLangs() { + + old, ok := oldLangs[v.GetLangMark()] + + if !ok { + + add = append(add, withdefault.TCoinLang(&model.TCoinLang{ + TCoinID: coin.ID, + LangMark: v.LangMark, + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + Rule: v.GetRule(), + IsDefault: int8(v.GetIsDefault()), + })) + + continue + } + + delete(oldLangs, v.LangMark) + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(old.ID)).UpdateSimple( + m.Title.Value(v.GetTitle()), + m.ImgURL.Value(v.GetImgUrl()), + m.Rule.Value(v.GetRule()), + m.IsDefault.Value(int8(v.GetIsDefault())), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + var delIds []int64 + for _, lang := range oldLangs { + delIds = append(delIds, lang.ID) + } + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *CoinSave) _create(project *model.Project) (err error) { + expSelect, err := jsonm.ToSliceString(s.Req.GetExpSelect()) + if err != nil { + return + } + + coin := withdefault.TCoin(&model.TCoin{ + ProjectID: project.ID, + Title: s.Req.GetTitle(), + OpenPush: int8(s.Req.GetOpenPush()), + ExpSelect: expSelect, + }) + + if err = s.GetDao().TCoin.WithContext(s.Ctx).Create(coin); err != nil { + err = s.BE().MysqlError(err) + return + } + + var langs = make([]*model.TCoinLang, 0, len(s.Req.GetLangs())) + for _, lang := range s.Req.GetLangs() { + langs = append(langs, withdefault.TCoinLang(&model.TCoinLang{ + TCoinID: coin.ID, + LangMark: lang.GetLangMark(), + Title: lang.GetTitle(), + ImgURL: lang.GetImgUrl(), + Rule: lang.GetRule(), + IsDefault: int8(lang.GetIsDefault()), + })) + } + + if len(langs) == 0 { + return + } + + if err = s.GetDao().TCoinLang.WithContext(s.Ctx).Create(langs...); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/fission_create_temp_group.go b/internal/service/containers/fission_create_temp_group.go new file mode 100644 index 0000000..4e0602d --- /dev/null +++ b/internal/service/containers/fission_create_temp_group.go @@ -0,0 +1,190 @@ +package containers + +import ( + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" +) + +type FissionCreateTempGroup struct { + logic.Logic + Req *pb.CreateTempGroupReq + Res *pb.CreateTempGroupRes +} + +func (s *FissionCreateTempGroup) Run() error { + return logic.Run(s) +} + +func (s *FissionCreateTempGroup) Exec() (err error) { + err = s.check() + if err != nil { + return + } + + group, err := s.create() + if err != nil { + return + } + + err = s.createGroupLang(group) + if err != nil { + return + } + + err = s.createTemp(group) + if err != nil { + return + } + + return +} + +func (s *FissionCreateTempGroup) check() (err error) { + m := s.GetDao().FissionTempGroup + exist, err := m.WithContext(s.Ctx).Where(m.Mark.Eq(s.Req.GetMark())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if exist != nil { + return workerr.BadRequest("mark exist") + } + + if s.Req.GetLangParts() != "" { + moduleM := s.GetDao().FissionLangModule + marks := strings.Split(s.Req.GetLangParts(), ",") + + var list []*model.FissionLangModule + + list, err = moduleM.WithContext(s.Ctx).Where(moduleM.Mark.In(marks...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var markKey = make(map[string]string) + for _, v := range list { + for _, kv := range v.GetParts() { + markKey[kv.Key] = v.Mark + } + } + + for _, v := range s.Req.GetLang() { + if module, ok := markKey[v.Key]; ok { + err = s.BE().VerifyError(fmt.Sprintf("%s模块下已存在%s,请重新设置", module, v.Key)) + return + } + } + } + + return +} + +func (s *FissionCreateTempGroup) create() (group *model.FissionTempGroup, err error) { + group = withdefault.FissionTempGroup(&model.FissionTempGroup{ + FissionID: s.Req.GetFissionId(), + CoverURL: s.Req.GetCoverUrl(), + Mark: s.Req.GetMark(), + Sort: s.Req.GetSort(), + LangParts: s.Req.GetLangParts(), + ConvertCoverURL: s.Req.GetConvertCoverUrl(), + }) + + m := s.GetDao().FissionTempGroup + + err = m.WithContext(s.Ctx).Create(group) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = group.ID + return + }) + return +} + +func (s *FissionCreateTempGroup) createGroupLang(group *model.FissionTempGroup) (err error) { + var lts []string + for _, v := range s.Req.GetLang() { + lts = append(lts, v.Value) + } + + ltmM := s.GetDao().LangTextMark + list, err := ltmM.WithContext(s.Ctx).Where(ltmM.Text.In(lts...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var vm = make(map[string]string) + for _, v := range list { + vm[v.Text] = v.Mark + } + + for _, text := range lts { + if _, ok := vm[text]; !ok { + err = s.BE().VerifyError(fmt.Sprintf("[%s]未翻译", text)) + return + } + } + + m := s.GetDao().FissionTempGroupLang + var add []*model.FissionTempGroupLang + for _, v := range s.Req.GetLang() { + add = append(add, withdefault.FissionTempGroupLang(&model.FissionTempGroupLang{ + GroupID: group.ID, + Mark: v.Key, + LangMark: vm[v.Value], + Desc: v.Desc, + })) + } + + if len(add) == 0 { + return + } + + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *FissionCreateTempGroup) createTemp(group *model.FissionTempGroup) (err error) { + if len(s.Req.LangType) == 0 { + return + } + + m := s.GetDao().FissionTemp + + var add []*model.FissionTemp + for _, v := range s.Req.GetLangType() { + add = append(add, withdefault.FissionTemp(&model.FissionTemp{ + FissionID: group.FissionID, + GroupID: group.ID, + LangType: int8(v), + TextType: mtype.FissionLangTypeTextType[int8(v)], + })) + } + + if len(add) == 0 { + return + } + + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/fission_template_info.go b/internal/service/containers/fission_template_info.go new file mode 100644 index 0000000..f3f2d9f --- /dev/null +++ b/internal/service/containers/fission_template_info.go @@ -0,0 +1,346 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" +) + +type FissionTemplateInfo struct { + logic.Logic + Req *pb.TemplateInfoReq + Res *pb.TemplateInfoRes +} + +func (s *FissionTemplateInfo) Run() error { + return logic.Run(s) +} + +func (s *FissionTemplateInfo) Exec() (err error) { + temp, group, err := s.temp() + if err != nil { + return + } + + temp, err = s.switchTemp(temp) + if err != nil { + return + } + + err = s.lang(temp, group) + if err != nil { + return + } + + s.fixReward() + + return +} + +func (s *FissionTemplateInfo) temp() (temp *model.FissionTemp, group *model.FissionTempGroup, err error) { + temp, err = finder.FissionTemp(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if temp == nil || temp.IsDel == mtype.Yes { + err = workerr.NotFound("template not found") + return + } + + group, err = cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.Res.TempGroupMark = group.Mark + + return +} + +func (s *FissionTemplateInfo) switchTemp(temp *model.FissionTemp) (*model.FissionTemp, error) { + langType := mtype.MarkToLangType[s.Req.GetLang()] + + if langType == 0 || langType == temp.LangType { + return temp, nil + } + + m := s.GetDao().FissionTemp + info, err := m.WithContext(s.Ctx).Where(m.GroupID.Eq(temp.GroupID), m.LangType.Eq(langType)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return nil, err + } + + if info == nil { + return temp, nil + } + + return info, nil +} + +func (s *FissionTemplateInfo) lang(temp *model.FissionTemp, group *model.FissionTempGroup) (err error) { + textMap, err := s._groupTextMap(group, mtype.FissionLangTypeToMark[temp.LangType]) + if err != nil { + return + } + + customText, err := s._text(temp.ID) + if err != nil { + return + } + + for k, v := range customText { + textMap[k] = v + } + + s.Res.Lang = make([]*pb.TemplateInfoRes_KV, 0, len(textMap)) + for _, v := range textMap { + s.Res.Lang = append(s.Res.Lang, &pb.TemplateInfoRes_KV{ + Key: v.Key, + Value: v.Value, + Desc: v.Desc, + }) + } + + imgMap, err := s._commonImg(temp.LangType) + if err != nil { + return + } + + customImg, err := s._img(temp.ID) + for k, v := range customImg { + imgMap[k] = v + } + + s.Res.Image = make([]*pb.TemplateInfoRes_KV, 0, len(imgMap)) + for _, v := range imgMap { + s.Res.Image = append(s.Res.Image, &pb.TemplateInfoRes_KV{ + Key: v.Key, + Value: v.Value, + Desc: v.Desc, + }) + } + + s.Res.Id = temp.ID + s.Res.HashId = temp.HashID + s.Res.LangType = int32(temp.LangType) + s.Res.TextType = int32(temp.TextType) + + return +} + +func (s *FissionTemplateInfo) _groupTextMap(group *model.FissionTempGroup, mark string) (textMap map[string]*mtype.LangKv, err error) { + textMap = make(map[string]*mtype.LangKv) + + m := s.GetDao().FissionTempGroupLang + + var lms []string + list, err := m.WithContext(s.Ctx).Where(m.GroupID.Eq(group.ID)).Find() + for _, v := range list { + lms = append(lms, v.LangMark) + } + + var partLkv []*mtype.LangKv + if group.LangParts != "" { + parts := strings.Split(group.LangParts, ",") + moduleM := s.GetDao().FissionLangModule + var partList []*model.FissionLangModule + partList, err = moduleM.WithContext(s.Ctx).Where(moduleM.Mark.In(parts...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range partList { + for _, kv := range v.GetParts() { + partLkv = append(partLkv, kv) + lms = append(lms, kv.Value) + } + } + } + + langM := s.GetDao().Lang + langList, err := langM.WithContext(s.Ctx).Where(langM.LangMark.In(lms...), langM.Mark.Eq(mark)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var mtMap = make(map[string]string) + for _, lang := range langList { + mtMap[lang.LangMark] = lang.LangText + } + + for _, v := range list { + textMap[v.Mark] = &mtype.LangKv{ + Key: v.Mark, + Value: mtMap[v.LangMark], + Desc: v.Desc, + } + } + + for _, v := range partLkv { + textMap[v.Key] = &mtype.LangKv{ + Key: v.Key, + Value: mtMap[v.Value], + Desc: v.Desc, + } + } + + return +} + +func (s *FissionTemplateInfo) _text(tempId int64) (textMap map[string]*mtype.LangKv, err error) { + textMap = make(map[string]*mtype.LangKv) + + langM := s.GetDao().FissionTempLang + lang, err := langM.WithContext(s.Ctx).Where(langM.TempID.Eq(tempId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range lang { + textMap[v.Mark] = &mtype.LangKv{ + Key: v.Mark, + Value: v.Val, + Desc: v.Desc, + } + } + return +} + +func (s *FissionTemplateInfo) _commonImg(langType int8) (imgMap map[string]*mtype.LangKv, err error) { + + if langType == mtype.FissionLangTypeZh { + + return map[string]*mtype.LangKv{ + consts.TempInfoImgAndroidBtnKey: { + Key: consts.TempInfoImgAndroidBtnKey, + Value: fmt.Sprintf(consts.TempInfoImgAndroidBtnValue, ""), + Desc: consts.TempInfoImgAndroidBtnDesc, + }, + consts.TempInfoImgIosBtnKey: { + Key: consts.TempInfoImgIosBtnKey, + Value: fmt.Sprintf(consts.TempInfoImgIosBtnValue, ""), + Desc: consts.TempInfoImgIosBtnDesc, + }, + consts.TempInfoImgAndroidBtnWhiteKey: { + Key: consts.TempInfoImgAndroidBtnWhiteKey, + Value: fmt.Sprintf(consts.TempInfoImgAndroidBtnWhiteValue, ""), + Desc: consts.TempInfoImgAndroidBtnWhiteDesc, + }, + consts.TempInfoImgIosBtnWhiteKey: { + Key: consts.TempInfoImgIosBtnWhiteKey, + Value: fmt.Sprintf(consts.TempInfoImgIosBtnWhiteValue, ""), + Desc: consts.TempInfoImgIosBtnWhiteDesc, + }, + consts.TempInfoImgWechatBrowserKey: { + Key: consts.TempInfoImgWechatBrowserKey, + Value: fmt.Sprintf(consts.TempInfoImgWechatBrowserValue, ""), + Desc: consts.TempInfoImgWechatBrowserDesc, + }, + consts.TempInfoImgWechatLineKey: { + Key: consts.TempInfoImgWechatLineKey, + Value: fmt.Sprintf(consts.TempInfoImgWechatLineValue, ""), + Desc: consts.TempInfoImgWechatLineDesc, + }, + consts.TempInfoImgDefaultKey: { + Key: consts.TempInfoImgDefaultKey, + Value: consts.TempInfoImgDefaultValue, + Desc: consts.TempInfoImgDefaultDesc, + }, + }, nil + + } + + return map[string]*mtype.LangKv{ + consts.TempInfoImgAndroidBtnKey: { + Key: consts.TempInfoImgAndroidBtnKey, + Value: fmt.Sprintf(consts.TempInfoImgAndroidBtnValue, "_en"), + Desc: consts.TempInfoImgAndroidBtnDesc, + }, + consts.TempInfoImgIosBtnKey: { + Key: consts.TempInfoImgIosBtnKey, + Value: fmt.Sprintf(consts.TempInfoImgIosBtnValue, "_en"), + Desc: consts.TempInfoImgIosBtnDesc, + }, + consts.TempInfoImgAndroidBtnWhiteKey: { + Key: consts.TempInfoImgAndroidBtnWhiteKey, + Value: fmt.Sprintf(consts.TempInfoImgAndroidBtnWhiteValue, "_en"), + Desc: consts.TempInfoImgAndroidBtnWhiteDesc, + }, + consts.TempInfoImgIosBtnWhiteKey: { + Key: consts.TempInfoImgIosBtnWhiteKey, + Value: fmt.Sprintf(consts.TempInfoImgIosBtnWhiteValue, "_en"), + Desc: consts.TempInfoImgIosBtnWhiteDesc, + }, + consts.TempInfoImgWechatBrowserKey: { + Key: consts.TempInfoImgWechatBrowserKey, + Value: fmt.Sprintf(consts.TempInfoImgWechatBrowserValue, "_en"), + Desc: consts.TempInfoImgWechatBrowserDesc, + }, + consts.TempInfoImgWechatLineKey: { + Key: consts.TempInfoImgWechatLineKey, + Value: fmt.Sprintf(consts.TempInfoImgWechatLineValue, "_en"), + Desc: consts.TempInfoImgWechatLineDesc, + }, + consts.TempInfoImgDefaultKey: { + Key: consts.TempInfoImgDefaultKey, + Value: consts.TempInfoImgDefaultValue, + Desc: consts.TempInfoImgDefaultDesc, + }, + }, nil +} + +func (s *FissionTemplateInfo) _img(tempId int64) (imgMap map[string]*mtype.LangKv, err error) { + imgMap = make(map[string]*mtype.LangKv) + + imageM := s.GetDao().FissionTempImage + img, err := imageM.WithContext(s.Ctx).Where(imageM.TempID.Eq(tempId)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range img { + imgMap[v.Mark] = &mtype.LangKv{ + Key: v.Mark, + Value: v.Val, + Desc: v.Desc, + } + } + + return +} + +func (s *FissionTemplateInfo) fixReward() { + s.Res.FixRewards = make([]*pb.TemplateInfoRes_FixReward, 0, len(app.FissionFixRewards)) + for _, reward := range app.FissionFixRewards { + one := &pb.TemplateInfoRes_FixReward{ + Id: reward.Id, + Langs: make([]*pb.TemplateInfoRes_Lang, 0, len(reward.Langs)), + } + for _, lang := range reward.Langs { + one.Langs = append(one.Langs, &pb.TemplateInfoRes_Lang{ + Title: lang.Title, + ImgUrl: lang.ImgUrl, + LangMark: lang.Mark, + }) + } + s.Res.FixRewards = append(s.Res.FixRewards, one) + } + return +} diff --git a/internal/service/containers/fission_update_temp_group.go b/internal/service/containers/fission_update_temp_group.go new file mode 100644 index 0000000..7f23a10 --- /dev/null +++ b/internal/service/containers/fission_update_temp_group.go @@ -0,0 +1,240 @@ +package containers + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" +) + +type FissionUpdateTempGroup struct { + logic.Logic + Req *pb.UpdateTempGroupReq + Res *pb.UpdateTempGroupRes +} + +func (s *FissionUpdateTempGroup) Run() error { + return logic.Run(s) +} + +func (s *FissionUpdateTempGroup) Exec() (err error) { + group, err := s.check() + if err != nil { + return + } + + err = s.update(group) + if err != nil { + return + } + + err = s.updateGroupLang(group) + if err != nil { + return + } + + err = s.updateTemp(group) + if err != nil { + return + } + + return +} + +func (s *FissionUpdateTempGroup) check() (group *model.FissionTempGroup, err error) { + group, err = cache.NewFissionTempGroup(s.Ctx).FindById(s.Req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if group == nil { + err = workerr.NotFound("group not found") + return + } + + if s.Req.GetLangParts() != "" { + moduleM := s.GetDao().FissionLangModule + marks := strings.Split(s.Req.GetLangParts(), ",") + + var list []*model.FissionLangModule + + list, err = moduleM.WithContext(s.Ctx).Where(moduleM.Mark.In(marks...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var markKey = make(map[string]string) + for _, v := range list { + for _, kv := range v.GetParts() { + markKey[kv.Key] = v.Mark + } + } + + for _, v := range s.Req.GetLang() { + if module, ok := markKey[v.Key]; ok { + err = s.BE().VerifyError(fmt.Sprintf("%s模块下已存在%s,请重新设置", module, v.Key)) + return + } + } + } + + return +} + +func (s *FissionUpdateTempGroup) update(group *model.FissionTempGroup) (err error) { + m := s.GetDao().FissionTempGroup + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(group.ID)).UpdateSimple( + m.CoverURL.Value(s.Req.GetCoverUrl()), + m.Sort.Value(s.Req.GetSort()), + m.LangParts.Value(s.Req.GetLangParts()), + m.ConvertCoverURL.Value(s.Req.GetConvertCoverUrl()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + _ = cache.NewFissionTempGroup(s.Ctx).Clear(group) + s.Res.Id = group.ID + return + }) + return +} + +func (s *FissionUpdateTempGroup) updateGroupLang(group *model.FissionTempGroup) (err error) { + var lts []string + for _, v := range s.Req.GetLang() { + lts = append(lts, v.GetValue()) + } + + ltmM := s.GetDao().LangTextMark + list, err := ltmM.WithContext(s.Ctx).Where(ltmM.Text.In(lts...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var vm = make(map[string]string) + for _, v := range list { + vm[v.Text] = v.Mark + } + + for _, text := range lts { + if _, ok := vm[text]; !ok { + err = s.BE().VerifyError(fmt.Sprintf("[%s]未翻译", text)) + return + } + } + + m := s.GetDao().FissionTempGroupLang + tglList, err := m.WithContext(s.Ctx).Where(m.GroupID.Eq(group.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var old = make(map[string]*model.FissionTempGroupLang) + for _, v := range tglList { + old[v.LangMark] = v + } + + var add []*model.FissionTempGroupLang + for _, v := range s.Req.GetLang() { + + tgl, ok := old[v.GetKey()] + if !ok { + add = append(add, withdefault.FissionTempGroupLang(&model.FissionTempGroupLang{ + GroupID: group.ID, + Mark: v.GetKey(), + LangMark: vm[v.GetValue()], + Desc: v.GetDesc(), + })) + continue + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(tgl.ID)).UpdateSimple(m.LangMark.Value(vm[v.GetValue()]), m.Desc.Value(v.GetValue())) + if err != nil { + return + } + + } + + if len(add) == 0 { + return + } + + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *FissionUpdateTempGroup) updateTemp(group *model.FissionTempGroup) (err error) { + if len(s.Req.LangType) == 0 { + return + } + + m := s.GetDao().FissionTemp + + list, err := m.WithContext(s.Ctx).Where(m.GroupID.Eq(group.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var old = make(map[int32]*model.FissionTemp) + for _, v := range list { + old[int32(v.LangType)] = v + } + + var newLangType = make(map[int32]struct{}) + var add []*model.FissionTemp + for _, v := range s.Req.GetLangType() { + newLangType[v] = struct{}{} + + if _, ok := old[v]; !ok { + add = append(add, withdefault.FissionTemp(&model.FissionTemp{ + FissionID: group.FissionID, + GroupID: group.ID, + LangType: int8(v), + TextType: mtype.FissionLangTypeTextType[int8(v)], + })) + continue + } + } + + var delIds []int64 + for _, v := range list { + if _, ok := newLangType[int32(v.LangType)]; !ok { + delIds = append(delIds, v.ID) + } + } + + if len(add) > 0 { + if err = m.WithContext(s.Ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(delIds...)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} diff --git a/internal/service/containers/fission_web_asd_user.go b/internal/service/containers/fission_web_asd_user.go new file mode 100644 index 0000000..acec348 --- /dev/null +++ b/internal/service/containers/fission_web_asd_user.go @@ -0,0 +1,156 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission_web" + "joybuywork/proto/go_proto/workerr" + + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" +) + +type FissionWebAdsUser struct { + logic.Logic + Req *pb.AdsUserReq + Res *pb.AdsUserRes +} + +func (s *FissionWebAdsUser) Run() error { + return logic.Run(s) +} + +func (s *FissionWebAdsUser) Exec() (err error) { + cpn, channel, err := s.campaign() + if err != nil { + return + } + + wbu, err := s.webUser(cpn, channel) + if err != nil { + return + } + + err = s.reward(cpn, wbu) + if err != nil { + return + } + + return +} + +func (s *FissionWebAdsUser) campaign() (cpn *model.FissionCampaign, channel *model.FissionCampaignChannel, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("campaign not found") + return + } + + // 用户要绑定的渠道 + channel, err = cmm.NewCMM(s.Ctx, s.GetDao()).UserBindChannel(cpn.ID, s.Req.GetCid()) + if err != nil { + return + } + + return +} + +// 生成web用户 +func (s *FissionWebAdsUser) webUser(cpn *model.FissionCampaign, channel *model.FissionCampaignChannel) (wbu *model.FissionWebUser, err error) { + cc := cache.NewFissionWebUser(s.Ctx) + wbu, err = cc.FindByWebId(cpn.ID, s.Req.GetWebId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + defer s.AddAfterRun(func() (err error) { + s.Res.Id = wbu.ID + return + }) + + m := s.GetDao().FissionWebUser + if wbu != nil { + if wbu.UserID == 0 && wbu.ChannelID != channel.ID { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(wbu.ID)).UpdateSimple(m.ChannelID.Value(channel.ID)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(wbu) + } + return + } + + var ip = s.Req.GetIp() + var ipCity string + if ip != "" { + res, _ := app.NewDeepLinkDevice().FindIpAreaCode(s.Ctx, &ddevicepb.FindIpAreaCodeReq{Ip: s.Req.GetIp()}) + ipCity = res.GetAreaCode() + } + + wbu = withdefault.FissionWebUser(&model.FissionWebUser{ + CampaignID: cpn.ID, + ChannelID: channel.ID, + WebID: s.Req.GetWebId(), + IP: ip, + IPCity: ipCity, + }) + + err = m.WithContext(s.Ctx).Create(wbu) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 是否拿了奖品 +func (s *FissionWebAdsUser) reward(cpn *model.FissionCampaign, wbu *model.FissionWebUser) (err error) { + + if wbu.RewardID == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where(m.ID.Eq(wbu.RewardID), m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info, _ := preward.InfoAutoLang(reward.RewardID, cpn.GetLangMarks()[0]) + + s.AddAfterRun(func() (err error) { + s.Res.RewardId = wbu.RewardID + s.Res.Title = info.Title + s.Res.ImgUrl = info.ImgUrl + + return + }) + + return +} diff --git a/internal/service/containers/fission_web_bind_web.go b/internal/service/containers/fission_web_bind_web.go new file mode 100644 index 0000000..70b0adc --- /dev/null +++ b/internal/service/containers/fission_web_bind_web.go @@ -0,0 +1,201 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission_web" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" +) + +type FissionWebBindWeb struct { + logic.Logic + Req *pb.BindWebReq + Res *pb.BindWebRes +} + +func (s *FissionWebBindWeb) Run() error { + return logic.Run(s) +} + +func (s *FissionWebBindWeb) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + channel, err := s.channel(cpn) + if err != nil { + return + } + + wbu, err := s.webUser(cpn, channel) + if err != nil { + return + } + + err = s.mark(cpn, channel, wbu) + if err != nil { + return + } + + return +} + +func (s *FissionWebBindWeb) mark(cpn *model.FissionCampaign, channel *model.FissionCampaignChannel, wbu *model.FissionWebUser) (err error) { + project, err := finder.Project(s.Ctx, cpn.ProjectID) + if err != nil { + return s.BE().CacheError(err) + } + + // 记录最后的行为渠道 + err = app.Redis.Set(s.Ctx, ckey.FissionWebLastChannel(cpn.ID, wbu.WebID), fmt.Sprint(channel.ID), 2*time.Hour) + if err != nil { + return s.BE().CacheError(err) + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = wbu.ID + s.Res.UserId = wbu.UserID + s.Res.DownloadLink = blink.NewCampaignLink(project.Domain, cpn.HashID, channel.Mark).CampaignDownloadLink() + s.Res.Submit = wbu.Answer != "" + + return + }) + + return +} + +func (s *FissionWebBindWeb) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + return +} + +func (s *FissionWebBindWeb) channel(cpn *model.FissionCampaign) (channel *model.FissionCampaignChannel, err error) { + m := s.GetDao().FissionCampaignChannel + + channel, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.Eq(s.Req.GetCMark()), + m.CType.Eq(mtype.FissionCampaignChannelTypeWeb), + m.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if channel != nil { + return + } + + // 找不到就取默认渠道 + channel, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.IsDefault.Eq(mtype.Yes), + m.CType.Eq(mtype.FissionCampaignChannelTypeWeb), + m.IsDel.Eq(mtype.No), + ).Take() + + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if channel == nil { + err = workerr.NotFound("not found channel") + return + } + + return +} + +func (s *FissionWebBindWeb) webUser(cpn *model.FissionCampaign, channel *model.FissionCampaignChannel) (wbu *model.FissionWebUser, err error) { + m := s.GetDao().FissionWebUser + wbu, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.WebID.Eq(s.Req.GetWebId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if wbu != nil { + if wbu.UserID == 0 && wbu.ChannelID != channel.ID { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(wbu.ID)).UpdateSimple(m.ChannelID.Value(channel.ID)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return + } + + rewardId, err := s.fissionReward(cpn) + if err != nil { + return + } + + var ip = s.Req.GetIp() + var ipCity string + if ip != "" { + res, _ := app.NewDeepLinkDevice().FindIpAreaCode(s.Ctx, &ddevicepb.FindIpAreaCodeReq{Ip: s.Req.GetIp()}) + ipCity = res.GetAreaCode() + } + + wbu = withdefault.FissionWebUser(&model.FissionWebUser{ + CampaignID: cpn.ID, + ChannelID: channel.ID, + WebID: s.Req.GetWebId(), + RewardID: rewardId, + IP: ip, + IPCity: ipCity, + }) + + err = m.WithContext(s.Ctx).Create(wbu) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 玩法的站外奖品id +func (s *FissionWebBindWeb) fissionReward(cpn *model.FissionCampaign) (rewardId int64, err error) { + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeWeb), + m.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward != nil { + rewardId = reward.ID + } + + return +} diff --git a/internal/service/containers/fission_web_web_reward.go b/internal/service/containers/fission_web_web_reward.go new file mode 100644 index 0000000..84d0dd1 --- /dev/null +++ b/internal/service/containers/fission_web_web_reward.go @@ -0,0 +1,285 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission_web" + "joybuywork/proto/go_proto/workerr" + "time" + + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" +) + +type FissionWebWebReward struct { + logic.Logic + Req *pb.WebRewardReq + Res *pb.WebRewardRes +} + +func (s *FissionWebWebReward) Run() error { + return logic.Run(s) +} + +func (s *FissionWebWebReward) Exec() (err error) { + cpn, err := s.cpn() + if err != nil { + return + } + + binder, err := s.wbu(cpn) + if err != nil || binder == nil { + return + } + + wbu, user, err := s.bind(cpn, binder) + if err != nil || wbu == nil { + return + } + + err = s.webReward(cpn, wbu, user) + if err != nil { + return + } + + return +} + +func (s *FissionWebWebReward) cpn() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + return +} + +func (s *FissionWebWebReward) wbu(cpn *model.FissionCampaign) (binder *model.FissionWebUser, err error) { + res, _ := app.NewDeepLinkDevice().FindBlackbox(s.Ctx, &ddevicepb.FindBlackboxReq{ + Blackbox: s.Req.GetWebId(), + ProjectId: cpn.ProjectID, + }) + + if res.GetWid() == "" { + return + } + + binder, err = cache.NewFissionWebUser(s.Ctx).FindByWebId(cpn.ID, res.GetWid()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *FissionWebWebReward) bind(cpn *model.FissionCampaign, binder *model.FissionWebUser) (*model.FissionWebUser, *model.FissionUser, error) { + // 已经绑定了用户就不显示了 + if binder.UserID > 0 || binder.RewardID == 0 { + s.Res.Status = 2 + return binder, nil, nil + } + + binder, user, err := s._bindUser(cpn, binder) + if err != nil { + return nil, nil, err + } + + if user == nil { + return binder, nil, nil + } + + cc := cache.NewFissionWebUser(s.Ctx) + + // 看看这个用户id有没有绑定过站外用户 + wbuM := s.GetDao().FissionWebUser + hasBind, err := wbuM.WithContext(s.Ctx).Where(wbuM.CampaignID.Eq(cpn.ID), wbuM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, nil, s.BE().MysqlError(err) + } + + // 如果已经绑定上了,就直接不允许领奖 + if hasBind != nil { + s.Res.Status = 1 + return binder, nil, nil + } + + _, err = wbuM.WithContext(s.Ctx).Where(wbuM.ID.Eq(binder.ID)).UpdateSimple(wbuM.UserID.Value(user.ID)) + if err != nil { + return nil, nil, s.BE().MysqlError(err) + } + + _ = cc.Clear(binder) + + return binder, user, nil +} + +func (s *FissionWebWebReward) _bindUser(cpn *model.FissionCampaign, binder *model.FissionWebUser) (*model.FissionWebUser, *model.FissionUser, error) { + if s.Req.GetUid() == "" { + return binder, nil, nil + } + + cc := cache.NewFissionWebUser(s.Ctx) + + user, err := cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetUid()) + if err != nil { + return nil, nil, s.BE().CacheError(err) + } + + userBind, err := cc.FindByUserId(cpn.ID, user.ID) + if err != nil { + return nil, nil, s.BE().CacheError(err) + } + + // 当前用户并没有领奖 + if userBind == nil { + return binder, user, nil + } + + _, err = s._setReward(cpn, binder, user) + if err != nil { + return nil, nil, err + } + + s.Res.Status = 2 + + return nil, nil, nil +} + +func (s *FissionWebWebReward) _setReward(cpn *model.FissionCampaign, wbu *model.FissionWebUser, user *model.FissionUser) (reward *model.FissionCampaignReward, err error) { + rewardM := s.GetDao().FissionCampaignReward + reward, err = rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(wbu.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if reward == nil { + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + var lang = s.Req.GetLang() + if user != nil { + lang = user.LangMark + } + + lang = utils.NotExistGetFirst(lang, cpn.GetLangMarks()) + info, err := preward.InfoAutoLang(reward.RewardID, lang) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.HasReward = true + s.Res.Title = info.Title + s.Res.ImgUrl = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Contact = info.Contact + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + s.Res.KvData = make([]*pb.WebRewardRes_KV, 0, len(info.KvData)) + for _, kv := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.WebRewardRes_KV{ + Key: kv.Key, + Value: kv.Value, + }) + } + + return + }) + + return +} + +func (s *FissionWebWebReward) webReward(cpn *model.FissionCampaign, wbu *model.FissionWebUser, user *model.FissionUser) (err error) { + reward, err := s._setReward(cpn, wbu, user) + if err != nil { + return + } + + // 找不到用户,只返回当前浏览器用户的奖品数据 + if user == nil { + return + } + + var record *model.FissionRewardRecord + var async []func() + defer s.AddAfterRun(func() (err error) { + + if record != nil { + s.Res.RewardId = record.RewardID + s.Res.RewardHashId = record.HashID + s.Res.IsPush = record.Status != mtype.FissionRewardRecordStatusWait + + if record.FailType == mtype.FissionRewardRecordFailTypeIneligible { + s.Res.Status = 1 + } + } + + for _, do := range async { + do() + } + + return + }) + + var rewardType int8 = mtype.FissionCampaignRewardTypeWeb + if cpn.Target == mtype.FissionCampaignConfigTargetAdsGame { + rewardType = mtype.FissionCampaignRewardTypeApp + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.UserID.Eq(user.ID), + m.RewardType.Eq(rewardType), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if record != nil { + return + } + + var opts []award.RecordOption + if user.IsNew == mtype.No { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeIneligible, + mtype.FissionRewardRecordFailTypeNotInstall, + )) + } + + record, _, async, err = award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).One(reward, false, opts...) + if err != nil { + return + } + + if user.IsNew == mtype.Yes { + if cpn.ReportType == mtype.FissionCampaignReportTypeNew { + fissionaction.NewMarkPoint(s.Ctx).InApp(user).WebToApp(time.Now().Unix(), reward.ID, record.ID, wbu.WebID) + } + } + + return +} diff --git a/internal/service/containers/games/trace.go b/internal/service/containers/games/trace.go new file mode 100644 index 0000000..41fa1ee --- /dev/null +++ b/internal/service/containers/games/trace.go @@ -0,0 +1,84 @@ +package games + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_games" + "time" +) + +type Trace struct { + logic.Logic + Req *pb.TraceReq + Res *pb.TraceRes +} + +func (s *Trace) Run() error { + return logic.Run(s) +} + +func (s *Trace) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *Trace) Exec() (err error) { + user, err := s.user() + if err != nil || user == nil { + return + } + + switch s.Req.GetType() { + case mtype.GameActionTypeStay: + return s.stay(user) + } + + return +} + +func (s *Trace) user() (user *model.GameUser, err error) { + m := s.GetDao().GameUser + user, err = m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.GetUserId())).First() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Trace) stay(user *model.GameUser) (err error) { + id := hashid.IdBigint() + var stayId int64 + key := ckey.GameActionStayId(user.ID, s.Req.GetLinkId()) + if !app.Redis.Cache.WithContext(s.Ctx).SetNX(s.Ctx, key, id, 2*consts.TimeDay).Val() { + stayId, _ = app.Redis.Cache.WithContext(s.Ctx).Get(s.Ctx, key).Int64() + } + + producer.NewCampaignNotice(s.Ctx).GameAction(types.GameAction{ + ID: id, + ProjectId: user.ProjectID, + GameId: user.GameID, + UserId: user.ID, + LinkId: s.Req.GetLinkId(), + Type: mtype.GameActionTypeStay, + ActionTime: time.Now().Unix(), + Dimension: mtype.GameDimension{ + GameDimensionOption: mtype.GameDimensionOption{ + StaySec: s.Req.GetStaySec(), + StayId: stayId, + }, + }, + }) + + return +} diff --git a/internal/service/containers/games/visit.go b/internal/service/containers/games/visit.go new file mode 100644 index 0000000..b521bc0 --- /dev/null +++ b/internal/service/containers/games/visit.go @@ -0,0 +1,287 @@ +package games + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_games" + "joybuywork/proto/go_proto/workerr" + "fmt" + "math/rand" + "time" + + c_fuserpb "gits.branchcn.com/backend/certified/proto/go_proto/c_fuser" + c_guserpb "gits.branchcn.com/backend/certified/proto/go_proto/c_guser" +) + +type Visit struct { + logic.Logic + Req *pb.VisitReq + Res *pb.VisitRes +} + +func (s *Visit) Run() error { + return logic.Run(s) +} + +func (s *Visit) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *Visit) Exec() (err error) { + project, err := s.project() + if err != nil { + return + } + + link, err := s.link() + if err != nil { + return + } + + user, err := s.user(project, link) + if err != nil { + return + } + + err = s.token(user, link.ID) + if err != nil { + return + } + + s.trace(user, link) + + return +} + +func (s *Visit) project() (project *model.Project, err error) { + project, err = cache.NewProject(s.Ctx).FindByHashId(s.Req.GetProjectHashId()) + if err != nil { + return + } + + if project == nil { + err = s.BE().VerifyError("not found project") + return + } + + return +} + +func (s *Visit) link() (link *model.GameLink, err error) { + m := s.GetDao().GameLink + link, err = m.WithContext(s.Ctx).Where(m.HashID.Eq(s.Req.GetLinkHashId())).First() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if link == nil { + err = s.BE().VerifyError("not found link") + return + } + + return +} + +func (s *Visit) user(project *model.Project, link *model.GameLink) (user *model.GameUser, err error) { + err = s._cert(project.ID) + if err != nil { + return + } + + if s._isView() { + return &model.GameUser{ + ID: rand.Int63(), + HashID: hashid.Id()[3:], + ProjectID: project.ID, + GameID: link.GameID, + }, nil + } + + if s.Req.GetUid() != "" { + user, err = s._uid(project, link) + if err != nil || user != nil { + return + } + } + + user, err = s._iovd(project, link) + if err != nil { + return + } + + return +} + +func (s *Visit) _uid(project *model.Project, link *model.GameLink) (user *model.GameUser, err error) { + m := s.GetDao().GameUser + user, err = m.WithContext(s.Ctx).Where(m.ProjectID.Eq(project.ID), m.GameID.Eq(link.GameID), m.SubUserID.Eq(s.Req.GetUid())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user != nil { + return + } + + user, err = s._iovd(project, link) + if err != nil { + return + } + + if user != nil && user.SubUserID == "" { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(m.SubUserID.Value(s.Req.GetUid())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + user = withdefault.GameUser(&model.GameUser{ + ProjectID: project.ID, + GameID: link.GameID, + IP: s.Req.GetIp(), + Os: s.Req.GetOs(), + Ver: s.Req.GetOsVersion(), + DModel: s.Req.GetDeviceModel(), + SubUserID: s.Req.GetUid(), + IovdMark: s._iovdMark(), + }) + + err = s.GetDao().GameUser.WithContext(s.Ctx).Create(user) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Visit) _iovd(project *model.Project, link *model.GameLink) (user *model.GameUser, err error) { + m := s.GetDao().GameUser + user, err = m.WithContext(s.Ctx).Where(m.ProjectID.Eq(project.ID), m.GameID.Eq(link.GameID), m.IovdMark.Eq(s._iovdMark())).Last() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user != nil { + return + } + + user = withdefault.GameUser(&model.GameUser{ + ProjectID: project.ID, + GameID: link.GameID, + IP: s.Req.GetIp(), + Os: s.Req.GetOs(), + Ver: s.Req.GetOsVersion(), + DModel: s.Req.GetDeviceModel(), + IovdMark: s._iovdMark(), + }) + + err = s.GetDao().GameUser.WithContext(s.Ctx).Create(user) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Visit) token(user *model.GameUser, linkId int64) (err error) { + res, err := app.NewCertifiedGUser().Token(s.Ctx, &c_guserpb.TokenReq{ + Id: user.ID, + GameId: user.GameID, + ProjectId: user.ProjectID, + LinkId: linkId, + IsView: s._isView(), + }) + + if err != nil { + return + } + + s.Res.Id = user.ID + s.Res.HashId = user.HashID + s.Res.Token = res.GetToken() + s.Res.Expired = res.GetExpired() + s.Res.IsView = utils.Ternary[int32](s._isView(), mtype.Yes, mtype.No) + + return +} + +func (s *Visit) _cert(projectId int64) (err error) { + if s._isView() { + return + } + + // 数据验签 + cert, err := app.NewCertifiedFUser().CertUser(s.Ctx, &c_fuserpb.CertUserReq{ + ProjectId: projectId, + UserId: s.Req.GetUid(), + Lv: s.Req.GetLv(), + Lang: s.Req.GetLang(), + Time: s.Req.GetCert().GetTime(), + Blackbox: s.Req.GetCert().GetBlackbox(), + Version: s.Req.GetCert().GetVersion(), + Platform: s.Req.GetCert().GetPlatform(), + Token: s.Req.GetCert().GetToken(), + }) + + if err != nil || !cert.GetOk() { + err = workerr.UnauthorizedError + return + } + + return +} + +func (s *Visit) _isView() bool { + return s.Req.GetUid() == consts.FissionViewer +} + +func (s *Visit) trace(user *model.GameUser, link *model.GameLink) { + if s._isView() { + return + } + + app.Redis.Cache.Del(s.Ctx, ckey.GameActionStayId(user.ID, link.ID)) + + producer.NewCampaignNotice(s.Ctx).GameAction(types.GameAction{ + ID: hashid.IdBigint(), + ProjectId: user.ProjectID, + GameId: user.GameID, + UserId: user.ID, + LinkId: link.ID, + Type: mtype.GameActionTypeVisit, + ActionTime: time.Now().Unix(), + Dimension: mtype.GameDimension{ + GameDimensionOption: mtype.GameDimensionOption{ + Ip: s.Req.GetIp(), + Os: s.Req.GetOs(), + OsVersion: s.Req.GetOsVersion(), + DeviceModel: s.Req.GetDeviceModel(), + }, + }, + }) +} + +func (s *Visit) _iovdMark() string { + return utils.Md5String(fmt.Sprintf("%s:%s:%s:%s", s.Req.GetIp(), s.Req.GetOs(), s.Req.GetOsVersion(), s.Req.GetDeviceModel())) +} diff --git a/internal/service/containers/library_qa_rand.go b/internal/service/containers/library_qa_rand.go new file mode 100644 index 0000000..43c8182 --- /dev/null +++ b/internal/service/containers/library_qa_rand.go @@ -0,0 +1,238 @@ +package containers + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_library" + "fmt" + + "gorm.io/gen" +) + +type LibraryQaRand struct { + logic.Logic + Req *pb.QaRandReq + Res *pb.QaRandRes +} + +func (s *LibraryQaRand) Run() error { + return logic.Run(s) +} + +func (s *LibraryQaRand) Exec() (err error) { + cpn, group, err := s.campaign() + if err != nil || group == nil { + return + } + + return s.rand(cpn, group) +} + +func (s *LibraryQaRand) campaign() (cpn *model.FissionCampaign, group *model.LibraryQaGroup, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignId()) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if cpn == nil { + err = s.BE().VerifyError("not a qa campaign") + return + } + + groupM := s.GetDao().LibraryQaGroup + group, err = groupM.WithContext(s.Ctx).Where(groupM.HashID.Eq(s.Req.GetGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *LibraryQaRand) rand(cpn *model.FissionCampaign, group *model.LibraryQaGroup) (err error) { + m := s.GetDao().LibraryQa + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.GroupID.Eq(group.ID), + } + + switch cpn.FissionID { + case consts.IdQaAudio: + cond = append(cond, m.Mark.Eq(mtype.LibraryQaMarkAudio)) + case consts.IdQaVideo: + cond = append(cond, m.Mark.Eq(mtype.LibraryQaMarkVideo)) + } + + list, err := m.WithContext(s.Ctx).Where(cond...).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + if len(list) == 0 { + return + } + + s.Res.List = make([]*pb.QaRandRes_One, 0, len(list)) + + var qaMap = make(map[int64]*model.LibraryQa, len(list)) + for _, v := range list { + qaMap[v.ID] = v + } + + chooseIds, err := s._filter(cpn, qaMap) + if err != nil { + return + } + + optionM := s.GetDao().LibraryQaOption + options, err := optionM.WithContext(s.Ctx).Where(optionM.QaID.In(chooseIds...), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var opMap = make(map[int64][]*model.LibraryQaOption) + for _, v := range options { + opMap[v.QaID] = append(opMap[v.QaID], v) + } + + for _, id := range chooseIds { + v := qaMap[id] + + one := &pb.QaRandRes_One{ + Id: v.ID, + HashId: v.HashID, + Mark: v.Mark, + Title: v.Title, + CoverUrl: v.CoverURL, + LinkUrl: v.LinkURL, + ExplainText: v.ExplainText, + ExplainImg: v.ExplainImg, + Options: make([]*pb.QaRandRes_Option, 0, len(opMap[v.ID])), + CreatedAt: v.CreatedAt, + AnswerMark: v.AnswerMark, + } + + for _, option := range opMap[v.ID] { + one.Options = append(one.Options, &pb.QaRandRes_Option{ + Id: option.ID, + Title: option.Title, + ImgUrl: option.ImgURL, + IsRight: int32(option.IsRight), + }) + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +func (s *LibraryQaRand) _qaNum(cpn *model.FissionCampaign) (qaNum int32, err error) { + langMark := utils.NotExistGetFirst(s.Req.GetLangMark(), cpn.GetLangMarks()) + if langMark == cpn.GetLangMarks()[0] { + qam := s.GetDao().FissionCampaignQa + var conf *model.FissionCampaignQa + conf, err = qam.WithContext(s.Ctx).Where(qam.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf == nil { + return + } + qaNum = conf.QaNum + + return + } + + lang, err := cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, langMark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + return + } + + qaNum = lang.GetQaGroup().QaNum + + return +} + +func (s *LibraryQaRand) _filter(cpn *model.FissionCampaign, qaMap map[int64]*model.LibraryQa) (chooseIds []int64, err error) { + key := ckey.FissionUserQaSelect(s.Req.GetUserId()) + choose, err := cachecurd.NewHMap(s.Ctx, key) + if err != nil { + return + } + + selectMap, err := choose.Int64ToInt64() + if err != nil { + return + } + + qaNum, err := s._qaNum(cpn) + if err != nil { + return + } + + var maxNum int64 + for _, num := range selectMap { + if maxNum < num { + maxNum = num + } + } + + var idx int32 + var selected = make(map[int64]struct{}) + for id := range qaMap { + num, ok := selectMap[id] + if ok && num >= maxNum { + continue + } + + chooseIds = append(chooseIds, id) + selected[id] = struct{}{} + + idx++ + if idx == qaNum { + break + } + } + + if idx < qaNum { + for id := range qaMap { + if _, ok := selected[id]; ok { + continue + } + + chooseIds = append(chooseIds, id) + + idx++ + if idx == qaNum { + break + } + } + } + + for _, id := range chooseIds { + _, err = choose.Incr(fmt.Sprint(id), 1) + if err != nil { + return + } + } + + return +} diff --git a/internal/service/containers/mall/c_test.go b/internal/service/containers/mall/c_test.go new file mode 100644 index 0000000..dacb9bd --- /dev/null +++ b/internal/service/containers/mall/c_test.go @@ -0,0 +1,25 @@ +package mall + +import ( + "context" + _ "joybuywork/test" + "testing" + + pb "joybuywork/proto/go_proto/w_mall" +) + +func TestItemList(t *testing.T) { + res := &pb.ItemListRes{} + + container := new(ItemList) + { + container.Init(context.Background()) + container.Req = &pb.ItemListReq{ + MallId: 367716860052148224, + Status: 1, + } + container.Res = res + } + + t.Log(container.Run(), res) +} diff --git a/internal/service/containers/mall/exchange_item.go b/internal/service/containers/mall/exchange_item.go new file mode 100644 index 0000000..b9d4c5d --- /dev/null +++ b/internal/service/containers/mall/exchange_item.go @@ -0,0 +1,292 @@ +package mall + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/provider/projectuser" + stos "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_mall" + "time" + + "gorm.io/gen" +) + +const ( + exchangeStatusOk = iota // 成功 + exchangeStatusLack // 库存不足 + exchangeStatusLimit // 兑换上限 + exchangeStatusDown // 商品已下架 + exchangeStatusPointLack // 积分不足 + exchangeStatusExchanging // 兑换中 + exchangeStatusFail // 兑换失败 +) + +type ExchangeItem struct { + logic.Logic + + Req *pb.ExchangeItemReq + Res *pb.ExchangeItemRes +} + +func (s *ExchangeItem) Run() (err error) { + return logic.Run(s) +} + +func (s *ExchangeItem) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *ExchangeItem) Exec() (err error) { + item, err := s.item() + if err != nil || item == nil { + return + } + + pu, err := s.pu() + if err != nil { + return + } + + exchanging := app.NewRedisLock(s.Ctx, ckey.MallItemExchanging(pu.GetProjectUser().ID)) + if !exchanging.SoftLock() { + s.Res.Status = exchangeStatusExchanging + return + } + defer exchanging.Release() + + err = s.checkItem(item) + if err != nil || s.Res.GetStatus() != exchangeStatusOk { + return + } + + if s.Req.GetPointSource() == 0 { + return s.appExchange(pu, item) + } + + return s.exchange(pu, item) +} + +func (s *ExchangeItem) item() (item *model.RedeemMallItem, err error) { + item, err = cache.NewRedeemMallItem(s.Ctx).FindById(s.Req.GetMallItemId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if item == nil { + s.Res.Status = exchangeStatusDown + return + } + + return +} + +func (s *ExchangeItem) pu() (pu *projectuser.ProjectUser, err error) { + return projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(s.Req.GetProjectId(), s.Req.GetUserId()), projectuser.WithDao(s.GetDao())) +} + +func (s *ExchangeItem) checkItem(item *model.RedeemMallItem) (err error) { + if verify.InArray[int32](item.GetStatus(), mtype.RedeemMallItemStatusDel, mtype.RedeemMallItemStatusDown) { + s.Res.Status = exchangeStatusDown + return + } + + stock, err := stocks.NewMallItem(s.Ctx, item.ID) + if err != nil { + return + } + + ok, err := stock.DecrPoolAndAdd(item.ID, 1) + if err != nil { + return + } + + if !ok { + s.Res.Status = exchangeStatusLack + return + } + + s.AddErrRun(func() (err error) { + _, _ = stock.DecrPoolAndAdd(item.ID, -1) + return + }) + + s.AddErrRun(func() (err error) { + if s.Res.Status != exchangeStatusOk { + _, _ = stock.DecrPoolAndAdd(item.ID, -1) + } + return + }) + + return +} + +func (s *ExchangeItem) exchange(pu *projectuser.ProjectUser, item *model.RedeemMallItem) (err error) { + coin, err := pu.GetCoin() + if err != nil { + return + } + + if coin.Num < int64(item.CoinNum) { + s.Res.Status = exchangeStatusPointLack + return + } + + ok, err := pu.Deduct(mtype.ProjectUserCoinUseSourceCenter, mtype.ProjectUserCoinDerMall, item.MallID, item.CoinNum) + if err != nil { + return + } + + if !ok { + s.Rollback("项目用户积分不足") + s.Res.Status = exchangeStatusPointLack + return + } + + return s._pushReward(item) +} + +func (s *ExchangeItem) appExchange(pu *projectuser.ProjectUser, item *model.RedeemMallItem) (err error) { + lackKey := ckey.ProjectUserCoinLack(pu.GetProjectUser().ProjectID, pu.GetProjectUser().UserID) + // 看看是不是有 + if app.Redis.Cache.Exists(s.Ctx, lackKey).Val() != 0 { + s.Res.Status = exchangeStatusLack + return + } + + deductM := s.GetDao().ProjectUserCoinDeduct + + var cond = []gen.Condition{ + deductM.UserID.Eq(pu.GetProjectUser().ID), + deductM.RelateID.Eq(item.ID), + deductM.Num.Eq(item.CoinNum), + deductM.Source.Eq(mtype.ProjectUserCoinDeductSourceApp), + } + + deduct, err := deductM.WithContext(s.Ctx).Where(cond...).Attrs(deductM.ID.Value(hashid.IdBigint())).FirstOrCreate() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + defer func() { + if err != nil { + return + } + + _, err = deductM.WithContext(s.Ctx).Delete(deduct) + if err != nil { + err = s.BE().MysqlError(err) + } + }() + + s2s, err := stos.NewUserCoinChange(s.Ctx, pu.GetProjectUser(), s.Req.GetUrlId(), stos.SetDao(s.GetDao())) + if err != nil { + return + } + + res, err := s2s.CenterExchange( + item.CoinNum, + deduct.ID, + item.ID, + s.Req.GetSourceData().GetCenterId(), + s.Req.GetSourceData().GetCenterTitle(), + s.Req.GetSourceData().GetCenterHashId(), + s.Req.GetUserId(), + ) + if err != nil { + return + } + + if res.State == stos.PointsChangeLack { + app.Redis.Cache.Set(s.Ctx, lackKey, 1, 10*time.Second) + s.Res.Status = exchangeStatusPointLack + return + } + + return s._pushReward(item) +} + +func (s *ExchangeItem) _pushReward(item *model.RedeemMallItem) (err error) { + mall, err := malls.NewMall(s.Ctx, item.MallID) + if err != nil { + return + } + + var record *model.RedeemMallRecord + var info = provider.RewardAutoLang{} + switch s.Req.GetSource() { + case 1: + record, info, err = mall.Exchange( + item, + mtype.RewardPushSourceCenter, + s.Req.GetSourceData().GetCenterId(), + s.Req.GetSourceData().GetModuleId(), + s.Req.GetSourceData().GetRelateId(), + mtype.RewardPushParam{ + SourceHashId: s.Req.GetSourceData().GetCenterTitle(), + UserId: s.Req.GetUserId(), + UserPlatform: s.Req.GetSourceData().GetUserPlatform(), + ParentUserId: s.Req.GetSourceData().GetParentUserId(), + ParentUserPlatform: s.Req.GetSourceData().GetParentUserPlatform(), + Num: item.CoinNum, + Lang: s.Req.GetUserId(), + Title: s.Req.GetSourceData().GetCenterTitle(), + RewardType: mtype.FissionCampaignRewardTypeExchange, + }, + ) + + if err != nil { + return err + } + + if record == nil { + return s.BE().VerifyError("not found reward") + } + + default: + return s.BE().VerifyError("not found source") + } + + s.Res.Status = exchangeStatusOk + if record.Status == mtype.RedeemMallRecordStatusFail { + s.Res.Status = exchangeStatusFail + } + + s.Res.Id = record.ID + s.Res.RewardId = info.Id + s.Res.Title = info.Title + s.Res.ImgUrl = info.ImgUrl + s.Res.ReceiveType = info.ReceiveType + s.Res.Contact = info.Contact + s.Res.OpenToUse = info.OpenToUse + s.Res.CustomRewardVal = record.CustomRewardVal + s.Res.WebUrl = info.WebUrl + s.Res.AppParam = info.AppParam + s.Res.PcParam = info.PcParam + s.Res.FailType = record.FailType + s.Res.FailMsg = record.FailMsg + s.Res.KvData = make([]*pb.ExchangeItemRes_KV, 0, len(info.KvData)) + + for _, datum := range info.KvData { + s.Res.KvData = append(s.Res.KvData, &pb.ExchangeItemRes_KV{ + Key: datum.Key, + Value: datum.Value, + IsShow: datum.IsShow, + }) + } + + return +} diff --git a/internal/service/containers/mall/item_list.go b/internal/service/containers/mall/item_list.go new file mode 100644 index 0000000..83a8031 --- /dev/null +++ b/internal/service/containers/mall/item_list.go @@ -0,0 +1,119 @@ +package mall + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_mall" +) + +type ItemList struct { + logic.Logic + + Req *pb.ItemListReq + Res *pb.ItemListRes +} + +func (s *ItemList) Run() (err error) { + return logic.Run(s) +} + +func (s *ItemList) Exec() (err error) { + return s.list() +} + +func (s *ItemList) list() (err error) { + mall, err := malls.NewMall(s.Ctx, s.Req.GetMallId()) + if err != nil { + return + } + + var list []*model.RedeemMallItem + switch s.Req.GetStatus() { + case 1: + list, err = mall.UpItems() + if err != nil { + return + } + case 2: + list, err = mall.DownItems() + if err != nil { + return + } + } + + var rewardMap = make(map[int64]struct{}) + var rewardIds []int64 + var ids []int64 + for _, v := range list { + if v.UseStock == -1 { + ids = append(ids, v.ID) + } + + if _, ok := rewardMap[v.RewardID]; !ok { + rewardMap[v.RewardID] = struct{}{} + rewardIds = append(rewardIds, v.RewardID) + } + } + + useStockMap, err := s._useStock(ids) + if err != nil { + return + } + + preward, err := provider.NewRewards(s.Ctx, mall.GetMall().ProjectID, rewardIds...) + if err != nil { + return + } + + s.Res.List = make([]*pb.ItemListRes_One, 0, len(list)) + + for _, v := range list { + info, _ := preward.InfoAutoLang(v.RewardID) + s.Res.List = append(s.Res.List, &pb.ItemListRes_One{ + Id: v.ID, + RewardId: v.RewardID, + Title: info.RewardTitle, + ImgUrl: info.ImgUrl, + Stock: v.Stock, + Remain: utils.Ternary[int64](v.UseStock == -1, v.Stock-useStockMap[v.ID], v.Stock-v.UseStock), + UpType: int32(v.UpType), + UpCustom: v.UpCustom, + UpAt: v.UpAt, + UpFrom: v.UpFrom, + UpShow: v.GetUpShow(), + DownType: int32(v.DownType), + DownCustom: v.DownCustom, + DownAt: v.DownAt, + DownFrom: v.DownFrom, + DownShow: v.GetDownShow(), + Status: v.GetStatus(), + CoinNum: v.CoinNum, + UseStock: utils.Ternary[int64](v.UseStock == -1, useStockMap[v.ID], v.UseStock), + }) + } + + return +} + +func (s *ItemList) _useStock(ids []int64) (data map[int64]int64, err error) { + data = make(map[int64]int64) + if len(ids) == 0 { + return + } + + stock, err := stocks.NewMallItem(s.Ctx, ids...) + if err != nil { + return + } + + data, err = stock.AllUseStock() + if err != nil { + return + } + + return +} diff --git a/internal/service/containers/mall/item_status.go b/internal/service/containers/mall/item_status.go new file mode 100644 index 0000000..473cdd1 --- /dev/null +++ b/internal/service/containers/mall/item_status.go @@ -0,0 +1,190 @@ +package mall + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_mall" + "joybuywork/proto/go_proto/workerr" + "time" + + "gorm.io/gen/field" +) + +type ItemStatus struct { + logic.Logic + + Req *pb.ItemStatusReq + Res *pb.ItemStatusRes +} + +func (s *ItemStatus) Run() (err error) { + return logic.Run(s) +} + +func (s *ItemStatus) Exec() (err error) { + item, err := s.item() + if err != nil { + return + } + + return s.status(item) +} + +func (s *ItemStatus) item() (item *model.RedeemMallItem, err error) { + item, err = cache.NewRedeemMallItem(s.Ctx).FindById(s.Req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if item == nil { + err = workerr.NotFound("not_found item") + return + } + + s.Res.Id = item.ID + + return +} + +func (s *ItemStatus) status(item *model.RedeemMallItem) (err error) { + switch s.Req.GetStatus() { + case 1: //上架 + err = s._up(item) + if err != nil { + return + } + case 2: //下架 + err = s._down(item) + if err != nil { + return + } + case 3: //删除 + err = s._delete(item) + if err != nil { + return + } + default: + return s.BE().VerifyError("invalid status") + } + + s.AddAfterRun(func() (err error) { + return cache.NewRedeemMallItem(s.Ctx).Clear(item) + }) + + return +} + +func (s *ItemStatus) _up(item *model.RedeemMallItem) (err error) { + if item.GetStatus() == mtype.RedeemMallItemStatusUp { + return + } + + if item.GetStatus() != mtype.RedeemMallItemStatusWait { + return s.BE().VerifyError("Not a item waiting to be listed") + } + + m := s.GetDao().RedeemMallItem + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(item.ID)).UpdateSimple( + m.UpAt.Value(time.Now().Unix()), + m.UpFrom.Value(mtype.RedeemMallItemUpFromManual), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *ItemStatus) _down(item *model.RedeemMallItem) (err error) { + if item.GetStatus() == mtype.RedeemMallItemStatusDown { + return + } + + m := s.GetDao().RedeemMallItem + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(item.ID)).UpdateSimple( + m.DownAt.Value(time.Now().Unix()), + m.DownFrom.Value(mtype.RedeemMallItemDownFromManual), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return s._task(item, mtype.RedeemMallItemTaskMarkDown) +} + +func (s *ItemStatus) _delete(item *model.RedeemMallItem) (err error) { + if item.GetStatus() == mtype.RedeemMallItemStatusDel { + return + } + + m := s.GetDao().RedeemMallItem + var up = []field.AssignExpr{ + m.IsDel.Value(mtype.Yes), + } + + if item.GetStatus() != mtype.RedeemMallItemStatusDown { + up = append( + up, + m.DownAt.Value(time.Now().Unix()), + m.DownFrom.Value(mtype.RedeemMallItemDownFromDel), + ) + + err = s._task(item, mtype.RedeemMallItemTaskMarkDown) + if err != nil { + return + } + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(item.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *ItemStatus) _task(item *model.RedeemMallItem, mark string) (err error) { + + m := s.GetDao().RedeemMallItemTask + task, err := m.WithContext(s.Ctx).Where(m.ItemID.Eq(item.ID), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if task == nil { + return + } + + switch task.Mark { + case mtype.RedeemMallItemTaskMarkDown: + + var stock *stocks.MallItem + stock, err = stocks.NewMallItem(s.Ctx, item.ID) + if err != nil { + return + } + + useNum, _ := stock.GetUseStock(item.ID) + + itemM := s.GetDao().RedeemMallItem + _, err = itemM.WithContext(s.Ctx).Where(itemM.ID.Eq(item.ID)).UpdateSimple( + itemM.UseStock.Value(useNum), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + } + + return +} diff --git a/internal/service/containers/mall/item_store.go b/internal/service/containers/mall/item_store.go new file mode 100644 index 0000000..bac3840 --- /dev/null +++ b/internal/service/containers/mall/item_store.go @@ -0,0 +1,99 @@ +package mall + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/utils/logic" + "time" + + pb "joybuywork/proto/go_proto/w_mall" +) + +type ItemStore struct { + logic.Logic + + Req *pb.ItemStoreReq + Res *pb.ItemStoreRes +} + +func (s *ItemStore) Run() (err error) { + return logic.Run(s) +} + +func (s *ItemStore) Exec() (err error) { + + item, err := s.store() + if err != nil { + return + } + + return s.task(item) +} + +func (s *ItemStore) store() (item *model.RedeemMallItem, err error) { + mall, err := malls.NewMall(s.Ctx, s.Req.GetMallId()) + if err != nil { + return + } + + item = withdefault.RedeemMallItem(&model.RedeemMallItem{ + MallID: mall.GetMall().ID, + RewardID: s.Req.GetRewardId(), + CoinNum: s.Req.GetCoinNum(), + Stock: s.Req.GetStock(), + UpType: int8(s.Req.GetUpType()), + DownType: int8(s.Req.GetDownType()), + DownCustom: s.Req.GetDownCustom(), + }) + + switch s.Req.GetUpType() { + case mtype.RedeemMallItemUpTypeNow: + item.UpAt = time.Now().Unix() + item.UpFrom = mtype.RedeemMallItemUpFromNow + case mtype.RedeemMallItemUpTypeCustom: + item.UpCustom = s.Req.GetUpCustom() + item.UpAt = s.Req.GetUpCustom() + item.UpFrom = mtype.RedeemMallItemUpFromTiming + } + + list, err := mall.UpItems() + if err != nil { + return + } + + if len(list) > 0 { + item.Sort = list[0].Sort + 1 + } + + item.SetUpShow(s.Req.GetUpShow()) + item.SetDownShow(s.Req.GetDownShow()) + + if err = s.GetDao().RedeemMallItem.WithContext(s.Ctx).Create(item); err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Id = item.ID + + return +} + +func (s *ItemStore) task(item *model.RedeemMallItem) (err error) { + if item.DownType == mtype.RedeemMallItemDownTypeCustom { + + task := withdefault.RedeemMallItemTask(&model.RedeemMallItemTask{ + ItemID: item.ID, + DoAt: item.DownCustom, + Mark: mtype.RedeemMallItemTaskMarkDown, + }) + + if err = s.GetDao().RedeemMallItemTask.WithContext(s.Ctx).Create(task); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} diff --git a/internal/service/containers/mall/item_update.go b/internal/service/containers/mall/item_update.go new file mode 100644 index 0000000..71c6d7d --- /dev/null +++ b/internal/service/containers/mall/item_update.go @@ -0,0 +1,153 @@ +package mall + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_mall" + "joybuywork/proto/go_proto/workerr" + "time" +) + +const ( + downTaskDel = iota + 1 + downTaskAdd + downTaskChange +) + +type ItemUpdate struct { + logic.Logic + + Req *pb.ItemUpdateReq + Res *pb.ItemUpdateRes + + changeStock bool + + downTask int +} + +func (s *ItemUpdate) Run() (err error) { + return logic.Run(s) +} + +func (s *ItemUpdate) Exec() (err error) { + item, err := s.item() + if err != nil { + return + } + + err = s.update(item) + if err != nil { + return + } + + return s.task(item) +} + +func (s *ItemUpdate) item() (item *model.RedeemMallItem, err error) { + item, err = cache.NewRedeemMallItem(s.Ctx).FindById(s.Req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if item == nil { + err = workerr.NotFound("not_found item") + return + } + + s.Res.Id = item.ID + + return +} + +func (s *ItemUpdate) update(item *model.RedeemMallItem) (err error) { + if item.Stock != s.Req.GetStock() { + s.changeStock = true + } + + if item.DownType != int8(s.Req.GetDownType()) { + switch s.Req.GetDownCustom() { + case mtype.RedeemMallItemDownTypeNone: + s.downTask = downTaskDel + case mtype.RedeemMallItemDownTypeCustom: + s.downTask = downTaskAdd + } + } else if item.DownCustom != s.Req.GetDownCustom() { + s.downTask = downTaskChange + } + + item.RewardID = s.Req.GetRewardId() + item.Stock = s.Req.GetStock() + item.CoinNum = s.Req.GetCoinNum() + item.UpType = int8(s.Req.GetUpType()) + item.DownType = int8(s.Req.GetDownType()) + item.DownCustom = s.Req.GetDownCustom() + + switch s.Req.GetUpType() { + case mtype.RedeemMallItemUpTypeNow: + item.UpAt = time.Now().Unix() + item.UpFrom = mtype.RedeemMallItemUpFromNow + case mtype.RedeemMallItemUpTypeCustom: + item.UpCustom = s.Req.GetUpCustom() + item.UpAt = s.Req.GetUpCustom() + item.UpFrom = mtype.RedeemMallItemUpFromTiming + } + + item.SetUpShow(s.Req.GetUpShow()) + item.SetDownShow(s.Req.GetDownShow()) + + m := s.GetDao().RedeemMallItem + if err = m.WithContext(s.Ctx).Save(item); err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + return cache.NewRedeemMallItem(s.Ctx).Clear(item) + }) + + return +} + +func (s *ItemUpdate) task(item *model.RedeemMallItem) (err error) { + + switch s.downTask { + case downTaskDel: + m := s.GetDao().RedeemMallItemTask + if _, err = m.WithContext(s.Ctx).Where(m.ItemID.Eq(item.ID)).Delete(); err != nil { + err = s.BE().MysqlError(err) + return + } + case downTaskAdd: + task := withdefault.RedeemMallItemTask(&model.RedeemMallItemTask{ + ItemID: item.ID, + DoAt: item.DownCustom, + Mark: mtype.RedeemMallItemTaskMarkDown, + }) + if err = s.GetDao().RedeemMallItemTask.WithContext(s.Ctx).Create(task); err != nil { + err = s.BE().MysqlError(err) + return + } + case downTaskChange: + m := s.GetDao().RedeemMallItemTask + if _, err = m.WithContext(s.Ctx).Where(m.ItemID.Eq(item.ID)).UpdateSimple(m.DoAt.Value(item.DownCustom)); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if s.changeStock { + var stock *stocks.MallItem + stock, err = stocks.NewMallItem(s.Ctx, item.ID) + if err != nil { + return + } + stock.Clear() + } + + return +} diff --git a/internal/service/containers/mall/list.go b/internal/service/containers/mall/list.go new file mode 100644 index 0000000..06c4d73 --- /dev/null +++ b/internal/service/containers/mall/list.go @@ -0,0 +1,273 @@ +package mall + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_mall" + "joybuywork/proto/go_proto/workerr" + "time" + + t_center_statpb "gits.branchcn.com/backend/taskcenter/proto/go_proto/t_center_stat" + "gorm.io/gen" + "gorm.io/gen/field" +) + +type List struct { + logic.Logic + + Req *pb.ListReq + Res *pb.ListRes +} + +func (s *List) Run() (err error) { + return logic.Run(s) +} + +func (s *List) Exec() (err error) { + project, err := s.project() + if err != nil { + return + } + + return s.list(project) +} + +func (s *List) project() (project *model.Project, err error) { + project, err = finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + err = workerr.NotFound("project not found") + return + } + + return +} + +func (s *List) list(project *model.Project) (err error) { + m := s.GetDao().RedeemMall + + var cond = []gen.Condition{ + m.ProjectID.Eq(project.ID), + m.IsDel.Eq(mtype.No), + } + + if s.Req.GetTitle() != "" { + cond = append(cond, m.Title.Like(utils.DbAllLike(s.Req.GetTitle()))) + } + + if s.Req.GetStatus() != 0 { + cond = append(cond, m.Status.Eq(int8(s.Req.GetStatus()))) + } + + var orderBy []field.Expr + if len(s.Req.GetOrderBy()) == 0 { + // 排序字段(1-创建最晚优先,2-创建最早优先,3-使用中优先,4-暂未使用优先) + for _, v := range s.Req.GetOrderBy() { + + switch v { + case 1: + orderBy = append(orderBy, m.CreatedAt.Desc()) + case 2: + orderBy = append(orderBy, m.CreatedAt) + case 3: + orderBy = append(orderBy, m.Status) + case 4: + orderBy = append(orderBy, m.Status.Desc()) + } + } + } + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err := m.WithContext(s.Ctx).Where(cond...).Order(orderBy...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if total == 0 { + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + relateMap, err := s._relate(ids) + if err != nil { + return + } + + rewardMap, err := s._reward(project.ID, ids) + if err != nil { + return + } + + s.Res.Total = total + s.Res.List = make([]*pb.ListRes_One, 0, len(list)) + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + Title: v.Title, + Status: int32(v.Status), + CreatedAt: v.CreatedAt, + Rewards: rewardMap[v.ID], + Relates: relateMap[v.ID], + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +func (s *List) _reward(projectId int64, ids []int64) (data map[int64][]*pb.ListRes_Reward, err error) { + data = make(map[int64][]*pb.ListRes_Reward, len(ids)) + if len(ids) == 0 { + return + } + + m := s.GetDao().RedeemMallItem + list, err := m.WithContext(s.Ctx).Where( + m.MallID.In(ids...), + m.DownAt.Eq(mtype.No), + m.IsDel.Eq(mtype.No), + m.UpAt.Lte(time.Now().Unix()), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardMap = make(map[int64]string) + var rewardIds []int64 + for _, v := range list { + if _, ok := rewardMap[v.RewardID]; !ok { + rewardIds = append(rewardIds, v.RewardID) + rewardMap[v.RewardID] = "" + } + } + + preward, err := provider.NewRewards(s.Ctx, projectId, rewardIds...) + if err != nil { + return + } + + for _, v := range list { + if !v.IsShow() { + continue + } + + info, _ := preward.InfoAutoLang(v.RewardID) + data[v.MallID] = append(data[v.MallID], &pb.ListRes_Reward{ + Id: v.ID, + Title: info.RewardTitle, + ImgUrl: info.ImgUrl, + }) + } + + return +} + +func (s *List) _relate(ids []int64) (data map[int64][]*pb.ListRes_Relate, err error) { + data = make(map[int64][]*pb.ListRes_Relate, len(ids)) + if len(ids) == 0 { + return + } + + m := s.GetDao().RedeemMallRelate + list, err := m.WithContext(s.Ctx).Where(m.MallID.In(ids...), m.CancelTime.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cpnIds, centerIds []int64 + for _, v := range list { + switch v.Source { + case mtype.RedeemMallRelateSourceCenter: + centerIds = append(centerIds, v.RelateID) + case mtype.RedeemMallRelateSourceCampaign: + cpnIds = append(cpnIds, v.RelateID) + } + } + + cpnTitle, err := s._cpnTitle(cpnIds) + if err != nil { + return + } + + centerTitle, err := s._centerTitle(centerIds) + if err != nil { + return + } + + for _, v := range list { + one := &pb.ListRes_Relate{ + Id: v.ID, + Source: int32(v.Source), + } + + switch v.Source { + case mtype.RedeemMallRelateSourceCenter: + one.Title = centerTitle[v.RelateID] + case mtype.RedeemMallRelateSourceCampaign: + one.Title = cpnTitle[v.RelateID] + } + + data[v.MallID] = append(data[v.MallID], one) + } + + return +} + +func (s *List) _centerTitle(ids []int64) (data map[int64]string, err error) { + data = make(map[int64]string, len(ids)) + + if len(ids) == 0 { + return + } + + res, err := app.NewTaskcenterCenterStat().DemTitle(s.Ctx, &t_center_statpb.DemTitleReq{ + CenterIds: ids, + }) + + if err != nil { + return + } + + for _, v := range res.GetCenters() { + data[v.GetId()] = v.GetTitle() + } + + return +} + +func (s *List) _cpnTitle(ids []int64) (data map[int64]string, err error) { + data = make(map[int64]string, len(ids)) + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + data[v.ID] = v.Title + } + + return +} diff --git a/internal/service/containers/mall/user_item_list.go b/internal/service/containers/mall/user_item_list.go new file mode 100644 index 0000000..7e09bf6 --- /dev/null +++ b/internal/service/containers/mall/user_item_list.go @@ -0,0 +1,103 @@ +package mall + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_mall" + "time" +) + +type UserItemList struct { + logic.Logic + + Req *pb.UserItemListReq + Res *pb.UserItemListRes +} + +func (s *UserItemList) Run() (err error) { + return logic.Run(s) +} + +func (s *UserItemList) Exec() (err error) { + return s.list() +} + +func (s *UserItemList) list() (err error) { + mall, err := malls.NewMall(s.Ctx, s.Req.GetMallId()) + if err != nil { + return + } + + list, err := mall.UpItems() + if err != nil { + return + } + + var showList []*model.RedeemMallItem + for _, v := range list { + if v.IsShow() { + showList = append(showList, v) + } + } + + var rewardMap = make(map[int64]struct{}) + var rewardIds []int64 + var ids []int64 + for _, v := range showList { + ids = append(ids, v.ID) + if _, ok := rewardMap[v.ID]; !ok { + rewardMap[v.RewardID] = struct{}{} + rewardIds = append(rewardIds, v.RewardID) + } + } + + useStockMap, err := s._useStock(ids) + if err != nil { + return + } + + preward, err := provider.NewRewards(s.Ctx, mall.GetMall().ProjectID, rewardIds...) + if err != nil { + return + } + + s.Res.List = make([]*pb.UserItemListRes_One, 0, len(showList)) + + for _, v := range showList { + info, _ := preward.InfoAutoLang(v.RewardID) + s.Res.List = append(s.Res.List, &pb.UserItemListRes_One{ + Id: v.ID, + RewardId: v.RewardID, + Title: info.Title, + ImgUrl: info.ImgUrl, + Remain: v.Stock - useStockMap[v.ID], + Status: v.GetStatus(), + UpRemain: v.UpAt - time.Now().Unix(), + CoinNum: v.CoinNum, + }) + } + + return +} + +func (s *UserItemList) _useStock(ids []int64) (data map[int64]int64, err error) { + data = make(map[int64]int64) + if len(ids) == 0 { + return + } + + stock, err := stocks.NewMallItem(s.Ctx, ids...) + if err != nil { + return + } + + data, err = stock.AllUseStock() + if err != nil { + return + } + + return +} diff --git a/internal/service/containers/openplatform/campaign_info.go b/internal/service/containers/openplatform/campaign_info.go new file mode 100644 index 0000000..ae86fe0 --- /dev/null +++ b/internal/service/containers/openplatform/campaign_info.go @@ -0,0 +1,125 @@ +package openplatform + +import ( + "joybuywork/internal/config" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_open_platform" + "fmt" +) + +type CampaignInfo struct { + logic.Logic + Req *pb.CampaignInfoReq + Res *pb.CampaignInfoRes +} + +func (s *CampaignInfo) Run() error { + return logic.Run(s) +} + +func (s *CampaignInfo) Exec() (err error) { + project, cpn, err := s.campaign() + if err != nil { + return + } + + err = s.info(project, cpn) + if err != nil { + return + } + + if len(cpn.GetLangMarks()) <= 1 { + return + } + + return s.langs(cpn) +} + +func (s *CampaignInfo) campaign() (project *model.Project, cpn *model.FissionCampaign, err error) { + project, err = finder.Project(s.Ctx, s.Req.GetProjectId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + err = s.BE().VerifyError("not found project") + return + } + + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = s.BE().VerifyError("not found campaign") + return + } + + return +} + +func (s *CampaignInfo) info(project *model.Project, cpn *model.FissionCampaign) (err error) { + + s.Res.HashId = cpn.HashID + s.Res.Title = cpn.Title + + // 默认渠道 + cl, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserBindChannel(cpn.ID, "") + if err != nil { + return + } + + var clMark string + if cl != nil { + clMark = cl.Mark + } + + s.Res.Link = blink.NewCampaignLink(project.Domain, cpn.HashID, clMark).CampaignShareLink() + + s.Res.Langs = make([]*pb.CampaignInfoRes_Lang, 0, len(cpn.GetLangMarks())) + + style, err := cache.NewCampaignStyle(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.Res.Langs = append(s.Res.Langs, &pb.CampaignInfoRes_Lang{ + Mark: cpn.GetLangMarks()[0], + PageTitle: style.PageTitle, + ShareText: style.ShareText, + ShareImg: fmt.Sprintf("%s/%s", config.Config.Upload.Host, style.ShareImg), + }) + + return +} + +func (s *CampaignInfo) langs(cpn *model.FissionCampaign) (err error) { + m := s.GetDao().FissionCampaignLang + + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + s.Res.Langs = append(s.Res.Langs, &pb.CampaignInfoRes_Lang{ + Mark: v.LangMark, + PageTitle: v.PageTitle, + ShareText: v.ShareText, + ShareImg: fmt.Sprintf("%s/%s", config.Config.Upload.Host, v.ShareImg), + }) + } + + return +} diff --git a/internal/service/containers/openplatform/player.go b/internal/service/containers/openplatform/player.go new file mode 100644 index 0000000..094bd4e --- /dev/null +++ b/internal/service/containers/openplatform/player.go @@ -0,0 +1,143 @@ +package openplatform + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_open_platform" +) + +type Player struct { + logic.Logic + Req *pb.PlayerReq + Res *pb.PlayerRes +} + +func (s *Player) Run() error { + return logic.Run(s) +} + +func (s *Player) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + return s.player(cpn) +} + +func (s *Player) campaign() (cpn *model.FissionCampaign, err error) { + project, err := finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + err = s.BE().VerifyError("not found project") + return + } + + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || project.ID != cpn.ProjectID { + err = s.BE().VerifyError("not found campaign") + return + } + + s.Res.FissionId = cpn.FissionID + + if s.Req.GetStartTime() == 0 { + s.Req.StartTime = cpn.StartTime + } + + if s.Req.GetEndTime() == 0 { + s.Req.EndTime = cpn.EndTime + } + + return +} + +func (s *Player) player(cpn *model.FissionCampaign) (err error) { + user, err := cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + s.Res.Status = 1 + return + } + + switch cpn.FissionID { + case consts.IdKeep: + var keep *players.KeepDog + keep, err = players.NewKeepDog(s.Ctx, user) + if err != nil { + return + } + + player := keep.GetPlayer() + + s.Res.Keep = &pb.PlayerRes_Keep{ + LoveNum: int64(player.CollectNum), + RemainFood: int64(player.Num), + Action: nil, + } + + return s._keepAction(player) + default: + return + } +} + +func (s *Player) _keepAction(player *model.FissionKeep) (err error) { + m := s.GetDao().FissionKeepLog + + feedNum, err := m.WithContext(s.Ctx).Where( + m.KeepID.Eq(player.ID), + m.Type.Eq(mtype.FissionKeepLogTypeFeed), + m.CreatedAt.Between(s.Req.GetStartTime(), s.Req.GetEndTime()), + ).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + collectNum, err := m.WithContext(s.Ctx).Where( + m.KeepID.Eq(player.ID), + m.Type.Eq(mtype.FissionKeepLogTypeLove), + m.CreatedAt.Between(s.Req.GetStartTime(), s.Req.GetEndTime()), + ).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + keepM := s.GetDao().FissionKeep + growPetNum, err := keepM.WithContext(s.Ctx).Where( + keepM.UserID.Eq(player.UserID), + keepM.CreatedAt.Between(s.Req.GetStartTime(), s.Req.GetEndTime()), + ).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.Res.Keep.Action = &pb.PlayerRes_KeepAction{ + FeedNum: feedNum, + CollectNum: collectNum, + GrowPet: growPetNum, + } + + return +} diff --git a/internal/service/containers/openplatform/user_list.go b/internal/service/containers/openplatform/user_list.go new file mode 100644 index 0000000..f11c0ef --- /dev/null +++ b/internal/service/containers/openplatform/user_list.go @@ -0,0 +1,368 @@ +package openplatform + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "fmt" + + pb "joybuywork/proto/go_proto/w_open_platform" +) + +type UserList struct { + logic.Logic + Req *pb.UserListReq + Res *pb.UserListRes +} + +func (s *UserList) Run() error { + return logic.Run(s) +} + +func (s *UserList) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + return s.list(cpn) +} + +func (s *UserList) campaign() (cpn *model.FissionCampaign, err error) { + + project, err := finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + err = s.BE().VerifyError("not found project") + return + } + + cpn, err = finder.Campaign(s.Ctx, s.Req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = s.BE().VerifyError("not found campaign") + return + } + + return +} + +func (s *UserList) list(cpn *model.FissionCampaign) (err error) { + + var list []*model.FissionUser + var total int64 + if s.Req.GetLastRecordId() > 0 { + list, total, err = s._recordList(cpn) + if err != nil { + return + } + + s.Res.Lave = total - int64(len(list)) + } else { + list, total, err = s._pageList(cpn) + if err != nil || total == 0 { + return + } + + s.Res.Total = total + + if s.Req.GetLastRecordId() == 0 { + s.Res.Lave = total - int64(len(list)) + } + } + + var ids = make([]int64, 0, len(list)) + var parentIds []int64 + var parentMap = make(map[int64]*model.FissionUser) + var channelIds []int64 + var channelMap = make(map[int64]string) + var userMark = make([]string, 0, len(list)) + var userCondMap = make(map[int64][]*pb.UserListRes_Cond) + for _, user := range list { + ids = append(ids, user.ID) + userMark = append(userMark, fmt.Sprint(user.ID)) + parentMap[user.ID] = user + + if _, ok := parentMap[user.ParentID]; !ok && user.ParentID > 0 { + parentIds = append(parentIds, user.ParentID) + parentMap[user.ParentID] = nil + } + + if _, ok := channelMap[user.ChannelID]; !ok && user.ChannelID > 0 { + channelIds = append(channelIds, user.ChannelID) + channelMap[user.ChannelID] = "" + } + + } + + statMap, err := s._statMap(ids) + if err != nil { + return + } + + err = s._parentMap(cpn.ID, parentIds, parentMap) + if err != nil { + return + } + + platformMap, err := s._platformMap(cpn.ID, ids) + if err != nil { + return + } + + err = s._channelMap(cpn.ID, channelIds, channelMap) + if err != nil { + return + } + + err = s._conds(cpn.ID, ids, userCondMap) + if err != nil { + return + } + + s.Res.List = make([]*pb.UserListRes_One, 0, len(list)) + + for _, user := range list { + + one := &pb.UserListRes_One{ + Id: user.ID, + DeviceId: user.DeviceID, + SubUserId: user.SubUserID, + Parent: "", + ChildNum: 0, + IndirectNum: 0, + EffectNum: 0, + CreatedAt: user.CreatedAt, + SourceTitle: mtype.FissionUserSource[user.Source], + Platform: platformMap[user.ID], + ChannelTitle: channelMap[user.ChannelID], + JoinAt: user.JoinAt, + Conds: userCondMap[user.ID], + } + + if stat, ok := statMap[user.ID]; ok { + one.ChildNum = stat.DirectNum + one.IndirectNum = stat.IndirectNum + one.EffectNum = stat.EffectiveNum + } + + if parent, ok := parentMap[user.ParentID]; ok { + one.Parent = parent.SubUserID + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +func (s *UserList) _pageList(cpn *model.FissionCampaign) (list []*model.FissionUser, total int64, err error) { + m := s.GetDao().FissionUser.SubTable(cpn.ID) + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.IsView.Eq(mtype.No), + ).Order(m.ID).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *UserList) _recordList(cpn *model.FissionCampaign) (list []*model.FissionUser, total int64, err error) { + m := s.GetDao().FissionUser.SubTable(cpn.ID) + + limit := int(s.Req.GetPerPage()) + if limit == 0 { + limit = 20 + } + + query := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.ID.Gt(s.Req.GetLastRecordId()), + m.IsView.Eq(mtype.No), + ).Limit(limit).Order(m.ID) + + total, err = query.Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if total == 0 { + return + } + + list, err = query.Limit(int(s.Req.GetPerPage())).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *UserList) _parentMap(cpnId int64, ids []int64, parentMap map[int64]*model.FissionUser) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionUser.SubTable(cpnId) + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, user := range list { + parentMap[user.ID] = user + } + + return +} + +func (s *UserList) _statMap(ids []int64) (stat map[int64]*model.FissionUserStat, err error) { + m := s.GetDao().FissionUserStat + + var list []*model.FissionUserStat + + var idsGroup = utils.Groups[int64](ids, 200) + + for _, partIds := range idsGroup { + var parts []*model.FissionUserStat + parts, err = m.WithContext(s.Ctx).Where(m.ID.In(partIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + list = append(list, parts...) + } + + stat = make(map[int64]*model.FissionUserStat, len(list)) + for _, v := range list { + stat[v.UserID] = v + } + + return +} + +func (s *UserList) _platformMap(cpnId int64, ids []int64) (platform map[int64]string, err error) { + + m := s.GetDao().FissionUserAttr + + var list []*model.FissionUserAttr + + var idsGroup = utils.Groups[int64](ids, 200) + + for _, partIds := range idsGroup { + var parts []*model.FissionUserAttr + parts, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.UserID.In(partIds...), m.Attr.Eq(mtype.FissionUserAttrMarkPlatform)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + list = append(list, parts...) + } + + platform = make(map[int64]string, len(ids)) + + for _, v := range list { + platform[v.UserID] = v.Value + } + + return +} + +func (s *UserList) _channelMap(cpnId int64, ids []int64, channelMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + channelMap[v.ID] = v.Title + } + + return +} + +func (s *UserList) _conds(cpnId int64, ids []int64, data map[int64][]*pb.UserListRes_Cond) (err error) { + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpnId)). + Where( + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(conds) == 0 { + return + } + + m := s.GetDao().FissionUserCond + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userCondMap = make(map[int64]map[int64]int64) + for _, v := range list { + + if _, ok := userCondMap[v.UserID]; !ok { + userCondMap[v.UserID] = map[int64]int64{ + v.CondID: v.Num, + } + } else { + userCondMap[v.UserID][v.CondID] = v.Num + } + } + + for _, userId := range ids { + + for _, cond := range conds { + one := &pb.UserListRes_Cond{ + Desc: cond.Desc, + Num: 0, + IfCond: int32(cond.IfCond), + EventType: int32(cond.EventType), + Event: cond.Event, + EventKey: cond.EventKey, + EventVal: cond.EventVal, + } + + if uc, ok := userCondMap[userId]; ok { + one.Num = uc[cond.ID] + } + + data[userId] = append(data[userId], one) + } + } + + return +} diff --git a/internal/service/containers/project_list.go b/internal/service/containers/project_list.go new file mode 100644 index 0000000..6073075 --- /dev/null +++ b/internal/service/containers/project_list.go @@ -0,0 +1,176 @@ +package containers + +import ( + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_project" +) + +type ProjectList struct { + logic.Logic + + Req *pb.ListReq + Res *pb.ListRes +} + +func (s *ProjectList) Run() (err error) { + return logic.Run(s) +} + +func (s *ProjectList) Exec() (err error) { + if s.Req.GetShowUser() { + return s.userList() + } + + return s.adminList() +} + +// 超级管理员能看到的数据 +func (s *ProjectList) adminList() (err error) { + m := s.GetDao().Project + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err := m.WithContext(s.Ctx).Where(m.CompanyID.Eq(s.Req.GetCompanyId()), m.IsDel.Eq(mtype.No)).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + s.Res.List = make([]*pb.ListRes_One, 0, len(list)) + s.Res.Total = total + + if total == 0 { + return + } + + var projectIds []int64 + for _, v := range list { + projectIds = append(projectIds, v.ID) + } + + projectUser, err := s._projectUser(projectIds) + if err != nil { + return + } + + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + Domain: v.Domain, + CreatedTime: v.CreatedAt, + UserRelate: nil, + Scene: int32(v.Scene), + LogoUrl: v.LogoURL, + } + + if relate, ok := projectUser[v.ID]; ok { + one.UserRelate = make([]*pb.ListRes_UserRelate, 0, len(relate)) + for _, user := range relate { + one.UserRelate = append(one.UserRelate, &pb.ListRes_UserRelate{ + UserId: user.ID, + HashId: user.HashID, + ShowName: user.ShowName, + }) + } + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +// 获取项目关联的员工 +func (s *ProjectList) _projectUser(projectIds []int64) (map[int64][]*model.User, error) { + relateM := s.GetDao().UserProjectRelate + relate, err := relateM.WithContext(s.Ctx).Where(relateM.ProjectID.In(projectIds...), relateM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return nil, s.BE().MysqlError(err) + } + + var urp = make(map[int64][]int64) + + var userIds []int64 + for _, v := range relate { + if _, ok := urp[v.UserID]; !ok { + userIds = append(userIds, v.UserID) + } + urp[v.UserID] = append(urp[v.UserID], v.ProjectID) + } + + userM := s.GetDao().User + user, err := userM.WithContext(s.Ctx).Select(userM.ID, userM.HashID, userM.ShowName).Where(userM.ID.In(userIds...), userM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return nil, s.BE().MysqlError(err) + } + + var projectUser = make(map[int64][]*model.User) + + for _, v := range user { + if pids, ok := urp[v.ID]; ok { + for _, pid := range pids { + projectUser[pid] = append(projectUser[pid], v) + } + } + } + + return projectUser, nil +} + +// 员工可见列表 +func (s *ProjectList) userList() (err error) { + relateM := s.GetDao().UserProjectRelate + var projectIds []int64 + err = relateM.WithContext(s.Ctx).Where(relateM.UserID.Eq(s.Req.GetUserId()), relateM.IsDel.Eq(mtype.No)).Pluck(relateM.ProjectID, &projectIds) + if err != nil { + return s.BE().MysqlError(err) + } + + if len(projectIds) == 0 { + return + } + + m := s.GetDao().Project + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err := m.WithContext(s.Ctx).Where(m.CompanyID.Eq(s.Req.GetCompanyId()), m.IsDel.Eq(mtype.No)).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + s.Res.List = make([]*pb.ListRes_One, 0, len(list)) + s.Res.Total = total + + if total == 0 { + return + } + + user, err := finder.User(s.Ctx, s.Req.GetUserId()) + if err != nil { + return + } + + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + Domain: v.Domain, + CreatedTime: v.CreatedAt, + UserRelate: []*pb.ListRes_UserRelate{ + { + UserId: user.ID, + HashId: user.HashID, + ShowName: user.ShowName, + }, + }, + } + + s.Res.List = append(s.Res.List, one) + } + return +} diff --git a/internal/service/containers/project_save_ads_config.go b/internal/service/containers/project_save_ads_config.go new file mode 100644 index 0000000..2fb401b --- /dev/null +++ b/internal/service/containers/project_save_ads_config.go @@ -0,0 +1,151 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_project" + "joybuywork/proto/go_proto/workerr" + "gorm.io/gen/field" +) + +type ProjectSaveAdsConfig struct { + logic.Logic + + Req *pb.SaveAdsConfigReq + Res *pb.SaveAdsConfigRes + + adClose bool +} + +func (s *ProjectSaveAdsConfig) Run() (err error) { + return logic.Run(s) +} + +func (s *ProjectSaveAdsConfig) Exec() (err error) { + project, err := s.project() + if err != nil { + return + } + + err = s.save(project) + if err != nil { + return + } + + return s.delCond(project.ID) +} + +// 找项目 +func (s *ProjectSaveAdsConfig) project() (project *model.Project, err error) { + user, err := finder.User(s.Ctx, s.Req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil || user.IsAdmin == mtype.No { + err = s.BE().VerifyError("no permission") + return + } + + project, err = finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + return nil, workerr.NotFound("project not found") + } + + return +} + +// 保存配置 +func (s *ProjectSaveAdsConfig) save(project *model.Project) (err error) { + cc := cache.NewProjectAd(s.Ctx) + ads, err := cc.FindByProjectId(project.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + ol := s.OL().User(s.Req.GetUserId(), s.Req.GetIp()) + if ads == nil { + err = s.GetDao().ProjectAd.WithContext(s.Ctx).Create(withdefault.ProjectAd(&model.ProjectAd{ + ProjectID: project.ID, + OpenAd: int8(s.Req.GetOpenAd()), + CampaignAd: int8(s.Req.GetCampaignAd()), + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if s.Req.GetOpenAd() == mtype.Yes { + ol.ProjectAds(project.ID, mtype.No, mtype.Yes) + } + + if s.Req.GetCampaignAd() == mtype.Yes { + ol.ProjectCpnAds(project.ID, mtype.No, mtype.Yes) + } + + user, _ := finder.User(s.Ctx, s.Req.GetUserId()) + if user != nil { + app.FeishuNoticeSend("[%s] 开启了[%s]项目的广告模块", user.Email, project.Title) + } + + return + } + + m := s.GetDao().ProjectAd + var up []field.AssignExpr + if ads.CampaignAd != int8(s.Req.GetCampaignAd()) { + up = append(up, m.CampaignAd.Value(int8(s.Req.GetCampaignAd()))) + ol.ProjectAds(project.ID, ads.CampaignAd, int8(s.Req.GetCampaignAd())) + } + + if ads.OpenAd != int8(s.Req.GetOpenAd()) { + up = append(up, m.OpenAd.Value(int8(s.Req.GetOpenAd()))) + ol.ProjectCpnAds(project.ID, ads.OpenAd, int8(s.Req.GetOpenAd())) + + // 如果状态改变,以前是开启,那现在就是要关闭了 + s.adClose = ads.OpenAd == mtype.Yes + } + + if len(up) == 0 { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(ads.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + s.AddAfterRun(func() (err error) { + _ = cc.Clear(ads) + return + }) + + return +} + +func (s *ProjectSaveAdsConfig) delCond(projectId int64) (err error) { + if !s.adClose { + return + } + + m := s.GetDao().FissionCampaignCond + _, err = m.WithContext(s.Ctx).Where(m.ProjectID.Eq(projectId), m.EventType.Eq(mtype.FissionCampaignCondEventTypeAds), m.IsDel.Eq(mtype.No)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/containers/project_store.go b/internal/service/containers/project_store.go new file mode 100644 index 0000000..95af4c2 --- /dev/null +++ b/internal/service/containers/project_store.go @@ -0,0 +1,161 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/encrypt" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_project" + "joybuywork/proto/go_proto/workerr" + + oprojectpb "gits.branchcn.com/backend/oplatform/proto/go_proto/oproject" + "gorm.io/gen" +) + +type ProjectStore struct { + logic.Logic + + Req *pb.StoreReq + Res *pb.StoreRes +} + +func (s *ProjectStore) Run() (err error) { + return logic.Run(s) +} + +func (s *ProjectStore) Exec() (err error) { + domain, err := s.domain() + if err != nil { + return + } + + return s.create(domain) +} + +func (s *ProjectStore) create(domain string) (err error) { + m := s.GetDao().Project + + project := withdefault.Project(&model.Project{ + CompanyID: s.Req.GetCompanyId(), + Title: s.Req.GetTitle(), + Domain: domain, + IsAll: utils.Ternary(s.Req.GetIsAll(), int8(mtype.Yes), int8(mtype.No)), + Scene: int8(s.Req.GetScene()), + LogoURL: s.Req.GetLogoUrl(), + FissionCertType: mtype.Yes, + }) + + err = m.WithContext(s.Ctx).Create(project) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s._userProjectRelate(project) + if err != nil { + return + } + + //生成默认密钥 + psm := s.GetDao().ProjectSecret + err = psm.WithContext(s.Ctx).Create(withdefault.ProjectSecret(&model.ProjectSecret{ + ProjectID: project.ID, + CreatorID: s.Req.GetUserId(), + AccessSecret: encrypt.ProjectSecret(project.ID), + })) + if err != nil { + return s.BE().MysqlError(err) + } + + return s._sync(project) +} + +func (s *ProjectStore) _sync(project *model.Project) (err error) { + // 创建项目第三方配置 + _, err = app.NewOProject().CreateWithSecret(s.Ctx, &oprojectpb.CreateWithSecretReq{ + ProjectId: project.ID, + Secret: project.ThirdSecret, + ProjectHash: project.HashID, + }) + return +} + +func (s *ProjectStore) _userProjectRelate(project *model.Project) (err error) { + // 项目没有选择成员 + if !s.Req.GetIsAll() && len(s.Req.GetUserIds()) == 0 { + return + } + + // 关联项目成员 + userM := s.GetDao().User + var cond = []gen.Condition{ + userM.IsDel.Eq(mtype.No), + } + + //不同的查询条件 + if s.Req.GetIsAll() { + cond = append(cond, userM.CompanyID.Eq(s.Req.GetCompanyId())) + } else { + cond = append(cond, userM.HashID.In(s.Req.GetUserIds()...)) + } + + //找到员工 + var userIds []int64 + err = userM.WithContext(s.Ctx).Where(cond...).Pluck(userM.ID, &userIds) + if err != nil { + return s.BE().MysqlError(err) + } + + var adds []*model.UserProjectRelate + for _, v := range userIds { + adds = append(adds, withdefault.UserProjectRelate(&model.UserProjectRelate{ + UserID: v, + ProjectID: project.ID, + })) + } + + if len(adds) > 0 { + err = s.GetDao().UserProjectRelate.WithContext(s.Ctx).Create(adds...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +func (s *ProjectStore) domain() (domain string, err error) { + + if s.Req.GetDomain() == "" { + domain = cmm.NewCMM(s.Ctx, s.GetDao()).GetDomain() + return + } + + domain = s.Req.GetDomain() + lc := app.NewRedisLock(s.Ctx, ckey.ProjectStoreOnce(domain)) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.OnceLockError + return + } + + m := s.GetDao().Project + exist, err := m.WithContext(s.Ctx).Where(m.Domain.Eq(domain), m.CompanyID.Neq(s.Req.GetCompanyId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if exist != nil { + err = workerr.DomainExistError + return + } + + return +} diff --git a/internal/service/containers/project_update.go b/internal/service/containers/project_update.go new file mode 100644 index 0000000..1e2fba6 --- /dev/null +++ b/internal/service/containers/project_update.go @@ -0,0 +1,164 @@ +package containers + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_project" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen" + "gorm.io/gen/field" +) + +type ProjectUpdate struct { + logic.Logic + + Req *pb.UpdateReq + Res *pb.UpdateRes +} + +func (s *ProjectUpdate) Run() (err error) { + return logic.Run(s) +} + +func (s *ProjectUpdate) Exec() (err error) { + project, err := s.project() + if err != nil { + return + } + + err = s.update(project) + if err != nil { + return + } + + err = s.userRelate(project) + if err != nil { + return + } + + return +} + +// 找项目 +func (s *ProjectUpdate) project() (project *model.Project, err error) { + project, err = finder.Project(s.Ctx, s.Req.GetId(), s.Req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + return nil, workerr.NotFound("project not found") + } + + return +} + +// 更新项目信息 +func (s *ProjectUpdate) update(project *model.Project) (err error) { + m := s.GetDao().Project + var updateField []field.AssignExpr + isAll := utils.Ternary(s.Req.GetIsAll(), int8(mtype.Yes), int8(mtype.No)) + if project.Title != s.Req.GetTitle() || project.IsAll != isAll { + updateField = append(updateField, m.Title.Value(s.Req.GetTitle()), m.IsAll.Value(isAll)) + } + if project.LogoURL != s.Req.GetLogoUrl() { + updateField = append(updateField, m.LogoURL.Value(s.Req.GetLogoUrl())) + } + + //没有东西可以更新 + if len(updateField) == 0 { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(project.ID)).UpdateSimple(updateField...) + if err != nil { + return s.BE().MysqlError(err) + } + + s.AddAfterRun(func() (err error) { + return cache.NewProject(s.Ctx).Clear(project) + }) + + return +} + +func (s *ProjectUpdate) userRelate(project *model.Project) (err error) { + // 更新项目关联关系 + if (project.IsAll == mtype.Yes) && s.Req.GetIsAll() { //如果之前是全员可看,现在也是,那证明不需要更新绑定关系 + return + } + + //找到项目的关联员工 + relateM := s.GetDao().UserProjectRelate + urp, err := relateM.WithContext(s.Ctx).Where(relateM.ProjectID.Eq(project.ID), relateM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var urpMap = make(map[int64]*model.UserProjectRelate) + for _, v := range urp { + urpMap[v.UserID] = v + } + + userM := s.GetDao().User + var userCond = []gen.Condition{ + userM.IsDel.Eq(mtype.No), + } + var adds []*model.UserProjectRelate + var dels []int64 + var newUserIds []int64 + if (project.IsAll == mtype.No) && s.Req.GetIsAll() { //如果以前不是全员可看,现在改成全员可看 + // 找到所有普通员工 + userCond = append(userCond, userM.CompanyID.Eq(project.CompanyID)) + } else { + userCond = append(userCond, userM.HashID.In(s.Req.GetUserIds()...)) + } + + err = userM.WithContext(s.Ctx).Where(userCond...).Pluck(userM.ID, &newUserIds) + if err != nil { + return s.BE().MysqlError(err) + } + + var newUserMap = make(map[int64]struct{}) + + // 新的员工id 不在旧的关系里面就要创建 + for _, v := range newUserIds { + newUserMap[v] = struct{}{} + if _, ok := urpMap[v]; !ok { + adds = append(adds, withdefault.UserProjectRelate(&model.UserProjectRelate{ + UserID: v, + ProjectID: project.ID, + })) + } + } + + // 旧的员工id 不在新的关系里面就要删除 + for _, v := range urp { + if _, ok := newUserMap[v.UserID]; !ok { + dels = append(dels, v.ID) + } + } + + if len(adds) > 0 { + err = relateM.WithContext(s.Ctx).Create(adds...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + if len(dels) > 0 { + _, err = relateM.WithContext(s.Ctx).Where(relateM.ID.In(dels...)).UpdateSimple(relateM.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} diff --git a/internal/service/containers/projectuser/point.go b/internal/service/containers/projectuser/point.go new file mode 100644 index 0000000..36a0cdf --- /dev/null +++ b/internal/service/containers/projectuser/point.go @@ -0,0 +1,81 @@ +package containers + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/finder" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_project_user" +) + +type Point struct { + logic.Logic + + Req *pb.PointReq + Res *pb.PointRes +} + +func (s *Point) Run() (err error) { + return logic.Run(s) +} + +func (s *Point) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *Point) Exec() (err error) { + pu, err := s.pu() + if err != nil { + return + } + + if s.Req.GetPointSource() == 0 { + return s.app(pu) + } + + return s.sys(pu) +} + +func (s *Point) pu() (pu *projectuser.ProjectUser, err error) { + project, err := finder.Project(s.Ctx, s.Req.GetProjectId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + pu, err = projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(project.ID, s.Req.GetUserId())) + if err != nil { + return + } + + return +} + +func (s *Point) app(pu *projectuser.ProjectUser) (err error) { + userInfo, err := s2s.NewUserInfo(s.Ctx, pu.GetProjectUser(), s.Req.GetUrlId()) + if err != nil { + return + } + + info, err := userInfo.UserInfo(s.Req.GetLangMark()) + if err != nil { + return + } + + s.Res.CoinNum = info.CoinNum + + return +} + +func (s *Point) sys(pu *projectuser.ProjectUser) (err error) { + coin, err := pu.GetCoin() + if err != nil { + return + } + + s.Res.CoinNum = coin.Num + + return +} diff --git a/internal/service/containers/register_store.go b/internal/service/containers/register_store.go new file mode 100644 index 0000000..d753ee5 --- /dev/null +++ b/internal/service/containers/register_store.go @@ -0,0 +1,121 @@ +package containers + +import ( + "joybuywork/internal/plugins/encrypt" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_register" + "joybuywork/proto/go_proto/workerr" +) + +type RegisterStore struct { + logic.Logic + + Req *pb.StoreReq + Res *pb.StoreRes +} + +func (s *RegisterStore) Run() (err error) { + return logic.Run(s) +} + +func (s *RegisterStore) Exec() (err error) { + err = s.check() + if err != nil { + return + } + + reg, err := s.register() + if err != nil { + return + } + + return s.autoPass(reg) +} + +// 看看能不能申请 +func (s *RegisterStore) check() error { + //验证用户名是否被使用 + m := s.GetDao().User + exist, err := m.WithContext(s.Ctx).Where(m.Username.Eq(s.Req.GetUsername())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if exist != nil && exist.IsDel == mtype.No { + return workerr.UserExistError + } + + return nil +} + +func (s *RegisterStore) register() (reg *model.Register, err error) { + m := s.GetDao().Register + + reg = withdefault.Register(&model.Register{ + Username: s.Req.GetUsername(), + Passwd: s.Req.GetPasswd(), + AuditType: mtype.RegisterAuditTypePass, + Email: s.Req.GetEmail(), + ShortName: s.Req.GetShortName(), + Phone: s.Req.GetPhone(), + AppName: s.Req.GetAppName(), + }) + + err = m.WithContext(s.Ctx).Create(reg) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *RegisterStore) autoPass(reg *model.Register) (err error) { + if reg.AuditType != mtype.RegisterAuditTypePass { + return + } + + //创建审核记录 + err = s.GetDao().RegisterAudit.WithContext(s.Ctx).Create(withdefault.RegisterAudit(&model.RegisterAudit{ + RegisterID: reg.ID, + Pass: mtype.Yes, + Desc: "系统自动通过", + OperatorID: 0, + })) + + if err != nil { + return s.BE().MysqlError(err) + } + + //创建企业 + var company = withdefault.Company(&model.Company{ + ShortName: s.Req.GetShortName(), + Phone: reg.Phone, + AppName: reg.AppName, + }) + err = s.GetDao().Company.WithContext(s.Ctx).Create(company) + + if err != nil { + return s.BE().MysqlError(err) + } + + //创建初始账号 + err = s.GetDao().User.WithContext(s.Ctx).Create(withdefault.User(&model.User{ + CompanyID: company.ID, + Username: s.Req.GetUsername(), + ShowName: s.Req.GetUsername(), + Passwd: encrypt.UserPasswd(s.Req.GetPasswd()), + IsAdmin: mtype.Yes, + Email: s.Req.GetEmail(), + })) + + if err != nil { + return s.BE().MysqlError(err) + } + + return +} diff --git a/internal/service/containers/reward_list.go b/internal/service/containers/reward_list.go new file mode 100644 index 0000000..0b685ef --- /dev/null +++ b/internal/service/containers/reward_list.go @@ -0,0 +1,237 @@ +package containers + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_reward" + "strings" + + "gorm.io/gen" +) + +type Num struct { + RewardId int64 + Num int64 +} + +type RewardList struct { + logic.Logic + + Req *pb.ListReq + Res *pb.ListRes +} + +func (s *RewardList) Run() (err error) { + return logic.Run(s) +} + +func (s *RewardList) Exec() (err error) { + project, err := finder.Project(s.Ctx, s.Req.GetProjectHashId()) + if err != nil { + return + } + + if project == nil { + return + } + + m := s.GetDao().Reward + + var cond = []gen.Condition{ + m.ProjectID.Eq(project.ID), + m.IsDel.Eq(mtype.No), + } + + query := m.WithContext(s.Ctx) + + if s.Req.GetRewardTitle() != "" { + cond = append(cond, m.RewardTitle.Like(utils.DbAllLike(s.Req.GetRewardTitle()))) + } + + if s.Req.GetLangMark() != "" || s.Req.GetTitle() != "" { + rewardM := s.GetDao().RewardLang + query = query.Join(rewardM, rewardM.RewardID.EqCol(m.ID)).Group(m.ID) + + if s.Req.GetLangMark() != "" { + lms := strings.Split(s.Req.GetLangMark(), ",") + cond = append(cond, rewardM.Mark.In(lms...)) + } + + if s.Req.GetTitle() != "" { + cond = append(cond, rewardM.Title.Like(utils.DbAllLike(s.Req.GetTitle()))) + } + } + + switch s.Req.GetOrderType() { + case 1: + query = query.Order(m.CreatedAt) + default: + query = query.Order(m.ID.Desc()) + } + + offset, limit := utils.PpDbLo(s.Req.GetPage(), s.Req.GetPerPage()) + list, total, err := query.Where(cond...).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + s.Res.List = make([]*pb.ListRes_One, 0, len(list)) + s.Res.Total = total + + if total == 0 { + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + relateNum, err := s._relatedNum(ids) + if err != nil { + return + } + + titleAndImg, langMap, err := s._rewardLangs(ids) + if err != nil { + return + } + + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + RewardTitle: v.RewardTitle, + Title: "", + ImgUrl: "", + ReceiveType: int32(v.ReceiveType), + RelatedNum: relateNum[v.ID], + KvData: nil, + Langs: make([]*pb.ListRes_Lang, 0, len(langMap[v.ID])), + DyRewardType: int32(v.DyRewardType), + CreatedAt: v.CreatedAt, + Contact: v.Contact, + UrlId: v.URLID, + } + + if info, ok := titleAndImg[v.ID]; ok { + one.Title = info.Title + one.ImgUrl = info.ImgURL + } + + _ = jsonm.StrUnmarshal(v.KvData, &one.KvData) + + for _, lang := range langMap[v.ID] { + one.Langs = append(one.Langs, &pb.ListRes_Lang{ + Mark: lang.Mark, + Title: lang.Title, + ImgUrl: lang.ImgURL, + IsDefault: int32(lang.IsDefault), + LangType: int32(mtype.MarkToLangType[lang.Mark]), + ImgId: lang.ImageID, + }) + } + + s.Res.List = append(s.Res.List, one) + } + + return +} + +func (s *RewardList) _relatedNum(ids []int64) (data map[int64]int64, err error) { + data = make(map[int64]int64) + + m := s.GetDao().RewardRelated + + var num []*Num + err = m.WithContext(s.Ctx). + Select(m.RewardID, m.ID.Count().As("num")). + Where(m.RewardID.In(ids...), m.CancelTime.Eq(0)). + Group(m.RewardID). + Scan(&num) + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range num { + data[v.RewardId] = v.Num + } + + return +} + +func (s *RewardList) _rewardLangs(ids []int64) (data map[int64]*model.RewardLang, rlMap map[int64][]*model.RewardLang, err error) { + + m := s.GetDao().RewardLang + list, err := m.WithContext(s.Ctx).Where(m.RewardID.In(ids...), m.IsDel.Eq(mtype.No)).Order(m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + rlMap = make(map[int64][]*model.RewardLang) + for _, v := range list { + rlMap[v.RewardID] = append(rlMap[v.RewardID], v) + } + + data = make(map[int64]*model.RewardLang) + + var idMap = make(map[int64]struct{}) + for _, id := range ids { + idMap[id] = struct{}{} + } + + // 找筛选的第一种语言 + if s.Req.GetLangMark() != "" { + lm := strings.Split(s.Req.GetLangMark(), ",")[0] + for _, v := range list { + if v.Mark == lm { + data[v.RewardID] = v + if _, ok := idMap[v.RewardID]; ok { + delete(idMap, v.RewardID) + } + } + } + } + + // 找页面的语言 + var plmIds []int64 + for id := range idMap { + plmIds = append(plmIds, id) + } + + if len(plmIds) == 0 { + return + } + + for _, v := range list { + if v.Mark == s.Req.GetPageLang() { + data[v.RewardID] = v + if _, ok := idMap[v.RewardID]; ok { + delete(idMap, v.RewardID) + } + } + + } + + // 找默认语言 + var dfIds []int64 + for id := range idMap { + dfIds = append(dfIds, id) + } + + if len(dfIds) == 0 { + return + } + + for _, v := range list { + if _, ok := data[v.RewardID]; !ok && v.IsDefault == mtype.Yes { + data[v.RewardID] = v + } + } + + return +} diff --git a/internal/service/containers/user_login.go b/internal/service/containers/user_login.go new file mode 100644 index 0000000..9772126 --- /dev/null +++ b/internal/service/containers/user_login.go @@ -0,0 +1,160 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/encrypt" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_user" + "joybuywork/proto/go_proto/workerr" + + c_userpb "gits.branchcn.com/backend/certified/proto/go_proto/c_user" +) + +type UserLogin struct { + logic.Logic + + Req *pb.LoginReq + Res *pb.LoginRes +} + +func (s *UserLogin) Run() (err error) { + return logic.Run(s) +} + +func (s *UserLogin) Exec() (err error) { + if s.Req.Code != "" { + err = s.codeUser() + if err != nil { + return + } + err = s.codeToken() + return + } + user, err := s.user() + if err != nil { + return + } + err = s.token(user) + if err != nil { + return + } + return +} + +// 查询用户 +func (s *UserLogin) user() (user *model.User, err error) { + userM := s.GetDao().User + user, err = userM.WithContext(s.Ctx).Where(userM.Username.Eq(s.Req.GetUsername()), userM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user == nil || user.IsDel == mtype.Yes { + err = workerr.LoginError + return + } + + valid, err := encrypt.CheckUserPasswd(s.Req.Passwd, user.Passwd) + if err != nil || !valid { + err = workerr.LoginError + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = user.ID + s.Res.HashId = user.HashID + s.Res.Email = user.Email + s.Res.IsAdmin = user.IsAdmin == mtype.Yes + s.Res.Name = user.ShowName + s.Res.Username = user.Username + s.Res.RoleName = utils.Ternary[string](user.IsAdmin == mtype.No, consts.NormalRoleName, consts.AdminRoleName) + s.Res.CompanyId = user.CompanyID + + return + }) + + return +} + +// 生产token +func (s *UserLogin) token(user *model.User) (err error) { + res, err := app.NewCertifiedUser().Token(s.Ctx, &c_userpb.TokenReq{ + Id: user.ID, + HashId: user.HashID, + CompanyId: user.CompanyID, + IsAdmin: user.IsAdmin == mtype.Yes, + }) + + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Token = res.GetToken() + s.Res.Expired = res.GetExpired() + return + }) + + return +} + +// 查询用户 +func (s *UserLogin) codeUser() (err error) { + res, err := app.NewCertifiedUser().CodeUser(s.Ctx, &c_userpb.CodeUserReq{ + AuthCode: s.Req.Code, + }) + if err != nil { + return + } + userM := s.GetDao().User + var user *model.User + user, err = userM.WithContext(s.Ctx).Where(userM.ID.Eq(res.GetId()), userM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user == nil || user.IsDel == mtype.Yes { + err = workerr.LoginError + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Id = user.ID + s.Res.HashId = user.HashID + s.Res.Email = user.Email + s.Res.IsAdmin = user.IsAdmin == mtype.Yes + s.Res.Name = user.ShowName + s.Res.Username = user.Username + s.Res.RoleName = utils.Ternary[string](user.IsAdmin == mtype.No, consts.NormalRoleName, consts.AdminRoleName) + s.Res.CompanyId = user.CompanyID + + return + }) + + return +} + +// Code生产token +func (s *UserLogin) codeToken() (err error) { + res, err := app.NewCertifiedUser().CodeToken(s.Ctx, &c_userpb.CodeTokenReq{ + AuthCode: s.Req.Code, + }) + if err != nil { + return + } + + s.AddAfterRun(func() (err error) { + s.Res.Token = res.GetToken() + s.Res.Expired = res.GetExpired() + return + }) + + return +} diff --git a/internal/service/crons/action/action.go b/internal/service/crons/action/action.go new file mode 100644 index 0000000..24eac33 --- /dev/null +++ b/internal/service/crons/action/action.go @@ -0,0 +1,169 @@ +package action + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/printer" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/utils" + "joybuywork/internal/utils/merr" + "fmt" + "time" + + "github.com/rs/xid" + rl "gits.branchcn.com/backend/microcode/plugins/derivative/lock" +) + +const ( + loggerModPrint = "print" + loggerModDb = "db" +) + +type OnceKey struct { + exp time.Duration //锁过期时间 + key string //锁key + release bool //是否直接完毕释放,(有一些可能需要一直锁着) +} + +type SyncProgress struct { + total int64 //任务总数 + sp chan int64 //当前已处理的任务数 + tf func() int64 //计算任务总数的方法 +} + +type IAction interface { + Init(ctx context.Context) //基于ctx的初始化处理 + Exec() error //执行方法 + OnceKey() *OnceKey //锁,防止多服务器并发操作 + Desc() string //描述,用来做关键字搜索 + Alert() bool //推送消息 + LoggerMod() string //日志模式 + DbExec() (total, successNum, failNum int64, err error) //Db执行方法 +} + +type Action struct { + ctx context.Context + be *merr.BusinessError +} + +func (a *Action) Exec() error { + return nil +} + +func (a *Action) DbExec() (total, successNum, failNum int64, err error) { + return +} + +func (a *Action) BE() *merr.BusinessError { + return a.be +} + +func (a *Action) Alert() bool { + return false +} + +func (a *Action) LoggerMod() string { + return loggerModPrint +} + +func (a *Action) Init(ctx context.Context) { + a.ctx = ctx + a.be = merr.NewBE(ctx) +} + +type Job struct { + R IAction +} + +func (s *Job) Run() { + taskId := xid.New().String() + ctx, cancel := context.WithCancel(context.WithValue(context.Background(), consts.TraceIdKey, taskId)) + defer cancel() + + s.R.Init(ctx) + + switch s.R.LoggerMod() { + case loggerModPrint: + s.print(ctx, taskId) + case loggerModDb: + s.db(ctx) + } +} + +func (s *Job) db(ctx context.Context) { + //防止多服务器同时执行,用redis上锁 + if s.R.OnceKey() != nil { + lock := app.NewRedisLock(ctx, s.R.OnceKey().key, rl.SetExpire(s.R.OnceKey().exp)) + if !lock.SoftLock() { + return + } + if s.R.OnceKey().release { + defer lock.Release() + } + } + + //执行任务 + t := time.Now() + total, successNum, failNum, err := s.R.DbExec() + if total == 0 { + return + } + + dao.CronLog.WithContext(ctx).Create(&model.CronLog{ + ExecAt: t.Unix(), + Desc: s.R.Desc(), + Machine: app.GetLocalIP(), + Total: total, + SuccessNum: successNum, + FailNum: failNum, + ExecStatus: utils.Ternary[int8](err == nil, 1, 2), + ExecFail: utils.Ternary[string](err == nil, "", fmt.Sprintf("%v", err)), + EndAt: t.Unix(), + }) + +} +func (s *Job) print(ctx context.Context, taskId string) { + mark := s.R.Desc() + + //捕捉运行panic,不用默认的捕捉,因为没有链路追踪 + defer func() { + if err := recover(); err != nil { + app.Logger.Error(ctx, fmt.Sprintf("[%s] 执行错误: %v", mark, err)) + } + + if s.R.Alert() { + app.FeishuNormalSend("task_id: %s, [%s]正常执行", taskId, mark) + } + }() + + //防止多服务器同时执行,用redis上锁 + if s.R.OnceKey() != nil { + lock := app.NewRedisLock(ctx, s.R.OnceKey().key, rl.SetExpire(s.R.OnceKey().exp)) + if !lock.SoftLock() { + return + } + if s.R.OnceKey().release { + defer lock.Release() + } + } + + //打印日志,知道这个定时任务执行了 + printer.Print(ctx, fmt.Sprintf("执行定时任务:%s", mark), nil) + + //执行任务 + t := time.Now() + err := s.R.Exec() + if err != nil { + app.Logger.Error(ctx, fmt.Sprintf("[%s] 执行错误: %v", mark, err)) + return + } + + //打印日志,知道这个定时任务执行了 + printer.Print(ctx, fmt.Sprintf("[%s]执行完成,执行时长: %12v", mark, time.Since(t)), err) +} + +func NewJob(r IAction) *Job { + return &Job{R: r} +} diff --git a/internal/service/crons/action/action_test.go b/internal/service/crons/action/action_test.go new file mode 100644 index 0000000..0282051 --- /dev/null +++ b/internal/service/crons/action/action_test.go @@ -0,0 +1,60 @@ +package action + +import ( + "context" + "testing" + + _ "joybuywork/test" +) + +func TestStatHour(t *testing.T) { + d := StatHour{} + + d.Init(context.Background()) + + d.Exec() +} + +func TestStatDay(t *testing.T) { + d := StatDay{} + + d.Init(context.Background()) + + d.Exec() +} + +func TestQuizOpen(t *testing.T) { + + d := CampaignQuizOpen{} + + d.Init(context.Background()) + + d.Exec() +} + +func TestPushNotify(t *testing.T) { + + d := PushNotify{} + + d.Init(context.Background()) + + d.Exec() +} + +func TestCampaignCoinScene(t *testing.T) { + + d := CampaignCoinScene{} + + d.Init(context.Background()) + + d.Exec() +} + +func TestCoinSceneSettlement(t *testing.T) { + + d := CoinSceneSettlement{} + + d.Init(context.Background()) + + d.Exec() +} diff --git a/internal/service/crons/action/campaign.go b/internal/service/crons/action/campaign.go new file mode 100644 index 0000000..ba639ec --- /dev/null +++ b/internal/service/crons/action/campaign.go @@ -0,0 +1,840 @@ +package action + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/crons/action/containers" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/proto/go_proto/workerr" + "fmt" + "sync" + "time" + + "github.com/golang-module/carbon/v2" + "github.com/panjf2000/ants/v2" +) + +type CampaignStart struct { + Action +} + +func (s *CampaignStart) Desc() string { + return "活动开启" +} + +func (s *CampaignStart) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronCampaignStart(), + release: true, + } +} + +func (s *CampaignStart) Exec() (err error) { + m := dao.FissionCampaign + + list, err := m.WithContext(s.ctx).Where( + m.StartTime.Gt(0), + m.StartTime.Lte(time.Now().Unix()), + m.Status.Eq(mtype.FissionCampaignStatusWait), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var cpnMap = make(map[int64]*model.FissionCampaign, len(list)) + var ids, mapIds []int64 + for _, v := range list { + ids = append(ids, v.ID) + cpnMap[v.ID] = v + if v.FissionID == consts.IdDice { + mapIds = append(mapIds, v.ID) + } + } + + confM := dao.FissionCampaignConfig + confs, err := confM.WithContext(s.ctx).Where(confM.CampaignID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var pIds, ptIds []int64 + for _, v := range confs { + if v.HasWhite == mtype.Yes { + ptIds = append(ptIds, v.CampaignID) + continue + } + pIds = append(pIds, v.CampaignID) + } + + if len(pIds) > 0 { + _, err = m.WithContext(s.ctx).Where(m.ID.In(pIds...)).UpdateSimple(m.Status.Value(mtype.FissionCampaignStatusPub)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + unix := time.Now().Unix() + dn := producer.NewDeepworkNotify(s.ctx) + for _, id := range pIds { + cpn := cpnMap[id] + dn.CampaignStart(types.DnCampaignStart{ + CampaignId: cpn.ID, + CampaignHashId: cpn.HashID, + Timestamp: unix, + }) + } + } + + if len(ptIds) > 0 { + _, err = m.WithContext(s.ctx).Where(m.ID.In(ptIds...)).UpdateSimple(m.Status.Value(mtype.FissionCampaignStatusPubPre)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + _ = cache.NewCampaign(s.ctx).Clear(list...) + + for _, id := range mapIds { + producer.NewCampaignNotice(s.ctx).CampaignDiceMap(types.CampaignDiceMap{CampaignId: id}) + } + + return +} + +type CampaignEnd struct { + Action +} + +func (s *CampaignEnd) Desc() string { + return "活动结束" +} + +func (s *CampaignEnd) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronCampaignEnd(), + release: true, + } +} + +func (s *CampaignEnd) Exec() (err error) { + m := dao.FissionCampaign + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gt(0), + m.EndTime.Lte(time.Now().Unix()), + m.Status.In(mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + if len(ids) == 0 { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).UpdateSimple(m.Status.Value(mtype.FissionCampaignStatusCancel)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewCampaign(s.ctx).Clear(list...) + + unix := time.Now().Unix() + dn := producer.NewDeepworkNotify(s.ctx) + for _, cpn := range list { + if cpn.ChildType == mtype.FissionCampaignChildTypeInvite { + producer.NewCampaignNotice(s.ctx).CampaignChildInvite(types.CampaignChildInvite{CampaignId: cpn.ID}) + } + + err = cmm.NewCMM(s.ctx, dao.Q).CampaignCancelTask(cpn, false) + if err != nil { + return + } + + dn.CampaignEnd(types.DnCampaignEnd{ + CampaignId: cpn.ID, + CampaignHashId: cpn.HashID, + Timestamp: unix, + }) + } + + return +} + +type CampaignPreToTun struct { + Action +} + +func (s *CampaignPreToTun) Desc() string { + return "预发布转正式发布" +} + +func (s *CampaignPreToTun) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronCampaignPreToTun(), + release: true, + } +} + +func (s *CampaignPreToTun) Exec() (err error) { + m := dao.FissionCampaign + + list, err := m.WithContext(s.ctx).Where( + m.PreToRun.Gt(0), + m.PreToRun.Lte(time.Now().Unix()), + m.Status.Eq(mtype.FissionCampaignStatusPubPre), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + confM := dao.FissionCampaignConfig + confs, err := confM.WithContext(s.ctx).Where(confM.CampaignID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var confIds []int64 + for _, v := range confs { + confIds = append(confIds, v.ID) + } + + _, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).UpdateSimple(m.Status.Value(mtype.FissionCampaignStatusPub)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = confM.WithContext(s.ctx).Where(confM.ID.In(confIds...)).UpdateSimple(confM.HasWhite.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + unix := time.Now().Unix() + dn := producer.NewDeepworkNotify(s.ctx) + for _, cpn := range list { + dn.CampaignStart(types.DnCampaignStart{ + CampaignId: cpn.ID, + CampaignHashId: cpn.HashID, + Timestamp: unix, + }) + } + + _ = cache.NewCampaign(s.ctx).Clear(list...) + + _ = cache.NewCampaignConfig(s.ctx).Clear(confs...) + + return +} + +type CampaignQuizOpen struct { + Action +} + +func (s *CampaignQuizOpen) Desc() string { + return "有奖竞猜开奖" +} + +func (s *CampaignQuizOpen) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronCampaignQuizOpen(), + release: true, + } +} + +func (s *CampaignQuizOpen) Exec() (err error) { + container := new(containers.CampaignQuizOpen) + { + container.Init(s.ctx, logic.WithErrNotifyNeqCode(workerr.MysqlErrorCode, workerr.CacheErrorCode, workerr.RedisErrorCode)) + } + + return container.Run() +} + +type CampaignCompensateReward struct { + Action +} + +func (s *CampaignCompensateReward) Desc() string { + return "活动奖品补偿" +} + +func (s *CampaignCompensateReward) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronCampaignCompensateReward(), + release: true, + } +} + +func (s *CampaignCompensateReward) Exec() (err error) { + now := carbon.Now() + + start, end := now.SubHour(), now.SubMinutes(30) + + var ids []int64 + m := dao.FissionCampaign + err = m.WithContext(s.ctx).Where(m.EndTime.Gte(end.Timestamp())).Pluck(m.ID, &ids) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gp, _ := ants.NewPool(10) + defer gp.Release() + + for _, id := range ids { + wg.Add(1) + cpnId := id + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("活动奖品补偿失败:cpnid:%d", cpnId)) + recordM := dao.FissionRewardRecord.SubTable(cpnId) + + list, err1 := recordM.WithContext(s.ctx).Where( + recordM.CampaignID.Eq(cpnId), + recordM.CreatedAt.Gte(start.Timestamp()), + recordM.CreatedAt.Lte(end.Timestamp()), + recordM.Status.Eq(mtype.FissionRewardRecordStatusWait), + ).Find() + if err1 != nil { + return + } + + if len(list) == 0 { + return + } + + var recordMap = make(map[int64]*model.FissionRewardRecord) + var recordIds []int64 + for _, v := range list { + recordIds = append(recordIds, v.ID) + recordMap[v.ID] = v + } + + ntfM := dao.FissionNotify + ntfList, err1 := ntfM.WithContext(s.ctx).Where(ntfM.CampaignID.Eq(cpnId), ntfM.RecordID.In(recordIds...)).Find() + if err1 != nil { + return + } + + var ntfMap = make(map[int64]*model.FissionNotify) + for _, v := range ntfList { + ntfMap[v.RecordID] = v + delete(recordMap, v.RecordID) + } + + var sysErrIds []int64 + var okIds []int64 + var rewardErrNum int + for _, v := range list { + ntf, ok := ntfMap[v.ID] + if !ok { + producer.NewCampaignNotice(s.ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: cpnId, + UserId: v.UserID, + UserRewardId: v.ID, + }) + rewardErrNum++ + continue + } + + if ntf.IsOk == mtype.No && ntf.PushNum >= mtype.FissionNotifyPushNumMax { + sysErrIds = append(sysErrIds, v.ID) + rewardErrNum++ + continue + } + + if ntf.IsOk == mtype.Yes { + okIds = append(okIds, v.ID) + rewardErrNum++ + continue + } + + } + + if len(sysErrIds) > 0 { + _, err = recordM.WithContext(s.ctx).Where(recordM.ID.In(sysErrIds...)).UpdateSimple( + recordM.Status.Value(mtype.FissionRewardRecordStatusFail), + recordM.FailType.Value(mtype.FissionRewardRecordFailTypeSys), + ) + } + + if len(okIds) > 0 { + _, err = recordM.WithContext(s.ctx).Where(recordM.ID.In(okIds...)).UpdateSimple( + recordM.Status.Value(mtype.FissionRewardRecordStatusSuccess), + ) + } + + for _, record := range recordMap { + producer.NewCampaignNotice(s.ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: record.CampaignID, + UserId: record.UserID, + UserRewardId: record.ID, + }) + } + + app.FeishuNormalSend(fmt.Sprintf("回调奖品丢失回调数据条数:%d,活动id:%d", rewardErrNum, cpnId)) + }) + } + + return +} + +type CampaignCancelReward struct { + Action +} + +func (s *CampaignCancelReward) Desc() string { + return "把养狗过期的奖品放回去奖品池" +} + +func (s *CampaignCancelReward) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronCampaignCancelReward(), + release: true, + } +} + +func (s *CampaignCancelReward) Exec() (err error) { + m := dao.FissionCampaign + + list, err := m.WithContext(s.ctx).Where( + m.StartTime.Gt(0), + m.StartTime.Lte(time.Now().Unix()), + m.Status.In(mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre), + m.IsDel.Eq(mtype.No), + m.FissionID.Eq(consts.IdKeep), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gp, _ := ants.NewPool(10) + defer gp.Release() + + for _, v := range list { + wg.Add(1) + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("把养狗过期的奖品放回去奖品池:cpnid:%d", v.ID)) + + keepM := dao.FissionKeep + exp, err1 := keepM.WithContext(s.ctx). + Select(keepM.ID, keepM.RewardID). + Where( + keepM.CampaignID.Eq(v.ID), + keepM.ExpiredAt.Lte(time.Now().Unix()), + keepM.CancelReward.Eq(mtype.No), + keepM.RewardID.Gt(0), + keepM.RecordID.Eq(0), + ).Find() + if err1 != nil { + return + } + + var cancelMap = make(map[int64][]int64) + for _, keep := range exp { + cancelMap[keep.RewardID] = append(cancelMap[keep.RewardID], keep.ID) + } + + for rewardId, ids := range cancelMap { + var stock *stocks.CampaignRewardSelect + stock, err = stocks.NewCampaignRewardSelect(s.ctx, rewardId) + if err != nil { + return + } + + stock.ClearUseStock() + + _, err = keepM.WithContext(s.ctx).Where(keepM.ID.In(ids...)).UpdateSimple(keepM.CancelReward.Value(mtype.Yes)) + if err != nil { + return + } + } + + }) + } + + return +} + +type CampaignCoinScene struct { + Action +} + +func (s *CampaignCoinScene) Desc() string { + return "创建下一场金币池" +} + +func (s *CampaignCoinScene) OnceKey() *OnceKey { + return &OnceKey{ + exp: 21 * time.Minute, + key: ckey.CronCampaignCoinScene(), + release: true, + } +} + +func (s *CampaignCoinScene) Exec() (err error) { + m := dao.FissionCampaign + + list, err := m.WithContext(s.ctx).Where( + m.StartTime.Gt(0), + m.StartTime.Lte(time.Now().Unix()), + m.Status.In(mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre), + m.IsDel.Eq(mtype.No), + m.FissionID.Eq(consts.IdCoin), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gp, _ := ants.NewPool(10) + defer gp.Release() + + for _, v := range list { + wg.Add(1) + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("创建下一场金币池:cpnid:%d", v.ID)) + + conf, _ := cache.NewCampaignCoin(s.ctx).FindByCampaignId(v.ID) + + sceneM := dao.FissionCoinScene + + if conf.OpenLimit > 0 { // 限制场次 + count, _ := sceneM.WithContext(s.ctx).Where(sceneM.CampaignID.Eq(v.ID)).Count() + if conf.OpenLimit <= int32(count) { + return + } + } + + _, start, _ := timez.GMTStartAndEndTs(v.TOffset) + + openTime := start + consts.DaySec // 明天开奖的场次 + + nextOpenTime := openTime + int64(consts.DaySec*conf.OpenDays) // 下一场开奖时间 + nextRewardTime := nextOpenTime + consts.DaySec // 下一场领奖结束时间 + + if v.EndTime < nextOpenTime { // 活动结束不能生成 + return + } + + // 看看明天有没有开奖的的,如果有那就要创建新的一场备用 + exit, _ := sceneM.WithContext(s.ctx).Where(sceneM.CampaignID.Eq(v.ID), sceneM.OpenTime.Eq(openTime)).Take() + if exit == nil { + return + } + + // 看看是不是已经创建过了 + done, _ := sceneM.WithContext(s.ctx).Where(sceneM.CampaignID.Eq(v.ID), sceneM.OpenTime.Eq(nextOpenTime)).Take() + if done != nil { + return + } + + err = sceneM.WithContext(s.ctx).Create(withdefault.FissionCoinScene(&model.FissionCoinScene{ + CampaignID: v.ID, + OpenTime: nextOpenTime, + InitCoin: conf.InitCoin, + InitUse: conf.InitUse, + RewardTime: nextRewardTime, + PreScene: exit.ID, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + }) + } + + return +} + +type CoinSceneSettlement struct { + Action +} + +func (s *CoinSceneSettlement) Desc() string { + return "金币场次结算" +} + +func (s *CoinSceneSettlement) OnceKey() *OnceKey { + return &OnceKey{ + exp: 21 * time.Minute, + key: ckey.CronCampaignCoinSceneSettlement(), + release: true, + } +} + +func (s *CoinSceneSettlement) Exec() (err error) { + now := time.Now().Truncate(time.Hour) + + // 就怕有错误时间差距 + start, end := now.Add(-5*time.Minute).Unix(), now.Add(5*time.Minute).Unix() + + m := dao.FissionCoinScene + list, err := m.WithContext(s.ctx).Where( + m.RewardTime.Between(start, end), + m.IsArchive.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gp, _ := ants.NewPool(10) + defer gp.Release() + + for _, v := range list { + wg.Add(1) + _ = gp.Submit(func() { + var err1 error + defer func() { + if err1 != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("场次处理失败:%v", err1)) + } + }() + + defer wg.Done() + + key := ckey.FissionCoinSceneData(v.ID) + scene, err1 := cachecurd.NewHMap(s.ctx, key, + cachecurd.SetCoinSceneBuild(v.CampaignID, v.ID), + cachecurd.SetHMapExp(consts.TimeDay), + ) + if err1 != nil { + return + } + + joinNum, _ := scene.GetInt64(cachecurd.CoinSceneJoinNum) + joinUserNum, _ := scene.GetInt64(cachecurd.CoinSceneJoinUserNum) + userCoin, _ := scene.GetInt64(cachecurd.CoinSceneUserCoin) + getNum, _ := scene.GetInt64(cachecurd.CoinSceneGetNum) + getCoin, _ := scene.GetInt64(cachecurd.CoinSceneGetTotal) + + sceneM := dao.FissionCoinScene + _, err1 = sceneM.WithContext(s.ctx).Where(sceneM.ID.Eq(v.ID)).UpdateSimple( + sceneM.JoinNum.Value(joinNum), + sceneM.JoinUserNum.Value(joinUserNum), + sceneM.UserCoin.Value(userCoin), + sceneM.GetNum.Value(getNum), + sceneM.GetCoin.Value(getCoin), + sceneM.IsArchive.Value(mtype.Yes), + ) + if err1 != nil { // 有错误,没有人参与,参与人数等于领取人数 + return + } + + }) + } + + return +} + +// CampaignRewardAdd 按配置周期追加活动奖品库存。 +type CampaignRewardAdd struct { + Action +} + +func (s *CampaignRewardAdd) Desc() string { + return "活动奖品追加库存" +} + +func (s *CampaignRewardAdd) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronCampaignRewardAdd(), + release: true, + } +} + +func (s *CampaignRewardAdd) Exec() (err error) { + now := time.Now().Unix() + m := dao.FissionCampaignRewardAdd + list, err := m.WithContext(s.ctx).Where( + m.Start.Lte(now), + m.FinishAt.Eq(0), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + if len(list) == 0 { + return + } + + campaignMap := make(map[int64][]*model.FissionCampaignRewardAdd) + for _, one := range list { + campaignMap[one.CampaignID] = append(campaignMap[one.CampaignID], one) + } + + gp, err := ants.NewPool(5) + if err != nil { + return err + } + defer gp.Release() + + var wg sync.WaitGroup + var firstErr error + for campaignID, rules := range campaignMap { + wg.Add(1) + _ = gp.Submit(func() { + defer wg.Done() + _ = s.addCampaignRewardStock(campaignID, rules, now) + }) + } + wg.Wait() + + return firstErr +} + +func (s *CampaignRewardAdd) addCampaignRewardStock(campaignID int64, rules []*model.FissionCampaignRewardAdd, now int64) (err error) { + var clearRewardIDs []int64 + err = dao.Q.Transaction(func(tx *dao.Query) error { + addM := tx.FissionCampaignRewardAdd + logM := tx.FissionCampaignRewardAddLog + rewardM := tx.FissionCampaignReward + + for _, rule := range rules { + interval := int64(rule.DayNum) * consts.DaySec + calcAt := now + finished := rule.End > 0 && now >= rule.End + if finished { + calcAt = rule.End + } + + addAt := rule.Start + (calcAt-rule.Start)/interval*interval + if addAt < rule.Start || (rule.End > 0 && addAt > rule.End) { + continue + } + + count, err1 := logM.WithContext(s.ctx).Where( + logM.RewardID.Eq(rule.RewardID), + logM.AddAt.Eq(addAt), + ).Count() + if err1 != nil { + return err1 + } + + if count == 0 { + reward, err2 := rewardM.WithContext(s.ctx).Where( + rewardM.ID.Eq(rule.RewardID), + rewardM.CampaignID.Eq(campaignID), + ).Take() + if err2 != nil { + return err2 + } + + _, err2 = rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(reward.ID)).UpdateSimple(rewardM.Stock.Add(rule.DayAdd)) + if err2 != nil { + return err2 + } + + err2 = logM.WithContext(s.ctx).Create(withdefault.FissionCampaignRewardAddLog(&model.FissionCampaignRewardAddLog{ + CampaignID: campaignID, + RewardID: rule.RewardID, + AddAt: addAt, + DayAdd: rule.DayAdd, + BeforeAdd: reward.Stock, + })) + if err2 != nil { + return err2 + } + clearRewardIDs = append(clearRewardIDs, rule.RewardID) + } + + if finished { + if _, err2 := addM.WithContext(s.ctx).Where( + addM.ID.Eq(rule.ID), + addM.FinishAt.Eq(0), + ).UpdateSimple(addM.FinishAt.Value(now)); err2 != nil { + return err2 + } + } + } + + return nil + }) + if err != nil { + return s.BE().MysqlError(err) + } + + stocks.NewCleaner(s.ctx, clearRewardIDs...).ClearAllReward() + + return +} diff --git a/internal/service/crons/action/containers/campaign_quiz_open.go b/internal/service/crons/action/containers/campaign_quiz_open.go new file mode 100644 index 0000000..faed3b1 --- /dev/null +++ b/internal/service/crons/action/containers/campaign_quiz_open.go @@ -0,0 +1,380 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "fmt" + "sync" + "time" + + "github.com/panjf2000/ants/v2" + "gorm.io/gen" + "gorm.io/gorm/clause" +) + +type userTypeWinner struct { + userIds []int64 + thank, reward *model.FissionCampaignReward + thankInfo, rewardInfo provider.RewardAutoLang +} + +type CampaignQuizOpen struct { + logic.Logic + + ntf chan []*model.FissionQuizReward + + cpnId int64 +} + +func (s *CampaignQuizOpen) Run() error { + return logic.Run(s) +} + +func (s *CampaignQuizOpen) Exec() (err error) { + m := s.GetDao().FissionCampaignQuiz + + var cpnIds []int64 + err = m.WithContext(s.Ctx).Where(m.OpenPrize.Lte(time.Now().Unix()), m.OpenType.Eq(mtype.FissionCampaignQuizOpenTypeWait)).Pluck(m.CampaignID, &cpnIds) + if err != nil { + return + } + + if len(cpnIds) == 0 { + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gop, _ := ants.NewPool(50) + defer gop.Release() + + for _, v := range cpnIds { + wg.Add(1) + cpnId := v + _ = gop.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.Ctx, fmt.Sprintf("竞猜开奖,活动id[%d]", cpnId)) + + err = s.open(cpnId) + if err != nil { + return + } + + }) + } + + return +} + +func (s *CampaignQuizOpen) open(cpnId int64) (err error) { + //活动数据 + cpn, err := finder.Campaign(s.Ctx, cpnId) + if err != nil { + return + } + + //活动配置数据 + fcqM := dao.FissionCampaignQuiz + fcq, err := fcqM.WithContext(s.Ctx).Where(fcqM.CampaignID.Eq(cpnId)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + //活动奖品数据 + rewardM := dao.FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.CampaignID.Eq(cpnId), rewardM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return + } + + if len(rewards) == 0 { + //设置成已开奖 + app.FeishuNormalSend("活动[%d],没有奖品开奖", cpnId) + err = s.setOpen(fcq) + return + } + + var utRewardMap = make(map[string][]*model.FissionCampaignReward) + var brIds []int64 + for _, v := range rewards { + brIds = append(brIds, v.RewardID) + key := fmt.Sprintf("%s_%d", v.LangMark, v.LevelID) + utRewardMap[key] = append(utRewardMap[key], v) + } + + prewards, err := provider.NewRewards(s.Ctx, cpn.ProjectID, brIds...) + if err != nil { + return + } + + // 赢家的数据,是否可以开奖 + winMap, open, err := s.winMap(cpnId, fcq) + if err != nil || !open { + return + } + + //活动配置数据 + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpnId) + if err != nil { + return + } + + var userRewardMap = make(map[string]*userTypeWinner) + var list []*model.FissionUser + m, quizM := s.GetDao().FissionUser.SubTable(cpn.ID), s.GetDao().FissionQuiz + _ = m.WithContext(s.Ctx). + Join(quizM, quizM.UserID.EqCol(m.ID)). + Where(m.CampaignID.Eq(cpn.ID), quizM.OptionID.Gt(0)). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + for _, v := range list { + + wnk := fmt.Sprintf("%s_%d", v.UserLang, v.UserLevel) + winner, ok := userRewardMap[wnk] + if !ok { + winner = &userTypeWinner{ + userIds: []int64{v.ID}, + thank: nil, + reward: nil, + } + + var setRewards []*model.FissionCampaignReward + switch conf.RewardGroup { + case mtype.FissionRewardGroupNormal: + setRewards = utRewardMap["_0"] + case mtype.FissionRewardGroupUserLevel: + setRewards = utRewardMap[fmt.Sprintf("_%d", v.UserLevel)] + case mtype.FissionRewardGroupLang: + setRewards = utRewardMap[fmt.Sprintf("%s_0", v.UserLang)] + case mtype.FissionRewardGroupLangAndUserLevel: + setRewards = utRewardMap[fmt.Sprintf("%s_%d", v.UserLang, v.UserLevel)] + } + + for _, reward := range setRewards { + info, _ := prewards.InfoAutoLang(reward.RewardID, v.LangMark) + if reward.IsThank == mtype.Yes { + winner.thank = reward + winner.thankInfo = info + } else { + winner.reward = reward + winner.rewardInfo = info + } + } + + userRewardMap[wnk] = winner + continue + } + + userRewardMap[wnk].userIds = append(userRewardMap[wnk].userIds, v.ID) + + } + return nil + }) + + for _, winner := range userRewardMap { + err = s.winner(cpnId, winner, winMap) + if err != nil { + return + } + } + + //设置成已开奖 + err = s.setOpen(fcq) + + return +} + +func (s *CampaignQuizOpen) setOpen(fcq *model.FissionCampaignQuiz) (err error) { + //设置成已开奖 + fcqM := dao.FissionCampaignQuiz + _, err = fcqM.WithContext(s.Ctx).Where(fcqM.ID.Eq(fcq.ID)).UpdateSimple(fcqM.OpenType.Value(mtype.FissionCampaignQuizOpenTypeOpen)) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *CampaignQuizOpen) winMap(cpnId int64, fcq *model.FissionCampaignQuiz) (winMap map[int64]struct{}, open bool, err error) { + //选项数据 + fcqM := s.GetDao().FissionCampaignQuiz + optionM := dao.FissionCampaignQuizOption + winMap = make(map[int64]struct{}) + if fcq.RewardRule == mtype.FissionCampaignQuizRewardRuleVote { + + //对选项排序,并且要找有投票的数据 + options, frr := optionM.WithContext(s.Ctx). + Where( + optionM.CampaignID.Eq(cpnId), + optionM.IsDel.Eq(mtype.No), + optionM.VoteNum.Gt(0), + ). + Order(optionM.VoteNum.Desc(), optionM.ID). + Find() + if frr != nil { + err = s.BE().MysqlError(frr) + return + } + + //没有投票选项就不会发奖 + if len(options) == 0 { + //设置成已开奖 + _, err = fcqM.WithContext(s.Ctx).Where(fcqM.ID.Eq(fcq.ID)).UpdateSimple(fcqM.OpenType.Value(mtype.FissionCampaignQuizOpenTypeNone)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } + + l := len(options) + //因为排序了,所以第一个肯定是赢的 + winMap[options[0].ID] = struct{}{} + //看看后面的有没有和赢的相同票数,就一齐赢 + for i := 1; i < l; i++ { + if options[0].VoteNum != options[i].VoteNum { + break + } + winMap[options[i].ID] = struct{}{} + } + } else { + option, frr := optionM.WithContext(s.Ctx). + Where( + optionM.CampaignID.Eq(cpnId), + optionM.IsDel.Eq(mtype.No), + optionM.IsRight.Eq(mtype.Yes), + ). + Take() + if err = dbcheck.DbError(frr); err != nil { + err = s.BE().MysqlError(err) + return + } + + //还没设置正确答案就退出,等下一次开奖 + if option == nil { + return + } + winMap[option.ID] = struct{}{} + } + + return winMap, true, nil +} + +func (s *CampaignQuizOpen) winner(cpnId int64, winner *userTypeWinner, winMap map[int64]struct{}) (err error) { + + reward, thank := winner.reward, winner.thank + rewardInfo, thankInfo := winner.rewardInfo, winner.thankInfo + idGroups := utils.Groups(winner.userIds, 200) + + m := s.GetDao().FissionQuiz + for _, ids := range idGroups { + var list []*model.FissionQuiz + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + if len(list) == 0 { + continue + } + + var add []*model.FissionRewardRecord + var winnerIds []int64 + var winnerMap = make(map[int64]struct{}) + for _, player := range list { + if _, ok := winMap[player.OptionID]; ok { + winnerMap[player.UserID] = struct{}{} + winnerIds = append(winnerIds, player.ID) + + add = append(add, withdefault.FissionRewardRecord(&model.FissionRewardRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + RewardID: reward.ID, + Title: rewardInfo.Title, + ImgURL: rewardInfo.ImgUrl, + RewardType: reward.RewardType, + RewardNum: reward.RewardNum, + Step: reward.Step, + IsThank: reward.IsThank, + Status: mtype.FissionRewardRecordStatusWait, + FailType: "", + FailMsg: "", + BaseRewardID: reward.RewardID, + })) + + continue + } + + add = append(add, withdefault.FissionRewardRecord(&model.FissionRewardRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + RewardID: thank.ID, + Title: thankInfo.Title, + ImgURL: thankInfo.ImgUrl, + RewardType: thank.RewardType, + RewardNum: thank.RewardNum, + Step: thank.Step, + IsThank: thank.IsThank, + Status: mtype.FissionRewardRecordStatusWait, + FailType: "", + FailMsg: "", + BaseRewardID: thank.RewardID, + })) + } + + if len(add) == 0 { + return + } + + //改成赢的状态 + if len(winnerIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(winnerIds...)).UpdateSimple(m.IsWin.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + fqrM := dao.FissionRewardRecord + _ = fqrM.WithContext(s.Ctx).Clauses(clause.Insert{ + Modifier: "IGNORE", + }).CreateInBatches(add, 200) + + fqrMs := dao.FissionRewardRecord.SubTable(cpnId) + _ = fqrMs.WithContext(s.Ctx).Clauses(clause.Insert{ + Modifier: "IGNORE", + }).CreateInBatches(add, 200) + + var useStock = make(map[int64]int64) + for _, record := range add { + if record.ID == 0 { + continue + } + producer.NewCampaignNotice(s.Ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: record.CampaignID, + UserId: record.UserID, + UserRewardId: record.ID, + }) + useStock[record.RewardID]++ + } + + for rewardId, num := range useStock { + stock, _ := stocks.NewCampaignReward(s.Ctx, rewardId) + _ = stock.AddUseStock(num) + } + } + + return +} diff --git a/internal/service/crons/action/containers/push_notify.go b/internal/service/crons/action/containers/push_notify.go new file mode 100644 index 0000000..76fd532 --- /dev/null +++ b/internal/service/crons/action/containers/push_notify.go @@ -0,0 +1,333 @@ +package containers + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/provider/pusher" + "joybuywork/internal/utils/logic" + "fmt" + "strconv" + "strings" + "sync" + "time" + + "github.com/panjf2000/ants/v2" + "gorm.io/gen" +) + +const ( + faultTolerance = 900 +) + +type PushNotify struct { + logic.Logic + + data map[int64]string +} + +func (s *PushNotify) Run() error { + return logic.Run(s) +} + +func (s *PushNotify) Exec() (err error) { + m := dao.FissionCampaign + + list, err := m.WithContext(s.Ctx).Where( + m.StartTime.Gt(0), + m.StartTime.Lte(time.Now().Unix()), + m.Status.In(mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gp, _ := ants.NewPool(10) + defer gp.Release() + + for _, v := range list { + wg.Add(1) + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.Ctx, fmt.Sprintf("活动奖品补偿失败:cpnid:%d", v.ID)) + + pushM := dao.FissionCampaignPush + pushs, err2 := pushM.WithContext(s.Ctx).Where(pushM.CampaignID.Eq(v.ID), pushM.Open.Eq(mtype.Yes)).Find() + if err2 != nil { + err = err2 + return + } + + if len(pushs) == 0 { + return + } + + for _, push := range pushs { + switch push.Mark { + case mtype.FissionCampaignPushMarkTaskReset: + for _, cond := range push.GetCond() { + err = s.taskReset(v, cond) + if err != nil { + return + } + } + case mtype.FissionCampaignPushMarkOffline: + for _, cond := range push.GetCond() { + err = s.offline(v, cond) + if err != nil { + return + } + } + case mtype.FissionCampaignPushMarkActive: + for _, cond := range push.GetCond() { + err = s.active(v, cond) + if err != nil { + return + } + } + } + } + }) + } + + return +} + +// 日活 +func (s *PushNotify) active(cpn *model.FissionCampaign, cond *mtype.PushCond) (err error) { + hour, markCode, codeVal := s._getHourCond(cond) + t := s._minTime().Add(-time.Duration(hour) * time.Hour) + + push, err := pusher.NewPusher(s.Ctx, cpn) + if err != nil { + return + } + + m := dao.FissionUserActive + + var list []*model.FissionUserActive + err = m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(cpn.ID), + m.LastActive.Lte(t.Unix()), + m.LastActive.Gt(t.Unix()-faultTolerance), + ). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + var userLines []*pusher.UserLine + for _, v := range list { + userLines = append(userLines, &pusher.UserLine{ + Id: v.UserID, + DoneAt: v.LastActive, + }) + } + + return push.Active(t, markCode, codeVal, userLines) + }) + + return +} + +// 任务重制 +func (s *PushNotify) taskReset(cpn *model.FissionCampaign, cond *mtype.PushCond) (err error) { + switch cpn.FissionID { + case consts.IdCash: + return s._cashReset(cpn, cond) + case consts.IdGold: + return s._goldReset(cpn, cond) + } + return +} + +func (s *PushNotify) _cashReset(cpn *model.FissionCampaign, cond *mtype.PushCond) (err error) { + hour, markCode, codeVal := s._getHourCond(cond) + t := s._minTime().Add(time.Duration(hour) * time.Hour) + + push, err := pusher.NewPusher(s.Ctx, cpn) + if err != nil { + return + } + + m := dao.FissionCash + var list []*model.FissionCash + err = m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(cpn.ID), + m.ExpiredIn.Lte(t.Unix()), + m.ExpiredIn.Gt(t.Unix()-faultTolerance), + ). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + var userLines []*pusher.UserLine + for _, v := range list { + userLines = append(userLines, &pusher.UserLine{ + Id: v.UserID, + DoneAt: v.ExpiredIn, + }) + } + + return push.TaskRest(t, markCode, codeVal, userLines) + }) + if err != nil { + return + } + + return +} + +func (s *PushNotify) _goldReset(cpn *model.FissionCampaign, cond *mtype.PushCond) (err error) { + hour, markCode, codeVal := s._getHourCond(cond) + t := s._minTime().Add(time.Duration(hour) * time.Hour) + + push, err := pusher.NewPusher(s.Ctx, cpn) + if err != nil { + return + } + + m := dao.FissionGold + var list []*model.FissionGold + err = m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(cpn.ID), + m.ExpiredIn.Lte(t.Unix()), + m.ExpiredIn.Gt(t.Unix()-faultTolerance), + ). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + var userLines []*pusher.UserLine + for _, v := range list { + userLines = append(userLines, &pusher.UserLine{ + Id: v.UserID, + DoneAt: v.ExpiredIn, + }) + } + + return push.TaskRest(t, markCode, codeVal, userLines) + }) + if err != nil { + return + } + + return +} + +// 离线 +func (s *PushNotify) offline(cpn *model.FissionCampaign, cond *mtype.PushCond) (err error) { + switch cpn.FissionID { + case consts.IdKeep: + return s._keepOffline(cpn, cond) + } + return +} + +func (s *PushNotify) _keepOffline(cpn *model.FissionCampaign, cond *mtype.PushCond) (err error) { + keep, err := cache.NewCampaignKeep(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if keep == nil || keep.MachineType != mtype.FissionCampaignKeepMachineTypeOffline { + return + } + + minute, markCode, codeVal := s._getMinCond(cond) + + tm := keep.OfflineMin + int32(minute) + + t := s._minTime().Add(-(time.Duration(tm)) * time.Minute) + + push, err := pusher.NewPusher(s.Ctx, cpn) + if err != nil { + return + } + + m := dao.FissionKeep + var list []*model.FissionKeep + err = m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(cpn.ID), + m.RewardID.Gt(0), + m.RecordID.Eq(0), + m.ReceiveOffline.Lte(t.Unix()), + m.ReceiveOffline.Gt(t.Unix()-faultTolerance), + ). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + var userLines []*pusher.UserLine + var userIds []int64 + for _, v := range list { + userIds = append(userIds, v.UserID) + } + + userM := s.GetDao().FissionUser + users, _ := userM.WithContext(s.Ctx).Where(userM.ID.In(userIds...)).Find() + var playerMap = make(map[int64]*players.KeepDog, len(users)) + for _, user := range users { + playerMap[user.ID], _ = players.NewKeepDog(s.Ctx, user, players.SetCpn(cpn)) + } + + for _, v := range list { + player, ok := playerMap[v.UserID] + if !ok { + continue + } + + if ok, _ = player.OfflineLimit(); ok { + continue + } + + userLines = append(userLines, &pusher.UserLine{ + Id: v.UserID, + DoneAt: v.ReceiveOffline, + }) + + } + + return push.Offline(t, markCode, codeVal, userLines) + }) + if err != nil { + return + } + + return +} + +func (s *PushNotify) _getHourCond(cond *mtype.PushCond) (hour int, markCode, codeVal string) { + if cond.Mark == "custom" { + hour, _ = strconv.Atoi(cond.Val) + } else { + day := cond.Mark[strings.LastIndex(cond.Mark, "_")+1:] + dayi, _ := strconv.Atoi(day) + hour = dayi * 24 + } + + return hour, cond.Mark, cond.Val +} + +func (s *PushNotify) _getMinCond(cond *mtype.PushCond) (min int, markCode, codeVal string) { + if cond.Mark == "custom" { + min, _ = strconv.Atoi(cond.Val) + } else { + hour := cond.Mark[strings.LastIndex(cond.Mark, "_")+1:] + houri, _ := strconv.Atoi(hour) + min = houri * 60 + } + + return min, cond.Mark, cond.Val +} + +func (s *PushNotify) _minTime() time.Time { + t, _ := time.ParseInLocation("2006-01-02 15:04", time.Now().Format("2006-01-02 15:04"), time.Local) + + return t +} diff --git a/internal/service/crons/action/mall.go b/internal/service/crons/action/mall.go new file mode 100644 index 0000000..e608d6a --- /dev/null +++ b/internal/service/crons/action/mall.go @@ -0,0 +1,192 @@ +package action + +import ( + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "sync" + "time" + + "github.com/panjf2000/ants/v2" + "go.uber.org/atomic" + "gorm.io/gen" +) + +type MallItemTask struct { + Action +} + +func (s *MallItemTask) Desc() string { + return "商城奖品任务" +} + +func (s *MallItemTask) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronMallItemTask(), + release: true, + } +} + +func (s *MallItemTask) LoggerMod() string { + return loggerModDb +} + +func (s *MallItemTask) DbExec() (total, successNum, failNum int64, err error) { + m := dao.RedeemMallItemTask + list, err := m.WithContext(s.ctx).Where(m.DoAt.Lte(time.Now().Unix())).Find() + if err != nil { + return + } + + if len(list) == 0 { + return + } + + total = int64(len(list)) + + gp, _ := ants.NewPool(20) + defer gp.Release() + wg := sync.WaitGroup{} + + sn, fn := atomic.NewInt64(0), atomic.NewInt64(0) + + for _, v := range list { + wg.Add(1) + switch v.Mark { + case mtype.RedeemMallItemTaskMarkDown: + gp.Submit(func() { + defer wg.Done() + if err1 := s._down(v); err1 != nil { + fn.Add(1) + } else { + sn.Add(1) + } + }) + } + } + + wg.Wait() + + successNum = sn.Load() + failNum = fn.Load() + + return +} + +func (s *MallItemTask) _down(task *model.RedeemMallItemTask) (err error) { + m := dao.RedeemMallItem + stock, err := stocks.NewMallItem(s.ctx, task.ItemID) + if err != nil { + return + } + + useStock, err := stock.GetUseStock(task.ItemID) + if err != nil { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ItemID)).UpdateSimple( + m.UseStock.Value(useStock), + m.DownAt.Value(task.DoAt), + m.DownFrom.Value(mtype.RedeemMallItemDownFromTiming), + ) + if err != nil { + return + } + + _, err = dao.RedeemMallItemTask.WithContext(s.ctx).Delete(task) + if err != nil { + return + } + + return +} + +type ProjectUserCoinExpiredTask struct { + Action +} + +func (s *ProjectUserCoinExpiredTask) Desc() string { + return "项目用户过期积分任务" +} + +func (s *ProjectUserCoinExpiredTask) OnceKey() *OnceKey { + return &OnceKey{ + exp: 11 * time.Minute, + key: ckey.CronProjectUserCoinExpiredTask(), + release: true, + } +} + +func (s *ProjectUserCoinExpiredTask) LoggerMod() string { + return loggerModDb +} + +func (s *ProjectUserCoinExpiredTask) DbExec() (total, successNum, failNum int64, err error) { + m := dao.ProjectUserCoinExpired + + var list []*model.ProjectUserCoinExpired + err = m.WithContext(s.ctx). + Select(m.ID). + Where( + m.DoneAt.Lte(time.Now().Add(10*time.Minute).Unix()), + m.IsWait.Eq(mtype.No), + ). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + total += int64(len(list)) + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + + producer.CoinExpired(s.ctx, int(v.DoneAt-time.Now().Unix()), types.DelayCommonCoinExpired{ + TaskId: v.ID, + }) + + successNum++ + } + + _, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).UpdateSimple(m.IsWait.Value(mtype.Yes)) + + return + }) + if err != nil { + return + } + + return +} + +func (s *ProjectUserCoinExpiredTask) _down(task *model.RedeemMallItemTask) (err error) { + m := dao.RedeemMallItem + stock, err := stocks.NewMallItem(s.ctx, task.ItemID) + if err != nil { + return + } + + useStock, err := stock.GetUseStock(task.ItemID) + if err != nil { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ItemID)).UpdateSimple( + m.UseStock.Value(useStock), + m.DownAt.Value(task.DoAt), + m.DownFrom.Value(mtype.RedeemMallItemDownFromTiming), + ) + if err != nil { + return + } + + _, err = dao.RedeemMallItemTask.WithContext(s.ctx).Delete(task) + if err != nil { + return + } + + return +} diff --git a/internal/service/crons/action/notify.go b/internal/service/crons/action/notify.go new file mode 100644 index 0000000..5839279 --- /dev/null +++ b/internal/service/crons/action/notify.go @@ -0,0 +1,180 @@ +package action + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/service/crons/action/containers" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/proto/go_proto/workerr" + "sync" + "time" + + "github.com/panjf2000/ants/v2" +) + +type Notify struct { + Action +} + +func (s *Notify) Desc() string { + return "重新回调" +} + +func (s *Notify) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronNotifyReward(), + release: true, + } +} + +func (s *Notify) Exec() (err error) { + m := dao.FissionNotifyTask + ntfM := dao.FissionNotify + + //找到需要重新回调的任务 + list, err := m.WithContext(s.ctx).Where(m.DoTime.Lte(time.Now().Add(-time.Hour).Unix())).Find() + if err != nil { + return + } + + if len(list) == 0 { + return + } + + //任务对应的回调数据 + var ntfIds []int64 + for _, v := range list { + ntfIds = append(ntfIds, v.NotifyID) + } + + var idsGroup = utils.Groups[int64](ntfIds, 200) + gop, _ := ants.NewPool(10) + defer gop.Release() + + wg := sync.WaitGroup{} + for _, ids := range idsGroup { + wg.Add(1) + _ = gop.Submit(func() { + defer wg.Done() + ntfL, _ := ntfM.WithContext(s.ctx).Where(ntfM.ID.In(ids...)).Find() + + var ntfMap = make(map[int64]*model.FissionNotify) + for _, v := range ntfL { + ntfMap[v.ID] = v + } + + for _, v := range list { + producer.RewardPushPub(s.ctx, 1, types.DelayCommonRewardPush{TaskId: v.ID}) + } + }) + } + + wg.Wait() + + return +} + +type PushNotify struct { + Action +} + +func (s *PushNotify) Desc() string { + return "推送提醒回调" +} + +func (s *PushNotify) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronPushNotify(), + release: true, + } +} + +func (s *PushNotify) Exec() (err error) { + container := new(containers.PushNotify) + { + container.Init(s.ctx, logic.WithErrNotifyNeqCode(workerr.MysqlErrorCode, workerr.CacheErrorCode, workerr.RedisErrorCode)) + } + + return container.Run() +} + +type PProfCollector struct { + Action +} + +func (s *PProfCollector) Desc() string { + return "pprof采集" +} + +func (s *PProfCollector) OnceKey() *OnceKey { + return nil +} + +func (s *PProfCollector) Exec() (err error) { + // 创建采集器(每 5 分钟采集一次,禁用 CPU Profiling) + collector := app.NewPProfCollector() + + // 启动采集任务 + collector.Start() + return +} + +type HeartBeatCollector struct { + Action +} + +func (s *HeartBeatCollector) Desc() string { + return "pprof采集" +} + +func (s *HeartBeatCollector) OnceKey() *OnceKey { + return nil +} + +func (s *HeartBeatCollector) Exec() (err error) { + app.HeartBeat() + return +} + +type GlobalRewardPushNotify struct { + Action +} + +func (s *GlobalRewardPushNotify) Desc() string { + return "全局奖品重新回调" +} + +func (s *GlobalRewardPushNotify) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronGlobalRewardPushNotify(), + release: true, + } +} + +func (s *GlobalRewardPushNotify) Exec() (err error) { + m := dao.RewardPushTask + + //找到需要重新回调的任务 + list, err := m.WithContext(s.ctx).Where(m.DoTime.Lte(time.Now().Add(-time.Hour).Unix())).Find() + if err != nil { + return + } + + if len(list) == 0 { + return + } + + for _, v := range list { + producer.GlobalRewardPushPub(s.ctx, 1, types.DelayCommonGlobalRewardPush{TaskId: v.ID}) + } + + return +} diff --git a/internal/service/crons/action/stat.go b/internal/service/crons/action/stat.go new file mode 100644 index 0000000..e42f53d --- /dev/null +++ b/internal/service/crons/action/stat.go @@ -0,0 +1,502 @@ +package action + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + "fmt" + "github.com/golang-module/carbon/v2" + "github.com/panjf2000/ants/v2" + "sync" + "time" +) + +type StatHour struct { + Action +} + +func (s *StatHour) Desc() string { + return "活动小时统计" +} + +func (s *StatHour) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronStatHour(), + release: true, + } +} + +func (s *StatHour) Exec() (err error) { + m := dao.FissionArchiveTask + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gte(time.Now().Unix()), + m.Mark.Eq(mtype.FissionArchiveTaskMarkCampaignHour), + m.IsStop.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + bt := map[string]int32{ + mtype.FissionBehaviorMarkView: mtype.FissionBehaviorTypeView, + mtype.FissionBehaviorMarkClickPlay: mtype.FissionBehaviorTypeClickPlay, + mtype.FissionBehaviorMarkClickShare: mtype.FissionBehaviorTypeClickShare, + mtype.FissionBehaviorMarkViewDownload: mtype.FissionBehaviorTypeViewDownload, + mtype.FissionBehaviorMarkClickDownload: mtype.FissionBehaviorTypeClickDownload, + mtype.FissionBehaviorMarkViewWechat: mtype.FissionBehaviorTypeViewWechat, + mtype.FissionBehaviorMarkAppInstall: mtype.FissionBehaviorTypeAppInstall, + mtype.FissionBehaviorMarkAppOpen: mtype.FissionBehaviorTypeAppOpen, + mtype.FissionBehaviorMarkViewDownloadByWx: mtype.FissionBehaviorTypeViewDownloadByWx, + mtype.FissionBehaviorMarkAppRegister: mtype.FissionBehaviorTypeAppRegister, + mtype.FissionBehaviorMarkSign: mtype.FissionBehaviorTypeSign, + mtype.FissionBehaviorMarkSignTarget: mtype.FissionBehaviorTypeSignTarget, + mtype.FissionBehaviorMarkGrow: mtype.FissionBehaviorTypeGrow, + } + + gp, _ := ants.NewPool(len(list)) + defer gp.Release() + + wg := &sync.WaitGroup{} + defer wg.Wait() + + for _, v := range list { + wg.Add(1) + task := v + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("统计活动小时任务失败:任务id:%d", task.ID)) + + err = provider.NewFissionBehaviorTotal(s.ctx, task.CampaignID).BehaviorTotalCycle(mtype.FissionTotalCycleTypeHour, carbon.Now().SubHour(), bt) + if err != nil { + return + } + + if task.EndTime < time.Now().Unix() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.IsStop.Value(mtype.Yes)) + if err != nil { + return + } + } + + }) + } + return +} + +type StatDay struct { + Action +} + +func (s *StatDay) Desc() string { + return "活动天统计" +} + +func (s *StatDay) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronStatDay(), + release: true, + } +} + +func (s *StatDay) Exec() (err error) { + m := dao.FissionArchiveTask + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gte(time.Now().Unix()), + m.Mark.Eq(mtype.FissionArchiveTaskMarkCampaignDay), + m.IsStop.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + bt := map[string]int32{ + mtype.FissionBehaviorMarkView: mtype.FissionBehaviorTypeView, + mtype.FissionBehaviorMarkClickPlay: mtype.FissionBehaviorTypeClickPlay, + mtype.FissionBehaviorMarkClickShare: mtype.FissionBehaviorTypeClickShare, + mtype.FissionBehaviorMarkViewDownload: mtype.FissionBehaviorTypeViewDownload, + mtype.FissionBehaviorMarkClickDownload: mtype.FissionBehaviorTypeClickDownload, + mtype.FissionBehaviorMarkViewWechat: mtype.FissionBehaviorTypeViewWechat, + mtype.FissionBehaviorMarkAppInstall: mtype.FissionBehaviorTypeAppInstall, + mtype.FissionBehaviorMarkAppOpen: mtype.FissionBehaviorTypeAppOpen, + mtype.FissionBehaviorMarkViewDownloadByWx: mtype.FissionBehaviorTypeViewDownloadByWx, + mtype.FissionBehaviorMarkAppRegister: mtype.FissionBehaviorTypeAppRegister, + mtype.FissionBehaviorMarkSign: mtype.FissionBehaviorTypeSign, + mtype.FissionBehaviorMarkSignTarget: mtype.FissionBehaviorTypeSignTarget, + mtype.FissionBehaviorMarkGrow: mtype.FissionBehaviorTypeGrow, + } + + gp, _ := ants.NewPool(10) + defer gp.Release() + + wg := &sync.WaitGroup{} + defer wg.Wait() + + for _, v := range list { + wg.Add(1) + task := v + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("统计活动天任务失败:任务id:%d", task.ID)) + + err = provider.NewFissionBehaviorTotal(s.ctx, task.CampaignID).BehaviorTotalCycle(mtype.FissionTotalCycleTypeDay, carbon.Now().SubHours(12), bt) + if err != nil { + return + } + + if task.EndTime < time.Now().Unix() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.IsStop.Value(mtype.Yes)) + if err != nil { + return + } + } + + }) + } + return +} + +type CondHour struct { + Action +} + +func (s *CondHour) Desc() string { + return "活动完成条件小时统计" +} + +func (s *CondHour) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronCondHour(), + release: true, + } +} + +func (s *CondHour) Exec() (err error) { + m := dao.FissionArchiveTask + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gte(time.Now().Unix()), + m.Mark.Eq(mtype.FissionArchiveTaskMarkCondHour), + m.IsStop.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + gp, _ := ants.NewPool(10) + defer gp.Release() + + wg := &sync.WaitGroup{} + defer wg.Wait() + + for _, v := range list { + wg.Add(1) + task := v + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("活动完成条件小时统计失败:任务id:%d", task.ID)) + + var conds []*model.FissionCampaignCond + condM := dao.FissionCampaignCond + conds, err = condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(task.CampaignID), condM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return + } + + var bt = map[string]int32{ + mtype.FissionBehaviorMarkFinishTask: mtype.FissionBehaviorTypeFinishTask, + } + for _, cond := range conds { + bt[utils.BehaviorFormatMark(mtype.FissionBehaviorTypeFinishCond, cond.ID)] = mtype.FissionBehaviorTypeFinishCond + } + + err = provider.NewFissionBehaviorTotal(s.ctx, task.CampaignID).BehaviorTotalCycle(mtype.FissionTotalCycleTypeHour, carbon.Now().SubHour(), bt) + if err != nil { + return + } + + if task.EndTime < time.Now().Unix() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.IsStop.Value(mtype.Yes)) + if err != nil { + return + } + + // 停止更新,把天的也停掉 + var dayStop *model.FissionArchiveTask + dayStop, err = m.WithContext(s.ctx).Where( + m.CampaignID.Eq(task.CampaignID), + m.Mark.Eq(mtype.FissionArchiveTaskMarkCondDay), + m.IsStop.Eq(mtype.Yes), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if dayStop != nil { + // 停止接收自定义事件 + _, _ = condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(task.CampaignID)).UpdateSimple(condM.IsDel.Value(mtype.Yes)) + } + + } + + }) + } + return +} + +type CondDay struct { + Action +} + +func (s *CondDay) Desc() string { + return "活动完成条件天统计" +} + +func (s *CondDay) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronCondDay(), + release: true, + } +} + +func (s *CondDay) Exec() (err error) { + m := dao.FissionArchiveTask + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gte(time.Now().Unix()), + m.Mark.Eq(mtype.FissionArchiveTaskMarkCondDay), + m.IsStop.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + gp, _ := ants.NewPool(10) + defer gp.Release() + + wg := &sync.WaitGroup{} + defer wg.Wait() + + for _, v := range list { + wg.Add(1) + task := v + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("活动完成条件天统计:任务id:%d", task.ID)) + + var conds []*model.FissionCampaignCond + condM := dao.FissionCampaignCond + conds, err = condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(task.CampaignID), condM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return + } + + var bt = map[string]int32{ + mtype.FissionBehaviorMarkFinishTask: mtype.FissionBehaviorTypeFinishTask, + } + for _, cond := range conds { + bt[utils.BehaviorFormatMark(mtype.FissionBehaviorTypeFinishCond, cond.ID)] = mtype.FissionBehaviorTypeFinishCond + } + + err = provider.NewFissionBehaviorTotal(s.ctx, task.CampaignID).BehaviorTotalCycle(mtype.FissionTotalCycleTypeDay, carbon.Now().SubHours(12), bt) + if err != nil { + return + } + + if task.EndTime < time.Now().Unix() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.IsStop.Value(mtype.Yes)) + if err != nil { + return + } + + // 停止更新,把小时的也停掉 + var hourStop *model.FissionArchiveTask + hourStop, err = m.WithContext(s.ctx).Where( + m.CampaignID.Eq(task.CampaignID), + m.Mark.Eq(mtype.FissionArchiveTaskMarkCondHour), + m.IsStop.Eq(mtype.Yes), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if hourStop != nil { + // 停止接收自定义事件 + _, _ = condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(task.CampaignID)).UpdateSimple(condM.IsDel.Value(mtype.Yes)) + } + } + + }) + } + return +} + +type AdsDay struct { + Action +} + +func (s *AdsDay) Desc() string { + return "广告活动天统计" +} + +func (s *AdsDay) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronAdsDay(), + release: true, + } +} + +func (s *AdsDay) Exec() (err error) { + m := dao.FissionArchiveTask + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gte(time.Now().Unix()), + m.Mark.Eq(mtype.FissionArchiveTaskMarkAdsDay), + m.IsStop.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + gp, _ := ants.NewPool(10) + defer gp.Release() + + wg := &sync.WaitGroup{} + defer wg.Wait() + + for _, v := range list { + wg.Add(1) + task := v + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("广告活动天统计:任务id:%d", task.ID)) + + var bt = map[string]int32{ + mtype.FissionBehaviorMarkView: mtype.FissionBehaviorTypeView, + mtype.FissionBehaviorMarkAppInstall: mtype.FissionBehaviorTypeAppInstall, + } + + err = provider.NewFissionBehaviorTotal(s.ctx, task.CampaignID).BehaviorTotalCycle(mtype.FissionTotalCycleTypeDay, carbon.Now().SubHours(12), bt) + if err != nil { + return + } + + if task.EndTime < time.Now().Unix() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ID), m.EndTime.Eq(task.EndTime)).UpdateSimple(m.IsStop.Value(mtype.Yes)) + if err != nil { + return + } + } + }) + } + return +} + +type AdsHour struct { + Action +} + +func (s *AdsHour) Desc() string { + return "广告活动小时统计" +} + +func (s *AdsHour) OnceKey() *OnceKey { + return &OnceKey{ + exp: 5 * time.Second, + key: ckey.CronAdsHour(), + release: true, + } +} + +func (s *AdsHour) Exec() (err error) { + m := dao.FissionArchiveTask + + list, err := m.WithContext(s.ctx).Where( + m.EndTime.Gte(time.Now().Unix()), + m.Mark.Eq(mtype.FissionArchiveTaskMarkAdsHour), + m.IsStop.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + gp, _ := ants.NewPool(10) + defer gp.Release() + + wg := &sync.WaitGroup{} + defer wg.Wait() + + for _, v := range list { + wg.Add(1) + task := v + + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(s.ctx, fmt.Sprintf("广告活动小时统计:任务id:%d", task.ID)) + + var bt = map[string]int32{ + mtype.FissionBehaviorMarkView: mtype.FissionBehaviorTypeView, + mtype.FissionBehaviorMarkAppInstall: mtype.FissionBehaviorTypeAppInstall, + } + + err = provider.NewFissionBehaviorTotal(s.ctx, task.CampaignID).BehaviorTotalCycle(mtype.FissionTotalCycleTypeHour, carbon.Now().SubHour(), bt) + if err != nil { + return + } + + if task.EndTime < time.Now().Unix() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(task.ID), m.EndTime.Eq(task.EndTime)).UpdateSimple(m.IsStop.Value(mtype.Yes)) + if err != nil { + return + } + } + }) + } + return +} diff --git a/internal/service/crons/action/z_clear.go b/internal/service/crons/action/z_clear.go new file mode 100644 index 0000000..34d7d97 --- /dev/null +++ b/internal/service/crons/action/z_clear.go @@ -0,0 +1,226 @@ +package action + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "sync" + "time" + + "github.com/panjf2000/ants/v2" + t_centerpb "gits.branchcn.com/backend/taskcenter/proto/go_proto/t_center" + "gorm.io/gen" +) + +type ErrLog struct { + Action +} + +func (s *ErrLog) Desc() string { + return "清理错误日志" +} + +func (s *ErrLog) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronNotifyReward(), + release: true, + } +} + +func (s *ErrLog) Exec() (err error) { + m := dao.ErrLog + t := time.Now().AddDate(0, -1, -15) + _, err = m.WithContext(s.ctx).Where(m.CreatedAt.Lte(t.Unix())).Delete() + if err != nil { + return + } + + return +} + +type SlowLog struct { + Action +} + +func (s *SlowLog) Desc() string { + return "清理错误日志" +} + +func (s *SlowLog) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronNotifyReward(), + release: true, + } +} + +func (s *SlowLog) Exec() (err error) { + m := dao.SlowLog + t := time.Now().AddDate(0, 0, -15) + _, err = m.WithContext(s.ctx).Where(m.CreatedAt.Lte(t.Unix())).Delete() + if err != nil { + return + } + + return +} + +type RewardCancel struct { + Action + wg *sync.WaitGroup +} + +func (s *RewardCancel) Desc() string { + return "清理错误日志" +} + +func (s *RewardCancel) OnceKey() *OnceKey { + return &OnceKey{ + exp: 2 * time.Minute, + key: ckey.CronNotifyReward(), + release: true, + } +} + +func (s *RewardCancel) Exec() (err error) { + m := dao.RewardRelated + + s.wg = new(sync.WaitGroup) + + cpnP, _ := ants.NewPool(5) + defer cpnP.Release() + + ctP, _ := ants.NewPool(5) + defer ctP.Release() + + var list []*model.RewardRelated + err = m.WithContext(s.ctx).Where(m.CancelTime.Eq(0)).FindInBatches(&list, 1000, func(tx gen.Dao, batch int) error { + cpnMap := make(map[int64][]*model.RewardRelated) + ctMap := make(map[int64][]*model.RewardRelated) + + for _, v := range list { + + switch v.RelateTable { + case "fission_campaign": + cpnMap[v.RelateID] = append(cpnMap[v.RelateID], v) + case "taskcenter.center": + ctMap[v.RelateID] = append(ctMap[v.RelateID], v) + } + } + + s.cpn(cpnP, cpnMap) + s.ct(ctP, ctMap) + + return nil + }) + + s.wg.Wait() + + return +} + +func (s *RewardCancel) cpn(cpnP *ants.Pool, cpnMap map[int64][]*model.RewardRelated) (err error) { + if len(cpnMap) == 0 { + return + } + + m := dao.RewardRelated + for id, relates := range cpnMap { + s.wg.Add(1) + cpnId := id + cpnP.Submit(func() { + defer s.wg.Done() + + cpn, _ := cache.NewCampaign(s.ctx).FindById(cpnId) + + if cpn == nil || cpn.Status == mtype.FissionCampaignStatusCancel || cpn.IsDel == mtype.Yes { + _, err = m.WithContext(s.ctx).Where( + m.RelateID.Eq(cpnId), + m.RelateTable.Eq("fission_campaign"), + m.CancelTime.Eq(0), + ).UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + return + } + return + } + + rewardM := dao.FissionCampaignReward + rewards, _ := rewardM.WithContext(s.ctx).Where( + rewardM.CampaignID.Eq(cpnId), + rewardM.IsDel.Eq(mtype.No), + ).Find() + + var useRewardIdMap = make(map[int64]struct{}) + for _, reward := range rewards { + useRewardIdMap[reward.RewardID] = struct{}{} + } + + var cancelIds []int64 + for _, relate := range relates { + if _, ok := useRewardIdMap[relate.RewardID]; !ok { + cancelIds = append(cancelIds, relate.ID) + } + } + + _, err = m.WithContext(s.ctx).Where(m.ID.In(cancelIds...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + return + } + return + + }) + + } + + return +} + +func (s *RewardCancel) ct(ctP *ants.Pool, ctMap map[int64][]*model.RewardRelated) (err error) { + if len(ctMap) == 0 { + return + } + + m := dao.RewardRelated + for id, relates := range ctMap { + s.wg.Add(1) + ctId := id + ctP.Submit(func() { + defer s.wg.Done() + + ctReward, _ := app.NewTaskcenterCenter().CheckRewardUse(s.ctx, &t_centerpb.CheckRewardUseReq{ + Id: ctId, + }) + + var useRewardIdMap = make(map[int64]struct{}) + for _, rewardId := range ctReward.GetRewardIds() { + useRewardIdMap[rewardId] = struct{}{} + } + + var cancelIds []int64 + for _, relate := range relates { + if _, ok := useRewardIdMap[relate.RewardID]; !ok { + cancelIds = append(cancelIds, relate.ID) + } + } + + if len(cancelIds) == 0 { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.In(cancelIds...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + return + } + return + + }) + + } + + return +} diff --git a/internal/service/crons/crons.go b/internal/service/crons/crons.go new file mode 100644 index 0000000..e906d24 --- /dev/null +++ b/internal/service/crons/crons.go @@ -0,0 +1,71 @@ +package crons + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/service/crons/action" + "fmt" + + "github.com/robfig/cron/v3" +) + +func SetUp() { + c := cron.New( + cron.WithSeconds(), + ) + + for t, fcs := range CronMethod() { + for _, fc := range fcs { + _, err := c.AddJob(t, fc) + if err != nil { + app.Logger.Error(context.Background(), fmt.Sprintf("定时任务启动失败: %v", err)) + } + } + } + + c.Start() +} + +func CronMethod() map[string][]cron.Job { + return map[string][]cron.Job{ + "0 * * * * *": { + action.NewJob(&action.CampaignStart{}), + action.NewJob(&action.CampaignEnd{}), + action.NewJob(&action.CampaignQuizOpen{}), + action.NewJob(&action.CampaignPreToTun{}), + }, + "5 * * * * *": { + action.NewJob(&action.CampaignCancelReward{}), + action.NewJob(&action.Notify{}), + action.NewJob(&action.HeartBeatCollector{}), + }, + "30 * * * * *": { + action.NewJob(&action.MallItemTask{}), + }, + "0 */5 * * * *": { + action.NewJob(&action.PushNotify{}), + action.NewJob(&action.PProfCollector{}), + }, + "0 */10 * * * *": { + action.NewJob(&action.CoinSceneSettlement{}), + action.NewJob(&action.ProjectUserCoinExpiredTask{}), + }, + "0 */20 * * * *": { + action.NewJob(&action.StatHour{}), + action.NewJob(&action.CondHour{}), + action.NewJob(&action.AdsHour{}), + action.NewJob(&action.CampaignCoinScene{}), + action.NewJob(&action.CampaignRewardAdd{}), + }, + "0 10 */3 * * *": { + action.NewJob(&action.StatDay{}), + action.NewJob(&action.CondDay{}), + action.NewJob(&action.AdsDay{}), + }, + "0 20 11 * * *": { + action.NewJob(&action.SlowLog{}), + action.NewJob(&action.ErrLog{}), + action.NewJob(&action.RewardCancel{}), + }, + } +} diff --git a/internal/service/notify/notify.go b/internal/service/notify/notify.go new file mode 100644 index 0000000..4d2db73 --- /dev/null +++ b/internal/service/notify/notify.go @@ -0,0 +1,111 @@ +package notify + +import ( + "bytes" + "context" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/repository/mtype" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "time" + + "github.com/valyala/fasthttp" +) + +const ( + timeOut = 10 * time.Second +) + +const ( + ContentTypeJson = "application/json" +) + +func normalReq(ctx context.Context, body []byte, notifyUrl, token, lang string, headers []*mtype.Header) (respBody string, code int, err error) { + req := fasthttp.AcquireRequest() + resp := fasthttp.AcquireResponse() + defer fasthttp.ReleaseRequest(req) + defer fasthttp.ReleaseResponse(resp) + + req.Header.SetMethod(fasthttp.MethodPost) + req.Header.Set(fasthttp.HeaderContentType, ContentTypeJson) + req.Header.Set("X-Message-Id", fmt.Sprint(ctx.Value(consts.TraceIdKey))) + req.Header.Set("X-Lang", lang) + req.Header.Set(fasthttp.HeaderAuthorization, fmt.Sprintf("Token %s", token)) + + for _, h := range headers { + switch h.Mark { + case mtype.NotifyUrlHeaderMarkLang: + req.Header.Set(h.Key, lang) + default: + req.Header.Set(h.Key, h.Val) + } + } + + req.SetRequestURI(notifyUrl) + req.SetBody(body) + + client := &fasthttp.Client{ + ReadTimeout: timeOut, + WriteTimeout: timeOut, + } + + err = client.Do(req, resp) + + return string(resp.Body()), resp.StatusCode(), err +} + +func proxyReq(ctx context.Context, body []byte, notifyUrl, token, lang string, headers []*mtype.Header) (respBody string, code int, err error) { + // 创建代理服务器的地址 + proxyURL, err := url.Parse(config.Config.Server.LadderHost) + if err != nil { + err = errors.New(fmt.Sprintf("无法解析代理 URL: %v", err)) + return + } + + // 创建自定义的 HTTP 客户端 + cli := &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyURL(proxyURL), + }, + } + + reqBody := bytes.NewBuffer(body) + + // 创建请求 + req, err := http.NewRequest("POST", notifyUrl, reqBody) + if err != nil { + err = errors.New(fmt.Sprintf("创建请求失败: %v", err)) + return + } + + req.Header.Set(fasthttp.HeaderContentType, ContentTypeJson) + req.Header.Set("X-Message-Id", fmt.Sprint(ctx.Value(consts.TraceIdKey))) + req.Header.Set("X-Lang", lang) + req.Header.Set(fasthttp.HeaderAuthorization, fmt.Sprintf("Token %s", token)) + + for _, h := range headers { + switch h.Mark { + case mtype.NotifyUrlHeaderMarkLang: + req.Header.Set(h.Key, lang) + default: + req.Header.Set(h.Key, h.Val) + } + } + + // 发送请求 + resp, err := cli.Do(req) + if err != nil { + err = errors.New(fmt.Sprintf("请求失败: %v", err)) + return + } + defer resp.Body.Close() + + // 可以通过 resp.Body 获取响应内容 + data, _ := io.ReadAll(resp.Body) + + return string(data), resp.StatusCode, nil +} diff --git a/internal/service/notify/notify_test.go b/internal/service/notify/notify_test.go new file mode 100644 index 0000000..7850092 --- /dev/null +++ b/internal/service/notify/notify_test.go @@ -0,0 +1,29 @@ +package notify + +import ( + "context" + "joybuywork/internal/repository/mtype" + "testing" + + _ "joybuywork/test" +) + +func TestReward(t *testing.T) { + reward := Reward{ + CampaignId: 2519, + RewardId: 287662212797321216, + UserId: 16845, + CampaignHashId: "d2jfj9mrdj7t2056562g", + RewardHashId: "cnv42u6rdj7rl1lurpvg", + KvData: []*mtype.KV{{ + Key: "1", + Value: "1", + }}, + RewardTitle: "ac", + RewardNum: 1, + SubUserId: "jeff", + ParentSubUserId: "", + } + + reward.Send(context.Background(), "https://testapi.branchcn.com/admin/notify", "0c62351ecc2fe2cda37eea4ed58e48edf334a2e6", 1, nil) +} diff --git a/internal/service/notify/reward.go b/internal/service/notify/reward.go new file mode 100644 index 0000000..3b3466c --- /dev/null +++ b/internal/service/notify/reward.go @@ -0,0 +1,421 @@ +package notify + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "fmt" + "strings" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +var delaySecMap = map[int32]int{ + 0: 15, 1: 15, + 2: 30, + 3: 180, + 4: 600, + 5: 1200, + 6: 1800, 7: 1800, 8: 1800, + 9: 3600, + 10: 3600 * 3, 11: 3600 * 3, 12: 3600 * 3, + 13: 3600 * 6, 14: 3600 * 6, +} + +type Reward struct { + //非传输数据 + CampaignId int64 `json:"campaign_id"` //活动id + RewardId int64 `json:"reward_id"` //领取的用户奖品记录id(fission_reward_record表主键) + UserId int64 `json:"user_id"` //用户id + ParentId int64 `json:"parent_id"` //上级用户id + + //传输数据 + CampaignHashId string `json:"campaign_hash_id"` //活动hash_id(fission_campaign表) + RewardHashId string `json:"reward_hash_id"` //奖品hash_id(fission_reward_record表) + KvData []*mtype.KV `json:"kv_data"` //奖品设置的回调的键值数据 + RewardType int8 `json:"reward_type"` //奖品类型 + RewardTitle string `json:"reward_title"` //奖品名称 + RewardNum int32 `json:"reward_num"` //奖品发放数量 + SubUserId string `json:"sub_user_id"` //活动提供的用户id,该值为第三方提供的唯一标识 + ParentSubUserId string `json:"parent_sub_user_id"` //活用户的上级用户id + Lang string `json:"lang"` //用户绑定的语种标识 + Title string `json:"title"` //活动标题 + MallRecordId int64 `json:"mall_record_id"` //关联的商城记录id(redeem_mall_record表主键) +} + +func (s Reward) Send(ctx context.Context, notifyUrl, token string, pushLadder int8, headers []*mtype.Header) (err error) { + // 防止一些并发操作,导致同时推送到客户端 + lc := app.NewRedisLock(ctx, ckey.FissionAcceptRewardOnce(s.CampaignId, s.RewardHashId), lock.SetExpire(timeOut)) + defer lc.Release() + if !lc.SoftLock() { + return + } + + //回调记录 + taskId := hashid.Id() + m := dao.FissionNotify + fn, err := m.WithContext(ctx).Where(m.CampaignID.Eq(s.CampaignId), m.RecordID.Eq(s.RewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if fn != nil { + taskId = fn.HashID + } + + // 回调成功不处理 + if fn != nil && (fn.IsOk == mtype.Yes || s.hasTask(ctx, fn.ID)) { + return + } + + body, _ := jsonm.Marshal(s.body(ctx, taskId)) + app.Logger.Info(ctx, fmt.Sprintf("奖品推送: %s", body.ToString())) + + reqStart := time.Now() + if fn == nil { + fn = withdefault.FissionNotify(&model.FissionNotify{ + HashID: taskId, + CampaignID: s.CampaignId, + RecordID: s.RewardId, + NotifyURL: notifyUrl, + NotifyType: mtype.FissionNotifyTypeServer, + Token: token, + Body: body.ToString(), + PushLadder: pushLadder, + }) + + fn.Headers, _ = jsonm.ToSliceString(headers) + + _ = m.WithContext(ctx).Create(fn) + } + + var end bool + delaySec, hasDelay := delaySecMap[fn.PushNum] + if !hasDelay { + end = true + } + + var respBody string + var code int + // 是否转发推送 + if pushLadder == mtype.No { + respBody, code, err = normalReq(ctx, body, notifyUrl, token, s.Lang, headers) + } else { + respBody, code, err = proxyReq(ctx, body, notifyUrl, token, s.Lang, headers) + } + + defer func() { // 只有在重推任务结束的时候,才返回错误信息出去 + if err != nil && end { + return + } + + err = nil + }() + + //处理回调任务 + var ok bool + if err == nil && code == 200 && strings.HasPrefix(respBody, "success") { + ok = true + } + + var ntfUp = []field.AssignExpr{ + m.PushNum.Add(1), + m.IsOk.Value(utils.Ternary[int8](ok, mtype.Yes, mtype.No)), + m.Body.Value(body.ToString()), + } + + if fn.NotifyURL != notifyUrl { + ntfUp = append(ntfUp, m.NotifyURL.Value(notifyUrl)) + } + + // 更新状态 + _, _ = m.WithContext(ctx).Where(m.ID.Eq(fn.ID)).UpdateSimple(ntfUp...) + + var cliResp = respBody + if err != nil && cliResp == "" { + cliResp = fmt.Sprintf("系统错误:%v", err) + } else if cliResp == "" { + cliResp = "如果处理成功请返回字符串success,当前接收到的信息为空字符串,无法判断当前回调是否正确" + } + + //回调结果 + fnrM := dao.FissionNotifyResp + _ = fnrM.WithContext(ctx).Create(withdefault.FissionNotifyResp(&model.FissionNotifyResp{ + CreatedAt: reqStart.Unix(), + NotifyID: fn.ID, + Resp: cliResp, + })) + + //如果没有发送成功并且不是最后一次发送,就创建一个任务 + if !ok && !end { + s.createTask(ctx, fn.ID, delaySec) + return + } + + recordM := dao.FissionRewardRecord + recordSM := dao.FissionRewardRecord.SubTable(s.CampaignId) + mallRecordM := dao.RedeemMallRecord + if ok { + _, nd, _ := strings.Cut(respBody, ":") + _, _ = recordM.WithContext(ctx).Where(recordM.ID.Eq(s.RewardId)).UpdateSimple( + recordM.Status.Value(mtype.FissionRewardRecordStatusSuccess), + recordM.FailType.Value(""), + recordM.FailMsg.Value(""), + recordM.CustomRewardVal.Value(nd), + ) + + _, _ = recordSM.WithContext(ctx).Where(recordSM.ID.Eq(s.RewardId)).UpdateSimple( + recordSM.Status.Value(mtype.FissionRewardRecordStatusSuccess), + recordSM.FailType.Value(""), + recordSM.FailMsg.Value(""), + recordSM.CustomRewardVal.Value(nd), + ) + + if s.MallRecordId > 0 { + _, _ = mallRecordM.WithContext(ctx).Where(mallRecordM.ID.Eq(s.MallRecordId)).UpdateSimple( + mallRecordM.Status.Value(mtype.RedeemMallRecordStatusOk), + mallRecordM.FailType.Value(""), + mallRecordM.FailMsg.Value(""), + mallRecordM.CustomRewardVal.Value(nd), + ) + } + + return + } + + var up = []field.AssignExpr{ + recordM.Status.Value(mtype.FissionRewardRecordStatusFail), + } + + var ups = []field.AssignExpr{ + recordSM.Status.Value(mtype.FissionRewardRecordStatusFail), + } + + var mup = []field.AssignExpr{ + mallRecordM.Status.Value(mtype.RedeemMallRecordStatusFail), + } + + if err != nil { + val := fmt.Sprintf("%v", err) + + if strings.Contains(val, "missing port in address") { + up = append(up, + recordM.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + recordM.FailMsg.Value("回调地址无法正常访问"), + ) + + ups = append(ups, + recordSM.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + recordSM.FailMsg.Value("回调地址无法正常访问"), + ) + + mup = append(mup, + recordSM.FailType.Value(mtype.RewardPushFailTypeCli), + recordSM.FailMsg.Value("回调地址无法正常访问"), + ) + } else { + up = append(up, + recordM.FailType.Value(mtype.FissionRewardRecordFailTypeSys), + recordM.FailMsg.Value(val), + ) + ups = append(ups, + recordSM.FailType.Value(mtype.FissionRewardRecordFailTypeSys), + recordSM.FailMsg.Value(val), + ) + + mup = append(mup, + recordSM.FailType.Value(mtype.RewardPushFailTypeSys), + recordSM.FailMsg.Value(val), + ) + } + + } else if !strings.HasPrefix(respBody, "success") { + up = append(up, + recordM.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + recordM.FailMsg.Value("返回无法识别值:"+cliResp), + ) + ups = append(ups, + recordSM.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + recordSM.FailMsg.Value("返回无法识别值:"+cliResp), + ) + mup = append(mup, + recordSM.FailType.Value(mtype.RewardPushFailTypeCli), + recordSM.FailMsg.Value("返回无法识别值:"+cliResp), + ) + } else { + up = append(up, + recordM.FailType.Value(mtype.FissionRewardRecordFailTypeUndefined), + ) + ups = append(ups, + recordSM.FailType.Value(mtype.FissionRewardRecordFailTypeUndefined), + ) + mup = append(mup, + recordSM.FailType.Value(mtype.RewardPushFailTypeUndefined), + ) + } + + _, _ = recordM.WithContext(ctx). + Where(recordM.ID.Eq(s.RewardId)). + UpdateSimple(up...) + + _, _ = recordSM.WithContext(ctx). + Where(recordSM.ID.Eq(s.RewardId)). + UpdateSimple(ups...) + + if s.MallRecordId > 0 { + _, _ = mallRecordM.WithContext(ctx). + Where(mallRecordM.ID.Eq(s.MallRecordId)). + UpdateSimple(mup...) + } + + return +} + +type InviteList struct { + UserId string `json:"user_id"` // 活动提供的用户id,该值为第三方提供的唯一用户标识 + DeviceId string `json:"device_id"` // 活动提供的用户id,该值为第三方提供的唯一设备标识 + InviteTime int64 `json:"invite_time"` // 邀请时间 + Platform string `json:"platform"` // 平台(ios, android, web, other) +} + +func (s Reward) body(ctx context.Context, taskId string) map[string]interface{} { + inviteM := dao.FissionUser + + // 找下级用户数据 + var list []*model.FissionUser + if s.UserId > 0 { + list, _ = inviteM.WithContext(ctx).Where(inviteM.CampaignID.Eq(s.CampaignId), inviteM.ParentID.Eq(s.UserId)).Find() + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + var attrMap = make(map[int64]string) + if len(ids) > 0 { + m := dao.FissionUserAttr + attrs, _ := m.WithContext(ctx).Where(m.UserID.In(ids...), m.Attr.Eq(mtype.FissionUserAttrMarkPlatform)).Find() + for _, v := range attrs { + attrMap[v.UserID] = v.Value + } + } + + var il = make([]*InviteList, 0, len(list)) + for _, v := range list { + il = append(il, &InviteList{ + UserId: v.SubUserID, + DeviceId: v.DeviceID, + InviteTime: v.CreatedAt, + Platform: utils.Ternary[string](attrMap[v.ID] == "", consts.PlatformOther, attrMap[v.ID]), + }) + } + + var kvData = make(map[string]string, len(s.KvData)) + for _, v := range s.KvData { + kvData[v.Key] = v.Value + } + + return map[string]interface{}{ + "task_id": taskId, + "source": "campaign", + "campaign_id": s.CampaignHashId, + "reward_id": s.RewardHashId, + "reward_type": s.RewardType, + "reward_title": s.RewardTitle, + "reward_num": s.RewardNum, + "user_id": s.SubUserId, + "user_platform": s._getPlatform(ctx, s.UserId), + "user_pid": s.ParentSubUserId, + "parent_platform": s._getPlatform(ctx, s.ParentId), + "kv_data": kvData, + "invite_list": il, + "lang": s.Lang, + "title": s.Title, + "custom_param": s._getCustomParam(ctx, s.UserId), + } +} + +// 获取平台信息 +func (s Reward) _getPlatform(ctx context.Context, userId int64) (platform string) { + if userId == 0 { + return + } + attr, err := cache.NewFissionUserAttr(ctx).FindByUniqIdx(userId, mtype.FissionUserAttrMarkPlatform) + if err != nil { + return + } + + if attr != nil { + platform = attr.Value + } + + if platform == "" { + platform = consts.PlatformOther + } + + return +} + +func (s Reward) createTask(ctx context.Context, fnId int64, sec int) { + exp := time.Duration(sec) * time.Second + + // 防止一些并发操作,导致同时推送到客户端 + lc := app.NewRedisLock(ctx, ckey.FissionRewardPushTaskOnce(fnId), lock.SetExpire(exp-time.Second)) + if !lc.SoftLock() { + return + } + + reward, _ := jsonm.MarshalToString(s) + fntM := dao.FissionNotifyTask + task := withdefault.FissionNotifyTask(&model.FissionNotifyTask{ + DoTime: time.Now().Add(exp).Unix(), + NotifyID: fnId, + Reward: reward, + }) + + _ = fntM.WithContext(ctx).Create(task) + producer.RewardPushPub(ctx, sec, types.DelayCommonRewardPush{TaskId: task.ID}) +} + +func (s Reward) hasTask(ctx context.Context, fnId int64) bool { + return app.Redis.Cache.Exists(ctx, ckey.FissionRewardPushTaskOnce(fnId)).Val() > 0 +} + +func (s Reward) _getCustomParam(ctx context.Context, userId int64) (data []*mtype.KV) { + if userId == 0 { + return + } + attr, err := cache.NewFissionUserJattr(ctx).FindByUniqIdx(userId, mtype.FissionUserAttrMarkCustomParam) + if err != nil { + return + } + + if attr == nil { + return make([]*mtype.KV, 0) + } + + var params = strings.Split(attr.Value, ",") + data = make([]*mtype.KV, 0, len(params)) + for _, v := range params { + key, val, _ := strings.Cut(v, "$") + + data = append(data, &mtype.KV{Key: key, Value: val}) + } + + return +} diff --git a/internal/service/provider/award/award_iss_verify.go b/internal/service/provider/award/award_iss_verify.go new file mode 100644 index 0000000..9e902e1 --- /dev/null +++ b/internal/service/provider/award/award_iss_verify.go @@ -0,0 +1,250 @@ +package award + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/merr" +) + +const ( + IssVerifyPointDeductStock = "DeductStock" // 扣除库存 + IssVerifyPointDeductPreStock = "DeductSelectStock" // 扣除预备库存 + IssVerifyPointRuleFilter = "RuleFilter" // 规则过滤 + IssVerifyPointUnlock = "Unlock" // 解锁 +) + +type IssVerify struct { + ctx context.Context + be *merr.BusinessError + user *model.FissionUser + reward *model.FissionCampaignReward + + unlimitStock bool // 不限制库存 + + hasFail bool // 是否校验失败 + point string // 当前校验节点 + err error // 错误信息 + + failDone []func() // 验证不通过要做一些操作,如:返还库存 +} + +// NewAwardIssVerify 奖品发放验证 +func NewAwardIssVerify(ctx context.Context, user *model.FissionUser, reward *model.FissionCampaignReward) *IssVerify { + return &IssVerify{ + ctx: ctx, + be: merr.NewBE(ctx), + user: user, + reward: reward, + unlimitStock: reward.IsThank == mtype.Yes || + reward.Stock == -1 || + reward.PropMark == mtype.FissionCampaignRewardPropMarkPoint, + } +} + +// IsOK 校验结果 +func (s *IssVerify) IsOK() (bool, error) { + if s.err != nil { + return false, s.err + } + + if s.hasFail { + for _, f := range s.failDone { + f() + } + } + + return !s.hasFail, nil +} + +// PointOK 返回验证节点,如果错误,当前返回节点校验不通过 +func (s *IssVerify) PointOK() (point string, ok bool, err error) { + if s.err != nil { + err = s.err + return + } + + if s.hasFail { + for _, f := range s.failDone { + f() + } + point = s.point + return + } + + ok = true + return +} + +// DeductStock 扣除库存 +func (s *IssVerify) DeductStock() (next *IssVerify) { + if s.err != nil || s.hasFail { + return s + } + + s.point = IssVerifyPointDeductStock + + reward := s.reward + + stock, err := stocks.NewCampaignReward(s.ctx, reward.ID) + if err != nil { + s.err = err + return s.setVerify(false, err) + } + + // 如果是谢谢参与奖,增加使用库存 + if s.unlimitStock { + err = stock.AddUseStock(1) + if err != nil { + s.err = err + return s.setVerify(false, err) + } + + s.failDone = append(s.failDone, func() { + // 还原库存 + _ = stock.AddUseStock(-1) + }) + + return s.setVerify(true, nil) + } + + ok, err := stock.DecrPoolAndAdd(reward.ID, 1) + if err != nil || !ok { + s.err = err + return s.setVerify(false, err) + } + + s.failDone = append(s.failDone, func() { + // 还原库存 + _, _ = stock.DecrPoolAndAdd(reward.ID, -1) + }) + + return s.setVerify(true, nil) +} + +// DeductSelectStock 扣除选择库存 +func (s *IssVerify) DeductSelectStock() (next *IssVerify) { + if s.err != nil || s.hasFail { + return s + } + + s.point = IssVerifyPointDeductPreStock + + reward := s.reward + + stock, err := stocks.NewCampaignRewardSelect(s.ctx, reward.ID) + if err != nil { + s.err = err + return s.setVerify(false, err) + } + + // 如果是谢谢参与奖,增加使用库存 + if s.unlimitStock { + err = stock.AddUseStock(1) + if err != nil { + s.err = err + return s.setVerify(false, err) + } + + s.failDone = append(s.failDone, func() { + // 还原库存 + _ = stock.AddUseStock(-1) + }) + + return s.setVerify(true, nil) + } + + ok, err := stock.DecrPoolAndAdd(reward.ID, 1) + if err != nil || !ok { + s.err = err + return s.setVerify(false, err) + } + + s.failDone = append(s.failDone, func() { + // 还原库存 + _, _ = stock.DecrPoolAndAdd(reward.ID, -1) + }) + + return s.setVerify(true, nil) +} + +// RuleFilter 规则过滤 +func (s *IssVerify) RuleFilter() (next *IssVerify) { + if s.err != nil || s.hasFail { + return s + } + + s.point = IssVerifyPointRuleFilter + + if s.reward.HasRule == mtype.No || s.reward.IsThank == mtype.Yes { + return s.setVerify(true, nil) + } + + rule, err := cache.NewCampaignRewardRule(s.ctx).FindByRewardId(s.reward.ID) + if err != nil { + return s.setVerify(false, s.be.CacheError(err)) + } + + if rule == nil { + return s.setVerify(true, nil) + } + + m := dao.FissionRewardRecord.SubTable(s.user.CampaignID) + if rule.CampaignLimit > 0 { + var count int64 + count, err = m.WithContext(s.ctx).Where(m.UserID.Eq(s.user.ID), m.RewardID.Eq(s.reward.ID)).Count() + if err != nil { + return s.setVerify(false, s.be.MysqlError(err)) + } + + if count >= int64(rule.CampaignLimit) { + return s.setVerify(false, nil) + } + } + + return s.setVerify(true, nil) +} + +// Unlock 解锁 +func (s *IssVerify) Unlock() (next *IssVerify) { + if s.err != nil || s.hasFail { + return s + } + + s.point = IssVerifyPointUnlock + + if s.reward.OpenTask == mtype.No || s.reward.IsThank == mtype.Yes { + return s.setVerify(true, nil) + } + + cpnId, userId, rewardId := s.user.CampaignID, s.user.ID, s.reward.ID + m := dao.FissionUnlockReward + ulr, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(cpnId), + m.UserID.Eq(userId), + m.RewardID.Eq(rewardId), + ).Take() + if err = dbcheck.DbError(err); err != nil { + s.err = err + return s.setVerify(false, err) + } + + if ulr == nil { + return s.setVerify(false, nil) + } + + return s.setVerify(true, nil) +} + +// 设置验证信息 +func (s *IssVerify) setVerify(ok bool, err error) *IssVerify { + s.err = err + if !ok { + s.hasFail = true + } + return s +} diff --git a/internal/service/provider/award/award_reawrd.go b/internal/service/provider/award/award_reawrd.go new file mode 100644 index 0000000..011addd --- /dev/null +++ b/internal/service/provider/award/award_reawrd.go @@ -0,0 +1,370 @@ +package award + +import ( + "context" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" + "fmt" +) + +type RecordOption func(record *model.FissionRewardRecord) + +// RewardRecordStatus 设置状态 +func RewardRecordStatus(status int8, failType, failMsg string) RecordOption { + return func(record *model.FissionRewardRecord) { + record.Status = status + record.FailType = failType + record.FailMsg = failMsg + } +} + +// RewardRecordAnswer 设置题答题目 +func RewardRecordAnswer(answer string, score int32) RecordOption { + return func(record *model.FissionRewardRecord) { + record.Answer = answer + record.Score = score + } +} + +// RewardRecordChildId 设置子活动 +func RewardRecordChildId(childId int64) RecordOption { + return func(record *model.FissionRewardRecord) { + record.ChildID = childId + } +} + +type Reward struct { + logic.Context + + user *model.FissionUser + projectId int64 + + coinInfo struct { + Title string + ImgURL string + RewardTitle string + } + + async []func() +} + +// NewAwardReward 奖品发放验证 +func NewAwardReward(ctx context.Context, dao *dao.Query, projectId int64, user *model.FissionUser) *Reward { + award := &Reward{ + user: user, + projectId: projectId, + } + + award.Init(ctx, dao, merr.NewBE(ctx)) + + return award +} + +// RewardIdsBatch 通过奖品id扣除奖品 +func (s *Reward) RewardIdsBatch(rewardIds []int64, sync bool) (res []*RewardRes, async []func(), err error) { + m := s.GetDao().FissionCampaignReward + rewards, err := m.WithContext(s.Ctx).Where(m.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(rewards) == 0 { + return + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rewards { + rewardMap[v.ID] = v + } + + var sendRewards = make([]*model.FissionCampaignReward, 0, len(rewardIds)) + for _, v := range rewardIds { + + reward, has := rewardMap[v] + if !has { + continue + } + + sendRewards = append(sendRewards, reward) + } + + if len(sendRewards) == 0 { + return + } + + return s.DeductStockBatch(sendRewards, sync) +} + +// DeductStockOne 扣除单个缓存 +func (s *Reward) DeductStockOne(reward *model.FissionCampaignReward, sync bool) (record *model.FissionRewardRecord, info provider.RewardAutoLang, async []func(), err error) { + res, async, err := s.DeductStockBatch([]*model.FissionCampaignReward{reward}, sync) + if err != nil { + return + } + + return res[0].Record, res[0].Info, async, nil +} + +// DeductStockBatch 扣除缓存的批量处理 +func (s *Reward) DeductStockBatch(rewards []*model.FissionCampaignReward, sync bool) (res []*RewardRes, async []func(), err error) { + var addRewards = make([]*RewardOne, 0, len(rewards)) + + for _, reward := range rewards { + ok, err1 := NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().IsOK() + if err1 != nil { + err = err1 + return + } + + var opts []RecordOption + if !ok { + opts = append(opts, RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + addRewards = append(addRewards, &RewardOne{ + Reward: reward, + Opts: opts, + }) + } + + return s.Batch(addRewards, sync) +} + +// One 创建用户奖品 +func (s *Reward) One(reward *model.FissionCampaignReward, sync bool, opts ...RecordOption) (record *model.FissionRewardRecord, info provider.RewardAutoLang, async []func(), err error) { + var one = &RewardOne{ + Reward: reward, + Opts: opts, + } + + res, async, err := s.Batch([]*RewardOne{one}, sync) + if err != nil { + return + } + + return res[0].Record, res[0].Info, async, nil +} + +type RewardOne struct { + Reward *model.FissionCampaignReward + Opts []RecordOption +} + +type RewardRes struct { + Record *model.FissionRewardRecord + Info provider.RewardAutoLang + Reward *model.FissionCampaignReward +} + +// Batch 批量创建用户奖品 +func (s *Reward) Batch(rewards []*RewardOne, sync bool) (res []*RewardRes, async []func(), err error) { + if len(rewards) == 0 { + return + } + + user := s.user + + var brIds []int64 + for _, reward := range rewards { + if reward.Reward.RewardID == 0 { + continue + } + + brIds = append(brIds, reward.Reward.RewardID) + } + + var preward *provider.Rewards + if len(brIds) > 0 { + preward, err = provider.NewRewards(s.Ctx, s.projectId, brIds...) + if err != nil { + return + } + } + + res = make([]*RewardRes, 0, len(rewards)) + + var records = make([]*model.FissionRewardRecord, 0, len(rewards)) + + for _, one := range rewards { + reward := one.Reward + + record := withdefault.FissionRewardRecord(&model.FissionRewardRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + RewardID: reward.ID, + RewardType: reward.RewardType, + RewardNum: reward.RewardNum, + Step: reward.Step, + IsThank: reward.IsThank, + BaseRewardID: reward.RewardID, + PropMark: reward.PropMark, + }) + + if verify.InArray[string](reward.PropMark, mtype.FissionCampaignRewardPropMarkChance, mtype.FissionCampaignRewardPropMarkPoint) || reward.RewardID < 0 { + record.Status = mtype.FissionRewardRecordStatusSuccess + } + + if reward.RewardType == mtype.FissionCampaignRewardTypeChild { + record.ChildID = reward.CampaignID + } + + for _, opt := range one.Opts { + opt(record) + } + + var info provider.RewardAutoLang + if reward.PropMark == mtype.FissionCampaignRewardPropMarkPoint { + info.Title, info.ImgUrl, info.RewardTitle, _ = s.getCoinInfo(user.LangMark) + } else if reward.RewardID != 0 && preward != nil { + info, _ = preward.InfoAutoLang(reward.RewardID, user.LangMark) + } + + record.Title, record.ImgURL = info.Title, info.ImgUrl + + records = append(records, record) + res = append(res, &RewardRes{ + Record: nil, + Info: info, + Reward: reward, + }) + } + + m := s.GetDao().FissionRewardRecord + err = m.WithContext(s.Ctx).Create(records...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + sm := s.GetDao().FissionRewardRecord.SubTable(user.CampaignID) + err = sm.WithContext(s.Ctx).Create(records...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var earnCoin []*projectuser.EarnCoinParam + for k, record := range records { + + res[k].Record = record + + switch record.PropMark { + case mtype.FissionCampaignRewardPropMarkPoint: + var operate = mtype.ProjectUserCoinAddReward + switch res[k].Reward.RewardType { + case mtype.FissionCampaignRewardTypeTask: + operate = mtype.ProjectUserCoinAddTask + } + + earnCoin = append(earnCoin, &projectuser.EarnCoinParam{ + CoinNum: record.RewardNum, + IsExpired: res[k].Reward.IsExpired(), + ExpiredAt: res[k].Reward.ExpiredAt(), + Source: mtype.ProjectUserCoinSourceCampaign, + SourceID: record.CampaignID, + SourceData: map[string]string{ + "reward_id": fmt.Sprintf("%d", record.RewardID), + "record_id": fmt.Sprintf("%d", record.ID), + }, + Operate: operate, + }) + default: + s.notify(record, res[k].Info) + } + + s.markPoint(record) + } + + if len(earnCoin) > 0 { + var pu *projectuser.ProjectUser + pu, err = projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(s.projectId, s.user.SubUserID)) + if err != nil { + return + } + + err = pu.EarnCoin(earnCoin...) + if err != nil { + return + } + } + + if sync { + for _, do := range s.async { + do() + } + return + } + + async = s.async + + return +} + +// 回调 +func (s *Reward) notify(record *model.FissionRewardRecord, info provider.RewardAutoLang) { + if record.Status != mtype.FissionRewardRecordStatusWait || record.PropMark == mtype.FissionCampaignRewardPropMarkChance { + return + } + + if info.ReceiveType == mtype.RewardReceiveTypeClient { + _ = s.GetDao().FissionClientReward.WithContext(s.Ctx).Create(withdefault.FissionClientReward(&model.FissionClientReward{ + UserID: s.user.SubUserID, + ProjectID: s.projectId, + CampaignID: s.user.CampaignID, + RecordID: record.ID, + CreatedAt: record.CreatedAt, + })) + return + } + + s.async = append(s.async, func() { + producer.NewCampaignNotice(s.Ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: s.user.CampaignID, + UserId: s.user.ID, + UserRewardId: record.ID, + }) + producer.CheckRewardPush(s.Ctx, 60, types.DelayCommonCheckRewardPush{ + CampaignId: s.user.CampaignID, + UserId: s.user.ID, + UserRewardId: record.ID, + BaseRewardId: record.BaseRewardID, + }) + }) +} + +// 埋点 +func (s *Reward) markPoint(record *model.FissionRewardRecord) { + s.async = append(s.async, func() { + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).Reward(record.CreatedAt, record.RewardID, record.ID, record.ChildID, record.RewardType, record.RewardNum) + }) +} + +func (s *Reward) getCoinInfo(langMark string) (title, imgUrl, rewardTitle string, err error) { + + if s.coinInfo.Title != "" { + return s.coinInfo.Title, s.coinInfo.ImgURL, s.coinInfo.RewardTitle, nil + } + + s.coinInfo.Title, s.coinInfo.ImgURL, s.coinInfo.RewardTitle, err = cmm.NewCMM(s.Ctx, s.GetDao()).GetCoinInfo(s.projectId, langMark) + if err != nil { + return + } + + return s.coinInfo.Title, s.coinInfo.ImgURL, s.coinInfo.RewardTitle, nil +} diff --git a/internal/service/provider/c_test.go b/internal/service/provider/c_test.go new file mode 100644 index 0000000..aaf2237 --- /dev/null +++ b/internal/service/provider/c_test.go @@ -0,0 +1,13 @@ +package provider + +import ( + "context" + "testing" + + _ "joybuywork/test" +) + +func TestCompanyMade(t *testing.T) { + a := NewCompanyMade(context.TODO(), 68).OkTemp("gold_dog") + t.Log(a) +} diff --git a/internal/service/provider/cachecurd/coin_scene.hmap.go b/internal/service/provider/cachecurd/coin_scene.hmap.go new file mode 100644 index 0000000..096277b --- /dev/null +++ b/internal/service/provider/cachecurd/coin_scene.hmap.go @@ -0,0 +1,76 @@ +package cachecurd + +import ( + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/lockdo" + "fmt" +) + +const ( + tCoinScene = "coinScene" // 金币池场次数据 +) + +const ( + CoinSceneUserCoin = "user_coin" // 投入金币总数 + CoinSceneJoinNum = "join_num" // 投入总次数 + CoinSceneJoinUserNum = "join_user_num" // 投入总人数 + CoinSceneGetNum = "get_num" // 领奖总人数 + CoinSceneGetTotal = "get_total" // 领奖金币数 +) + +// 激励养成奖品选择人数 +func (s *HMap) coinScene(cond *HMapBuild) (err error) { + err = lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + m := dao.FissionCoin + var total struct { + UserCoin int64 `json:"user_coin"` + JoinNum int64 `json:"join_num"` + JoinUserNum int64 `json:"join_user_num"` + } + + err = m.WithContext(s.ctx). + Select( + m.UseCoin.Sum().As("user_coin"), + m.UseNum.Sum().As("join_num"), + m.UserID.Count().As("join_user_num"), + ). + Where(m.SceneID.Eq(cond.SceneId), m.UseNum.Gt(0)). + Scan(&total) + if err != nil { + return + } + + var getTotal struct { + GetNum int64 `json:"get_num"` + GetCoin int64 `json:"get_coin"` + } + err = m.WithContext(s.ctx). + Select( + m.GetCoin.Sum().As("get_coin"), + m.UserID.Count().As("get_num"), + ). + Where(m.SceneID.Eq(cond.SceneId), m.Status.Eq(mtype.FissionCoinStatusOk)). + Scan(&getTotal) + if err != nil { + return + } + + // 这里初始化一下内存数据 + s.data = make(map[string]string, 4) + + return s.Set( + CoinSceneUserCoin, fmt.Sprint(total.UserCoin), + CoinSceneJoinNum, fmt.Sprint(total.JoinNum), + CoinSceneGetNum, fmt.Sprint(getTotal.GetNum), + CoinSceneJoinUserNum, fmt.Sprint(total.JoinUserNum), + CoinSceneGetTotal, fmt.Sprint(getTotal.GetCoin), + ) + }) + + return +} diff --git a/internal/service/provider/cachecurd/hmap.go b/internal/service/provider/cachecurd/hmap.go new file mode 100644 index 0000000..9a4f89c --- /dev/null +++ b/internal/service/provider/cachecurd/hmap.go @@ -0,0 +1,208 @@ +package cachecurd + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "fmt" + "strconv" + "time" + + grds "github.com/go-redis/redis/v8" +) + +type HMap struct { + ctx context.Context + cli *grds.Client + key string + + exp time.Duration + build *HMapBuild + + data map[string]string +} + +func NewHMap(ctx context.Context, key string, opts ...HMapOption) (*HMap, error) { + hmap := &HMap{ + ctx: ctx, + cli: app.Redis.Cache, + key: key, + exp: lockdo.Rand2HourExp(), + } + + for _, opt := range opts { + opt(hmap) + } + + err := hmap.Build() + if err != nil { + return nil, err + } + + return hmap, nil +} + +func (s *HMap) Get(field string) (value string, err error) { + if s.data != nil { + return s.data[field], nil + } + + data, err := s.GetAll() + if err != nil { + return + } + + return data[field], nil +} + +func (s *HMap) GetInt64(field string) (value int64, err error) { + val, err := s.Get(field) + if err != nil { + return + } + return utils.StrToInt64(val), nil +} + +// GetAll 获取数据 +func (s *HMap) GetAll() (data map[string]string, err error) { + if s.data != nil { + return s.data, nil + } + + data, err = s.cli.HGetAll(s.ctx, s.key).Result() + if err != nil { + return + } + + s.data = data + + return +} + +// Set 设置数据 +func (s *HMap) Set(values ...string) (err error) { + s.cli.HSet(s.ctx, s.key, values) + if s.data != nil { + for i := 0; i < len(values); i += 2 { + s.data[values[i]] = values[i+1] + } + } + + s.setExp() + + return +} + +// Incr 追加值 +func (s *HMap) Incr(key string, val int64) (num int64, err error) { + num, err = s.cli.HIncrBy(s.ctx, s.key, key, val).Result() + if err != nil { + return + } + if s.data != nil { + v, _ := strconv.ParseInt(s.data[key], 10, 64) + s.data[key] = fmt.Sprintf("%d", v+val) + } + + s.setExp() + + return +} + +// Del 删除值 +func (s *HMap) Del(key string) (err error) { + s.cli.HDel(s.ctx, s.key, key) + if s.data != nil { + delete(s.data, key) + } + + s.setExp() + + return +} + +// Clear 清楚HMap +func (s *HMap) Clear() (err error) { + return s.cli.Del(s.ctx, s.key).Err() +} + +// Exist 是否存在key +func (s *HMap) Exist(key string) bool { + data, _ := s.GetAll() + _, ok := data[key] + return ok +} + +// Int64ToInt64 把数据变成map[int64]int64 +func (s *HMap) Int64ToInt64() (data map[int64]int64, err error) { + vals, err := s.GetAll() + if err != nil { + return + } + + data = make(map[int64]int64, len(vals)) + for k, v := range vals { + key, _ := strconv.ParseInt(k, 10, 64) + value, _ := strconv.ParseInt(v, 10, 64) + data[key] = value + } + + return +} + +func (s *HMap) setExp() { + s.cli.Expire(s.ctx, s.key, s.exp) +} + +func (s *HMap) CustomBuild(fc func() ([]string, error)) (*HMap, error) { + err := lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + values, err := fc() + if err != nil { + return + } + + s.data = make(map[string]string, len(values)/2) + + return s.Set(values...) + }) + + return s, err +} + +type HMapBuild struct { + t string + CpnId int64 + RewardId int64 + RewardLimit int64 + SceneId int64 + UserId int64 + Tz int32 +} + +func (s *HMap) Build() (err error) { + if s.build == nil { + return + } + + switch s.build.t { + case tKeepRewardSelect: + return s.keepRewardSelect(s.build) + case tCampaignRewardStock: + return s.campaignRewardStock(s.build) + case tRewardSelectStock: + return s.rewardSelectStock(s.build) + case tCampaignStock: + return s.campaignStock(s.build) + case tCoinScene: + return s.coinScene(s.build) + case tMallItemStock: + return s.mallItemStock(s.build) + } + + return +} diff --git a/internal/service/provider/cachecurd/hmap_option.go b/internal/service/provider/cachecurd/hmap_option.go new file mode 100644 index 0000000..9e80039 --- /dev/null +++ b/internal/service/provider/cachecurd/hmap_option.go @@ -0,0 +1,66 @@ +package cachecurd + +import "time" + +type HMapOption func(hamp *HMap) + +func SetCampaignStock(cpnId int64) HMapOption { + return func(hamp *HMap) { + hamp.build = &HMapBuild{ + t: tCampaignStock, + CpnId: cpnId, + } + } +} + +func SetCampaignRewardStock(rewardId int64) HMapOption { + return func(hamp *HMap) { + hamp.build = &HMapBuild{ + t: tCampaignRewardStock, + RewardId: rewardId, + } + } +} + +func SetRewardSelectStock(rewardId int64) HMapOption { + return func(hamp *HMap) { + hamp.build = &HMapBuild{ + t: tRewardSelectStock, + RewardId: rewardId, + } + } +} + +func SetKeepRewardSelectBuild(cpnId int64) HMapOption { + return func(hamp *HMap) { + hamp.build = &HMapBuild{ + t: tKeepRewardSelect, + CpnId: cpnId, + } + } +} + +func SetCoinSceneBuild(cpnId, sceneId int64) HMapOption { + return func(hamp *HMap) { + hamp.build = &HMapBuild{ + t: tCoinScene, + CpnId: cpnId, + SceneId: sceneId, + } + } +} + +func SetHMapExp(exp time.Duration) HMapOption { + return func(hamp *HMap) { + hamp.exp = exp + } +} + +func SetMallItemStock(rewardId int64) HMapOption { + return func(hamp *HMap) { + hamp.build = &HMapBuild{ + t: tMallItemStock, + RewardId: rewardId, + } + } +} diff --git a/internal/service/provider/cachecurd/keep_reward_select.hmap.go b/internal/service/provider/cachecurd/keep_reward_select.hmap.go new file mode 100644 index 0000000..aef81da --- /dev/null +++ b/internal/service/provider/cachecurd/keep_reward_select.hmap.go @@ -0,0 +1,58 @@ +package cachecurd + +import ( + "joybuywork/internal/repository/dao" + "joybuywork/internal/utils/lockdo" + "fmt" +) + +const ( + tKeepRewardSelect = "keepRewardSelect" // 激励养成奖品选择人数 + +) + +// 激励养成奖品选择人数 +func (s *HMap) keepRewardSelect(cond *HMapBuild) (err error) { + err = lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + m := dao.FissionKeep + type Num struct { + RewardId int64 + Num int64 + } + + var nums []*Num + err = m.WithContext(s.ctx). + Select( + m.ID.Count().As("num"), + m.RewardID, + ). + Where(m.CampaignID.Eq(cond.CpnId)).Group(m.RewardID).Scan(&nums) + if err != nil { + return + } + + var values []string + for _, num := range nums { + values = append(values, fmt.Sprintf("%d", num.RewardId), fmt.Sprintf("%d", num.Num)) + } + + err = s.Set(values...) + if err != nil { + return + } + + s.data = make(map[string]string, len(nums)) + for i := 0; i < len(values); i += 2 { + s.data[values[i]] = values[i+1] + } + + return + + }) + + return +} diff --git a/internal/service/provider/cachecurd/rank.go b/internal/service/provider/cachecurd/rank.go new file mode 100644 index 0000000..858b914 --- /dev/null +++ b/internal/service/provider/cachecurd/rank.go @@ -0,0 +1,162 @@ +package cachecurd + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/lockdo" + "fmt" + "time" + + grds "github.com/go-redis/redis/v8" + "gorm.io/gen" +) + +type RankOption func(rank *Ranker) + +func SetChildBuild(cpnId int64, childType int8) RankOption { + return func(rank *Ranker) { + rank.build = &RankBuild{ + CpnId: cpnId, + ChildType: childType, + } + } +} + +func SetRankExp(exp time.Duration) RankOption { + return func(rank *Ranker) { + rank.exp = exp + } +} + +type Ranker struct { + ctx context.Context + cli *grds.Client + key string + + build *RankBuild + exp time.Duration +} + +type RankBuild struct { + CpnId int64 + ChildType int8 +} + +func NewRanker(ctx context.Context, key string, opts ...RankOption) (*Ranker, error) { + rank := &Ranker{ + ctx: ctx, + cli: app.Redis.Cache, + key: key, + exp: time.Hour * 24, + } + for _, opt := range opts { + opt(rank) + } + + err := rank.Build() + if err != nil { + return nil, err + } + + return rank, nil +} + +func (s *Ranker) Build() (err error) { + if s.build == nil { + return + } + + if s.build.ChildType == mtype.FissionCampaignChildTypeInvite { + return s.invite(s.build) + } + + return +} + +type RankMember struct { + UserId string + Score float64 +} + +// GetRank 获取排名数据 +func (s *Ranker) GetRank(num int64) (members []*RankMember, err error) { + data, err := s.cli.ZRevRangeWithScores(s.ctx, s.key, 0, num-1).Result() + if err != nil { + return + } + + members = make([]*RankMember, len(data)) + for i, v := range data { + members[i] = &RankMember{ + UserId: fmt.Sprintf("%v", v.Member), + Score: v.Score, + } + } + + return +} + +// InitMember 初始化一个用户 +func (s *Ranker) InitMember(member string, asc int64) (err error) { + return s.SetMembers([]*grds.Z{{ + Score: 1 + s.timeAsc(asc), + Member: member, + }}) +} + +// SetMembers 设置用户 +func (s *Ranker) SetMembers(members []*grds.Z) (err error) { + return s.cli.ZAdd(s.ctx, s.key, members...).Err() +} + +// GetMemberRank 获取用户当前排名,如果返回9,是第10名的意思 +func (s *Ranker) GetMemberRank(member string) (rank int64, err error) { + return s.cli.ZRevRank(s.ctx, s.key, member).Result() +} + +// Incr 追加分数 +func (s *Ranker) Incr(member string) (err error) { + return s.IncrBy(1, member) +} + +// IncrBy 追加特定分数 +func (s *Ranker) IncrBy(increment float64, member string) (err error) { + return s.cli.ZIncrBy(s.ctx, s.key, increment, member).Err() +} + +// 子活动排行榜初始化 +func (s *Ranker) invite(build *RankBuild) (err error) { + return lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + m := dao.FissionChildUser + var list []*model.FissionChildUser + err = m.WithContext(s.ctx).Where(m.CampaignID.Eq(build.CpnId), m.InviteNum.Gt(0)).FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + var members = make([]*grds.Z, 0, len(list)) + for _, v := range list { + members = append(members, &grds.Z{ + Score: float64(v.InviteNum) + s.timeAsc(v.CreatedAt), + Member: fmt.Sprint(v.UserID), + }) + } + return s.SetMembers(members) + }) + + s.setExp() + + return + }) +} + +func (s *Ranker) setExp() { + s.cli.Expire(s.ctx, s.key, s.exp) +} + +func (s *Ranker) timeAsc(asc int64) float64 { + return 1 - float64(asc)/1e13 +} diff --git a/internal/service/provider/cachecurd/stock.hmap.go b/internal/service/provider/cachecurd/stock.hmap.go new file mode 100644 index 0000000..85d7efd --- /dev/null +++ b/internal/service/provider/cachecurd/stock.hmap.go @@ -0,0 +1,218 @@ +package cachecurd + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/proto/go_proto/workerr" + "fmt" +) + +const ( + StockFieldStock = "stock" // 总库存 + StockFieldUseStock = "use_stock" // 已使用 + StockFieldPoolNum = "pool_num" // 奖品池使用 +) + +const ( + tRewardSelectStock = "rewardSelectStock" // 奖品被选择的库存 + tCampaignRewardStock = "campaignRewardStock" // 活动奖品库存 + tCampaignStock = "campaignStock" // 活动库存 + + tMallItemStock = "mallItemStock" // 商城库存 +) + +// 奖品总预算情况 +func (s *HMap) campaignStock(cond *HMapBuild) (err error) { + err = lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + var cpn *model.FissionCampaign + cpn, err = cache.NewCampaign(s.ctx).FindById(cond.CpnId) + if err != nil { + return + } + + var rewardLimit int64 + + switch cpn.FissionID { + case consts.IdReferral: + var conf *model.FissionCampaignReferral + conf, err = cache.NewCampaignReferral(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + return + } + rewardLimit = int64(conf.RewardLimit) + case consts.IdWinTogether: + var conf *model.FissionCampaignWin + conf, err = cache.NewCampaignWin(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + return + } + rewardLimit = int64(conf.RewardLimit) + case consts.IdGold: + var conf *model.FissionCampaignGold + conf, err = cache.NewCampaignGold(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + return + } + rewardLimit = int64(conf.PriceNum) + case consts.IdCash: + var conf *model.FissionCampaignCash + conf, err = cache.NewCampaignCash(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + return + } + rewardLimit = int64(conf.PriceNum) + default: + return workerr.VerifyError("The fission is not be support") + } + + var num int64 + switch cpn.FissionID { + case consts.IdGold: + m := dao.FissionGoldLog + num, err = m.WithContext(s.ctx). + Where(m.CampaignID.Eq(cpn.ID), m.Type.Eq(mtype.FissionGoldLogTypeReward)). + Count() + if err != nil { + return + } + case consts.IdCash: + m := dao.FissionCashRecord + num, err = m.WithContext(s.ctx). + Where(m.CampaignID.Eq(cpn.ID), m.Type.Eq(mtype.FissionCashRecordTypeReward)). + Count() + if err != nil { + return + } + default: + var rewardNum struct { + Num int64 `json:"num"` + } + m := dao.FissionRewardRecord.SubTable(cond.CpnId) + err = m.WithContext(s.ctx). + Select(m.RewardNum.Sum().As("num")). + Where(m.CampaignID.Eq(cond.CpnId), m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp)). + Scan(&rewardNum) + if err != nil { + return + } + + num = rewardNum.Num + } + + return s._setStock(rewardLimit, num, rewardLimit-num) + }) + + return +} + +// 奖品发放库存情况 +func (s *HMap) campaignRewardStock(cond *HMapBuild) (err error) { + err = lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + rewardId := cond.RewardId + + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(rewardId)).Take() + if err != nil { + return + } + + m := dao.FissionRewardRecord.SubTable(reward.CampaignID) + count, err := m.WithContext(s.ctx).Where( + m.RewardID.Eq(rewardId), + m.Status.Neq(mtype.FissionRewardRecordStatusFail), + ).Count() + if err != nil { + return + } + + return s._setStock(int64(reward.Stock), count, utils.Ternary[int64](reward.IsThank == mtype.Yes, -1, int64(reward.Stock)-count)) + + }) + + return +} + +// 奖品选择库存情况 +func (s *HMap) rewardSelectStock(cond *HMapBuild) (err error) { + err = lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + rewardId := cond.RewardId + + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(rewardId)).Take() + if err != nil { + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(reward.CampaignID) + if err != nil { + return + } + + var count int64 + switch cpn.FissionID { + case consts.IdKeep: + m := dao.FissionKeep + count, err = m.WithContext(s.ctx).Where( + m.RewardID.Eq(rewardId), + m.CancelReward.Eq(mtype.No), + ).Count() + if err != nil { + return + } + default: + return workerr.VerifyError("The fission is not be support") + } + + return s._setStock(int64(reward.Stock), count, utils.Ternary[int64](reward.IsThank == mtype.Yes, -1, int64(reward.Stock)-count)) + }) + + return +} + +func (s *HMap) mallItemStock(cond *HMapBuild) (err error) { + err = lockdo.ExistDo(s.ctx, s.key, func(exist bool) (err error) { + if exist { + return + } + + rewardId := cond.RewardId + + rewardM := dao.RedeemMallItem + reward, err := rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(rewardId)).Take() + if err != nil { + return + } + + m := dao.RedeemMallRecord + count, err := m.WithContext(s.ctx).Where(m.MallItemID.Eq(reward.ID)).Count() + if err != nil { + return + } + + return s._setStock(reward.Stock, count, reward.Stock-count) + }) + + return +} + +func (s *HMap) _setStock(stock, useStock, poolNum int64) (err error) { + s.data = make(map[string]string, 3) + return s.Set(StockFieldStock, fmt.Sprint(stock), StockFieldUseStock, fmt.Sprint(useStock), StockFieldPoolNum, fmt.Sprint(poolNum)) +} diff --git a/internal/service/provider/campaign_timezone.go b/internal/service/provider/campaign_timezone.go new file mode 100644 index 0000000..e661ae0 --- /dev/null +++ b/internal/service/provider/campaign_timezone.go @@ -0,0 +1,133 @@ +package provider + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/timez" + "time" +) + +type CampaignTZ struct { + ctx context.Context + be *merr.BusinessError + + cpn *model.FissionCampaign + langMark string + + tOffset int32 + start, end, pre int64 +} + +// NewCampaignTZ 活动控制器 +func NewCampaignTZ(ctx context.Context, cpn *model.FissionCampaign, langMark string) *CampaignTZ { + ct := &CampaignTZ{ + ctx: ctx, + be: merr.NewBE(ctx), + cpn: cpn, + langMark: langMark, + } + + ct.tz() + + return ct +} + +// GetStatus 获取活动状态 +func (s *CampaignTZ) GetStatus() int32 { + if s.IsWait() { + return mtype.FissionCampaignStatusWait + } + + if s.IsPre() { + return mtype.FissionCampaignStatusPubPre + } + + if s.IsRunning() { + return mtype.FissionCampaignStatusPub + } + + return mtype.FissionCampaignStatusCancel +} + +// GetTz 获取活动时区 +func (s *CampaignTZ) GetTz() int32 { + return s.tOffset +} + +// IsWait 活动等待开始 +func (s *CampaignTZ) IsWait() bool { + return time.Now().Unix() < s.start +} + +// IsRunning IsStart 活动进行中 +func (s *CampaignTZ) IsRunning() bool { + return time.Now().Unix() > s.start && time.Now().Unix() < s.end +} + +// IsEnd 活动是否结束 +func (s *CampaignTZ) IsEnd() bool { + return time.Now().Unix() > s.end +} + +// IsPre 活动是否在予发布期间 +func (s *CampaignTZ) IsPre() bool { + if s.pre > 0 { + return time.Now().Unix() < s.pre + } + + return s.cpn.Status == mtype.FissionCampaignStatusPubPre +} + +// EndTime 结束时间处理成设置好时区的标准时间 +func (s *CampaignTZ) EndTime() time.Time { + return time.Unix(s.end, 0).In(timez.Location(s.tOffset)) +} + +// StarTime 开始时间处理成设置好时区的标准时间 +func (s *CampaignTZ) StarTime() time.Time { + return time.Unix(s.start, 0).In(timez.Location(s.tOffset)) +} + +// 时区处理 +func (s *CampaignTZ) tz() { + s.tOffset = s.cpn.TOffset + s.start = s.cpn.StartTime + s.end = s.cpn.EndTime + s.pre = s.cpn.PreToRun + lms := s.cpn.GetLangMarks() + + if len(lms) <= 1 || s.langMark == "" { + return + } + + var uLang string + for _, lm := range lms[1:] { + if lm == s.langMark { + uLang = lm + break + } + } + + if uLang == "" { + return + } + + lang, _ := cache.NewCampaignLang(s.ctx).FindByCampaignId(s.cpn.ID, uLang) + if lang == nil { + return + } + + s.tOffset = lang.TOffset + s.start = timez.GMT(s.cpn.TStart, lang.TOffset) + s.end = timez.GMT(s.cpn.TEnd, lang.TOffset) + + if s.cpn.PreToRun > 0 { + preTime := timez.GMTTime(s.cpn.TOffset, s.cpn.PreToRun) + preDateTime := preTime.Format(time.DateTime) + langPre, _ := time.ParseInLocation(time.DateTime, preDateTime, timez.Location(lang.TOffset)) + s.pre = langPre.Unix() + } +} diff --git a/internal/service/provider/company_made.go b/internal/service/provider/company_made.go new file mode 100644 index 0000000..714b1d7 --- /dev/null +++ b/internal/service/provider/company_made.go @@ -0,0 +1,164 @@ +package provider + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" +) + +type CompanyMade struct { + logic.Context + + companyId int64 + + conf *model.CompanyMade +} + +func NewCompanyMade(ctx context.Context, companyId int64, opts ...logic.CtxOption) (conf *CompanyMade) { + conf = &CompanyMade{ + companyId: companyId, + } + + conf.BaseInit(ctx, merr.NewBE(ctx), opts...) + + return +} + +type CompanyMadeStatus struct { + Open bool `json:"open"` + FissionTemp []string `json:"fission_temp"` +} + +func (s *CompanyMade) OkTemp(mark string) (ok bool) { + status, _ := s.GetMade(mtype.CompanyMadeMarkFissionTemp) + + return verify.InArray[string](mark, status.FissionTemp...) +} + +func (s *CompanyMade) GetMade(mark string) (status CompanyMadeStatus, err error) { + key := ckey.CompanyMade(s.companyId, mark) + + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + + if exist { + b, _ := app.Redis.Cache.Get(s.Ctx, key).Bytes() + return jsonm.Unmarshal(b, &status) + } + + var made *model.CompanyMade + made, err = s._getMade(mark, false) + if err != nil { + return + } + + status.Open = made != nil + + if made != nil { + status.FissionTemp = made.GetFissionTemp() + } + + b, _ := jsonm.Marshal(status) + app.Redis.Cache.Set(s.Ctx, key, b.ToBytes(), lockdo.Rand2HourExp()) + + return + }) + + return +} + +func (s *CompanyMade) SetMake(mark string, params any) (err error) { + made, err := s._getMade(mark, true) + if err != nil { + return + } + + made.SetParams(params) + + err = s.GetDao().CompanyMade.WithContext(s.Ctx).Save(made) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s._clear(mark) + + return +} + +func (s *CompanyMade) Del(mark string) (err error) { + made, err := s._getMade(mark, false) + if err != nil || made == nil { + return + } + + _, err = s.GetDao().CompanyMade.WithContext(s.Ctx).Delete(made) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s._clear(mark) + + return +} + +func (s *CompanyMade) _getMade(mark string, nilCreate bool) (made *model.CompanyMade, err error) { + made, err = cache.NewCompanyMade(s.Ctx).FindByUniqId(s.companyId, mark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if made != nil || !nilCreate { + return + } + + key := ckey.CompanyMadeStoreOnce(s.companyId, mark) + lc := app.NewFollower(s.Ctx, key).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + made, err = cache.NewCompanyMade(s.Ctx).FindByUniqId(s.companyId, mark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if made != nil { + return + } + + made = withdefault.CompanyMade(&model.CompanyMade{ + CompanyID: s.companyId, + Mark: mark, + }) + + err = s.GetDao().CompanyMade.WithContext(s.Ctx).Create(made) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *CompanyMade) _clear(mark string) { + _ = cache.NewCompanyMade(s.Ctx).Clear(&model.CompanyMade{ + CompanyID: s.companyId, + Mark: mark, + }) + + app.Redis.Cache.Del(s.Ctx, ckey.CompanyMade(s.companyId, mark)) +} diff --git a/internal/service/provider/fission_behavior_total.go b/internal/service/provider/fission_behavior_total.go new file mode 100644 index 0000000..0269b98 --- /dev/null +++ b/internal/service/provider/fission_behavior_total.go @@ -0,0 +1,501 @@ +package provider + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/merr" + "joybuywork/proto/go_proto/workerr" + "fmt" + "github.com/golang-module/carbon/v2" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen" + "gorm.io/gen/field" + "time" +) + +type FissionBehaviorTotal struct { + ctx context.Context + be *merr.BusinessError + cpnId int64 +} + +// NewFissionBehaviorTotal 用户行为统计数据 +func NewFissionBehaviorTotal(ctx context.Context, cpnId int64) *FissionBehaviorTotal { + return &FissionBehaviorTotal{ctx: ctx, be: merr.NewBE(ctx), cpnId: cpnId} +} + +// StatHour 设置小时活动归档数据 +func (s *FissionBehaviorTotal) StatHour(mark string, at int64, userMark string) { + t := carbon.CreateFromTimestamp(at) + + start, end := t.StartOfHour(), t.EndOfHour() + hour := t.Format(consts.YmdH) + + //次数key + key := ckey.FissionBehaviorTotalCycleHour(s.cpnId, hour) + userKey := ckey.FissionBehaviorTotalCycleHourUser(s.cpnId, hour, mark) + + // 如果key不存在 + if app.Redis.Cache.Exists(s.ctx, key).Val() == 0 { + _ = s._existStat(mark, start, end, key, userKey) + } + + // 次数 + app.Redis.Cache.HIncrBy(s.ctx, key, mark, 1) + app.Redis.Cache.Expire(s.ctx, key, 2*time.Hour) + + //人数 + app.Redis.Cache.HSet(s.ctx, userKey, userMark, 1) + app.Redis.Cache.Expire(s.ctx, userKey, 2*time.Hour) + return +} + +// StatDay 设置天纬度的统计数据 +func (s *FissionBehaviorTotal) StatDay(mark string, at int64, userMark string) { + t := carbon.CreateFromTimestamp(at) + + start, end := t.StartOfDay(), t.EndOfDay() + day := t.ToShortDateString() + + //次数key + key := ckey.FissionBehaviorTotalCycleDay(s.cpnId, day) + userKey := ckey.FissionBehaviorTotalCycleDayUser(s.cpnId, day, mark) + + // 如果key不存在 + if app.Redis.Cache.Exists(s.ctx, key).Val() == 0 { + _ = s._existStat(mark, start, end, key, userKey) + } + + //次数 + app.Redis.Cache.HIncrBy(s.ctx, key, mark, 1) + app.Redis.Cache.Expire(s.ctx, key, 2*time.Hour) + + //人数 + app.Redis.Cache.HSet(s.ctx, userKey, userMark, 1) + app.Redis.Cache.Expire(s.ctx, userKey, 2*time.Hour) +} + +type BehaviorNum struct { + Total int64 + Mark string +} + +// CycleHour 获取小时活动归档数据 +func (s *FissionBehaviorTotal) CycleHour(t carbon.Carbon, marks ...string) (hourNumMap, hourUserNumMap map[string]int64, err error) { + // 小时数据统计归档 + hourStr := t.Format(consts.YmdH) + key := ckey.FissionBehaviorTotalCycleHour(s.cpnId, hourStr) + if len(marks) == 0 { + var numMap = map[string]string{} + numMap, err = app.Redis.Cache.HGetAll(s.ctx, key).Result() + if err != nil { + err = s.be.RedisError(err) + return + } + + hourNumMap, hourUserNumMap = make(map[string]int64, len(numMap)), make(map[string]int64, len(numMap)) + + for mark, num := range numMap { + hourNumMap[mark] = utils.StrToInt64(num) + userKey := ckey.FissionBehaviorTotalCycleHourUser(s.cpnId, hourStr, mark) + hourUserNumMap[mark] = app.Redis.Cache.HLen(s.ctx, userKey).Val() + } + + return + } + + // 如果没有数据就填充好 + start, end := t.StartOfHour(), t.EndOfHour() + for _, mark := range marks { + if !app.Redis.Cache.HExists(s.ctx, key, mark).Val() { + err = s._existStat(mark, start, end, key, ckey.FissionBehaviorTotalCycleHourUser(s.cpnId, hourStr, mark)) + if err != nil { + return + } + } + } + + hourNumMap, hourUserNumMap = make(map[string]int64, len(marks)), make(map[string]int64, len(marks)) + var vals []interface{} + vals, err = app.Redis.Cache.HMGet(s.ctx, key, marks...).Result() + if err != nil { + err = s.be.RedisError(err) + return + } + + var numMap = map[string]string{} + for i, v := range marks { + if vals[i] == nil { + continue + } + numMap[v] = fmt.Sprint(vals[i]) + } + + for mark, num := range numMap { + hourNumMap[mark] = utils.StrToInt64(num) + userKey := ckey.FissionBehaviorTotalCycleHourUser(s.cpnId, hourStr, mark) + hourUserNumMap[mark] = app.Redis.Cache.HLen(s.ctx, userKey).Val() + } + + return +} + +// CycleDay 获取天活动归档数据 +func (s *FissionBehaviorTotal) CycleDay(t carbon.Carbon, marks ...string) (dayNumMap, dayUserNumMap map[string]int64, err error) { + dayStr := t.ToShortDateString() + key := ckey.FissionBehaviorTotalCycleDay(s.cpnId, dayStr) + + if len(marks) == 0 { + var numMap = map[string]string{} + numMap, err = app.Redis.Cache.HGetAll(s.ctx, key).Result() + if err != nil { + err = s.be.RedisError(err) + return + } + + dayNumMap, dayUserNumMap = make(map[string]int64, len(numMap)), make(map[string]int64, len(numMap)) + + for k, v := range numMap { + dayNumMap[k] = utils.StrToInt64(v) + userKey := ckey.FissionBehaviorTotalCycleDayUser(s.cpnId, dayStr, k) + dayUserNumMap[k] = app.Redis.Cache.HLen(s.ctx, userKey).Val() + } + + return + } + + // 如果没有数据就填充好 + start, end := t.StartOfDay(), t.EndOfDay() + for _, mark := range marks { + if !app.Redis.Cache.HExists(s.ctx, key, mark).Val() { + err = s._existStat(mark, start, end, key, ckey.FissionBehaviorTotalCycleDayUser(s.cpnId, dayStr, mark)) + if err != nil { + return + } + } + } + + dayNumMap, dayUserNumMap = make(map[string]int64, len(marks)), make(map[string]int64, len(marks)) + var vals []interface{} + vals, err = app.Redis.Cache.HMGet(s.ctx, key, marks...).Result() + if err != nil { + err = s.be.RedisError(err) + return + } + + var numMap = map[string]string{} + for i, v := range marks { + if vals[i] == nil { + continue + } + numMap[v] = fmt.Sprint(vals[i]) + } + + for k, v := range numMap { + dayNumMap[k] = utils.StrToInt64(v) + userKey := ckey.FissionBehaviorTotalCycleDayUser(s.cpnId, dayStr, k) + dayUserNumMap[k] = app.Redis.Cache.HLen(s.ctx, userKey).Val() + } + + return +} + +// FissionTotalAdd 玩法活动总数值统计 +func (s *FissionBehaviorTotal) FissionTotalAdd(num int64, bt int32, mark string, newUser bool) (err error) { + m := dao.FissionTotal + + var update []field.AssignExpr + update = append(update, m.Num.Add(num)) + if newUser { + update = append(update, m.UserNum.Add(1)) + } + + cc := cache.NewFissionTotal(s.ctx) + id, err := cc.FindByUniqIdx(s.cpnId, mark) + if err != nil { + return s.be.CacheError(err) + } + + defer func() { + if err != nil || id == 0 { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(id)).UpdateSimple(update...) + if err != nil { + err = s.be.MysqlError(err) + return + } + }() + + if id != 0 { + return + } + + lc := app.NewFollower(s.ctx, ckey.FissionBehaviorTotalCreateOnce(s.cpnId, mark), lock.SetExpire(10*time.Second)).Lock() + defer lc.Release() + if err != nil { + return workerr.BusyError + } + + id, err = cc.FindByUniqIdx(s.cpnId, mark) + if err != nil { + return s.be.MysqlError(err) + } + + if id != 0 { + return + } + + total := withdefault.FissionTotal(&model.FissionTotal{ + Mark: mark, + BehaviorType: bt, + CampaignID: s.cpnId, + Num: num, + UserNum: utils.Ternary[int64](newUser, 1, 0), + }) + + err = m.WithContext(s.ctx).Create(total) + if err != nil { + return s.be.MysqlError(err) + } + + return +} + +type statDayNum struct { + Num int64 + UserNum int64 + BehaviorType int32 +} + +// BehaviorTotalCycle 行为周期归档 +func (s *FissionBehaviorTotal) BehaviorTotalCycle(statType int8, now carbon.Carbon, btm map[string]int32) (err error) { + var marks []string + for mark := range btm { + marks = append(marks, mark) + } + + var start carbon.Carbon + var numMap, userNumMap = make(map[string]int64, len(marks)), make(map[string]int64, len(marks)) + if statType == mtype.FissionTotalCycleTypeHour { + start = now.StartOfHour() + + numMap, userNumMap, err = s.CycleHour(now, marks...) + if err != nil { + return + } + + } else { + start = now.StartOfDay() + numMap, userNumMap, err = s.CycleDay(now, marks...) + if err != nil { + return + } + } + + var statMap = map[string]*statDayNum{} + for mark, bt := range btm { + statMap[mark] = &statDayNum{ + Num: numMap[mark], + UserNum: userNumMap[mark], + BehaviorType: bt, + } + marks = append(marks, mark) + } + + m := dao.FissionTotalCycle + list, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(s.cpnId), + m.StatType.Eq(statType), + m.StatTime.Eq(start.Timestamp()), + m.Mark.In(marks...), + ).Find() + if err != nil { + return + } + + var recordMap = make(map[string]*model.FissionTotalCycle) + for _, v := range list { + recordMap[v.Mark] = v + } + + var add []*model.FissionTotalCycle + for mark, total := range statMap { + if record, ok := recordMap[mark]; ok { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(record.ID)).UpdateSimple(m.Num.Value(total.Num), m.UserNum.Value(total.UserNum)) + if err != nil { + return + } + } else if total.Num > 0 { + add = append(add, withdefault.FissionTotalCycle(&model.FissionTotalCycle{ + CampaignID: s.cpnId, + StatTime: start.Timestamp(), + StatType: statType, + BehaviorType: total.BehaviorType, + Mark: mark, + Num: total.Num, + UserNum: total.UserNum, + })) + } + } + + if len(add) > 0 { + err = m.WithContext(s.ctx).Create(add...) + if err != nil { + return + } + } + + return +} + +func (s *FissionBehaviorTotal) Num(mark string, start, end carbon.Carbon) (total int64) { + fbm := dao.FissionBehavior + + total, _ = fbm.WithContext(s.ctx).Where( + fbm.CampaignID.Eq(s.cpnId), + fbm.Mark.Eq(mark), + fbm.BehaviorTime.Gte(start.Timestamp()), + fbm.BehaviorTime.Lte(end.Timestamp()), + ).Count() + + return +} + +func (s *FissionBehaviorTotal) UserNum(mark string, start, end carbon.Carbon) (total int64) { + fbm := dao.FissionBehavior + + total, _ = fbm.WithContext(s.ctx).Where( + fbm.CampaignID.Eq(s.cpnId), + fbm.Mark.Eq(mark), + fbm.BehaviorTime.Gte(start.Timestamp()), + fbm.BehaviorTime.Lte(end.Timestamp()), + ).Group(fbm.UserMark).Count() + + return +} + +func (s *FissionBehaviorTotal) NumType(bt int32, start, end carbon.Carbon) (total int64) { + fbm := dao.FissionBehavior + + total, _ = fbm.WithContext(s.ctx).Where( + fbm.CampaignID.Eq(s.cpnId), + fbm.BehaviorType.Eq(bt), + fbm.BehaviorTime.Gte(start.Timestamp()), + fbm.BehaviorTime.Lte(end.Timestamp()), + ).Count() + + return +} + +func (s *FissionBehaviorTotal) UserNumType(bt int32, start, end carbon.Carbon) (total int64) { + fbm := dao.FissionBehavior + + total, _ = fbm.WithContext(s.ctx).Where( + fbm.CampaignID.Eq(s.cpnId), + fbm.BehaviorType.Eq(bt), + fbm.BehaviorTime.Gte(start.Timestamp()), + fbm.BehaviorTime.Lte(end.Timestamp()), + ).Group(fbm.UserMark).Count() + + return +} + +type MarkTotal struct { + Mark string + Total int64 +} + +func (s *FissionBehaviorTotal) MarkNumType(bt int32, start, end carbon.Carbon) (numStat []*MarkTotal) { + fbm := dao.FissionBehavior + _ = fbm.WithContext(s.ctx). + Select( + fbm.Mark, + fbm.ID.Count().As("total"), + ). + Where( + fbm.CampaignID.Eq(s.cpnId), + fbm.BehaviorType.Eq(bt), + fbm.BehaviorTime.Gte(start.Timestamp()), + fbm.BehaviorTime.Lte(end.Timestamp()), + ). + Group(fbm.Mark). + Scan(&numStat) + + return +} + +func (s *FissionBehaviorTotal) MarkUserNumType(bt int32, start, end carbon.Carbon) (numStat []*MarkTotal) { + fbm := dao.FissionBehavior + + fbmAs := fbm.As("fbm") + _ = gen.Table( + fbm.WithContext(s.ctx). + Select( + fbm.Mark, + fbm.UserMark, + ). + Where( + fbm.CampaignID.Eq(s.cpnId), + fbm.BehaviorType.Eq(bt), + fbm.BehaviorTime.Gte(start.Timestamp()), + fbm.BehaviorTime.Lte(end.Timestamp()), + ). + Group(fbm.Mark, fbm.UserMark). + As("fbm")). + Select( + fbmAs.Mark, + fbmAs.UserMark.Count().As("total"), + ). + Group(fbmAs.Mark). + Scan(&numStat) + + return +} + +// 不存在统计就补充 +func (s *FissionBehaviorTotal) _existStat(mark string, start, end carbon.Carbon, key string, userKey string) (err error) { + lc := app.NewRedisLock(s.ctx, ckey.ForLock(key), lock.SetExpire(10*time.Second)) + if !lc.SoftLock() { + return + } + defer lc.Release() + + app.Redis.Cache.HIncrBy(s.ctx, key, mark, s.Num(mark, start, end)) + app.Redis.Cache.Expire(s.ctx, key, 2*time.Hour) + + // 人数获取 + m := dao.FissionBehavior + var userMarks []string + err = m.WithContext(s.ctx). + Select(m.UserMark.Distinct()). + Where( + m.CampaignID.Eq(s.cpnId), + m.Mark.Eq(mark), + m.BehaviorTime.Gte(start.Timestamp()), + m.BehaviorTime.Lte(end.Timestamp()), + ). + Group(m.UserMark). + Pluck(m.UserMark, &userMarks) + + if err != nil { + return + } + + for _, userMark := range userMarks { + if app.Redis.Cache.HSetNX(s.ctx, userKey, userMark, 1).Val() { + app.Redis.Cache.Expire(s.ctx, userKey, 2*time.Hour) + } + } + + return +} diff --git a/internal/service/provider/fission_clue.go b/internal/service/provider/fission_clue.go new file mode 100644 index 0000000..e068f67 --- /dev/null +++ b/internal/service/provider/fission_clue.go @@ -0,0 +1,160 @@ +package provider + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/merr" + "time" +) + +type FissionClue struct { + ctx context.Context + be *merr.BusinessError + + chanceKey string + rewardKey string + helpKey string + preCondKey string + clueMapData string +} + +func NewFissionClue(ctx context.Context, userId int64) *FissionClue { + return &FissionClue{ + ctx: ctx, + be: merr.NewBE(ctx), + chanceKey: ckey.FissionChanceNotify(userId), + rewardKey: ckey.FissionNewcomerRewardNotify(userId), + helpKey: ckey.FissionHelpPercentAdd(userId), + preCondKey: ckey.FissionUserTaskPreCond(userId), + clueMapData: ckey.FissionClueMapData(userId), + } +} + +func (s *FissionClue) AddChance(chance int64) { + app.Redis.Cache.IncrBy(s.ctx, s.chanceKey, chance) + app.Redis.Cache.Expire(s.ctx, s.chanceKey, 2*time.Hour) +} + +func (s *FissionClue) GetChance() (chance int64) { + chance, _ = app.Redis.Cache.Get(s.ctx, s.chanceKey).Int64() + return +} + +func (s *FissionClue) Notified() { + app.Redis.Cache.Del(s.ctx, s.chanceKey, s.rewardKey, s.helpKey, s.preCondKey, s.clueMapData) +} + +func (s *FissionClue) AddNewcomerReward(rewardId int64) { + app.Redis.Cache.IncrBy(s.ctx, s.rewardKey, rewardId) + app.Redis.Cache.Expire(s.ctx, s.rewardKey, 2*time.Hour) +} + +func (s *FissionClue) GetNewcomerReward() (rewardId int64) { + rewardId, _ = app.Redis.Cache.Get(s.ctx, s.rewardKey).Int64() + return +} + +func (s *FissionClue) SetPreCond(preCond, expMin int32) { + app.Redis.Cache.Set(s.ctx, s.preCondKey, preCond, time.Duration(expMin)*time.Minute) +} + +func (s *FissionClue) GetPreCond() int32 { + preCond, _ := app.Redis.Cache.Get(s.ctx, s.preCondKey).Int64() + return int32(preCond) +} + +const ( + chopRewardIdKey = "chop_reward_id" + percentIsFix = "is_fix" + oldPercentKey = "old_percent" + addPercentKey = "add_percent" +) + +func (s *FissionClue) ChopHelp(chopRewardId int64, oldPercent, addPercent float64, isFix bool) { + + _ = lockdo.ExistDo(s.ctx, s.helpKey, func(exist bool) (err error) { + if !exist { + app.Redis.Cache.HSet(s.ctx, s.helpKey, chopRewardIdKey, chopRewardId, oldPercentKey, oldPercent, percentIsFix, utils.Ternary[string](isFix, percentIsFix, "")) + } + + id, _ := app.Redis.Cache.HGet(s.ctx, s.helpKey, chopRewardIdKey).Int64() + if id != chopRewardId { + return + } + + app.Redis.Cache.HIncrByFloat(s.ctx, s.helpKey, addPercentKey, addPercent) + app.Redis.Cache.Expire(s.ctx, s.helpKey, 2*consts.TimeDay) + + return + }) +} + +type ChopHelp struct { + ChopRewardId int64 + OldPercent, AddPercent float64 + IsFix bool +} + +func (s *FissionClue) GetChopHelp() (chopHelp ChopHelp) { + + data := app.Redis.Cache.HGetAll(s.ctx, s.helpKey).Val() + if len(data) == 0 { + return + } + + chopHelp.ChopRewardId = utils.StrToInt64(data[chopRewardIdKey]) + chopHelp.OldPercent = utils.StrToFloat64(data[oldPercentKey]).InexactFloat64() + chopHelp.AddPercent = utils.StrToFloat64(data[addPercentKey]).InexactFloat64() + chopHelp.IsFix = data[percentIsFix] == percentIsFix + + return +} + +const ( + goldIdKey = "gold_id" + oldGoldKey = "old_gold" + addGoldKey = "add_gold" +) + +func (s *FissionClue) AddGold(goldId int64, oldGold, add int64) { + + _ = lockdo.ExistDo(s.ctx, s.clueMapData, func(exist bool) (err error) { + if !exist { + app.Redis.Cache.HSet(s.ctx, s.clueMapData, goldIdKey, goldId, oldGoldKey, oldGold) + } + + id, _ := app.Redis.Cache.HGet(s.ctx, s.clueMapData, goldIdKey).Int64() + if id != goldId { + return + } + + app.Redis.Cache.HIncrBy(s.ctx, s.clueMapData, addGoldKey, add) + app.Redis.Cache.Expire(s.ctx, s.clueMapData, 2*consts.TimeDay) + + return + }) + +} + +type GoldNotify struct { + GoldId int64 + OldGold, Add int64 +} + +func (s *FissionClue) GetGold() (notify GoldNotify) { + + data := app.Redis.Cache.HGetAll(s.ctx, s.clueMapData).Val() + if len(data) == 0 { + return + } + + notify.GoldId = utils.StrToInt64(data[goldIdKey]) + notify.OldGold = utils.StrToInt64(data[oldGoldKey]) + notify.Add = utils.StrToInt64(data[addGoldKey]) + + return +} diff --git a/internal/service/provider/fission_config.go b/internal/service/provider/fission_config.go new file mode 100644 index 0000000..39abaa6 --- /dev/null +++ b/internal/service/provider/fission_config.go @@ -0,0 +1,149 @@ +package provider + +import ( + "context" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" +) + +type FissionConfig struct { + logic.Context + + project *model.Project + + conf *model.FissionConfig +} + +func NewFissionConfig(ctx context.Context, project *model.Project) (conf *FissionConfig, err error) { + conf = &FissionConfig{ + project: project, + } + + conf.BaseInit(ctx, merr.NewBE(ctx)) + + err = conf._init() + if err != nil { + return + } + + return +} + +func (s *FissionConfig) _init() (err error) { + return lockdo.FindNilDo( + s.Ctx, + ckey.FissionConfigOnce(s.project.ID), + func() (none bool, err error) { + s.conf, err = cache.NewFissionConfig(s.Ctx).FindByProjectId(s.project.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return s.conf == nil, nil + + }, + func() (err error) { + s.conf = withdefault.FissionConfig(&model.FissionConfig{ + ProjectID: s.project.ID, + }) + + if err = s.GetDao().FissionConfig.WithContext(s.Ctx).Create(s.conf); err != nil { + return s.BE().MysqlError(err) + } + return + }, + ) +} + +func (s *FissionConfig) Config() (conf *model.FissionConfig) { + return s.conf +} + +func (s *FissionConfig) SetPushCampaignTask(pv int32) (err error) { + conf := s.Config() + + if conf.PushCampaignTask == int8(pv) { + return + } + + m := s.GetDao().FissionConfig + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(m.PushCampaignTask.Value(int8(pv))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewFissionConfig(s.Ctx).Clear(conf) + + return +} + +func (s *FissionConfig) SetPushVisit(pv int32) (err error) { + conf := s.Config() + + if conf.PushVisit == int8(pv) { + return + } + + m := s.GetDao().FissionConfig + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(m.PushVisit.Value(int8(pv))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewFissionConfig(s.Ctx).Clear(conf) + + return +} + +func (s *FissionConfig) GetLvUrl() (url *model.NotifyURL, err error) { + conf := s.Config() + + if conf.LvURLID == 0 || !s._canDo() { + return + } + + url, err = cache.NewNotifyURL(s.Ctx).FindById(conf.LvURLID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if url.IsDel == mtype.Yes { + return nil, nil + } + + return +} + +func (s *FissionConfig) SetLvUrl(urlId int64) (err error) { + conf := s.Config() + + if conf.LvURLID == urlId || !s._canDo() { + return + } + + m := s.GetDao().FissionConfig + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(m.LvURLID.Value(urlId)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewFissionConfig(s.Ctx).Clear(conf) + + return +} + +func (s *FissionConfig) _canDo() bool { + status, _ := NewCompanyMade(s.Ctx, s.project.CompanyID, logic.WithDao(s.GetDao())).GetMade(mtype.CompanyMadeMarkLvApi) + return status.Open +} diff --git a/internal/service/provider/fission_user.go b/internal/service/provider/fission_user.go new file mode 100644 index 0000000..3d974d4 --- /dev/null +++ b/internal/service/provider/fission_user.go @@ -0,0 +1,891 @@ +package provider + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" + "strings" + "time" + + "joybuywork/proto/go_proto/workerr" + + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +type FissionUser struct { + logic.Context + + user *model.FissionUser + cpn *model.FissionCampaign + channel *model.FissionCampaignChannel + + conf *model.FissionCampaignConfig + cpnControl *CampaignTZ + + upData, msUpData []field.AssignExpr + + changeLangMark bool + changeLvMark bool + + subUserIdLock, deviceIdLock *lock.RedisLock +} + +func NewFissionUser(ctx context.Context, cpn *model.FissionCampaign, channel *model.FissionCampaignChannel, opts ...logic.CtxOption) *FissionUser { + user := &FissionUser{ + cpn: cpn, + channel: channel, + } + + user.BaseInit(ctx, merr.NewBE(ctx), opts...) + + return user +} + +func (s *FissionUser) NotifyUser(behaviorTime, noticeType int64, isInstall bool, noticeTag, userMark, uid, deviceId, lvMark, lang, platform, customParam string, webChannelId, channelId int64, expTime time.Duration, parent *model.FissionUser) (user, bindParent *model.FissionUser, newUser bool, err error) { + defer s.lockRelease() + cpn := s.cpn + uct, err := s.userCampaignType(lang, lvMark, "") + if err != nil { + return + } + + // 如果没有关联的上级,尝试找一下 + defer func() { + if err != nil || user == nil { + return + } + + err = s._refresh(user) + if err != nil { + return + } + + if (parent == nil || parent.ID != user.ParentID) && user.ParentID > 0 { + bindParent, err = finder.FissionUser(s.Ctx, cpn.ID, user.ParentID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } else { + bindParent = parent + } + + if newUser { + return + } + + }() + + user, err = s.notifyFindUser(noticeType, uct, userMark, uid, deviceId, platform, lang, lvMark, customParam, webChannelId) + if err != nil || user != nil { + return + } + + if uid != "" { + lc := s.getSubUserIdLock(uid) + if lc.Error() != nil { + err = workerr.BusyError + return + } + } + + if deviceId != "" { + lc := s.getDeviceIdLock(deviceId) + if lc.Error() != nil { + err = workerr.BusyError + return + } + } + + // 再重新查一次 + user, err = s.notifyFindUser(noticeType, uct, userMark, uid, deviceId, platform, lang, lvMark, customParam, webChannelId) + if err != nil || user != nil { + return + } + + if cpn.FissionID == consts.IdKeep && user == nil && noticeType == types.NoticeTypeCustom { + return + } + + lvMark, err = s._lvMark(uid, lang, lvMark, mtype.LVApiLogSourceNotifyUser) + if err != nil { + return + } + + //新的活动用户 + newUser = true + user = withdefault.FissionUser(&model.FissionUser{ + CreatedAt: behaviorTime, + CampaignID: cpn.ID, + ChannelID: 0, + ParentID: 0, + Deep: 0, + IsNew: utils.Ternary[int8](isInstall, mtype.Yes, mtype.No), + SubUserID: uid, + DeviceID: deviceId, + UserMark: utils.Ternary[string](uid == "", deviceId, uid), + UserType: mtype.FissionUserTypePlay, + ParentIds: "", + IsView: utils.Ternary[int8](uid == consts.FissionViewer, mtype.Yes, mtype.No), + ShareLink: "", + Source: 0, + LangMark: lang, + UserLang: uct.LangMark, + LevelMark: lvMark, + UserLevelMark: uct.LevelMark, + UserLevel: uct.LevelId, + }) + + switch noticeType { + case types.NoticeTypeOpen: + user.Source = mtype.FissionUserSourceOpen + case types.NoticeTypeInstall: + user.Source = mtype.FissionUserSourceInstall + if noticeTag == types.NoticeTagWeb { + user.Source = mtype.FissionUserSourceWebFirstOpen + } + case types.NoticeTypeRegister: + user.Source = mtype.FissionUserSourceRegister + case types.NoticeTypeCustom: + user.Source = mtype.FissionUserSourceCustom + case types.NoticeTypePay: + user.Source = mtype.FissionUserSourcePay + } + + if parent != nil { + user.ParentID = parent.ID + user.ChannelID = parent.ChannelID + user.Deep = parent.Deep + 1 + user.LangMark = utils.STernary[string](lang, "", parent.LangMark) + + if parent.ParentID > 0 { + user.SetParentIds(append(parent.GetParentIds(), parent.ParentID)) + } + } + + // 如果没绑定上级的渠道,就绑定来源渠道 + if channelId > 0 && user.ChannelID == 0 { + user.ChannelID = channelId + } + + err = s._create(user, uct, platform, lvMark, customParam, "", "", webChannelId) + if err != nil { + return + } + + if user.SubUserID != "" { + producer.NewCampaignNotice(s.Ctx).ProjectUser(types.ProjectUser{ + ProjectId: cpn.ProjectID, + UserId: user.SubUserID, + }) + } + + app.Redis.Cache.Set(s.Ctx, ckey.FissionUserUniqMark(cpn.ID, userMark), user.ID, expTime) + app.Redis.Cache.Set(s.Ctx, ckey.FissionUserIovdMark(user.ID), userMark, expTime) + + return +} + +func (s *FissionUser) VisitUser(uid, platform, lang, lvMark, customParam, ip, centerHashId, moduleId string, device *ddevicepb.FindBlackboxRes, wbu *model.FissionWebUser) (user *model.FissionUser, err error) { + defer s.lockRelease() + + defer func() { + if err != nil { + return + } + err = s._refresh(user) + }() + + lvMark, err = s._lvMark(uid, lang, lvMark, mtype.LVApiLogSourceVisitUser) + if err != nil { + return + } + + conf, err := s.getConf() + if err != nil { + return + } + + var webChancelId int64 + if wbu != nil { + webChancelId = wbu.ChannelID + } + + userId := utils.Ternary[string](uid == "", consts.FissionViewer, uid) + + // 白名单校验 + err = s._white(conf, userId, lang) + if err != nil { + return + } + + countryMark := s._country(conf.RewardGroup, ip) + + user, err = s._findBySubUserId(userId) + if err != nil { + return + } + + uct, err := s.userCampaignType(lang, lvMark, countryMark) + if err != nil { + return + } + + //有用户,或者活动结束了 + if user != nil { + user = s._refreshAttr(user, uct, platform, lang, lvMark, customParam, centerHashId, moduleId, webChancelId) + return + } + + var deviceId string + var parent *model.FissionUser + if userId != consts.FissionViewer { + user, parent, deviceId, err = s._deviceUser(device, uid, conf) + if err != nil || user != nil { + user = s._refreshSubUserId(user, uid) + user = s._refreshAttr(user, uct, platform, lang, lvMark, customParam, centerHashId, moduleId, webChancelId) + return + } + } + + //加锁来创建 + lc := s.getSubUserIdLock(userId).Lock() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + if deviceId != "" { + lc1 := s.getDeviceIdLock(deviceId).Lock() + if lc1.Error() != nil { + err = workerr.BusyError + return + } + } + + //获取到锁再找一次 + user, err = s._findBySubUserId(userId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user != nil { + user = s._refreshAttr(user, uct, platform, lang, lvMark, customParam, centerHashId, moduleId, webChancelId) + return + } + + //创建用户 + user = withdefault.FissionUser(&model.FissionUser{ + CampaignID: s.cpn.ID, + SubUserID: userId, + DeviceID: deviceId, + UserMark: utils.Ternary[string](userId != "", userId, deviceId), + UserType: utils.Ternary[int8](s.cpn.EndTime < time.Now().Unix(), mtype.FissionUserTypeVisitor, mtype.FissionUserTypePlay), + IsView: utils.Ternary[int8](userId == consts.FissionViewer, mtype.Yes, mtype.No), + Source: mtype.FissionUserSourceVisit, + LangMark: lang, + LevelMark: lvMark, + UserLevelMark: uct.LevelMark, + UserLevel: uct.LevelId, + UserLang: uct.LangMark, + UserCountry: uct.CountryMark, + }) + + if s.channel != nil { + user.ChannelID = s.channel.ID + } + + if parent != nil { + user.ParentID = parent.ID + user.ChannelID = parent.ChannelID + user.Deep = parent.Deep + 1 + + if parent.ParentID > 0 { + user.SetParentIds(append(parent.GetParentIds(), parent.ParentID)) + } + } + + err = s._create(user, uct, platform, lvMark, customParam, centerHashId, moduleId, webChancelId) + if err != nil { + return + } + + if user.SubUserID != "" { + producer.NewCampaignNotice(s.Ctx).ProjectUser(types.ProjectUser{ + ProjectId: s.cpn.ProjectID, + UserId: user.SubUserID, + }) + } + + return +} + +func (s *FissionUser) GetChangeLangMark() bool { + return s.changeLangMark +} + +func (s *FissionUser) GetChangeLvMark() bool { + return s.changeLvMark +} + +func (s *FissionUser) getSubUserIdLock(userId string) *lock.RedisLock { + if s.subUserIdLock == nil { + s.subUserIdLock = app.NewRedisLock(s.Ctx, ckey.FissionUserStoreOnce(s.cpn.ID, userId)) + } + + return s.subUserIdLock +} + +func (s *FissionUser) getDeviceIdLock(deviceId string) *lock.RedisLock { + if s.deviceIdLock == nil { + s.deviceIdLock = app.NewRedisLock(s.Ctx, ckey.FissionUserStoreDeviceOnce(s.cpn.ID, deviceId)) + } + + return s.deviceIdLock +} +func (s *FissionUser) lockRelease() { + if s.subUserIdLock != nil { + s.subUserIdLock.Release() + } + + if s.deviceIdLock != nil { + s.deviceIdLock.Release() + } +} + +func (s *FissionUser) getConf() (conf *model.FissionCampaignConfig, err error) { + if s.conf == nil { + s.conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(s.cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return s.conf, nil +} + +func (s *FissionUser) getTz(lang string) *CampaignTZ { + if s.cpnControl == nil { + s.cpnControl = NewCampaignTZ(s.Ctx, s.cpn, lang) + } + + return s.cpnControl +} + +func (s *FissionUser) _white(conf *model.FissionCampaignConfig, userId, lang string) (err error) { + if userId == consts.FissionViewer { + return + } + + tz := s.getTz(lang) + if tz.IsWait() && conf.HasWarmUp == mtype.No { + return workerr.CNotRunError + } + + if tz.IsPre() { + userIdList := strings.Split(conf.WhiteList, ";") + for _, id := range userIdList { + if userId == id { + return + } + } + return workerr.CNotRunError + } + + return +} + +func (s *FissionUser) _refresh(user *model.FissionUser) (err error) { + if len(s.upData) == 0 { + return + } + + m := s.GetDao().FissionUser + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(s.upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + ms := s.GetDao().FissionUser.SubTable(s.cpn.ID) + _, err = ms.WithContext(s.Ctx).Where(ms.ID.Eq(user.ID)).UpdateSimple(s.msUpData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 清除缓存 + _ = cache.NewFissionUser(s.Ctx, user.CampaignID).Clear(user) + + return +} + +func (s *FissionUser) _country(rewardGroup int8, ip string) string { + var countryMark string + if rewardGroup == mtype.FissionRewardGroupCountry && ip != "" { + res, _ := app.NewDeepLinkDevice().FindIpAreaCode(s.Ctx, &ddevicepb.FindIpAreaCodeReq{Ip: ip}) + countryMark = res.GetAreaCode() + } + + return countryMark +} + +func (s *FissionUser) _findBySubUserId(userId string) (user *model.FissionUser, err error) { + if userId == "" { + return + } + + user, err = cache.NewFissionUser(s.Ctx, s.cpn.ID).FindBySubUserId(userId) + if err != nil { + err = s.BE().CacheError(err) + return + } + return +} + +func (s *FissionUser) _findByDeviceId(deviceId string) (user *model.FissionUser, err error) { + if deviceId == "" { + return + } + + user, err = cache.NewFissionUser(s.Ctx, s.cpn.ID).FindByDeviceId(deviceId) + if err != nil { + err = s.BE().CacheError(err) + return + } + return +} + +func (s *FissionUser) _refreshDeviceId(user *model.FissionUser, deviceId string) *model.FissionUser { + m := s.GetDao().FissionUser + ms := s.GetDao().FissionUser.SubTable(s.cpn.ID) + + if user.DeviceID == "" && deviceId != "" { + s.upData = append(s.upData, m.DeviceID.Value(deviceId)) + s.msUpData = append(s.msUpData, ms.DeviceID.Value(deviceId)) + user.DeviceID = deviceId + + if user.SubUserID == "" && user.UserMark == "" { + s.upData = append(s.upData, m.UserMark.Value(deviceId)) + s.msUpData = append(s.msUpData, ms.UserMark.Value(deviceId)) + user.UserMark = deviceId + } + } + + return user +} + +func (s *FissionUser) _refreshSubUserId(user *model.FissionUser, subUserId string) *model.FissionUser { + m := s.GetDao().FissionUser + ms := s.GetDao().FissionUser.SubTable(s.cpn.ID) + + if user.SubUserID == "" && subUserId != "" { + s.upData = append(s.upData, m.SubUserID.Value(subUserId), m.UserMark.Value(subUserId)) + s.msUpData = append(s.msUpData, ms.SubUserID.Value(subUserId), m.UserMark.Value(subUserId)) + user.SubUserID = subUserId + user.UserMark = subUserId + + if user.SubUserID != "" { + producer.NewCampaignNotice(s.Ctx).ProjectUser(types.ProjectUser{ + ProjectId: s.cpn.ProjectID, + UserId: user.SubUserID, + }) + } + } + + return user +} + +func (s *FissionUser) _refreshAttr(user *model.FissionUser, uct consts.CampaignUserType, platform, lang, lvMark, customParam, centerHashId, moduleId string, webChannelId int64) *model.FissionUser { + attr := NewFissionUserAttr(s.Ctx, user) + + m := s.GetDao().FissionUser + ms := s.GetDao().FissionUser.SubTable(s.cpn.ID) + channel := s.channel + + // 如果用户没有绑定渠道,就绑定一下 + if s.channel != nil && user.ChannelID == 0 { + s.upData = append(s.upData, m.ChannelID.Value(channel.ID)) + s.msUpData = append(s.msUpData, ms.ChannelID.Value(channel.ID)) + user.ChannelID = channel.ID + } + + // 更换匹配中的语种 + if user.UserLang != uct.LangMark { + s.upData = append(s.upData, m.UserLang.Value(uct.LangMark)) + s.msUpData = append(s.msUpData, ms.UserLang.Value(uct.LangMark)) + user.UserLang = uct.LangMark + } + + // 更换匹配中的用户等级 + if user.UserLevel != uct.LevelId && user.FixedUserLevel == mtype.No { + s.upData = append(s.upData, m.UserLevelMark.Value(uct.LevelMark), m.UserLevel.Value(uct.LevelId)) + s.msUpData = append(s.msUpData, ms.UserLevelMark.Value(uct.LevelMark), ms.UserLevel.Value(uct.LevelId)) + user.UserLevelMark = uct.LevelMark + user.UserLevel = uct.LevelId + } + + // 更换匹配中的国家 + if user.UserCountry != uct.CountryMark { + s.upData = append(s.upData, m.UserCountry.Value(uct.CountryMark)) + s.msUpData = append(s.msUpData, ms.UserCountry.Value(uct.CountryMark)) + user.UserCountry = uct.CountryMark + } + + // 用户带的语言标识 + if lang != "" && user.LangMark != lang { + s.upData = append(s.upData, m.LangMark.Value(lang)) + s.msUpData = append(s.msUpData, ms.LangMark.Value(lang)) + user.LangMark = lang + s.changeLangMark = true + + _ = attr.Lang(lang) + } + + if lvMark != "" { + // 用户带的用户等级标识 + oldLv := strings.Split(user.LevelMark, ",") + setLv := strings.Split(lvMark, ",") + + // 如果数组相等,并且也没有切换语种,那就更新了 + if !verify.SliceEq(oldLv, setLv) { + s.upData = append(s.upData, m.LevelMark.Value(lvMark)) + s.msUpData = append(s.msUpData, ms.LevelMark.Value(lvMark)) + user.LevelMark = lvMark + + _ = attr.UserLv(uct.LevelMark, setLv) + s.changeLvMark = true + } + } + + _ = attr.Platform(platform) + + _ = attr.Center(centerHashId) + _ = attr.CenterModule(moduleId) + + _ = attr.CustomParam(customParam) + + if webChannelId > 0 { + _ = attr.WebChannel(webChannelId) + } + + return user +} + +// 去拿deviceCode信息 +func (s *FissionUser) _deviceUser(device *ddevicepb.FindBlackboxRes, uid string, conf *model.FissionCampaignConfig) (user, parent *model.FissionUser, deviceId string, err error) { + if device.GetDeviceId() == "" { + return + } + + //看看能不能找到device的参与数据 + user, err = s._findByDeviceId(device.GetDeviceId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + deviceId = device.GetDeviceId() + + if device.GetLastParentUserId() != "" { + parent, err = s._findBySubUserId(device.GetLastParentUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return + } + + // 这个deviceId被其他人绑定过的 + if user.SubUserID == "" { + return + } + + if conf.DeviceOnce == mtype.Yes && user.SubUserID != uid { + err = workerr.DeviceOnceError + return + } + + user = nil + + return +} + +func (s *FissionUser) _findByUserMark(noticeType int64, userMark string) (user *model.FissionUser, err error) { + if !verify.InArray[int64](noticeType, types.NoticeTypeInstall, types.NoticeTypeOpen) || userMark == "" { + return + } + + id, _ := app.Redis.Cache.Get(s.Ctx, ckey.FissionUserUniqMark(s.cpn.ID, userMark)).Int64() + if id == 0 { + return + } + + user, err = cache.NewFissionUser(s.Ctx, s.cpn.ID).FindById(id) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *FissionUser) notifyFindUser(noticeType int64, uct consts.CampaignUserType, userMark, uid, deviceId, platform, lang, lvMark, customParam string, webChannelId int64) (user *model.FissionUser, err error) { + defer func() { + if user != nil { + user = s._refreshAttr(user, uct, platform, lang, lvMark, customParam, "", "", webChannelId) + } + }() + + user, err = s._findByUserMark(noticeType, userMark) + if err != nil || user != nil { + return + } + + user, err = s._findBySubUserId(uid) + if err != nil || user != nil { + return + } + + if user != nil { + user = s._refreshDeviceId(user, deviceId) + return + } + + user, err = s._findByDeviceId(deviceId) + if err != nil || user == nil { + return + } + + // 相同设备,但是不同用户id, 当新用户处理 + if uid != "" && user.SubUserID != "" && user.SubUserID != uid { + user = nil + return + } + + user = s._refreshSubUserId(user, uid) + + return +} + +func (s *FissionUser) _create(user *model.FissionUser, uct consts.CampaignUserType, platform, lvMark, customParam, centerHashId, moduleId string, webChannelId int64) (err error) { + ms := s.GetDao().FissionUser.SubTable(user.CampaignID) + if err = ms.WithContext(s.Ctx).Create(user); err != nil { + err = s.BE().MysqlError(err) + return + } + + m := s.GetDao().FissionUser + if err = m.WithContext(s.Ctx).Create(user); err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.GetDao().FissionUserStat.WithContext(s.Ctx).Create(withdefault.FissionUserStat(&model.FissionUserStat{ + UserID: user.ID, + CampaignID: user.CampaignID, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + attr := NewFissionUserAttr(s.Ctx, user) + + err = attr.WithUser( + platform, + user.LangMark, + uct.LevelMark, lvMark, + uct.CountryMark, + centerHashId, + moduleId, + webChannelId, + ) + if err != nil { + return + } + + err = attr.CustomParam(customParam) + if err != nil { + return + } + + return +} + +// UserCampaignType 获取活动对应的用户所属类型数据 +func (s *FissionUser) userCampaignType(langMark, lvMark, countryMark string) (uct consts.CampaignUserType, err error) { + cpn := s.cpn + conf, err := s.getConf() + if err != nil { + return + } + + var userLang, userLevelMark, userCountry string + var userLevel int64 + defer func() { + + if userLevel > 0 && userLevelMark == "" { + level, _ := cache.NewFissionUserLevel(s.Ctx).FindById(userLevel) + userLevelMark = level.Mark + } + + uct.LangMark, uct.LevelId, uct.LevelMark, uct.CountryMark = userLang, userLevel, userLevelMark, userCountry + }() + + ful := finder.NewFuserLayer(conf) + + switch conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel: + var dfId int64 + lvMarks := strings.Split(lvMark, ",") + for _, mark := range lvMarks { + var lvId int64 + lvId, err = cache.NewFissionUserLevel(s.Ctx).FindByMarkId(cpn.ProjectID, mark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lvId == 0 { + continue + } + + if dfId == 0 { + dfId = lvId + } + + _, df := ful.Level().Selected(lvId) + if !df { + userLevel = lvId + userLevelMark = mark + break + } + + } + + if userLevel == 0 { + userLevel, _ = ful.Level().Selected(0) + } + + case mtype.FissionRewardGroupLang: + userLang, _ = ful.Lang().Selected(langMark) + case mtype.FissionRewardGroupLangAndUserLevel: + + userLang, _ = ful.LangLevel().GetLang(langMark) + + var dfId int64 + lvMarks := strings.Split(lvMark, ",") + for _, mark := range lvMarks { + var lvId int64 + lvId, err = cache.NewFissionUserLevel(s.Ctx).FindByMarkId(cpn.ProjectID, mark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lvId == 0 { + continue + } + + if dfId == 0 { + dfId = lvId + } + + _, df := ful.LangLevel().GetLevel(userLang, lvId) + if !df { + userLevel = lvId + userLevelMark = mark + } + } + + if userLevel == 0 { + userLevel, _ = ful.LangLevel().GetLevel(userLang, 0) + } + + case mtype.FissionRewardGroupCountry: + userCountry, _ = ful.Country().Selected(countryMark) + } + + return +} + +func (s *FissionUser) _lvMark(subUserId, langMark, lvMark, source string) (lv string, err error) { + if subUserId == "" { + return + } + + project, err := cache.NewProject(s.Ctx).FindById(s.cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + conf, err := NewFissionConfig(s.Ctx, project) + if err != nil { + return + } + + url, err := conf.GetLvUrl() + if err != nil { + return + } + + if url == nil { + return lvMark, nil + } + + key := ckey.FissionLvApiCache(project.ID, subUserId) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + + if exist { + lv = app.Redis.Cache.Get(s.Ctx, key).Val() + return + } + + sts, err := s2s.NewLvApi(s.Ctx, conf.Config()) + if err != nil { + return + } + + data, err := sts.LvApi(s.cpn, subUserId, langMark, source) + if err != nil { + err = nil + app.Redis.Cache.Set(s.Ctx, key, lv, 5*time.Second) + return + } + + lv = strings.Join(data.List, ",") + + app.Redis.Cache.Set(s.Ctx, key, lv, 30*time.Second) + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} diff --git a/internal/service/provider/fission_user_attr.go b/internal/service/provider/fission_user_attr.go new file mode 100644 index 0000000..f16f889 --- /dev/null +++ b/internal/service/provider/fission_user_attr.go @@ -0,0 +1,538 @@ +package provider + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" + "fmt" + "strings" + "time" + + "joybuywork/proto/go_proto/workerr" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gorm/clause" +) + +type FissionUserAttr struct { + logic.Context + + user *model.FissionUser + + attr map[string]*model.FissionUserAttr +} + +func NewFissionUserAttr(ctx context.Context, user *model.FissionUser) *FissionUserAttr { + attr := &FissionUserAttr{ + user: user, + } + + attr.Init(ctx, dao.Q, merr.NewBE(ctx)) + + return attr +} + +func (s *FissionUserAttr) GetAttr(mark string) (*model.FissionUserAttr, error) { + if s.attr != nil { + return s.attr[mark], nil + } + + var attrMarks = []string{mtype.FissionUserAttrMarkPlatform, mtype.FissionUserAttrMarkLang, mtype.FissionUserAttrMarkUserLv} + s.attr = make(map[string]*model.FissionUserAttr, len(attrMarks)) + for _, v := range attrMarks { + attr, err := cache.NewFissionUserAttr(s.Ctx).FindByUniqIdx(s.user.ID, v) + if err != nil { + return nil, s.BE().CacheError(err) + } + s.attr[v] = attr + } + + return s.attr[mark], nil +} + +func (s *FissionUserAttr) WithUser(platform, lang, levelMark, lvMarks, country, centerHashId, moduleId string, channelId int64) (err error) { + user := s.user + var attrs []*model.FissionUserAttr + if lang != "" { + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkLang, + Value: user.LangMark, + Values: user.LangMark, + })) + } + + if levelMark != "" { + setLv := strings.Split(lvMarks, ",") + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkUserLv, + Value: utils.Ternary[string](verify.InArray(levelMark, setLv...), levelMark, setLv[0]), + Values: lvMarks, + })) + } + + if country != "" { + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkCountry, + Value: country, + Values: country, + })) + } + + if platform != "" { + platform = utils.SupportPlatform(platform) + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkPlatform, + Value: platform, + Values: platform, + })) + } + + if channelId != 0 { + webChId := fmt.Sprint(channelId) + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkWebChannel, + Value: webChId, + Values: webChId, + })) + } + + if centerHashId != "" { + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkCenter, + Value: centerHashId, + Values: centerHashId, + })) + } + + if moduleId != "" { + attrs = append(attrs, withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkCenterModule, + Value: moduleId, + Values: moduleId, + })) + } + + if len(attrs) == 0 { + return + } + + return s.creates(attrs...) +} + +// Platform 更新平台 +func (s *FissionUserAttr) Platform(platform string) (err error) { + if platform == "" || s.ignore() { + return + } + + // 用户关联的平台 + platform = utils.SupportPlatform(platform) + pfAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkPlatform, platform, platform) + if err != nil { + return + } + + // 如果没更新,或者平台是其他,就不用处理了 + if platform == pfAttr.Value || platform == consts.PlatformOther { + return + } + + return s.update(pfAttr, platform) +} + +// WebChannel 更新站外渠道 +func (s *FissionUserAttr) WebChannel(channelId int64) (err error) { + if channelId == 0 || s.ignore() { + return + } + + webChId := fmt.Sprint(channelId) + + wbcAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkWebChannel, webChId, webChId) + if err != nil { + return + } + + // 如果没更新,就不用处理了 + if webChId == wbcAttr.Value { + return + } + + return s.update(wbcAttr, webChId) +} + +// Country 更新国家属性 +func (s *FissionUserAttr) Country(country string) (err error) { + if country == "" || s.ignore() { + return + } + + // 用户关联的国家 + pfAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkCountry, country, country) + if err != nil { + return + } + + // 如果没更新,或者平台是其他,就不用处理了 + if country == pfAttr.Value { + return + } + + return s.update(pfAttr, country) +} + +// UserLv 更新用户等级 +func (s *FissionUserAttr) UserLv(userLv string, setLv []string) (err error) { + if userLv == "" || s.ignore() { + return + } + + // 用户关联的用户等级 + attrVal := utils.Ternary[string](verify.InArray[string](userLv, setLv...), userLv, setLv[0]) + values := strings.Join(setLv, ",") + pfAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkUserLv, attrVal, values) + if err != nil { + return + } + + // 如果没更新,或者平台是其他,就不用处理了 + if attrVal == pfAttr.Value && verify.AllInArray(setLv, pfAttr.GetValues()) { + return + } + + return s.update(pfAttr, setLv...) +} + +// Lang 更新语言 +func (s *FissionUserAttr) Lang(lang string) (err error) { + if lang == "" || s.ignore() { + return + } + + // 用户关联的语言 + pfAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkLang, lang, lang) + if err != nil { + return + } + + // 如果没更新,或者平台是其他,就不用处理了 + if lang == pfAttr.Value { + return + } + + return s.update(pfAttr, lang) +} + +// Center 更新任务中心来源 +func (s *FissionUserAttr) Center(centerHashId string) (err error) { + if centerHashId == "" || s.ignore() { + return + } + + // 用户关联的任务中心 + pfAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkCenter, centerHashId, centerHashId) + if err != nil { + return + } + + // 如果没更新,就不用处理了 + if centerHashId == pfAttr.Value { + return + } + + return s.update(pfAttr, centerHashId) +} + +// CenterModule 更新任务中心模块来源 +func (s *FissionUserAttr) CenterModule(moduleId string) (err error) { + if moduleId == "" || s.ignore() { + return + } + + // 用户关联的任务中心模块 + pfAttr, err := s.firstOrCreate(mtype.FissionUserAttrMarkCenterModule, moduleId, moduleId) + if err != nil { + return + } + + // 如果没更新,就不用处理了 + if moduleId == pfAttr.Value { + return + } + + return s.update(pfAttr, moduleId) +} + +func (s *FissionUserAttr) firstOrCreate(attrMark, value, values string) (attr *model.FissionUserAttr, err error) { + user := s.user + attr, err = cache.NewFissionUserAttr(s.Ctx).FindByUniqIdx(user.ID, attrMark, cache.WithNilSet(func() ([]byte, error) { + createAttr := withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: attrMark, + Value: value, + Values: values, + }) + + err = s.creates(createAttr) + if err != nil { + return nil, err + } + + return jsonm.Marshal(createAttr) + })) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *FissionUserAttr) creates(attrs ...*model.FissionUserAttr) (err error) { + err = s.GetDao().FissionUserAttr.WithContext(s.Ctx).Clauses( + clause.OnConflict{ + DoNothing: true, + }).Create(attrs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, attr := range attrs { + if s.canTotalAttr(attr.Attr) { + _ = s.changeTotal(attr.Attr, attr.Value, "") + } + } + + return +} + +func (s *FissionUserAttr) createsJ(attrs ...*model.FissionUserJattr) (err error) { + err = s.GetDao().FissionUserJattr.WithContext(s.Ctx).Clauses( + clause.OnConflict{ + DoNothing: true, + }).Create(attrs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *FissionUserAttr) update(attr *model.FissionUserAttr, vals ...string) (err error) { + attrM := s.GetDao().FissionUserAttr + + attrVals := attr.GetValues() + for _, val := range vals { + if !verify.InArray(val, attrVals...) { + attrVals = append(attrVals, val) + } + } + + _, err = attrM.WithContext(s.Ctx).Where(attrM.ID.Eq(attr.ID)).UpdateSimple( + attrM.Value.Value(vals[0]), + attrM.Values.Value(strings.Join(attrVals, ",")), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if s.canTotalAttr(attr.Attr) { + _ = s.changeTotal(attr.Attr, vals[0], attr.Value) + } + + // 清除缓存 + _ = cache.NewFissionUserAttr(s.Ctx).Clear(attr) + + return +} + +func (s *FissionUserAttr) changeTotal(attr string, newVal, oldVal string) (err error) { + m := s.GetDao().FissionUserAttrTotal + if newVal != "" { + var id int64 + id, err = s.getTotalId(attr, newVal) + if err != nil { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(id)).UpdateSimple(m.Num.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if oldVal != "" { + var id int64 + id, err = s.getTotalId(attr, oldVal) + if err != nil { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(id)).UpdateSimple(m.Num.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *FissionUserAttr) ignore() bool { + return s.user.IsView == mtype.Yes +} + +func (s *FissionUserAttr) canTotalAttr(attr string) bool { + return verify.InArray[string](attr, mtype.FissionUserAttrMarkPlatform) +} + +func (s *FissionUserAttr) getTotalId(attr, val string) (id int64, err error) { + cc := cache.NewFissionUserAttrTotal(s.Ctx) + id, err = cc.FindByUniqIdx(s.user.CampaignID, attr, val) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if id != 0 { + return + } + + lc := app.NewFollower(s.Ctx, ckey.FissionUserAttrCreateOnce(s.user.CampaignID, attr, val), lock.SetExpire(10*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + id, err = cc.FindByUniqIdx(s.user.CampaignID, attr, val) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if id != 0 { + return + } + + total := withdefault.FissionUserAttrTotal(&model.FissionUserAttrTotal{ + CampaignID: s.user.CampaignID, + Attr: attr, + Val: val, + Num: 0, + }) + + err = s.GetDao().FissionUserAttrTotal.WithContext(s.Ctx).Create(total) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + id = total.ID + return +} + +func (s *FissionUserAttr) CustomParam(paramStr string) (err error) { + if paramStr == "" || s.ignore() { + return + } + + pfAttr, err := s.firstOrCreateJ(mtype.FissionUserAttrMarkCustomParam, paramStr) + if err != nil { + return + } + + // 如果没更新,就不用处理了 + if paramStr == pfAttr.Value && verify.InArray[string](paramStr, pfAttr.GetValues()...) { + return + } + + return s.updateJ(pfAttr, paramStr) +} + +func (s *FissionUserAttr) firstOrCreateJ(attrMark string, values ...string) (attr *model.FissionUserJattr, err error) { + user := s.user + + valj, _ := jsonm.ToSliceString(values) + attr, err = cache.NewFissionUserJattr(s.Ctx).FindByUniqIdx(user.ID, attrMark, cache.WithNilSet(func() ([]byte, error) { + createAttr := withdefault.FissionUserJattr(&model.FissionUserJattr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: attrMark, + Value: values[0], + Values: valj, + }) + + err = s.createsJ(createAttr) + if err != nil { + return nil, err + } + + return jsonm.Marshal(createAttr) + })) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *FissionUserAttr) updateJ(attr *model.FissionUserJattr, vals ...string) (err error) { + attrM := s.GetDao().FissionUserJattr + + attrVals := attr.GetValues() + for _, val := range vals { + if !verify.InArray(val, attrVals...) { + attrVals = append(attrVals, val) + } + } + + values, _ := jsonm.ToSliceString(attrVals) + + _, err = attrM.WithContext(s.Ctx).Where(attrM.ID.Eq(attr.ID)).UpdateSimple( + attrM.Value.Value(vals[0]), + attrM.Values.Value(values), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 清除缓存 + _ = cache.NewFissionUserJattr(s.Ctx).Clear(attr) + + return +} diff --git a/internal/service/provider/fissionaction/README.md b/internal/service/provider/fissionaction/README.md new file mode 100644 index 0000000..70cb4da --- /dev/null +++ b/internal/service/provider/fissionaction/README.md @@ -0,0 +1 @@ +> 这里的json文件都只是一些说明对照,要跟前段页面显示的保持一致 \ No newline at end of file diff --git a/internal/service/provider/fissionaction/action_list.go b/internal/service/provider/fissionaction/action_list.go new file mode 100644 index 0000000..abe90fa --- /dev/null +++ b/internal/service/provider/fissionaction/action_list.go @@ -0,0 +1,268 @@ +package fissionaction + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" +) + +// 这个是玩法共用的埋点事件,如果有其他玩法没有,调整一下 +var commonAction = []int32{ + mtype.FissionActionTypeView, + mtype.FissionActionTypeAppInstall, mtype.FissionActionTypeWebFirstOpen, mtype.FissionActionTypeAppRegister, mtype.FissionActionTypeAppOpen, + mtype.FissionActionTypeViewDownload, mtype.FissionActionTypeClickDownload, +} + +// 排序在最后面的埋点 +var weakAction = []int32{ + mtype.FissionActionTypeReward, mtype.FissionActionTypeToUse, + mtype.FissionActionTypeClickRule, mtype.FissionActionTypeClickShareLink, mtype.FissionActionTypeViewWeb, +} + +type ActionList struct { + ctx context.Context + be *merr.BusinessError + + cpn *model.FissionCampaign + conf *model.FissionCampaignConfig + tempGroup *model.FissionTempGroup +} + +func NewActionList(ctx context.Context, cpn *model.FissionCampaign, conf *model.FissionCampaignConfig, tempGroup *model.FissionTempGroup) *ActionList { + return &ActionList{ + ctx: ctx, + be: merr.NewBE(ctx), + cpn: cpn, + conf: conf, + tempGroup: tempGroup, + } +} + +// GetFissionAction 获取活动支持的埋点事件 +func (s ActionList) GetFissionAction() (actions []int32) { + actions = append(actions, commonAction...) + + if !s._notNeedClickShare() { + actions = append(actions, mtype.FissionActionTypeClickShare) + } + + if !s._notNeedClickPlay() { + actions = append(actions, mtype.FissionActionTypeClickPlay) + } + + if !s._notSupportCond() { + actions = append(actions, mtype.FissionActionTypeClickCond, mtype.FissionActionTypeFinishCond, mtype.FissionActionTypeClickMyTask) + } + + if s._hasClickPlayWeb() { + actions = append(actions, mtype.FissionActionTypeClickPlayWeb) + } + + if s.cpn.Target == mtype.FissionCampaignConfigTargetAdsGame { + actions = append(actions, mtype.FissionActionTypeWebToApp) + } + + if s.conf.HasLongImg == mtype.Yes { + actions = append(actions, mtype.FissionActionTypeClickLongImg) + } + + switch s.cpn.FissionID { + case consts.IdFlip: + actions = append(actions, mtype.FissionActionTypeClickMyReward, mtype.FissionActionTypeShowWindow, mtype.FissionActionTypeClickFlip) + case consts.IdPrizeWheel, consts.IdBlindBox, consts.IdSlotMachine, consts.IdLuckyGrid: + actions = append(actions, mtype.FissionActionTypeClickMyReward) + case consts.IdGrow, consts.IdKeep: + actions = append(actions, mtype.FissionActionTypeGrow, mtype.FissionActionTypeGrowOk) + case consts.IdQa, consts.IdQaAudio, consts.IdQaVideo: + actions = append(actions, mtype.FissionActionTypeAnswerQa, mtype.FissionActionTypeSubmitQa) + case consts.IdChop: + actions = append(actions, mtype.FissionActionTypeHelp) + + if s._manyReward() { + actions = append(actions, mtype.FissionActionTypeSelectReward) + } + + case consts.IdWinTogether: + actions = append(actions, mtype.FissionActionTypeNewcomer) + case consts.IdCoin: + actions = append(actions, mtype.FissionActionTypeUseCoin, mtype.FissionActionTypeGetCoin, mtype.FissionActionTypeClickCustomBtn) + case consts.IdSignIn: + actions = append(actions, mtype.FissionActionTypeSign) + if s._hasUseProp() { + actions = append(actions, mtype.FissionActionTypeUseProp) + } + case consts.IdVs: + actions = append(actions, mtype.FissionActionTypeVsVote) + default: + + } + + if s._hasManualTask() { + actions = append(actions, mtype.FissionActionTypeManualTask) + } + + if s._unlockReward() { + actions = append(actions, mtype.FissionActionTypeUnlockReward) + } + + actions = append(actions, weakAction...) + + return +} + +// GetFixDimension 获取活动固有维度 +func (s ActionList) GetFixDimension() (dms []string) { + + dms = []string{ + DimensionDateKey, + DimensionPlatformKey, + DimensionLangKey, + DimensionChannelKey, + DimensionLevelMarkKey, + } + + // 多语言时区 + if len(s.cpn.GetLangTypes()) > 0 { + dms = append(dms, DimensionLangGmtKey) + } + + return +} + +// GetDimension 获取埋点事件专属维度 +func (s ActionList) GetDimension(actionType int32) (dms []string) { + + switch s.conf.RewardGroup { + case mtype.FissionRewardGroupCountry: + dms = append(dms, DimensionCountryKey) + } + + switch actionType { + case mtype.FissionActionTypeClickDownload, mtype.FissionActionTypeViewDownload: + dms = append(dms, DimensionDownloadFromKey) + case mtype.FissionActionTypeClickShare: + dms = append(dms, DimensionMediaKey) + case mtype.FissionActionTypeClickCond: + dms = append(dms, DimensionCondKey) + + if s._condHasForm() { + dms = append(dms, DimensionFromKey) + } + + case mtype.FissionActionTypeFinishCond: + dms = append(dms, DimensionCondKey) + case mtype.FissionActionTypeToUse: + dms = append(dms, DimensionRewardKey, DimensionFromKey) + case mtype.FissionActionTypeReward: + dms = append(dms, DimensionRewardKey, DimensionRewardTypeKey) + case mtype.FissionActionTypeSelectReward: + dms = append(dms, DimensionRewardKey) + case mtype.FissionActionTypeClickPlay, mtype.FissionActionTypeShowWindow, mtype.FissionActionTypeHelp: + dms = append(dms, DimensionFromKey) + case mtype.FissionActionTypeClickLongImg: + dms = append(dms, DimensionImgUrlKey, DimensionZoneIdKey) + case mtype.FissionActionTypeGrow, mtype.FissionActionTypeGrowOk: + + if s._growHasReward() { + dms = append(dms, DimensionRewardKey) + } + + case mtype.FissionActionTypeAnswerQa: + dms = append(dms, DimensionQaIdKey, DimensionQaOptionIdKey) + case mtype.FissionActionTypeSubmitQa: + dms = append(dms, DimensionQaPointKey) + case mtype.FissionActionTypeClickFlip: + dms = append(dms, DimensionFromStatusKey) + case mtype.FissionActionTypeClickCustomBtn: + dms = append(dms, DimensionCustomBtnIdKey) + case mtype.FissionActionTypeManualTask: + dms = append(dms, DimensionTaskIdKey, DimensionRewardKey) + case mtype.FissionActionTypeClickShareLink: + dms = append(dms, DimensionParentIdKey) + case mtype.FissionActionTypeVsVote: + dms = append(dms, DimensionScheduleIdKey, DimensionWinTeamIdKey) + case mtype.FissionActionTypeUnlockReward: + dms = append(dms, DimensionRewardKey) + } + + return +} + +// 任务埋点是否有来源维度 +func (s ActionList) _condHasForm() bool { + return verify.InArray(s.cpn.FissionID, consts.IdFlip) || + (s.cpn.FissionID == consts.IdLuckyGrid && s.tempGroup.Mark == "grid_palm") +} + +func (s ActionList) _notSupportCond() bool { + if verify.InArray(s.cpn.FissionID, consts.IdChop, consts.IdCash) { + return true + } + + ticket, _ := cache.NewCampaignTicket(s.ctx).FindByMark(s.cpn.ID, mtype.FissionCampaignTicketCustom) + + return ticket == nil || ticket.Open == mtype.No +} + +func (s ActionList) _unlockReward() bool { + m := dao.FissionCampaignReward + count, _ := m.WithContext(s.ctx).Where(m.CampaignID.Eq(s.cpn.ID), m.OpenTask.Eq(mtype.Yes), m.IsDel.Eq(mtype.No)).Count() + return count > 0 +} + +func (s ActionList) _hasManualTask() bool { + m := dao.FissionCampaignTask + count, _ := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(s.cpn.ID), + m.AwardMode.Eq(mtype.FissionCampaignTaskAwardModeManual), + m.IsDel.Eq(mtype.No), + ).Count() + + return count > 0 +} + +func (s ActionList) _manyReward() bool { + m := dao.FissionCampaignReward + count, _ := m.WithContext(s.ctx).Where(m.CampaignID.Eq(s.cpn.ID), m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), m.IsDel.Eq(mtype.No)).Count() + return count > 1 +} + +func (s ActionList) _hasUseProp() bool { + switch s.cpn.FissionID { + case consts.IdSignIn: + conf, _ := cache.NewCampaignSign(s.ctx).FindByCampaignId(s.cpn.ID) + return conf.HasCard == mtype.Yes + default: + return false + } +} + +func (s ActionList) _growHasReward() bool { + return verify.InArray[int64](s.cpn.FissionID, consts.IdKeep) +} + +func (s ActionList) _notNeedClickPlay() bool { + return verify.InArray[int64](s.cpn.FissionID, + consts.IdWinTogether, + consts.IdReferral, + consts.IdCash, + consts.IdKeep, + consts.IdSignIn, + consts.IdVs, + ) +} + +func (s ActionList) _notNeedClickShare() bool { + conf, _ := cache.NewCampaignConfig(s.ctx).FindByCampaignId(s.cpn.ID) + return utils.Ternary[bool](verify.InArray[int64](s.cpn.FissionID, consts.IdSignIn, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo, consts.IdPrizeQuiz), conf.OpenShare == mtype.No, false) +} + +func (s ActionList) _hasClickPlayWeb() bool { + return s.conf.HasWeb == mtype.Yes || s.cpn.Target == mtype.FissionCampaignConfigTargetAdsGame +} diff --git a/internal/service/provider/fissionaction/c_test.go b/internal/service/provider/fissionaction/c_test.go new file mode 100644 index 0000000..a5a5488 --- /dev/null +++ b/internal/service/provider/fissionaction/c_test.go @@ -0,0 +1,25 @@ +package fissionaction + +import ( + "context" + "joybuywork/internal/repository/dao" + "testing" + "time" + + _ "joybuywork/test" +) + +func TestNewMarkPoint(t *testing.T) { + + ctx := context.Background() + m := dao.FissionUser + user, _ := m.WithContext(ctx).Where(m.ID.Eq(287926444071743488)).Take() + + t.Log(user) + + //NewMarkPoint(ctx).InApp(user).ClickCond(time.Now().Unix(), 147398024462151681, "14.153.77.109") + //NewMarkPoint(ctx).InApp(user).AppOpen(time.Now().Unix(), "14.153.77.109", "android", "13", "xiaomi", false) + NewMarkPoint(ctx).InApp(user).View(time.Now().Unix(), "14.153.77.109", "android", "13", "xiaomi") + + time.Sleep(time.Second) +} diff --git a/internal/service/provider/fissionaction/dimension.go b/internal/service/provider/fissionaction/dimension.go new file mode 100644 index 0000000..22c177d --- /dev/null +++ b/internal/service/provider/fissionaction/dimension.go @@ -0,0 +1,358 @@ +package fissionaction + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" +) + +const ( + DimensionPlatformKey = "platform" // 平台 + DimensionChannelKey = "channel_id" // 渠道 + DimensionLangKey = "lang" // 语言 + DimensionLevelMarkKey = "level_mark" // 用户等级 + DimensionUserLvKey = "user_lv" // 活动支持等级 + DimensionCountryKey = "country" // 国家 + DimensionCondKey = "cond_id" // 任务条件Id + DimensionMediaKey = "media_id" // 社媒ID + DimensionRewardKey = "reward_id" // 活动奖品ID + DimensionDownloadFromKey = "download_from" // 下载页来源 + DimensionImgUrlKey = "img_url" // 图片地址 + DimensionFromKey = "from" // 事件来源 + DimensionDateKey = "date" // 日期 + DimensionLangGmtKey = "lang_gmt" // 活动语言时区 + DimensionQaIdKey = "qa_id" // 问题ID + DimensionQaOptionIdKey = "qa_option_id" // 问题选项ID + DimensionQaGroupIdKey = "qa_group_id" // 题库ID + DimensionQaPointKey = "qa_point" // 答题分数 + DimensionRewardTypeKey = "reward_type" // 奖品类型 + DimensionFromStatusKey = "from_status" // 事件状态 + DimensionCustomBtnIdKey = "custom_btn_id" // 自定义按钮id + DimensionZoneIdKey = "zone_id" // 热区id + DimensionTaskIdKey = "task_id" // 任务id + DimensionParentIdKey = "parent_id" // 上级id + DimensionScheduleIdKey = "schedule_id" // 赛程id + DimensionWinTeamIdKey = "win_team_id" // 比赛队伍id +) + +type keyTitle struct { + Id int64 // 主标识 + Mark string // 字符串主标识 (前端拿来做文案替换的标识) + Title string // 主标识标题 + SecondId int64 // 第二标识 (拿来做一些分组或者判断用的) +} + +type DimensionKey struct { + ctx context.Context + be *merr.BusinessError + + cpn *model.FissionCampaign + conf *model.FissionCampaignConfig +} + +func NewDimensionKey(ctx context.Context, cpnId ...any) (*DimensionKey, error) { + dk := &DimensionKey{ + ctx: ctx, + be: merr.NewBE(ctx), + } + + cpn, err := finder.Campaign(ctx, cpnId) + if err != nil { + return nil, dk.be.CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return nil, workerr.NotFound("campaign not found") + } + + conf, err := cache.NewCampaignConfig(ctx).FindByCampaignId(cpn.ID) + if err != nil { + return nil, dk.be.CacheError(err) + } + + dk.cpn = cpn + dk.conf = conf + + return dk, nil +} + +// PlatformKeys DimensionPlatformKey 支持的key +func (s DimensionKey) PlatformKeys() []string { + return []string{consts.PlatformAndroid, consts.PlatformIOS, consts.PlatformWeb, consts.PlatformIPad, consts.PlatformOther} +} + +// ChannelKeys DimensionChannelKey 支持的keys +func (s DimensionKey) ChannelKeys() (keys []*keyTitle) { + m := dao.FissionCampaignChannel + + list, _ := m.WithContext(s.ctx).Where(m.CampaignID.Eq(s.cpn.ID), m.IsDel.Eq(mtype.No)).Find() + + keys = make([]*keyTitle, 0, len(list)) + + for _, v := range list { + keys = append(keys, &keyTitle{ + Id: v.ID, + Title: v.Title, + SecondId: int64(v.CType), + }) + } + return +} + +// LangKeys DimensionLangKey 支持的keys +func (s DimensionKey) LangKeys() (keys []*keyTitle) { + for _, v := range s.cpn.GetLangMarks() { + keys = append(keys, &keyTitle{ + Mark: v, + }) + } + return +} + +// UserLv DimensionUserLvKey 支持的keys +func (s DimensionKey) UserLv() (keys []*keyTitle) { + if !verify.InArray(s.conf.RewardGroup, mtype.FissionRewardGroupLangAndUserLevel, mtype.FissionRewardGroupUserLevel) { + return + } + + var ids []int64 + ful := finder.NewFuserLayer(s.conf) + + switch s.conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel: + ids = ful.Level().Support + case mtype.FissionRewardGroupLangAndUserLevel: + var titleMap = make(map[int64]string) + for _, v := range ful.LangLevel().Support { + for _, id := range v.Level { + if _, ok := titleMap[id]; ok { + titleMap[id] = "" + ids = append(ids, id) + } + } + } + default: + + } + + m := dao.FissionUserLevel + list, _ := m.WithContext(s.ctx).Where(m.ID.In(ids...)).Find() + var titleMap = make(map[int64]string, len(list)) + for _, v := range list { + titleMap[v.ID] = v.Title + } + + for _, v := range ids { + keys = append(keys, &keyTitle{ + Id: v, + Title: titleMap[v], + SecondId: 0, + }) + } + + return +} + +// CountryKeys DimensionCountryKey 支持的keys +func (s DimensionKey) CountryKeys() (keys []*keyTitle) { + if !verify.InArray(s.conf.RewardGroup, mtype.FissionRewardGroupCountry) { + return + } + + ful := finder.NewFuserLayer(s.conf) + keys = make([]*keyTitle, 0, len(ful.Country().Support)) + for _, v := range ful.Country().Support { + keys = append(keys, &keyTitle{ + Mark: v, + Title: "", + }) + } + + return +} + +// TaskKeys DimensionCondKey 支持的keys +func (s DimensionKey) TaskKeys() (keys []*keyTitle) { + m := dao.FissionCampaignTicket + ticket, _ := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(s.cpn.ID), + m.Mark.Eq(mtype.FissionCampaignTicketCustom), + m.Open.Eq(mtype.Yes), + ).Take() + + if ticket == nil { + return + } + + condM := dao.FissionCampaignCond + conds, _ := condM.WithContext(s.ctx). + Where( + condM.CampaignID.Eq(s.cpn.ID), + condM.WithContext(s.ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + + keys = make([]*keyTitle, 0, len(conds)) + + for _, cond := range conds { + keys = append(keys, &keyTitle{ + Id: cond.ID, + Title: cond.Desc, + }) + } + + return +} + +// MediaKeys DimensionMediaKey 支持的keys +func (s DimensionKey) MediaKeys() (keys []*keyTitle) { + + mediaIds := s.conf.GetShare() + + keys = make([]*keyTitle, 0, len(mediaIds)+1) + + keys = append(keys, &keyTitle{ + Id: -1, + Title: "Copy Link", + SecondId: 0, + }) + + for _, mediaId := range mediaIds { + keys = append(keys, &keyTitle{ + Id: mediaId, + Title: consts.ShareTitleMap[mediaId], + SecondId: 0, + }) + + } + + return +} + +// RewardKeys DimensionRewardKey 支持的keys +func (s DimensionKey) RewardKeys() (keys []*keyTitle) { + + m := dao.FissionCampaignReward + + list, _ := m.WithContext(s.ctx).Where(m.CampaignID.Eq(s.cpn.ID), m.IsDel.Eq(mtype.No)).Order(m.ID, m.Sort).Find() + + var titleMap = make(map[int64]string) + var ids []int64 + for _, v := range list { + if _, ok := titleMap[v.RewardID]; ok { + titleMap[v.RewardID] = "" + ids = append(ids, v.RewardID) + } + + } + + rewardM := dao.Reward + rewards, _ := rewardM.WithContext(s.ctx).Where(rewardM.ID.In(ids...)).Find() + + for _, v := range rewards { + titleMap[v.ID] = v.RewardTitle + } + + for _, v := range list { + keys = append(keys, &keyTitle{ + Id: v.ID, + Title: titleMap[v.RewardID], + SecondId: v.RewardID, + }) + } + + return +} + +// LongImgKeys DimensionImgUrlKey 支持的keys +func (s DimensionKey) LongImgKeys() (keys []*keyTitle) { + if s.conf.HasLongImg == mtype.Yes { + return + } + + m := dao.FissionCampaignLongImg + list, _ := m.WithContext(s.ctx).Where(m.CampaignID.Eq(s.conf.CampaignID)).Find() + + var titleMap = make(map[string]struct{}) + for _, v := range list { + keys = append(keys, &keyTitle{ + Mark: v.ImgURL, + }) + + titleMap[v.ImgURL] = struct{}{} + } + + if len(s.cpn.GetLangTypes()) == 1 { + return + } + + langM := dao.FissionCampaignLang + langs, _ := langM.WithContext(s.ctx).Where(langM.CampaignID.Eq(s.cpn.ID), langM.IsDel.Eq(mtype.No)).Find() + + for _, v := range langs { + imgs := v.GetLongImg() + for _, img := range imgs { + if _, ok := titleMap[img.ImgUrl]; ok { + continue + } + + keys = append(keys, &keyTitle{ + Mark: img.ImgUrl, + }) + + titleMap[img.ImgUrl] = struct{}{} + } + } + + return +} + +// 这些key,尽量保持一个key只用一种埋点,说白了就是要保证一个key一个说明,不能有两个说明 +const ( + base = "base" // 基本的下载页 + wechat = "wechat" // 微信来源的下载页 + web = "web" // 站外的下载页 + playBtn = "play_btn" // 活动首页的触发游戏的按钮 + again = "again" // 再玩一次按钮 + myTask = "my_task" // 我的任务挂件 + home = "home" // 首页展示的内容 + myReward = "my_reward" // 我的奖励挂机 + window = "window" // 弹出的窗口 + reward = "reward" // 奖品弹窗 + chance = "chance" // 再来一次弹窗 + chanceLack = "chance_lack" // 抽奖机会不足弹窗 + customBtnId = "custom_btn_id" // 自定义按钮id +) + +// DownloadFromKeys DimensionDownloadFromKey 支持的key +func (s DimensionKey) DownloadFromKeys() []string { + return []string{base, wechat, web} +} + +// DimensionFromKeys DimensionFromKey 支持的key +func (s DimensionKey) DimensionFromKeys(actionType int32) (keys []string) { + switch actionType { + case mtype.FissionActionTypeClickPlay: + keys = []string{playBtn, again} + case mtype.FissionActionTypeClickCond: + keys = []string{myTask, home} + case mtype.FissionActionTypeToUse: + keys = []string{myReward, window} + case mtype.FissionActionTypeShowWindow: + switch s.cpn.FissionID { + case consts.IdFlip: + keys = []string{reward, chance, chanceLack} + } + case mtype.FissionActionTypeClickCustomBtn: + keys = []string{customBtnId} + } + return +} diff --git a/internal/service/provider/fissionaction/mark_point.go b/internal/service/provider/fissionaction/mark_point.go new file mode 100644 index 0000000..1d04112 --- /dev/null +++ b/internal/service/provider/fissionaction/mark_point.go @@ -0,0 +1,835 @@ +package fissionaction + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "fmt" + "strings" +) + +type identify struct { + campaignId int64 + userMark string + userMarkSource int8 + isView bool // 是否一个预览用户 +} + +type pointOnce struct { + t int32 // 埋点类型 + at int64 // 行为时间 + + otherData *types.FissionActionOtherData + opts []Option +} + +type MarkPoint struct { + ctx context.Context + + p producer.FissionBiReceiver + + dimension mtype.Dimension + identify identify + + batch bool + + points []*pointOnce + actions []*model.FissionAction + afterDo []func() + + timezone []int32 +} + +func NewMarkPoint(ctx context.Context, opts ...BPOption) *MarkPoint { + markPoint := &MarkPoint{ + ctx: ctx, + p: producer.NewFissionBiReceiver(ctx), + } + + for _, opt := range opts { + opt(markPoint) + } + + return markPoint +} + +func (s *MarkPoint) append(t int32, at int64, otherData *types.FissionActionOtherData, opts ...Option) { + if s.batch { + s.points = append(s.points, &pointOnce{ + t: t, + at: at, + otherData: otherData, + opts: opts, + }) + return + } + s.pub(t, at, otherData, opts...) +} + +func (s *MarkPoint) appendDo(fc func()) { + s.afterDo = append(s.afterDo, fc) +} + +// Push 推送 +func (s *MarkPoint) Push() { + for _, point := range s.points { + s.pub(point.t, point.at, point.otherData, point.opts...) + } + + s.after() + + // 推送之后要重制一下值 + s.points, s.actions, s.afterDo = nil, nil, nil +} + +func (s *MarkPoint) pub(t int32, at int64, otherData *types.FissionActionOtherData, opts ...Option) { + if s.identify.isView { + return + } + + dms := s.dimension + + for _, opt := range opts { + opt(&dms.DimensionOption) + } + + otherStr, _ := jsonm.MarshalToString(otherData) + tz := s.timezones() + + data := types.FissionAction{ + ID: hashid.IdBigint(), + CampaignID: s.identify.campaignId, + UserMark: s.identify.userMark, + UserMarkSource: s.identify.userMarkSource, + Type: t, + ActionTime: at, + Dimension: dms, + OtherData: otherStr, + Timezone: tz, + } + + s.p.FissionAction(data) + + if s.batch { + return + } + + s.after() +} + +func (s *MarkPoint) after() { + for _, do := range s.afterDo { + do() + } +} + +func (s *MarkPoint) platform(platform string) string { + platform = strings.ToLower(platform) + switch platform { + case consts.PlatformAndroid, consts.PlatformIOS, consts.PlatformWeb, consts.PlatformIPad: + default: + platform = consts.PlatformOther + } + + return platform +} + +func (s *MarkPoint) timezones() []int32 { + if len(s.timezone) > 0 { + return s.timezone + } + + cpn, _ := cache.NewCampaign(s.ctx).FindById(s.identify.campaignId) + s.timezone = append(s.timezone, cpn.TOffset) + + if len(cpn.GetLangTypes()) == 1 { + return s.timezone + } + + m := dao.FissionCampaignLang + var tz []int32 + _ = m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID), m.TOffset.Neq(cpn.TOffset), m.IsDel.Eq(0)).Group(m.TOffset).Pluck(m.TOffset, &tz) + for _, t := range tz { + s.timezone = append(s.timezone, t) + } + + return s.timezone +} + +// InApp 站内行为 +type InApp struct { + *MarkPoint + user *model.FissionUser +} + +func (s *MarkPoint) InApp(user *model.FissionUser, dems ...CusDem) InApp { + + s.identify = identify{ + campaignId: user.CampaignID, + userMark: fmt.Sprint(user.ID), + userMarkSource: mtype.FissionActionUserMarkSourceFissionUser, + isView: user.IsView == mtype.Yes, + } + + var platform string + pAttr, _ := cache.NewFissionUserAttr(s.ctx).FindByUniqIdx(user.ID, mtype.FissionUserAttrMarkPlatform) + if pAttr != nil { + platform = pAttr.Value + } + + s.dimension = mtype.Dimension{ + Platform: platform, + ChannelId: user.ChannelID, + ParentId: user.ParentID, + Lang: utils.STernary[string](user.UserLang, "", user.LangMark), + LevelMark: user.LevelMark, + UserLv: user.UserLevel, + Country: user.UserCountry, + DimensionOption: mtype.DimensionOption{}, + } + + for _, dem := range dems { + dem(&s.dimension) + } + + return InApp{ + MarkPoint: s, + user: user, + } +} + +// View 访问活动行为 +func (s InApp) View(at int64, ip, os, ver, device string) { + s.appendDo(func() { + if s.user.JoinAt > 0 { + return + } + + m, sm := dao.FissionUser, dao.FissionUser.SubTable(s.user.CampaignID) + _, _ = m.WithContext(s.ctx).Where(m.ID.Eq(s.user.ID)).UpdateSimple(m.JoinAt.Value(at)) + _, _ = sm.WithContext(s.ctx).Where(sm.ID.Eq(s.user.ID)).UpdateSimple(sm.JoinAt.Value(at)) + + _ = cache.NewFissionUser(s.ctx, s.user.CampaignID).Clear(s.user) + }) + + s.append(mtype.FissionActionTypeView, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }) +} + +// AppOpen 用户打开app行为 +func (s InApp) AppOpen(at int64, ip, os, ver, device string, cpnFirst bool) { + s.append(mtype.FissionActionTypeAppOpen, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }, SetCpnFirst(cpnFirst)) +} + +// AppInstall 用户安装app行为 +func (s InApp) AppInstall(at int64, ip, os, ver, device string, cpnFirst bool) { + s.appendDo(func() { + if s.user.InstallAt > 0 { + return + } + + m, sm := dao.FissionUser, dao.FissionUser.SubTable(s.user.CampaignID) + _, _ = m.WithContext(s.ctx).Where(m.ID.Eq(s.user.ID)).UpdateSimple(m.InstallAt.Value(at)) + _, _ = sm.WithContext(s.ctx).Where(sm.ID.Eq(s.user.ID)).UpdateSimple(sm.InstallAt.Value(at)) + + _ = cache.NewFissionUser(s.ctx, s.user.CampaignID).Clear(s.user) + }) + + s.append(mtype.FissionActionTypeAppInstall, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }, SetCpnFirst(cpnFirst)) +} + +// WebFirstOpen 用户首次打开行为 +func (s InApp) WebFirstOpen(at int64, ip, os, ver, device string, cpnFirst bool) { + s.appendDo(func() { + if s.user.InstallAt > 0 { + return + } + + m, sm := dao.FissionUser, dao.FissionUser.SubTable(s.user.CampaignID) + _, _ = m.WithContext(s.ctx).Where(m.ID.Eq(s.user.ID)).UpdateSimple(m.InstallAt.Value(at)) + _, _ = sm.WithContext(s.ctx).Where(sm.ID.Eq(s.user.ID)).UpdateSimple(sm.InstallAt.Value(at)) + + _ = cache.NewFissionUser(s.ctx, s.user.CampaignID).Clear(s.user) + }) + + s.append(mtype.FissionActionTypeWebFirstOpen, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }, SetCpnFirst(cpnFirst)) +} + +// AppRegister 用户注册app行为 +func (s InApp) AppRegister(at int64, ip, os, ver, device string, cpnFirst bool) { + s.appendDo(func() { + if s.user.RegisterAt > 0 { + return + } + + m, sm := dao.FissionUser, dao.FissionUser.SubTable(s.user.CampaignID) + _, _ = m.WithContext(s.ctx).Where(m.ID.Eq(s.user.ID)).UpdateSimple(m.RegisterAt.Value(at)) + _, _ = sm.WithContext(s.ctx).Where(sm.ID.Eq(s.user.ID)).UpdateSimple(sm.RegisterAt.Value(at)) + + _ = cache.NewFissionUser(s.ctx, s.user.CampaignID).Clear(s.user) + }) + + s.append(mtype.FissionActionTypeAppRegister, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }, SetCpnFirst(cpnFirst)) +} + +// ClickPlay 活动按钮点击行为 +// from: play_btn=点击活动玩的按钮 again=点击再玩一次触发玩的按钮 +func (s InApp) ClickPlay(at int64, ip, from string) { + s.append(mtype.FissionActionTypeClickPlay, at, &types.FissionActionOtherData{ + Ip: ip, + }, SetFrom(from)) +} + +// ClickShare 点击分享 +func (s InApp) ClickShare(at, mediaId int64, ip string) { + s.append(mtype.FissionActionTypeClickShare, at, &types.FissionActionOtherData{ + Ip: ip, + }, SetMediaId(mediaId)) +} + +// ClickCond 点击去完成条件 +// from: my_task=点击我的任务弹窗中的去完成按钮 home=点击首页中展示的任务的去完成按钮 +func (s InApp) ClickCond(at, condId int64, ip, from string) { + s.append(mtype.FissionActionTypeClickCond, at, &types.FissionActionOtherData{ + Ip: ip, + }, SetCondId(condId), SetFrom(from)) +} + +// FinishCond 完成条件 +func (s InApp) FinishCond(at, condId int64, total float64, event string, eventData []types.EventData) { + s.append(mtype.FissionActionTypeFinishCond, at, &types.FissionActionOtherData{ + Event: event, + EventData: eventData, + Total: total, + }, SetCondId(condId)) +} + +// Sign 签到 signDate 格式为 20250712 +func (s InApp) Sign(at int64, utm int32, signDate string) { + s.append(mtype.FissionActionTypeSign, at, nil, SetSignDate(utm, signDate)) +} + +// UseProp 使用道具 +// prop_name: sign_card = 补签卡 fixed_dice = 幸运骰子(固定点数) +// +// uno_three = uno+3道具 uno_five = uno+5道具 uno_fix = uno指定颜色道具 +func (s InApp) UseProp(at int64, propName string) { + s.append(mtype.FissionActionTypeUseProp, at, nil, SetPropName(propName)) +} + +// GetProp 领取道具 +// prop_name: sign_card = 补签卡 fixed_dice = 幸运骰子(固定点数) +// +// uno_three = uno+3道具 uno_five = uno+5道具 uno_fix = uno指定颜色道具 +func (s InApp) GetProp(at int64, propName string, propNum int32) { + s.append(mtype.FissionActionTypeGetProp, at, nil, + SetPropName(propName), + SetPropNum(propNum), + ) +} + +// Grow 领养生命体 +func (s InApp) Grow(at int64, rewardId int64) { + s.append(mtype.FissionActionTypeGrow, at, nil, SetRewardId(rewardId)) +} + +// GrowOk 养成生命体 +func (s InApp) GrowOk(at int64, rewardId, rewardRecordId int64) { + s.append(mtype.FissionActionTypeGrowOk, at, nil, + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + ) +} + +// WebToApp web用户转行成app用户 +func (s InApp) WebToApp(at, rewardId, rewardRecordId int64, webId string) { + s.append(mtype.FissionActionTypeWebToApp, at, nil, + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + SetFromWebId(webId), + ) +} + +// ToUse 点击去使用按钮 +// from: my_reward=点击奖励记录去使用 window=点击领奖弹窗去使用按钮 +func (s InApp) ToUse(at, rewardId int64, ip, from string) { + s.append(mtype.FissionActionTypeToUse, at, &types.FissionActionOtherData{ + Ip: ip, + }, SetRewardId(rewardId), SetFrom(from)) +} + +// ClickLongImg 点击长图 +func (s InApp) ClickLongImg(at int64, imgUrl string, imgId, zoneId int64, ip string) { + s.append(mtype.FissionActionTypeClickLongImg, at, &types.FissionActionOtherData{ + Ip: ip, + }, SetImgUrl(imgUrl), SetImgId(imgId), SetZoneId(zoneId)) +} + +// FinishTask 完成任务 +func (s InApp) FinishTask(at int64, taskId int64) { + s.append(mtype.FissionActionTypeFinishTask, at, nil, SetTaskId(taskId)) +} + +// ClickMyTask 点击我的任务icon +func (s InApp) ClickMyTask(at int64, ip string) { + s.append(mtype.FissionActionTypeClickMyTask, at, &types.FissionActionOtherData{ + Ip: ip, + }) +} + +// ClickMyReward 点击奖励记录 +func (s InApp) ClickMyReward(at int64, ip string) { + s.append(mtype.FissionActionTypeClickMyReward, at, &types.FissionActionOtherData{ + Ip: ip, + }) +} + +// ClickRule 点击活动规则 +func (s InApp) ClickRule(at int64, ip string) { + s.append(mtype.FissionActionTypeClickRule, at, &types.FissionActionOtherData{ + Ip: ip, + }) +} + +// FormShow 打开表单 +// from: my_reward = 奖品记录 window = 弹窗 +// form_status: blank = 空白表单 fill = 已经填写过的 +func (s InApp) FormShow(at int64, status, from string, rewardId, rewardRecordId int64) { + s.append(mtype.FissionActionTypeFormShow, at, nil, + SetFromStatus(status), + SetFrom(from), + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + ) +} + +// FormSubmit 点击活动规则 +func (s InApp) FormSubmit(at int64, rewardId, rewardRecordId int64) { + s.append(mtype.FissionActionTypeFormSubmit, at, nil, + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + ) +} + +// CopyContact 复制客服联系方式 +// from: my_reward = 奖品记录 window = 弹窗 +func (s InApp) CopyContact(at int64, from string, rewardId int64) { + s.append(mtype.FissionActionTypeCopyContact, at, nil, + SetFrom(from), + SetRewardId(rewardId), + ) +} + +// Reward 获得一个奖品 +func (s InApp) Reward(at, rewardId, rewardRecordId, childId int64, rewardType int8, rewardNum int32) { + s.append(mtype.FissionActionTypeReward, at, nil, + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + SetChildId(childId), + SetRewardType(int32(rewardType)), + SetRewardNum(rewardNum), + ) +} + +// ShowWindow 展示弹窗 +// from: reward = 获得奖品弹窗 chance = 获得抽奖机会弹窗 chance_lack = 抽奖机会不足弹窗 +func (s InApp) ShowWindow(at int64, from string) { + s.append(mtype.FissionActionTypeShowWindow, at, nil, + SetFrom(from), + ) +} + +// AnswerQa 回答问题 +func (s InApp) AnswerQa(at int64, qaId, qaOptionId int64, isRight int32) { + s.append(mtype.FissionActionTypeAnswerQa, at, nil, + SetQaId(qaId), + SetQaOptionId(qaOptionId), + SetQaOptionRight(isRight), + ) +} + +// SubmitQa 提交答卷 +func (s InApp) SubmitQa(at int64, qaGroupId int64, qaNum int32, point string) { + s.append(mtype.FissionActionTypeSubmitQa, at, nil, + SetQaGroupId(qaGroupId), + SetQaNum(qaNum), + SetQaPoint(point), + ) +} + +// SelectReward 选择奖品 +func (s InApp) SelectReward(at int64, rewardId int64) { + s.append(mtype.FissionActionTypeSelectReward, at, nil, + SetRewardId(rewardId), + ) +} + +// Help 获得助力 +// from: help_install = 安装助力 help_register = 注册助力 help_open = 拉日活助力 +func (s InApp) Help(at int64, from string, rewardId int64) { + s.append(mtype.FissionActionTypeHelp, at, nil, + SetFrom(from), + SetRewardId(rewardId), + ) +} + +// Newcomer 完成新人任务 +func (s InApp) Newcomer(at int64, rewardId, rewardRecordId int64) { + s.append(mtype.FissionActionTypeNewcomer, at, nil, + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + ) +} + +// ClickFlip 点击立即翻牌 +func (s InApp) ClickFlip(at int64, fromStatus string) { + s.append(mtype.FissionActionTypeClickFlip, at, nil, + SetFromStatus(fromStatus), + ) +} + +// UseCoin 投放金币 +func (s InApp) UseCoin(at int64, sceneId, times int64) { + s.append(mtype.FissionActionTypeUseCoin, at, nil, + SetSceneId(sceneId), + SetUseTimes(times), + ) +} + +// GetCoin 领取金币 +func (s InApp) GetCoin(at int64, sceneId int64) { + s.append(mtype.FissionActionTypeGetCoin, at, nil, + SetSceneId(sceneId), + ) +} + +// ClickCustomBtn 点击自定义按钮 +func (s InApp) ClickCustomBtn(at int64, customBtnId int64) { + s.append(mtype.FissionActionTypeClickCustomBtn, at, nil, + SetCustomBtnId(customBtnId), + ) +} + +// ClickChild 点击子活动入口 +func (s InApp) ClickChild(at int64, childId int64, childType int8) { + s.append(mtype.FissionActionTypeClickChild, at, nil, + SetChildId(childId), + SetChildType(int32(childType)), + ) +} + +// JoinChild 参与子活动(玩子活动) +func (s InApp) JoinChild(at int64, childId int64, childType int8) { + s.append(mtype.FissionActionTypeJoinChild, at, nil, + SetChildId(childId), + SetChildType(int32(childType)), + ) +} + +// Pay 支付事件 +func (s InApp) Pay(at int64, info *types.PurchaseData) { + s.append(mtype.FissionActionTypePay, at, + &types.FissionActionOtherData{PurchaseData: info}, + SetPay(info.Amount, info.Currency), + ) +} + +// PointsUse 使用积分事件 +func (s InApp) PointsUse(at int64, pointUse int32) { + s.append(mtype.FissionActionTypePointsUse, at, nil, + SetPointsUse(pointUse), + ) +} + +// ManualTask 手动领取任务奖励 +func (s InApp) ManualTask(at int64, taskId, rewardId int64) { + s.append(mtype.FissionActionTypeManualTask, at, nil, + SetRewardId(rewardId), + SetTaskId(taskId), + ) +} + +// CenterDrainage 任务中心引流 +func (s InApp) CenterDrainage(at int64, centerHashId, centerModuleId string) { + s.append(mtype.FissionActionTypeCenterDrainage, at, nil, + SetCenterHashId(centerHashId), + SetCenterModuleId(centerModuleId), + ) +} + +// ClickChat 进入AI对话 +// chat_from: icon = 图标,tip = 宠物文案 +func (s InApp) ClickChat(at int64, chatFrom, chatTipMsg string) { + s.append(mtype.FissionActionTypeClickChat, at, nil, + SetChatFrom(chatFrom), + SetChatTipMsg(chatTipMsg), + ) +} + +// VsVote 赛事竞猜投票 +func (s InApp) VsVote(at int64, scheduleId int64, winType int32, winTeamId int64) { + s.append(mtype.FissionActionTypeVsVote, at, nil, + SetScheduleId(scheduleId), + SetWinType(winType, winTeamId), + ) +} + +// VsWin 赛事竞猜获胜 +func (s InApp) VsWin(at int64, scheduleId int64, voteNum int32) { + s.append(mtype.FissionActionTypeVsWin, at, nil, + SetScheduleId(scheduleId), + SetVoteNum(voteNum), + ) +} + +// VsAcceptReward 赛事竞猜领取奖品 +func (s InApp) VsAcceptReward(at int64, scheduleId, rewardId, rewardRecordId int64) { + s.append(mtype.FissionActionTypeVsAcceptReward, at, nil, + SetScheduleId(scheduleId), + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + ) +} + +// MallRedeem 兑换商城商品 +func (s InApp) MallRedeem(at int64, mallId, mallItemId int64, pointUse int32) { + s.append(mtype.FissionActionTypeMallRedeem, at, nil, + SetMallId(mallId), + SetMallItemId(mallItemId), + SetPointsUse(pointUse), + ) +} + +// ClickUnoCard 点击UNO自定卡 +func (s InApp) ClickUnoCard(at int64, colorMark, cardNo string, cardId int64) { + s.append(mtype.FissionActionTypeClickUnoCard, at, nil, + SetCardNo(colorMark, cardNo), + SetUnoCardId(cardId), + ) +} + +// CollectUnoCard 集齐uno卡牌 +func (s InApp) CollectUnoCard(at int64, cardColor string) { + s.append(mtype.FissionActionTypeCollectUnoCard, at, nil, + SetCardColor(cardColor), + ) +} + +// UnlockReward 解锁奖品 +func (s InApp) UnlockReward(at, rewardId, taskId int64) { + s.append(mtype.FissionActionTypeUnlockReward, at, nil, + SetRewardId(rewardId), + SetTaskId(taskId), + ) +} + +// OutApp 站外行为 +type OutApp struct { + *MarkPoint +} + +func (s *MarkPoint) OutApp(cpnId, channelId, parentId int64, webId, platform, lang string) OutApp { + s.identify = identify{ + campaignId: cpnId, + userMark: webId, + userMarkSource: mtype.FissionActionUserMarkSourceUaWebId, + } + + s.dimension = mtype.Dimension{ + Platform: s.platform(platform), + ChannelId: channelId, + ParentId: parentId, + Lang: lang, + DimensionOption: mtype.DimensionOption{}, + } + + return OutApp{ + MarkPoint: s, + } +} + +// View 访问活动行为,这个是web2app用的访问活动 +func (s OutApp) View(at int64, ip, os, ver, device string) { + s.append(mtype.FissionActionTypeView, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }) +} + +// ViewDownload 浏览下载页行为 +// from: base=正常下载页 wechat=从微信跳转过来的下载页 web=站外过来的下载页 +func (s OutApp) ViewDownload(at int64, downloadFrom, ip, os, ver, device string) { + s.append(mtype.FissionActionTypeViewDownload, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }, SetDownloadFrom(downloadFrom)) +} + +// ClickDownload 点击下载按钮行为 base=正常下载页点击下载 wechat=从微信跳转过来的下载页点击下载 web=站外过来的下载页点击下载 +func (s OutApp) ClickDownload(at int64, downloadFrom string) { + s.append(mtype.FissionActionTypeClickDownload, at, nil, SetDownloadFrom(downloadFrom)) +} + +// ViewWechat 浏览微信页行为 +func (s OutApp) ViewWechat(at int64, ip string) { + s.append(mtype.FissionActionTypeViewWechat, at, &types.FissionActionOtherData{ + Ip: ip, + }) +} + +// ViewWeb 访问站外链接行为 +func (s OutApp) ViewWeb(at int64, ip, os, ver, device string) { + s.append(mtype.FissionActionTypeViewWeb, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }) +} + +// ClickPlayWeb 活动站外按钮点击行为 +func (s OutApp) ClickPlayWeb(at int64, rewardId int64) { + s.append(mtype.FissionActionTypeClickPlayWeb, at, nil, + SetRewardId(rewardId), + ) +} + +// InAppOpenLink 站内打开链接行为 +func (s OutApp) InAppOpenLink(at int64, blackBox, uid string) { + s.append(mtype.FissionActionTypeInAppOpenLink, at, nil, + SetBlackbox(blackBox), + SetUid(uid), + ) +} + +// Help 获得助力 +// from: help_click = 点击助力 +func (s OutApp) Help(at int64, from string, rewardId int64, ip, os, ver, device string) { + s.append(mtype.FissionActionTypeHelp, at, + &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }, + SetFrom(from), + SetRewardId(rewardId), + ) +} + +// ClickShareLink 点击分享连接行为 +func (s OutApp) ClickShareLink(at int64, ip, os, ver, device string) { + s.append(mtype.FissionActionTypeClickShareLink, at, &types.FissionActionOtherData{ + Ip: ip, + Os: os, + OsVersion: ver, + DeviceModel: device, + }) +} + +// Child 子活动行为 +type Child struct { + *MarkPoint +} + +func (s *MarkPoint) Child(child *model.FissionChildUser, user *model.FissionUser, dems ...CusDem) Child { + s.identify = identify{ + campaignId: child.CampaignID, + userMark: fmt.Sprint(child.ID), + userMarkSource: mtype.FissionActionUserMarkSourceChild, + } + + var platform string + pAttr, _ := cache.NewFissionUserAttr(s.ctx).FindByUniqIdx(user.ID, mtype.FissionUserAttrMarkPlatform) + if pAttr != nil { + platform = pAttr.Value + } + + s.dimension = mtype.Dimension{ + Platform: platform, + ChannelId: user.ChannelID, + ParentId: user.ParentID, + Lang: utils.STernary[string](user.UserLang, "", user.LangMark), + LevelMark: user.LevelMark, + UserLv: user.UserLevel, + Country: user.UserCountry, + DimensionOption: mtype.DimensionOption{ + PCpnId: child.PCpnID, + }, + } + + for _, dem := range dems { + dem(&s.dimension) + } + + return Child{ + MarkPoint: s, + } +} + +// ChildShow 子活动入口打开 +func (s Child) ChildShow(at int64) { + s.append(mtype.FissionActionTypeChildShow, at, nil) +} + +// ChildSign 子活动签到 +func (s Child) ChildSign(at int64) { + s.append(mtype.FissionActionTypeChildSign, at, nil) +} + +// ChildLottery 子活动抽奖 +func (s Child) ChildLottery(at int64) { + s.append(mtype.FissionActionTypeChildLottery, at, nil) +} + +// ChildInvite 子活动邀请成功 +func (s Child) ChildInvite(at int64, invitedId int64) { + s.append(mtype.FissionActionTypeChildInvite, at, &types.FissionActionOtherData{ + InvitedId: invitedId, + }) +} + +// ChildGetReward 子活动获得奖品 +func (s Child) ChildGetReward(at int64, rewardId, rewardRecordId int64, rewardType int8) { + s.append(mtype.FissionActionTypeChildGetReward, at, nil, + SetRewardId(rewardId), + SetRewardRecordId(rewardRecordId), + SetRewardType(int32(rewardType)), + ) +} diff --git a/internal/service/provider/fissionaction/option.go b/internal/service/provider/fissionaction/option.go new file mode 100644 index 0000000..8d87156 --- /dev/null +++ b/internal/service/provider/fissionaction/option.go @@ -0,0 +1,362 @@ +package fissionaction + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/mtype" + "fmt" +) + +type CusDem func(option *mtype.Dimension) + +// SetChannelId 设置渠道 +func SetChannelId(id int64) CusDem { + return func(option *mtype.Dimension) { + option.ChannelId = id + } +} + +type Option func(option *mtype.DimensionOption) + +// SetCondId 完成事件id +func SetCondId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.CondId = mustId(id) + } +} + +// SetMediaId 社媒id +func SetMediaId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.MediaId = mustId(id) + } +} + +// SetRewardId 活动奖品id +func SetRewardId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.RewardId = mustId(id) + } +} + +// SetRewardRecordId 奖品记录id +func SetRewardRecordId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.RewardRecordId = mustId(id) + } +} + +// SetRewardType 奖品记录id +func SetRewardType(t int32) Option { + return func(option *mtype.DimensionOption) { + option.RewardType = mustId(t) + } +} + +// SetRewardNum 奖品数量 +func SetRewardNum(num int32) Option { + return func(option *mtype.DimensionOption) { + option.RewardNum = num + } +} + +// SetDownloadFrom 下载页来源 +func SetDownloadFrom(from string) Option { + return func(option *mtype.DimensionOption) { + option.DownloadFrom = mustStr(from) + } +} + +// SetPropName 道具名称 +func SetPropName(name string) Option { + return func(option *mtype.DimensionOption) { + option.PropName = mustStr(name) + } +} + +// SetPropNum 道具数量 +func SetPropNum(num int32) Option { + return func(option *mtype.DimensionOption) { + option.PropNum = num + } +} + +// SetFromWebId 绑定的浏览器id +func SetFromWebId(webId string) Option { + return func(option *mtype.DimensionOption) { + option.FromWebId = mustStr(webId) + } +} + +// SetCpnFirst 绑定的浏览器id +func SetCpnFirst(isTure bool) Option { + return func(option *mtype.DimensionOption) { + if isTure { + option.CpnFirst = "true" + } else { + option.CpnFirst = "false" + } + + } +} + +// SetSignDate 触发签到的时间 +func SetSignDate(utm int32, date string) Option { + return func(option *mtype.DimensionOption) { + option.UTM = fmt.Sprint(utm) + option.SignDate = mustStr(date) + } +} + +// SetImgUrl 图片地址 +func SetImgUrl(url string) Option { + return func(option *mtype.DimensionOption) { + option.ImgUrl = mustStr(url) + } +} + +// SetImgId 长图id +func SetImgId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.ImgId = mustId(id) + } +} + +// SetZoneId 热区id +func SetZoneId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.ZoneId = mustId(id) + } +} + +// SetTaskId 完成的任务ID +func SetTaskId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.TaskId = mustId(id) + } +} + +// SetFrom 事件来源 +func SetFrom(from string) Option { + return func(option *mtype.DimensionOption) { + option.From = mustStr(from) + } +} + +// SetFromStatus 事件状态 +func SetFromStatus(status string) Option { + return func(option *mtype.DimensionOption) { + option.FromStatus = mustStr(status) + } +} + +// SetBlackbox 黑盒数据 +func SetBlackbox(blackbox string) Option { + return func(option *mtype.DimensionOption) { + option.Blackbox = mustStr(blackbox) + } +} + +// SetUid 第三方用户id +func SetUid(uid string) Option { + return func(option *mtype.DimensionOption) { + option.Uid = mustStr(uid) + } +} + +// SetQaId 题目ID +func SetQaId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.QaId = mustId(id) + } +} + +// SetQaOptionId 选择的选项ID +func SetQaOptionId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.QaOptionId = mustId(id) + } +} + +// SetQaOptionRight 选择的选项是否正确 +func SetQaOptionRight(isRight int32) Option { + return func(option *mtype.DimensionOption) { + option.QaOptionRight = mustId(isRight) + } +} + +// SetQaGroupId 题库ID +func SetQaGroupId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.QaGroupId = mustId(id) + } +} + +// SetQaNum 答题数量 +func SetQaNum(num int32) Option { + return func(option *mtype.DimensionOption) { + option.QaNum = num + } +} + +// SetQaPoint 答题分数 +func SetQaPoint(point string) Option { + return func(option *mtype.DimensionOption) { + option.QaPoint = point + } +} + +// SetChildId 子活动id +func SetChildId(id int64) Option { + return func(option *mtype.DimensionOption) { + option.ChildId = mustId(id) + } +} + +// SetChildType 子活动类型 +func SetChildType(childType int32) Option { + return func(option *mtype.DimensionOption) { + option.ChildType = childType + } +} + +// SetSceneId 参与场次 +func SetSceneId(sceneId int64) Option { + return func(option *mtype.DimensionOption) { + option.SceneId = sceneId + } +} + +// SetUseTimes 投放次数 +func SetUseTimes(times int64) Option { + return func(option *mtype.DimensionOption) { + option.UseTimes = times + } +} + +// SetCustomBtnId 参与场次 +func SetCustomBtnId(customBtnId int64) Option { + return func(option *mtype.DimensionOption) { + option.CustomBtnId = customBtnId + } +} + +// SetPay 设置付款金额 +func SetPay(payCount int64, payCurrency string) Option { + return func(option *mtype.DimensionOption) { + option.PayCount = payCount + option.PayCurrency = payCurrency + } +} + +func SetPointsUse(num int32) Option { + return func(option *mtype.DimensionOption) { + option.PointsUse = num + } +} + +func SetCenterHashId(centerHashId string) Option { + return func(option *mtype.DimensionOption) { + option.CenterHashId = centerHashId + } +} + +func SetCenterModuleId(centerModuleId string) Option { + return func(option *mtype.DimensionOption) { + option.CenterModuleId = centerModuleId + } +} + +// SetChatFrom 设置对话来源 +func SetChatFrom(chatFrom string) Option { + return func(option *mtype.DimensionOption) { + option.ChatFrom = chatFrom + } +} + +// SetChatTipMsg 设置对话提示消息 +func SetChatTipMsg(chatTipMsg string) Option { + return func(option *mtype.DimensionOption) { + option.ChatTipMsg = chatTipMsg + } +} + +// SetScheduleId 设置对话提示消息 +func SetScheduleId(scheduleId int64) Option { + return func(option *mtype.DimensionOption) { + option.ScheduleId = mustId(scheduleId) + } +} + +// SetWinType 设置获胜队伍 +func SetWinType(winType int32, winTeamId int64) Option { + return func(option *mtype.DimensionOption) { + option.WinType = mustId(winType) + option.WinTeamId = mustId(winTeamId) + } +} + +// SetVoteNum 设置投票次数 +func SetVoteNum(voteNum int32) Option { + return func(option *mtype.DimensionOption) { + option.VoteNum = mustId(voteNum) + } +} + +// SetMallId 设置对话提示消息 +func SetMallId(mallId int64) Option { + return func(option *mtype.DimensionOption) { + option.MallId = mustId(mallId) + } +} + +// SetMallItemId 设置对话提示消息 +func SetMallItemId(mallItemId int64) Option { + return func(option *mtype.DimensionOption) { + option.MallItemId = mustId(mallItemId) + } +} + +// SetCardNo 设置牌型 +func SetCardNo(colorMark, cardNo string) Option { + return func(option *mtype.DimensionOption) { + option.CardNo = mustStr(fmt.Sprintf("%s_%s", colorMark, cardNo)) + } +} + +// SetUnoCardId 设置牌id +func SetUnoCardId(cardId int64) Option { + return func(option *mtype.DimensionOption) { + option.UnoCardId = mustId(cardId) + } +} + +// SetCardColor 设置卡颜色 +func SetCardColor(cardColor string) Option { + return func(option *mtype.DimensionOption) { + option.CardColor = cardColor + } +} + +type BPOption func(bp *MarkPoint) + +func SetBatch() BPOption { + return func(bp *MarkPoint) { + bp.batch = true + } +} + +// 让id必定有值,为了让json字段显示出来 +func mustId[T consts.SignNumber](id T) T { + if id == 0 { + return -1 + } + return id +} + +// 让字符串必定有值,为了让json字段显示出来 +func mustStr(str string) string { + if str == "" { + return "-" + } + return str +} diff --git a/internal/service/provider/fissionaction/z_action_list.json b/internal/service/provider/fissionaction/z_action_list.json new file mode 100644 index 0000000..11f1052 --- /dev/null +++ b/internal/service/provider/fissionaction/z_action_list.json @@ -0,0 +1,486 @@ +[ + { + "id": 1, + "zh_name": { + "name": "活动页浏览", + "desc": "用户访问了活动页" + }, + "en_name": { + "name": "Page Views", + "desc": "User access to the activity page in the App" + } + }, + { + "id": 2, + "zh_name": { + "name": "App安装事件", + "desc": "活动带来的安装量" + }, + "en_name": { + "name": "App Install", + "desc": "About App Installed" + } + }, + { + "id": 3, + "zh_name": { + "name": "App打开事件", + "desc": "活动带来的打开量" + }, + "en_name": { + "name": "App Open", + "desc": "About Opening The App" + } + }, + { + "id": 4, + "zh_name": { + "name": "App安装事件", + "desc": "活动带来的安装量" + }, + "en_name": { + "name": "App Register", + "desc": "About Registering App" + } + }, + { + "id": 5, + "zh_name": { + "name": "玩游戏主按钮", + "desc": "主页上的玩游戏按钮,如:抽奖按钮,摇骰子按钮,开始答题按钮" + }, + "en_name": { + "name": "Game \"Play\" Button", + "desc": "Game buttons on the home page, such as lottery button, dice roll button, answer button" + } + }, + { + "id": 6, + "zh_name": { + "name": "分享链接", + "desc": "用户分享链接给好友操作" + }, + "en_name": { + "name": "Share Link", + "desc": "User sharing activity link" + } + }, + { + "id": 7, + "zh_name": { + "name": "浏览活动下载页", + "desc": "用户去到了活动下载页面" + }, + "en_name": { + "name": "Download Page View", + "desc": "User stays on the download page" + } + }, + { + "id": 8, + "zh_name": { + "name": "点击下载App按钮", + "desc": "用户在下载页中点击了下载按钮" + }, + "en_name": { + "name": "Click Download App", + "desc": "User clicks the Download App button" + } + }, + { + "id": 9, + "zh_name": { + "name": "微信页预览", + "desc": "用户停留在微信页" + }, + "en_name": { + "name": "Wechat Page View", + "desc": "User stays on WeChat page" + } + }, + { + "id": 10, + "zh_name": { + "name": "点击“去完成”任务", + "desc": "用户点击了任务列表中的去完成按钮" + }, + "en_name": { + "name": "Click Do Task", + "desc": "The user clicks the Go to Complete button in the task list" + } + }, + { + "id": 11, + "zh_name": { + "name": "完成任务", + "desc": "用户完成了活动中配置的任务" + }, + "en_name": { + "name": "Completed Task", + "desc": "The user completed the activity task" + } + }, + { + "id": 12, + "zh_name": { + "name": "站外活动页浏览", + "desc": "用户通过站外链接浏览到非App内的活动页" + }, + "en_name": { + "name": "Off-site Page Views", + "desc": "Users browse to activity pages outside the App" + } + }, + { + "id": 13, + "zh_name": { + "name": "站外活动页玩游戏主按钮", + "desc": "站外活动页上的玩游戏按钮,如:抽奖按钮,摇骰子按钮" + }, + "en_name": { + "name": "Off-site \"Play\" Button", + "desc": "Game buttons on off-site activity pages, such as lottery buttons and dice roll buttons" + } + }, + { + "id": 14, + "zh_name": { + "name": "每日签到", + "desc": "用户每天参与活动" + }, + "en_name": { + "name": "Sign In", + "desc": "Users participate in activities every day" + } + }, + { + "id": 15, + "zh_name": { + "name": "道具使用", + "desc": "用户使用道具行为,如:补签卡,幸运骰子" + }, + "en_name": { + "name": "Props Use", + "desc": "User behavior using props, such as: make-up sign-in cards, lucky dice" + } + }, + { + "id": 16, + "zh_name": { + "name": "领养", + "desc": "用户领养树苗、小狗等行为" + }, + "en_name": { + "name": "Adoption", + "desc": "User adoption of saplings, puppies, etc." + } + }, + { + "id": 17, + "zh_name": { + "name": "站外转化到站内", + "desc": "用户通过站外活动引流到站内,触发了留存行为" + }, + "en_name": { + "name": "Off-Site To On-Site", + "desc": "Users are attracted to the site through off-site activities, triggering retention behavior" + } + }, + { + "id": 18, + "zh_name": { + "name": "使用奖品", + "desc": "用户获得奖品后,点击奖品提供的“去使用”按钮" + }, + "en_name": { + "name": "Use Reward", + "desc": "After the user receives the prize, click the \"Go to Use\" button provided by the prize" + } + }, + { + "id": 19, + "zh_name": { + "name": "点击长图", + "desc": "活动中配置的长图被点击行为记录" + }, + "en_name": { + "name": "Click Image", + "desc": "Records of clicks on the long images configured in the activity" + } + }, + { + "id": 20, + "zh_name": { + "name": "完成一次获奖规则", + "desc": "用户获得一次奖励内容,如:获得抽奖机会等" + }, + "en_name": { + "name": "Completed Award Rules", + "desc": "The user gets a reward, such as a chance to win a prize" + } + }, + { + "id": 21, + "zh_name": { + "name": "点击任务挂件", + "desc": "用户点击任务挂件查看任务信息" + }, + "en_name": { + "name": "Click Task Icon", + "desc": "The user clicks on the task widget to view the task information" + } + }, + { + "id": 22, + "zh_name": { + "name": "点击奖励挂件", + "desc": "用户点击我的奖励挂件查看奖品信息" + }, + "en_name": { + "name": "Click Reward Icon", + "desc": "The user clicks on the My Reward widget to view the prize information" + } + }, + { + "id": 23, + "zh_name": { + "name": "点击规则", + "desc": "用户点击规则查询活动规则信息" + }, + "en_name": { + "name": "Click Rule", + "desc": "User clicks on the rule to query the activity rule information" + } + }, + { + "id": 24, + "zh_name": { + "name": "查看表单窗口", + "desc": "用户打开表单奖品的表单窗口" + }, + "en_name": { + "name": "View Form Window", + "desc": "User opens the form window for the form prize" + } + }, + { + "id": 25, + "zh_name": { + "name": "填写表单", + "desc": "用户完成领取奖品的表单填写" + }, + "en_name": { + "name": "Fill Form", + "desc": "The user completes the form to claim the prize" + } + }, + { + "id": 26, + "zh_name": { + "name": "复制联系客服", + "desc": "用户点击复制联系客服按钮" + }, + "en_name": { + "name": "Copy Contact", + "desc": "User clicks the Copy Contact Customer Service button" + } + }, + { + "id": 27, + "zh_name": { + "name": "活动链接点击", + "desc": "浏览器用户对活动链接的点击" + }, + "en_name": { + "name": "Link Click", + "desc": "Browser user clicks on active links" + } + }, + { + "id": 28, + "zh_name": { + "name": "奖品发放", + "desc": "奖品发放数据" + }, + "en_name": { + "name": "Prizes", + "desc": "Prize distribution data" + } + }, + { + "id": 29, + "zh_name": { + "name": "弹窗展示", + "desc": "各种弹窗展示情况,如:奖品弹窗等" + }, + "en_name": { + "name": "Window Show", + "desc": "Various pop-up window displays, such as prize pop-up windows, etc." + } + }, + { + "id": 30, + "zh_name": { + "name": "养成", + "desc": "用户养成树苗、小狗等行为" + }, + "en_name": { + "name": "Pet Grow Maximum", + "desc": "Pets are kept to the maximum limit" + } + }, + { + "id": 31, + "zh_name": { + "name": "回答题目", + "desc": "用户回答的问题记录" + }, + "en_name": { + "name": "Answer The Question", + "desc": "User answered questions" + } + }, + { + "id": 32, + "zh_name": { + "name": "提交答卷", + "desc": "用户回答玩所有问题提交答卷的行为" + }, + "en_name": { + "name": "Submit Answered", + "desc": "The user answers all questions and submits the answer sheet" + } + }, + { + "id": 33, + "zh_name": { + "name": "选择奖品", + "desc": "活动存在多个奖品的情况下,用户对每个奖品的选择情况" + }, + "en_name": { + "name": "Reward Select", + "desc": "When there are multiple prizes in an event, the user's choice of each prize" + } + }, + { + "id": 34, + "zh_name": { + "name": "获得助力", + "desc": "用户在分享链接后获得的助力分析" + }, + "en_name": { + "name": "Support", + "desc": "Analysis of the help users get after sharing the link" + } + }, + { + "id": 35, + "zh_name": { + "name": "活动新人", + "desc": "活动中用户的完成新人任务的分析" + }, + "en_name": { + "name": "Newcomers", + "desc": "Analysis of users completing new user tasks in the activity" + } + }, + { + "id": 36, + "zh_name": { + "name": "用户首次打开web", + "desc": "用户首次打开web活动行为" + }, + "en_name": { + "name": "Web First Open", + "desc": "User's first web browsing activity" + } + }, + { + "id": 37, + "zh_name": { + "name": "点击“立即翻牌”", + "desc": "用户点击“立即翻牌”按钮" + }, + "en_name": { + "name": "Click \"Flip Now\"", + "desc": "User clicks the \"Flip Now\" button" + } + }, + { + "id": 38, + "zh_name": { + "name": "金币投放", + "desc": "用户参与瓜分金币池,点击金币投放按钮,并成功扣除金币动作" + }, + "en_name": { + "name": "Use Coin", + "desc": "The user participates in the activity, clicks the gold coin release button, and successfully deducts the gold coins" + } + }, + { + "id": 39, + "zh_name": { + "name": "领取金币", + "desc": "在金币瓜分活动开奖后,用户进入活动领取金币" + }, + "en_name": { + "name": "Receive Coins", + "desc": "After the event is drawn, users enter the event to receive gold coins" + } + }, + { + "id": 40, + "zh_name": { + "name": "自定义按钮点击", + "desc": "活动中配置的自定义按钮点击" + }, + "en_name": { + "name": "Custom Button Click", + "desc": "Custom button click configured in activity" + } + }, + { + "id": 50, + "zh_name": { + "name": "领取任务奖励", + "desc": "用户领取任务奖励" + }, + "en_name": { + "name": "Receive Task Reward", + "desc": "User receives task rewards" + } + }, + { + "id": 51, + "zh_name": { + "name": "点击分享链接", + "desc": "用户分享出去的链接被点击" + }, + "en_name": { + "name": "Click Share Link", + "desc": "The link shared by the user was clicked" + } + }, + { + "id": 54, + "zh_name": { + "name": "竞猜投票", + "desc": "用户对队伍进行投票" + }, + "en_name": { + "name": "Vote", + "desc": "Users vote for the team" + } + }, + { + "id": 61, + "zh_name": { + "name": "奖品解锁", + "desc": "用户解锁奖品" + }, + "en_name": { + "name": "Unlock Reward", + "desc": "Users unlock rewards" + } + } +] diff --git a/internal/service/provider/fissionaction/z_dimension.json b/internal/service/provider/fissionaction/z_dimension.json new file mode 100644 index 0000000..d17d077 --- /dev/null +++ b/internal/service/provider/fissionaction/z_dimension.json @@ -0,0 +1,288 @@ +[ + { + "key": "platform", + "zh_name": { + "name": "操作系统", + "desc": "用户的操作系统,目前支持:android,ios,web,ipad,other" + }, + "en_name": { + "name": "OS", + "desc": "The user's OS, currently supported: android, ios, web, ipad, other" + } + }, + { + "key": "channel_id", + "zh_name": { + "name": "活动渠道", + "desc": "活动所配置的渠道" + }, + "en_name": { + "name": "Channel", + "desc": "The channel configured for the activity" + } + }, + { + "key": "lang", + "zh_name": { + "name": "用户语言", + "desc": "用户在进入活动时被标记的语言" + }, + "en_name": { + "name": "Language", + "desc": "The language the user was marked as when entering the activity" + } + }, + { + "key": "user_lv", + "zh_name": { + "name": "用户类型", + "desc": "用户在进入活动关联上的活动类型" + }, + "en_name": { + "name": "User Type", + "desc": "The activity type of the user on the entry activity association" + } + }, + { + "key": "country", + "zh_name": { + "name": "用户国家", + "desc": "用户在进入活动关联上的国家" + }, + "en_name": { + "name": "Country", + "desc": "The country associated with the user entering the activity" + } + }, + { + "key": "cond_id", + "zh_name": { + "name": "活动任务", + "desc": "活动所配置需要完成的任务" + }, + "en_name": { + "name": "Task List", + "desc": "The tasks that need to be completed by the activity configuration" + } + }, + { + "key": "media_id", + "zh_name": { + "name": "活动社媒", + "desc": "活动所支持的分享社媒" + }, + "en_name": { + "name": "Media List", + "desc": "Social media supported by the event" + } + }, + { + "key": "reward_id", + "zh_name": { + "name": "活动奖品", + "desc": "活动所配置的奖品" + }, + "en_name": { + "name": "Reward List", + "desc": "Prizes for the event" + } + }, + { + "key": "download_from", + "zh_name": { + "name": "下载来源", + "desc": "下载页或下载按钮的来源" + }, + "en_name": { + "name": "Reward List", + "desc": "Prizes for the event" + } + }, + { + "key": "img_url", + "zh_name": { + "name": "活动长图", + "desc": "活动配置的长图数据" + }, + "en_name": { + "name": "Images List", + "desc": "Long image data of activity configuration" + } + }, + { + "key": "from", + "zh_name": { + "name": "事件来源", + "desc": "同一个事件在不同场景下触发" + }, + "en_name": { + "name": "Event From", + "desc": "The same event triggered in different scenarios" + } + }, + { + "key": "date", + "zh_name": { + "name": "日期", + "desc": "" + }, + "en_name": { + "name": "Date", + "desc": "" + } + }, + { + "key": "lang_gmt", + "zh_name": { + "name": "语言时区", + "desc": "活动支持的语言,并且是指定语言设置的时区的日期" + }, + "en_name": { + "name": "Language With GMT", + "desc": "The languages supported by the event, and the date in the time zone of the specified language settings" + } + }, + { + "key": "qa_id", + "zh_name": { + "name": "回答的题目", + "desc": "题库中对应的题目" + }, + "en_name": { + "name": "Question", + "desc": "Corresponding questions in the question bank" + } + }, + { + "key": "qa_option_id", + "zh_name": { + "name": "题目选项", + "desc": "用户在回答题目时选择的选项" + }, + "en_name": { + "name": "Question Options", + "desc": "The option the user selected when answering the question" + } + }, + { + "key": "qa_point", + "zh_name": { + "name": "答题分数", + "desc": "用户提交答卷时获得的分数" + }, + "en_name": { + "name": "Point", + "desc": "The score obtained when the user submits the answer sheet" + } + }, + { + "key": "reward_type", + "zh_name": { + "name": "奖品分组", + "desc": "奖品基于不同设置方式进行分组" + }, + "en_name": { + "name": "Reward Group", + "desc": "Prizes are grouped based on different settings" + } + }, + { + "key": "from_status", + "zh_name": { + "name": "事件状态", + "desc": "当前事件是在一个具体状态下触发的" + }, + "en_name": { + "name": "Event Status", + "desc": "The current event is triggered in a specific state" + } + }, + { + "key": "scene_id", + "zh_name": { + "name": "开奖场次", + "desc": "一个活动的多次结算场次,如:金币池活动不同日期瓜分一次金币池奖金" + }, + "en_name": { + "name": "Scenes", + "desc": "Multiple settlement sessions for an activity, such as: a gold coin pool activity with gold coin pool bonuses divided on different dates" + } + }, + { + "key": "use_times", + "zh_name": { + "name": "投放次数", + "desc": "用户成功扣道具的数据,如:用户需要使用100金币参与活动,点击参与后成功扣除道具会被记录,重复扣除也会被记录" + }, + "en_name": { + "name": "Use Times", + "desc": "Data on users’ successful item deductions, such as: users need to use 100 gold coins to participate in the event, and after clicking to participate, successful item deductions will be recorded, and repeated deductions will also be recorded" + } + }, + { + "key": "custom_btn_id", + "zh_name": { + "name": "按钮文案", + "desc": "活动创建时配置的按钮文案" + }, + "en_name": { + "name": "Button Text", + "desc": "The button text configured when the activity was created" + } + }, + { + "key": "zone_id", + "zh_name": { + "name": "长图热区", + "desc": "活动长图热区点击数据" + }, + "en_name": { + "name": "Button Text", + "desc": "The button text configured when the activity was created" + } + }, + { + "key": "task_id", + "zh_name": { + "name": "任务", + "desc": "用户完成的任务" + }, + "en_name": { + "name": "Task", + "desc": "User completed tasks" + } + }, + { + "key": "parent_id", + "zh_name": { + "name": "上级用户", + "desc": "关联的上级用户" + }, + "en_name": { + "name": "Inviter", + "desc": "The inviter of the user" + } + }, + { + "key": "schedule_id", + "zh_name": { + "name": "赛程", + "desc": "比赛赛程" + }, + "en_name": { + "name": "Schedule", + "desc": "Match Schedule" + } + }, + { + "key": "win_team_id", + "zh_name": { + "name": "获胜队伍", + "desc": "用户选择的获胜队伍" + }, + "en_name": { + "name": "Winning Team", + "desc": "The winning team selected by the user" + } + } +] diff --git a/internal/service/provider/fissionaction/z_dimension_key.json b/internal/service/provider/fissionaction/z_dimension_key.json new file mode 100644 index 0000000..94cd38e --- /dev/null +++ b/internal/service/provider/fissionaction/z_dimension_key.json @@ -0,0 +1,200 @@ +[ + { + "key": "base", + "zh_name": { + "name": "分享链接进入下载页", + "desc": "用户通过上级用户分享的链接直接来到下载页" + }, + "en_name": { + "name": "Click on the parent link to go to the download page", + "desc": "Users go directly to the download page through the link shared by the parent user" + } + }, + { + "key": "wechat", + "zh_name": { + "name": "从微信页转到下载页", + "desc": "用户通过上级用户分享的链接去到了微信页,再跳过到下载页" + }, + "en_name": { + "name": "Go to the download page from the WeChat page", + "desc": "The user goes to the WeChat page through the link shared by the parent user, and then jumps to the download page" + } + }, + { + "key": "web", + "zh_name": { + "name": "从站外链接转到下载页", + "desc": "用户访问站外链接后跳制下载页" + }, + "en_name": { + "name": "Go to the download page from an external link", + "desc": "After the user visits the external link, the download page will be redirected" + } + }, + { + "key": "play_btn", + "zh_name": { + "name": "主页中的游戏按钮", + "desc": "用户点击进入首页后显示了玩游戏的按钮" + }, + "en_name": { + "name": "Game button on the home page", + "desc": "After the user clicks into the homepage, a button to play games is displayed" + } + }, + { + "key": "again", + "zh_name": { + "name": "再玩一次按钮", + "desc": "用户通过点击再玩一次按钮玩游戏" + }, + "en_name": { + "name": "Play Again Button", + "desc": "The user plays the game by clicking the Play Again button" + } + }, + { + "key": "my_task", + "zh_name": { + "name": "我的任务挂件", + "desc": "活动中的任务挂件" + }, + "en_name": { + "name": "Task Icon", + "desc": "Task widget in activity" + } + }, + { + "key": "home", + "zh_name": { + "name": "首页展示", + "desc": "首页展示" + }, + "en_name": { + "name": "Home page display", + "desc": "Home page display" + } + }, + { + "key": "my_reward", + "zh_name": { + "name": "我的奖励挂件", + "desc": "活动中的奖励挂件" + }, + "en_name": { + "name": "Reward Icon", + "desc": "Reward pendants in activities" + } + }, + { + "key": "window", + "zh_name": { + "name": "奖品弹窗", + "desc": "奖品弹窗" + }, + "en_name": { + "name": "Prize pop-up", + "desc": "Prize pop-up" + } + }, + { + "key": "reward", + "zh_name": { + "name": "奖品弹窗", + "desc": "奖品弹窗" + }, + "en_name": { + "name": "Prize pop-up", + "desc": "Prize pop-up" + } + }, + { + "key": "chance", + "zh_name": { + "name": "再来一次弹窗", + "desc": "再来一次弹窗" + }, + "en_name": { + "name": "Another pop-up", + "desc": "Another pop-up" + } + }, + { + "key": "chance_lack", + "zh_name": { + "name": "抽奖机会不足弹窗", + "desc": "抽奖机会不足弹窗" + }, + "en_name": { + "name": "Insufficient lottery chance pop-up window", + "desc": "Insufficient lottery chance pop-up window" + } + }, + { + "key": "help_install", + "zh_name": { + "name": "安装助力", + "desc": "用户获得的安装助力" + }, + "en_name": { + "name": "IA", + "desc": "The install boost users get" + } + }, + { + "key": "help_register", + "zh_name": { + "name": "注册助力", + "desc": "用户获得的注册助力" + }, + "en_name": { + "name": "RA", + "desc": "The registration boost users receive" + } + }, + { + "key": "help_open", + "zh_name": { + "name": "拉日活助力", + "desc": "用户获得的拉日活助力" + }, + "en_name": { + "name": "DA", + "desc": "The help users get in increasing daily activity" + } + }, + { + "key": "help_click", + "zh_name": { + "name": "点击助力", + "desc": "用户分析的邀请链接被点击产生的助力" + }, + "en_name": { + "name": "CA", + "desc": "User analysis of the help generated by clicks on the invitation link" + } + }, + { + "key": "has_lucky", + "zh_name": { + "name": "有抽奖机会", + "desc": "用户是有抽奖机会的状态下触发了当前事件" + }, + "en_name": { + "name": "Has Chance", + "desc": "The current event is triggered when the user has a chance to win a prize" + } + }, + { + "key": "none_lucky", + "zh_name": { + "name": "没有抽奖机会", + "desc": "用户是没有抽奖机会的状态下触发了当前事件" + }, + "en_name": { + "name": "Has No Chance", + "desc": "The current event is triggered when the user has no chance to win the lottery" + } + } +] diff --git a/internal/service/provider/lang_title.go b/internal/service/provider/lang_title.go new file mode 100644 index 0000000..4ac5a5a --- /dev/null +++ b/internal/service/provider/lang_title.go @@ -0,0 +1,121 @@ +package provider + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "gorm.io/gen" +) + +type LangTitle struct { + logic.Context + + cpn *model.FissionCampaign + userLang string + + lang *model.FissionCampaignLang +} + +// NewLangTitle 奖品发放验证 +func NewLangTitle(ctx context.Context, cpn *model.FissionCampaign, userLang string) (*LangTitle, error) { + lang := &LangTitle{ + cpn: cpn, + userLang: userLang, + } + + lang.BaseInit(ctx, merr.NewBE(ctx)) + + err := lang.setLang() + if err != nil { + return nil, err + } + + return lang, nil +} + +// GetCondTitle 获取任务名称文案 +func (s *LangTitle) GetCondTitle(condIds ...int64) (data map[int64]string, err error) { + data = make(map[int64]string) + l := len(condIds) + + if s.lang != nil { + var idMap = make(map[int64]struct{}, l) + for _, id := range condIds { + idMap[id] = struct{}{} + } + + for _, cond := range s.lang.GetConds() { + if _, ok := idMap[cond.CondId]; !ok && l > 0 { + continue + } + data[cond.CondId] = cond.Desc + } + + return + } + + m := s.GetDao().FissionCampaignCond + var conds []gen.Condition + if l > 0 { + conds = append(conds, m.ID.In(condIds...)) + } else { + conds = append(conds, m.CampaignID.Eq(s.cpn.ID), m.WithContext(s.Ctx). + Or(m.IsDel.Eq(mtype.No)). + Or(m.IsDel.Eq(mtype.Yes), m.DelUse.Eq(mtype.Yes))) + } + + list, err := m.WithContext(s.Ctx).Where(conds...).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, cond := range list { + data[cond.ID] = cond.Desc + } + + return +} + +// GetPageTitle 获取页面标题 +func (s *LangTitle) GetPageTitle() (string, error) { + if s.lang != nil { + return s.lang.PageTitle, nil + } + + style, err := cache.NewCampaignStyle(s.Ctx).FindByCampaignId(s.cpn.ID) + if err != nil { + return "", s.BE().CacheError(err) + } + + if style != nil { + return style.PageTitle, nil + } + + oldConf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(s.cpn.ID) + if err != nil { + return "", s.BE().CacheError(err) + } + + if oldConf != nil { + return oldConf.PageTitle, nil + } + + return "", s.BE().VerifyError("not found data") +} + +func (s *LangTitle) setLang() (err error) { + if s.userLang == s.cpn.GetLangMarks()[0] { + return + } + + s.lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(s.cpn.ID, s.userLang) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} diff --git a/internal/service/provider/malls/mall.go b/internal/service/provider/malls/mall.go new file mode 100644 index 0000000..4ce56d0 --- /dev/null +++ b/internal/service/provider/malls/mall.go @@ -0,0 +1,175 @@ +package malls + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + stos "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + "fmt" +) + +type Mall struct { + logic.Context + + mall *model.RedeemMall +} + +func NewMall(ctx context.Context, mallId int64, opts ...logic.CtxOption) (item *Mall, err error) { + item = new(Mall) + { + item.BaseInit(ctx, merr.NewBE(ctx), opts...) + } + + item.mall, err = cache.NewRedeemMall(ctx).FindById(mallId) + if err != nil { + return nil, err + } + + if item.mall == nil { + return nil, workerr.NotFound("not found mall") + } + + return +} + +func (s *Mall) GetMall() *model.RedeemMall { + return s.mall +} + +func (s *Mall) UpItems() (list []*model.RedeemMallItem, err error) { + m := s.GetDao().RedeemMallItem + + dbList, err := m.WithContext(s.Ctx).Where( + m.MallID.Eq(s.mall.ID), + m.DownAt.Eq(mtype.No), + m.IsDel.Eq(mtype.No), + ).Order(m.Sort.Desc(), m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, item := range dbList { + if verify.InArray[int32](item.GetStatus(), mtype.RedeemMallItemStatusUp, mtype.RedeemMallItemStatusWait) { + list = append(list, item) + } + } + + return +} + +func (s *Mall) DownItems() (list []*model.RedeemMallItem, err error) { + m := s.GetDao().RedeemMallItem + + list, err = m.WithContext(s.Ctx).Where( + m.MallID.Eq(s.mall.ID), + m.DownAt.Gt(mtype.No), + m.IsDel.Eq(mtype.No), + ).Order(m.DownAt.Desc(), m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Mall) Exchange(item *model.RedeemMallItem, source string, firstId, secondId, relateId int64, pushParam mtype.RewardPushParam) (record *model.RedeemMallRecord, info provider.RewardAutoLang, err error) { + reward, record, info, err := s.ExchangeRecord(item, pushParam.Lang) + if err != nil { + return + } + + if record.Status == mtype.RedeemMallRecordStatusOk { + return + } + + rp, err := stos.NewReward(s.Ctx, reward) + if err != nil { + return + } + + pushParam.RelateHashId = fmt.Sprintf("%d", record.ID) + pushParam.RewardId = fmt.Sprintf("%d", record.ID) + + push, err := rp.CreatePush( + source, + firstId, + secondId, + relateId, + mtype.Yes, + pushParam, + ) + + if err != nil || push == nil { + return + } + + push, err = rp.Send(push, true) + if err != nil || push == nil { + return + } + + if push.Status == mtype.RewardPushStatusFail { + record.Status = mtype.RedeemMallRecordStatusFail + record.FailType = push.FailType + record.FailMsg = push.FailMsg + } else { + record.Status = mtype.RedeemMallRecordStatusOk + record.CustomRewardVal = push.RespData + } + + if err = s.GetDao().RedeemMallRecord.WithContext(s.Ctx).Save(record); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Mall) ExchangeRecord(item *model.RedeemMallItem, langMark string) (reward *model.Reward, record *model.RedeemMallRecord, info provider.RewardAutoLang, err error) { + reward, err = cache.NewReward(s.Ctx).FindById(item.RewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + pewards, err := provider.NewRewards(s.Ctx, s.mall.ProjectID, item.RewardID) + if err != nil { + return + } + + info, err = pewards.InfoAutoLang(item.RewardID, langMark) + if err != nil { + return + } + + record = withdefault.RedeemMallRecord(&model.RedeemMallRecord{ + MallID: item.MallID, + MallItemID: item.ID, + CoinNum: int64(item.CoinNum), + Status: mtype.RedeemMallRecordStatusWait, + FailType: "", + FailMsg: "", + RewardID: item.RewardID, + CustomRewardVal: "", + }) + + if reward.ReceiveType != mtype.RewardReceiveTypeNotify { + record.Status = mtype.RedeemMallRecordStatusOk + } + + if err = s.GetDao().RedeemMallRecord.WithContext(s.Ctx).Create(record); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/provider/malls/relate.go b/internal/service/provider/malls/relate.go new file mode 100644 index 0000000..60e1d66 --- /dev/null +++ b/internal/service/provider/malls/relate.go @@ -0,0 +1,147 @@ +package malls + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "time" +) + +type Relate struct { + logic.Context + + relateId int64 + relateTable string + + list []*model.RedeemMallRelate +} + +func NewRelate(ctx context.Context, relateId int64, relateTable string, opts ...logic.CtxOption) (relate *Relate, err error) { + relate = new(Relate) + { + relate.BaseInit(ctx, merr.NewBE(ctx), opts...) + } + + err = relate._init(relateId, relateTable) + if err != nil { + return nil, err + } + + relate.relateId = relateId + relate.relateTable = relateTable + + return +} + +func (s *Relate) _init(relateId int64, relateTable string) (err error) { + m := s.GetDao().RedeemMallRelate + s.list, err = m.WithContext(s.Ctx).Where(m.RelateID.Eq(relateId), m.RelateTable.Eq(relateTable)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Relate) Related(source int8, mallIds ...int64) (err error) { + m := s.GetDao().RedeemMallRelate + + var checkMallMap = make(map[int64]struct{}) + var oldMap = make(map[int64]*model.RedeemMallRelate) + for _, v := range s.list { + oldMap[v.MallID] = v + checkMallMap[v.MallID] = struct{}{} + } + + var reRelate []int64 + var relates []*model.RedeemMallRelate + for _, id := range mallIds { + checkMallMap[id] = struct{}{} + + old, ok := oldMap[id] + if !ok { + relates = append(relates, withdefault.RedeemMallRelate(&model.RedeemMallRelate{ + MallID: id, + Source: source, + RelateID: s.relateId, + RelateTable: s.relateTable, + })) + continue + } + + delete(oldMap, old.MallID) + + if old.CancelTime == 0 { + continue + } + + reRelate = append(reRelate, old.ID) + } + + if len(relates) > 0 { + if err = m.WithContext(s.Ctx).Create(relates...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(reRelate) > 0 { + idGroup := utils.Groups[int64](reRelate, 200) + for _, ids := range idGroup { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(ids...)).UpdateSimple(m.CancelTime.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + var cancelIds []int64 + for _, related := range oldMap { + cancelIds = append(cancelIds, related.ID) + } + + if len(cancelIds) > 0 { + idGroup := utils.Groups[int64](cancelIds, 200) + for _, ids := range idGroup { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(ids...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + cc := cache.NewRedeemMall(s.Ctx) + mallM := s.GetDao().RedeemMall + for mallId := range checkMallMap { + mall, _ := cc.FindById(mallId) + if mall == nil { + continue + } + + var status int8 + count, _ := m.WithContext(s.Ctx).Where(m.MallID.Eq(mallId), m.CancelTime.Eq(mtype.No)).Count() + if count > 0 { + status = mtype.RedeemMallStatusUsed + } else { + status = mtype.RedeemMallStatusWait + } + + _, err = mallM.WithContext(s.Ctx).Where(mallM.ID.Eq(mall.ID)).UpdateSimple(mallM.Status.Value(status)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(mall) + } + + return +} diff --git a/internal/service/provider/operatelog/operate_log.go b/internal/service/provider/operatelog/operate_log.go new file mode 100644 index 0000000..8582267 --- /dev/null +++ b/internal/service/provider/operatelog/operate_log.go @@ -0,0 +1,181 @@ +package operatelog + +import ( + "context" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "fmt" +) + +type OperateLog struct { + ctx context.Context + userId int64 + ip string + batch bool + logs []*model.OperateLog +} + +func NewOperateLog(ctx context.Context, opts ...Option) *OperateLog { + bp := &OperateLog{ + ctx: ctx, + } + + for _, opt := range opts { + opt(bp) + } + + return bp +} + +// InDB 入库 +func (s *OperateLog) InDB() { + s.inDB(s.logs...) +} + +func (s *OperateLog) append(mark, markId string, data map[string]any) { + one := withdefault.OperateLog(&model.OperateLog{ + UserID: s.userId, + Mark: mark, + MarkID: markId, + Data: "", + IP: s.ip, + }) + + one.Data, _ = jsonm.MarshalToString(data) + + if s.batch { + s.logs = append(s.logs, one) + return + } + s.inDB(one) +} + +func (s *OperateLog) inDB(logs ...*model.OperateLog) { + if len(logs) == 0 { + return + } + _ = dao.Q.OperateLog.WithContext(s.ctx).Create(logs...) +} + +type User struct { + *OperateLog +} + +func (s *OperateLog) User(userId int64, ip string) User { + s.userId = userId + s.ip = ip + return User{OperateLog: s} +} + +func (s User) UpdateRunningDiceInit(diceConfId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningDiceInit, fmt.Sprint(diceConfId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningDiceDay(diceConfId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningDiceDay, fmt.Sprint(diceConfId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningOdds(rewardId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningOdds, fmt.Sprint(rewardId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningStock(rewardId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningStock, fmt.Sprint(rewardId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningCashStock(cashConfId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningCashStock, fmt.Sprint(cashConfId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningRewardRule(rewardId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningRewardRule, fmt.Sprint(rewardId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateCampaignAdsType(campaignId int64, before, after int8) { + s.append(mtype.OperateLogMarkUpdateCampaignAdsType, fmt.Sprint(campaignId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) ProjectAds(projectId int64, before, after int8) { + s.append(mtype.OperateLogMarkProjectAds, fmt.Sprint(projectId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) ProjectCpnAds(projectId int64, before, after int8) { + s.append(mtype.OperateLogMarkProjectCpnAds, fmt.Sprint(projectId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) TaskLimitRule(taskId int64, kvs []string) { + l := len(kvs) + if l == 0 { + return + } + var data = make(map[string]any, l/2) + for i := 0; i < l; i += 2 { + data[kvs[i]] = kvs[i+1] + } + + s.append(mtype.OperateLogMarkTaskLimitRule, fmt.Sprint(taskId), data) +} + +func (s User) UpdateRunningTriggetType(condId int64, before int8, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningTriggetType, fmt.Sprint(condId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningAdsStrategy(condId int64, before, after string) { + s.append(mtype.OperateLogMarkUpdateRunningAdsStrategy, fmt.Sprint(condId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) UpdateRunningInitPercent(rewardId int64, before, after float64) { + s.append(mtype.OperateLogMarkUpdateRunningInitPercent, fmt.Sprint(rewardId), map[string]any{ + "before": before, + "after": after, + }) +} + +func (s User) CampaignSave(campaignId int64, data any) { + s.append(mtype.OperateLogMarkCampaignSave, fmt.Sprint(campaignId), map[string]any{ + "after": data, + }) +} + +func (s User) UpdateRunningGoldStock(goldConfId int64, before, after int32) { + s.append(mtype.OperateLogMarkUpdateRunningGoldStock, fmt.Sprint(goldConfId), map[string]any{ + "before": before, + "after": after, + }) +} diff --git a/internal/service/provider/operatelog/option.go b/internal/service/provider/operatelog/option.go new file mode 100644 index 0000000..5e3604e --- /dev/null +++ b/internal/service/provider/operatelog/option.go @@ -0,0 +1,9 @@ +package operatelog + +type Option func(bp *OperateLog) + +func SetBatch() Option { + return func(ol *OperateLog) { + ol.batch = true + } +} diff --git a/internal/service/provider/players/ballot.go b/internal/service/provider/players/ballot.go new file mode 100644 index 0000000..5944a35 --- /dev/null +++ b/internal/service/provider/players/ballot.go @@ -0,0 +1,292 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + + "gits.branchcn.com/backend/joybuywork/proto/go_proto/workerr" +) + +// Ballot 幸运上上签交互逻辑 +type Ballot struct { + Player + player *model.FissionBallot + conf *model.FissionCampaignBallot + + fissionPlayerSetInitOnceKey string +} + +func NewBallot(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Ballot, err error) { + player = &Ballot{} + + err = player.Init(ctx, user, consts.IdBallot, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Ballot) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(s.user) + if err != nil { + return + } + + var rewardMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rewards { + rewardMap[v.ID] = v + } + + for _, v := range rewardMap { + reward = v + break + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionBallot + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionBallotLog(&model.FissionBallotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BallotID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Ballot) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionBallot + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionBallotLog(&model.FissionBallotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BallotID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// SetInit 获得初始次数 +func (s *Ballot) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionBallot + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionBallotLog(&model.FissionBallotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BallotID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Ballot) GetConf() *model.FissionCampaignBallot { + if s.conf == nil { + s.conf, _ = cache.NewCampaignBallot(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Ballot) GetPlayer() *model.FissionBallot { + return s.player +} + +// 玩家 +func (s *Ballot) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Ballot) firstOrCreate() (player *model.FissionBallot, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Ballot) _dbFirst() (*model.FissionBallot, error) { + playerM := dao.FissionBallot + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Ballot) createPlayer() (player *model.FissionBallot, err error) { + playerM := dao.FissionBallot + player = withdefault.FissionBallot(&model.FissionBallot{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Ballot) _addLog(logs ...*model.FissionBallotLog) (err error) { + err = s.GetDao().FissionBallotLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/players/blind.go b/internal/service/provider/players/blind.go new file mode 100644 index 0000000..f96600a --- /dev/null +++ b/internal/service/provider/players/blind.go @@ -0,0 +1,370 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/proto/go_proto/workerr" +) + +// Blind 盲盒交互逻辑 +type Blind struct { + Player + player *model.FissionBlind + conf *model.FissionCampaignBlind + + fissionPlayerSetInitOnceKey string +} + +func NewBlind(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Blind, err error) { + player = &Blind{} + + err = player.Init(ctx, user, consts.IdBlindBox, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Blind) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionBlind + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionBlindLog(&model.FissionBlindLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BlindID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Blind) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Blind) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Blind) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionBlindLog + for _, task := range tasks { + + next, t, source, lotteryVal := s._lotteryTask(checkManual, task) + if next { + continue + } + + val, _ := jsonm.MarshalToString(lotteryVal) + log := withdefault.FissionBlindLog(&model.FissionBlindLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BlindID: player.ID, + Type: t, + Source: source, + Val: val, + }) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionBlind + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Blind) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + // 抽奖 + reward, err = s._lottery() + if err != nil { + return + } + + if s.IsView() { + preward, _ := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + info, _ = preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + return + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionBlind + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionBlindLog(&model.FissionBlindLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BlindID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Blind) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionBlind + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionBlindLog(&model.FissionBlindLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + BlindID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Blind) GetConf() *model.FissionCampaignBlind { + if s.conf == nil { + s.conf, _ = cache.NewCampaignBlind(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Blind) GetPlayer() *model.FissionBlind { + return s.player +} + +// 玩家 +func (s *Blind) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Blind) firstOrCreate() (player *model.FissionBlind, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Blind) _dbFirst() (*model.FissionBlind, error) { + playerM := dao.FissionBlind + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Blind) createPlayer() (player *model.FissionBlind, err error) { + playerM := dao.FissionBlind + player = withdefault.FissionBlind(&model.FissionBlind{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Blind) _addLog(logs ...*model.FissionBlindLog) (err error) { + if len(logs) == 0 { + return + } + err = s.GetDao().FissionBlindLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/players/cash.go b/internal/service/provider/players/cash.go new file mode 100644 index 0000000..db459fa --- /dev/null +++ b/internal/service/provider/players/cash.go @@ -0,0 +1,742 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/proto/go_proto/workerr" + "math/rand" + "time" + + "github.com/golang-module/carbon/v2" + "gorm.io/datatypes" + "gorm.io/gen" + "gorm.io/gen/field" +) + +const ( + cashFailTypeEnergyLack = iota + 1 // 能量不足 + cashFailTypeRewardLack // 奖品库存不足 +) + +// Cash 现金转盘交互逻辑 +type Cash struct { + Player + player *model.FissionCash + conf *model.FissionCampaignCash + blindLang string + cashPercentKey string + cashAgainKey string +} + +func NewCash(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Cash, err error) { + player = &Cash{} + + err = player.Init(ctx, user, consts.IdCash, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// EffectInvite 有效邀请追加进度 +func (s *Cash) EffectInvite(helperId int64, add float64) (err error) { + player := s.GetPlayer() + + // 一定要触发需要邀请进来的才算 + if player.LotteryNum < 5 { + return + } + + percent, err := s._addPercent(player.ID, add) + if err != nil { + return + } + + inviteData, _ := jsonm.MarshalToString(mtype.RecordTypeInvite{ + UserId: helperId, + Help: true, + }) + + // 更新成有效助力 + m := s.GetDao().FissionCashRecord + _, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(player.CampaignID), + m.UserID.Eq(player.UserID), + m.CashID.Eq(player.ID), + m.Type.Eq(mtype.FissionCashRecordTypeInvite), + ).Where(gen.Cond( + datatypes.JSONQuery(m.Data.ColumnName().String()).Equals(helperId, "user_id"), + )...).UpdateSimple(m.Data.Value(inviteData)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + energyData, _ := jsonm.MarshalToString(mtype.RecordTypeEnergy{ + TitleMark: "record:share_reward", + DecOrAdd: mtype.FissionCashRecordDataAdd, + Energy: add, + }) + + err = s._addRecord(withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeEnergy, + Data: energyData, + })) + + if err != nil || percent < 1 { + return + } + + // 进度条满了 + playerM := s.GetDao().FissionCash + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Energy.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = app.Redis.Cache.IncrByFloat(s.Ctx, s.cashPercentKey, -1).Err() + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +// InviteOne 邀请一个人 +func (s *Cash) InviteOne(helperId int64) (err error) { + player := s.GetPlayer() + + // 一定要触发需要邀请进来的才算 + if player.LotteryNum < 5 { + return + } + + inviteData, _ := jsonm.MarshalToString(mtype.RecordTypeInvite{ + UserId: helperId, + Help: false, + }) + + return s._addRecord(withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeInvite, + Data: inviteData, + })) +} + +// Spin 转转盘 +func (s *Cash) Spin() (id int64, failType int32, err error) { + cpn, user := s.cpn, s.user + player, conf := s.GetPlayer(), s.GetConf() + + if player.Energy < consts.FissionCashFixEnergyUse { + failType = cashFailTypeEnergyLack + return + } + + energyData, _ := jsonm.MarshalToString(mtype.RecordTypeEnergy{ + TitleMark: "record:spin_reward", + DecOrAdd: mtype.FissionCashRecordDataDec, + Energy: consts.FissionCashFixEnergyUse, + }) + + var records = []*model.FissionCashRecord{ + withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeEnergy, + Data: energyData, + }), + } + defer func() { + if err != nil { + return + } + err = s._addRecord(records...) + }() + + id = consts.SpinGetId[int(player.LotteryNum)] + var price float64 + for _, v := range consts.FissionCashSpin { + if id == v.Id { + price = v.Cash + } + } + + cashData, _ := jsonm.MarshalToString(mtype.RecordTypeCash{ + TitleMark: "record:spin_reward", + DecOrAdd: mtype.FissionCashRecordDataAdd, + Cash: price, + }) + + records = append(records, withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeCash, + Data: cashData, + })) + + m := s.GetDao().FissionCash + var upData = []field.AssignExpr{ + m.ShowPrice.Add(price), + m.Energy.Sub(consts.FissionCashFixEnergyUse), + m.LotteryNum.Add(1), + } + + switch player.LotteryNum + 1 { + case 4: + upData = append(upData, m.NextStep.Value(mtype.FissionCashNextStepTriggerShare)) + case 5: + upData = append(upData, m.NextStep.Value(mtype.FissionCashNextStepLastSpin)) + case 6: + + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + if conf.PriceNum > 0 { + if conf.Lack == mtype.Yes { + failType = cashFailTypeRewardLack + return + } + + var ok bool + ok, err = stock.DecrPoolAndAdd(cpn.ID, 1) + if err != nil { + return + } + + if !ok { + if conf.Lack == mtype.No { + confM := s.GetDao().FissionCampaignCash + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(confM.Lack.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewCampaignCash(s.Ctx).Clear(conf) + } + + failType = cashFailTypeRewardLack + return + } + } else { + err = stock.AddUseStock(1) + if err != nil { + return + } + } + + upData = append(upData, m.NextStep.Value(mtype.FissionCashNextStepShowReward)) + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + var rewards []*model.FissionCampaignReward + rewards, err = cm.UserAppReward(s.user) + if err != nil { + return + } + + var addRewards = make([]*award.RewardOne, 0, len(rewards)) + var ids []int64 + for _, reward := range rewards { + addRewards = append(addRewards, &award.RewardOne{Reward: reward}) + } + + var rewardsRes []*award.RewardRes + rewardsRes, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).Batch(addRewards, true) + if err != nil { + return + } + + for _, reward := range rewardsRes { + ids = append(ids, reward.Record.ID) + } + + data, _ := jsonm.MarshalToString(mtype.RecordTypeReward{ + Ids: ids, + }) + + records = append(records, withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeReward, + Data: data, + })) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// LastSpin 弹窗还差最后一次抽奖获得奖品动画 +func (s *Cash) LastSpin() (err error) { + player := s.player + if player.NextStep != mtype.FissionCashNextStepLastSpin { + return + } + m := s.GetDao().FissionCash + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.NextStep.Value(mtype.FissionCashNextStepInviteSpin), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// ShowReward 播放展示奖品动画 +func (s *Cash) ShowReward() (err error) { + player := s.player + if player.NextStep != mtype.FissionCashNextStepShowReward { + return + } + + m := s.GetDao().FissionCash + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.NextStep.Value(mtype.FissionCashNextStepNone), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// TriggerShare 播放触发了分享动画 +func (s *Cash) TriggerShare() (err error) { + player := s.player + if player.NextStep != mtype.FissionCashNextStepTriggerShare { + return + } + + m := s.GetDao().FissionCash + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.ShowPrice.Add(consts.FissionCashFixShare), + m.Energy.Add(consts.FissionCashFixEnergyUse), + m.NextStep.Value(mtype.FissionCashNextStepNone), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cashRecordData, _ := jsonm.MarshalToString(mtype.RecordTypeCash{ + TitleMark: "record:share_reward", + DecOrAdd: "add", + Cash: consts.FissionCashFixShare, + }) + + energyRecordData, _ := jsonm.MarshalToString(mtype.RecordTypeEnergy{ + TitleMark: "record:share_reward", + DecOrAdd: "add", + Energy: consts.FissionCashFixEnergyUse, + }) + + err = s._addRecord(withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeCash, + Data: cashRecordData, + }), withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeEnergy, + Data: energyRecordData, + })) + if err != nil { + return + } + + return +} + +// OpenGift 播放开盒子动画 +func (s *Cash) OpenGift() (openBox, leftBox, rightBox int32, err error) { + player, cpn, conf := s.GetPlayer(), s.cpn, s.GetConf() + + if player.NextStep != mtype.FissionCashNextStepOpenGift { + return + } + + spl := cpn.GetLangMarks() + var price = conf.Price + if player.Lang != spl[0] { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, player.Lang) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + err = workerr.NotFound("not found cash conf") + return + } + + if c := lang.GetCash(); c != nil { + price = c.Price + } + } + + openBox, leftBox, rightBox = s._boxVal(price) + + m := s.GetDao().FissionCash + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.ShowPrice.Value(float64(openBox)), + m.Energy.Value(consts.FissionCashFixEnergy), + m.NextStep.Value(mtype.FissionCashNextStepNone), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cashRecordData, _ := jsonm.MarshalToString(mtype.RecordTypeCash{ + TitleMark: "record:start_reward", + DecOrAdd: mtype.FissionCashRecordDataAdd, + Cash: float64(openBox), + }) + + energyRecordData, _ := jsonm.MarshalToString(mtype.RecordTypeEnergy{ + TitleMark: "record:start_reward", + DecOrAdd: mtype.FissionCashRecordDataAdd, + Energy: consts.FissionCashFixEnergy, + }) + + err = s._addRecord(withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeCash, + Data: cashRecordData, + }), withdefault.FissionCashRecord(&model.FissionCashRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CashID: player.ID, + Type: mtype.FissionCashRecordTypeEnergy, + Data: energyRecordData, + })) + + if err != nil { + return + } + + return +} + +// Again 再玩一次 +func (s *Cash) Again() (err error) { + if !app.NewRedisLock(s.Ctx, s.cashAgainKey).SoftLock() { + return workerr.OnceLockError + } + + hasAgain, err := s.HasAgain() + if err != nil || !hasAgain { + return + } + + _, err = s.createPlayer(s.user.LangMark) + return +} + +// HasAgain 是否有再玩一次 +func (s *Cash) HasAgain() (ok bool, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if conf.LoopNum == 1 || player.LotteryNum < 6 { + return + } + + if conf.LoopNum == 0 { + return true, nil + } + + rewardNum, err := s._rewardNum() + if err != nil { + return + } + + if rewardNum >= int64(conf.LoopNum) { + return + } + + return true, nil +} + +// RefreshView 刷新预览用户 +func (s *Cash) RefreshView() (err error) { + if !s.IsView() { + err = s.BE().VerifyError("非预览用户无法重新体验") + return + } + + player := s.GetPlayer() + + m := s.GetDao().FissionCashRecord + _, err = m.WithContext(s.Ctx).Where(m.CashID.Eq(player.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + app.Redis.Cache.Del(s.Ctx, s.cashPercentKey) + + playerM := s.GetDao().FissionCash + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// GetConf 获取玩法配置 +func (s *Cash) GetConf() *model.FissionCampaignCash { + if s.conf == nil { + s.conf, _ = cache.NewCampaignCash(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Cash) GetPlayer() *model.FissionCash { + return s.player +} + +// 玩家 +func (s *Cash) initPlayer() (err error) { + user, sp := s.user, s.cpn.GetLangMarks() + + lang := utils.NotExistGetFirst(user.LangMark, sp) + s.blindLang = lang + + player, err := s._dbFirst(lang) + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.cashPercentKey = ckey.FissionUserCashPercent(player.ID) + s.cashAgainKey = ckey.FissionUserCashAgain(player.UserID) + }() + + if player != nil { + // 没有过期,或者已经完成了任务 + if player.ExpiredIn > time.Now().Unix() || player.LotteryNum >= int8(len(consts.SpinGetId)) { + + return + } + + // 过期了 + playerM := s.GetDao().FissionCash + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.IsExpired.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + player, err = s.firstOrCreate(lang) + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Cash) firstOrCreate(lang string) (player *model.FissionCash, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst(lang) + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer(lang) +} + +func (s *Cash) createPlayer(lang string) (player *model.FissionCash, err error) { + conf := s.GetConf() + + playerM := dao.FissionCash + player = withdefault.FissionCash(&model.FissionCash{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + LotteryNum: 0, + NextStep: mtype.FissionCashNextStepOpenGift, + Energy: 0, + ShowPrice: 0, + ExpiredIn: carbon.Now().AddDays(int(conf.ExpiredDay)).Timestamp(), + IsExpired: 0, + Lang: lang, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Cash) _dbFirst(lang string) (*model.FissionCash, error) { + playerM := dao.FissionCash + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID), playerM.Lang.Value(lang), playerM.IsExpired.Eq(mtype.No)).Last() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +func (s *Cash) _addRecord(records ...*model.FissionCashRecord) (err error) { + err = s.GetDao().FissionCashRecord.WithContext(s.Ctx).Create(records...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 追加进度 +func (s *Cash) _addPercent(playerId int64, onePercent float64) (percent float64, err error) { + key := s.cashPercentKey + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if exist { + return + } + + m := s.GetDao().FissionCashRecord + efNum, err := m.WithContext(s.Ctx).Where( + m.CashID.Eq(playerId), + m.Type.Eq(mtype.FissionCashRecordTypeInvite), + ).Where(gen.Cond( + datatypes.JSONQuery(m.Data.ColumnName().String()).Equals(true, "help"), + )...).Count() + if err != nil { + return + } + + // 重新设置进度 + p := float64(efNum) * onePercent + for p > 1 { + p -= 1 + } + + err = app.Redis.Cache.IncrByFloat(s.Ctx, key, p).Err() + if err != nil { + return + } + + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + app.Redis.Cache.Expire(s.Ctx, key, consts.TimeDay) + percent, err = app.Redis.Cache.IncrByFloat(s.Ctx, key, onePercent).Result() + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *Cash) _boxVal(price int32) (openBox, leftBox, rightBox int32) { + openBox = price - consts.FissionCashFixLeft + + if price <= 30 { + leftBox = openBox - 1 + rightBox = openBox - 2 + return + } + + if price <= 50 { + leftBox = openBox - (rand.Int31n(5) + 15) + rightBox = openBox - (rand.Int31n(5) + 10) + return + } + + leftBox = openBox - (rand.Int31n(10) + 15) + rightBox = openBox - (rand.Int31n(10) + 10) + + return +} + +func (s *Cash) _rewardNum() (count int64, err error) { + player := s.GetPlayer() + m := s.GetDao().FissionCashRecord + count, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(player.CampaignID), + m.UserID.Eq(player.UserID), + m.Type.Eq(mtype.FissionCashRecordTypeReward), + ).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/provider/players/chop.go b/internal/service/provider/players/chop.go new file mode 100644 index 0000000..3d20948 --- /dev/null +++ b/internal/service/provider/players/chop.go @@ -0,0 +1,968 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen" +) + +const ( + chopHelpOk = iota + chopHelpLimit + chopHelpDone +) + +type helperInfo struct { + ipAddress string // ip + os string // 系统 + osVersion string // 系统版本 + deviceModel string // 设备类型 + webId string // 浏览器id + deviceID string // 设备号 + actionTime int64 // 助力时间 + helper *model.FissionUser // 用户数据 +} + +// Chop 现金转盘交互逻辑 +type Chop struct { + Player + player *model.FissionChop + conf *model.FissionCampaignChop + + chopHelpUserKey string + chopHelpUserRewardKey string + + canSelectReward int32 + oldPercent float64 +} + +func NewChop(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Chop, err error) { + player = &Chop{} + + err = player.Init(ctx, user, consts.IdChop, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// HelpClue 助力提醒 +func (s *Chop) HelpClue() (isFix bool, old, add float64) { + player := s.GetPlayer() + help := provider.NewFissionClue(s.Ctx, player.UserID).GetChopHelp() + + if help.ChopRewardId != player.ChopRewardID { + return + } + + isFix = help.IsFix + old = help.OldPercent + add = help.AddPercent + + return +} + +// RegisterHelp 注册助力 +func (s *Chop) RegisterHelp(actionTime int64, helper *model.FissionUser) (helpOk bool, err error) { + player := s.GetPlayer() + if player.ChopRewardID == 0 { + return + } + + conf, userMark, helpMark := s.GetConf(), fmt.Sprint(helper.ID), mtype.FissionCampaignTicketHelpEventRegister + + var canHelp bool + switch conf.HelpRule { + case mtype.FissionCampaignChopHelpRuleUniqReward: + canHelp, err = s.rewardCanHelp(helpMark, userMark) + if err != nil { + return + } + case mtype.FissionCampaignChopHelpRuleUniqUser: + canHelp, err = s.userCanHelp(helpMark, userMark) + if err != nil { + return + } + } + + // 无需助力 + if !canHelp { + return + } + + // 任务数据 + chopReward, task, err := s.getTask(mtype.FissionCampaignTaskTypeRegister) + if err != nil || task == nil { + return + } + + // 助力处理 + status, err := s._doHelp(chopReward, task, helpMark, userMark) + if err != nil || status != chopHelpOk { + return + } + + info := &helperInfo{ + actionTime: actionTime, + helper: helper, + } + + err = s.helpOkNotify(info, chopReward, helpMark, task.Percent, types.HelpSourceRegister) + if err != nil { + return + } + + return true, nil +} + +// InstallHelp 安装助力 +func (s *Chop) InstallHelp(actionTime int64, helper *model.FissionUser) (helpOk bool, err error) { + player := s.GetPlayer() + if player.ChopRewardID == 0 { + return + } + + conf, userMark, helpMark := s.GetConf(), fmt.Sprint(helper.ID), mtype.FissionCampaignTicketHelpEventInstall + + var canHelp bool + switch conf.HelpRule { + case mtype.FissionCampaignChopHelpRuleUniqReward: + canHelp, err = s.rewardCanHelp(helpMark, userMark) + if err != nil { + return + } + case mtype.FissionCampaignChopHelpRuleUniqUser: + canHelp, err = s.userCanHelp(helpMark, userMark) + if err != nil { + return + } + } + + // 无需助力 + if !canHelp { + return + } + + // 任务数据 + chopReward, task, err := s.getTask(mtype.FissionCampaignTaskTypeInstall) + if err != nil || task == nil { + return + } + + // 助力处理 + status, err := s._doHelp(chopReward, task, helpMark, userMark) + if err != nil || status != chopHelpOk { + return + } + + info := &helperInfo{ + actionTime: actionTime, + helper: helper, + } + err = s.helpOkNotify(info, chopReward, helpMark, task.Percent, types.HelpSourceInstall) + if err != nil { + return + } + + return true, nil +} + +// OpenHelp 打开助力 +func (s *Chop) OpenHelp(actionTime int64, helper *model.FissionUser) (helpOk bool, err error) { + player := s.GetPlayer() + if player.ChopRewardID == 0 { + return + } + + conf, userMark, helpMark := s.GetConf(), fmt.Sprint(helper.ID), mtype.FissionCampaignTicketHelpEventOpen + + var canHelp bool + switch conf.HelpRule { + case mtype.FissionCampaignChopHelpRuleUniqReward: + canHelp, err = s.rewardCanHelp(helpMark, userMark) + if err != nil { + return + } + case mtype.FissionCampaignChopHelpRuleUniqUser: + canHelp, err = s.userCanHelp(helpMark, userMark) + if err != nil { + return + } + } + + // 无需助力 + if !canHelp { + return + } + + // 任务数据 + chopReward, task, err := s.getTask(mtype.FissionCampaignTaskTypeOpen) + if err != nil || task == nil { + return + } + + // 助力处理 + status, err := s._doHelp(chopReward, task, helpMark, userMark) + if err != nil || status != chopHelpOk { + return + } + + info := &helperInfo{ + actionTime: actionTime, + helper: helper, + } + + err = s.helpOkNotify(info, chopReward, helpMark, task.Percent, types.HelpSourceOpen) + if err != nil { + return + } + + return true, nil +} + +// ClickHelp 点击助力 +func (s *Chop) ClickHelp(actionTime int64, userMark, IpAddress, os, osVersion, deviceModel, deviceId, webId string) (helpOk bool, err error) { + player := s.GetPlayer() + if player.ChopRewardID == 0 { + return + } + + conf, helpMark := s.GetConf(), mtype.FissionCampaignTicketHelpEventClick + + var canHelp bool + + switch conf.HelpRule { + case mtype.FissionCampaignChopHelpRuleUniqReward: + canHelp, err = s.rewardCanHelp(helpMark, userMark) + if err != nil { + return + } + case mtype.FissionCampaignChopHelpRuleUniqUser: + canHelp, err = s.userCanHelp(helpMark, userMark) + if err != nil { + return + } + } + + // 无需助力 + if !canHelp { + return + } + + // 任务数据 + chopReward, task, err := s.getTask(mtype.FissionCampaignTaskTypeClick) + if err != nil || task == nil { + return + } + + // 助力处理 + status, err := s._doHelp(chopReward, task, helpMark, userMark) + if err != nil || status != chopHelpOk { + return + } + + helper := &helperInfo{ + ipAddress: IpAddress, + os: os, + osVersion: osVersion, + deviceModel: deviceModel, + deviceID: deviceId, + webId: webId, + actionTime: actionTime, + } + + err = s.helpOkNotify(helper, chopReward, helpMark, task.Percent, types.HelpSourceClick) + if err != nil { + return + } + + return true, nil +} + +// Reselect 重选奖品 +func (s *Chop) Reselect() (err error) { + player := s.GetPlayer() + if player.ChopRewardID == 0 { + return + } + + canSelect, err := s.ExistSelectReward() + if err != nil { + return + } + + if !canSelect { + return + } + + m := s.GetDao().FissionChop + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.ChopRewardID.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// SelectReward 选择奖品 +func (s *Chop) SelectReward(rewardId int64) (err error) { + player := s.GetPlayer() + + if player.ChopRewardID > 0 { + err = s.BE().VerifyError("reward selected") + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(rewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = workerr.NotFound("not found reward") + return + } + + chopRewardM := s.GetDao().FissionChopReward + + if reward.HasRule == mtype.Yes { + ruleM := s.GetDao().FissionCampaignRewardRule + var rule *model.FissionCampaignRewardRule + rule, err = ruleM.WithContext(s.Ctx).Where(ruleM.RewardID.Eq(reward.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var count int64 + count, err = chopRewardM.WithContext(s.Ctx).Where( + chopRewardM.UserID.Eq(player.UserID), + chopRewardM.RewardID.Eq(reward.ID), + ).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if count >= int64(rule.CampaignLimit) { + err = s.BE().VerifyError("reward limit") + return + } + } + + chopReward := withdefault.FissionChopReward(&model.FissionChopReward{ + UserID: player.UserID, + CampaignID: player.CampaignID, + RewardID: reward.ID, + InitPercent: reward.InitPercent, + Percent: reward.InitPercent, + RecordID: 0, + }) + + if err = chopRewardM.WithContext(s.Ctx).Create(chopReward); err != nil { + err = s.BE().MysqlError(err) + return + } + + m := s.GetDao().FissionChop + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.ChopRewardID.Value(chopReward.ID)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 选择奖品埋点 + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).SelectReward(time.Now().Unix(), reward.ID) + + // 有初始助力,要推送一下消息 + if reward.InitPercent > 0 { + provider.NewFissionClue(s.Ctx, s.user.ID).ChopHelp(chopReward.ID, 0, reward.InitPercent, true) + } + + return +} + +// ExistSelectReward 是否存在可选择的奖品 +func (s *Chop) ExistSelectReward() (exist bool, err error) { + if s.canSelectReward != 0 { + return s.canSelectReward == 1, nil + } + + exist, err = s._existSelectReward() + if err != nil { + return + } + + if exist { + s.canSelectReward = 1 + } else { + s.canSelectReward = -1 + } + + return +} + +// 是否选择奖品 +func (s *Chop) _existSelectReward() (exist bool, err error) { + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(s.user) + if err != nil { + return + } + + var limitIds []int64 + for _, reward := range rewards { + if reward.HasRule == mtype.Yes { + limitIds = append(limitIds, reward.ID) + } + } + + if len(limitIds) == 0 { + return true, nil + } + + ruleM := s.GetDao().FissionCampaignRewardRule + rules, err := ruleM.WithContext(s.Ctx).Where(ruleM.CampaignID.Eq(s.user.CampaignID), ruleM.RewardID.In(limitIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ruleMap = make(map[int64]*model.FissionCampaignRewardRule, len(rules)) + for _, rule := range rules { + ruleMap[rule.RewardID] = rule + } + + type rewardGet struct { + RewardId int64 `json:"reward_id"` + Num int32 `json:"num"` + } + + var gets []*rewardGet + chopRewardM := s.GetDao().FissionChopReward + err = chopRewardM.WithContext(s.Ctx). + Select(chopRewardM.ID.Count().As("num"), chopRewardM.RewardID). + Where(chopRewardM.UserID.Eq(s.user.ID), chopRewardM.RecordID.Gt(0)). + Group(chopRewardM.RewardID). + Scan(&gets) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var filterMap = make(map[int64]struct{}) + for _, v := range gets { + if rule, ok := ruleMap[v.RewardId]; ok && rule.CampaignLimit <= v.Num { + filterMap[v.RewardId] = struct{}{} + } + } + + return len(rewards) > len(filterMap), nil +} + +// GetConf 获取玩法配置 +func (s *Chop) GetConf() *model.FissionCampaignChop { + if s.conf == nil { + s.conf, _ = cache.NewCampaignChop(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// RefreshView 刷新预览用户 +func (s *Chop) RefreshView() (err error) { + if !s.IsView() { + err = s.BE().VerifyError("非预览用户无法重新体验") + return + } + + player := s.GetPlayer() + + m := s.GetDao().FissionChop + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + app.Redis.Cache.Del(s.Ctx, s.chopHelpUserRewardKey, s.chopHelpUserKey) + + helpM := s.GetDao().FissionChopHelp + _, err = helpM.WithContext(s.Ctx).Where(helpM.UserID.Eq(player.UserID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + chopRewardM := s.GetDao().FissionChopReward + _, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.UserID.Eq(player.UserID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// GetPlayer 获取玩家基础数据 +func (s *Chop) GetPlayer() *model.FissionChop { + return s.player +} + +// 玩家 +func (s *Chop) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.chopHelpUserKey = ckey.FissionChopHelpUser(player.UserID) + s.chopHelpUserRewardKey = ckey.FissionChopHelpUserReward(player.ChopRewardID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Chop) firstOrCreate() (player *model.FissionChop, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +func (s *Chop) createPlayer() (player *model.FissionChop, err error) { + playerM := dao.FissionChop + player = withdefault.FissionChop(&model.FissionChop{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Chop) _dbFirst() (*model.FissionChop, error) { + playerM := dao.FissionChop + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 用户唯一助力 +func (s *Chop) userCanHelp(mark string, uniqMark string) (canHelp bool, err error) { + player, key := s.GetPlayer(), s.chopHelpUserKey + + // 这个人给它上级助力过事件了,就不能再助力了 + yes, err := app.Redis.Cache.HSetNX(s.Ctx, + key, + fmt.Sprintf("%s_%s", mark, uniqMark), + 1, + ).Result() + if err != nil { + err = s.BE().RedisError(err) + return + } + + if !yes { + return + } + + // 设置成功就给一个过期时间 + app.Redis.Cache.Expire(s.Ctx, key, consts.TimeDay) + + // 再查数据库看看是不是真的,怕只是缓存过期 + helpM := s.GetDao().FissionChopHelp + help, err := helpM.WithContext(s.Ctx). + Where( + helpM.CampaignID.Eq(player.CampaignID), + helpM.Mark.Eq(mark), + helpM.UserMark.Eq(uniqMark), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if help != nil { + return + } + + return true, nil +} + +// 奖品唯一助力 +func (s *Chop) rewardCanHelp(mark string, uniqMark string) (canHelp bool, err error) { + player, key := s.GetPlayer(), s.chopHelpUserRewardKey + + // 这个人给它上级助力过事件了,就不能再助力了 + yes, err := app.Redis.Cache.HSetNX(s.Ctx, + key, + fmt.Sprintf("%s_%s", mark, uniqMark), + 1, + ).Result() + if err != nil { + err = s.BE().RedisError(err) + return + } + + if !yes { + return + } + app.Redis.Cache.Expire(s.Ctx, key, consts.TimeDay) + + // 再查数据库看看助力过没有 + helpM := s.GetDao().FissionChopHelp + help, err := helpM.WithContext(s.Ctx). + Where( + helpM.ChopRewardID.Eq(player.ChopRewardID), + helpM.Mark.Eq(mark), + helpM.UserMark.Eq(uniqMark), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if help != nil { + return + } + + return true, nil +} + +func (s *Chop) getTask(taskType int8) (chopReward *model.FissionChopReward, task *model.FissionCampaignTask, err error) { + player := s.GetPlayer() + + chopRewardM := s.GetDao().FissionChopReward + chopReward, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.ID.Eq(player.ChopRewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + // 没找到,或者助力完成 + if chopReward == nil || chopReward.RecordID > 0 { + return + } + + taskM := s.GetDao().FissionCampaignTask + task, err = taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(player.CampaignID), + taskM.TaskType.Eq(taskType), + taskM.TaskMark.Eq(utils.FissionCampaignTaskMarkRewardOneVal(chopReward.RewardID)), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + s.oldPercent = chopReward.Percent + + return +} + +func (s *Chop) _doHelp(chopReward *model.FissionChopReward, task *model.FissionCampaignTask, helpMark, userMark string) (status int8, err error) { + // 计算助力进度 + percent, err := s._helpPercent(chopReward, task, helpMark) + if err != nil { // 有错误,或者被限制了 + return + } + + if percent == 0 { + status = chopHelpLimit + return + } + + if percent < 100 { + err = s._chopHelpOk(chopReward, task, helpMark, userMark, percent) + return + } + + // 发奖要锁住,防止并发发奖 + lc := app.NewRedisLock(s.Ctx, ckey.FissionChopHelpOnce(chopReward.ID), lock.SetExpire(10*time.Second)) + if !lc.SoftLock() { + return + } + defer lc.Release() + + // 重新找一遍,看看是不是没绑定奖励 + chopRewardM := s.GetDao().FissionChopReward + chopReward, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.ID.Eq(chopReward.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if chopReward.RecordID > 0 { + status = chopHelpDone + return + } + + err = s._chopHelpOk(chopReward, task, helpMark, userMark, 100) + if err != nil { + return + } + + return +} + +func (s *Chop) _helpPercent(chopReward *model.FissionChopReward, task *model.FissionCampaignTask, helpMark string) (percent float64, err error) { + // 有限制的助力 + if task.PercentLimit != 0 { + key := ckey.FissionChopHelpMarkPercent(chopReward.ID, helpMark) + + s._createPercentCache(chopReward.ID, key, helpMark, 0) + + num := app.Redis.Cache.IncrByFloat(s.Ctx, key, task.Percent).Val() + // 超过限制不能助力 + if num > task.PercentLimit { + return + } + } + + // 提高助力进度 + key := ckey.FissionChopHelpPercent(chopReward.ID) + s._createPercentCache(chopReward.ID, key, "", chopReward.InitPercent) + percent = app.Redis.Cache.IncrByFloat(s.Ctx, key, task.Percent).Val() + return +} + +// 创建缓存进度 +func (s *Chop) _createPercentCache(chopRewardId int64, key, mark string, initPercent float64) { + _ = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if exist { + return + } + + m := s.GetDao().FissionChopHelp + var cond = []gen.Condition{ + m.ChopRewardID.Eq(chopRewardId), + } + if mark != "" { + cond = append(cond, m.Mark.Eq(mark)) + } + + var num struct { + Percent float64 + } + + err = m.WithContext(s.Ctx).Select(m.Percent.Sum().As("percent")).Where(cond...).Scan(&num) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + app.Redis.Cache.IncrByFloat(s.Ctx, key, num.Percent+initPercent) + app.Redis.Cache.Expire(s.Ctx, key, consts.TimeDay) + return + }) +} + +// 助力成功 +func (s *Chop) _chopHelpOk(chopReward *model.FissionChopReward, task *model.FissionCampaignTask, helpMark, userMark string, percent float64) (err error) { + user := s.user + m := s.GetDao().FissionChopHelp + err = m.WithContext(s.Ctx).Create(withdefault.FissionChopHelp(&model.FissionChopHelp{ + UserID: chopReward.UserID, + CampaignID: chopReward.CampaignID, + ChopRewardID: chopReward.ID, + Mark: helpMark, + Percent: task.Percent, + UserMark: userMark, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + chopRewardM := s.GetDao().FissionChopReward + if percent != 100 { + _, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.ID.Eq(chopReward.ID)).UpdateSimple(chopRewardM.Percent.Add(task.Percent)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(chopReward.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + ok, err := award.NewAwardIssVerify(s.Ctx, user, reward).DeductStock().IsOK() + if err != nil { + return + } + + var opts []award.RecordOption + if !ok { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + record, _, _, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(reward, true, opts...) + if err != nil { + return + } + + _, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.ID.Eq(chopReward.ID)).UpdateSimple( + chopRewardM.Percent.Value(100), + chopRewardM.RecordID.Value(record.ID), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 一些助力回调处理 +func (s *Chop) helpOkNotify(info *helperInfo, chopReward *model.FissionChopReward, helpMark string, percent float64, source int32) (err error) { + beHelper, cpn := s.user, s.cpn + // 助力次数 + 1 + statM := s.GetDao().FissionUserStat + _, err = statM.WithContext(s.Ctx).Where(statM.UserID.Eq(beHelper.ID)).UpdateSimple(statM.HelpNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 如果是点击事件 info 为nil + var subUserId, subDeviceId string + if source == types.HelpSourceClick { + // 平台 + platform, dm := strings.ToLower(info.os), strings.ToLower(info.deviceModel) + if platform == "macos" { + platform = consts.PlatformIOS + } + + if platform == consts.PlatformIOS && dm == consts.PlatformIPad { + platform = consts.PlatformIPad + } + + subDeviceId = info.deviceID + + fissionaction.NewMarkPoint(s.Ctx).OutApp( + beHelper.CampaignID, + beHelper.ChannelID, + beHelper.ID, + info.webId, + platform, + beHelper.LangMark, + ).Help( + info.actionTime, + helpMark, + chopReward.RewardID, + info.ipAddress, + info.os, + info.osVersion, + info.deviceModel, + ) + + } else { + subUserId = info.helper.SubUserID + subDeviceId = info.helper.DeviceID + fissionaction.NewMarkPoint(s.Ctx).InApp(info.helper).Help(info.actionTime, helpMark, chopReward.RewardID) + } + + langTitle, err := provider.NewLangTitle(s.Ctx, s.cpn, beHelper.LangMark) + if err != nil { + return + } + + pageTitle, err := langTitle.GetPageTitle() + if err != nil { + return + } + + // 助力通知 + producer.NewOplatformOther(s.Ctx).OpoCampaignHelpOk(types.OpoCampaignHelpOk{ + ProjectId: cpn.ProjectID, + CampaignHashId: cpn.HashID, + CampaignTitle: cpn.Title, + PageTitle: pageTitle, + HelperUserId: subUserId, + HelperDeviceId: subDeviceId, + BeHelperUserId: beHelper.SubUserID, + BeHelperDeviceId: beHelper.DeviceID, + Source: source, + }, producer.SetHeaderLang(beHelper.LangMark)) + + provider.NewFissionClue(s.Ctx, beHelper.ID).ChopHelp(chopReward.ID, s.oldPercent, percent, false) + + return +} diff --git a/internal/service/provider/players/coin.go b/internal/service/provider/players/coin.go new file mode 100644 index 0000000..052c669 --- /dev/null +++ b/internal/service/provider/players/coin.go @@ -0,0 +1,624 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/fissionaction" + stos "joybuywork/internal/service/provider/s2s" + "time" + + "gorm.io/gen/field" +) + +const ( + CoinDeductStatusLack = iota + 1 // 缺乏金币 + CoinDeductStatusMax // 达到投放上限 + CoinDeductStatusEnd // 当前场次已结束 +) + +const ( + CoinGainStatusNotOpen = iota + 1 // 未开奖 + CoinGainStatusLackJoin // 参与次数不足 + CoinGainStatusExpired // 领奖超时 + CoinGainStatusGot // 已领取 + CoinGainStatusFail // 领取失败 +) + +type CoinStatus struct { + GetCoin int64 // 预计获得金币数 + UseNum int32 // 投放次数 + AllCoin int64 // 总奖池金额 + OpenSec int64 // 剩余开奖时间(秒) + CanGet int32 // 是否可以领取瓜分了 + End int32 // 是否没有下一场了 +} + +// Coin 金币池交互逻辑 +type Coin struct { + Player + player *model.FissionCoin + conf *model.FissionCampaignCoin + + nowScene *model.FissionCoinScene + + end int32 + + preSceneOk int8 + + lackKey string +} + +func NewCoin(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Coin, err error) { + player = &Coin{} + + err = player.Init(ctx, user, consts.IdCoin, opts...) + if err != nil { + return + } + + err = player.initNowScene() + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +func (s *Coin) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + player := s.GetPlayer() + + var logs []*model.FissionCoinLog + for _, task := range tasks { + if task.AwardMode == mtype.FissionCampaignTaskAwardModeManual || task.PropMark == mtype.FissionCampaignTaskPropMarkChance { + continue + } + + var source = mtype.FissionCoinLogSourceFinishTask + if task.TaskType == mtype.FissionCampaignTaskTypeCondAll { + source = mtype.FissionCoinLogSourceFinishAllTask + } + + log := withdefault.FissionCoinLog(&model.FissionCoinLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + CoinID: player.ID, + SceneID: player.SceneID, + Type: mtype.FissionCoinLogTypeReward, + Source: source, + }) + + log.SetVal(mtype.CoinLogVal{ + TaskId: task.ID, + RewardId: task.RewardID, + }) + + logs = append(logs, log) + } + + if len(logs) == 0 { + return + } + + return s._addLog(logs...) +} + +func (s *Coin) Deduct() (useNum, status int32, err error) { + player := s.GetPlayer() + + if s.IsView() { + useNum = 2 + return + } + + nowScene := s.GetNowScene() + if nowScene.OpenTime <= time.Now().Unix() { + status = CoinDeductStatusEnd + return + } + + conf, lackKey := s.GetConf(), s.lackKey + + if player.UseNum >= conf.UseLimit { + status = CoinDeductStatusMax + return + } + + // 看看是不是有 + if app.Redis.Cache.Exists(s.Ctx, lackKey).Val() != 0 { + status = CoinDeductStatusLack + return + } + + deductM := s.GetDao().FissionPointDeduct + deduct, err := deductM.WithContext(s.Ctx).Where(deductM.UserID.Eq(player.UserID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if deduct == nil { + deduct = withdefault.FissionPointsDeduct(&model.FissionPointDeduct{ + UserID: player.UserID, + }) + + if err = s.GetDao().FissionPointDeduct.WithContext(s.Ctx).Create(deduct); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + s2s, err := stos.NewPointsChange(s.Ctx, s.cpn, s.user, conf.URLID) + if err != nil { + return + } + + res, err := s2s.CoinDeduct(player, conf.UseCoin, deduct.ID) + if err != nil { + return + } + + if res.State == stos.PointsChangeLack { + app.Redis.Cache.Set(s.Ctx, lackKey, 1, 10*time.Second) + status = CoinDeductStatusLack + return + } + + m := s.GetDao().FissionCoin + var up = []field.AssignExpr{ + m.UseCoin.Add(conf.UseCoin), + m.UseNum.Add(1), + } + + if player.Status == mtype.FissionCoinStatusWait { + up = append(up, m.Status.Value(mtype.FissionCoinStatusJoin)) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = s._sceneCoin(player.SceneID, conf.UseCoin, player.UseNum == 0) + if err != nil { + return + } + + val, _ := jsonm.MarshalToString(&mtype.CoinLogVal{ + CoinNum: int64(conf.UseCoin), + RelateId: res.RelateId, + }) + + err = s._addLog(withdefault.FissionCoinLog(&model.FissionCoinLog{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CoinID: player.ID, + SceneID: player.SceneID, + Type: mtype.FissionCoinLogTypeUse, + Source: mtype.FissionCoinLogSourcePutIn, + Val: val, + })) + if err != nil { + return + } + + useNum = player.UseNum + 1 + s.player.UseNum += 1 + + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).UseCoin(time.Now().Unix(), player.SceneID, int64(useNum)) + + _, err = deductM.WithContext(s.Ctx).Delete(deduct) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Coin) Gain() (getCoin int64, status int32, err error) { + + if s.IsView() { + getCoin = 99999 + return + } + + nowScene := s.GetNowScene() + if nowScene.OpenTime > time.Now().Unix() { + status = CoinGainStatusNotOpen + return + } + + player, conf := s.GetPlayer(), s.GetConf() + if player.Status == mtype.FissionCoinStatusWait { + status = CoinGainStatusLackJoin + return + } + + if player.Status == mtype.FissionCoinStatusOk { + status = CoinGainStatusGot + return + } + + if player.Status == mtype.FissionCoinStatusExpired { + status = CoinGainStatusExpired + return + } + + s2s, err := stos.NewPointsChange(s.Ctx, s.cpn, s.user, conf.URLID) + if err != nil { + return + } + + _, getCoin, err = s._getCoin(player.SceneID, player.UseNum) + if err != nil { + return + } + + res, err := s2s.CoinGain(player, int32(getCoin)) + if err != nil { + return + } + + if res.State != stos.PointsChangeSuccess { + status = CoinGainStatusFail + return + } + + m := s.GetDao().FissionCoin + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.GetCoin.Add(int32(getCoin)), + m.Status.Value(mtype.FissionCoinStatusOk), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + sceneData, err := s._sceneData(player.SceneID) + if err != nil { + return + } + + val, _ := jsonm.MarshalToString(&mtype.CoinLogVal{ + CoinNum: getCoin, + RelateId: res.RelateId, + }) + + err = s._addLog(withdefault.FissionCoinLog(&model.FissionCoinLog{ + CampaignID: player.CampaignID, + UserID: player.UserID, + CoinID: player.ID, + SceneID: player.SceneID, + Type: mtype.FissionCoinLogTypeAdd, + Source: mtype.FissionCoinLogSourceGetOk, + Val: val, + })) + if err != nil { + return + } + + _, err = sceneData.Incr(cachecurd.CoinSceneGetNum, 1) + if err != nil { + err = s.BE().CacheError(err) + return + } + + _, err = sceneData.Incr(cachecurd.CoinSceneGetTotal, getCoin) + if err != nil { + err = s.BE().CacheError(err) + return + } + + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).GetCoin(time.Now().Unix(), player.SceneID) + + return +} + +// GetStatus 获取用户状态 +func (s *Coin) GetStatus() (status CoinStatus, err error) { + nowScene, player := s.GetNowScene(), s.GetPlayer() + + userCoin, getCoin, err := s._getCoin(nowScene.ID, player.UseNum) + if err != nil { + return + } + + status = CoinStatus{ + GetCoin: getCoin, + UseNum: player.UseNum, + AllCoin: int64(nowScene.InitCoin) + userCoin, + OpenSec: nowScene.OpenTime - time.Now().Unix(), + CanGet: 0, + End: s.end, + } + + if status.OpenSec < 0 { + status.OpenSec = 0 + } + + // 开奖了 + if nowScene.OpenTime <= time.Now().Unix() && nowScene.RewardTime > time.Now().Unix() && player.Status == mtype.FissionCoinStatusJoin { + status.CanGet = 1 + } + + return +} + +// GetConf 获取玩法配置 +func (s *Coin) GetConf() *model.FissionCampaignCoin { + if s.conf == nil { + s.conf, _ = cache.NewCampaignCoin(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetNowScene 当前场次数据 +func (s *Coin) GetNowScene() *model.FissionCoinScene { + return s.nowScene +} + +// GetNowScene 当前场次数据 +func (s *Coin) initNowScene() (err error) { + + m := s.GetDao().FissionCoinScene + nowScene, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(s.cpn.ID), m.OpenTime.Gte(time.Now().Unix())).Order(m.OpenTime).First() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if nowScene == nil { + nowScene, _ = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(s.cpn.ID)).Last() + s.end = 1 + } + + s.nowScene = nowScene + + return +} + +// GetPlayer 获取玩家基础数据 +func (s *Coin) GetPlayer() *model.FissionCoin { + return s.player +} + +// 玩家 +func (s *Coin) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.lackKey = ckey.FissionCoinLack(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Coin) firstOrCreate() (player *model.FissionCoin, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +func (s *Coin) createPlayer() (player *model.FissionCoin, err error) { + nowScene := s.GetNowScene() + playerM := dao.FissionCoin + player = withdefault.FissionCoin(&model.FissionCoin{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + SceneID: nowScene.ID, + PreSceneOk: s.preSceneOk, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Coin) _dbFirst() (player *model.FissionCoin, err error) { + nowScene := s.GetNowScene() + + playerM := dao.FissionCoin + player, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID), playerM.SceneID.Eq(nowScene.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + if nowScene.PreScene == 0 || (player != nil && player.PreSceneOk == mtype.Yes) || s.end == 1 { + return + } + + lastPlayer, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Last() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + if lastPlayer == nil { + s.preSceneOk = mtype.Yes + return + } + + // 不是上一场 + if lastPlayer.SceneID != nowScene.PreScene { + + if lastPlayer.Status == mtype.FissionCoinStatusJoin { + var scene *model.FissionCoinScene + m := s.GetDao().FissionCoinScene + scene, err = m.WithContext(s.Ctx).Where(m.ID.Eq(lastPlayer.SceneID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(lastPlayer.ID)).UpdateSimple(playerM.Status.Value(mtype.FissionCoinStatusExpired)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(&mtype.CoinLogVal{ + CoinNum: s._count(scene.UserCoin, scene.JoinNum, lastPlayer.UseNum), + }) + + err = s._addLog(withdefault.FissionCoinLog(&model.FissionCoinLog{ + CreatedAt: scene.RewardTime + consts.DaySec, + CampaignID: lastPlayer.CampaignID, + UserID: lastPlayer.UserID, + CoinID: lastPlayer.ID, + SceneID: lastPlayer.SceneID, + Type: mtype.FissionCoinLogTypeAdd, + Source: mtype.FissionCoinLogSourceGetExpired, + Val: val, + })) + if err != nil { + return + } + + } + + s.preSceneOk = mtype.Yes + + return + } + + // 如果这个用户上一场没结算,要拿来结算一下 + if lastPlayer.Status == mtype.FissionCoinStatusJoin { + m := s.GetDao().FissionCoinScene + var preScene *model.FissionCoinScene + preScene, err = m.WithContext(s.Ctx).Where(m.ID.Eq(lastPlayer.SceneID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + if preScene.RewardTime > time.Now().Unix() { + player = lastPlayer + s.nowScene = preScene + } + + return + } + + s.preSceneOk = mtype.Yes + + return player, nil +} + +func (s *Coin) _sceneCoin(sceneId int64, add int32, first bool) (num int64, err error) { + sceneData, err := s._sceneData(sceneId) + if err != nil { + return + } + + if add > 0 { + _, _ = sceneData.Incr(cachecurd.CoinSceneJoinNum, 1) + if first { + _, _ = sceneData.Incr(cachecurd.CoinSceneJoinUserNum, 1) + } + + return sceneData.Incr(cachecurd.CoinSceneUserCoin, int64(add)) + } + + return sceneData.GetInt64(cachecurd.CoinSceneUserCoin) +} + +// 奖池金币总数,用户获得的金币数 +func (s *Coin) _getCoin(sceneId int64, useNum int32) (userCoin, getCoin int64, err error) { + sceneData, err := s._sceneData(sceneId) + if err != nil { + return + } + + userCoin, _ = sceneData.GetInt64(cachecurd.CoinSceneUserCoin) + joinNum, _ := sceneData.GetInt64(cachecurd.CoinSceneJoinNum) + + getCoin = s._count(userCoin, joinNum, useNum) + + return +} + +func (s *Coin) _sceneData(sceneId int64) (sceneData *cachecurd.HMap, err error) { + conf, key := s.GetConf(), ckey.FissionCoinSceneData(sceneId) + return cachecurd.NewHMap(s.Ctx, key, + cachecurd.SetCoinSceneBuild(s.cpn.ID, sceneId), + cachecurd.SetHMapExp(time.Duration(conf.OpenDays+1)*consts.TimeDay), + ) +} + +func (s *Coin) _addLog(logs ...*model.FissionCoinLog) (err error) { + if len(logs) == 0 { + return + } + + err = s.GetDao().FissionCoinLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Coin) _count(userCoin, joinNum int64, useNum int32) (getCoin int64) { + scene := s.GetNowScene() + + var oneCoin int64 + if joinNum > 0 || scene.InitUse > 0 { + oneCoin = (userCoin + int64(scene.InitCoin)) / (joinNum + int64(scene.InitUse)) + if oneCoin == 0 { + oneCoin = 1 + } + } + + return int64(useNum) * oneCoin +} diff --git a/internal/service/provider/players/coin_test.go b/internal/service/provider/players/coin_test.go new file mode 100644 index 0000000..ca1b9eb --- /dev/null +++ b/internal/service/provider/players/coin_test.go @@ -0,0 +1,55 @@ +package players + +import ( + "context" + "joybuywork/internal/repository/cache" + "testing" + + _ "joybuywork/test" +) + +func TestCoinStatus(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 4602).FindById(276303329544409088) + if err != nil { + t.Error(err) + } + + user.LangMark = "zh" + + kg, err := NewCoin(ctx, user) + if err != nil { + t.Error(err) + } + + status, err := kg.GetStatus() + if err != nil { + t.Error(err) + } + + t.Log(status) +} + +func TestCoinGain(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 4602).FindById(276303329544409088) + if err != nil { + t.Error(err) + } + + user.LangMark = "zh" + + kg, err := NewCoin(ctx, user) + if err != nil { + t.Error(err) + } + + getCoin, status, err := kg.Gain() + if err != nil { + t.Error(err) + } + + t.Log(getCoin, status) +} diff --git a/internal/service/provider/players/dice.go b/internal/service/provider/players/dice.go new file mode 100644 index 0000000..2d546fc --- /dev/null +++ b/internal/service/provider/players/dice.go @@ -0,0 +1,1469 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" + "gorm.io/gen/field" +) + +type rollData struct { + MarkType int8 // 格子类型 + Step int32 // 下标数据 + RewardId int64 // 活动奖品id + MapId int64 // 地图int类型id + MapHashId string // 地图hash_id + RewardTitle string // 奖品名称 + ImgUrl string // 奖品地址 + Intact bool // 合成了奖品 + Lack bool // 缺库存 +} + +const ( + diceFailTypeNone = iota // 没有错误 + diceFailTypeLack // 缺骰子数 + diceFailTypeProps // 道具不足 +) + +// Dice 金币池交互逻辑 +type Dice struct { + Player + player *model.FissionDice + conf *model.FissionCampaignDice + run *model.FissionDiceRun + + fissionPlayerSetInitOnceKey string + diceOnceKey string +} + +func NewDice(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Dice, err error) { + player = &Dice{} + + err = player.Init(ctx, user, consts.IdDice, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +func (s *Dice) PointsUse() (status int32, err error) { + player := s.GetPlayer() + + logM := s.GetDao().FissionDiceRecord + + status, deduct, err := s.pointsUse(mtype.FissionPointsLogSourceDice, logM.TableName(), mtype.PointsLogOther{ + PlayerId: player.ID, + }, []*pointsUseCond{ + { + Field: logM.Mark.ColumnName().String(), + Value: mtype.FissionDiceRecordMarkPointsUse, + }, + }) + defer s.pointsUseOk(deduct) + + if status != pointsUseOk || err != nil { + return + } + + m := s.GetDao().FissionDice + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Add(1)) + if err != nil { + return + } + + log := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + Mark: mtype.FissionDiceRecordMarkPointsUse, + Data: "", + }) + + log.SetData(&mtype.DiceRecord{ + Chance: 1, + PointsNum: deduct.Num, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Dice) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance, fixChance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, fixChance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Dice) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Dice) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance, fixChance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionDiceRecord + for _, task := range tasks { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + continue + } + + log := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + }) + + val := &mtype.DiceRecord{ + TaskId: task.ID, + Chance: task.Chance, + } + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + log.Mark = mtype.FissionDiceRecordMarkGetRollRegister + case mtype.FissionCampaignTaskTypeInstall: + log.Mark = mtype.FissionDiceRecordMarkGetRollInstall + case mtype.FissionCampaignTaskTypeCondAll: + log.Mark = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionDiceRecordMarkGetManualRollAll, mtype.FissionDiceRecordMarkGetRollAll) + case mtype.FissionCampaignTaskTypeCondOne: + log.Mark = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionDiceRecordMarkGetManualRollTask, mtype.FissionDiceRecordMarkGetRollTask) + val.CondId = utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark) + } + + log.SetData(val) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + case mtype.FissionCampaignTaskPropMarkFixedRoll: + log.Mark = mtype.FissionDiceRecordMarkGetLucky + fixChance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionDice + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if fixChance > 0 { + var prop *model.FissionDiceProp + prop, err = s._propOrCreate(mtype.FissionDicePropMarkFixedRoll) + if err != nil { + return + } + + m := s.GetDao().FissionDiceProp + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(prop.ID)).UpdateSimple(m.Num.Add(fixChance), m.TotalNum.Add(fixChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.appTrack().GetProp(time.Now().Unix(), consts.PropNameFixedDice, fixChance) + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +type RollRes struct { + FailType int32 + MarkType int32 + MapHashId string + RewardTitle string + ImgUrl string + IsIntact bool + RollNum int32 + Lack bool + RewardId int64 +} + +// Roll 普通掷骰子 +func (s *Dice) Roll() (res RollRes, err error) { + s.Tran() + defer func() { + s.TranCommit(err) + s.AfterDo(err) + }() + + player := s.GetPlayer() + if player.Chance <= 0 { + res.FailType = diceFailTypeLack + return + } + + step := int(utils.RandNumber(6)) + + win, err := s._rollMap(step, false) + if err != nil || win == nil { + return + } + + // 不是预览用户要减次数,并且不是再来一次就减一次 + if !s.IsView() && win.MarkType != mtype.FissionDiceMapMarkTypeChance { + m := s.GetDao().FissionDice + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 记录日志 + err = s._rollDiceRecord(win, false) + if err != nil { + return + } + + return s._rollRes(win) +} + +// FixRoll 使用幸运骰子 +func (s *Dice) FixRoll(rollVal string) (res RollRes, err error) { + s.Tran() + defer func() { + s.TranCommit(err) + s.AfterDo(err) + }() + + player := s.GetPlayer() + + m := s.GetDao().FissionDiceProp + prop, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.Mark.Eq(mtype.FissionDicePropMarkFixedRoll)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if prop == nil || prop.Num <= 0 { + res.FailType = diceFailTypeProps + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(prop.ID)).UpdateSimple(m.Num.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + step := utils.StrToInt(rollVal) - 1 + + win, err := s._rollMap(step, true) + if err != nil || win == nil { + return + } + + // 记录日志 + err = s._rollDiceRecord(win, true) + if err != nil { + return + } + + // 使用道具埋点 + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).UseProp(time.Now().Unix(), consts.PropNameFixedDice) + + return s._rollRes(win) +} + +type DiceMapOne struct { + MapHashId string `json:"map_hash_id"` + MarkType int32 `json:"mark_type"` + RewardTitle string `json:"reward_title"` + ImgUrl string `json:"img_url"` + RewardId int64 `json:"reward_id"` +} + +func (s *Dice) DiceMap(mapHashId string, showStep int64, prefixStep int32) (maps []*DiceMapOne, err error) { + player := s.GetPlayer() + + run, err := s._runMap() + if err != nil { + return + } + + m := s.GetDao().FissionDiceMap + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID), m.DmgID.Eq(run.DmgID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + maps = make([]*DiceMapOne, 0, 54) + + var point = run.MapID + if mapHashId != "" { + var dm *model.FissionDiceMap + dm, err = m.WithContext(s.Ctx).Where(m.HashID.Eq(mapHashId)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if dm != nil { + point = dm.ID + } + } + + rewardMap, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppRewardInfo(s.cpn, s.user) + if err != nil { + return + } + + var add = func(i int) { + v := list[i] + one := &DiceMapOne{ + MapHashId: v.HashID, + MarkType: int32(v.MarkType), + RewardTitle: "", + ImgUrl: "", + } + + if reward, ok := rewardMap[v.RewardID]; ok { + one.RewardTitle = reward.Title + one.ImgUrl = reward.ImgUrl + one.RewardId = reward.RewardId + } + + maps = append(maps, one) + } + + if point == 0 || (showStep > 0 && run.GoStep <= showStep) { + maps = append(maps, &DiceMapOne{ + MapHashId: "", + MarkType: -1, + RewardTitle: "GO", + ImgUrl: "", + }) + + for i := 0; i < 53; i++ { + add(i) + } + return + } + + // 在第几格 + var idx int + for i, v := range list { + if v.ID == point { + idx = i + break + } + } + + // 走了超过12步 + var mapL = len(list) + var start = idx - utils.Ternary(mapHashId == "", int(prefixStep), -1) + start = utils.Ternary(start < 0, 0, start) + var end = 54 + start + if end > mapL { + end = mapL + } + + for i := start; i < end; i++ { + add(i) + } + + // 如果超过了地图最大长度,从头再来 + var resLen = len(maps) + for i := 0; i < 54-resLen; i++ { + add(i) + } + + return +} + +// SetInit 获得初始次数 +func (s *Dice) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionDice + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.DiceRecord{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + UserID: player.UserID, + CampaignID: player.CampaignID, + Mark: mtype.FissionDiceRecordMarkGetRollSys, + Data: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +type MixRewardRes struct { + Lack bool //奖品无库存 + RewardId int64 //奖品ID + RewardTitle string //奖品名称 + ImgUrl string //奖品图片 + ReceiveType int32 //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + KvData []*mtype.RewardKV //键值数据 + Contact string //联系方式 + RewardHashId string //领取的用户奖品hash_id + OpenToUse int32 //开启去使用(0-否,1-是) + WebUrl string //Web端的跳转地址 + AppParam string //App端的跳转参数 + PcParam string //pc端的跳转参数 +} + +func (s *Dice) MixReward(rewardId int64) (res MixRewardRes, err error) { + s.Tran() + defer func() { + s.TranCommit(err) + }() + + user := s.user + + m := s.GetDao().FissionDiceCollect + collect, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.RewardID.Eq(rewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if collect == nil || collect.RecordID == 0 { + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(collect.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var upData = []field.AssignExpr{ + m.IntactNum.Add(1), + m.Num.Sub(reward.CollectNum), + m.RecordID.Value(0), + } + + cr := reward.GetCollectRule() + if cr.Open == mtype.Yes && cr.ResetType == mtype.FissionCampaignRewardCollectRuleResetGet { + upData = append(upData, m.SignNum.Value(0)) + } + + // 完整度+1 + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(collect.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + recordM := s.GetDao().FissionRewardRecord.SubTable(user.CampaignID) + record, err := recordM.WithContext(s.Ctx).Where(recordM.ID.Eq(collect.RecordID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var lack bool + if record.FailType == mtype.FissionRewardRecordFailTypeCli && record.FailMsg == mtype.FissionRewardRecordFailTypeCliLackMsg { + lack = true + } + + // 骰子记录 + var diceRecord = withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CreatedAt: record.CreatedAt, + CampaignID: user.CampaignID, + UserID: user.ID, + Mark: mtype.FissionDiceRecordMarkReward, + Data: "", + }) + + diceRecord.SetData(&mtype.DiceRecord{ + RewardId: record.RewardID, + RecordId: record.ID, + }) + + err = s._addLog(diceRecord) + if err != nil { + return + } + + preward, err := provider.NewRewards(s.Ctx, s.cpn.ProjectID, record.BaseRewardID) + if err != nil { + return + } + + info, _ := preward.InfoAutoLang(record.BaseRewardID, user.LangMark) + + res = MixRewardRes{ + Lack: lack, + RewardId: record.RewardID, + RewardTitle: info.Title, + ImgUrl: info.ImgUrl, + ReceiveType: info.ReceiveType, + KvData: info.KvData, + Contact: info.Contact, + RewardHashId: record.HashID, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + } + + return +} + +type DiceStatus struct { + Stat *model.FissionUserStat + Run *model.FissionDiceRun + CollectMap map[int64]int32 + PropMap map[string]int32 + FixedRollTaskFinish int64 +} + +func (s *Dice) Status() (status DiceStatus, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + // 统计数据 + status.Stat, err = cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionUserStat(s.user) + if err != nil { + return + } + + // 用户当前所在地图的信息 + status.Run, err = s._runMap() + if err != nil { + return + } + + collectM := s.GetDao().FissionDiceCollect + collects, err := collectM.WithContext(s.Ctx).Where(collectM.UserID.Eq(player.UserID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + status.CollectMap = make(map[int64]int32) + for _, v := range collects { + status.CollectMap[v.RewardID] = v.Num + } + + propM := s.GetDao().FissionDiceProp + props, err := propM.WithContext(s.Ctx).Where(propM.UserID.Eq(player.UserID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + status.PropMap = make(map[string]int32) + for _, prop := range props { + status.PropMap[prop.Mark] = prop.Num + } + + if conf.FixDice == mtype.No { + return + } + + taskM := s.GetDao().FissionCampaignTask + task, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(player.CampaignID), + taskM.PropMark.Eq(mtype.FissionCampaignTaskPropMarkFixedRoll), + taskM.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if task == nil { + return + } + + taskRecordM := s.GetDao().FissionUserTaskRecord + status.FixedRollTaskFinish, err = taskRecordM.WithContext(s.Ctx).Where(taskRecordM.UserID.Eq(player.UserID), taskRecordM.TaskID.Eq(task.ID)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if task.ChanceLimit > 0 && int64(task.ChanceLimit) < status.FixedRollTaskFinish { + status.FixedRollTaskFinish = int64(task.ChanceLimit) + } + + return +} + +// Sign 签到 +func (s *Dice) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionDice + var upData []field.AssignExpr + upData = append(upData, playerM.LastSign.Value(lastSign)) + if conf.DayChance > 0 { + + upData = append(upData, + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + ) + + val, _ := jsonm.MarshalToString(mtype.DiceRecord{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + UserID: player.UserID, + CampaignID: player.CampaignID, + Mark: mtype.FissionDiceRecordMarkSign, + Data: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + } + + scrIds, err := s._signCollectReward() + if err != nil { + return + } + + if len(scrIds) > 0 { + var addSignIds []int64 + for _, id := range scrIds { + var collect *model.FissionDiceCollect + collect, err = s._rewardCollect(id) + if err != nil { + return + } + addSignIds = append(addSignIds, collect.ID) + } + + m := s.GetDao().FissionDiceCollect + _, err = m.WithContext(s.Ctx).Where(m.ID.In(addSignIds...)).UpdateSimple(m.SignNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(upData...) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// GetConf 获取玩法配置 +func (s *Dice) GetConf() *model.FissionCampaignDice { + if s.conf == nil { + s.conf, _ = cache.NewCampaignDice(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Dice) GetPlayer() *model.FissionDice { + return s.player +} + +// 玩家 +func (s *Dice) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + s.diceOnceKey = ckey.FissionDiceOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Dice) firstOrCreate() (player *model.FissionDice, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Dice) _dbFirst() (*model.FissionDice, error) { + playerM := dao.FissionDice + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Dice) createPlayer() (player *model.FissionDice, err error) { + playerM := dao.FissionDice + player = withdefault.FissionDice(&model.FissionDice{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Dice) _addLog(logs ...*model.FissionDiceRecord) (err error) { + err = s.GetDao().FissionDiceRecord.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Dice) _signCollectReward() (ids []int64, err error) { + rewards, err := cmm.NewUserAppReward(s.Ctx).Get(s.GetDao(), s.user) + if err != nil { + return + } + + for _, reward := range rewards { + cr := reward.GetCollectRule() + if cr.Open == mtype.Yes { + ids = append(ids, reward.ID) + } + } + + return +} + +func (s *Dice) _rewardCollect(rewardId int64) (collect *model.FissionDiceCollect, err error) { + player := s.GetPlayer() + + err = lockdo.FindNilDo( + s.Ctx, + ckey.FissionUserCreateRewardCollect(player.UserID, rewardId), + func() (none bool, err error) { + m := s.GetDao().FissionDiceCollect + collect, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.RewardID.Eq(rewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return collect == nil, nil + }, + func() (err error) { + collect = withdefault.FissionDiceCollect(&model.FissionDiceCollect{ + UserID: player.UserID, + CampaignID: player.CampaignID, + RewardID: rewardId, + }) + + err = s.GetDao().FissionDiceCollect.WithContext(s.Ctx).Create(collect) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + }) + + if err != nil { + return + } + + return +} + +func (s *Dice) _runMap() (run *model.FissionDiceRun, err error) { + if s.run != nil { + return s.run, nil + } + + user := s.user + m := s.GetDao().FissionDiceMapGroup + dmg, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.LangMark.Eq(user.UserLang), + m.LevelID.Eq(user.UserLevel), + m.CountryMark.Eq(user.UserCountry), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if dmg == nil { + err = workerr.NotFound("not found dice map") + return + } + + lc := app.NewFollower(s.Ctx, ckey.FissionUserRunCreateOnce(user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + runM := s.GetDao().FissionDiceRun + run, err = runM.WithContext(s.Ctx).Where(runM.UserID.Eq(user.ID), runM.DmgID.Eq(dmg.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if run == nil { + run = withdefault.FissionDiceRun(&model.FissionDiceRun{ + CampaignID: user.CampaignID, + UserID: user.ID, + DmgID: dmg.ID, + }) + + if err = runM.WithContext(s.Ctx).Create(run); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + s.run = run + + return +} + +func (s *Dice) _rollMap(idx int, isFixRoll bool) (res *rollData, err error) { + run, err := s._runMap() + if err != nil { + return + } + + m := s.GetDao().FissionDiceMap + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(run.CampaignID), m.DmgID.Eq(run.DmgID), m.ID.Gt(run.MapID)).Limit(6).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) < 6 { + + back := 6 - len(list) + var backList []*model.FissionDiceMap + backList, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(run.CampaignID), m.DmgID.Eq(run.DmgID)).Limit(back).Order(m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range backList { + list = append(list, v) + } + + } + + if len(list) == 0 { + app.Logger.Error(s.Ctx, fmt.Sprintf("活动[%d]地图生成异常, 用户id[%d]", run.CampaignID, run.UserID)) + err = workerr.ServerError + return + } + + var loseMap = make(map[int]*model.FissionDiceMap) + for i, v := range list { + if verify.InArray(v.MarkType, mtype.FissionDiceMapMarkTypeNone, mtype.FissionDiceMapMarkTypeChance, mtype.FissionDiceMapMarkTypeFixedRoll) { + loseMap[i] = v + } + } + + var win, lose *rollData + + for i, v := range loseMap { + switch v.MarkType { + case mtype.FissionDiceMapMarkTypeNone, mtype.FissionDiceMapMarkTypeChance: + lose = &rollData{ + MarkType: v.MarkType, + Step: int32(i), + RewardId: v.RewardID, + MapId: v.ID, + MapHashId: v.HashID, + } + break + } + } + + win = &rollData{ + MarkType: list[idx].MarkType, + Step: int32(idx), + RewardId: list[idx].RewardID, + MapId: list[idx].ID, + MapHashId: list[idx].HashID, + } + + // 预览用户直接返回结果 + if s.IsView() { + return s._viewWin(win) + } + + // 不是固定骰子,要看看走不走概率 + if !isFixRoll { + confM := s.GetDao().FissionCampaignDice + var conf *model.FissionCampaignDice + conf, err = confM.WithContext(s.Ctx).Where(confM.CampaignID.Eq(run.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + // 走概率发奖 + if conf.AwardType == mtype.FissionCampaignDiceAwardTypeOdds { + + winner, _ := lucky.NewDiscrete(s.Ctx, []lucky.Reward{ + {Share: int(conf.Odds), Mark: true}, + {Share: 1000 - int(conf.Odds), Mark: false}, + }).Lottery() + + // 赢不了 + if !winner.Bool() { + return lose, nil + } + + return s._odds(list, win, lose, isFixRoll) + } + } + + // 如果都没中奖品,那就不用做奖品处理 + if !verify.InArray(win.MarkType, mtype.FissionDiceMapMarkTypeNormal, mtype.FissionDiceMapMarkTypeSuper) { + return win, nil + } + + res, err = s._reward(win, lose, isFixRoll) + if err != nil { + return + } + + return +} + +// 预览用户返回的数据 +func (s *Dice) _viewWin(rd *rollData) (win *rollData, err error) { + win = rd + + if win.RewardId == 0 { + return + } + + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where(m.ID.Eq(win.RewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := preward.AutoLang(reward.RewardID, s.user.LangMark) + + win.RewardTitle = info.Title + win.ImgUrl = info.ImgUrl + + return +} + +// 概率获取奖品 +func (s *Dice) _odds(diceMaps []*model.FissionDiceMap, win, lose *rollData, isFixRoll bool) (res *rollData, err error) { + var rewardMap = make(map[int64]*model.FissionCampaignReward) + var ids []int64 + var mapIdx = make(map[int]*model.FissionDiceMap) + for idx, v := range diceMaps { + if _, ok := rewardMap[v.RewardID]; !ok { + ids = append(ids, v.RewardID) + rewardMap[v.RewardID] = nil + } + mapIdx[idx] = v + } + + if len(ids) == 0 { + return win, nil + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var signIds []int64 + var signMap = make(map[int64]mtype.CollectRule) + for _, v := range list { + cr := v.GetCollectRule() + if cr.Open == mtype.Yes && cr.SignDay > 0 { + signIds = append(signIds, v.ID) + signMap[v.ID] = cr + } + } + + filterMap, err := s._filterCollect(signIds, signMap) + if err != nil { + return + } + + var allOdds int + var prize []lucky.Reward + for _, v := range list { + + if _, ok := filterMap[v.ID]; ok { + continue + } + + odds := int(v.Odds) + prize = append(prize, lucky.Reward{ + Share: odds, + Mark: v.ID, + }) + + allOdds = allOdds + odds + rewardMap[v.ID] = v + } + + if len(prize) == 0 { + return lose, nil + } + + reward, err := lucky.NewDiscrete(s.Ctx, prize).Lottery() + if err != nil { + return + } + + id := reward.Int64() + + // 概率中奖了,就走到那个中奖的格子 + for idx, diceMap := range mapIdx { + if diceMap.RewardID == id { + win = &rollData{ + MarkType: diceMap.MarkType, + Step: int32(idx), + RewardId: diceMap.RewardID, + MapId: diceMap.ID, + MapHashId: diceMap.HashID, + } + break + } + } + + collect, err := s._rewardCollect(id) + if err != nil { + return + } + + return s._rewardInDb(rewardMap[id], collect, win, lose, isFixRoll) +} + +// 奖品入库 +func (s *Dice) _rewardInDb(reward *model.FissionCampaignReward, collect *model.FissionDiceCollect, win, lose *rollData, isFixRoll bool) (res *rollData, err error) { + var intact bool + var lack bool + if reward.CollectNum == collect.Num+1 { + + //中奖了 + var check bool + check, err = award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().RuleFilter().IsOK() + if err != nil { + return + } + + if !check && !isFixRoll { + return lose, nil + } + + intact = true + lack = !check + } + + cpn, err := finder.Campaign(s.Ctx, reward.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + preward, err := provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := preward.AutoLang(reward.RewardID, s.user.LangMark) + + collectM := s.GetDao().FissionDiceCollect + var up []field.AssignExpr + var record *model.FissionRewardRecord + if intact { + record, err = s._intactReward(reward, lack) + if err != nil { + return + } + + if lack { // 没有库存,那就不让客户看动画了 + up = append(up, collectM.Num.Value(0), collectM.IntactNum.Add(1)) + + // 骰子记录 + var diceRecord = withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CreatedAt: record.CreatedAt, + CampaignID: record.CampaignID, + UserID: record.UserID, + Mark: mtype.FissionDiceRecordMarkReward, + Data: "", + }) + + diceRecord.SetData(&mtype.DiceRecord{ + RewardId: record.RewardID, + RecordId: record.ID, + }) + + err = s._addLog(diceRecord) + if err != nil { + return + } + + } else { // 有库存,让用户看到合成动画 + up = append(up, collectM.Num.Add(1), collectM.RecordID.Value(record.ID)) + } + + } else { // 没有收集完碎片,碎片数 +1 + up = append(up, collectM.Num.Add(1)) + } + + _, err = collectM.WithContext(s.Ctx).Where(collectM.ID.Eq(collect.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + win.RewardTitle = info.Title + win.ImgUrl = info.ImgUrl + win.Intact = intact + win.Lack = lack + + return win, nil +} + +// 完整的奖品处理 +func (s *Dice) _intactReward(reward *model.FissionCampaignReward, lack bool) (record *model.FissionRewardRecord, err error) { + var opts []award.RecordOption + if lack { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + record, _, async, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, false, opts...) + if lack { + return + } + + s.AddOkDone(func() { + for _, fn := range async { + fn() + } + }) + + return +} + +// 加骰子记录 +func (s *Dice) _rollDiceRecord(win *rollData, luckyProp bool) (err error) { + player := s.GetPlayer() + + record := withdefault.FissionDiceRecord(&model.FissionDiceRecord{ + CampaignID: player.CampaignID, + UserID: player.UserID, + }) + + data := &mtype.DiceRecord{ + Point: win.Step + 1, + RewardId: win.RewardId, + } + + // 使用幸运骰子道具 + if luckyProp { + + switch win.MarkType { + case mtype.FissionDiceMapMarkTypeNone: + record.Mark = mtype.FissionDiceRecordMarkLucky + case mtype.FissionDiceMapMarkTypeChance: + record.Mark = mtype.FissionDiceRecordMarkLuckyChance + data.Chance = 1 + default: + record.Mark = mtype.FissionDiceRecordMarkLuckyCollect + } + + record.SetData(data) + + return s._addLog(record) + } + + switch win.MarkType { + case mtype.FissionDiceMapMarkTypeNone: + record.Mark = mtype.FissionDiceRecordMarkRoll + case mtype.FissionDiceMapMarkTypeChance: + record.Mark = mtype.FissionDiceRecordMarkRollChance + data.Chance = 1 + default: + record.Mark = mtype.FissionDiceRecordMarkRollCollect + } + + record.SetData(data) + + return s._addLog(record) +} + +// 结果处理 +func (s *Dice) _rollRes(win *rollData) (res RollRes, err error) { + run, err := s._runMap() + if err != nil { + return + } + + // 更新地图信息 + runM := s.GetDao().FissionDiceRun + _, err = runM.WithContext(s.Ctx).Where(runM.ID.Eq(run.ID)).UpdateSimple( + runM.MapID.Value(win.MapId), + runM.MapHashID.Value(win.MapHashId), + runM.GoStep.Add(int64(win.Step)+1), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + res.MarkType = int32(win.MarkType) + res.MapHashId = win.MapHashId + res.RewardTitle = win.RewardTitle + res.ImgUrl = win.ImgUrl + res.IsIntact = win.Intact + res.RollNum = win.Step + 1 + res.Lack = win.Lack + res.RewardId = win.RewardId + + return +} + +func (s *Dice) _reward(win, lose *rollData, isFixRoll bool) (res *rollData, err error) { + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.Ctx).Where(m.ID.Eq(win.RewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil || reward.IsDel == mtype.Yes { + return lose, nil + } + + collect, err := s._rewardCollect(reward.ID) + if err != nil { + return + } + + cr := reward.GetCollectRule() + if cr.Open == mtype.Yes { + collectNum := cr.InitCollect + ((collect.SignNum / cr.SignDay) * cr.AddCollect) + if collect.Num >= collectNum { + return lose, nil + } + } + + return s._rewardInDb(reward, collect, win, lose, isFixRoll) +} + +// 用户道具 +func (s *Dice) _propOrCreate(mark string) (prop *model.FissionDiceProp, err error) { + user := s.user + m := s.GetDao().FissionDiceProp + err = lockdo.FindNilDo( + s.Ctx, + ckey.FissionUserCreateDicePropOnce(user.ID, mark), + func() (none bool, err error) { + prop, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.Mark.Eq(mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return prop == nil, nil + }, + func() (err error) { + prop = withdefault.FissionDiceProp(&model.FissionDiceProp{ + UserID: user.ID, + CampaignID: user.CampaignID, + Mark: mark, + Num: 0, + TotalNum: 0, + }) + if err = m.WithContext(s.Ctx).Create(prop); err != nil { + err = s.BE().MysqlError(err) + return + } + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *Dice) _filterCollect(ids []int64, signMap map[int64]mtype.CollectRule) (filter map[int64]struct{}, err error) { + filter = make(map[int64]struct{}) + + if len(ids) == 0 { + return + } + + player := s.GetPlayer() + m := s.GetDao().FissionDiceCollect + + list, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.RewardID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + cr := signMap[v.RewardID] + collectNum := cr.InitCollect + ((v.SignNum / cr.SignDay) * cr.AddCollect) + if v.Num >= collectNum { + filter[v.RewardID] = struct{}{} + } + } + + return +} diff --git a/internal/service/provider/players/flip.go b/internal/service/provider/players/flip.go new file mode 100644 index 0000000..bf43693 --- /dev/null +++ b/internal/service/provider/players/flip.go @@ -0,0 +1,376 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/proto/go_proto/workerr" +) + +// Flip 翻牌交互逻辑 +type Flip struct { + Player + player *model.FissionFlip + conf *model.FissionCampaignFlip + + fissionPlayerSetInitOnceKey string +} + +func NewFlip(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Flip, err error) { + player = &Flip{} + + err = player.Init(ctx, user, consts.IdFlip, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Flip) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionFlip + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionFlipLog(&model.FissionFlipLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + FlipID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Flip) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Flip) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Flip) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionFlipLog + for _, task := range tasks { + next, t, source, lotteryVal := s._lotteryTask(checkManual, task) + if next { + continue + } + + val, _ := jsonm.MarshalToString(lotteryVal) + + log := withdefault.FissionFlipLog(&model.FissionFlipLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + FlipID: player.ID, + Type: t, + Source: source, + Val: val, + }) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionFlip + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + s.addChanceNotify(int64(chance)) + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Flip) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + // 抽奖 + reward, err = s._lottery() + if err != nil { + return + } + + if s.IsView() { + preward, _ := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + info, _ = preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + return + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionFlip + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionFlipLog(&model.FissionFlipLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + FlipID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Flip) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionFlip + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionFlipLog(&model.FissionFlipLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + FlipID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Flip) GetConf() *model.FissionCampaignFlip { + if s.conf == nil { + s.conf, _ = cache.NewCampaignFlip(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Flip) GetPlayer() *model.FissionFlip { + return s.player +} + +// 玩家 +func (s *Flip) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Flip) firstOrCreate() (player *model.FissionFlip, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Flip) _dbFirst() (*model.FissionFlip, error) { + playerM := dao.FissionFlip + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Flip) createPlayer() (player *model.FissionFlip, err error) { + playerM := dao.FissionFlip + player = withdefault.FissionFlip(&model.FissionFlip{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Flip) _addLog(logs ...*model.FissionFlipLog) (err error) { + if len(logs) == 0 { + return + } + err = s.GetDao().FissionFlipLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 增加抽奖次数通知 +func (s *Flip) addChanceNotify(chance int64) { + provider.NewFissionClue(s.Ctx, s.user.ID).AddChance(chance) +} diff --git a/internal/service/provider/players/gashapon.go b/internal/service/provider/players/gashapon.go new file mode 100644 index 0000000..ab8c62f --- /dev/null +++ b/internal/service/provider/players/gashapon.go @@ -0,0 +1,419 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/proto/go_proto/workerr" +) + +// Gashapon 现金转盘交互逻辑 +type Gashapon struct { + Player + player *model.FissionGashapon + conf *model.FissionCampaignGashapon + + fissionPlayerSetInitOnceKey string +} + +func NewGashapon(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Gashapon, err error) { + player = &Gashapon{} + + err = player.Init(ctx, user, consts.IdGashapon, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +func (s *Gashapon) PointsUse() (status int32, err error) { + player := s.GetPlayer() + logM := s.GetDao().FissionGashaponLog + + status, deduct, err := s.pointsUse(mtype.FissionPointsLogSourceGashapon, logM.TableName(), mtype.PointsLogOther{ + PlayerId: player.ID, + }, []*pointsUseCond{ + { + Field: logM.Type.ColumnName().String(), + Value: mtype.LotteryFissionTypeAdd, + }, + { + Field: logM.Source.ColumnName().String(), + Value: mtype.FissionLogSourcePointsUse, + }, + }) + defer s.pointsUseOk(deduct) + + if status != pointsUseOk || err != nil || deduct == nil { + return + } + + m := s.GetDao().FissionGashapon + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Add(1)) + if err != nil { + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + PointsNum: deduct.Num, + }) + + log := withdefault.FissionGashaponLog(&model.FissionGashaponLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GashaponID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourcePointsUse, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Gashapon) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionGashapon + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionGashaponLog(&model.FissionGashaponLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GashaponID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Gashapon) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Gashapon) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Gashapon) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionGashaponLog + for _, task := range tasks { + next, t, source, lotteryVal := s._lotteryTask(checkManual, task) + if next { + continue + } + + val, _ := jsonm.MarshalToString(lotteryVal) + log := withdefault.FissionGashaponLog(&model.FissionGashaponLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GashaponID: player.ID, + Type: t, + Source: source, + Val: val, + }) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionGashapon + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Gashapon) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + // 抽奖 + reward, err = s._lottery() + if err != nil { + return + } + + if s.IsView() { + preward, _ := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + info, _ = preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + return + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionGashapon + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionGashaponLog(&model.FissionGashaponLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GashaponID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Gashapon) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionGashapon + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionGashaponLog(&model.FissionGashaponLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GashaponID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Gashapon) GetConf() *model.FissionCampaignGashapon { + if s.conf == nil { + s.conf, _ = cache.NewCampaignGashapon(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Gashapon) GetPlayer() *model.FissionGashapon { + return s.player +} + +// 玩家 +func (s *Gashapon) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Gashapon) firstOrCreate() (player *model.FissionGashapon, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Gashapon) _dbFirst() (*model.FissionGashapon, error) { + playerM := dao.FissionGashapon + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Gashapon) createPlayer() (player *model.FissionGashapon, err error) { + playerM := dao.FissionGashapon + player = withdefault.FissionGashapon(&model.FissionGashapon{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Gashapon) _addLog(logs ...*model.FissionGashaponLog) (err error) { + if len(logs) == 0 { + return + } + err = s.GetDao().FissionGashaponLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/players/gashapon_test.go b/internal/service/provider/players/gashapon_test.go new file mode 100644 index 0000000..b321bb3 --- /dev/null +++ b/internal/service/provider/players/gashapon_test.go @@ -0,0 +1,121 @@ +package players + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/withdefault" + "testing" + + _ "joybuywork/test" + + "github.com/rs/xid" +) + +var ( + testGashaponCampaignID int64 = 4602 + testGashaponUserID int64 = 276303329544409088 +) + +func createTestGashaponUser(ctx context.Context) (*model.FissionUser, error) { + user := withdefault.FissionUser(&model.FissionUser{ + CampaignID: testGashaponCampaignID, + SubUserID: xid.New().String(), + LangMark: "zh", + }) + + m := dao.Q.FissionUser.SubTable(testGashaponCampaignID) + err := m.WithContext(ctx).Create(user) + if err != nil { + return nil, err + } + + return user, nil +} + +func testNewGashaponUser(ctx context.Context, t *testing.T, newUser bool) *Gashapon { + var user *model.FissionUser + var err error + if newUser { + user, err = createTestGashaponUser(ctx) + if err != nil { + t.Error(err) + } + } else { + user, err = cache.NewFissionUser(ctx, testGashaponCampaignID).FindById(testGashaponUserID) + if err != nil { + t.Error(err) + } + user.LangMark = "zh" + } + + kg, err := NewGashapon(ctx, user) + if err != nil { + t.Error(err) + } + + return kg +} + +func TestNewGashapon(t *testing.T) { + ctx := context.Background() + kg := testNewGashaponUser(ctx, t, true) + t.Log(kg.GetPlayer()) +} + +func TestGashaponSign(t *testing.T) { + ctx := context.Background() + kg := testNewGashaponUser(ctx, t, true) + + err := kg.Sign() + if err != nil { + t.Error(err) + } + + t.Log(kg.GetPlayer()) +} + +func TestGashaponSetInit(t *testing.T) { + ctx := context.Background() + kg := testNewGashaponUser(ctx, t, true) + + err := kg.SetInit() + if err != nil { + t.Error(err) + } + + t.Log(kg.GetPlayer()) +} + +func TestGashaponLottery(t *testing.T) { + ctx := context.Background() + kg := testNewGashaponUser(ctx, t, true) + + reward, info, record, err := kg.Lottery() + if err != nil { + t.Error(err) + } + + t.Log(reward, info, record) +} + +func TestGashaponPointsUse(t *testing.T) { + ctx := context.Background() + kg := testNewGashaponUser(ctx, t, true) + + status, err := kg.PointsUse() + if err != nil { + t.Error(err) + } + + t.Log(status) +} + +func TestGashaponGetConf(t *testing.T) { + ctx := context.Background() + kg := testNewGashaponUser(ctx, t, true) + + conf := kg.GetConf() + t.Log(conf) +} diff --git a/internal/service/provider/players/gold.go b/internal/service/provider/players/gold.go new file mode 100644 index 0000000..7230ae7 --- /dev/null +++ b/internal/service/provider/players/gold.go @@ -0,0 +1,579 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils" + "math/rand" + "strconv" + "strings" + "time" + + "joybuywork/proto/go_proto/workerr" + + "github.com/golang-module/carbon/v2" +) + +const ( + goldSpinEnergy = 100 // 转盘消耗能量 +) + +const ( + goldFailTypeEnergyLack = iota + 1 // 能量不足 + goldFailTypeRewardLack // 奖品库存不足 +) + +// Gold 金币任务交互逻辑 +type Gold struct { + Player + player *model.FissionGold + conf *model.FissionCampaignGold + + blindLang string +} + +func NewGold(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Gold, err error) { + player = &Gold{} + + err = player.Init(ctx, user, consts.IdGold, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Gold) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + var chance int32 + var logs = make([]*model.FissionGoldLog, 0, len(tasks)) + + var goldNum = player.GoldNum + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + val := mtype.GoldLogVal{ + TaskId: task.ID, + Chance: task.Chance, + } + + log := withdefault.FissionGoldLog(&model.FissionGoldLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GoldID: player.ID, + Type: mtype.FissionGoldLogTypeDoTask, + }) + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + log.Source = mtype.FissionLogSourceRegister + case mtype.FissionCampaignTaskTypeInstall: + log.Source = mtype.FissionLogSourceInstall + case mtype.FissionCampaignTaskTypeCondAll: + log.Source = mtype.FissionLogSourceCondAll + case mtype.FissionCampaignTaskTypeCondOne: + log.Source = mtype.FissionLogSourceCondOne + val.CondId = utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark) + } + + goldNum += task.Chance + + log.Val, _ = jsonm.MarshalToString(val) + logs = append(logs, log) + } + + provider.NewFissionClue(s.Ctx, player.UserID).AddGold(player.ID, int64(player.GoldNum), int64(chance)) + + m := s.GetDao().FissionGold + if conf.GoldNum > goldNum { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.GoldNum.Add(chance)) + if err != nil { + return + } + + return s._addLog(logs...) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.GoldNum.Add(chance), m.NextStep.Value(mtype.FissionGoldNextStepGoldRain)) + if err != nil { + return + } + + return s._addLog(logs...) +} + +// Clue 金币获得提醒 +func (s *Gold) Clue() (old, add int32) { + player := s.GetPlayer() + clue := provider.NewFissionClue(s.Ctx, player.UserID).GetGold() + + if clue.GoldId != player.ID { + return + } + + old = int32(clue.OldGold) + add = int32(clue.Add) + + return +} + +// Spin 转转盘 +func (s *Gold) Spin() (id int64, failType int32, err error) { + cpn, user := s.cpn, s.user + player, conf := s.GetPlayer(), s.GetConf() + + if player.Energy < goldSpinEnergy { + failType = goldFailTypeEnergyLack + return + } + + var logs []*model.FissionGoldLog + defer func() { + if err != nil || len(logs) == 0 { + return + } + + err = s._addLog(logs...) + }() + + if player.LotteryNum == 0 { + id = 4 + + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.Energy.Sub(goldSpinEnergy), + m.LotteryNum.Add(1), + m.ShowPrice.Add(0.99), + m.NextStep.Value(mtype.FissionGoldNextStepLastSpin), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(&mtype.GoldLogVal{ + Cash: 0.99, + }) + + logs = append(logs, withdefault.FissionGoldLog(&model.FissionGoldLog{ + CampaignID: cpn.ID, + UserID: user.ID, + GoldID: player.ID, + Type: mtype.FissionGoldLogTypeLottery, + Source: mtype.FissionGoldLogSourceLottery, + Val: val, + })) + + return + } + + // 有库存限制 + if conf.PriceNum > 0 { + if conf.Lack == mtype.Yes { + failType = goldFailTypeRewardLack + return + } + + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + var ok bool + ok, err = stock.DecrPoolAndAdd(cpn.ID, 1) + if err != nil { + return + } + + if !ok { + if conf.Lack == mtype.No { + confM := s.GetDao().FissionCampaignGold + _, err = confM.WithContext(s.Ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(confM.Lack.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewCampaignGold(s.Ctx).Clear(conf) + } + + failType = goldFailTypeRewardLack + return + } + } + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + var rewards []*model.FissionCampaignReward + rewards, err = cm.UserAppReward(s.user) + if err != nil { + return + } + + var addRewards = make([]*award.RewardOne, 0, len(rewards)) + var ids []int64 + for _, reward := range rewards { + addRewards = append(addRewards, &award.RewardOne{Reward: reward}) + } + + rewardsRes, _, err := award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).Batch(addRewards, true) + if err != nil { + return + } + + for _, reward := range rewardsRes { + ids = append(ids, reward.Record.ID) + } + + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.Energy.Sub(goldSpinEnergy), + m.LotteryNum.Add(1), + m.ShowPrice.Add(0.01), + m.NextStep.Value(mtype.FissionGoldNextStepShowReward), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(&mtype.GoldLogVal{ + Cash: 0.01, + }) + + rewardVal, _ := jsonm.MarshalToString(&mtype.GoldLogVal{ + RecordIds: ids, + }) + + logs = append(logs, withdefault.FissionGoldLog(&model.FissionGoldLog{ + CampaignID: cpn.ID, + UserID: user.ID, + GoldID: player.ID, + Type: mtype.FissionGoldLogTypeLottery, + Source: mtype.FissionGoldLogSourceLottery, + Val: val, + }), withdefault.FissionGoldLog(&model.FissionGoldLog{ + CampaignID: cpn.ID, + UserID: user.ID, + GoldID: player.ID, + Type: mtype.FissionGoldLogTypeReward, + Source: mtype.FissionGoldLogSourceReward, + Val: rewardVal, + })) + + id = 1 + return +} + +// GoldRain 弹窗还差最后一次抽奖获得奖品动画 +func (s *Gold) GoldRain() (err error) { + player := s.player + if player.NextStep != mtype.FissionGoldNextStepGoldRain { + return + } + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.NextStep.Value(mtype.FissionGoldNextStepNone), + m.Energy.Add(1), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// LastSpin 弹窗还差最后一次抽奖获得奖品动画 +func (s *Gold) LastSpin() (err error) { + player := s.player + if player.NextStep != mtype.FissionGoldNextStepLastSpin { + return + } + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.NextStep.Value(mtype.FissionGoldNextStepNone), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// ShowReward 播放展示奖品动画 +func (s *Gold) ShowReward() (err error) { + player := s.player + if player.NextStep != mtype.FissionGoldNextStepShowReward { + return + } + + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.NextStep.Value(mtype.FissionGoldNextStepNone), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// TriggerShare 赠送动画 +func (s *Gold) TriggerShare() (err error) { + player := s.GetPlayer() + + if player.NextStep != mtype.FissionGoldNextStepTriggerShare { + return + } + + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.ShowPrice.Add(1), + m.Energy.Add(100), + m.NextStep.Value(mtype.FissionGoldNextStepNone), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// OpenGift 播放开盒子动画 +func (s *Gold) OpenGift() (openBox, leftBox, rightBox float64, err error) { + player, cpn, conf := s.GetPlayer(), s.cpn, s.GetConf() + + if player.NextStep != mtype.FissionGoldNextStepOpenGift { + return + } + + spl := cpn.GetLangMarks() + var price = conf.Price + if player.Lang != spl[0] { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, player.Lang) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + err = workerr.NotFound("not found cash conf") + return + } + + if c := lang.GetGold(); c != nil { + price = c.Price + } + } + + openBox = price - 2 + + if strings.Contains(strconv.FormatFloat(price, 'f', -1, 64), ".") { + leftBox = openBox - float64(rand.Int31n(5)+15) - float64(rand.Int31n(50)+15)/100 + rightBox = openBox - float64(rand.Int31n(5)+10) - float64(rand.Int31n(30)+10)/100 + } else { + leftBox = openBox - float64(rand.Int31n(5)+15) + rightBox = openBox - float64(rand.Int31n(5)+10) + } + + m := s.GetDao().FissionGold + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.ShowPrice.Value(openBox), + m.NextStep.Value(mtype.FissionGoldNextStepTriggerShare), + m.Energy.Value(99), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(&mtype.GoldLogVal{ + Cash: openBox, + }) + + err = s._addLog(withdefault.FissionGoldLog(&model.FissionGoldLog{ + CampaignID: player.CampaignID, + UserID: player.UserID, + GoldID: player.ID, + Type: mtype.FissionGoldLogTypeOpenGift, + Source: mtype.FissionGoldLogSourceOpenGift, + Val: val, + })) + + return +} + +// RefreshView 刷新预览用户 +func (s *Gold) RefreshView() (err error) { + if !s.IsView() { + err = s.BE().VerifyError("非预览用户无法重新体验") + return + } + + player := s.GetPlayer() + + m := s.GetDao().FissionGoldLog + _, err = m.WithContext(s.Ctx).Where(m.GoldID.Eq(player.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + playerM := s.GetDao().FissionGold + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// GetConf 获取玩法配置 +func (s *Gold) GetConf() *model.FissionCampaignGold { + if s.conf == nil { + s.conf, _ = cache.NewCampaignGold(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Gold) GetPlayer() *model.FissionGold { + return s.player +} + +// 玩家 +func (s *Gold) initPlayer() (err error) { + user, sp := s.user, s.cpn.GetLangMarks() + + lang := utils.NotExistGetFirst(user.LangMark, sp) + s.blindLang = lang + + player, err := s._dbFirst(lang) + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + }() + + if player != nil { + // 没有过期,或者已经完成了任务 + if player.ExpiredIn > time.Now().Unix() || player.LotteryNum >= int8(len(consts.SpinGetId)) { + return + } + + // 过期了 + playerM := s.GetDao().FissionGold + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.IsExpired.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + player, err = s.firstOrCreate(lang) + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Gold) firstOrCreate(lang string) (player *model.FissionGold, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst(lang) + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer(lang) +} + +func (s *Gold) createPlayer(lang string) (player *model.FissionGold, err error) { + conf := s.GetConf() + + playerM := dao.FissionGold + player = withdefault.FissionGold(&model.FissionGold{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + LotteryNum: 0, + NextStep: mtype.FissionGoldNextStepOpenGift, + Energy: 0, + ShowPrice: 0, + ExpiredIn: carbon.Now().AddDays(int(conf.ExpiredDay)).Timestamp(), + IsExpired: 0, + Lang: lang, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Gold) _dbFirst(lang string) (*model.FissionGold, error) { + playerM := dao.FissionGold + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID), playerM.Lang.Value(lang), playerM.IsExpired.Eq(mtype.No)).Last() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +func (s *Gold) _addLog(logs ...*model.FissionGoldLog) (err error) { + err = s.GetDao().FissionGoldLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/players/gold_test.go b/internal/service/provider/players/gold_test.go new file mode 100644 index 0000000..c8ae8d9 --- /dev/null +++ b/internal/service/provider/players/gold_test.go @@ -0,0 +1,31 @@ +package players + +import ( + "context" + "joybuywork/internal/repository/cache" + _ "joybuywork/test" + "testing" +) + +func TestGoldSpin(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 4438).FindById(253453927955017728) + if err != nil { + t.Error(err) + } + + user.LangMark = "zh" + + kg, err := NewGold(ctx, user) + if err != nil { + t.Error(err) + } + + num, add, err := kg.Spin() + if err != nil { + t.Error(err) + } + + t.Log(num, add) +} diff --git a/internal/service/provider/players/grid.go b/internal/service/provider/players/grid.go new file mode 100644 index 0000000..0909a79 --- /dev/null +++ b/internal/service/provider/players/grid.go @@ -0,0 +1,370 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/proto/go_proto/workerr" +) + +// Grid 现金转盘交互逻辑 +type Grid struct { + Player + player *model.FissionGrid + conf *model.FissionCampaignGrid + + fissionPlayerSetInitOnceKey string +} + +func NewGrid(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Grid, err error) { + player = &Grid{} + + err = player.Init(ctx, user, consts.IdLuckyGrid, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Grid) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionGrid + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionGridLog(&model.FissionGridLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GridID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Grid) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Grid) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Grid) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionGridLog + for _, task := range tasks { + next, t, source, lotteryVal := s._lotteryTask(checkManual, task) + if next { + continue + } + + val, _ := jsonm.MarshalToString(lotteryVal) + + log := withdefault.FissionGridLog(&model.FissionGridLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GridID: player.ID, + Type: t, + Source: source, + Val: val, + }) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionGrid + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Grid) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + // 抽奖 + reward, err = s._lottery() + if err != nil { + return + } + + if s.IsView() { + preward, _ := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + info, _ = preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + return + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionGrid + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionGridLog(&model.FissionGridLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GridID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Grid) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionGrid + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionGridLog(&model.FissionGridLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + GridID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Grid) GetConf() *model.FissionCampaignGrid { + if s.conf == nil { + s.conf, _ = cache.NewCampaignGrid(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Grid) GetPlayer() *model.FissionGrid { + return s.player +} + +// 玩家 +func (s *Grid) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Grid) firstOrCreate() (player *model.FissionGrid, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Grid) _dbFirst() (*model.FissionGrid, error) { + playerM := dao.FissionGrid + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Grid) createPlayer() (player *model.FissionGrid, err error) { + playerM := dao.FissionGrid + player = withdefault.FissionGrid(&model.FissionGrid{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Grid) _addLog(logs ...*model.FissionGridLog) (err error) { + if len(logs) == 0 { + return + } + err = s.GetDao().FissionGridLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/players/keep_dog.go b/internal/service/provider/players/keep_dog.go new file mode 100644 index 0000000..d114dc1 --- /dev/null +++ b/internal/service/provider/players/keep_dog.go @@ -0,0 +1,1980 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/timez" + "fmt" + "math" + "time" + + "gorm.io/gen/field" +) + +const ( + keepMachineLimitNone = iota + keepMachineLimitDone // 被限制不能领取了 + keepMachineLimitWait // 还没有到时间 +) + +// KeepDog 激励养成交互逻辑 +type KeepDog struct { + Player + player *model.FissionKeep + conf *model.FissionCampaignKeep + propFeedNumKey string // 道具喂养次数key + dayFirstInviteKey string // 当天首次喂养状态key + getMachineLastKey string + machineSaveKey string + machineNotSaveKey string + dogFoodLimit string // 狗粮限制缓存状态 +} + +func NewKeepDog(ctx context.Context, user *model.FissionUser, opts ...Option) (player *KeepDog, err error) { + player = &KeepDog{} + + err = player.Init(ctx, user, consts.IdKeep, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return nil, err + } + + return +} + +// TaskLimit 任务是否能完成 +func (s *KeepDog) TaskLimit(task *model.FissionCampaignTask) (limit bool, err error) { + player := s.GetPlayer() + if player.RewardID == 0 || player.ExpiredAt <= time.Now().Unix() { + return true, nil + } + + return +} + +// ReceiveReward 手动领取奖励 +func (s *KeepDog) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *KeepDog) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *KeepDog) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionKeepLog + for _, task := range tasks { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + continue + } + + var source = mtype.FissionKeepLogSourceFinishTask + if task.TaskType == mtype.FissionCampaignTaskTypeCondAll { + source = mtype.FissionKeepLogSourceFinishAllTask + } + + log := &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Source: source, + } + + if task.PropMark == mtype.FissionCampaignTaskPropMarkChance { + log.Type = mtype.FissionKeepLogTypeProp + log.Val = fmt.Sprint(task.Chance) + log.ValSource, _ = jsonm.MarshalToString(mtype.KeepLogValSource{ + TaskId: task.ID, + Chance: task.Chance, + }) + + chance += task.Chance + } else { + log.Type = mtype.FissionKeepLogTypeReward + log.Val = "1" + log.ValSource, _ = jsonm.MarshalToString(mtype.KeepLogValSource{ + TaskId: task.ID, + RewardId: task.RewardID, + }) + } + + logs = append(logs, log) + } + + if chance > 0 { + playerM := s.GetDao().FissionKeep + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Num.Add(chance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(logs) > 0 { + err = s.addKeepLog(logs...) + if err != nil { + return + } + } + + return +} + +const ( + KeepDogRewardSelectStatusOk = iota // 成功 + KeepDogRewardSelectStatusRemove // 奖品下架 + KeepDogRewardSelectStatusLack // 奖品不足 + KeepDogRewardSelectStatusLimit // 奖品已经是获得的最大限制 +) + +// ChildActive 完成子活动 +func (s *KeepDog) ChildActive(num int32, childType int8) (err error) { + player := s.GetPlayer() + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var source string + switch childType { + case mtype.FissionCampaignChildTypeInvite: + source = mtype.FissionKeepLogSourceChildInvite + case mtype.FissionCampaignChildTypeSign: + source = mtype.FissionKeepLogSourceChildSign + case mtype.FissionCampaignChildTypeLucky: + source = mtype.FissionKeepLogSourceChildLucky + case mtype.FissionCampaignChildTypeBlind: + source = mtype.FissionKeepLogSourceChildBlind + case mtype.FissionCampaignChildTypeTask: + source = mtype.FissionKeepLogSourceChildTask + } + + return s.addKeepLog(&model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: source, + Val: fmt.Sprint(num), + }) +} + +// RewardSelect 选择奖品 +func (s *KeepDog) RewardSelect(rewardId int64) (status int32, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if player.RewardID != 0 { + return + } + + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(rewardId), rewardM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + return KeepDogRewardSelectStatusRemove, nil + } + + // 非预览用户占用库存 + if !s.IsView() { + var point string + var ok bool + point, ok, err = award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductSelectStock().RuleFilter().PointOK() + if err != nil { + return + } + + if !ok { + switch point { + case award.IssVerifyPointDeductPreStock: + return KeepDogRewardSelectStatusLack, nil + case award.IssVerifyPointRuleFilter: + return KeepDogRewardSelectStatusLimit, nil + } + return + } + } + + m := dao.FissionKeep + var up = []field.AssignExpr{ + m.RewardID.Value(rewardId), + m.Step.Value(1), + m.Num.Value(conf.InitGet), + m.ExpiredAt.Value(time.Now().AddDate(0, 0, int(conf.FeedCycle)).Unix()), + } + + if conf.MachineType == mtype.FissionCampaignKeepMachineTypeOffline { + up = append(up, m.ReceiveOffline.Value(time.Now().Unix())) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf.InitGet > 0 { + err = s.addKeepLog(&model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceInitGet, + Val: fmt.Sprint(conf.InitGet), + }) + if err != nil { + return + } + } + + // 预览用户不用处理下面的邀请、埋点动作、奖品被选的动作 + if s.IsView() { + return + } + + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).Grow(time.Now().Unix(), rewardId) + statM := dao.FissionUserStat + _, err = statM.WithContext(s.Ctx).Where(statM.UserID.Eq(player.UserID)).UpdateSimple(statM.GrowNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + hmap, err := cachecurd.NewHMap(s.Ctx, ckey.FissionKeepRewardSelectedUser(player.CampaignID), cachecurd.SetKeepRewardSelectBuild(player.CampaignID)) + if err != nil { + return + } + + _, err = hmap.Incr(fmt.Sprint(rewardId), 1) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.user.ParentID == 0 || s.user.IsHelp == mtype.No { + return + } + + dayFirst, err := s.dayFirst() + if err != nil { + return + } + + parent, err := cache.NewFissionUser(s.Ctx, player.CampaignID).FindById(s.user.ParentID) + if err != nil { + return + } + + pkd, err := NewKeepDog(s.Ctx, parent) + if err != nil { + return + } + + err = pkd.InviteSelect(dayFirst) + if err != nil { + return + } + + return +} + +type KeepDogCollectReward struct { + RewardType int32 + Chance int32 + RewardId int64 + RewardTitle string + RewardImg string + Lack bool + RewardRecordId int64 + LastReward bool + ReceiveType int32 +} + +// Collect 收集一级道具 +func (s *KeepDog) Collect() (num int32, gets []*KeepDogCollectReward, err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.Collect == 0 || player.RecordID > 0 { + return + } + + collectNum := player.CollectNum + player.Collect + var logs = []*model.FissionKeepLog{ + { + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeLove, + Source: mtype.FissionKeepLogSourceCollect, + Val: fmt.Sprintf("%d", player.Collect), + }, + } + + m := dao.FissionKeep + var keepUp = []field.AssignExpr{ + m.CollectNum.Add(player.Collect), + m.Collect.Value(0), + } + defer func() { + if err != nil { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(keepUp...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.addKeepLog(logs...) + if err != nil { + return + } + + num = player.Collect + }() + + if player.Step == 4 { + + if collectNum < conf.Collect { + return + } + + var get *KeepDogCollectReward + get, err = s.finishKeep() + if err != nil { + return + } + + gets = append(gets, get) + + keepUp = append(keepUp, m.Step.Value(0), m.RecordID.Value(get.RewardRecordId)) + + return + } + + stepM := dao.FissionCampaignKeepStep + steps, err := stepM.WithContext(s.Ctx).Where(stepM.CampaignID.Eq(player.CampaignID)).Order(stepM.Step).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var stepMap = make(map[int32]*model.FissionCampaignKeepStep) + for _, step := range steps { + stepMap[step.Step] = step + } + + var finishStep []int32 + var chance int32 + var rewardIds []int64 + var nextStep = player.Step + for i := player.Step; i <= 3; i++ { + step := stepMap[i] + needNum := s.stepPercent(conf.Collect, step.Percent) + if needNum > float64(collectNum) { + break + } + + nextStep++ + finishStep = append(finishStep, step.Step) + + switch step.RewardType { + case mtype.FissionCampaignKeepStepRewardTypeProp: + + chance += step.RewardNum + + gets = append(gets, &KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeProp, + Chance: step.RewardNum, + }) + + val, _ := jsonm.MarshalToString(mtype.KeepLogValSource{ + Step: step.Step, + Chance: step.RewardNum, + }) + + logs = append(logs, &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceStep, + Val: fmt.Sprintf("%d", step.RewardNum), + ValSource: val, + }) + + case mtype.FissionCampaignKeepStepRewardTypeReward: + + rewardIds = append(rewardIds, step.RewardID) + + val, _ := jsonm.MarshalToString(mtype.KeepLogValSource{ + Step: step.Step, + RewardId: step.RewardID, + }) + + logs = append(logs, &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeReward, + Source: mtype.FissionKeepLogSourceStep, + Val: fmt.Sprintf("%d", step.RewardNum), + ValSource: val, + }) + } + } + + if nextStep == 4 && collectNum >= conf.Collect { + var get *KeepDogCollectReward + get, err = s.finishKeep() + if err != nil { + return + } + + // 最终奖品放最后 + defer func() { + gets = append(gets, get) + }() + + keepUp = append(keepUp, m.RecordID.Value(get.RewardRecordId)) + nextStep = 0 + } + + keepUp = append(keepUp, m.Step.Value(nextStep), m.Num.Add(chance)) + + if len(rewardIds) == 0 { + return + } + + rewardM := dao.FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + cpn := s.cpn + + // 预览用户直接显示奖品 + if s.IsView() { + var bids []int64 + var bMap = make(map[int64]struct{}) + for _, v := range rewards { + if _, ok := bMap[v.RewardID]; !ok { + bids = append(bids, v.RewardID) + bMap[v.RewardID] = struct{}{} + } + } + + var preward *provider.Rewards + preward, err = provider.NewRewards(s.Ctx, cpn.ProjectID, bids...) + if err != nil { + return + } + + for _, v := range rewards { + info, _ := preward.InfoAutoLang(v.RewardID, s.user.LangMark) + gets = append(gets, &KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeReward, + RewardId: v.ID, + RewardTitle: info.Title, + RewardImg: info.ImgUrl, + ReceiveType: info.ReceiveType, + }) + } + + return + } + + var sendRewards = make([]*award.RewardOne, 0, len(rewards)) + for _, v := range rewards { + + one := &award.RewardOne{ + Reward: v, + Opts: nil, + } + + var ok bool + ok, err = award.NewAwardIssVerify(s.Ctx, s.user, v).DeductStock().IsOK() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if !ok { + one.Opts = append(one.Opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + sendRewards = append(sendRewards, one) + } + + records, _, err := award.NewAwardReward(s.Ctx, dao.Q, cpn.ProjectID, s.user).Batch(sendRewards, true) + if err != nil { + return + } + + for _, v := range records { + gets = append(gets, &KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeReward, + RewardId: v.Record.RewardID, + RewardTitle: v.Info.Title, + RewardImg: v.Info.ImgUrl, + Lack: v.Record.FailMsg == mtype.FissionRewardRecordFailTypeCliLackMsg, + RewardRecordId: v.Record.ID, + ReceiveType: v.Info.ReceiveType, + }) + } + + return +} + +const ( + KeepDogFeedStatusOk = iota // 喂养成功 + KeepDogFeedStatusMaxCollect // 收集数达到最大 + KeepDogFeedStatusLack // 狗粮不足 + KeepDogFeedStatusGetFeedNum // 需要收喂养次数道具 +) + +// Feed 喂养 +func (s *KeepDog) Feed() (status, addSecond int32, err error) { + player, conf, key := s.GetPlayer(), s.GetConf(), s.propFeedNumKey + + num, propNum, err := s.feedNum() + if err != nil { + return + } + + if propNum >= int64(conf.FeedGetNum) { + return KeepDogFeedStatusGetFeedNum, 0, nil + } + + if player.Num < conf.FeedNum { + return KeepDogFeedStatusLack, 0, nil + } + + if player.Collect >= 4 { + return KeepDogFeedStatusMaxCollect, 0, nil + } + + decr := conf.FeedNum + collectNum := player.CollectNum + second := player.SecondNum + decr + m := dao.FissionKeep + var up []field.AssignExpr + + if second < conf.CollectSecond { + up = append(up, m.SecondNum.Value(second), m.Num.Sub(decr)) + } else if collectNum == 3 { + decr = conf.CollectSecond - player.SecondNum + up = append(up, m.SecondNum.Value(0), m.Collect.Add(1), m.Num.Sub(decr)) + } else { + var incr int32 + for { + second -= conf.CollectSecond + incr++ + + if incr+collectNum == 4 { + decr = (conf.CollectSecond - player.SecondNum) + incr*conf.CollectSecond + second = 0 + break + } + + if second < conf.CollectSecond { + break + } + } + + up = append(up, m.SecondNum.Value(second), m.Collect.Add(incr), m.Num.Sub(decr)) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + defer func() { + if err != nil { + return + } + + err = s.addKeepLog(&model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeFeed, + Source: mtype.FissionKeepLogSourceFeed, + Val: fmt.Sprintf("%d", decr), + }) + if err != nil { + return + } + + app.Redis.Cache.HIncrBy(s.Ctx, key, keepDogFeedNumMapAllNumKey, 1) + app.Redis.Cache.HIncrBy(s.Ctx, key, keepDogFeedNumMapPropNumKey, 1) + + addSecond = (decr * 100) / conf.CollectSecond + }() + + if num+1 == 3 && s.HelpOk() { + var dayFirst bool + dayFirst, err = s.dayFirst() + if err != nil { + return + } + + var parent *model.FissionUser + parent, err = cache.NewFissionUser(s.Ctx, player.CampaignID).FindById(s.user.ParentID) + if err != nil { + return + } + + var pkd *KeepDog + pkd, err = NewKeepDog(s.Ctx, parent) + if err != nil { + return + } + + err = pkd.InviteThirdFeed(dayFirst) + if err != nil { + return + } + } + + return +} + +// MachineRecycle 回收机器产生的道具 +func (s *KeepDog) MachineRecycle(num float64) (limit, numVal int32, err error) { + tz := provider.NewCampaignTZ(s.Ctx, s.cpn, s.user.LangMark) + day, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + conf := s.GetConf() + if conf.MachineType == mtype.FissionCampaignKeepMachineTypeOffline { + return s._offlineRecycle(day, start, end) + } + + return s._onlineRecycle(day, start, end, num) +} + +// 在线收益回收 +func (s *KeepDog) _onlineRecycle(day string, start, end int64, num float64) (limit, numVal int32, err error) { + player, key := s.GetPlayer(), s.getMachineLastKey + + dayLimit, err := s.machineDayLimit(day, start, end, 0) + if err != nil { + return + } + + if dayLimit { + limit = keepMachineLimitDone + return + } + + if num < 10 || s.secGet() < num { + return + } + + if num > 99 { + num = 99 + } + + lc := app.NewRedisLock(s.Ctx, s.machineSaveKey).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + addNum := math.Floor(num) + machineNum := num - addNum //收了之后,剩余多少 + + numVal = int32(addNum) + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(numVal), m.MachineNum.Value(machineNum)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + t := time.Now().Unix() + err = s.addKeepLog(&model.FissionKeepLog{ + CreatedAt: t, + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceMachine, + Val: fmt.Sprintf("%d", numVal), + }) + if err != nil { + return + } + + app.Redis.Cache.Set(s.Ctx, key, t, lockdo.Rand2HourExp()) + app.Redis.Cache.Set(s.Ctx, s.machineNotSaveKey, 1, 2*time.Second) + + dayLimit, err = s.machineDayLimit(day, start, end, num) + if err != nil { + return + } + + if dayLimit { + limit = keepMachineLimitDone + } + + return +} + +func (s *KeepDog) _offlineRecycle(day string, start, end int64) (limit, numVal int32, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + offlineLimit, err := s.offlineNumLimit(day, start, end, 0) + if err != nil { + return + } + + if offlineLimit { + limit = keepMachineLimitDone + return + } + + nextReceive := player.ReceiveOffline + int64(conf.OfflineMin)*60 + + if time.Now().Unix() < nextReceive { + limit = keepMachineLimitWait + return + } + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(conf.OfflineGet), m.ReceiveOffline.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + numVal = conf.OfflineGet + + err = s.addKeepLog(&model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceMachineOffline, + Val: fmt.Sprintf("%d", conf.OfflineGet), + }) + if err != nil { + return + } + + if conf.OfflineLimit == 0 { + return + } + + offlineLimit, err = s.offlineNumLimit(day, start, end, 1) + if err != nil { + return + } + + if offlineLimit { + limit = keepMachineLimitDone + } + + return +} + +func (s *KeepDog) OfflineLimit() (ok bool, err error) { + tz := provider.NewCampaignTZ(s.Ctx, s.cpn, s.user.LangMark) + day, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + conf := s.GetConf() + if conf.MachineType != mtype.FissionCampaignKeepMachineTypeOffline { + return false, nil + } + + return s.offlineNumLimit(day, start, end, 0) +} + +// MachineSave 保存机器产生的道具 +func (s *KeepDog) MachineSave(num float64) (err error) { + player := s.GetPlayer() + + if num > 99 { + num = 99 + } + + if player.MachineNum == num { + return + } + + lc := app.NewRedisLock(s.Ctx, s.machineSaveKey).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + // 不能保存的时间 + exist, err := app.Redis.Exists(s.Ctx, s.machineNotSaveKey) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if exist { + return + } + + if s.secGet() < num { + return s.BE().VerifyError("can not do it") + } + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.MachineNum.Value(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// GetPropFeed 收喂养次数的道具 +func (s *KeepDog) GetPropFeed() (num int32, err error) { + player, conf, key := s.GetPlayer(), s.GetConf(), s.propFeedNumKey + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(conf.FeedGet)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + num = conf.FeedGet + + err = s.addKeepLog(&model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceFeedProp, + Val: fmt.Sprintf("%d", conf.FeedGet), + }) + if err != nil { + return + } + + _, propNum, err := s.feedNum() + if err != nil { + return + } + + if int32(propNum) < conf.FeedGetNum { + err = s.BE().VerifyError("can not do it") + return + } + + app.Redis.Cache.HIncrBy(s.Ctx, key, keepDogFeedNumMapPropNumKey, -propNum) + return +} + +// GetPropNeedFeedNum 获得喂养的道具还需要几次 +func (s *KeepDog) GetPropNeedFeedNum() (need int32, err error) { + _, propNum, err := s.feedNum() + if err != nil { + return + } + + return s.GetConf().FeedGetNum - int32(propNum), nil +} + +// InviteThirdFeed 邀请的下级喂养了3次 +func (s *KeepDog) InviteThirdFeed(dayFirst bool) (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + invite := conf.GetInvite() + if conf.OpenInvite == mtype.No || invite == nil || !s.canGetInviteFood() { + return + } + + var logs = []*model.FissionKeepLog{ + { + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceThird, + Val: fmt.Sprintf("%d", invite.FeedThird), + }, + } + num := invite.FeedThird + + if dayFirst { + logs = append(logs, &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceDayFirstThird, + Val: fmt.Sprintf("%d", invite.DayFirstThird), + }) + + num += invite.DayFirstThird + } + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.addKeepLog(logs...) + if err != nil { + return + } + + return +} + +// InviteSelect 邀请的下级选择了奖品 +func (s *KeepDog) InviteSelect(dayFirst bool) (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + invite := conf.GetInvite() + if conf.OpenInvite == mtype.No || invite == nil || !s.canGetInviteFood() { + return + } + + var logs = []*model.FissionKeepLog{ + { + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceSelect, + Val: fmt.Sprintf("%d", invite.RewardSelected), + }, + } + num := invite.RewardSelected + + if dayFirst { + logs = append(logs, &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceDayFirstSelect, + Val: fmt.Sprintf("%d", invite.DayFirstSelected), + }) + + num += invite.DayFirstSelected + } + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.addKeepLog(logs...) + if err != nil { + return + } + + return s.addFoodInviteLimit(int64(num)) +} + +// EffectInvite 用户有效邀请 +func (s *KeepDog) EffectInvite(childUserId int64) (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if conf.OpenInvite == mtype.No || !s.canGetInviteFood() { + return + } + + invite := conf.GetInvite() + + var num = invite.InviteGet + var logs = []*model.FissionKeepLog{ + { + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceEffectInvite, + Val: fmt.Sprintf("%d", invite.InviteGet), + }, + } + + defer func() { + if err != nil { + return + } + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Num.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.addKeepLog(logs...) + if err != nil { + return + } + + err = s.addFoodInviteLimit(int64(num)) + }() + + if invite.DayFirstGet == mtype.No { + return + } + + cpn := s.cpn + + tz := provider.NewCampaignTZ(s.Ctx, cpn, s.user.LangMark) + start, _ := timez.GMTTimeStart(tz.GetTz()) + day := start.Format(timez.ShortDateOnly) + + key := ckey.FissionUserDayFirstInviteUser(day, player.UserID) + + var first bool + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if exist { + return + } + + m := dao.FissionUser.SubTable(cpn.ID) + info, err1 := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.ParentID.Eq(player.UserID), + m.IsHelp.Eq(mtype.Yes), + ).First() + if err1 = dbcheck.DbError(err1); err1 != nil { + return err1 + } + + if info != nil { + app.Redis.Cache.Set(s.Ctx, key, info.ID, lockdo.Rand2HourExp()) + return + } + + first = true + app.Redis.Cache.Set(s.Ctx, key, childUserId, lockdo.Rand2HourExp()) + + err = dao.FissionUserAttr.WithContext(s.Ctx).Create(withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: cpn.ID, + UserID: childUserId, + Attr: mtype.FissionUserAttrMarkDayFirst, + Value: fmt.Sprintf("%d:%s", tz.GetTz(), day), + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if !first { + return + } + + num += invite.DayFirstGet + + logs = append(logs, &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceDayFirstEffectInvite, + Val: fmt.Sprintf("%d", invite.DayFirstGet), + }) + + return +} + +// GetPlayer 获取玩家基础数据 +func (s *KeepDog) GetPlayer() *model.FissionKeep { + return s.player +} + +// GetConf 获取活动配置 +func (s *KeepDog) GetConf() *model.FissionCampaignKeep { + if s.conf == nil { + s.conf, _ = cache.NewCampaignKeep(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + return s.conf +} + +type KeepDogStatus struct { + PropNeedFeed int32 // 获得喂养道具还需要几次 + DayFirstInvite int32 // 当天是否有进行首次邀请 + DayFirstFeed int32 // 当天是否进行了第一次喂养 + SecondPercent int32 // 爱心进度 + Percent string // 奖品进度 + Left int32 // 还差的爱心树 + MachineLimit int32 // 狗粮机限制 + OfflineFull int64 // 离线狗粮机填满剩余秒数 +} + +// GetStatus 获取一些需要计算的状态 +func (s *KeepDog) GetStatus() (status KeepDogStatus, err error) { + status.PropNeedFeed, err = s.GetPropNeedFeedNum() + if err != nil { + return + } + + player, conf := s.GetPlayer(), s.GetConf() + + stepM := dao.FissionCampaignKeepStep + steps, err := stepM.WithContext(s.Ctx).Where(stepM.CampaignID.Eq(player.CampaignID)).Order(stepM.Step).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var stepMap = make(map[int32]int32) + for _, step := range steps { + stepMap[step.Step] = step.Percent + } + + status.Left = conf.Collect - player.CollectNum + if status.Left < 0 { + status.Left = 0 + } + + var cent float64 + + status.SecondPercent = (player.SecondNum * 100) / conf.CollectSecond + cent = float64(player.CollectNum) * 60 / float64(conf.Collect) + if player.Guided == mtype.Yes { + cent += 40 + } + + if percent, ok := stepMap[player.Step]; ok && cent >= float64(percent) { + cent = float64(percent) - 1 + } else if player.Step == 4 && cent >= 100 { + cent = 99 + } + + if player.RecordID > 0 { + cent = 100 + } + + status.Percent = utils.Float64PointCutZero(cent, 1) + + cpn := s.cpn + + tz := provider.NewCampaignTZ(s.Ctx, cpn, s.user.LangMark) + day, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + dayFirstInviteUserKey := ckey.FissionUserDayFirstInviteUser(day, player.UserID) + err = lockdo.ExistDo(s.Ctx, dayFirstInviteUserKey, func(exist bool) (err error) { + if exist { + return + } + + m := dao.FissionUser.SubTable(cpn.ID) + info, err1 := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.ParentID.Eq(player.UserID), + m.IsHelp.Eq(mtype.Yes), + m.CreatedAt.Gte(start), + ).First() + if err1 = dbcheck.DbError(err1); err1 != nil { + return err1 + } + + if info != nil { + app.Redis.Cache.Set(s.Ctx, dayFirstInviteUserKey, info.ID, lockdo.Rand2HourExp()) + return + } + + status.DayFirstInvite = 1 + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + dayFirstFeedKey := ckey.FissionUserDayFirstFeed(day, player.UserID) + err = lockdo.ExistDo(s.Ctx, dayFirstFeedKey, func(exist bool) (err error) { + if exist { + return + } + + m := dao.FissionKeepLog + info, err1 := m.WithContext(s.Ctx).Where( + m.UserID.Eq(player.UserID), + m.Type.Eq(mtype.FissionKeepLogTypeFeed), + m.CreatedAt.Gte(start), + ).First() + if err1 = dbcheck.DbError(err1); err1 != nil { + return err1 + } + + if info != nil { + app.Redis.Cache.Set(s.Ctx, dayFirstFeedKey, info.ID, lockdo.Rand2HourExp()) + return + } + + status.DayFirstFeed = 1 + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch conf.MachineType { + case mtype.FissionCampaignKeepMachineTypeOnline: + var dayLimit bool + dayLimit, err = s.machineDayLimit(day, start, end, 0) + if err != nil { + return + } + + if dayLimit { + status.MachineLimit = keepMachineLimitDone + } + case mtype.FissionCampaignKeepMachineTypeOffline: + status.OfflineFull = player.ReceiveOffline + int64(conf.OfflineMin)*60 - time.Now().Unix() + + var offlineLimit bool + offlineLimit, err = s.offlineNumLimit(day, start, end, 0) + if err != nil { + return + } + + if offlineLimit { + status.MachineLimit = keepMachineLimitDone + } + } + + return +} + +const ( + KeepDogFeedReselectOk = iota // 喂养成功 + KeepDogFeedReselectLimit // 超过最大养成次数 +) + +// Reselect 重新选择奖品 +func (s *KeepDog) Reselect() (status int32, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if player.RecordID == 0 && player.ExpiredAt > time.Now().Unix() { + return + } + + m := dao.FissionKeep + count, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(s.user.ID), m.RecordID.Gt(0)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf.MaxFeed > 0 && count >= int64(conf.MaxFeed) { + return KeepDogFeedReselectLimit, nil + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.ReselectAt.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = s.createPlayer() + if err != nil { + return + } + + return +} + +// Guided 引导 +func (s *KeepDog) Guided() (get KeepDogCollectReward, err error) { + player := s.GetPlayer() + + if player.Guided == mtype.Yes { + return + } + + var logs = []*model.FissionKeepLog{ + { + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeGuided, + Source: mtype.FissionKeepLogSourceFeed, + Val: "20", + }, + } + var num int32 = -20 + defer func() { + if err != nil { + return + } + + m := dao.FissionKeep + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Guided.Value(mtype.Yes), m.Step.Value(2), m.Num.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.addKeepLog(logs...) + if err != nil { + return + } + + }() + + stepM := dao.FissionCampaignKeepStep + step, err := stepM.WithContext(s.Ctx).Where(stepM.CampaignID.Eq(player.CampaignID), stepM.Step.Eq(1), stepM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if step == nil { + return + } + + if step.RewardType == mtype.FissionCampaignKeepStepRewardTypeProp { + + logs = append(logs, &model.FissionKeepLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeProp, + Source: mtype.FissionKeepLogSourceStep, + Val: fmt.Sprint(step.RewardNum), + }) + + num += step.RewardNum + + return KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeProp, + Chance: step.RewardNum, + }, nil + } + + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(step.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + return + } + + cpn := s.cpn + + // 预览用户直接显示奖品 + if s.IsView() { + var preward *provider.Rewards + preward, err = provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + info, _ := preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + + return KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeReward, + Chance: reward.RewardNum, + RewardId: reward.ID, + RewardTitle: info.Title, + RewardImg: info.ImgUrl, + Lack: false, + RewardRecordId: 0, + LastReward: false, + ReceiveType: info.ReceiveType, + }, nil + } + + ok, err := award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().IsOK() + if err != nil { + err = s.BE().CacheError(err) + return + } + + var opts []award.RecordOption + if !ok { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + record, info, _, err := award.NewAwardReward(s.Ctx, dao.Q, cpn.ProjectID, s.user).One(reward, true, opts...) + if err != nil { + return + } + + return KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeReward, + Chance: reward.RewardNum, + RewardId: record.RewardID, + RewardTitle: info.Title, + RewardImg: info.ImgUrl, + Lack: !ok, + RewardRecordId: record.ID, + ReceiveType: info.ReceiveType, + }, nil +} + +// RefreshView 刷新预览用户 +func (s *KeepDog) RefreshView() (err error) { + if !s.IsView() { + err = s.BE().VerifyError("非预览用户无法重新体验") + return + } + + player := s.GetPlayer() + + m := s.GetDao().FissionKeepLog + _, err = m.WithContext(s.Ctx).Where(m.KeepID.Eq(player.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + playerM := s.GetDao().FissionKeep + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).Delete() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + app.Redis.Cache.Del(s.Ctx, + s.propFeedNumKey, + s.dayFirstInviteKey, + s.getMachineLastKey, + s.machineSaveKey, + s.machineNotSaveKey, + s.dogFoodLimit, + ) + + return +} + +const ( + keepDogFeedNumMapPropNumKey = "prop_num" // 获得道具的喂养数 + keepDogFeedNumMapAllNumKey = "all_num" // 喂养总数 +) + +// 喂养数据 +func (s *KeepDog) feedNum() (num, propNum int64, err error) { + player, key := s.GetPlayer(), s.propFeedNumKey + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if exist { + data := app.Redis.Cache.HGetAll(s.Ctx, key).Val() + for k, v := range data { + switch k { + case keepDogFeedNumMapPropNumKey: + propNum = utils.StrToInt64(v) + case keepDogFeedNumMapAllNumKey: + num = utils.StrToInt64(v) + } + } + + return + } + + m := dao.FissionKeepLog + propNum, err = m.WithContext(s.Ctx).Where(m.KeepID.Eq(player.ID), m.Type.Eq(mtype.FissionKeepLogTypeFeed), m.CreatedAt.Gt(player.FeedGetAt)).Count() + if err != nil { + return + } + + allNum, err := m.WithContext(s.Ctx).Where(m.KeepID.Eq(player.ID), m.Type.Eq(mtype.FissionKeepLogTypeFeed)).Count() + if err != nil { + return + } + + app.Redis.Cache.HSet(s.Ctx, key, allNum, keepDogFeedNumMapPropNumKey, propNum, keepDogFeedNumMapAllNumKey, allNum) + app.Redis.Cache.Expire(s.Ctx, key, lockdo.Rand2HourExp()) + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +// 玩家 +func (s *KeepDog) initPlayer() (err error) { + playerM := dao.FissionKeep + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Last() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + defer func() { + s.player = player + s.propFeedNumKey = ckey.FissionUserPropFeedNum(player.ID) + s.dayFirstInviteKey = ckey.FissionUserDayFirstInvite(player.UserID) + s.getMachineLastKey = ckey.FissionUserKeepGetMachineLast(player.ID) + s.machineSaveKey = ckey.FissionUserKeepMachineSave(player.ID) + s.machineNotSaveKey = ckey.FissionUserKeepMachineNotSave(player.ID) + s.dogFoodLimit = ckey.FissionUserKeepInviteDogFoodLimit(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 用户最后一次获得机器狗粮的时间 +func (s *KeepDog) getMachineLast() (t int64, err error) { + player, key := s.GetPlayer(), s.getMachineLastKey + t, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := dao.FissionKeepLog + info, err1 := m.WithContext(s.Ctx).Where( + m.KeepID.Eq(player.ID), + m.Type.Eq(mtype.FissionKeepLogTypeProp), + m.Source.Eq(mtype.FissionKeepLogSourceMachine), + ).Last() + if err1 = dbcheck.DbError(err1); err1 != nil { + return 0, err1 + } + + if info != nil { + return info.CreatedAt, nil + } + + return 0, nil + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +// 用户是否是当天被上级首次邀请的用户 +func (s *KeepDog) dayFirst() (dayFirst bool, err error) { + + err = lockdo.ExistDo(s.Ctx, s.dayFirstInviteKey, func(exist bool) (err error) { + + if exist { + dayFirst, err = app.Redis.Cache.Get(s.Ctx, s.dayFirstInviteKey).Bool() + return + } + + dayFirstAttr, err1 := cache.NewFissionUserAttr(s.Ctx).FindByUniqIdx(s.user.ID, mtype.FissionUserAttrMarkDayFirst) + if err1 != nil { + return err1 + } + + dayFirst = dayFirstAttr != nil + + app.Redis.Cache.Set(s.Ctx, s.dayFirstInviteKey, dayFirst, lockdo.Rand2HourExp()) + + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +// 创建玩家基础数据 +func (s *KeepDog) firstOrCreate() (player *model.FissionKeep, err error) { + playerM := dao.FissionKeep + lock := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lock.Release() + if lock.Error() != nil { + err = lock.Error() + return + } + + player, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Last() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +func (s *KeepDog) createPlayer() (player *model.FissionKeep, err error) { + playerM := dao.FissionKeep + player = withdefault.FissionKeep(&model.FissionKeep{ + UserID: s.user.ID, + CampaignID: s.user.CampaignID, + ExpiredAt: time.Now().AddDate(0, 0, int(s.GetConf().FeedCycle)).Unix(), + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 完成最终奖品养成 +func (s *KeepDog) finishKeep() (get *KeepDogCollectReward, err error) { + player := s.GetPlayer() + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(player.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = s.BE().VerifyError("not found reward") + return + } + + val, _ := jsonm.MarshalToString(mtype.KeepLogValSource{ + Step: 4, + RewardId: reward.ID, + }) + + err = s.addKeepLog(&model.FissionKeepLog{ + ID: hashid.IdBigint(), + UserID: player.UserID, + CampaignID: player.CampaignID, + KeepID: player.ID, + Type: mtype.FissionKeepLogTypeReward, + Source: mtype.FissionKeepLogSourceStep, + Val: "1", + ValSource: val, + }) + + if err != nil { + return + } + + cpn := s.cpn + + // 预览用户直接显示奖品 + if s.IsView() { + var preward *provider.Rewards + preward, err = provider.NewRewards(s.Ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + info, _ := preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + + return &KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeReward, + Chance: reward.RewardNum, + RewardId: reward.ID, + RewardTitle: info.Title, + RewardImg: info.ImgUrl, + ReceiveType: info.ReceiveType, + }, nil + } + + ok, err := award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().IsOK() + if err != nil { + return + } + + var opts []award.RecordOption + if !ok { + opts = append(opts, award.RewardRecordStatus( + mtype.FissionRewardRecordStatusFail, + mtype.FissionRewardRecordFailTypeCli, + mtype.FissionRewardRecordFailTypeCliLackMsg, + )) + } + + record, info, _, err := award.NewAwardReward(s.Ctx, dao.Q, cpn.ProjectID, s.user).One(reward, true, opts...) + if err != nil { + return + } + + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).GrowOk(time.Now().Unix(), record.RewardID, record.ID) + statM := dao.FissionUserStat + _, err = statM.WithContext(s.Ctx).Where(statM.UserID.Eq(player.UserID)).UpdateSimple(statM.GrowRewardNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return &KeepDogCollectReward{ + RewardType: mtype.FissionCampaignKeepStepRewardTypeReward, + RewardId: record.RewardID, + RewardTitle: info.Title, + RewardImg: info.ImgUrl, + RewardRecordId: record.ID, + LastReward: true, + ReceiveType: info.ReceiveType, + }, nil +} + +// 真实的阶段百分比 +func (s *KeepDog) stepPercent(collect, percent int32) float64 { + return (float64(collect) / 60) * float64(percent-40) +} + +// 是否可以领取邀请的狗粮 +func (s *KeepDog) canGetInviteFood() (ok bool) { + player, conf := s.GetPlayer(), s.GetConf() + + if conf.OpenInvite == mtype.No || player.InviteLimit == mtype.Yes { + return + } + + invite := conf.GetInvite() + + if invite.InviteMaxGet == 0 { + return true + } + + num, _ := s.getFoodInviteLimit() + + if int64(invite.InviteMaxGet) > num { + return true + } + + m := dao.FissionKeep + _, _ = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.InviteLimit.Value(mtype.Yes)) + s.GetPlayer().InviteLimit = mtype.Yes + + return +} + +// 追加邀请获得的狗粮数,用来防治最大获得数量 +func (s *KeepDog) addFoodInviteLimit(num int64) (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if conf.OpenInvite == mtype.No || player.InviteLimit == mtype.Yes { + return + } + + invite := conf.GetInvite() + + if invite.InviteMaxGet == 0 { + return + } + + _, err = s.getFoodInviteLimit() + if err != nil { + return + } + + app.Redis.Cache.IncrBy(s.Ctx, s.dogFoodLimit, num) + app.Redis.Cache.Expire(s.Ctx, s.dogFoodLimit, consts.TimeDay) + + return +} + +// 获取当前通过邀请获得的狗粮数 +func (s *KeepDog) getFoodInviteLimit() (num int64, err error) { + player, key := s.GetPlayer(), s.dogFoodLimit + return lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := dao.FissionKeepLog + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(player.UserID), + m.Source.In( + mtype.FissionKeepLogSourceThird, + mtype.FissionKeepLogSourceDayFirstThird, + mtype.FissionKeepLogSourceSelect, + mtype.FissionKeepLogSourceDayFirstSelect, + mtype.FissionKeepLogSourceEffectInvite, + mtype.FissionKeepLogSourceDayFirstEffectInvite, + ), + ).Count() + }) +} + +func (s *KeepDog) secGet() float64 { + lastGet, _ := s.getMachineLast() + bt := time.Now().Unix() - lastGet + return float64(bt) * s.GetConf().SecGet +} + +func (s *KeepDog) addKeepLog(logs ...*model.FissionKeepLog) (err error) { + var addLogs = make([]*model.FissionKeepLog, 0, len(logs)) + for _, log := range logs { + addLogs = append(addLogs, withdefault.FissionKeepLog(log)) + } + + err = dao.FissionKeepLog.WithContext(s.Ctx).Create(addLogs...) + if err != nil { + err = s.BE().MysqlError(err) + } + return +} + +func (s *KeepDog) machineDayLimit(day string, start, end int64, add float64) (ok bool, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if conf.SecGetDayLimit == 0 { + return + } + + key := ckey.FissionKeepMachineDayLimit(day, s.user.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if exist { + return + } + + m := s.GetDao().FissionKeepLog + type num struct { + Num float64 `json:"num"` + } + + sumField := field.NewFloat64(m.TableName(), m.Val.ColumnName().String()) + + var sum num + err = m.WithContext(s.Ctx). + Select(sumField.Sum().As("num")). + Where( + m.UserID.Eq(player.UserID), + m.Type.Eq(mtype.FissionKeepLogTypeProp), + m.Source.Eq(mtype.FissionKeepLogSourceMachine), + m.CreatedAt.Gte(start), + m.CreatedAt.Lte(end), + ). + Scan(&sum) + if err != nil { + return + } + + app.Redis.Cache.IncrByFloat(s.Ctx, key, sum.Num) + app.Redis.Cache.Expire(s.Ctx, key, consts.TimeDay) + + return + }) + + if err != nil { + return + } + + var count float64 + if add > 0 { + count = app.Redis.Cache.IncrByFloat(s.Ctx, key, add).Val() + } else { + count, _ = app.Redis.Cache.Get(s.Ctx, key).Float64() + } + + ok = count >= conf.SecGetDayLimit + + return +} + +func (s *KeepDog) offlineNumLimit(day string, start, end, add int64) (ok bool, err error) { + player, conf, key := s.GetPlayer(), s.GetConf(), ckey.FissionUserKeepOfflineGetNum(day, s.user.ID) + + if conf.OfflineLimit == 0 { + return + } + + num, err := lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionKeepLog + return m.WithContext(s.Ctx).Where(m.KeepID.Eq(player.ID), + m.Type.Eq(mtype.FissionKeepLogTypeProp), + m.Source.Eq(mtype.FissionKeepLogSourceMachineOffline), + m.CreatedAt.Between(start, end), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if add > 0 { + app.Redis.Cache.IncrBy(s.Ctx, key, add) + num += add + } + + return int64(conf.OfflineLimit) <= num, nil +} diff --git a/internal/service/provider/players/keep_dog_test.go b/internal/service/provider/players/keep_dog_test.go new file mode 100644 index 0000000..3d32573 --- /dev/null +++ b/internal/service/provider/players/keep_dog_test.go @@ -0,0 +1,66 @@ +package players + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "github.com/rs/xid" + "testing" + "time" + + _ "joybuywork/test" +) + +func TestCollect(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 4458).FindById(256032827461812224) + if err != nil { + t.Error(err) + } + + kg, err := NewKeepDog(ctx, user) + if err != nil { + t.Error(err) + } + + num, add, err := kg.Collect() + if err != nil { + t.Error(err) + } + + t.Log(num, add) +} + +func TestRewardSelect(t *testing.T) { + + t.Run("create user run", func(t *testing.T) { + ctx := context.Background() + user := withdefault.FissionUser(&model.FissionUser{ + CampaignID: 4330, + SubUserID: xid.New().String(), + UserType: mtype.FissionUserTypePlay, + Source: mtype.FissionUserSourceVisit, + JoinAt: time.Now().Unix(), + }) + + err := dao.FissionUser.WithContext(ctx).Create(user) + if err != nil { + t.Error(err) + return + } + + kg, err := NewKeepDog(ctx, user) + if err != nil { + t.Error(err) + } + + // 243328379302412289 + kg.RewardSelect(243328379302412288) + + }) + +} diff --git a/internal/service/provider/players/option.go b/internal/service/provider/players/option.go new file mode 100644 index 0000000..0fb86be --- /dev/null +++ b/internal/service/provider/players/option.go @@ -0,0 +1,20 @@ +package players + +import ( + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" +) + +type Option func(player *Player) + +func SetDao(d *dao.Query) Option { + return func(player *Player) { + player.Context.Init(player.Ctx, d, player.BE()) + } +} + +func SetCpn(cpn *model.FissionCampaign) Option { + return func(player *Player) { + player.cpn = cpn + } +} diff --git a/internal/service/provider/players/player.go b/internal/service/provider/players/player.go new file mode 100644 index 0000000..13b2d94 --- /dev/null +++ b/internal/service/provider/players/player.go @@ -0,0 +1,670 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/projectuser" + stos "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "joybuywork/internal/utils/timez" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" +) + +type Player struct { + logic.Context + cpn *model.FissionCampaign + user *model.FissionUser + + tz *provider.CampaignTZ + + mpInApp *fissionaction.InApp +} + +// Init 初始化一个逻辑类 +func (s *Player) Init(ctx context.Context, user *model.FissionUser, fissionId int64, opts ...Option) (err error) { + s.Context.Init(ctx, dao.Q, merr.NewBE(ctx)) + s.user = user + + for _, opt := range opts { + opt(s) + } + + // 如果外部没设置的话自己设置一下 + if s.cpn == nil { + s.cpn, err = cache.NewCampaign(s.Ctx).FindById(s.user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.cpn == nil { + return workerr.NotFound("not found cpn") + } + } + + // 验证一下活动玩法和实际玩法是否一致 + if s.cpn.FissionID != fissionId { + return workerr.VerifyError(fmt.Sprintf("The current user identity does not belong to the current activity (%s)", consts.FissionIdMap[fissionId])) + } + + return +} + +// IsView 预览用户 +func (s *Player) IsView() bool { + return s.user.IsView == mtype.Yes +} + +// HelpOk 助力成功用户 +func (s *Player) HelpOk() bool { + return s.user.ParentID > 0 && s.user.IsHelp == mtype.Yes +} + +// appTrack 应用事件记录 +func (s *Player) appTrack() fissionaction.InApp { + if s.mpInApp == nil { + mpInApp := fissionaction.NewMarkPoint(s.Ctx).InApp(s.user) + s.mpInApp = &mpInApp + } + + return *s.mpInApp +} + +// 统一抽奖 +func (s *Player) _lottery() (reward *model.FissionCampaignReward, err error) { + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(s.user) + if err != nil { + return + } + + //如果是预览用户,随机返回一个奖品 + if s.IsView() { + var dataMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rewards { + if v.Odds == 0 { + continue + } + dataMap[v.ID] = v + } + + for _, v := range dataMap { + reward = v + } + + return + } + + var ids []int64 + for _, v := range rewards { + ids = append(ids, v.ID) + } + + stock, err := stocks.NewCampaignReward(s.Ctx, ids...) + if err != nil { + return + } + useStockMap, _ := stock.AllUseStock() + + var thinkId int64 + var thinkMap = make(map[int64]*model.FissionCampaignReward) + var rewardMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rewards { + if v.IsThank == mtype.Yes { + thinkMap[v.ID] = v + rewardMap[v.ID] = v + thinkId = v.ID + } else if int64(v.Stock) > useStockMap[v.ID] { + rewardMap[v.ID] = v + } + } + + //随机一个谢谢参与发放 + var think *model.FissionCampaignReward + for _, v := range thinkMap { + think = v + } + + //获取到了奖品 + for { + + //构建抽奖数据 + var prize = make([]lucky.Reward, 0, len(rewardMap)) + for _, v := range rewardMap { + prize = append(prize, lucky.Reward{ + Share: int(v.Odds), + Mark: v.ID, + }) + } + + // 抽奖 + lcy, _ := lucky.NewDiscrete(s.Ctx, prize).Lottery() + + // 没中奖 + if lcy.Int64() == 0 { + reward = think + } else { + reward = rewardMap[lcy.Int64()] + } + + // 中奖了 + var check bool + check, err = award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().RuleFilter().Unlock().IsOK() + if err != nil { + return + } + + // 扣除库存成功 + if check { + return + } + + // 这个奖品这个人不能中了 + rewardMap[thinkId].Odds += reward.Odds + delete(rewardMap, lcy.Int64()) + } +} + +// GetTz 获取用户的时区 +func (s *Player) GetTz() *provider.CampaignTZ { + if s.tz == nil { + s.tz = provider.NewCampaignTZ(s.Ctx, s.cpn, s.user.LangMark) + } + return s.tz +} + +// 最后签到 +func (s *Player) _lastSign(lastSign string) (ok bool, day string) { + tz := provider.NewCampaignTZ(s.Ctx, s.cpn, s.user.LangMark) + + if tz.IsWait() { + return false, lastSign + } + + signDate, _, _ := timez.GMTStartAndEndTs(tz.GetTz()) + + day = strings.ReplaceAll(signDate, "-", "") + if lastSign == "" || day > lastSign { + s.appTrack().Sign(time.Now().Unix(), tz.GetTz(), day) + return true, day + } + + return false, lastSign +} + +// 手动领取任务奖励 +func (s *Player) _receiveReward(taskRewards []*model.FissionUserTaskReward, callback func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error) (err error) { + var taskRewardMap = make(map[int64]int64) + var ids []int64 + defer func() { + if err != nil || len(ids) == 0 { + return + } + + receiveTime := time.Now().Unix() + + m := s.GetDao().FissionUserTaskReward + _, err = m.WithContext(s.Ctx).Where(m.ID.In(ids...)).UpdateSimple(m.ReceiveTime.Value(receiveTime)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, task := range taskRewards { + s.appTrack().ManualTask(receiveTime, task.TaskID, taskRewardMap[task.TaskID]) + } + + }() + + var taskMap = make(map[int64]*model.FissionCampaignTask) + var taskIds []int64 + + for _, v := range taskRewards { + ids = append(ids, v.ID) + + if _, ok := taskMap[v.TaskID]; !ok { + taskIds = append(taskIds, v.TaskID) + taskMap[v.TaskID] = nil + } + } + + taskM := s.GetDao().FissionCampaignTask + cpnTasks, err := taskM.WithContext(s.Ctx).Where(taskM.ID.In(taskIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range cpnTasks { + taskMap[v.ID] = v + } + + var rewardIds []int64 + var tasks []*model.FissionCampaignTask + for _, v := range taskRewards { + + task, ok := taskMap[v.TaskID] + if !ok { + continue + } + + taskRewardMap[v.TaskID] = task.RewardID + + tasks = append(tasks, task) + switch task.PropMark { + case mtype.FissionCampaignRewardPropMarkReward: + rewardIds = append(rewardIds, task.RewardID) + } + + } + + var records []*award.RewardRes + if len(rewardIds) > 0 { + records, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).RewardIdsBatch(rewardIds, true) + if err != nil { + return + } + } + + return callback(tasks, records) +} + +const ( + pointsUseOk = iota // 积分使用成功 + pointsUseLack // 积分不足 + pointsUseClose // 积分使用关闭 + pointsUseDayLimit // 积分每日使用次数超限额 + pointsUseTotalLimit // 积分使用次数超限额 +) + +type pointsUseCond struct { + Field string + Value any +} + +func (s *Player) pointsUse(source, tableName string, other mtype.PointsLogOther, where []*pointsUseCond) (status int32, deduct *model.FissionPointDeduct, err error) { + lackKey := ckey.FissionCoinLack(s.user.ID) + if app.Redis.Cache.Exists(s.Ctx, lackKey).Val() != 0 { + status = pointsUseLack + return + } + + conf, err := cache.NewCampaignPointsUse(s.Ctx).FindByCampaignId(s.user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil || conf.UseNum == 0 { + status = pointsUseClose + return + } + + if conf.DayLimit > 0 { + tz := s.GetTz() + day, start, end := timez.GMTStartAndEndTs(tz.GetTz()) + + dayLimitKey := ckey.FissionPointsUseDayNum(s.user.ID, day) + var dayNum int64 + dayNum, err = lockdo.Int64(s.Ctx, dayLimitKey, func() (num int64, err error) { + query := app.DB.Client.Debug().Table(tableName).WithContext(s.Ctx). + Where("campaign_id = ? and user_id = ? and created_at between ? and ?", s.user.CampaignID, s.user.ID, start, end) + + for _, cond := range where { + query = query.Where(fmt.Sprintf("%s = ?", cond.Field), cond.Value) + } + query.Count(&num) + + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if dayNum >= int64(conf.DayLimit) { + status = pointsUseDayLimit + return + } + + defer func() { + if err == nil && status == pointsUseOk { + app.Redis.Cache.Incr(s.Ctx, dayLimitKey) + } + }() + } + + if conf.TotalLimit > 0 { + totalLimitKey := ckey.FissionPointsUseNum(s.user.ID) + var totalNum int64 + totalNum, err = lockdo.Int64(s.Ctx, totalLimitKey, func() (num int64, err error) { + query := app.DB.Client.Debug().Table(tableName).WithContext(s.Ctx). + Where("campaign_id = ? and user_id = ?", s.user.CampaignID, s.user.ID) + + for _, cond := range where { + query = query.Where(fmt.Sprintf("%s = ?", cond.Field), cond.Value) + } + + query.Count(&num) + + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if totalNum >= int64(conf.TotalLimit) { + status = pointsUseTotalLimit + return + } + + defer func() { + if err == nil && status == pointsUseOk { + app.Redis.Cache.Incr(s.Ctx, totalLimitKey) + } + }() + } + + deductM := s.GetDao().FissionPointDeduct + deduct, err = deductM.WithContext(s.Ctx).Where(deductM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if deduct == nil { + deduct = withdefault.FissionPointsDeduct(&model.FissionPointDeduct{ + UserID: s.user.ID, + Num: conf.UseNum, + }) + + if err = s.GetDao().FissionPointDeduct.WithContext(s.Ctx).Create(deduct); err != nil { + err = s.BE().MysqlError(err) + return + } + } else { + deduct.Num = conf.UseNum + } + + s2s, err := stos.NewPointsChange(s.Ctx, s.cpn, s.user, conf.URLID) + if err != nil { + return 0, nil, err + } + + other.DeductId = deduct.ID + + res, err := s2s.Deduct(conf.UseNum, source, other) + if err != nil { + return 0, nil, err + } + + if res.State == stos.PointsChangeLack { + status = pointsUseLack + app.Redis.Cache.Set(s.Ctx, lackKey, 1, 10*time.Second) + return + } + + return +} + +func (s *Player) pointsUseOk(deduct *model.FissionPointDeduct) { + if deduct == nil { + return + } + + deductM := s.GetDao().FissionPointDeduct + _, _ = deductM.WithContext(s.Ctx).Delete(deduct) + + s.appTrack().PointsUse(time.Now().Unix(), deduct.Num) +} + +func (s *Player) GetTCoin() (coinNum int64, err error) { + pu, err := projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(s.cpn.ProjectID, s.user.SubUserID)) + if err != nil { + return + } + + coin, err := pu.GetCoin() + if err != nil { + return + } + + return coin.Num, nil +} + +func (s *Player) unlockReward(task *model.FissionCampaignTask) (ok bool, err error) { + if task.PropMark != mtype.FissionCampaignTaskPropMarkUnlockReward { + return + } + + cpnId, userId, rewardId := s.cpn.ID, s.user.ID, task.RewardID + key := ckey.FissionUserUnlockReward(userId, rewardId) + first := app.Redis.Cache.SetNX(s.Ctx, key, 1, consts.TimeDay).Val() + if !first { + return false, nil + } + + m := s.GetDao().FissionUnlockReward + ulr, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpnId), + m.UserID.Eq(userId), + m.RewardID.Eq(rewardId), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if ulr != nil { + return false, nil + } + + err = m.WithContext(s.Ctx).Create(withdefault.FissionUnlockReward(&model.FissionUnlockReward{ + CampaignID: cpnId, + UserID: userId, + RewardID: rewardId, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.appTrack().UnlockReward(time.Now().Unix(), rewardId, task.ID) + + return true, nil +} + +type EventReward struct { + PropMark string + Chance int32 + Reward *award.RewardRes +} + +func (s *Player) eventOk(mark string) (ok bool, rewards []*EventReward, err error) { + event, err := cache.NewCampaignEvent(s.Ctx).FindByCampaignId(s.user.CampaignID, mark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if event == nil { + return + } + + switch event.Mark { + case mtype.FissionCampaignEventMarkFirstVisit: + return s._eventFirstVisit(event) + } + + return +} + +func (s *Player) _eventFirstVisit(event *model.FissionCampaignEvent) (ok bool, rewards []*EventReward, err error) { + eventKey := ckey.FissionUserEventFirstVisit(s.user.ID) + if !app.Redis.Cache.SetNX(s.Ctx, eventKey, 1, lockdo.Rand2HourExp()).Val() { + return + } + + m := s.GetDao().FissionUserEvent + fv, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(s.user.ID), m.Mark.Eq(mtype.FissionCampaignEventMarkFirstVisit)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if fv != nil { + return + } + + fv = withdefault.FissionUserEvent(&model.FissionUserEvent{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + Mark: mtype.FissionCampaignEventMarkFirstVisit, + }) + if err = m.WithContext(s.Ctx).Create(fv); err != nil { + err = s.BE().MysqlError(err) + } + + if event.Open == mtype.No { + return + } + + var rewardIds []int64 + for _, reward := range event.GetRewards() { + switch reward.PropMark { + case mtype.FissionCampaignRewardPropMarkChance: + rewards = append(rewards, &EventReward{ + PropMark: reward.PropMark, + Chance: reward.Chance, + }) + case mtype.FissionCampaignRewardPropMarkReward, mtype.FissionCampaignRewardPropMarkPoint: + rewardIds = append(rewardIds, reward.RewardId) + } + } + + if len(rewardIds) == 0 { + return + } + + res, _, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).RewardIdsBatch(rewardIds, true) + if err != nil { + return + } + + for _, reward := range res { + rewards = append(rewards, &EventReward{ + PropMark: reward.Reward.PropMark, + Reward: reward, + }) + } + + return +} + +// _lotteryTask 抽奖任务通用处理 +func (s *Player) _lotteryTask(checkManual bool, task *model.FissionCampaignTask) (next bool, t int8, source string, lotteryVal mtype.LotteryLogVal) { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + next = true + return + } + + lotteryVal.TaskId = task.ID + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + lotteryVal.Chance = task.Chance + t = mtype.LotteryFissionTypeAdd + case mtype.FissionCampaignTaskPropMarkUnlockReward: + ok, _ := s.unlockReward(task) + if !ok { + next = true + return + } + t = mtype.LotteryFissionTypeUnlock + lotteryVal.RewardId = task.RewardID + } + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + source = mtype.FissionLogSourceRegister + case mtype.FissionCampaignTaskTypeInstall: + source = mtype.FissionLogSourceInstall + case mtype.FissionCampaignTaskTypeCondAll: + source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondAll, mtype.FissionLogSourceCondAll) + case mtype.FissionCampaignTaskTypeCondOne: + source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondOne, mtype.FissionLogSourceCondOne) + } + + return +} + +type TaskTip struct { + PropMark string + Chance int32 + RecordId int64 +} + +func GetTaskTip(ctx context.Context, userId int64) (list []*TaskTip, err error) { + taskTipKey := ckey.FissionUserTaskTip(userId) + + strs, err := app.Redis.Cache.LRange(ctx, taskTipKey, 0, -1).Result() + if err != nil { + return + } + + list = make([]*TaskTip, 0, len(strs)) + for _, str := range strs { + taskTip := &TaskTip{} + if err = jsonm.StrUnmarshal(str, taskTip); err != nil { + continue + } + list = append(list, taskTip) + } + + return list, nil +} + +func AddTaskTip(ctx context.Context, userId int64, propMark string, chance int32, recordId int64) { + taskTipKey := ckey.FissionUserTaskTip(userId) + + taskTip := &TaskTip{ + PropMark: propMark, + Chance: chance, + RecordId: recordId, + } + + str, _ := jsonm.MarshalToString(taskTip) + + app.Redis.Cache.RPush(ctx, taskTipKey, str) + app.Redis.Cache.Expire(ctx, taskTipKey, consts.TimeWeek) +} + +func DelTaskTip(ctx context.Context, userId int64, l int32) { + taskTipKey := ckey.FissionUserTaskTip(userId) + + for i := 0; i < int(l); i++ { + app.Redis.Cache.LPop(ctx, taskTipKey) + } +} diff --git a/internal/service/provider/players/qa.go b/internal/service/provider/players/qa.go new file mode 100644 index 0000000..eb58d28 --- /dev/null +++ b/internal/service/provider/players/qa.go @@ -0,0 +1,717 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils" + "fmt" + "time" + + "gits.branchcn.com/backend/joybuywork/proto/go_proto/workerr" +) + +// Qa 现金转盘交互逻辑 +type Qa struct { + Player + player *model.FissionQa + conf *model.FissionCampaignQa + + fissionPlayerSetInitOnceKey string +} + +func NewQa(ctx context.Context, user *model.FissionUser, fissionId int64, opts ...Option) (player *Qa, err error) { + player = &Qa{} + + err = player.Init(ctx, user, fissionId, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Qa) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Qa) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Qa) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionQaLog + for _, task := range tasks { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + continue + } + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + val, _ := jsonm.MarshalToString(mtype.AnswerLogVal{ + TaskId: task.ID, + Chance: task.Chance, + }) + + log := withdefault.FissionQaLog(&model.FissionQaLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QaID: player.ID, + Type: mtype.FissionQaLogTypeAdd, + Val: val, + }) + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + log.Source = mtype.FissionLogSourceRegister + case mtype.FissionCampaignTaskTypeInstall: + log.Source = mtype.FissionLogSourceInstall + case mtype.FissionCampaignTaskTypeCondAll: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondAll, mtype.FissionLogSourceCondAll) + case mtype.FissionCampaignTaskTypeCondOne: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondOne, mtype.FissionLogSourceCondOne) + } + + logs = append(logs, log) + } + + if chance == 0 { + return + } + + m := s.GetDao().FissionQa + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +type QaAnswer struct { + QID int64 `json:"qid"` + AID []int64 `json:"aid"` +} + +func (s *Qa) Answer(submits []*QaAnswer) (score, qaRightNum int32, win bool, reward *model.FissionCampaignReward, record *model.FissionRewardRecord, info provider.RewardAutoLang, err error) { + player := s.GetPlayer() + + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + //答卷 + var qaIds []int64 + answer := make(map[int64]map[int64]struct{}) + for _, v := range submits { + qaIds = append(qaIds, v.QID) + answer[v.QID] = map[int64]struct{}{} + for _, v1 := range v.AID { + answer[v.QID][v1] = struct{}{} + } + } + + var qaNum = int32(len(qaIds)) + var qaGroupId int64 + + switch s.cpn.FissionID { + case consts.IdPrizeAnswer: + var checkGroup bool + temp, _ := cache.NewFissionTemp(s.Ctx).FindById(s.cpn.TemplateID) + if temp != nil { + group, _ := cache.NewFissionTempGroup(s.Ctx).FindById(temp.GroupID) + checkGroup = group.Mark == "answer_tmb" + } + + if !checkGroup { + score, err = s._prizeAnswerScore(qaIds, answer) + if err != nil { + return + } + } else { + qaNum, qaGroupId, err = s._getQaGroup() + if err != nil { + return + } + + score, qaRightNum, err = s._qaScore(qaNum, qaGroupId, qaIds, answer) + if err != nil { + return + } + } + + case consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: + qaNum, qaGroupId, err = s._getQaGroup() + if err != nil { + return + } + + score, qaRightNum, err = s._qaScore(qaNum, qaGroupId, qaIds, answer) + if err != nil { + return + } + default: + return + } + + answerSb, _ := jsonm.MarshalToString(submits) + win, reward, record, info, err = s._getReward(answerSb, score) + if err != nil { + return + } + + playerM := s.GetDao().FissionQa + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.AnswerLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + Score: score, + }) + + log := withdefault.FissionQaLog(&model.FissionQaLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QaID: player.ID, + Type: mtype.FissionQaLogTypeDecr, + Source: mtype.FissionLogSourceAnswer, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).SubmitQa(time.Now().Unix(), qaGroupId, qaNum, fmt.Sprint(score)) + + return +} + +// Sign 签到 +func (s *Qa) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionQa + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.AnswerLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionQaLog(&model.FissionQaLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QaID: player.ID, + Type: mtype.FissionQaLogTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// SetInit 获得初始次数 +func (s *Qa) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionQa + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.AnswerLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionQaLog(&model.FissionQaLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QaID: player.ID, + Type: mtype.FissionQaLogTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Qa) GetConf() *model.FissionCampaignQa { + if s.conf == nil { + s.conf, _ = cache.NewCampaignQa(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Qa) GetPlayer() *model.FissionQa { + return s.player +} + +// 玩家 +func (s *Qa) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Qa) firstOrCreate() (player *model.FissionQa, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Qa) _dbFirst() (*model.FissionQa, error) { + playerM := dao.FissionQa + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Qa) createPlayer() (player *model.FissionQa, err error) { + playerM := dao.FissionQa + player = withdefault.FissionQa(&model.FissionQa{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Qa) _addLog(logs ...*model.FissionQaLog) (err error) { + err = s.GetDao().FissionQaLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Qa) _prizeAnswerScore(qaIds []int64, answer map[int64]map[int64]struct{}) (score int32, err error) { + conf := s.GetConf() + + qm := s.GetDao().FissionCampaignQaQuestion + ql, err := qm.WithContext(s.Ctx).Where(qm.ID.In(qaIds...), qm.QaID.Eq(conf.ID), qm.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var qids []int64 + var scoreMap = make(map[int64]int32) + for _, v := range ql { + qids = append(qids, v.ID) + scoreMap[v.ID] = v.Score + } + + opm := s.GetDao().FissionCampaignQaOption + opl, err := opm.WithContext(s.Ctx).Where(opm.QuestionID.In(qids...), opm.IsRight.Eq(mtype.Yes), opm.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + //问题 + question := map[int64][]int64{} + for _, v := range opl { + question[v.QuestionID] = append(question[v.QuestionID], v.ID) + } + + for qid, aid := range question { + sub, ok := answer[qid] + if !ok { + continue + } + + var allRight = true + for _, v := range aid { + _, ok1 := sub[v] + if !ok1 { + allRight = false + break + } + } + + if allRight { + score += scoreMap[qid] + } + } + + return +} + +func (s *Qa) _getReward(answer string, score int32) (win bool, reward *model.FissionCampaignReward, record *model.FissionRewardRecord, info provider.RewardAutoLang, err error) { + m := s.GetDao().FissionCampaignReward + rl, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(s.user, m.Score, m.ID) + if err != nil { + return + } + + var thinkMap = make(map[int64]*model.FissionCampaignReward) + var rewardMap = make(map[int32][]*model.FissionCampaignReward) + var minScore int32 = -1 + for _, v := range rl { + if v.IsThank == mtype.Yes { + thinkMap[v.ID] = v + } else { + rewardMap[v.Score] = append(rewardMap[v.Score], v) + + if minScore == -1 { + minScore = v.Score + } + + } + } + + var stepScore int32 + var scoreRewards []*model.FissionCampaignReward + for sc, rewards := range rewardMap { + + if sc > score || sc <= stepScore { + continue + } + + stepScore = sc + scoreRewards = rewards + } + + if len(scoreRewards) == 1 { + reward = scoreRewards[0] + var deOk bool + deOk, err = award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().RuleFilter().IsOK() + + if deOk { + win = score >= minScore + record, info, err = s._answerReward(reward, answer, score) + return + } + } else { + var scoreRewardsMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range scoreRewards { + scoreRewardsMap[v.ID] = v + } + + key := ckey.FissionUserRewards(s.user.ID) + var ids []int64 + idStr := app.Redis.Cache.Get(s.Ctx, key).Val() + if idStr != "" { + ids = utils.SplitToInt64(idStr, consts.JoinComma) + } + + if len(ids) >= len(scoreRewards) { + ids = []int64{} + } + + var next = make(map[int64]struct{}) + for _, v := range ids { + next[v] = struct{}{} + } + + for _, v := range scoreRewardsMap { + reward = v + + if _, ok := next[reward.ID]; ok { + continue + } + + var deOk bool + deOk, err = award.NewAwardIssVerify(s.Ctx, s.user, reward).DeductStock().RuleFilter().IsOK() + + if deOk { + win = score >= minScore + record, info, err = s._answerReward(reward, answer, score) + break + } + + reward = nil + } + + if reward != nil { + ids = append(ids, reward.ID) + idStr = utils.Join(ids, consts.JoinComma) + app.Redis.Cache.SetEX(s.Ctx, key, idStr, consts.TimeDay*2) + return + } + + } + + for _, v := range thinkMap { + reward = v + win = score >= minScore + record, info, err = s._answerReward(v, answer, score) + return + } + + return +} + +// 答题奖品 +func (s *Qa) _answerReward(reward *model.FissionCampaignReward, answer string, score int32) (record *model.FissionRewardRecord, info provider.RewardAutoLang, err error) { + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One( + reward, + true, + award.RewardRecordAnswer(answer, score), + ) + return +} + +func (s *Qa) _qaScore(qal int32, qaGroupId int64, qaIds []int64, answer map[int64]map[int64]struct{}) (score, qaRightNum int32, err error) { + + qam := s.GetDao().LibraryQa + ql, err := qam.WithContext(s.Ctx).Where(qam.GroupID.Eq(qaGroupId), qam.ID.In(qaIds...), qam.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + l := int32(len(ql)) + + if l == 0 { + return + } + + if l < qal { + qal = l + } + + qaScore := 100 / qal + + var qids []int64 + var scoreMap = make(map[int64]int32) + for _, v := range ql { + qids = append(qids, v.ID) + scoreMap[v.ID] = qaScore + } + + opm := s.GetDao().LibraryQaOption + opl, err := opm.WithContext(s.Ctx).Where(opm.QaID.In(qids...), opm.IsRight.Eq(mtype.Yes), opm.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + //问题 + question := map[int64][]int64{} + for _, v := range opl { + question[v.QaID] = append(question[v.QaID], v.ID) + } + + for qid, aid := range question { + sub, ok := answer[qid] + if !ok { + continue + } + + var allRight = true + for _, v := range aid { + _, ok1 := sub[v] + if !ok1 { + allRight = false + break + } + } + + if allRight { + score += scoreMap[qid] + qaRightNum++ + } + } + + if qaRightNum >= qal { + score = 100 + } + + return +} + +func (s *Qa) _getQaGroup() (qaNum int32, qaGroupId int64, err error) { + cpn, qa := s.cpn, s.GetConf() + + qaNum, qaGroupId = qa.QaNum, qa.QaGroupID + + spLang := cpn.GetLangMarks() + if len(spLang) == 1 { + return + } + langMark := utils.NotExistGetFirst(s.user.LangMark, spLang) + + if langMark == spLang[0] { + return + } + + lang, err := cache.NewCampaignLang(s.Ctx).FindByCampaignId(cpn.ID, langMark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + return + } + + qaGroup := lang.GetQaGroup() + if qaGroup == nil { + return + } + + group, err := cache.NewLibraryQaGroup(s.Ctx).FindByHashId(qaGroup.QaGroupId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if group == nil { + return + } + + return qaGroup.QaNum, group.ID, nil +} diff --git a/internal/service/provider/players/qa_test.go b/internal/service/provider/players/qa_test.go new file mode 100644 index 0000000..8607c90 --- /dev/null +++ b/internal/service/provider/players/qa_test.go @@ -0,0 +1,28 @@ +package players + +import ( + "context" + "joybuywork/internal/repository/cache" + "testing" + + _ "joybuywork/test" +) + +func TestQaAnswer(t *testing.T) { + ctx := context.Background() + user, _ := cache.NewFissionUser(ctx, 5537).FindById(417362857461927936) + + player, _ := NewQa(ctx, user, 8) + + player.Answer([]*QaAnswer{ + { + QID: 138, + AID: []int64{464}, + }, + { + QID: 139, + AID: []int64{466}, + }, + }) + +} diff --git a/internal/service/provider/players/quiz.go b/internal/service/provider/players/quiz.go new file mode 100644 index 0000000..db80a11 --- /dev/null +++ b/internal/service/provider/players/quiz.go @@ -0,0 +1,347 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/utils" + "time" + + "gits.branchcn.com/backend/joybuywork/proto/go_proto/workerr" +) + +// Quiz 赛事竞猜交互逻辑 +type Quiz struct { + Player + player *model.FissionQuiz + conf *model.FissionCampaignQuiz + + fissionPlayerSetInitOnceKey string +} + +func NewQuiz(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Quiz, err error) { + player = &Quiz{} + + err = player.Init(ctx, user, consts.IdPrizeQuiz, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Quiz) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Quiz) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Quiz) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionQuizLog + for _, task := range tasks { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + continue + } + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + val, _ := jsonm.MarshalToString(mtype.QuizLogVal{ + TaskId: task.ID, + VoteNum: task.Chance, + }) + + log := withdefault.FissionQuizLog(&model.FissionQuizLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QuizID: player.ID, + Type: mtype.FissionQuizLogTypeAdd, + Val: val, + }) + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + log.Source = mtype.FissionLogSourceRegister + case mtype.FissionCampaignTaskTypeInstall: + log.Source = mtype.FissionLogSourceInstall + case mtype.FissionCampaignTaskTypeCondAll: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondAll, mtype.FissionLogSourceCondAll) + case mtype.FissionCampaignTaskTypeCondOne: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondOne, mtype.FissionLogSourceCondOne) + } + + logs = append(logs, log) + } + + if chance == 0 { + return + } + + m := s.GetDao().FissionQuiz + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +func (s *Quiz) Vote(optionId int64, voteNum int32) (err error) { + player, conf := s.GetPlayer(), s.GetConf() + + if conf.OpenPrize <= time.Now().Unix() { + err = workerr.CVoteEndError + return + } + + if player.Chance < voteNum { + return workerr.CChanceNoneError + } + + var optId = player.OptionID + optionM := s.GetDao().FissionCampaignQuizOption + + //如果原来没选,就设置一个 + if optId == 0 { + var option *model.FissionCampaignQuizOption + option, err = optionM.WithContext(s.Ctx).Where(optionM.ID.Eq(optionId), optionM.CampaignID.Eq(player.CampaignID), optionM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if option == nil { + return workerr.NotFound("not found opt") + } + + optId = option.ID + } + + if voteNum > 0 { + _, err = optionM.WithContext(s.Ctx).Where(optionM.ID.Eq(optId)).UpdateSimple(optionM.VoteNum.Add(int64(voteNum))) + if err != nil { + return s.BE().MysqlError(err) + } + } + + playerM := s.GetDao().FissionQuiz + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(voteNum), playerM.OptionID.Value(optId)) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.QuizLogVal{ + VoteNum: voteNum, + OptionId: optId, + }) + + log := withdefault.FissionQuizLog(&model.FissionQuizLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QuizID: player.ID, + Type: mtype.FissionQuizLogTypeDecr, + Source: mtype.FissionLogSourceVote, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Quiz) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionQuiz + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.QuizLogVal{ + VoteNum: conf.InitChance, + }) + + log := withdefault.FissionQuizLog(&model.FissionQuizLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + QuizID: player.ID, + Type: mtype.FissionQuizLogTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Quiz) GetConf() *model.FissionCampaignQuiz { + if s.conf == nil { + s.conf, _ = cache.NewCampaignQuiz(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Quiz) GetPlayer() *model.FissionQuiz { + return s.player +} + +// 玩家 +func (s *Quiz) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Quiz) firstOrCreate() (player *model.FissionQuiz, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Quiz) _dbFirst() (*model.FissionQuiz, error) { + playerM := dao.FissionQuiz + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Quiz) createPlayer() (player *model.FissionQuiz, err error) { + playerM := dao.FissionQuiz + player = withdefault.FissionQuiz(&model.FissionQuiz{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Quiz) _addLog(logs ...*model.FissionQuizLog) (err error) { + err = s.GetDao().FissionQuizLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/players/sign.go b/internal/service/provider/players/sign.go new file mode 100644 index 0000000..eb30a5e --- /dev/null +++ b/internal/service/provider/players/sign.go @@ -0,0 +1,1678 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + "errors" + "fmt" + "strings" + "time" + + "joybuywork/proto/go_proto/workerr" + + "github.com/golang-module/carbon/v2" + "github.com/rs/xid" + "gorm.io/gen/field" + "gorm.io/gorm" +) + +const ( + SignStatusOk = iota //签到成功 + SignStatusFail //签到失败 + SignStatusMissCard //补签卡不足 + SignStatusDone //已签到 + SignStatusCard //补签签到 + SignStatusWait //活动未开启 +) + +const ( + SignWait = iota // 未签到 + SignDone // 已签到 + SignMiss // 漏签 +) + +type Status struct { + DirectNum int64 // 直接邀请人数 + MaxContinue int32 // 最大连续签到 + TodaySign int32 // 今天是否有签到 + CycleDay int32 // 周期签到天数 +} + +// Sign 签到交互逻辑 +type Sign struct { + Player + player *model.FissionSign + conf *model.FissionCampaignSign + + upPlayer []field.AssignExpr + + signDataKey string + + cacheData *cachecurd.HMap +} + +func NewSign(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Sign, err error) { + player = &Sign{} + + err = player.Init(ctx, user, consts.IdSignIn, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +type SignReward struct { + RewardTitle string //奖品名称 + RewardNum int32 //获得的奖品数量 + ImgUrl string //奖品图片 + RewardId int64 //奖品id + ReceiveType int32 //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + KvData []*mtype.KV //键值数据 + Contact string //联系方式 +} + +// SignIn 签到 +func (s *Sign) SignIn(signTime int64) (status int32, reward *SignReward, err error) { + defer func() { + s.AfterDo(err) + }() + tz := s.GetTz() + if !tz.IsRunning() { + status = SignStatusWait + return + } + + // 今天的开始 + today, _ := timez.GMTTimeStart(tz.GetTz()) + + // 提交上来的签到时间有这个可能是补签卡 + submitDay, _ := timez.GMTTimeStart(tz.GetTz(), signTime) + + s.Tran() + defer func() { + s.TranCommit(err) + }() + + conf := s.GetConf() + if conf.SignType == mtype.FissionCampaignSignTypeCycle { + + if signTime == 0 || today.Equal(submitDay) { + return s._cycleSign() + } + + return s._cycleCardSign(submitDay) + } + + // 下面的逻辑太老旧了,不想嵌套到里面 !!! + + if today.Before(submitDay) { // 如果当前时间小于提交的时间,那就是未来的时间,未来时间不可以签到 + status = SignStatusFail + return + } + + if signTime == 0 || today.Equal(submitDay) { + return s._todaySign(today) + } + + return s._cardSign(submitDay) +} + +// 周期补签卡签到 +func (s *Sign) _cycleCardSign(signTime time.Time) (status int32, reward *SignReward, err error) { + s._cycleStart() + + playerM := s.GetDao().FissionSign + player := s.GetPlayer() + + if player.CardNum <= 0 { + status = SignStatusMissCard + return + } + + if player.CycleStart > signTime.Unix() || signTime.Unix() >= time.Now().Unix() { + status = SignStatusFail + return + } + + status, signDay, err := s._sign(signTime, true) + if err != nil || status != SignStatusOk { + return + } + + cd, err := s._cycleData(false) + if err != nil { + return + } + + // 签到的天更新 + signStr, err := cd.Get(signCycleDay) + if err != nil { + return + } + if signStr == "" { + signStr = signDay.SignDate + } else { + signStr += consts.JoinComma + signDay.SignDate + } + + s.AddOkDone(func() { + _ = cd.Set(signCycleDay, signStr) + }) + + continueNum, maxContinue, _, err := s._continueNum() + if err != nil { + return + } + + s.AddOkDone(func() { + _ = cd.Set(signMaxContinue, fmt.Sprint(maxContinue)) + _ = cd.Set(signContinueNum, fmt.Sprint(continueNum)) + + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).UseProp(time.Now().Unix(), consts.PropNameSignCard) + }) + + s.upPlayer = append( + s.upPlayer, + playerM.SignContinue.Value(continueNum), + playerM.MaxContinue.Value(maxContinue), + playerM.CardNum.Sub(1), + ) + + signDays := strings.Split(signStr, consts.JoinComma) + signNum := int32(len(signDays)) + + reward, recordIds, err := s._cycleReward(signNum, signDay) + if err != nil { + return + } + + err = s._cyclePlayerSync(recordIds) + if err != nil { + return + } + + return +} + +// 周期签到 +func (s *Sign) _cycleSign() (status int32, reward *SignReward, err error) { + s._cycleStart() + + playerM := s.GetDao().FissionSign + player, tz := s.GetPlayer(), s.GetTz() + // 今天的开始 + today, _ := timez.GMTTimeStart(tz.GetTz()) + + status, signDay, err := s._sign(today, false) + if err != nil || status != SignStatusOk { + return + } + + if player.SignStart == 0 { + s.player.SignStart = today.Unix() + s.upPlayer = append(s.upPlayer, playerM.SignStart.Value(today.Unix())) + } + + cd, err := s._cycleData(false) + if err != nil { + return + } + + s.AddOkDone(func() { + // 下一次签到时间 + err = cd.Set(signNextDay, fmt.Sprint(today.AddDate(0, 0, 1).Unix())) + if err != nil { + return + } + + // 最后签到时间 + err = cd.Set(signLastDay, fmt.Sprint(today.Unix())) + if err != nil { + return + } + }) + + // 签到的天更新 + signStr, err := cd.Get(signCycleDay) + if err != nil { + return + } + if signStr == "" { + signStr = signDay.SignDate + } else { + signStr += consts.JoinComma + signDay.SignDate + } + + s.AddOkDone(func() { + _ = cd.Set(signCycleDay, signStr) + }) + + // 连续签到数据 + continueNum, _ := cd.GetInt64(signContinueNum) + s.AddOkDone(func() { + _, _ = cd.Incr(signContinueNum, 1) + }) + + continueNum += 1 + maxContinue, _ := cd.GetInt64(signMaxContinue) + if continueNum > maxContinue { + maxContinue = continueNum + + s.AddOkDone(func() { + _ = cd.Set(signMaxContinue, fmt.Sprint(maxContinue)) + }) + } + + s.upPlayer = append( + s.upPlayer, + playerM.SignContinue.Value(int32(continueNum)), + playerM.MaxContinue.Value(int32(maxContinue)), + ) + + signDays := strings.Split(signStr, consts.JoinComma) + signNum := int32(len(signDays)) + + reward, recordIds, err := s._cycleReward(signNum, signDay) + if err != nil { + return + } + + err = s._cyclePlayerSync(recordIds) + if err != nil { + return + } + + return +} + +// 周期奖品处理 +func (s *Sign) _cycleReward(signNum int32, signDay *model.FissionSignDay) (reward *SignReward, recordIds []int64, err error) { + //当前签到是否有奖品 + rewards, err := cmm.NewUserAppReward(s.Ctx).Get(s.GetDao(), s.user) + if err != nil { + return + } + + var signReward *model.FissionCampaignReward + for _, v := range rewards { + if v.SignDay > signNum { + break + } + + if v.SignDay == signNum { + signReward = v + } + } + + if signReward == nil { + return + } + + reward, recordIds, err = s._signReward(signDay, signReward) + if err != nil { + return + } + + // 绑定数据 + sdm := s.GetDao().FissionSignDay + _, err = sdm.WithContext(s.Ctx).Where(sdm.ID.Eq(signDay.ID)).UpdateSimple(sdm.RecordIds.Value(utils.Join(recordIds, consts.JoinComma))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 周期用户更新数据同步 +func (s *Sign) _cyclePlayerSync(recordIds []int64) (err error) { + playerM := s.GetDao().FissionSign + player := s.GetPlayer() + // 更新玩家数据 + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(s.upPlayer...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 更新统计数据 + statM := s.GetDao().FissionUserStat + _, err = statM.WithContext(s.Ctx).Where(statM.UserID.Eq(player.UserID)).UpdateSimple(statM.SignNum.Add(1), statM.SignRewardNum.Add(int64(len(recordIds)))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +type SignBoard struct { + SignDate []*SignBoardOne //签到板信息 + NowMouth string //当前月 + CycleDate []*SignCycleDateOne +} + +type SignCycleDateOne struct { + SignTime int64 //签到时间 + SignIn int32 //签到类型(0-未签,1-已签,2-漏签) + NowDay bool //是否今天 + RewardId int64 //奖品id,0即没有礼物 + RewardTitle string //奖品图片 + RewardImg string //奖品标题 + IsSuper int32 //是否超级大奖 (0-否,1-是) + Y string //年 + M string //月 + D string //日 +} +type SignBoardOne struct { + Y string //年 + M string //月 + D string //日 + SignIn int32 //签到类型(0-未签,1-已签,2-漏签) + Ban bool //是否非签到日期 + RewardId int64 //奖品id,0即没有礼物 + Open bool //是否已经领奖 + NowWeek bool //是否本周 + NowDay bool //是否今天 + LastMiss bool //是否最后一个漏签 + NowMouth bool //是否本月 +} + +// SignBoard 签到版 +func (s *Sign) SignBoard(pageType int32, nowMouth string) (signBoard *SignBoard, err error) { + defer func() { + s.AfterDo(err) + }() + conf := s.GetConf() + if conf.SignType == mtype.FissionCampaignSignTypeCycle { + return s._cycleSignBoard() + } + + return s._normalSignBoard(pageType, nowMouth) +} + +// 周期签到板 +func (s *Sign) _cycleSignBoard() (signBoard *SignBoard, err error) { + s._cycleStart() + + rewards, err := cmm.NewUserAppReward(s.Ctx).Get(s.GetDao(), s.user, s.GetDao().FissionCampaignReward.SignDay) + if err != nil { + return + } + + var rewardIds []int64 + var dayReward = make(map[int32]*model.FissionCampaignReward) + for _, reward := range rewards { + dayReward[reward.SignDay] = reward + rewardIds = append(rewardIds, reward.RewardID) + } + + prewards, err := provider.NewRewards(s.Ctx, s.cpn.ProjectID, rewardIds...) + if err != nil { + return + } + + player, conf, tz := s.GetPlayer(), s.GetConf(), s.GetTz() + + today, _ := timez.GMTTimeStart(tz.GetTz()) + cycleStart, _ := timez.GMTTimeStart(tz.GetTz(), player.CycleStart) + cpnEnd := s.GetTz().EndTime() + cd, err := s._cycleData(false) + if err != nil { + return + } + + signDayStr, _ := cd.Get(signCycleDay) + var signDay []string + if signDayStr != "" { + signDay = strings.Split(signDayStr, consts.JoinComma) + } + + var signMap = make(map[string]struct{}) + for _, v := range signDay { + signMap[v] = struct{}{} + } + + var signNum int32 + var signDate = make([]*SignCycleDateOne, 0, int(conf.SignCycle)) + for i := 0; i < int(conf.SignCycle); i++ { + one := &SignCycleDateOne{ + SignTime: cycleStart.Unix(), + SignIn: 0, + NowDay: false, + RewardId: 0, + RewardTitle: "", + RewardImg: "", + IsSuper: 0, + Y: fmt.Sprint(cycleStart.Year()), + M: fmt.Sprint(int(cycleStart.Month())), + D: fmt.Sprint(cycleStart.Day()), + } + + shortDate := cycleStart.Format(timez.ShortDateOnly) + + if cycleStart.Before(today) { + if _, ok := signMap[shortDate]; ok { + one.SignIn = SignDone + signNum++ + } else { + one.SignIn = SignMiss + } + } else { + signNum++ + } + + if cycleStart.Equal(today) { + one.NowDay = true + if _, ok := signMap[shortDate]; ok { + one.SignIn = SignDone + } + } + + if reward, ok := dayReward[signNum]; ok { + info := prewards.AutoLang(reward.RewardID, s.user.LangMark) + one.RewardId = reward.ID + one.IsSuper = int32(reward.IsSuper) + one.RewardTitle = info.Title + one.RewardImg = info.ImgUrl + delete(dayReward, signNum) + } + + signDate = append(signDate, one) + cycleStart = cycleStart.AddDate(0, 0, 1) + if cycleStart.After(cpnEnd) { + break + } + } + + signBoard = &SignBoard{CycleDate: signDate} + + return +} + +// 看看要不要重制周期时间 +func (s *Sign) _cycleStart() { + cd, err := s._cycleData(false) + if err != nil { + return + } + + player, conf := s.GetPlayer(), s.GetConf() + + dayStart := s._dayStart() + yesterdayStart := dayStart.AddDate(0, 0, -1) + var refresh bool + playerM := s.GetDao().FissionSign + if player.CycleStart == 0 { + s.player.CycleStart = dayStart.Unix() + s.upPlayer = append(s.upPlayer, playerM.CycleStart.Value(dayStart.Unix())) + + s.AddOkDone(func() { + _ = cd.Set(signNextDay, fmt.Sprint(dayStart.Unix())) + }) + + } else if conf.RecycleType == mtype.FissionCampaignRecycleTypeContinue { + lastDay, _ := cd.GetInt64(signLastDay) + if lastDay < yesterdayStart.Unix() { + s.player.CycleStart = dayStart.Unix() + s.upPlayer = append(s.upPlayer, playerM.CycleStart.Value(dayStart.Unix())) + _ = cd.Clear() + refresh = true + } + } else if conf.RecycleType == mtype.FissionCampaignRecycleTypeCycle { + if (dayStart.Unix()-player.CycleStart)/consts.DaySec >= int64(conf.SignCycle) { + s.player.CycleStart = dayStart.Unix() + s.upPlayer = append(s.upPlayer, playerM.CycleStart.Value(dayStart.Unix())) + _ = cd.Clear() + refresh = true + } + } + + _, err = s._cycleData(refresh) + if err != nil { + return + } +} + +func (s *Sign) _dayStart() time.Time { + tz := s.GetTz() + dayStart, _ := timez.GMTTimeStart(tz.GetTz()) + cpnStart := tz.StarTime() + if dayStart.Before(cpnStart) { + dayStart = cpnStart + } + return dayStart +} + +// GetSignCard 获得了签到卡 +func (s *Sign) GetSignCard(num int32) (err error) { + player := s.GetPlayer() + + m := s.GetDao().FissionSign + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.CardNum.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.ToObjString(mtype.SignLogVal{CardNum: num}) + + err = s._addLog(withdefault.FissionSignLog(&model.FissionSignLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignID: player.ID, + Type: mtype.FissionSignLogTypeSignCard, + Source: mtype.FissionSignLogSourceGetCard, + Val: val, + })) + if err != nil { + return + } + + s.appTrack().GetProp(time.Now().Unix(), consts.PropNameSignCard, num) + + return +} + +// GetStatus 用户额外信息 +func (s *Sign) GetStatus() (status Status, err error) { + player, conf, tz := s.GetPlayer(), s.GetConf(), s.GetTz() + + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.Ctx).Where(statM.UserID.Eq(player.UserID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if stat != nil { + status.DirectNum = stat.DirectNum + } + + var maxContinue = player.MaxContinue + if player.NextStep > 0 { + maxContinue = 0 + m := s.GetDao().FissionCampaignReward + if player.NextStep > 1 { + + var reward *model.FissionCampaignReward + reward, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID), m.Step.Eq(player.NextStep-1)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward != nil { + maxContinue = reward.SignDay + } + } else if player.LoopNum > 0 { + var rewards []*model.FissionCampaignReward + rewards, err = cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(s.user, m.Step) + if err != nil { + return + } + + l := len(rewards) + maxContinue = rewards[l-1].SignDay + } + } + + status.MaxContinue = maxContinue + + today, _ := timez.GMTTimeStart(tz.GetTz()) + exist, err := s._hasSign(today) + if err != nil { + return + } + + status.TodaySign = utils.Ternary[int32](exist, 1, 0) + + // 周期签到天数 + if conf.SignType == mtype.FissionCampaignSignTypeCycle { + s._cycleStart() + + cd, _ := s._cycleData(false) + cycleDay, _ := cd.Get(signCycleDay) + if cycleDay != "" { + status.CycleDay = int32(len(strings.Split(cycleDay, consts.JoinComma))) + } + + } + + return +} + +// GetConf 获取玩法配置 +func (s *Sign) GetConf() *model.FissionCampaignSign { + if s.conf == nil { + s.conf, _ = cache.NewCampaignSign(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Sign) GetPlayer() *model.FissionSign { + return s.player +} + +// 玩家 +func (s *Sign) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.signDataKey = ckey.FissionSignData(player.ID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Sign) firstOrCreate() (player *model.FissionSign, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Sign) _dbFirst() (*model.FissionSign, error) { + playerM := dao.FissionSign + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Sign) createPlayer() (player *model.FissionSign, err error) { + playerM := dao.FissionSign + player = withdefault.FissionSign(&model.FissionSign{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Sign) _addLog(logs ...*model.FissionSignLog) (err error) { + err = s.GetDao().FissionSignLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 连续签到数据 +func (s *Sign) _continueNum() (continueNum, maxContinue int32, cycleDate []string, err error) { + player, tz := s.GetPlayer(), s.GetTz() + m := s.GetDao().FissionSignDay + list, err := m.WithContext(s.Ctx).Where( + m.UserID.Eq(player.UserID), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + signMap := make(map[string]struct{}) + for _, day := range list { + signMap[day.SignDate] = struct{}{} + } + + var start = player.SignStart + if start == 0 { + start = time.Now().Unix() + } + + sdn := timez.GMTCarbon(tz.GetTz()).Now() + sd := utils.BetweenDay(timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(start).StartOfDay(), sdn) + cycleStart, _ := timez.GMTTimeStart(tz.GetTz(), player.CycleStart) + cycle := cycleStart.Format(timez.ShortDateOnly) + + for _, day := range sd { + _, ok := signMap[day] + + if !ok { + continueNum = 0 + continue + } + + if day >= cycle { + cycleDate = append(cycleDate, day) + } + + continueNum++ + + if continueNum > maxContinue { + maxContinue = continueNum + } + } + + return +} + +// 获得奖品通用处理 +func (s *Sign) _signReward(sign *model.FissionSignDay, rewards ...*model.FissionCampaignReward) (signReward *SignReward, recordId []int64, err error) { + if len(rewards) == 0 { + return + } + + var rewardIds []int64 + var add []*award.RewardOne + for _, reward := range rewards { + rewardIds = append(rewardIds, reward.ID) + add = append(add, &award.RewardOne{ + Reward: reward, + }) + } + + records, async, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).Batch(add, false) + if err != nil { + return + } + + stock, err := stocks.NewCampaignReward(s.Ctx, rewardIds...) + if err != nil { + return + } + + player := s.GetPlayer() + var addLog []*model.FissionSignLog + for _, v := range records { + recordId = append(recordId, v.Record.ID) + + val, _ := jsonm.MarshalToString(mtype.SignLogVal{ + TOffset: s.GetTz().GetTz(), + SignDate: sign.SignDate, + RecordId: v.Record.ID, + RewardId: v.Record.RewardID, + }) + addLog = append(addLog, withdefault.FissionSignLog(&model.FissionSignLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignID: player.ID, + Type: mtype.FissionSignLogTypeGetReward, + Source: utils.Ternary[string](sign.SignType == mtype.FissionSignTypeRemedy, mtype.FissionSignLogSourceCardReward, mtype.FissionSignLogSourceSignReward), + Val: val, + })) + + _ = stock.AddUseStock(1, v.Record.RewardID) + } + + err = s._addLog(addLog...) + if err != nil { + return + } + + record, info := records[0].Record, records[0].Info + + signReward = &SignReward{ + RewardTitle: info.Title, + RewardNum: record.RewardNum, + ImgUrl: info.ImgUrl, + RewardId: record.RewardID, + ReceiveType: info.ReceiveType, + KvData: make([]*mtype.KV, 0, len(info.KvData)), + Contact: info.Contact, + } + + for _, v := range info.KvData { + signReward.KvData = append(signReward.KvData, &mtype.KV{ + Key: v.Key, + Value: v.Value, + }) + } + + s.AddOkDone(async...) + + return +} + +const ( + signNextDay = "next_day" // 下次签到日期 + signLastDay = "last_day" // 最后签到日期 + signContinueNum = "continue_num" // 连续签到天数 + signMaxContinue = "max_continue" // 最大连续签到天数 + signCycleDay = "cycle_day" // 周期内签到天 +) + +func (s *Sign) _cycleData(refresh bool) (data *cachecurd.HMap, err error) { + if s.cacheData != nil && !refresh { + return s.cacheData, nil + } + + player, tz := s.GetPlayer(), s.GetTz() + dayStart, _ := timez.GMTTimeStart(tz.GetTz()) + + yesterdayStart := dayStart.AddDate(0, 0, -1) + + data, err = cachecurd.NewHMap(s.Ctx, s.signDataKey, cachecurd.SetHMapExp(2*consts.TimeDay)) + if err != nil { + return + } + + data, err = data.CustomBuild(func() ([]string, error) { + var values []string + today := dayStart.Format(timez.ShortDateOnly) + yesterday := yesterdayStart.Format(timez.ShortDateOnly) + m := s.GetDao().FissionSignDay + sign, err1 := m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.SignDate.In(today, yesterday)).Find() + if err1 != nil { + return nil, err1 + } + + var todaySign, yesterdaySign *model.FissionSignDay + for _, v := range sign { + if v.SignDate == today { + todaySign = v + } else if v.SignDate == yesterday { + yesterdaySign = v + } + } + + if todaySign == nil { + values = append(values, signNextDay, fmt.Sprint(dayStart.Unix())) + } else { + values = append(values, signNextDay, fmt.Sprint(dayStart.AddDate(0, 0, 1).Unix())) + } + + if yesterdaySign == nil { + values = append(values, signLastDay, "0") + } else { + values = append(values, signLastDay, fmt.Sprint(yesterdayStart.Unix())) + } + + // 连续签到天数 + continueNum, maxContinue, cycleDate, err1 := s._continueNum() + if err1 != nil { + return nil, err1 + } + values = append(values, signContinueNum, fmt.Sprint(continueNum), signMaxContinue, fmt.Sprint(maxContinue), signCycleDay, strings.Join(cycleDate, consts.JoinComma)) + + return values, nil + }) + if err != nil { + return + } + + s.cacheData = data + + return +} + +// 是否已经签到了 +func (s *Sign) _hasSign(today time.Time) (exist bool, err error) { + shortDay := today.Format(timez.ShortDateOnly) + player := s.GetPlayer() + + key := ckey.FissionCampaignSignState(player.CampaignID, shortDay) + if app.Redis.Cache.HExists(s.Ctx, key, fmt.Sprint(player.UserID)).Val() { + exist = true + return + } + + m := s.GetDao().FissionSignDay + sign, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.SignDate.Eq(shortDay)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return sign != nil, nil +} + +// 签到某一天 +func (s *Sign) _sign(signTime time.Time, useCard bool) (status int32, signDay *model.FissionSignDay, err error) { + shortDay := signTime.Format(timez.ShortDateOnly) + player, tz, conf := s.GetPlayer(), s.GetTz(), s.GetConf() + + // 是否已经签到了 + exist, err := s._hasSign(signTime) + if err != nil { + return + } + if exist { + status = SignStatusDone + return + } + + var value = xid.New().String() + var mapKey = fmt.Sprint(player.UserID) + var key = ckey.FissionCampaignSignState(player.CampaignID, shortDay) + // 预防一些错误,要回滚缓存 + s.AddErrDone(func() { + v := app.Redis.Cache.HGet(s.Ctx, key, mapKey).Val() + if v == value { + app.Redis.Cache.HDel(s.Ctx, key, mapKey) + } + }) + + if !app.Redis.Cache.HSetNX(s.Ctx, key, mapKey, value).Val() { + status = SignStatusDone + return + } + + // 延长缓存时间 + app.Redis.Cache.ExpireAt(s.Ctx, key, signTime.AddDate(0, 0, 1)) + + // 签到记录 + signDay = withdefault.FissionSignDay(&model.FissionSignDay{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignDate: shortDay, + SignType: utils.Ternary[int8](useCard, mtype.FissionSignTypeOk, mtype.FissionSignTypeRemedy), + RecordIds: "", + }) + + if err = s.GetDao().FissionSignDay.WithContext(s.Ctx).Create(signDay); err != nil { + if errors.Is(err, gorm.ErrDuplicatedKey) { + status = SignStatusFail + return + } + + err = s.BE().MysqlError(err) + return + } + + // 加日志 + if useCard { + val, _ := jsonm.ToObjString(mtype.SignLogVal{ + TOffset: tz.GetTz(), + SignDate: shortDay, + CardNum: 1, + }) + + err = s._addLog(withdefault.FissionSignLog(&model.FissionSignLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignID: player.ID, + Type: mtype.FissionSignLogTypeSignCard, + Source: mtype.FissionSignLogSourceUseCard, + Val: val, + })) + if err != nil { + return + } + + } else { + val, _ := jsonm.ToObjString(mtype.SignLogVal{ + TOffset: tz.GetTz(), + SignDate: shortDay, + }) + + err = s._addLog(withdefault.FissionSignLog(&model.FissionSignLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignID: player.ID, + Type: mtype.FissionSignLogTypeSign, + Source: utils.Ternary[string](conf.SignType == mtype.FissionCampaignSignTypeCycle, mtype.FissionSignLogSourceManualSign, mtype.FissionSignLogSourceAutoSign), + Val: val, + })) + + if err != nil { + return + } + } + + s.AddOkDone(func() { + // 新版报表数据 + if s.cpn.ReportType == mtype.FissionCampaignReportTypeNew { + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).Sign(time.Now().Unix(), tz.GetTz(), signTime.Format(timez.ShortDateOnly)) + } + }) + + s.upPlayer = append(s.upPlayer, s.GetDao().FissionSign.SignDay.Add(1)) + + return +} + +// 当天签到(旧) +func (s *Sign) _todaySign(today time.Time) (status int32, reward *SignReward, err error) { + status, signDay, err := s._sign(today, false) + if err != nil || status != SignStatusOk { + return + } + + reward, err = s._signOk(signDay) + if err != nil { + return + } + + return +} + +// 补签卡签到(旧) +func (s *Sign) _cardSign(signDate time.Time) (status int32, reward *SignReward, err error) { + player, tz := s.GetPlayer(), s.GetTz() + if player.CardNum == 0 { + status = SignStatusMissCard + return + } + + shortDay := signDate.Format(timez.ShortDateOnly) + + m := s.GetDao().FissionSignDay + sign, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(player.UserID), m.SignDate.Eq(shortDay)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if sign != nil { + status = SignStatusDone + return + } + + signDay := withdefault.FissionSignDay(&model.FissionSignDay{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignDate: shortDay, + SignType: mtype.FissionSignTypeOk, + RecordIds: "", + }) + + if err = m.WithContext(s.Ctx).Create(signDay); err != nil { + if errors.Is(err, gorm.ErrDuplicatedKey) { + status = SignStatusFail + return + } + + err = s.BE().MysqlError(err) + return + } + + status = SignStatusCard + + playerM := s.GetDao().FissionSign + s.upPlayer = append(s.upPlayer, playerM.CardNum.Sub(1)) + + // 加日志 + val, _ := jsonm.ToObjString(mtype.SignLogVal{ + TOffset: tz.GetTz(), + SignDate: shortDay, + }) + + err = s._addLog(withdefault.FissionSignLog(&model.FissionSignLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SignID: player.ID, + Type: mtype.FissionSignLogTypeSignCard, + Source: mtype.FissionSignLogSourceUseCard, + Val: val, + })) + + if err != nil { + return + } + + reward, err = s._signOk(signDay) + if err != nil { + return + } + + if s.cpn.ReportType == mtype.FissionCampaignReportTypeNew { + fissionaction.NewMarkPoint(s.Ctx).InApp(s.user).UseProp(time.Now().Unix(), consts.PropNameSignCard) + } + + return +} + +// 普通签到版(旧) +func (s *Sign) _normalSignBoard(pageType int32, nowMouth string) (signBoard *SignBoard, err error) { + cpn, conf, player, tz := s.cpn, s.conf, s.GetPlayer(), s.GetTz() + + // 签到开始和结束时间 + var now = timez.GMTCarbon(tz.GetTz()).Now() + var start carbon.Carbon + var end = timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(cpn.TEnd).EndOfDay() + if cpn.Status == mtype.FissionCampaignStatusWait { + start = timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(cpn.TStart) + } else if player.SignStart != 0 { + start = timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(player.SignStart) + } else { + start = now + } + + start = start.StartOfDay() + + // 奖品日期 + dayReward, lastReward, err := s._dayReward(start, end, player.LoopNum) + if err != nil { + return + } + + // 签到数据 + signMap, rewardIdMap, openMap, lastMiss, err := s._dataMap(start, now, dayReward, lastReward) + if err != nil { + return + } + + // 本周开始和周结束 + wStart, wEnd := now.StartOfWeek(), now.EndOfWeek() + + // 某个呀的签到板 + var mStart carbon.Carbon + switch pageType { + case 1: + mStart = timez.GMTCarbon(tz.GetTz()).ParseByFormat(nowMouth, "Y-n").AddMonth() + case 2: + mStart = timez.GMTCarbon(tz.GetTz()).ParseByFormat(nowMouth, "Y-n").SubMonth() + } + + if mStart.IsInvalid() { + mStart = now + } + + // 完整月 + mStart = mStart.StartOfMonth() + mEnd := mStart.EndOfMonth() + + signBoard = &SignBoard{ + SignDate: nil, + NowMouth: mStart.ToFormatString("Y-n"), + } + + // 之前的时间 + nw := mStart.Week() + for i := nw; i > 0; i-- { + s._appendSignDate(mStart.SubDays(i), start, end, wStart, wEnd, mStart, mEnd, rewardIdMap, signMap, openMap, conf.HasCard, lastMiss, signBoard) + } + + begin := mStart + for { + if begin.Gte(mEnd) { + break + } + + s._appendSignDate(begin, start, end, wStart, wEnd, mStart, mEnd, rewardIdMap, signMap, openMap, conf.HasCard, lastMiss, signBoard) + + begin = begin.AddDay() + } + + ew := begin.Week() + for i := 0; i < 7-ew; i++ { + s._appendSignDate(begin.AddDays(i), start, end, wStart, wEnd, mStart, mEnd, rewardIdMap, signMap, openMap, conf.HasCard, lastMiss, signBoard) + } + + return +} + +// 普通签到获得奖品逻辑(旧) +func (s *Sign) _normalReward(sign *model.FissionSignDay, totalNum int32) (signReward *SignReward, recordId []int64, err error) { + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + rewards, err := cm.UserAppReward(s.user) + if err != nil { + return + } + + if len(rewards) == 0 { + return + } + + reward := rewards[0] + num := totalNum / reward.SignDay + if num == 0 { + return + } + + player := s.GetPlayer() + m := s.GetDao().FissionRewardRecord.SubTable(player.ID) + count, err := m.WithContext(s.Ctx).Where( + m.UserID.Eq(player.ID), + m.RewardID.Eq(reward.ID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + ).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + can := int64(num) - count + if can == 0 { + return + } + + var addRewards []*model.FissionCampaignReward + for i := can; i > 0; i-- { + addRewards = append(addRewards, reward) + } + + return s._signReward(sign, addRewards...) +} + +// 阶梯签到获得奖品逻辑(旧) +func (s *Sign) _stepReward(sign *model.FissionSignDay, totalNum int32) (signReward *SignReward, recordId []int64, err error) { + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + rewards, err := cm.UserAppReward(s.user, s.GetDao().FissionCampaignReward.Step) + if err != nil { + return + } + + if len(rewards) == 0 { + return + } + + player, conf := s.GetPlayer(), s.GetConf() + + var stepMap = make(map[int32]*model.FissionCampaignReward) + for _, v := range rewards { + stepMap[v.Step] = v + } + + m := s.GetDao().FissionRewardRecord.SubTable(player.CampaignID) + list, err := m.WithContext(s.Ctx).Where( + m.UserID.Eq(player.UserID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf.IsLoop == mtype.No { + + for _, v := range list { + delete(stepMap, v.Step) + } + + var addRewards []*model.FissionCampaignReward + for _, reward := range stepMap { + if totalNum < reward.SignDay { + continue + } + + addRewards = append(addRewards, reward) + } + + signReward, recordId, err = s._signReward(sign, addRewards...) + if err != nil { + return + } + + return + } + + l := len(rewards) + lastReward := rewards[l-1] + + signDay := 1 + player.SignDay - player.LoopNum*lastReward.SignDay + nextStep := player.NextStep + if nextStep == 0 { + nextStep = 1 + } + if signDay < totalNum { + totalNum = signDay + } + + var addLoopNum int32 + var addRewards []*model.FissionCampaignReward + for { + + stepReward := stepMap[nextStep] + if totalNum < stepReward.SignDay { + break + } + + if stepReward.ID == lastReward.ID { + addLoopNum++ + nextStep = 1 + totalNum -= lastReward.SignDay + + } else { + nextStep++ + } + + addRewards = append(addRewards, stepReward) + } + + signReward, recordId, err = s._signReward(sign, addRewards...) + if err != nil { + return + } + + playerM := s.GetDao().FissionSign + s.upPlayer = append(s.upPlayer, playerM.LoopNum.Add(addLoopNum), playerM.NextStep.Value(nextStep)) + + return +} + +type signState struct { + RewardId int64 + SignDay int32 + addDay int +} + +// 签到板奖品分布(旧) +func (s *Sign) _dayReward(start, end carbon.Carbon, loopNum int32) (dayReward []*signState, lastReward *model.FissionCampaignReward, err error) { + conf := s.GetConf() + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(s.user) + if err != nil { + return + } + + if len(rewards) == 0 { + err = workerr.NotFound("not found reward") + return + } + + l := len(rewards) + lastReward = rewards[l-1] + + // 非阶梯一个奖品,多次获得 + if conf.SignType == mtype.FissionCampaignSignTypeNormal { + reward := rewards[0] + + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = workerr.NotFound("not found reward") + return + } + + diff := start.DiffAbsInDays(end) + 1 + + times := int(diff / int64(reward.SignDay)) + dayReward = make([]*signState, times) + for i := 0; i < times; i++ { + day := int32(i+1)*reward.SignDay - 1 + dayReward[i] = &signState{ + RewardId: reward.ID, + addDay: int(day), + SignDay: reward.SignDay, + } + } + + return + } + + // 活动奖品,阶梯多奖品 + + // 不支持阶梯循环 + if conf.IsLoop == mtype.No { + dayReward = make([]*signState, 0, len(rewards)) + for _, v := range rewards { + dayReward = append(dayReward, &signState{ + RewardId: v.ID, + addDay: int(v.SignDay - 1), + SignDay: v.SignDay, + }) + } + + return + } + + doLoop := int(loopNum + 1) + + for i := 0; i < doLoop; i++ { + for _, v := range rewards { + dayReward = append(dayReward, &signState{ + RewardId: v.ID, + addDay: int(v.SignDay-1) + int(lastReward.SignDay)*i, + SignDay: v.SignDay, + }) + } + } + + return +} + +// 签到版基础数据(旧) +func (s *Sign) _dataMap(start, now carbon.Carbon, dayReward []*signState, lastReward *model.FissionCampaignReward, +) (signMap map[string]int8, rewardIdMap map[string]int64, openMap map[int64]int, lastMiss string, err error) { + + player, conf, tz := s.GetPlayer(), s.GetConf(), s.GetTz() + + // 签到的所有数据 + sdm := s.GetDao().FissionSignDay + sd, err := sdm.WithContext(s.Ctx). + Select(sdm.SignDate, sdm.RecordIds). + Where( + sdm.UserID.Eq(player.UserID), + sdm.SignDate.Gte(start.ToShortDateString()), + sdm.SignDate.Lte(now.ToShortDateString()), + ).Order(sdm.SignDate).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + sdMap := make(map[string][]int64) + for _, day := range sd { + sdMap[day.SignDate] = day.GetRecordIds() + } + + rewardIdMap = make(map[string]int64) + var recordIds []int64 + signMap = make(map[string]int8) + se := utils.BetweenDay(start, now) + for _, day := range se { + + idv, ok := sdMap[day] + + if ok { + if len(idv) > 0 { + recordIds = append(recordIds, idv...) + } + signMap[day] = mtype.FissionSignTypeOk + continue + } + + signMap[day] = mtype.FissionSignTypeMiss + lastMiss = day + missDay := timez.GMTCarbon(tz.GetTz()).ParseByFormat(day, "Ymd") + if conf.IsContinue == mtype.Yes { + var idx int32 + for k, reward := range dayReward { + rewardDay := start.AddDays(reward.addDay) + if missDay.Gt(rewardDay) { + continue + } + + switch conf.SignType { + case mtype.FissionCampaignSignTypeStep: + dayReward[k].addDay = int(missDay.AddDays(int(reward.SignDay)).DiffAbsInDays(start)) + int(idx*lastReward.SignDay) + if reward.RewardId == lastReward.ID { + idx++ + } + case mtype.FissionCampaignSignTypeNormal: + idx++ + dayReward[k].addDay = int(missDay.AddDays(int(idx * reward.SignDay)).DiffAbsInDays(start)) + } + } + } else { + for k, reward := range dayReward { + if missDay.Gt(start.AddDays(reward.addDay)) { + continue + } + + dayReward[k].addDay++ + } + } + } + + for _, state := range dayReward { + rewardIdMap[start.AddDays(state.addDay).ToShortDateString()] = state.RewardId + } + + if len(recordIds) == 0 { + return + } + + // 领奖数据 + openMap = make(map[int64]int) + recordM := s.GetDao().FissionRewardRecord.SubTable(player.CampaignID) + records, err := recordM.WithContext(s.Ctx).Where(recordM.ID.In(recordIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, record := range records { + openMap[record.RewardID]++ + } + + return +} + +// 签到板追加数据(旧) +func (s *Sign) _appendSignDate(dt, start, end, wStart, wEnd, mStart, mEnd carbon.Carbon, rewardIdMap map[string]int64, signMap map[string]int8, openMap map[int64]int, hashCard int8, lastMiss string, res *SignBoard) { + dateStr := dt.ToShortDateString() + one := &SignBoardOne{ + Y: fmt.Sprint(dt.Year()), + M: fmt.Sprint(dt.Month()), + D: fmt.Sprint(dt.Day()), + SignIn: 0, + Ban: dt.Lt(start) || dt.Gt(end), + RewardId: rewardIdMap[dateStr], + Open: false, + NowWeek: dt.Gte(wStart) && dt.Lte(wEnd), + NowDay: dt.IsToday(), + LastMiss: lastMiss != "" && lastMiss == dateStr, + NowMouth: dt.Gte(mStart) && dt.Lte(mEnd), + } + + if st, ok := signMap[dateStr]; ok { + one.SignIn = utils.Ternary[int32](st == mtype.FissionSignTypeMiss, 2, 1) + one.Ban = !one.Ban && st == mtype.FissionSignTypeMiss && hashCard == mtype.No // 不能补签禁用 + } + + if open, ok := openMap[one.RewardId]; ok { + one.Open = open > 0 + openMap[one.RewardId]-- + } + + res.SignDate = append(res.SignDate, one) +} + +// 签到成功 (旧) +func (s *Sign) _signOk(signDay *model.FissionSignDay) (reward *SignReward, err error) { + continueNum, maxContinue, _, err := s._continueNum() + if err != nil { + return + } + + player, conf := s.GetPlayer(), s.GetConf() + playerM := s.GetDao().FissionSign + + s.upPlayer = append(s.upPlayer, + playerM.SignContinue.Value(continueNum), + playerM.MaxContinue.Value(maxContinue), + ) + + if player.SignStart == 0 { + s.upPlayer = append(s.upPlayer, playerM.SignStart.Value(time.Now().Unix())) + } + + var totalNum = player.SignDay + 1 + if conf.IsLoop == mtype.Yes { + totalNum = continueNum + } else if conf.IsContinue == mtype.Yes { + totalNum = maxContinue + } + + var recordIds []int64 + switch conf.SignType { + case mtype.FissionCampaignSignTypeNormal: + reward, recordIds, err = s._normalReward(signDay, totalNum) + if err != nil { + return + } + case mtype.FissionCampaignSignTypeStep: + reward, recordIds, err = s._stepReward(signDay, totalNum) + if err != nil { + return + } + } + + // 绑定数据 + if len(recordIds) > 0 { + sdm := s.GetDao().FissionSignDay + _, err = sdm.WithContext(s.Ctx).Where(sdm.ID.Eq(signDay.ID)).UpdateSimple(sdm.RecordIds.Value(utils.Join(recordIds, consts.JoinComma))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 更新玩家数据 + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(s.upPlayer...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 更新统计数据 + statM := s.GetDao().FissionUserStat + _, err = statM.WithContext(s.Ctx).Where(statM.UserID.Eq(player.UserID)).UpdateSimple(statM.SignNum.Add(1), statM.SignRewardNum.Add(int64(len(recordIds)))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/provider/players/sign_test.go b/internal/service/provider/players/sign_test.go new file mode 100644 index 0000000..31467bf --- /dev/null +++ b/internal/service/provider/players/sign_test.go @@ -0,0 +1,57 @@ +package players + +import ( + "context" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "testing" + + _ "joybuywork/test" +) + +func TestSignBoard(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 4840).FindById(284386073378832384) + if err != nil { + t.Error(err) + } + + user.LangMark = "zh" + + kg, err := NewSign(ctx, user) + if err != nil { + t.Error(err) + } + + status, err := kg.SignBoard(0, "") + if err != nil { + t.Error(err) + } + + t.Log(jsonm.MarshalToString(status)) +} + +func TestCycleCardSign(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 4837).FindById(284267078566621184) + if err != nil { + t.Error(err) + } + + user.LangMark = "zh" + + kg, err := NewSign(ctx, user) + if err != nil { + t.Error(err) + } + + status, reward, err := kg.SignIn(1754755200) + if err != nil { + t.Error(err) + } + + t.Log(status) + t.Log(jsonm.MarshalToString(reward)) +} diff --git a/internal/service/provider/players/slot.go b/internal/service/provider/players/slot.go new file mode 100644 index 0000000..a6b2c63 --- /dev/null +++ b/internal/service/provider/players/slot.go @@ -0,0 +1,376 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/proto/go_proto/workerr" +) + +// Slot 现金转盘交互逻辑 +type Slot struct { + Player + player *model.FissionSlot + conf *model.FissionCampaignSlot + + fissionPlayerSetInitOnceKey string +} + +func NewSlot(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Slot, err error) { + player = &Slot{} + + err = player.Init(ctx, user, consts.IdSlotMachine, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Slot) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionSlot + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionSlotLog(&model.FissionSlotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SlotID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Slot) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Slot) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Slot) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionSlotLog + for _, task := range tasks { + next, t, source, lotteryVal := s._lotteryTask(checkManual, task) + if next { + continue + } + + val, _ := jsonm.MarshalToString(lotteryVal) + + log := withdefault.FissionSlotLog(&model.FissionSlotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SlotID: player.ID, + Type: t, + Source: source, + Val: val, + }) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionSlot + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + s.addChanceNotify(int64(chance)) + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Slot) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + // 抽奖 + reward, err = s._lottery() + if err != nil { + return + } + + if s.IsView() { + preward, _ := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + info, _ = preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + return + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionSlot + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionSlotLog(&model.FissionSlotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SlotID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Slot) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionSlot + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionSlotLog(&model.FissionSlotLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + SlotID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Slot) GetConf() *model.FissionCampaignSlot { + if s.conf == nil { + s.conf, _ = cache.NewCampaignSlot(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Slot) GetPlayer() *model.FissionSlot { + return s.player +} + +// 玩家 +func (s *Slot) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Slot) firstOrCreate() (player *model.FissionSlot, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Slot) _dbFirst() (*model.FissionSlot, error) { + playerM := dao.FissionSlot + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Slot) createPlayer() (player *model.FissionSlot, err error) { + playerM := dao.FissionSlot + player = withdefault.FissionSlot(&model.FissionSlot{ + UserID: s.user.ID, + CampaignID: s.user.CampaignID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Slot) _addLog(logs ...*model.FissionSlotLog) (err error) { + if len(logs) == 0 { + return + } + err = s.GetDao().FissionSlotLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 增加抽奖次数通知 +func (s *Slot) addChanceNotify(chance int64) { + provider.NewFissionClue(s.Ctx, s.user.ID).AddChance(chance) +} diff --git a/internal/service/provider/players/uno.go b/internal/service/provider/players/uno.go new file mode 100644 index 0000000..85b6808 --- /dev/null +++ b/internal/service/provider/players/uno.go @@ -0,0 +1,1059 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/utils" + "math/rand" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" +) + +const ( + unoClaimStatusOk = iota + unoClaimStatusDoing // 正在收集中 + unoClaimStatusDone // 已经收集完成了 +) + +const ( + unoCollectStatusOk = iota + unoCollectStatusLack // 抽奖次数不足 + unoCollectStatusPropLack // 道具不足 + unoCollectStatusPropFail // 道具不存在 +) + +// Uno Uno卡牌交互逻辑 +type Uno struct { + Player + player *model.FissionUno + conf *model.FissionCampaignUno + + fissionPlayerSetInitOnceKey string + fissionUserUnoClaimOnceKey string + fissionUserUnoCollectOnceKey string + + collectMap map[string]*model.FissionUnoCollect + collectUp map[string]bool +} + +func NewUno(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Uno, err error) { + player = &Uno{} + + err = player.Init(ctx, user, consts.IdUno, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +func (s *Uno) Claim(colorMark string) (status int32, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + s.Tran() + defer func() { + s.TranCommit(err) + s.AfterDo(err) + }() + + lock := app.NewRedisLock(s.Ctx, s.fissionUserUnoClaimOnceKey) + defer lock.Release() + if !lock.SoftLock() { + status = unoClaimStatusDoing + return + } + + player := s.GetPlayer() + m := s.GetDao().FissionUnoCollect + collect, err := m.WithContext(s.Ctx).Where(m.UnoID.Eq(player.ID), m.Mark.Eq(colorMark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if collect == nil || collect.PreIntactNum <= 0 { + status = unoClaimStatusDone + return + } + + groupM := s.GetDao().FissionCampaignUnoGroup + group, err := groupM.WithContext(s.Ctx).Where(groupM.CampaignID.Eq(player.CampaignID), groupM.Mark.Eq(colorMark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(group.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + record, info, async, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, false) + if err != nil { + return + } + + s.AddOkDone(func() { + for _, fn := range async { + fn() + } + }) + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(collect.ID)).UpdateColumnSimple( + m.IntactNum.Add(1), + m.PreIntactNum.Sub(1), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s._addLog(withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: mtype.FissionUnoLogTypeClaim, + Source: mtype.FissionUnoLogSourceClaim, + }, mtype.UnoLogVal{ + RewardId: record.RewardID, + RecordId: record.ID, + })) + if err != nil { + return + } + + // 收集卡牌埋点 + s.appTrack().CollectUnoCard(time.Now().Unix(), colorMark) + + return unoClaimStatusOk, info, record, nil +} + +type UnoCollectCard struct { + Mark string + CardNo int32 +} + +func (s *Uno) _randMark(groups []*model.FissionCampaignUnoGroup) string { + var odds []string + for _, v := range groups { + odds = append(odds, v.Odds) + } + + shares, _ := utils.NormalizeDecimalStrings(odds) + + var marks []lucky.Reward + for i, v := range groups { + marks = append(marks, lucky.Reward{ + Share: shares[i], + Mark: v.Mark, + }) + } + + // 抽奖 + lcy, _ := lucky.NewDiscrete(s.Ctx, marks).Lottery() + + return lcy.String() +} + +func (s *Uno) _randCard(group *model.FissionCampaignUnoGroup) (card *UnoCollectCard, err error) { + collectMap, err := s._userCollect() + if err != nil { + return + } + collect := collectMap[group.Mark] + + cardInfo := collect.GetCardInfo() + var hasCardMap = make(map[int]struct{}) + for i, cardNum := range cardInfo { + if cardNum > 0 { + hasCardMap[i+1] = struct{}{} + } + } + + var unoCardMap = map[int]struct{}{1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {}, 8: {}, 9: {}} + + switch group.OpenRule { + case mtype.No: + for k := range hasCardMap { + delete(unoCardMap, k) + } + case mtype.Yes: + rule := group.GetLimitRule() + num := int(rule.InitNum + rule.AddNum*(collect.SignNum/rule.SignDay)) + + if num >= 9 { + for k := range hasCardMap { + delete(unoCardMap, k) + } + } else { + + var reset = make(map[int]struct{}) + for k := range hasCardMap { + reset[k] = struct{}{} + } + + hcmL := len(hasCardMap) + if hcmL > num { + idx := hcmL - num + for i := 0; i < 9; i++ { + if _, ok := hasCardMap[i+1]; ok { + delete(reset, i+1) + idx-- + if idx <= 0 { + break + } + } + } + } else if hcmL < num { + idx := num - hcmL + for k := range unoCardMap { + if _, ok := reset[k]; !ok { + reset[k] = struct{}{} + idx-- + if idx <= 0 { + break + } + } + } + } + + unoCardMap = reset + } + + } + + var hasL = len(hasCardMap) + var cardNo, preIntactNum int32 + for no := range unoCardMap { + cardNo = int32(no) + + idx := no - 1 + intactL := hasL + 1 + if intactL < 9 { + cardInfo[idx]++ + break + } + + rewardM := s.GetDao().FissionCampaignReward + reward, _ := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(group.RewardID)).Take() + + if reward == nil { + continue + } + + issVr := award.NewAwardIssVerify(s.Ctx, s.user, reward) + ok1, _ := issVr.DeductStock().IsOK() + if !ok1 { + continue + } + + preIntactNum++ + for i := range cardInfo { + if i != idx { + cardInfo[i]-- + } + } + + break + } + + if cardNo == 0 { + for no := range hasCardMap { + cardNo = int32(no) + } + } + + collect.SetCardInfo(cardInfo) + collect.PreIntactNum += preIntactNum + if preIntactNum > 0 && + group.OpenRule == mtype.Yes && + group.GetLimitRule().ResetType == mtype.FissionCampaignUnoGroupResetTypeReward { + collect.SignNum = 0 + } + + s.collectUp[group.Mark] = true + + card = &UnoCollectCard{ + Mark: group.Mark, + CardNo: cardNo, + } + + return +} + +func (s *Uno) Collect() (status int32, cards *UnoCollectCard, err error) { + player := s.GetPlayer() + + m := s.GetDao().FissionCampaignUnoGroup + groups, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID)).Find() + if err != nil { + err = s.BE().CacheError(err) + return + } + + groupMap := make(map[string]*model.FissionCampaignUnoGroup) + for _, v := range groups { + groupMap[v.Mark] = v + } + + mark := s._randMark(groups) + if s.IsView() { + return unoCollectStatusOk, &UnoCollectCard{ + Mark: mark, + CardNo: rand.Int31n(8) + 1, + }, nil + } + + if player.Chance <= 0 { + status = unoCollectStatusLack + return + } + + randCard, err := s._randCard(groupMap[mark]) + if err != nil { + return + } + + playerM := s.GetDao().FissionUno + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = s._upCollect() + if err != nil { + return + } + + log := withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: mtype.FissionUnoLogTypeDecr, + Source: mtype.FissionLogSourceLottery, + }, mtype.UnoLogVal{ + Chance: 1, + Cards: []*mtype.UnoLogValCard{ + { + CardNo: randCard.CardNo, + Mark: mark, + }, + }, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return unoCollectStatusOk, randCard, nil +} + +func (s *Uno) UseProp(propMark, colorMark string) (status int32, cards []*UnoCollectCard, err error) { + + switch propMark { + case mtype.FissionCampaignUnoPropMarkThree: + return s._useThree() + case mtype.FissionCampaignUnoPropMarkFive: + return s._useFive() + case mtype.FissionCampaignUnoPropMarkFix: + return s._useFix(colorMark) + } + + return unoCollectStatusPropFail, nil, nil +} + +func (s *Uno) _useFix(colorMark string) (status int32, cards []*UnoCollectCard, err error) { + player := s.GetPlayer() + + m := s.GetDao().FissionCampaignUnoGroup + groups, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID)).Find() + if err != nil { + err = s.BE().CacheError(err) + return + } + + groupMap := make(map[string]*model.FissionCampaignUnoGroup) + for _, v := range groups { + groupMap[v.Mark] = v + } + + if s.IsView() { + return unoCollectStatusOk, []*UnoCollectCard{ + { + Mark: colorMark, + CardNo: rand.Int31n(8) + 1, + }, + }, nil + } + + if player.FixNum <= 0 { + status = unoCollectStatusPropLack + return + } + + randCard, err := s._randCard(groupMap[colorMark]) + if err != nil { + return + } + + playerM := s.GetDao().FissionUno + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.FixNum.Sub(1)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = s._upCollect() + if err != nil { + return + } + + log := withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: mtype.FissionUnoLogTypePropUse, + Source: mtype.FissionUnoLogSourceFixUse, + }, mtype.UnoLogVal{ + Chance: 1, + PropMark: mtype.FissionCampaignTaskPropMarkUnoFix, + Cards: []*mtype.UnoLogValCard{ + { + CardNo: randCard.CardNo, + Mark: randCard.Mark, + }, + }, + }) + + err = s._addLog(log) + if err != nil { + return + } + + cards = append(cards, randCard) + + // 使用道具埋点 + s.appTrack().UseProp(time.Now().Unix(), consts.PropNameUnoFix) + + return +} + +func (s *Uno) _useFive() (status int32, cards []*UnoCollectCard, err error) { + player := s.GetPlayer() + + m := s.GetDao().FissionCampaignUnoGroup + groups, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID)).Find() + if err != nil { + err = s.BE().CacheError(err) + return + } + + groupMap := make(map[string]*model.FissionCampaignUnoGroup) + for _, v := range groups { + groupMap[v.Mark] = v + } + + if s.IsView() { + cards = append(cards, &UnoCollectCard{}) + + for i := 0; i < 5; i++ { + cards = append(cards, &UnoCollectCard{ + Mark: s._randMark(groups), + CardNo: rand.Int31n(8) + 1, + }) + } + + return unoCollectStatusOk, cards, nil + } + + if player.FiveNum <= 0 { + status = unoCollectStatusPropLack + return + } + + for i := 0; i < 5; i++ { + mark := s._randMark(groups) + var randCard *UnoCollectCard + randCard, err = s._randCard(groupMap[mark]) + if err != nil { + return + } + cards = append(cards, randCard) + } + + playerM := s.GetDao().FissionUno + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.FiveNum.Sub(1)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = s._upCollect() + if err != nil { + return + } + + var logCards []*mtype.UnoLogValCard + for _, v := range cards { + logCards = append(logCards, &mtype.UnoLogValCard{ + CardNo: v.CardNo, + Mark: v.Mark, + }) + } + + log := withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: mtype.FissionUnoLogTypePropUse, + Source: mtype.FissionUnoLogSourceFiveUse, + }, mtype.UnoLogVal{ + Chance: 1, + PropMark: mtype.FissionCampaignTaskPropMarkUnoFive, + Cards: logCards, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.appTrack().UseProp(time.Now().Unix(), consts.PropNameUnoFive) + + return +} + +func (s *Uno) _useThree() (status int32, cards []*UnoCollectCard, err error) { + player := s.GetPlayer() + + m := s.GetDao().FissionCampaignUnoGroup + groups, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(player.CampaignID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + groupMap := make(map[string]*model.FissionCampaignUnoGroup) + for _, v := range groups { + groupMap[v.Mark] = v + } + + if s.IsView() { + cards = append(cards, &UnoCollectCard{}) + + for i := 0; i < 3; i++ { + cards = append(cards, &UnoCollectCard{ + Mark: s._randMark(groups), + CardNo: rand.Int31n(8) + 1, + }) + } + + return unoCollectStatusOk, cards, nil + } + + if player.ThreeNum <= 0 { + status = unoCollectStatusPropLack + return + } + + for i := 0; i < 3; i++ { + mark := s._randMark(groups) + var randCard *UnoCollectCard + randCard, err = s._randCard(groupMap[mark]) + if err != nil { + return + } + cards = append(cards, randCard) + } + + playerM := s.GetDao().FissionUno + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.ThreeNum.Sub(1)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + err = s._upCollect() + if err != nil { + return + } + + var logCards []*mtype.UnoLogValCard + for _, v := range cards { + logCards = append(logCards, &mtype.UnoLogValCard{ + CardNo: v.CardNo, + Mark: v.Mark, + }) + } + + log := withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: mtype.FissionUnoLogTypePropUse, + Source: mtype.FissionUnoLogSourceThreeUse, + }, mtype.UnoLogVal{ + Chance: 1, + PropMark: mtype.FissionCampaignTaskPropMarkUnoThree, + Cards: logCards, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.appTrack().UseProp(time.Now().Unix(), consts.PropNameUnoThree) + + return +} + +type UnoCards struct { + CardNo int32 `json:"card_no"` + CardNum int32 `json:"card_num"` +} + +func (s *Uno) Cards() (data map[string][]*UnoCards, err error) { + collectMap, err := s._userCollect() + if err != nil { + return + } + + data = map[string][]*UnoCards{ + mtype.FissionCampaignUnoGroupRed: {}, + mtype.FissionCampaignUnoGroupBlue: {}, + mtype.FissionCampaignUnoGroupYellow: {}, + mtype.FissionCampaignUnoGroupGreen: {}, + } + + for k := range data { + collect := collectMap[k] + nums := collect.GetCardInfo() + data[k] = make([]*UnoCards, 9) + for i := 0; i < 9; i++ { + one := &UnoCards{ + CardNo: int32(i) + 1, + CardNum: nums[i] + collect.PreIntactNum, + } + + data[k][i] = one + } + } + + return +} + +// Sign 签到 +func (s *Uno) Sign() (err error) { + player := s.GetPlayer() + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionUno + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.LastSign.Value(lastSign)) + if err != nil { + return s.BE().MysqlError(err) + } + + m := s.GetDao().FissionUnoCollect + _, err = m.WithContext(s.Ctx).Where(m.UnoID.Eq(player.ID)).UpdateSimple(m.SignNum.Add(1)) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Uno) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Uno) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Uno) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var lotteryChance, threeNum, fiveNum, fixNum int32 + var logs []*model.FissionUnoLog + for _, task := range tasks { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + continue + } + + val := mtype.UnoLogVal{ + TaskId: task.ID, + Chance: task.Chance, + } + var logType int8 + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + lotteryChance += task.Chance + logType = mtype.FissionUnoLogTypeAdd + case mtype.FissionCampaignTaskPropMarkUnoFive: + chance += task.Chance + fiveNum += task.Chance + logType = mtype.FissionUnoLogTypeProp + case mtype.FissionCampaignTaskPropMarkUnoThree: + chance += task.Chance + threeNum += task.Chance + logType = mtype.FissionUnoLogTypeProp + case mtype.FissionCampaignTaskPropMarkUnoFix: + chance += task.Chance + fixNum += task.Chance + logType = mtype.FissionUnoLogTypeProp + } + + log := withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: logType, + }, val) + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + log.Source = mtype.FissionLogSourceRegister + case mtype.FissionCampaignTaskTypeInstall: + log.Source = mtype.FissionLogSourceInstall + case mtype.FissionCampaignTaskTypeCondAll: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondAll, mtype.FissionLogSourceCondAll) + case mtype.FissionCampaignTaskTypeCondOne: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondOne, mtype.FissionLogSourceCondOne) + } + + logs = append(logs, log) + + } + + if lotteryChance > 0 || threeNum > 0 || fiveNum > 0 || fixNum > 0 { + m := s.GetDao().FissionUno + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple( + m.Chance.Add(lotteryChance), + m.ThreeNum.Add(threeNum), + m.FiveNum.Add(fiveNum), + m.FixNum.Add(fixNum), + ) + if err != nil { + return + } + + if lotteryChance > 0 { + s.addChanceNotify(int64(lotteryChance)) + } + } + + err = s._addLog(logs...) + if err != nil { + return + } + + s.trackGetProp(threeNum, fiveNum, fixNum) + + return +} + +func (s *Uno) trackGetProp(threeNum, fiveNum, fixNum int32) { + props := []struct { + name string + num int32 + }{ + {name: consts.PropNameUnoThree, num: threeNum}, + {name: consts.PropNameUnoFive, num: fiveNum}, + {name: consts.PropNameUnoFix, num: fixNum}, + } + + now := time.Now().Unix() + for _, prop := range props { + if prop.num > 0 { + s.appTrack().GetProp(now, prop.name, prop.num) + } + } +} + +// SetInit 获得初始次数 +func (s *Uno) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionUno + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + log := withdefault.FissionUnoLog(&model.FissionUnoLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Type: mtype.FissionUnoLogTypeAdd, + Source: mtype.FissionLogSourceInit, + }, mtype.UnoLogVal{ + Chance: conf.InitChance, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Uno) GetConf() *model.FissionCampaignUno { + if s.conf == nil { + s.conf, _ = cache.NewCampaignUno(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Uno) GetPlayer() *model.FissionUno { + return s.player +} + +// 玩家 +func (s *Uno) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + s.fissionUserUnoClaimOnceKey = ckey.FissionUserUnoClaimOnce(player.UserID) + s.fissionUserUnoCollectOnceKey = ckey.FissionUserUnoCollectOnce(player.UserID) + + s.collectMap = make(map[string]*model.FissionUnoCollect, 4) + s.collectUp = make(map[string]bool, 4) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Uno) firstOrCreate() (player *model.FissionUno, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Uno) _dbFirst() (*model.FissionUno, error) { + playerM := dao.FissionUno + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Uno) createPlayer() (player *model.FissionUno, err error) { + playerM := dao.FissionUno + player = withdefault.FissionUno(&model.FissionUno{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Uno) _addLog(logs ...*model.FissionUnoLog) (err error) { + err = s.GetDao().FissionUnoLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Uno) _userCollect() (data map[string]*model.FissionUnoCollect, err error) { + if len(s.collectMap) > 0 { + return s.collectMap, nil + } + + player := s.GetPlayer() + m := s.GetDao().FissionUnoCollect + list, err := m.WithContext(s.Ctx).Where(m.UnoID.Eq(player.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + key := s.fissionUserUnoCollectOnceKey + + lc := app.NewFollower(s.Ctx, key).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + list, err = m.WithContext(s.Ctx).Where(m.UnoID.Eq(player.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + cardInfo := make([]int32, 9) + list = append( + list, + withdefault.FissionUnoCollect(&model.FissionUnoCollect{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Mark: mtype.FissionCampaignUnoGroupRed, + }, cardInfo), + withdefault.FissionUnoCollect(&model.FissionUnoCollect{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Mark: mtype.FissionCampaignUnoGroupBlue, + }, cardInfo), + withdefault.FissionUnoCollect(&model.FissionUnoCollect{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Mark: mtype.FissionCampaignUnoGroupYellow, + }, cardInfo), + withdefault.FissionUnoCollect(&model.FissionUnoCollect{ + UserID: player.UserID, + CampaignID: player.CampaignID, + UnoID: player.ID, + Mark: mtype.FissionCampaignUnoGroupGreen, + }, cardInfo), + ) + + if err = m.WithContext(s.Ctx).Create(list...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + for _, v := range list { + s.collectMap[v.Mark] = v + } + + return s.collectMap, nil +} + +// 增加抽奖次数通知 +func (s *Uno) addChanceNotify(chance int64) { + provider.NewFissionClue(s.Ctx, s.user.ID).AddChance(chance) +} + +func (s *Uno) _upCollect() (err error) { + for _, collect := range s.collectMap { + if up, ok := s.collectUp[collect.Mark]; ok && up { + err = s.GetDao().FissionUnoCollect.WithContext(s.Ctx).Save(collect) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + return +} diff --git a/internal/service/provider/players/vs.go b/internal/service/provider/players/vs.go new file mode 100644 index 0000000..97d9235 --- /dev/null +++ b/internal/service/provider/players/vs.go @@ -0,0 +1,1145 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + "math" + "strconv" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +const ( + voteOk = iota + voteEnd // 非投票时间无法投票 + voteLack // 投票机会不足 + votePointLack // 积分不足 + voteLimit // 投票已达最大次数 + voteFail // 投票失败 + voteNotSameTeam // 不能投同队伍 +) + +type Vs struct { + Player + player *model.FissionV + conf *model.FissionCampaignV + + fissionPlayerSetInitOnceKey string +} + +func NewVs(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Vs, err error) { + player = &Vs{} + + err = player.Init(ctx, user, consts.IdVs, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +func (s *Vs) Exchange(item *model.RedeemMallItem) (err error) { + player := s.GetPlayer() + val, _ := jsonm.MarshalToString(mtype.VsLogVal{ + PointsNum: item.CoinNum, + MallId: item.MallID, + MallItemId: item.ID, + }) + + log := withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: mtype.FissionVsLogTypeExchange, + Source: mtype.FissionLogSourceExchange, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + vsM := s.GetDao().FissionV + _, err = vsM.WithContext(s.Ctx).Where(vsM.ID.Eq(player.ID)).UpdateSimple(vsM.CoinUse.Add(item.CoinNum)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Vs) FirstVisit() (rewards []*EventReward, err error) { + ok, rewards, err := s.eventOk(mtype.FissionCampaignEventMarkFirstVisit) + if err != nil || !ok { + return + } + + player := s.GetPlayer() + var chance int32 + var point int32 + var logs = make([]*model.FissionVsLog, 0, len(rewards)) + for _, v := range rewards { + + var val string + var t int8 + + switch v.PropMark { + case mtype.FissionCampaignRewardPropMarkPoint: + t = mtype.FissionVsLogTypeAddPoint + val, _ = jsonm.ToObjString(mtype.VsLogVal{ + PointsNum: v.Chance, + }) + + point += v.Chance + case mtype.FissionCampaignRewardPropMarkReward: + t = mtype.FissionVsLogTypeReward + val, _ = jsonm.ToObjString(mtype.VsLogVal{ + RewardId: v.Reward.Record.RewardID, + RecordId: v.Reward.Record.ID, + }) + case mtype.FissionCampaignRewardPropMarkChance: + t = mtype.FissionVsLogTypeAddVote + val, _ = jsonm.ToObjString(mtype.VsLogVal{ + Chance: v.Chance, + }) + chance++ + } + + logs = append(logs, withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: t, + Source: mtype.FissionLogSourceFirstVisit, + Val: val, + })) + } + + err = s._addLog(logs...) + if err != nil { + return + } + + if chance > 0 || point > 0 { + m := s.GetDao().FissionV + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Add(chance), m.CoinGet.Add(point)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Vs) TipReward() (err error) { + player := s.GetPlayer() + + var ids []int64 + m := s.GetDao().FissionVsVoteSettlement + err = m.WithContext(s.Ctx).Select(m.ID).Where(m.VsID.Eq(player.ID), m.TipAt.Eq(0)).Pluck(m.ID, &ids) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(ids) == 0 { + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.In(ids...)).UpdateColumnSimple(m.TipAt.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Vs) SettlementReward(settlement *model.FissionVsVoteSettlement) (rewards []*Reward, err error) { + player := s.GetPlayer() + + if settlement.AcceptAt > 0 { + + if settlement.TipAt > 0 { + return + } + + m := s.GetDao().FissionRewardRecord + records, err1 := m.WithContext(s.Ctx).Where(m.ID.In(settlement.GetRecordIds()...)).Find() + if err1 != nil { + err1 = s.BE().MysqlError(err1) + return + } + + var brMap = make(map[int64]struct{}) + var brIds []int64 + for _, record := range records { + if _, ok := brMap[record.BaseRewardID]; !ok && record.BaseRewardID > 0 { + brIds = append(brIds, record.BaseRewardID) + } + } + + preward, err1 := provider.NewRewards(s.Ctx, s.cpn.ProjectID, brIds...) + if err1 != nil { + err = err1 + return + } + + rewards = make([]*Reward, 0, len(records)) + for _, record := range records { + + switch record.PropMark { + case mtype.FissionCampaignRewardPropMarkReward: + info, _ := preward.InfoAutoLang(record.BaseRewardID, s.user.LangMark) + + rewards = append(rewards, &Reward{ + Id: record.RewardID, + PropMark: record.PropMark, + Title: info.Title, + Img: info.ImgUrl, + KvData: info.KvData, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + PropNum: record.RewardNum, + RewardHashId: record.HashID, + }) + + case mtype.FissionCampaignRewardPropMarkPoint: + + rewards = append(rewards, &Reward{ + Id: record.RewardID, + PropMark: record.PropMark, + Title: record.Title, + Img: record.ImgURL, + PropNum: record.RewardNum, + RewardHashId: record.HashID, + }) + } + } + + return + } + + lc := app.NewRedisLock(s.Ctx, ckey.FissionVoteAcceptOnce(settlement.ID), lock.SetExpire(10*time.Second)) + defer lc.Release() + if !lc.SoftLock() { + return + } + + m := s.GetDao().FissionVsVote + vote, err := m.WithContext(s.Ctx).Where(m.ID.Eq(settlement.VoteID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if vote == nil { + return + } + + scheduleM := s.GetDao().FissionCampaignVsSchedule + schedule, err := scheduleM.WithContext(s.Ctx).Where(scheduleM.ID.Eq(vote.ScheduleID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if schedule == nil { + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(schedule.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + return + } + + odds, _ := strconv.ParseFloat(settlement.Odds, 64) + if reward.PropMark == mtype.FissionCampaignTaskPropMarkPoint && odds != 1 { + rewardNum := int32(math.Floor(float64(reward.RewardNum) * odds)) + reward.RewardNum = rewardNum + } + + var num = vote.FreeVote + vote.PointVote + var accepts = make([]*model.FissionCampaignReward, 0) + for i := 0; i < int(num); i++ { + accepts = append(accepts, reward) + } + + res, _, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).DeductStockBatch(accepts, true) + if err != nil { + return + } + + var coinGet int32 + var recordIds []int64 + rewards = make([]*Reward, 0, len(res)) + for _, v := range res { + record := v.Record + info := v.Info + rewards = append(rewards, &Reward{ + Id: record.RewardID, + PropMark: record.PropMark, + Title: info.Title, + Img: info.ImgUrl, + KvData: info.KvData, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + PropNum: record.RewardNum, + RewardHashId: record.HashID, + }) + recordIds = append(recordIds, record.ID) + + if s.GetConf().ClaimType != mtype.FissionCampaignVsClaimTypeAuto { + s.appTrack().VsAcceptReward(record.CreatedAt, schedule.ID, record.RewardID, record.ID) + } + + if record.PropMark == mtype.FissionCampaignRewardPropMarkPoint { + coinGet += record.RewardNum + } + + } + + idStr, _ := jsonm.ToSliceString(recordIds) + sltM := s.GetDao().FissionVsVoteSettlement + _, err = sltM.WithContext(s.Ctx).Where(sltM.ID.Eq(settlement.ID)).UpdateColumnSimple( + sltM.AcceptAt.Value(time.Now().Unix()), + sltM.RecordIds.Value(idStr), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if coinGet > 0 { + playerM := s.GetDao().FissionV + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateColumnSimple(playerM.CoinGet.Add(coinGet)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + val, _ := jsonm.MarshalToString(mtype.VsLogVal{ + RewardId: reward.ID, + ScheduleId: settlement.ScheduleID, + Odds: settlement.Odds, + Num: num, + }) + + log := withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: mtype.FissionVsLogTypeSettlement, + Source: mtype.FissionLogSourceSettlement, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Vs) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Vs) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Vs) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + var coinGet int32 + var logs []*model.FissionVsLog + for _, task := range tasks { + if checkManual && task.AwardMode == mtype.FissionCampaignTaskAwardModeManual { + continue + } + + var val string + var t int8 + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + val, _ = jsonm.MarshalToString(mtype.VsLogVal{ + TaskId: task.ID, + Chance: task.Chance, + }) + t = mtype.FissionVsLogTypeAddVote + case mtype.FissionCampaignTaskPropMarkPoint: + val, _ = jsonm.MarshalToString(mtype.VsLogVal{ + TaskId: task.ID, + PointsNum: task.Chance, + }) + t = mtype.FissionVsLogTypeAddPoint + coinGet += task.Chance + case mtype.FissionCampaignTaskPropMarkReward: + val, _ = jsonm.MarshalToString(mtype.VsLogVal{ + TaskId: task.ID, + RewardId: task.RewardID, + }) + t = mtype.FissionVsLogTypeReward + } + + log := withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: t, + Source: "", + Val: val, + }) + + switch task.TaskType { + case mtype.FissionCampaignTaskTypeRegister: + log.Source = mtype.FissionLogSourceRegister + case mtype.FissionCampaignTaskTypeInstall: + log.Source = mtype.FissionLogSourceInstall + case mtype.FissionCampaignTaskTypeCondAll: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondAll, mtype.FissionLogSourceCondAll) + case mtype.FissionCampaignTaskTypeCondOne: + log.Source = utils.Ternary[string](task.AwardMode == mtype.FissionCampaignTaskAwardModeManual, mtype.FissionLogSourceManualCondOne, mtype.FissionLogSourceCondOne) + } + + logs = append(logs, log) + } + + if chance > 0 || coinGet > 0 { + m := s.GetDao().FissionV + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Add(chance), m.CoinGet.Add(coinGet)) + if err != nil { + return + } + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +func (s *Vs) Vote(scheduleId, teamId int64) (status int32, err error) { + s.Tran() + defer func() { + s.TranCommit(err) + }() + player, conf := s.GetPlayer(), s.GetConf() + + scheduleM := s.GetDao().FissionCampaignVsSchedule + schedule, err := scheduleM.WithContext(s.Ctx).Where(scheduleM.ID.Eq(scheduleId)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if schedule.GetStatus() != mtype.FissionCampaignVsScheduleStatusVote { + return voteEnd, nil + } + + var winType int8 = mtype.FissionCampaignVsScheduleWinTypeWin + if teamId == 0 { + if !verify.InArray[string](mtype.FissionCampaignVsScheduleOtherVoteDraw, schedule.GetOtherVote()...) { + return voteFail, nil + } + + winType = mtype.FissionCampaignVsScheduleWinTypeDraw + } + + m := s.GetDao().FissionVsVote + vote, err := m.WithContext(s.Ctx).Where(m.VsID.Eq(player.ID), m.ScheduleID.Eq(scheduleId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if vote == nil { + vote = withdefault.FissionVsVote(&model.FissionVsVote{ + CampaignID: player.CampaignID, + UserID: player.UserID, + VsID: player.ID, + ScheduleID: scheduleId, + WinType: winType, + WinTeamID: teamId, + IsWin: 0, + }) + + err = m.WithContext(s.Ctx).Create(vote) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + defer func() { + if status != voteOk { + _, _ = m.WithContext(s.Ctx).Delete(vote) + } + }() + } + + if vote.WinType != winType || vote.WinTeamID != teamId || (teamId > 0 && !verify.InArray[int64](teamId, schedule.GetVsTeamIds()...)) { + return voteNotSameTeam, nil + } + + if vote.FreeVote+vote.PointVote >= conf.EachLimitNum { + return voteLimit, nil + } + + if player.Chance > 0 { + val, _ := jsonm.MarshalToString(mtype.VsLogVal{ + Chance: 1, + ScheduleId: scheduleId, + WinType: winType, + WinTeamId: teamId, + }) + + log := withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: mtype.FissionVsLogTypeVote, + Source: mtype.FissionLogSourceVote, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + vsM := s.GetDao().FissionV + _, err = vsM.WithContext(s.Ctx).Where(vsM.ID.Eq(player.ID)).UpdateSimple(vsM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(vote.ID)).UpdateColumnSimple(m.FreeVote.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s._voteAdd() + if err != nil { + return + } + + s.appTrack().VsVote(time.Now().Unix(), scheduleId, int32(winType), teamId) + + return voteOk, nil + } + + if conf.OpenPoint == mtype.No { + return voteLack, nil + } + + pu, err := projectuser.NewProjectUser(s.Ctx, + projectuser.WithInit(s.cpn.ProjectID, s.user.SubUserID), + projectuser.WithDao(s.GetDao()), + ) + if err != nil { + return + } + + ok, err := pu.Deduct(mtype.ProjectUserCoinUseSourceCampaign, mtype.ProjectUserCoinDerVote, player.CampaignID, conf.PointsNum) + if err != nil { + return + } + + if !ok { + s.Rollback("项目用户积分不足") + return voteLack, nil + } + + val, _ := jsonm.MarshalToString(mtype.VsLogVal{ + Chance: 1, + ScheduleId: scheduleId, + WinType: winType, + WinTeamId: teamId, + PointsNum: conf.PointsNum, + }) + + log := withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: mtype.FissionVsLogTypeVote, + Source: mtype.FissionLogSourceVote, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + vsM := s.GetDao().FissionV + _, err = vsM.WithContext(s.Ctx).Where(vsM.ID.Eq(player.ID)).UpdateSimple(vsM.CoinUse.Add(conf.PointsNum)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(vote.ID)).UpdateColumnSimple(m.PointVote.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s._voteAdd() + if err != nil { + return + } + + s.appTrack().PointsUse(time.Now().Unix(), conf.PointsNum) + s.appTrack().VsVote(time.Now().Unix(), scheduleId, int32(winType), teamId) + + return voteOk, nil +} + +type Schedule struct { + Id int64 + Desc string + VsImg string + VsDate string + VsTz int32 + VoteCountdown int64 + Status int32 + OpenOdds int32 + OddsLeft string + OddsRight string + OddsDraw string + WinType int32 + WinTeamId int64 + Scores []*Score + OtherVote []string + Teams []*Team + UserVote *UserVote + Reward *Reward + Votes []*Vote +} + +type Score struct { + TeamId int64 + Score string +} + +type UserVote struct { + UserWinType int32 + UserWinTeamId int64 + IsWin bool + VoteNum int32 +} + +type Team struct { + Id int64 + Name string + LogoImg string + Score string +} + +type Reward struct { + Id int64 + PropMark string + Title string + Img string + KvData []*mtype.RewardKV + ReceiveType int32 + Contact string //联系方式 + OpenToUse int32 //开启去使用(0-否,1-是) + WebUrl string //Web端的跳转地址 + AppParam string //App端的跳转参数 + PcParam string //pc端的跳转参数 + PropNum int32 + RewardHashId string //领取的用户奖品hash_id +} + +type Vote struct { + WinType int32 `json:"win_type"` + WinTeamId int64 `json:"win_team_id"` + Num int64 `json:"num"` +} + +func (s *Vs) Schedules(tabType int32) (list []*Schedule, err error) { + player, conf := s.GetPlayer(), s.GetConf() + + teamM := s.GetDao().FissionCampaignVsTeam + teams, err := teamM.WithContext(s.Ctx).Where(teamM.CampaignID.Eq(s.user.CampaignID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamMap = make(map[int64]*model.FissionCampaignVsTeam, len(teams)) + for _, v := range teams { + teamMap[v.ID] = v + } + + voteM := s.GetDao().FissionVsVote + votes, err := voteM.WithContext(s.Ctx).Where( + voteM.CampaignID.Eq(s.user.CampaignID), + voteM.VsID.Eq(player.ID), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var voteMap = make(map[int64]*model.FissionVsVote, len(votes)) + for _, v := range votes { + voteMap[v.ScheduleID] = v + } + + scheduleM := s.GetDao().FissionCampaignVsSchedule + schedules, err := scheduleM.WithContext(s.Ctx).Where( + scheduleM.CampaignID.Eq(player.CampaignID), + scheduleM.VsAt.Gt(0), + ).Order(scheduleM.VsAt.Asc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range schedules { + rewardIds = append(rewardIds, v.RewardID) + } + + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var hasPoint bool + var brdIds []int64 + var brdMap = make(map[int64]struct{}) + for _, v := range rewards { + if _, ok := brdMap[v.RewardID]; !ok && v.RewardID > 0 { + brdIds = append(brdIds, v.RewardID) + } + + if v.PropMark == mtype.FissionCampaignRewardPropMarkPoint { + hasPoint = true + } + } + + preward, err := provider.NewRewards(s.Ctx, s.cpn.ProjectID, brdIds...) + if err != nil { + return + } + + var title, imgUrl string + if hasPoint { + title, imgUrl, _, err = cmm.NewCMM(s.Ctx, s.GetDao()).GetCoinInfo(s.cpn.ProjectID, s.user.LangMark) + if err != nil { + return + } + } + + var rewardMap = make(map[int64]*Reward, len(rewards)) + for _, reward := range rewards { + one := &Reward{ + Id: reward.ID, + PropMark: reward.PropMark, + Title: title, + Img: imgUrl, + KvData: nil, + ReceiveType: 0, + Contact: "", + OpenToUse: 0, + WebUrl: "", + AppParam: "", + PcParam: "", + PropNum: reward.RewardNum, + } + + if reward.PropMark == mtype.FissionCampaignRewardPropMarkReward { + info, _ := preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + one.Title = info.Title + one.Img = info.ImgUrl + one.KvData = info.KvData + one.ReceiveType = info.ReceiveType + one.Contact = info.Contact + one.OpenToUse = info.OpenToUse + one.WebUrl = info.WebUrl + one.AppParam = info.AppParam + one.PcParam = info.PcParam + } + + rewardMap[reward.ID] = one + } + + var scheduleLang = make(map[int64]*mtype.VsSchedulePkTeam) + if verify.InArray[string](s.user.LangMark, s.cpn.GetLangMarks()[1:]...) { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.Ctx).FindByCampaignId(player.CampaignID, s.user.LangMark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + for _, v := range lang.GetVs() { + for _, pk := range v.PkTeams { + scheduleLang[pk.Id] = pk + } + } + } + + var fn = func(v *model.FissionCampaignVsSchedule) { + + slt := v.GetSettlement() + scoreMap := make(map[int64]string, len(slt.Scores)) + + for _, v := range slt.Scores { + scoreMap[v.TeamId] = v.Score + } + + one := &Schedule{ + Id: v.ID, + Desc: v.Desc, + VsImg: v.VsImg, + VsDate: timez.GMTTime(conf.VsTz, v.VsAt).Format(timez.PointYmdHi), + VsTz: conf.VsTz, + VoteCountdown: v.VoteEnd - time.Now().Unix(), + Status: v.GetStatus(), + OpenOdds: int32(v.OpenOdds), + OddsLeft: v.OddsLeft, + OddsRight: v.OddsRight, + OddsDraw: v.OddsDraw, + WinType: slt.WinType, + WinTeamId: slt.WinTeamId, + Scores: make([]*Score, 0, len(slt.Scores)), + OtherVote: v.GetOtherVote(), + Teams: make([]*Team, 0, len(v.GetVsTeamIds())), + UserVote: nil, + Reward: rewardMap[v.RewardID], + Votes: nil, + } + + for _, v := range slt.Scores { + one.Scores = append(one.Scores, &Score{ + TeamId: v.TeamId, + Score: v.Score, + }) + } + + if vote, ok := voteMap[v.ID]; ok { + one.UserVote = &UserVote{ + UserWinType: int32(vote.WinType), + UserWinTeamId: vote.WinTeamID, + IsWin: vote.IsWin == mtype.Yes, + VoteNum: vote.FreeVote + vote.PointVote, + } + } + + for _, teamId := range v.GetVsTeamIds() { + two := &Team{ + Id: teamId, + } + + if team, ok := teamMap[teamId]; ok { + two.Name = team.Name + two.LogoImg = team.LogoImg + two.Score = scoreMap[teamId] + } + + one.Teams = append(one.Teams, two) + } + + if lang, ok := scheduleLang[v.ID]; ok && lang != nil { + one.Desc = lang.Desc + one.VsImg = lang.VsImg + + for i, v := range lang.Teams { + if v.Id > 0 { + one.Teams[i].Name = v.Name + one.Teams[i].LogoImg = v.LogoImg + } + } + } + + one.Votes, err = s._voteNum(v.ID) + if err != nil { + return + } + + list = append(list, one) + } + + for _, v := range schedules { + if tabType == 1 && !verify.InArray[int32](v.GetStatus(), mtype.FissionCampaignVsScheduleStatusVote, mtype.FissionCampaignVsScheduleStatusRunning) { + continue + } + + _, ok := voteMap[v.ID] + if tabType == 3 && !ok { + continue + } + + fn(v) + } + + if len(list) > 0 || tabType != 1 { + return + } + + l := len(schedules) + for i := l; i > 0; i-- { + one := schedules[i-1] + if one.IsSettlement == mtype.Yes { + fn(one) + break + } + } + + return +} + +// SetInit 获得初始次数 +func (s *Vs) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionV + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.VsLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionVsLog(&model.FissionVsLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + VsID: player.ID, + Type: mtype.FissionVsLogTypeAddVote, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Vs) GetConf() *model.FissionCampaignV { + if s.conf == nil { + s.conf, _ = cache.NewCampaignVs(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Vs) GetPlayer() *model.FissionV { + return s.player +} + +// 玩家 +func (s *Vs) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Vs) firstOrCreate() (player *model.FissionV, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Vs) _dbFirst() (*model.FissionV, error) { + playerM := dao.FissionV + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Vs) createPlayer() (player *model.FissionV, err error) { + playerM := dao.FissionV + player = withdefault.FissionVs(&model.FissionV{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Vs) _addLog(logs ...*model.FissionVsLog) (err error) { + err = s.GetDao().FissionVsLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +func (s *Vs) _voteNum(scheduleId int64) (votes []*Vote, err error) { + m := s.GetDao().FissionVsVote + + voteNumField := field.NewUnsafeFieldRaw("free_vote + point_vote") + + err = m.WithContext(s.Ctx). + Select(m.WinType, m.WinTeamID, voteNumField.Sum().As("num")). + Where(m.ScheduleID.Eq(scheduleId)). + Group(m.WinType, m.WinTeamID). + Scan(&votes) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Vs) _voteAdd() (err error) { + m := s.GetDao().FissionV + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(s.GetPlayer().ID)).UpdateSimple(m.VoteNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.player.VoteNum++ + + return +} diff --git a/internal/service/provider/players/vs_test.go b/internal/service/provider/players/vs_test.go new file mode 100644 index 0000000..0b52f57 --- /dev/null +++ b/internal/service/provider/players/vs_test.go @@ -0,0 +1,32 @@ +package players + +import ( + "context" + "joybuywork/internal/repository/cache" + "testing" + + _ "joybuywork/test" +) + +func TestVsVote(t *testing.T) { + ctx := context.Background() + + user, err := cache.NewFissionUser(ctx, 5501).FindById(402105141839065088) + if err != nil { + t.Error(err) + } + + user.LangMark = "zh" + + kg, err := NewVs(ctx, user) + if err != nil { + t.Error(err) + } + + status, err := kg.Vote(402105085220155395, 402105085220155392) + if err != nil { + t.Error(err) + } + + t.Log(status) +} diff --git a/internal/service/provider/players/wheel.go b/internal/service/provider/players/wheel.go new file mode 100644 index 0000000..f20ab0a --- /dev/null +++ b/internal/service/provider/players/wheel.go @@ -0,0 +1,421 @@ +package players + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/proto/go_proto/workerr" +) + +// Wheel 现金转盘交互逻辑 +type Wheel struct { + Player + player *model.FissionPrizeWheel + conf *model.FissionCampaignWheel + + fissionPlayerSetInitOnceKey string +} + +func NewWheel(ctx context.Context, user *model.FissionUser, opts ...Option) (player *Wheel, err error) { + player = &Wheel{} + + err = player.Init(ctx, user, consts.IdPrizeWheel, opts...) + if err != nil { + return + } + + err = player.initPlayer() + if err != nil { + return + } + + return +} + +func (s *Wheel) PointsUse() (status int32, err error) { + player := s.GetPlayer() + + logM := s.GetDao().FissionPrizeWheelLog + + status, deduct, err := s.pointsUse(mtype.FissionPointsLogSourceWheel, logM.TableName(), mtype.PointsLogOther{ + PlayerId: player.ID, + }, []*pointsUseCond{ + { + Field: logM.Type.ColumnName().String(), + Value: mtype.LotteryFissionTypeAdd, + }, + { + Field: logM.Source.ColumnName().String(), + Value: mtype.FissionLogSourcePointsUse, + }, + }) + defer s.pointsUseOk(deduct) + + if status != pointsUseOk || err != nil || deduct == nil { + return + } + + m := s.GetDao().FissionPrizeWheel + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.Chance.Add(1)) + if err != nil { + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + PointsNum: deduct.Num, + }) + + log := withdefault.FissionPrizeWheelLog(&model.FissionPrizeWheelLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + WheelID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourcePointsUse, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// Sign 签到 +func (s *Wheel) Sign() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if conf.DayChance == 0 { + return + } + + signOk, lastSign := s._lastSign(player.LastSign) + if !signOk { + return + } + + playerM := s.GetDao().FissionPrizeWheel + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.Chance.Add(conf.DayChance), + playerM.DayChance.Add(conf.DayChance), + playerM.LastSign.Value(lastSign), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.DayChance, + }) + + log := withdefault.FissionPrizeWheelLog(&model.FissionPrizeWheelLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + WheelID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceSign, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance = player.Chance + conf.DayChance + + return +} + +// ReceiveReward 手动领取奖励 +func (s *Wheel) ReceiveReward(taskRewards ...*model.FissionUserTaskReward) (chance int32, reward *award.RewardRes, err error) { + + err = s._receiveReward(taskRewards, func(tasks []*model.FissionCampaignTask, records []*award.RewardRes) error { + chance, err = s.taskFinish(tasks, false) + if err != nil { + return err + } + + if len(records) == 0 { + return nil + } + + reward = records[0] + + return nil + }) + + if err != nil { + return + } + + return +} + +// FinishTask 完成任务 +func (s *Wheel) FinishTask(tasks ...*model.FissionCampaignTask) (err error) { + _, err = s.taskFinish(tasks, true) + if err != nil { + return + } + return +} + +// 完成任务 +func (s *Wheel) taskFinish(tasks []*model.FissionCampaignTask, checkManual bool) (chance int32, err error) { + player := s.GetPlayer() + + var logs []*model.FissionPrizeWheelLog + for _, task := range tasks { + next, t, source, lotteryVal := s._lotteryTask(checkManual, task) + if next { + continue + } + + val, _ := jsonm.MarshalToString(lotteryVal) + + log := withdefault.FissionPrizeWheelLog(&model.FissionPrizeWheelLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + WheelID: player.ID, + Type: t, + Source: source, + Val: val, + }) + + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + chance += task.Chance + } + + logs = append(logs, log) + } + + if chance > 0 { + m := s.GetDao().FissionPrizeWheel + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.TaskChance.Add(chance), m.Chance.Add(chance)) + if err != nil { + return + } + } + + err = s._addLog(logs...) + if err != nil { + return + } + + return +} + +// Lottery 抽奖 +func (s *Wheel) Lottery() (reward *model.FissionCampaignReward, info provider.RewardAutoLang, record *model.FissionRewardRecord, err error) { + player := s.GetPlayer() + if player.Chance <= 0 { + err = workerr.CChanceNoneError + return + } + + // 抽奖 + reward, err = s._lottery() + if err != nil { + return + } + + if s.IsView() { + preward, _ := provider.NewRewards(s.Ctx, s.cpn.ProjectID, reward.RewardID) + info, _ = preward.InfoAutoLang(reward.RewardID, s.user.LangMark) + return + } + + record, info, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, s.user).One(reward, true) + if err != nil { + return + } + + // 抽奖数减1 + playerM := s.GetDao().FissionPrizeWheel + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.Chance.Sub(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: 1, + RewardId: record.RewardID, + RecordId: record.ID, + }) + + log := withdefault.FissionPrizeWheelLog(&model.FissionPrizeWheelLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + WheelID: player.ID, + Type: mtype.LotteryFissionTypeDecr, + Source: mtype.FissionLogSourceLottery, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + return +} + +// SetInit 获得初始次数 +func (s *Wheel) SetInit() (err error) { + player, conf := s.GetPlayer(), s.GetConf() + if player.SetInit == mtype.Yes || conf.InitChance == 0 { + return + } + + key := s.fissionPlayerSetInitOnceKey + + if !app.NewRedisLock(s.Ctx, key).SoftLock() { + return + } + + m := s.GetDao().FissionPrizeWheel + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.SetInit.Value(mtype.Yes), m.Chance.Add(conf.InitChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + val, _ := jsonm.MarshalToString(mtype.LotteryLogVal{ + Chance: conf.InitChance, + }) + + log := withdefault.FissionPrizeWheelLog(&model.FissionPrizeWheelLog{ + UserID: player.UserID, + CampaignID: player.CampaignID, + WheelID: player.ID, + Type: mtype.LotteryFissionTypeAdd, + Source: mtype.FissionLogSourceInit, + Val: val, + }) + + err = s._addLog(log) + if err != nil { + return + } + + s.player.Chance += conf.InitChance + + return +} + +// GetConf 获取玩法配置 +func (s *Wheel) GetConf() *model.FissionCampaignWheel { + if s.conf == nil { + s.conf, _ = cache.NewCampaignWheel(s.Ctx).FindByCampaignId(s.user.CampaignID) + } + + return s.conf +} + +// GetPlayer 获取玩家基础数据 +func (s *Wheel) GetPlayer() *model.FissionPrizeWheel { + return s.player +} + +// 玩家 +func (s *Wheel) initPlayer() (err error) { + player, err := s._dbFirst() + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + s.player = player + s.fissionPlayerSetInitOnceKey = ckey.FissionPlayerSetInitOnce(player.UserID) + }() + + if player != nil { + return + } + + player, err = s.firstOrCreate() + if err != nil { + return + } + + return +} + +// 创建玩家基础数据 +func (s *Wheel) firstOrCreate() (player *model.FissionPrizeWheel, err error) { + lc := app.NewFollower(s.Ctx, ckey.FissionUserCreatePlayerOnce(s.user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + player, err = s._dbFirst() + if err != nil { + return + } + + if player != nil { + return + } + + return s.createPlayer() +} + +// 数据库查询 +func (s *Wheel) _dbFirst() (*model.FissionPrizeWheel, error) { + playerM := dao.FissionPrizeWheel + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(s.user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return nil, s.BE().MysqlError(err) + } + + return player, nil +} + +// 创建一个玩家 +func (s *Wheel) createPlayer() (player *model.FissionPrizeWheel, err error) { + playerM := dao.FissionPrizeWheel + player = withdefault.FissionPrizeWheel(&model.FissionPrizeWheel{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + }) + + err = playerM.WithContext(s.Ctx).Create(player) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Wheel) _addLog(logs ...*model.FissionPrizeWheelLog) (err error) { + if len(logs) == 0 { + return + } + err = s.GetDao().FissionPrizeWheelLog.WithContext(s.Ctx).Create(logs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} diff --git a/internal/service/provider/projectuser/option.go b/internal/service/provider/projectuser/option.go new file mode 100644 index 0000000..0ddf99b --- /dev/null +++ b/internal/service/provider/projectuser/option.go @@ -0,0 +1,36 @@ +package projectuser + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" +) + +type Option func(pu *ProjectUser) + +func WithDao(d *dao.Query) Option { + return func(pu *ProjectUser) { + pu.Context.Init(pu.Ctx, d, pu.BE()) + } +} + +func WithInit(projectId int64, userId string) Option { + return func(pu *ProjectUser) { + pu.withInit = &initData{ + ProjectID: projectId, + UserID: userId, + } + } +} + +func WithUser(user *model.ProjectUser) Option { + return func(pu *ProjectUser) { + pu.user = user + } +} + +func WithUserId(userId int64) Option { + return func(pu *ProjectUser) { + pu.user, _ = cache.NewProjectUser(pu.Ctx).FindById(userId) + } +} diff --git a/internal/service/provider/projectuser/project_user.go b/internal/service/provider/projectuser/project_user.go new file mode 100644 index 0000000..a611890 --- /dev/null +++ b/internal/service/provider/projectuser/project_user.go @@ -0,0 +1,359 @@ +package projectuser + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "time" +) + +type initData struct { + ProjectID int64 + UserID string +} + +type ProjectUser struct { + logic.Context + + user *model.ProjectUser + + coinKey string + + withInit *initData +} + +func NewProjectUser(ctx context.Context, opts ...Option) (pu *ProjectUser, err error) { + pu = new(ProjectUser) + { + pu.BaseInit(ctx, merr.NewBE(ctx)) + } + + for _, opt := range opts { + opt(pu) + } + + if pu.withInit != nil { + err = pu.init(pu.withInit.ProjectID, pu.withInit.UserID) + if err != nil { + return + } + } + + pu.coinKey = ckey.ProjectUserCoinNum(pu.user.ID) + + return +} + +func (s *ProjectUser) GetProjectUser() *model.ProjectUser { + return s.user +} + +func (s *ProjectUser) init(projectId int64, userId string) (err error) { + s.user, err = cache.NewProjectUser(s.Ctx).FindByUniqId(projectId, userId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.user != nil { + return + } + + lc := app.NewFollower(s.Ctx, ckey.ProjectUserCreate(projectId, userId)).Lock() + defer lc.Release() + if lc.Error() != nil { + return lc.Error() + } + + s.user, err = cache.NewProjectUser(s.Ctx).FindByUniqId(projectId, userId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.user != nil { + return + } + + user := withdefault.ProjectUser(&model.ProjectUser{ + ProjectID: projectId, + UserID: userId, + }) + + if err = s.GetDao().ProjectUser.WithContext(s.Ctx).Create(user); err != nil { + err = s.BE().MysqlError(err) + return + } + + s.user = user + + return +} + +type Coin struct { + Num int64 `json:"num"` +} + +func (s *ProjectUser) GetCoin() (coin Coin, err error) { + + coinNum, err := s.coinNum() + if err != nil { + return + } + + coin.Num = coinNum + + return +} + +func (s *ProjectUser) IncrCoin(num int64) (coinNum int64, err error) { + coinNum, err = s.coinNum() + if err != nil { + return + } + + coinNum, err = app.Redis.Cache.IncrBy(s.Ctx, s.coinKey, num).Result() + if err != nil { + return + } + + app.Redis.Cache.Expire(s.Ctx, s.coinKey, lockdo.Rand2HourExp()) + + return +} + +func (s *ProjectUser) Expired(num int64) (coinNum int64, err error) { + if app.Redis.Cache.Exists(s.Ctx, s.coinKey).Val() == 0 { + return + } + + return s.IncrCoin(-num) +} + +type coin struct { + Num int64 `json:"num"` +} + +func (s *ProjectUser) coinNum() (num int64, err error) { + var coinNum coin + m := s.GetDao().ProjectUserCoin + err = m.WithContext(s.Ctx). + Select(m.CoinUse.Sum().As("num")). + Where( + m.ProjectID.Eq(s.user.ProjectID), + m.UserID.Eq(s.user.ID), + m.ExpiredAt.Gt(time.Now().Unix()), + m.IsUsed.Eq(mtype.No), + ). + Scan(&coinNum) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return coinNum.Num, nil +} + +type EarnCoinParam struct { + CoinNum int32 + IsExpired int8 + ExpiredAt int64 + Source string + SourceID int64 + SourceData map[string]string + Operate string +} + +func (s *ProjectUser) EarnCoin(earns ...*EarnCoinParam) (err error) { + var incrNum int64 + var coins []*model.ProjectUserCoin + var expired []*model.ProjectUserCoinExpired + var records []*model.ProjectUserCoinRecord + for _, earn := range earns { + one := withdefault.ProjectUserCoin(&model.ProjectUserCoin{ + ProjectID: s.user.ProjectID, + UserID: s.user.ID, + CoinNum: earn.CoinNum, + CoinUse: earn.CoinNum, + ExpiredAt: earn.ExpiredAt, + IsExpired: earn.IsExpired, + IsUsed: 0, + Source: earn.Source, + SourceID: earn.SourceID, + SourceData: "", + }, earn.SourceData) + + coins = append(coins, one) + + if earn.IsExpired == mtype.Yes { + expired = append(expired, withdefault.ProjectUserCoinExpired(&model.ProjectUserCoinExpired{ + UserID: s.user.ID, + CoinID: one.ID, + DoneAt: earn.ExpiredAt, + })) + } + + incrNum += int64(earn.CoinNum) + + records = append(records, withdefault.ProjectUserCoinRecord(&model.ProjectUserCoinRecord{ + ProjectID: s.user.ProjectID, + UserID: s.user.ID, + Source: earn.Source, + SourceID: earn.SourceID, + Type: mtype.ProjectUserCoinRecordTypeAdd, + Mark: earn.Operate, + Num: earn.CoinNum, + ExpiredAt: utils.Ternary[int64](earn.IsExpired == mtype.Yes, earn.ExpiredAt, 0), + })) + } + + if err = s.GetDao().ProjectUserCoin.WithContext(s.Ctx).Create(coins...); err != nil { + err = s.BE().MysqlError(err) + return + } + + if err = s.GetDao().ProjectUserCoinRecord.WithContext(s.Ctx).Create(records...); err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(expired) > 0 { + if err = s.GetDao().ProjectUserCoinExpired.WithContext(s.Ctx).Create(expired...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + //_, err = s.IncrCoin(incrNum) + //if err != nil { + // return + //} + + return +} + +func (s *ProjectUser) Deduct(source, operate string, sourceId int64, num int32) (ok bool, err error) { + m := s.GetDao().ProjectUserCoin + var coinIds []int64 + var deductNum = num + var lastId int64 + + for { + var list []*model.ProjectUserCoin + list, err = m.WithContext(s.Ctx).Where( + m.UserID.Eq(s.user.ID), + m.ExpiredAt.Gte(time.Now().Unix()), + m.IsUsed.Eq(mtype.No), + m.ID.Gt(lastId), + ).Order(m.ExpiredAt, m.ID).Limit(100).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + break + } + + var partIds []int64 + for _, item := range list { + deductNum -= item.CoinUse + if deductNum >= 0 { + partIds = append(partIds, item.ID) + } + + if deductNum < 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(item.ID)).UpdateSimple(m.CoinUse.Value(-deductNum)) + if err != nil { + return + } + coinIds = append(coinIds, item.ID) + break + } + } + + if len(partIds) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.In(partIds...)).UpdateSimple(m.CoinUse.Value(0), m.IsUsed.Value(mtype.Yes)) + if err != nil { + return + } + + coinIds = append(coinIds, partIds...) + } + + if deductNum <= 0 { + break + } + + lastId = list[len(list)-1].ID + } + + if deductNum > 0 { + return false, nil + } + + use := withdefault.ProjectUserCoinUse(&model.ProjectUserCoinUse{ + UserID: s.user.ID, + Num: num, + Source: source, + SourceID: sourceId, + Operate: operate, + }, coinIds) + + err = s.GetDao().ProjectUserCoinUse.WithContext(s.Ctx).Create(use) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.GetDao().ProjectUserCoinRecord.WithContext(s.Ctx).Create(withdefault.ProjectUserCoinRecord(&model.ProjectUserCoinRecord{ + ProjectID: s.user.ProjectID, + UserID: s.user.ID, + Source: source, + SourceID: sourceId, + Type: mtype.ProjectUserCoinRecordTypeDer, + Mark: operate, + Num: num, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return true, nil +} + +func (s *ProjectUser) DeductOk(source, relateMark string, relateID int64, operate string, num int32) (err error) { + deduct := withdefault.ProjectUserCoinDeduct(&model.ProjectUserCoinDeduct{ + UserID: s.user.ID, + Source: source, + RelateMark: relateMark, + RelateID: relateID, + Operate: operate, + Num: num, + }) + + if err = s.GetDao().ProjectUserCoinDeduct.WithContext(s.Ctx).Create(deduct); err != nil { + err = s.BE().MysqlError(err) + return + } + + producer.NewCampaignNotice(s.Ctx).ProjectUserCoinDeduct(types.ProjectUserCoinDeduct{ + Type: types.ProjectUserCoinDeductTypeDeduct, + UserId: s.user.ID, + DeductId: deduct.ID, + }) + + return +} diff --git a/internal/service/provider/pusher/option.go b/internal/service/provider/pusher/option.go new file mode 100644 index 0000000..ed7042a --- /dev/null +++ b/internal/service/provider/pusher/option.go @@ -0,0 +1 @@ +package pusher diff --git a/internal/service/provider/pusher/push_group.go b/internal/service/provider/pusher/push_group.go new file mode 100644 index 0000000..41520dc --- /dev/null +++ b/internal/service/provider/pusher/push_group.go @@ -0,0 +1,55 @@ +package pusher + +import ( + "context" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/utils/verify" + "time" +) + +const ( + groupSec = 300 +) + +type pushGroup struct { + one, two, three *cachecurd.HMap + oneBt, twoBt, threeBt [2]int64 +} + +func (s *pushGroup) insideOne(doneAt int64) bool { + return verify.Inside[int64](doneAt, s.oneBt[0], s.oneBt[1]) +} + +func (s *pushGroup) insideTwo(doneAt int64) bool { + return verify.Inside[int64](doneAt, s.twoBt[0], s.twoBt[1]) +} + +func (s *pushGroup) insideThree(doneAt int64) bool { + return verify.Inside[int64](doneAt, s.threeBt[0], s.threeBt[1]) +} + +func newPushGroup(ctx context.Context, t time.Time, cpnId int64, mark string) *pushGroup { + var base = t.Minute() / 5 + one, two, three := base+1, base+2, base+3 + + if two > 12 { + two -= 12 + } + + if three > 12 { + three -= 12 + } + + pg := &pushGroup{} + + pg.one, _ = cachecurd.NewHMap(ctx, ckey.FissionPushUserGroup(cpnId, mark, one), cachecurd.SetHMapExp(16*time.Minute)) + pg.two, _ = cachecurd.NewHMap(ctx, ckey.FissionPushUserGroup(cpnId, mark, two), cachecurd.SetHMapExp(16*time.Minute)) + pg.three, _ = cachecurd.NewHMap(ctx, ckey.FissionPushUserGroup(cpnId, mark, three), cachecurd.SetHMapExp(16*time.Minute)) + + pg.oneBt = [2]int64{t.Unix() - 3*groupSec, t.Unix() - 2*groupSec} + pg.twoBt = [2]int64{t.Unix() - 2*groupSec, t.Unix() - groupSec} + pg.threeBt = [2]int64{t.Unix() - groupSec, t.Unix()} + + return pg +} diff --git a/internal/service/provider/pusher/pusher.go b/internal/service/provider/pusher/pusher.go new file mode 100644 index 0000000..90bf47d --- /dev/null +++ b/internal/service/provider/pusher/pusher.go @@ -0,0 +1,375 @@ +package pusher + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "fmt" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" +) + +type UserLine struct { + Id int64 + DoneAt int64 +} + +type Pusher struct { + logic.Context + + cpn *model.FissionCampaign + project *model.Project + + channelLink map[int64]string // 渠道链接 + + pg map[string]*pushGroup // 防止重复推送分组 + + langTitle map[string]string // 语言页面标题 + + targetNum int64 // 需要邀请的目标数 + + icon string // 玩法icon +} + +func NewPusher(ctx context.Context, cpn *model.FissionCampaign) (*Pusher, error) { + pusher := &Pusher{ + cpn: cpn, + pg: make(map[string]*pushGroup), + langTitle: make(map[string]string), + } + + pusher.Init(ctx, dao.Q, merr.NewBE(ctx)) + + err := pusher.set() + if err != nil { + return nil, err + } + + return pusher, nil +} + +// 设置必定需要的参数 +func (s *Pusher) set() (err error) { + channelM := dao.FissionCampaignChannel + channelList, err := channelM.WithContext(s.Ctx).Where( + channelM.CampaignID.Eq(s.cpn.ID), + channelM.CType.Eq(mtype.FissionCampaignChannelTypeApp), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.project, err = cache.NewProject(s.Ctx).FindById(s.cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.channelLink = make(map[int64]string, len(channelList)) + for _, v := range channelList { + s.channelLink[v.ID] = blink.NewCampaignLink(s.project.Domain, s.cpn.HashID, v.Mark).CampaignShareLink() + if v.IsDefault == mtype.Yes && v.IsDel == mtype.No { + s.channelLink[0] = s.channelLink[v.ID] + } + } + + switch s.cpn.FissionID { + case consts.IdCash: + taskM := dao.FissionCampaignTask + task, err1 := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(s.cpn.ID), + taskM.TaskType.In(mtype.FissionCampaignTaskTypeInstall, mtype.FissionCampaignTaskTypeRegister), + taskM.IsDel.Eq(mtype.No), + ).Take() + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + if task == nil { + return + } + + s.targetNum = int64(1 / task.Percent) + } + + return +} + +func (s *Pusher) CompleteTask(user *model.FissionUser) (err error) { + if s.beLimit(s.cpn.ProjectID, mtype.FissionCampaignPushMarkCompleteTask, user.SubUserID) { + return + } + + inviteNum, err1 := s._inviteNum([]int64{user.ID}) + if err1 != nil { + return err1 + } + + userMap, err := s._userChannel(s.cpn.ID, []int64{user.ID}) + if err != nil { + return err + } + + s._push( + mtype.FissionCampaignPushMarkCompleteTask, + "", + "", + app.TalkMap.CompeteTask(user.LangMark), + userMap[user.ID], + 0, + inviteNum[user.ID], + ) + + return +} + +// Active 日活推送 +func (s *Pusher) Active(t time.Time, markCode, codeVal string, userLines []*UserLine) (err error) { + return s.gpPush(mtype.FissionCampaignPushMarkActive, markCode, codeVal, userLines, s._getPg(mtype.FissionCampaignPushMarkActive, t)) +} + +// TaskRest 任务重制推送 +func (s *Pusher) TaskRest(t time.Time, markCode, codeVal string, userLines []*UserLine) (err error) { + return s.gpPush(mtype.FissionCampaignPushMarkTaskReset, markCode, codeVal, userLines, s._getPg(mtype.FissionCampaignPushMarkTaskReset, t)) +} + +// Offline 离线推送 +func (s *Pusher) Offline(t time.Time, markCode, codeVal string, userLines []*UserLine) (err error) { + return s.gpPush(mtype.FissionCampaignPushMarkOffline, markCode, codeVal, userLines, s._getPg(mtype.FissionCampaignPushMarkOffline, t)) +} + +// Visit 访问推送 +func (s *Pusher) Visit(user *model.FissionUser, t time.Time) (err error) { + userMap, err := s._userChannel(s.cpn.ID, []int64{user.ID}) + if err != nil { + return err + } + + s._push( + mtype.FissionCampaignPushMarkVisit, + "", + "", + "", + userMap[user.ID], + t.Unix(), + 0, + ) + + return +} + +// 记录组推送,一些需要防止二次推送的处理的 +func (s *Pusher) gpPush(mark, markCode, codeVal string, userLines []*UserLine, pg *pushGroup) (err error) { + var userIds []int64 + for _, v := range userLines { + id := fmt.Sprintf("%d", v.Id) + if pg.insideOne(v.DoneAt) && pg.one.Exist(id) { + continue + } + + if pg.insideTwo(v.DoneAt) && pg.two.Exist(id) { + continue + } + + if pg.insideThree(v.DoneAt) && pg.three.Exist(id) { + continue + } + + userIds = append(userIds, v.Id) + } + + inviteNum, err1 := s._inviteNum(userIds) + if err1 != nil { + return err1 + } + + cpn := s.cpn + + userMap, err1 := s._userChannel(cpn.ID, userIds) + if err1 != nil { + return err1 + } + + var oneOk, twoOk, threeOk []string + for _, v := range userLines { + user, ok := userMap[v.Id] + if !ok { + continue + } + + langMark := utils.NotExistGetFirst[string](user.LangMark, s.cpn.GetLangMarks()) + + var desc string + switch mark { + case mtype.FissionCampaignPushMarkOffline: + switch s.cpn.FissionID { + case consts.IdKeep: + desc = app.TalkMap.DogOffline(langMark) + } + case mtype.FissionCampaignPushMarkTaskReset: + desc = app.TalkMap.TaskReset(langMark) + case mtype.FissionCampaignPushMarkActive: + desc = app.TalkMap.Active(langMark) + } + + id := fmt.Sprintf("%d", v.Id) + if pg.insideThree(v.DoneAt) { + threeOk = append(threeOk, id, "1") + } else if pg.insideTwo(v.DoneAt) { + twoOk = append(twoOk, id, "1") + } else if pg.insideOne(v.DoneAt) { + oneOk = append(oneOk, id, "1") + } + + s._push(mark, markCode, codeVal, desc, user, v.DoneAt, inviteNum[v.Id]) + } + + if len(threeOk) > 0 { + _ = pg.three.Set(threeOk...) + } + + if len(twoOk) > 0 { + _ = pg.two.Set(twoOk...) + } + + if len(oneOk) > 0 { + _ = pg.one.Set(oneOk...) + } + + return +} + +// 推送到开发平台 +func (s *Pusher) _push(mark, markCode, codeVal, desc string, user userChannel, doneAt, inviteNum int64) { + producer.NewOplatformOther(s.Ctx).OpoCampaignPush(types.OpoCampaignPush{ + ProjectId: s.cpn.ProjectID, + FissionId: s.cpn.FissionID, + CampaignHashId: s.cpn.HashID, + CampaignTitle: s.cpn.Title, + CampaignUrl: user.ChannelUrl, + PageTitle: s._getLangTitle(user.LangMark), + FissionIcon: fmt.Sprintf("%s/%s", config.Config.Upload.Host, consts.GetPushLogo(s.cpn.FissionID, int32(s.cpn.Target))), + UserId: user.UserId, + Mark: mark, + MarkCode: markCode, + CodeVal: codeVal, + MarkDesc: desc, + PushTime: time.Now().Unix(), + TaskExpireTime: doneAt, + InviteNum: inviteNum, + TargetNum: s.targetNum, + }, producer.SetHeaderLang(user.LangMark)) +} + +// 获取页面标题 +func (s *Pusher) _getLangTitle(userLang string) (langTitle string) { + langTitle, ok := s.langTitle[userLang] + if ok { + return langTitle + } + + lt, err := provider.NewLangTitle(s.Ctx, s.cpn, userLang) + if err != nil { + return + } + + langTitle, _ = lt.GetPageTitle() + + s.langTitle[userLang] = langTitle + return +} + +// 获取push记录组 +func (s *Pusher) _getPg(mark string, t time.Time) *pushGroup { + pg, ok := s.pg[mark] + if !ok { + pg = newPushGroup(s.Ctx, t, s.cpn.ID, mark) + s.pg[mark] = pg + return pg + } + + return pg +} + +// 邀请人数 +func (s *Pusher) _inviteNum(ids []int64) (data map[int64]int64, err error) { + data = make(map[int64]int64, len(ids)) + + m := dao.FissionUserStat + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return + } + + for _, v := range list { + data[v.UserID] = v.EffectiveNum + } + return +} + +type userChannel struct { + UserId string `json:"user_id"` + ChannelUrl string `json:"channel"` + LangMark string `json:"lang_mark"` +} + +// 用户渠道 +func (s *Pusher) _userChannel(cpnId int64, ids []int64) (data map[int64]userChannel, err error) { + m := dao.FissionUser.SubTable(cpnId) + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + return + } + + var channelIds []int64 + var channelMap = make(map[int64]string) + for _, v := range list { + if _, ok := channelMap[v.ChannelID]; !ok { + channelMap[v.ChannelID] = "" + channelIds = append(channelIds, v.ChannelID) + } + } + + data = make(map[int64]userChannel, len(ids)) + for _, user := range list { + if user.IsView == mtype.Yes { + continue + } + + data[user.ID] = userChannel{ + UserId: user.SubUserID, + ChannelUrl: s.channelLink[user.ChannelID], + LangMark: user.LangMark, + } + } + + return +} + +func (s *Pusher) beLimit(projectId int64, mark, subUserId string) bool { + return !app.NewRedisLock(s.Ctx, ckey.FissionPushLimit(projectId, mark, subUserId), lock.SetExpire(2*time.Hour)).SoftLock() +} + +func (s *Pusher) GetChannelUrl(channelId int64) string { + return s.channelLink[channelId] +} + +func (s *Pusher) GetProject() *model.Project { + return s.project +} diff --git a/internal/service/provider/pusher/pusher_test.go b/internal/service/provider/pusher/pusher_test.go new file mode 100644 index 0000000..8bfc008 --- /dev/null +++ b/internal/service/provider/pusher/pusher_test.go @@ -0,0 +1,55 @@ +package pusher + +import ( + "context" + _ "joybuywork/test" + "testing" + "time" + + "github.com/rs/xid" +) + +func TestGroup(t *testing.T) { + + ctx := context.Background() + + for i := 0; i < 100; i++ { + id := xid.New().String() + + var at int64 = 1772703600 + t.Run("one", func(t *testing.T) { + ti, _ := time.ParseInLocation("2006-01-02 15:04:05", "2026-03-05 17:40:01", time.Local) + + pg := newPushGroup(ctx, ti, 1, "a") + + if pg.insideThree(at) { + pg.three.Set(id, "1") + } else if pg.insideTwo(at) { + pg.two.Set(id, "1") + } else if pg.insideOne(at) { + pg.one.Set(id, "1") + } + }) + + t.Run("two", func(t *testing.T) { + ti, _ := time.ParseInLocation("2006-01-02 15:04:05", "2026-03-05 17:45:01", time.Local) + + pg := newPushGroup(ctx, ti, 1, "a") + + if pg.insideOne(at) && pg.one.Exist(id) { + return + } + + if pg.insideTwo(at) && pg.two.Exist(id) { + return + } + + if pg.insideThree(at) && pg.three.Exist(id) { + return + } + + t.Log("2323423dsfsfsdf") + }) + } + +} diff --git a/internal/service/provider/rewards.go b/internal/service/provider/rewards.go new file mode 100644 index 0000000..3230bbe --- /dev/null +++ b/internal/service/provider/rewards.go @@ -0,0 +1,621 @@ +package provider + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/merr" + "fmt" +) + +type RewardAutoLang struct { + KvData []*mtype.RewardKV `json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `json:"receive_type"` //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-实物) + Contact string `json:"contact,omitempty"` //联系方式 + Id int64 `json:"id"` + Url string `json:"url,omitempty"` //回调地址 + Title string `json:"title"` // 显示的奖品名称 + ImgUrl string `json:"img_url"` // 显示的奖品图片 + Mark string `json:"mark"` // 语言标识 + IsDefault int32 `json:"is_default"` + FindDefault bool `json:"find_default"` //只能找到默认数据 + RewardTitle string `json:"reward_title"` //奖品标题 + FormTitle string `json:"form_title"` //表单标题 + OpenToUse int32 `json:"open_to_use"` //是否开启了“去使用” + AppParam string `json:"app_param"` //app参数 + PcParam string `json:"pc_param"` //pc参数 + WebUrl string `json:"web_url"` //web端跳转参数 + DyRewardType int32 `json:"dy_reward_type"` //动态奖品内容类型(0-无,1-兑换码) + UrlId int64 `json:"url_id"` //回调地址 + FormId int64 `json:"form_id"` //表单id +} + +type RewardInfo struct { + Id int64 `json:"id"` + KvData []*mtype.RewardKV `json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `json:"receive_type"` //发放类型(0-不做任何操作,1-系统发放,2-联系客服,3-客户端发放,4-实物) + RewardTitle string `json:"reward_title,omitempty"` //奖品标题 + Contact string `json:"contact,omitempty"` //联系方式 + Url string `json:"url,omitempty"` //回调地址 + Langs []*RewardLang `json:"langs,omitempty"` //语言数据 + FormTitle string `json:"form_title"` //表单标题 + DyRewardType int32 `json:"dy_reward_type"` //动态奖品内容类型(0-无,1-兑换码) + UrlId int64 `json:"url_id"` //回调地址 + FormId int64 `json:"form_id"` //表单id +} + +type RewardLang struct { + RewardId int64 `json:"reward_id"` + Title string `json:"title"` + ImgUrl string `json:"img_url"` + Mark string `json:"mark"` + IsDefault int32 `json:"is_default"` + FindDefault bool `json:"find_default"` //只能找到默认数据 + OpenToUse int32 `json:"open_to_use"` //是否开启了“去使用” + AppParam string `json:"app_param"` //app参数 + WebUrl string `json:"web_url"` //web端跳转参数 + PcParam string `json:"pc_param"` //pc参数 +} + +type Rewards struct { + ctx context.Context + be *merr.BusinessError + projectId int64 + + find struct { + list []*model.Reward + } // 找到的数据 + + fmap map[int64]struct{} + urlMap map[int64]string //地址id对应的地址信息 + formMap map[int64]string //表单id对应的表单标题 + rMap map[int64]*RewardInfo //奖品信息临时map + rlMap map[string]RewardLang //奖品的语言信息临时map + rls map[int64][]*model.RewardLang //奖品的语言信息列表临时map + ralMap map[string]RewardAutoLang //奖品信息并且自动选匹配语种后的数据临时map +} + +// NewRewards 奖品管理 +func NewRewards(ctx context.Context, projectId int64, ids ...int64) (*Rewards, error) { + p := &Rewards{ + ctx: ctx, + be: merr.NewBE(ctx), + projectId: projectId, + fmap: map[int64]struct{}{}, + rlMap: map[string]RewardLang{}, + rMap: map[int64]*RewardInfo{}, + rls: map[int64][]*model.RewardLang{}, + ralMap: map[string]RewardAutoLang{}, + } + + err := p._find(ids...) + + return p, err +} + +func (s *Rewards) Append(ids ...int64) (*Rewards, error) { + err := s._find(ids...) + return s, err +} + +// InfoListWithLang 奖品列表信息带语言 +func (s *Rewards) InfoListWithLang(ids ...int64) (list []*RewardInfo, err error) { + list, err = s.InfoList(ids...) + for _, v := range list { + if len(v.Langs) != 0 { + continue + } + + langs := s.rls[v.Id] + for _, lang := range langs { + v.Langs = append(v.Langs, &RewardLang{ + RewardId: lang.RewardID, + Title: lang.Title, + ImgUrl: lang.ImgURL, + Mark: lang.Mark, + IsDefault: int32(lang.IsDefault), + }) + } + } + + return +} + +// InfoWithLang 奖品信息带语言 +func (s *Rewards) InfoWithLang(ids ...int64) (info *RewardInfo, err error) { + info, err = s.Info(ids...) + if err != nil { + return + } + + if len(info.Langs) != 0 { + return + } + + langs := s.rls[info.Id] + for _, lang := range langs { + info.Langs = append(info.Langs, &RewardLang{ + RewardId: lang.RewardID, + Title: lang.Title, + ImgUrl: lang.ImgURL, + Mark: lang.Mark, + IsDefault: int32(lang.IsDefault), + FindDefault: false, + OpenToUse: int32(lang.OpenToUse), + AppParam: lang.AppParam, + WebUrl: lang.WebURL, + PcParam: lang.PcParam, + }) + } + + return +} + +// InfoList 奖品列表信息 +func (s *Rewards) InfoList(ids ...int64) (list []*RewardInfo, err error) { + + urlMap, err := s._url() + if err != nil { + return + } + + formMap, err := s._form() + if err != nil { + return + } + + if len(ids) > 0 { + // 找id + list = make([]*RewardInfo, 0, len(ids)) + var inMap = make(map[int64]struct{}) + for _, id := range ids { + inMap[id] = struct{}{} + } + + for _, v := range s.find.list { + if _, ok := inMap[v.ID]; ok { + list = append(list, s.one(v, urlMap[v.URLID], formMap[v.FormID])) + } + } + + return + } + + // 全都找 + list = make([]*RewardInfo, 0, len(s.find.list)) + for _, v := range s.find.list { + list = append(list, s.one(v, urlMap[v.URLID], formMap[v.FormID])) + } + + return +} + +// InfoMap 奖品列表信息 +func (s *Rewards) InfoMap(ids ...int64) (list map[int64]*RewardInfo, err error) { + + urlMap, err := s._url() + if err != nil { + return + } + + formMap, err := s._form() + if err != nil { + return + } + + if len(ids) > 0 { + // 找id的 + list = make(map[int64]*RewardInfo, len(ids)) + var inMap = make(map[int64]struct{}) + for _, id := range ids { + inMap[id] = struct{}{} + } + + for _, v := range s.find.list { + if _, ok := inMap[v.ID]; ok { + list[v.ID] = s.one(v, urlMap[v.URLID], formMap[v.FormID]) + } + } + + return + } + + // 全都找 + list = make(map[int64]*RewardInfo, len(s.find.list)) + for _, v := range s.find.list { + list[v.ID] = s.one(v, urlMap[v.URLID], formMap[v.FormID]) + } + + return +} + +// Info 奖品信息 +func (s *Rewards) Info(ids ...int64) (info *RewardInfo, err error) { + + for _, id := range ids { + var ok bool + info, ok = s.rMap[id] + if ok { + return + } + } + + defer func() { + if err == nil && info != nil { + s.rMap[info.Id] = info + } + }() + + urlMap, err := s._url() + if err != nil { + return + } + + formMap, err := s._form() + if err != nil { + return + } + + if len(ids) == 0 { + for _, v := range s.find.list { + return s.one(v, urlMap[v.URLID], formMap[v.FormID]), nil + } + return + } + + for _, v := range s.find.list { + for _, id := range ids { + if v.ID == id { + return s.one(v, urlMap[v.URLID], formMap[v.FormID]), nil + } + } + } + + return +} + +// AutoLang 自动匹配语言 +func (s *Rewards) AutoLang(rewardId int64, langMarks ...string) (lang RewardLang) { + + key := fmt.Sprint(rewardId) + if len(langMarks) > 0 { + key += "_" + langMarks[0] + } + + if info, ok := s.rlMap[key]; ok { + return info + } + + defer func() { + s.rlMap[key] = lang + }() + + langs := s.rls[rewardId] + for _, v := range langs { + for _, mark := range langMarks { + if v.Mark == mark { + return RewardLang{ + RewardId: v.RewardID, + Title: v.Title, + ImgUrl: v.ImgURL, + Mark: v.Mark, + IsDefault: int32(v.IsDefault), + FindDefault: false, + OpenToUse: int32(v.OpenToUse), + AppParam: v.AppParam, + WebUrl: v.WebURL, + PcParam: v.PcParam, + } + } + } + } + + for _, v := range langs { + if v.IsDefault == mtype.Yes { + return RewardLang{ + RewardId: v.RewardID, + Title: v.Title, + ImgUrl: v.ImgURL, + Mark: v.Mark, + IsDefault: int32(v.IsDefault), + FindDefault: true, + OpenToUse: int32(v.OpenToUse), + AppParam: v.AppParam, + WebUrl: v.WebURL, + PcParam: v.PcParam, + } + } + } + + return +} + +func (s *Rewards) InfoAutoLang(rewardId int64, langMarks ...string) (data RewardAutoLang, err error) { + key := fmt.Sprint(rewardId) + if len(langMarks) > 0 { + key += "_" + langMarks[0] + } + + if cd, ok := s.ralMap[key]; ok { + return cd, nil + } + + defer func() { + if err == nil { + s.ralMap[key] = data + } + }() + + info, err := s.Info(rewardId) + if err != nil { + return + } + + if info == nil { + err = s.be.VerifyError("not found reward info") + return + } + + lang := s.AutoLang(rewardId, langMarks...) + + return RewardAutoLang{ + KvData: info.KvData, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Id: info.Id, + Url: info.Url, + Title: lang.Title, + ImgUrl: lang.ImgUrl, + Mark: lang.Mark, + IsDefault: lang.IsDefault, + FindDefault: lang.FindDefault, + RewardTitle: info.RewardTitle, + FormTitle: info.FormTitle, + OpenToUse: lang.OpenToUse, + AppParam: lang.AppParam, + PcParam: lang.PcParam, + WebUrl: lang.WebUrl, + DyRewardType: info.DyRewardType, + UrlId: info.UrlId, + FormId: info.FormId, + }, nil +} + +func (s *Rewards) InfoAutoLangMap(langMarks ...string) (data map[int64]*RewardAutoLang, err error) { + list, err := s.InfoList() + if err != nil { + return + } + + data = make(map[int64]*RewardAutoLang, len(list)) + + for _, info := range list { + lang := s.AutoLang(info.Id, langMarks...) + data[info.Id] = &RewardAutoLang{ + KvData: info.KvData, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + Id: info.Id, + Url: info.Url, + Title: lang.Title, + ImgUrl: lang.ImgUrl, + Mark: lang.Mark, + IsDefault: lang.IsDefault, + FindDefault: lang.FindDefault, + RewardTitle: info.RewardTitle, + FormTitle: info.FormTitle, + OpenToUse: lang.OpenToUse, + AppParam: lang.AppParam, + PcParam: lang.PcParam, + WebUrl: lang.WebUrl, + DyRewardType: info.DyRewardType, + UrlId: info.UrlId, + FormId: info.FormId, + } + } + + return +} + +// 找到对应的数据 +func (s *Rewards) _find(fids ...int64) (err error) { + var rewardIds []int64 + if len(fids) == 0 { + rewardIds, err = s._findByProjectId() + } else { + rewardIds, err = s._findByIds(fids...) + } + + if err != nil { + return + } + + return s._findRewardLang(rewardIds) +} + +func (s *Rewards) _findByProjectId() (rewardIds []int64, err error) { + m := dao.Reward + list, err := m.WithContext(s.ctx). + Where( + m.ProjectID.Eq(s.projectId), + m.OldData.Eq(mtype.No), + m.IsDel.Eq(mtype.No)). + Order(m.ID.Desc()). + Find() + if err != nil { + err = s.be.MysqlError(err) + return + } + + for _, v := range list { + if _, ok := s.fmap[v.ID]; ok { + continue + } + s.find.list = append(s.find.list, v) + s.fmap[v.ID] = struct{}{} + rewardIds = append(rewardIds, v.ID) + } + + return +} + +func (s *Rewards) _findByIds(fids ...int64) (rewardIds []int64, err error) { + var fixIds, ids []int64 + for _, v := range fids { + if _, ok := s.fmap[v]; ok { + continue + } + + if v < 0 { + fixIds = append(fixIds, v) + continue + } + + ids = append(ids, v) + } + + if len(fixIds) > 0 { + for _, reward := range app.FissionFixRewards { + s.find.list = append(s.find.list, &model.Reward{ + ID: reward.Id, + RewardTitle: reward.RewardTitle, + }) + + for _, lang := range reward.Langs { + s.rls[reward.Id] = append(s.rls[reward.Id], &model.RewardLang{ + RewardID: reward.Id, + Mark: lang.Mark, + IsDefault: utils.Ternary[int8](lang.IsDefault, mtype.Yes, mtype.No), + Title: lang.Title, + ImgURL: lang.ImgUrl, + }) + } + } + } + + if len(ids) == 0 { + return + } + + c := cache.NewReward(s.ctx) + list, err := c.FindByIds(ids) + if err != nil { + err = s.be.CacheError(err) + return + } + + for _, v := range list { + s.find.list = append(s.find.list, v) + s.fmap[v.ID] = struct{}{} + rewardIds = append(rewardIds, v.ID) + } + + return +} + +func (s *Rewards) _findRewardLang(rewardIds []int64) (err error) { + rlm := dao.RewardLang + list, err := rlm.WithContext(s.ctx).Where(rlm.RewardID.In(rewardIds...), rlm.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.be.MysqlError(err) + return + } + + for _, v := range list { + s.rls[v.RewardID] = append(s.rls[v.RewardID], v) + } + + return +} + +func (s *Rewards) _url() (urlMap map[int64]string, err error) { + if len(s.urlMap) != 0 { + return s.urlMap, nil + } + + var ids []int64 + urlMap = make(map[int64]string) + for _, v := range s.find.list { + if _, ok := urlMap[v.URLID]; !ok { + ids = append(ids, v.URLID) + urlMap[v.URLID] = "" + } + } + + if len(ids) == 0 { + return + } + + m := dao.NotifyURL + list, err := m.WithContext(s.ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.be.MysqlError(err) + return + } + + for _, url := range list { + urlMap[url.ID] = url.URL + } + + s.urlMap = urlMap + + return +} + +func (s *Rewards) _form() (formMap map[int64]string, err error) { + if len(s.formMap) != 0 { + return s.formMap, nil + } + + var ids []int64 + formMap = make(map[int64]string) + for _, v := range s.find.list { + if _, ok := formMap[v.FormID]; !ok && v.FormID > 0 { + ids = append(ids, v.FormID) + formMap[v.FormID] = "" + } + } + + if len(ids) == 0 { + return + } + + m := dao.Form + list, err := m.WithContext(s.ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.be.MysqlError(err) + return + } + + for _, form := range list { + formMap[form.ID] = form.Title + } + + s.formMap = formMap + + return +} + +func (s *Rewards) one(val *model.Reward, url, formTitle string) *RewardInfo { + return &RewardInfo{ + Id: val.ID, + KvData: val.GetKvData(), + ReceiveType: int32(val.ReceiveType), + RewardTitle: val.RewardTitle, + Contact: val.Contact, + Url: url, + Langs: nil, + FormTitle: formTitle, + DyRewardType: int32(val.DyRewardType), + UrlId: val.URLID, + FormId: val.FormID, + } +} + +func (s *Rewards) GetProjectId() int64 { + return s.projectId +} diff --git a/internal/service/provider/s2s/lv_api.go b/internal/service/provider/s2s/lv_api.go new file mode 100644 index 0000000..7d114aa --- /dev/null +++ b/internal/service/provider/s2s/lv_api.go @@ -0,0 +1,118 @@ +package s2s + +import ( + "context" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" +) + +type LvApiResp struct { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data *LvApiRespData `json:"data"` +} +type LvApiRespData struct { + List []string `json:"list"` // 用户绑定的标签 +} + +type LvApi struct { + S2S + + log *model.LvAPILog +} + +func NewLvApi(ctx context.Context, conf *model.FissionConfig, opts ...Option) (*LvApi, error) { + r := &LvApi{} + + err := r.init(ctx, conf.ProjectID, conf.LvURLID, opts...) + if err != nil { + return nil, err + } + + return r, nil +} + +func (s *LvApi) LvApi(cpn *model.FissionCampaign, userId, langMark, source string) (res *LvApiRespData, err error) { + var resp, errMsg string + var code int32 + defer func() { + s.after(code, resp, errMsg) + }() + + m := s.GetDao().FissionUserLevel + var marks = make([]string, 0) + err = m.WithContext(s.Ctx).Where(m.ProjectID.Eq(cpn.ProjectID), m.DeletedAt.Eq(0)).Pluck(m.Mark, &marks) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + req := mtype.LvApiLogReq{ + UserId: userId, + CampaignId: cpn.HashID, + Title: cpn.Title, + State: "get_user_type", + TlSettingUserType: marks, + } + + s.before(cpn.ID, userId, source, req) + + body, _ := jsonm.Marshal(req) + resp, code, err = s.request(s.log.ID, body, langMark, prefixToken, NewCertToken) + if err != nil { + errMsg = fmt.Sprintf("请求处理失败: %v", err) + err = workerr.S2SNotSuccessError + return + } + + var data = &LvApiResp{} + err = jsonm.StrUnmarshal(resp, data) + if err != nil { + errMsg = fmt.Sprintf("无法解析的返回数据: %v", err) + err = workerr.S2SUnableToParseError + return + } + + if data.Code != successCode { + errMsg = "code返回的非200,请确认业务是否正确对接" + if data.Msg != "" { + errMsg = fmt.Sprintf("code返回的非200, 提供的信息为: %s", data.Msg) + } + err = workerr.S2SNotSuccessError + return + } + + res = data.Data + + return +} + +func (s *LvApi) before(cpnId int64, userId, source string, req mtype.LvApiLogReq) { + s.log = withdefault.LvApiLog(&model.LvAPILog{ + CampaignID: cpnId, + UserID: userId, + Source: source, + ReqURL: s.GetUrl(), + }) + + s.log.SetReq(req) + + _ = s.GetDao().LvAPILog.WithContext(s.Ctx).Create(s.log) + s.start = time.Now() +} + +func (s *LvApi) after(code int32, resp, errMsg string) { + s.log.RespCode = code + s.log.Resp = resp + s.log.ErrMsg = errMsg + s.log.Token = s.GetToken() + s.log.ReqHeader = s.GetHeader() + s.log.ReqTime = time.Since(s.start).Milliseconds() + + _ = s.GetDao().LvAPILog.WithContext(s.Ctx).Save(s.log) +} diff --git a/internal/service/provider/s2s/option.go b/internal/service/provider/s2s/option.go new file mode 100644 index 0000000..d973519 --- /dev/null +++ b/internal/service/provider/s2s/option.go @@ -0,0 +1,13 @@ +package s2s + +import ( + "joybuywork/internal/repository/dao" +) + +type Option func(s2s *S2S) + +func SetDao(d *dao.Query) Option { + return func(s2s *S2S) { + s2s.Context.Init(s2s.Ctx, d, s2s.BE()) + } +} diff --git a/internal/service/provider/s2s/point_change_test.go b/internal/service/provider/s2s/point_change_test.go new file mode 100644 index 0000000..e63429a --- /dev/null +++ b/internal/service/provider/s2s/point_change_test.go @@ -0,0 +1,29 @@ +package s2s + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/finder" + "testing" + + _ "joybuywork/test" +) + +func TestPointsChange(t *testing.T) { + ctx := context.Background() + cpn, _ := finder.Campaign(ctx, "d2cqmqurdj7rva37jrm0") + + user, _ := cache.NewFissionUser(ctx, cpn.ID).FindBySubUserId("test123") + + change, err := NewPointsChange(ctx, cpn, user, 274848041419001856) + if err != nil { + t.Fatal(err) + return + } + + m := dao.FissionCoin + player, _ := m.WithContext(ctx).Where(m.UserID.Eq(user.ID)).First() + + t.Log(change.CoinDeduct(player, 100, 100)) +} diff --git a/internal/service/provider/s2s/points_change.go b/internal/service/provider/s2s/points_change.go new file mode 100644 index 0000000..770b1fe --- /dev/null +++ b/internal/service/provider/s2s/points_change.go @@ -0,0 +1,153 @@ +package s2s + +import ( + "context" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "fmt" + "time" + + "joybuywork/proto/go_proto/workerr" +) + +const ( + PointsChangeSuccess = "success" // 处理成功 + PointsChangeLack = "lack" // 余额不足扣除失败 +) + +type PointsChangeResp struct { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data *PointsChangeRespData `json:"data"` +} +type PointsChangeRespData struct { + State string `json:"state"` // 状态(success - 成功,lack - 缺乏) + RelateId string `json:"relate_id"` // 成功关联的唯一信息 +} + +type PointsChange struct { + S2S + + user *model.FissionUser + cpn *model.FissionCampaign + log *model.FissionPointsLog +} + +func NewPointsChange(ctx context.Context, cpn *model.FissionCampaign, user *model.FissionUser, urlId int64, opts ...Option) (*PointsChange, error) { + c := &PointsChange{ + user: user, + cpn: cpn, + } + + err := c.init(ctx, cpn.ProjectID, urlId, opts...) + if err != nil { + return nil, err + } + + return c, nil +} + +func (s *PointsChange) Deduct(num int32, source string, other mtype.PointsLogOther) (res *PointsChangeRespData, err error) { + return s.Change(num, mtype.FissionPointsLogStateDeduct, source, other) +} + +func (s *PointsChange) CoinGain(player *model.FissionCoin, num int32) (res *PointsChangeRespData, err error) { + return s.Change(num, mtype.FissionPointsLogStateGain, mtype.FissionPointsLogSourceCoin, mtype.PointsLogOther{ + PlayerId: player.ID, + SceneId: player.SceneID, + }) +} + +func (s *PointsChange) CoinDeduct(player *model.FissionCoin, num int32, deductId int64) (res *PointsChangeRespData, err error) { + return s.Change(num, mtype.FissionPointsLogStateDeduct, mtype.FissionPointsLogSourceCoin, mtype.PointsLogOther{ + PlayerId: player.ID, + SceneId: player.SceneID, + DeductId: deductId, + }) +} + +// Change 积分变更 +func (s *PointsChange) Change(num int32, state, source string, other mtype.PointsLogOther) (res *PointsChangeRespData, err error) { + var resp, errMsg string + var code int32 + defer func() { + s.after(code, resp, errMsg) + }() + + req := mtype.PointsLogReq{ + State: state, + Num: num, + UserId: s.user.SubUserID, + Source: source, + CampaignId: s.cpn.HashID, + Title: s.cpn.Title, + } + + switch state { + case mtype.FissionPointsLogStateGain: + req.GainId = fmt.Sprint(other.PlayerId) + case mtype.FissionPointsLogStateDeduct: + req.DeductId = fmt.Sprint(other.DeductId) + } + + s.before(source, req, other) + + body, _ := jsonm.Marshal(req) + resp, code, err = s.request(s.log.ID, body, s.user.LangMark, prefixToken, NewCertToken) + if err != nil { + errMsg = fmt.Sprintf("请求处理失败: %v", err) + err = workerr.S2SNotSuccessError + return + } + + var data = &PointsChangeResp{} + err = jsonm.StrUnmarshal(resp, data) + if err != nil || data.Data == nil { + errMsg = fmt.Sprintf("无法解析的返回数据: %v", err) + err = workerr.S2SUnableToParseError + return + } + + if data.Code != successCode { + errMsg = "code返回的非200,请确认业务是否正确对接" + if data.Msg != "" { + errMsg = fmt.Sprintf("code返回的非200, 提供的信息为: %s", data.Msg) + } + err = workerr.S2SNotSuccessError + return + } + + res = data.Data + + return +} + +func (s *PointsChange) before(source string, req mtype.PointsLogReq, other mtype.PointsLogOther) { + s.log = withdefault.FissionPointsLog(&model.FissionPointsLog{ + CampaignID: s.user.CampaignID, + UserID: s.user.ID, + State: req.State, + Num: req.Num, + Source: source, + ReqURL: s.GetUrl(), + }) + + s.log.SetReq(req) + s.log.SetOtherData(other) + _ = s.GetDao().FissionPointsLog.WithContext(s.Ctx).Create(s.log) + + s.start = time.Now() +} + +func (s *PointsChange) after(code int32, resp, errMsg string) { + s.log.RespCode = code + s.log.Resp = resp + s.log.ErrMsg = errMsg + s.log.Token = s.GetToken() + s.log.ReqHeader = s.GetHeader() + s.log.ReqTime = time.Since(s.start).Milliseconds() + + _ = s.GetDao().FissionPointsLog.WithContext(s.Ctx).Save(s.log) +} diff --git a/internal/service/provider/s2s/reward.go b/internal/service/provider/s2s/reward.go new file mode 100644 index 0000000..7bb5033 --- /dev/null +++ b/internal/service/provider/s2s/reward.go @@ -0,0 +1,312 @@ +package s2s + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "encoding/json" + "fmt" + "strings" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" +) + +type Reward struct { + S2S + reward *model.Reward + + log *model.RewardPushLog +} + +func NewReward(ctx context.Context, reward *model.Reward, opts ...Option) (*Reward, error) { + r := &Reward{ + reward: reward, + } + + err := r.init(ctx, reward.ProjectID, reward.URLID, opts...) + if err != nil { + return nil, err + } + + return r, nil +} + +func (s *Reward) CreatePush(source string, firstId, secondId, relateId int64, sync int8, param mtype.RewardPushParam) (push *model.RewardPush, err error) { + // 防止一些并发操作,导致同时推送到客户端 + lc := app.NewRedisLock(s.Ctx, ckey.FissionPushRewardOnce(source, firstId, secondId, relateId), lock.SetExpire(timeOut)) + defer lc.Release() + if !lc.SoftLock() { + return + } + + m := s.GetDao().RewardPush + push, err = m.WithContext(s.Ctx).Where( + m.RelateID.Eq(relateId), + m.FirstID.Eq(firstId), + m.Source.Eq(source), + m.SecondID.Eq(secondId), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if push == nil { + push = withdefault.RewardPush(&model.RewardPush{ + Source: source, + FirstID: firstId, + SecondID: secondId, + RelateID: relateId, + RewardID: s.reward.ID, + UserID: param.UserId, + Sync: sync, + }) + + push.SetParam(param) + + err = m.WithContext(s.Ctx).Create(push) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } else if push.GetParam() != param { + push.SetParam(param) + err = m.WithContext(s.Ctx).Save(push) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *Reward) Send(oldPush *model.RewardPush, sync bool) (push *model.RewardPush, err error) { + if oldPush.Status == mtype.RewardPushStatusOk { + return oldPush, nil + } + + // 防止一些并发操作,导致同时推送到客户端 + lc := app.NewRedisLock(s.Ctx, ckey.FissionPushRewardOnce(oldPush.Source, oldPush.FirstID, oldPush.SecondID, oldPush.RelateID), lock.SetExpire(timeOut)) + defer lc.Release() + if !lc.SoftLock() { + return + } + + push = oldPush + param := push.GetParam() + + langInfo, err := s._langInfo(param.Lang) + if err != nil { + return + } + + var kv = make(map[string]string, len(s.reward.GetJustKvData())) + for _, v := range s.reward.GetJustKvData() { + kv[v.Key] = v.Value + } + + var campaignHashId string + if param.CampaignId > 0 { + cpn, _ := cache.NewCampaign(s.Ctx).FindById(param.CampaignId) + campaignHashId = cpn.HashID + } + + var req = mtype.RewardPushLogReq{ + TaskId: push.ID, + UserId: param.UserId, + CampaignId: campaignHashId, + Source: push.Source, + RewardId: param.RelateHashId, + RewardTitle: langInfo.Title, + RewardNum: param.Num, + KvData: kv, + UserPid: param.ParentUserId, + Lang: param.Lang, + Title: param.Title, + UserPlatform: utils.SupportPlatform(param.UserPlatform), + ParentPlatform: utils.SupportPlatform(param.ParentUserPlatform), + RewardType: param.RewardType, + } + + switch push.Source { + case mtype.RewardPushSourceWall: + req.WallId = param.SourceHashId + case mtype.RewardPushSourceCenter: + req.CenterId = param.SourceHashId + } + + s.before(push.ID, req) + body, _ := json.Marshal(req) + var errMsg string + resp, code, err := s.request(s.log.ID, body, param.Lang, prefixToken, OldCertToken) + defer func() { + s.after(code, resp, errMsg) + }() + + push.PushNum++ + + if strings.HasPrefix(resp, "success") { + _, nd, _ := strings.Cut(resp, ":") + + push.Status = mtype.RewardPushStatusOk + push.RespData = nd + push.FailType = "" + push.FailMsg = "" + + err = s.GetDao().RewardPush.WithContext(s.Ctx).Save(push) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s._notify(push) + + return + } + + push.Status = mtype.RewardPushStatusFail + + if err != nil { + + val := fmt.Sprintf("%v", err) + + if strings.Contains(val, "missing port in address") { + push.FailType = mtype.RewardPushFailTypeCli + push.FailMsg = "回调地址无法正常访问" + } else { + push.FailType = mtype.RewardPushFailTypeSys + push.FailMsg = val + } + + } else if resp == "" { + + push.FailType = mtype.RewardPushFailTypeCli + push.FailMsg = "如果处理成功请返回字符串success,当前接收到的信息为空字符串,无法判断当前回调是否正确" + + } else if !strings.HasPrefix(resp, "success") { + + push.FailType = mtype.RewardPushFailTypeCli + push.FailMsg = fmt.Sprintf("返回无法识别值:%s", resp) + + } else { + + push.FailType = mtype.RewardPushFailTypeUndefined + push.FailMsg = "未知错误" + + } + + errMsg = push.FailMsg + err = nil + + if !sync && s._retry(push) { + m := s.GetDao().RewardPush + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(push.ID)).UpdateSimple(m.PushNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + err = s.GetDao().RewardPush.WithContext(s.Ctx).Save(push) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s._notify(push) + + return +} + +func (s *Reward) Async(push *model.RewardPush, delaySec int) { + task := withdefault.RewardPushTask(&model.RewardPushTask{ + DoTime: time.Now().Add(time.Duration(delaySec) * time.Second).Unix(), + PushID: push.ID, + }) + + _ = s.GetDao().RewardPushTask.WithContext(s.Ctx).Create(task) + producer.GlobalRewardPushPub(s.Ctx, delaySec, types.DelayCommonGlobalRewardPush{TaskId: task.ID}) +} + +func (s *Reward) _retry(push *model.RewardPush) (hasNext bool) { + //如果没有发送成功并且不是最后一次发送,就创建一个任务 + delaySec, hasDelay := delaySecMap[push.PushNum] + if !hasDelay { + return + } + + s.Async(push, delaySec) + + return true +} + +func (s *Reward) _langInfo(lang string) (langInfo *model.RewardLang, err error) { + m := s.GetDao().RewardLang + langInfo, err = m.WithContext(s.Ctx).Where(m.RewardID.Eq(s.reward.ID), m.Mark.Eq(lang), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if langInfo != nil { + return + } + + langInfo, err = m.WithContext(s.Ctx).Where(m.RewardID.Eq(s.reward.ID), m.IsDefault.Eq(mtype.Yes), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Reward) before(pushId string, req mtype.RewardPushLogReq) { + s.log = withdefault.RewardPushLog(&model.RewardPushLog{ + PushID: pushId, + ReqURL: s.GetUrl(), + }) + + s.log.SetReq(req) + + _ = s.GetDao().RewardPushLog.WithContext(s.Ctx).Create(s.log) + s.start = time.Now() +} + +func (s *Reward) after(code int32, resp, errMsg string) { + s.log.RespCode = code + s.log.Resp = resp + s.log.ErrMsg = errMsg + s.log.Token = s.GetToken() + s.log.ReqHeader = s.GetHeader() + s.log.ReqTime = time.Since(s.start).Milliseconds() + + _ = s.GetDao().RewardPushLog.WithContext(s.Ctx).Save(s.log) +} + +func (s *Reward) _notify(push *model.RewardPush) { + producer.NewDeepworkNotify(s.Ctx).RewardPushStatus(types.DnRewardPushStatus{ + Source: push.Source, + SourceId: push.FirstID, + SourceSecondId: push.SecondID, + RelateId: push.RelateID, + TaskId: push.ID, + Status: int32(push.Status), + FailType: push.FailType, + FailMsg: push.FailMsg, + RewardVal: push.RespData, + RewardType: push.GetParam().RewardType, + }) +} diff --git a/internal/service/provider/s2s/s2s.go b/internal/service/provider/s2s/s2s.go new file mode 100644 index 0000000..14c0f2b --- /dev/null +++ b/internal/service/provider/s2s/s2s.go @@ -0,0 +1,169 @@ +package s2s + +import ( + "bytes" + "context" + "joybuywork/internal/config" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "fmt" + "io" + "net/http" + "net/url" + "time" + + "github.com/valyala/fasthttp" +) + +var delaySecMap = map[int32]int{ + 0: 15, 1: 15, + 2: 30, + 3: 180, + 4: 600, + 5: 1200, + 6: 1800, 7: 1800, 8: 1800, + 9: 3600, + 10: 3600 * 3, 11: 3600 * 3, 12: 3600 * 3, + 13: 3600 * 6, 14: 3600 * 6, +} + +const ( + successCode = 200 +) + +const ( + OldCertToken = iota + NewCertToken +) + +const ( + prefixToken = "Token" + prefixBearer = "Bearer" +) + +const ( + timeOut = 10 * time.Second +) + +const ( + ContentTypeJson = "application/json" +) + +type S2S struct { + logic.Context + url *model.NotifyURL + project *model.Project + + tokenStr string + + header http.Header + + start time.Time +} + +func (s *S2S) init(ctx context.Context, ProjectId, UrlId int64, opts ...Option) (err error) { + s.Context.Init(ctx, dao.Q, merr.NewBE(ctx)) + + for _, opt := range opts { + opt(s) + } + + s.url, err = cache.NewNotifyURL(ctx).FindById(UrlId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.project, err = cache.NewProject(ctx).FindById(ProjectId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +func (s *S2S) request(id int64, body []byte, lang, prefix string, certToken int8) (respBody string, code int32, err error) { + cli := &http.Client{ + Timeout: timeOut, + } + + // 走代理 + if s.project.PushLadder == mtype.Yes { + var proxyURL *url.URL + proxyURL, err = url.Parse(config.Config.Server.LadderHost) + if err != nil { + err = s.BE().VerifyError(fmt.Sprintf("无法解析代理 URL: %v", err)) + return + } + cli.Transport = &http.Transport{ + Proxy: http.ProxyURL(proxyURL), + } + } + + // 创建请求 + req, err := http.NewRequest("POST", s.url.URL, bytes.NewBuffer(body)) + if err != nil { + err = s.BE().VerifyError(fmt.Sprintf("创建请求失败: %v", err)) + return + } + + req.Header.Set(fasthttp.HeaderContentType, ContentTypeJson) + req.Header.Set("X-Message-Id", fmt.Sprint(id)) + req.Header.Set("X-Lang", lang) + req.Header.Set(fasthttp.HeaderAuthorization, fmt.Sprintf("%s %s", prefix, s.token(body, certToken))) + + for _, h := range s.url.GetHeaders() { + switch h.Mark { + case mtype.NotifyUrlHeaderMarkLang: + req.Header.Set(h.Key, lang) + default: + req.Header.Set(h.Key, h.Val) + } + } + + s.header = req.Header.Clone() + + // 发送请求 + resp, err := cli.Do(req) + if err != nil { + err = s.BE().VerifyError(fmt.Sprintf("请求失败: %v", err)) + return + } + defer resp.Body.Close() + + // 可以通过 resp.Body 获取响应内容 + data, _ := io.ReadAll(resp.Body) + + return string(data), int32(resp.StatusCode), nil +} + +func (s *S2S) token(body []byte, certToken int8) string { + switch certToken { + case OldCertToken: + s.tokenStr = s.project.NotifyToken + default: + s.tokenStr = utils.Md5String(s.project.ThirdSecret + " " + utils.Md5(body)) + } + + return s.tokenStr +} + +func (s *S2S) GetUrl() string { + return s.url.URL +} + +func (s *S2S) GetToken() string { + return s.tokenStr +} + +func (s *S2S) GetHeader() (header string) { + header, _ = jsonm.MarshalToString(s.header) + return +} diff --git a/internal/service/provider/s2s/user_coin_change.go b/internal/service/provider/s2s/user_coin_change.go new file mode 100644 index 0000000..8dceda8 --- /dev/null +++ b/internal/service/provider/s2s/user_coin_change.go @@ -0,0 +1,122 @@ +package s2s + +import ( + "context" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "fmt" + "time" + + "joybuywork/proto/go_proto/workerr" +) + +type UserCoinChange struct { + S2S + + user *model.ProjectUser + log *model.ProjectUserCoinLog +} + +func NewUserCoinChange(ctx context.Context, user *model.ProjectUser, urlId int64, opts ...Option) (*UserCoinChange, error) { + c := &UserCoinChange{ + user: user, + } + + err := c.init(ctx, user.ProjectID, urlId, opts...) + if err != nil { + return nil, err + } + + return c, nil +} + +func (s *UserCoinChange) CenterExchange(num int32, deductId, mallItemId, centerId int64, title, centerHashId, langMark string) (res *PointsChangeRespData, err error) { + return s.Change(num, mtype.ProjectUserCoinLogStateDeduct, mtype.ProjectUserCoinLogSourceCenterExchange, centerId, centerHashId, title, langMark, mtype.PointsLogOther{ + MallItemId: mallItemId, + DeductId: deductId, + }) +} + +// Change 积分变更 +func (s *UserCoinChange) Change(num int32, state, source string, sourceId int64, reqHashId, title, langMark string, other mtype.PointsLogOther) (res *PointsChangeRespData, err error) { + var resp, errMsg string + var code int32 + defer func() { + s.after(code, resp, errMsg) + }() + + req := mtype.PointsLogReq{ + State: state, + Num: num, + UserId: s.user.UserID, + Source: source, + CampaignId: reqHashId, + Title: title, + } + + switch state { + case mtype.ProjectUserCoinLogStateDeduct: + req.DeductId = fmt.Sprint(other.DeductId) + } + + s.before(source, sourceId, req, other) + + body, _ := jsonm.Marshal(req) + resp, code, err = s.request(s.log.ID, body, langMark, prefixToken, NewCertToken) + if err != nil { + errMsg = fmt.Sprintf("请求处理失败: %v", err) + err = workerr.S2SNotSuccessError + return + } + + var data = &PointsChangeResp{} + err = jsonm.StrUnmarshal(resp, data) + if err != nil || data.Data == nil { + errMsg = fmt.Sprintf("无法解析的返回数据: %v", err) + err = workerr.S2SUnableToParseError + return + } + + if data.Code != successCode { + errMsg = "code返回的非200,请确认业务是否正确对接" + if data.Msg != "" { + errMsg = fmt.Sprintf("code返回的非200, 提供的信息为: %s", data.Msg) + } + err = workerr.S2SNotSuccessError + return + } + + res = data.Data + + return +} + +func (s *UserCoinChange) before(source string, sourceId int64, req mtype.PointsLogReq, other mtype.PointsLogOther) { + s.log = withdefault.ProjectUserCoinLog(&model.ProjectUserCoinLog{ + ProjectID: s.user.ProjectID, + UserID: s.user.ID, + Source: source, + SourceID: sourceId, + ReqURL: s.GetUrl(), + Num: req.Num, + }) + + s.log.SetReq(req) + s.log.SetOtherData(other) + _ = s.GetDao().ProjectUserCoinLog.WithContext(s.Ctx).Create(s.log) + + s.start = time.Now() +} + +func (s *UserCoinChange) after(code int32, resp, errMsg string) { + s.log.RespCode = code + s.log.Resp = resp + s.log.ErrMsg = errMsg + s.log.Token = s.GetToken() + s.log.ReqHeader = s.GetHeader() + s.log.ReqTime = time.Since(s.start).Milliseconds() + + _ = s.GetDao().ProjectUserCoinLog.WithContext(s.Ctx).Save(s.log) +} diff --git a/internal/service/provider/s2s/user_info.go b/internal/service/provider/s2s/user_info.go new file mode 100644 index 0000000..7804a6a --- /dev/null +++ b/internal/service/provider/s2s/user_info.go @@ -0,0 +1,109 @@ +package s2s + +import ( + "context" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" +) + +type UserInfoResp struct { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data *UserInfoRespData `json:"data"` +} +type UserInfoRespData struct { + CoinNum int64 `json:"coin_num"` +} + +type UserInfo struct { + S2S + + user *model.ProjectUser + log *model.ProjectUserInfoLog +} + +func NewUserInfo(ctx context.Context, user *model.ProjectUser, urlId int64, opts ...Option) (*UserInfo, error) { + c := &UserInfo{ + user: user, + } + + err := c.init(ctx, user.ProjectID, urlId, opts...) + if err != nil { + return nil, err + } + + return c, nil +} + +// UserInfo 获取用户信息 +func (s *UserInfo) UserInfo(langMark string) (res *UserInfoRespData, err error) { + var resp, errMsg string + var code int32 + defer func() { + s.after(code, resp, errMsg) + }() + + req := mtype.ProjectUserInfoReq{ + UserId: s.user.UserID, + } + + s.before(req) + + body, _ := jsonm.Marshal(req) + resp, code, err = s.request(s.log.ID, body, langMark, prefixBearer, NewCertToken) + if err != nil { + errMsg = fmt.Sprintf("请求处理失败: %v", err) + err = workerr.S2SNotSuccessError + return + } + + var data = &UserInfoResp{} + err = jsonm.StrUnmarshal(resp, data) + if err != nil || data.Data == nil { + errMsg = fmt.Sprintf("无法解析的返回数据: %v", err) + err = workerr.S2SUnableToParseError + return + } + + if data.Code != successCode { + errMsg = "code返回的非200,请确认业务是否正确对接" + if data.Msg != "" { + errMsg = fmt.Sprintf("code返回的非200, 提供的信息为: %s", data.Msg) + } + err = workerr.S2SNotSuccessError + return + } + + res = data.Data + + return +} + +func (s *UserInfo) before(req mtype.ProjectUserInfoReq) { + s.log = withdefault.ProjectUserInfoLog(&model.ProjectUserInfoLog{ + ProjectID: s.user.ProjectID, + UserID: s.user.ID, + ReqURL: s.GetUrl(), + }) + + s.log.SetReq(req) + _ = s.GetDao().ProjectUserInfoLog.WithContext(s.Ctx).Create(s.log) + + s.start = time.Now() +} + +func (s *UserInfo) after(code int32, resp, errMsg string) { + s.log.RespCode = code + s.log.Resp = resp + s.log.ErrMsg = errMsg + s.log.Token = s.GetToken() + s.log.ReqHeader = s.GetHeader() + s.log.ReqTime = time.Since(s.start).Milliseconds() + + _ = s.GetDao().ProjectUserInfoLog.WithContext(s.Ctx).Save(s.log) +} diff --git a/internal/service/provider/stocks/c_test.go b/internal/service/provider/stocks/c_test.go new file mode 100644 index 0000000..cc12374 --- /dev/null +++ b/internal/service/provider/stocks/c_test.go @@ -0,0 +1,16 @@ +package stocks + +import ( + "context" + "testing" + + _ "joybuywork/test" +) + +func TestNewSelect(t *testing.T) { + ctx := context.Background() + stock, _ := NewCampaignRewardSelect(ctx) + + stock.DecrPoolAndAdd(249919123207720960, 1) + +} diff --git a/internal/service/provider/stocks/campaign.go b/internal/service/provider/stocks/campaign.go new file mode 100644 index 0000000..8bf50c6 --- /dev/null +++ b/internal/service/provider/stocks/campaign.go @@ -0,0 +1,41 @@ +package stocks + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/provider/cachecurd" +) + +type CampaignParam struct { + CpnId int64 + RewardLimit int64 +} + +// Campaign 活动总预算的库存 +type Campaign struct { + stocks +} + +func NewCampaign(ctx context.Context, cpnIds ...int64) (stock *Campaign, err error) { + stock = &Campaign{} + + err = stock.Init(ctx, stock, cpnIds) + if err != nil { + return + } + + return +} + +func (s *Campaign) Key(cpnId int64) string { + return ckey.FissionCampaignPool(cpnId) +} + +func (s *Campaign) BuildStock(cpnId int64) (*cachecurd.HMap, error) { + return cachecurd.NewHMap(s.Ctx, s.Key(cpnId), cachecurd.SetCampaignStock(cpnId), cachecurd.SetHMapExp(consts.TimeDay)) +} + +func (s *Campaign) Clear() { + NewCleaner(s.Ctx, s.ids...).ClearCampaign() +} diff --git a/internal/service/provider/stocks/campaign_reward.go b/internal/service/provider/stocks/campaign_reward.go new file mode 100644 index 0000000..bc74922 --- /dev/null +++ b/internal/service/provider/stocks/campaign_reward.go @@ -0,0 +1,36 @@ +package stocks + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/provider/cachecurd" +) + +// CampaignReward 活动奖品发放库存 +type CampaignReward struct { + stocks +} + +func NewCampaignReward(ctx context.Context, rewardIds ...int64) (stock *CampaignReward, err error) { + stock = &CampaignReward{} + + err = stock.Init(ctx, stock, rewardIds) + if err != nil { + return + } + + return +} + +func (s *CampaignReward) Key(rewardId int64) string { + return ckey.FissionCampaignRewardStock(rewardId) +} + +func (s *CampaignReward) BuildStock(rewardId int64) (*cachecurd.HMap, error) { + return cachecurd.NewHMap(s.Ctx, s.Key(rewardId), cachecurd.SetCampaignRewardStock(rewardId), cachecurd.SetHMapExp(consts.TimeDay)) +} + +func (s *CampaignReward) Clear() { + NewCleaner(s.Ctx, s.ids...).ClearReward() +} diff --git a/internal/service/provider/stocks/campaign_reward_select.go b/internal/service/provider/stocks/campaign_reward_select.go new file mode 100644 index 0000000..448dae4 --- /dev/null +++ b/internal/service/provider/stocks/campaign_reward_select.go @@ -0,0 +1,36 @@ +package stocks + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/provider/cachecurd" +) + +// CampaignRewardSelect 活动奖品库存 +type CampaignRewardSelect struct { + stocks +} + +func NewCampaignRewardSelect(ctx context.Context, rewardIds ...int64) (stock *CampaignRewardSelect, err error) { + stock = &CampaignRewardSelect{} + + err = stock.Init(ctx, stock, rewardIds) + if err != nil { + return + } + + return +} + +func (s *CampaignRewardSelect) Key(rewardId int64) string { + return ckey.FissionCampaignRewardSelectStock(rewardId) +} + +func (s *CampaignRewardSelect) BuildStock(rewardId int64) (*cachecurd.HMap, error) { + return cachecurd.NewHMap(s.Ctx, s.Key(rewardId), cachecurd.SetRewardSelectStock(rewardId), cachecurd.SetHMapExp(consts.TimeDay)) +} + +func (s *CampaignRewardSelect) Clear() { + NewCleaner(s.Ctx, s.ids...).ClearAllReward() +} diff --git a/internal/service/provider/stocks/cleaner.go b/internal/service/provider/stocks/cleaner.go new file mode 100644 index 0000000..42b51b7 --- /dev/null +++ b/internal/service/provider/stocks/cleaner.go @@ -0,0 +1,73 @@ +package stocks + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" +) + +type Cleaner struct { + ctx context.Context + ids []int64 +} + +func NewCleaner(ctx context.Context, ids ...int64) Cleaner { + return Cleaner{ + ctx: ctx, + ids: ids, + } +} + +// ClearCampaign 清空活动总预算库存 +func (s Cleaner) ClearCampaign() { + if len(s.ids) == 0 { + return + } + var keys = make([]string, 0, len(s.ids)) + for _, cpnId := range s.ids { + keys = append(keys, ckey.FissionCampaignPool(cpnId)) + } + app.Redis.Cache.Del(s.ctx, keys...) +} + +// ClearReward 清空奖品库存 +func (s Cleaner) ClearReward() { + if len(s.ids) == 0 { + return + } + var keys = make([]string, 0, len(s.ids)) + for _, rewardId := range s.ids { + keys = append(keys, ckey.FissionCampaignRewardStock(rewardId)) + } + app.Redis.Cache.Del(s.ctx, keys...) +} + +// ClearRewardSelect 清空奖品选择 +func (s Cleaner) ClearRewardSelect() { + if len(s.ids) == 0 { + return + } + var keys = make([]string, 0, len(s.ids)) + for _, rewardId := range s.ids { + keys = append(keys, ckey.FissionCampaignRewardSelectStock(rewardId)) + } + app.Redis.Cache.Del(s.ctx, keys...) +} + +// ClearItem 清空奖品库存 +func (s Cleaner) ClearItem() { + if len(s.ids) == 0 { + return + } + var keys = make([]string, 0, len(s.ids)) + for _, rewardId := range s.ids { + keys = append(keys, ckey.MallItemStock(rewardId)) + } + app.Redis.Cache.Del(s.ctx, keys...) +} + +// ClearAllReward 清空所有奖品相关的库存 +func (s Cleaner) ClearAllReward() { + s.ClearRewardSelect() + s.ClearReward() +} diff --git a/internal/service/provider/stocks/mall_reward.go b/internal/service/provider/stocks/mall_reward.go new file mode 100644 index 0000000..6fb6506 --- /dev/null +++ b/internal/service/provider/stocks/mall_reward.go @@ -0,0 +1,36 @@ +package stocks + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/provider/cachecurd" +) + +// MallItem 活动奖品发放库存 +type MallItem struct { + stocks +} + +func NewMallItem(ctx context.Context, rewardIds ...int64) (stock *MallItem, err error) { + stock = &MallItem{} + + err = stock.Init(ctx, stock, rewardIds) + if err != nil { + return + } + + return +} + +func (s *MallItem) Key(rewardId int64) string { + return ckey.MallItemStock(rewardId) +} + +func (s *MallItem) BuildStock(rewardId int64) (*cachecurd.HMap, error) { + return cachecurd.NewHMap(s.Ctx, s.Key(rewardId), cachecurd.SetMallItemStock(rewardId), cachecurd.SetHMapExp(consts.TimeDay)) +} + +func (s *MallItem) Clear() { + NewCleaner(s.Ctx, s.ids...).ClearItem() +} diff --git a/internal/service/provider/stocks/stocks.go b/internal/service/provider/stocks/stocks.go new file mode 100644 index 0000000..ff3198e --- /dev/null +++ b/internal/service/provider/stocks/stocks.go @@ -0,0 +1,161 @@ +package stocks + +import ( + "context" + "joybuywork/internal/repository/dao" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/merr" + "strconv" +) + +type IStock interface { + Key(id int64) string // 缓存key + BuildStock(id int64) (*cachecurd.HMap, error) // 构建库存缓存 +} + +type stocks struct { + logic.Context + ids []int64 + stockMap map[int64]*cachecurd.HMap + + im IStock +} + +func (s *stocks) Init(ctx context.Context, im IStock, ids []int64) (err error) { + s.Context.Init(ctx, dao.Q, merr.NewBE(ctx)) + s.ids = ids + s.stockMap = make(map[int64]*cachecurd.HMap, len(ids)) + s.im = im + for _, id := range ids { + s.stockMap[id], err = im.BuildStock(id) + if err != nil { + return + } + } + + return +} + +// Total 奖品总库存 +func (s *stocks) Total(id int64) (num int64, err error) { + return s.getField(id, cachecurd.StockFieldStock) +} + +// GetUseStock 获取奖品已使用库存数量 +func (s *stocks) GetUseStock(id int64) (num int64, err error) { + return s.getField(id, cachecurd.StockFieldUseStock) +} + +// AddUseStock 添加库存使用量 +func (s *stocks) AddUseStock(total int64, ids ...int64) (err error) { + if len(ids) == 0 { + ids = s.ids + } + + for _, id := range ids { + stock, ok := s.stockMap[id] + if !ok { + continue + } + _, err = stock.Incr(cachecurd.StockFieldUseStock, total) + if err != nil { + return + } + } + + return +} + +// AllUseStock 奖品集合已使用库存数量 +func (s *stocks) AllUseStock(ids ...int64) (data map[int64]int64, err error) { + if len(ids) == 0 { + ids = s.ids + } + + data = make(map[int64]int64, len(ids)) + for _, id := range ids { + data[id], err = s.GetUseStock(id) + if err != nil { + return + } + } + + return +} + +// ClearUseStock 清空缓存 +func (s *stocks) ClearUseStock(ids ...int64) (err error) { + clearIds := s.ids + if len(ids) > 0 { + clearIds = ids + } + + for _, id := range clearIds { + stock, ok := s.stockMap[id] + if !ok { + continue + } + err = stock.Clear() + if err != nil { + return + } + } + + return +} + +// DecrPoolAndAdd 扣除奖品池成功增加库存使用 +func (s *stocks) DecrPoolAndAdd(id, val int64) (ok bool, err error) { + stock, err := s.getAndSet(id) + if err != nil { + return + } + num, err := stock.Incr(cachecurd.StockFieldPoolNum, -val) + if err != nil { + return + } + if num < 0 { + return + } + + err = s.AddUseStock(val, id) + if err != nil { + return + } + + return true, nil +} + +// 获取缓存,没有就设置 +func (s *stocks) getAndSet(id int64) (stock *cachecurd.HMap, err error) { + stock, ok := s.stockMap[id] + if ok { + return + } + + stock, err = s.im.BuildStock(id) + if err != nil { + return + } + + s.stockMap[id] = stock + s.ids = append(s.ids, id) + + return +} + +// 获取库存缓存的某个字段 +func (s *stocks) getField(id int64, field string) (total int64, err error) { + stock, err := s.getAndSet(id) + if err != nil { + return + } + + val, err := stock.Get(field) + if err != nil { + return + } + + return strconv.ParseInt(val, 10, 64) +} diff --git a/internal/service/provider/traces/fn_timer.go b/internal/service/provider/traces/fn_timer.go new file mode 100644 index 0000000..9c2c336 --- /dev/null +++ b/internal/service/provider/traces/fn_timer.go @@ -0,0 +1,58 @@ +package traces + +import ( + "context" + "joybuywork/internal/app" + "fmt" + "time" +) + +type FnTimer struct { + *FnTimers + name string + start time.Time +} + +func (ft FnTimer) Stop() { + if ft.FnTimers == nil { + return + } + elapsed := time.Since(ft.start) + ft.content = append(ft.content, fmt.Sprintf("[函数耗时] %s: %s\n", ft.name, elapsed)) +} + +type FnTimers struct { + ctx context.Context + content []string +} + +func NewFnTimers(ctx context.Context) *FnTimers { + return &FnTimers{ + ctx: ctx, + } +} + +func (s *FnTimers) Trace(name string) (ft FnTimer) { + if s == nil { + return + } + + return FnTimer{ + FnTimers: s, + name: name, + start: time.Now(), + } +} + +func (s *FnTimers) Push() { + if s == nil { + return + } + + var str string + for _, t := range s.content { + str += t + "\n" + } + + app.FeishuNormalSend(str) +} diff --git a/internal/service/queue/consumer/action.go b/internal/service/queue/consumer/action.go new file mode 100644 index 0000000..be72574 --- /dev/null +++ b/internal/service/queue/consumer/action.go @@ -0,0 +1,69 @@ +package consumer + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/plugins/printer" + "joybuywork/internal/utils" + "fmt" + "time" + + "github.com/Shopify/sarama" + "github.com/rs/xid" +) + +type Do func(ctx *Ctx) error + +type Ctx struct { + ctx context.Context + name string + message *sarama.ConsumerMessage + do Do +} + +func NewCtx(name string, message *sarama.ConsumerMessage, do Do) *Ctx { + ctx := context.WithValue(context.Background(), consts.CtxMsgId, xid.New().String()) + for _, header := range message.Headers { + ctx = context.WithValue(ctx, utils.Bs(header.Key), utils.Bs(header.Value)) + } + + return &Ctx{ + ctx: ctx, + name: name, + message: message, + do: do, + } +} + +func (s *Ctx) Done() { + if s == nil { + return + } + + req := utils.Bs(s.message.Value) + defer app.TryCatch(s.ctx, fmt.Sprintf("执行任务[%s]失败,数据: %s", s.name, req)) + + var err error + tn := time.Now() + sl := printer.NewSlowLog(s.ctx, printer.SetSlow(printer.TenNormalSlow)) + app.Collect(s.name) + sl.Start(fmt.Sprintf("运行[%s], 执行间隔:%12v, 数据:%s", s.name, time.Since(s.message.Timestamp), req)) + defer func() { + sl.End(fmt.Sprintf("执行时长:%12v, 运行错误:%v", time.Since(tn), err), err, s.name, req, "") + }() + + err = s.do(&Ctx{ + ctx: s.ctx, + message: s.message, + }) +} + +func (s *Ctx) Parse(data any) error { + return jsonm.Unmarshal(s.message.Value, data) +} + +func (s *Ctx) Context() context.Context { + return s.ctx +} diff --git a/internal/service/queue/consumer/campaignnotice/behavior.go b/internal/service/queue/consumer/campaignnotice/behavior.go new file mode 100644 index 0000000..be9dbf9 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/behavior.go @@ -0,0 +1,156 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "time" +) + +type Behavior struct { + logic.Logic + + Req *types.CampaignBehavior +} + +func (s *Behavior) Exec() (err error) { + var mark string + var first bool + switch s.Req.BehaviorType { + case mtype.FissionBehaviorTypeView, mtype.FissionBehaviorTypeClickPlay, mtype.FissionBehaviorTypeClickShare, + mtype.FissionBehaviorTypeViewDownload, mtype.FissionBehaviorTypeClickDownload, mtype.FissionBehaviorTypeViewWechat, + mtype.FissionBehaviorTypeAppInstall, mtype.FissionBehaviorTypeAppOpen, mtype.FissionBehaviorTypeViewDownloadByWx, + mtype.FissionBehaviorTypeAppRegister, mtype.FissionBehaviorTypeCustom, mtype.FissionBehaviorTypeFinishTask, + mtype.FissionBehaviorTypeViewHot, mtype.FissionBehaviorTypeViewWeb, mtype.FissionBehaviorTypeSign, + mtype.FissionBehaviorTypeSignTarget, mtype.FissionBehaviorTypeSignCard, + mtype.FissionBehaviorTypeGrow, mtype.FissionBehaviorTypeGrowOk: + mark = mtype.BehaviorTypeToMark[s.Req.BehaviorType] + case mtype.FissionBehaviorTypeFinishCond, mtype.FissionBehaviorTypeClickMedia, + mtype.FissionBehaviorTypeChannelInstall, mtype.FissionBehaviorTypeChannelView, mtype.FissionBehaviorTypeChannelOpen, + mtype.FissionBehaviorTypeClickIcon, mtype.FissionBehaviorTypeRewardApp, mtype.FissionBehaviorTypeRewardWeb: + mark = utils.BehaviorFormatMark(s.Req.BehaviorType, s.Req.MarkId) + } + + if mark == "" { + return + } + + // 是否是第一次行为 + first, err = s.firstBehavior(mark) + if err != nil { + return + } + + // 记录缓存统计 + s.stat() + + // 创建行为记录 + err = s.create(mark) + if err != nil { + return + } + + return provider.NewFissionBehaviorTotal(s.Ctx, s.Req.CampaignId).FissionTotalAdd(1, s.Req.BehaviorType, mark, first) +} + +// 创建一个行为记录 +func (s *Behavior) create(mark string) (err error) { + + b := withdefault.FissionBehavior(&model.FissionBehavior{ + BehaviorType: s.Req.BehaviorType, + BehaviorTime: s.Req.BehaviorTime, + CampaignID: s.Req.CampaignId, + UserMark: s.Req.UserMark, + Mark: mark, + }) + + b.OtherData, _ = jsonm.MarshalToString(s.Req.OtherData) + + m := s.GetDao().FissionBehavior + err = m.WithContext(s.Ctx).Create(b) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 用户新行为 +func (s *Behavior) firstBehavior(mark string) (yes bool, err error) { + key := ckey.FissionUserFirstBehavior(s.Req.CampaignId, s.Req.UserMark, mark) + defer func() { + if err != nil { + return + } + + app.Redis.Cache.Expire(s.Ctx, key, 2*time.Hour) + }() + + exist, err := app.Redis.Exists(s.Ctx, key) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if exist { + return + } + + first, err := app.Redis.Cache.SetNX(s.Ctx, key, 1, 2*time.Hour).Result() + if err != nil { + err = s.BE().CacheError(err) + return + } + + if !first { + return + } + + m := s.GetDao().FissionBehavior + info, err := m.WithContext(s.Ctx). + Select(m.CampaignID, m.Mark, m.UserMark). + Where(m.CampaignID.Eq(s.Req.CampaignId), m.Mark.Eq(mark), m.UserMark.Eq(s.Req.UserMark)). + Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if info != nil { + return + } + + return first, nil +} + +// 做展示的纬度即时统计,保证为归档的数据实时展示 +func (s *Behavior) stat() { + var mark string + switch s.Req.BehaviorType { + case mtype.FissionBehaviorTypeView, mtype.FissionBehaviorTypeClickPlay, mtype.FissionBehaviorTypeClickShare, + mtype.FissionBehaviorTypeViewDownload, mtype.FissionBehaviorTypeClickDownload, mtype.FissionBehaviorTypeViewWechat, + mtype.FissionBehaviorTypeAppInstall, mtype.FissionBehaviorTypeViewDownloadByWx, mtype.FissionBehaviorTypeAppRegister, + mtype.FissionBehaviorTypeFinishTask, mtype.FissionBehaviorTypeSign, mtype.FissionBehaviorTypeSignTarget, + mtype.FissionBehaviorTypeGrow: + mark = mtype.BehaviorTypeToMark[s.Req.BehaviorType] + case mtype.FissionBehaviorTypeFinishCond, mtype.FissionBehaviorTypeRewardApp: + mark = utils.BehaviorFormatMark(s.Req.BehaviorType, s.Req.MarkId) + } + + if mark == "" { + return + } + + fbt := provider.NewFissionBehaviorTotal(s.Ctx, s.Req.CampaignId) + + fbt.StatHour(mark, s.Req.BehaviorTime, s.Req.UserMark) + fbt.StatDay(mark, s.Req.BehaviorTime, s.Req.UserMark) +} diff --git a/internal/service/queue/consumer/campaignnotice/child_invite.go b/internal/service/queue/consumer/campaignnotice/child_invite.go new file mode 100644 index 0000000..5ab7f0a --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/child_invite.go @@ -0,0 +1,151 @@ +package campaignnotice + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "time" +) + +type ChildInvite struct { + logic.Logic + + Req *types.CampaignChildInvite +} + +func (s *ChildInvite) Exec() (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn.Status != mtype.FissionCampaignStatusCancel { + return + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Order(m.Step).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + l := len(list) + + var rankNum int64 + switch l { + case 7: + rankNum = 10000 + case 6: + rankNum = 100 + case 5: + rankNum = 10 + default: + rankNum = int64(l) + } + + ranker, err := cachecurd.NewRanker(s.Ctx, ckey.FissionChildRank(cpn.ID), cachecurd.SetChildBuild(cpn.ID, cpn.ChildType)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + ranks, err := ranker.GetRank(rankNum) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if len(ranks) == 0 { + return + } + + pcpn, err := cache.NewCampaign(s.Ctx).FindById(cpn.Pid) + if err != nil { + err = s.BE().CacheError(err) + return + } + + childUserCache := cache.NewFissionChildUser(s.Ctx) + childUserM := s.GetDao().FissionChildUser + for i, rank := range ranks { + var idx = -1 + user, _ := cache.NewFissionUser(s.Ctx, cpn.Pid).FindById(utils.StrToInt64(rank.UserId)) + if i < 4 { + idx = i + } else if i < 10 { + idx = 4 + } else if i < 100 { + idx = 5 + } else if i < 10000 { + idx = 6 + } + + if idx == -1 { + return + } + + player, _ := childUserCache.FindByUniqIdx(user.ID, cpn.ID) + if player == nil || player.RecordID > 0 { + continue + } + + reward := list[idx] + var record *model.FissionRewardRecord + record, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).One(reward, true, award.RewardRecordChildId(player.CampaignID)) + if err != nil { + return + } + + _, err = childUserM.WithContext(s.Ctx). + Where(childUserM.ID.Eq(player.ID)). + UpdateSimple( + childUserM.LastDone.Value(time.Now().Unix()), + childUserM.RewardID.Value(record.RewardID), + childUserM.RecordID.Value(record.ID), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.GetDao().FissionChildUserRecord.WithContext(s.Ctx).Create(withdefault.FissionChildUserRecord(&model.FissionChildUserRecord{ + PCpnID: player.PCpnID, + CampaignID: player.CampaignID, + UserID: player.UserID, + PlayerID: player.ID, + ChildType: player.ChildType, + Mark: mtype.FissionChildUserRecordSourceInvite, + RecordID: record.ID, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = childUserCache.Clear(player) + + if reward.PropMark == mtype.FissionCampaignRewardPropMarkReward { + continue + } + + switch pcpn.FissionID { + case consts.IdKeep: + keepDog, _ := players.NewKeepDog(s.Ctx, user) + _ = keepDog.ChildActive(reward.RewardNum, mtype.FissionCampaignChildTypeInvite) + } + + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/cond_stat.go b/internal/service/queue/consumer/campaignnotice/cond_stat.go new file mode 100644 index 0000000..97fd9bf --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/cond_stat.go @@ -0,0 +1,72 @@ +package campaignnotice + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "fmt" + "gorm.io/gen/field" +) + +type CondStat struct { + logic.Logic + + Req *types.CampaignCondStat +} + +func (s *CondStat) Exec() (err error) { + return s.stat() +} + +func (s *CondStat) stat() (err error) { + m := s.GetDao().FissionCampaignCond + cond, err := m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.CondId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if cond == nil { + return + } + + var upData = []field.AssignExpr{ + m.Num.Add(1), + m.Total.Add(s.Req.Total), + } + + if s.Req.First { + upData = append(upData, m.UserNum.Add(1)) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(cond.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cond.CampaignID, + BehaviorType: mtype.FissionBehaviorTypeFinishCond, + BehaviorTime: s.Req.BehaviorTime, + UserMark: fmt.Sprint(s.Req.UserId), + OtherData: map[string]float64{"total": s.Req.Total}, + MarkId: fmt.Sprint(cond.ID), + }) + + cpn, err := cache.NewCampaign(s.Ctx).FindById(cond.CampaignID) + if err != nil { + return + } + + if cpn.ReportType == mtype.FissionCampaignReportTypeNew { + user, _ := cache.NewFissionUser(s.Ctx, cond.CampaignID).FindById(s.Req.UserId) + fissionaction.NewMarkPoint(s.Ctx).InApp(user).FinishCond(s.Req.BehaviorTime, cond.ID, s.Req.Total, s.Req.Event, s.Req.EventData) + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/consume.go b/internal/service/queue/consumer/campaignnotice/consume.go new file mode 100644 index 0000000..0d5aad7 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/consume.go @@ -0,0 +1,385 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/queue/consumer" + "joybuywork/internal/service/queue/consumer/campaignnotice/export" + "joybuywork/internal/service/queue/consumer/campaignnotice/validevents" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "errors" + + "github.com/Shopify/sarama" + "gits.branchcn.com/backend/microcode/plugins/derivative/task" + "gits.branchcn.com/backend/microcode/plugins/kafka" +) + +func Run() (err error) { + c, err := consumer.NewConsumer(&CampaignNotice{}) + if err != nil { + return + } + c.Run() + return +} + +type CampaignNotice struct{} + +func (s CampaignNotice) Params() consumer.CParams { + return consumer.CParams{ + Topic: types.CampaignNoticeTopic, + Num: 5, + Name: "campaign_notice", + GroupName: types.CampaignUserGroup, + Config: kafka.DefaultConsumerConfig(), + } +} + +func (s CampaignNotice) Receive(session sarama.ConsumerGroupSession, message *sarama.ConsumerMessage) { + // 结束标记消息已消费 + defer session.MarkMessage(message, "") + var handler *consumer.Ctx + switch utils.Bs(message.Key) { + case types.CampaignNoticeKey: + handler = consumer.NewCtx("活动通知", message, campaignNotice) + case types.CampaignOtherStatKey: + handler = consumer.NewCtx("活动其他统计", message, campaignOtherStat) + case types.CampaignRewardNotifyKey: + handler = consumer.NewCtx("奖品回调", message, campaignRewardNotify) + case types.CampaignTargetStatKey: + handler = consumer.NewCtx("用户达标统计", message, campaignTargetStatKey) + case types.CampaignCondStatKey: + handler = consumer.NewCtx("活动条件统计", message, campaignCondStatKey) + case types.CampaignBehaviorKey: + handler = consumer.NewCtx("活动行为处理", message, campaignBehavior) + case types.CampaignDiceMapKey: + handler = consumer.NewCtx("大富翁地图生成", message, campaignDiceMap) + case types.DownloadKey: + handler = consumer.NewCtx("导出任务", message, download) + case types.ValidEventsKey: + handler = consumer.NewCtx("有效事件", message, validEvents) + case types.ProjectUserKey: + handler = consumer.NewCtx("项目用户存储", message, projectUser) + case types.RewardLimitUpKey: + handler = consumer.NewCtx("活动修改预算总上线", message, rewardLimitUp) + case types.CampaignChildInviteKey: + handler = consumer.NewCtx("子活动排行榜结算", message, campaignChildInvite) + case types.ProjectUserCoinDeductKey: + handler = consumer.NewCtx("项目用户积分扣除", message, projectUserCoinDeduct) + case types.CampaignVsSettlementKey: + handler = consumer.NewCtx("赛事竞猜结算", message, campaignVsSettlement) + case types.CampaignSettlementRewardKey: + handler = consumer.NewCtx("赛事竞猜结算奖励", message, campaignSettlementReward) + case types.GameActionKey: + handler = consumer.NewCtx("游戏行为类型", message, gameAction) + default: + return + } + + handler.Done() +} + +func gameAction(ctx *consumer.Ctx) (err error) { + var val types.GameAction + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(GameAction) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignSettlementReward(ctx *consumer.Ctx) (err error) { + var val types.CampaignSettlementReward + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(SettlementReward) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignVsSettlement(ctx *consumer.Ctx) (err error) { + var val types.CampaignVsSettlement + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(VsSettlement) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func projectUserCoinDeduct(ctx *consumer.Ctx) (err error) { + var val types.ProjectUserCoinDeduct + err = ctx.Parse(&val) + if err != nil { + return + } + + taskIdKey := ckey.ProjectUserCoinDeduct(val.UserId) + t := app.NewRedisTask(ctx.Context(), taskIdKey) + c, err := t.TaskPublicAndConsume(func(td *task.Data) error { + var data types.ProjectUserCoinDeduct + err = td.ParsingMsg(&data) + if err != nil { + return err + } + var container = new(ProjectUserCoinDeduct) + { + container.Init(td.Ctx) + container.Req = &data + } + + return container.Run() + }, val) + + if err != nil { + return + } + + if c.Error() != nil && (errors.Is(c.Error(), task.AbnormalErr) || errors.Is(c.Error(), task.ReenterLimit)) { + producer.NewCampaignNotice(ctx.Context()).ProjectUserCoinDeduct(val) + err = c.Error() + return + } + + return +} + +func campaignChildInvite(ctx *consumer.Ctx) (err error) { + var val types.CampaignChildInvite + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(ChildInvite) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func projectUser(ctx *consumer.Ctx) (err error) { + var val types.ProjectUser + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(ProjectUser) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func validEvents(ctx *consumer.Ctx) (err error) { + var val types.ValidEvents + err = ctx.Parse(&val) + if err != nil { + return + } + + taskIdKey := ckey.ValidEventsKey(val.UserId) + if val.NoticeType == types.NoticeTypeClick { + taskIdKey = ckey.ValidEventsUserMarkKey(val.ClickInfo.UserMark) + } + + t := app.NewRedisTask(ctx.Context(), taskIdKey) + c, err := t.TaskPublicAndConsume(func(td *task.Data) error { + var data types.ValidEvents + err = td.ParsingMsg(&data) + if err != nil { + return err + } + var container = new(validevents.ValidEvents) + { + container.Init(td.Ctx, logic.WithBp(), logic.WithErrData(data)) + container.Req = &data + } + + return logic.Run(container) + }, val) + + if err != nil { + return + } + + if c.Error() != nil && (errors.Is(c.Error(), task.AbnormalErr) || errors.Is(c.Error(), task.ReenterLimit)) { + producer.NewCampaignNotice(ctx.Context()).ValidEvents(val) + err = c.Error() + return + } + + return +} + +func download(ctx *consumer.Ctx) (err error) { + var val types.Download + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(export.Download) + { + container.Init(ctx.Context(), logic.WithErrData(val)) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignCondStatKey(ctx *consumer.Ctx) (err error) { + var val types.CampaignCondStat + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(CondStat) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignTargetStatKey(ctx *consumer.Ctx) (err error) { + var val types.CampaignTargetStat + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(TargetStat) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignRewardNotify(ctx *consumer.Ctx) (err error) { + var val types.CampaignRewardNotify + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(RewardNotify) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignNotice(ctx *consumer.Ctx) (err error) { + var val types.CampaignNotice + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(Notice) + { + container.Init(ctx.Context(), logic.WithBp()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignOtherStat(ctx *consumer.Ctx) (err error) { + var val types.CampaignOtherStat + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(OtherStat) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignBehavior(ctx *consumer.Ctx) (err error) { + var val types.CampaignBehavior + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(Behavior) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func campaignDiceMap(ctx *consumer.Ctx) (err error) { + var val types.CampaignDiceMap + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(DiceMap) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} + +func rewardLimitUp(ctx *consumer.Ctx) (err error) { + var val types.RewardLimitUp + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new(RewardLimitUp) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} diff --git a/internal/service/queue/consumer/campaignnotice/dice_map.go b/internal/service/queue/consumer/campaignnotice/dice_map.go new file mode 100644 index 0000000..c97c9e1 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/dice_map.go @@ -0,0 +1,192 @@ +package campaignnotice + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "fmt" +) + +type DiceMap struct { + logic.Logic + + Req *types.CampaignDiceMap +} + +func (s *DiceMap) Exec() (err error) { + cpn, can, err := s.check() + if err != nil || !can { + return + } + + err = s.buildMap(cpn) + if err != nil { + return + } + + return +} + +func (s *DiceMap) check() (cpn *model.FissionCampaign, can bool, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.FissionID != consts.IdDice || !cpn.IsPub() { + return + } + + can = true + return +} + +func (s *DiceMap) buildMap(cpn *model.FissionCampaign) (err error) { + rewardM := s.GetDao().FissionCampaignReward + rewards, err := rewardM.WithContext(s.Ctx).Where( + rewardM.CampaignID.Eq(cpn.ID), + rewardM.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + rewardM.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var groupMap = make(map[string]int64) + var groups []*model.FissionDiceMapGroup + var rewardGroup = make(map[int64][]*model.FissionCampaignReward) + for _, reward := range rewards { + key := fmt.Sprintf("%s_%d_%s", reward.LangMark, reward.LevelID, reward.CountryMark) + id, ok := groupMap[key] + + if !ok { + group := withdefault.FissionDiceMapGroup(&model.FissionDiceMapGroup{ + CampaignID: cpn.ID, + LevelID: reward.LevelID, + LangMark: reward.LangMark, + CountryMark: reward.CountryMark, + }) + groups = append(groups, group) + + id = group.ID + groupMap[key] = id + } + + rewardGroup[id] = append(rewardGroup[id], reward) + } + + m := s.GetDao().FissionDiceMapGroup + err = m.WithContext(s.Ctx).Create(groups...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + confM := s.GetDao().FissionCampaignDice + conf, err := confM.WithContext(s.Ctx).Where(confM.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + for dmgId, v := range rewardGroup { + err = s._buildMap(conf, dmgId, v) + if err != nil { + return + } + } + + return +} + +// 生成地图 +func (s *DiceMap) _buildMap(conf *model.FissionCampaignDice, dmgId int64, rewards []*model.FissionCampaignReward) (err error) { + + nl := len(rewards) + nm := utils.Ternary[int](nl%4 == 0, 1, 4) + + var rewardIds = make([]int64, 0, nl) + for i := 0; i < nm; i++ { + for _, reward := range rewards { + rewardIds = append(rewardIds, reward.ID) + } + } + + groupMap := s._group(rewardIds, conf) + + var list = make([]*model.FissionDiceMap, 0, 30) + for { + if len(list) >= 120 { + break + } + + for _, m := range groupMap { + var maps = make([]*model.FissionDiceMap, 0, 6) + maps = append(maps, withdefault.FissionDiceMap(&model.FissionDiceMap{ + CampaignID: conf.CampaignID, + MarkType: mtype.FissionDiceMapMarkTypeNone, + DmgID: dmgId, + })) + for _, v := range m { + maps = append(maps, withdefault.FissionDiceMap(&model.FissionDiceMap{ + CampaignID: conf.CampaignID, + MarkType: v.markType, + RewardID: v.rewardId, + DmgID: dmgId, + })) + } + + if len(maps) == 6 { + list = append(list, maps...) + } + } + } + + dmm := s.GetDao().FissionDiceMap + if err = dmm.WithContext(s.Ctx).Create(list...); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +type gm struct { + markType int8 + rewardId int64 +} + +// 把奖品分成一组一组的 +func (s *DiceMap) _group(rewardIds []int64, conf *model.FissionCampaignDice) []map[int]gm { + var idx int + var groupMap = make([]map[int]gm, len(rewardIds)/4) + var done = func() { + var one = map[int]gm{} + + for i := 1; i <= 4; i++ { + one[i] = gm{markType: mtype.FissionDiceMapMarkTypeNormal, rewardId: rewardIds[idx]} + idx++ + } + + one[5] = gm{markType: utils.Ternary[int8](conf.RollAgain == mtype.Yes, mtype.FissionDiceMapMarkTypeChance, mtype.FissionDiceMapMarkTypeNone)} + + groupMap = append(groupMap, one) + } + + for { + if len(rewardIds) <= idx { + break + } + done() + } + + return groupMap +} diff --git a/internal/service/queue/consumer/campaignnotice/export/ads_table.go b/internal/service/queue/consumer/campaignnotice/export/ads_table.go new file mode 100644 index 0000000..836125f --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/ads_table.go @@ -0,0 +1,178 @@ +package export + +import ( + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + pb "joybuywork/proto/go_proto/w_common" + "fmt" + "github.com/golang-module/carbon/v2" +) + +type adsTable struct { + base +} + +func (s *adsTable) Export() (path string, err error) { + var data pb.DownloadReq_CampaignReport + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + //var data = adsTable{ + // CampaignHashId: "cmfkna6rdj7vmgsh3oi0", + // StartTime: 1704902400, + // EndTime: 1704988799, + //} + + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + marks := []string{ + mtype.FissionBehaviorMarkView, + mtype.FissionBehaviorMarkAppInstall, + } + dataHeader := export.HeaderField{ + {Field: "view_user", Title: "访问人数"}, + {Field: "install_user", Title: "下载人数"}, + } + + start := utils.Ternary(data.StartTime != 0, carbon.CreateFromTimestamp(data.StartTime), carbon.Now().StartOfDay()) + end := utils.Ternary(data.EndTime != 0, carbon.CreateFromTimestamp(data.EndTime), carbon.Now()) + var statType int8 = mtype.FissionTotalCycleTypeHour + + if start.AddDay().Lt(end) { + statType = mtype.FissionTotalCycleTypeDay + } + + m := s.GetDao().FissionTotalCycle + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.In(marks...), + m.StatTime.Gte(start.Timestamp()), + m.StatTime.Lte(end.Timestamp()), + m.StatType.Eq(statType), + ).Find() + + if err != nil { + err = s.BE().MysqlError(err) + return + } + var rowMap = make(map[string]map[string]int64) + for _, v := range list { + d := carbon.CreateFromTimestamp(v.StatTime) + switch statType { + case mtype.FissionTotalCycleTypeHour: + if _, ok := rowMap[fmt.Sprintf("%dh", d.Hour())]; !ok { + rowMap[fmt.Sprintf("%dh", d.Hour())] = map[string]int64{ + v.Mark: v.UserNum, + } + } else { + rowMap[fmt.Sprintf("%dh", d.Hour())][v.Mark] = v.UserNum + } + default: + if _, ok := rowMap[d.ToShortDateString()]; !ok { + rowMap[d.ToShortDateString()] = map[string]int64{ + v.Mark: v.UserNum, + } + } else { + rowMap[d.ToShortDateString()][v.Mark] = v.UserNum + } + } + } + + // 即时数据 + pTotal := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var immUserNum map[string]int64 + + now := carbon.Now() + switch statType { + case mtype.FissionTotalCycleTypeHour: + if now.StartOfDay().Eq(start.StartOfDay()) { // 当天的某一个小时 + _, immUserNum, err = pTotal.CycleHour(now, marks...) + if err != nil { + return + } + + hs := fmt.Sprintf("%dh", now.Hour()) + + for mark, v := range immUserNum { + if _, ok := rowMap[hs]; !ok { + rowMap[hs] = map[string]int64{ + mark: v, + } + } else { + rowMap[hs][mark] = v + } + } + } + + default: + if end.Gte(now) { // 如果结束时间大于当前时间 + dayStr := now.ToShortDateString() + _, immUserNum, err = pTotal.CycleDay(now, marks...) + if err != nil { + return + } + + for mark, v := range immUserNum { + if _, ok := rowMap[dayStr]; !ok { + rowMap[dayStr] = map[string]int64{ + mark: v, + } + } else { + rowMap[dayStr][mark] = v + } + } + } + } + + header := append(export.HeaderField{{ + Field: "day", + Title: "日期", + }}, dataHeader...) + + var between []string + var rowData []export.RowData + switch statType { + case mtype.FissionTotalCycleTypeHour: + hours := utils.BetweenHour(start, end) + for _, v := range hours { + key := fmt.Sprintf("%dh", v) + between = append(between, key) + } + default: + between = utils.BetweenDay(start, end) + } + + for _, v := range between { + one := export.RowData{ + "day": v, + } + + if row, ok := rowMap[v]; ok { + for mark, num := range row { + switch mark { + case mtype.FissionBehaviorMarkAppInstall: + one["install_user"] = fmt.Sprintf("\t%d", num) + case mtype.FissionBehaviorMarkView: + + one["view_user"] = fmt.Sprintf("\t%d", num) + } + } + } + + rowData = append(rowData, one) + } + + return s._eptFile(header, rowData) +} diff --git a/internal/service/queue/consumer/campaignnotice/export/base.go b/internal/service/queue/consumer/campaignnotice/export/base.go new file mode 100644 index 0000000..6161daa --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/base.go @@ -0,0 +1,56 @@ +package export + +import ( + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/export/xlsx" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/upload" + "errors" + "os" + "time" +) + +type base struct { + logic.Logic + Req *types.Download +} + +func (s *base) _eptFile(header export.HeaderField, rowData []export.RowData) (path string, err error) { + ept := xlsx.NewExport(s.Ctx, header, 0) + err = ept.ExportFile(rowData) + if err != nil { + return + } + + path, err = upload.File(ept.GetFullPath(), ept.GetFilename()) + defer os.Remove(ept.GetFullPath()) + if err != nil { + return + } + return s._yun(ept.GetFullPath(), ept.GetFilename(), int64(len(rowData))) +} + +func (s *base) _yun(fullPath, filename string, count int64) (path string, err error) { + path, err = upload.File(fullPath, filename) + defer os.Remove(fullPath) + if err != nil { + return + } + + w := count / 200000 + + // 等阿里云全球加速同步 + if w > 0 { + time.Sleep(time.Duration(w) * time.Second) + } + + return +} + +func (s *base) _checkCount(count int64) (err error) { + if count > 200000 { + return errors.New("当前导出数据已经超过20万行,如果确实需要导出,请联系平台工作人员或者对接开放平台文档拉取") + } + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/c_test.go b/internal/service/queue/consumer/campaignnotice/export/c_test.go new file mode 100644 index 0000000..6461a6e --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/c_test.go @@ -0,0 +1,53 @@ +package export + +import ( + "context" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/types" + "testing" + + _ "joybuywork/test" +) + +func TestNewUserList(t *testing.T) { + + b := new(base) + { + b.Init(context.Background()) + } + + //{"campaign_hash_id":"csjg9g6rdj7jt0t121j0"} + + task := &model.ExportTask{ + HashID: hashid.Id(), + UserID: 133, + Mark: "fission_user_stat", + Cond: "{\"campaign_hash_id\":\"d5nehvurdj7mniubl1a0\",\"type\":\"help\"}", + EptStatus: mtype.ExportTaskEptStatusDoing, + ExpiredAt: 0, + Filename: "", + FailMsg: "", + } + + dao.ExportTask.WithContext(context.Background()).Create(task) + + e := &fissionUserStat{ + base: base{ + Logic: b.Logic, + Req: &types.Download{ + TaskId: task.HashID, + Mark: "fission_user_stat", + Cond: []byte(task.Cond), + }, + }, + } + + t.Log(e.Export()) +} + +func TestName(t *testing.T) { + t.Log(int64(123 / 20000)) +} diff --git a/internal/service/queue/consumer/campaignnotice/export/campaign_report.go b/internal/service/queue/consumer/campaignnotice/export/campaign_report.go new file mode 100644 index 0000000..845a808 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/campaign_report.go @@ -0,0 +1,295 @@ +package export + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils" + pb "joybuywork/proto/go_proto/w_common" + "fmt" + "github.com/golang-module/carbon/v2" +) + +type campaignReport struct { + base +} + +func (s *campaignReport) Export() (path string, err error) { + var data pb.DownloadReq_CampaignReport + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + //var data = campaignReport{ + // CampaignHashId: "cmfkna6rdj7vmgsh3oi0", + // StartTime: 1704902400, + // EndTime: 1704988799, + //} + + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + marks, dataHeader, err := s._campaignReportMark(cpn) + if err != nil { + return + } + + start := utils.Ternary(data.StartTime != 0, carbon.CreateFromTimestamp(data.StartTime), carbon.Now().StartOfDay()) + end := utils.Ternary(data.EndTime != 0, carbon.CreateFromTimestamp(data.EndTime), carbon.Now()) + var statType int8 = mtype.FissionTotalCycleTypeHour + + if start.AddDay().Lt(end) { + statType = mtype.FissionTotalCycleTypeDay + } + + m := s.GetDao().FissionTotalCycle + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.Mark.In(marks...), + m.StatTime.Gte(start.Timestamp()), + m.StatTime.Lte(end.Timestamp()), + m.StatType.Eq(statType), + ).Find() + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rowMap = make(map[string]map[string]map[string]int64) + for _, v := range list { + d := carbon.CreateFromTimestamp(v.StatTime) + switch statType { + case mtype.FissionTotalCycleTypeHour: + if _, ok := rowMap[fmt.Sprintf("%dh", d.Hour())]; !ok { + rowMap[fmt.Sprintf("%dh", d.Hour())] = map[string]map[string]int64{ + v.Mark: {v.Mark + "_user": v.UserNum, v.Mark + "_num": v.Num}, + } + } else { + rowMap[fmt.Sprintf("%dh", d.Hour())][v.Mark] = map[string]int64{ + v.Mark + "_user": v.UserNum, v.Mark + "_num": v.Num, + } + } + default: + if _, ok := rowMap[d.ToShortDateString()]; !ok { + rowMap[d.ToShortDateString()] = map[string]map[string]int64{ + v.Mark: {v.Mark + "_user": v.UserNum, v.Mark + "_num": v.Num}, + } + } else { + rowMap[d.ToShortDateString()][v.Mark] = map[string]int64{ + v.Mark + "_user": v.UserNum, v.Mark + "_num": v.Num, + } + } + } + } + + // 即时数据 + pTotal := provider.NewFissionBehaviorTotal(s.Ctx, cpn.ID) + + var immNum, immUserNum map[string]int64 + + now := carbon.Now() + switch statType { + case mtype.FissionTotalCycleTypeHour: + if now.StartOfDay().Eq(start.StartOfDay()) { // 当天的某一个小时 + immNum, immUserNum, err = pTotal.CycleHour(now, marks...) + if err != nil { + return + } + + hs := fmt.Sprintf("%dh", now.Hour()) + + for mark, v := range immNum { + if _, ok := rowMap[hs]; !ok { + rowMap[hs] = map[string]map[string]int64{ + mark: {mark + "_num": v}, + } + } else { + rowMap[hs][mark] = map[string]int64{ + mark + "_num": v, + } + } + } + + for mark, v := range immUserNum { + rowMap[hs][mark][mark+"_user"] = v + } + + } + default: + if end.Gte(now) { // 如果结束时间大于当前时间 + dayStr := now.ToShortDateString() + immNum, immUserNum, err = pTotal.CycleDay(now, marks...) + if err != nil { + return + } + + for mark, v := range immNum { + if _, ok := rowMap[dayStr]; !ok { + rowMap[dayStr] = map[string]map[string]int64{ + mark: {mark + "_num": v}, + } + } else { + rowMap[dayStr][mark] = map[string]int64{ + mark + "_num": v, + } + } + } + + for mark, v := range immUserNum { + rowMap[dayStr][mark][mark+"_user"] = v + } + } + } + + header := append(export.HeaderField{{ + Field: "day", + Title: "日期", + }}, dataHeader...) + + var between []string + var rowData []export.RowData + switch statType { + case mtype.FissionTotalCycleTypeHour: + hours := utils.BetweenHour(start, end) + for _, v := range hours { + key := fmt.Sprintf("%dh", v) + between = append(between, key) + } + default: + between = utils.BetweenDay(start, end) + } + + for _, v := range between { + one := export.RowData{ + "day": v, + } + + var fv = make(map[string]int64) + if row, ok := rowMap[v]; ok { + for _, un := range row { + for k, d := range un { + fv[k] = d + } + } + } + + for _, v1 := range dataHeader { + one[v1.Field] = fv[v1.Field] + } + + rowData = append(rowData, one) + } + + return s._eptFile(header, rowData) +} + +func (s *campaignReport) _campaignReportMark(cpn *model.FissionCampaign) (marks []string, header []export.HeaderFieldOne, err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch cpn.FissionID { + case consts.IdSignIn: + marks = []string{ + mtype.FissionBehaviorMarkSign, + mtype.FissionBehaviorMarkSignTarget, + } + + header = export.HeaderField{ + {Field: "sign_user", Title: "签到人数"}, + {Field: "sign_num", Title: "签到次数"}, + {Field: "sign_target_user", Title: "签到达标人数"}, + {Field: "sign_target_num", Title: "签到达标次数"}, + } + + return + case consts.IdGrow: + marks = []string{ + mtype.FissionBehaviorMarkView, + mtype.FissionBehaviorMarkGrow, + } + + header = export.HeaderField{ + {Field: "view_user", Title: "活动访问人数"}, + {Field: "view_num", Title: "活动访问次数"}, + {Field: "grow_user", Title: "领养人数"}, + {Field: "grow_num", Title: "领养次数"}, + } + + return + } + + marks = []string{ + mtype.FissionBehaviorMarkView, + mtype.FissionBehaviorMarkClickShare, + } + header = export.HeaderField{ + {Field: "view_user", Title: "活动访问人数"}, + {Field: "view_num", Title: "活动访问次数"}, + {Field: "click_share_user", Title: "点击分享按钮人数"}, + {Field: "click_share_num", Title: "点击分享按钮次数"}, + } + + if conf.Option == mtype.FissionCampaignConfigTargetOptionApp && conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister { + marks = append(marks, mtype.FissionBehaviorMarkAppRegister) + + header = append(header, + export.HeaderFieldOne{Field: "app_register_user", Title: "注册人数"}, + export.HeaderFieldOne{Field: "app_register_num", Title: "注册次数"}, + ) + + } else { + marks = append(marks, mtype.FissionBehaviorMarkAppInstall) + + header = append(header, + export.HeaderFieldOne{Field: "app_install_user", Title: "裂变带来新增人数"}, + export.HeaderFieldOne{Field: "app_install_num", Title: "裂变带来新增次数"}, + ) + } + + if conf.Option != mtype.FissionCampaignConfigTargetOptionApp { + condM := s.GetDao().FissionCampaignCond + var conds []*model.FissionCampaignCond + conds, err = condM.WithContext(s.Ctx).Where( + condM.CampaignID.Eq(cpn.ID), + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, cond := range conds { + mark := utils.BehaviorFormatMark(mtype.FissionBehaviorTypeFinishCond, cond.ID) + marks = append(marks, mark) + + header = append(header, + export.HeaderFieldOne{Field: fmt.Sprintf("%s_user", mark), Title: fmt.Sprintf("%s人数", cond.Event)}, + export.HeaderFieldOne{Field: fmt.Sprintf("%s_num", mark), Title: fmt.Sprintf("%s次数", cond.Event)}, + ) + } + + marks = append(marks, mtype.FissionBehaviorMarkFinishTask) + header = append(header, + export.HeaderFieldOne{Field: "finish_task_user", Title: "活动条件达标人数"}, + export.HeaderFieldOne{Field: "finish_task_num", Title: "活动条件达标次数"}, + ) + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/child_list.go b/internal/service/queue/consumer/campaignnotice/export/child_list.go new file mode 100644 index 0000000..9645edf --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/child_list.go @@ -0,0 +1,272 @@ +package export + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/export/xlsx" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_common" + + "gorm.io/gen" +) + +type childList struct { + base +} + +func (s *childList) Export() (path string, err error) { + var data pb.DownloadReq_NewUserList + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + cpn, err := finder.Campaign(s.Ctx, data.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return + } + + tz := utils.STernary[int32](data.GetTOffset(), consts.DefaultTz, cpn.TOffset) + + data.Start = timez.GMT(data.Start, tz) + data.End = timez.GMT(data.End, tz) + + m := s.GetDao().FissionChildUser + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.JoinTime.Gt(0), + } + + if !verify.EmptyString(data.GetUserMark()) { + + var user *model.FissionUser + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(data.GetUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + cond = append(cond, m.ID.Eq(-1)) + } else { + cond = append(cond, m.UserID.Eq(user.ID)) + } + + } + + if data.GetStart() > 0 { + cond = append(cond, m.JoinTime.Gte(data.GetStart())) + } + + if data.GetEnd() > 0 { + cond = append(cond, m.JoinTime.Lte(data.GetEnd())) + } + + if data.GetPidType() == 0 && data.GetParentUserMark() != "" { + var puser *model.FissionUser + puser, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(data.GetParentUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if puser == nil { + cond = append(cond, m.ID.Eq(-1)) + } else { + cond = append(cond, m.ParentID.Eq(puser.ID)) + } + } + + if data.GetPidType() != 0 { + switch data.GetPidType() { + case 1: + cond = append(cond, m.ParentID.Gt(0)) + case 2: + cond = append(cond, m.ParentID.Eq(0)) + } + } + + count, err := m.WithContext(s.Ctx).Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if err = s._checkCount(count); err != nil { + return + } + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, s.baseHeader(cpn.ChildType), count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + //找上级用户数据 + var ( + userMap = make(map[int64]string) + ) + + var list []*model.FissionChildUser + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + var playerIds, userIds []int64 + for _, v := range list { + + playerIds = append(playerIds, v.ID) + + if _, ok := userMap[v.UserID]; !ok && v.UserID > 0 { + userIds = append(userIds, v.UserID) + userMap[v.UserID] = "" + } + + if _, ok := userMap[v.ParentID]; !ok && v.ParentID > 0 { + userIds = append(userIds, v.UserID) + userMap[v.ParentID] = "" + } + + } + + err = s._userMap(cpn.Pid, userIds, userMap) + if err != nil { + return + } + + childData, err := s._child(cpn.ID, cpn.ChildType, playerIds) + if err != nil { + return + } + + for _, v := range list { + rowData = append(rowData, export.RowData{ + "sub_user_id": userMap[v.UserID], + "parent": userMap[v.ParentID], + "join_date": timez.GMTTime(tz, v.JoinTime).Format(timez.ListDate), + "num": childData[v.ID], + }) + } + + ept.AppendData(rowData) + return + }) + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +func (s *childList) baseHeader(childType int8) export.HeaderField { + + bh := export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + } + + switch childType { + case mtype.FissionCampaignChildTypeSign: + bh = append(bh, export.HeaderFieldOne{ + Field: "num", + Title: "签到天数", + }) + case mtype.FissionCampaignChildTypeInvite: + bh = append(bh, export.HeaderFieldOne{ + Field: "num", + Title: "邀请人数", + }) + case mtype.FissionCampaignChildTypeLucky: + bh = append(bh, export.HeaderFieldOne{ + Field: "num", + Title: "抽奖次数", + }) + case mtype.FissionCampaignChildTypeBlind: + bh = append(bh, export.HeaderFieldOne{ + Field: "num", + Title: "开盒次数", + }) + case mtype.FissionCampaignChildTypeTask: + + } + + bh = append(bh, export.HeaderFieldOne{ + Field: "join_date", + Title: "参与时间", + }, export.HeaderFieldOne{ + Field: "parent", + Title: "上级用户", + }) + + return bh +} + +type childListNum struct { + PlayerId int64 + Num int64 +} + +// 用户数据 +func (s *childList) _child(cpnId int64, childType int8, ids []int64) (childData map[int64]int64, err error) { + childData = make(map[int64]int64, len(ids)) + + var mark string + switch childType { + case mtype.FissionCampaignChildTypeBlind: + mark = mtype.FissionChildUserRecordSourceBlind + case mtype.FissionCampaignChildTypeInvite: + mark = mtype.FissionChildUserRecordSourceInviteOne + case mtype.FissionCampaignChildTypeSign: + mark = mtype.FissionChildUserRecordSourceSign + case mtype.FissionCampaignChildTypeLucky: + mark = mtype.FissionChildUserRecordSourceLucky + case mtype.FissionCampaignChildTypeTask: + + } + + m := s.GetDao().FissionChildUserRecord + var nums []*childListNum + err = m.WithContext(s.Ctx).Select(m.PlayerID, m.ID.Count().As("num")). + Where(m.CampaignID.Eq(cpnId), m.PlayerID.In(ids...), m.Mark.Eq(mark)). + Group(m.PlayerID). + Scan(&nums) + + for _, num := range nums { + childData[num.PlayerId] = num.Num + } + + return +} + +// 用户数据 +func (s *childList) _userMap(cpnId int64, ids []int64, userMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + m := s.GetDao().FissionUser.SubTable(cpnId) + + //找上级数据 + userList, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range userList { + userMap[v.ID] = v.UserMark + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/coin_record.go b/internal/service/queue/consumer/campaignnotice/export/coin_record.go new file mode 100644 index 0000000..a674ab7 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/coin_record.go @@ -0,0 +1,210 @@ +package export + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/export/xlsx" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + "fmt" + + pb "joybuywork/proto/go_proto/w_common" + + "gorm.io/gen" +) + +type coinRecord struct { + base +} + +func (s *coinRecord) Export() (path string, err error) { + var data pb.DownloadReq_CoinRecord + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + tz := utils.STernary(data.GetTOffset(), consts.DefaultTz, cpn.TOffset) + + cond, err := s.cond(&data, cpn, tz) + + m := s.GetDao().FissionCoinLog + count, err := m.WithContext(s.Ctx).Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "title", Title: "开奖时间"}, + {Field: "created_date", Title: "领取/扣除时间"}, + {Field: "num", Title: "数量"}, + {Field: "type", Title: "类型"}, + {Field: "source", Title: "来源"}, + } + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, header, count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + // 临时存储对象 + var ( + userMap = make(map[int64]string) + ) + + sceneM := s.GetDao().FissionCoinScene + scenes, err := sceneM.WithContext(s.Ctx).Where(sceneM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + gmt := utils.Ternary[string](cpn.TOffset < 0, fmt.Sprint(cpn.TOffset), fmt.Sprintf("+%d", cpn.TOffset)) + + var titleMap = make(map[int64]string, len(scenes)) + for _, v := range scenes { + day, _, _ := timez.GMTStartAndEndTs(cpn.TOffset, v.OpenTime) + titleMap[v.ID] = fmt.Sprintf("%s(GMT%s)", day, gmt) + } + + var list []*model.FissionCoinLog + + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + var userIds []int64 + for _, v := range list { + if _, ok := userMap[v.UserID]; !ok { + userIds = append(userIds, v.UserID) + } + } + + err = s._userMap(cpn.ID, userIds, userMap) + if err != nil { + return + } + + for _, v := range list { + val := v.GetVal() + + rowData = append(rowData, export.RowData{ + "sub_user_id": userMap[v.UserID], + "created_date": timez.GMTTime(tz, v.CreatedAt).Format(timez.ListDate), + "title": titleMap[v.SceneID], + "num": val.CoinNum, + "type": v.GetTypeTitle(), + "source": v.GetSourceTitle(), + }) + } + + ept.AppendData(rowData) + + return nil + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +func (s *coinRecord) cond(data *pb.DownloadReq_CoinRecord, cpn *model.FissionCampaign, tz int32) (cond []gen.Condition, err error) { + data.Start = timez.GMT(data.Start, tz) + data.End = timez.GMT(data.End, tz) + + m := s.GetDao().FissionCoinLog + cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + } + + if data.GetUserId() > 0 { + var user *model.FissionUser + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindById(data.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + cond = append(cond, m.UserID.Eq(user.ID)) + } + + if data.GetSubUserId() != "" { + var user *model.FissionUser + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(data.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + cond = append(cond, m.UserID.Eq(user.ID)) + } + + if data.GetType() > 0 { + cond = append(cond, m.Type.Eq(int8(data.GetType()))) + } + + if data.GetSceneId() > 0 { + cond = append(cond, m.SceneID.Eq(data.GetSceneId())) + } + + if data.GetSource() != "" { + cond = append(cond, m.Source.Eq(data.GetSource())) + } + + if data.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(data.GetStart())) + } + + if data.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(data.GetEnd())) + } + + return +} + +func (s *coinRecord) _userMap(cpnId int64, userIds []int64, userMap map[int64]string) (err error) { + if len(userIds) == 0 { + return + } + + userM := s.GetDao().FissionUser.SubTable(cpnId) + userList, err1 := userM.WithContext(s.Ctx).Select(userM.ID, userM.SubUserID).Where(userM.ID.In(userIds...)).Find() + if err1 != nil { + return err1 + } + + for _, user := range userList { + userMap[user.ID] = user.SubUserID + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/export.go b/internal/service/queue/consumer/campaignnotice/export/export.go new file mode 100644 index 0000000..881558a --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/export.go @@ -0,0 +1,115 @@ +package export + +import ( + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/proto/go_proto/workerr" +) + +type iDownload interface { + Export() (path string, err error) +} + +type Download struct { + logic.Logic + + Req *types.Download +} + +func (s *Download) Exec() (err error) { + task, err := s.task() + if err != nil { + return + } + + err = s.ept(task) + if err != nil { + return + } + + return +} + +func (s *Download) task() (task *model.ExportTask, err error) { + m := s.GetDao().ExportTask + + task, err = m.WithContext(s.Ctx).Where(m.HashID.Eq(s.Req.TaskId), m.Mark.Eq(s.Req.Mark)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if task == nil { + err = workerr.NotFound("not found ept taskType") + return + } + + return +} + +func (s *Download) ept(task *model.ExportTask) (err error) { + + if task.EptStatus != mtype.ExportTaskEptStatusDoing { + return + } + + m := s.GetDao().ExportTask + + bs := base{ + Logic: s.Logic, + Req: s.Req, + } + + var ept iDownload + + var path string + switch task.Mark { + case mtype.ExportTaskMarkCampaignReport: + ept = &campaignReport{base: bs} + case mtype.ExportTaskMarkFissionUser: + ept = &fissionUser{base: bs} + case mtype.ExportTaskMarkFissionRewardRecord: + ept = &fissionRewardRecord{base: bs} + case mtype.ExportTaskMarkFissionUserStat: + ept = &fissionUserStat{base: bs} + case mtype.ExportTaskMarkAdsTable: + ept = &adsTable{base: bs} + case mtype.ExportTaskMarkNewUserList: + ept = &newUserList{base: bs} + case mtype.ExportTaskMarkCoinRecord: + ept = &coinRecord{base: bs} + case mtype.ExportTaskMarkChildList: + ept = &childList{base: bs} + } + + if ept == nil { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.EptStatus.Value(mtype.ExportTaskEptStatusFail), m.FailMsg.Value("not support mark")) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } + + path, err = ept.Export() + if err != nil { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.EptStatus.Value(mtype.ExportTaskEptStatusFail), m.FailMsg.Value(err.Error())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(task.ID)).UpdateSimple(m.EptStatus.Value(mtype.ExportTaskEptStatusOk), m.Filename.Value(path)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/fission_reward_record.go b/internal/service/queue/consumer/campaignnotice/export/fission_reward_record.go new file mode 100644 index 0000000..63d8270 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/fission_reward_record.go @@ -0,0 +1,328 @@ +package export + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/export/xlsx" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_common" + "fmt" + + "gorm.io/gen" +) + +type fissionRewardRecord struct { + base +} + +func (s *fissionRewardRecord) Export() (path string, err error) { + var data pb.DownloadReq_FissionRewardRecord + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + tz := utils.STernary(data.GetTOffset(), consts.DefaultTz, cpn.TOffset) + + subCpnId, cond, err := s.cond(&data, cpn, tz) + + m := s.GetDao().FissionRewardRecord.SubTable(subCpnId) + count, err := m.WithContext(s.Ctx).Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if err = s._checkCount(count); err != nil { + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "created_date", Title: "发奖时间"}, + {Field: "title", Title: "奖品"}, + {Field: "status", Title: "发奖状态"}, + } + + if data.GetIsChild() == mtype.No { + header = append(header, export.HeaderFieldOne{ + Field: "reward_type", + Title: "奖品来源", + }) + } + + header = append(header, export.HeaderFieldOne{ + Field: "fail_msg", Title: "发奖失败原因", + }, export.HeaderFieldOne{ + Field: "reward_type", Title: "奖品来源", + }, export.HeaderFieldOne{ + Field: "form", Title: "提交的表单内容", + }, export.HeaderFieldOne{ + Field: "custom", Title: "自定义数据", + }) + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, header, count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + // 临时存储对象 + var ( + userMap = make(map[int64]string) + rewardTitleMap = make(map[int64]string) + childMap = make(map[int64]string) + ) + + // 把固定奖品放进去 + for _, v := range app.FissionFixRewards { + rewardTitleMap[v.Id] = v.RewardTitle + } + + var list []*model.FissionRewardRecord + + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + var userIds, formRecordIds, brIds, childIds []int64 + for _, v := range list { + if _, ok := userMap[v.UserID]; !ok { + userIds = append(userIds, v.UserID) + } + + if v.Status == mtype.FissionRewardRecordStatusSubmitForm { + formRecordIds = append(formRecordIds, v.ID) + } + + if _, ok := rewardTitleMap[v.BaseRewardID]; !ok { + brIds = append(brIds, v.BaseRewardID) + rewardTitleMap[v.BaseRewardID] = "" + } + + if _, ok := childMap[v.ChildID]; !ok && v.ChildID > 0 { + childIds = append(childIds, v.ChildID) + childMap[v.ChildID] = "" + } + } + + err = s._userMap(subCpnId, userIds, userMap) + if err != nil { + return + } + + formMap, err1 := s._formMap(formRecordIds) + if err1 != nil { + err = err1 + return + } + + err = s._rewardTitleMap(brIds, rewardTitleMap) + if err != nil { + return + } + + for _, v := range list { + + var content string + if v.CustomRewardVal != "" { + content = "兑换码:" + v.CustomRewardVal + } + + var rewardType = mtype.FissionCampaignRewardTypeTitle[v.RewardType] + if v.RewardType == mtype.FissionCampaignRewardTypeChild { + rewardType = fmt.Sprintf("%s(%s)", mtype.FissionCampaignRewardTypeTitle[v.RewardType], childMap[v.ChildID]) + } + + var title = rewardTitleMap[v.BaseRewardID] + if data.GetIsChild() == mtype.Yes && v.PropMark == mtype.FissionCampaignRewardPropMarkChance { + title = fmt.Sprintf("%s *%d", consts.FissionPropMarkTitle[consts.FissionPropMark[cpn.FissionID]], v.RewardNum) + } + + rowData = append(rowData, export.RowData{ + "sub_user_id": userMap[v.UserID], + "created_date": timez.GMTTime(tz, v.CreatedAt).Format(timez.ListDate), + "title": title, + "status": mtype.FissionRewardRecordStatus[v.Status], + "fail_msg": v.FailMsg, + "form": formMap[v.ID], + "custom": content, + "reward_type": rewardType, + }) + } + + ept.AppendData(rowData) + + return nil + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +func (s *fissionRewardRecord) _rewardTitleMap(brIds []int64, rewardTitleMap map[int64]string) (err error) { + if len(brIds) == 0 { + return + } + + brList, err := cache.NewReward(s.Ctx).FindByIds(brIds) + if err != nil { + return err + } + + for _, v := range brList { + rewardTitleMap[v.ID] = v.RewardTitle + } + + return +} + +func (s *fissionRewardRecord) _formMap(formRecordIds []int64) (formMap map[int64]string, err error) { + formMap = make(map[int64]string, len(formRecordIds)) + + if len(formRecordIds) == 0 { + return + } + + rfm := s.GetDao().FissionRewardRecordForm + rfList, err := rfm.WithContext(s.Ctx).Where(rfm.RecordID.In(formRecordIds...)).Find() + if err != nil { + return + } + + for _, v := range rfList { + items := v.GetItems() + for _, item := range items { + formMap[v.RecordID] += fmt.Sprintf("%s:%s\r\n", item.Key, item.Value) + } + } + + return +} + +func (s *fissionRewardRecord) _userMap(subCpnId int64, userIds []int64, userMap map[int64]string) (err error) { + if len(userIds) == 0 { + return + } + + userM := s.GetDao().FissionUser.SubTable(subCpnId) + userList, err1 := userM.WithContext(s.Ctx).Select(userM.ID, userM.SubUserID).Where(userM.ID.In(userIds...)).Find() + if err1 != nil { + return err1 + } + + for _, user := range userList { + userMap[user.ID] = user.SubUserID + } + + return +} + +// 填充子活动信息 +func (s *fissionRewardRecord) _fillChildMap(childIds []int64, childMap map[int64]string) (err error) { + if len(childIds) == 0 { + return + } + + m := s.GetDao().FissionCampaign + + list, err := m.WithContext(s.Ctx).Where(m.ID.In(childIds...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + childMap[v.ID] = v.Title + } + + return +} + +func (s *fissionRewardRecord) cond(data *pb.DownloadReq_FissionRewardRecord, cpn *model.FissionCampaign, tz int32) (subCpnId int64, cond []gen.Condition, err error) { + data.Start = timez.GMT(data.Start, tz) + data.End = timez.GMT(data.End, tz) + + subCpnId = cpn.ID + if data.GetIsChild() == mtype.Yes { + subCpnId = cpn.Pid + } + + m := s.GetDao().FissionRewardRecord.SubTable(subCpnId) + if data.GetIsChild() == mtype.Yes { + cond = append(cond, m.CampaignID.Eq(cpn.Pid), m.ChildID.Eq(cpn.ID)) + } else { + cond = append(cond, m.CampaignID.Eq(cpn.ID), m.PropMark.Eq(mtype.FissionCampaignRewardPropMarkReward)) + } + + if len(data.GetStatus()) > 0 { + var status = make([]int8, 0, len(data.GetStatus())) + for _, v := range data.GetStatus() { + status = append(status, int8(v)) + } + + cond = append(cond, m.Status.In(status...)) + } + + if data.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(data.GetStart())) + } + + if data.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(data.GetEnd())) + } + + if !verify.EmptyString(data.GetUserMark()) { + var userId int64 + var user *model.FissionUser + userM := s.GetDao().FissionUser.SubTable(cpn.ID) + user, err = userM.WithContext(s.Ctx).Where(userM.CampaignID.Eq(cpn.ID), userM.UserMark.Eq(data.GetUserMark())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user != nil { + userId = user.ID + } + cond = append(cond, m.UserID.Eq(userId)) + } + + if !verify.EmptyString(data.GetRewardTitle()) { + rewardM := s.GetDao().Reward + var ids []int64 + err = rewardM.WithContext(s.Ctx).Where( + rewardM.ProjectID.Eq(cpn.ProjectID), + rewardM.RewardTitle.Like(utils.DbAllLike(data.GetRewardTitle())), + rewardM.IsDel.Eq(mtype.No), + ).Pluck(rewardM.ID, &ids) + if err != nil { + err = s.BE().MysqlError(err) + return + } + cond = append(cond, m.BaseRewardID.In(ids...)) + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/fission_user.go b/internal/service/queue/consumer/campaignnotice/export/fission_user.go new file mode 100644 index 0000000..a4f46e1 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/fission_user.go @@ -0,0 +1,277 @@ +package export + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_common" + + "github.com/golang-module/carbon/v2" + "gorm.io/gen" +) + +type fissionUser struct { + base +} + +func (s *fissionUser) Export() (path string, err error) { + var data pb.DownloadReq_FissionUser + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionUser.SubTable(cpn.ID) + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.IsDel.Eq(mtype.No), + m.IsView.Eq(mtype.No), + } + + if !verify.EmptyString(data.GetUserMark()) { + cond = append(cond, m.UserMark.Eq(data.GetUserMark())) + } + + if data.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(data.GetStart())) + } + + if data.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(data.GetEnd())) + } + + if data.GetSource() > 0 { + cond = append(cond, m.Source.Eq(int8(data.GetSource()))) + } + + if data.GetParentUserMark() != "" { + var puser *model.FissionUser + puser, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(data.GetParentUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if puser == nil { + cond = append(cond, m.ParentID.Eq(-1)) + } else { + cond = append(cond, m.ParentID.Eq(puser.ID)) + } + } + + switch cpn.FissionID { + case consts.IdDice: + return s.dice(cpn.ID, cond) + case consts.IdPrizeQuiz: + return s.quiz(cpn, cond) + default: + + } + + var subUserId = make(map[int64]string) + var list []*model.FissionUser + var rowData []export.RowData + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + for _, v := range list { + subUserId[v.ID] = v.SubUserID + rowData = append(rowData, export.RowData{ + "sub_user_id": v.SubUserID, + "pid": subUserId[v.ParentID], + "created_date": carbon.CreateFromTimestamp(v.CreatedAt).ToShortDateString(), + "is_new": utils.Ternary[string](v.IsNew == mtype.Yes, "是", "否"), + }) + } + + return nil + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "pid", Title: "上级"}, + {Field: "created_date", Title: "绑定关系链成功时间"}, + {Field: "is_new", Title: "是否新下载"}, + } + + return s._eptFile(header, rowData) +} + +func (s *fissionUser) dice(cpnId int64, cond []gen.Condition) (path string, err error) { + m := s.GetDao().FissionUser.SubTable(cpnId) + + var channelTitle = make(map[int64]string) + var subUserId = make(map[int64]string) + var list []*model.FissionUser + var rowData []export.RowData + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + + var userIds, channelIds []int64 + for _, v := range list { + userIds = append(userIds, v.ID) + + if _, ok := channelTitle[v.ChannelID]; !ok { + channelTitle[v.ChannelID] = "" + channelIds = append(channelIds, v.ChannelID) + } + } + + if len(channelIds) > 0 { + channelM := s.GetDao().FissionCampaignChannel + channelList, err1 := channelM.WithContext(s.Ctx).Where(channelM.ID.In(channelIds...)).Find() + if err1 != nil { + return err1 + } + for _, v := range channelList { + channelTitle[v.ID] = v.Title + } + } + + diceM := s.GetDao().FissionDice + diceList, err1 := diceM.WithContext(s.Ctx).Where(diceM.UserID.In(userIds...)).Find() + if err1 != nil { + return err1 + } + + var diceMap = make(map[int64]int32) + for _, v := range diceList { + diceMap[v.UserID] = v.Chance + } + + propM := s.GetDao().FissionDiceProp + propList, err1 := propM.WithContext(s.Ctx).Where(propM.UserID.In(userIds...), propM.Mark.Eq(mtype.FissionDicePropMarkFixedRoll)).Find() + if err1 != nil { + return err1 + } + + var propMap = make(map[int64]int32) + for _, v := range propList { + propMap[v.UserID] = v.Num + } + + for _, v := range list { + subUserId[v.ID] = v.SubUserID + rowData = append(rowData, export.RowData{ + "sub_user_id": v.SubUserID, + "remain_dice": diceMap[v.ID], + "remain_lucky": propMap[v.ID], + "pid": subUserId[v.ParentID], + "created_date": carbon.CreateFromTimestamp(v.CreatedAt).Format(consts.YmdHs), + "channel_title": channelTitle[v.ChannelID], + "help_status": utils.Ternary(v.IsHelp == mtype.Yes, "成功", "-"), + "source": mtype.FissionUserSource[v.Source], + }) + } + + return nil + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "remain_dice", Title: "剩余骰子数"}, + {Field: "remain_lucky", Title: "剩余幸运骰数"}, + {Field: "created_date", Title: "参与时间"}, + {Field: "channel_title", Title: "渠道"}, + {Field: "pid", Title: "上级用户ID"}, + {Field: "source", Title: "参与方式"}, + //{Field: "help_status", Title: "助力状态"}, + } + + return s._eptFile(header, rowData) +} + +func (s *fissionUser) quiz(cpn *model.FissionCampaign, cond []gen.Condition) (path string, err error) { + m := s.GetDao().FissionUser.SubTable(cpn.ID) + + optionM := s.GetDao().FissionCampaignQuizOption + options, err := optionM.WithContext(s.Ctx).Where(optionM.CampaignID.Eq(cpn.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var optionMap = make(map[int64]string) + for _, v := range options { + optionMap[v.ID] = v.Title + } + + var subUserId = make(map[int64]string) + var list []*model.FissionUser + var rowData []export.RowData + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + playerM := s.GetDao().FissionQuiz + players, err1 := playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err1 != nil { + return err1 + } + + var playerMap = make(map[int64]*model.FissionQuiz) + for _, v := range players { + playerMap[v.UserID] = v + } + + for _, v := range list { + subUserId[v.ID] = v.SubUserID + + one := export.RowData{ + "sub_user_id": v.SubUserID, + "pid": subUserId[v.ParentID], + "created_date": carbon.CreateFromTimestamp(v.CreatedAt).Format(consts.YmdHs), + "is_new": utils.Ternary(v.IsNew == mtype.Yes, "是", "否"), + "lack_num": 0, + "option_title": "", + } + + if player, ok := playerMap[v.ID]; ok { + one["lack_num"] = player.Chance + one["option_title"] = utils.Ternary[string](player.OptionID == 0, "-", optionMap[player.OptionID]) + } + + rowData = append(rowData, one) + } + + return nil + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "pid", Title: "上级"}, + {Field: "created_date", Title: "绑定关系链成功时间"}, + {Field: "is_new", Title: "是否新下载"}, + {Field: "option_title", Title: "投票选项"}, + {Field: "lack_num", Title: "剩余票数"}, + } + + return s._eptFile(header, rowData) +} diff --git a/internal/service/queue/consumer/campaignnotice/export/fission_user_stat.go b/internal/service/queue/consumer/campaignnotice/export/fission_user_stat.go new file mode 100644 index 0000000..21c3ec2 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/fission_user_stat.go @@ -0,0 +1,889 @@ +package export + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/export/xlsx" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + pb "joybuywork/proto/go_proto/w_common" + "fmt" + "strings" + + "gorm.io/gen" + "gorm.io/gen/field" +) + +const ( + inviteType = "invite" + taskType = "task" + growType = "grow" + helpType = "help" +) + +type fissionUserStat struct { + base + + rewardTitle map[int64]string +} + +func (s *fissionUserStat) Export() (path string, err error) { + var data pb.DownloadReq_FissionUserStat + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + switch data.GetType() { + case inviteType: + return s.fixed(&data) + case taskType: + return s.custom(&data) + case growType: + return s.grow(&data) + case helpType: + return s.help(&data) + default: + return s.old(&data) + } +} + +// 拉新 +func (s *fissionUserStat) fixed(data *pb.DownloadReq_FissionUserStat) (path string, err error) { + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var header = export.HeaderField{ + {Field: "device_id", Title: "用户设备ID"}, + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "direct_num", Title: "直接下级数量"}, + {Field: "indirect_num", Title: "间接下载数量"}, + {Field: "user_ids", Title: "直接下级的用户ID"}, + } + + m := s.GetDao().FissionUserStat + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.EffectiveNum.Gt(0), + } + + count, err := m.WithContext(s.Ctx). + Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, header, count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + var list []*model.FissionUserStat + err = m.WithContext(s.Ctx).Where(cond...). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + var userIdMap map[int64]*model.FissionUser + userIdMap, err = s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var childMap map[int64][]string + childMap, err = s._getChild(cpn.ID, ids) + if err != nil { + return + } + + for _, v := range list { + one := export.RowData{ + "device_id": "", + "sub_user_id": "", + "direct_num": v.DirectNum, + "indirect_num": v.IndirectNum, + "user_ids": strings.Join(childMap[v.UserID], ";"), + } + + if user, ok := userIdMap[v.UserID]; ok { + one["sub_user_id"] = user.SubUserID + one["device_id"] = user.DeviceID + } + + rowData = append(rowData, one) + } + ept.AppendData(rowData) + return + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +// 拿到用户的sub +func (s *fissionUserStat) _getUserId(cpnId int64, ids []int64) (data map[int64]*model.FissionUser, err error) { + + m := s.GetDao().FissionUser.SubTable(cpnId) + + userList, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + data = make(map[int64]*model.FissionUser, len(userList)) + for _, v := range userList { + data[v.ID] = v + } + return +} + +func (s *fissionUserStat) _getChild(cpnId int64, ids []int64) (childMap map[int64][]string, err error) { + + m := s.GetDao().FissionUser.SubTable(cpnId) + + cl, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.ParentID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + childMap = make(map[int64][]string) + for _, v := range cl { + childMap[v.ParentID] = append(childMap[v.ParentID], v.SubUserID) + } + + return +} + +// 任务 +func (s *fissionUserStat) custom(data *pb.DownloadReq_FissionUserStat) (path string, err error) { + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "target_num", Title: "达标次数"}, + } + + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.Ctx). + Where( + condM.CampaignID.Eq(cpn.ID), + condM.WithContext(s.Ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range conds { + header = append(header, export.HeaderFieldOne{ + Field: fmt.Sprintf("cond_id:%d", v.ID), + Title: fmt.Sprintf("%s完成次数", v.Desc), + }) + } + + m := s.GetDao().FissionUserStat + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.TargetNum.Gt(0), + } + + count, err := m.WithContext(s.Ctx). + Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if err = s._checkCount(count); err != nil { + return + } + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, header, count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + var list []*model.FissionUserStat + err = m.WithContext(s.Ctx). + Where(cond...). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + var userIdMap map[int64]*model.FissionUser + userIdMap, err = s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var condDetail map[int64]map[int64]int64 + condDetail, err = s._getCondDetail(ids) + if err != nil { + return + } + + for _, v := range list { + one := export.RowData{ + "sub_user_id": "", + "target_num": v.TargetNum, + } + + if user, ok := userIdMap[v.UserID]; ok { + one["sub_user_id"] = user.SubUserID + } + + if detail, ok := condDetail[v.UserID]; ok { + for condId, num := range detail { + one[fmt.Sprintf("cond_id:%d", condId)] = num + } + } + + rowData = append(rowData, one) + } + + ept.AppendData(rowData) + + return + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +func (s *fissionUserStat) _getCondDetail(ids []int64) (condDetail map[int64]map[int64]int64, err error) { + condDetail = make(map[int64]map[int64]int64) + m := s.GetDao().FissionUserCond + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + + if v.Num == 0 { + continue + } + + if _, ok := condDetail[v.UserID]; !ok { + condDetail[v.UserID] = map[int64]int64{ + v.CondID: v.Num, + } + } else { + condDetail[v.UserID][v.CondID] = v.Num + } + } + + return +} + +// 养成 +func (s *fissionUserStat) grow(data *pb.DownloadReq_FissionUserStat) (path string, err error) { + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "grow_reward_num", Title: "养成次数"}, + {Field: "reward_detail", Title: "养成详情"}, + {Field: "grow_num", Title: "领养次数"}, + {Field: "grow_detail", Title: "领养详情"}, + } + + m := s.GetDao().FissionUserStat + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.GrowRewardNum.Gt(0), + } + + count, err := m.WithContext(s.Ctx). + Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, header, count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + var rowData []export.RowData + var list []*model.FissionUserStat + err = m.WithContext(s.Ctx). + Where(cond...). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + var userIdMap map[int64]*model.FissionUser + userIdMap, err = s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var reward, grow map[int64][]string + reward, grow, err = s._getGrowLife(cpn.ID, ids) + if err != nil { + return + } + + for _, v := range list { + one := export.RowData{ + "sub_user_id": "", + "grow_reward_num": v.GrowRewardNum, + "grow_num": v.GrowNum, + } + + if user, ok := userIdMap[v.UserID]; ok { + one["sub_user_id"] = user.SubUserID + } + + if detail, ok := reward[v.UserID]; ok { + one["reward_detail"] = strings.Join(detail, "\r\n") + } + + if detail, ok := grow[v.UserID]; ok { + one["grow_detail"] = strings.Join(detail, "\r\n") + } + + rowData = append(rowData, one) + } + + ept.AppendData(rowData) + return + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +func (s *fissionUserStat) _getGrowLife(cpnId int64, userIds []int64) (reward, grow map[int64][]string, err error) { + + m := s.GetDao().FissionGrowLife + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(userIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userGrowNum = make(map[int64]map[int64]int64) + var userRewardNum = make(map[int64]map[int64]int64) + + for _, v := range list { + if _, ok := userGrowNum[v.UserID]; !ok { + userGrowNum[v.UserID] = map[int64]int64{ + v.RewardID: 1, + } + } else { + userGrowNum[v.UserID][v.RewardID]++ + } + + if _, ok := userRewardNum[v.UserID]; !ok && v.RecordID > 0 { + userRewardNum[v.UserID] = map[int64]int64{ + v.RewardID: 1, + } + } else { + userRewardNum[v.UserID][v.RewardID]++ + } + } + + rewardTitle, err := s._getRewardTitle(cpnId) + if err != nil { + return + } + + reward, grow = make(map[int64][]string, len(userRewardNum)), make(map[int64][]string, len(userGrowNum)) + + for userId, rewards := range userRewardNum { + reward[userId] = make([]string, 0, len(rewards)) + for rewardId, num := range rewards { + reward[userId] = append(reward[userId], fmt.Sprintf("%s %d", rewardTitle[rewardId], num)) + } + } + + for userId, rewards := range userGrowNum { + grow[userId] = make([]string, 0, len(rewards)) + for rewardId, num := range rewards { + grow[userId] = append(grow[userId], fmt.Sprintf("%s %d", rewardTitle[rewardId], num)) + } + } + + return +} + +func (s *fissionUserStat) _getRewardTitle(cpnId int64) (title map[int64]string, err error) { + if s.rewardTitle != nil { + return s.rewardTitle, nil + } + + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ids []int64 + var rewardMap = make(map[int64]string) + for _, v := range list { + if _, ok := rewardMap[v.RewardID]; !ok { + ids = append(ids, v.RewardID) + rewardMap[v.RewardID] = "" + } + } + + rewardM := s.GetDao().Reward + rewards, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range rewards { + rewardMap[v.ID] = v.RewardTitle + } + + s.rewardTitle = make(map[int64]string, len(list)) + for _, v := range list { + s.rewardTitle[v.ID] = rewardMap[v.RewardID] + } + + return s.rewardTitle, nil +} + +// 旧报表的排行榜导出 +func (s *fissionUserStat) old(data *pb.DownloadReq_FissionUserStat) (path string, err error) { + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionUserStat + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.IsDel.Eq(mtype.No), + } + + var order []field.Expr + var t int32 = consts.FissionRankTypeSelfTask + + switch cpn.FissionID { + case consts.IdSignIn: + t = consts.FissionRankTypeSign + order = append(order, m.SignNum.Desc(), m.SignRewardNum.Desc(), m.ID) + cond = append(cond, m.SignNum.Gt(0)) + case consts.IdGrow: + t = consts.FissionRankTypeGrow + order = append(order, m.GrowNum.Desc(), m.GrowRewardNum.Desc(), m.ID) + cond = append(cond, m.GrowNum.Gt(0)) + default: + switch conf.Option { + case mtype.FissionCampaignConfigTargetOptionApp: + t = utils.Ternary[int32](conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister, consts.FissionRankTypeRegister, consts.FissionRankTypeInstall) + case mtype.FissionCampaignConfigTargetOptionFriend: + t = consts.FissionRankTypeFriendTarget + } + + if conf.Target == mtype.FissionCampaignConfigTargetUp { + order = append(order, m.TargetNum.Desc(), m.IndirectTargetNum.Desc(), m.ID) + cond = append(cond, m.TargetNum.Gt(0)) + } else { + order = append(order, m.EffectiveNum.Desc(), m.IndirectEffectiveNum.Desc(), m.ID) + cond = append(cond, m.EffectiveNum.Gt(0)) + } + } + + list, err := m.WithContext(s.Ctx).Where(cond...).Order(order...).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.UserID) + } + + userM := s.GetDao().FissionUser.SubTable(cpn.ID) + var userIdMap = make(map[int64]string) + var userList []*model.FissionUser + if len(ids) > 0 { + userList, err = userM.WithContext(s.Ctx).Where(userM.CampaignID.Eq(cpn.ID), userM.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range userList { + userIdMap[v.ID] = v.SubUserID + } + } + + switch t { + case 1, 2: //下载注册 + var childList []*model.FissionUser + var childMap = make(map[int64][]string) + if len(userList) > 0 { + childList, err = userM.WithContext(s.Ctx).Where(userM.CampaignID.Eq(cpn.ID), userM.ParentID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range childList { + childMap[v.ParentID] = append(childMap[v.ParentID], v.SubUserID) + } + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "direct_num", Title: "直接下级数量"}, + {Field: "indirect_num", Title: "间接下载数量"}, + {Field: "user_ids", Title: "直接下级的user_id"}, + } + + var rowData []export.RowData + for _, v := range list { + rowData = append(rowData, export.RowData{ + "sub_user_id": userIdMap[v.UserID], + "direct_num": v.DirectNum, + "indirect_num": v.IndirectNum, + "user_ids": strings.Join(childMap[v.UserID], ";"), + }) + } + return s._eptFile(header, rowData) + case 3: //好友完成任务 + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "target_num", Title: "直邀达标人数"}, + {Field: "indirect_target_num", Title: "间接邀请达标人数"}, + } + + var rowData []export.RowData + for _, v := range list { + rowData = append(rowData, export.RowData{ + "sub_user_id": userIdMap[v.UserID], + "target_num": v.TargetNum, + "indirect_target_num": v.IndirectTargetNum, + }) + } + + return s._eptFile(header, rowData) + case 4: // 自己做任务 + var condStr = make(map[int64]string) + var userConds []*model.FissionUserCond + userCondM := s.GetDao().FissionUserCond + userConds, err = userCondM.WithContext(s.Ctx).Where(userCondM.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userCondMap = make(map[int64]map[int64]int64) + for _, v := range userConds { + + if _, ok := userCondMap[v.UserID]; !ok { + userCondMap[v.UserID] = map[int64]int64{v.CondID: v.Num} + } else { + userCondMap[v.UserID][v.CondID] = v.Num + } + } + + var conds []*model.FissionCampaignCond + condM := s.GetDao().FissionCampaignCond + conds, err = condM.WithContext(s.Ctx).Where(condM.CampaignID.Eq(cpn.ID), condM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, id := range ids { + for _, v := range conds { + num, _ := userCondMap[id][v.ID] + condStr[id] += fmt.Sprintf("%s:%d\n", v.Desc, num) + } + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "target_num", Title: "达标次数"}, + } + + var rowData []export.RowData + for _, v := range list { + rowData = append(rowData, export.RowData{ + "sub_user_id": userIdMap[v.UserID], + "target_num": condStr[v.UserID], + }) + } + + return s._eptFile(header, rowData) + case 5: + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "sign_reward_num", Title: "签到达标次数"}, + {Field: "sign_num", Title: "签到总次数"}, + } + + var rowData []export.RowData + for _, v := range list { + rowData = append(rowData, export.RowData{ + "sub_user_id": userIdMap[v.UserID], + "sign_reward_num": v.SignRewardNum, + "sign_num": v.SignNum, + }) + } + return s._eptFile(header, rowData) + case 6: + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户id"}, + {Field: "grow_num", Title: "参与次数"}, + {Field: "grow_reward_num", Title: "养成次数"}, + } + + var rowData []export.RowData + for _, v := range list { + rowData = append(rowData, export.RowData{ + "sub_user_id": userIdMap[v.UserID], + "grow_num": v.GrowNum, + "grow_reward_num": v.GrowRewardNum, + }) + } + return s._eptFile(header, rowData) + } + + return s._eptFile(export.HeaderField{{ + Field: "none", + Title: "暂不支持该类型导出", + }}, nil) +} + +func (s *fissionUserStat) help(data *pb.DownloadReq_FissionUserStat) (path string, err error) { + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var header = export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "num", Title: "获得助力次数"}, + } + + ticketM := s.GetDao().FissionCampaignTicket + ticket, err := ticketM.WithContext(s.Ctx).Where( + ticketM.CampaignID.Eq(cpn.ID), + ticketM.Open.Eq(mtype.Yes), + ticketM.Mark.Eq(mtype.FissionCampaignTicketRewardHelp), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var helpEvent = ticket.GetHelpEvent() + for _, mark := range helpEvent { + switch mark { + case mtype.FissionCampaignTicketHelpEventOpen: + header = append(header, export.HeaderFieldOne{ + Field: mark, + Title: "拉日活助力", + }) + case mtype.FissionCampaignTicketHelpEventClick: + header = append(header, export.HeaderFieldOne{ + Field: mark, + Title: "点击助力", + }) + case mtype.FissionCampaignTicketHelpEventInstall: + header = append(header, export.HeaderFieldOne{ + Field: mark, + Title: "下载助力", + }) + case mtype.FissionCampaignTicketHelpEventRegister: + header = append(header, export.HeaderFieldOne{ + Field: mark, + Title: "注册助力", + }) + } + } + + m := s.GetDao().FissionUserStat + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.HelpNum.Gt(0), + } + + count, err := m.WithContext(s.Ctx). + Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 导出任务 + ept, err := xlsx.NewExport(s.Ctx, header, count).UpgradeTask() + if err != nil { + return + } + ept.Done() + + var list []*model.FissionUserStat + err = m.WithContext(s.Ctx). + Where(cond...). + FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.UserID) + } + + var userIdMap map[int64]*model.FissionUser + userIdMap, err = s._getUserId(cpn.ID, ids) + if err != nil { + return + } + + var chopHelp map[int64]map[string]int64 + chopHelp, err = s._getChopHelp(ids) + if err != nil { + return + } + + for _, v := range list { + one := export.RowData{ + "sub_user_id": "", + "num": v.HelpNum, + } + + for _, event := range helpEvent { + one[event] = 0 + } + + if user, ok := userIdMap[v.UserID]; ok { + one["sub_user_id"] = user.SubUserID + } + + for mark, num := range chopHelp[v.UserID] { + one[mark] = num + } + + rowData = append(rowData, one) + } + ept.AppendData(rowData) + return + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +type HelpNum struct { + UserID int64 `json:"user_id"` + Mark string `json:"mark"` + Num int64 `json:"num"` +} + +func (s *fissionUserStat) _getChopHelp(userIds []int64) (data map[int64]map[string]int64, err error) { + if len(userIds) == 0 { + return + } + m := s.GetDao().FissionChopHelp + + var nums []*HelpNum + + err = m.WithContext(s.Ctx).Select( + m.ID.Count().As("num"), + m.UserID, + m.Mark, + ).Where(m.UserID.In(userIds...)).Group(m.UserID, m.Mark).Scan(&nums) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + data = make(map[int64]map[string]int64) + for _, num := range nums { + if _, ok := data[num.UserID]; !ok { + data[num.UserID] = map[string]int64{ + num.Mark: num.Num, + } + } else { + data[num.UserID][num.Mark] = num.Num + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/export/new_user_list.go b/internal/service/queue/consumer/campaignnotice/export/new_user_list.go new file mode 100644 index 0000000..337b6f5 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/export/new_user_list.go @@ -0,0 +1,1140 @@ +package export + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/export/xlsx" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_common" + "fmt" + + "gorm.io/gen" +) + +type chance2 struct { + chance int32 + expiredIn int64 + coinNum int32 +} + +type chance struct { + chance int32 + luckyChance int32 + collectNum int32 + threeNum int32 + fiveNum int32 + fixNum int32 + coinGet int32 + coinUse int32 + rewardTitle string + percent string + isNewcomer string + chance2 map[string]*chance2 + chance3 map[int64]*chance2 +} + +type newUserList struct { + base +} + +func (s *newUserList) Export() (path string, err error) { + var data pb.DownloadReq_NewUserList + + err = jsonm.Unmarshal(s.Req.Cond, &data) + if err != nil { + return + } + + cpn, err := finder.Campaign(s.Ctx, data.CampaignHashId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + tz := utils.STernary(data.GetTOffset(), consts.DefaultTz, cpn.TOffset) + data.Start = timez.GMT(data.Start, tz) + data.End = timez.GMT(data.End, tz) + + m := s.GetDao().FissionUser.SubTable(cpn.ID) + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.IsView.Eq(mtype.No), + m.CampaignID.Eq(cpn.ID), + } + + if !verify.EmptyString(data.GetUserMark()) { + cond = append(cond, m.UserMark.Eq(data.GetUserMark())) + } + + if data.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(data.GetStart())) + } + + if data.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(data.GetEnd())) + } + + if data.GetSource() > 0 { + cond = append(cond, m.Source.Eq(int8(data.GetSource()))) + } + + if data.GetLangMark() != "" { + cond = append(cond, m.LangMark.Eq(data.GetLangMark())) + } + + if data.GetParentUserMark() != "" { + var puser *model.FissionUser + puser, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(data.GetParentUserMark()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if puser == nil { + cond = append(cond, m.ID.Eq(-1)) + } else { + cond = append(cond, m.ParentID.Eq(puser.ID)) + } + } + + if data.GetPidType() != 0 { + switch data.GetPidType() { + case 1: + cond = append(cond, m.ParentID.Gt(0)) + case 2: + cond = append(cond, m.ParentID.Eq(0)) + } + } + + if data.GetJoinType() != 0 { + switch data.GetJoinType() { + case 1: + cond = append(cond, m.JoinAt.Gt(0)) + case 2: + cond = append(cond, m.JoinAt.Eq(0)) + } + } + + if len(data.GetUserCond()) > 0 { + for _, v := range data.GetUserCond() { + switch v { + case mtype.FissionUserStateDataCondInstall: + cond = append(cond, m.InstallAt.Gt(0)) + case mtype.FissionUserStateDataCondRegister: + cond = append(cond, m.RegisterAt.Gt(0)) + default: + cond = append(cond, m.ID.Eq(0)) + } + } + } + + count, err := m.WithContext(s.Ctx).Where(cond...).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if err = s._checkCount(count); err != nil { + return + } + + // 导出任务 + fp := export.NewRedisPart(s.Ctx, app.Redis.Cache, ckey.ExportKey(s.Req.TaskId)) + ept, err := xlsx.NewExport(s.Ctx, s.baseHeader(cpn.ID, cpn.FissionID, cpn.TOffset), count).UpgradeTask(fp.FinishPart(50)) + if err != nil { + return + } + ept.Done() + + //找上级用户数据 + var ( + userMap = make(map[int64]string) + channelMap = make(map[int64]string) + lvTitleMap = make(map[int64]string) + helpFailMark = make(map[int64]string) + ) + + var list []*model.FissionUser + err = m.WithContext(s.Ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) (err error) { + var rowData = make([]export.RowData, 0, len(list)) + var pids, ids, channelIds, lvIds []int64 + var ( + platformMap = make(map[int64]string) + chanceMap = make(map[int64]*chance) + statNumMap = make(map[int64]*model.FissionUserStat) + ) + for _, v := range list { + ids = append(ids, v.ID) + statNumMap[v.ID] = nil + chanceMap[v.ID] = nil + userMap[v.ID] = v.UserMark + platformMap[v.ID] = "" + if _, ok := userMap[v.ParentID]; !ok && v.ParentID > 0 { + userMap[v.ParentID] = "" + pids = append(pids, v.ParentID) + } + + if _, ok := channelMap[v.ChannelID]; !ok && v.ChannelID > 0 { + channelMap[v.ChannelID] = "" + channelIds = append(channelIds, v.ChannelID) + } + + if _, ok := lvTitleMap[v.UserLevel]; !ok && v.UserLevel > 0 { + lvTitleMap[v.UserLevel] = "" + lvIds = append(lvIds, v.UserLevel) + } + } + + err = s._parentMap(cpn.ID, pids, userMap) + if err != nil { + return + } + + err = s._statMap(ids, statNumMap) + if err != nil { + return + } + + err = s._channelMap(channelIds, channelMap) + if err != nil { + return + } + + err = s._chanceMap(cpn, ids, chanceMap) + if err != nil { + return + } + + err = s._platformMap(cpn, ids, platformMap) + if err != nil { + return + } + + err = s._lvTitleMap(lvIds, lvTitleMap) + if err != nil { + return + } + + err = s._helpMap(cpn, list, helpFailMark) + if err != nil { + return + } + + for _, v := range list { + one := export.RowData{ + "sub_user_id": v.SubUserID, + "device_id": v.DeviceID, + "created_date": timez.GMTTime(tz, v.CreatedAt).Format(timez.ListDate), + "lang": v.LangMark, + "lv": lvTitleMap[v.UserLevel], + "country": v.UserCountry, + "platform": platformMap[v.ID], + "parent_user_id": utils.Ternary[string](v.ParentID == 0, "-", userMap[v.ParentID]), + "is_new": utils.Ternary[string](v.IsNew == mtype.Yes, "是", "否"), + "channel": channelMap[v.ChannelID], + "source": mtype.FissionUserSource[v.Source], + "chance": 0, + "lucky_chance": 0, + "invite_num": 0, + "effect_num": 0, + "help_status": "", + "join_at": "", + "install_at": "", + "register_at": "", + } + + if v.JoinAt > 0 { + one["join_at"] = timez.GMTTime(tz, v.JoinAt).Format(timez.ListDate) + } + + if v.InstallAt > 0 { + one["install_at"] = timez.GMTTime(tz, v.InstallAt).Format(timez.ListDate) + } + + if v.RegisterAt > 0 { + one["register_at"] = timez.GMTTime(tz, v.RegisterAt).Format(timez.ListDate) + } + + if helpMark, ok := helpFailMark[v.ID]; ok { + switch helpMark { + case "": + one["help_status"] = "助力成功" + case "-": + one["help_status"] = "-" + default: + one["help_status"] = consts.HelpStatusTitle[helpMark] + } + } + + if stat, ok := statNumMap[v.ID]; ok && stat != nil { + one["invite_num"] = stat.DirectNum + one["effect_num"] = stat.EffectiveNum + } + + if c, ok := chanceMap[v.ID]; ok && c != nil { + one["chance"] = c.chance + one["lucky_chance"] = c.luckyChance + one["reward_title"] = c.rewardTitle + one["percent"] = c.percent + one["is_newcomer"] = c.isNewcomer + one["collect_num"] = c.collectNum + if c2, ok1 := c.chance2[v.LangMark]; ok1 && c2.expiredIn > 0 { + one["expired_date"] = timez.GMTTime(tz, c2.expiredIn).Format(timez.ListDate) + one["gold_num"] = c2.chance + } + one["three_num"] = c.threeNum + one["five_num"] = c.fiveNum + one["fix_num"] = c.fixNum + one["coin_get"] = c.coinGet + one["coin_use"] = c.coinUse + + switch cpn.FissionID { + case consts.IdCoin: + for mark, c3 := range c.chance3 { + one[fmt.Sprintf("%d", mark)] = fmt.Sprintf("投放次数:%d;收益:%d", c3.chance, c3.coinNum) + } + } + + } + + rowData = append(rowData, one) + } + + ept.AppendData(rowData) + return + }) + + reply := <-ept.GetReply() + + return s._yun(reply.FilePath, reply.Filename, count) +} + +func (s *newUserList) baseHeader(cpnId, fissionId int64, tOffset int32) export.HeaderField { + + bh := export.HeaderField{ + {Field: "sub_user_id", Title: "用户ID"}, + {Field: "device_id", Title: "用户设备ID"}, + } + + bh = append(bh, s._fissionHeader(cpnId, fissionId, tOffset)...) + + bh = append(bh, export.HeaderFieldOne{ + Field: "created_date", + Title: "参与时间", + }, export.HeaderFieldOne{ + Field: "lang", + Title: "用户语种", + }) + + bh = append(bh, s._attrHeader(cpnId)...) + + bh = append(bh, export.HeaderFieldOne{ + Field: "platform", + Title: "操作系统", + }, export.HeaderFieldOne{ + Field: "parent_user_id", + Title: "上级用户ID", + }) + + bh = append(bh, s._inviteHeader(cpnId, fissionId)...) + + bh = append(bh, export.HeaderFieldOne{ + Field: "channel", + Title: "渠道", + }, export.HeaderFieldOne{ + Field: "source", + Title: "参与方式", + }, export.HeaderFieldOne{ + Field: "join_at", + Title: "首次访问活动", + }, export.HeaderFieldOne{ + Field: "install_at", + Title: "首次安装", + }, export.HeaderFieldOne{ + Field: "register_at", + Title: "首次注册", + }) + + return bh +} + +func (s *newUserList) _fissionHeader(cpnId, fissionId int64, tOffset int32) export.HeaderField { + switch fissionId { + case consts.IdDice: + header := export.HeaderField{ + {Field: "chance", Title: "剩余骰子数"}, + } + + m := s.GetDao().FissionCampaignDice + conf, _ := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Take() + if conf != nil { + header = append(header, export.HeaderFieldOne{Field: "lucky_chance", Title: "剩余幸运骰数"}) + } + + return header + case consts.IdGrow: + return export.HeaderField{ + {Field: "chance", Title: "剩余养成道具数"}, + } + case consts.IdQaVideo, consts.IdQaAudio, consts.IdQa, consts.IdPrizeAnswer: + return export.HeaderField{ + {Field: "chance", Title: "剩余答题次数"}, + } + case consts.IdChop: + return export.HeaderField{ + {Field: "reward_title", Title: "当前助力奖品"}, + {Field: "percent", Title: "助力进度"}, + } + case consts.IdWinTogether: + return export.HeaderField{ + {Field: "is_newcomer", Title: "新人用户"}, + } + case consts.IdReferral: + return export.HeaderField{} + case consts.IdKeep: + return export.HeaderField{ + {Field: "reward_title", Title: "最终奖品"}, + {Field: "collect_num", Title: "收集爱心"}, + {Field: "chance", Title: "剩余狗粮"}, + } + case consts.IdCash: + return export.HeaderField{ + {Field: "expired_date", Title: "任务过期时间"}, + } + case consts.IdGold: + return export.HeaderField{ + {Field: "gold_num", Title: "获得金币数"}, + {Field: "expired_date", Title: "任务过期时间"}, + } + case consts.IdCoin: + m := s.GetDao().FissionCoinScene + var scenes []*model.FissionCoinScene + scenes, _ = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId)).Find() + gmt := utils.Ternary[string](tOffset < 0, fmt.Sprint(tOffset), fmt.Sprintf("+%d", tOffset)) + var fields = export.HeaderField{ + {Field: "chance", Title: "投放总次数"}, + {Field: "collect_num", Title: "总收益"}, + } + for _, v := range scenes { + day, _, _ := timez.GMTStartAndEndTs(tOffset, v.OpenTime) + fields = append(fields, export.HeaderFieldOne{ + Field: fmt.Sprintf("%d", v.ID), + Title: fmt.Sprintf("%s(GMT%s)", day, gmt), + }) + } + + return fields + case consts.IdSignIn: + return export.HeaderField{ + {Field: "change", Title: "签到天数"}, + {Field: "lucky_chance", Title: "最大连签"}, + } + case consts.IdVs: + return export.HeaderField{ + {Field: "chance", Title: "剩余投票次数"}, + {Field: "lucky_chance", Title: "投票次数"}, + {Field: "coin_get", Title: "积分获取数"}, + {Field: "coin_use", Title: "积分消耗数"}, + } + case consts.IdUno: + return export.HeaderField{ + {Field: "chance", Title: "剩余抽奖次数"}, + {Field: "three_num", Title: "+3卡牌道具"}, + {Field: "five_num", Title: "+5卡牌道具"}, + {Field: "fix_num", Title: "指定颜色道具"}, + } + default: + return export.HeaderField{ + {Field: "chance", Title: "剩余抽奖次数"}, + } + } +} + +func (s *newUserList) _attrHeader(cpnId int64) export.HeaderField { + conf, _ := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpnId) + switch conf.RewardGroup { + case mtype.FissionRewardGroupUserLevel, mtype.FissionRewardGroupLangAndUserLevel: + return export.HeaderField{ + {Field: "lv", Title: "用户等级"}, + } + case mtype.FissionRewardGroupCountry: + return export.HeaderField{ + {Field: "country", Title: "用户国家"}, + } + default: + return export.HeaderField{} + } +} + +func (s *newUserList) _inviteHeader(cpnId, fissionId int64) export.HeaderField { + + m := s.GetDao().FissionCampaignTicket + fixed, _ := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpnId), m.Mark.Eq(mtype.FissionCampaignTicketFixed), m.Open.Eq(mtype.Yes)).Take() + + if fixed == nil && !verify.InArray(fissionId, consts.IdReferral, consts.IdWinTogether) { + return export.HeaderField{} + } + + return export.HeaderField{ + {Field: "invite_num", Title: "总邀请人数"}, + {Field: "effect_num", Title: "有效邀请人数"}, + {Field: "help_status", Title: "助力状态"}, + } +} + +// 父级数据 +func (s *newUserList) _parentMap(cpnId int64, ids []int64, userMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + m := s.GetDao().FissionUser.SubTable(cpnId) + + //找上级数据 + userList, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range userList { + userMap[v.ID] = v.UserMark + } + + return +} + +// 统计数据 +func (s *newUserList) _statMap(ids []int64, statNumMap map[int64]*model.FissionUserStat) (err error) { + if len(ids) == 0 { + return + } + + //统计数据 + statM := s.GetDao().FissionUserStat + statList, err := statM.WithContext(s.Ctx).Where(statM.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range statList { + statNumMap[v.UserID] = v + } + + return +} + +// 剩余活动次数 +func (s *newUserList) _chanceMap(cpn *model.FissionCampaign, ids []int64, chanceMap map[int64]*chance) (err error) { + + switch cpn.FissionID { + case consts.IdBlindBox: + m := s.GetDao().FissionBlind + var list []*model.FissionBlind + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdLuckyGrid: + m := s.GetDao().FissionGrid + var list []*model.FissionGrid + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdSlotMachine: + m := s.GetDao().FissionSlot + var list []*model.FissionSlot + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdPrizeWheel: + m := s.GetDao().FissionPrizeWheel + var list []*model.FissionPrizeWheel + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdFlip: + m := s.GetDao().FissionFlip + var list []*model.FissionFlip + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdBallot: + m := s.GetDao().FissionBallot + var list []*model.FissionBallot + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdDice: + m := s.GetDao().FissionDice + var list []*model.FissionDice + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + + pm := s.GetDao().FissionDiceProp + var pList []*model.FissionDiceProp + pList, err = pm.WithContext(s.Ctx).Where(pm.UserID.In(ids...), pm.Mark.Eq(mtype.FissionDicePropMarkFixedRoll)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range pList { + chanceMap[v.UserID].luckyChance = v.Num + } + case consts.IdGrow: + m := s.GetDao().FissionGrow + var list []*model.FissionGrow + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.GrowNum} + } + case consts.IdChop: + return s._chop(ids, chanceMap) + case consts.IdWinTogether: + m := s.GetDao().FissionWin + var list []*model.FissionWin + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{isNewcomer: utils.Ternary[string](v.IsNewcomer == mtype.Yes, "是", "否")} + } + case consts.IdKeep: + return s._keep(ids, chanceMap) + case consts.IdCash: + return s._cash(ids, chanceMap) + case consts.IdGold: + return s._gold(ids, chanceMap) + case consts.IdQa, consts.IdQaVideo, consts.IdQaAudio, consts.IdPrizeAnswer: + m := s.GetDao().FissionQa + var list []*model.FissionQa + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{chance: v.Chance} + } + case consts.IdCoin: + return s._coin(ids, chanceMap) + case consts.IdSignIn: + m := s.GetDao().FissionSign + var list []*model.FissionSign + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{ + chance: v.SignDay, + luckyChance: v.MaxContinue, + } + } + case consts.IdVs: + m := s.GetDao().FissionV + var list []*model.FissionV + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{ + chance: v.Chance, + luckyChance: v.VoteNum, + coinGet: v.CoinGet, + coinUse: v.CoinUse, + } + } + case consts.IdUno: + m := s.GetDao().FissionUno + var list []*model.FissionUno + list, err = m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + for _, v := range list { + chanceMap[v.UserID] = &chance{ + chance: v.Chance, + threeNum: v.ThreeNum, + fiveNum: v.FiveNum, + fixNum: v.FixNum, + } + } + default: + return + } + + return +} + +func (s *newUserList) _cash(ids []int64, chanceMap map[int64]*chance) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCash + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + if cash, ok := chanceMap[v.UserID]; !ok || cash == nil { + chanceMap[v.UserID] = &chance{ + chance2: map[string]*chance2{ + v.Lang: { + expiredIn: v.ExpiredIn, + }, + }, + } + } else { + if c2, ok1 := chanceMap[v.UserID].chance2[v.Lang]; !ok1 || c2 == nil { + chanceMap[v.UserID].chance2[v.Lang] = &chance2{ + expiredIn: v.ExpiredIn, + } + } else { + chanceMap[v.UserID].chance2[v.Lang].expiredIn = v.ExpiredIn + } + + } + } + + return +} + +func (s *newUserList) _gold(ids []int64, chanceMap map[int64]*chance) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionGold + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + if gold, ok := chanceMap[v.UserID]; !ok || gold == nil { + chanceMap[v.UserID] = &chance{ + chance2: map[string]*chance2{ + v.Lang: { + chance: v.GoldNum, + expiredIn: v.ExpiredIn, + }, + }, + } + } else { + + if c2, ok1 := chanceMap[v.UserID].chance2[v.Lang]; !ok1 || c2 == nil { + chanceMap[v.UserID].chance2[v.Lang] = &chance2{ + expiredIn: v.ExpiredIn, + chance: v.GoldNum, + } + } else { + chanceMap[v.UserID].chance2[v.Lang].expiredIn = v.ExpiredIn + chanceMap[v.UserID].chance2[v.Lang].chance = v.GoldNum + } + } + } + + return +} + +func (s *newUserList) _coin(ids []int64, chanceMap map[int64]*chance) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCoin + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + if coin, ok := chanceMap[v.UserID]; !ok || coin == nil { + chanceMap[v.UserID] = &chance{ + chance: v.UseNum, + collectNum: v.GetCoin, + chance3: map[int64]*chance2{ + v.SceneID: { + chance: v.UseNum, + coinNum: v.GetCoin, + }, + }, + } + } else { + + chanceMap[v.UserID].collectNum += v.GetCoin + chanceMap[v.UserID].chance += v.UseNum + + if c3, ok1 := chanceMap[v.UserID].chance3[v.SceneID]; !ok1 || c3 == nil { + chanceMap[v.UserID].chance3[v.SceneID] = &chance2{ + coinNum: v.GetCoin, + chance: v.UseNum, + } + } else { + chanceMap[v.UserID].chance3[v.SceneID].coinNum = v.GetCoin + chanceMap[v.UserID].chance3[v.SceneID].chance = v.UseNum + } + } + } + + return +} + +func (s *newUserList) _keep(ids []int64, chanceMap map[int64]*chance) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionKeep + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var rewardMap = make(map[int64]string) + var rewardIds []int64 + for _, v := range list { + if _, ok := rewardMap[v.RewardID]; !ok { + rewardMap[v.RewardID] = "" + rewardIds = append(rewardIds, v.RewardID) + } + } + + rewardTitleMap, err := s._getRewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range list { + chanceMap[v.UserID] = &chance{ + chance: v.Num, + collectNum: v.CollectNum, + rewardTitle: rewardTitleMap[v.RewardID], + } + } + + return +} + +func (s *newUserList) _chop(ids []int64, chanceMap map[int64]*chance) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionChop + list, err := m.WithContext(s.Ctx).Where(m.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var chopMap = make(map[int64]*model.FissionChopReward, len(list)) + var chopRewardMap = make(map[int64]string) + var chopRewardIds []int64 + for _, v := range list { + if v.ChopRewardID == 0 { + continue + } + chopRewardIds = append(chopRewardIds, v.ChopRewardID) + } + + if len(chopRewardIds) > 0 { + chopRewardM := s.GetDao().FissionChopReward + var chopRewardList []*model.FissionChopReward + chopRewardList, err = chopRewardM.WithContext(s.Ctx).Where(chopRewardM.ID.In(chopRewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardIds []int64 + for _, v := range chopRewardList { + rewardIds = append(rewardIds, v.RewardID) + chopMap[v.ID] = v + } + + var rewardTitleMap map[int64]string + rewardTitleMap, err = s._getRewardTitle(rewardIds) + if err != nil { + return + } + + for _, v := range chopRewardList { + chopRewardMap[v.ID] = rewardTitleMap[v.RewardID] + } + } + + for _, v := range list { + if chop, ok := chopMap[v.ChopRewardID]; ok { + chanceMap[v.UserID] = &chance{ + rewardTitle: chopRewardMap[chop.RewardID], + percent: fmt.Sprintf("%.2f", chop.Percent), + } + } else { + chanceMap[v.UserID] = &chance{} + } + } + + return +} + +func (s *newUserList) _channelMap(ids []int64, channelMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + channelMap[v.ID] = v.Title + } + return +} + +func (s *newUserList) _platformMap(cpn *model.FissionCampaign, ids []int64, platformMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionUserAttr + list, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.UserID.In(ids...), m.Attr.Eq(mtype.FissionUserAttrMarkPlatform)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range list { + platformMap[v.UserID] = v.Value + } + + return +} + +func (s *newUserList) _lvTitleMap(ids []int64, lvTitleMap map[int64]string) (err error) { + if len(ids) == 0 { + return + } + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + lvTitleMap[v.ID] = v.Title + } + return +} + +func (s *newUserList) _helpMap(cpn *model.FissionCampaign, users []*model.FissionUser, helpFailMark map[int64]string) (err error) { + if len(users) == 0 { + return + } + + key := ckey.FissionUserHelpFailMark(cpn.ID) + var ids []int64 + for _, user := range users { + + helpFailMark[user.ID] = "-" + if user.ParentID == 0 { + continue + } + + if user.IsHelp == mtype.Yes { + helpFailMark[user.ID] = "" + continue + } + + failMark := app.Redis.Cache.HGet(s.Ctx, key, fmt.Sprint(user.ID)).Val() + if failMark == "" { + ids = append(ids, user.ID) + continue + } + + helpFailMark[user.ID] = failMark + } + + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionCampaignTicket + tickets, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Open.Eq(mtype.Yes)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, ticket := range tickets { + + if ticket.Mark == mtype.FissionCampaignTicketFixed { + var vals []string + for _, id := range ids { + failMark := utils.Ternary[string](ticket.AppEvent == mtype.FissionCampaignTicketAppEventInstall, consts.HelpStatusNotInstall, consts.HelpStatusNotRegister) + helpFailMark[id] = failMark + vals = append(vals, fmt.Sprint(id), failMark) + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + + return + } + + if ticket.Mark == mtype.FissionCampaignTicketCustom && verify.InArray(cpn.FissionID, consts.IdReferral, consts.IdWinTogether) { + + if ticket.PreEvent == mtype.FissionCampaignTicketPreEventNone { + var vals []string + for _, id := range ids { + failMark := consts.HelpStatusNotTask + helpFailMark[id] = failMark + vals = append(vals, fmt.Sprint(id), failMark) + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + + return + } + + switch cpn.FissionID { + case consts.IdReferral: + playerM := s.GetDao().FissionReferral + var list []*model.FissionReferral + list, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var vals []string + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventInstall: + + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotInstall) + helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + + case mtype.FissionCampaignTicketAppEventRegister: + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotRegister) + helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + + case consts.IdWinTogether: + playerM := s.GetDao().FissionWin + var list []*model.FissionWin + list, err = playerM.WithContext(s.Ctx).Where(playerM.UserID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var vals []string + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventInstall: + + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotInstall) + helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + + case mtype.FissionCampaignTicketAppEventRegister: + for _, v := range list { + failMark := utils.Ternary[string](v.BindInstall == mtype.Yes, consts.HelpStatusNotTask, consts.HelpStatusNotRegister) + helpFailMark[v.UserID] = failMark + vals = append(vals, fmt.Sprint(v.UserID), failMark) + } + } + + app.Redis.Cache.HSet(s.Ctx, key, vals) + } + + return + } + + } + + return +} + +func (s *newUserList) _getRewardTitle(rewardIds []int64) (data map[int64]string, err error) { + m := s.GetDao().FissionCampaignReward + rewards, err := m.WithContext(s.Ctx).Where(m.ID.In(rewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bMap = make(map[int64]string) + var bIds []int64 + for _, v := range rewards { + if _, ok := bMap[v.RewardID]; !ok { + bIds = append(bIds, v.RewardID) + } + } + + rewardM := s.GetDao().Reward + + list, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(bIds...)).Find() + for _, v := range list { + bMap[v.ID] = v.RewardTitle + } + + data = make(map[int64]string, len(rewards)) + for _, v := range rewards { + data[v.ID] = bMap[v.RewardID] + } + return +} diff --git a/internal/service/queue/consumer/campaignnotice/game_action.go b/internal/service/queue/consumer/campaignnotice/game_action.go new file mode 100644 index 0000000..26edde7 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/game_action.go @@ -0,0 +1,345 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "time" + + "gits.branchcn.com/backend/joybuywork/proto/go_proto/workerr" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +type GameAction struct { + logic.Logic + + Req *types.GameAction +} + +func (s *GameAction) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *GameAction) Exec() (err error) { + err = s.duration() + if err != nil { + return + } + + err = s.total() + if err != nil { + return + } + + err = s.date() + if err != nil { + return + } + + return +} + +// 入库 +func (s *GameAction) duration() (err error) { + one := &model.GameAction{ + ID: s.Req.ID, + ProjectID: s.Req.ProjectId, + GameID: s.Req.GameId, + UserID: s.Req.UserId, + LinkID: s.Req.LinkId, + Type: s.Req.Type, + ActionTime: s.Req.ActionTime, + Dimension: "", + } + + one.SetDimension(&s.Req.Dimension) + + m := s.Dao().GameAction + err = m.WithContext(s.Ctx).Create(one) + if err != nil { + return + } + + return +} + +func (s *GameAction) total() (err error) { + id, err := s._getTotalId(0) + if err != nil { + return + } + + m := s.GetDao().GameTotal + var up []field.AssignExpr + switch s.Req.Type { + case mtype.GameActionTypeVisit: + var first bool + first, err = s._firstVisit(0) + if err != nil { + return + } + + up = append(up, m.Pv.Add(1)) + if first { + up = append(up, m.Uv.Add(1)) + } + + case mtype.GameActionTypeStay: + up = append(up, m.Psec.Add(int64(s.Req.Dimension.StaySec))) + } + + if len(up) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(id)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + ltId, err := s._getTotalId(s.Req.LinkId) + if err != nil { + return + } + + var ltUp []field.AssignExpr + switch s.Req.Type { + case mtype.GameActionTypeVisit: + var first bool + first, err = s._firstVisit(s.Req.LinkId) + if err != nil { + return + } + + ltUp = append(ltUp, m.Pv.Add(1)) + if first { + ltUp = append(ltUp, m.Uv.Add(1)) + } + + case mtype.GameActionTypeStay: + ltUp = append(ltUp, m.Psec.Add(int64(s.Req.Dimension.StaySec))) + } + + if len(ltUp) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(ltId)).UpdateSimple(ltUp...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *GameAction) _firstVisit(linkId int64) (first bool, err error) { + key := ckey.GameActionFirst(s.Req.ProjectId, s.Req.GameId, linkId, s.Req.UserId, mtype.GameActionTypeVisit) + if !app.Redis.Cache.SetNX(s.Ctx, key, 1, lockdo.Rand2HourExp()).Val() { + return + } + + m := s.Dao().GameAction + visit, err := m.WithContext(s.Ctx).Where( + m.ProjectID.Eq(s.Req.ProjectId), + m.GameID.Eq(s.Req.GameId), + m.LinkID.Eq(linkId), + m.UserID.Eq(s.Req.UserId), + m.Type.Eq(mtype.GameActionTypeVisit), + ).First() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if visit == nil || visit.ID == s.Req.ID { + return true, nil + } + + return +} + +func (s *GameAction) date() (err error) { + day, start, end := timez.GMTStartAndEndTs(8) + + id, err := s._getTotalDateId(0, day) + if err != nil { + return + } + + m := s.GetDao().GameTotalDate + var up []field.AssignExpr + switch s.Req.Type { + case mtype.GameActionTypeVisit: + var first bool + first, err = s._firstDateVisit(0, day, start, end) + if err != nil { + return + } + + up = append(up, m.Pv.Add(1)) + if first { + up = append(up, m.Uv.Add(1)) + } + + case mtype.GameActionTypeStay: + up = append(up, m.Psec.Add(int64(s.Req.Dimension.StaySec))) + } + + if len(up) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(id)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + ltId, err := s._getTotalDateId(s.Req.LinkId, day) + if err != nil { + return + } + + var ltUp []field.AssignExpr + switch s.Req.Type { + case mtype.GameActionTypeVisit: + var first bool + first, err = s._firstDateVisit(s.Req.LinkId, day, start, end) + if err != nil { + return + } + + ltUp = append(ltUp, m.Pv.Add(1)) + if first { + ltUp = append(ltUp, m.Uv.Add(1)) + } + + case mtype.GameActionTypeStay: + ltUp = append(ltUp, m.Psec.Add(int64(s.Req.Dimension.StaySec))) + } + + if len(ltUp) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(ltId)).UpdateSimple(ltUp...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *GameAction) _firstDateVisit(linkId int64, day string, start, end int64) (first bool, err error) { + key := ckey.GameActionFirstDate(s.Req.ProjectId, s.Req.GameId, linkId, s.Req.UserId, mtype.GameActionTypeVisit, day) + if !app.Redis.Cache.SetNX(s.Ctx, key, 1, lockdo.Rand2HourExp()).Val() { + return + } + + m := s.Dao().GameAction + visit, err := m.WithContext(s.Ctx).Where( + m.ProjectID.Eq(s.Req.ProjectId), + m.GameID.Eq(s.Req.GameId), + m.LinkID.Eq(linkId), + m.UserID.Eq(s.Req.UserId), + m.Type.Eq(mtype.GameActionTypeVisit), + m.ActionTime.Between(start, end), + ).First() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if visit == nil || visit.ID == s.Req.ID { + return true, nil + } + + return +} + +func (s *GameAction) _getTotalId(linkId int64) (id int64, err error) { + cc := cache.NewGameTotal(s.Ctx) + id, err = cc.FindByUniqIdx(s.Req.ProjectId, s.Req.GameId, linkId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + lc := app.NewFollower(s.Ctx, ckey.GameTotalCreateOnce(s.Req.ProjectId, s.Req.GameId, linkId), lock.SetExpire(10*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + id, err = cc.FindByUniqIdx(s.Req.ProjectId, s.Req.GameId, linkId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if id != 0 { + return + } + + total := withdefault.GameTotal(&model.GameTotal{ + ProjectID: s.Req.ProjectId, + GameID: s.Req.GameId, + LinkID: linkId, + }) + + err = s.GetDao().GameTotal.WithContext(s.Ctx).Create(total) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return total.ID, nil +} + +func (s *GameAction) _getTotalDateId(linkId int64, day string) (id int64, err error) { + cc := cache.NewGameTotalDate(s.Ctx) + id, err = cc.FindByUniqIdx(s.Req.ProjectId, s.Req.GameId, linkId, day) + if err != nil { + err = s.BE().CacheError(err) + return + } + + lc := app.NewFollower(s.Ctx, ckey.GameTotalCreateOnceDate(s.Req.ProjectId, s.Req.GameId, linkId, day), lock.SetExpire(10*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + id, err = cc.FindByUniqIdx(s.Req.ProjectId, s.Req.GameId, linkId, day) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if id != 0 { + return + } + + total := withdefault.GameTotalDate(&model.GameTotalDate{ + ProjectID: s.Req.ProjectId, + GameID: s.Req.GameId, + LinkID: linkId, + Ymd: day, + }) + + err = s.GetDao().GameTotalDate.WithContext(s.Ctx).Create(total) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return total.ID, nil +} diff --git a/internal/service/queue/consumer/campaignnotice/logic_test.go b/internal/service/queue/consumer/campaignnotice/logic_test.go new file mode 100644 index 0000000..db9353b --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/logic_test.go @@ -0,0 +1,304 @@ +package campaignnotice + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/consumer/campaignnotice/export" + "joybuywork/internal/service/queue/consumer/campaignnotice/validevents" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "errors" + "testing" + "time" + + "github.com/rs/xid" + "gits.branchcn.com/backend/microcode/plugins/derivative/task" + + _ "joybuywork/test" +) + +func TestLogic(t *testing.T) { + + //wg := sync.WaitGroup{} + + //for i := 0; i < 20; i++ { + //wg.Add(1) + //go func(i int) { + // defer wg.Done() + var ctx = context.Background() + var val = types.CampaignNotice{ + CampaignId: 4838, + DeviceId: xid.New().String(), + UserId: "en_jjjjj", + IsInstall: false, + BehaviorTime: time.Now().Unix(), + NoticeType: types.NoticeTypePay, + NoticeTag: "", + Event: "purchases", + EventData: []types.EventData{ + { + EventKey: "count", + EventVal: "2", + }, + { + EventKey: "times", + EventVal: "1", + }, + }, + ProjectId: 143, + Ip: "", + Os: "iphone", + OsVersion: "", + DeviceModel: "", + Lang: "", + ChannelId: 0, + WebChannelId: 0, + UserMark: "948a13f1eb402f8ff16472e217608fb6", + PurchasesData: &types.PurchaseData{ + TransactionId: "ffdd33", + TransactionDesc: "交易描述", + Amount: 2, + Currency: "货币单位(如:USD CNY)", + PurchaseCount: 1, + ContentItems: []types.PurchaseItem{ + { + ProductId: "123", + ProductName: "产品名称", + ProductPrice: 2, + ProductQuantity: 1, + }, + }, + }, + } + + var container = new(Notice) + { + container.Init(ctx, logic.WithBp()) + container.Req = &val + } + + errCode := logic.Run(container) + t.Log(errCode) + + //fmt.Printf("i: %d, err: %v \n", i, errCode) + //}(i) + + //} + //wg.Wait() + time.Sleep(time.Second) +} + +func TestOtherStat(t *testing.T) { + + var userMap = map[string]struct{}{} + for i := 0; i < 20; i++ { + userMap[xid.New().String()] = struct{}{} + } + + var tms = map[string]struct{}{ + mtype.FissionStatOtherNoChanceClickBtn: {}, + } + + //wg := sync.WaitGroup{} + + for i := 0; i < 20; i++ { + + var mk string + for k := range tms { + mk = k + } + + var userHid string + for k := range userMap { + userHid = k + } + + //wg.Add(1) + //go func(i int) { + // defer wg.Done() + var ctx = context.Background() + var val = types.CampaignOtherStat{ + CampaignId: 208, + Mark: mk, + UserHashId: userHid, + } + + var container = new(OtherStat) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Log(errCode) + + //fmt.Printf("i: %d, err: %v \n", i, errCode) + //}(i) + + } + //wg.Wait() + +} + +func TestDiceMap(t *testing.T) { + + var container = new(DiceMap) + { + container.Init(context.Background()) + container.Req = &types.CampaignDiceMap{CampaignId: 1990} + } + + t.Log(logic.Run(container)) +} + +func TestDownload(t *testing.T) { + + var container = new(export.Download) + { + container.Init(context.Background()) + container.Req = &types.Download{ + TaskId: "cmfm6ferdj7o6p8uls7g", + Mark: "campaign_report", + Cond: []byte("eyJjYW1wYWlnbl9oYXNoX2lkIjoiY21mNTdkbXJkajdycmZqNW4zZzAiLCJzdGFydF90aW1lIjoxNzA0ODE2MDAwLCJlbmRfdGltZSI6MTcwNDkwMjM5OX0="), + } + } + + t.Log(logic.Run(container)) +} + +func TestValidEvents(t *testing.T) { + + var ctx = context.Background() + + //m := dao.FissionUser.SubTable(4323) + // + //id := xid.New().String() + // + //var users = []*model.FissionUser{ + // withdefault.FissionUser(&model.FissionUser{ + // CampaignID: 4323, + // ParentID: 241506581677985792, + // DeviceID: id, + // UserMark: id, + // UserType: 2, + // Source: 2, + // }), + //} + // + //m.WithContext(ctx).Create(users...) + + //wg := sync.WaitGroup{} + + //for i := 0; i < 20; i++ { + //wg.Add(1) + //go func(i int) { + // defer wg.Done() + + // {"user_id":382170871531298816,"new_user":false,"behavior_time":1778309465,"notice_type":4,"event":"watch","event_data":[{"event_key":"stay","event_val":"1"}],"event_type":2,"ads_cond_id":382143541333184513,"campaign_id":5419,"parent_id":0} + //for _, user := range users { + + var ( + val = types.ValidEvents{ + UserId: 386884299340845056, + //UserId: 238667159948607488, + NewUser: true, + BehaviorTime: time.Now().Unix(), + NoticeType: types.NoticeTypeCustom, + Event: "share", + EventData: []types.EventData{ + { + EventKey: "share_img", + EventVal: "1", + }, + }, + EventType: 1, + CampaignId: 5443, + ParentId: 296975721290174464, + ClickInfo: nil, + } + ) + + var container = new(validevents.ValidEvents) + { + container.Init(ctx, logic.WithBp(), logic.WithTran()) + container.Req = &val + } + + errCode := logic.Run(container) + t.Log(errCode) + //} + + //fmt.Printf("i: %d, err: %v \n", i, errCode) + //}(i) + + //} + //wg.Wait() + + time.Sleep(time.Second) +} + +func TestName(t *testing.T) { + val := types.ValidEvents{ + UserId: 284409507420909568, + NewUser: false, + BehaviorTime: time.Now().Unix(), + NoticeType: types.NoticeTypePay, + Event: "purchases", + EventData: []types.EventData{ + { + EventKey: "count", + EventVal: "1", + }, + }, + EventType: 3, + AdsCondId: 0, + CampaignId: 4838, + ParentId: 0, + ClickInfo: nil, + } + + ctx := context.Background() + ddd := app.NewRedisTask(ctx, ckey.ValidEventsKey(val.UserId)) + c, err := ddd.TaskPublicAndConsume(func(td *task.Data) (err error) { + var data types.ValidEvents + err = td.ParsingMsg(&data) + if err != nil { + return err + } + var container = new(validevents.ValidEvents) + { + container.Init(td.Ctx) + container.Req = &data + } + + return logic.Run(container) + }, val) + + if err != nil { + return + } + + if c.Error() != nil && (errors.Is(c.Error(), task.AbnormalErr) || errors.Is(c.Error(), task.ReenterLimit)) { + producer.NewCampaignNotice(ctx).ValidEvents(val) + err = c.Error() + return + } +} + +func TestRewardLimitUp(t *testing.T) { + ctx := context.Background() + var val = types.RewardLimitUp{ + CampaignId: 4152, + } + var container = new(RewardLimitUp) + { + container.Init(ctx, logic.WithBp()) + container.Req = &val + } + + errCode := logic.Run(container) + t.Log(errCode) +} diff --git a/internal/service/queue/consumer/campaignnotice/notice.go b/internal/service/queue/consumer/campaignnotice/notice.go new file mode 100644 index 0000000..cc6348b --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/notice.go @@ -0,0 +1,1606 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strconv" + "strings" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +const ( + campaignNoticeEtNone = iota // 无效用户 + campaignNoticeEtInvite // 邀请有效 + campaignNoticeEtSelf // 自身完成有效任务 + campaignNoticeEtParent // 上级完成有效任务 +) + +const ( + campaignNoticeResTypeNone = iota + campaignNoticeResTypeNotNext // 没有下一级 + campaignNoticeResTypeLack // 库存不足 +) + +type Notice struct { + logic.Logic + + Req *types.CampaignNotice + + //项目id + projectId int64 + + //活动hash_id + cpnHashId string + + //父级的统计 + pStat *model.FissionUserStat + + expTime time.Duration // 归档结束用来当缓存过期时间 + + resendReg bool // 重新触发注册事件 +} + +func (s *Notice) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + parent, err := s.parent() + if err != nil { + return + } + + user, parent, newUser, err := s.user(cpn, parent) + if err != nil || user == nil { + return + } + + if cpn.ReportType == mtype.FissionCampaignReportTypeNew { + var dems []fissionaction.CusDem + if s.Req.WebChannelId > 0 { + dems = append(dems, fissionaction.SetChannelId(s.Req.WebChannelId)) + } + switch s.Req.NoticeType { + case types.NoticeTypeOpen: + s.MP().InApp(user, dems...).AppOpen(s.Req.BehaviorTime, s.Req.Ip, s.Req.Os, s.Req.OsVersion, s.Req.DeviceModel, newUser) + case types.NoticeTypeInstall: + if s.Req.NoticeTag == types.NoticeTagWeb { + s.MP().InApp(user, dems...).WebFirstOpen(s.Req.BehaviorTime, s.Req.Ip, s.Req.Os, s.Req.OsVersion, s.Req.DeviceModel, newUser) + } else { + s.MP().InApp(user, dems...).AppInstall(s.Req.BehaviorTime, s.Req.Ip, s.Req.Os, s.Req.OsVersion, s.Req.DeviceModel, newUser) + } + + case types.NoticeTypeRegister: + s.MP().InApp(user).AppRegister(s.Req.BehaviorTime, s.Req.Ip, s.Req.Os, s.Req.OsVersion, s.Req.DeviceModel, newUser) + case types.NoticeTypeCustom: + case types.NoticeTypePay: + s.MP().InApp(user).Pay(s.Req.BehaviorTime, s.Req.PurchasesData) + } + } + + if cpn.Target == mtype.FissionCampaignConfigTargetAdsGame || s.change(cpn, user, parent, newUser) { + return + } + + et, targetNum, setHelp, err := s.effective(cpn, user, parent, newUser) + if err != nil { + return + } + + if et == campaignNoticeEtSelf { + err = s.targetStatNum(user, targetNum) // 自己的达标数 + if err != nil { + return + } + } else { + err = s.parentStatNum(parent, newUser, setHelp, et, targetNum) + if err != nil { + return + } + } + + switch et { + case campaignNoticeEtInvite: // 好友有效 + err = s.game(cpn, user, parent) + if err != nil { + return + } + case campaignNoticeEtSelf: // 自己完成任务有效 + err = s.selfGame(cpn, user, targetNum) + if err != nil { + return + } + case campaignNoticeEtParent: // 上级完成任务有效 + err = s.selfGame(cpn, parent, targetNum) + if err != nil { + return + } + } + + return +} + +// 活动数据 +func (s *Notice) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + s.projectId = cpn.ProjectID + s.cpnHashId = cpn.HashID + s.expTime = provider.NewCampaignTZ(s.Ctx, cpn, s.Req.Lang).EndTime().Sub(time.Now()) + + return +} + +// 找父亲 +func (s *Notice) parent() (parent *model.FissionUser, err error) { + if s.Req.ParentId == "" { + return + } + + fuCache := cache.NewFissionUser(s.Ctx, s.Req.CampaignId) + parent, err = fuCache.FindBySubUserId(s.Req.ParentId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + return +} + +// 通过用户唯一标识找参与用户 +func (s *Notice) _findByUserMark(cpnId int64, uct consts.CampaignUserType) (user *model.FissionUser, err error) { + if !verify.InArray(s.Req.NoticeType, types.NoticeTypeInstall, types.NoticeTypeOpen) || s.Req.UserMark == "" { + return + } + + id, _ := app.Redis.Cache.Get(s.Ctx, ckey.FissionUserUniqMark(cpnId, s.Req.UserMark)).Int64() + if id == 0 { + return + } + + user, err = cache.NewFissionUser(s.Ctx, cpnId).FindById(id) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + ms := s.GetDao().FissionUser.SubTable(cpnId) + m := s.GetDao().FissionUser + var upData []field.AssignExpr + var upDataMs []field.AssignExpr + // 没绑定device_id就绑定 + if user.DeviceID == "" && s.Req.DeviceId != "" { + upData = append(upData, m.DeviceID.Value(s.Req.DeviceId)) + upDataMs = append(upDataMs, ms.DeviceID.Value(s.Req.DeviceId)) + user.DeviceID = s.Req.DeviceId + } + + // 没绑定user_id就绑定 + if user.SubUserID == "" && s.Req.UserId != "" { + upData = append(upData, m.SubUserID.Value(s.Req.UserId), m.UserMark.Value(s.Req.UserId)) + upDataMs = append(upDataMs, ms.SubUserID.Value(s.Req.UserId), ms.UserMark.Value(s.Req.UserId)) + user.SubUserID = s.Req.UserId + } + + if user.LangMark != s.Req.Lang { + upData = append(upData, m.LangMark.Value(s.Req.Lang), m.UserLang.Value(uct.LangMark)) + upDataMs = append(upDataMs, ms.LangMark.Value(s.Req.Lang), ms.UserLang.Value(uct.LangMark)) + user.LangMark, user.UserLang = s.Req.Lang, uct.LangMark + } + + // 更换匹配中的用户等级 + if user.UserLevel != uct.LevelId && user.FixedUserLevel == mtype.No { + upData = append(upData, m.UserLevelMark.Value(uct.LevelMark), m.UserLevel.Value(uct.LevelId)) + upDataMs = append(upDataMs, ms.UserLevelMark.Value(uct.LevelMark), ms.UserLevel.Value(uct.LevelId)) + user.UserLevelMark = uct.LevelMark + user.UserLevel = uct.LevelId + } + + lvMark := strings.Join(s.Req.UserLv, ",") + if user.LevelMark != lvMark { + upData = append(upData, m.LevelMark.Value(lvMark)) + upDataMs = append(upDataMs, ms.LevelMark.Value(lvMark)) + user.LevelMark = lvMark + } + + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = ms.WithContext(s.Ctx).Where(ms.ID.Eq(user.ID)).UpdateSimple(upDataMs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewFissionUser(s.Ctx, cpnId).Clear(user) + } + + return +} + +// 通过user_id找参与用户 +func (s *Notice) _findByOwnerId(uct consts.CampaignUserType) (user *model.FissionUser, err error) { + if s.Req.UserId == "" { + return + } + + fuCache := cache.NewFissionUser(s.Ctx, s.Req.CampaignId) + user, err = fuCache.FindBySubUserId(s.Req.UserId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + ms := s.GetDao().FissionUser.SubTable(user.CampaignID) + m := s.GetDao().FissionUser + var upData []field.AssignExpr + var upDataMs []field.AssignExpr + // 没绑定device_id就绑定 + if user.DeviceID == "" && s.Req.DeviceId != "" { + upData = append(upData, m.DeviceID.Value(s.Req.DeviceId)) + upDataMs = append(upDataMs, ms.DeviceID.Value(s.Req.DeviceId)) + user.DeviceID = s.Req.DeviceId + } + + // 没绑定user_id就绑定 + if user.SubUserID == "" && s.Req.UserId != "" { + upData = append(upData, m.SubUserID.Value(s.Req.UserId), m.UserMark.Value(s.Req.UserId)) + upDataMs = append(upDataMs, ms.SubUserID.Value(s.Req.UserId), ms.UserMark.Value(s.Req.UserId)) + user.SubUserID = s.Req.UserId + } + + if user.LangMark != s.Req.Lang { + upData = append(upData, m.LangMark.Value(s.Req.Lang), m.UserLang.Value(uct.LangMark)) + upDataMs = append(upDataMs, ms.LangMark.Value(s.Req.Lang), ms.UserLang.Value(uct.LangMark)) + user.LangMark, user.UserLang = s.Req.Lang, uct.LangMark + } + + // 更换匹配中的用户等级 + if user.UserLevel != uct.LevelId && user.FixedUserLevel == mtype.No { + upData = append(upData, m.UserLevelMark.Value(uct.LevelMark), m.UserLevel.Value(uct.LevelId)) + upDataMs = append(upDataMs, ms.UserLevelMark.Value(uct.LevelMark), ms.UserLevel.Value(uct.LevelId)) + user.UserLevelMark = uct.LevelMark + user.UserLevel = uct.LevelId + } + + lvMark := strings.Join(s.Req.UserLv, ",") + if user.LevelMark != lvMark { + upData = append(upData, m.LevelMark.Value(lvMark)) + upDataMs = append(upDataMs, ms.LevelMark.Value(lvMark)) + user.LevelMark = lvMark + } + + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = ms.WithContext(s.Ctx).Where(ms.ID.Eq(user.ID)).UpdateSimple(upDataMs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = fuCache.Clear(user) + } + + return +} + +// 通过device找活动的参与用户 +func (s *Notice) _findByDeviceId(uct consts.CampaignUserType) (user *model.FissionUser, err error) { + if s.Req.DeviceId == "" { + return + } + + fuCache := cache.NewFissionUser(s.Ctx, s.Req.CampaignId) + user, err = fuCache.FindByDeviceId(s.Req.DeviceId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil || user.SubUserID == s.Req.UserId { + return + } + + // 如果同一个设备多个用户,就当成一个新用户处理吧 + if user.SubUserID != "" && s.Req.UserId != "" { + return nil, nil + } + + ms := s.GetDao().FissionUser.SubTable(user.CampaignID) + m := s.GetDao().FissionUser + var upData []field.AssignExpr + var upDataMs []field.AssignExpr + // 没绑定device_id就绑定 + if user.DeviceID == "" && s.Req.DeviceId != "" { + upData = append(upData, m.DeviceID.Value(s.Req.DeviceId)) + upDataMs = append(upDataMs, ms.DeviceID.Value(s.Req.DeviceId)) + user.DeviceID = s.Req.DeviceId + } + + // 没绑定user_id就绑定 + if user.SubUserID == "" && s.Req.UserId != "" { + upData = append(upData, m.SubUserID.Value(s.Req.UserId), m.UserMark.Value(s.Req.UserId)) + upDataMs = append(upDataMs, ms.SubUserID.Value(s.Req.UserId), ms.UserMark.Value(s.Req.UserId)) + user.SubUserID = s.Req.UserId + } + + if user.LangMark != s.Req.Lang { + upData = append(upData, m.LangMark.Value(s.Req.Lang), m.UserLang.Value(uct.LangMark)) + upDataMs = append(upDataMs, ms.LangMark.Value(s.Req.Lang), ms.UserLang.Value(uct.LangMark)) + user.LangMark, user.UserLang = s.Req.Lang, uct.LangMark + } + + // 更换匹配中的用户等级 + if user.UserLevel != uct.LevelId && user.FixedUserLevel == mtype.No { + upData = append(upData, m.UserLevelMark.Value(uct.LevelMark), m.UserLevel.Value(uct.LevelId)) + upDataMs = append(upDataMs, ms.UserLevelMark.Value(uct.LevelMark), ms.UserLevel.Value(uct.LevelId)) + user.UserLevelMark = uct.LevelMark + user.UserLevel = uct.LevelId + } + + lvMark := strings.Join(s.Req.UserLv, ",") + if user.LevelMark != lvMark { + upData = append(upData, m.LevelMark.Value(lvMark)) + upDataMs = append(upDataMs, ms.LevelMark.Value(lvMark)) + user.LevelMark = lvMark + } + + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = ms.WithContext(s.Ctx).Where(ms.ID.Eq(user.ID)).UpdateSimple(upDataMs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = fuCache.Clear(user) + } + + return +} + +// 参与用户 +func (s *Notice) user(cpn *model.FissionCampaign, parent *model.FissionUser) (user, bindParent *model.FissionUser, newUser bool, err error) { + return provider.NewFissionUser(s.Ctx, cpn, nil).NotifyUser( + s.Req.BehaviorTime, + s.Req.NoticeType, + s.Req.IsInstall, + s.Req.NoticeTag, + s.Req.UserMark, + s.Req.UserId, + s.Req.DeviceId, + strings.Join(s.Req.UserLv, ","), + s.Req.Lang, + s.platform(), + s.Req.CustomParam, + s.Req.WebChannelId, + s.Req.ChannelId, + s.expTime, + parent, + ) +} + +func (s *Notice) platform() string { + platform, dm := strings.ToLower(s.Req.Os), strings.ToLower(s.Req.DeviceModel) + if platform == "macos" { + platform = consts.PlatformIOS + } + + if verify.InArray(platform, consts.PlatformAndroid, consts.PlatformIOS, consts.PlatformWeb) { + // 创建一些可变更的属性 + if platform == consts.PlatformIOS && dm == consts.PlatformIPad { + platform = consts.PlatformIPad + } + } + + return platform +} + +func (s *Notice) effective(cpn *model.FissionCampaign, user, parent *model.FissionUser, newUser bool) (et int, targetNum int32, setHelp bool, err error) { + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 设置用户助力成功,仅当首次完成的触发条件的时候会执行 + defer func() { + if parent != nil && user.IsHelp == mtype.No && et != campaignNoticeEtNone { + userMs := s.GetDao().FissionUser.SubTable(cpn.ID) + res, err1 := userMs.WithContext(s.Ctx).Where( + userMs.ID.Eq(user.ID), + userMs.IsHelp.Eq(mtype.No), + ).UpdateSimple(userMs.IsHelp.Value(mtype.Yes)) + if err1 != nil { + err = s.BE().MysqlError(err1) + return + } + + _ = cache.NewFissionUser(s.Ctx, cpn.ID).Clear(user) + + setHelp = res.RowsAffected > 0 + } + + langTitle, _ := provider.NewLangTitle(s.Ctx, cpn, user.LangMark) + + pageTitle, _ := langTitle.GetPageTitle() + + // 助力成功回调 + if setHelp { + switch s.Req.NoticeType { + case types.NoticeTypeInstall: + producer.NewOplatformOther(s.Ctx).OpoCampaignHelpOk(types.OpoCampaignHelpOk{ + ProjectId: cpn.ProjectID, + CampaignHashId: cpn.HashID, + CampaignTitle: cpn.Title, + PageTitle: pageTitle, + HelperUserId: user.SubUserID, + HelperDeviceId: user.DeviceID, + BeHelperUserId: parent.SubUserID, + BeHelperDeviceId: parent.DeviceID, + Source: types.HelpSourceInstall, + KvData: make([]*types.KV, 0), + }, producer.SetHeaderLang(user.LangMark)) + case types.NoticeTypeRegister: + producer.NewOplatformOther(s.Ctx).OpoCampaignHelpOk(types.OpoCampaignHelpOk{ + ProjectId: cpn.ProjectID, + CampaignHashId: cpn.HashID, + CampaignTitle: cpn.Title, + PageTitle: pageTitle, + HelperUserId: user.SubUserID, + HelperDeviceId: user.DeviceID, + BeHelperUserId: parent.SubUserID, + BeHelperDeviceId: parent.DeviceID, + Source: types.HelpSourceRegister, + KvData: make([]*types.KV, 0), + }, producer.SetHeaderLang(user.LangMark)) + case types.NoticeTypeCustom: + var kv = make([]*types.KV, 0, len(s.Req.EventData)) + for _, v := range s.Req.EventData { + kv = append(kv, &types.KV{ + Event: s.Req.Event, + Key: v.EventKey, + Value: v.EventVal, + }) + } + producer.NewOplatformOther(s.Ctx).OpoCampaignHelpOk(types.OpoCampaignHelpOk{ + ProjectId: cpn.ProjectID, + CampaignHashId: cpn.HashID, + CampaignTitle: cpn.Title, + PageTitle: pageTitle, + HelperUserId: user.SubUserID, + HelperDeviceId: user.DeviceID, + BeHelperUserId: parent.SubUserID, + BeHelperDeviceId: parent.DeviceID, + Source: types.HelpSourceCustom, + KvData: kv, + }, producer.SetHeaderLang(user.LangMark)) + + } + } + + }() + + if cpn.FissionID == consts.IdSignIn { + if parent == nil { // 没有上级不处理 + return + } + + if s.Req.NoticeType == types.NoticeTypeInstall { + et = utils.Ternary[int](newUser, campaignNoticeEtInvite, campaignNoticeEtNone) + return + } + + return + } + + switch conf.Option { + case mtype.FissionCampaignConfigTargetOptionApp: + if parent == nil { // 没有上级不处理 + return + } + + if conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventInstall && s.Req.NoticeType == types.NoticeTypeInstall { + et = utils.Ternary[int](newUser, campaignNoticeEtInvite, campaignNoticeEtNone) + return + } + + if conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister && s.Req.NoticeType == types.NoticeTypeRegister && user.IsHelp == mtype.No { + + // 防止并发操作 + once := app.Redis.Cache.SetNX(s.Ctx, ckey.FissionRegisterOnce(user.ID), s.Req.BehaviorTime, 20*time.Second).Val() + et = utils.Ternary[int](once, campaignNoticeEtInvite, campaignNoticeEtNone) + return + } + + return + case mtype.FissionCampaignConfigTargetOptionFriend: + if parent == nil || len(s.Req.EventData) == 0 { // 没有上级不处理 + return + } + targetNum, err = s._eventEffective(user, conf.BothType) + if err != nil { + return + } + + // 如果是老带新和一起赢奖励,那么一个用户达标只能算一次助力成功 + if verify.InArray(cpn.FissionID, consts.IdWinTogether, consts.IdReferral) { + if targetNum > 0 && user.IsHelp == mtype.No { + once := app.Redis.Cache.SetNX(s.Ctx, ckey.FissionEventEffectiveOnce(user.ID), s.Req.BehaviorTime, 20*time.Second).Val() + et = utils.Ternary[int](once, campaignNoticeEtInvite, campaignNoticeEtNone) + return + } + return + } + et = utils.Ternary[int](targetNum > 0, campaignNoticeEtParent, campaignNoticeEtNone) + return + case mtype.FissionCampaignConfigTargetOptionSelf, mtype.FissionCampaignConfigTargetOptionUse: + if len(s.Req.EventData) == 0 { + return + } + targetNum, err = s._eventEffective(user, conf.BothType) + if err != nil { + return + } + + et = utils.Ternary[int](targetNum > 0, campaignNoticeEtSelf, campaignNoticeEtNone) + return + case mtype.FissionCampaignConfigTargetOptionTask: + if len(s.Req.EventData) == 0 { + return + } + targetNum, err = s._eventEffective(user, conf.BothType) + if err != nil { + return + } + } + + return +} + +// 事件触发是否有效,返回达标次数 +func (s *Notice) _eventEffective(user *model.FissionUser, bothType int8) (targetNum int32, err error) { + //自定义事件处理逻辑 + m := s.GetDao().FissionCampaignCond + conds, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(conds) == 0 { + return + } + + // 用户只能同时存在一个计算有效 + lc := app.NewRedisLock(s.Ctx, ckey.FissionCustomEffectiveOnce(user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + var target = make(map[int64]*utils.CondTotalFinishRes) // 完成的任务 + var condValMap = make(map[int64]*model.FissionCampaignCond) // 条件id对应的任务数据 + var condMap = make(map[string][]*model.FissionCampaignCond) // event+key对应的条件数据集合 + for _, cond := range conds { + key := fmt.Sprintf("%s_%s", cond.Event, cond.EventKey) + condMap[key] = append(condMap[key], cond) + target[cond.ID] = nil // 默认任务条件都没有完成 + condValMap[cond.ID] = cond + } + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + // 只获取活动相关的条件 + var condTotal = make(map[int64]string) // 条件累计数据 + var records []*model.FissionUserCondRecord + for _, v := range s.Req.EventData { + key := fmt.Sprintf("%s_%s", s.Req.Event, v.EventKey) + eCond, ok := condMap[key] // 找到event+key对应的条件数据集合 + if !ok { // 如果找不到就不是我们想要的自定义事件 + continue + } + + for _, cond := range eCond { + + if !cm.EventCanTotal(cond, user.SubUserID, 0, user.JoinAt, s.Req.BehaviorTime) { + continue + } + + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondTotal: + if total, ok1 := condTotal[cond.ID]; ok1 { // 如果存在当前条件的数据就累加 + condTotal[cond.ID] = utils.StrAdd(total, v.EventVal) + } else { + condTotal[cond.ID] = v.EventVal + } + + records = append(records, withdefault.FissionUserCondRecord(&model.FissionUserCondRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: cond.ID, + Val: v.EventVal, + IsUse: mtype.Yes, // 因为累加过了,所以要标识为已使用 + BehaviorTime: s.Req.BehaviorTime, + })) + + s.condFinish(user.ID, cond.ID, v.EventVal) + + case mtype.FissionCampaignCondIfCondEq: + if cond.EventVal == v.EventVal { // 等式下,必须要值相等才成立条件 + if total, ok1 := condTotal[cond.ID]; ok1 { // 如果存在当前条件的数据就累加 + condTotal[cond.ID] = utils.StrAdd(total, v.EventVal) + } else { + condTotal[cond.ID] = v.EventVal + } + records = append(records, withdefault.FissionUserCondRecord(&model.FissionUserCondRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: cond.ID, + Val: v.EventVal, + BehaviorTime: s.Req.BehaviorTime, + })) + + s.condFinish(user.ID, cond.ID, v.EventVal) + } + case mtype.FissionCampaignCondIfCondGte: + if utils.NumberStrCompareGte(v.EventVal, cond.EventVal) { // 大于等于下,必须要值大于等于才成立条件 + if total, ok1 := condTotal[cond.ID]; ok1 { // 如果存在当前条件的数据就累加 + condTotal[cond.ID] = utils.StrAdd(total, v.EventVal) + } else { + condTotal[cond.ID] = v.EventVal + } + records = append(records, withdefault.FissionUserCondRecord(&model.FissionUserCondRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: cond.ID, + Val: v.EventVal, + BehaviorTime: s.Req.BehaviorTime, + })) + + s.condFinish(user.ID, cond.ID, v.EventVal) + } + } + } + } + + // 没有完成的条件肯定不会触发有效的 + if len(records) == 0 { + return + } + + ucrM := s.GetDao().FissionUserCondRecord + + // 先去找还被计算的记录 + ucr, err := ucrM.WithContext(s.Ctx).Where(ucrM.UserID.Eq(user.ID), ucrM.IsUse.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 把新创建的记录入库 + err = ucrM.WithContext(s.Ctx).Create(records...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 找到条件总揽 + fucM := s.GetDao().FissionUserCond + fuc, err := fucM.WithContext(s.Ctx).Where(fucM.UserID.Eq(user.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 把总揽条件构建一个map + var uCondMap = make(map[int64]*model.FissionUserCond) + for _, uCond := range fuc { + uCondMap[uCond.CondID] = uCond + if total, ok1 := condTotal[uCond.CondID]; ok1 { // 这里要把之前累计的都放到累计map上 + condTotal[uCond.CondID] = utils.StrAdd(total, uCond.Total) + } else { + condTotal[uCond.CondID] = uCond.Total + } + } + + var incCond = make(map[int64]int64) // 完成次数需要+1的总揽数据 + for _, record := range records { + cond := condValMap[record.CondID] + + info, ok := uCondMap[cond.ID] + + if !ok { + info = withdefault.FissionUserCond(&model.FissionUserCond{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: record.CondID, + }) + + err = fucM.WithContext(s.Ctx).Create(info) + if err != nil { + err = s.BE().MysqlError(err) + return + } + uCondMap[cond.ID] = info + } + + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondEq, mtype.FissionCampaignCondIfCondGte: + incCond[info.ID]++ + } + } + + for condId, total := range condTotal { + cond := condValMap[condId] + if cond.IfCond != mtype.FissionCampaignCondIfCondTotal { + continue + } + + info := uCondMap[cond.ID] + + if utils.NumberStrCompareGte(total, cond.EventVal) { // 这里代表完成了一次累计任务,要重新开始累计 + res := utils.CondTotalFinishNum(total, cond.EventVal) + + // 处理值问题 + _, err = fucM.WithContext(s.Ctx). + Where(fucM.ID.Eq(info.ID)). + UpdateSimple(fucM.Num.Add(int64(res.Num)), fucM.CountNum.Add(int64(res.Num)), fucM.Total.Value(res.Remain)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + target[cond.ID] = res + uCondMap[cond.ID].CountNum += int64(res.Num) + } else { // 这里是没有完成累计任务,记录最新的累计值 + _, err = fucM.WithContext(s.Ctx).Where(fucM.ID.Eq(info.ID)).UpdateSimple(fucM.Total.Value(total)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + // 完成的任务数 + if len(incCond) > 0 { + for id, num := range incCond { + _, err = fucM.WithContext(s.Ctx).Where(fucM.ID.Eq(id)).UpdateSimple(fucM.Num.Add(num)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + // 整合新的和旧的所有没有计算的记录 + for _, v := range ucr { + records = append(records, v) + } + + if len(records) == 0 { + return + } + + // 把计算完毕的记录都标识成已计算,下一次就不找这些数据 + var useRecord []int64 + var countMap = make(map[int32][]int64) + defer func() { + if targetNum == 0 { + return + } + + if len(countMap) > 0 { + for k, v := range countMap { + _, err = fucM.WithContext(s.Ctx).Where(fucM.ID.In(v...)).UpdateSimple(fucM.CountNum.Sub(int64(k))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + if len(useRecord) > 0 { + _, err = ucrM.WithContext(s.Ctx).Where(ucrM.ID.In(useRecord...)).UpdateSimple(ucrM.IsUse.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + }() + + // 分条件计算 + switch bothType { + case mtype.FissionCampaignConfigTargetBothTypeOne: + // 达标统计 + var condStat []int64 + for _, v := range records { + cond, ok := condValMap[v.CondID] + if !ok { + continue + } + + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondGte, mtype.FissionCampaignCondIfCondEq: + targetNum++ + useRecord = append(useRecord, v.ID) + condStat = append(condStat, cond.ID) + } + } + + for condId, res := range target { + if res == nil || res.Num <= 0 { + continue + } + + targetNum += res.Num + + // 这个事件完成的次数 + for i := 0; i < int(res.Num); i++ { + condStat = append(condStat, condId) + } + + countMap[res.Num] = append(countMap[res.Num], uCondMap[condId].ID) + } + + // 达标统计 + if len(condStat) > 0 { + producer.NewCampaignNotice(s.Ctx).CampaignTargetStat(types.CampaignTargetStat{ + CampaignId: user.CampaignID, + UserId: user.ID, + CondIds: condStat, + FinishTime: s.Req.BehaviorTime, + }) + } + + return + case mtype.FissionCampaignConfigTargetBothTypeAll: + var groupIdx = make(map[int64]int) + var groupFinish = make(map[int]map[int64]int64) + + // 完成任务分组 + for _, v := range records { + cond, ok := condValMap[v.CondID] + if !ok { + continue + } + + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondGte, mtype.FissionCampaignCondIfCondEq: + idx := groupIdx[v.CondID] + _, ok1 := groupFinish[idx] + if !ok1 { + groupFinish[idx] = make(map[int64]int64) + } + + groupFinish[idx][v.CondID] = v.ID + groupIdx[v.CondID]++ + } + } + + var useCount []int64 + for condId := range target { + fuc1, ok1 := uCondMap[condId] + if !ok1 { + continue + } + + for i := 0; i < int(fuc1.CountNum); i++ { + idx := groupIdx[condId] + _, ok2 := groupFinish[idx] + if !ok2 { + groupFinish[idx] = make(map[int64]int64) + } + + groupFinish[idx][condId] = 0 + groupIdx[condId]++ + } + useCount = append(useCount, fuc1.ID) + } + + var condStat []int64 + for _, cond := range conds { + condStat = append(condStat, cond.ID) + } + + for _, v := range groupFinish { + if len(v) != len(conds) { + continue + } + + for _, recordId := range v { + + if recordId > 0 { + useRecord = append(useRecord, recordId) + } + + } + + targetNum++ + + producer.NewCampaignNotice(s.Ctx).CampaignTargetStat(types.CampaignTargetStat{ + CampaignId: user.CampaignID, + UserId: user.ID, + CondIds: condStat, + FinishTime: s.Req.BehaviorTime, + }) + } + + if len(useCount) > 0 { + countMap[targetNum] = useCount + } + + return + } + + return +} + +func (s *Notice) condFirst(userId, condId int64) (yes bool, err error) { + key := ckey.FissionUserCondFirst(userId, condId) + + exist, err := app.Redis.Exists(s.Ctx, key) + if err != nil { + err = s.BE().RedisError(err) + return + } + + if exist { + return + } + + yes = app.Redis.Cache.SetNX(s.Ctx, key, 1, s.expTime).Val() + if !yes { + return + } + + m := s.GetDao().FissionUserCondRecord + record, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(userId), m.CondID.Eq(condId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return record == nil, nil +} + +// 完成事件 +func (s *Notice) condFinish(userId, condId int64, total string) { + val, _ := strconv.ParseFloat(total, 64) + first, _ := s.condFirst(userId, condId) + producer.NewCampaignNotice(s.Ctx).CampaignCondStat(types.CampaignCondStat{ + UserId: userId, + CondId: condId, + Total: val, + BehaviorTime: s.Req.BehaviorTime, + First: first, + Event: s.Req.Event, + EventData: s.Req.EventData, + }) +} + +// 邀请目标人数换活动机会数 (使用:大转盘、盲盒、九宫格、老虎机、赛事竞猜、签到) +func (s *Notice) _targetToChance(userId int64, taskChance, targetNum, chance int32) (fnh int32, err error) { + //获取到当前的任务次数,需要完成多少轮任务 + oldNum := taskChance / chance + + num, err := s._statDirectNum(userId) + if err != nil { + return + } + + //当前可计算完成任务的人数 + nowInvite := int32(num) - (oldNum * targetNum) + + //当前完成的次数 + fnh = nowInvite / targetNum + + return +} + +// 统计有效邀请人数 +func (s *Notice) _statDirectNum(userId int64) (num int64, err error) { + key := ckey.FissionUserInviteStat(userId) + + if app.Redis.Cache.Exists(s.Ctx, key).Val() == 0 { + //锁住计算获得的人次 + lc := app.NewRedisLock(s.Ctx, ckey.ForLock(key), lock.SetExpire(5*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + if app.Redis.Cache.Exists(s.Ctx, key).Val() == 0 { + num = app.Redis.Cache.IncrBy(s.Ctx, key, s.pStat.EffectiveNum).Val() + } + } + + //当前邀请人数+1 + num = app.Redis.Cache.Incr(s.Ctx, key).Val() + app.Redis.Cache.Expire(s.Ctx, key, 2*time.Hour) + + return +} + +// 玩法数据处理 +func (s *Notice) game(cpn *model.FissionCampaign, user, parent *model.FissionUser) (err error) { + + switch cpn.FissionID { + case consts.IdPrizeQuiz: //有奖竞猜 + return s.prizeQuiz(cpn, user, parent) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: //趣味问答 + return s.prizeAnswer(user, parent) + case consts.IdSignIn: //签到 + return s.sign(user, parent) + } + return +} + +// 有奖竞猜 +func (s *Notice) prizeQuiz(cpn *model.FissionCampaign, user, parent *model.FissionUser) (err error) { + m := s.GetDao().FissionCampaignQuiz + fcq, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + fqM := s.GetDao().FissionQuiz + pqUser, err := fqM.WithContext(s.Ctx).Where(fqM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if pqUser == nil { + //创建用户的赛事竞猜玩法数据 + err = fqM.WithContext(s.Ctx).Create(withdefault.FissionQuiz(&model.FissionQuiz{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: fcq.InitChance, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + //防止并发获取投票次数 + lc := app.NewRedisLock(s.Ctx, ckey.FissionParentInviteOnce(parent.ID), lock.SetExpire(5*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + return + } + + //是新用户,完成目标 + ppqUser, err := fqM.WithContext(s.Ctx).Where(fqM.UserID.Eq(parent.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if ppqUser == nil { + return + } + + //默认一人给一次 + var fnh int32 = 1 + + //添加机会数 + defer func() { + if err != nil || fnh == 0 { + return + } + + addChance := fnh * fcq.Chance + _, err = fqM.WithContext(s.Ctx).Where(fqM.ID.Eq(ppqUser.ID)).UpdateSimple(fqM.Chance.Add(addChance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + }() + + //目标数小于,直接一个因为这里就是一个人进来的 + if fcq.TargetNum <= 1 { + return + } + + //如果多人给一次,借助redis.incr来记录一下 + fnh, err = s._targetToChance( + parent.ID, + ppqUser.TaskChance, + fcq.TargetNum, + fcq.Chance, + ) + + return +} + +func (s *Notice) prizeAnswer(user *model.FissionUser, parent *model.FissionUser) (err error) { + m := s.GetDao().FissionCampaignQa + qa, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + //看看有没有活动用户数据 + fqM := s.GetDao().FissionQa + player, err := fqM.WithContext(s.Ctx).Where(fqM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + //创建用户的玩法用户数据 + err = fqM.WithContext(s.Ctx).Create(withdefault.FissionQa(&model.FissionQa{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: qa.InitChance, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + //防止并发获取答题次数 + lc := app.NewRedisLock(s.Ctx, ckey.FissionParentInviteOnce(parent.ID), lock.SetExpire(5*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + return + } + + //是新用户,完成目标 + pPlayer, err := fqM.WithContext(s.Ctx).Where(fqM.UserID.Eq(parent.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if pPlayer == nil { + pPlayer = withdefault.FissionQa(&model.FissionQa{ + UserID: parent.ID, + CampaignID: parent.CampaignID, + Chance: qa.InitChance, + }) + + //这里是防止后面有一些需求,导致上级用户可以不进入活动页面页能拉新的情况,不让一般都不会走进来这个if + if err = fqM.WithContext(s.Ctx).Create(pPlayer); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + //假设邀请了完成了一次获取抽奖机会的任务 + var fnh int32 = 1 + + //添加机会数 + defer func() { + if err != nil || fnh == 0 { + return + } + addChance := fnh * qa.Chance + _, err = fqM.WithContext(s.Ctx).Where(fqM.ID.Eq(pPlayer.ID)).UpdateSimple( + fqM.Chance.Add(addChance), + fqM.TaskChance.Add(addChance), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + }() + + //目标数小于等于1,直接当完成,因为这里就是一个人进来的 + if qa.TargetNum <= 1 { + return + } + + //如果多人给一次,借助redis.incr来记录一下 + fnh, err = s._targetToChance( + pPlayer.UserID, + pPlayer.TaskChance, + qa.TargetNum, + qa.Chance, + ) + + return +} + +func (s *Notice) selfGame(cpn *model.FissionCampaign, user *model.FissionUser, targetNum int32) (err error) { + switch cpn.FissionID { + case consts.IdPrizeQuiz: //有奖竞猜 + return s.selfPrizeQuiz(user, targetNum) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaVideo, consts.IdQaAudio: //趣味问答 + return s.selfPrizeAnswer(user, targetNum) + } + return +} + +func (s *Notice) selfPrizeQuiz(user *model.FissionUser, targetNum int32) (err error) { + m := s.GetDao().FissionCampaignQuiz + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + //看看有没有活动用户数据 + playerM := s.GetDao().FissionQuiz + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var chance = conf.Chance * targetNum + + if player == nil { + //创建用户的玩法用户数据 + err = playerM.WithContext(s.Ctx).Create(withdefault.FissionQuiz(&model.FissionQuiz{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: conf.InitChance + chance, + TaskChance: chance, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.TaskChance.Add(chance), playerM.Chance.Add(chance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *Notice) selfPrizeAnswer(user *model.FissionUser, targetNum int32) (err error) { + m := s.GetDao().FissionCampaignQa + conf, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + //看看有没有活动用户数据 + playerM := s.GetDao().FissionQa + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var chance = conf.Chance * targetNum + + if player == nil { + //创建用户的玩法用户数据 + err = playerM.WithContext(s.Ctx).Create(withdefault.FissionQa(&model.FissionQa{ + UserID: user.ID, + CampaignID: user.CampaignID, + Chance: conf.InitChance + chance, + TaskChance: chance, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.TaskChance.Add(chance), playerM.Chance.Add(chance)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// 上级统计数据 +func (s *Notice) parentStatNum(parent *model.FissionUser, newUser, setHelp bool, et int, targetNum int32) (err error) { + if parent == nil { + return + } + + m := s.GetDao().FissionUserStat + + var userIds = []int64{parent.ID} + if parent.ParentID > 0 { + userIds = append(userIds, parent.ParentID) + } + + stat, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(parent.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + s.pStat = stat + + // 直接要更新的数据, 间接要更新的数据 + var upData, indirectData []field.AssignExpr + if newUser { + upData = append(upData, m.DirectNum.Add(1)) + if parent.ParentID > 0 { + indirectData = append(indirectData, m.IndirectNum.Add(1)) + } + } + + // 当前用户变成助力成功 + if setHelp { + upData = append(upData, m.EffectiveNum.Add(1)) + if parent.ParentID > 0 { + indirectData = append(indirectData, m.IndirectEffectiveNum.Add(1)) + } + } + + // 达标数+1 + if et != 0 { + upData = append(upData, m.TargetNum.Add(int64(targetNum))) + if parent.ParentID > 0 { + indirectData = append(indirectData, m.IndirectTargetNum.Add(int64(targetNum))) + } + } + + // 直接数据更新 + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(stat.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 间接数据更新 + if len(indirectData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(parent.ParentID)).UpdateSimple(indirectData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 达标数统计 +func (s *Notice) targetStatNum(user *model.FissionUser, targetNum int32) (err error) { + + m := s.GetDao().FissionUserStat + + // 直接达标数 + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID)).UpdateSimple(m.TargetNum.Add(int64(targetNum))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 间接达标数 + if user.ParentID > 0 { + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ParentID)).UpdateSimple(m.IndirectTargetNum.Add(int64(targetNum))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return + +} + +func (s *Notice) sign(user *model.FissionUser, parent *model.FissionUser) (err error) { + m := s.GetDao().FissionCampaignSign + fcs, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + //看看有没有活动用户数据 + playerM := s.GetDao().FissionSign + player, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + //创建用户的玩法用户数据 + err = playerM.WithContext(s.Ctx).Create(withdefault.FissionSign(&model.FissionSign{ + UserID: user.ID, + CampaignID: user.CampaignID, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + //防止并发获取骰子次数 + lc := app.NewRedisLock(s.Ctx, ckey.FissionParentInviteOnce(parent.ID), lock.SetExpire(5*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + return + } + + //是新用户,完成目标 + pfb, err := playerM.WithContext(s.Ctx).Where(playerM.UserID.Eq(parent.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if pfb == nil { + pfb = withdefault.FissionSign(&model.FissionSign{ + UserID: parent.ID, + CampaignID: parent.CampaignID, + }) + + //这里是防止后面有一些需求,导致上级用户可以不进入活动页面页能拉新的情况,不让一般都不会走进来这个if + if err = playerM.WithContext(s.Ctx).Create(pfb); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if fcs.HasCard == mtype.No { + return + } + + //假设邀请了完成了一次获取补签卡机会的任务 + var fnh int32 = 1 + + //添加机会数 + defer func() { + if err != nil || fnh == 0 { + return + } + addChance := fnh + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(pfb.ID)).UpdateSimple( + playerM.CardNum.Add(addChance), + playerM.TaskCard.Add(addChance), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + }() + + //目标数小于等于1,直接当完成,因为这里就是一个人进来的 + if fcs.InviteNum <= 1 { + return + } + + //如果多人给一次,借助redis.incr来记录一下 + fnh, err = s._targetToChance( + pfb.UserID, + pfb.TaskCard, + fcs.InviteNum, + 1, + ) + + return +} + +// 切换处理方式 +func (s *Notice) change(cpn *model.FissionCampaign, user *model.FissionUser, parent *model.FissionUser, newUser bool) (ok bool) { + if !consts.NewEventCpn(cpn.FissionID) { + return false + } + + switch s.Req.NoticeType { + case types.NoticeTypeInstall, types.NoticeTypeRegister, types.NoticeTypeOpen: + if parent == nil { + return + } + producer.NewCampaignNotice(s.Ctx).ValidEvents(types.ValidEvents{ + UserId: user.ID, + NewUser: newUser, + BehaviorTime: s.Req.BehaviorTime, + NoticeType: s.Req.NoticeType, + CampaignId: s.Req.CampaignId, + ParentId: user.ParentID, + }) + + if s.resendReg { + producer.NewCampaignNotice(s.Ctx).ValidEvents(types.ValidEvents{ + UserId: user.ID, + NewUser: false, + BehaviorTime: user.RegisterAt, + NoticeType: types.NoticeTypeRegister, + CampaignId: user.CampaignID, + ParentId: user.ParentID, + }) + } + + case types.NoticeTypeCustom, types.NoticeTypePay: + if user == nil { + return + } + + var eventType int32 = mtype.FissionCampaignCondEventTypeCustom + if s.Req.NoticeType == types.NoticeTypePay { + eventType = mtype.FissionCampaignCondEventTypeStandard + } + + producer.NewCampaignNotice(s.Ctx).ValidEvents(types.ValidEvents{ + UserId: user.ID, + NewUser: newUser, + BehaviorTime: s.Req.BehaviorTime, + NoticeType: s.Req.NoticeType, + Event: s.Req.Event, + EventData: s.Req.EventData, + EventType: eventType, + CampaignId: s.Req.CampaignId, + ParentId: user.ParentID, + }) + } + + return true +} diff --git a/internal/service/queue/consumer/campaignnotice/other_stat.go b/internal/service/queue/consumer/campaignnotice/other_stat.go new file mode 100644 index 0000000..09b8b32 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/other_stat.go @@ -0,0 +1,103 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/proto/go_proto/workerr" + "time" +) + +type OtherStat struct { + logic.Logic + + Req *types.CampaignOtherStat +} + +func (s *OtherStat) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.stat(cpn) + if err != nil { + return + } + + return +} + +// 活动数据 +func (s *OtherStat) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + if cpn.EndTime < time.Now().Unix() { + err = workerr.CEndError + return + } + + return + +} + +// 统计 +func (s *OtherStat) stat(cpn *model.FissionCampaign) (err error) { + exp := time.Unix(cpn.EndTime, 0).Add(time.Hour).Sub(time.Now()) + + //次数 + key := ckey.FissionStatOther(s.Req.CampaignId) + app.Redis.Cache.HIncrBy(s.Ctx, key, s.Req.Mark, 1) + app.Redis.Cache.Expire(s.Ctx, key, exp) + + switch s.Req.Mark { + case mtype.FissionStatOtherNoChanceClickBtn: + var yes bool + yes, err = s.newUser(cpn, exp) + if err != nil { + return + } + + if yes { + app.Redis.Cache.HIncrBy(s.Ctx, key, mtype.FissionStatOtherNoChanceClickBtnUser, 1) + } + case mtype.FissionStatOtherInviteShow: + var yes bool + yes, err = s.newUser(cpn, exp) + if err != nil { + return + } + + if yes { + app.Redis.Cache.HIncrBy(s.Ctx, key, mtype.FissionStatOtherInviteShowUser, 1) + } + } + + return +} + +func (s *OtherStat) newUser(cpn *model.FissionCampaign, exp time.Duration) (yes bool, err error) { + key := ckey.FissionStatOtherRecord(cpn.ID, s.Req.Mark) + yes, err = app.Redis.Cache.HSetNX(s.Ctx, key, s.Req.UserHashId, 1).Result() + if err != nil { + err = s.BE().RedisError(err) + return + } + + app.Redis.Cache.Expire(s.Ctx, key, exp) + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/project_user.go b/internal/service/queue/consumer/campaignnotice/project_user.go new file mode 100644 index 0000000..37f1b05 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/project_user.go @@ -0,0 +1,26 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" +) + +type ProjectUser struct { + logic.Logic + + Req *types.ProjectUser +} + +func (s *ProjectUser) Exec() (err error) { + + if !app.NewRedisLock(s.Ctx, ckey.FissionProjectUserUniq(s.Req.ProjectId, s.Req.UserId)).SoftLock() { + return + } + + _, _ = projectuser.NewProjectUser(s.Ctx, projectuser.WithInit(s.Req.ProjectId, s.Req.UserId)) + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/project_user_coin_deduct.go b/internal/service/queue/consumer/campaignnotice/project_user_coin_deduct.go new file mode 100644 index 0000000..09990c2 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/project_user_coin_deduct.go @@ -0,0 +1,158 @@ +package campaignnotice + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" +) + +type ProjectUserCoinDeduct struct { + logic.Logic + + Req *types.ProjectUserCoinDeduct +} + +func (s *ProjectUserCoinDeduct) Run() (err error) { + return logic.Run(s) +} + +func (s *ProjectUserCoinDeduct) Data() (data jsonm.JsonM) { + data, _ = jsonm.Marshal(s.Req) + return +} + +func (s *ProjectUserCoinDeduct) Exec() (err error) { + + switch s.Req.Type { + case types.ProjectUserCoinDeductTypeDeduct: + deduct, err1 := s.deduct() + if err1 != nil || deduct == nil { + return err1 + } + + err = s.deductCoin(deduct) + if err != nil { + return + } + + return + + case types.ProjectUserCoinDeductTypeExpired: + expired, err1 := s.expired() + if err1 != nil || expired == nil { + return err1 + } + + err = s.expiredCoin(expired) + if err != nil { + return + } + + } + + return +} + +func (s *ProjectUserCoinDeduct) expired() (expired *model.ProjectUserCoinExpired, err error) { + m := s.GetDao().ProjectUserCoinExpired + expired, err = m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.ExpiredId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *ProjectUserCoinDeduct) expiredCoin(expired *model.ProjectUserCoinExpired) (err error) { + m := s.GetDao().ProjectUserCoin + coin, err := m.WithContext(s.Ctx).Where(m.ID.Eq(expired.CoinID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if coin == nil || coin.IsUsed == mtype.Yes { + return + } + + userM := s.GetDao().ProjectUser + user, err := userM.WithContext(s.Ctx).Where(m.ID.Eq(coin.UserID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if user == nil { + return + } + + pu, err := projectuser.NewProjectUser(s.Ctx, projectuser.WithUser(user)) + if err != nil { + return + } + + _, err = pu.Expired(int64(coin.CoinUse)) + if err != nil { + return + } + + _, err = s.GetDao().ProjectUserCoinExpired.WithContext(s.Ctx).Delete(expired) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s.GetDao().ProjectUserCoinRecord.WithContext(s.Ctx).Create(withdefault.ProjectUserCoinRecord(&model.ProjectUserCoinRecord{ + ProjectID: user.ProjectID, + UserID: user.ID, + Source: coin.Source, + SourceID: coin.SourceID, + Type: mtype.ProjectUserCoinRecordTypeDer, + Mark: mtype.ProjectUserCoinDerExpired, + Num: coin.CoinUse, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *ProjectUserCoinDeduct) deduct() (deduct *model.ProjectUserCoinDeduct, err error) { + m := s.GetDao().ProjectUserCoinDeduct + deduct, err = m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.DeductId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +func (s *ProjectUserCoinDeduct) deductCoin(deduct *model.ProjectUserCoinDeduct) (err error) { + pu, err := projectuser.NewProjectUser(s.Ctx, projectuser.WithUserId(s.Req.UserId)) + if err != nil { + return + } + + _, err = pu.Deduct(deduct.RelateMark, deduct.Operate, deduct.RelateID, deduct.Num) + if err != nil { + return + } + + _, err = s.GetDao().ProjectUserCoinDeduct.WithContext(s.Ctx).Delete(deduct) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/pub_test.go b/internal/service/queue/consumer/campaignnotice/pub_test.go new file mode 100644 index 0000000..42c2e4f --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/pub_test.go @@ -0,0 +1,118 @@ +package campaignnotice + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "github.com/rs/xid" + "gits.branchcn.com/backend/microcode/plugins/kafka" + "testing" + "time" + + _ "joybuywork/test" +) + +func TestCampaignNotice(t *testing.T) { + + kafkaConfig := kafka.PluginConfig{ + Brokers: []string{ + "120.79.90.126:9093", + }, + } + var err error + app.Kafka, err = kafka.NewPlugin(kafkaConfig) + if err != nil { + t.Log(err) + return + } + producer.SetUp() + + ctx := context.WithValue(context.Background(), consts.TraceIdKey, xid.New().String()) + + p := producer.NewCampaignNotice(ctx) + + var userMap = map[string]struct{}{} + + for i := 0; i < 20; i++ { + userMap[xid.New().String()] = struct{}{} + } + + for i := 0; i < 50; i++ { + var d string + for k, _ := range userMap { + d = k + break + } + + var data = types.CampaignNotice{ + CampaignId: 1290, + DeviceId: d, + UserId: "", + ParentId: "111", + IsInstall: true, + BehaviorTime: time.Now().Unix(), + } + + if i%2 == 0 { + data.UserId = d + data.IsInstall = false + } + + p.CampaignNotice(data) + } + + time.Sleep(2 * time.Second) +} + +func TestCampaignStat(t *testing.T) { + + kafkaConfig := kafka.PluginConfig{ + Brokers: []string{ + "120.79.90.126:9093", + }, + } + var err error + app.Kafka, err = kafka.NewPlugin(kafkaConfig) + if err != nil { + t.Log(err) + return + } + producer.SetUp() + + ctx := context.WithValue(context.Background(), consts.TraceIdKey, xid.New().String()) + + p := producer.NewCampaignNotice(ctx) + + var userMap = map[string]struct{}{} + for i := 0; i < 20; i++ { + userMap[xid.New().String()] = struct{}{} + } + + var tms = map[string]struct{}{ + mtype.FissionStatOtherNoChanceClickBtn: {}, + } + + for i := 0; i < 200; i++ { + var mk string + for k := range tms { + mk = k + break + } + + var userHid string + for k := range userMap { + userHid = k + } + + p.CampaignOtherStat(types.CampaignOtherStat{ + CampaignId: 367, + UserHashId: userHid, + Mark: mk, + }) + } + + time.Sleep(2 * time.Second) +} diff --git a/internal/service/queue/consumer/campaignnotice/reward_limit_up.go b/internal/service/queue/consumer/campaignnotice/reward_limit_up.go new file mode 100755 index 0000000..d41cf8d --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/reward_limit_up.go @@ -0,0 +1,423 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "time" +) + +type RewardLimitUp struct { + logic.Logic + + Req *types.RewardLimitUp +} + +func (s *RewardLimitUp) Exec() (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch cpn.FissionID { + case consts.IdReferral, consts.IdWinTogether: + app.Redis.Cache.Del(s.Ctx, ckey.FissionCampaignRewardLimitPool(cpn.ID)) + stocks.NewCleaner(s.Ctx, cpn.ID).ClearCampaign() + default: + + } + + switch cpn.FissionID { + case consts.IdReferral: + return s._referral(cpn) + case consts.IdWinTogether: + return s._win(cpn) + case consts.IdGrow: + return s._grow(cpn) + default: + + } + + return +} + +// 版本控制执行 +func (s *RewardLimitUp) _verDone(cpnId int64, fn func() (bool, error)) (err error) { + key := ckey.FissionRewardLimitUpVer(cpnId) + now := time.Now() + + for { + if app.NewVerControl(s.Ctx, key).HasNewVersion(now) { + return + } + + end, err1 := fn() + if err1 != nil || end { + err = err1 + return + } + } +} + +func (s *RewardLimitUp) _grow(cpn *model.FissionCampaign) (err error) { + var id int64 + limit := 50 + + rewardM := s.GetDao().FissionCampaignReward + rewardList, err := rewardM.WithContext(s.Ctx).Where(rewardM.ID.In(s.Req.RewardIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ids []int64 + var rewardMap = make(map[int64]*model.FissionCampaignReward) + for _, reward := range rewardList { + rewardMap[reward.ID] = reward + ids = append(ids, reward.ID) + } + + m := s.GetDao().FissionRewardRecord + ms := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + return s._verDone(cpn.ID, func() (bool, error) { + + var list []*model.FissionRewardRecord + list, err = ms.WithContext(s.Ctx). + Where( + ms.CampaignID.Eq(cpn.ID), + ms.RewardID.In(ids...), + ms.Status.Eq(mtype.FissionRewardRecordStatusFail), + ms.FailMsg.Eq(mtype.FissionRewardRecordFailTypeCliLackMsg), + ms.ID.Gt(id), + ).Limit(limit).Order(ms.ID).Find() + if err != nil { + return false, s.BE().MysqlError(err) + } + + if len(list) == 0 { + return true, nil + } + + var recordIds []int64 + var pushRecords []*model.FissionRewardRecord + for _, record := range list { + ok, _ := award.NewAwardIssVerify(s.Ctx, nil, rewardMap[record.RewardID]).DeductStock().IsOK() + if !ok { + continue + } + + recordIds = append(recordIds, record.ID) + pushRecords = append(pushRecords, record) + } + + if len(recordIds) == 0 { + return true, nil + } + + _, _ = m.WithContext(s.Ctx).Where(m.ID.In(recordIds...)).UpdateSimple( + m.Status.Value(mtype.FissionRewardRecordStatusWait), + m.FailType.Value(""), + m.FailMsg.Value(""), + ) + + _, _ = ms.WithContext(s.Ctx).Where(ms.ID.In(recordIds...)).UpdateSimple( + ms.Status.Value(mtype.FissionRewardRecordStatusWait), + ms.FailType.Value(""), + ms.FailMsg.Value(""), + ) + + for _, record := range pushRecords { + producer.NewCampaignNotice(s.Ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: record.CampaignID, + UserId: record.UserID, + UserRewardId: record.ID, + }) + } + + l := len(list) + id = list[l-1].ID + return l < limit, nil + }) +} + +func (s *RewardLimitUp) _referral(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignReferral(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var id int64 + limit := 20 + m := s.GetDao().FissionReferral + + return s._verDone(cpn.FissionID, func() (bool, error) { + var list []*model.FissionReferral + list, err = m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(cpn.ID), + m.LimitStatus.Eq(mtype.FissionReferralLimitStatusBudget), + m.ID.Gt(id), + ).Limit(limit).Order(m.ID).Find() + if err != nil { + return false, s.BE().MysqlError(err) + } + + if len(list) == 0 { + return true, nil + } + + var userId []int64 + for _, v := range list { + userId = append(userId, v.UserID) + } + + userM := s.GetDao().FissionUser.SubTable(cpn.ID) + var users []*model.FissionUser + users, err = userM.WithContext(s.Ctx).Where(userM.ID.In(userId...)).Find() + if err != nil { + return false, s.BE().MysqlError(err) + } + + var userMap = make(map[int64]*model.FissionUser, len(users)) + for _, v := range users { + userMap[v.ID] = v + } + + for _, v := range list { + err = s._compensate(cpn, userMap[v.UserID], conf.RewardRule, conf.StepLoop, conf.RewardLimit, v.NextStep, v.LoopInvite, func(limitStatus int8, nextStep, loopInvite int32) (err error) { + playerM := s.GetDao().FissionReferral + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(v.ID)).UpdateSimple(playerM.LimitStatus.Value(limitStatus)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + }) + } + + l := len(list) + id = list[l-1].ID + return l < limit, nil + }) +} + +func (s *RewardLimitUp) _win(cpn *model.FissionCampaign) (err error) { + conf, err := cache.NewCampaignWin(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var id int64 + limit := 20 + m := s.GetDao().FissionWin + return s._verDone(cpn.FissionID, func() (bool, error) { + var list []*model.FissionWin + list, err = m.WithContext(s.Ctx). + Where( + m.CampaignID.Eq(cpn.ID), + m.LimitStatus.Eq(mtype.FissionReferralLimitStatusBudget), + m.ID.Gt(id), + ).Limit(limit).Order(m.ID).Find() + if err != nil { + return false, s.BE().MysqlError(err) + } + + if len(list) == 0 { + return true, nil + } + + var userId []int64 + for _, v := range list { + userId = append(userId, v.UserID) + } + + userM := s.GetDao().FissionUser.SubTable(cpn.ID) + var users []*model.FissionUser + users, err = userM.WithContext(s.Ctx).Where(userM.ID.In(userId...)).Find() + if err != nil { + return false, s.BE().MysqlError(err) + } + + var userMap = make(map[int64]*model.FissionUser, len(users)) + for _, v := range users { + userMap[v.ID] = v + } + + for _, v := range list { + err = s._compensate(cpn, userMap[v.UserID], conf.RewardRule, conf.StepLoop, conf.RewardLimit, v.NextStep, v.LoopInvite, func(limitStatus int8, nextStep, loopInvite int32) (err error) { + playerM := s.GetDao().FissionWin + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(v.ID)).UpdateSimple(playerM.LimitStatus.Value(limitStatus)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + }) + } + + l := len(list) + id = list[l-1].ID + return l < limit, nil + }) +} + +func (s *RewardLimitUp) _compensate(cpn *model.FissionCampaign, user *model.FissionUser, rewardRule, stepLoop int8, rewardLimit, nextStep, loopInvite int32, limitDo limitDo) (err error) { + rewards, err := cmm.NewUserAppReward(s.Ctx).Get(s.GetDao(), user, s.GetDao().FissionCampaignReward.Step) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + m := s.GetDao().FissionUser.SubTable(user.CampaignID) + statKey := ckey.FissionUserInviteStat(user.ID) + num, err := lockdo.Int64(s.Ctx, statKey, func() (num int64, err error) { + return m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.ParentID.Eq(user.ID), + m.IsHelp.Eq(mtype.Yes), + ).Count() + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch rewardRule { + case mtype.FissionReferralRewardRuleStep: + return s._step(cpn, user, num, rewards, stepLoop, nextStep, loopInvite, rewardLimit, limitDo) + case mtype.FissionReferralRewardRuleCycle: + return s._cycle(cpn, user, num, rewards, rewardLimit, limitDo) + } + + return +} + +type limitDo func(limitStatus int8, nextStep, loopInvite int32) (err error) + +func (s *RewardLimitUp) _step(cpn *model.FissionCampaign, user *model.FissionUser, effectNum int64, rewards []*model.FissionCampaignReward, stepLoop int8, nextStep, loopInvite, rewardLimit int32, limitDo limitDo) (err error) { + var stepMap = make(map[int32]*model.FissionCampaignReward, len(rewards)) + var inviteAll int32 + var maxStep int32 + for _, reward := range rewards { + inviteAll += reward.InviteNum + stepMap[reward.Step] = reward + if reward.Step > maxStep { + maxStep = reward.Step + } + } + + for { + + if stepLoop == mtype.Yes && (loopInvite*inviteAll) >= rewardLimit { + return limitDo(mtype.FissionReferralLimitStatusInvite, nextStep, loopInvite) + } + + cn := int32(effectNum) - (loopInvite * inviteAll) + + reward, ok := stepMap[nextStep] + if !ok { + return limitDo(mtype.FissionReferralLimitStatusFinish, 0, loopInvite) + } + + if reward.InviteNum > cn { + return limitDo(mtype.FissionReferralLimitStatusNone, reward.Step, loopInvite) + } + + var decr = int64(reward.RewardNum) //奖品数据 + + //扣除总预算是否成功 + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + decrOk, _ := stock.DecrPoolAndAdd(cpn.ID, decr) + if !decrOk { + return limitDo(mtype.FissionReferralLimitStatusBudget, reward.Step, loopInvite) + } + + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).One(reward, true) + if err != nil { + return + } + + nextStep++ + + if nextStep > maxStep && stepLoop == mtype.Yes { + nextStep = 1 + loopInvite++ + } + + } + +} + +func (s *RewardLimitUp) _cycle(cpn *model.FissionCampaign, user *model.FissionUser, effectNum int64, rewards []*model.FissionCampaignReward, rewardLimit int32, limitDo limitDo) (err error) { + + key := ckey.FissionUserGetRewardNum(user.ID) + num, err := lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + reward := rewards[0] + + var needInvite = int64(reward.InviteNum) //完成任务需要邀请的人数 + var decr = int64(reward.RewardNum) //奖品数据 + + for { + cn := effectNum - (num * needInvite) //总邀请人数 -(完成任务数 * 完成任务需要邀请的人数)= 计算完成任务的邀请人数 + + //邀请的人不足以获取到奖品 + if cn < needInvite { + return limitDo(mtype.FissionReferralLimitStatusNone, -1, 0) + } + + if (num * needInvite) >= int64(rewardLimit) { + return limitDo(mtype.FissionReferralLimitStatusInvite, -1, 0) + } + + //扣除总预算是否成功 + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, cpn.ID) + if err != nil { + return + } + + decrOk, _ := stock.DecrPoolAndAdd(cpn.ID, decr) + if !decrOk { + return limitDo(mtype.FissionReferralLimitStatusBudget, -1, 0) + } + + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), cpn.ProjectID, user).One(reward, true) + if err != nil { + return + } + + // 领奖数+1 + app.Redis.Cache.Incr(s.Ctx, key) + num++ + } +} diff --git a/internal/service/queue/consumer/campaignnotice/reward_notify.go b/internal/service/queue/consumer/campaignnotice/reward_notify.go new file mode 100644 index 0000000..0cf79a6 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/reward_notify.go @@ -0,0 +1,304 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/notify" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" +) + +type RewardNotify struct { + logic.Logic + + Req *types.CampaignRewardNotify +} + +func (s *RewardNotify) Exec() (err error) { + cpn, user, err := s.campaign() + if err != nil { + return + } + + err = s.notify(cpn, user) + if err != nil { + return + } + + return +} + +func (s *RewardNotify) notify(cpn *model.FissionCampaign, user *model.FissionUser) (err error) { + rewardRecordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err := rewardRecordM.WithContext(s.Ctx).Where(rewardRecordM.ID.Eq(s.Req.UserRewardId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + err = workerr.NotFound("not found reward record") + return + } + + if record.Status != mtype.FissionRewardRecordStatusWait { + return + } + + // 固定奖品不处理 + if verify.InArray[int64](record.BaseRewardID, app.FixRewardsIdThank, app.FixRewardsIdChallengeFailed) { + _, err = rewardRecordM. + WithContext(s.Ctx). + Where(rewardRecordM.ID.Eq(record.ID)). + UpdateSimple(rewardRecordM.Status.Value(mtype.FissionRewardRecordStatusSuccess)) + if err != nil { + return s.BE().MysqlError(err) + } + + recordM := s.GetDao().FissionRewardRecord + _, err = recordM. + WithContext(s.Ctx). + Where(recordM.ID.Eq(record.ID)). + UpdateSimple(recordM.Status.Value(mtype.FissionRewardRecordStatusSuccess)) + if err != nil { + return s.BE().MysqlError(err) + } + + return + } + + baseReward, err := cache.NewReward(s.Ctx).FindById(record.BaseRewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 是需要推送的奖品,但是没绑定回调地址 + if baseReward == nil || (baseReward.ReceiveType == mtype.RewardReceiveTypeNotify && baseReward.URLID == 0) { + return s._errData(record) + } + + // 活动结束 + if (cpn.EndTime > 0 && record.CreatedAt > cpn.EndTime) || (cpn.Status == mtype.FissionCampaignStatusCancel && record.CreatedAt > cpn.UpdatedAt) { + _, err = rewardRecordM.WithContext(s.Ctx).Where(rewardRecordM.ID.Eq(record.ID)). + UpdateSimple( + rewardRecordM.Status.Value(mtype.FissionRewardRecordStatusFail), + rewardRecordM.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + rewardRecordM.FailMsg.Value("活动结束"), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + recordM := s.GetDao().FissionRewardRecord + _, err = recordM. + WithContext(s.Ctx). + Where(recordM.ID.Eq(record.ID)). + UpdateSimple( + recordM.Status.Value(mtype.FissionRewardRecordStatusFail), + recordM.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + recordM.FailMsg.Value("活动结束"), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + if record.MallRecordID > 0 { + mallRecordM := s.GetDao().RedeemMallRecord + _, err = mallRecordM. + WithContext(s.Ctx). + Where(mallRecordM.ID.Eq(record.MallRecordID)). + UpdateSimple( + mallRecordM.Status.Value(mtype.RedeemMallRecordStatusFail), + mallRecordM.FailType.Value(mtype.RewardPushFailTypeCli), + mallRecordM.FailMsg.Value("活动结束"), + ) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return + } + + switch baseReward.ReceiveType { + case mtype.RewardReceiveTypeContact: // 自主发放,改成需要手动发放 + return s._manual(record) + case mtype.RewardReceiveTypeForm: // 表单 + return s._form(record) + case mtype.RewardReceiveTypeClient, mtype.RewardReceiveTypeNone: // 客户端回调要等客户端那边同步状态 + return + default: + } + + // 推送数据 + rewardHashId, rewardTitle, kvData := record.HashID, record.Title, baseReward.GetJustKvData() + var rewardNum = utils.Ternary[int32](record.RewardNum < 1, 1, record.RewardNum) + project, err := finder.Project(s.Ctx, cpn.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + url, err := cache.NewNotifyURL(s.Ctx).FindById(baseReward.URLID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 找上级用户 + var parentSubUserId string + if user.ParentID > 0 { + var parent *model.FissionUser + parent, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindById(user.ParentID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if parent != nil { + parentSubUserId = parent.SubUserID + } + } + + err = notify.Reward{ + CampaignId: cpn.ID, + RewardId: s.Req.UserRewardId, + UserId: user.ID, + ParentId: user.ParentID, + CampaignHashId: cpn.HashID, + RewardHashId: rewardHashId, + KvData: kvData, + RewardType: record.RewardType, + RewardTitle: rewardTitle, + RewardNum: rewardNum, + SubUserId: user.SubUserID, + ParentSubUserId: parentSubUserId, + Lang: utils.STernary[string](user.UserLang, "", user.LangMark), + Title: cpn.Title, + MallRecordId: record.MallRecordID, + }.Send(s.Ctx, url.URL, project.NotifyToken, project.PushLadder, url.GetHeaders()) + + return +} + +func (s *RewardNotify) _manual(record *model.FissionRewardRecord) (err error) { + m := s.GetDao().FissionRewardRecord + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(record.ID)).UpdateSimple( + m.Status.Value(mtype.FissionRewardRecordStatusManual), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + sm := s.GetDao().FissionRewardRecord.SubTable(record.CampaignID) + _, err = sm.WithContext(s.Ctx).Where(sm.ID.Eq(record.ID)).UpdateSimple( + sm.Status.Value(mtype.FissionRewardRecordStatusManual), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *RewardNotify) _form(record *model.FissionRewardRecord) (err error) { + m := s.GetDao().FissionRewardRecord + _, err = m.WithContext(s.Ctx).Where( + m.ID.Eq(record.ID), + m.Status.Eq(mtype.FissionRewardRecordStatusWait), + ).UpdateSimple( + m.Status.Value(mtype.FissionRewardRecordStatusWaitForm), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + sm := s.GetDao().FissionRewardRecord.SubTable(record.CampaignID) + _, err = sm.WithContext(s.Ctx).Where( + sm.ID.Eq(record.ID), + sm.Status.Eq(mtype.FissionRewardRecordStatusWait), + ).UpdateSimple( + sm.Status.Value(mtype.FissionRewardRecordStatusWaitForm), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// 关联非法奖品数据 +func (s *RewardNotify) _errData(record *model.FissionRewardRecord) (err error) { + m := s.GetDao().FissionRewardRecord + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(record.ID)). + UpdateSimple( + m.Status.Value(mtype.FissionRewardRecordStatusFail), + m.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + m.FailMsg.Value("关联非法奖品数据"), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + sm := s.GetDao().FissionRewardRecord.SubTable(record.CampaignID) + _, err = sm.WithContext(s.Ctx).Where(sm.ID.Eq(record.ID)). + UpdateSimple( + sm.Status.Value(mtype.FissionRewardRecordStatusFail), + sm.FailType.Value(mtype.FissionRewardRecordFailTypeCli), + sm.FailMsg.Value("关联非法奖品数据"), + ) + if err != nil { + return s.BE().MysqlError(err) + } + + if record.MallRecordID > 0 { + mallRecordM := s.GetDao().RedeemMallRecord + _, err = mallRecordM. + WithContext(s.Ctx). + Where(mallRecordM.ID.Eq(record.MallRecordID)). + UpdateSimple( + mallRecordM.Status.Value(mtype.RedeemMallRecordStatusFail), + mallRecordM.FailType.Value(mtype.RewardPushFailTypeCli), + mallRecordM.FailMsg.Value("关联非法奖品数据"), + ) + if err != nil { + return s.BE().MysqlError(err) + } + } + + return +} + +func (s *RewardNotify) campaign() (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + user, err = finder.FissionUser(s.Ctx, cpn.ID, s.Req.UserId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/settlement_reward.go b/internal/service/queue/consumer/campaignnotice/settlement_reward.go new file mode 100644 index 0000000..8a0e4fc --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/settlement_reward.go @@ -0,0 +1,47 @@ +package campaignnotice + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" +) + +type SettlementReward struct { + logic.Logic + + Req *types.CampaignSettlementReward +} + +func (s *SettlementReward) Exec() (err error) { + + m := s.GetDao().FissionVsVoteSettlement + slt, err := m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.SettlementId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if slt == nil { + return + } + + user, err := cache.NewFissionUser(s.Ctx, slt.CampaignID).FindById(slt.UserID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + vs, err := players.NewVs(s.Ctx, user) + if err != nil { + return + } + + _, err = vs.SettlementReward(slt) + if err != nil { + return + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/target_stat.go b/internal/service/queue/consumer/campaignnotice/target_stat.go new file mode 100644 index 0000000..5aa6370 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/target_stat.go @@ -0,0 +1,189 @@ +package campaignnotice + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/proto/go_proto/workerr" + "fmt" +) + +type TargetStat struct { + logic.Logic + + Req *types.CampaignTargetStat +} + +func (s *TargetStat) Exec() (err error) { + conf, err := s.Conf() + if err != nil { + return + } + + return s.stat(conf) +} + +func (s *TargetStat) Conf() (conf *model.FissionCampaignConfig, err error) { + conf, err = cache.NewCampaignConfig(s.Ctx).FindByCampaignId(s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil { + err = workerr.NotFound("not found cond") + return + } + + return +} + +func (s *TargetStat) stat(conf *model.FissionCampaignConfig) (err error) { + switch conf.BothType { + case mtype.FissionCampaignConfigTargetBothTypeOne: + return s.one() + case mtype.FissionCampaignConfigTargetBothTypeAll: + return s.all() + } + return +} + +// 所有条件 +func (s *TargetStat) all() (err error) { + if len(s.Req.CondIds) == 0 { + return + } + + num, err := s.getNum() + if err != nil { + return + } + + var condIdStr string + for i, v := range s.Req.CondIds { + if i == 0 { + condIdStr += fmt.Sprint(v) + } else { + condIdStr += fmt.Sprintf(",%d", v) + } + + } + + m := s.GetDao().FissionTargetRecord + err = m.WithContext(s.Ctx).Create(withdefault.FissionTargetRecord(&model.FissionTargetRecord{ + CampaignID: s.Req.CampaignId, + UserID: s.Req.UserId, + Num: num, + CondID: condIdStr, + FinishTime: s.Req.FinishTime, + })) + if err != nil { + return s.BE().MysqlError(err) + } + + s.behavior(map[string][]int64{ + "cond_id": s.Req.CondIds, + }) + + return +} + +// 任一条件 +func (s *TargetStat) one() (err error) { + if len(s.Req.CondIds) == 0 { + return + } + + var add []*model.FissionTargetRecord + for _, condId := range s.Req.CondIds { + var num int32 + num, err = s.getNum() + if err != nil { + return + } + add = append(add, withdefault.FissionTargetRecord(&model.FissionTargetRecord{ + CampaignID: s.Req.CampaignId, + UserID: s.Req.UserId, + Num: num, + CondID: fmt.Sprint(condId), + FinishTime: s.Req.FinishTime, + })) + + s.behavior(map[string][]int64{ + "cond_id": {condId}, + }) + } + + m := s.GetDao().FissionTargetRecord + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +func (s *TargetStat) getNum() (num int32, err error) { + key := ckey.FissionUserTargetNum(s.Req.UserId) + defer func() { + num = int32(app.Redis.Cache.Incr(s.Ctx, key).Val()) + }() + + exist, err := app.Redis.Exists(s.Ctx, key) + if err != nil { + err = s.BE().RedisError(err) + return + } + + if exist { + return + } + + lc := app.NewRedisLock(s.Ctx, ckey.ForLock(key)).Lock() + defer lc.Release() + + if lc.Error() != nil { + err = workerr.BusyError + return + } + + exist, err = app.Redis.Exists(s.Ctx, key) + if err != nil { + err = s.BE().RedisError(err) + return + } + + if exist { + return + } + + m := s.GetDao().FissionTargetRecord + var count int64 + count, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(s.Req.UserId)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + app.Redis.Cache.IncrBy(s.Ctx, key, count) + + return +} + +func (s *TargetStat) behavior(otherData map[string][]int64) { + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: s.Req.CampaignId, + BehaviorType: mtype.FissionBehaviorTypeFinishTask, + BehaviorTime: s.Req.FinishTime, + UserMark: fmt.Sprint(s.Req.UserId), + OtherData: otherData, + }) + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/ballot.go b/internal/service/queue/consumer/campaignnotice/validevents/ballot.go new file mode 100644 index 0000000..af9d077 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/ballot.go @@ -0,0 +1,5 @@ +package validevents + +type ballot struct { + base +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/base.go b/internal/service/queue/consumer/campaignnotice/validevents/base.go new file mode 100644 index 0000000..05401d5 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/base.go @@ -0,0 +1,592 @@ +package validevents + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + "fmt" + "math/rand" + "strconv" + "time" + + "gorm.io/gen/field" +) + +// 安装、注册事件是否有效处理 +type taskEffectDo func() (err error) + +// 事件完成任务回调 +type taskDoneCallback func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) + +type eventData struct { + props map[string]int32 // 道具对应的发放数量,如: {"chance": 10, "fixed_roll": 1} (如果是大富翁表示,骰子个数获得10个,固定骰子获得1个) + targetNum int32 // 当前推送的事件计算完毕后,总共完成了几次自定义事件 +} + +type base struct { + *logic.Logic + Req *types.ValidEvents + + effectNum, taskValidNum int64 + + cpn *model.FissionCampaign + tOffset int32 // 时区 + reportType int8 // 报表类型 + spLang []string // 支持的语种 + + condFinishData []*condFinishOne + condTotalData []*condTotalOne +} + +func (s *base) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + return +} + +func (s *base) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + return +} + +func (s *base) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + return +} + +func (s *base) Open(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + return +} + +func (s *base) Click(userMark string, beHelper *model.FissionUser) (err error) { + return +} + +// 条件结果处理 +func (s *base) _event(user *model.FissionUser, callbacks ...taskDoneCallback) (data eventData, err error) { + e := event{base: s} + + defer func() { + if err == nil { + err = e.dataSync() + } + }() + + return e.event(user, callbacks...) +} + +// 任务是否有效完成 +func (s *base) _effect(user *model.FissionUser, task *model.FissionCampaignTask, ideq ...string) (ok bool, err error) { + taskLimit, chance, chanceLimit, targetNum := int64(task.TaskLimit), int64(task.Chance), int64(task.ChanceLimit), int64(task.Num) + // 完成的任务 + ftNum, err := s._taskFinishNum(user.ID, task.ID) + if err != nil { + return + } + + // 统计有效邀请人数 + + var num int64 + if task.PropMark == mtype.FissionCampaignTaskPropMarkChance { + num, err = s._statDirectNum(user.CampaignID, user.ID) + if err != nil { + return + } + } else { + num, err = s._statTaskValidNum(user.CampaignID, user.ID, task.ID, ideq...) + if err != nil { + return + } + } + + var indicatorData *mtype.IndicatorData + switch s.Req.NoticeType { + case types.NoticeTypeInstall: + indicatorData = &mtype.IndicatorData{ + InstallNum: num, + } + case types.NoticeTypeRegister: + indicatorData = &mtype.IndicatorData{ + RegisterNum: num, + } + default: + + } + + // 超过限制不能完成任务了 + if (task.TaskLimit != 0 && ftNum >= taskLimit) || + (task.ChanceLimit != 0 && (ftNum*chance) >= chanceLimit) { + return false, s._taskRecord(user, task, indicatorData, mtype.Yes) + } + + // 有效计算次数 + //总邀请人数 减去 当前任务完成次数 * 任务目标次数 + efNum := num - (ftNum * targetNum) + if efNum < targetNum { + return + } + + return true, s._taskRecord(user, task, indicatorData, mtype.No) +} + +// 任务有效就执行任务有效处理 +func (s *base) _taskEffectDo(user *model.FissionUser, task *model.FissionCampaignTask, do taskEffectDo, ideq ...string) (err error) { + ok, err := s._effect(user, task, ideq...) + if err != nil { + return + } + + if !ok { + return + } + + return do() +} + +// 统计有效邀请人数 +func (s *base) _statDirectNum(cpnId, userId int64) (num int64, err error) { + // 如果已经统计过了,就直接返回 + if s.effectNum > 0 { + return s.effectNum, nil + } + + key := ckey.FissionUserInviteStat(userId) + + _, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUser.SubTable(cpnId) + return m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpnId), + m.ParentID.Eq(userId), + m.IsHelp.Eq(mtype.Yes), + ).Count() + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + + app.Redis.Cache.Expire(s.Ctx, key, 2*time.Hour) + s.effectNum, err = app.Redis.Cache.Incr(s.Ctx, key).Result() + if err != nil { + err = s.BE().CacheError(err) + return + } + + return s.effectNum, nil +} + +// 统计任务有效数 +func (s *base) _statTaskValidNum(cpnId, userId, taskId int64, ideq ...string) (num int64, err error) { + // 如果已经统计过了,就直接返回 + if s.taskValidNum > 0 { + return s.taskValidNum, nil + } + + key := ckey.FissionUserTaskValidStat(userId, taskId) + + _, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserTaskValid + return m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpnId), + m.UserID.Eq(userId), + m.TaskID.Eq(taskId), + ).Count() + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + + valid := withdefault.FissionUserTaskValid(&model.FissionUserTaskValid{ + CampaignID: cpnId, + UserID: userId, + TaskID: taskId, + }) + valid.SetIdeq(ideq...) + + m := s.GetDao().FissionUserTaskValid + has, err := m.WithContext(s.Ctx).Where(m.Ideq.Eq(valid.Ideq)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if has > 1 { + return + } + + if err = m.WithContext(s.Ctx).Create(valid); err != nil { + err = s.BE().MysqlError(err) + return + } + + app.Redis.Cache.Expire(s.Ctx, key, 2*time.Hour) + s.taskValidNum, err = app.Redis.Cache.Incr(s.Ctx, key).Result() + if err != nil { + err = s.BE().CacheError(err) + return + } + + return s.taskValidNum, nil +} + +// 任务完成数 +func (s *base) _taskFinishNum(userId, taskId int64) (num int64, err error) { + key := ckey.FissionUserTaskCpnLimit(userId, taskId) + num, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserTaskRecord + return m.WithContext(s.Ctx).Where(m.UserID.Eq(userId), m.TaskID.Eq(taskId)).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + return +} + +// 任务完成次数刷新缓存 +func (s *base) _addTaskFinish(user *model.FissionUser, task *model.FissionCampaignTask, chance int64) (err error) { + if task.TaskLimit > 0 || task.ChanceLimit > 0 { + key := ckey.FissionUserTaskCpnLimit(user.ID, task.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if !exist { + var num int64 + m := s.GetDao().FissionUserTaskRecord + num, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.TaskID.Eq(task.ID)).Count() + if err != nil { + return + } + app.Redis.Cache.IncrBy(s.Ctx, key, num) + } + + app.Redis.Cache.IncrBy(s.Ctx, key, chance) + app.Redis.Cache.Expire(s.Ctx, key, time.Duration(rand.Intn(60)+60)*time.Minute) + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if task.DayLimit > 0 { + day, start, end := timez.GMTStartAndEndTs(s.tOffset, s.Req.BehaviorTime) + key := ckey.FissionUserTaskDayLimit(day, user.ID, task.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if !exist { + var num int64 + m := s.GetDao().FissionUserTaskRecord + num, err = m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.TaskID.Eq(task.ID), + m.CreatedAt.Gte(start), + m.CreatedAt.Lte(end), + ).Count() + if err != nil { + return + } + app.Redis.Cache.IncrBy(s.Ctx, key, num) + } + app.Redis.Cache.IncrBy(s.Ctx, key, chance) + app.Redis.Cache.Expire(s.Ctx, key, time.Duration(rand.Intn(60)+60)*time.Minute) + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if task.WeekLimit > 0 { + start, end := timez.GetWeekEnd(s.tOffset, int32(task.WeekNum)) + key := ckey.FissionUserWeekLimit(start, user.ID, task.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if !exist { + var num int64 + m := s.GetDao().FissionUserTaskRecord + num, err = m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.TaskID.Eq(task.ID), + m.CreatedAt.Between(start, end), + ).Count() + if err != nil { + return + } + app.Redis.Cache.IncrBy(s.Ctx, key, num) + } + app.Redis.Cache.IncrBy(s.Ctx, key, chance) + app.Redis.Cache.Expire(s.Ctx, key, time.Duration(rand.Intn(60)+60)*time.Minute) + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return +} + +// 一个任务完成了 +func (s *base) _taskRecord(user *model.FissionUser, task *model.FissionCampaignTask, data *mtype.IndicatorData, limit int8) (err error) { + record := withdefault.FissionUserTaskRecord(&model.FissionUserTaskRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + TaskID: task.ID, + IndicatorData: "", + Chance: task.Chance, + LimitProp: limit, + }) + + record.SetIndicatorData(data) + + err = s._addUserTaskRecord(record) + if err != nil { + return + } + + return s._addTaskFinish(user, task, 1) +} + +// 添加任务完成记录 +func (s *base) _addUserTaskRecord(records ...*model.FissionUserTaskRecord) (err error) { + if len(records) == 0 { + return + } + m := s.GetDao().FissionUserTaskRecord + if err = m.WithContext(s.Ctx).Create(records...); err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 完成事件统计推送 +func (s *base) _condFinish(user *model.FissionUser, condId int64, total string, first bool) { + val, _ := strconv.ParseFloat(total, 64) + + s.condFinishData = append(s.condFinishData, &condFinishOne{ + condId: condId, + num: 1, + userNum: utils.Ternary[int64](first, 1, 0), + }) + + if s.reportType == mtype.FissionCampaignReportTypeNew { + s.MP().InApp(user).FinishCond(s.Req.BehaviorTime, condId, val, s.Req.Event, s.Req.EventData) + } +} + +func (s *base) _condTotal(condId int64, total string) { + val, _ := strconv.ParseFloat(total, 64) + s.condTotalData = append(s.condTotalData, &condTotalOne{ + condId: condId, + total: val, + }) +} + +// 获取安装事件的任务 +func (s *base) _getInstallTasks(campaignId int64) (tasks []*model.FissionCampaignTask, setHelp bool, err error) { + return s._getTaskAndHelp(campaignId, mtype.FissionCampaignTaskMarkInstall) +} + +// 获取注册事件的任务 +func (s *base) _getRegisterTasks(campaignId int64) (tasks []*model.FissionCampaignTask, setHelp bool, err error) { + return s._getTaskAndHelp(campaignId, mtype.FissionCampaignTaskMarkRegister) +} + +// 获取任务 +func (s *base) _getTaskAndHelp(campaignId int64, mark string) (tasks []*model.FissionCampaignTask, setHelp bool, err error) { + m := s.GetDao().FissionCampaignTask + tasks, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(campaignId), + m.TaskMark.Eq(mark), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, task := range tasks { + if task.PropMark == mtype.FissionCampaignTaskPropMarkChance { + setHelp = true + return + } + } + + for _, task := range tasks { + if verify.InArray[string](task.PropMark, + mtype.FissionCampaignTaskPropMarkFixedRoll, + mtype.FissionCampaignTaskPropMarkRevive, + mtype.FissionCampaignTaskPropMarkReward, + ) { + setHelp = true + return + } + } + + return +} + +// 同步数据 +func (s *base) dataSync() (err error) { + if len(s.condFinishData) > 0 { + var data = make(map[int64]*condFinishOne) + for _, v := range s.condFinishData { + if _, ok := data[v.condId]; !ok { + data[v.condId] = v + } else { + data[v.condId].num += v.num + } + } + m := s.GetDao().FissionCampaignCond + for _, v := range data { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(v.condId)).UpdateSimple(m.Num.Add(v.num), m.UserNum.Add(v.userNum)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + if len(s.condTotalData) > 0 { + var data = make(map[int64]float64) + for _, v := range s.condTotalData { + data[v.condId] += v.total + } + m := s.GetDao().FissionCampaignCond + for id, total := range data { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(id)).UpdateSimple(m.Total.Add(total)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + return +} + +// 增加抽奖次数通知 +func (s *base) addChanceNotify(userId, chance int64) { + provider.NewFissionClue(s.Ctx, userId).AddChance(chance) +} + +// 有邀请类的子活动 +func (s *base) hasChildInvite(user *model.FissionUser, invitedId int64, done func() error) (err error) { + child, err := cache.NewCampaignChild(s.Ctx).FindByUniqIdx(user.CampaignID, mtype.FissionCampaignChildTypeInvite) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if child == nil { + return + } + + cpn, err := cache.NewCampaign(s.Ctx).FindById(child.ChildID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.Status == mtype.FissionCampaignStatusCancel || cpn.IsDel == mtype.Yes || !timez.GMTInsideEndless(s.tOffset, cpn.TStart, cpn.TEnd) { + return + } + + player, err := cache.NewFissionChildUser(s.Ctx).FindByUniqIdx(user.ID, cpn.ID, cache.WithNilSet(func() ([]byte, error) { + info := withdefault.FissionChildUser(&model.FissionChildUser{ + PCpnID: cpn.Pid, + CampaignID: cpn.ID, + UserID: user.ID, + ParentID: user.ParentID, + ChildType: cpn.ChildType, + }) + + err = s.GetDao().FissionChildUser.WithContext(s.Ctx).Create(info) + if err != nil { + return nil, err + } + + return jsonm.Marshal(info) + })) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionChildUser + var up = []field.AssignExpr{ + m.InviteNum.Add(1), + } + + if player.JoinTime == 0 { + up = append(up, m.JoinTime.Value(time.Now().Unix())) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewFissionChildUser(s.Ctx).Clear(player) + + recordM := s.GetDao().FissionChildUserRecord + err = recordM.WithContext(s.Ctx).Create(withdefault.FissionChildUserRecord(&model.FissionChildUserRecord{ + PCpnID: player.PCpnID, + CampaignID: player.CampaignID, + UserID: player.UserID, + PlayerID: player.ID, + ChildType: player.ChildType, + Mark: mtype.FissionChildUserRecordSourceInviteOne, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + ranker, err := cachecurd.NewRanker(s.Ctx, ckey.FissionChildRank(cpn.ID), cachecurd.SetChildBuild(cpn.ID, cpn.ChildType)) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if player.InviteNum == 0 { + err = ranker.InitMember(fmt.Sprint(player.UserID), player.CreatedAt) + if err != nil { + err = s.BE().CacheError(err) + return + } + } else { + err = ranker.Incr(fmt.Sprint(player.UserID)) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + s.AddAfterRun(func() (err error) { + fissionaction.NewMarkPoint(s.Ctx).InApp(user).JoinChild(time.Now().Unix(), player.CampaignID, player.ChildType) + fissionaction.NewMarkPoint(s.Ctx).Child(player, user).ChildInvite(time.Now().Unix(), invitedId) + return + }) + + if done != nil { + return done() + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/blind.go b/internal/service/queue/consumer/campaignnotice/validevents/blind.go new file mode 100644 index 0000000..60c70f8 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/blind.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type blind struct { + base +} + +func (s *blind) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewBlind(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *blind) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *blind) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *blind) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewBlind(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/cash.go b/internal/service/queue/consumer/campaignnotice/validevents/cash.go new file mode 100644 index 0000000..2844422 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/cash.go @@ -0,0 +1,91 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type cash struct { + base + + addRecords []*model.FissionCashRecord +} + +func (s *cash) Open(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + if !s.Req.NewUser { + return + } + + cashP, err := players.NewCash(s.Ctx, beHelper) + if err != nil { + return + } + + err = cashP.InviteOne(helper.ID) + if err != nil { + return + } + + return +} + +func (s *cash) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper, tasks) + if err != nil { + return + } + + return +} + +func (s *cash) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil { + return + } + + err = s._fixTaskDo(beHelper, helper, tasks) + if err != nil { + return + } + + return +} + +func (s *cash) _fixTaskDo(user, helper *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + cashP, err := players.NewCash(s.Ctx, user) + if err != nil { + return + } + + if s.Req.NewUser { + err = cashP.InviteOne(helper.ID) + if err != nil { + return + } + } + + if len(tasks) == 0 { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return cashP.EffectInvite(helper.ID, task.Percent) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/chop.go b/internal/service/queue/consumer/campaignnotice/validevents/chop.go new file mode 100644 index 0000000..4e1ad50 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/chop.go @@ -0,0 +1,58 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/service/provider/players" +) + +type chop struct { + base +} + +func (s *chop) Click(userMark string, beHelper *model.FissionUser) (err error) { + chopP, err := players.NewChop(s.Ctx, beHelper) + if err != nil { + return + } + + _, err = chopP.ClickHelp( + s.Req.BehaviorTime, + userMark, + s.Req.ClickInfo.IpAddress, + s.Req.ClickInfo.Os, + s.Req.ClickInfo.OsVersion, + s.Req.ClickInfo.DeviceModel, + s.Req.ClickInfo.DeviceID, + s.Req.ClickInfo.WebId, + ) + + // 助力 + return +} + +func (s *chop) Open(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + chopP, err := players.NewChop(s.Ctx, beHelper) + if err != nil { + return + } + + return chopP.OpenHelp(s.Req.BehaviorTime, helper) +} + +func (s *chop) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + chopP, err := players.NewChop(s.Ctx, beHelper) + if err != nil { + return + } + + return chopP.RegisterHelp(s.Req.BehaviorTime, helper) +} + +func (s *chop) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + chopP, err := players.NewChop(s.Ctx, beHelper) + if err != nil { + return + } + + return chopP.InstallHelp(s.Req.BehaviorTime, helper) +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/coin.go b/internal/service/queue/consumer/campaignnotice/validevents/coin.go new file mode 100644 index 0000000..f6bbb06 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/coin.go @@ -0,0 +1,28 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/service/provider/players" +) + +type coin struct { + base +} + +func (s *coin) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewCoin(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/dice.go b/internal/service/queue/consumer/campaignnotice/validevents/dice.go new file mode 100644 index 0000000..e1b3b06 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/dice.go @@ -0,0 +1,87 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" + "fmt" +) + +type dice struct { + base +} + +func (s *dice) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper, tasks) + if err != nil { + return + } + + return +} + +func (s *dice) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper, tasks) + if err != nil { + return + } + + return +} + +func (s *dice) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewDice(s.Ctx, user) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +// 用户固定事件任务 +func (s *dice) _fixTaskDo(user, helper *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewDice(s.Ctx, user) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + case mtype.FissionCampaignTaskPropMarkFixedRoll: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }, mtype.FissionCampaignTaskPropMarkFixedRoll, fmt.Sprint(helper.ID)) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/event.go b/internal/service/queue/consumer/campaignnotice/validevents/event.go new file mode 100644 index 0000000..165cc61 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/event.go @@ -0,0 +1,1507 @@ +package validevents + +import ( + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/provider/pusher" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/lockdo" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + "fmt" + "math/rand" + "strings" + "time" + + "gorm.io/gen" +) + +type condFinishOne struct { + condId int64 // 条件id + num int64 // 用户 + userNum int64 // 完成人数 +} + +type condTotalOne struct { + condId int64 // 条件id + total float64 // 累计值 +} + +type event struct { + *base + + tasks []*model.FissionCampaignTask // 校验完之后,剩下的用户可以完成的任务 + + taskDoneMap map[int64]int64 + taskDayDoneMap map[int64]int64 + taskWeekDoneMap map[int64]int64 + + condDoneMap map[int64]int64 + condDayDoneMap map[int64]int64 + condWeekDoneMap map[int64]int64 + + lvLimitMap map[int64][]string + preCondMap map[int32]struct{} +} + +func (s *event) event(user *model.FissionUser, callbacks ...taskDoneCallback) (data eventData, err error) { + err = s.unlockReward(user, callbacks...) + if err != nil { + return + } + + conf, err := cache.NewCampaignTicket(s.Ctx).FindByMark(user.CampaignID, mtype.FissionCampaignTicketCustom) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf == nil || conf.Open == mtype.No { + return + } + + conds, userCondMap, err := s.getUserCondMap(user, false) + if err != nil { + return + } + + if len(conds) == 0 { + return + } + + switch conf.BothType { + case mtype.FissionCampaignTicketBothTypeOne: + err = s.acceptCheckOne(user, conds) + if err != nil { + return + } + case mtype.FissionCampaignTicketBothTypeAll: + err = s.acceptCheckAll(user) + if err != nil { + return + } + } + + // 如果接收事件验证校验过后没有任务了,那么就不用去计算了 + if len(s.tasks) == 0 { + return + } + + // 过期数据处理 + err = s.userCondExp(conds, userCondMap, conf.BothType) + if err != nil { + return + } + + switch conf.BothType { + case mtype.FissionCampaignTicketBothTypeOne: + return s.one(user, conds, userCondMap, callbacks...) + case mtype.FissionCampaignTicketBothTypeAll: + return s.all(user, conds, userCondMap, callbacks...) + } + + return +} + +// 所有任务完成逻辑 +func (s *event) all(user *model.FissionUser, allConds []*model.FissionCampaignCond, userCondMap map[int64]*model.FissionUserCond, callbacks ...taskDoneCallback) (data eventData, err error) { + var task *model.FissionCampaignTask + for _, v := range s.tasks { + if v.TaskMark == mtype.FissionCampaignTaskMarkCondAll { + task = v + break + } + } + + if task == nil { + return + } + + // 过滤被被限制了的事件 + conds, err := s.condLimit(user, allConds, task) + if err != nil { + return + } + + // 过滤到没有到没有可以完成的事件 + if len(conds) == 0 { + return + } + + // 接收到key对应的值 + var valMap = make(map[string][]string) + for _, v := range s.Req.EventData { + valMap[v.EventKey] = append(valMap[v.EventKey], v.EventVal) + } + + var condIdMap = make(map[int64]*model.FissionCampaignCond) + for _, v := range allConds { + condIdMap[v.ID] = v + } + + var condTotal = make(map[int64]string) // 累计条件下的已累计的值 + var condTotalFinishNumMap = make(map[int64]int64) // 累计条件下完成的次数 + for _, v := range userCondMap { + cond := condIdMap[v.CondID] + if cond.IfCond == mtype.FissionCampaignCondIfCondTotal { + condTotal[cond.ID] = v.Total + condTotalFinishNumMap[cond.ID] = 0 + } + } + + var userCondRecord []*model.FissionUserCondRecord + for _, cond := range conds { + + if cond.Event != s.Req.Event { + continue + } + + condCpnLimit, condDayLimit, condWeekLimit := s.condDoneMap[cond.ID], s.condDayDoneMap[cond.ID], s.condWeekDoneMap[cond.ID] + userCond := userCondMap[cond.ID] + total, num := userCond.Total, userCond.Num + var doneNum int64 + for _, val := range valMap[cond.EventKey] { + + // 任务被限制完成了 + if s._beLimit(task, condCpnLimit, condDayLimit, condWeekLimit, user) { + break + } + + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondEq: + if cond.EventVal != val { + continue + } + + condCpnLimit++ + condDayLimit++ + condWeekLimit++ + doneNum = 1 + case mtype.FissionCampaignCondIfCondGte: + if !utils.NumberStrCompareGte(val, cond.EventVal) { + continue + } + + condCpnLimit++ + condDayLimit++ + condWeekLimit++ + doneNum = 1 + case mtype.FissionCampaignCondIfCondTotal: + total = utils.StrAdd(total, val) + + // 计算一下完成的次数 + doneRes := utils.CondTotalFinishNum(total, cond.EventVal, func(doneNum int32) bool { + condCpnLimit++ + condDayLimit++ + condWeekLimit++ + return s._beTaskNumLimit(task, condCpnLimit, condDayLimit, condWeekLimit) + }) + + total = doneRes.Remain + doneNum = int64(doneRes.Num) + + // 统计完成次数追加 + condTotalFinishNumMap[cond.ID] += doneNum + + // 累计总值 + s._condTotal(cond.ID, val) + } + + // 如果事件被消费了 + if doneNum > 0 { + // 加一条记录 + userCondRecord = append(userCondRecord, withdefault.FissionUserCondRecord(&model.FissionUserCondRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: cond.ID, + Val: val, + IsUse: mtype.Yes, + BehaviorTime: s.Req.BehaviorTime, + })) + + // 完成次数条件 + for i := 0; i < int(doneNum); i++ { + s._condFinish(user, cond.ID, val, num == 0) + num++ + } + } + } + + userCondMap[cond.ID].Num += doneNum // 完成次数 + userCondMap[cond.ID].CountNum += doneNum // 可以计算的完成次数 + userCondMap[cond.ID].Total = total // 累计值 + + // 加限制值 + err = s._addCondLimit(user, task, cond, doneNum) + if err != nil { + return + } + } + + // 把有效的记录记录一下. + err = s._addUserCondRecord(user, userCondRecord, conds, task) + if err != nil { + return + } + + var fl int // 完成的次数 + + // 更新一下条件数据 + defer func() { + m := s.GetDao().FissionUserCond + for _, v := range userCondMap { + _, _ = m.WithContext(s.Ctx).Where(m.ID.Eq(v.ID)).UpdateSimple( + m.Num.Value(v.Num), + m.CountNum.Value(v.CountNum-int64(fl)), + m.Total.Value(v.Total), + ) + } + }() + + // 看看最小可计算数是谁,就是达标次数 + for _, userCond := range userCondMap { + if userCond.CountNum == 0 { + fl = 0 + break + } + + if fl == 0 || fl > int(userCond.CountNum) { + fl = int(userCond.CountNum) + } + } + + if fl == 0 { + return + } + + data.props = make(map[string]int32) + data.targetNum = int32(fl) // 达标数 + + var callbackTasks = make([]*model.FissionCampaignTask, 0, fl) // 要回调的任务 + var addTaskRecord = make([]*model.FissionUserTaskRecord, 0, fl) // 任务记录 + var rewardIds []int64 // 获得的奖品 + var addTaskRewards []*model.FissionUserTaskReward // 待领取记录 + for i := 0; i < fl; i++ { + + record := withdefault.FissionUserTaskRecord(&model.FissionUserTaskRecord{ + CreatedAt: s.Req.BehaviorTime, + CampaignID: user.CampaignID, + UserID: user.ID, + TaskID: task.ID, + IndicatorData: "[]", + Chance: task.Chance, + LimitProp: 0, + }) + + addTaskRecord = append(addTaskRecord, record) + callbackTasks = append(callbackTasks, task) + + if task.AwardMode == mtype.FissionCampaignTaskAwardModeAuto { + switch task.PropMark { + case mtype.FissionCampaignRewardPropMarkReward: + data.props[task.PropMark] += 1 + rewardIds = append(rewardIds, task.RewardID) + case mtype.FissionCampaignRewardPropMarkChance: + data.props[task.PropMark] += task.Chance + } + } else { + addTaskRewards = append(addTaskRewards, withdefault.FissionUserTaskReward(&model.FissionUserTaskReward{ + UserID: user.ID, + CampaignID: user.CampaignID, + TaskID: task.ID, + ReceiveTime: 0, + TaskRecordID: record.ID, + })) + } + + } + + for _, callback := range callbacks { + err = callback(user, callbackTasks) + if err != nil { + return + } + } + + if len(addTaskRecord) > 0 { + err = s._addUserTaskRecord(addTaskRecord...) + if err != nil { + return + } + + for _, v := range addTaskRecord { + if s.reportType == mtype.FissionCampaignReportTypeNew { + s.MP().InApp(user).FinishTask(v.CreatedAt, v.TaskID) + } + } + + err = s._addTaskFinish(user, task, int64(fl)) + if err != nil { + return + } + } + + if len(rewardIds) > 0 { + _, err = s._taskReward(user, rewardIds) + if err != nil { + return + } + } + + if len(addTaskRewards) > 0 { + err = s.GetDao().FissionUserTaskReward.WithContext(s.Ctx).Create(addTaskRewards...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 任一任务完成 +func (s *event) one(user *model.FissionUser, conds []*model.FissionCampaignCond, userCondMap map[int64]*model.FissionUserCond, callbacks ...taskDoneCallback) (data eventData, err error) { + // 接收到key对应的值 + var valMap = make(map[string][]string) + for _, v := range s.Req.EventData { + valMap[v.EventKey] = append(valMap[v.EventKey], v.EventVal) + } + + // 活动的条件数据 + var condIdMap = make(map[int64]*model.FissionCampaignCond) + for _, v := range conds { + condIdMap[v.ID] = v + } + + var condTotal = make(map[int64]string) // 累计条件下的已累计的值 + for _, v := range userCondMap { + cond := condIdMap[v.CondID] + if cond.IfCond == mtype.FissionCampaignCondIfCondTotal { + condTotal[cond.ID] = v.Total + } + } + + m := s.GetDao().FissionUserCond + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + var taskDoneMap = make(map[int64]int64) // 任务完成次数 + var userCondRecord []*model.FissionUserCondRecord + // 可以完成的任务 + for _, v := range s.tasks { + // 找到完成这个任务需要完成的条件 + cond, ok := condIdMap[utils.FissionCampaignTaskMarkCondOneCondId(v.TaskMark)] + if !ok || !cm.EventCanTotal(cond, user.SubUserID, s.Req.AdsCondId, user.JoinAt, s.Req.BehaviorTime) { // 不存在,或者事件是验证目标类型不通过都不处理 + continue + } + + cpnLimit, dayLimit, weekLimit := s.taskDoneMap[v.ID], s.taskDayDoneMap[v.ID], s.taskWeekDoneMap[v.ID] + userCond := userCondMap[cond.ID] + total, num := userCond.Total, userCond.Num + + // 遍历接收到的key,计算任务完成的次数 + for _, val := range valMap[cond.EventKey] { + + // 任务被限制完成了 + if s._beLimit(v, cpnLimit, dayLimit, weekLimit, user) { + break + } + + var doneNum int64 + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondEq: + if cond.EventVal != val { + continue + } + cpnLimit++ + dayLimit++ + weekLimit++ + doneNum = 1 + case mtype.FissionCampaignCondIfCondGte: + if !utils.NumberStrCompareGte(val, cond.EventVal) { + continue + } + cpnLimit++ + dayLimit++ + weekLimit++ + doneNum = 1 + case mtype.FissionCampaignCondIfCondTotal: + total = utils.StrAdd(total, val) + + // 计算一下完成的次数 + doneRes := utils.CondTotalFinishNum(total, cond.EventVal, func(doneNum int32) bool { + cpnLimit++ + dayLimit++ + weekLimit++ + return s._beTaskNumLimit(v, cpnLimit, dayLimit, weekLimit) + }) + + total = doneRes.Remain + doneNum = int64(doneRes.Num) + + // 累计总值 + s._condTotal(cond.ID, val) + } + + // 如果事件被消费了 + if doneNum > 0 { + // 加任务完成次数 + taskDoneMap[v.ID] += doneNum + + // 加一条记录 + userCondRecord = append(userCondRecord, withdefault.FissionUserCondRecord(&model.FissionUserCondRecord{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: cond.ID, + Val: val, + IsUse: mtype.Yes, + BehaviorTime: s.Req.BehaviorTime, + })) + + // 完成次数条件 + for i := 0; i < int(doneNum); i++ { + s._condFinish(user, cond.ID, val, num == 0) + num++ + switch num { + case 1: + err = s._invokePreCond(user, mtype.FissionCampaignTaskPreCondTask1) + if err != nil { + return + } + case 2: + err = s._invokePreCond(user, mtype.FissionCampaignTaskPreCondTask2) + if err != nil { + return + } + } + } + } + } + + // 更新一下完成次数 + switch cond.IfCond { + case mtype.FissionCampaignCondIfCondTotal: + // 更新一下累计值和完成次数 + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(userCond.ID)).UpdateSimple(m.Num.Add(taskDoneMap[v.ID]), m.Total.Value(total)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + default: + // 更新一下用户条件的完成次数 + if fNum := taskDoneMap[v.ID]; fNum > 0 { + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(userCond.ID)).UpdateSimple(m.Num.Add(fNum)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + } + + // 把有效的记录记录一下. + err = s._addUserCondRecord(user, userCondRecord, conds, nil) + if err != nil { + return + } + + data.props = make(map[string]int32) + + // 完成任务 + var rewardIds []int64 + var callbackTasks []*model.FissionCampaignTask + var add []*model.FissionUserTaskRecord + var addTaskRewards []*model.FissionUserTaskReward // 待领取记录 + for _, task := range s.tasks { + fNum := taskDoneMap[task.ID] + if fNum == 0 { + continue + } + + err = s._addTaskFinish(user, task, fNum) + if err != nil { + return + } + + // 达标数 + data.targetNum += int32(fNum) + + // 完成一次回调一次 + for i := 0; i < int(fNum); i++ { + record := withdefault.FissionUserTaskRecord(&model.FissionUserTaskRecord{ + CreatedAt: s.Req.BehaviorTime, + CampaignID: user.CampaignID, + UserID: user.ID, + TaskID: task.ID, + IndicatorData: "[]", + Chance: task.Chance, + LimitProp: 0, + }) + + add = append(add, record) + callbackTasks = append(callbackTasks, task) + + if task.AwardMode == mtype.FissionCampaignTaskAwardModeAuto { + switch task.PropMark { + case mtype.FissionCampaignRewardPropMarkReward: + data.props[task.PropMark] += 1 + rewardIds = append(rewardIds, task.RewardID) + case mtype.FissionCampaignRewardPropMarkChance: + data.props[task.PropMark] += task.Chance + players.AddTaskTip(s.Ctx, user.ID, mtype.FissionCampaignRewardPropMarkChance, task.Chance, 0) + case mtype.FissionCampaignRewardPropMarkPoint: + data.props[task.PropMark] += task.Chance + rewardIds = append(rewardIds, task.RewardID) + } + } else { + addTaskRewards = append(addTaskRewards, withdefault.FissionUserTaskReward(&model.FissionUserTaskReward{ + UserID: user.ID, + CampaignID: user.CampaignID, + TaskID: task.ID, + ReceiveTime: 0, + TaskRecordID: record.ID, + })) + } + + } + } + + if len(callbackTasks) > 0 { + for _, callback := range callbacks { + err = callback(user, callbackTasks) + if err != nil { + return + } + } + } + + if len(rewardIds) > 0 { + _, err = s._taskReward(user, rewardIds) + if err != nil { + return + } + } + + if len(add) > 0 { + err = s._addUserTaskRecord(add...) + if err != nil { + return + } + + for _, v := range add { + if s.reportType == mtype.FissionCampaignReportTypeNew { + s.MP().InApp(user).FinishTask(v.CreatedAt, v.TaskID) + } + } + } + + if len(addTaskRewards) > 0 { + err = s.GetDao().FissionUserTaskReward.WithContext(s.Ctx).Create(addTaskRewards...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 获取用户对应条件完成状态hash表数据 +func (s *event) getUserCondMap(user *model.FissionUser, unlockReward bool) (conds []*model.FissionCampaignCond, data map[int64]*model.FissionUserCond, err error) { + condM := s.GetDao().FissionCampaignCond + var wheres = []gen.Condition{ + condM.CampaignID.Eq(user.CampaignID), + condM.IsDel.Eq(mtype.No), + } + + if unlockReward { + wheres = append(wheres, condM.RewardID.Gt(0)) + } else { + wheres = append(wheres, condM.RewardID.Eq(0)) + } + + conds, err = condM.WithContext(s.Ctx).Where(wheres...).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var condIds = make([]int64, 0, len(conds)) + for _, cond := range conds { + condIds = append(condIds, cond.ID) + } + + m := s.GetDao().FissionUserCond + list, err := m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.CondID.In(condIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + data = make(map[int64]*model.FissionUserCond) + for _, v := range list { + data[v.CondID] = v + } + + var add []*model.FissionUserCond + for _, condId := range condIds { + if _, ok := data[condId]; !ok { + add = append(add, withdefault.FissionUserCond(&model.FissionUserCond{ + CampaignID: user.CampaignID, + UserID: user.ID, + CondID: condId, + Num: 0, + Total: "", + CountNum: 0, + })) + } + } + + if len(add) == 0 { + return + } + + err = m.WithContext(s.Ctx).Create(add...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range add { + data[v.CondID] = v + } + + return +} + +// 看看需不需要做一些过期处理 +func (s *event) userCondExp(conds []*model.FissionCampaignCond, data map[int64]*model.FissionUserCond, bothType int8) (err error) { + if bothType == mtype.FissionCampaignTicketBothTypeAll { + task := s.tasks[0] + var start, end int64 + if task.DayLimit > 0 { + _, start, end = timez.GMTStartAndEndTs(s.tOffset, s.Req.BehaviorTime) + } else if task.WeekLimit > 0 { + start, end = timez.GetWeekEnd(s.tOffset, int32(task.WeekNum)) + } + + if start == 0 { + return + } + + var expId []int64 + for _, cond := range conds { + if data[cond.ID].TotalExp < start { + data[cond.ID].TotalExp = end + data[cond.ID].Total = "" + data[cond.ID].CountNum = 0 + expId = append(expId, data[cond.ID].ID) + } + } + + if len(expId) == 0 { + return + } + + m := s.GetDao().FissionUserCond + _, err = m.WithContext(s.Ctx).Where(m.ID.In(expId...)).UpdateSimple( + m.TotalExp.Value(end), + m.Total.Value(""), + m.CountNum.Value(0), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + } + + // 完成任一任务 + var taskMap = make(map[string]int64) + for _, cond := range conds { + taskMap[utils.FissionCampaignTaskMarkCondOneVal(cond.ID)] = cond.ID + } + + for _, task := range s.tasks { + var start, end int64 + if task.DayLimit > 0 { + _, start, end = timez.GMTStartAndEndTs(s.tOffset, s.Req.BehaviorTime) + } else if task.WeekLimit > 0 { + start, end = timez.GetWeekEnd(s.tOffset, int32(task.WeekNum)) + } + + if start == 0 { + continue + } + + condId, ok := taskMap[task.TaskMark] + if ok && data[condId].TotalExp < start { + data[condId].TotalExp = end + data[condId].Total = "" + + m := s.GetDao().FissionUserCond + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(data[condId].ID)).UpdateSimple( + m.TotalExp.Value(end), + m.Total.Value(""), + m.CountNum.Value(0), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + return +} + +// 接收校验任一条件完成的事件 +func (s *event) acceptCheckAll(user *model.FissionUser) (err error) { + m := s.GetDao().FissionCampaignTask + tasks, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID), m.TaskMark.Eq(mtype.FissionCampaignTaskMarkCondAll), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return s.taskLimit(user, tasks) +} + +// 接收校验任一条件完成的事件 +func (s *event) acceptCheckOne(user *model.FissionUser, list []*model.FissionCampaignCond) (err error) { + var t = utils.Ternary[int32](s.Req.EventType == 0, mtype.FissionCampaignCondEventTypeCustom, s.Req.EventType) + + var keys = make(map[string]struct{}, len(s.Req.EventData)) + for _, v := range s.Req.EventData { + keys[fmt.Sprintf("%s_%s_%d", s.Req.Event, v.EventKey, t)] = struct{}{} + } + + var conds []*model.FissionCampaignCond + for _, v := range list { + if _, ok := keys[fmt.Sprintf("%s_%s_%d", v.Event, v.EventKey, t)]; ok { + conds = append(conds, v) + } + } + + var marks []string + for _, v := range conds { + marks = append(marks, utils.FissionCampaignTaskMarkCondOneVal(v.ID)) + } + + if len(marks) == 0 { + return + } + + m := s.GetDao().FissionCampaignTask + tasks, err := m.WithContext(s.Ctx).Where(m.CampaignID.Eq(user.CampaignID), m.TaskMark.In(marks...), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return s.taskLimit(user, tasks) +} + +// 任务已经被限制 +func (s *event) taskLimit(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + var userId = user.ID + var preCond []int32 + var levelLimit = make(map[int64][]int64) + for _, task := range tasks { + var fLimit bool + fLimit, err = s._fissionLimit(user, task) + if err != nil { + return + } + + if fLimit { + continue + } + + if task.TaskLimit > 0 { + var num int64 + num, err = s._cpnNum(userId, task.ID) + if err != nil { + return + } + + if num >= int64(task.TaskLimit) { + continue + } + } + + if task.DayLimit > 0 { + var num int64 + num, err = s._dayNum(userId, task.ID) + if err != nil { + return + } + + if num >= int64(task.DayLimit) { + continue + } + } + + if task.WeekLimit > 0 { + var num int64 + num, err = s._weekNum(userId, task.ID, int32(task.WeekNum)) + if err != nil { + return + } + + if num >= int64(task.WeekLimit) { + continue + } + } + + if task.LevelLimit != "" { + levelLimit[task.ID] = task.GetLevelLimit() + } + + if task.HasPre == mtype.Yes { + preCond = append(preCond, task.PreCond) + } + + s.tasks = append(s.tasks, task) + } + + err = s._levelLimit(levelLimit) + if err != nil { + return + } + + return s._preCond(userId, preCond) +} + +func (s *event) _fissionLimit(user *model.FissionUser, task *model.FissionCampaignTask) (ok bool, err error) { + switch s.cpn.FissionID { + case consts.IdKeep: + var kg *players.KeepDog + kg, err = players.NewKeepDog(s.Ctx, user) + if err != nil { + return + } + + return kg.TaskLimit(task) + } + + return +} + +// 用户等级限制 +func (s *event) _levelLimit(taskLvIdMap map[int64][]int64) (err error) { + + var titleMap = make(map[int64]string) + var ids []int64 + for _, lvIds := range taskLvIdMap { + for _, lvId := range lvIds { + if _, ok := titleMap[lvId]; !ok { + titleMap[lvId] = "" + ids = append(ids, lvId) + } + } + } + + s.lvLimitMap = make(map[int64][]string) + + if len(ids) == 0 { + return + } + + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.Ctx).Where(m.ID.In(ids...), m.DeletedAt.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + titleMap[v.ID] = v.Mark + } + + for id, lvIds := range taskLvIdMap { + for _, lvId := range lvIds { + s.lvLimitMap[id] = append(s.lvLimitMap[id], titleMap[lvId]) + } + } + + return +} + +// 前置任务 +func (s *event) _preCond(userId int64, preCond []int32) (err error) { + s.preCondMap = make(map[int32]struct{}, len(preCond)) + + if len(preCond) == 0 { + return + } + + m := s.GetDao().FissionUserPreCond + done, err := m.WithContext(s.Ctx).Select(m.PreCond).Where(m.UserID.Eq(userId), m.PreCond.In(preCond...), m.ExpiredAt.Gt(time.Now().Unix())).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range done { + s.preCondMap[v.PreCond] = struct{}{} + } + + return +} + +// 活动内限制 +func (s *event) _cpnNum(userId, taskId int64) (num int64, err error) { + num, err = s._taskFinishNum(userId, taskId) + if err != nil { + return + } + + if s.taskDoneMap == nil { + s.taskDoneMap = make(map[int64]int64) + } + + s.taskDoneMap[taskId] = num + + return +} + +// 当天任务完成数 +func (s *event) _dayNum(userId, taskId int64) (num int64, err error) { + day, start, end := timez.GMTStartAndEndTs(s.tOffset, s.Req.BehaviorTime) + + key := ckey.FissionUserTaskDayLimit(day, userId, taskId) + num, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserTaskRecord + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(userId), + m.TaskID.Eq(taskId), + m.CreatedAt.Gte(start), + m.CreatedAt.Lte(end), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.taskDayDoneMap == nil { + s.taskDayDoneMap = make(map[int64]int64) + } + + s.taskDayDoneMap[taskId] = num + + return +} + +// 周任务完成数 +func (s *event) _weekNum(userId, taskId int64, weekNum int32) (num int64, err error) { + start, end := timez.GetWeekEnd(s.tOffset, weekNum) + + key := ckey.FissionUserWeekLimit(start, userId, taskId) + num, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserTaskRecord + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(userId), + m.TaskID.Eq(taskId), + m.CreatedAt.Between(start, end), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.taskWeekDoneMap == nil { + s.taskWeekDoneMap = make(map[int64]int64) + } + + s.taskWeekDoneMap[taskId] = num + + return +} + +// 判断是否被限制了 +func (s *event) _beLimit(task *model.FissionCampaignTask, cpnLimit, dayLimit, weekLimit int64, user *model.FissionUser) bool { + + // 用户等级限制 + if task.LevelLimit != "" && s._beLevelLimit(task.ID, user.LevelMark) { + return true + } + + // 语言限制 + if lm := task.GetLangMarks(); len(lm) > 0 && !verify.InArray(user.LangMark, lm...) { + return true + } + + // 有前置任务 + if task.HasPre == mtype.Yes { + if _, ok := s.preCondMap[task.PreCond]; !ok { + return true + } + } + + return s._beTaskNumLimit(task, cpnLimit, dayLimit, weekLimit) +} + +// 任务可完成次数限制 +func (s *event) _beTaskNumLimit(task *model.FissionCampaignTask, cpnLimit, dayLimit, weekLimit int64) bool { + // 活动限制 + if task.TaskLimit > 0 && task.TaskLimit <= int32(cpnLimit) { + return true + } + + // 每日限制 + if task.DayLimit > 0 && task.DayLimit <= int32(dayLimit) { + return true + } + + // 周限制 + if task.WeekLimit > 0 && task.WeekLimit <= int32(weekLimit) { + return true + } + + return false +} + +// 事件已经被限制 +func (s *event) condLimit(user *model.FissionUser, conds []*model.FissionCampaignCond, task *model.FissionCampaignTask) (canDo []*model.FissionCampaignCond, err error) { + + cm := cmm.NewCMM(s.Ctx, s.GetDao()) + for _, cond := range conds { + if !cm.EventCanTotal(cond, user.SubUserID, s.Req.AdsCondId, user.JoinAt, s.Req.BehaviorTime) { + continue + } + + if cond.IfCond == mtype.FissionCampaignCondIfCondTotal { + canDo = append(canDo, cond) + continue + } + + if task.TaskLimit > 0 { + var num int64 + num, err = s._cpnCondDoneNum(user.ID, cond.ID) + if err != nil { + return + } + if num >= int64(task.TaskLimit) { + continue + } + } + + if task.DayLimit > 0 { + var num int64 + num, err = s._dayCondDoneNum(user.ID, cond.ID) + if err != nil { + return + } + if num >= int64(task.DayLimit) { + continue + } + } + + if task.WeekLimit > 0 { + var num int64 + num, err = s._weekCondDoneNum(user.ID, cond.ID, int32(task.WeekNum)) + if err != nil { + return + } + if num >= int64(task.WeekLimit) { + continue + } + } + + canDo = append(canDo, cond) + } + + return +} + +// 活动内限制 +func (s *event) _cpnCondDoneNum(userId, condId int64) (num int64, err error) { + key := ckey.FissionUserCondCpnLimit(userId, condId) + num, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserCondRecord + return m.WithContext(s.Ctx).Where(m.UserID.Eq(userId), m.CondID.Eq(condId)).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.condDoneMap == nil { + s.condDoneMap = make(map[int64]int64) + } + + s.condDoneMap[condId] = num + + return +} + +// 当天任务完成数 +func (s *event) _dayCondDoneNum(userId, condId int64) (num int64, err error) { + day, start, end := timez.GMTStartAndEndTs(s.tOffset, s.Req.BehaviorTime) + + key := ckey.FissionUserCondDayLimit(day, userId, condId) + num, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserCondRecord + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(userId), + m.CondID.Eq(condId), + m.BehaviorTime.Gte(start), + m.BehaviorTime.Lte(end), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.condDayDoneMap == nil { + s.condDayDoneMap = make(map[int64]int64) + } + + s.condDayDoneMap[condId] = num + + return +} + +// 周任务完成数 +func (s *event) _weekCondDoneNum(userId, condId int64, weekNum int32) (num int64, err error) { + start, end := timez.GetWeekEnd(s.tOffset, weekNum) + + key := ckey.FissionUserCondWeekLimit(start, userId, condId) + num, err = lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionUserCondRecord + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(userId), + m.CondID.Eq(condId), + m.BehaviorTime.Between(start, end), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + if s.condWeekDoneMap == nil { + s.condWeekDoneMap = make(map[int64]int64) + } + + s.condWeekDoneMap[condId] = num + + return +} + +// 同步限制数到缓存 +func (s *event) _addCondLimit(user *model.FissionUser, task *model.FissionCampaignTask, cond *model.FissionCampaignCond, chance int64) (err error) { + if task.TaskLimit > 0 { + key := ckey.FissionUserCondCpnLimit(user.ID, cond.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if !exist { + var num int64 + m := s.GetDao().FissionUserCondRecord + num, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID), m.CondID.Eq(cond.ID)).Count() + if err != nil { + return + } + app.Redis.Cache.IncrBy(s.Ctx, key, num) + } + app.Redis.Cache.IncrBy(s.Ctx, key, chance) + app.Redis.Cache.Expire(s.Ctx, key, time.Duration(rand.Intn(60)+60)*time.Minute) + return + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if task.DayLimit > 0 { + day, start, end := timez.GMTStartAndEndTs(s.tOffset) + key := ckey.FissionUserCondDayLimit(day, user.ID, cond.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if !exist { + var num int64 + m := s.GetDao().FissionUserCondRecord + num, err = m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.CondID.Eq(cond.ID), + m.CreatedAt.Gte(start), + m.CreatedAt.Lte(end), + ).Count() + if err != nil { + return + } + app.Redis.Cache.IncrBy(s.Ctx, key, num) + } + app.Redis.Cache.IncrBy(s.Ctx, key, chance) + app.Redis.Cache.Expire(s.Ctx, key, time.Duration(rand.Intn(60)+60)*time.Minute) + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if task.WeekLimit > 0 { + start, end := timez.GetWeekEnd(s.tOffset, int32(task.WeekNum)) + key := ckey.FissionUserCondWeekLimit(start, user.ID, cond.ID) + err = lockdo.ExistDo(s.Ctx, key, func(exist bool) (err error) { + if !exist { + var num int64 + m := s.GetDao().FissionUserCondRecord + num, err = m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.CondID.Eq(cond.ID), + m.CreatedAt.Between(start, end), + ).Count() + if err != nil { + return + } + app.Redis.Cache.IncrBy(s.Ctx, key, num) + } + app.Redis.Cache.IncrBy(s.Ctx, key, chance) + app.Redis.Cache.Expire(s.Ctx, key, time.Duration(rand.Intn(60)+60)*time.Minute) + return + }) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return +} + +// 是不是等级限制 +func (s *event) _beLevelLimit(taskId int64, levelMark string) bool { + marks, ok := s.lvLimitMap[taskId] + if !ok { //没有证明没开限制 + return false + } + + return !verify.OneInArray(marks, strings.Split(levelMark, ",")) +} + +// 用户事件的完成记录 +func (s *event) _addUserCondRecord(user *model.FissionUser, userCondRecord []*model.FissionUserCondRecord, conds []*model.FissionCampaignCond, task *model.FissionCampaignTask) (err error) { + if len(userCondRecord) == 0 { + return + } + err = s.GetDao().FissionUserCondRecord.WithContext(s.Ctx).Create(userCondRecord...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var condMap = make(map[int64]*model.FissionCampaignCond, len(conds)) + var openPush = make(map[int64]struct{}) + var ids []int64 + for _, cond := range conds { + ids = append(ids, cond.ID) + condMap[cond.ID] = cond + + if cond.TriggetType == mtype.FissionCampaignCondTriggerTypeGlobal && cond.OpenPush == mtype.Yes { + openPush[cond.ID] = struct{}{} + } + } + + var taskLotteryMap = make(map[int64]int32, len(s.tasks)) + var taskDayLimitMap = make(map[int64]int32, len(s.tasks)) + for _, v := range s.tasks { + taskLotteryMap[utils.FissionCampaignTaskMarkCondOneCondId(v.TaskMark)] = v.Chance + taskDayLimitMap[utils.FissionCampaignTaskMarkCondOneCondId(v.TaskMark)] = v.DayLimit + } + + langTitle, err := provider.NewLangTitle(s.Ctx, s.cpn, user.LangMark) + if err != nil { + return + } + + taskTitleMap, err := langTitle.GetCondTitle(ids...) + if err != nil { + return + } + + pageTitle, err := langTitle.GetPageTitle() + if err != nil { + return + } + + push, _ := pusher.NewPusher(s.Ctx, s.cpn) + fc, _ := provider.NewFissionConfig(s.Ctx, push.GetProject()) + + for _, v := range userCondRecord { + if fc.Config().PushCampaignTask == mtype.Yes { + cond, ok := condMap[v.CondID] + if !ok { + continue + } + + var lotteryNum int32 + var dayLimit int32 + if task != nil { + lotteryNum = task.Chance + dayLimit = task.DayLimit + } else { + lotteryNum = taskLotteryMap[v.CondID] + dayLimit = taskDayLimitMap[v.CondID] + } + + producer.NewOplatformOther(s.Ctx).OpoCampaignCondOk(types.OpoCampaignCondOk{ + ProjectId: s.cpn.ProjectID, + CampaignHashId: s.cpn.HashID, + CampaignTitle: s.cpn.Title, + UserId: user.SubUserID, + DeviceId: user.DeviceID, + TaskTitle: taskTitleMap[v.CondID], + PageTitle: pageTitle, + FissionIcon: fmt.Sprintf("%s/%s", config.Config.Upload.Host, consts.GetPushLogo(s.cpn.FissionID, int32(s.cpn.Target))), + CampaignUrl: push.GetChannelUrl(user.ChannelID), + MarkDesc: app.TalkMap.CompeteTask(utils.NotExistGetFirst[string](user.LangMark, s.cpn.GetLangMarks())), + Event: cond.Event, + EventKey: cond.EventKey, + LotteryNum: lotteryNum, + DayLimit: dayLimit, + }, producer.SetHeaderLang(user.LangMark)) + } + + if _, ok := openPush[v.CondID]; ok && push != nil { + _ = push.CompleteTask(user) + } + + } + + return +} + +// 自动发放奖品 +func (s *event) _taskReward(user *model.FissionUser, rewardIds []int64) (records []*award.RewardRes, err error) { + records, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).RewardIdsBatch(rewardIds, true) + if err != nil { + return + } + + for _, record := range records { + r := record.Record + players.AddTaskTip(s.Ctx, user.ID, r.PropMark, 0, r.ID) + } + + return +} + +// 触发前置任务 +func (s *event) _invokePreCond(user *model.FissionUser, preCond int32) (err error) { + taskM := s.GetDao().FissionCampaignTask + task, err := taskM.WithContext(s.Ctx).Where( + taskM.CampaignID.Eq(user.CampaignID), + taskM.PreCond.Eq(preCond), + taskM.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if task == nil { + return + } + + m := s.GetDao().FissionUserPreCond + err = m.WithContext(s.Ctx).Create(withdefault.FissionUserPreCond(&model.FissionUserPreCond{ + CampaignID: user.CampaignID, + UserID: user.ID, + PreCond: task.PreCond, + ExpiredAt: time.Now().Add(time.Duration(task.ExpiredMin) * time.Minute).Unix(), + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + provider.NewFissionClue(s.Ctx, user.ID).SetPreCond(preCond, task.ExpiredMin) + + return +} + +func (s *event) unlockReward(user *model.FissionUser, callbacks ...taskDoneCallback) (err error) { + unlockConds, userCondMap, err := s.getUserCondMap(user, true) + if err != nil { + return + } + if len(unlockConds) == 0 { + return + } + + var unlockCond = make(map[int64]*model.FissionCampaignCond, len(unlockConds)) + var rewardIds []int64 + for _, cond := range unlockConds { + rewardIds = append(rewardIds, cond.RewardID) + unlockCond[cond.RewardID] = cond + } + + m := s.GetDao().FissionUnlockReward + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.UserID.Eq(user.ID), + m.RewardID.In(rewardIds...), + ).Find() + if err != nil { + return + } + + for _, v := range list { + _, ok := unlockCond[v.RewardID] + if ok { + delete(unlockCond, v.RewardID) + } + } + + if len(unlockCond) == 0 { + return + } + + var conds []*model.FissionCampaignCond + for _, cond := range unlockConds { + conds = append(conds, cond) + } + + err = s.acceptCheckOne(user, conds) + if err != nil { + return + } + + // 如果接收事件验证校验过后没有任务了,那么就不用去计算了 + if len(s.tasks) == 0 { + return + } + + _, err = s.one(user, conds, userCondMap, callbacks...) + if err != nil { + return + } + + s.tasks = nil + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/flip.go b/internal/service/queue/consumer/campaignnotice/validevents/flip.go new file mode 100644 index 0000000..fc3c26b --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/flip.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type flip struct { + base +} + +func (s *flip) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewFlip(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *flip) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *flip) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *flip) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewFlip(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/gashapon.go b/internal/service/queue/consumer/campaignnotice/validevents/gashapon.go new file mode 100644 index 0000000..ed9e88a --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/gashapon.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type gashapon struct { + base +} + +func (s *gashapon) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewGashapon(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *gashapon) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *gashapon) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *gashapon) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewGashapon(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/gold.go b/internal/service/queue/consumer/campaignnotice/validevents/gold.go new file mode 100644 index 0000000..75f503f --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/gold.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type gold struct { + base +} + +func (s *gold) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewGold(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *gold) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *gold) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *gold) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewGold(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/grid.go b/internal/service/queue/consumer/campaignnotice/validevents/grid.go new file mode 100644 index 0000000..9d0dd7a --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/grid.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type grid struct { + base +} + +func (s *grid) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewGrid(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *grid) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *grid) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *grid) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewGrid(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/grow.go b/internal/service/queue/consumer/campaignnotice/validevents/grow.go new file mode 100644 index 0000000..470c001 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/grow.go @@ -0,0 +1,231 @@ +package validevents + +import ( + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + "joybuywork/internal/utils/timez" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "gorm.io/gen/field" +) + +type grow struct { + base +} + +func (s *grow) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + fc := cmm.NewFirstCreate(s.Ctx, s.GetDao()) + player, err := fc.FissionGrow(user) + if err != nil { + return + } + + data, err := s._event(user) + if err != nil { + return + } + + targetNum = data.targetNum + + playerM := s.GetDao().FissionGrow + var upData []field.AssignExpr + for mark, num := range data.props { + switch mark { + case mtype.FissionCampaignTaskPropMarkChance: + upData = append(upData, playerM.GrowNum.Add(num), playerM.TaskNum.Add(num)) + } + } + + if len(upData) > 0 { + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +func (s *grow) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper, tasks) + if err != nil { + return + } + + return +} + +func (s *grow) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *grow) _fixTaskDo(user, helper *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + fc := cmm.NewFirstCreate(s.Ctx, s.GetDao()) + player, err := fc.FissionGrow(user) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, s._addGrow(player.ID, task.Chance)) + if err != nil { + return + } + case mtype.FissionCampaignTaskPropMarkRevive: + //判断是否需要复活 + err = s._revive(user, helper, task) + if err != nil { + return + } + } + } + + return +} + +// 复活 +func (s *grow) _revive(user, helper *model.FissionUser, task *model.FissionCampaignTask) (err error) { + //判断是否死亡 + lifeM := s.GetDao().FissionGrowLife + life, err := lifeM.WithContext(s.Ctx).Where( + lifeM.IsGrow.Eq(mtype.Yes), + lifeM.UserID.Eq(user.ID), + lifeM.CampaignID.Eq(user.CampaignID), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if life == nil { + return + } + + // 对应时区的时间 + now, dieTime := timez.GMTTime(s.tOffset), timez.GMTTime(s.tOffset, life.DieTime) + if dieTime.After(now) { // 没有死 + return + } + + // 不是死亡状态要修改成死亡状态 + if life.IsDie == mtype.No { + err = cmm.NewCMM(s.Ctx, s.GetDao()).LifeStatus(life, true, 0) + if err != nil { + return + } + } + + //死亡,判断是否复活 + //死亡之后邀请的历史人数,当前 + m := s.GetDao().FissionUserTaskValid + + valid := withdefault.FissionUserTaskValid(&model.FissionUserTaskValid{ + CampaignID: user.CampaignID, + UserID: user.ID, + TaskID: task.ID, + }) + valid.SetIdeq(mtype.FissionCampaignTaskPropMarkRevive, fmt.Sprint(helper.ID)) + + has, err := m.WithContext(s.Ctx).Where(m.Ideq.Eq(valid.Ideq)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if has == 0 { + if err = m.WithContext(s.Ctx).Create(valid); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + num, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.UserID.Eq(user.ID), + m.TaskID.Eq(task.ID), + m.CreatedAt.Gt(life.DieTime), + ).Count() + if err != nil { + return + } + + if num < int64(task.Num) { // 不能完成复活 + return + } + + //邀请到足够的人复活 + indicatorData := &mtype.IndicatorData{ + InstallNum: num, + } + + confM := s.GetDao().FissionCampaignGrow + conf, err := confM.WithContext(s.Ctx).Where(confM.CampaignID.Eq(user.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf == nil { + return workerr.NotFound("conf not found") + } + + err = cmm.NewCMM(s.Ctx, s.GetDao()).LifeStatus(life, true, 0) + if err != nil { + return + } + + _, err = lifeM.WithContext(s.Ctx).Where(lifeM.ID.Eq(life.ID)).UpdateSimple( + lifeM.IsDie.Value(mtype.No), + lifeM.DieTime.Value(now.Add(time.Duration(conf.DieHour)*time.Hour).Unix()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = s._taskRecord(user, task, indicatorData, mtype.No) + if err != nil { + return + } + return +} + +// 增加养料 +func (s *grow) _addGrow(playerId int64, chance int32) taskEffectDo { + return func() (err error) { + playerM := s.GetDao().FissionGrow + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(playerId)).UpdateSimple( + playerM.GrowNum.Add(chance), + playerM.TaskNum.Add(chance), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/keep.go b/internal/service/queue/consumer/campaignnotice/validevents/keep.go new file mode 100644 index 0000000..e9f38fa --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/keep.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type keep struct { + base +} + +func (s *keep) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + kg, err := players.NewKeepDog(s.Ctx, user) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return kg.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *keep) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper.ID, tasks) + if err != nil { + return + } + + return +} + +func (s *keep) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, helper.ID, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *keep) _fixTaskDo(user *model.FissionUser, helperUserId int64, tasks []*model.FissionCampaignTask) (err error) { + kg, err := players.NewKeepDog(s.Ctx, user) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return kg.EffectInvite(helperUserId) + }) + if err != nil { + return + } + } + } + + return s.hasChildInvite(user, helperUserId, nil) +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/prize_wheel.go b/internal/service/queue/consumer/campaignnotice/validevents/prize_wheel.go new file mode 100644 index 0000000..58402aa --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/prize_wheel.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type prizeWheel struct { + base +} + +func (s *prizeWheel) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewWheel(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *prizeWheel) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *prizeWheel) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *prizeWheel) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewWheel(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/qa.go b/internal/service/queue/consumer/campaignnotice/validevents/qa.go new file mode 100644 index 0000000..fb7fcc1 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/qa.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type qa struct { + base +} + +func (s *qa) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewQa(s.Ctx, user, s.cpn.FissionID, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *qa) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *qa) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *qa) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewQa(s.Ctx, user, s.cpn.FissionID, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/quiz.go b/internal/service/queue/consumer/campaignnotice/validevents/quiz.go new file mode 100644 index 0000000..e4516d2 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/quiz.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type quiz struct { + base +} + +func (s *quiz) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewQuiz(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *quiz) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *quiz) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *quiz) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewQuiz(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/referral.go b/internal/service/queue/consumer/campaignnotice/validevents/referral.go new file mode 100644 index 0000000..8daa87b --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/referral.go @@ -0,0 +1,491 @@ +package validevents + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/lockdo" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +type referral struct { + base +} + +func (s *referral) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + fc := cmm.NewFirstCreate(s.Ctx, s.GetDao()) + player, err := fc.FissionReferral(user) + if err != nil { + return + } + + data, err := s._event(user) + if err != nil { + return + } + + targetNum = data.targetNum + + if data.targetNum == 0 || user.IsHelp == mtype.Yes { + return + } + + ticket, err := cache.NewCampaignTicket(s.Ctx).FindByMark(user.CampaignID, mtype.FissionCampaignTicketCustom) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var preOk = true + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventInstall: + preOk = player.BindInstall == mtype.Yes + case mtype.FissionCampaignTicketPreEventRegister: + preOk = player.BindRegister == mtype.Yes + } + + if !preOk { + return + } + + setHelp = true + + err = s._eventHelp(user) + if err != nil { + return + } + + return +} + +func (s *referral) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionReferral(helper) + if err != nil { + return + } + + if player.BindRegister == mtype.Yes { + return + } + + m := s.GetDao().FissionReferral + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.BindRegister.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *referral) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionReferral(helper) + if err != nil { + return + } + + if player.BindInstall == mtype.Yes { + return + } + + m := s.GetDao().FissionReferral + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.BindInstall.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +type referralStepDo func(player *model.FissionReferral, conf *model.FissionCampaignReferral, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) +type referralCycleDo func(player *model.FissionReferral, conf *model.FissionCampaignReferral, reward *model.FissionCampaignReward) (err error) + +type referralDo struct { + step referralStepDo + cycle referralCycleDo +} + +func (s *referral) _do(user *model.FissionUser, do referralDo) (err error) { + //防止同一个人并发发礼物超发 + lc := app.NewRedisLock(s.Ctx, ckey.FissionParentInviteOnce(user.ID), lock.SetExpire(10*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + return + } + fc := cmm.NewFirstCreate(s.Ctx, s.GetDao()) + player, err := fc.FissionReferral(user) + if err != nil { + return + } + + // 被限制了 + if player.LimitStatus != mtype.FissionReferralLimitStatusNone { + return + } + + conf, err := cache.NewCampaignReferral(s.Ctx).FindByCampaignId(player.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionCampaignReward + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(user, m.Step) + if err != nil { + err = s.BE().MysqlError(err) + return + } + if conf.RewardRule == mtype.FissionReferralRewardRuleStep { + var allInviteNum int32 + for _, campaignReward := range rewards { + if campaignReward.InviteNum > allInviteNum { + allInviteNum = campaignReward.InviteNum + } + } + rewardL := len(rewards) + var reward, nextReward *model.FissionCampaignReward + for i, campaignReward := range rewards { + if campaignReward.Step == player.NextStep { + reward = campaignReward + + if i < rewardL-1 { + nextReward = rewards[i+1] + } + + break + } + } + + if nextReward == nil && conf.StepLoop == mtype.Yes { + nextReward = rewards[0] + } + + return do.step(player, conf, reward, nextReward, allInviteNum) + } else if conf.RewardRule == mtype.FissionReferralRewardRuleCycle { + + return do.cycle(player, conf, rewards[0]) + } + + return +} + +func (s *referral) _eventHelp(helper *model.FissionUser) (err error) { + // 找被助力的人 + user, err := cache.NewFissionUser(s.Ctx, helper.CampaignID).FindById(helper.ParentID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + effectNum, err := s._statDirectNum(user.CampaignID, user.ID) + if err != nil { + return + } + + do := referralDo{ + step: func(player *model.FissionReferral, conf *model.FissionCampaignReferral, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) { + return s._step(user, effectNum, player, conf, reward, nextReward, allInviteNum) + }, + cycle: func(player *model.FissionReferral, conf *model.FissionCampaignReferral, reward *model.FissionCampaignReward) (err error) { + err = s._cycle(user, effectNum, player, conf, reward) + if err != nil { + return + } + + return s._extra(user, player, effectNum) + }, + } + + return s._do(user, do) +} + +// 用户固定事件任务 +func (s *referral) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + do := referralDo{ + step: func(player *model.FissionReferral, conf *model.FissionCampaignReferral, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) { + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return s._step(user, s.effectNum, player, conf, reward, nextReward, allInviteNum) + }) + if err != nil { + return + } + } + } + return + }, + cycle: func(player *model.FissionReferral, conf *model.FissionCampaignReferral, reward *model.FissionCampaignReward) (err error) { + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + err = s._cycle(user, s.effectNum, player, conf, reward) + if err != nil { + return + } + + return s._extra(user, player, s.effectNum) + }) + if err != nil { + return + } + } + } + return + }, + } + return s._do(user, do) +} + +// 增加抽奖次数 +func (s *referral) _step(user *model.FissionUser, effectNum int64, player *model.FissionReferral, conf *model.FissionCampaignReferral, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) { + + var limitStatus int8 + defer func() { + if err != nil { + return + } + + err = s._limitStatus(player.ID, limitStatus) + }() + + if conf.StepLoop == mtype.Yes && effectNum > int64(conf.InviteLimit) { + limitStatus = mtype.FissionReferralLimitStatusInvite + return + } + + //没有下一级任务 + if reward == nil { + limitStatus = mtype.FissionReferralLimitStatusFinish + return + } + + var inviteNum = effectNum - int64(player.LoopInvite*allInviteNum) + + //没有完成 + if int64(reward.InviteNum) > inviteNum { + return + } + + var decr = int64(reward.RewardNum) + + //扣除总预算是否成功 + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, player.CampaignID) + if err != nil { + return + } + + ok, _ := stock.DecrPoolAndAdd(player.CampaignID, decr) + if !ok { + limitStatus = mtype.FissionReferralLimitStatusBudget + return + } + + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(reward, true) + if err != nil { + return + } + + if nextReward == nil { + limitStatus = mtype.FissionReferralLimitStatusFinish + return + } + + // 初始化奖品的东西 + playerM := s.GetDao().FissionReferral + var up []field.AssignExpr + up = append(up, playerM.NextStep.Value(nextReward.Step)) + if nextReward.Step <= reward.Step { + up = append(up, playerM.LoopInvite.Add(1)) + } + + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + +} + +// 增加抽奖次数 +func (s *referral) _cycle(user *model.FissionUser, effectNum int64, player *model.FissionReferral, conf *model.FissionCampaignReferral, reward *model.FissionCampaignReward) (err error) { + + var limitStatus int8 + defer func() { + if err != nil { + return + } + + err = s._limitStatus(player.ID, limitStatus) + }() + + if effectNum > int64(conf.InviteLimit) { + limitStatus = mtype.FissionReferralLimitStatusInvite + return + } + + key := ckey.FissionUserGetRewardNum(user.ID) + num, err := lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionRewardRecord.SubTable(user.CampaignID) + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + var needInvite = int64(reward.InviteNum) //完成任务需要邀请的人数 + var decr = int64(reward.RewardNum) //奖品数据 + cn := effectNum - (num * needInvite) //总邀请人数 -(完成任务数 * 完成任务需要邀请的人数)= 计算完成任务的邀请人数 + + //邀请的人不足以获取到奖品 + if cn < needInvite { + return + } + + //扣除总预算是否成功 + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, player.CampaignID) + if err != nil { + return + } + + ok, _ := stock.DecrPoolAndAdd(player.CampaignID, decr) + if !ok { + limitStatus = mtype.FissionReferralLimitStatusBudget + return + } + + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(reward, true) + if err != nil { + return + } + + // 领奖数+1 + app.Redis.Cache.Incr(s.Ctx, key) + + return + +} + +func (s *referral) _limitStatus(playerId int64, ls int8) (err error) { + if ls == mtype.FissionReferralLimitStatusNone { + return + } + m := s.GetDao().FissionReferral + var up = []field.AssignExpr{ + m.LimitStatus.Value(ls), + } + + if ls == mtype.FissionReferralLimitStatusFinish { + up = append(up, m.NextStep.Value(0)) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(playerId)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 额外 +func (s *referral) _extra(user *model.FissionUser, player *model.FissionReferral, effectNum int64) (err error) { + m := s.GetDao().FissionCampaignReward + var extras []*model.FissionCampaignReward + var extraReward, nextExtraReward *model.FissionCampaignReward + extras, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeExtra), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + rewardL := len(extras) + for i, extra := range extras { + if extra.Step == player.NextStep { + extraReward = extra + + if i < rewardL-1 { + nextExtraReward = extras[i+1] + } + + break + } + } + + if extraReward == nil { + return + } + + //没有达标任务 + if int64(extraReward.InviteNum) > effectNum { + return + } + + // 额外奖品 + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(extraReward, true) + if err != nil { + return + } + + var nextStep int32 + if nextExtraReward != nil { + nextStep = nextExtraReward.Step + } + + // 下次的额外奖 + playerM := s.GetDao().FissionReferral + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.NextStep.Value(nextStep)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/sign.go b/internal/service/queue/consumer/campaignnotice/validevents/sign.go new file mode 100644 index 0000000..f8c505f --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/sign.go @@ -0,0 +1,55 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type sign struct { + base +} + +func (s *sign) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil { + return + } + + // 只要是拉来新安装都算助力成功了 + if len(tasks) == 0 { + return true, nil + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *sign) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + signP, err := players.NewSign(s.Ctx, user) + if err != nil { + return + } + + if len(tasks) == 0 { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return signP.GetSignCard(task.Num) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/slot.go b/internal/service/queue/consumer/campaignnotice/validevents/slot.go new file mode 100644 index 0000000..6217eaa --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/slot.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type slot struct { + base +} + +func (s *slot) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewSlot(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *slot) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *slot) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *slot) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewSlot(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/uno.go b/internal/service/queue/consumer/campaignnotice/validevents/uno.go new file mode 100644 index 0000000..a809ea7 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/uno.go @@ -0,0 +1,80 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type uno struct { + base +} + +func (s *uno) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewUno(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *uno) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *uno) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *uno) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewUno(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance, mtype.FissionCampaignTaskPropMarkUnoFive, + mtype.FissionCampaignTaskPropMarkUnoThree, mtype.FissionCampaignTaskPropMarkUnoFix: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/valid_events.go b/internal/service/queue/consumer/campaignnotice/validevents/valid_events.go new file mode 100644 index 0000000..124a820 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/valid_events.go @@ -0,0 +1,456 @@ +package validevents + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen/field" +) + +type iValidEvents interface { + Click(userMark string, beHelper *model.FissionUser) (err error) + Open(helper, beHelper *model.FissionUser) (setHelp bool, err error) + Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) + Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) + Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) +} + +type ValidEvents struct { + logic.Logic + Req *types.ValidEvents + factory iValidEvents // 验证事件工厂 + + cpn *model.FissionCampaign +} + +func (s *ValidEvents) Exec() (err error) { + err = s.campaign() + if err != nil { + return + } + + // 点击邀请链接事件处理 + if s.Req.NoticeType == types.NoticeTypeClick { + return s.clickNotice() + } + + // 找活动的助力用户和被助力的用户 + helper, beHelper, err := s.user() + if err != nil { + return + } + + // 设置工厂 + s._setFactory(helper.LangMark) + + // 自定义事件处理 + if verify.InArray[int64](s.Req.NoticeType, types.NoticeTypeCustom, types.NoticeTypePay) { + return s.validEvent(helper, beHelper) + } + + // 这个用户没有上级 或者已经助力了 + if beHelper == nil || (helper.IsHelp == mtype.Yes && !s._manyFixedHelpFission()) { + return + } + + // 有上级,当前用户给上级触发助力事件 + switch s.Req.NoticeType { + case types.NoticeTypeOpen: + if s._openMustNewUser() { + return s.validOpen(helper, beHelper) + } + case types.NoticeTypeInstall: + if s._installMustNewUser() { + return s.validInstall(helper, beHelper) + } + case types.NoticeTypeRegister: + return s.validRegister(helper, beHelper) + default: + return + } + + return +} + +func (s *ValidEvents) campaign() (err error) { + cpn, err := cache.NewCampaign(s.Ctx).FindById(s.Req.CampaignId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s.cpn = cpn + return +} + +func (s *ValidEvents) user() (helper, beHelper *model.FissionUser, err error) { + c := cache.NewFissionUser(s.Ctx, s.cpn.ID) + + // 触发事件的用户 + helper, err = c.FindById(s.Req.UserId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if helper == nil { + err = workerr.NotFound("not found helper") + return + } + + // 被助力的用户 + if helper.ParentID > 0 { + beHelper, err = c.FindById(helper.ParentID) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + return +} + +// 点击通知 +func (s *ValidEvents) clickNotice() (err error) { + beHelper, err := cache.NewFissionUser(s.Ctx, s.cpn.ID).FindById(s.Req.ParentId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + s._setFactory(beHelper.LangMark) + + return s.validClick(s.Req.ClickInfo.UserMark, beHelper) +} + +// 打开 +func (s *ValidEvents) validOpen(helper, beHelper *model.FissionUser) (err error) { + setHelp, err := s.factory.Open(helper, beHelper) + if err != nil { + return + } + + // 看看 + helpOk, err := s._setHelper(helper, setHelp) + if err != nil { + return + } + + err = s._effectStat(beHelper, helpOk) + if err != nil { + return + } + + return +} + +// 安装 +func (s *ValidEvents) validInstall(helper, beHelper *model.FissionUser) (err error) { + setHelp, err := s.factory.Install(helper, beHelper) + if err != nil { + return + } + + helpOk, err := s._setHelper(helper, setHelp) + if err != nil { + return + } + + err = s._effectStat(beHelper, helpOk) + if err != nil { + return + } + + s._callOpoCampaignHelpOk(helper, beHelper, setHelp, types.HelpSourceInstall) + + return +} + +// 注册 +func (s *ValidEvents) validRegister(helper, beHelper *model.FissionUser) (err error) { + setHelp, err := s.factory.Register(helper, beHelper) + if err != nil { + return + } + + helpOk, err := s._setHelper(helper, setHelp) + if err != nil { + return + } + + err = s._effectStat(beHelper, helpOk) + if err != nil { + return + } + + s._callOpoCampaignHelpOk(helper, beHelper, setHelp, types.HelpSourceRegister) + + return +} + +// 自己完成自定义事件 +func (s *ValidEvents) validEvent(helper, beHelper *model.FissionUser) (err error) { + targetNum, setHelp, err := s.factory.Event(helper) + if err != nil { + return + } + + err = s._targetStat(helper, int64(targetNum)) + if err != nil { + return + } + + if beHelper == nil { + return + } + + helpOk, err := s._setHelper(helper, setHelp) + if err != nil { + return + } + + err = s._effectStat(beHelper, helpOk) + if err != nil { + return + } + + s._callOpoCampaignHelpOk(helper, beHelper, setHelp, types.HelpSourceCustom) + + return +} + +// 链接点击 +func (s *ValidEvents) validClick(userMark string, beHelper *model.FissionUser) (err error) { + return s.factory.Click(userMark, beHelper) +} + +func (s *ValidEvents) _setFactory(langMark string) { + var b = base{ + Logic: &s.Logic, + Req: s.Req, + cpn: s.cpn, + tOffset: provider.NewCampaignTZ(s.Ctx, s.cpn, langMark).GetTz(), + reportType: s.cpn.ReportType, + spLang: s.cpn.GetLangMarks(), + condFinishData: nil, + condTotalData: nil, + } + switch s.cpn.FissionID { + case consts.IdCash: + s.factory = &cash{base: b} + case consts.IdDice: + s.factory = &dice{base: b} + case consts.IdLuckyGrid: + s.factory = &grid{base: b} + case consts.IdGrow: + s.factory = &grow{base: b} + case consts.IdPrizeWheel: + s.factory = &prizeWheel{base: b} + case consts.IdBlindBox: + s.factory = &blind{base: b} + case consts.IdSlotMachine: + s.factory = &slot{base: b} + case consts.IdFlip: + s.factory = &flip{base: b} + case consts.IdQa, consts.IdQaAudio, consts.IdQaVideo, consts.IdPrizeAnswer: + s.factory = &qa{base: b} + case consts.IdChop: + s.factory = &chop{base: b} + case consts.IdWinTogether: + s.factory = &win{base: b} + case consts.IdReferral: + s.factory = &referral{base: b} + case consts.IdKeep: + s.factory = &keep{base: b} + case consts.IdGold: + s.factory = &gold{base: b} + case consts.IdCoin: + s.factory = &coin{base: b} + case consts.IdSignIn: + s.factory = &sign{base: b} + case consts.IdPrizeQuiz: + s.factory = &quiz{base: b} + case consts.IdBallot: + s.factory = &ballot{base: b} + case consts.IdVs: + s.factory = &vs{base: b} + case consts.IdUno: + s.factory = &uno{base: b} + case consts.IdGashapon: + s.factory = &gashapon{base: b} + default: + return + } +} + +// 固定事件归档统计 +func (s *ValidEvents) _effectStat(user *model.FissionUser, helpOk bool) (err error) { + m := s.GetDao().FissionUserStat + + // 直接要更新的数据, 间接要更新的数据 + var upData, indirectData []field.AssignExpr + + // 如果是一个新创建的用户记录 + if s.Req.NewUser { + upData = append(upData, m.DirectNum.Add(1)) + if user.ParentID > 0 { + indirectData = append(indirectData, m.IndirectNum.Add(1)) + } + } + + // 当前用户变成助力成功 + if helpOk { + upData = append(upData, m.EffectiveNum.Add(1)) + if user.ParentID > 0 { + indirectData = append(indirectData, m.IndirectEffectiveNum.Add(1)) + } + } + + // 直接数据更新 + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 间接数据更新 + if len(indirectData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ParentID)).UpdateSimple(indirectData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 目标事件统计 +func (s *ValidEvents) _targetStat(user *model.FissionUser, num int64) (err error) { + m := s.GetDao().FissionUserStat + + // 直接要更新的数据, 间接要更新的数据 + var upData, indirectData []field.AssignExpr + + // 当前用户达标 + if num > 0 { + upData = append(upData, m.TargetNum.Add(num)) + if user.ParentID > 0 { + indirectData = append(indirectData, m.IndirectTargetNum.Add(num)) + } + } + + // 直接数据更新 + if len(upData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ID)).UpdateSimple(upData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + // 间接数据更新 + if len(indirectData) > 0 { + _, err = m.WithContext(s.Ctx).Where(m.UserID.Eq(user.ParentID)).UpdateSimple(indirectData...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return +} + +// 把活动用户设置为一个有效助力 +func (s *ValidEvents) _setHelper(helper *model.FissionUser, setHelp bool) (setOk bool, err error) { + // 助力过的,或者助力不成功的 + if helper == nil || helper.IsHelp == mtype.Yes || !setHelp { + return + } + + // 把当前这个助力用户标记成助力成功 + userMs := s.GetDao().FissionUser.SubTable(helper.CampaignID) + _, err = userMs.WithContext(s.Ctx).Where(userMs.ID.Eq(helper.ID)).UpdateSimple(userMs.IsHelp.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + userM := s.GetDao().FissionUser + _, err = userM.WithContext(s.Ctx).Where(userM.ID.Eq(helper.ID)).UpdateSimple(userM.IsHelp.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + s.AddAfterRun(func() (err error) { + _ = cache.NewFissionUser(s.Ctx, s.cpn.ID).Clear(helper) + return + }) + + return true, nil +} + +// 回调开放平台 +func (s *ValidEvents) _callOpoCampaignHelpOk(helper, beHelper *model.FissionUser, helpOk bool, source int32) { + if !helpOk || s._manyFixedHelpFission() { + return + } + + var kv = make([]*types.KV, 0, len(s.Req.EventData)) + for _, v := range s.Req.EventData { + kv = append(kv, &types.KV{ + Event: s.Req.Event, + Key: v.EventKey, + Value: v.EventVal, + }) + } + + langTitle, err := provider.NewLangTitle(s.Ctx, s.cpn, beHelper.LangMark) + if err != nil { + return + } + + pageTitle, err := langTitle.GetPageTitle() + if err != nil { + return + } + + producer.NewOplatformOther(s.Ctx).OpoCampaignHelpOk(types.OpoCampaignHelpOk{ + ProjectId: s.cpn.ProjectID, + CampaignHashId: s.cpn.HashID, + CampaignTitle: s.cpn.Title, + PageTitle: pageTitle, + HelperUserId: helper.SubUserID, + HelperDeviceId: helper.DeviceID, + BeHelperUserId: beHelper.SubUserID, + BeHelperDeviceId: beHelper.DeviceID, + Source: source, + KvData: kv, + }, producer.SetHeaderLang(beHelper.LangMark)) +} + +// 安装事件必须是新创建用户才能执行触发事件 +func (s *ValidEvents) _installMustNewUser() bool { + return s._manyFixedHelpFission() || s.Req.NewUser +} + +// 打开事件必须是新创建用户才能执行触发事件 +func (s *ValidEvents) _openMustNewUser() bool { + return s._manyFixedHelpFission() || s.Req.NewUser +} + +// 可以多次接收固定事件的玩法 +func (s *ValidEvents) _manyFixedHelpFission() bool { + return verify.InArray[int64](s.cpn.FissionID, consts.IdChop) +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/vs.go b/internal/service/queue/consumer/campaignnotice/validevents/vs.go new file mode 100644 index 0000000..9e597e9 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/vs.go @@ -0,0 +1,79 @@ +package validevents + +import ( + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/players" +) + +type vs struct { + base +} + +func (s *vs) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + player, err := players.NewVs(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + targetData, err := s._event(user, func(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + return player.FinishTask(tasks...) + }) + if err != nil { + return + } + + targetNum = targetData.targetNum + + return +} + +func (s *vs) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *vs) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 用户固定事件任务 +func (s *vs) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + player, err := players.NewVs(s.Ctx, user, players.SetCpn(s.cpn), players.SetDao(s.GetDao())) + if err != nil { + return + } + + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return player.FinishTask(task) + }) + if err != nil { + return + } + } + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/validevents/win.go b/internal/service/queue/consumer/campaignnotice/validevents/win.go new file mode 100644 index 0000000..e0e33a3 --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/validevents/win.go @@ -0,0 +1,604 @@ +package validevents + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/stocks" + "joybuywork/internal/utils/lockdo" + "time" + + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen/field" +) + +type win struct { + base +} + +func (s *win) Event(user *model.FissionUser) (targetNum int32, setHelp bool, err error) { + fc := cmm.NewFirstCreate(s.Ctx, s.GetDao()) + player, err := fc.FissionWin(user) + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + err = s._newcomerReward(user, player.ID, setHelp) + }() + + data, err := s._event(user) + if err != nil { + return + } + + targetNum = data.targetNum + + if data.targetNum == 0 || user.IsHelp == mtype.Yes { + return + } + + ticket, err := cache.NewCampaignTicket(s.Ctx).FindByMark(user.CampaignID, mtype.FissionCampaignTicketCustom) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var preOk = true + switch ticket.PreEvent { + case mtype.FissionCampaignTicketPreEventInstall: + preOk = player.BindInstall == mtype.Yes + case mtype.FissionCampaignTicketPreEventRegister: + preOk = player.BindRegister == mtype.Yes + } + + if !preOk { + return + } + + setHelp = true + + err = s._eventHelp(user) + if err != nil { + return + } + + return +} + +func (s *win) Register(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionWin(helper) + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + err = s._newcomerReward(helper, player.ID, setHelp) + }() + + if player.BindRegister == mtype.Yes { + return + } + + m := s.GetDao().FissionWin + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.BindRegister.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + tasks, setHelp, err := s._getRegisterTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +func (s *win) Install(helper, beHelper *model.FissionUser) (setHelp bool, err error) { + player, err := cmm.NewFirstCreate(s.Ctx, s.GetDao()).FissionWin(helper) + if err != nil { + return + } + + defer func() { + if err != nil { + return + } + + err = s._newcomerReward(helper, player.ID, setHelp) + }() + + if player.BindInstall == mtype.Yes { + return + } + + m := s.GetDao().FissionWin + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(player.ID)).UpdateSimple(m.BindInstall.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + tasks, setHelp, err := s._getInstallTasks(helper.CampaignID) + if err != nil || len(tasks) == 0 { + return + } + + err = s._fixTaskDo(beHelper, tasks) + if err != nil { + return + } + + return +} + +// 一起赢发放新人奖 +func (s *win) _newcomerReward(user *model.FissionUser, playerId int64, setHelp bool) (err error) { + conf, err := cache.NewCampaignWin(s.Ctx).FindByCampaignId(user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch conf.NewcomerCond { + case mtype.FissionNewcomerCondInstall: + + if user.Source != mtype.FissionUserSourceInstall || !s.Req.NewUser { + return + } + + case mtype.FissionNewcomerCondHelp: + + if user.IsHelp == mtype.Yes || !setHelp { + return + } + + case mtype.FissionNewcomerCondInstallAndHelp: + + if user.Source != mtype.FissionUserSourceInstall || user.IsHelp == mtype.Yes || !setHelp { + return + } + } + + if !app.NewRedisLock(s.Ctx, ckey.FissionWinNewcomerOnce(user.ID)).SoftLock() { + return + } + + rewardM := s.GetDao().FissionCampaignReward + rl, err := rewardM.WithContext(s.Ctx).Where( + rewardM.CampaignID.Eq(user.CampaignID), + rewardM.RewardType.Eq(mtype.FissionCampaignRewardTypeNewcomer), + rewardM.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var randMap = make(map[int64]*model.FissionCampaignReward) + for _, v := range rl { + randMap[v.ID] = v + } + + var reward *model.FissionCampaignReward + for _, v := range randMap { + reward = v + break + } + + record, _, async, err := award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(reward, false) + if err != nil || record == nil { + return + } + + provider.NewFissionClue(s.Ctx, user.ID).AddNewcomerReward(record.ID) + + s.MP().InApp(user).Newcomer(record.CreatedAt, record.RewardID, record.ID) + + playerM := s.GetDao().FissionWin + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(playerId)).UpdateSimple(playerM.IsNewcomer.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + // 如果为没有用户id,就不用通知客户 + if user.SubUserID == "" { + return + } + + s.AddAfterRun(func() (err error) { + // 执行异步任务 + for _, do := range async { + do() + } + return + }) + + return +} + +type winStepDo func(player *model.FissionWin, conf *model.FissionCampaignWin, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) +type winCycleDo func(player *model.FissionWin, conf *model.FissionCampaignWin, reward *model.FissionCampaignReward) (err error) + +type winDo struct { + step winStepDo + cycle winCycleDo +} + +func (s *win) _do(user *model.FissionUser, do winDo) (err error) { + //防止同一个人并发发礼物超发 + lc := app.NewRedisLock(s.Ctx, ckey.FissionParentInviteOnce(user.ID), lock.SetExpire(10*time.Second)).Lock() + defer lc.Release() + if lc.Error() != nil { + return + } + + fc := cmm.NewFirstCreate(s.Ctx, s.GetDao()) + player, err := fc.FissionWin(user) + if err != nil { + return + } + + // 被限制了 + if player.LimitStatus != mtype.FissionReferralLimitStatusNone { + return + } + + conf, err := cache.NewCampaignWin(s.Ctx).FindByCampaignId(player.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionCampaignReward + rewards, err := cmm.NewCMM(s.Ctx, s.GetDao()).UserAppReward(user, m.Step) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf.RewardRule == mtype.FissionReferralRewardRuleStep { + var allInviteNum int32 + for _, campaignReward := range rewards { + if campaignReward.InviteNum > allInviteNum { + allInviteNum = campaignReward.InviteNum + } + } + rewardL := len(rewards) + var reward, nextReward *model.FissionCampaignReward + for i, campaignReward := range rewards { + if campaignReward.Step == player.NextStep { + reward = campaignReward + + if i < rewardL-1 { + nextReward = rewards[i+1] + } + + break + } + } + + if nextReward == nil && conf.StepLoop == mtype.Yes { + nextReward = rewards[0] + } + + return do.step(player, conf, reward, nextReward, allInviteNum) + } else if conf.RewardRule == mtype.FissionReferralRewardRuleCycle { + + return do.cycle(player, conf, rewards[0]) + } + + return +} + +func (s *win) _eventHelp(helper *model.FissionUser) (err error) { + // 找被助力的人 + user, err := cache.NewFissionUser(s.Ctx, helper.CampaignID).FindById(helper.ParentID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + effectNum, err := s._statDirectNum(user.CampaignID, user.ID) + if err != nil { + return + } + + do := winDo{ + step: func(player *model.FissionWin, conf *model.FissionCampaignWin, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) { + return s._step(user, effectNum, player, conf, reward, nextReward, allInviteNum) + }, + cycle: func(player *model.FissionWin, conf *model.FissionCampaignWin, reward *model.FissionCampaignReward) (err error) { + err = s._cycle(user, effectNum, player, conf, reward) + if err != nil { + return + } + + return s._extra(user, player, effectNum) + }, + } + + return s._do(user, do) +} + +// 用户固定事件任务 +func (s *win) _fixTaskDo(user *model.FissionUser, tasks []*model.FissionCampaignTask) (err error) { + do := winDo{ + step: func(player *model.FissionWin, conf *model.FissionCampaignWin, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) { + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + return s._step(user, s.effectNum, player, conf, reward, nextReward, allInviteNum) + }) + if err != nil { + return + } + } + } + return + }, + cycle: func(player *model.FissionWin, conf *model.FissionCampaignWin, reward *model.FissionCampaignReward) (err error) { + for _, task := range tasks { + switch task.PropMark { + case mtype.FissionCampaignTaskPropMarkChance: + err = s._taskEffectDo(user, task, func() (err error) { + err = s._cycle(user, s.effectNum, player, conf, reward) + if err != nil { + return + } + + return s._extra(user, player, s.effectNum) + }) + if err != nil { + return + } + } + } + return + }, + } + + return s._do(user, do) +} + +// 增加抽奖次数 +func (s *win) _step(user *model.FissionUser, effectNum int64, player *model.FissionWin, conf *model.FissionCampaignWin, reward, nextReward *model.FissionCampaignReward, allInviteNum int32) (err error) { + + var limitStatus int8 + defer func() { + if err != nil { + return + } + + err = s._limitStatus(player.ID, limitStatus) + }() + + if conf.StepLoop == mtype.Yes && effectNum > int64(conf.InviteLimit) { + limitStatus = mtype.FissionReferralLimitStatusInvite + return + } + + //没有下一级任务 + if reward == nil { + limitStatus = mtype.FissionReferralLimitStatusFinish + return + } + + var inviteNum = effectNum - int64(player.LoopInvite*allInviteNum) + + //没有完成 + if int64(reward.InviteNum) > inviteNum { + return + } + + var decr = int64(reward.RewardNum) + + //扣除总预算是否成功 + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, player.CampaignID) + if err != nil { + return + } + + ok, _ := stock.DecrPoolAndAdd(player.CampaignID, decr) + if !ok { + limitStatus = mtype.FissionReferralLimitStatusBudget + return + } + + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(reward, true) + if err != nil { + return + } + + if nextReward == nil { + limitStatus = mtype.FissionReferralLimitStatusFinish + return + } + + // 初始化奖品的东西 + playerM := s.GetDao().FissionWin + var up []field.AssignExpr + up = append(up, playerM.NextStep.Value(nextReward.Step)) + if nextReward.Step <= reward.Step { + up = append(up, playerM.LoopInvite.Add(1)) + } + + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return + +} + +// 增加抽奖次数 +func (s *win) _cycle(user *model.FissionUser, effectNum int64, player *model.FissionWin, conf *model.FissionCampaignWin, reward *model.FissionCampaignReward) (err error) { + + var limitStatus int8 + defer func() { + if err != nil { + return + } + + err = s._limitStatus(player.ID, limitStatus) + }() + + if effectNum > int64(conf.InviteLimit) { + limitStatus = mtype.FissionReferralLimitStatusInvite + return + } + + key := ckey.FissionUserGetRewardNum(user.ID) + num, err := lockdo.Int64(s.Ctx, key, func() (num int64, err error) { + m := s.GetDao().FissionRewardRecord.SubTable(user.CampaignID) + return m.WithContext(s.Ctx).Where( + m.UserID.Eq(user.ID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + ).Count() + }) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + var needInvite = int64(reward.InviteNum) //完成任务需要邀请的人数 + var decr = int64(reward.RewardNum) //奖品数据 + cn := effectNum - (num * needInvite) //总邀请人数 -(完成任务数 * 完成任务需要邀请的人数)= 计算完成任务的邀请人数 + + //邀请的人不足以获取到奖品 + if cn < needInvite { + return + } + + //扣除总预算是否成功 + var stock *stocks.Campaign + stock, err = stocks.NewCampaign(s.Ctx, player.CampaignID) + if err != nil { + return + } + + ok, _ := stock.DecrPoolAndAdd(player.CampaignID, decr) + if !ok { + limitStatus = mtype.FissionReferralLimitStatusBudget + return + } + + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(reward, true) + if err != nil { + return + } + + // 领奖数+1 + app.Redis.Cache.Incr(s.Ctx, key) + + return + +} + +func (s *win) _limitStatus(playerId int64, ls int8) (err error) { + if ls == mtype.FissionReferralLimitStatusNone { + return + } + m := s.GetDao().FissionWin + var up = []field.AssignExpr{ + m.LimitStatus.Value(ls), + } + + if ls == mtype.FissionReferralLimitStatusFinish { + up = append(up, m.NextStep.Value(0)) + } + + _, err = m.WithContext(s.Ctx).Where(m.ID.Eq(playerId)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return +} + +// 额外 +func (s *win) _extra(user *model.FissionUser, player *model.FissionWin, effectNum int64) (err error) { + m := s.GetDao().FissionCampaignReward + var extras []*model.FissionCampaignReward + var extraReward, nextExtraReward *model.FissionCampaignReward + extras, err = m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(user.CampaignID), + m.RewardType.Eq(mtype.FissionCampaignRewardTypeExtra), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + rewardL := len(extras) + for i, extra := range extras { + if extra.Step == player.NextStep { + extraReward = extra + + if i < rewardL-1 { + nextExtraReward = extras[i+1] + } + + break + } + } + + if extraReward == nil { + return + } + + //没有达标任务 + if int64(extraReward.InviteNum) > effectNum { + return + } + + // 额外奖品 + _, _, _, err = award.NewAwardReward(s.Ctx, s.GetDao(), s.cpn.ProjectID, user).One(extraReward, true) + if err != nil { + return + } + + var nextStep int32 + if nextExtraReward != nil { + nextStep = nextExtraReward.Step + } + + // 下次的额外奖 + playerM := s.GetDao().FissionWin + _, err = playerM.WithContext(s.Ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple(playerM.NextStep.Value(nextStep)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} diff --git a/internal/service/queue/consumer/campaignnotice/vs_settlement.go b/internal/service/queue/consumer/campaignnotice/vs_settlement.go new file mode 100644 index 0000000..d8650bc --- /dev/null +++ b/internal/service/queue/consumer/campaignnotice/vs_settlement.go @@ -0,0 +1,115 @@ +package campaignnotice + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "time" + + "gorm.io/gen" +) + +type VsSettlement struct { + logic.Logic + + Req *types.CampaignVsSettlement +} + +func (s *VsSettlement) Exec() (err error) { + + m := s.GetDao().FissionCampaignVsSchedule + schedule, err := m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.ScheduleId)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if schedule == nil || schedule.IsSettlement == mtype.No { + return + } + + mp := fissionaction.NewMarkPoint(s.Ctx) + + t := time.Now().Unix() + + slt := schedule.GetSettlement() + var settlements = make([]*model.FissionVsVoteSettlement, 0, 200) + + voteM := s.GetDao().FissionVsVote + var votes []*model.FissionVsVote + err = voteM.WithContext(s.Ctx).Where( + voteM.ScheduleID.Eq(schedule.ID), + voteM.WinType.Eq(int8(slt.WinType)), + voteM.WinTeamID.Eq(slt.WinTeamId), + ).FindInBatches(&votes, 200, func(tx gen.Dao, batch int) error { + var userIds []int64 + for _, v := range votes { + userIds = append(userIds, v.UserID) + } + + userM := s.GetDao().FissionUser.SubTable(schedule.CampaignID) + users, err1 := userM.WithContext(s.Ctx).Where(userM.ID.In(userIds...)).Find() + if err1 != nil { + return s.BE().MysqlError(err1) + } + + var userMap = make(map[int64]*model.FissionUser) + for _, p := range users { + userMap[p.ID] = p + } + + var ids []int64 + for _, vote := range votes { + ids = append(ids, vote.ID) + settlements = append(settlements, withdefault.FissionVsVoteSettlement(&model.FissionVsVoteSettlement{ + CampaignID: vote.CampaignID, + UserID: vote.UserID, + ScheduleID: vote.ScheduleID, + VsID: vote.VsID, + VoteID: vote.ID, + AcceptAt: 0, + RecordIds: "[]", + Odds: schedule.GetOdds(), + })) + + mp.InApp(userMap[vote.UserID]).VsWin(t, vote.ScheduleID, vote.FreeVote+vote.PointVote) + } + + _, err = voteM.WithContext(s.Ctx).Where(voteM.ID.In(ids...)).UpdateColumnSimple(voteM.IsWin.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + + return nil + }) + + err = s.GetDao().FissionVsVoteSettlement.WithContext(s.Ctx).CreateInBatches(settlements, 200) + if err != nil { + return s.BE().MysqlError(err) + } + + conf, err := cache.NewCampaignVs(s.Ctx).FindByCampaignId(schedule.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if conf.ClaimType == mtype.FissionCampaignVsClaimTypePage { + return + } + + p := producer.NewCampaignNotice(s.Ctx) + for _, v := range settlements { + p.CampaignSettlementReward(types.CampaignSettlementReward{ + SettlementId: v.ID, + }) + } + + return +} diff --git a/internal/service/queue/consumer/consumer.go b/internal/service/queue/consumer/consumer.go new file mode 100644 index 0000000..de9e179 --- /dev/null +++ b/internal/service/queue/consumer/consumer.go @@ -0,0 +1,114 @@ +package consumer + +import ( + "context" + "joybuywork/internal/app" + "errors" + "fmt" + "github.com/Shopify/sarama" + "github.com/rs/xid" + "gits.branchcn.com/backend/microcode/plugins/kafka" + "time" +) + +const ( + defaultConsumerNum = 5 //默认消费者数 +) + +type Receive func(session sarama.ConsumerGroupSession, message *sarama.ConsumerMessage) + +type CParams struct { + Topic string + Num int + Name string + GroupName string + Config *sarama.Config +} + +type IConsumer interface { + Receive(session sarama.ConsumerGroupSession, message *sarama.ConsumerMessage) + Params() CParams +} + +type Consumer struct { + c IConsumer + cp CParams +} + +func NewConsumer(consumer IConsumer) (*Consumer, error) { + c := &Consumer{ + c: consumer, + cp: consumer.Params(), + } + + if c.cp.Topic == "" { + return nil, errors.New("topic empty") + } + + if c.cp.GroupName == "" { + return nil, errors.New("group_name empty") + } + + if c.cp.Num == 0 { + c.cp.Num = defaultConsumerNum + } + + if c.cp.Config == nil { + c.cp.Config = kafka.DefaultConsumerConfig() + } + + if c.cp.Name == "" { + c.cp.Name = xid.New().String() + } + + return c, nil +} + +func (c *Consumer) Run() { + handler := newGroupHandler(c.c.Receive) + for i := 0; i < c.cp.Num; i++ { + idx := i + app.GoSafeRetry(func() { + start(handler, c.cp, idx) + }, func() { + app.Logger.Warn(context.Background(), "消费者将在5秒后尝试重新启动", "") + time.Sleep(5 * time.Second) + start(handler, c.cp, idx) + }, "消费者组", c.cp.GroupName) + } + return +} + +// 启动一个消费任务 +func start(handler *GroupHandler, conf CParams, idx int) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // 创建消费者组 + consumerGroup, err := app.Kafka.NewConsumerGroup(conf.GroupName, conf.Config) + if err != nil { + app.Logger.Error(ctx, fmt.Sprintf("创建消费者组出错:%v", err)) + return + } + defer consumerGroup.Close() + + //加入全局运行任务 + mark := fmt.Sprintf("%s-%d", conf.Name, idx) + RTS[mark] = &Task{ + gh: handler, + cancel: cancel, + } + + for { + if err = consumerGroup.Consume(ctx, []string{conf.Topic}, handler); err != nil { + app.Logger.Error(ctx, fmt.Sprintf("消费出错:%v", err)) + } + if handler.Closed() { + // 消费者处理程序被关闭,退出消费循环 + delete(RTS, mark) + break + } + app.Logger.Warn(ctx, fmt.Sprintf("消费者(%s-%d)重新分配", conf.Name, idx)) + } + app.Logger.Warn(ctx, fmt.Sprintf("消费者(%s-%d)结束消费", conf.Name, idx)) +} diff --git a/internal/service/queue/consumer/group_handler.go b/internal/service/queue/consumer/group_handler.go new file mode 100644 index 0000000..454f3c0 --- /dev/null +++ b/internal/service/queue/consumer/group_handler.go @@ -0,0 +1,60 @@ +package consumer + +import ( + "joybuywork/internal/app" + "github.com/Shopify/sarama" + "sync" +) + +type GroupHandler struct { + name string + mu sync.Mutex + closed bool + receive Receive +} + +func newGroupHandler(receive Receive) *GroupHandler { + return &GroupHandler{ + mu: sync.Mutex{}, + closed: false, + receive: receive, + } +} + +// Cleanup 在消费者组关闭时执行清理操作 +func (h *GroupHandler) Cleanup(session sarama.ConsumerGroupSession) error { + return nil +} + +// Setup 初始化消费者组 +func (h *GroupHandler) Setup(session sarama.ConsumerGroupSession) error { + return nil +} + +// ConsumeClaim 消费消息 +func (h *GroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { + for { + select { + case message := <-claim.Messages(): + _ = app.QueueConsumerPool.Submit(func() { + h.receive(session, message) + }) + case <-session.Context().Done(): + return nil + } + } +} + +// Close 关闭消费者组处理程序 +func (h *GroupHandler) Close() { + h.mu.Lock() + defer h.mu.Unlock() + h.closed = true +} + +// Closed 检查消费者组处理程序是否已关闭 +func (h *GroupHandler) Closed() bool { + h.mu.Lock() + defer h.mu.Unlock() + return h.closed +} diff --git a/internal/service/queue/consumer/statcampaign/logic.go b/internal/service/queue/consumer/statcampaign/logic.go new file mode 100644 index 0000000..9150d8d --- /dev/null +++ b/internal/service/queue/consumer/statcampaign/logic.go @@ -0,0 +1,467 @@ +package statcampaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + "fmt" + "slices" + "strings" + "time" +) + +type Logic struct { + logic.Logic + + Req *types.StatCampaignValue + + userMark string //用户标识 + expTime time.Duration //基于活动结束时间的缓存过期时间 + + lang string + + channelId, webChannelId int64 +} + +func (s *Logic) Exec() (err error) { + cpn, err := s.campaign() + if err != nil { + return + } + + err = s.statCampaign(cpn) + if err != nil { + return + } + + err = s.channelStat(cpn) + if err != nil { + return + } + + err = s.campaignNotice() + if err != nil { + return + } + + err = s.other(cpn) + if err != nil { + return + } + + return +} + +func (s *Logic) campaign() (cpn *model.FissionCampaign, err error) { + cpn, err = finder.Campaign(s.Ctx, s.Req.CampaignID, s.Req.Hid) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("cpn not found") + return + } + + // 让后面都可以用活动主键 + s.Req.CampaignID = cpn.ID + s.lang = s.Req.Language + + // 一些项目用户id特别处理 + if s.Req.BehaviorType == mtype.FissionBehaviorTypeCustom && verify.InArray(cpn.ProjectID, 374, 143) { + lg, _, _ := strings.Cut(s.Req.UserID, "_") + if !verify.InArray(lg, cpn.GetLangMarks()...) { + err = workerr.NotFound("not at rule") + return + } + + if s.lang == "" { + s.lang = lg + } + } + + //构建标识 + if s.Req.FromSrv { + s.userMark = fmt.Sprintf("srv:%s", s.Req.UserID) + } else { + s.userMark = utils.Md5String(fmt.Sprintf("%v_%v_%v_%v", s.Req.IpAddress, s.Req.Os, s.Req.OsVersion, s.Req.DeviceModel)) + } + + // 广告活动 + if cpn.Target == mtype.FissionCampaignConfigTargetAdsGame { + s.expTime = 7 * 24 * time.Hour + return + } + + tz := provider.NewCampaignTZ(s.Ctx, cpn, s.lang) + if tz.IsEnd() { + err = workerr.VerifyError("cpn stat end") + return + } + + if tz.IsWait() { + err = workerr.VerifyError("cpn not start") + return + } + + s.expTime = time.Until(tz.EndTime()) + + // 不是予发布状态下或者没有用户id的都不用验证白名单 + if !tz.IsPre() || s.Req.UserID == "" { + return + } + + // 验证白名单 + conf, err := cache.NewCampaignConfig(s.Ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if slices.Contains(conf.GetWhileList(), s.Req.UserID) { + return + } + + return nil, workerr.CNotRunError +} + +func (s *Logic) statCampaign(cpn *model.FissionCampaign) (err error) { + //行为队列 + + if s.Req.BehaviorType == mtype.FissionBehaviorTypeCustom || cpn.Target != consts.FissionTargetAds { + return + } + + b := types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: s.Req.BehaviorType, + BehaviorTime: s.Req.BehaviorTime, + UserMark: s.userMark, + OtherData: nil, + MarkId: "", + } + + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(b) + + return +} + +func (s *Logic) channelStat(cpn *model.FissionCampaign) (err error) { + if !verify.InArray(s.Req.BehaviorType, mtype.FissionBehaviorTypeAppOpen, mtype.FissionBehaviorTypeAppInstall) || cpn.Target != mtype.FissionCampaignConfigTargetAdsGame { + return + } + + var chId int64 + defer func() { + if chId == 0 { + return + } + + var bt int32 + switch s.Req.BehaviorType { + case mtype.FissionBehaviorTypeAppInstall: + bt = mtype.FissionBehaviorTypeChannelInstall + case mtype.FissionBehaviorTypeAppOpen: + bt = mtype.FissionBehaviorTypeChannelOpen + } + + producer.NewCampaignNotice(s.Ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: bt, + BehaviorTime: s.Req.BehaviorTime, + UserMark: s.userMark, + MarkId: fmt.Sprint(chId), + }) + }() + + // 带渠道标识 + if s.Req.Channel != "" { + m := s.GetDao().FissionCampaignChannel + + var ch *model.FissionCampaignChannel + ch, err = m.WithContext(s.Ctx).Where(m.CampaignID.Eq(cpn.ID), m.Mark.Eq(s.Req.Channel)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if ch != nil { + chId = ch.ID + + if ch.CType == mtype.FissionCampaignChannelTypeApp { + s.channelId = ch.ID + } else { + s.webChannelId = ch.ID + } + + } + + return + } + + // 有上级用户,通过上级用户的绑定信息来统计 + var parent *model.FissionUser + if s.Req.OwnerID != "" { + parent, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.OwnerID) + if err != nil { + return s.BE().CacheError(err) + } + } + + // 有web_id就是站外渠道来源 + if s.Req.WebId != "" { + defer func() { + s.webChannelId = chId + }() + + // 拿上级用户的站外信息来统计站外渠道,因为产品定义,带来的下级全都归总到上级的渠道上 + wbuM := s.GetDao().FissionWebUser + var wbu *model.FissionWebUser + if parent != nil { + wbu, err = wbuM.WithContext(s.Ctx).Where(wbuM.CampaignID.Eq(cpn.ID), wbuM.UserID.Eq(parent.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if wbu != nil { + chId = wbu.ChannelID + } + } + + // 如果在上级的关系链赋予了数据,就直接返回统计 + if chId > 0 { + return + } + + // 取当前web_id最后访问的渠道id + chId, err = app.Redis.Cache.Get(s.Ctx, ckey.FissionWebLastChannel(cpn.ID, s.Req.WebId)).Int64() + if err = dbcheck.RdError(err); err != nil { + return s.BE().CacheError(err) + } + + if chId > 0 { + return + } + + // webid对应的的站外记录 + wbu, err = wbuM.WithContext(s.Ctx).Where(wbuM.CampaignID.Eq(cpn.ID), wbuM.WebID.Eq(s.Req.WebId)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if wbu != nil { + chId = wbu.ChannelID + _ = app.Redis.Cache.SetNX(s.Ctx, ckey.FissionWebLastChannel(cpn.ID, wbu.WebID), fmt.Sprint(chId), 2*time.Hour) + } + + return + } + + // 站内的数据 + if parent != nil && parent.ChannelID > 0 { + chId = parent.ChannelID + s.channelId = parent.ChannelID + return + } + + if s.Req.UserID != "" { + var user *model.FissionUser + + user, err = cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.UserID) + if err != nil { + return s.BE().CacheError(err) + } + if user != nil && user.ChannelID > 0 { + chId = user.ChannelID + } + } + + // 归到默认渠道 + m := s.GetDao().FissionCampaignChannel + ch, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.CType.Eq(mtype.FissionCampaignChannelTypeApp), + m.IsDefault.Eq(mtype.Yes), + m.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if ch == nil { + return + } + + chId = ch.ID + + return +} + +// 活动通知 +func (s *Logic) campaignNotice() (err error) { + // 不是需要通知的事件不通知 + if !verify.InArray(s.Req.BehaviorType, + mtype.FissionBehaviorTypeAppInstall, + mtype.FissionBehaviorTypeAppOpen, + mtype.FissionBehaviorTypeAppRegister, + mtype.FissionBehaviorTypeCustom, + mtype.FissionBehaviorTypeWebFirstOpen, + mtype.FissionBehaviorTypePurchase, + ) { + return + } + + var notice = types.CampaignNotice{ + CampaignId: s.Req.CampaignID, + DeviceId: s.Req.DeviceID, + UserId: s.Req.UserID, + ParentId: s.Req.OwnerID, + IsInstall: false, + BehaviorTime: s.Req.BehaviorTime, + NoticeType: 0, + NoticeTag: "", + Event: s.Req.Event, + EventData: s.Req.EventData, + ProjectId: s.Req.ProjectID, + Ip: s.Req.IpAddress, + Os: s.Req.Os, + OsVersion: s.Req.OsVersion, + DeviceModel: s.Req.DeviceModel, + Lang: s.lang, + ChannelId: s.channelId, + WebChannelId: s.webChannelId, + UserMark: s.userMark, + PurchasesData: s.Req.PurchasesData, + UserLv: s.Req.Tags, + } + + switch s.Req.BehaviorType { + case mtype.FissionBehaviorTypeAppInstall: + notice.NoticeType = types.NoticeTypeInstall + notice.IsInstall = true + case mtype.FissionBehaviorTypeAppOpen: + notice.NoticeType = types.NoticeTypeOpen + case mtype.FissionBehaviorTypeAppRegister: + notice.NoticeType = types.NoticeTypeRegister + case mtype.FissionBehaviorTypeCustom: + notice.NoticeType = types.NoticeTypeCustom + case mtype.FissionBehaviorTypeWebFirstOpen: + notice.NoticeType = types.NoticeTypeInstall + notice.IsInstall = true + notice.NoticeTag = types.NoticeTagWeb + case mtype.FissionBehaviorTypePurchase: + notice.NoticeType = types.NoticeTypePay + } + + // 安装,打开,注册,是新用户才通知 + if verify.InArray(s.Req.BehaviorType, mtype.FissionBehaviorTypeAppInstall, mtype.FissionBehaviorTypeAppOpen, mtype.FissionBehaviorTypeAppRegister, mtype.FissionBehaviorTypeWebFirstOpen) { + producer.NewCampaignNotice(s.Ctx).CampaignNotice(notice) + return + } + + // 自定义事件 + if s.Req.UserID == "" && s.Req.DeviceID == "" { + return + } + + var keys []string + for _, v := range s.Req.EventData { + keys = append(keys, v.EventKey) + } + + m := s.GetDao().FissionCampaignCond + list, err := m.WithContext(s.Ctx).Where( + m.CampaignID.Eq(s.Req.CampaignID), + m.Event.Eq(s.Req.Event), + m.EventKey.In(keys...), + m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var hasCond bool + for _, v := range list { + + switch v.TriggetType { + case mtype.FissionCampaignCondTriggerTypeClick: + if cmm.NewCMM(s.Ctx, s.GetDao()).EventCanTotal(v, s.Req.UserID, 0, 0, s.Req.BehaviorTime) { + hasCond = true + } + case mtype.FissionCampaignCondTriggerTypePage: + user, _ := cache.NewFissionUser(s.Ctx, s.Req.CampaignID).FindBySubUserId(s.Req.UserID) + + if user != nil && user.JoinAt > 0 && user.JoinAt <= s.Req.BehaviorTime { + hasCond = true + } + + case mtype.FissionCampaignCondTriggerTypeGlobal: + hasCond = true + } + } + + if !hasCond { + return + } + + if verify.InArray[int32](s.Req.BehaviorType, mtype.FissionBehaviorTypeCustom, mtype.FissionBehaviorTypePurchase) { + producer.NewCampaignNotice(s.Ctx).CampaignNotice(notice) + return + } + + return +} + +func (s *Logic) other(cpn *model.FissionCampaign) (err error) { + switch cpn.FissionID { + case consts.IdChop: + return s._chopHelp(cpn) + } + + return +} + +func (s *Logic) _chopHelp(cpn *model.FissionCampaign) (err error) { + if s.Req.BehaviorType != mtype.FissionBehaviorTypeViewDownload || s.Req.OwnerID == "" { + return + } + + user, err := cache.NewFissionUser(s.Ctx, cpn.ID).FindBySubUserId(s.Req.OwnerID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + producer.NewCampaignNotice(s.Ctx).ValidEvents(types.ValidEvents{ + BehaviorTime: s.Req.BehaviorTime, + NoticeType: types.NoticeTypeClick, + CampaignId: cpn.ID, + ParentId: user.ID, + ClickInfo: &types.ValidEventsClickInfo{ + UserMark: s.userMark, + IpAddress: s.Req.IpAddress, + Os: s.Req.Os, + OsVersion: s.Req.OsVersion, + DeviceModel: s.Req.DeviceModel, + DeviceID: s.Req.DeviceID, + WebId: s.Req.WebId, + }, + }) + return +} diff --git a/internal/service/queue/consumer/statcampaign/logic_test.go b/internal/service/queue/consumer/statcampaign/logic_test.go new file mode 100644 index 0000000..19e7bce --- /dev/null +++ b/internal/service/queue/consumer/statcampaign/logic_test.go @@ -0,0 +1,511 @@ +package statcampaign + +import ( + "context" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "fmt" + "math/rand" + "sync" + "testing" + "time" + + "github.com/rs/xid" + + _ "joybuywork/test" +) + +// TestLogic_Custom 测试自定义行为事件 +func TestLogic_Custom(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeCustom) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 3458, + Event: "pay", + EventData: []types.EventData{ + { + EventKey: "pay_10", + EventVal: "10", + }, + }, + ProjectID: 554, + Channel: "", + FromSrv: false, + Hid: "", + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_Custom err: %v", errCode) +} + +// TestLogic_AppInstall 测试App安装行为 +func TestLogic_AppInstall(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeAppInstall) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 3458, + OwnerID: "", + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_AppInstall err: %v", errCode) +} + +// TestLogic_AppOpen 测试App打开行为 +func TestLogic_AppOpen(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeAppOpen) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 3458, + OwnerID: "", + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_AppOpen err: %v", errCode) +} + +// TestLogic_AppRegister 测试App注册行为 +func TestLogic_AppRegister(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeAppRegister) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 3458, + OwnerID: "", + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_AppRegister err: %v", errCode) +} + +// TestLogic_WebFirstOpen 测试Web首次打开行为 +func TestLogic_WebFirstOpen(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeWebFirstOpen) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "web", + OsVersion: "chrome", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "", + WebId: xid.New().String(), + CampaignID: 3458, + OwnerID: "", + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_WebFirstOpen err: %v", errCode) +} + +// TestLogic_FromServer 测试来自服务端的统计 +func TestLogic_FromServer(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeCustom) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: "", + Os: "", + OsVersion: "", + DeviceModel: "", + DeviceID: "", + UserID: "server_user_1", + CampaignID: 3458, + Event: "pay", + EventData: []types.EventData{ + { + EventKey: "pay_10", + EventVal: "10", + }, + }, + ProjectID: 554, + Channel: "", + FromSrv: true, + Hid: "", + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_FromServer err: %v", errCode) +} + +// TestLogic_WithChannel 测试带渠道标识的行为统计 +func TestLogic_WithChannel(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeAppInstall) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "android", + OsVersion: "13", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 3458, + OwnerID: "", + ProjectID: 554, + Channel: "test_channel_mark", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_WithChannel err: %v", errCode) +} + +// TestLogic_InvalidCampaign 测试无效活动ID +func TestLogic_InvalidCampaign(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeCustom) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 0, // 无效的活动ID + Event: "pay", + EventData: []types.EventData{ + { + EventKey: "pay_10", + EventVal: "10", + }, + }, + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_InvalidCampaign err: %v", errCode) + + if errCode == nil { + t.Log("expected error for invalid campaign but got nil") + } +} + +// TestLogic_Purchase 测试支付行为统计 +func TestLogic_Purchase(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypePurchase) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "123", + CampaignID: 3458, + Event: "purchases", + EventData: []types.EventData{ + { + EventKey: "count", + EventVal: "100", + }, + { + EventKey: "times", + EventVal: "1", + }, + }, + ProjectID: 554, + Channel: "", + FromSrv: false, + PurchasesData: &types.PurchaseData{ + TransactionId: xid.New().String(), + TransactionDesc: "test purchase", + Amount: 100, + Currency: "USD", + PurchaseCount: 1, + ContentItems: []types.PurchaseItem{ + { + PayTime: time.Now().Format("2006-01-02 15:04:05"), + ProductId: "product_1", + ProductName: "Test Product", + ProductPrice: 100, + ProductQuantity: 1, + }, + }, + }, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_Purchase err: %v", errCode) +} + +// TestLogic_WithOwnerId 测试带上级用户ID的行为 +func TestLogic_WithOwnerId(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeAppOpen) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "new_user_1", + CampaignID: 3458, + OwnerID: "123", // 上级用户ID + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_WithOwnerId err: %v", errCode) +} + +// TestLogic_Concurrent 并发测试多种行为类型 +func TestLogic_Concurrent(t *testing.T) { + behaviorTypes := []int32{ + mtype.FissionBehaviorTypeCustom, + mtype.FissionBehaviorTypeAppInstall, + mtype.FissionBehaviorTypeAppOpen, + mtype.FissionBehaviorTypeAppRegister, + } + + wg := sync.WaitGroup{} + for i, bt := range behaviorTypes { + wg.Add(1) + go func(idx int, behaviorType int32) { + defer wg.Done() + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: behaviorType, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: fmt.Sprintf("user_%d", idx), + CampaignID: 3458, + OwnerID: "", + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + // 为自定义事件设置event数据 + if behaviorType == mtype.FissionBehaviorTypeCustom { + val.Event = "pay" + val.EventData = []types.EventData{ + { + EventKey: "pay_10", + EventVal: "10", + }, + } + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("Concurrent[%d] behaviorType: %d, err: %v", idx, behaviorType, errCode) + }(i, bt) + } + wg.Wait() +} + +// TestLogic_ViewDownload 测试浏览下载页行为 +func TestLogic_ViewDownload(t *testing.T) { + bt := int32(mtype.FissionBehaviorTypeViewDownload) + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "web", + OsVersion: "chrome", + DeviceModel: xid.New().String(), + DeviceID: xid.New().String(), + UserID: "", + WebId: xid.New().String(), + CampaignID: 3458, + OwnerID: "123", + ProjectID: 554, + Channel: "", + FromSrv: false, + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + t.Logf("TestLogic_ViewDownload err: %v", errCode) +} + +// BenchmarkLogic 基准测试自定义事件处理性能 +func BenchmarkLogic(b *testing.B) { + var id = map[string]bool{ + xid.New().String(): true, + xid.New().String(): true, + xid.New().String(): true, + "": false, + } + + bt := int32(mtype.FissionBehaviorTypeCustom) + + for i := 0; i < b.N; i++ { + var dm string + for k, v := range id { + if v { + dm = k + } else { + dm = xid.New().String() + } + break + } + + var ctx = context.Background() + var val = types.StatCampaignValue{ + BehaviorType: bt, + BehaviorTime: time.Now().Unix(), + IpAddress: fmt.Sprintf("%d.%d.%d.%d", rand.Int31n(255), rand.Int31n(255), rand.Int31n(255), rand.Int31n(255)), + Os: "ios", + OsVersion: "16", + DeviceModel: dm, + UserID: "123", + CampaignID: 3458, + OwnerID: "", + } + + var container = new(Logic) + { + container.Init(ctx) + container.Req = &val + } + + errCode := logic.Run(container) + b.Log(errCode) + } +} diff --git a/internal/service/queue/consumer/statcampaign/stat_campaign.go b/internal/service/queue/consumer/statcampaign/stat_campaign.go new file mode 100644 index 0000000..fe2ac15 --- /dev/null +++ b/internal/service/queue/consumer/statcampaign/stat_campaign.go @@ -0,0 +1,171 @@ +package statcampaign + +import ( + "joybuywork/internal/app" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/consumer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + "joybuywork/proto/go_proto/workerr" + "fmt" + "strings" + "sync" + + "github.com/Shopify/sarama" + "github.com/panjf2000/ants/v2" + "gits.branchcn.com/backend/microcode/plugins/kafka" +) + +func Run() (err error) { + c, err := consumer.NewConsumer(&StatCampaign{}) + if err != nil { + return + } + c.Run() + return +} + +type StatCampaign struct{} + +func (s StatCampaign) Params() consumer.CParams { + return consumer.CParams{ + Topic: types.StatCampaignTopic, + Num: 5, + Name: "campaign_notice", + GroupName: types.StatCampaignGroup, + Config: kafka.DefaultConsumerConfig(), + } +} + +func (s StatCampaign) Receive(session sarama.ConsumerGroupSession, message *sarama.ConsumerMessage) { + // 结束标记消息已消费 + defer session.MarkMessage(message, "") + var handler *consumer.Ctx + switch utils.Bs(message.Key) { + case types.StatCampaignKey: + handler = consumer.NewCtx("活动统计", message, statCampaign) + default: + return + } + + handler.Done() +} + +func statCampaign(ctx *consumer.Ctx) (err error) { + var val types.StatCampaignValue + err = ctx.Parse(&val) + if err != nil { + return + } + + // 不是自定义事件,或者是自定义事件,但是已经指定了活动,要走直接进入逻辑 + if !verify.InArray[int32](val.BehaviorType, mtype.FissionBehaviorTypeCustom, mtype.FissionBehaviorTypePurchase) { + var container = new(Logic) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) + } + + if val.BehaviorType == mtype.FissionBehaviorTypePurchase { + if val.PurchasesData == nil { + app.Logger.Error(ctx.Context(), "没有接收到支付信息") + return + } + + val.Event = "purchases" + val.EventData = []types.EventData{ + { + EventKey: "count", + EventVal: fmt.Sprint(val.PurchasesData.Amount), + }, + { + EventKey: "times", + EventVal: fmt.Sprint(val.PurchasesData.PurchaseCount), + }, + } + } + + // 如果hid是优值的,就要用活动hash_id来处理 + if val.Hid != "" { + hids := strings.Split(val.Hid, ",") + wg := sync.WaitGroup{} + defer wg.Wait() + + for _, id := range hids { + wg.Add(1) + one := val + one.Hid = id + + app.GoSafe(func() { + defer wg.Done() + + var container = new(Logic) + { + container.Init(ctx.Context(), logic.WithErrNotifyNeqCode(workerr.VerifyErrorCode, 404)) + container.Req = &one + } + + _ = logic.Run(container) + + }, fmt.Sprintf("处理活动统计逻辑panic, cpn_id: %s", id)) + } + + return + } + + // 没有指定活动id的自定义事件,那么就要全局活动推送 + var keys []string + for _, v := range val.EventData { + keys = append(keys, v.EventKey) + } + + // 自定义事件要先找到事件绑定的活动 + m := dao.Q.FissionCampaignCond + var ids []int64 + err = m.WithContext(ctx.Context()). + Where( + m.ProjectID.Eq(val.ProjectID), + m.Event.Eq(val.Event), + m.EventKey.In(keys...), + m.EventType.In(mtype.FissionCampaignCondEventTypeCustom, mtype.FissionCampaignCondEventTypeStandard), + m.IsDel.Eq(mtype.No), + ). + Group(m.CampaignID). + Pluck(m.CampaignID, &ids) + + if err != nil || len(ids) == 0 { + return + } + + wg := sync.WaitGroup{} + defer wg.Wait() + + gp, _ := ants.NewPool(len(ids)) + defer gp.Release() + + for _, id := range ids { + wg.Add(1) + one := val + one.CampaignID = id + _ = gp.Submit(func() { + defer wg.Done() + defer app.TryCatch(ctx.Context(), fmt.Sprintf("处理活动统计逻辑panic, cpn_id: %d", id)) + + var container = new(Logic) + { + container.Init(ctx.Context(), logic.WithErrNotifyNeqCode(workerr.VerifyErrorCode, 404)) + container.Req = &one + } + + _ = logic.Run(container) + }) + } + + return +} diff --git a/internal/service/queue/consumer/task.go b/internal/service/queue/consumer/task.go new file mode 100644 index 0000000..d6a9a67 --- /dev/null +++ b/internal/service/queue/consumer/task.go @@ -0,0 +1,18 @@ +package consumer + +import ( + "context" +) + +type Task struct { + gh *GroupHandler + cancel context.CancelFunc +} + +var RTS = make(map[string]*Task) + +func Stop() { + for _, t := range RTS { + t.gh.Close() + } +} diff --git a/internal/service/queue/delay/action.go b/internal/service/queue/delay/action.go new file mode 100644 index 0000000..32bc540 --- /dev/null +++ b/internal/service/queue/delay/action.go @@ -0,0 +1,72 @@ +package delay + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/plugins/printer" + "joybuywork/internal/utils" + "fmt" + "time" + + "github.com/rs/xid" + "gits.branchcn.com/backend/microcode/plugins/derivative/delay" +) + +type Do func(ctx *Ctx) error + +type Ctx struct { + ctx context.Context + name string + message delay.Delivery + do Do +} + +func NewCtx(ctx context.Context, name string, message delay.Delivery, do Do) *Ctx { + ctx = context.WithValue(context.Background(), consts.TraceIdKey, message.AppId) + msgId := xid.New().String() + if message.MsgId != "" { + msgId = message.MsgId + } + ctx = context.WithValue(ctx, consts.CtxMsgId, msgId) + + return &Ctx{ + ctx: ctx, + name: name, + message: message, + do: do, + } +} + +func (s *Ctx) Done() (err error) { + if s == nil { + return + } + + req := utils.Bs(s.message.Body) + defer app.TryCatch(s.ctx, fmt.Sprintf("执行任务[%s]失败,数据: %s", s.name, req)) + + tn := time.Now() + sl := printer.NewSlowLog(s.ctx, printer.SetSlow(printer.TenNormalSlow)) + app.Collect(s.name) + sl.Start(fmt.Sprintf("运行[%s], 执行间隔:%12v, 数据:%s", s.name, time.Since(s.message.PublishTime), req)) + defer func() { + sl.End(fmt.Sprintf("执行时长:%12v, 运行错误:%v", time.Since(tn), err), err, s.name, req, "") + }() + + err = s.do(&Ctx{ + ctx: s.ctx, + message: s.message, + }) + + return +} + +func (s *Ctx) Parse(data any) error { + return jsonm.Unmarshal(s.message.Body, data) +} + +func (s *Ctx) Context() context.Context { + return s.ctx +} diff --git a/internal/service/queue/delay/delay.go b/internal/service/queue/delay/delay.go new file mode 100644 index 0000000..d90120d --- /dev/null +++ b/internal/service/queue/delay/delay.go @@ -0,0 +1,148 @@ +package delay + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" + "fmt" + + "gits.branchcn.com/backend/microcode/plugins/derivative/delay" +) + +func Setup() error { + customers := delay.RegisterConsumer( + delayCommon(), + ) + + return customers.Listen() +} + +func Stop() { + delay.Stop() +} + +func delayCommon() *delay.Consumer { + return delay.NewRedisDelayQueue(context.Background(), app.Redis.Cache, ckey.DelayCommonKey()).Consumer(commonCustomerAction) +} + +// 通用对列消费者 +func commonCustomerAction(ctx context.Context, d delay.Delivery) error { + var handler *Ctx + switch d.Type { + case types.CommonRewardPush: + handler = NewCtx(ctx, "奖品延时回调", d, rewardPush) + case types.CommonGlobalRewardPush: + handler = NewCtx(ctx, "全局奖品延时回调", d, globalRewardPush) + + case types.CommonCoinExpired: + handler = NewCtx(ctx, "T币过期处理", d, coinExpired) + case types.CommonCheckRewardPush: + handler = NewCtx(ctx, "检查奖品是否成功推送", d, checkRewardPush) + default: + app.Logger.Error(ctx, fmt.Sprintf("不存在%s类型的延时对列处理场景", d.Type)) + } + + return handler.Done() +} + +func checkRewardPush(ctx *Ctx) (err error) { + var data *types.DelayCommonCheckRewardPush + err = ctx.Parse(&data) + if err != nil { + return + } + + reward, err := cache.NewReward(ctx.Context()).FindById(data.BaseRewardId) + if err != nil { + return + } + + if reward == nil || reward.ReceiveType != mtype.RewardReceiveTypeNotify { + return + } + + m := dao.FissionNotify + ntf, err := m.WithContext(ctx.Context()).Where( + m.CampaignID.Eq(data.CampaignId), + m.RecordID.Eq(data.UserRewardId), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if ntf != nil { + return + } + + producer.NewCampaignNotice(ctx.Context()).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: data.CampaignId, + UserId: data.UserId, + UserRewardId: data.UserRewardId, + }) + + return +} + +func coinExpired(ctx *Ctx) (err error) { + var data *types.DelayCommonRewardPush + err = ctx.Parse(&data) + if err != nil { + return + } + + m := dao.ProjectUserCoinExpired + expired, err := m.WithContext(ctx.Context()).Where(m.ID.Eq(data.TaskId)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if expired == nil { + return + } + + producer.NewCampaignNotice(ctx.Context()).ProjectUserCoinDeduct(types.ProjectUserCoinDeduct{ + UserId: expired.UserID, + ExpiredId: expired.ID, + }) + + return +} + +func rewardPush(ctx *Ctx) (err error) { + var data *types.DelayCommonRewardPush + err = ctx.Parse(&data) + if err != nil { + return + } + + container := new(RewardPush) + { + container.Init(ctx.Context(), logic.WithErrData(data)) + container.Req = data + } + + return logic.Run(container) +} + +func globalRewardPush(ctx *Ctx) (err error) { + var data *types.DelayCommonGlobalRewardPush + err = ctx.Parse(&data) + if err != nil { + return + } + + container := new(GlobalRewardPush) + { + container.Init(ctx.Context(), logic.WithErrData(data)) + container.Req = data + } + + return logic.Run(container) +} diff --git a/internal/service/queue/delay/global_reward_push.go b/internal/service/queue/delay/global_reward_push.go new file mode 100644 index 0000000..b8d4abe --- /dev/null +++ b/internal/service/queue/delay/global_reward_push.go @@ -0,0 +1,63 @@ +package delay + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" +) + +type GlobalRewardPush struct { + logic.Logic + + Req *types.DelayCommonGlobalRewardPush +} + +func (s *GlobalRewardPush) Exec() (err error) { + m := s.GetDao().RewardPushTask + task, err := m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.TaskId)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if task == nil { + return + } + + pushM := s.GetDao().RewardPush + push, err := pushM.WithContext(s.Ctx).Where(pushM.ID.Eq(task.PushID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + reward, err := cache.NewReward(s.Ctx).FindById(push.RewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if reward == nil || reward.ReceiveType != mtype.RewardReceiveTypeNotify { + return + } + + rp, err := s2s.NewReward(s.Ctx, reward) + if err != nil { + return + } + + _, _ = rp.Send(push, push.Sync == mtype.Yes) + + return s.deleteTask(task) +} + +func (s *GlobalRewardPush) deleteTask(task *model.RewardPushTask) (err error) { + _, err = s.GetDao().RewardPushTask.WithContext(s.Ctx).Delete(task) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} diff --git a/internal/service/queue/delay/reward_push.go b/internal/service/queue/delay/reward_push.go new file mode 100644 index 0000000..a09ea7c --- /dev/null +++ b/internal/service/queue/delay/reward_push.go @@ -0,0 +1,72 @@ +package delay + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/notify" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" +) + +type RewardPush struct { + logic.Logic + + Req *types.DelayCommonRewardPush +} + +func (s *RewardPush) Exec() (err error) { + m := dao.FissionNotifyTask + task, err := m.WithContext(s.Ctx).Where(m.ID.Eq(s.Req.TaskId)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if task == nil { + return + } + + ntfM := dao.FissionNotify + ntf, err := ntfM.WithContext(s.Ctx).Where(ntfM.ID.Eq(task.NotifyID)).Take() + if err != nil { + return s.BE().MysqlError(err) + } + + if ntf == nil || ntf.IsOk == mtype.Yes { + return s.deleteTask(task) + } + + var notifyReward notify.Reward + err = jsonm.StrUnmarshal(task.Reward, ¬ifyReward) + if err != nil { + return + } + + cpn, _ := cache.NewCampaign(s.Ctx).FindById(notifyReward.CampaignId) + project, _ := cache.NewProject(s.Ctx).FindById(cpn.ProjectID) + + rewardM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + reward, _ := rewardM.WithContext(s.Ctx).Where(rewardM.ID.Eq(notifyReward.RewardId)).Take() + + breward, _ := cache.NewReward(s.Ctx).FindById(reward.BaseRewardID) + url, _ := cache.NewNotifyURL(s.Ctx).FindById(breward.URLID) + + if url != nil { + notifyReward.KvData = breward.GetJustKvData() + _ = notifyReward.Send(s.Ctx, url.URL, project.NotifyToken, project.PushLadder, ntf.GetHeaders()) + } + + return s.deleteTask(task) +} + +func (s *RewardPush) deleteTask(task *model.FissionNotifyTask) (err error) { + _, err = dao.FissionNotifyTask.WithContext(s.Ctx).Delete(task) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} diff --git a/internal/service/queue/producer/campaign_notice.go b/internal/service/queue/producer/campaign_notice.go new file mode 100644 index 0000000..8e48440 --- /dev/null +++ b/internal/service/queue/producer/campaign_notice.go @@ -0,0 +1,82 @@ +package producer + +import ( + "context" + "joybuywork/internal/service/queue/types" +) + +type CampaignNotice struct { + ctx context.Context + topic string +} + +func NewCampaignNotice(ctx context.Context) CampaignNotice { + return CampaignNotice{ + ctx: ctx, + topic: types.CampaignNoticeTopic, + } +} + +func (p CampaignNotice) CampaignNotice(data types.CampaignNotice) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignNoticeKey, data) +} + +func (p CampaignNotice) CampaignOtherStat(data types.CampaignOtherStat) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignOtherStatKey, data) +} + +func (p CampaignNotice) CampaignRewardNotify(data types.CampaignRewardNotify) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignRewardNotifyKey, data) +} + +func (p CampaignNotice) CampaignTargetStat(data types.CampaignTargetStat) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignTargetStatKey, data) +} + +func (p CampaignNotice) CampaignCondStat(data types.CampaignCondStat) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignCondStatKey, data) +} + +func (p CampaignNotice) CampaignBehavior(data types.CampaignBehavior) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignBehaviorKey, data) +} + +func (p CampaignNotice) CampaignDiceMap(data types.CampaignDiceMap) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignDiceMapKey, data) +} + +func (p CampaignNotice) Download(data types.Download) { + _ = AP.Produce(p.ctx, p.topic, types.DownloadKey, data) +} + +func (p CampaignNotice) ValidEvents(data types.ValidEvents) { + _ = AP.Produce(p.ctx, p.topic, types.ValidEventsKey, data) +} + +func (p CampaignNotice) ProjectUser(data types.ProjectUser) { + _ = AP.Produce(p.ctx, p.topic, types.ProjectUserKey, data) +} + +func (p CampaignNotice) RewardLimitUp(data types.RewardLimitUp) { + _ = AP.Produce(p.ctx, p.topic, types.RewardLimitUpKey, data) +} + +func (p CampaignNotice) CampaignChildInvite(data types.CampaignChildInvite) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignChildInviteKey, data) +} + +func (p CampaignNotice) ProjectUserCoinDeduct(data types.ProjectUserCoinDeduct) { + _ = AP.Produce(p.ctx, p.topic, types.ProjectUserCoinDeductKey, data) +} + +func (p CampaignNotice) CampaignVsSettlement(data types.CampaignVsSettlement) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignVsSettlementKey, data) +} + +func (p CampaignNotice) CampaignSettlementReward(data types.CampaignSettlementReward) { + _ = AP.Produce(p.ctx, p.topic, types.CampaignSettlementRewardKey, data) +} + +func (p CampaignNotice) GameAction(data types.GameAction) { + _ = AP.Produce(p.ctx, p.topic, types.GameActionKey, data) +} diff --git a/internal/service/queue/producer/delay_common.go b/internal/service/queue/producer/delay_common.go new file mode 100644 index 0000000..b53b20b --- /dev/null +++ b/internal/service/queue/producer/delay_common.go @@ -0,0 +1,62 @@ +package producer + +import ( + "context" + "joybuywork/internal/consts" + "joybuywork/internal/service/queue/types" + + "gits.branchcn.com/backend/microcode/plugins/derivative/delay" + "go-micro.dev/v4/metadata" +) + +// RewardPushPub 奖励推送延时对列 +func RewardPushPub(ctx context.Context, sec int, data types.DelayCommonRewardPush) (msgId string, err error) { + var opts = []delay.PushOption{ + delay.UseType(types.CommonRewardPush), + } + + if tradeId, ok := metadata.Get(ctx, consts.TraceIdKey); ok && tradeId != "" { + opts = append(opts, delay.UseAppId(tradeId)) + } + + return DelayCommon.Push(sec, data, opts...) +} + +// GlobalRewardPushPub 全局奖励推送延时对列 +func GlobalRewardPushPub(ctx context.Context, sec int, data types.DelayCommonGlobalRewardPush) (msgId string, err error) { + var opts = []delay.PushOption{ + delay.UseType(types.CommonGlobalRewardPush), + } + + if tradeId, ok := metadata.Get(ctx, consts.TraceIdKey); ok && tradeId != "" { + opts = append(opts, delay.UseAppId(tradeId)) + } + + return DelayCommon.Push(sec, data, opts...) +} + +// CoinExpired 金币过期推送延时对列 +func CoinExpired(ctx context.Context, sec int, data types.DelayCommonCoinExpired) (msgId string, err error) { + var opts = []delay.PushOption{ + delay.UseType(types.CommonCoinExpired), + } + + if tradeId, ok := metadata.Get(ctx, consts.TraceIdKey); ok && tradeId != "" { + opts = append(opts, delay.UseAppId(tradeId)) + } + + return DelayCommon.Push(sec, data, opts...) +} + +// CheckRewardPush 金币过期推送延时对列 +func CheckRewardPush(ctx context.Context, sec int, data types.DelayCommonCheckRewardPush) (msgId string, err error) { + var opts = []delay.PushOption{ + delay.UseType(types.CommonCheckRewardPush), + } + + if tradeId, ok := metadata.Get(ctx, consts.TraceIdKey); ok && tradeId != "" { + opts = append(opts, delay.UseAppId(tradeId)) + } + + return DelayCommon.Push(sec, data, opts...) +} diff --git a/internal/service/queue/producer/fissionbi_receiver.go b/internal/service/queue/producer/fissionbi_receiver.go new file mode 100644 index 0000000..3deebe7 --- /dev/null +++ b/internal/service/queue/producer/fissionbi_receiver.go @@ -0,0 +1,22 @@ +package producer + +import ( + "context" + "joybuywork/internal/service/queue/types" +) + +type FissionBiReceiver struct { + ctx context.Context + topic string +} + +func NewFissionBiReceiver(ctx context.Context) FissionBiReceiver { + return FissionBiReceiver{ + ctx: ctx, + topic: types.FissionBiReceiverTopic, + } +} + +func (p FissionBiReceiver) FissionAction(data types.FissionAction) { + _ = AP.Produce(p.ctx, p.topic, types.FbrFissionActionKey, data) +} diff --git a/internal/service/queue/producer/joybuywork_notify.go b/internal/service/queue/producer/joybuywork_notify.go new file mode 100644 index 0000000..729dd3a --- /dev/null +++ b/internal/service/queue/producer/joybuywork_notify.go @@ -0,0 +1,30 @@ +package producer + +import ( + "context" + "joybuywork/internal/service/queue/types" +) + +type DeepworkNotify struct { + ctx context.Context + topic string +} + +func NewDeepworkNotify(ctx context.Context) DeepworkNotify { + return DeepworkNotify{ + ctx: ctx, + topic: types.DeepworkNotifyTopic, + } +} + +func (p DeepworkNotify) CampaignStart(data types.DnCampaignStart) { + _ = AP.Produce(p.ctx, p.topic, types.DnCampaignStartKey, data) +} + +func (p DeepworkNotify) CampaignEnd(data types.DnCampaignEnd) { + _ = AP.Produce(p.ctx, p.topic, types.DnCampaignEndKey, data) +} + +func (p DeepworkNotify) RewardPushStatus(data types.DnRewardPushStatus) { + _ = AP.Produce(p.ctx, p.topic, types.DnRewardPushStatusKey, data) +} diff --git a/internal/service/queue/producer/oplatform_other.go b/internal/service/queue/producer/oplatform_other.go new file mode 100644 index 0000000..36af909 --- /dev/null +++ b/internal/service/queue/producer/oplatform_other.go @@ -0,0 +1,36 @@ +package producer + +import ( + "context" + "joybuywork/internal/service/queue/types" + + "github.com/Shopify/sarama" +) + +type OplatformOther struct { + ctx context.Context + topic string +} + +func NewOplatformOther(ctx context.Context) OplatformOther { + return OplatformOther{ + ctx: ctx, + topic: types.OplatformOtherTopic, + } +} + +func (p OplatformOther) OpoCampaignHelpOk(data types.OpoCampaignHelpOk, headers ...sarama.RecordHeader) { + _ = AP.Produce(p.ctx, p.topic, types.OpoCampaignHelpOkKey, data, headers...) +} + +func (p OplatformOther) OpoCampaignCondOk(data types.OpoCampaignCondOk, headers ...sarama.RecordHeader) { + _ = AP.Produce(p.ctx, p.topic, types.OpoCampaignCondOkKey, data, headers...) +} + +func (p OplatformOther) OpoCampaignDelete(data types.OpoCampaignDelete, headers ...sarama.RecordHeader) { + _ = AP.Produce(p.ctx, p.topic, types.OpoCampaignDeleteKey, data, headers...) +} + +func (p OplatformOther) OpoCampaignPush(data types.OpoCampaignPush, headers ...sarama.RecordHeader) { + _ = AP.Produce(p.ctx, p.topic, types.OpoCampaignPushKey, data, headers...) +} diff --git a/internal/service/queue/producer/option.go b/internal/service/queue/producer/option.go new file mode 100644 index 0000000..ffa22a3 --- /dev/null +++ b/internal/service/queue/producer/option.go @@ -0,0 +1,14 @@ +package producer + +import ( + "joybuywork/internal/consts" + + "github.com/Shopify/sarama" +) + +func SetHeaderLang(langMark string) sarama.RecordHeader { + return sarama.RecordHeader{ + Key: []byte(consts.XLangKey), + Value: []byte(langMark), + } +} diff --git a/internal/service/queue/producer/producer.go b/internal/service/queue/producer/producer.go new file mode 100644 index 0000000..15d582a --- /dev/null +++ b/internal/service/queue/producer/producer.go @@ -0,0 +1,116 @@ +package producer + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/utils" + "fmt" + "time" + + "github.com/Shopify/sarama" + "github.com/rs/xid" + "gits.branchcn.com/backend/microcode/plugins/derivative/delay" + "gits.branchcn.com/backend/microcode/plugins/kafka" +) + +var AP *AsyncProducer + +func SetUp() { + AP, _ = NewAsyncProducer(kafka.DefaultProducerConfig()) + + initCommonProducer() +} + +type AsyncProducer struct { + producer sarama.AsyncProducer +} + +func NewAsyncProducer(config *sarama.Config) (*AsyncProducer, error) { + p, err := app.Kafka.NewAsyncProducer(config) + if err != nil { + return nil, err + } + + ap := &AsyncProducer{producer: p} + + // 监听消息发送结果 + app.GoSafe(ap.handleSuccesses, "默认生产者监听发送成功消息") + app.GoSafe(ap.handleErrors, "默认生产者监听发送错误消息") + + return ap, nil +} + +func (p *AsyncProducer) Produce(ctx context.Context, topic string, key string, value any, setHeader ...sarama.RecordHeader) (err error) { + b, err := jsonm.Marshal(value) + if err != nil { + return + } + + var headers = []sarama.RecordHeader{ + { + Key: []byte(consts.CtxMsgId), + Value: []byte(xid.New().String()), + }, + } + traceId := ctx.Value(consts.TraceIdKey) + if traceId == nil { + headers = append(headers, sarama.RecordHeader{ + Key: []byte(consts.TraceIdKey), + Value: []byte(xid.New().String()), + }) + } else { + headers = append(headers, sarama.RecordHeader{ + Key: []byte(consts.TraceIdKey), + Value: []byte(traceId.(string)), + }) + } + + for _, header := range setHeader { + headers = append(headers, header) + } + + m := &sarama.ProducerMessage{ + Headers: headers, + Topic: topic, + Key: sarama.StringEncoder(key), + Value: sarama.ByteEncoder(b), + Timestamp: time.Now(), + } + + p.producer.Input() <- m + return +} + +func (p *AsyncProducer) handleSuccesses() { + for v := range p.producer.Successes() { + ctx := context.Background() + for _, header := range v.Headers { + ctx = context.WithValue(ctx, utils.Bs(header.Key), utils.Bs(header.Value)) + } + + key, _ := v.Key.Encode() + val, _ := v.Value.Encode() + app.Logger.Info(ctx, fmt.Sprintf("默认生产者发送消息成功, key: %s, val: %s", utils.Bs(key), utils.Bs(val))) + } +} + +func (p *AsyncProducer) handleErrors() { + for v := range p.producer.Errors() { + ctx := context.Background() + for _, header := range v.Msg.Headers { + ctx = context.WithValue(ctx, utils.Bs(header.Key), utils.Bs(header.Value)) + } + key, _ := v.Msg.Key.Encode() + val, _ := v.Msg.Value.Encode() + app.Logger.Info(ctx, fmt.Sprintf("默认生产者发送消息失败:%v, key: %s, val: %s", v.Err, utils.Bs(key), utils.Bs(val))) + } +} + +var DelayCommon *delay.Producer + +func initCommonProducer() { + DelayCommon = delay.NewRedisDelayQueue(context.Background(), app.Redis.Cache, ckey.DelayCommonKey()).Producer() +} diff --git a/internal/service/queue/producer/pub_test.go b/internal/service/queue/producer/pub_test.go new file mode 100644 index 0000000..f2857d7 --- /dev/null +++ b/internal/service/queue/producer/pub_test.go @@ -0,0 +1,249 @@ +package producer + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/hashid" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/queue/types" + "fmt" + "os" + "sync" + "testing" + "time" + + "github.com/rs/xid" + "gits.branchcn.com/backend/microcode/plugins/kafka" +) + +func conf() { + var filePath = config.FilePath{ + ConfigName: "config-dev", + ConfigType: "yaml", + ConfigPath: os.Args[5] + "/etc", + } + + err := config.LoadConfig(filePath) + if err != nil { + panic(err) + } + + err = app.InitFeiShu() + if err != nil { + panic(err) + } + + app.InitLogger() + + app.InitRedis() + + app.InitNode() + +} + +func TestCampaignLogic(t *testing.T) { + conf() + kafkaConfig := kafka.PluginConfig{ + Brokers: []string{ + "120.79.90.126:9093", + }, + } + var err error + app.Kafka, err = kafka.NewPlugin(kafkaConfig) + if err != nil { + t.Log(err) + return + } + SetUp() + + ctxId := xid.New().String() + //ctxId := "cslhe0rdervo4sb1lhng" + + t.Log(ctxId) + + ctx := context.WithValue(context.Background(), consts.TraceIdKey, ctxId) + + p := NewStatCampaign(ctx) + + for i := 0; i < 1; i++ { + //p.StatCampaign(types.StatCampaignValue{ + // //BehaviorType: utils.Ternary[int32](i%2 == 0, mtype.FissionBehaviorTypeAppOpen, mtype.FissionBehaviorTypeAppInstall), + // //BehaviorType: mtype.FissionBehaviorTypeAppOpen, + // //BehaviorType: mtype.FissionBehaviorTypeAppRegister, + // BehaviorType: mtype.FissionBehaviorTypeAppInstall, + // //BehaviorType: mtype.FissionBehaviorTypeWebFirstOpen, + // //BehaviorType: mtype.FissionBehaviorTypePurchase, + // BehaviorTime: time.Now().Unix(), + // IpAddress: "13.214.120.1" + fmt.Sprintf("%d", i), + // Os: "ios", + // OsVersion: "16.2", + // DeviceModel: "iphone", + // DeviceID: xid.New().String(), + // //DeviceID: "d31tkujdervu1v302u3c", + // //UserID: xid.New().String(), + // //UserID: "zh_123457", + // WebId: "", + // //CampaignID: 3932, + // OwnerID: "123", + // Event: "", + // EventData: nil, + // ProjectID: 554, + // Channel: "", + // FromSrv: false, + // Hid: "d6rnbh6rdj7pn0gu1a1g", + // PurchasesData: &types.PurchaseData{ + // TransactionId: "ffdd33", + // TransactionDesc: "交易描述", + // Amount: 2, + // Currency: "货币单位(如:USD CNY)", + // PurchaseCount: 1, + // ContentItems: []types.PurchaseItem{ + // { + // ProductId: "123", + // ProductName: "产品名称", + // ProductPrice: 2, + // ProductQuantity: 1, + // }, + // }, + // }, + //}) + + //p.StatCampaign(types.StatCampaignValue{ + // //BehaviorType: utils.Ternary[int32](i%2 == 0, mtype.FissionBehaviorTypeAppOpen, mtype.FissionBehaviorTypeAppInstall), + // BehaviorType: mtype.FissionBehaviorTypeAppInstall, + // BehaviorTime: time.Now().Unix(), + // IpAddress: "13.224.212.22" + fmt.Sprintf("%d", i), + // Os: "ios", + // OsVersion: "16.3", + // DeviceModel: "iphone", + // DeviceID: xid.New().String(), + // //UserID: "123456", + // WebId: "", + // CampaignID: 3619, + // OwnerID: "zh_123", + // ProjectID: 143, + // Channel: "", + //}) + + p.StatCampaign(types.StatCampaignValue{ + BehaviorType: mtype.FissionBehaviorTypeCustom, + BehaviorTime: time.Now().Unix(), + IpAddress: "127.268.24." + fmt.Sprintf("%d", i), + Os: "ios", + OsVersion: "16.3", + DeviceModel: "iphone", + //DeviceID: "123123", + //DeviceID: xid.New().String(), + //UserID: xid.New().String(), + UserID: "123", + WebId: "", + //CampaignID: 4376, + //OwnerID: "131", + Event: "product_detait_view", + EventData: []types.EventData{ + { + EventKey: "is_success", + EventVal: "1", + }, + }, + ProjectID: 554, + Channel: "", + FromSrv: false, + //Hid: "d7fgfdmrdj7rdut0hhsg", + //Language: "zh", + //Tags: []string{"lv1", "lv2"}, + }) + } + + time.Sleep(2 * time.Second) +} + +func TestCampaignChildInvite(t *testing.T) { + conf() + kafkaConfig := kafka.PluginConfig{ + Brokers: []string{ + "120.79.90.126:9093", + }, + } + var err error + app.Kafka, err = kafka.NewPlugin(kafkaConfig) + if err != nil { + t.Log(err) + return + } + SetUp() + + ctxId := xid.New().String() + //ctxId := "cslhe0rdervo4sb1lhng" + + t.Log(ctxId) + + ctx := context.WithValue(context.Background(), consts.TraceIdKey, ctxId) + + NewCampaignNotice(ctx).CampaignChildInvite(types.CampaignChildInvite{CampaignId: 4304}) + + time.Sleep(time.Second) +} + +func TestRewardPushPub(t *testing.T) { + conf() + + initCommonProducer() + + RewardPushPub(context.Background(), 1, types.DelayCommonRewardPush{TaskId: 287660046502219776}) + +} + +func TestBiFissionAction(t *testing.T) { + conf() + kafkaConfig := kafka.PluginConfig{ + Brokers: []string{ + "120.79.90.126:9093", + }, + } + var err error + app.Kafka, err = kafka.NewPlugin(kafkaConfig) + if err != nil { + t.Log(err) + return + } + SetUp() + + wg := sync.WaitGroup{} + defer wg.Wait() + ctxId := xid.New().String() + ctx := context.WithValue(context.Background(), consts.TraceIdKey, ctxId) + for i := 0; i < 100; i++ { + for j := 0; j < 1000; j++ { + wg.Add(1) + go func() { + defer wg.Done() + NewFissionBiReceiver(ctx).FissionAction(types.FissionAction{ + ID: hashid.IdBigint(), + CampaignID: 4929, + UserMark: xid.New().String(), + UserMarkSource: 4, + Type: 1, + ActionTime: time.Now().Unix(), + Dimension: mtype.Dimension{ + Platform: "ios", + ChannelId: 287612651835895808, + ParentId: 0, + Lang: "zh", + LevelMark: "", + UserLv: 0, + Country: "", + FirstAction: true, + DimensionOption: mtype.DimensionOption{}, + }, + OtherData: "{\"ip\":\"223.74.148.216\",\"os\":\"macOS\",\"os_version\":\"10.15.7\"}", + }) + }() + } + time.Sleep(time.Millisecond * 200) + } + + time.Sleep(2 * time.Second) +} diff --git a/internal/service/queue/producer/stat_campaign.go b/internal/service/queue/producer/stat_campaign.go new file mode 100644 index 0000000..fa63702 --- /dev/null +++ b/internal/service/queue/producer/stat_campaign.go @@ -0,0 +1,22 @@ +package producer + +import ( + "context" + "joybuywork/internal/service/queue/types" +) + +type StatCampaign struct { + ctx context.Context + topic string +} + +func NewStatCampaign(ctx context.Context) StatCampaign { + return StatCampaign{ + ctx: ctx, + topic: types.StatCampaignTopic, + } +} + +func (p StatCampaign) StatCampaign(data types.StatCampaignValue) { + _ = AP.Produce(p.ctx, p.topic, types.StatCampaignKey, data) +} diff --git a/internal/service/queue/types/campaign_notice.go b/internal/service/queue/types/campaign_notice.go new file mode 100644 index 0000000..15c2933 --- /dev/null +++ b/internal/service/queue/types/campaign_notice.go @@ -0,0 +1,204 @@ +package types + +import ( + "joybuywork/internal/repository/mtype" +) + +// topic campaign-notice +const ( + + // topic名称 + CampaignNoticeTopic = "campaign-notice" + + // 组名称 + CampaignUserGroup = "campaign-user-group" + + // key关键字 + CampaignNoticeKey = "campaign_notice" //活动通知 + CampaignOtherStatKey = "campaign_other_stat" //统计其他区分活动的数据 + CampaignRewardNotifyKey = "campaign_reward_notify" //奖品回调 + CampaignBehaviorKey = "campaign_behavior" //活动行为 + CampaignTargetStatKey = "campaign_target_stat" //达标统计 + CampaignCondStatKey = "campaign_cond_stat" //完成条件统计 + CampaignDiceMapKey = "campaign_dice_map" //大富翁地图 + DownloadKey = "download" //下载 + ValidEventsKey = "valid_events" //有效事件 + ProjectUserKey = "project_user" //项目用户 + CampaignChildInviteKey = "campaign_child_invite" //子活动排行榜结算 + ProjectUserCoinDeductKey = "project_user_coin_deduct" //项目用户积分计算 + CampaignVsSettlementKey = "campaign_vs_settlement" //赛事竞猜结算 + CampaignSettlementRewardKey = "campaign_settlement_reward" //赛事竞猜结算奖励 + GameActionKey = "game_action" //游戏行为类型 +) + +type CampaignNotice struct { + CampaignId int64 `json:"campaign_id"` // 活动id + DeviceId string `json:"device_id"` // 设备id + UserId string `json:"user_id"` // user_id + ParentId string `json:"parent_id"` // 父级user_id + IsInstall bool `json:"is_install"` // 是否为安装事件 + BehaviorTime int64 `json:"behavior_time"` // 行为时间 + NoticeType int64 `json:"notice_type"` // 通知类型(1-打开事件通知,2-安装事件通知,3-注册事件通知,4-自定义事件通知) + NoticeTag string `json:"notice_value,omitempty"` // 通知类型标签 + // 事件触发奖励 + Event string `json:"event,omitempty"` // 事件名称 + EventData []EventData `json:"event_data,omitempty"` // 事件数据 + + ProjectId int64 `json:"project_id"` // 项目id + + Ip string `json:"ip,omitempty"` // ip + Os string `json:"os,omitempty"` // 系统 + OsVersion string `json:"os_version,omitempty"` // 系统版本 + DeviceModel string `json:"device_model,omitempty"` // 设备类型 + + Lang string `json:"lang,omitempty"` // 语种 + ChannelId int64 `json:"channel_id,omitempty"` // 站内渠道id + WebChannelId int64 `json:"web_channel_id,omitempty"` // 站外渠道id + + UserMark string `json:"user_mark,omitempty"` // 用户标识 + + PurchasesData *PurchaseData `json:"purchases_data,omitempty"` // 支付数据 + + UserLv []string `json:"user_lv,omitempty"` // 用户类型 + CustomParam string `json:"custom_param"` // 自定义参数 +} + +type CampaignOtherStat struct { + CampaignId int64 `json:"campaign_id"` // 活动id + Mark string `json:"mark"` // 统计标识 + UserHashId string `json:"user_hash_id"` // 用户hash_id +} + +type CampaignChannel struct { + CampaignId int64 `json:"campaign_id"` // 活动id + ChannelId int64 `json:"channel_id"` // 渠道id + UserMark string `json:"user_mark"` // 用户唯一标识 + CType int8 `json:"c_type"` // 渠道类型(1-站内,2-站外) + BehaviorMark string `json:"behavior_mark"` // 行为标识 +} + +type CampaignRewardNotify struct { + CampaignId int64 `json:"campaign_id"` // 活动id + UserId int64 `json:"user_id"` // 用户id + UserRewardId int64 `json:"user_reward_id"` // 用户领取的奖品记录id +} + +type CampaignBehavior struct { + CampaignId int64 `json:"campaign_id"` // 活动id + BehaviorType int32 `json:"behavior_type"` // 用户行为类型 + BehaviorTime int64 `json:"behavior_time"` // 行为时间 + UserMark string `json:"user_mark"` // 用户标识 + OtherData any `json:"other_data"` // 其他要记录的数据 + MarkId string `json:"mark_id"` // 标识id +} + +type CampaignTargetStat struct { + CampaignId int64 `json:"campaign_id"` // 活动id + UserId int64 `json:"user_id"` // 用户id + CondIds []int64 `json:"cond_ids"` // 完成的条件id + FinishTime int64 `json:"finish_time"` // 完成时间 +} + +type CampaignCondStat struct { + UserId int64 `json:"user_id"` // 用户id + CondId int64 `json:"cond_id"` // 条件id + Total float64 `json:"total"` // 总计值 + BehaviorTime int64 `json:"behavior_time"` // 行为时间 + First bool `json:"first"` // 第一次完成 + // 事件触发奖励 + Event string `json:"event"` // 事件名称 + EventData []EventData `json:"event_data"` // 事件数据 +} + +type CampaignDiceMap struct { + CampaignId int64 `json:"campaign_id"` // 活动id +} + +type Download struct { + TaskId string `json:"task_id"` // 导出任务ID + Mark string `json:"mark"` // 导出内容标识 + Cond []byte `json:"cond"` // 其他塞选数据 +} + +type FissionUserTag struct { + UserId int64 `json:"user_id"` // 用户id + Mark string `json:"mark"` // 标签标识 + Val string `json:"val"` // 标签值 +} + +type CampaignRewardHelp struct { + Mark string `json:"mark"` // 助力标识 + UserMark string `json:"user_mark"` // 用户标识 + HelpUserId int64 `json:"help_user_id"` // 被助力的用户id + CampaignId int64 `json:"campaign_id"` // 活动ID +} + +type ValidEvents struct { + UserId int64 `json:"user_id"` // 完成事件的用户id + NewUser bool `json:"new_user"` // 是否新创建用户 + BehaviorTime int64 `json:"behavior_time"` // 行为时间 + NoticeType int64 `json:"notice_type"` // 通知类型(1-打开事件通知,2-安装事件通知,3-注册事件通知,4-自定义事件通知,5-点击邀请链接事件通知) + + // 事件触发奖励 + Event string `json:"event"` // 事件名称 + EventData []EventData `json:"event_data"` // 事件数据 + EventType int32 `json:"event_type"` // 事件来源 1-自定义推送,2-广告推送 + AdsCondId int64 `json:"ads_cond_id"` // 广告触发到的id + CampaignId int64 `json:"campaign_id"` // 活动id + ParentId int64 `json:"parent_id"` // 上级ID + + // 点击事件数据 + ClickInfo *ValidEventsClickInfo `json:"click_info,omitempty"` //点击链接 +} + +type ValidEventsClickInfo struct { + UserMark string `json:"user_mark"` // 点击邀请链接事件的用户标识 + IpAddress string `json:"ip_address"` // ip + Os string `json:"os"` // 系统 + OsVersion string `json:"os_version"` // 系统版本 + DeviceModel string `json:"device_model"` // 设备类型 + DeviceID string `json:"device_id"` // 设备号 + WebId string `json:"web_id"` // 浏览器id +} + +type ProjectUser struct { + ProjectId int64 `json:"project_id"` // 项目ID + UserId string `json:"user_id"` // 第三方用户ID +} + +type CampaignChildInvite struct { + CampaignId int64 `json:"campaign_id"` // 活动id +} + +type ProjectUserCoinDeduct struct { + Type int32 `json:"type"` + UserId int64 `json:"user_id"` + DeductId int64 `json:"deduct_id,omitempty"` + ExpiredId int64 `json:"expired_id,omitempty"` +} + +type CampaignVsSettlement struct { + ScheduleId int64 `json:"schedule_id"` // 赛事id +} + +type CampaignSettlementReward struct { + SettlementId int64 `json:"settlement_id"` // 结算记录id +} + +const RewardLimitUpKey = "reward_limit_up" + +type RewardLimitUp struct { + CampaignId int64 `json:"campaign_id"` // 活动id + RewardIds []int64 `json:"reward_ids"` // 奖品id集合 +} + +type GameAction struct { + ID int64 `json:"id"` + ProjectId int64 `json:"project_id"` // 项目id + GameId int64 `json:"game_id"` // 游戏id + UserId int64 `json:"user_id"` // 用户id + LinkId int64 `json:"link_id"` // 链接id + Type int32 `json:"type"` // 行为类型 + ActionTime int64 `json:"action_time"` // 行为时间 + Dimension mtype.GameDimension `json:"dimension"` // 维度数据 +} diff --git a/internal/service/queue/types/consts.go b/internal/service/queue/types/consts.go new file mode 100644 index 0000000..521986f --- /dev/null +++ b/internal/service/queue/types/consts.go @@ -0,0 +1,28 @@ +package types + +const ( + NoticeTypeOpen = iota + 1 //打开事件通知 + NoticeTypeInstall //安装事件通知 + NoticeTypeRegister //注册事件通知 + NoticeTypeCustom //自定义事件通知 + NoticeTypeClick //链接点击事件通知 + NoticeTypePay //支付事件 +) + +const ( + NoticeTagWeb = "web" // web事件标签 +) + +// 助力原因 1-完成安装事件,2-完成注册事件,3-完成自定义事件任务,4-打开APP助力,5-点击邀请链接 +const ( + HelpSourceInstall = iota + 1 + HelpSourceRegister + HelpSourceCustom + HelpSourceOpen + HelpSourceClick +) + +const ( + ProjectUserCoinDeductTypeDeduct = iota + 1 // 扣款 + ProjectUserCoinDeductTypeExpired // 过期 +) diff --git a/internal/service/queue/types/delay_comon.go b/internal/service/queue/types/delay_comon.go new file mode 100644 index 0000000..f8b5548 --- /dev/null +++ b/internal/service/queue/types/delay_comon.go @@ -0,0 +1,28 @@ +package types + +const CommonRewardPush = "reward_push" + +type DelayCommonRewardPush struct { + TaskId int64 `json:"task_id"` +} + +const CommonGlobalRewardPush = "global_reward_push" + +type DelayCommonGlobalRewardPush struct { + TaskId int64 `json:"task_id"` +} + +const CommonCoinExpired = "coin_expired" + +type DelayCommonCoinExpired struct { + TaskId int64 `json:"task_id"` +} + +const CommonCheckRewardPush = "check_reward_push" + +type DelayCommonCheckRewardPush struct { + CampaignId int64 `json:"campaign_id"` // 活动id + UserId int64 `json:"user_id"` // 用户id + UserRewardId int64 `json:"user_reward_id"` // 用户领取的奖品记录id + BaseRewardId int64 `json:"base_reward_id"` // 基础奖品id +} diff --git a/internal/service/queue/types/fissionbi_receiver.go b/internal/service/queue/types/fissionbi_receiver.go new file mode 100644 index 0000000..ec6a73c --- /dev/null +++ b/internal/service/queue/types/fissionbi_receiver.go @@ -0,0 +1,41 @@ +package types + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/mtype" +) + +// topic fissionbi-receiver +const ( + FissionBiReceiverTopic = "fissionbi-receiver" + + FbrFissionActionKey = "fission_action" // 用户行为key +) + +type FissionAction struct { + ID int64 `json:"id"` + CampaignID int64 `json:"campaign_id"` // 活动id + UserMark string `json:"user_mark"` // 用户唯一标识 + UserMarkSource int8 `json:"user_mark_source"` // 唯一标识来源 + Type int32 `json:"type"` // 行为类型 + ActionTime int64 `json:"action_time"` // 行为时间 + Dimension mtype.Dimension `json:"dimension"` // 维度数据 + OtherData string `json:"other_data"` // 其他数据 + Timezone []int32 `json:"timezone"` // 支持时区 +} + +type FissionActionOtherData struct { + Ip string `json:"ip,omitempty"` // ip + Event string `json:"event,omitempty"` // 事件名称 + EventData []EventData `json:"event_data,omitempty"` // 事件数据 + Os string `json:"os,omitempty"` // 系统 + OsVersion string `json:"os_version,omitempty"` // 系统版本 + DeviceModel string `json:"device_model,omitempty"` // 设备类型 + Total float64 `json:"total,omitempty"` // 计算的数值 + InvitedId int64 `json:"invited_id,omitempty"` // 被邀请的用户id(fission_user表id) + PurchaseData *PurchaseData `json:"purchase_data,omitempty"` // 支付信息 +} + +func (s *FissionAction) OtherDataStr(data *FissionActionOtherData) { + s.OtherData, _ = jsonm.MarshalToString(data) +} diff --git a/internal/service/queue/types/joybuywork_notify.go b/internal/service/queue/types/joybuywork_notify.go new file mode 100644 index 0000000..ae33d04 --- /dev/null +++ b/internal/service/queue/types/joybuywork_notify.go @@ -0,0 +1,35 @@ +package types + +// topic joybuywork-notify +const ( + DeepworkNotifyTopic = "joybuywork-notify" + + DnCampaignStartKey = "campaign_start" // 活动开始 + DnCampaignEndKey = "campaign_end" // 活动结束 + DnRewardPushStatusKey = "reward_push_status" // 奖品状态推送 +) + +type DnCampaignStart struct { + CampaignId int64 `json:"campaign_id"` + CampaignHashId string `json:"campaign_hash_id"` + Timestamp int64 `json:"timestamp"` +} + +type DnCampaignEnd struct { + CampaignId int64 `json:"campaign_id"` + CampaignHashId string `json:"campaign_hash_id"` + Timestamp int64 `json:"timestamp"` +} + +type DnRewardPushStatus struct { + Source string `json:"source"` // 来源 + SourceId int64 `json:"source_id"` // 来源id + SourceSecondId int64 `json:"source_second_id"` // 来源二级id + RelateId int64 `json:"relate_id"` // 关联id + TaskId string `json:"task_id"` // 回调任务id + Status int32 `json:"status"` // 状态(1-推送中,2-完成,3-失败) + FailType string `json:"fail_type"` // 失败原因标识 + FailMsg string `json:"fail_msg"` // 具体失败原因 + RewardVal string `json:"reward_val"` // 成功后返回的数据 + RewardType int32 `json:"reward_type"` // 奖品类型(1-活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励,7-子活动奖励,8-兑换奖励) +} diff --git a/internal/service/queue/types/oplatform_other.go b/internal/service/queue/types/oplatform_other.go new file mode 100644 index 0000000..6b2ea01 --- /dev/null +++ b/internal/service/queue/types/oplatform_other.go @@ -0,0 +1,71 @@ +package types + +// topic oplatform-other +const ( + OplatformOtherTopic = "oplatform-other" + + OpoCampaignHelpOkKey = "campaign_help_ok" // 活动助力成功通知 + OpoCampaignCondOkKey = "campaign_cond_ok" // 活动任务成功通知 + OpoCampaignDeleteKey = "campaign_delete" // 活动删除通知 + OpoCampaignPushKey = "campaign_push" // 活动 +) + +type OpoCampaignHelpOk struct { + ProjectId int64 `json:"project_id"` // 项目id + CampaignHashId string `json:"campaign_hash_id"` // 活动hash_id + CampaignTitle string `json:"campaign_title"` // 活动标题 + PageTitle string `json:"page_title"` // 活动页面标题 + HelperUserId string `json:"helper_user_id"` // 助力者用户id + BeHelperUserId string `json:"be_helper_user_id"` // 被助力者用户id + HelperDeviceId string `json:"helper_device_id"` // 助力者设备id + BeHelperDeviceId string `json:"be_helper_device_id"` // 被助力者设备id + Source int32 `json:"source"` // 助力原因 1-完成安装事件,2-完成注册事件,3-完成自定义事件任务,4-打开事件,5-点击邀请链接事件 + KvData []*KV `json:"kv_data"` // 指定任务的kv值 +} + +type KV struct { + Event string `json:"event" ` //事件 + Key string `json:"key" ` //事件key + Value string `json:"value" ` //事件key对应的值 +} + +type OpoCampaignCondOk struct { + ProjectId int64 `json:"project_id"` // 项目id + CampaignHashId string `json:"campaign_hash_id"` // 活动hash_id + CampaignTitle string `json:"campaign_title"` // 活动标题 + UserId string `json:"user_id"` // 完成任务的用户id + DeviceId string `json:"device_id"` // 完成任务的设备id + TaskTitle string `json:"task_title"` // 任务标题 + PageTitle string `json:"page_title"` // 活动页面标题 + FissionIcon string `json:"fission_icon"` // 玩法icon + CampaignUrl string `json:"campaign_url"` // 活动地址 + MarkDesc string `json:"mark_desc"` // 触发类型默认描述 + Event string `json:"event"` // 事件 + EventKey string `json:"event_key"` // 事件key + LotteryNum int32 `json:"lottery_num"` // 抽奖次数 + DayLimit int32 `json:"day_limit"` // 每日上限 +} + +type OpoCampaignDelete struct { + ProjectId int64 `json:"project_id"` // 项目id + CampaignHashId string `json:"campaign_hash_id"` // 活动hash_id +} + +type OpoCampaignPush struct { + ProjectId int64 `json:"project_id"` // 项目id + FissionId int64 `json:"fission_id"` // 玩法id + CampaignHashId string `json:"campaign_hash_id"` // 活动hash_id + CampaignTitle string `json:"campaign_title"` // 活动标题 + CampaignUrl string `json:"campaign_url"` // 活动地址 + PageTitle string `json:"page_title"` // 活动页面标题 + FissionIcon string `json:"fission_icon"` // 玩法icon + UserId string `json:"user_id"` // 用户id + Mark string `json:"mark"` // 触发类型 + MarkCode string `json:"mark_code"` // 触发编码 + CodeVal string `json:"code_val"` // 编码值 + MarkDesc string `json:"mark_desc"` // 触发类型默认描述 + PushTime int64 `json:"push_time"` // 推送时间 + TaskExpireTime int64 `json:"task_expire_time"` // 用户任务过期时间 + InviteNum int64 `json:"invite_num"` // 有效邀请用户数 + TargetNum int64 `json:"target_num"` // 完成任务需要的有效邀请人数 +} diff --git a/internal/service/queue/types/stat_campaign.go b/internal/service/queue/types/stat_campaign.go new file mode 100644 index 0000000..b56750a --- /dev/null +++ b/internal/service/queue/types/stat_campaign.go @@ -0,0 +1,64 @@ +package types + +// topic stat-campaign +const ( + StatCampaignTopic = "stat-campaign" + StatCampaignGroup = "stat-campaign-group" + StatCampaignKey = "stat_campaign" +) + +type StatCampaignValue struct { + BehaviorType int32 `json:"behavior_type"` // 用户行为类型 + // 行为 + BehaviorTime int64 `json:"behavior_time"` // 行为时间 + IpAddress string `json:"ip_address"` // ip + Os string `json:"os"` // 系统 + OsVersion string `json:"os_version"` // 系统版本 + DeviceModel string `json:"device_model"` // 设备类型 + DeviceID string `json:"device_id"` // 设备号 + UserID string `json:"user_id"` // user_id + WebId string `json:"web_id"` // 浏览器id + // 活动相关 + CampaignID int64 `json:"campaign_id"` // 活动id + OwnerID string `json:"owner_id"` // 链接所属用户/上级用户的user_id + + // 事件触发奖励 + Event string `json:"event"` // 事件名称 + EventData []EventData `json:"event_data"` // 事件数据 + + ProjectID int64 `json:"project_id"` // 项目id + + Channel string `json:"channel"` // 渠道 + + FromSrv bool `json:"from_srv"` //是否来自服务端 + + Hid string `json:"hid,omitempty"` //活动HashId + + PurchasesData *PurchaseData `json:"purchases_data"` // 支付数据 + + Language string `json:"language"` // 语言 + Tags []string `json:"tags"` // 标签 + CustomParam string `json:"custom_param"` // 自定义参数 +} + +type EventData struct { + EventKey string `json:"event_key"` // event_key + EventVal string `json:"event_val"` // event_val +} + +type PurchaseData struct { + TransactionId string `json:"transaction_id"` // 交易id + TransactionDesc string `json:"transaction_desc"` // 交易描述 + Amount int64 `json:"amount"` // 总交易金额(单位:分 如1元则填100) + Currency string `json:"currency"` // 货币单位(如:USD CNY) + PurchaseCount int64 `json:"purchase_count"` // 支付次数,默认为:1 + ContentItems []PurchaseItem `json:"content_items"` // 交易内容 +} + +type PurchaseItem struct { + PayTime string `json:"pay_time"` // 支付时间 + ProductId string `json:"product_id"` // 商品id + ProductName string `json:"product_name"` // 商品名称 + ProductPrice int64 `json:"product_price"` // 商品单价(单位:分 如1元则填100) + ProductQuantity int64 `json:"product_quantity"` // 商品数量 +} diff --git a/internal/service/script/boot.go b/internal/service/script/boot.go new file mode 100644 index 0000000..2e1b12d --- /dev/null +++ b/internal/service/script/boot.go @@ -0,0 +1,464 @@ +package script + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + pb "joybuywork/proto/go_proto/w_script" + "fmt" + "time" + + "github.com/rs/xid" + bi_fission_actionpb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_fission_action" + "gorm.io/gen" +) + +type fixData struct { + ctx context.Context + taskId string + CampaignHashId string `json:"campaign_hash_id"` + Date string `json:"date"` +} + +func (s fixData) fixData() { + d := dao.Q.Begin() + var err error + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("demo逻辑问题%v", err)) + d.Rollback() + return + } + d.Commit() + }() + + app.FeishuNormalSend("开始同步数据") + + m := dao.FissionTempGroup + tm := dao.FissionTemp + list, err := m.WithContext(s.ctx).Distinct(m.ID).Join(tm, tm.GroupID.EqCol(m.ID)). + Where(m.IsDel.Eq(0), tm.IsDel.Eq(0), tm.ID.IsNotNull()).Find() + if err != nil { + return + } + + var addTemp []*model.FissionTemp + var addTempImage []*model.FissionTempImage + im := dao.FissionTempImage + for _, v := range list { + one := withdefault.FissionTemp(&model.FissionTemp{ + FissionID: v.FissionID, + GroupID: v.ID, + LangType: mtype.FissionLangTypeNl, + TextType: mtype.FissionTempTextTypeEn, + }) + addTemp = append(addTemp, one) + + enT, _ := tm.WithContext(s.ctx).Where(tm.GroupID.Eq(v.ID), tm.LangType.Eq(mtype.FissionLangTypeEn)).First() + if enT == nil { + continue + } + + imgs, _ := im.WithContext(s.ctx).Where(im.TempID.Eq(enT.ID)).Find() + for _, img := range imgs { + addTempImage = append(addTempImage, withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: one.ID, + Mark: img.Mark, + Val: img.Val, + Desc: img.Desc, + })) + } + } + + if len(addTemp) > 0 { + err = d.FissionTemp.WithContext(s.ctx).Create(addTemp...) + if err != nil { + return + } + } + + if len(addTempImage) > 0 { + err = d.FissionTempImage.WithContext(s.ctx).Create(addTempImage...) + if err != nil { + return + } + } + + fmt.Println(len(list)) + + app.FeishuNormalSend("ok") + + return +} + +type fixData2 struct { + ctx context.Context + taskId string + CampaignHashId string `json:"campaign_hash_id"` +} + +func (s fixData2) fixData2() { + d := dao.Q.Begin() + var err error + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("demo逻辑问题%v", err)) + d.Rollback() + return + } + d.Commit() + }() + + app.FeishuNormalSend("开始") + + m := dao.FissionCampaign + + t, _ := time.ParseInLocation(time.DateOnly, "2026-02-04", time.Local) + list, err := m.WithContext(s.ctx).Where(m.EndTime.Gt(t.Unix())).Find() + if err != nil { + return + } + + userM := dao.FissionUser + + for _, v := range list { + + userSm := dao.FissionUser.SubTable(v.ID) + + var users []*model.FissionUser + _ = userSm.WithContext(s.ctx).Where(userSm.CampaignID.Eq(v.ID)).FindInBatches(&users, 200, func(tx gen.Dao, batch int) error { + var userMark []string + for _, user := range users { + userMark = append(userMark, fmt.Sprint(user.ID)) + } + + resI, _ := app.NewFissionBiFissionAction().Find(s.ctx, &bi_fission_actionpb.FindReq{ + CampaignId: v.ID, + Type: mtype.FissionActionTypeAppInstall, + UserMarkSource: mtype.FissionActionUserMarkSourceFissionUser, + UserMark: userMark, + }) + + var userInstall = make(map[string]int64, len(users)) + for _, action := range resI.GetList() { + if tt, ok := userInstall[action.GetUserMark()]; !ok || tt > action.GetActionTime() { + userInstall[action.GetUserMark()] = action.GetActionTime() + } + } + + resR, _ := app.NewFissionBiFissionAction().Find(s.ctx, &bi_fission_actionpb.FindReq{ + CampaignId: v.ID, + Type: mtype.FissionActionTypeAppRegister, + UserMarkSource: mtype.FissionActionUserMarkSourceFissionUser, + UserMark: userMark, + }) + + var userRegister = make(map[string]int64, len(users)) + for _, action := range resR.GetList() { + if tt, ok := userRegister[action.GetUserMark()]; !ok || tt > action.GetActionTime() { + userRegister[action.GetUserMark()] = action.GetActionTime() + } + } + + for _, user := range users { + var installAt int64 + if at, ok := userInstall[fmt.Sprint(user.ID)]; ok { + installAt = at + } + + var registerAt int64 + if at, ok := userRegister[fmt.Sprint(user.ID)]; ok { + registerAt = at + } + + _, _ = userM.WithContext(s.ctx).Where(userM.ID.Eq(user.ID)).UpdateSimple(userM.InstallAt.Value(installAt), userM.RegisterAt.Value(registerAt)) + _, _ = userSm.WithContext(s.ctx).Where(userSm.ID.Eq(user.ID)).UpdateSimple(userSm.InstallAt.Value(installAt), userSm.RegisterAt.Value(registerAt)) + + _ = cache.NewFissionUser(s.ctx, user.CampaignID).Clear(user) + } + + return nil + }) + + } + + app.FeishuNormalSend("完成") + + return +} + +func Boot(req *pb.BootReq) (taskId string) { + taskId = xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + + switch req.Scene { + case "clearCpn": //清楚表缓存 + b := clearCpn{ctx: ctx} + + jsonm.StrUnmarshal(req.JsonData, &b) + + app.GoSafe(b.clearCpn, fmt.Sprintf("脚本任务 clearCpn:%s", taskId)) + return + case "getCache": //获取缓存值 + b := getCache{ctx: ctx} + + jsonm.StrUnmarshal(req.JsonData, &b) + + app.GoSafe(b.getCache, fmt.Sprintf("脚本任务 getCache:%s", taskId)) + return + case "printAllLog": //全量日志 + b := printAllLog{ctx: ctx} + + jsonm.StrUnmarshal(req.JsonData, &b) + + app.GoSafe(b.printAllLog, fmt.Sprintf("脚本任务 printAllLog:%s", taskId)) + return + case "collectSlowLog": //收集慢业务 + b := collectSlowLog{ctx: ctx} + + jsonm.StrUnmarshal(req.JsonData, &b) + + app.GoSafe(b.collectSlowLog, fmt.Sprintf("脚本任务 collectSlowLog:%s", taskId)) + return + case "clearStock": //清楚活动库存缓存 + b := clearStock{ctx: ctx, taskId: taskId} + + jsonm.StrUnmarshal(req.JsonData, &b) + + app.GoSafe(b.clearStock, fmt.Sprintf("脚本任务 clearStock:%s", taskId)) + return + case "clearCache": //清楚表缓存 + b := clearCache{ctx: ctx} + + jsonm.StrUnmarshal(req.JsonData, &b) + + app.GoSafe(b.clearCache, fmt.Sprintf("脚本任务 clearCache:%s", taskId)) + return + case "lang": + b := lang{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.lang, fmt.Sprintf("脚本任务 lang:%s", taskId)) + case "langModule": + + b := langModule{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.langModule, fmt.Sprintf("脚本任务 langModule:%s", taskId)) + case "langTextMark": + + b := langTextMark{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.langTextMark, fmt.Sprintf("脚本任务 langTextMark:%s", taskId)) + case "checkLang": + + b := checkLang{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.checkLang, fmt.Sprintf("脚本任务 checkLang:%s", taskId)) + case "fillLang": + + b := fillLang{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.fillLang, fmt.Sprintf("脚本任务 fillLang:%s", taskId)) + case "pushWaitReward": + + b := pushWaitReward{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.pushWaitReward, fmt.Sprintf("脚本任务 pushWaitReward:%s", taskId)) + case "openAd": + b := openAd{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openAd, fmt.Sprintf("脚本任务 openAd:%s", taskId)) + case "openPushLadder": + b := openPushLadder{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openPushLadder, fmt.Sprintf("脚本任务 openPushLadder:%s", taskId)) + case "openCloseCopyShare": + b := openCloseCopyShare{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openCloseCopyShare, fmt.Sprintf("脚本任务 openCloseCopyShare:%s", taskId)) + case "openCert": + b := openCert{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openCert, fmt.Sprintf("脚本任务 openCert:%s", taskId)) + case "resetAdsInit": + b := resetAdsInit{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.resetAdsInit, fmt.Sprintf("脚本任务 resetAdsInit:%s", taskId)) + case "fixData": + b := fixData{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.fixData, fmt.Sprintf("脚本任务 fixData:%s", taskId)) + case "fixData2": + b := fixData2{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.fixData2, fmt.Sprintf("脚本任务 fixData2:%s", taskId)) + case "openTest": + b := openTest{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openTest, fmt.Sprintf("脚本任务 openTest:%s", taskId)) + case "setLangParts": + b := setLangParts{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.setLangParts, fmt.Sprintf("脚本任务 setLangParts:%s", taskId)) + case "taskCenterLang": + b := taskCenterLang{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.taskCenterLang, fmt.Sprintf("脚本任务 taskCenterLang:%s", taskId)) + case "openLvApi": + b := openLvApi{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openLvApi, fmt.Sprintf("脚本任务 openLvApi:%s", taskId)) + + case "openFissionTemp": + b := openFissionTemp{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.openFissionTemp, fmt.Sprintf("脚本任务 openFissionTemp:%s", taskId)) + case "statCampaign": + b := statCampaign{ + ctx: ctx, + taskId: taskId, + } + + jsonm.StrUnmarshal(req.JsonData, &b) + app.GoSafe(b.statCampaign, fmt.Sprintf("脚本任务 statCampaign:%s", taskId)) + default: + app.FeishuNormalSend("你设置的脚本场景不存在[%s]", req.GetScene()) + app.Logger.Warn(ctx, fmt.Sprintf("not done scene: %s, data: %s", req.GetScene(), req.GetJsonData())) + } + return +} + +type demo struct { + ctx context.Context + taskId string +} + +func (s demo) demo() { + d := dao.Q.Begin() + var err error + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("demo逻辑问题%v", err)) + d.Rollback() + return + } + d.Commit() + }() + + gm := dao.FissionTempGroup + group, err := gm.WithContext(s.ctx).Where(gm.FissionID.Eq(consts.IdAdsWheel), gm.Mark.Eq("ads_wheel_orange")).Take() + if err != nil { + return + } + + if group == nil { + return + } + + tm := dao.FissionTemp + list, err := tm.WithContext(s.ctx).Where(tm.GroupID.Eq(group.ID)).Find() + if err != nil { + return + } + + var add []*model.FissionTempImage + for _, v := range list { + add = append(add, withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: v.ID, + Mark: "main", + Val: fmt.Sprintf("ftg/ads_wheel_orange/main_%s.png", mtype.FissionLangTypeToMark[v.LangType]), + Desc: "活动主图", + }), withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: v.ID, + Mark: "windows_congrats", + Val: fmt.Sprintf("ftg/ads_wheel_orange/windows_congrats_%s.png", mtype.FissionLangTypeToMark[v.LangType]), + Desc: "弹窗-中奖标题文案", + })) + } + + if len(add) > 0 { + err = d.FissionTempImage.WithContext(s.ctx).Create(add...) + if err != nil { + return + } + } + return +} diff --git a/internal/service/script/forever.go b/internal/service/script/forever.go new file mode 100644 index 0000000..6e4ad3b --- /dev/null +++ b/internal/service/script/forever.go @@ -0,0 +1,1268 @@ +package script + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/plugins/printer" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "encoding/json" + "fmt" + "os" + "strings" + "time" + + "github.com/aliyun/aliyun-oss-go-sdk/oss" + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" +) + +type clearCache struct { + ctx context.Context + Table string `json:"table"` +} + +// 清楚对应的数据表缓存 +func (c clearCache) clearCache() { + var table = strings.Split(c.Table, ",") + + for _, v := range table { + + var mkey string + switch v { + case model.TableNameFissionCampaign: + cc := cache.NewCampaign(c.ctx) + + mkey = cc.Cache.Prefix() + + case model.TableNameFissionCampaignConfig: + cc := cache.NewCampaignConfig(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameFissionCampaignStyle: + cc := cache.NewCampaignStyle(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameFissionCampaignCash: + cc := cache.NewCampaignCash(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameUser: + cc := cache.NewUser(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameProject: + cc := cache.NewProject(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameFissionUser: + cc := cache.NewFissionUser(c.ctx, 0) + + mkey = cc.Cache.Prefix() + case model.TableNameReward: + cc := cache.NewReward(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameFissionWebUser: + cc := cache.NewReward(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameFissionTemp: + cc := cache.NewFissionTemp(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameLibraryQaGroup: + cc := cache.NewLibraryQaGroup(c.ctx) + + mkey = cc.Cache.Prefix() + case model.TableNameFissionTempGroup: + cc := cache.NewFissionTempGroup(c.ctx) + + list, _ := dao.FissionTempGroup.WithContext(c.ctx).Find() + _ = cc.Clear(list...) + + return + } + + if mkey == "" { + continue + } + + app.FeishuNormalSend("[%s]开始处理缓存数据", v) + + var idx int + var cursor uint64 + var err error + var keys []string + for { + + keys, cursor, err = app.Redis.Cache.Scan(c.ctx, cursor, fmt.Sprintf("%s:*", mkey), 10000).Result() + if err != nil { + return + } + + app.Redis.Cache.Del(c.ctx, keys...) + + idx += len(keys) + + if cursor == 0 { + break + } + } + app.FeishuNormalSend("[%s]删除了%d个缓存", v, idx) + } + +} + +type lang struct { + ctx context.Context + taskId string +} + +// 把json文件里面的语言数据写到表里面 +func (s lang) lang() { + dir, _ := os.Getwd() + + var path string + + if consts.RunTest { + path = fmt.Sprintf("../../../asset/campaign/lang") + } else { + path = fmt.Sprintf("%s/asset/campaign/lang", dir) + } + + var err error + tx := dao.Q.Begin() + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("语言包处理有异常:%v", err)) + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + entrys, err := os.ReadDir(path) + if err != nil { + return + } + + m := tx.Lang + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var ddd = make(map[string]string) + var b []byte + b, err = os.ReadFile(path + "/" + entry.Name()) + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + var list []*model.Lang + list, err = m.WithContext(s.ctx).Where(m.Mark.Eq(mark)).Find() + if err != nil { + return + } + + var oldMap = make(map[string]*model.Lang) + for _, v := range list { + oldMap[v.LangMark] = v + } + + var add []*model.Lang + for mk, text := range ddd { + + for { + if strings.HasSuffix(text, "_") { + text = strings.TrimSuffix(text, "_") + continue + } + break + } + + l, ok1 := oldMap[mk] + if !ok1 { + add = append(add, withdefault.Lang(&model.Lang{ + Mark: mark, + LangMark: mk, + LangText: text, + })) + + continue + } + if l.LangText != text { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(l.ID)).UpdateSimple(m.LangText.Value(text)) + if err != nil { + return + } + } + } + + if len(add) > 0 { + err = m.WithContext(s.ctx).Create(add...) + if err != nil { + return + } + } + + } + +} + +type langModule struct { + ctx context.Context + taskId string +} + +func (s langModule) langModule() { + dir, _ := os.Getwd() + + var path string + + if consts.RunTest { + path = fmt.Sprintf("../../../asset/campaign") + } else { + path = fmt.Sprintf("%s/asset/campaign", dir) + } + + var err error + tx := dao.Q.Begin() + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("语言包处理有异常:%v", err)) + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + m := tx.FissionLangModule + + type parts struct { + Parts any `json:"parts"` + Desc string `json:"desc"` + } + + var ddd = make(map[string]*parts) + b, err := os.ReadFile(path + "/fission_lang.json") + if err != nil { + return + } + + _ = json.Unmarshal(b, &ddd) + + list, err := m.WithContext(s.ctx).Find() + if err != nil { + return + } + + var old = make(map[string]*model.FissionLangModule) + for _, v := range list { + old[v.Mark] = v + } + + var add []*model.FissionLangModule + for mark, v := range ddd { + ps, _ := jsonm.MarshalToString(v.Parts) + module, ok := old[mark] + if !ok { + add = append(add, withdefault.FissionLangModule(&model.FissionLangModule{ + Mark: mark, + Desc: v.Desc, + Parts: ps, + })) + continue + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(module.ID)).UpdateSimple(m.Desc.Value(v.Desc), m.Parts.Value(ps)) + if err != nil { + return + } + } + + if len(add) > 0 { + err = m.WithContext(s.ctx).Create(add...) + if err != nil { + return + } + } + +} + +type langTextMark struct { + ctx context.Context + taskId string +} + +// 语言文案标识,用中文来做文案标识 +func (s langTextMark) langTextMark() { + dir, _ := os.Getwd() + + var path string + if consts.RunTest { + path = fmt.Sprintf("../../../asset/campaign/lang") + } else { + path = fmt.Sprintf("%s/asset/campaign/lang", dir) + } + + var err error + tx := dao.Q.Begin() + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("语言包处理有异常:%v", err)) + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + b, err := os.ReadFile(path + "/zh.json") + if err != nil { + return + } + + m := tx.LangTextMark + + var ddd = make(map[string]string) + _ = json.Unmarshal(b, &ddd) + + var list []*model.LangTextMark + list, err = m.WithContext(s.ctx).Find() + if err != nil { + return + } + + var lm = make(map[string]*model.LangTextMark) + for _, v := range list { + lm[v.Mark] = v + } + + var add []*model.LangTextMark + for mark, text := range ddd { + ltm, ok := lm[mark] + if !ok { + add = append(add, withdefault.LangTextMark(&model.LangTextMark{ + Mark: mark, + Text: text, + })) + continue + } + + if ltm.Text != text { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(ltm.ID)).UpdateSimple(m.Text.Value(text)) + if err != nil { + return + } + } + } + + if len(add) > 0 { + err = m.WithContext(s.ctx).Create(add...) + if err != nil { + return + } + } + +} + +type checkLang struct { + ctx context.Context + taskId string +} + +func (s checkLang) checkLang() { + path := fmt.Sprintf("../../../asset/campaign/lang") + b, err := os.ReadFile(path + "/zh.json") + if err != nil { + return + } + + var ddd = make(map[string]string) + _ = json.Unmarshal(b, &ddd) + + entrys, err := os.ReadDir(path) + if err != nil { + return + } + + for _, entry := range entrys { + if !strings.HasSuffix(entry.Name(), ".json") { + continue + } + mark, _ := strings.CutSuffix(entry.Name(), ".json") + + _, ok := mtype.MarkToLangType[mark] + if !ok { + continue + } + + var c []byte + c, err = os.ReadFile(path + "/" + entry.Name()) + if err != nil { + return + } + + var fff = make(map[string]string) + _ = json.Unmarshal(c, &fff) + + for k := range fff { + if _, ok1 := ddd[k]; !ok1 { + fmt.Printf("[%s]文件的[%s]不存在于zh\n", entry.Name(), k) + } + } + + for k := range ddd { + if _, ok1 := fff[k]; !ok1 { + fmt.Printf("[%s]不存在于[%s]\n", k, entry.Name()) + } + } + } + +} + +type fillLang struct { + ctx context.Context + taskId string +} + +func (s fillLang) fillLang() { + + var lts = []int8{ + mtype.FissionLangTypeZh, + mtype.FissionLangTypeEn, + mtype.FissionLangTypeRu, + mtype.FissionLangTypeFr, + mtype.FissionLangTypePt, + mtype.FissionLangTypeJa, + mtype.FissionLangTypeDe, + mtype.FissionLangTypeEs, + mtype.FissionLangTypeId, + mtype.FissionLangTypeIt, + mtype.FissionLangTypeTr, + mtype.FissionLangTypeAr, + mtype.FissionLangTypeKo, + mtype.FissionLangTypeTh, + } + + m := dao.FissionTempGroup + list, err := m.WithContext(s.ctx).Find() + + tx := dao.Q.Begin() + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("语言包处理有异常:%v", err)) + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + tempM := tx.FissionTemp + imgM := tx.FissionTempImage + for _, v := range list { + var tempList []*model.FissionTemp + tempList, err = tempM.WithContext(s.ctx).Where(tempM.GroupID.Eq(v.ID), tempM.LangType.In(lts...)).Find() + if err != nil { + return + } + + var old = make(map[int8]*model.FissionTemp) + var ch bool + for _, temp := range tempList { + if temp.LangType == mtype.FissionLangTypeZh { + ch = true + } + old[temp.LangType] = temp + } + + if len(tempList) == 0 || !ch { + continue + } + + var add []*model.FissionTemp + for _, lt := range lts { + if _, ok := old[lt]; ok { + continue + } + + one := withdefault.FissionTemp(&model.FissionTemp{ + FissionID: v.FissionID, + GroupID: v.ID, + LangType: lt, + TextType: mtype.FissionLangTypeTextType[lt], + }) + + add = append(add, one) + } + + if len(add) == 0 { + continue + } + + err = tempM.WithContext(s.ctx).Create(add...) + if err != nil { + return + } + var images []*model.FissionTempImage + enTemp, ok := old[mtype.FissionLangTypeEn] + if ok { + var useImg []*model.FissionTempImage + useImg, err = dao.FissionTempImage.WithContext(s.ctx).Where(dao.FissionTempImage.TempID.Eq(enTemp.ID)).Find() + if err != nil { + return + } + for _, temp := range add { + for _, image := range useImg { + images = append(images, withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: temp.ID, + Mark: image.Mark, + Val: image.Val, + Desc: image.Desc, + })) + } + } + } else { + for _, temp := range add { + images = append(images, withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: temp.ID, + Mark: "main", + Val: fmt.Sprintf("ftg/%s/main_en.png", v.Mark), + Desc: "活动主图", + }), withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: temp.ID, + Mark: "wechat", + Val: fmt.Sprintf("ftg/%s/main_en.png", v.Mark), + Desc: "微信引导图", + }), withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: temp.ID, + Mark: "wechat_bg", + Val: fmt.Sprintf("ftg/%s/main_en.png", v.Mark), + Desc: "微信引导图背景", + }), withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: temp.ID, + Mark: "download", + Val: fmt.Sprintf("ftg/%s/main_en.png", v.Mark), + Desc: "下载引导图", + })) + + } + } + + if len(images) > 0 { + err = imgM.WithContext(s.ctx).Create(images...) + if err != nil { + return + } + } + } +} + +type openAd struct { + ctx context.Context + taskId string + ProjectId int64 `json:"project_id"` + ProjectHashId string `json:"project_hash_id"` + GaShowId string `json:"ga_show_id"` + GaEmbedId string `json:"ga_embed_id"` + GaDoubleId string `json:"ga_double_id"` + Prod bool `json:"prod"` +} + +func (s openAd) openAd() { + project, err := finder.Project(s.ctx, s.ProjectId, s.ProjectHashId) + if err != nil { + return + } + + if project == nil { + app.FeishuNormalSend(fmt.Sprintf("[%d_%s] 找不到对应的项目", s.ProjectId, s.ProjectHashId)) + return + } + + ads, err := cache.NewProjectAd(s.ctx).FindByProjectId(project.ID) + if err != nil { + return + } + + showId := utils.Ternary[string](s.Prod, s.GaShowId, "6366208850") + embedId := utils.Ternary[string](s.Prod, s.GaEmbedId, "8800800505") + doubleId := utils.Ternary[string](s.Prod, s.GaDoubleId, "6174637163") + status := utils.Ternary[int8](s.Prod, mtype.ProjectAdStatusProd, mtype.ProjectAdStatusTest) + + if ads == nil { + ads = withdefault.ProjectAd(&model.ProjectAd{ + ProjectID: project.ID, + OpenAd: mtype.Yes, + CampaignAd: mtype.Yes, + GaShowID: showId, + GaEmbedID: embedId, + GaDoubleID: doubleId, + AdStatus: status, + }) + + err = dao.ProjectAd.WithContext(s.ctx).Create(ads) + if err != nil { + return + } + + } else { + m := dao.ProjectAd + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(ads.ID)).UpdateSimple( + m.GaShowID.Value(showId), + m.GaEmbedID.Value(embedId), + m.GaDoubleID.Value(doubleId), + m.AdStatus.Value(status), + ) + + if err != nil { + return + } + _ = cache.NewProjectAd(s.ctx).Clear(ads) + } + + app.FeishuNormalSend(fmt.Sprintf( + "[%d_%s]配置广告成功, 谷歌展示广告id:%s, 谷歌内嵌广告id:%s,谷歌多重广告id:%s,状态:%d", + s.ProjectId, + s.ProjectHashId, + showId, + embedId, + doubleId, + status, + )) + +} + +type openCloseCopyShare struct { + ctx context.Context + taskId string + ProjectId int64 `json:"project_id"` + ProjectHashId string `json:"project_hash_id"` + Open int8 `json:"open"` +} + +func (s openCloseCopyShare) openCloseCopyShare() { + project, err := finder.Project(s.ctx, s.ProjectId, s.ProjectHashId) + if err != nil { + return + } + + if project == nil { + app.FeishuNormalSend(fmt.Sprintf("[%d_%s] 找不到对应的项目", s.ProjectId, s.ProjectHashId)) + return + } + + m := dao.Project + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(project.ID)).UpdateSimple(m.CloseCopyShare.Value(s.Open)) + if err != nil { + return + } + + _ = cache.NewProject(s.ctx).Clear(project) + app.Redis.Cache.Del(s.ctx, + fmt.Sprintf("certified:project:project_show_id:%d", project.ID), + fmt.Sprintf("certified:project:project_show_hash:%s", project.HashID), + ) + app.FeishuNormalSend(fmt.Sprintf("[%d_%s]项目关闭社媒状态修改为[%s]", s.ProjectId, s.ProjectHashId, utils.Ternary(s.Open == mtype.Yes, "开启", "关闭"))) + +} + +type openPushLadder struct { + ctx context.Context + taskId string + ProjectId int64 `json:"project_id"` + ProjectHashId string `json:"project_hash_id"` + Open int8 `json:"open"` +} + +func (s openPushLadder) openPushLadder() { + project, err := finder.Project(s.ctx, s.ProjectId, s.ProjectHashId) + if err != nil { + return + } + + if project == nil { + app.FeishuNormalSend(fmt.Sprintf("[%d_%s] 找不到对应的项目", s.ProjectId, s.ProjectHashId)) + return + } + + m := dao.Project + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(project.ID)).UpdateSimple(m.PushLadder.Value(s.Open)) + if err != nil { + return + } + + _ = cache.NewProject(s.ctx).Clear(project) + app.Redis.Cache.Del(s.ctx, + fmt.Sprintf("certified:project:project_show_id:%d", project.ID), + fmt.Sprintf("certified:project:project_show_hash:%s", project.HashID), + ) + app.FeishuNormalSend(fmt.Sprintf("[%d_%s]项目代理推送状态修改为[%s]", s.ProjectId, s.ProjectHashId, utils.Ternary(s.Open == mtype.Yes, "开启", "关闭"))) + +} + +type openCert struct { + ctx context.Context + taskId string + ProjectId int64 `json:"project_id"` + ProjectHashId string `json:"project_hash_id"` + Open int8 `json:"open"` +} + +func (s openCert) openCert() { + project, err := finder.Project(s.ctx, s.ProjectId, s.ProjectHashId) + if err != nil { + return + } + + if project == nil { + app.FeishuNormalSend(fmt.Sprintf("[%d_%s] 找不到对应的项目", s.ProjectId, s.ProjectHashId)) + return + } + + m := dao.Project + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(project.ID)).UpdateSimple(m.FissionCertType.Value(s.Open)) + if err != nil { + return + } + + _ = cache.NewProject(s.ctx).Clear(project) + app.Redis.Cache.Del(s.ctx, + fmt.Sprintf("certified:project:project_show_id:%d", project.ID), + fmt.Sprintf("certified:project:project_show_hash:%s", project.HashID), + ) + app.FeishuNormalSend(fmt.Sprintf("[%d_%s]项目认证状态修改为[%s]", s.ProjectId, s.ProjectHashId, utils.Ternary(s.Open == mtype.Yes, "开启", "关闭"))) + +} + +// 奖品库存缓存清理 +type clearStock struct { + ctx context.Context + taskId string + CampaignId int64 `json:"campaign_id"` +} + +func (s clearStock) clearStock() { + var err error + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("fixData逻辑问题%v", err)) + return + } + }() + cpn, err := finder.Campaign(s.ctx, s.CampaignId) + if err != nil || cpn == nil { + return + } + + m := dao.FissionCampaignReward + + list, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return + } + + var ids []int64 + + for _, v := range list { + ids = append(ids, v.ID) + } + + type num struct { + RewardId int64 + Num int64 + } + + recordM := dao.FissionRewardRecord.SubTable(cpn.ID) + var nums []*num + err = recordM.WithContext(s.ctx).Select(recordM.RewardID, recordM.ID.Count().As("num")).Where(recordM.RewardID.In(ids...)).Group(recordM.RewardID).Scan(&nums) + if err != nil { + return + } + + var idMap = make(map[int64]int64) + for _, v := range nums { + idMap[v.RewardId] = v.Num + } + + var preIdMap = make(map[int64]int64) + switch cpn.FissionID { + case consts.IdKeep: + var preNums []*num + preM := dao.FissionKeep + err = preM.WithContext(s.ctx).Select(preM.RewardID, preM.ID.Count().As("num")).Where(preM.RewardID.In(ids...)).Group(preM.RewardID).Scan(&nums) + if err != nil { + return + } + + for _, v := range preNums { + preIdMap[v.RewardId] = v.Num + } + + } + + for _, v := range list { + n, _ := app.Redis.Cache.Get(s.ctx, ckey.FissionCampaignRewardPool(v.ID)).Int64() + n1, _ := app.Redis.Cache.Get(s.ctx, ckey.FissionCampaignRewardUseStock(v.ID)).Int64() + + app.FeishuNormalSend("配置库存:%d, 实际发放库存: %d,redis记录库存池剩余库存:%d,已使用库存: %d", v.Stock, idMap[v.ID], n, n1) + + app.Redis.Cache.Del(s.ctx, ckey.FissionCampaignRewardPool(v.ID), ckey.FissionCampaignRewardUseStock(v.ID)) + + pn, _ := app.Redis.Cache.Get(s.ctx, ckey.FissionCampaignPreRewardPool(v.ID)).Int64() + pn1, _ := app.Redis.Cache.Get(s.ctx, ckey.FissionCampaignRewardPreUseStock(v.ID)).Int64() + + app.FeishuNormalSend("配置预备库存:%d, 实际发放预备库存: %d,redis记录预备库存池剩余预备库存:%d,已使用预备库存: %d", v.Stock, preIdMap[v.ID], pn, pn1) + + app.Redis.Cache.Del(s.ctx, ckey.FissionCampaignPreRewardPool(v.ID), ckey.FissionCampaignRewardPreUseStock(v.ID)) + } + +} + +type resetAdsInit struct { + ctx context.Context + taskId string + Url string `json:"url"` +} + +// 重制广告配置 +func (s resetAdsInit) resetAdsInit() { + + resp, err := app.EtcdCli.Put(s.ctx, app.EtcdConfig+"/ads", s.Url) + if err != nil { + app.FeishuNormalSend("重制广告配置错误:%v", err) + return + } + + app.FeishuNormalSend("重制广告配置成功, Header: %+v, PrevKv: %+v", resp.Header, resp.PrevKv) + return +} + +type taskCenterLang struct { + ctx context.Context + taskId string + Refresh int32 `json:"refresh"` + Ver int64 `json:"ver"` +} + +// 重制广告配置 +func (s taskCenterLang) taskCenterLang() { + var err error + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("语言包处理有异常:%v", err)) + return + } + }() + + dir, _ := os.Getwd() + + var path string + if consts.RunTest { + path = fmt.Sprintf("../../../asset/taskcenter") + } else { + path = fmt.Sprintf("%s/asset/taskcenter", dir) + } + + client, err := oss.New("https://oss-cn-shenzhen.aliyuncs.com", "LTAI5tNvMLF181bTb3qCZxk4", "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A") + if err != nil { + return + } + + // 填写存储空间名称,例如examplebucket。 + bucket, err := client.Bucket("client-project-resource") + if err != nil { + return + } + + var yunPath = "taskcenter/lang" + var fileNames []string + files, _ := os.ReadDir(path) + for _, v := range files { + name := fmt.Sprintf("%s/%s", yunPath, v.Name()) + err = bucket.PutObjectFromFile(name, fmt.Sprintf("%s/%s", path, v.Name())) + if err != nil { + return + } + + fileNames = append(fileNames, name) + } + + if s.Refresh == 0 { + app.FeishuNormalSend("任务中心语言包处理成功,仅更新远端语言包") + return + } + + b, _ := jsonm.MarshalToString(map[string]interface{}{ + "ver": utils.STernary[int64](s.Ver, 0, time.Now().Unix()), + "path": fmt.Sprintf("%s/%s", config.Config.Upload.Host, yunPath), + }) + + resp, err := app.EtcdCli.Put(s.ctx, "/taskcenter/lang", b) + if err != nil { + return + } + + app.FeishuNormalSend("任务中心语言包处理成功, Header: %+v, PrevKv: %+v, data: %s, 文件内容:%+v", resp.Header, resp.PrevKv, b, fileNames) + return +} + +type clearCpn struct { + ctx context.Context + CampaignHashId string `json:"campaign_hash_id"` +} + +// 清楚活动的用户设备数据 +func (s clearCpn) clearCpn() { + d := dao.Q.Begin() + var err error + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("clearCpn逻辑问题%v", err)) + d.Rollback() + return + } + d.Commit() + }() + + cpn, err := finder.Campaign(s.ctx, s.CampaignHashId) + if err != nil || cpn == nil { + return + } + + project, err := finder.Project(s.ctx, cpn.ProjectID) + if err != nil { + return + } + + if project == nil || project.IsDel == mtype.Yes || project.IsTest == mtype.No { + return + } + + m := d.FissionUser.SubTable(cpn.ID) + + list, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID)).Limit(50).Find() + if err != nil { + return + } + + if len(list) == 0 { + return + } + + cc := cache.NewFissionUser(s.ctx, cpn.ID) + var keys []string + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + + if v.DeviceID != "" { + keys = append(keys, cc.IdxKey("campaign_id", v.CampaignID, "device_id", v.DeviceID)) + } + + if v.SubUserID != "" { + keys = append(keys, cc.IdxKey("campaign_id", v.CampaignID, "sub_user_id", v.SubUserID)) + } + + if v.DeviceID != "" { + _, _ = app.NewDeepLinkDevice().DeleteDevice(s.ctx, &ddevicepb.DeleteDeviceReq{ + Code: v.DeviceID, + ProjectId: project.ID, + }) + } + } + + res, err := m.WithContext(s.ctx).Where(m.ID.In(ids...)).Delete() + if err != nil { + return + } + + statM := d.FissionUserStat + resStat, err := statM.WithContext(s.ctx).Where(statM.UserID.In(ids...)).Delete() + if err != nil { + return + } + + _ = cc.Clear(list...) + + if len(keys) > 0 { + app.Redis.Cache.Del(s.ctx, keys...) + } + + app.FeishuNormalSend("用户数据删除:%d,统计数据删除:%d", res.RowsAffected, resStat.RowsAffected) +} + +type openTest struct { + ctx context.Context + taskId string + ProjectId int64 `json:"project_id"` + ProjectHashId string `json:"project_hash_id"` + Open int8 `json:"open"` +} + +// 把项目变成测试项目 +func (s openTest) openTest() { + project, err := finder.Project(s.ctx, s.ProjectId, s.ProjectHashId) + if err != nil { + return + } + + if project == nil { + app.FeishuNormalSend(fmt.Sprintf("[%d_%s] 找不到对应的项目", s.ProjectId, s.ProjectHashId)) + return + } + + m := dao.Project + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(project.ID)).UpdateSimple(m.IsTest.Value(s.Open)) + if err != nil { + return + } + + _ = cache.NewProject(s.ctx).Clear(project) + app.Redis.Cache.Del(s.ctx, + fmt.Sprintf("certified:project:project_show_id:%d", project.ID), + fmt.Sprintf("certified:project:project_show_hash:%s", project.HashID), + ) + app.FeishuNormalSend(fmt.Sprintf("[%d_%s]项目测试状态修改为[%s]", s.ProjectId, s.ProjectHashId, utils.Ternary(s.Open == mtype.Yes, "开启", "关闭"))) + +} + +type getCache struct { + ctx context.Context + taskId string + Key string `json:"key"` + Cmd string `json:"cmd"` +} + +// 把项目变成测试项目 +func (s getCache) getCache() { + + var v string + switch s.Cmd { + case "hget": + r, _ := app.Redis.Cache.HGetAll(s.ctx, s.Key).Result() + v, _ = jsonm.MarshalToString(r) + case "del": + r, _ := app.Redis.Cache.Del(s.ctx, s.Key).Result() + v = fmt.Sprintf("del:%d rows", r) + default: + v, _ = app.Redis.Cache.Get(s.ctx, s.Key).Result() + } + + app.FeishuNormalSend("key:%s value:%s", s.Key, utils.STernary[string](v, "", "没有查到数据哦")) + +} + +type printAllLog struct { + ctx context.Context + taskId string + Open int32 `json:"open"` +} + +// 把项目变成测试项目 +func (s printAllLog) printAllLog() { + + switch s.Open { + case 1: + consts.PrintAllLog = true + default: + consts.PrintAllLog = false + } + + app.FeishuNormalSend(fmt.Sprintf("全量日志状态修改为[%s]", utils.Ternary[string](s.Open == mtype.Yes, "开启", "关闭"))) +} + +type collectSlowLog struct { + ctx context.Context + taskId string + Open int32 `json:"open"` +} + +// 把项目变成测试项目 +func (s collectSlowLog) collectSlowLog() { + defer app.TryCatch(s.ctx, "收集慢日志状态修改") + + switch s.Open { + case 1: + if consts.CollectSlowLog { + return + } + + consts.CollectSlowLog = true + printer.Slow.Run() + default: + if !consts.CollectSlowLog { + return + } + consts.CollectSlowLog = false + printer.Slow.Stop() + } + + app.FeishuNormalSend(fmt.Sprintf("收集慢日志状态修改为[%s]", utils.Ternary[string](s.Open == mtype.Yes, "开启", "关闭"))) +} + +type setLangParts struct { + ctx context.Context + taskId string + Mark string `json:"mark"` + Parts string `json:"parts"` +} + +func (s setLangParts) setLangParts() { + m := dao.FissionTempGroup + g, err := m.WithContext(s.ctx).Where(m.Mark.Eq(s.Mark)).Take() + if err != nil || g == nil || g.LangParts == s.Parts { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(g.ID)).UpdateSimple(m.LangParts.Value(s.Parts)) + if err != nil { + return + } + + _ = cache.NewFissionTempGroup(s.ctx).Clear(g) + + app.FeishuNormalSend(fmt.Sprintf("模版组[%s]语言包修改过成功[%s]->[%s]", g.Mark, g.LangParts, s.Parts)) +} + +type openLvApi struct { + ctx context.Context + taskId string + CompanyId int64 `json:"company_id"` + Open int32 `json:"open"` +} + +func (s openLvApi) openLvApi() { + + made, err := cache.NewCompanyMade(s.ctx).FindByUniqId(s.CompanyId, mtype.CompanyMadeMarkLvApi) + if err != nil { + return + } + + if made == nil && s.Open == 1 { + err = provider.NewCompanyMade(s.ctx, s.CompanyId).SetMake(mtype.CompanyMadeMarkLvApi, "") + + app.FeishuNormalSend(fmt.Sprintf("企业[%d]开启[%s]组件", s.CompanyId, mtype.CompanyMadeMarkLvApi)) + + return + } + + if made != nil && s.Open == 0 { + err = provider.NewCompanyMade(s.ctx, s.CompanyId).Del(mtype.CompanyMadeMarkLvApi) + + app.FeishuNormalSend(fmt.Sprintf("企业[%d]关闭[%s]组件", s.CompanyId, mtype.CompanyMadeMarkLvApi)) + + return + } + +} + +type openFissionTemp struct { + ctx context.Context + taskId string + CompanyId int64 `json:"company_id"` + Temp []string `json:"temp"` +} + +func (s openFissionTemp) openFissionTemp() { + + made, err := cache.NewCompanyMade(s.ctx).FindByUniqId(s.CompanyId, mtype.CompanyMadeMarkFissionTemp) + if err != nil { + return + } + + if len(s.Temp) > 0 { + err = provider.NewCompanyMade(s.ctx, s.CompanyId).SetMake(mtype.CompanyMadeMarkFissionTemp, s.Temp) + + app.FeishuNormalSend(fmt.Sprintf("企业[%d]开启[%s]组件, 模板:%+v", s.CompanyId, mtype.CompanyMadeMarkFissionTemp, s.Temp)) + + return + } + + if made != nil && len(s.Temp) == 0 { + err = provider.NewCompanyMade(s.ctx, s.CompanyId).Del(mtype.CompanyMadeMarkFissionTemp) + + app.FeishuNormalSend(fmt.Sprintf("企业[%d]关闭[%s]组件", s.CompanyId, mtype.CompanyMadeMarkFissionTemp)) + + return + } + +} + +type pushWaitReward struct { + ctx context.Context + taskId string + CampaignId int64 `json:"campaign_id"` +} + +func (s pushWaitReward) pushWaitReward() { + + m := dao.FissionRewardRecord.SubTable(s.CampaignId) + list, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(s.CampaignId), m.Status.Eq(mtype.FissionRewardRecordStatusWait)).Find() + if err != nil { + return + } + + for _, record := range list { + producer.NewCampaignNotice(s.ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: record.CampaignID, + UserId: record.UserID, + UserRewardId: record.ID, + }) + } +} + +type statCampaign struct { + ctx context.Context + taskId string + + BehaviorType int32 `json:"behavior_type"` + IpAddress string `json:"ip_address"` + UserID string `json:"user_id"` + DeviceID string `json:"device_id"` + Event string `json:"event"` + EventData []types.EventData `json:"event_data"` + ProjectID int64 `json:"project_id"` + Hid int64 `json:"hid"` + TsHID string `json:"ts_hid"` //任务中心hash_id + Language string `json:"language"` // 语言 +} + +func (s statCampaign) statCampaign() { + p := producer.NewStatCampaign(s.ctx) + + p.StatCampaign(types.StatCampaignValue{ + BehaviorType: s.BehaviorType, + BehaviorTime: time.Now().Unix(), + IpAddress: s.IpAddress, + Os: "ios", + OsVersion: "16.3", + DeviceModel: "iphone", + DeviceID: s.DeviceID, + UserID: s.UserID, + Event: s.Event, + EventData: s.EventData, + ProjectID: s.ProjectID, + Language: s.Language, + }) + +} diff --git a/internal/service/script/script_test.go b/internal/service/script/script_test.go new file mode 100644 index 0000000..8e064db --- /dev/null +++ b/internal/service/script/script_test.go @@ -0,0 +1,222 @@ +package script + +import ( + "context" + "joybuywork/internal/consts" + "testing" + "time" + + "github.com/rs/xid" + + _ "joybuywork/test" +) + +func TestLang(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := lang{ + ctx: ctx, + taskId: taskId, + } + + c.lang() +} + +func TestLangModule(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := langModule{ + ctx: ctx, + taskId: taskId, + } + + c.langModule() +} + +func TestLangTextMark(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := langTextMark{ + ctx: ctx, + taskId: taskId, + } + + c.langTextMark() +} + +func TestCheckLang(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := checkLang{ + ctx: ctx, + taskId: taskId, + } + + c.checkLang() +} + +func TestFillLang(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := fillLang{ + ctx: ctx, + taskId: taskId, + } + + c.fillLang() +} + +func TestOpenPushLadder(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := openPushLadder{ + ctx: ctx, + taskId: taskId, + ProjectId: 143, + ProjectHashId: "", + Open: 1, + } + + c.openPushLadder() +} + +func TestFixData(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := fixData{ + ctx: ctx, + taskId: taskId, + CampaignHashId: "d34cfv6rdj7q4t79q220", + Date: "2026-07-13 19:03:30", + } + + c.fixData() +} + +func TestFixData2(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := fixData2{ + ctx: ctx, + taskId: taskId, + CampaignHashId: "d1363eerdj7quq5bpakg", + } + + c.fixData2() +} + +func TestTestGetWebReward(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := testGetWebReward{ + ctx: ctx, + taskId: taskId, + CampaignHashId: "cpm0cumrdj7q5fjo0lk0", + WebId: "cppq1surdj7k8gjm3cb0", + } + + c.testGetWebReward() +} + +func TestClearStock(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := clearStock{ + ctx: ctx, + taskId: taskId, + CampaignId: 3203, + } + + c.clearStock() +} + +func TestTaskCenterLang(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := taskCenterLang{ + ctx: ctx, + taskId: taskId, + } + + c.taskCenterLang() + + time.Sleep(time.Second) +} + +func TestSetLangParts(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := setLangParts{ + ctx: ctx, + taskId: taskId, + Mark: "cat", + Parts: "common,media,tip,pet,task,show_detail,form,icon,rule,grow_task,reward_show,invite_record,child,chat", + } + + c.setLangParts() + + c1 := setLangParts{ + ctx: ctx, + taskId: taskId, + Mark: "gold_dog", + Parts: "common,media,tip,keep_dog,task,show_detail,form,icon,rule,grow_task,reward_show,invite_record,child,chat", + } + + c1.setLangParts() + + c2 := setLangParts{ + ctx: ctx, + taskId: taskId, + Mark: "keep_dog", + Parts: "common,media,tip,keep_dog,task,show_detail,form,icon,rule,grow_task,reward_show,invite_record,child,chat", + } + + c2.setLangParts() +} + +func TestStatCampaign(t *testing.T) { + + taskId := xid.New().String() + ctx := context.Background() + ctx = context.WithValue(ctx, consts.CtxBootId, taskId) + c := statCampaign{ + ctx: ctx, + taskId: taskId, + BehaviorType: 0, + IpAddress: "", + UserID: "", + DeviceID: "", + Event: "", + EventData: nil, + ProjectID: 0, + Hid: 0, + TsHID: "", + Language: "", + } + + c.statCampaign() +} diff --git a/internal/service/script/test_api.go b/internal/service/script/test_api.go new file mode 100644 index 0000000..6537406 --- /dev/null +++ b/internal/service/script/test_api.go @@ -0,0 +1,145 @@ +// 这个文件是给自己做一些方便接口测试的脚本 +package script + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "github.com/rs/xid" +) + +// 发放站外奖品 +type testGetWebReward struct { + ctx context.Context + taskId string + + CampaignHashId string `json:"campaign_hash_id"` + ChannelMark string `json:"channel_mark"` + WebId string `json:"web_id"` +} + +func (s *testGetWebReward) testGetWebReward() { + if config.Config.Server.Env == consts.Prod { + return + } + + var err error + tx := dao.Q.Begin() + defer func() { + if err != nil { + app.Logger.Error(s.ctx, fmt.Sprintf("领取站外奖品出错:%v", err)) + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + cpn, err := finder.Campaign(s.ctx, s.CampaignHashId) + if err != nil { + return + } + + if cpn == nil || cpn.Target != mtype.FissionCampaignConfigTargetAdsGame { + err = workerr.NotFound("not found cpn or not an ads game") + return + } + + channelM := dao.FissionCampaignChannel + channel, err := channelM.WithContext(s.ctx).Where(channelM.CampaignID.Eq(cpn.ID), channelM.IsDefault.Eq(mtype.Yes)).Take() + if err != nil { + return + } + + wbu, err := cache.NewFissionWebUser(s.ctx).FindByWebId(cpn.ID, s.WebId) + if err != nil { + return + } + + if wbu == nil || wbu.UserID > 0 { + err = workerr.NotFound("not found web user or be bind") + return + } + + rewardM := dao.FissionCampaignReward + reward, err := rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(wbu.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + return + } + + if reward == nil { + return + } + + subUserId := xid.New().String() + user := withdefault.FissionUser(&model.FissionUser{ + IsNew: mtype.Yes, + SubUserID: subUserId, + DeviceID: "", + UserMark: subUserId, + UserType: mtype.FissionUserTypePlay, + Source: mtype.FissionUserSourceInstall, + ChannelID: channel.ID, + }) + + ums := tx.FissionUser.SubTable(cpn.ID) + err = ums.WithContext(s.ctx).Create(user) + if err != nil { + return + } + + m := tx.FissionWebUser + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(wbu.ID)).UpdateSimple(m.UserID.Value(user.ID)) + if err != nil { + return + } + + record, _, _, err := award.NewAwardReward(s.ctx, dao.Q, cpn.ProjectID, user).One(reward, false) + if err != nil { + return + } + + _ = cache.NewFissionWebUser(s.ctx).Clear(wbu) + + producer.NewCampaignNotice(s.ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: mtype.FissionBehaviorTypeAppInstall, + BehaviorTime: time.Now().Unix(), + UserMark: wbu.WebID, + OtherData: nil, + }) + + producer.NewCampaignNotice(s.ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: mtype.FissionBehaviorTypeChannelInstall, + BehaviorTime: time.Now().Unix(), + UserMark: wbu.WebID, + OtherData: nil, + MarkId: fmt.Sprintf("%d", channel.ID), + }) + + producer.NewCampaignNotice(s.ctx).CampaignBehavior(types.CampaignBehavior{ + CampaignId: cpn.ID, + BehaviorType: mtype.FissionBehaviorTypeRewardApp, + BehaviorTime: time.Now().Unix(), + UserMark: wbu.WebID, + OtherData: nil, + MarkId: fmt.Sprintf("%d", record.RewardID), + }) + + time.Sleep(1 * time.Second) +} diff --git a/internal/service/service.go b/internal/service/service.go new file mode 100644 index 0000000..322e773 --- /dev/null +++ b/internal/service/service.go @@ -0,0 +1,107 @@ +package service + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/merr" + "joybuywork/proto/go_proto/workerr" +) + +type Service struct { + ctx context.Context + dao *dao.Query + svcErr error + be *merr.BusinessError +} + +// Init 初始化服务对象 +func (s *Service) Init(ctx context.Context) { + s.ctx = ctx + s.dao = dao.Q + s.be = merr.NewBE(ctx) +} + +func (s *Service) checkErr() { + if s.svcErr != nil { + app.Logger.Error(s.ctx, s.svcErr.Error()) + } +} + +func (s *Service) BE() *merr.BusinessError { + return s.be +} + +func (s *Service) GetDao() *dao.Query { + return s.dao +} + +func (s *Service) ProjectErrNil(idVal ...any) (project *model.Project, err error) { + project, err = finder.Project(s.ctx, idVal...) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + return +} + +func (s *Service) CpnAndUser(cpnId, userId int64) (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = cache.NewCampaign(s.ctx).FindById(cpnId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = cache.NewFissionUser(s.ctx, cpn.ID).FindById(userId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + return +} + +func (s *Service) CpnAndUserStr(cpnId, userId string) (cpn *model.FissionCampaign, user *model.FissionUser, err error) { + cpn, err = cache.NewCampaign(s.ctx).FindByHashId(cpnId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err = cache.NewFissionUser(s.ctx, cpn.ID).FindByHashId(userId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + return +} diff --git a/internal/service/w_campaign.go b/internal/service/w_campaign.go new file mode 100644 index 0000000..4455d5e --- /dev/null +++ b/internal/service/w_campaign.go @@ -0,0 +1,2010 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/cmm" + containers "joybuywork/internal/service/containers/campaign" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/operatelog" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign" + "joybuywork/proto/go_proto/workerr" + "time" + + "gorm.io/gen" + "gorm.io/gen/field" +) + +type WCampaign struct { + Service +} + +// List 活动列表 +func (s *WCampaign) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + *res = pb.ListRes{} + + container := new(containers.List) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Status 修改状态 +func (s *WCampaign) Status(req *pb.StatusReq, res *pb.StatusRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return workerr.NotFound("campaign not found") + } + + *res = pb.StatusRes{} + + //活动已经下线了,直接返回成功,什么都不干 + if cpn.Status == mtype.FissionCampaignStatusCancel { + return + } + + // 想下线,但是没发布 + if req.Status == mtype.FissionCampaignStatusCancel && !cpn.IsPub() { + return workerr.CWaitCancelError + } + + // 想上线,但是不是预发布状态 + if verify.InArray[int32](req.Status, mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre) && cpn.Status != mtype.FissionCampaignStatusPubPre { + return workerr.CPubWaitError + } + + m := s.GetDao().FissionCampaign + var up = []field.AssignExpr{ + m.Status.Value(int8(req.GetStatus())), + } + + if req.PreRunTime > 0 { + up = append(up, m.PreToRun.Value(timez.GMT(req.PreRunTime, cpn.TOffset))) + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(up...) + if err != nil { + return s.BE().MysqlError(err) + } + + err = cache.NewCampaign(s.ctx).Clear(cpn) + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch req.Status { + case mtype.FissionCampaignStatusPub: + var conf *model.FissionCampaignConfig + conf, err = cache.NewCampaignConfig(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + confM := s.GetDao().FissionCampaignConfig + _, err = confM.WithContext(s.ctx).Where(confM.ID.Eq(conf.ID)).UpdateSimple(confM.HasWhite.Value(mtype.No)) + if err != nil { + return s.BE().MysqlError(err) + } + + _ = cache.NewCampaignConfig(s.ctx).Clear(conf) + + producer.NewDeepworkNotify(s.ctx).CampaignStart(types.DnCampaignStart{ + CampaignId: cpn.ID, + CampaignHashId: cpn.HashID, + Timestamp: time.Now().Unix(), + }) + + case mtype.FissionCampaignStatusCancel: + err = cmm.NewCMM(s.ctx, s.GetDao()).CampaignCancelTask(cpn, true) + if err != nil { + return + } + + producer.NewDeepworkNotify(s.ctx).CampaignEnd(types.DnCampaignEnd{ + CampaignId: cpn.ID, + CampaignHashId: cpn.HashID, + Timestamp: time.Now().Unix(), + }) + default: + + } + + return +} + +// Destroy 删除活动 +func (s *WCampaign) Destroy(req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + *res = pb.DestroyRes{} + + if cpn == nil || cpn.IsDel == mtype.Yes { + return + } + + m := s.GetDao().FissionCampaign + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(cpn.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + + err = cache.NewCampaign(s.ctx).Clear(cpn) + if err != nil { + return + } + + // 待发布的活动的一些数据要停止处理 + if cpn.Status == mtype.FissionCampaignStatusWait { + err = cmm.NewCMM(s.ctx, s.GetDao()).CampaignCancelTask(cpn, true) + if err != nil { + return + } + } + + producer.NewOplatformOther(s.ctx).OpoCampaignDelete(types.OpoCampaignDelete{ + ProjectId: cpn.ProjectID, + CampaignHashId: cpn.HashID, + }, producer.SetHeaderLang(cpn.GetLangMarks()[0])) + + return +} + +// Store 创建活动 +func (s *WCampaign) Store(req *pb.StoreReq, res *pb.StoreRes) (err error) { + defer s.checkErr() + *res = pb.StoreRes{} + + container := new(containers.Store) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOl()) + container.Req = req + container.Res = res + } + + err = container.Run() + + return +} + +// Share 社媒选项 +func (s *WCampaign) Share(req *pb.ShareReq, res *pb.ShareRes) (err error) { + defer s.checkErr() + + loc, overSea := consts.ShareLocList, consts.ShareOverSeaList + + *res = pb.ShareRes{ + Loc: make([]*pb.ShareRes_One, 0, len(loc)), + OverSea: make([]*pb.ShareRes_One, 0, len(overSea)), + } + + for _, v := range loc { + if v.Close { + continue + } + res.Loc = append(res.Loc, &pb.ShareRes_One{ + Id: v.Id, + Title: v.Title, + Logo: v.Logo, + Scheme: v.Scheme, + IosScheme: v.IosScheme, + }) + } + + for _, v := range overSea { + if v.Close { + continue + } + res.OverSea = append(res.OverSea, &pb.ShareRes_One{ + Id: v.Id, + Title: v.Title, + Logo: v.Logo, + Scheme: v.Scheme, + IosScheme: v.IosScheme, + }) + } + + return +} + +// Show 活动详情 +func (s *WCampaign) Show(req *pb.ShowReq, res *pb.ShowRes) (err error) { + defer s.checkErr() + *res = pb.ShowRes{} + + container := new(containers.Show) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + err = container.Run() + + return +} + +// ChannelList 渠道列表 +func (s *WCampaign) ChannelList(req *pb.ChannelListReq, res *pb.ChannelListRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId(), req.GetCampaignHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return workerr.NotFound("not found campaign") + } + + project, err := finder.Project(s.ctx, cpn.ProjectID) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("not found project") + } + + m := s.GetDao().FissionCampaignChannel + list, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Order(m.ID).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var cll, cwl int + for _, v := range list { + switch v.CType { + case mtype.FissionCampaignChannelTypeApp: + cll++ + case mtype.FissionCampaignChannelTypeWeb: + cwl++ + } + } + + *res = pb.ChannelListRes{ + List: make([]*pb.ChannelListRes_One, 0, cll), + WebList: make([]*pb.ChannelListRes_One, 0, cwl), + } + + for _, v := range list { + switch v.CType { + case mtype.FissionCampaignChannelTypeApp: + var url string + switch cpn.Target { + case mtype.FissionCampaignConfigTargetAdsGame: + url = blink.NewAdsLink(project.Domain, cpn.HashID, v.Mark).CampaignShareLink() + default: + url = blink.NewCampaignLink(project.Domain, cpn.HashID, v.Mark).CampaignShareLink() + } + + res.List = append(res.List, &pb.ChannelListRes_One{ + Id: v.ID, + Title: v.Title, + IsDefault: int32(v.IsDefault), + Url: url, + }) + case mtype.FissionCampaignChannelTypeWeb: + url := v.ShortLink + if url == "" { + url = blink.NewCampaignLink(project.Domain, cpn.HashID, v.Mark).CampaignWebLink() + } + res.WebList = append(res.WebList, &pb.ChannelListRes_One{ + Id: v.ID, + Title: v.Title, + IsDefault: int32(v.IsDefault), + Url: url, + Code: v.Code, + }) + } + } + + return +} + +// ChannelCreate 渠道创建 +func (s *WCampaign) ChannelCreate(req *pb.ChannelCreateReq, res *pb.ChannelCreateRes) (err error) { + defer s.checkErr() + + *res = pb.ChannelCreateRes{} + + container := new(containers.ChannelCreate) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ChannelUpdate 渠道更新 +func (s *WCampaign) ChannelUpdate(req *pb.ChannelUpdateReq, res *pb.ChannelUpdateRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionCampaignChannel + cl, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if cl == nil || cl.IsDel == mtype.Yes { + return workerr.NotFound("not found channel") + } + + if cl.IsDefault == mtype.Yes { + return workerr.CChanelNotSetError + } + + *res = pb.ChannelUpdateRes{} + + if cl.Title == req.GetTitle() { + return + } + + var title []string + err = m.WithContext(s.ctx).Where(m.CampaignID.Eq(cl.CampaignID), m.ID.Neq(cl.ID), m.CType.Eq(cl.CType), m.IsDel.Eq(mtype.No)).Pluck(m.Title, &title) + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range title { + if v == req.GetTitle() { + return workerr.CChanelExistError + } + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(cl.ID)).UpdateSimple(m.Title.Value(req.GetTitle())) + if err != nil { + return s.BE().MysqlError(err) + } + + cpn, _ := cache.NewCampaign(s.ctx).FindById(cl.CampaignID) + cpnM := s.GetDao().FissionCampaign + cpnM.WithContext(s.ctx).Where(cpnM.ID.Eq(cl.CampaignID)).UpdateSimple(cpnM.UpdatedAt.Value(time.Now().Unix())) + cache.NewCampaign(s.ctx).Clear(cpn) + + _ = cache.NewCampaignChannel(s.ctx).Clear(cl) + + return +} + +// ChannelDestroy 渠道删除 +func (s *WCampaign) ChannelDestroy(req *pb.ChannelDestroyReq, res *pb.ChannelDestroyRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionCampaignChannel + cl, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if cl == nil || cl.IsDel == mtype.Yes { + return + } + + if cl.IsDefault == mtype.Yes { + return workerr.CChanelNotSetError + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(cl.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + + cpn, _ := cache.NewCampaign(s.ctx).FindById(cl.CampaignID) + cpnM := s.GetDao().FissionCampaign + cpnM.WithContext(s.ctx).Where(cpnM.ID.Eq(cl.CampaignID)).UpdateSimple(cpnM.UpdatedAt.Value(time.Now().Unix())) + cache.NewCampaign(s.ctx).Clear(cpn) + + _ = cache.NewCampaignChannel(s.ctx).Clear(cl) + + *res = pb.ChannelDestroyRes{} + return +} + +// Update 更新活动 +func (s *WCampaign) Update(req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + defer s.checkErr() + *res = pb.UpdateRes{} + + container := new(containers.Update) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOl()) + container.Req = req + container.Res = res + } + + err = container.Run() + + return +} + +// KvData 获取活动键值对 +func (s *WCampaign) KvData(req *pb.KvDataReq, res *pb.KvDataRes) (err error) { + defer s.checkErr() + conf, err := cache.NewCampaignConfig(s.ctx).FindByCampaignId(req.GetId()) + if err != nil { + return s.BE().CacheError(err) + } + + if conf == nil { + return workerr.NotFound("not found campaign") + } + + kv := conf.GetCampaignData() + + *res = pb.KvDataRes{ + Kv: make([]*pb.KvDataRes_KV, 0, len(kv)), + } + + for _, v := range kv { + res.Kv = append(res.Kv, &pb.KvDataRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + + return +} + +// Cert 认证活动信息 +func (s *WCampaign) Cert(req *pb.CertReq, res *pb.CertRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + project, err := finder.Project(s.ctx, req.GetProjectId(), req.GetProjectHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes || project == nil || project.IsDel == mtype.Yes || cpn.ProjectID != project.ID { + return + } + + *res = pb.CertRes{ + Cert: true, + Id: cpn.ID, + HashId: cpn.HashID, + ProjectId: project.ID, + ProjectHashId: project.HashID, + Title: cpn.Title, + } + return +} + +// Barrage 活动弹幕 +func (s *WCampaign) Barrage(req *pb.BarrageReq, res *pb.BarrageRes) (err error) { + defer s.checkErr() + *res = pb.BarrageRes{} + container := new(containers.Barrage) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Option 投票选项 +func (s *WCampaign) Option(req *pb.OptionReq, res *pb.OptionRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil { + return workerr.NotFound("not found cpn") + } + + fcqM := s.GetDao().FissionCampaignQuiz + fcq, err := fcqM.WithContext(s.ctx).Where(fcqM.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if fcq == nil { + return workerr.NotFound("not found fcq") + } + + optionM := s.GetDao().FissionCampaignQuizOption + options, err := optionM.WithContext(s.ctx).Where(optionM.CampaignID.Eq(cpn.ID), optionM.IsDel.Eq(mtype.No)).Order(optionM.VoteNum.Desc(), optionM.ID).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.OptionRes{} + + var rightId int64 + for _, v := range options { + res.Options = append(res.Options, &pb.OptionRes_Option{ + Id: v.ID, + Title: v.Title, + ImgUrl: v.ImgURL, + IsRight: int32(v.IsRight), + VoteNum: v.VoteNum, + }) + if v.IsRight == mtype.Yes { + rightId = v.ID + } + } + + if fcq.OpenType != mtype.FissionCampaignQuizOpenTypeWait { + res.RightId = rightId + } + + return +} + +// RelateDdl 活动关联动态下载页 +func (s *WCampaign) RelateDdl(req *pb.RelateDdlReq, res *pb.RelateDdlRes) (err error) { + defer s.checkErr() + + *res = pb.RelateDdlRes{} + + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + cpn, err := finder.Campaign(s.ctx, req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found campaign") + return + } + + conf, err := cmm.NewCMM(s.ctx, s.dao).GetFissionConfig(project.ID) + if err != nil { + return + } + + m := s.GetDao().FissionConfig + + // 关闭动态下载页 + if req.GetClose() { + if conf.DynamicCampaign == cpn.ID { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(m.DynamicCampaign.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + return + } + + // 等值不用修改 + if conf.DynamicCampaign == cpn.ID { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(conf.ID)).UpdateSimple(m.DynamicCampaign.Value(cpn.ID)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// DdlCampaign 关联动态下载页的活动 +func (s *WCampaign) DdlCampaign(req *pb.DdlCampaignReq, res *pb.DdlCampaignRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + conf, err := cmm.NewCMM(s.ctx, s.dao).GetFissionConfig(project.ID) + if err != nil { + return + } + + if conf.DynamicCampaign == 0 { + return + } + + cpn, err := finder.Campaign(s.ctx, conf.DynamicCampaign) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found campaign") + return + } + + *res = pb.DdlCampaignRes{ + HashId: cpn.HashID, + Title: cpn.Title, + Status: int32(cpn.Status), + } + return +} + +// Langs 活动多语言配置信息 +func (s *WCampaign) Langs(req *pb.LangsReq, res *pb.LangsRes) (err error) { + defer s.checkErr() + *res = pb.LangsRes{} + + container := new(containers.Langs) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Lang 活动语言信息 +func (s *WCampaign) Lang(req *pb.LangReq, res *pb.LangRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found campaign") + return + } + + project, err := s.ProjectErrNil(cpn.ProjectID) + if err != nil { + return + } + + conf, err := cache.NewCampaignConfig(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var langMark = utils.NotExistGetFirst(req.GetLangMark(), cpn.GetLangMarks()) + lang, err := cache.NewCampaignLang(s.ctx).FindByCampaignId(cpn.ID, langMark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lang == nil { + return + } + + *res = pb.LangRes{ + HashId: lang.HashID, + PageTitle: lang.PageTitle, + ImageMain: lang.ImageMain, + DownloadPageImage: lang.DownloadPageImage, + WechatPageImage: lang.WechatPageImage, + ContentImg: lang.ContentImg, + WebBgImg: lang.WebBgImg, + WarmUpImg: lang.WarmUpImg, + DlBgImg: lang.DlBgImg, + DlBannerImg: lang.DlBannerImg, + DlBannerAppLogo: lang.DlBannerAppLogo, + DlBannerAppName: lang.DlBannerAppName, + DlBannerAppBtn: lang.DlBannerAppBtn, + ShareText: lang.ShareText, + ShareImg: lang.ShareImg, + Rule: lang.Rule, + Conds: nil, + Quit: nil, + Questions: nil, + LongImgs: nil, + Cash: nil, + TOffset: lang.TOffset, + QaGroup: nil, + TalkText: nil, + Gold: nil, + Coin: nil, + TopicColor: lang.TopicColor, + PcBg: lang.PcBg, + RuleImg: lang.RuleImg, + } + + for _, cond := range lang.GetConds() { + res.Conds = append(res.Conds, &pb.LangRes_Cond{ + CondId: cond.CondId, + Desc: cond.Desc, + WebUrl: cond.WebURL, + ExtraParam: cond.ExtraParam, + PcParam: cond.PcParam, + GoText: cond.GoText, + }) + } + + if quit := lang.GetQuit(); quit != nil { + res.Quit = &pb.LangRes_Quit{ + Title: quit.Title, + Options: make([]*pb.LangRes_Option, 0, len(quit.Options)), + } + + for _, option := range quit.Options { + res.Quit.Options = append(res.Quit.Options, &pb.LangRes_Option{ + OptionId: option.OptionId, + Title: option.Title, + ImgUrl: option.ImgUrl, + }) + } + } + + for _, question := range lang.GetQuestions() { + q := &pb.LangRes_Question{ + QaId: question.QaId, + Title: question.Title, + Options: make([]*pb.LangRes_Option, 0, len(question.Options)), + } + + for _, option := range question.Options { + q.Options = append(q.Options, &pb.LangRes_Option{ + OptionId: option.OptionId, + Title: option.Title, + ImgUrl: option.ImgUrl, + }) + } + + res.Questions = append(res.Questions, q) + } + + var targetChannelMap = make(map[int64]*model.FissionCampaignChannel) + var targetCpnMap = make(map[int64]*model.FissionCampaign) + if conf.HasLongImg == mtype.Yes { + imgM := s.GetDao().FissionCampaignLongImg + var imgs []*model.FissionCampaignLongImg + imgs, err = imgM.WithContext(s.ctx).Where(imgM.CampaignID.Eq(lang.CampaignID), imgM.LangID.Eq(lang.ID), imgM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var cpnIds []int64 + var zoneIds []int64 + for _, img := range imgs { + if img.ClickType == mtype.FissionCampaignLongImgClickTypeAll { + if img.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + cpnIds = append(cpnIds, img.TargetID) + } + continue + } + zoneIds = append(zoneIds, img.ID) + } + + var zoneMap = make(map[int64][]*model.FissionCampaignLongImgZone, len(zoneIds)) + if len(zoneIds) > 0 { + zoneM := s.GetDao().FissionCampaignLongImgZone + var zones []*model.FissionCampaignLongImgZone + zones, err = zoneM.WithContext(s.ctx).Where(zoneM.ImgID.In(zoneIds...), zoneM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, zone := range zones { + zoneMap[zone.ImgID] = append(zoneMap[zone.ImgID], zone) + if zone.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + cpnIds = append(cpnIds, zone.TargetID) + } + } + } + + if len(cpnIds) > 0 { + cpnM := s.GetDao().FissionCampaign + var cpns []*model.FissionCampaign + cpns, err = cpnM.WithContext(s.ctx).Where(cpnM.ID.In(cpnIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range cpns { + targetCpnMap[v.ID] = v + } + + channelM := s.GetDao().FissionCampaignChannel + var channels []*model.FissionCampaignChannel + channels, err = channelM.WithContext(s.ctx).Where(channelM.CampaignID.In(cpnIds...), channelM.IsDefault.Eq(mtype.Yes), channelM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, channel := range channels { + targetChannelMap[channel.CampaignID] = channel + } + + } + + for _, v := range imgs { + var one = &pb.LangRes_LongImg{ + ImgUrl: v.ImgURL, + WebUrl: v.WebURL, + AppParam: v.AppParam, + Id: v.ID, + ClickType: int32(v.ClickType), + HotZone: make([]*pb.LangRes_HotZone, 0, len(zoneMap[v.ID])), + TargetType: int32(v.TargetType), + TargetId: v.TargetID, + TargetUrl: "", + PcParam: v.PcParam, + } + if v.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + one.TargetUrl = blink.NewCampaignLink(project.Domain, targetCpnMap[v.TargetID].HashID, targetChannelMap[v.TargetID].Mark).CampaignShareLink() + } + + for _, zone := range zoneMap[v.ID] { + two := &pb.LangRes_HotZone{ + Id: zone.ID, + WebUrl: zone.WebURL, + AppParam: zone.AppParam, + ClickX: zone.ClickX, + ClickY: zone.ClickY, + ClickW: zone.ClickW, + ClickH: zone.ClickH, + TargetType: int32(zone.TargetType), + TargetId: zone.TargetID, + TargetUrl: "", + PcParam: zone.PcParam, + } + + if zone.TargetType == mtype.FissionCampaignLongImgTargetTypeCampaign { + two.TargetUrl = blink.NewCampaignLink(project.Domain, targetCpnMap[zone.TargetID].HashID, targetChannelMap[zone.TargetID].Mark).CampaignShareLink() + } + + one.HotZone = append(one.HotZone, two) + } + + res.LongImgs = append(res.LongImgs, one) + } + } + + if cash := lang.GetCash(); cash != nil { + res.Cash = &pb.LangRes_Cash{ + Price: cash.Price, + Currency: cash.Currency, + } + } + + if gold := lang.GetGold(); gold != nil { + res.Gold = &pb.LangRes_Gold{ + Price: gold.Price, + Currency: gold.Currency, + } + } + + if coin := lang.GetLangCoin(); coin != nil { + res.Coin = &pb.LangRes_Coin{ + CustomBtnText: coin.CustomBtnText, + CustomWebUrl: coin.CustomWebUrl, + CustomExtraParam: coin.CustomExtraParam, + CustomPcParam: coin.CustomPcParam, + } + } + + if qaGroup := lang.GetQaGroup(); qaGroup != nil { + var title string + qaGroupM := s.GetDao().LibraryQaGroup + group, _ := qaGroupM.WithContext(s.ctx).Where(qaGroupM.HashID.Eq(qaGroup.QaGroupId)).Take() + if group != nil { + title = group.Title + } + + res.QaGroup = &pb.LangRes_QaGroup{ + QaGroupId: qaGroup.QaGroupId, + QaNum: qaGroup.QaNum, + Title: title, + GuideGroupId: qaGroup.GuideGroupId, + } + } + + if langVs := lang.GetVs(); langVs != nil { + var langScheduleMap = make(map[int64]*pb.LangRes_PkTeam, len(langVs)) + + for _, schedule := range langVs { + for _, pkTeam := range schedule.PkTeams { + var teams = make([]*pb.LangRes_Team, 0, len(pkTeam.Teams)) + for _, team := range pkTeam.Teams { + teams = append(teams, &pb.LangRes_Team{ + Id: team.Id, + Name: team.Name, + LogoImg: team.LogoImg, + }) + } + + langScheduleMap[pkTeam.Id] = &pb.LangRes_PkTeam{ + Id: pkTeam.Id, + Teams: teams, + VsImg: pkTeam.VsImg, + Desc: pkTeam.Desc, + } + } + } + + m := s.GetDao().FissionCampaignVsTeam + vsTeam, err1 := m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID)).Find() + if err1 != nil { + err1 = s.BE().MysqlError(err1) + return + } + + var vsTeamMap = make(map[int64]*pb.LangRes_Team, len(vsTeam)) + for _, v := range vsTeam { + vsTeamMap[v.ID] = &pb.LangRes_Team{ + Id: v.ID, + Name: v.Name, + LogoImg: v.LogoImg, + } + } + + scheduleM := s.GetDao().FissionCampaignVsSchedule + var list []*model.FissionCampaignVsSchedule + list, err = scheduleM.WithContext(s.ctx).Where(scheduleM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var vsSchedule = make(map[int32][]*model.FissionCampaignVsSchedule) + for _, v := range list { + vsSchedule[v.VsIdx] = append(vsSchedule[v.VsIdx], v) + } + + res.Schedules = make([]*pb.LangRes_Schedule, len(vsSchedule)) + for idx, schedules := range vsSchedule { + one := &pb.LangRes_Schedule{ + Id: idx, + PkTeams: make([]*pb.LangRes_PkTeam, 0, len(schedules)), + } + + for _, schedule := range schedules { + two := &pb.LangRes_PkTeam{ + Id: schedule.ID, + Desc: schedule.Desc, + VsImg: schedule.VsImg, + } + + for _, teamId := range schedule.GetVsTeamIds() { + if teamId > 0 { + two.Teams = append(two.Teams, vsTeamMap[teamId]) + } else { + two.Teams = append(two.Teams, &pb.LangRes_Team{ + Id: teamId, + }) + } + } + + if scd, ok := langScheduleMap[schedule.ID]; ok { + two.Desc = scd.Desc + two.VsImg = scd.VsImg + for i, team := range scd.Teams { + if team.Id > 0 { + two.Teams[i] = team + } + } + } + + one.PkTeams = append(one.PkTeams, two) + } + + res.Schedules[idx] = one + } + } + + _ = jsonm.StrUnmarshal(lang.TalkText, &res.TalkText) + _ = jsonm.StrUnmarshal(lang.Uno, &res.Uno) + + return +} + +// SaveLang 保存活动多语言配置信息 +func (s *WCampaign) SaveLang(req *pb.SaveLangReq, res *pb.SaveLangRes) (err error) { + defer s.checkErr() + *res = pb.SaveLangRes{} + + container := new(containers.SaveLang) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOnce(ckey.FissionCampaignLangSaveOnce(req.GetCampaignHashId(), req.GetLangMark()))) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// DestroyLang 删除活动语言配置信息 +func (s *WCampaign) DestroyLang(req *pb.DestroyLangReq, res *pb.DestroyLangRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionCampaignLang + lang, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetHashId()), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if lang == nil || lang.IsDel == mtype.Yes { + return + } + + cpn, err := finder.Campaign(s.ctx, lang.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(lang.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + lt := mtype.MarkToLangType[lang.LangMark] + + var nlt []int8 + for _, v := range cpn.GetLangTypes() { + if v == lt { + continue + } + nlt = append(nlt, v) + } + + nltStr, _ := jsonm.MarshalToString(nlt) + + cpnM := s.GetDao().FissionCampaign + _, err = cpnM.WithContext(s.ctx).Where(cpnM.ID.Eq(cpn.ID)).UpdateSimple(cpnM.LangTypes.Value(nltStr)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewCampaignLang(s.ctx).Clear(lang) + _ = cache.NewCampaign(s.ctx).Clear(cpn) + + *res = pb.DestroyLangRes{} + return +} + +// LangSelect 活动语言选择 +func (s *WCampaign) LangSelect(req *pb.LangSelectReq, res *pb.LangSelectRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + m := s.GetDao().FissionCampaignLang + langs, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var langMap = make(map[string]bool) + for _, lang := range langs { + langMap[lang.LangMark] = true + } + + *res = pb.LangSelectRes{ + List: make([]*pb.LangSelectRes_One, len(mtype.MarkToLangType)), + } + + for k, v := range mtype.MarkToLangType { + res.List[int(v)-1] = &pb.LangSelectRes_One{ + LangType: int32(v), + LangMark: k, + Selected: langMap[k], + } + } + + return +} + +// CampaignInfo 活动信息 +func (s *WCampaign) CampaignInfo(req *pb.CampaignInfoReq, res *pb.CampaignInfoRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId(), req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found campaign") + return + } + + project, err := s.ProjectErrNil(cpn.ProjectID) + if err != nil { + return + } + + // 默认渠道 + cl, err := cmm.NewCMM(s.ctx, s.GetDao()).UserBindChannel(cpn.ID, "") + if err != nil { + return + } + + var clMark string + if cl != nil { + clMark = cl.Mark + } + + linkObj := blink.NewCampaignLink(project.Domain, cpn.HashID, clMark) + + var pageTitle, shareImg, pcBg string + + switch cpn.Target { + case mtype.FissionCampaignConfigTargetApp, mtype.FissionCampaignConfigTargetUp, mtype.FissionCampaignConfigTargetRetain: + langMark := utils.NotExistGetFirst(req.GetLang(), cpn.GetLangMarks()) + if langMark == cpn.GetLangMarks()[0] { + var style *model.FissionCampaignStyle + style, err = cache.NewCampaignStyle(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + pageTitle = style.PageTitle + shareImg = style.ShareImg + pcBg = style.PcBg + + } else { + var lang *model.FissionCampaignLang + lang, err = cache.NewCampaignLang(s.ctx).FindByCampaignId(cpn.ID, langMark) + if err != nil { + err = s.BE().CacheError(err) + return + } + + pageTitle = lang.PageTitle + shareImg = lang.ShareImg + pcBg = lang.PcBg + } + default: + var conf *model.FissionCampaignConfig + conf, err = cache.NewCampaignConfig(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + pageTitle = conf.PageTitle + shareImg = conf.ShareImg + pcBg = conf.PcBg + } + + *res = pb.CampaignInfoRes{ + Id: cpn.ID, + HashId: cpn.HashID, + Title: cpn.Title, + PageTitle: pageTitle, + FissionMark: consts.FissionIdMap[cpn.FissionID], + FissionTitle: consts.FissionTitle[consts.LangZhCn][consts.FissionIdMap[cpn.FissionID]], + StartTime: cpn.TStart, + EndTime: cpn.TEnd, + Status: int32(cpn.Status), + TOffset: cpn.TOffset, + LangTypes: cpn.GetLangMarks(), + ShareImg: shareImg, + Link: linkObj.CampaignShareLink(), + ImgHost: config.Config.Upload.Host, + PcBg: pcBg, + Target: int32(cpn.Target), + StartAt: cpn.StartTime, + EndAt: cpn.EndTime, + ProjectId: cpn.ProjectID, + } + + return +} + +// ShowReward 显示的奖品数据 +func (s *WCampaign) ShowReward(req *pb.ShowRewardReq, res *pb.ShowRewardRes) (err error) { + defer s.checkErr() + + *res = pb.ShowRewardRes{} + + container := new(containers.ShowReward) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsStore 创建Ads活动 +func (s *WCampaign) AdsStore(req *pb.AdsStoreReq, res *pb.AdsStoreRes) (err error) { + defer s.checkErr() + *res = pb.AdsStoreRes{} + + container := new(containers.AdsStore) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsUpdate 更新Ads活动 +func (s *WCampaign) AdsUpdate(req *pb.AdsUpdateReq, res *pb.AdsUpdateRes) (err error) { + defer s.checkErr() + *res = pb.AdsUpdateRes{} + container := new(containers.AdsUpdate) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsShow Ads活动详情 +func (s *WCampaign) AdsShow(req *pb.AdsShowReq, res *pb.AdsShowRes) (err error) { + defer s.checkErr() + *res = pb.AdsShowRes{} + container := new(containers.AdsShow) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// CampaignSelect 活动选择列表 +func (s *WCampaign) CampaignSelect(req *pb.CampaignSelectReq, res *pb.CampaignSelectRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectId(), req.GetProjectHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return + } + + m := s.GetDao().FissionCampaign + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.ProjectID.Eq(project.ID), + } + + if len(req.GetTargets()) > 0 { + var targets = make([]int8, 0, len(req.GetTargets())) + for _, v := range req.GetTargets() { + targets = append(targets, int8(v)) + } + cond = append(cond, m.Target.In(targets...)) + } + + if len(req.GetStatus()) > 0 { + var status = make([]int8, 0, len(req.GetStatus())) + for _, v := range req.GetStatus() { + status = append(status, int8(v)) + } + cond = append(cond, m.Status.In(status...)) + } + + if req.GetTempHashId() != "" { + var temp *model.FissionTemp + tempM := s.GetDao().FissionTemp + temp, err = tempM.WithContext(s.ctx).Where(tempM.HashID.Eq(req.GetTempHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil { + cond = append(cond, m.FissionID.Eq(0)) + } else { + cond = append(cond, m.FissionID.Eq(temp.FissionID)) + } + + } + + if req.GetChildType() > 0 { + cond = append(cond, m.ChildType.Eq(int8(req.GetChildType()))) + } + + if req.GetChild() { + cond = append(cond, m.Target.Eq(mtype.FissionCampaignConfigTargetChild)) + if req.GetChildWith() != "" { + var cpn *model.FissionCampaign + cpn, err = finder.Campaign(s.ctx, req.GetChildWith()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn != nil { + cond = append(cond, m.WithContext(s.ctx).Where(m.Pid.Eq(cpn.ID)).Or(m.Pid.Eq(0))) + } else { + cond = append(cond, m.Pid.Eq(-1)) + } + + } else { + cond = append(cond, m.Pid.Eq(0)) + } + } + + list, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.CampaignSelectRes{ + List: make([]*pb.CampaignSelectRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.CampaignSelectRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + Status: int32(v.Status), + ChildType: int32(v.ChildType), + }) + } + return +} + +// RewardDetail 奖品详情 +func (s *WCampaign) RewardDetail(req *pb.RewardDetailReq, res *pb.RewardDetailRes) (err error) { + defer s.checkErr() + *res = pb.RewardDetailRes{} + container := new(containers.RewardDetail) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// UpdateStock 修改奖品库存 +func (s *WCampaign) UpdateStock(req *pb.UpdateStockReq, res *pb.UpdateStockRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionCampaignReward + reward, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = workerr.NotFound("reward not found") + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(reward.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if !cpn.IsPub() { + err = workerr.VerifyError("campaign not run") + return + } + + if reward.Stock == req.GetStock() { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(reward.ID)).UpdateSimple(m.Stock.Value(req.GetStock())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = app.Redis.Del(s.ctx, ckey.FissionCampaignRewardPool(reward.ID)) + operatelog.NewOperateLog(s.ctx).User(req.GetUserId(), req.GetIp()).UpdateRunningStock(reward.ID, reward.Stock, req.GetStock()) + + *res = pb.UpdateStockRes{} + return +} + +// CampaignTz 活动时区数据 +func (s *WCampaign) CampaignTz(req *pb.CampaignTzReq, res *pb.CampaignTzRes) (err error) { + defer s.checkErr() + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = workerr.NotFound("cpn not found") + return + } + + if cpn.ChildType != 0 { + + if cpn.Pid == 0 { + return + } + + cpn, err = cache.NewCampaign(s.ctx).FindById(cpn.Pid) + if err != nil { + err = s.BE().CacheError(err) + return + } + + } + + *res = pb.CampaignTzRes{ + List: []*pb.CampaignTzRes_One{ + { + Mark: cpn.GetLangMarks()[0], + TOffset: cpn.TOffset, + }, + }, + } + + if len(cpn.GetLangTypes()) == 1 { + return + } + + m := s.GetDao().FissionCampaignLang + list, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(cpn.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + res.List = append(res.List, &pb.CampaignTzRes_One{ + Mark: v.LangMark, + TOffset: v.TOffset, + }) + } + + return +} + +// CampaignRewardType 活动奖品类型 +func (s *WCampaign) CampaignRewardType(req *pb.CampaignRewardTypeReq, res *pb.CampaignRewardTypeRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionCampaignReward + list, err := m.WithContext(s.ctx).Where(m.CampaignID.Eq(req.GetId())).Find() + if err != nil { + return s.BE().MysqlError(err) + } + *res = pb.CampaignRewardTypeRes{ + List: make([]*pb.CampaignRewardTypeRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.CampaignRewardTypeRes_One{ + Id: v.ID, + RewardType: int32(v.RewardType), + }) + } + + return +} + +// ChildList 子活动列表 +func (s *WCampaign) ChildList(req *pb.ChildListReq, res *pb.ChildListRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectId(), req.GetProjectHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return + } + + m := s.GetDao().FissionCampaign + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.ProjectID.Eq(project.ID), + m.Target.Eq(mtype.FissionCampaignConfigTargetChild), + } + + if req.GetTitle() != "" { + cond = append(cond, m.Title.Like(utils.DbAllLike(req.GetTitle()))) + } + + if len(req.GetPids()) > 0 { + cond = append(cond, m.Pid.In(req.GetPids()...)) + } + + if len(req.GetStatus()) != 0 { + var status = make([]int8, 0, len(req.GetStatus())) + for _, v := range req.GetStatus() { + status = append(status, int8(v)) + } + cond = append(cond, m.Status.In(status...)) + } + + if len(req.GetChildType()) != 0 { + var status = make([]int8, 0, len(req.GetChildType())) + for _, v := range req.GetChildType() { + status = append(status, int8(v)) + } + cond = append(cond, m.ChildType.In(status...)) + } + + if len(req.GetFissionId()) != 0 { + cond = append(cond, m.FissionID.In(req.GetFissionId()...)) + } + + if len(req.GetCampaignId()) != 0 { + cond = append(cond, m.Pid.In(req.GetCampaignId()...)) + } + + if req.GetStart() > 0 { + cond = append(cond, m.TStart.Gte(req.GetStart())) + } + + if req.GetEnd() > 0 { + cond = append(cond, m.TEnd.Lte(req.GetEnd())) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.ChildListRes{ + List: make([]*pb.ChildListRes_One, 0, len(list)), + Total: total, + } + + var cpnIds []int64 + var cpnMap = make(map[int64]string) + for _, v := range list { + if _, ok := cpnMap[v.Pid]; !ok && v.Pid > 0 { + cpnIds = append(cpnIds, v.Pid) + cpnMap[v.Pid] = "" + } + } + + if len(cpnIds) > 0 { + var cpns []*model.FissionCampaign + cpns, err = m.WithContext(s.ctx).Where(m.ID.In(cpnIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, cpn := range cpns { + cpnMap[cpn.ID] = cpn.Title + } + } + + for _, v := range list { + one := &pb.ChildListRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + FissionId: v.FissionID, + FissionMark: consts.FissionIdMap[v.FissionID], + StartTime: v.TStart, + EndTime: v.TEnd, + Status: int32(v.Status), + ChildType: int32(v.ChildType), + BindCampaign: "", + HasReport: 0, + } + + if pTitle, ok := cpnMap[v.Pid]; ok { + one.BindCampaign = pTitle + one.HasReport = 1 + } + + res.List = append(res.List, one) + } + + return +} + +// ChildStore 子活动列表 +func (s *WCampaign) ChildStore(req *pb.ChildStoreReq, res *pb.ChildStoreRes) (err error) { + defer s.checkErr() + *res = pb.ChildStoreRes{} + + container := new(containers.ChildStore) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOl()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ChildUpdate 更新子活动 +func (s *WCampaign) ChildUpdate(req *pb.ChildUpdateReq, res *pb.ChildUpdateRes) (err error) { + defer s.checkErr() + *res = pb.ChildUpdateRes{} + + container := new(containers.ChildUpdate) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOl()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ChildShow 子活动活动 +func (s *WCampaign) ChildShow(req *pb.ChildShowReq, res *pb.ChildShowRes) (err error) { + defer s.checkErr() + *res = pb.ChildShowRes{} + + container := new(containers.ChildShow) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// TaskCenterJump 子活动列表 +func (s *WCampaign) TaskCenterJump(req *pb.TaskCenterJumpReq, res *pb.TaskCenterJumpRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.ctx).Where(m.ID.In(req.GetCpnIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + projectId := list[0].ProjectID + + project, err := cache.NewProject(s.ctx).FindById(projectId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + channelM := s.GetDao().FissionCampaignChannel + channels, err := channelM.WithContext(s.ctx).Where( + channelM.CampaignID.In(req.GetCpnIds()...), + channelM.CType.Eq(mtype.FissionCampaignChannelTypeApp), + channelM.IsDefault.Eq(mtype.Yes), + channelM.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var channelMark = make(map[int64]string, len(channels)) + for _, v := range channels { + channelMark[v.CampaignID] = v.Mark + } + + *res = pb.TaskCenterJumpRes{ + List: make([]*pb.TaskCenterJumpRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.TaskCenterJumpRes_One{ + Id: v.ID, + JumpUrl: blink.NewCampaignLink( + project.Domain, + v.HashID, + channelMark[v.ID], + blink.SetTaskCenter(req.GetCenterHashId(), req.GetModuleId()), + ).CampaignShareLink(), + }) + } + + return +} + +// CondList 活动任务数据 +func (s *WCampaign) CondList(req *pb.CondListReq, res *pb.CondListRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionCampaignCond + + list, err := m.WithContext(s.ctx).Where(m.ID.In(req.GetIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.CondListRes{ + List: make([]*pb.CondListRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.CondListRes_One{ + Id: v.ID, + Desc: v.Desc, + Event: v.Event, + Conds: []*pb.CondListRes_Cond{ + { + EventKey: v.EventKey, + EventVal: v.EventVal, + IfCond: int32(v.IfCond), + }, + }, + }) + } + + return +} + +// Campaigns 获取活动数据 +func (s *WCampaign) Campaigns(req *pb.CampaignsReq, res *pb.CampaignsRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.ctx).Where(m.ID.In(req.GetCampaignIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.CampaignsRes{ + List: make([]*pb.CampaignsRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.CampaignsRes_One{ + Id: v.ID, + Title: v.Title, + }) + } + + return +} + +// SetLvApi 设置动态用户等级动态api +func (s *WCampaign) SetLvApi(req *pb.SetLvApiReq, res *pb.SetLvApiRes) (err error) { + defer s.checkErr() + + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + conf, err := provider.NewFissionConfig(s.ctx, project) + if err != nil { + return + } + + err = conf.SetLvUrl(req.GetUrlId()) + if err != nil { + return + } + + *res = pb.SetLvApiRes{} + return +} + +// GetLvApi 获取动态用户等级动态api +func (s *WCampaign) GetLvApi(req *pb.GetLvApiReq, res *pb.GetLvApiRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + conf, err := provider.NewFissionConfig(s.ctx, project) + if err != nil { + return + } + + url, err := conf.GetLvUrl() + if err != nil || url == nil { + return + } + + *res = pb.GetLvApiRes{ + UrlId: url.ID, + Title: url.Title, + } + return +} + +// VsSettlement 赛事竞猜结算 +func (s *WCampaign) VsSettlement(req *pb.VsSettlementReq, res *pb.VsSettlementRes) (err error) { + defer s.checkErr() + + *res = pb.VsSettlementRes{} + container := new(containers.VsSettlement) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// VsSettlementInfo 赛事竞猜结算 +func (s *WCampaign) VsSettlementInfo(req *pb.VsSettlementInfoReq, res *pb.VsSettlementInfoRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionCampaignVsSchedule + schedule, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetScheduleId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if schedule == nil { + err = workerr.NotFound("not found schedule") + return + } + + slt := schedule.GetSettlement() + + var scoreMap = make(map[int64]string, len(slt.Scores)) + for _, v := range slt.Scores { + scoreMap[v.TeamId] = v.Score + } + + var vsTeamIds = schedule.GetVsTeamIds() + teamM := s.GetDao().FissionCampaignVsTeam + teams, err := teamM.WithContext(s.ctx).Where(teamM.ID.In(vsTeamIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamMap = make(map[int64]*pb.VsSettlementInfoRes_Team, len(teams)) + for _, v := range teams { + teamMap[v.ID] = &pb.VsSettlementInfoRes_Team{ + Id: v.ID, + Name: v.Name, + LogoImg: v.LogoImg, + Score: scoreMap[v.ID], + } + } + + *res = pb.VsSettlementInfoRes{ + WinType: slt.WinType, + WinTeamId: slt.WinTeamId, + Teams: make([]*pb.VsSettlementInfoRes_Team, 0, len(vsTeamIds)), + } + + for _, id := range vsTeamIds { + if _, ok := teamMap[id]; ok { + res.Teams = append(res.Teams, teamMap[id]) + } else { + res.Teams = append(res.Teams, &pb.VsSettlementInfoRes_Team{ + Id: id, + Score: scoreMap[id], + }) + } + } + + return +} + +// ActionList 行为列表 +func (s *WCampaign) ActionList(req *pb.ActionListReq, res *pb.ActionListRes) (err error) { + defer s.checkErr() + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + conf, err := cache.NewCampaignConfig(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + temp, err := cache.NewFissionTemp(s.ctx).FindById(cpn.TemplateID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + group, err := cache.NewFissionTempGroup(s.ctx).FindById(temp.GroupID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + pfa := fissionaction.NewActionList(s.ctx, cpn, conf, group) + + *res = pb.ActionListRes{ + ActionTypes: pfa.GetFissionAction(), + } + + return +} diff --git a/internal/service/w_campaign_stat.go b/internal/service/w_campaign_stat.go new file mode 100644 index 0000000..efc7b4f --- /dev/null +++ b/internal/service/w_campaign_stat.go @@ -0,0 +1,571 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + containers "joybuywork/internal/service/containers/campaignstat" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_stat" + "joybuywork/proto/go_proto/workerr" + "time" + + bi_fission_actionpb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_fission_action" +) + +type WCampaignStat struct { + Service +} + +// Summary 活动概览数据 +func (s *WCampaignStat) Summary(req *pb.SummaryReq, res *pb.SummaryRes) (err error) { + defer s.checkErr() + + *res = pb.SummaryRes{} + + container := new(containers.Summary) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Campaign 活动数据 +func (s *WCampaignStat) Campaign(req *pb.CampaignReq, res *pb.CampaignRes) (err error) { + defer s.checkErr() + + *res = pb.CampaignRes{} + + container := new(containers.Campaign) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Related 裂变数据 +func (s *WCampaignStat) Related(req *pb.RelatedReq, res *pb.RelatedRes) (err error) { + defer s.checkErr() + *res = pb.RelatedRes{} + + container := new(containers.Related) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Stat 统计事件数据 +func (s *WCampaignStat) Stat(req *pb.StatReq, res *pb.StatRes) (err error) { + defer s.checkErr() + + *res = pb.StatRes{} + + container := new(containers.Stat) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Channel 渠道统计 +func (s *WCampaignStat) Channel(req *pb.ChannelReq, res *pb.ChannelRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil { + return + } + + m := s.GetDao().FissionCampaignChannel + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.CType.Eq(int8(req.GetCType())), + m.IsDel.Eq(mtype.No), + ).Order(m.ID).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + if total == 0 { + return + } + + var totalMark = []int32{ + mtype.FissionActionTypeAppInstall, + mtype.FissionActionTypeWebFirstOpen, + mtype.FissionActionTypeAppOpen, + } + + switch req.GetCType() { + case mtype.FissionCampaignChannelTypeApp: + totalMark = append(totalMark, mtype.FissionActionTypeView) + case mtype.FissionCampaignChannelTypeWeb: + totalMark = append(totalMark, mtype.FissionActionTypeViewWeb) + } + + var clickNum, clickUser = make(map[int64]int64), make(map[int64]int64) + var installNum, installUser = make(map[int64]int64), make(map[int64]int64) + var openNum, openUser = make(map[int64]int64), make(map[int64]int64) + for _, tm := range totalMark { + channelTotal, _ := app.NewFissionBiFissionAction().ChannelTotal(s.ctx, &bi_fission_actionpb.ChannelTotalReq{ + CampaignId: cpn.ID, + Type: tm, + Tz: 8, + Start: req.GetStartTime(), + End: req.GetEndTime(), + }) + + for _, v := range channelTotal.GetList() { + switch tm { + case mtype.FissionActionTypeAppInstall, mtype.FissionActionTypeWebFirstOpen: + installNum[v.GetChannelId()] += v.GetNum() + installUser[v.GetChannelId()] += v.GetUserNum() + case mtype.FissionActionTypeAppOpen: + openNum[v.GetChannelId()] += v.GetNum() + openUser[v.GetChannelId()] += v.GetUserNum() + case mtype.FissionActionTypeView, mtype.FissionActionTypeViewWeb: + clickNum[v.GetChannelId()] += v.GetNum() + clickUser[v.GetChannelId()] += v.GetUserNum() + } + } + } + + *res = pb.ChannelRes{ + List: make([]*pb.ChannelRes_One, 0, len(list)), + Total: total, + } + + project, err := finder.Project(s.ctx, cpn.ProjectID) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("not found project") + } + + for _, v := range list { + one := &pb.ChannelRes_One{ + Id: v.ID, + Title: v.Title, + Url: "", + ClickNum: clickNum[v.ID], + ClickUserNum: clickUser[v.ID], + InstallNum: installNum[v.ID], + InstallUserNum: installUser[v.ID], + OpenNum: openNum[v.ID], + OpenUserNum: openUser[v.ID], + } + + switch v.CType { + case mtype.FissionCampaignChannelTypeApp: + one.Url = blink.NewCampaignLink(project.Domain, cpn.HashID, v.Mark).CampaignShareLink() + case mtype.FissionCampaignChannelTypeWeb: + one.Url = blink.NewCampaignLink(project.Domain, cpn.HashID, v.Mark).CampaignWebLink() + } + + res.List = append(res.List, one) + } + + return +} + +// AdsSummary Ads总揽数据 +func (s *WCampaignStat) AdsSummary(req *pb.AdsSummaryReq, res *pb.AdsSummaryRes) (err error) { + defer s.checkErr() + *res = pb.AdsSummaryRes{} + container := new(containers.AdsSummary) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsTable Ads报表 +func (s *WCampaignStat) AdsTable(req *pb.AdsTableReq, res *pb.AdsTableRes) (err error) { + defer s.checkErr() + *res = pb.AdsTableRes{} + container := new(containers.AdsTable) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsReward Ads奖品 +func (s *WCampaignStat) AdsReward(req *pb.AdsRewardReq, res *pb.AdsRewardRes) (err error) { + defer s.checkErr() + + *res = pb.AdsRewardRes{} + container := new(containers.AdsReward) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// InAppBP 应用内埋点 +func (s *WCampaignStat) InAppBP(req *pb.InAppBPReq, res *pb.InAppBPRes) (err error) { + defer s.checkErr() + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaiginId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if cpn == nil || !verify.InArray(cpn.Status, mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre) || cpn.ReportType != mtype.FissionCampaignReportTypeNew { + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil || user.IsView == mtype.Yes { + return + } + + bp := fissionaction.NewMarkPoint(s.ctx).InApp(user) + //支持埋点类型(5-活动按钮点击,6-点击分享按钮,10-点击去完成,18-点击去使用,19-长图点击, + //21-我的任务弹窗,22-我的奖励记录弹窗,23-规则,24-展示表单,25-复制联系方式,29-展示弹窗,31-回答题目,37-点击立即翻牌,40-点击自定义按钮,53-进入ai对话) + switch req.GetType() { + case mtype.FissionActionTypeClickPlay: + bp.ClickPlay(time.Now().Unix(), req.GetIp(), req.GetFrom()) + case mtype.FissionActionTypeClickShare: + bp.ClickShare(time.Now().Unix(), req.GetMediaId(), req.GetIp()) + case mtype.FissionActionTypeToUse: + bp.ToUse(time.Now().Unix(), req.GetRewardId(), req.GetIp(), req.GetFrom()) + case mtype.FissionActionTypeClickCond: + bp.ClickCond(time.Now().Unix(), req.GetCondId(), req.GetIp(), req.GetFrom()) + case mtype.FissionActionTypeClickLongImg: + bp.ClickLongImg(time.Now().Unix(), req.GetImgUrl(), req.GetImgId(), req.GetZoneId(), req.GetIp()) + case mtype.FissionActionTypeClickMyTask: + bp.ClickMyTask(time.Now().Unix(), req.GetIp()) + case mtype.FissionActionTypeClickMyReward: + bp.ClickMyReward(time.Now().Unix(), req.GetIp()) + case mtype.FissionActionTypeClickRule: + bp.ClickRule(time.Now().Unix(), req.GetIp()) + case mtype.FissionActionTypeFormShow: + bp.FormShow(time.Now().Unix(), req.GetFormShowStatus(), req.GetFrom(), req.GetRewardId(), req.GetRewardRecordId()) + case mtype.FissionActionTypeCopyContact: + bp.CopyContact(time.Now().Unix(), req.GetFrom(), req.GetRewardId()) + case mtype.FissionActionTypeShowWindow: + bp.ShowWindow(time.Now().Unix(), req.GetFrom()) + case mtype.FissionActionTypeAnswerQa: + bp.AnswerQa(time.Now().Unix(), req.GetQaId(), req.GetQaOptionId(), req.GetIsRight()) + case mtype.FissionActionTypeClickFlip: + bp.ClickFlip(time.Now().Unix(), req.GetClickFlipStatus()) + case mtype.FissionActionTypeClickCustomBtn: + bp.ClickCustomBtn(time.Now().Unix(), req.GetCustomBtnId()) + case mtype.FissionActionTypeClickChat: + bp.ClickChat(time.Now().Unix(), req.GetChatFrom(), req.GetChatTipMsg()) + case mtype.FissionActionTypeClickUnoCard: + bp.ClickUnoCard(time.Now().Unix(), req.GetColorMark(), req.GetCardNo(), req.GetUnoCardId()) + default: + } + + *res = pb.InAppBPRes{} + return +} + +// OutAppBP 应用外埋点 +func (s *WCampaignStat) OutAppBP(req *pb.OutAppBPReq, res *pb.OutAppBPRes) (err error) { + defer s.checkErr() + cpn, err := cache.NewCampaign(s.ctx).FindByHashId(req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if cpn == nil || !verify.InArray(cpn.Status, mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre) || cpn.ReportType != mtype.FissionCampaignReportTypeNew { + return + } + + channel, err := cmm.NewCMM(s.ctx, s.GetDao()).UserBindChannel(cpn.ID, req.GetCid()) + if err != nil { + return + } + + var parentId int64 + if req.GetParentUserId() != "" { + parent, err1 := cache.NewFissionUser(s.ctx, cpn.ID).FindBySubUserId(req.GetParentUserId()) + if err1 != nil { + err = s.BE().CacheError(err1) + return + } + if parent != nil { + parentId = parent.ID + } + } + + bp := fissionaction.NewMarkPoint(s.ctx).OutApp(cpn.ID, channel.ID, parentId, req.GetWebId(), req.GetPlatform(), req.GetLang()) + //埋点类型(1-访问活动,12-访问站外链接,13-活动按钮点击,7-浏览下载页行为, 8-点击下载按钮,9-浏览微信页行为,27-站内活动链接点击行为,51点击分享连接) + switch req.GetType() { + case mtype.FissionActionTypeView: + bp.View(time.Now().Unix(), req.GetIp(), req.GetOs(), req.GetOsVersion(), req.GetDeviceModel()) + case mtype.FissionActionTypeViewWeb: + bp.ViewWeb(time.Now().Unix(), req.GetIp(), req.GetOs(), req.GetOsVersion(), req.GetDeviceModel()) + case mtype.FissionActionTypeClickPlayWeb: + bp.ClickPlayWeb(time.Now().Unix(), 0) + case mtype.FissionActionTypeViewDownload: + bp.ViewDownload(time.Now().Unix(), req.GetDownloadFrom(), req.GetIp(), req.GetOs(), req.GetOsVersion(), req.GetDeviceModel()) + case mtype.FissionActionTypeClickDownload: + bp.ClickDownload(time.Now().Unix(), req.GetDownloadFrom()) + case mtype.FissionActionTypeViewWechat: + bp.ViewWechat(time.Now().Unix(), req.GetIp()) + case mtype.FissionActionTypeInAppOpenLink: + bp.InAppOpenLink(time.Now().Unix(), req.GetBlackbox(), req.GetUid()) + case mtype.FissionActionTypeClickShareLink: + if parentId > 0 { + bp.ClickShareLink(time.Now().Unix(), req.GetIp(), req.GetOs(), req.GetOsVersion(), req.GetDeviceModel()) + } + default: + + } + + *res = pb.OutAppBPRes{} + return +} + +// ReportInfo 报表信息 +func (s *WCampaignStat) ReportInfo(req *pb.ReportInfoReq, res *pb.ReportInfoRes) (err error) { + defer s.checkErr() + + *res = pb.ReportInfoRes{} + container := new(containers.ReportInfo) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// StatEvent 活动统计的维度 +func (s *WCampaignStat) StatEvent(req *pb.StatEventReq, res *pb.StatEventRes) (err error) { + defer s.checkErr() + + container := new(containers.StatEvent) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// DemTitle 维度标题数据 +func (s *WCampaignStat) DemTitle(req *pb.DemTitleReq, res *pb.DemTitleRes) (err error) { + defer s.checkErr() + *res = pb.DemTitleRes{} + container := new(containers.DemTitle) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// TopTen 活动前十排行榜 +func (s *WCampaignStat) TopTen(req *pb.TopTenReq, res *pb.TopTenRes) (err error) { + defer s.checkErr() + + *res = pb.TopTenRes{} + container := new(containers.TopTen) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// UserCycle 用户明细占比数据 +func (s *WCampaignStat) UserCycle(req *pb.UserCycleReq, res *pb.UserCycleRes) (err error) { + defer s.checkErr() + *res = pb.UserCycleRes{} + container := new(containers.UserCycle) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Active 用户活跃 +func (s *WCampaignStat) Active(req *pb.ActiveReq, res *pb.ActiveRes) (err error) { + defer s.checkErr() + + if !app.NewRedisLock(s.ctx, ckey.FissionStatActiveOnce(req.GetUserId())).SoftLock() { + return + } + + m := s.GetDao().FissionUserActive + info, err := m.WithContext(s.ctx).Where(m.UserID.Eq(req.GetUserId()), m.CampaignID.Eq(req.GetCampaignId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if info == nil { + err = m.WithContext(s.ctx).Create(withdefault.FissionUserActive(&model.FissionUserActive{ + CampaignID: req.GetCampaignId(), + UserID: req.GetUserId(), + LastActive: time.Now().Unix(), + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(info.ID)).UpdateSimple(m.LastActive.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.ActiveRes{} + return +} + +// ChildBP 应用内埋点 +func (s *WCampaignStat) ChildBP(req *pb.ChildBPReq, res *pb.ChildBPRes) (err error) { + defer s.checkErr() + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaiginId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + if cpn == nil || !verify.InArray(cpn.Status, mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre) || cpn.ReportType != mtype.FissionCampaignReportTypeNew { + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil || user.IsView == mtype.Yes { + return + } + + childCpn, err := cache.NewCampaign(s.ctx).FindByHashId(req.GetChildHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if childCpn == nil || !verify.InArray[int8](childCpn.Status, mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre) { + return + } + + childUser, err := cache.NewFissionChildUser(s.ctx).FindByUniqIdx(user.ID, childCpn.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if childUser == nil { + return + } + + userBp := fissionaction.NewMarkPoint(s.ctx).InApp(user) + childBp := fissionaction.NewMarkPoint(s.ctx).Child(childUser, user) + //支持埋点类型(43-点击子活动入口) + switch req.GetType() { + case mtype.FissionActionTypeChildShow: + userBp.ClickChild(time.Now().Unix(), cpn.ID, childCpn.ChildType) + childBp.ChildShow(time.Now().Unix()) + default: + } + *res = pb.ChildBPRes{} + return +} + +// ChildReportInfo 子活动报表信息 +func (s *WCampaignStat) ChildReportInfo(req *pb.ChildReportInfoReq, res *pb.ChildReportInfoRes) (err error) { + defer s.checkErr() + cpn, err := cache.NewCampaign(s.ctx).FindByHashId(req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.Target != mtype.FissionCampaignConfigTargetChild { + return + } + + var pTitle string + if cpn.Pid > 0 { + var pcpn *model.FissionCampaign + pcpn, err = cache.NewCampaign(s.ctx).FindById(cpn.Pid) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if pcpn != nil { + pTitle = pcpn.Title + } + } + + *res = pb.ChildReportInfoRes{ + HashId: cpn.HashID, + Title: cpn.Title, + StartTime: cpn.TStart, + EndTime: cpn.TEnd, + Status: int32(cpn.Status), + TOffset: cpn.TOffset, + ChildType: int32(cpn.ChildType), + PTitle: pTitle, + } + return +} diff --git a/internal/service/w_campaign_user.go b/internal/service/w_campaign_user.go new file mode 100644 index 0000000..f24d709 --- /dev/null +++ b/internal/service/w_campaign_user.go @@ -0,0 +1,5394 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/cmm" + containers "joybuywork/internal/service/containers/campaignuser" + "joybuywork/internal/service/notify" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/award" + "joybuywork/internal/service/provider/cachecurd" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/provider/projectuser" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/timez" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_campaign_user" + "joybuywork/proto/go_proto/workerr" + "errors" + "fmt" + "strings" + "time" + + grds "github.com/go-redis/redis/v8" + "github.com/golang-module/carbon/v2" + deventpb "gits.branchcn.com/backend/deeplink/proto/go_proto/devent" + bi_fission_actionpb "gits.branchcn.com/backend/fissionbi/proto/go_proto/bi_fission_action" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "gorm.io/gen" + "gorm.io/gen/field" +) + +type WCampaignUser struct { + Service +} + +// List 用户列表 +func (s *WCampaignUser) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + + *res = pb.ListRes{} + + container := new(containers.List) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Reward 用户奖励 +func (s *WCampaignUser) Reward(req *pb.RewardReq, res *pb.RewardRes) (err error) { + defer s.checkErr() + *res = pb.RewardRes{} + + container := new(containers.Reward) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Visit 访问活动 +func (s *WCampaignUser) Visit(req *pb.VisitReq, res *pb.VisitRes) (err error) { + defer s.checkErr() + *res = pb.VisitRes{} + + container := new(containers.Visit) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Play 用户活动数据 +func (s *WCampaignUser) Play(req *pb.PlayReq, res *pb.PlayRes) (err error) { + defer s.checkErr() + *res = pb.PlayRes{} + container := new(containers.Play) + { + container.Init(s.ctx, logic.WithOnce(ckey.FissionUserPlayOnce(req.GetId())), logic.WithErrData(req)) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// RewardUser 中奖用户列表 +func (s *WCampaignUser) RewardUser(req *pb.RewardUserReq, res *pb.RewardUserRes) (err error) { + defer s.checkErr() + *res = pb.RewardUserRes{} + + container := new(containers.RewardUser) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Info 用户信息 +func (s *WCampaignUser) Info(req *pb.InfoReq, res *pb.InfoRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId(), req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindBySubUserId(req.GetSubUserId()) + if err != nil { + return s.BE().CacheError(err) + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + var psuId string + if user.ParentID != 0 { + var parent *model.FissionUser + parent, err = finder.FissionUser(s.ctx, cpn.ID, user.ParentID) + if err != nil { + err = s.BE().CacheError(err) + return + } + psuId = parent.SubUserID + } + + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.ctx).Where(statM.UserID.Eq(user.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + rewardM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + list, err := rewardM.WithContext(s.ctx).Where(rewardM.UserID.Eq(user.ID), rewardM.Status.Eq(mtype.FissionRewardRecordStatusSuccess)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.InfoRes{ + SubUserId: user.SubUserID, + PsuId: psuId, + DirectNum: 0, + IndirectNum: 0, + Rewards: make([]*pb.InfoRes_Reward, 0, len(list)), + } + + if stat != nil { + res.DirectNum = stat.DirectNum + res.IndirectNum = stat.IndirectNum + } + + for _, v := range list { + res.Rewards = append(res.Rewards, &pb.InfoRes_Reward{ + CreatedTime: v.CreatedAt, + Title: v.Title, + }) + } + + return +} + +// Rank 排行榜 +func (s *WCampaignUser) Rank(req *pb.RankReq, res *pb.RankRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId(), req.GetCampaignHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + conf, err := cache.NewCampaignConfig(s.ctx).FindByCampaignId(cpn.ID) + if err != nil { + return s.BE().CacheError(err) + } + + m := s.GetDao().FissionUserStat + var order []field.Expr + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + m.IsDel.Eq(mtype.No), + } + + var t int32 = consts.FissionRankTypeSelfTask + + switch cpn.FissionID { + case consts.IdSignIn: + t = consts.FissionRankTypeSign + order = append(order, m.SignNum.Desc(), m.SignRewardNum.Desc(), m.ID) + cond = append(cond, m.SignNum.Gt(0)) + case consts.IdGrow: + t = consts.FissionRankTypeGrow + order = append(order, m.GrowNum.Desc(), m.GrowRewardNum.Desc(), m.ID) + cond = append(cond, m.GrowNum.Gt(0)) + default: + switch conf.Option { + case mtype.FissionCampaignConfigTargetOptionApp: + t = utils.Ternary[int32](conf.AppEvent == mtype.FissionCampaignConfigTargetAppEventRegister, consts.FissionRankTypeRegister, consts.FissionRankTypeInstall) + case mtype.FissionCampaignConfigTargetOptionFriend: + t = consts.FissionRankTypeFriendTarget + } + + if conf.Target == mtype.FissionCampaignConfigTargetUp || conf.Option == mtype.FissionCampaignConfigTargetOptionTask { + order = append(order, m.TargetNum.Desc(), m.IndirectTargetNum.Desc(), m.ID) + cond = append(cond, m.TargetNum.Gt(0)) + } else { + order = append(order, m.EffectiveNum.Desc(), m.IndirectEffectiveNum.Desc(), m.ID) + cond = append(cond, m.EffectiveNum.Gt(0)) + } + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(order...).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.RankRes{ + List: make([]*pb.RankRes_One, 0, len(list)), + Total: total, + Type: t, + } + + if total == 0 { + return + } + + var userIds []int64 + for _, v := range list { + userIds = append(userIds, v.UserID) + } + + um := s.GetDao().FissionUser.SubTable(cpn.ID) + ul, err := um.WithContext(s.ctx).Where(um.ID.In(userIds...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + var uMap = make(map[int64]string) + for _, v := range ul { + uMap[v.ID] = v.UserMark + } + + var condMap = make(map[int64][]*pb.RankRes_Cond) + if t == consts.FissionRankTypeSelfTask { + var userConds []*model.FissionUserCond + userCondM := s.GetDao().FissionUserCond + userConds, err = userCondM.WithContext(s.ctx).Where(userCondM.UserID.In(userIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userCondMap = make(map[int64]map[int64]int64) + for _, v := range userConds { + + if _, ok := userCondMap[v.UserID]; !ok { + userCondMap[v.UserID] = map[int64]int64{v.CondID: v.Num} + } else { + userCondMap[v.UserID][v.CondID] = v.Num + } + } + + var conds []*model.FissionCampaignCond + condM := s.GetDao().FissionCampaignCond + conds, err = condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(cpn.ID)). + Where( + condM.WithContext(s.ctx). + Or(condM.IsDel.Eq(mtype.No)). + Or(condM.IsDel.Eq(mtype.Yes), condM.DelUse.Eq(mtype.Yes)), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, id := range userIds { + for _, v := range conds { + one := &pb.RankRes_Cond{ + Desc: v.Desc, + Num: 0, + } + + if num, ok := userCondMap[id][v.ID]; ok { + one.Num = num + } + condMap[id] = append(condMap[id], one) + } + } + } + + for _, v := range list { + one := &pb.RankRes_One{ + SubUserId: uMap[v.UserID], + Conds: condMap[v.UserID], + } + + switch cpn.FissionID { + case consts.IdSignIn: + one.DirectNum = v.SignRewardNum + one.IndirectNum = v.SignNum + case consts.IdGrow: + one.DirectNum = v.GrowNum + one.IndirectNum = v.GrowRewardNum + default: + if conf.Target == mtype.FissionCampaignConfigTargetUp || conf.Option == mtype.FissionCampaignConfigTargetOptionTask { + one.DirectNum = v.TargetNum + one.IndirectNum = v.IndirectTargetNum + } else { + one.DirectNum = v.EffectiveNum + one.IndirectNum = v.IndirectEffectiveNum + } + } + + res.List = append(res.List, one) + } + + return +} + +// Lottery 活动抽奖 +func (s *WCampaignUser) Lottery(req *pb.LotteryReq, res *pb.LotteryRes) (err error) { + defer s.checkErr() + *res = pb.LotteryRes{} + container := new(containers.Lottery) + { + container.Init(s.ctx, logic.WithOnce(ckey.FissionUserLotteryOnce(req.GetUserId()))) + container.Req = req + container.Res = res + } + + err = container.Run() + return +} + +// Answer 活动答题 +func (s *WCampaignUser) Answer(req *pb.AnswerReq, res *pb.AnswerRes) (err error) { + defer s.checkErr() + *res = pb.AnswerRes{} + container := new(containers.Answer) + { + container.Init(s.ctx, logic.WithOnce(ckey.FissionUserAnswerOnce(req.GetUserId())), logic.WithBp()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Vote 活动投票 +func (s *WCampaignUser) Vote(req *pb.VoteReq, res *pb.VoteRes) (err error) { + defer s.checkErr() + *res = pb.VoteRes{} + container := new(containers.Vote) + { + container.Init(s.ctx, logic.WithOnce(ckey.FissionUserVoteOnce(req.GetUserId()))) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Notify 客户端回调 +func (s *WCampaignUser) Notify(req *pb.NotifyReq, res *pb.NotifyRes) (err error) { + defer s.checkErr() + *res = pb.NotifyRes{} + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err := m.WithContext(s.ctx).Where(m.UserID.Eq(user.ID), m.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if record == nil { + return workerr.NotFound("reward not found") + } + + // 不是待发送的就不用发送 + if record.Status != mtype.FissionRewardRecordStatusWait { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(record.ID)).UpdateSimple(m.Status.Value(mtype.FissionRewardRecordStatusSuccess)) + if err != nil { + return s.BE().MysqlError(err) + } + + ntfM := s.GetDao().FissionNotify + ntf := withdefault.FissionNotify(&model.FissionNotify{ + CampaignID: user.CampaignID, + RecordID: record.ID, + NotifyType: mtype.FissionNotifyTypeClient, + NotifyURL: "", + Token: "", + Body: req.GetBody(), + PushNum: record.RewardNum, + IsOk: mtype.Yes, + }) + + err = ntfM.WithContext(s.ctx).Create(ntf) + if err != nil { + return s.BE().MysqlError(err) + } + + respM := s.GetDao().FissionNotifyResp + err = respM.WithContext(s.ctx).Create(withdefault.FissionNotifyResp(&model.FissionNotifyResp{ + NotifyID: ntf.ID, + Resp: req.GetResp(), + })) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// AcceptReward 领取奖品 +func (s *WCampaignUser) AcceptReward(req *pb.AcceptRewardReq, res *pb.AcceptRewardRes) (err error) { + defer s.checkErr() + *res = pb.AcceptRewardRes{} + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + reward, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetRewardHashId()), m.CampaignID.Eq(cpn.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + err = workerr.NotFound("not found reward") + return + } + + // 不是待发送的就不用发送 + if reward.Status != mtype.FissionRewardRecordStatusWait { + return + } + + userId, userRewardId := reward.UserID, reward.ID + + // 没有回调就通知回调 + producer.NewCampaignNotice(s.ctx).CampaignRewardNotify(types.CampaignRewardNotify{ + CampaignId: cpn.ID, + UserId: userId, + UserRewardId: userRewardId, + }) + + return +} + +// TargetRule 达标规则 +func (s *WCampaignUser) TargetRule(req *pb.TargetRuleReq, res *pb.TargetRuleRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionUser.SubTable(req.GetCampaignId()) + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(req.GetCampaignId()), + m.ParentID.Eq(req.GetUserId()), + m.ParentID.Gt(0), + ).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + if total == 0 { + return + } + + var userIds []int64 + var userCondMap = make(map[int64]map[int64]int64) + for _, v := range list { + if _, ok := userCondMap[v.ID]; !ok { + userIds = append(userIds, v.ID) + userCondMap[v.ID] = map[int64]int64{} + } + } + + userCondM := s.GetDao().FissionUserCond + userConds, err := userCondM.WithContext(s.ctx).Where(userCondM.UserID.In(userIds...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range userConds { + userCondMap[v.UserID][v.CondID] = v.Num + } + + statM := s.GetDao().FissionUserStat + stat, err := statM.WithContext(s.ctx).Where(statM.UserID.Eq(req.GetUserId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.TargetRuleRes{ + List: make([]*pb.TargetRuleRes_One, 0, len(list)), + Total: total, + TargetNum: 0, + } + + if stat != nil { + var cpn *model.FissionCampaign + cpn, err = finder.Campaign(s.ctx, req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + switch cpn.FissionID { + case consts.IdReferral, consts.IdWinTogether: + res.TargetNum = stat.EffectiveNum + default: + res.TargetNum = stat.TargetNum + } + + } + + condM := s.GetDao().FissionCampaignCond + conds, err := condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(req.GetCampaignId())).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range list { + one := &pb.TargetRuleRes_One{ + SubUserId: utils.Ternary(v.SubUserID == "", v.DeviceID, v.SubUserID), + Cond: make([]*pb.TargetRuleRes_Cond, 0, len(conds)), + } + + for _, cond := range conds { + one.Cond = append(one.Cond, &pb.TargetRuleRes_Cond{ + Desc: cond.Desc, + Num: userCondMap[v.ID][cond.ID], + CondId: cond.ID, + }) + } + + res.List = append(res.List, one) + } + + return +} + +// Task 我的任务 +func (s *WCampaignUser) Task(req *pb.TaskReq, res *pb.TaskRes) (err error) { + defer s.checkErr() + + *res = pb.TaskRes{} + container := new(containers.Task) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Resend 补发奖品 +func (s *WCampaignUser) Resend(req *pb.ResendReq, res *pb.ResendRes) (err error) { + defer s.checkErr() + + lc := app.NewRedisLock(s.ctx, ckey.FissionRewardResendOnce(req.GetRewardHashId()), lock.SetExpire(20*time.Second)) + if !lc.SoftLock() { + return workerr.BusyError + } + defer lc.Release() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if record == nil { + return workerr.NotFound("not found record") + } + + if record.Status != mtype.FissionRewardRecordStatusFail { + switch record.Status { + case mtype.FissionRewardRecordStatusWait: + if record.CreatedAt+consts.DaySec > time.Now().Unix() { + return s.BE().VerifyError("can not resend") + } + default: + return s.BE().VerifyError("can not resend") + } + + } + + reward, err := cache.NewReward(s.ctx).FindById(record.BaseRewardID) + if err != nil { + return s.BE().CacheError(err) + } + + if reward == nil || reward.ReceiveType != mtype.RewardReceiveTypeNotify { + return + } + + url, err := cache.NewNotifyURL(s.ctx).FindById(reward.URLID) + if err != nil { + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, record.UserID) + if err != nil { + return s.BE().CacheError(err) + } + + var parentSubUserId string + if user.ParentID > 0 { + var parent *model.FissionUser + parent, err = finder.FissionUser(s.ctx, cpn.ID, user.ParentID) + if err != nil { + return s.BE().CacheError(err) + } + parentSubUserId = parent.SubUserID + } + + project, err := finder.Project(s.ctx, cpn.ProjectID) + if err != nil { + return s.BE().CacheError(err) + } + + _ = notify.Reward{ + CampaignId: record.CampaignID, + RewardId: record.ID, + UserId: user.ID, + ParentId: user.ParentID, + CampaignHashId: cpn.HashID, + RewardHashId: record.HashID, + KvData: reward.GetJustKvData(), + RewardType: record.RewardType, + RewardTitle: record.Title, + RewardNum: record.RewardNum, + SubUserId: user.SubUserID, + ParentSubUserId: parentSubUserId, + Lang: utils.STernary[string](user.UserLang, "", user.LangMark), + Title: cpn.Title, + MallRecordId: record.MallRecordID, + }.Send(s.ctx, url.URL, project.NotifyToken, project.PushLadder, url.GetHeaders()) + + record, err = m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.ResendRes{ + Status: int32(record.Status), + FailType: record.FailType, + FailMsg: record.FailMsg, + } + return +} + +// DynamicLink 获取用户动态链接 +func (s *WCampaignUser) DynamicLink(req *pb.DynamicLinkReq, res *pb.DynamicLinkRes) (err error) { + defer s.checkErr() + *res = pb.DynamicLinkRes{} + container := new(containers.DynamicLink) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// DylinkShow 获取用户动态链接详情 +func (s *WCampaignUser) DylinkShow(req *pb.DylinkShowReq, res *pb.DylinkShowRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionUserDylink + + lk, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + params := lk.GetParams() + + *res = pb.DylinkShowRes{ + MediaType: params.MediaType, + ImageText: nil, + } + + switch params.MediaType { + case mtype.FissionUserDyLinkMediaTypeImgText: + for _, text := range params.ImageText { + res.ImageText = append(res.ImageText, &pb.DylinkShowRes_ImageText{ + NickName: text.NickName, + Avatar: text.Avatar, + Title: text.Title, + Desc: text.Desc, + Image: text.Image, + }) + } + } + + return +} + +// SignIn 我的签到板 +func (s *WCampaignUser) SignIn(req *pb.SignInReq, res *pb.SignInRes) (err error) { + defer s.checkErr() + + *res = pb.SignInRes{} + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + player, err := players.NewSign(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + playerData, err := player.SignBoard(req.GetPageType(), req.GetNowMouth()) + if err != nil { + return + } + + *res = pb.SignInRes{ + SignDate: make([]*pb.SignInRes_SignDate, 0, len(playerData.SignDate)), + NowMouth: playerData.NowMouth, + CycleDate: make([]*pb.SignInRes_CycleDate, 0, len(playerData.CycleDate)), + } + + for _, v := range playerData.SignDate { + res.SignDate = append(res.SignDate, &pb.SignInRes_SignDate{ + Y: v.Y, + M: v.M, + D: v.D, + SignIn: v.SignIn, + Ban: v.Ban, + RewardId: v.RewardId, + Open: v.Open, + NowWeek: v.NowWeek, + NowDay: v.NowDay, + LastMiss: v.LastMiss, + NowMouth: v.NowMouth, + }) + } + + for _, v := range playerData.CycleDate { + res.CycleDate = append(res.CycleDate, &pb.SignInRes_CycleDate{ + SignTime: v.SignTime, + SignIn: v.SignIn, + NowDay: v.NowDay, + RewardId: v.RewardId, + RewardImg: v.RewardImg, + RewardTitle: v.RewardTitle, + IsSuper: v.IsSuper, + Y: v.Y, + M: v.M, + D: v.D, + }) + } + + return +} + +// Sign 签到 +func (s *WCampaignUser) Sign(req *pb.SignReq, res *pb.SignRes) (err error) { + defer s.checkErr() + + lc := app.NewRedisLock(s.ctx, ckey.FissionUserSignOnce(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.OnceLockError + return + } + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + sign, err := players.NewSign(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + status, reward, err := sign.SignIn(req.GetSignDate()) + if err != nil { + return + } + + *res = pb.SignRes{ + FailType: status, + } + + if reward != nil { + *res = pb.SignRes{ + FailType: status, + HasReward: true, + RewardTitle: reward.RewardTitle, + RewardNum: reward.RewardNum, + ImgUrl: reward.ImgUrl, + RewardId: reward.RewardId, + ReceiveType: reward.ReceiveType, + KvData: make([]*pb.SignRes_KV, 0, len(reward.KvData)), + Contact: reward.Contact, + } + + for _, v := range reward.KvData { + res.KvData = append(res.KvData, &pb.SignRes_KV{ + Key: v.Key, + Value: v.Value, + }) + } + } + + return +} + +// DiceMap 大富翁地图 +func (s *WCampaignUser) DiceMap(req *pb.DiceMapReq, res *pb.DiceMapRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("please login") + return + } + + dice, err := players.NewDice(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + maps, err := dice.DiceMap(req.GetMapHashId(), req.GetGoShowStep(), req.GetPrefixStep()) + if err != nil { + return + } + + *res = pb.DiceMapRes{ + List: make([]*pb.DiceMapRes_One, 0, len(maps)), + } + + for _, v := range maps { + res.List = append(res.List, &pb.DiceMapRes_One{ + MapHashId: v.MapHashId, + MarkType: v.MarkType, + RewardTitle: v.RewardTitle, + ImgUrl: v.ImgUrl, + RewardId: v.RewardId, + }) + } + + return +} + +// Dice 大富翁骰子 +func (s *WCampaignUser) Dice(req *pb.DiceReq, res *pb.DiceRes) (err error) { + defer s.checkErr() + + lc := app.NewRedisLock(s.ctx, ckey.FissionDiceOnce(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + return workerr.OnceLockError + } + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + dice, err := players.NewDice(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + var rollRes players.RollRes + switch req.GetMark() { + case mtype.FissionDicePropMarkFixedRoll: + rollRes, err = dice.FixRoll(req.GetVal()) + if err != nil { + return + } + default: + rollRes, err = dice.Roll() + if err != nil { + return + } + } + + *res = pb.DiceRes{ + FailType: rollRes.FailType, + MapHashId: rollRes.MapHashId, + RollNum: rollRes.RollNum, + MarkType: rollRes.MarkType, + RewardTitle: rollRes.RewardTitle, + ImgUrl: rollRes.ImgUrl, + IsIntact: rollRes.IsIntact, + Lack: rollRes.Lack, + RewardId: rollRes.RewardId, + } + + return +} + +// Grow 成长生命体 +func (s *WCampaignUser) Grow(req *pb.GrowReq, res *pb.GrowRes) (err error) { + defer s.checkErr() + + lifeM := s.GetDao().FissionGrowLife + life, err := lifeM.WithContext(s.ctx).Where(lifeM.UserID.Eq(req.GetUserId()), lifeM.IsGrow.Eq(mtype.Yes)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if life == nil { + *res = pb.GrowRes{ + GetGrow: true, + } + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + tz := provider.NewCampaignTZ(s.ctx, cpn, req.GetLangMark()) + + now, die := timez.GMTTime(tz.GetTz()), timez.GMTTime(tz.GetTz(), life.DieTime) + + if life.IsDie == mtype.No && die.Before(now) { + err = cmm.NewCMM(s.ctx, s.GetDao()).LifeStatus(life, true, 0) + if err != nil { + return + } + + life.IsDie = mtype.Yes + } + + *res = pb.GrowRes{ + GetGrow: false, + Title: life.Title, + Step: life.Step, + Num: life.Num, + WillDie: die.Before(now.AddDate(0, 0, 1)), + IsDie: life.IsDie == mtype.Yes, + MaxLv: false, + RewardTitle: "", + RewardUrl: "", + RewardId: 0, + } + + stepM := s.GetDao().FissionCampaignGrowStep + step, err := stepM.WithContext(s.ctx).Where(stepM.CampaignID.Eq(life.CampaignID), stepM.Step.Eq(life.Step+1), stepM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if step != nil { + res.LvUpNum = step.Num + res.DiffP = utils.PercentNoZero(life.Num, step.Num) + return + } + + recordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err := recordM.WithContext(s.ctx).Where( + recordM.ID.Eq(life.RecordID), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + return + } + + if record.FailType == mtype.FissionRewardRecordFailTypeCli && record.FailMsg == mtype.FissionRewardRecordFailTypeCliLackMsg { + res.Lack = true + } + + res.WillDie = false + res.IsDie = false + res.MaxLv = true + res.RewardTitle = record.Title + res.RewardUrl = record.ImgURL + res.RewardId = record.RewardID + + return +} + +// GetGrow 领养生命体 +func (s *WCampaignUser) GetGrow(req *pb.GetGrowReq, res *pb.GetGrowRes) (err error) { + defer s.checkErr() + + playerM := s.GetDao().FissionGrow + player, err := playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(req.GetUserId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + err = workerr.NotFound("not found player") + return + } + + lifeM := s.GetDao().FissionGrowLife + growing, err := lifeM.WithContext(s.ctx).Where(lifeM.UserID.Eq(player.UserID), lifeM.IsGrow.Eq(mtype.Yes)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + // 没有死亡,没有到最高等级,不重新领取 + if growing != nil && growing.IsDie == mtype.No && growing.RecordID == 0 { + return + } + + confM := s.GetDao().FissionCampaignGrow + conf, err := confM.WithContext(s.ctx).Where(confM.CampaignID.Eq(player.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf == nil { + err = workerr.NotFound("not found grow conf") + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.ctx).Where( + rewardM.CampaignID.Eq(player.CampaignID), + rewardM.RewardType.Eq(mtype.FissionCampaignRewardTypeApp), + rewardM.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + return + } + + defer func() { + if err != nil { + return + } + cpn, _ := cache.NewCampaign(s.ctx).FindById(player.CampaignID) + if cpn != nil && cpn.ReportType == mtype.FissionCampaignReportTypeNew { + user, _ := cache.NewFissionUser(s.ctx, cpn.ID).FindById(player.UserID) + fissionaction.NewMarkPoint(s.ctx).InApp(user).Grow(time.Now().Unix(), reward.ID) + } + }() + + lc := app.NewRedisLock(s.ctx, ckey.FissionGrowGetOnce(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + return + } + + tx := s.GetDao().Begin() + defer func() { + if err != nil { + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + lifeTx := tx.FissionGrowLife + _, err = lifeTx.WithContext(s.ctx).Where(lifeTx.UserID.Eq(player.UserID), lifeTx.IsGrow.Eq(mtype.Yes)).UpdateSimple(lifeTx.IsGrow.Value(mtype.No)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + err = lifeTx.WithContext(s.ctx).Create(withdefault.FissionGrowLife(&model.FissionGrowLife{ + UserID: player.UserID, + CampaignID: player.CampaignID, + Title: req.GetTitle(), + Num: 0, + Step: 0, + DieTime: carbon.Now().AddHours(int(conf.DieHour)).Timestamp(), + IsGrow: mtype.Yes, + RewardID: reward.ID, + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + recordM := tx.FissionGrowRecord + err = recordM.WithContext(s.ctx).Create(withdefault.FissionGrowRecord(&model.FissionGrowRecord{ + UserID: player.UserID, + CampaignID: player.CampaignID, + Mark: mtype.FissionGrowRecordGetGrow, + VarData: "", + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + statTx := tx.FissionUserStat + _, err = statTx.WithContext(s.ctx).Where(statTx.UserID.Eq(player.UserID)).UpdateSimple(statTx.GrowNum.Add(1)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.GetGrowRes{} + return +} + +// Feed 饲养生命体 +func (s *WCampaignUser) Feed(req *pb.FeedReq, res *pb.FeedRes) (err error) { + defer s.checkErr() + *res = pb.FeedRes{} + + container := new(containers.Feed) + { + container.Init(s.ctx, logic.WithOnce(ckey.FissionGrowFeedOnce(req.GetUserId())), logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// GetFeed 领取饲养道具 +func (s *WCampaignUser) GetFeed(req *pb.GetFeedReq, res *pb.GetFeedRes) (err error) { + defer s.checkErr() + *res = pb.GetFeedRes{} + + lc := app.NewRedisLock(s.ctx, ckey.FissionGrowGetFeedOnce(req.GetUserId(), req.GetMark())) + defer lc.Release() + if !lc.SoftLock() { + return + } + + playerM := s.GetDao().FissionGrow + player, err := playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(req.GetUserId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + err = workerr.NotFound("not found player") + return + } + + confM := s.GetDao().FissionCampaignGrow + conf, err := confM.WithContext(s.ctx).Where(confM.CampaignID.Eq(player.CampaignID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if conf == nil { + err = workerr.NotFound("not found grow conf") + return + } + + if req.GetMark() != "auto" { + return + } + + now := carbon.Now() + next := carbon.CreateFromTimestamp(player.PropsTime) + if next.Gt(now) { + return + } + + _, err = playerM.WithContext(s.ctx).Where(playerM.ID.Eq(player.ID)).UpdateSimple( + playerM.GrowNum.Add(conf.AutoNum), + playerM.AutoNum.Add(conf.AutoNum), + playerM.PropsTime.Value(now.AddHours(int(conf.AutoHour)).Timestamp()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// GrowRecord 成长记录 +func (s *WCampaignUser) GrowRecord(req *pb.GrowRecordReq, res *pb.GrowRecordRes) (err error) { + defer s.checkErr() + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.FissionID != consts.IdGrow { + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + tz := provider.NewCampaignTZ(s.ctx, cpn, user.LangMark) + + var date = carbon.Now().Timestamp() + if req.GetDate() != "" { + date = timez.GMTCarbon(tz.GetTz()).Parse(req.GetDate()).StartOfDay().Timestamp() + } + + recordM := s.GetDao().FissionGrowRecord + records, err := recordM.WithContext(s.ctx).Where( + recordM.UserID.Eq(req.GetUserId()), + recordM.CreatedAt.Lt(date), + ).Limit(20).Order(recordM.CreatedAt.Desc(), recordM.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + l := len(records) + if l == 0 { + return + } + + type DateGroup struct { + idx int + data []*pb.GrowRecordRes_Record + } + + var lastRecord *model.FissionGrowRecord + var idx int + var dateMap = make(map[string]*DateGroup) + for i, v := range records { + + ct := timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(v.CreatedAt) + sd := ct.Format(consts.Ymd_) + + d := &pb.GrowRecordRes_Record{ + Mark: v.Mark, + His: ct.Format(consts.His_), + VarData: nil, + } + for _, kv := range v.GetVarData() { + d.VarData = append(d.VarData, &pb.GrowRecordRes_KV{ + Key: kv.Key, + Value: kv.Value, + IdMark: kv.IdMark, + }) + } + + _, ok := dateMap[sd] + if !ok { + dateMap[sd] = &DateGroup{ + idx: idx, + data: []*pb.GrowRecordRes_Record{d}, + } + idx++ + + } else { + dateMap[sd].data = append(dateMap[sd].data, d) + } + + if i == l-1 { + lastRecord = v + } + } + + if lastRecord == nil { + return + } + + var ld = timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(lastRecord.CreatedAt) + sd := ld.Format(consts.Ymd_) + + var list []*model.FissionGrowRecord + list, err = recordM.WithContext(s.ctx).Where( + recordM.UserID.Eq(req.GetUserId()), + recordM.ID.Lt(lastRecord.ID), + recordM.CreatedAt.Lte(ld.EndOfDay().Timestamp()), + ).Order(recordM.CreatedAt.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + for _, v := range list { + ct := timez.GMTCarbon(tz.GetTz()).CreateFromTimestamp(v.CreatedAt) + d := &pb.GrowRecordRes_Record{ + Mark: v.Mark, + His: ct.Format(consts.His_), + VarData: nil, + } + for _, kv := range v.GetVarData() { + d.VarData = append(d.VarData, &pb.GrowRecordRes_KV{ + Key: kv.Key, + Value: kv.Value, + IdMark: kv.IdMark, + }) + } + + dateMap[sd].data = append(dateMap[sd].data, d) + } + + *res = pb.GrowRecordRes{ + List: make([]*pb.GrowRecordRes_One, len(dateMap)), + } + + for d, v := range dateMap { + res.List[v.idx] = &pb.GrowRecordRes_One{ + Date: d, + Records: v.data, + } + } + + return +} + +// ContentLink 内容链接 +func (s *WCampaignUser) ContentLink(req *pb.ContentLinkReq, res *pb.ContentLinkRes) (err error) { + defer s.checkErr() + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetUserId()) + if err != nil { + err = s.be.CacheError(err) + return + } + + ct, err := cmm.NewCMM(s.ctx, s.dao).CreateContentLink(user, req.GetMarkId(), req.GetMark()) + if err != nil { + return + } + + if ct.LinkURL != "" && user.ShareLink != ct.LinkURL { + userM := s.dao.FissionUser + _, err = userM.WithContext(s.ctx).Where(userM.ID.Eq(user.ID)).UpdateSimple(userM.ShareLink.Value(ct.LinkURL)) + if err != nil { + err = s.be.MysqlError(err) + return + } + + userMs := s.dao.FissionUser.SubTable(user.CampaignID) + _, err = userMs.WithContext(s.ctx).Where(userMs.ID.Eq(user.ID)).UpdateSimple(userMs.ShareLink.Value(ct.LinkURL)) + if err != nil { + err = s.be.MysqlError(err) + return + } + + _ = cache.NewFissionUser(s.ctx, user.CampaignID).Clear(user) + } + + *res = pb.ContentLinkRes{ + LinkUrl: ct.LinkURL, + } + + return +} + +// LinkContent 链接内容 +func (s *WCampaignUser) LinkContent(req *pb.LinkContentReq, res *pb.LinkContentRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionUserCtlink + + ct, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetCtId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if ct == nil { + return + } + + user, err := finder.FissionUser(s.ctx, ct.CampaignID, ct.UserID) + if err != nil { + err = s.be.CacheError(err) + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(ct.CampaignID) + if err != nil { + err = s.be.CacheError(err) + return + } + + *res = pb.LinkContentRes{ + Mark: ct.Mark, + } + + switch ct.Mark { + case mtype.FissionUserCtLinkMarkQa: + qam := s.GetDao().LibraryQa + + var qa *model.LibraryQa + qa, err = qam.WithContext(s.ctx).Where(qam.ID.Eq(ct.MarkID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if qa == nil { + res.Qa = &pb.LinkContentRes_Qa{HomeShare: true} + return + } + + optionM := s.GetDao().LibraryQaOption + var options []*model.LibraryQaOption + options, err = optionM.WithContext(s.ctx).Where(optionM.QaID.Eq(qa.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + res.Qa = &pb.LinkContentRes_Qa{ + Id: qa.ID, + HashId: qa.HashID, + Mark: qa.Mark, + Title: qa.Title, + CoverUrl: qa.CoverURL, + LinkUrl: qa.LinkURL, + Options: make([]*pb.LinkContentRes_Option, 0, len(options)), + AnswerMark: qa.AnswerMark, + } + + for _, v := range options { + res.Qa.Options = append(res.Qa.Options, &pb.LinkContentRes_Option{ + Id: v.ID, + Title: v.Title, + ImgUrl: v.ImgURL, + }) + } + + return + case mtype.FissionUserCtLinkMarkBallot: + rewardM := s.GetDao().FissionCampaignReward + var reward *model.FissionCampaignReward + + reward, err = rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(ct.MarkID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + if reward == nil { + return + } + + preward, _ := provider.NewRewards(s.ctx, cpn.ProjectID, reward.RewardID) + info := preward.AutoLang(reward.RewardID, user.LangMark) + + res.Ballot = &pb.LinkContentRes_Ballot{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + } + return + case mtype.FissionUserCtLinkMarkChop: + rewardM := s.GetDao().FissionCampaignReward + var rewards []*model.FissionCampaignReward + + rewards, err = rewardM.WithContext(s.ctx).Where(rewardM.CampaignID.Eq(ct.CampaignID), rewardM.IsDel.Eq(mtype.No)).Find() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + res.Chop = &pb.LinkContentRes_Chop{ + Rewards: make([]*pb.LinkContentRes_ChopReward, 0, len(rewards)), + } + + var bids []int64 + for _, v := range rewards { + bids = append(bids, v.RewardID) + } + + preward, _ := provider.NewRewards(s.ctx, cpn.ProjectID, bids...) + + for _, v := range rewards { + info := preward.AutoLang(v.RewardID, user.LangMark) + res.Chop.Rewards = append(res.Chop.Rewards, &pb.LinkContentRes_ChopReward{ + Title: info.Title, + ImgUrl: info.ImgUrl, + Selected: v.ID == ct.MarkID, + Id: v.ID, + }) + } + + return + } + + return +} + +// ChopSelect 选择砍一刀奖品 +func (s *WCampaignUser) ChopSelect(req *pb.ChopSelectReq, res *pb.ChopSelectRes) (err error) { + defer s.checkErr() + + user, err := finder.FissionUser(s.ctx, req.GetCampaignId(), req.GetUserId()) + if err != nil { + err = s.be.CacheError(err) + return + } + + chop, err := players.NewChop(s.ctx, user) + if err != nil { + return + } + + err = chop.SelectReward(req.GetRewardId()) + if err != nil { + return + } + + *res = pb.ChopSelectRes{} + return +} + +// ChopReselect 重选砍一刀奖品 +func (s *WCampaignUser) ChopReselect(req *pb.ChopReselectReq, res *pb.ChopReselectRes) (err error) { + defer s.checkErr() + user, err := finder.FissionUser(s.ctx, req.GetCampaignId(), req.GetUserId()) + if err != nil { + err = s.be.CacheError(err) + return + } + + chop, err := players.NewChop(s.ctx, user) + if err != nil { + return + } + + err = chop.Reselect() + if err != nil { + return + } + + canSelect, err := chop.ExistSelectReward() + if err != nil { + return + } + + *res = pb.ChopReselectRes{ + RewardNone: !canSelect, + } + return +} + +// ChopHelp 砍一刀助力记录 +func (s *WCampaignUser) ChopHelp(req *pb.ChopHelpReq, res *pb.ChopHelpRes) (err error) { + defer s.checkErr() + playerM := s.GetDao().FissionChop + player, err := playerM.WithContext(s.ctx).Where(playerM.UserID.Eq(req.GetUserId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if player == nil { + err = workerr.NotFound("not found player") + return + } + + if player.ChopRewardID == 0 { + return + } + + m := s.GetDao().FissionChopHelp + var cond = []gen.Condition{ + m.UserID.Eq(player.UserID), + m.ChopRewardID.Eq(player.ChopRewardID), + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.ChopHelpRes{ + List: make([]*pb.ChopHelpRes_One, 0, len(list)), + Total: total, + } + + if total == 0 { + return + } + + for _, v := range list { + res.List = append(res.List, &pb.ChopHelpRes_One{ + Id: v.ID, + Mark: v.Mark, + Percent: v.Percent, + CreatedTime: v.CreatedAt, + }) + } + + return +} + +// LevelList 用户等级列表 +func (s *WCampaignUser) LevelList(req *pb.LevelListReq, res *pb.LevelListRes) (err error) { + defer s.checkErr() + + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + return + } + + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.DeletedAt.Eq(0)).Order(m.ID).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.LevelListRes{ + List: make([]*pb.LevelListRes_One, 0, len(list)), + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + type Num struct { + LevelId int64 + Num int64 + } + + var num []*Num + relateM := s.GetDao().FissionUserLevelRelated + err = relateM.WithContext(s.ctx). + Select(relateM.LevelID, relateM.ID.Count().As("num")). + Where(relateM.LevelID.In(ids...), relateM.CancelTime.Eq(0)). + Group(relateM.LevelID). + Scan(&num) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var numMap = map[int64]int64{} + for _, v := range num { + numMap[v.LevelId] = v.Num + } + + for _, v := range list { + res.List = append(res.List, &pb.LevelListRes_One{ + Id: v.ID, + Title: v.Title, + Mark: v.Mark, + CreatedAt: v.CreatedAt, + Num: numMap[v.ID], + }) + } + + return +} + +// LevelStore 创建用户等级 +func (s *WCampaignUser) LevelStore(req *pb.LevelStoreReq, res *pb.LevelStoreRes) (err error) { + defer s.checkErr() + + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + err = workerr.NotFound("not found project") + return + } + + lc := app.NewRedisLock(s.ctx, ckey.FissionUserLevelOperateOnce(project.ID, req.GetMark())).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + m := s.GetDao().FissionUserLevel + exist, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.Mark.Eq(req.GetMark()), m.DeletedAt.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if exist != nil { + err = s.BE().VerifyError("level exist") + return + } + + err = m.WithContext(s.ctx).Create(withdefault.FissionUserLevel(&model.FissionUserLevel{ + ProjectID: project.ID, + Mark: req.GetMark(), + Title: req.GetTitle(), + })) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.LevelStoreRes{} + return +} + +// LevelEdit 更新用户等级 +func (s *WCampaignUser) LevelEdit(req *pb.LevelEditReq, res *pb.LevelEditRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionUserLevel + + c := cache.NewFissionUserLevel(s.ctx) + lv, err := c.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lv == nil || lv.DeletedAt > 0 { + err = workerr.NotFound("not found user level") + return + } + + lc := app.NewRedisLock(s.ctx, ckey.FissionUserLevelOperateOnce(lv.ProjectID, req.GetMark())).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + exist, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(lv.ProjectID), m.Mark.Eq(req.GetMark()), m.DeletedAt.Eq(0), m.ID.Neq(lv.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if exist != nil { + err = s.BE().VerifyError("level exist") + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(lv.ID)).UpdateSimple(m.Title.Value(req.GetTitle()), m.Mark.Value(req.GetMark())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = c.Clear(lv) + + *res = pb.LevelEditRes{} + return +} + +// LevelDestroy 删除用户等级 +func (s *WCampaignUser) LevelDestroy(req *pb.LevelDestroyReq, res *pb.LevelDestroyRes) (err error) { + defer s.checkErr() + m := s.GetDao().FissionUserLevel + + c := cache.NewFissionUserLevel(s.ctx) + lv, err := c.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if lv == nil || lv.DeletedAt > 0 { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(lv.ID)).UpdateSimple(m.DeletedAt.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = c.Clear(lv) + + *res = pb.LevelDestroyRes{} + return +} + +// ProjectList 项目参与用户列表 +func (s *WCampaignUser) ProjectList(req *pb.ProjectListReq, res *pb.ProjectListRes) (err error) { + defer s.checkErr() + + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + return + } + + m := s.GetDao().FissionCampaign + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var cpnMap = make(map[int64]*model.FissionCampaign) + var ids []int64 + for _, v := range list { + cpnMap[v.ID] = v + ids = append(ids, v.ID) + } + + userM := s.GetDao().FissionUser + + var cond = []gen.Condition{ + userM.IsDel.Eq(mtype.No), + userM.IsView.Eq(mtype.No), + userM.CampaignID.In(ids...), + userM.SubUserID.Neq(""), + } + + if req.GetStart() > 0 { + cond = append(cond, userM.CreatedAt.Gte(req.GetStart())) + } + + if req.GetEnd() > 0 { + cond = append(cond, userM.CreatedAt.Lte(req.GetEnd())) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + userList, total, err := userM.WithContext(s.ctx).Where(cond...).Order(userM.ID).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + if total == 0 { + return + } + + *res = pb.ProjectListRes{ + List: make([]*pb.ProjectListRes_One, 0, len(userList)), + Total: total, + } + + var shareCond = make(map[int64][]string) + var userIds = make([]int64, 0, len(list)) + for _, v := range userList { + userIds = append(userIds, v.ID) + shareCond[v.CampaignID] = append(shareCond[v.CampaignID], fmt.Sprint(v.ID)) + } + + statM := s.GetDao().FissionUserStat + stats, err := statM.WithContext(s.ctx).Where(statM.UserID.In(userIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var statMap = make(map[int64]*model.FissionUserStat, len(stats)) + for _, v := range stats { + statMap[v.UserID] = v + } + + for _, v := range userList { + one := &pb.ProjectListRes_One{ + Id: v.ID, + SubUserId: v.SubUserID, + HashId: v.HashID, + CampaignTitle: cpnMap[v.CampaignID].Title, + CampaignHashId: cpnMap[v.CampaignID].HashID, + CreatedAt: v.CreatedAt, + EffectNum: 0, + IsNew: int32(v.IsNew), + HelpStatus: 0, + } + + if v.ParentID > 0 { + one.HelpStatus = utils.Ternary[int32](v.IsHelp == mtype.Yes, 1, 2) + } + + if stat, ok := statMap[v.ID]; ok { + one.EffectNum = stat.EffectiveNum + } + + res.List = append(res.List, one) + } + + return +} + +// FinishStep 完成现金抽奖阶段 +func (s *WCampaignUser) FinishStep(req *pb.FinishStepReq, res *pb.FinishStepRes) (err error) { + defer s.checkErr() + lc := app.NewRedisLock(s.ctx, ckey.FissionUserFinishStepOnce(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.BusyError + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + cash, err := players.NewCash(s.ctx, user) + if err != nil { + return + } + + *res = pb.FinishStepRes{} + + switch req.GetStep() { + case mtype.FissionCashNextStepOpenGift: + res.OpenBox, res.LeftBox, res.RightBox, err = cash.OpenGift() + return + case mtype.FissionCashNextStepTriggerShare: + return cash.TriggerShare() + case mtype.FissionCashNextStepShowReward: + return cash.ShowReward() + case mtype.FissionCashNextStepLastSpin: + return cash.LastSpin() + default: + return + } + +} + +// Spin 现金转盘抽奖 +func (s *WCampaignUser) Spin(req *pb.SpinReq, res *pb.SpinRes) (err error) { + defer s.checkErr() + lc := app.NewRedisLock(s.ctx, ckey.FissionUserSpinOnce(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.BusyError + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + var id int64 + var failType int32 + switch cpn.FissionID { + case consts.IdGold: + var gold *players.Gold + gold, err = players.NewGold(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + id, failType, err = gold.Spin() + if err != nil { + return + } + default: + var cash *players.Cash + cash, err = players.NewCash(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + id, failType, err = cash.Spin() + if err != nil { + return + } + } + + *res = pb.SpinRes{ + Id: id, + FailType: failType, + } + return +} + +// CashRecords 现金转盘记录 +func (s *WCampaignUser) CashRecords(req *pb.CashRecordsReq, res *pb.CashRecordsRes) (err error) { + defer s.checkErr() + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + cash, err := players.NewCash(s.ctx, user) + if err != nil { + return + } + + player := cash.GetPlayer() + + if !verify.InArray(req.GetType(), mtype.FissionCashRecordTypeInvite, mtype.FissionCashRecordTypeEnergy, mtype.FissionCashRecordTypeCash) { + return + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + recordM := s.GetDao().FissionCashRecord + list, total, err := recordM.WithContext(s.ctx). + Where(recordM.CashID.Eq(player.ID), recordM.Type.Eq(int8(req.GetType()))). + Order(recordM.CreatedAt.Desc(), recordM.ID.Desc()). + FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + *res = pb.CashRecordsRes{ + List: make([]*pb.CashRecordsRes_One, 0, len(list)), + Total: total, + } + + switch req.GetType() { + case mtype.FissionCashRecordTypeInvite: + + var inviteIds []int64 + for _, v := range list { + inviteIds = append(inviteIds, v.GetDataInvite().UserId) + } + + var users []*model.FissionUser + userM := s.GetDao().FissionUser.SubTable(cpn.ID) + users, err = userM.WithContext(s.ctx).Where(userM.ID.In(inviteIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var userMap = make(map[int64]string) + for _, v := range users { + userMap[v.ID] = v.UserMark + } + + for _, v := range list { + invite := v.GetDataInvite() + res.List = append(res.List, &pb.CashRecordsRes_One{ + SubUserId: userMap[invite.UserId], + CreatedAt: v.CreatedAt, + IsHelp: invite.Help, + }) + } + case mtype.FissionCashRecordTypeCash: + for _, v := range list { + cashData := v.GetDataCash() + res.List = append(res.List, &pb.CashRecordsRes_One{ + TitleMark: cashData.TitleMark, + CreatedAt: v.CreatedAt, + DecOrAdd: cashData.DecOrAdd, + Val: cashData.Cash, + }) + } + case mtype.FissionCashRecordTypeEnergy: + for _, v := range list { + data := v.GetDataEnergy() + res.List = append(res.List, &pb.CashRecordsRes_One{ + TitleMark: data.TitleMark, + CreatedAt: v.CreatedAt, + DecOrAdd: data.DecOrAdd, + Val: data.Energy, + }) + } + default: + + } + + return +} + +// MixReward 合成奖品 +func (s *WCampaignUser) MixReward(req *pb.MixRewardReq, res *pb.MixRewardRes) (err error) { + defer s.checkErr() + + if !app.NewRedisLock(s.ctx, ckey.FissionUserMixReward(req.GetUserId())).SoftLock() { + return workerr.OnceLockError + } + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + dice, err := players.NewDice(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + reward, err := dice.MixReward(req.GetRewardId()) + if err != nil { + return + } + + *res = pb.MixRewardRes{ + Lack: reward.Lack, + RewardId: reward.RewardId, + RewardTitle: reward.RewardTitle, + ImgUrl: reward.ImgUrl, + ReceiveType: reward.ReceiveType, + KvData: make([]*pb.MixRewardRes_KV, 0, len(reward.KvData)), + Contact: reward.Contact, + RewardHashId: reward.RewardHashId, + OpenToUse: reward.OpenToUse, + WebUrl: reward.WebUrl, + AppParam: reward.AppParam, + PcParam: reward.PcParam, + } + + return +} + +// DiceRecord 骰子记录 +func (s *WCampaignUser) DiceRecord(req *pb.DiceRecordReq, res *pb.DiceRecordRes) (err error) { + defer s.checkErr() + *res = pb.DiceRecordRes{} + container := new(containers.DiceRecord) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// RewardForm 奖品需要填写的表单 +func (s *WCampaignUser) RewardForm(req *pb.RewardFormReq, res *pb.RewardFormRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId(), req.GetCampaignHashId()) + if err != nil { + return + } + + if cpn == nil { + err = workerr.NotFound("not found cpn") + return + } + + m := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + err = workerr.NotFound("not found record") + return + } + + user, err := finder.FissionUser(s.ctx, record.CampaignID, record.UserID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + if record.Status == mtype.FissionRewardRecordStatusSubmitForm { + rfm := s.GetDao().FissionRewardRecordForm + var recordForm *model.FissionRewardRecordForm + recordForm, err = rfm.WithContext(s.ctx).Where(rfm.RecordID.Eq(record.ID)).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + items := recordForm.GetItems() + + var form *model.Form + form, err = cache.NewForm(s.ctx).FindById(recordForm.FormID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + *res = pb.RewardFormRes{ + IsSubmit: true, + Title: form.Title, + Items: make([]*pb.RewardFormRes_Item, 0, len(items)), + Id: record.ID, + RewardId: record.RewardID, + } + + for _, item := range items { + res.Items = append(res.Items, &pb.RewardFormRes_Item{ + Name: item.Name, + Key: item.Key, + Value: item.Value, + }) + } + + return + } + + breward, err := cache.NewReward(s.ctx).FindById(record.BaseRewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if breward.ReceiveType != mtype.RewardReceiveTypeForm { + return + } + + form, err := cache.NewForm(s.ctx).FindById(breward.FormID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + items := form.GetItems() + + *res = pb.RewardFormRes{ + IsSubmit: false, + Title: form.Title, + Items: make([]*pb.RewardFormRes_Item, 0, len(items)), + Id: record.ID, + RewardId: record.RewardID, + } + + for _, v := range items { + res.Items = append(res.Items, &pb.RewardFormRes_Item{ + Name: v.GetTranName(req.GetLangMark()), + Key: v.Name, + Value: "", + }) + } + + return +} + +// SubmitForm 提交表单 +func (s *WCampaignUser) SubmitForm(req *pb.SubmitFormReq, res *pb.SubmitFormRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionRewardRecord.SubTable(req.GetCampaignId()) + record, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record == nil { + err = workerr.NotFound("not found record") + return + } + + switch record.Status { + case mtype.FissionRewardRecordStatusSubmitForm: + *res = pb.SubmitFormRes{ + FailType: 1, + } + + return + case mtype.FissionRewardRecordStatusFail: + *res = pb.SubmitFormRes{ + FailType: 3, + } + + return + default: + + } + + breward, err := cache.NewReward(s.ctx).FindById(record.BaseRewardID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if breward.ReceiveType != mtype.RewardReceiveTypeForm { + *res = pb.SubmitFormRes{ + FailType: 3, + } + return + } + + form, err := cache.NewForm(s.ctx).FindById(breward.FormID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + var items = form.GetItems() + var itemMap = make(map[string]struct{}) + for _, item := range form.GetItems() { + itemMap[item.Name] = struct{}{} + } + + var submitItems = make([]*mtype.SubmitFormItem, 0, len(items)) + for _, v := range req.GetItems() { + if _, ok := itemMap[v.GetKey()]; !ok { + continue + } + + submitItems = append(submitItems, &mtype.SubmitFormItem{ + Name: v.GetName(), + Key: v.GetKey(), + Value: v.GetValue(), + }) + } + + recordForm := withdefault.FissionRewardRecordForm(&model.FissionRewardRecordForm{ + CampaignID: record.CampaignID, + RecordID: record.ID, + FormID: form.ID, + Items: "", + }) + + recordForm.SetItems(submitItems) + + err = s.GetDao().FissionRewardRecordForm.WithContext(s.ctx).Create(recordForm) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(record.ID)).UpdateSimple(m.Status.Value(mtype.FissionRewardRecordStatusSubmitForm)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + user, _ := cache.NewFissionUser(s.ctx, record.CampaignID).FindById(record.UserID) + if user != nil { + fissionaction.NewMarkPoint(s.ctx).InApp(user).FormSubmit(time.Now().Unix(), record.RewardID, record.ID) + } + + return +} + +// GetAdsUrl 广告停留回传 +func (s *WCampaignUser) GetAdsUrl(req *pb.GetAdsUrlReq, res *pb.GetAdsUrlRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionCampaignCond + cond, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetCondId())).Take() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if cond == nil { + err = workerr.NotFound("not found cond") + return + } + + user, err := finder.FissionUser(s.ctx, cond.CampaignID, req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + ad, err := cache.NewProjectAd(s.ctx).FindByProjectId(cond.ProjectID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if ad == nil || ad.OpenAd == mtype.No { + err = workerr.NotFound("not open ad") + return + } + + eventVal := fmt.Sprint(cond.WatchSec) + jt := time.Now().Unix() + token := app.Encode(user.HashID, cond.Event, cond.EventKey, eventVal, jt) + err = app.Redis.Set(s.ctx, ckey.FissionUserAdsOnce(token), fmt.Sprint(cond.ID), consts.TimeDay) + if err != nil { + err = s.BE().RedisError(err) + return + } + + if cond.AdsStrategyID != "" { + *res = pb.GetAdsUrlRes{ + Url: blink.NewAdsJump(cond.AdsStrategyID, blink.SetAdsJumpLg(user.LangMark)).Link(), + Token: token, + UserHashId: user.HashID, + Event: cond.Event, + EventKey: cond.EventKey, + EventVal: eventVal, + JumpTime: jt, + } + + return + } + + act, host, uri := app.AdsRandOne(ad.AdStatus == mtype.ProjectAdStatusProd, ad.ProjectID) + + *res = pb.GetAdsUrlRes{ + Url: fmt.Sprintf("%s%s", host, uri), + Token: token, + UserHashId: user.HashID, + Event: cond.Event, + EventKey: cond.EventKey, + EventVal: eventVal, + JumpTime: jt, + AdG: &pb.GetAdsUrlRes_AdG{ + Adc: act, + GaShowId: ad.GaShowID, + GaEmbedId: ad.GaEmbedID, + GaDoubleId: ad.GaDoubleID, + }, + } + return +} + +// AdsStay 广告停留回传 +func (s *WCampaignUser) AdsStay(req *pb.AdsStayReq, res *pb.AdsStayRes) (err error) { + defer s.checkErr() + + if !app.TokenOk(req.GetToken(), req.GetUserHashId(), req.GetEvent(), req.GetEventKey(), req.GetEventVal(), req.GetJumpTime()) { + err = s.BE().VerifyError("params error") + return + } + + key := ckey.FissionUserAdsOnce(req.GetToken()) + defer func() { + if err == nil { + _ = app.Redis.Del(s.ctx, key) + } + }() + + nd := time.Now().Unix() - req.GetJumpTime() + st := utils.StrToInt64(req.GetEventVal()) + if nd < st { + sl := int32(st - nd) + *res = pb.AdsStayRes{ + StayLave: utils.Ternary[int32](sl < 0, 0, sl), + } + return + } + + condId, err := app.Redis.Cache.Get(s.ctx, key).Int64() + if !errors.Is(err, grds.Nil) && err != nil { + err = s.BE().CacheError(err) + return + } + + if errors.Is(err, grds.Nil) || condId == 0 { + err = nil + return + } + + cond, err := cache.NewCampaignCond(s.ctx).FindById(condId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cond == nil { + return + } + + user, err := finder.FissionUser(s.ctx, cond.CampaignID, req.GetUserHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes || !verify.InArray(cpn.Status, mtype.FissionCampaignStatusPubPre, mtype.FissionCampaignStatusPub) { + err = workerr.CEndError + return + } + + producer.NewCampaignNotice(s.ctx).ValidEvents(types.ValidEvents{ + UserId: user.ID, + NewUser: false, + BehaviorTime: time.Now().Unix(), + NoticeType: types.NoticeTypeCustom, + Event: req.GetEvent(), + EventData: []types.EventData{ + { + EventKey: req.GetEventKey(), + EventVal: "1", + }, + }, + EventType: mtype.FissionCampaignCondEventTypeAds, + AdsCondId: condId, + CampaignId: cpn.ID, + }) + + *res = pb.AdsStayRes{ + Done: true, + } + return +} + +// ClueNotified 通知信息已经被接收 +func (s *WCampaignUser) ClueNotified(req *pb.ClueNotifiedReq, res *pb.ClueNotifiedRes) (err error) { + defer s.checkErr() + + provider.NewFissionClue(s.ctx, req.GetUserId()).Notified() + + *res = pb.ClueNotifiedRes{} + return +} + +// ChangeUserLevel 修改用户等级 +func (s *WCampaignUser) ChangeUserLevel(req *pb.ChangeUserLevelReq, res *pb.ChangeUserLevelRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionCampaign + + list, err := m.WithContext(s.ctx). + Where( + m.ProjectID.Eq(req.GetProjectId()), + m.Status.In(mtype.FissionCampaignStatusPub, mtype.FissionCampaignStatusPubPre), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids []int64 + var cpnMap = make(map[int64]*model.FissionCampaign, len(list)) + for _, v := range list { + ids = append(ids, v.ID) + cpnMap[v.ID] = v + } + + confM := s.GetDao().FissionCampaignConfig + confList, err := confM.WithContext(s.ctx).Where(confM.CampaignID.In(ids...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(confList) == 0 { + return + } + + cc1 := cache.NewFissionUserAttr(s.ctx) + for _, v := range confList { + cc := cache.NewFissionUser(s.ctx, v.CampaignID) + var user *model.FissionUser + user, err = cc.FindBySubUserId(req.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + continue + } + + uct, _ := cmm.NewCMM(s.ctx, s.GetDao()).UserCampaignType(cpnMap[v.CampaignID], v, "", req.GetUserLevel(), "") + setLv := strings.Split(req.GetUserLevel(), ",") + + userM := s.GetDao().FissionUser + _, err = userM.WithContext(s.ctx).Where(userM.ID.Eq(user.ID)).UpdateSimple( + userM.LevelMark.Value(req.GetUserLevel()), + userM.UserLevel.Value(uct.LevelId), + userM.UserLevelMark.Value(uct.LevelMark), + userM.FixedUserLevel.Value(mtype.Yes), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + userMs := s.GetDao().FissionUser.SubTable(user.CampaignID) + _, err = userMs.WithContext(s.ctx).Where(userMs.ID.Eq(user.ID)).UpdateSimple( + userMs.LevelMark.Value(req.GetUserLevel()), + userMs.UserLevel.Value(uct.LevelId), + userMs.UserLevelMark.Value(uct.LevelMark), + userMs.FixedUserLevel.Value(mtype.Yes), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(user) + + attrVal := utils.Ternary[string](verify.InArray[string](uct.LevelMark, setLv...), uct.LevelMark, setLv[0]) + var attr *model.FissionUserAttr + attr, err = cache.NewFissionUserAttr(s.ctx).FindByUniqIdx(user.ID, mtype.FissionUserAttrMarkUserLv, cache.WithNilSet(func() ([]byte, error) { + pAttr := withdefault.FissionUserAttr(&model.FissionUserAttr{ + CampaignID: user.CampaignID, + UserID: user.ID, + Attr: mtype.FissionUserAttrMarkUserLv, + Value: attrVal, + Values: req.GetUserLevel(), + }) + + err = s.GetDao().FissionUserAttr.WithContext(s.ctx).Create(pAttr) + if err != nil { + return nil, err + } + + return jsonm.Marshal(pAttr) + })) + + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 如果没更新,或者平台是其他,就不用处理了 + if attrVal == attr.Value { + continue + } + + vals := attr.GetValues() + for _, lv := range setLv { + if !verify.InArray(lv, vals...) { + vals = append(vals, lv) + } + } + + attrM := s.GetDao().FissionUserAttr + _, err = attrM.WithContext(s.ctx).Where(attrM.ID.Eq(attr.ID)).UpdateSimple( + attrM.Value.Value(attrVal), + attrM.Values.Value(strings.Join(vals, ",")), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc1.Clear(attr) + } + + *res = pb.ChangeUserLevelRes{} + return +} + +// ChopReward 砍一刀可选奖品 +func (s *WCampaignUser) ChopReward(req *pb.ChopRewardReq, res *pb.ChopRewardRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + rewards, err := cmm.NewCMM(s.ctx, s.GetDao()).UserAppReward(user) + if err != nil { + return + } + + var bRewardIds []int64 + var limitIds []int64 + for _, reward := range rewards { + if reward.HasRule == mtype.Yes { + limitIds = append(limitIds, reward.ID) + } + bRewardIds = append(bRewardIds, reward.RewardID) + } + + prewards, _ := provider.NewRewards(s.ctx, 0, bRewardIds...) + + if len(limitIds) == 0 { + *res = pb.ChopRewardRes{ + Rewards: make([]*pb.ChopRewardRes_Reward, 0, len(rewards)), + } + + for _, reward := range rewards { + info, _ := prewards.InfoAutoLang(reward.RewardID, user.LangMark) + + res.Rewards = append(res.Rewards, &pb.ChopRewardRes_Reward{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + }) + } + + return + } + + ruleM := s.GetDao().FissionCampaignRewardRule + rules, err := ruleM.WithContext(s.ctx).Where(ruleM.CampaignID.Eq(user.CampaignID), ruleM.RewardID.In(limitIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ruleMap = make(map[int64]*model.FissionCampaignRewardRule, len(rules)) + for _, rule := range rules { + ruleMap[rule.RewardID] = rule + } + + type rewardGet struct { + RewardId int64 `json:"reward_id"` + Num int32 `json:"num"` + } + + var gets []*rewardGet + chopRewardM := s.GetDao().FissionChopReward + err = chopRewardM.WithContext(s.ctx). + Select(chopRewardM.ID.Count().As("num"), chopRewardM.RewardID). + Where(chopRewardM.UserID.Eq(user.ID), chopRewardM.RecordID.Gt(0)). + Group(chopRewardM.RewardID). + Scan(&gets) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var filterMap = make(map[int64]struct{}) + for _, v := range gets { + if rule, ok := ruleMap[v.RewardId]; ok && rule.CampaignLimit <= v.Num { + filterMap[v.RewardId] = struct{}{} + } + } + + *res = pb.ChopRewardRes{} + + for _, reward := range rewards { + if _, ok := filterMap[reward.ID]; ok { + continue + } + info, _ := prewards.InfoAutoLang(reward.RewardID, user.LangMark) + + res.Rewards = append(res.Rewards, &pb.ChopRewardRes_Reward{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + }) + } + + return +} + +// HelpPercent 助力进度 +func (s *WCampaignUser) HelpPercent(req *pb.HelpPercentReq, res *pb.HelpPercentRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + *res = pb.HelpPercentRes{} + + chop, err := players.NewChop(s.ctx, user) + if err != nil { + return + } + + res.IsFix, res.OldPercent, res.AddPercent = chop.HelpClue() + + return +} + +// InvokeCond 触发前置条件 +func (s *WCampaignUser) InvokeCond(req *pb.InvokeCondReq, res *pb.InvokeCondRes) (err error) { + defer s.checkErr() + user, err := finder.FissionUser(s.ctx, req.GetCampaignId(), req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionUserPreCond + pre, err := m.WithContext(s.ctx).Select(m.ID).Where(m.UserID.Eq(user.ID), m.PreCond.Eq(req.GetPreCond())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + taskM := s.GetDao().FissionCampaignTask + task, err := taskM.WithContext(s.ctx).Where( + taskM.CampaignID.Eq(user.CampaignID), + taskM.PreCond.Eq(req.GetPreCond()), + taskM.IsDel.Eq(mtype.No), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if task == nil { + return + } + + if pre == nil && verify.InArray(task.PreCond, mtype.FissionCampaignTaskPreCondClickIcon, mtype.FissionCampaignTaskPreCondWait30s) { + pre = withdefault.FissionUserPreCond(&model.FissionUserPreCond{ + CampaignID: user.CampaignID, + UserID: user.ID, + PreCond: task.PreCond, + ExpiredAt: time.Now().Add(time.Duration(task.ExpiredMin) * time.Minute).Unix(), + }) + + err = m.WithContext(s.ctx).Create(pre) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if pre == nil { + return + } + + condId := utils.FissionCampaignTaskMarkCondOneCondId(task.TaskMark) + cond, err := cache.NewCampaignCond(s.ctx).FindById(condId) + if err != nil { + err = s.BE().CacheError(err) + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(cond.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + // 用户当前语言是配置的语言 + var condLangMap = make(map[int64]*mtype.LangCond) + if verify.InArray(user.LangMark, cpn.GetLangMarks()...) { + lang, err1 := cache.NewCampaignLang(s.ctx).FindByCampaignId(user.CampaignID, user.LangMark) + if err1 != nil { + err = s.BE().CacheError(err1) + return + } + + if lang != nil { + for _, v := range lang.GetConds() { + condLangMap[v.CondId] = v + } + } + } + + var condExtra = make(map[string]*deventpb.GetCustomEventListRes_Info) + + eventRes, _ := app.NewDeepLinkEvent().GetCustomEventList(s.ctx, &deventpb.GetCustomEventListReq{ + ProjectId: cpn.ProjectID, + EventKeyList: []string{cond.Event}, + LangMark: user.LangMark, + }) + for _, v := range eventRes.GetList() { + condExtra[v.GetEventKey()] = v + } + + *res = pb.InvokeCondRes{ + Id: cond.ID, + Desc: cond.Desc, + IfCond: int32(cond.IfCond), + Event: cond.Event, + EventKey: cond.EventKey, + EventVal: cond.EventVal, + TaskChance: task.Chance, + WebUrl: cond.WebURL, + AppParam: cond.ExtraParam, + EventType: int32(cond.EventType), + ViewType: int32(cond.ViewType), + GoShow: int32(cond.GoShow), + AdsStrategyId: cond.AdsStrategyID, + IsSuper: int32(cond.IsSuper), + HasPre: int32(task.HasPre), + Reward: nil, + PropMark: task.PropMark, + ExpiredSec: pre.ExpiredAt - time.Now().Unix(), + PcParam: cond.PcParam, + } + + if condLang, ok := condLangMap[cond.ID]; ok { + res.Desc = condLang.Desc + } + + if cond.OpenJump == mtype.Yes { + if condLang, ok := condLangMap[cond.ID]; ok { + res.WebUrl = condLang.WebURL + res.AppParam = condLang.ExtraParam + res.PcParam = condLang.ExtraParam + } + } else { + if param, ok := condExtra[cond.Event]; ok { + res.WebUrl = param.WebUrl + res.AppParam = param.ExtraParam + res.PcParam = param.PcParam + } + } + + if task.RewardID == 0 { + return + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.ctx).Where(rewardM.ID.Eq(task.RewardID)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil { + return + } + + bewards, err := provider.NewRewards(s.ctx, cpn.ProjectID, reward.RewardID) + if err != nil { + return + } + + info := bewards.AutoLang(reward.RewardID, user.LangMark) + res.Reward = &pb.InvokeCondRes_Reward{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + } + + return +} + +// KeepReward 激励养成可选奖品 +func (s *WCampaignUser) KeepReward(req *pb.KeepRewardReq, res *pb.KeepRewardRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + rewards, err := cmm.NewCMM(s.ctx, s.GetDao()).UserAppReward(user) + if err != nil { + return + } + + var rewardIds, bRewardIds, limitIds []int64 + for _, reward := range rewards { + if reward.HasRule == mtype.Yes { + limitIds = append(limitIds, reward.ID) + } + bRewardIds = append(bRewardIds, reward.RewardID) + rewardIds = append(rewardIds, reward.ID) + } + + hmap, err := cachecurd.NewHMap(s.ctx, ckey.FissionKeepRewardSelectedUser(user.CampaignID), cachecurd.SetKeepRewardSelectBuild(user.CampaignID)) + if err != nil { + return + } + + selectReward, _ := hmap.Int64ToInt64() + var useStock = make(map[int64]int64, len(rewardIds)) + for _, id := range rewardIds { + useStock[id] = selectReward[id] + } + + prewards, _ := provider.NewRewards(s.ctx, 0, bRewardIds...) + + if len(limitIds) == 0 { + *res = pb.KeepRewardRes{ + Rewards: make([]*pb.KeepRewardRes_Reward, 0, len(rewards)), + } + + for _, reward := range rewards { + var status int32 + if int64(reward.Stock) <= useStock[reward.ID] { + status = 2 + } + + info := prewards.AutoLang(reward.RewardID, user.LangMark) + + res.Rewards = append(res.Rewards, &pb.KeepRewardRes_Reward{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + Num: useStock[reward.ID], + Status: status, + }) + } + + return + } + + ruleM := s.GetDao().FissionCampaignRewardRule + rules, err := ruleM.WithContext(s.ctx).Where(ruleM.CampaignID.Eq(user.CampaignID), ruleM.RewardID.In(limitIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ruleMap = make(map[int64]*model.FissionCampaignRewardRule, len(rules)) + for _, rule := range rules { + ruleMap[rule.RewardID] = rule + } + + type rewardGet struct { + RewardId int64 `json:"reward_id"` + Num int32 `json:"num"` + } + + var gets []*rewardGet + keepM := s.GetDao().FissionKeep + err = keepM.WithContext(s.ctx). + Select(keepM.ID.Count().As("num"), keepM.RewardID). + Where(keepM.UserID.Eq(user.ID)). + Group(keepM.RewardID). + Scan(&gets) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var filterMap = make(map[int64]struct{}) + for _, v := range gets { + if rule, ok := ruleMap[v.RewardId]; ok && rule.CampaignLimit <= v.Num { + filterMap[v.RewardId] = struct{}{} + } + } + + *res = pb.KeepRewardRes{} + + for _, reward := range rewards { + var status int32 + if _, ok := filterMap[reward.ID]; ok { + status = 3 + } else if int64(reward.Stock) <= useStock[reward.ID] { + status = 2 + } + + info := prewards.AutoLang(reward.RewardID, user.LangMark) + res.Rewards = append(res.Rewards, &pb.KeepRewardRes_Reward{ + Id: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + Num: useStock[reward.ID], + Status: status, + }) + } + + return +} + +// KeepSelect 选择激励养成奖品 +func (s *WCampaignUser) KeepSelect(req *pb.KeepSelectReq, res *pb.KeepSelectRes) (err error) { + defer s.checkErr() + + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + status, err := keepDog.RewardSelect(req.GetRewardId()) + if err != nil { + return + } + + *res = pb.KeepSelectRes{ + Status: status, + } + return +} + +// KeepCollect 激励养成收集一级道具 +func (s *WCampaignUser) KeepCollect(req *pb.KeepCollectReq, res *pb.KeepCollectRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + lc := app.NewRedisLock(s.ctx, ckey.FissionUserKeepDoingOnce(user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + num, gets, err := keepDog.Collect() + if err != nil { + return + } + + *res = pb.KeepCollectRes{ + Gets: make([]*pb.KeepCollectRes_Reward, 0, len(gets)), + Num: num, + } + + for _, get := range gets { + res.Gets = append(res.Gets, &pb.KeepCollectRes_Reward{ + RewardType: get.RewardType, + Chance: get.Chance, + RewardId: get.RewardId, + RewardTitle: get.RewardTitle, + RewardImg: get.RewardImg, + Lack: get.Lack, + LastReward: get.LastReward, + ReceiveType: get.ReceiveType, + }) + } + + return +} + +// KeepFeed 激励养成收集一级道具 +func (s *WCampaignUser) KeepFeed(req *pb.KeepFeedReq, res *pb.KeepFeedRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + lc := app.NewRedisLock(s.ctx, ckey.FissionUserKeepDoingOnce(user.ID)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = lc.Error() + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + status, addPercent, err := keepDog.Feed() + if err != nil { + return + } + + *res = pb.KeepFeedRes{ + Status: status, + AddPercent: addPercent, + } + return +} + +// MachineSave 激励养成保存机器道具 +func (s *WCampaignUser) MachineSave(req *pb.MachineSaveReq, res *pb.MachineSaveRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + err = keepDog.MachineSave(req.GetNum()) + if err != nil { + return + } + + *res = pb.MachineSaveRes{} + return +} + +// MachineRecycle 激励养成保存机器道具 +func (s *WCampaignUser) MachineRecycle(req *pb.MachineRecycleReq, res *pb.MachineRecycleRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + limit, getNum, err := keepDog.MachineRecycle(req.GetNum()) + if err != nil { + return + } + + conf := keepDog.GetConf() + + *res = pb.MachineRecycleRes{ + MachineLimit: limit, + NextFull: time.Now().Add(time.Duration(conf.OfflineMin)*time.Minute).Unix() - time.Now().Unix(), + GetNum: getNum, + } + + return +} + +// GetPropFeed 收喂养次数的道具 +func (s *WCampaignUser) GetPropFeed(req *pb.GetPropFeedReq, res *pb.GetPropFeedRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + num, err := keepDog.GetPropFeed() + if err != nil { + return + } + + *res = pb.GetPropFeedRes{ + Num: num, + } + return +} + +// KeepLog 激励养成记录 +func (s *WCampaignUser) KeepLog(req *pb.KeepLogReq, res *pb.KeepLogRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + player := keepDog.GetPlayer() + + m := s.GetDao().FissionKeepLog + + var cond = []gen.Condition{ + m.KeepID.Eq(player.ID), + } + + if len(req.GetType()) > 0 { + var ts = make([]int8, 0, len(req.GetType())) + for _, v := range req.GetType() { + ts = append(ts, int8(v)) + } + cond = append(cond, m.Type.In(ts...)) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.CreatedAt.Desc()).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.KeepLogRes{ + List: make([]*pb.KeepLogRes_One, 0, len(list)), + Total: total, + } + + for _, v := range list { + res.List = append(res.List, &pb.KeepLogRes_One{ + Type: int32(v.Type), + Source: v.Source, + Val: v.Val, + CreatedAt: v.CreatedAt, + }) + } + + return +} + +// KeepReselect 激励养成重新选择 +func (s *WCampaignUser) KeepReselect(req *pb.KeepReselectReq, res *pb.KeepReselectRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + status, err := keepDog.Reselect() + if err != nil { + return + } + + *res = pb.KeepReselectRes{ + Status: status, + } + return +} + +// KeepGuide 激励养成指引 +func (s *WCampaignUser) KeepGuide(req *pb.KeepGuideReq, res *pb.KeepGuideRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + reward, err := keepDog.Guided() + if err != nil { + return + } + + *res = pb.KeepGuideRes{ + RewardType: reward.RewardType, + Chance: reward.Chance, + RewardId: reward.RewardId, + RewardTitle: reward.RewardTitle, + RewardImg: reward.RewardImg, + Lack: reward.Lack, + ReceiveType: reward.ReceiveType, + } + return +} + +// KeepFirstInvite 激励养成首邀状态 +func (s *WCampaignUser) KeepFirstInvite(req *pb.KeepFirstInviteReq, res *pb.KeepFirstInviteRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + tz := provider.NewCampaignTZ(s.ctx, cpn, user.LangMark) + start, _ := timez.GMTTimeStart(tz.GetTz()) + + keepDog, err := players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + + status, err := keepDog.GetStatus() + if err != nil { + return + } + + conf := keepDog.GetConf() + + *res = pb.KeepFirstInviteRes{ + OpenInvite: int32(conf.OpenInvite), + DayFirstInvite: status.DayFirstInvite, + DayFirstFeed: status.DayFirstFeed, + ExpiredSec: start.Unix() - time.Now().Unix() + 86400, + } + return +} + +// Child 子活动信息 +func (s *WCampaignUser) Child(req *pb.ChildReq, res *pb.ChildRes) (err error) { + defer s.checkErr() + *res = pb.ChildRes{} + + container := new(containers.Child) + { + container.Init(s.ctx, logic.WithErrData(req)) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ChildActive 参与子活动 +func (s *WCampaignUser) ChildActive(req *pb.ChildActiveReq, res *pb.ChildActiveRes) (err error) { + defer s.checkErr() + *res = pb.ChildActiveRes{} + + container := new(containers.ChildActive) + { + container.Init(s.ctx, logic.WithErrData(req)) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// GoldFinishStep 完成金币任务阶段 +func (s *WCampaignUser) GoldFinishStep(req *pb.GoldFinishStepReq, res *pb.GoldFinishStepRes) (err error) { + defer s.checkErr() + lc := app.NewRedisLock(s.ctx, ckey.FissionUserFinishStepOnce(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.BusyError + return + } + + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + err = workerr.NotFound("not found cpn") + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + *res = pb.GoldFinishStepRes{} + + gold, err := players.NewGold(s.ctx, user) + if err != nil { + return + } + + switch req.GetStep() { + case mtype.FissionGoldNextStepOpenGift: + res.OpenBox, res.LeftBox, res.RightBox, err = gold.OpenGift() + return + case mtype.FissionGoldNextStepTriggerShare: + return gold.TriggerShare() + case mtype.FissionGoldNextStepShowReward: + return gold.ShowReward() + case mtype.FissionGoldNextStepLastSpin: + return gold.LastSpin() + case mtype.FissionGoldNextStepGoldRain: + return gold.GoldRain() + default: + return + } + +} + +// GoldNotify 金币获取通知 +func (s *WCampaignUser) GoldNotify(req *pb.GoldNotifyReq, res *pb.GoldNotifyRes) (err error) { + defer s.checkErr() + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + *res = pb.GoldNotifyRes{} + + gold, err := players.NewGold(s.ctx, user) + if err != nil { + return + } + + res.OldGold, res.AddGold = gold.Clue() + return +} + +// GoldRecord 金币获取记录 +func (s *WCampaignUser) GoldRecord(req *pb.GoldRecordReq, res *pb.GoldRecordRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + gold, err := players.NewGold(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + player := gold.GetPlayer() + + m := s.GetDao().FissionGoldLog + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, count, err := m.WithContext(s.ctx). + Where(m.CampaignID.Eq(cpn.ID), m.GoldID.Eq(player.ID), m.Type.Eq(mtype.FissionGoldLogTypeDoTask)). + Order(m.CreatedAt.Desc()). + FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.GoldRecordRes{ + List: make([]*pb.GoldRecordRes_One, 0, len(list)), + Total: count, + } + + var condIds []int64 + var condMap = make(map[int64]string) + for _, v := range list { + val := v.GetVal() + if _, ok := condMap[val.CondId]; !ok { + condIds = append(condIds, val.CondId) + condMap[val.CondId] = "" + } + } + + langTitle, err := provider.NewLangTitle(s.ctx, cpn, user.LangMark) + if err != nil { + return + } + + condMap, err = langTitle.GetCondTitle(condIds...) + if err != nil { + return + } + + for _, v := range list { + + val := v.GetVal() + title, ok := condMap[val.CondId] + + one := &pb.GoldRecordRes_One{ + Title: title, + GoldNum: val.Chance, + CreatedAt: v.CreatedAt, + Mark: utils.Ternary[string](ok, "record:completed_task", "record:completed_task_none"), + } + + if verify.InArray[string](v.Source, mtype.FissionLogSourceInstall, mtype.FissionLogSourceRegister) { + one.Mark = "record:completed_invite_task" + } + + res.List = append(res.List, one) + } + + return +} + +// Deduct 扣除积分 +func (s *WCampaignUser) Deduct(req *pb.DeductReq, res *pb.DeductRes) (err error) { + defer s.checkErr() + lc := app.NewRedisLock(s.ctx, ckey.FissionCoinChangeLock(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.OnceLockError + return + } + + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + player, err := players.NewCoin(s.ctx, user) + if err != nil { + return + } + + useNum, status, err := player.Deduct() + if err != nil { + return + } + + playerStatus, err := player.GetStatus() + if err != nil { + return + } + + *res = pb.DeductRes{ + Status: status, + Total: playerStatus.AllCoin, + UseNum: useNum, + GetCoin: playerStatus.GetCoin, + OpenSec: playerStatus.OpenSec, + } + return +} + +// Gain 领取积分 +func (s *WCampaignUser) Gain(req *pb.GainReq, res *pb.GainRes) (err error) { + defer s.checkErr() + lc := app.NewRedisLock(s.ctx, ckey.FissionCoinChangeLock(req.GetUserId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.OnceLockError + return + } + + user, err := cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + player, err := players.NewCoin(s.ctx, user) + if err != nil { + return + } + + getCoin, status, err := player.Gain() + if err != nil { + return + } + *res = pb.GainRes{ + Status: status, + GetCoin: getCoin, + } + return +} + +// CoinRecord 金币池记录 +func (s *WCampaignUser) CoinRecord(req *pb.CoinRecordReq, res *pb.CoinRecordRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignId(), req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.GetDao().FissionCoinLog + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + } + + var userMap = make(map[int64]string) + + if req.GetUserId() > 0 { + var user *model.FissionUser + user, err = cache.NewFissionUser(s.ctx, cpn.ID).FindById(req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + cond = append(cond, m.UserID.Eq(user.ID)) + userMap[user.ID] = user.SubUserID + } + + if req.GetSubUserId() != "" { + var user *model.FissionUser + user, err = cache.NewFissionUser(s.ctx, cpn.ID).FindBySubUserId(req.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + cond = append(cond, m.UserID.Eq(user.ID)) + userMap[user.ID] = user.SubUserID + } + + if len(req.GetType()) > 0 { + var status = make([]int8, 0, len(req.GetType())) + for _, v := range req.GetType() { + status = append(status, int8(v)) + } + cond = append(cond, m.Type.In(status...)) + } + + if req.GetSceneId() > 0 { + cond = append(cond, m.SceneID.Eq(req.GetSceneId())) + } + + if req.GetSource() != "" { + cond = append(cond, m.Source.Eq(req.GetSource())) + } + + tz := utils.STernary[int32](req.GetTOffset(), consts.DefaultTz, cpn.TOffset) + if req.GetStart() > 0 { + cond = append(cond, m.CreatedAt.Gte(timez.GMT(req.GetStart(), tz))) + } + + if req.GetEnd() > 0 { + cond = append(cond, m.CreatedAt.Lte(timez.GMT(req.GetEnd(), tz))) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, count, err := m.WithContext(s.ctx). + Where(cond...). + Order(m.CreatedAt.Desc()). + FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + sceneM := s.GetDao().FissionCoinScene + scenes, err := sceneM.WithContext(s.ctx).Where(sceneM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + gmt := utils.Ternary[string](cpn.TOffset < 0, fmt.Sprint(cpn.TOffset), fmt.Sprintf("+%d", cpn.TOffset)) + + var titleMap = make(map[int64]string, len(scenes)) + for _, v := range scenes { + day, _, _ := timez.GMTStartAndEndTs(cpn.TOffset, v.OpenTime) + titleMap[v.ID] = fmt.Sprintf("%s(GMT%s)", day, gmt) + } + + if req.GetUserId() == 0 && req.GetSubUserId() == "" { + var userId []int64 + for _, v := range list { + if _, ok := userMap[v.UserID]; !ok { + userId = append(userId, v.UserID) + } + } + + userM := s.GetDao().FissionUser.SubTable(cpn.ID) + var users []*model.FissionUser + users, err = userM.WithContext(s.ctx).Where(userM.ID.In(userId...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, v := range users { + userMap[v.ID] = v.SubUserID + } + } + + *res = pb.CoinRecordRes{ + List: make([]*pb.CoinRecordRes_One, 0, len(list)), + Total: count, + } + + for _, v := range list { + val := v.GetVal() + + res.List = append(res.List, &pb.CoinRecordRes_One{ + Id: v.ID, + Type: int32(v.Type), + CreatedAt: v.CreatedAt, + Source: v.Source, + Num: val.CoinNum, + SubUserId: userMap[v.UserID], + Title: titleMap[v.SceneID], + }) + } + + return +} + +// ChildList 子活动用户列表 +func (s *WCampaignUser) ChildList(req *pb.ChildListReq, res *pb.ChildListRes) (err error) { + defer s.checkErr() + *res = pb.ChildListRes{} + container := new(containers.ChildList) + { + container.Init(s.ctx, logic.WithErrData(req)) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ReceiveReward 领取奖励 +func (s *WCampaignUser) ReceiveReward(req *pb.ReceiveRewardReq, res *pb.ReceiveRewardRes) (err error) { + defer s.checkErr() + + lc := app.NewRedisLock(s.ctx, ckey.FissionReceiveRewardLock(req.GetUserId(), req.GetTaskId())) + defer lc.Release() + if !lc.SoftLock() { + err = workerr.OnceLockError + return + } + + m := s.GetDao().FissionUserTaskReward + list, err := m.WithContext(s.ctx).Where( + m.UserID.Eq(req.GetUserId()), + m.TaskID.Eq(req.GetTaskId()), + m.ReceiveTime.Eq(0), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + var reward *award.RewardRes + var chance int32 + switch cpn.FissionID { + case consts.IdPrizeWheel: + var player *players.Wheel + player, err = players.NewWheel(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdBlindBox: + var player *players.Blind + player, err = players.NewBlind(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdLuckyGrid: + var player *players.Grid + player, err = players.NewGrid(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdFlip: + var player *players.Flip + player, err = players.NewFlip(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdSlotMachine: + var player *players.Slot + player, err = players.NewSlot(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdKeep: + var player *players.KeepDog + player, err = players.NewKeepDog(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdVs: + var player *players.Vs + player, err = players.NewVs(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + case consts.IdGashapon: + var player *players.Gashapon + player, err = players.NewGashapon(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + case consts.IdPrizeAnswer, consts.IdQa, consts.IdQaAudio, consts.IdQaVideo: + var player *players.Qa + player, err = players.NewQa(s.ctx, user, cpn.FissionID, players.SetCpn(cpn)) + if err != nil { + return + } + + chance, reward, err = player.ReceiveReward(list...) + if err != nil { + return + } + default: + return s.BE().VerifyError("Not supported") + } + + *res = pb.ReceiveRewardRes{ + PropMark: mtype.FissionCampaignRewardPropMarkChance, + Chance: chance, + Reward: nil, + } + + if reward != nil { + res.PropMark = reward.Reward.PropMark + res.Reward = &pb.ReceiveRewardRes_Reward{ + HashId: reward.Record.HashID, + Title: reward.Info.Title, + Img: reward.Info.ImgUrl, + JumpUrl: "", + KvData: nil, + ReceiveType: reward.Info.ReceiveType, + Contact: reward.Info.Contact, + CreatedAt: reward.Record.CreatedAt, + OpenToUse: reward.Info.OpenToUse, + WebUrl: reward.Info.WebUrl, + AppParam: reward.Info.AppParam, + PcParam: reward.Info.PcParam, + Lack: utils.Ternary[int32](reward.Record.FailMsg == mtype.FissionRewardRecordFailTypeCliLackMsg, 1, 0), + RewardNum: reward.Record.RewardNum, + } + + for _, v := range reward.Info.KvData { + res.Reward.KvData = append(res.Reward.KvData, &pb.ReceiveRewardRes_KV{ + Key: v.Key, + Value: v.Value, + IsShow: v.IsShow, + }) + } + + } + + return +} + +// LotteryLog 抽奖玩法日志 +func (s *WCampaignUser) LotteryLog(req *pb.LotteryLogReq, res *pb.LotteryLogRes) (err error) { + defer s.checkErr() + *res = pb.LotteryLogRes{} + container := new(containers.LotteryLog) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// UserList 活动用户数据 +func (s *WCampaignUser) UserList(req *pb.UserListReq, res *pb.UserListRes) (err error) { + defer s.checkErr() + + m := s.GetDao().FissionUser.SubTable(req.GetCampaignId()) + + var idsGroup = utils.Groups[int64](req.GetIds(), 200) + var list []*model.FissionUser + for _, ids := range idsGroup { + var parts []*model.FissionUser + + parts, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).Find() + if err != nil { + return + } + list = append(list, parts...) + } + + *res = pb.UserListRes{ + List: make([]*pb.UserListRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.UserListRes_One{ + Id: v.ID, + HashId: v.HashID, + SubUserId: v.SubUserID, + DeviceId: v.DeviceID, + }) + } + + return +} + +// CashAgain 现金大抽奖再玩一次 +func (s *WCampaignUser) CashAgain(req *pb.CashAgainReq, res *pb.CashAgainRes) (err error) { + defer s.checkErr() + + user, err := finder.FissionUser(s.ctx, req.GetCampaignId(), req.GetUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = s.BE().VerifyError("not found user") + return + } + + cash, err := players.NewCash(s.ctx, user) + if err != nil { + return + } + + err = cash.Again() + if err != nil { + return + } + + *res = pb.CashAgainRes{} + return +} + +// MarkLevel 用户等级标识列表 +func (s *WCampaignUser) MarkLevel(req *pb.MarkLevelReq, res *pb.MarkLevelRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil { + return + } + + m := s.GetDao().FissionUserLevel + list, err := m.WithContext(s.ctx).Where( + m.ProjectID.Eq(project.ID), + m.Mark.In(req.GetMarks()...), + m.DeletedAt.Eq(0), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.MarkLevelRes{ + List: make([]*pb.MarkLevelRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.MarkLevelRes_One{ + Id: v.ID, + Title: v.Title, + Mark: v.Mark, + }) + } + + return +} + +// DiceCollect 用户手机碎片 +func (s *WCampaignUser) DiceCollect(req *pb.DiceCollectReq, res *pb.DiceCollectRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + collectM := s.GetDao().FissionDiceCollect + collects, err := collectM.WithContext(s.ctx).Where(collectM.UserID.Eq(user.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + var collectMap = make(map[int64]*model.FissionDiceCollect) + for _, v := range collects { + collectMap[v.RewardID] = v + } + + rewards, err := cmm.NewCMM(s.ctx, s.GetDao()).UserAppReward(user) + if err != nil { + return + } + + var brIds []int64 + for _, v := range rewards { + brIds = append(brIds, v.RewardID) + } + + rewardM := s.GetDao().Reward + rewardList, err := rewardM.WithContext(s.ctx).Where(rewardM.ID.In(brIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var rewardTitle = make(map[int64]string, len(rewardList)) + for _, v := range rewardList { + rewardTitle[v.ID] = v.RewardTitle + } + + for _, reward := range rewards { + + one := &pb.DiceCollectRes_One{ + RewardId: reward.ID, + Num: 0, + CollectNum: reward.CollectNum, + Title: rewardTitle[reward.RewardID], + MixNum: 0, + MaxNum: reward.CollectNum, + } + + rule := reward.GetCollectRule() + + if rule.Open == mtype.Yes { + one.MaxNum = rule.InitCollect + } + + if collect, ok := collectMap[reward.ID]; ok { + one.Num = collect.Num + one.MixNum = collect.IntactNum + + if rule.Open == mtype.Yes { + one.MaxNum = rule.InitCollect * collect.SignNum + } + } + + res.List = append(res.List, one) + } + + return +} + +// ClientReward 用户手机碎片 +func (s *WCampaignUser) ClientReward(req *pb.ClientRewardReq, res *pb.ClientRewardRes) (err error) { + defer s.checkErr() + + var userId = req.GetUserId() + var projectId, cpnId int64 + if req.GetPorjectHashId() != "" { + var project *model.Project + project, err = finder.Project(s.ctx, req.GetPorjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project != nil { + projectId = project.ID + } + } + + if req.GetCampaignUserId() != 0 { + var user *model.FissionUser + user, err = cache.NewFissionUser(s.ctx, req.GetCampaignId()).FindById(req.GetCampaignUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user != nil { + userId = user.SubUserID + + var cpn *model.FissionCampaign + cpn, err = finder.Campaign(s.ctx, user.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn != nil { + projectId = cpn.ProjectID + cpnId = cpn.ID + } + } + } + + m := s.GetDao().FissionClientReward + var cond = []gen.Condition{ + m.UserID.Eq(userId), + m.ReceiveAt.Eq(0), + } + + if projectId > 0 { + cond = append(cond, m.ProjectID.Eq(projectId)) + } + + if cpnId > 0 { + cond = append(cond, m.CampaignID.Eq(cpnId)) + } + + *res = pb.ClientRewardRes{ + Rewards: make([]*pb.ClientRewardRes_Reward, 0, 20), + } + + var rewardMap = make(map[int64]*model.Reward) + var list []*model.FissionClientReward + err = m.WithContext(s.ctx).Where(cond...).FindInBatches(&list, 200, func(tx gen.Dao, batch int) error { + var ids []int64 + var recordIds []int64 + for _, v := range list { + ids = append(ids, v.ID) + recordIds = append(recordIds, v.RecordID) + } + + recordM := s.GetDao().FissionRewardRecord + records, err1 := recordM.WithContext(s.ctx).Where(recordM.ID.In(recordIds...)).Find() + if err1 != nil { + return s.BE().MysqlError(err) + } + + var rewardIds []int64 + for _, record := range records { + if _, ok := rewardMap[record.BaseRewardID]; !ok { + rewardMap[record.BaseRewardID] = nil + rewardIds = append(rewardIds, record.BaseRewardID) + } + } + + if len(rewardIds) > 0 { + rewardM := s.GetDao().Reward + var rewards []*model.Reward + rewards, err = rewardM.WithContext(s.ctx).Where(rewardM.ID.In(rewardIds...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, reward := range rewards { + rewardMap[reward.ID] = reward + } + } + + for _, record := range records { + one := &pb.ClientRewardRes_Reward{ + HashId: record.HashID, + CreatedAt: record.CreatedAt, + KvData: make([]*pb.ClientRewardRes_KV, 0), + } + + if reward, ok := rewardMap[record.BaseRewardID]; ok { + for _, kv := range reward.GetKvData() { + one.KvData = append(one.KvData, &pb.ClientRewardRes_KV{ + Key: kv.Key, + Value: kv.Value, + }) + } + } + + res.Rewards = append(res.Rewards, one) + } + + _, err = recordM.WithContext(s.ctx).Where(recordM.ID.In(recordIds...)).UpdateSimple(recordM.Status.Value(mtype.FissionRewardRecordStatusSuccess)) + if err != nil { + return s.BE().MysqlError(err) + } + + subM := s.GetDao().FissionRewardRecord.SubTable(cpnId) + _, err = subM.WithContext(s.ctx).Where(subM.ID.In(recordIds...)).UpdateSimple(subM.Status.Value(mtype.FissionRewardRecordStatusSuccess)) + if err != nil { + return s.BE().MysqlError(err) + } + + _, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).UpdateSimple(m.ReceiveAt.Value(time.Now().Unix())) + if err != nil { + return s.BE().MysqlError(err) + } + + return nil + }) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + return +} + +// PointsUse 积分兑换 +func (s *WCampaignUser) PointsUse(req *pb.PointsUseReq, res *pb.PointsUseRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + var status int32 + switch cpn.FissionID { + case consts.IdPrizeWheel: + var player *players.Wheel + player, err = players.NewWheel(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + status, err = player.PointsUse() + case consts.IdDice: + var player *players.Dice + player, err = players.NewDice(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + status, err = player.PointsUse() + case consts.IdGashapon: + var player *players.Gashapon + player, err = players.NewGashapon(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + status, err = player.PointsUse() + default: + return s.BE().VerifyError("Not supported") + } + + *res = pb.PointsUseRes{ + Status: status, + } + return +} + +// Chat Ai聊天 +func (s *WCampaignUser) Chat(req *pb.ChatReq, res *pb.ChatRes) (err error) { + defer s.checkErr() + *res = pb.ChatRes{} + container := new(containers.Chat) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ChatList Ai聊天 +func (s *WCampaignUser) ChatList(req *pb.ChatListReq, res *pb.ChatListRes) (err error) { + defer s.checkErr() + *res = pb.ChatListRes{} + container := new(containers.ChatList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ScheduleList 赛程信息 +func (s *WCampaignUser) ScheduleList(req *pb.ScheduleListReq, res *pb.ScheduleListRes) (err error) { + defer s.checkErr() + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + player, err := players.NewVs(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + schedules, err := player.Schedules(req.GetTabType()) + if err != nil { + return + } + + var list = make([]*pb.ScheduleListRes_One, 0, len(schedules)) + for _, schedule := range schedules { + one := &pb.ScheduleListRes_One{ + Id: schedule.Id, + Desc: schedule.Desc, + VsImg: schedule.VsImg, + VsDate: schedule.VsDate, + VsTz: schedule.VsTz, + VoteCountdown: schedule.VoteCountdown, + Status: schedule.Status, + WinType: schedule.WinType, + WinTeamId: schedule.WinTeamId, + Teams: make([]*pb.ScheduleListRes_Team, 0, len(schedule.Teams)), + UserVote: nil, + Reward: nil, + Votes: make([]*pb.ScheduleListRes_Vote, 0, len(schedule.Votes)), + OtherVote: schedule.OtherVote, + Scores: make([]*pb.ScheduleListRes_Score, 0, len(schedule.Scores)), + OpenOdds: schedule.OpenOdds, + OddsLeft: schedule.OddsLeft, + OddsRight: schedule.OddsRight, + OddsDraw: schedule.OddsDraw, + } + + if schedule.UserVote != nil { + one.UserVote = &pb.ScheduleListRes_UserVote{ + UserWinType: schedule.UserVote.UserWinType, + UserWinTeamId: schedule.UserVote.UserWinTeamId, + IsWin: schedule.UserVote.IsWin, + VoteNum: schedule.UserVote.VoteNum, + } + } + + for _, team := range schedule.Teams { + one.Teams = append(one.Teams, &pb.ScheduleListRes_Team{ + Id: team.Id, + Name: team.Name, + LogoImg: team.LogoImg, + Score: team.Score, + }) + } + + for _, vote := range schedule.Votes { + one.Votes = append(one.Votes, &pb.ScheduleListRes_Vote{ + WinType: vote.WinType, + WinTeamId: vote.WinTeamId, + Num: vote.Num, + }) + } + + for _, score := range schedule.Scores { + one.Scores = append(one.Scores, &pb.ScheduleListRes_Score{ + TeamId: score.TeamId, + Score: score.Score, + }) + } + + if reward := schedule.Reward; reward != nil { + one.Reward = &pb.ScheduleListRes_Reward{ + RewardId: reward.Id, + PropMark: reward.PropMark, + Title: reward.Title, + Img: reward.Img, + KvData: make([]*pb.ScheduleListRes_KV, 0, len(reward.KvData)), + ReceiveType: reward.ReceiveType, + Contact: reward.Contact, + OpenToUse: reward.OpenToUse, + WebUrl: reward.WebUrl, + AppParam: reward.AppParam, + PcParam: reward.PcParam, + PropNum: reward.PropNum, + } + for _, kv := range reward.KvData { + one.Reward.KvData = append(one.Reward.KvData, &pb.ScheduleListRes_KV{ + Key: kv.Key, + Value: kv.Value, + IsShow: kv.IsShow, + }) + } + } + + list = append(list, one) + } + + *res = pb.ScheduleListRes{ + List: list, + } + return +} + +// MallList 用户商城奖品列表 +func (s *WCampaignUser) MallList(req *pb.MallListReq, res *pb.MallListRes) (err error) { + defer s.checkErr() + *res = pb.MallListRes{} + container := new(containers.MallList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Exchange 商城奖品兑换 +func (s *WCampaignUser) Exchange(req *pb.ExchangeReq, res *pb.ExchangeRes) (err error) { + defer s.checkErr() + *res = pb.ExchangeRes{} + container := new(containers.Exchange) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// VoteList 投票列表 +func (s *WCampaignUser) VoteList(req *pb.VoteListReq, res *pb.VoteListRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUserStr(req.GetCampaignHashId(), req.GetUserHashId()) + if err != nil { + return + } + + m := s.GetDao().FissionVsVote + votes, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(cpn.ID), + m.UserID.Eq(user.ID), + ).Order(m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + teamM := s.GetDao().FissionCampaignVsTeam + teams, err := teamM.WithContext(s.ctx).Where( + teamM.CampaignID.Eq(cpn.ID), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var teamMap = make(map[int64]*pb.VoteListRes_Team, len(teams)) + for _, team := range teams { + teamMap[team.ID] = &pb.VoteListRes_Team{ + Id: team.ID, + Name: team.Name, + LogoImg: team.LogoImg, + } + } + + var scheduleIds []int64 + for _, vote := range votes { + scheduleIds = append(scheduleIds, vote.ScheduleID) + } + + scheduleM := s.GetDao().FissionCampaignVsSchedule + schedules, err := scheduleM.WithContext(s.ctx).Where( + scheduleM.ID.In(scheduleIds...), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var scheduleTeamMap = make(map[int64][]*pb.VoteListRes_Team, len(schedules)) + for _, schedule := range schedules { + for _, id := range schedule.GetVsTeamIds() { + scheduleTeamMap[schedule.ID] = append(scheduleTeamMap[schedule.ID], teamMap[id]) + } + } + + *res = pb.VoteListRes{ + List: make([]*pb.VoteListRes_One, 0, len(votes)), + } + + for _, vote := range votes { + res.List = append(res.List, &pb.VoteListRes_One{ + Id: vote.ID, + Teams: scheduleTeamMap[vote.ScheduleID], + WinType: int32(vote.WinType), + WinTeamId: vote.WinTeamID, + FreeVote: vote.FreeVote, + PointVote: vote.PointVote, + }) + } + + return +} + +// VsTipReward 接收投票结果 +func (s *WCampaignUser) VsTipReward(req *pb.VsTipRewardReq, res *pb.VsTipRewardRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + player, err := players.NewVs(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + err = player.TipReward() + if err != nil { + return + } + + *res = pb.VsTipRewardRes{} + return +} + +// UnoRandCard uno随机牌 +func (s *WCampaignUser) UnoRandCard(req *pb.UnoRandCardReq, res *pb.UnoRandCardRes) (err error) { + defer s.checkErr() + + *res = pb.UnoRandCardRes{} + container := new(containers.UnoRandCard) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOnce(ckey.FissionUserUnoRandCardOnce(req.GetUserId()))) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// UnoClaim uno领取牌奖励 +func (s *WCampaignUser) UnoClaim(req *pb.UnoClaimReq, res *pb.UnoClaimRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + player, err := players.NewUno(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + status, info, record, err := player.Claim(req.GetColorMark()) + if err != nil { + return + } + + *res = pb.UnoClaimRes{ + Status: status, + } + + if record != nil { + res.Id = record.ID + res.HashId = record.HashID + res.RewardId = record.RewardID + res.Title = info.Title + res.ImgUrl = info.ImgUrl + res.KvData = make([]*pb.UnoClaimRes_KV, 0, len(info.KvData)) + res.ReceiveType = info.ReceiveType + res.Contact = info.Contact + res.OpenToUse = info.OpenToUse + res.CustomRewardVal = record.CustomRewardVal + res.WebUrl = info.WebUrl + res.AppParam = info.AppParam + res.PcParam = info.PcParam + + for _, kv := range info.KvData { + res.KvData = append(res.KvData, &pb.UnoClaimRes_KV{ + Key: kv.Key, + Value: kv.Value, + IsShow: kv.IsShow, + }) + } + } + + return +} + +// UnoCard uno卡牌 +func (s *WCampaignUser) UnoCard(req *pb.UnoCardReq, res *pb.UnoCardRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUserStr(req.GetCampaignHashId(), req.GetUserHashId()) + if err != nil { + return + } + + m := s.GetDao().FissionUnoCollect + list, err := m.WithContext(s.ctx).Where(m.UserID.Eq(user.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var collectMap = make(map[string]*model.FissionUnoCollect, len(list)) + for _, v := range list { + collectMap[v.Mark] = v + } + + groupM := s.GetDao().FissionCampaignUnoGroup + groups, err := groupM.WithContext(s.ctx).Where(groupM.CampaignID.Eq(cpn.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.UnoCardRes{ + List: make([]*pb.UnoCardRes_One, 0, len(list)), + } + + for _, v := range groups { + + one := &pb.UnoCardRes_One{ + Id: v.ID, + Mark: v.Mark, + LimitNum: 9, + } + + if collect, ok := collectMap[v.Mark]; ok { + one.PreIntactNum = collect.PreIntactNum + one.IntactNum = collect.IntactNum + one.CardInfo = collect.GetCardInfo() + + if v.OpenRule == mtype.Yes { + rule := v.GetLimitRule() + one.LimitNum = rule.InitNum + rule.AddNum*(collect.SignNum/rule.SignDay) + if one.LimitNum > 9 { + one.LimitNum = 9 + } + } + } + + res.List = append(res.List, one) + } + + return +} + +// Show 用户详情 +func (s *WCampaignUser) Show(req *pb.ShowReq, res *pb.ShowRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUserStr(req.GetCampaignHashId(), req.GetUserHashId()) + if err != nil { + return + } + + attr := provider.NewFissionUserAttr(s.ctx, user) + + platform, err := attr.GetAttr(mtype.FissionUserAttrMarkPlatform) + if err != nil { + return + } + + var oss string + var os string + if platform != nil { + os = platform.Value + oss = platform.Values + } + + lang, _ := attr.GetAttr(mtype.FissionUserAttrMarkLang) + + var langMarks []string + if lang != nil { + langMarks = lang.GetValues() + } + + lv, _ := attr.GetAttr(mtype.FissionUserAttrMarkUserLv) + + var lvMarks string + if lv != nil { + lvMarks = lv.Values + } + + lastView, err := app.NewFissionBiFissionAction().FindLast(s.ctx, &bi_fission_actionpb.FindLastReq{ + CampaignId: cpn.ID, + Type: mtype.FissionActionTypeView, + UserMark: fmt.Sprint(user.ID), + }) + + if err != nil { + return + } + + *res = pb.ShowRes{ + Id: user.ID, + HashId: user.HashID, + UserId: user.SubUserID, + DeviceId: user.DeviceID, + CreatedAt: user.CreatedAt, + Source: int32(user.Source), + LangMark: user.LangMark, + LangMarks: langMarks, + LvMark: user.LevelMark, + LvMarks: lvMarks, + Os: os, + Oss: oss, + JoinAt: user.JoinAt, + JoinAtLast: lastView.GetActionTime(), + Tz: cpn.TOffset, + } + + return +} + +// EventFirstVisit 首次访问活动 +func (s *WCampaignUser) EventFirstVisit(req *pb.EventFirstVisitReq, res *pb.EventFirstVisitRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil { + return + } + + var rewards []*players.EventReward + switch cpn.FissionID { + case consts.IdVs: + var player *players.Vs + player, err = players.NewVs(s.ctx, user, players.SetCpn(cpn)) + if err != nil { + return + } + + rewards, err = player.FirstVisit() + if err != nil { + return + } + } + + *res = pb.EventFirstVisitRes{ + Rewards: make([]*pb.EventFirstVisitRes_EventReward, 0, len(rewards)), + } + + for _, v := range rewards { + var reward *pb.EventFirstVisitRes_Reward + if verify.InArray[string](v.PropMark, mtype.FissionCampaignRewardPropMarkPoint, mtype.FissionCampaignRewardPropMarkReward) { + record, info := v.Reward.Record, v.Reward.Info + reward = &pb.EventFirstVisitRes_Reward{ + Id: record.ID, + HashId: record.HashID, + RewardId: record.RewardID, + RewardNum: record.RewardNum, + Title: record.Title, + ImgUrl: record.ImgURL, + KvData: make([]*pb.EventFirstVisitRes_KV, 0, len(info.KvData)), + ReceiveType: info.ReceiveType, + Contact: info.Contact, + CustomRewardVal: record.CustomRewardVal, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + } + + for _, kv := range info.KvData { + reward.KvData = append(reward.KvData, &pb.EventFirstVisitRes_KV{ + Key: kv.Key, + Value: kv.Value, + IsShow: kv.IsShow, + }) + } + } + + res.Rewards = append(res.Rewards, &pb.EventFirstVisitRes_EventReward{ + PropMark: v.PropMark, + Reward: reward, + Chance: v.Chance, + }) + } + + return +} + +// FindByUniq 通过唯一键找用户id +func (s *WCampaignUser) FindByUniq(req *pb.FindByUniqReq, res *pb.FindByUniqRes) (err error) { + defer s.checkErr() + c := cache.NewFissionUser(s.ctx, req.GetCampaignId()) + + var user *model.FissionUser + if req.GetSubUserId() != "" { + user, err = c.FindBySubUserId(req.GetSubUserId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + if req.GetDeviceId() != "" { + user, err = c.FindBySubUserId(req.GetDeviceId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + } + + var id int64 + if user != nil { + id = user.ID + } + + *res = pb.FindByUniqRes{ + Id: id, + } + + return +} + +// TaskTip 任务提示 +func (s *WCampaignUser) TaskTip(req *pb.TaskTipReq, res *pb.TaskTipRes) (err error) { + defer s.checkErr() + + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil || cpn == nil || user == nil { + return + } + + list, err := players.GetTaskTip(s.ctx, user.ID) + if err != nil { + return + } + + *res = pb.TaskTipRes{ + Rewards: make([]*pb.TaskTipRes_EventReward, 0), + L: int32(len(list)), + } + + var hasCoin bool + var recordIds []int64 + for _, v := range list { + if v.PropMark == mtype.FissionCampaignRewardPropMarkPoint { + hasCoin = true + } + + if v.RecordId > 0 { + recordIds = append(recordIds, v.RecordId) + } + } + + var recordMap = make(map[int64]*model.FissionRewardRecord) + var preward *provider.Rewards + if len(recordIds) > 0 { + m := s.GetDao().FissionRewardRecord.SubTable(req.GetCampaignId()) + var records []*model.FissionRewardRecord + records, err = m.WithContext(s.ctx).Where(m.ID.In(recordIds...)).Find() + if err != nil { + return + } + + var bIds []int64 + var bMap = make(map[int64]struct{}) + for _, v := range records { + recordMap[v.ID] = v + + if _, ok := bMap[v.BaseRewardID]; !ok && v.BaseRewardID > 0 { + bIds = append(bIds, v.BaseRewardID) + bMap[v.BaseRewardID] = struct{}{} + } + } + + if len(bIds) > 0 { + preward, err = provider.NewRewards(s.ctx, cpn.ProjectID, bIds...) + if err != nil { + return + } + } + } + + var title, imgUrl string + if hasCoin { + title, imgUrl, _, err = cmm.NewCMM(s.ctx, s.GetDao()).GetCoinInfo(cpn.ProjectID, user.LangMark) + if err != nil { + return + } + } + + for _, v := range list { + + switch v.PropMark { + case mtype.FissionCampaignRewardPropMarkChance: + res.Rewards = append(res.Rewards, &pb.TaskTipRes_EventReward{ + PropMark: v.PropMark, + Reward: nil, + Chance: v.Chance, + }) + + case mtype.FissionCampaignRewardPropMarkReward: + r := recordMap[v.RecordId] + info, _ := preward.InfoAutoLang(r.BaseRewardID, user.LangMark) + var kv = make([]*pb.TaskTipRes_KV, 0, len(info.KvData)) + for _, d := range info.KvData { + kv = append(kv, &pb.TaskTipRes_KV{ + Key: d.Key, + Value: d.Value, + IsShow: d.IsShow, + }) + } + + res.Rewards = append(res.Rewards, &pb.TaskTipRes_EventReward{ + PropMark: v.PropMark, + Reward: &pb.TaskTipRes_Reward{ + Id: r.ID, + HashId: r.HashID, + RewardId: r.RewardID, + RewardNum: r.RewardNum, + Title: info.Title, + ImgUrl: info.ImgUrl, + KvData: kv, + ReceiveType: info.ReceiveType, + Contact: info.Contact, + CustomRewardVal: r.CustomRewardVal, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + }, + Chance: v.Chance, + }) + case mtype.FissionCampaignRewardPropMarkPoint: + r := recordMap[v.RecordId] + res.Rewards = append(res.Rewards, &pb.TaskTipRes_EventReward{ + PropMark: v.PropMark, + Reward: &pb.TaskTipRes_Reward{ + Id: r.ID, + HashId: r.HashID, + RewardId: r.RewardID, + RewardNum: r.RewardNum, + Title: title, + ImgUrl: imgUrl, + }, + Chance: r.RewardNum, + }) + } + } + + return +} + +// TaskTipOk 任务提示完成 +func (s *WCampaignUser) TaskTipOk(req *pb.TaskTipOkReq, res *pb.TaskTipOkRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil || cpn == nil || user == nil { + return + } + + players.DelTaskTip(s.ctx, user.ID, req.GetL()) + + *res = pb.TaskTipOkRes{} + return +} + +// CoinLog 金币日志 +func (s *WCampaignUser) CoinLog(req *pb.CoinLogReq, res *pb.CoinLogRes) (err error) { + defer s.checkErr() + cpn, user, err := s.CpnAndUser(req.GetCampaignId(), req.GetUserId()) + if err != nil || cpn == nil || user == nil { + return + } + + if user.SubUserID == "" { + return + } + + pu, err := projectuser.NewProjectUser(s.ctx, projectuser.WithInit(cpn.ProjectID, user.SubUserID)) + if err != nil { + return + } + + m := s.GetDao().ProjectUserCoinRecord + var cond = []gen.Condition{ + m.UserID.Eq(pu.GetProjectUser().ID), + m.Source.Eq(mtype.ProjectUserCoinSourceCampaign), + m.SourceID.Eq(cpn.ID), + m.CreatedAt.Gt(cpn.StartTime), + } + + if req.GetType() > 0 { + cond = append(cond, m.Type.Eq(int8(req.GetType()))) + } + + o, l := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(o, l) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if total == 0 { + return + } + + *res = pb.CoinLogRes{ + List: make([]*pb.CoinLogRes_One, 0, len(list)), + Total: total, + } + + for _, v := range list { + res.List = append(res.List, &pb.CoinLogRes_One{ + CreatedAt: v.CreatedAt, + Mark: fmt.Sprintf("coin_log:%s", v.Mark), + Num: v.Num, + Type: int32(v.Type), + }) + } + + return +} + +// AnswerHistory 答题历史 +func (s *WCampaignUser) AnswerHistory(req *pb.AnswerHistoryReq, res *pb.AnswerHistoryRes) (err error) { + defer s.checkErr() + cpn, err := cache.NewCampaign(s.ctx).FindById(req.GetCampaignId()) + if err != nil || cpn == nil { + return + } + + rewardM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + reward, err := rewardM.WithContext(s.ctx).Where(rewardM.CampaignID.Eq(cpn.ID), rewardM.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + answers := reward.GetAnswer() + + var qid []int64 + var selectMap = make(map[int64]map[int64]struct{}) + for _, v := range answers { + qid = append(qid, v.QID) + if _, ok := selectMap[v.QID]; !ok { + selectMap[v.QID] = make(map[int64]struct{}) + } + + for _, a := range v.AID { + selectMap[v.QID][a] = struct{}{} + } + } + + m := s.GetDao().LibraryQa + qa, err := m.WithContext(s.ctx).Where(m.ID.In(qid...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var qMap = make(map[int64]*model.LibraryQa) + for _, v := range qa { + qMap[v.ID] = v + } + + optionM := s.GetDao().LibraryQaOption + options, err := optionM.WithContext(s.ctx).Where(optionM.QaID.In(qid...), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var qaMap = make(map[int64][]*model.LibraryQaOption) + for _, option := range options { + qaMap[option.QaID] = append(qaMap[option.QaID], option) + } + + *res = pb.AnswerHistoryRes{ + List: make([]*pb.AnswerHistoryRes_One, 0, len(qid)), + } + + for _, v := range answers { + q, ok := qMap[v.QID] + if !ok { + continue + } + + one := &pb.AnswerHistoryRes_One{ + Id: q.ID, + HashId: q.HashID, + Mark: q.Mark, + Title: q.Title, + CoverUrl: q.CoverURL, + LinkUrl: q.LinkURL, + ExplainText: q.ExplainText, + ExplainImg: q.ExplainImg, + Options: make([]*pb.AnswerHistoryRes_Option, 0, len(qaMap[v.QID])), + AnswerMark: q.AnswerMark, + SelectOptionId: v.AID, + } + + for _, opt := range qaMap[v.QID] { + one.Options = append(one.Options, &pb.AnswerHistoryRes_Option{ + Id: opt.ID, + Title: opt.Title, + ImgUrl: opt.ImgURL, + IsRight: int32(opt.IsRight), + }) + } + + res.List = append(res.List, one) + } + + return +} diff --git a/internal/service/w_coin.go b/internal/service/w_coin.go new file mode 100644 index 0000000..f9abcc8 --- /dev/null +++ b/internal/service/w_coin.go @@ -0,0 +1,75 @@ +package service + +import ( + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/service/containers" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_coin" +) + +type WCoin struct { + Service +} + +// Save 积分配置保存 +func (s *WCoin) Save(req *pb.SaveReq, res *pb.SaveRes) (err error) { + defer s.checkErr() + + *res = pb.SaveRes{} + container := new(containers.CoinSave) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOnce(ckey.ProjectCoinCreateOnce(req.GetProjectHashId()))) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Show 积分配置展示 +func (s *WCoin) Show(req *pb.ShowReq, res *pb.ShowRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId(), req.GetProjectId()) + if err != nil { + return + } + + coin, err := cache.NewTCoin(s.ctx).FindByProjectId(project.ID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if coin == nil { + return + } + + m := s.GetDao().TCoinLang + langs, err := m.WithContext(s.ctx).Where(m.TCoinID.Eq(coin.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var list = make([]*pb.ShowRes_Lang, 0, len(langs)) + for _, l := range langs { + list = append(list, &pb.ShowRes_Lang{ + LangMark: l.LangMark, + Title: l.Title, + ImgUrl: l.ImgURL, + Rule: l.Rule, + IsDefault: int32(l.IsDefault), + }) + } + + *res = pb.ShowRes{ + Title: coin.Title, + OpenPush: int32(coin.OpenPush), + ExpSelect: coin.GetExpSelect(), + Langs: list, + } + + return +} diff --git a/internal/service/w_common.go b/internal/service/w_common.go new file mode 100644 index 0000000..b3b674a --- /dev/null +++ b/internal/service/w_common.go @@ -0,0 +1,256 @@ +package service + +import ( + "joybuywork/internal/config" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/queue/producer" + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils" + "joybuywork/internal/utils/upload" + pb "joybuywork/proto/go_proto/w_common" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen" +) + +type WCommon struct { + Service +} + +// PolicyToken 获取阿里云token +func (s *WCommon) PolicyToken(req *pb.PolicyTokenReq, res *pb.PolicyTokenRes) (err error) { + defer s.checkErr() + policy := upload.GetPolicy(req.FileSuffix) + + *res = pb.PolicyTokenRes{ + AccessKeyId: config.Config.Upload.AccessKey, + Host: config.Config.Upload.Host, + UploadUrl: config.Config.Upload.UploadUrl, + Expire: policy.Expire, + Signature: policy.Signature, + Dir: policy.Directory, + Policy: policy.Policy, + Key: policy.Key, + } + return +} + +// Whitelist 服务器白名单 +func (s *WCommon) Whitelist(req *pb.WhitelistReq, res *pb.WhitelistRes) (err error) { + defer s.checkErr() + + m := s.GetDao().ServerWhitelist + + *res = pb.WhitelistRes{} + + err = m.WithContext(s.ctx).Pluck(m.IP, &res.Ips) + if err != nil { + return s.BE().MysqlError(err) + } + + return +} + +// Download 下载 +func (s *WCommon) Download(req *pb.DownloadReq, res *pb.DownloadRes) (err error) { + defer s.checkErr() + + m := s.GetDao().ExportTask + + task := withdefault.ExportTask(&model.ExportTask{ + UserID: req.GetUserId(), + Mark: req.GetMark(), + Cond: "", + EptStatus: mtype.ExportTaskEptStatusDoing, + ExpiredAt: 0, + Filename: "", + FailMsg: "", + }) + + var data jsonm.JsonM + + switch req.Mark { + case mtype.ExportTaskMarkCampaignReport: + data, _ = jsonm.Marshal(req.CampaignReport) + case mtype.ExportTaskMarkFissionUser: + data, _ = jsonm.Marshal(req.FissionUser) + case mtype.ExportTaskMarkFissionRewardRecord: + data, _ = jsonm.Marshal(req.FissionRewardRecord) + case mtype.ExportTaskMarkFissionUserStat: + data, _ = jsonm.Marshal(req.FissionUserStat) + case mtype.ExportTaskMarkAdsTable: + data, _ = jsonm.Marshal(req.AdsTable) + case mtype.ExportTaskMarkNewUserList: + data, _ = jsonm.Marshal(req.NewUserList) + case mtype.ExportTaskMarkCoinRecord: + data, _ = jsonm.Marshal(req.CoinRecord) + case mtype.ExportTaskMarkChildList: + data, _ = jsonm.Marshal(req.ChildList) + default: + err = workerr.VerifyError("not found download type") + return + } + + task.Cond = data.ToString() + + err = m.WithContext(s.ctx).Create(task) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + producer.NewCampaignNotice(s.ctx).Download(types.Download{ + TaskId: task.HashID, + Mark: task.Mark, + Cond: data, + }) + + *res = pb.DownloadRes{ + HashId: task.HashID, + } + return +} + +// DownloadStatus 下载状态 +func (s *WCommon) DownloadStatus(req *pb.DownloadStatusReq, res *pb.DownloadStatusRes) (err error) { + defer s.checkErr() + m := s.GetDao().ExportTask + + task, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if task == nil { + err = workerr.NotFound("not found ept task") + return + } + + *res = pb.DownloadStatusRes{ + Status: int32(task.EptStatus), + Url: task.Filename, + FailMsg: task.FailMsg, + Progress: "", + } + + return +} + +// OperateLog dashboard操作日志 +func (s *WCommon) OperateLog(req *pb.OperateLogReq, res *pb.OperateLogRes) (err error) { + defer s.checkErr() + + _ = s.GetDao().OperateLog.WithContext(s.ctx).Create(withdefault.OperateLog(&model.OperateLog{ + UserID: req.GetUserId(), + Mark: req.GetMark(), + MarkID: req.GetMarkId(), + Data: req.GetData(), + IP: req.GetIp(), + })) + + *res = pb.OperateLogRes{} + return +} + +// SaveMaterial 保存素材 +func (s *WCommon) SaveMaterial(req *pb.SaveMaterialReq, res *pb.SaveMaterialRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().Material + + material := withdefault.Material(&model.Material{ + ProjectID: project.ID, + MaterialType: int8(req.GetMaterialType()), + MaterialData: req.GetMaterialData(), + }) + err = m.WithContext(s.ctx).Create(material) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.SaveMaterialRes{ + Id: material.ID, + } + return +} + +// MaterialList 素材列表 +func (s *WCommon) MaterialList(req *pb.MaterialListReq, res *pb.MaterialListRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().Material + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.ProjectID.Eq(project.ID), + } + + if req.GetMaterialType() > 0 { + cond = append(cond, m.MaterialType.Value(int8(req.GetMaterialType()))) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).FindByPage(offset, limit) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if total == 0 { + return + } + + *res = pb.MaterialListRes{ + List: make([]*pb.MaterialListRes_One, 0, len(list)), + Total: total, + } + + for _, v := range list { + res.List = append(res.List, &pb.MaterialListRes_One{ + Id: v.ID, + MaterialType: int32(v.MaterialType), + MaterialData: v.MaterialData, + }) + } + + return +} + +// CompanyMade 企业定制组件列表 +func (s *WCommon) CompanyMade(req *pb.CompanyMadeReq, res *pb.CompanyMadeRes) (err error) { + defer s.checkErr() + m := s.GetDao().CompanyMade + list, err := m.WithContext(s.ctx).Where(m.CompanyID.Eq(req.GetCompanyId())).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.CompanyMadeRes{ + List: make([]*pb.CompanyMadeRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.CompanyMadeRes_One{ + Id: v.ID, + Mark: v.Mark, + FissionTemp: v.GetFissionTemp(), + }) + } + + return +} diff --git a/internal/service/w_fission.go b/internal/service/w_fission.go new file mode 100644 index 0000000..6bf5252 --- /dev/null +++ b/internal/service/w_fission.go @@ -0,0 +1,448 @@ +package service + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/containers" + "joybuywork/internal/utils" + "joybuywork/internal/utils/arr" + "joybuywork/internal/utils/logic" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_fission" + "joybuywork/proto/go_proto/workerr" + + "gorm.io/gen" +) + +type WFission struct { + Service +} + +// List 玩法列表 +func (s *WFission) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + + list := consts.FissionList() + + var targets []int32 + if req.GetTarget() > 0 { + targets = append(targets, req.GetTarget()) + } + + if len(req.GetTargets()) > 0 { + for _, target := range req.GetTargets() { + if target == req.GetTarget() { + continue + } + targets = append(targets, target) + } + } + + // 找全部 + if len(targets) == 0 { + *res = pb.ListRes{ + List: make([]*pb.ListRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.ListRes_One{ + Id: v.Id, + Mark: v.Mark, + Logo: v.Logo, + Title: v.GetTitle(req.GetLang(), req.GetTarget()), + CanUse: v.CanUse, + Desc: v.GetDesc(req.GetLang(), req.GetTarget()), + Color: v.Color, + }) + } + + return + } + + // 找部分 + var fissionByTarget []int64 + for _, target := range targets { + fissionByTarget = arr.NotExistAppend(fissionByTarget, consts.FissionByTarget[target]) + } + + *res = pb.ListRes{ + List: make([]*pb.ListRes_One, 0, len(fissionByTarget)), + } + + for _, v := range list { + if !verify.InArray(v.Id, fissionByTarget...) { + continue + } + + one := &pb.ListRes_One{ + Id: v.Id, + Mark: v.Mark, + Logo: v.Logo, + Title: v.GetTitle(req.GetLang(), req.GetTarget()), + CanUse: v.CanUse, + Desc: v.GetDesc(req.GetLang(), req.GetTarget()), + Color: v.Color, + } + + if req.GetTarget() == consts.FissionTargetRetain { + one.Logo = v.RetainLogo + } else if req.GetTarget() == consts.FissionTargetConvert { + one.Logo = v.ConvertLogo + } + + res.List = append(res.List, one) + } + + return +} + +// TemplateList 玩法模版列表 +func (s *WFission) TemplateList(req *pb.TemplateListReq, res *pb.TemplateListRes) (err error) { + defer s.checkErr() + + fissionId, ok := consts.FissionMarkMap[req.Mark] + + if !ok { + return workerr.NotFound("fission mark not found") + } + + m := s.GetDao().FissionTempGroup + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.FissionID.Eq(fissionId), + } + + list, err := m.WithContext(s.ctx).Where(cond...).Order(m.Sort, m.ID).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.TemplateListRes{ + List: make([]*pb.TemplateListRes_One, 0, len(list)), + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.ID) + } + + tempM := s.GetDao().FissionTemp + tempList, err := tempM.WithContext(s.ctx).Where(tempM.GroupID.In(ids...), tempM.IsDel.Eq(mtype.No)).Order(tempM.LangType).Find() + if err != nil { + return s.BE().MysqlError(err) + } + var groupTemp = make(map[int64][]*model.FissionTemp) + for _, v := range tempList { + groupTemp[v.GroupID] = append(groupTemp[v.GroupID], v) + } + + for _, v := range list { + one := &pb.TemplateListRes_One{ + Id: v.ID, + Mark: v.Mark, + CoverUrl: utils.Ternary(req.GetTarget() == mtype.FissionCampaignConfigTargetUp && v.ConvertCoverURL != "", v.ConvertCoverURL, v.CoverURL), + Title: "", + Sort: v.Sort, + Temps: nil, + IsPrivate: int32(v.IsPrivate), + } + + if temps, ok1 := groupTemp[v.ID]; ok1 { + one.Temps = make([]*pb.TemplateListRes_Temp, 0, len(temps)) + for _, v1 := range temps { + one.Temps = append(one.Temps, &pb.TemplateListRes_Temp{ + HashId: v1.HashID, + LangType: int32(v1.LangType), + }) + } + } + + res.List = append(res.List, one) + } + + return +} + +// TemplateInfo 玩法模版信息 +func (s *WFission) TemplateInfo(req *pb.TemplateInfoReq, res *pb.TemplateInfoRes) (err error) { + defer s.checkErr() + container := new(containers.FissionTemplateInfo) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// CreateTempGroup 创建模板组 +func (s *WFission) CreateTempGroup(req *pb.CreateTempGroupReq, res *pb.CreateTempGroupRes) (err error) { + defer s.checkErr() + + container := new(containers.FissionCreateTempGroup) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOnce(ckey.FissionTempGroupStoreOnce(req.GetMark()))) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// CreateTemp 玩法模版列表 +func (s *WFission) CreateTemp(req *pb.CreateTempReq, res *pb.CreateTempRes) (err error) { + defer s.checkErr() + + group, err := cache.NewFissionTempGroup(s.ctx).FindById(req.GetGroupId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if group == nil || group.IsDel == mtype.Yes { + return workerr.NotFound("temp_group not found") + } + + tx := s.GetDao().Begin() + defer func() { + if err != nil { + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + m := tx.FissionTemp + temp := withdefault.FissionTemp(&model.FissionTemp{ + FissionID: group.FissionID, + GroupID: group.ID, + LangType: int8(req.GetLangType()), + TextType: int8(req.GetTextType()), + }) + + if err = m.WithContext(s.ctx).Create(temp); err != nil { + return s.BE().MysqlError(err) + } + + var conf = make([]*model.FissionTempImage, 0, len(req.GetImage())) + for _, kv := range req.GetImage() { + conf = append(conf, &model.FissionTempImage{ + TempID: temp.ID, + Mark: kv.Key, + Val: kv.Value, + Desc: kv.Desc, + }) + } + + var lang = make([]*model.FissionTempLang, 0, len(req.GetLang())) + for _, kv := range req.GetLang() { + lang = append(lang, withdefault.FissionTempLang(&model.FissionTempLang{ + TempID: temp.ID, + Mark: kv.Key, + Val: kv.Value, + Desc: kv.Desc, + })) + } + + if err = tx.FissionTempImage.WithContext(s.ctx).Create(conf...); err != nil { + return s.BE().MysqlError(err) + } + + if err = tx.FissionTempLang.WithContext(s.ctx).Create(lang...); err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.CreateTempRes{ + Id: temp.ID, + HashId: temp.HashID, + } + return +} + +// CreateTempLang 玩法模版列表 +func (s *WFission) CreateTempLang(req *pb.CreateTempLangReq, res *pb.CreateTempLangRes) (err error) { + defer s.checkErr() + tempM := s.GetDao().FissionTemp + var temp *model.FissionTemp + if req.GetId() > 0 { + temp, err = tempM.WithContext(s.ctx).Where(tempM.ID.Eq(req.GetId())).Take() + } else if req.GetHashId() != "" { + temp, err = tempM.WithContext(s.ctx).Where(tempM.HashID.Eq(req.GetHashId())).Take() + } + + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil || temp.IsDel == mtype.Yes { + return workerr.NotFound("temp not found") + } + + conf := make([]*model.FissionTempLang, 0, len(req.GetLang())) + for _, kv := range req.GetLang() { + conf = append(conf, withdefault.FissionTempLang(&model.FissionTempLang{ + TempID: temp.ID, + Mark: kv.Key, + Val: kv.Value, + Desc: kv.Desc, + })) + } + + if err = s.GetDao().FissionTempLang.WithContext(s.ctx).Create(conf...); err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.CreateTempLangRes{} + return +} + +// CreateTempImg 玩法模版列表 +func (s *WFission) CreateTempImg(req *pb.CreateTempImgReq, res *pb.CreateTempImgRes) (err error) { + defer s.checkErr() + tempM := s.GetDao().FissionTemp + var temp *model.FissionTemp + if req.GetId() > 0 { + temp, err = tempM.WithContext(s.ctx).Where(tempM.ID.Eq(req.GetId())).Take() + } else if req.GetHashId() != "" { + temp, err = tempM.WithContext(s.ctx).Where(tempM.HashID.Eq(req.GetHashId())).Take() + } + + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil || temp.IsDel == mtype.Yes { + return workerr.NotFound("temp not found") + } + + conf := make([]*model.FissionTempImage, 0, len(req.GetImage())) + for _, kv := range req.GetImage() { + conf = append(conf, withdefault.FissionTempImage(&model.FissionTempImage{ + TempID: temp.ID, + Mark: kv.Key, + Val: kv.Value, + Desc: kv.Desc, + })) + } + + if err = s.GetDao().FissionTempImage.WithContext(s.ctx).Create(conf...); err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.CreateTempImgRes{} + return +} + +// UpdateTempImg 更新玩法图片配置 +func (s *WFission) UpdateTempImg(req *pb.UpdateTempImgReq, res *pb.UpdateTempImgRes) (err error) { + defer s.checkErr() + tempM := s.GetDao().FissionTemp + var temp *model.FissionTemp + if req.GetId() > 0 { + temp, err = tempM.WithContext(s.ctx).Where(tempM.ID.Eq(req.GetId())).Take() + } else if req.GetHashId() != "" { + temp, err = tempM.WithContext(s.ctx).Where(tempM.HashID.Eq(req.GetHashId())).Take() + } + + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil || temp.IsDel == mtype.Yes { + return workerr.NotFound("temp not found") + } + + var marks []string + var imgMap = make(map[string]*pb.UpdateTempImgReq_KV) + + for _, v := range req.GetImage() { + marks = append(marks, v.GetKey()) + imgMap[v.Key] = v + } + + m := s.GetDao().FissionTempImage + + list, err := m.WithContext(s.ctx).Where(m.TempID.Eq(temp.ID), m.Mark.In(marks...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range list { + if img, ok := imgMap[v.Mark]; ok && (img.Value != v.Val || img.Desc != v.Desc) { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(v.ID)).UpdateSimple(m.Val.Value(img.Value), m.Desc.Value(img.Desc)) + if err != nil { + return s.BE().MysqlError(err) + } + + } + } + *res = pb.UpdateTempImgRes{} + return +} + +// UpdateTempLang 更新玩法语言配置 +func (s *WFission) UpdateTempLang(req *pb.UpdateTempLangReq, res *pb.UpdateTempLangRes) (err error) { + defer s.checkErr() + tempM := s.GetDao().FissionTemp + var temp *model.FissionTemp + if req.GetId() > 0 { + temp, err = tempM.WithContext(s.ctx).Where(tempM.ID.Eq(req.GetId())).Take() + } else if req.GetHashId() != "" { + temp, err = tempM.WithContext(s.ctx).Where(tempM.HashID.Eq(req.GetHashId())).Take() + } + + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if temp == nil || temp.IsDel == mtype.Yes { + return workerr.NotFound("temp not found") + } + + var marks []string + var langMap = make(map[string]*pb.UpdateTempLangReq_KV) + + for _, v := range req.GetLang() { + marks = append(marks, v.GetKey()) + langMap[v.Key] = v + } + + m := s.GetDao().FissionTempLang + + list, err := m.WithContext(s.ctx).Where(m.TempID.Eq(temp.ID), m.Mark.In(marks...)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range list { + if lang, ok := langMap[v.Mark]; ok && (lang.Value != v.Val || lang.Desc != v.Desc) { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(v.ID)).UpdateSimple(m.Val.Value(lang.Value), m.Desc.Value(lang.Desc)) + if err != nil { + return s.BE().MysqlError(err) + } + } + } + + *res = pb.UpdateTempLangRes{} + return +} + +// UpdateTempGroup 更新模板组 +func (s *WFission) UpdateTempGroup(req *pb.UpdateTempGroupReq, res *pb.UpdateTempGroupRes) (err error) { + defer s.checkErr() + + container := new(containers.FissionUpdateTempGroup) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} diff --git a/internal/service/w_fission_web.go b/internal/service/w_fission_web.go new file mode 100644 index 0000000..5d19031 --- /dev/null +++ b/internal/service/w_fission_web.go @@ -0,0 +1,299 @@ +package service + +import ( + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/service/containers" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_fission_web" + "joybuywork/proto/go_proto/workerr" + "time" + + "gits.branchcn.com/backend/microcode/plugins/lucky" +) + +type WFissionWeb struct { + Service +} + +// GetWebReward 抽取站外奖品 +func (s *WFissionWeb) GetWebReward(req *pb.GetWebRewardReq, res *pb.GetWebRewardRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil { + return workerr.NotFound("not found cpn") + } + + wbuM := s.GetDao().FissionWebUser + wbu, err := wbuM.WithContext(s.ctx).Where(wbuM.CampaignID.Eq(cpn.ID), wbuM.WebID.Eq(req.GetWebId())).Take() + if err != nil { + return s.BE().MysqlError(err) + } + + if wbu == nil { + return workerr.NotFound("not found user") + } + + *res = pb.GetWebRewardRes{ + Id: wbu.RewardID, + } + return +} + +// BindWeb 绑定站外活动 +func (s *WFissionWeb) BindWeb(req *pb.BindWebReq, res *pb.BindWebRes) (err error) { + defer s.checkErr() + + *res = pb.BindWebRes{} + container := new(containers.FissionWebBindWeb) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// WebReward 用户站外奖 +func (s *WFissionWeb) WebReward(req *pb.WebRewardReq, res *pb.WebRewardRes) (err error) { + defer s.checkErr() + *res = pb.WebRewardRes{} + + container := new(containers.FissionWebWebReward) + { + container.Init(s.ctx, logic.WithOnce(ckey.FissionUserWebRewardOnce(req.GetWebId()))) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// WebAnswer 用户站外答题 +func (s *WFissionWeb) WebAnswer(req *pb.WebAnswerReq, res *pb.WebAnswerRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req) + if err != nil { + return s.BE().CacheError(err) + } + + wbuM := s.GetDao().FissionWebUser + wbu, err := wbuM.WithContext(s.ctx).Where(wbuM.CampaignID.Eq(cpn.ID), wbuM.WebID.Eq(req.GetWebId())).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if wbu == nil { + return workerr.NotFound("not found webuser") + } + + if wbu.RewardID > 0 { + *res = pb.WebAnswerRes{ + Id: wbu.RewardID, + } + + return + } + + //答卷 + answer := make(map[int64]map[int64]struct{}) + for _, v := range req.GetSubmits() { + answer[v.GetQid()] = map[int64]struct{}{} + for _, v1 := range v.GetAid() { + answer[v.GetQid()][v1] = struct{}{} + } + } + + qm := s.GetDao().FissionCampaignQaQuestion + ql, err := qm.WithContext(s.ctx).Where(qm.CampaignID.Eq(cpn.ID), qm.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + var qids []int64 + var scoreMap = make(map[int64]int32) + for _, v := range ql { + qids = append(qids, v.ID) + scoreMap[v.ID] = v.Score + } + + opm := s.GetDao().FissionCampaignQaOption + opl, err := opm.WithContext(s.ctx).Where(opm.QuestionID.In(qids...), opm.IsRight.Eq(mtype.Yes), opm.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + //问题 + question := map[int64][]int64{} + for _, v := range opl { + question[v.QuestionID] = append(question[v.QuestionID], v.ID) + } + + // 得分 + var score int32 + for qid, aid := range question { + sub, ok := answer[qid] + if !ok { + continue + } + + var allRight = true + for _, v := range aid { + _, ok1 := sub[v] + if !ok1 { + allRight = false + break + } + } + + if allRight { + score += scoreMap[qid] + } + } + + rewardM := s.GetDao().FissionCampaignReward + reward, err := rewardM.WithContext(s.ctx). + Where(rewardM.CampaignID.Eq(cpn.ID), rewardM.RewardType.Eq(mtype.FissionCampaignRewardTypeWeb), rewardM.IsDel.Eq(mtype.No)). + Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + var rewardId int64 + if reward != nil { + rewardId = reward.ID + } + + val, _ := jsonm.MarshalToString(req.GetSubmits()) + + // 设置他的奖品 + _, err = wbuM.WithContext(s.ctx).Where(wbuM.ID.Eq(wbu.ID)).UpdateSimple(wbuM.RewardID.Value(rewardId), wbuM.Score.Value(score), wbuM.Answer.Value(val)) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.WebAnswerRes{ + Id: rewardId, + } + return +} + +// AdsUser Ads用户数据 +func (s *WFissionWeb) AdsUser(req *pb.AdsUserReq, res *pb.AdsUserRes) (err error) { + defer s.checkErr() + *res = pb.AdsUserRes{} + + container := new(containers.FissionWebAdsUser) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsLottery Ads抽奖 +func (s *WFissionWeb) AdsLottery(req *pb.AdsLotteryReq, res *pb.AdsLotteryRes) (err error) { + defer s.checkErr() + + cc := cache.NewFissionWebUser(s.ctx) + wbu, err := cc.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if wbu == nil { + err = workerr.NotFound("not found web user") + return + } + + cpn, err := finder.Campaign(s.ctx, wbu.CampaignID) + if err != nil { + err = s.BE().CacheError(err) + return + } + + m := s.dao.FissionCampaignReward + list, err := m.WithContext(s.ctx).Where( + m.CampaignID.Eq(wbu.CampaignID), + m.IsDel.Eq(mtype.No), + ).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + err = workerr.NotFound("not reward select") + return + } + + var bIds []int64 + var rewardMap = make(map[int64]*model.FissionCampaignReward, len(list)) + var prize = make([]lucky.Reward, 0, len(list)) + for _, v := range list { + prize = append(prize, lucky.Reward{ + Share: int(v.Odds), + Mark: v.ID, + }) + rewardMap[v.ID] = v + bIds = append(bIds, v.RewardID) + } + + prewards, err := provider.NewRewards(s.ctx, cpn.ProjectID, bIds...) + if err != nil { + return + } + + if wbu.RewardID > 0 { + info, _ := prewards.InfoAutoLang(wbu.RewardID, cpn.GetLangMarks()[0]) + *res = pb.AdsLotteryRes{ + RewardId: wbu.RewardID, + Title: info.Title, + ImgUrl: info.ImgUrl, + } + return + } + + dis := lucky.NewDiscrete(s.ctx, prize) + lottery, _ := dis.Lottery() + reward := rewardMap[lottery.Int64()] + + wbuM := s.GetDao().FissionWebUser + _, err = wbuM.WithContext(s.ctx).Where(wbuM.ID.Eq(wbu.ID)).UpdateSimple(wbuM.RewardID.Value(reward.ID)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(wbu) + + info, _ := prewards.InfoAutoLang(reward.RewardID, cpn.GetLangMarks()[0]) + *res = pb.AdsLotteryRes{ + RewardId: reward.ID, + Title: info.Title, + ImgUrl: info.ImgUrl, + } + + if cpn.ReportType == mtype.FissionCampaignReportTypeNew { + fissionaction.NewMarkPoint(s.ctx). + OutApp(cpn.ID, wbu.ChannelID, 0, wbu.WebID, req.GetPlatform(), cpn.GetLangMarks()[0]). + ClickPlayWeb(time.Now().Unix(), reward.ID) + } + + return +} diff --git a/internal/service/w_games.go b/internal/service/w_games.go new file mode 100644 index 0000000..64a2110 --- /dev/null +++ b/internal/service/w_games.go @@ -0,0 +1,390 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + containers "joybuywork/internal/service/containers/games" + "joybuywork/internal/utils" + "joybuywork/internal/utils/blink" + pb "joybuywork/proto/go_proto/w_games" + "fmt" + "strings" + "time" + + "github.com/golang-module/carbon/v2" + "gorm.io/gen/field" +) + +type WGames struct { + Service +} + +// LinkList 链接列表 +func (s *WGames) LinkList(req *pb.LinkListReq, res *pb.LinkListRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + _, gameMap := consts.GameLinkMap() + + m := s.GetDao().GameLink + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.GameID.Eq(req.GetGameId()), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return + } + + var playLinkMap = make(map[int64]string, len(list)) + for _, v := range list { + playLinkMap[v.ID] = blink.NewGameLink(gameMap[v.GameID].Link, project.HashID, blink.SetGameLinkId(v.HashID)).Link() + } + + *res = pb.LinkListRes{ + List: make([]*pb.LinkListRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.LinkListRes_One{ + Id: v.ID, + Title: v.Title, + IsDefault: int32(v.IsDefault), + Link: playLinkMap[v.ID], + }) + } + + return +} + +// Visit 访问小游戏 +func (s *WGames) Visit(req *pb.VisitReq, res *pb.VisitRes) (err error) { + defer s.checkErr() + *res = pb.VisitRes{} + container := new(containers.Visit) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// List 游戏列表 +func (s *WGames) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + games := consts.Games + + ids, gameMap := consts.GameLinkMap() + + m := s.GetDao().GameLink + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.GameID.In(ids...), m.IsDel.Eq(mtype.No), m.IsDefault.Eq(mtype.Yes)).Find() + if err != nil { + return + } + + var linkMap = make(map[int64]*model.GameLink) + for _, v := range list { + linkMap[v.GameID] = v + } + + var playLinkMap = make(map[int64]string, len(games)) + for _, id := range ids { + + link, ok := linkMap[id] + if !ok { + lc := app.NewFollower(s.ctx, ckey.GameLinkInit(project.ID, id)) + if ok1, _ := lc.SoftLock(); ok1 { + link = withdefault.GameLink(&model.GameLink{ + ProjectID: project.ID, + GameID: id, + Title: "默认链接", + IsDefault: mtype.Yes, + }) + + err = m.WithContext(s.ctx).Create(link) + if err != nil { + return + } + + lc.Release() + } + } + + playLinkMap[id] = blink.NewGameLink(gameMap[id].Link, project.HashID, blink.SetGameLinkId(link.HashID)).Link() + } + + *res = pb.ListRes{ + List: make([]*pb.ListRes_One, 0, len(games)), + } + + for _, v := range games { + res.List = append(res.List, &pb.ListRes_One{ + Id: v.ID, + Title: v.Title, + Img: v.Img, + Link: playLinkMap[v.ID], + }) + } + + return +} + +// LinkStore 创建链接 +func (s *WGames) LinkStore(req *pb.LinkStoreReq, res *pb.LinkStoreRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + link := withdefault.GameLink(&model.GameLink{ + ProjectID: project.ID, + GameID: req.GetGameId(), + Title: req.GetTitle(), + }) + err = s.GetDao().GameLink.WithContext(s.ctx).Create(link) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, gameMap := consts.GameLinkMap() + + *res = pb.LinkStoreRes{ + Id: link.ID, + Link: blink.NewGameLink(gameMap[link.GameID].Link, project.HashID, blink.SetGameLinkId(link.HashID)).Link(), + } + + return +} + +// LinkUpdate 更新链接 +func (s *WGames) LinkUpdate(req *pb.LinkUpdateReq, res *pb.LinkUpdateRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().GameLink + link, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetId()), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if link == nil || link.ProjectID != project.ID { + err = s.BE().VerifyError("not found link") + return + } + + var up []field.AssignExpr + if link.Title != req.GetTitle() { + up = append(up, m.Title.Value(req.GetTitle())) + } + + if len(up) > 0 { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(link.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + *res = pb.LinkUpdateRes{ + Id: link.ID, + } + return +} + +// LinkDestroy 删除链接 +func (s *WGames) LinkDestroy(req *pb.LinkDestroyReq, res *pb.LinkDestroyRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().GameLink + link, err := m.WithContext(s.ctx).Where(m.ID.Eq(req.GetId()), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if link == nil || link.ProjectID != project.ID || link.IsDefault == mtype.Yes { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(link.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.LinkDestroyRes{ + Id: link.ID, + } + return +} + +// Trace 跟踪小游戏 +func (s *WGames) Trace(req *pb.TraceReq, res *pb.TraceRes) (err error) { + defer s.checkErr() + *res = pb.TraceRes{} + container := new(containers.Trace) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Overview 小游戏统计 +func (s *WGames) Overview(req *pb.OverviewReq, res *pb.OverviewRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().GameTotal + total, err := m.WithContext(s.ctx).Where( + m.ProjectID.Eq(project.ID), + m.GameID.Eq(req.GetGameId()), + m.LinkID.Eq(req.GetLinkId()), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + dateM := s.GetDao().GameTotalDate + yes := carbon.Now().SubDay().Format(time.DateOnly) + yesterdayTotal, err := dateM.WithContext(s.ctx).Where( + dateM.ProjectID.Eq(project.ID), + dateM.GameID.Eq(req.GetGameId()), + dateM.LinkID.Eq(req.GetLinkId()), + dateM.Ymd.Eq(yes), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + var mark = []string{"visit_num", "visit_user_num", "total_stay"} + + *res = pb.OverviewRes{ + List: make([]*pb.OverviewRes_One, 0, len(mark)), + } + + for _, v := range mark { + one := &pb.OverviewRes_One{ + Mark: v, + Total: 0, + Yesterday: 0, + Avg: "", + } + switch v { + case "visit_num": + if total != nil { + one.Total = total.Pv + } + + if yesterdayTotal != nil { + one.Yesterday = yesterdayTotal.Pv + } + + case "visit_user_num": + + if total != nil { + one.Total = total.Uv + } + + if yesterdayTotal != nil { + one.Yesterday = yesterdayTotal.Uv + } + + case "total_stay": + if total != nil { + one.Total = total.Psec + one.Avg = strings.TrimSuffix(strings.TrimRight(fmt.Sprintf("%.2f", float64(total.Psec)/float64(total.Uv)), "0"), ".") + } + } + res.List = append(res.List, one) + } + + return +} + +// Trend 小游戏趋势 +func (s *WGames) Trend(req *pb.TrendReq, res *pb.TrendRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + start := utils.Ternary(req.GetStartTime() != 0, carbon.CreateFromTimestamp(req.GetStartTime()), carbon.Now().StartOfDay()) + end := utils.Ternary(req.GetEndTime() != 0, carbon.CreateFromTimestamp(req.GetEndTime()), carbon.Now()) + + var xMap = make(map[string]int) + x := utils.BetweenDay(start, end, time.DateOnly) + for k, v := range x { + xMap[v] = k + } + + m := s.GetDao().GameTotalDate + list, err := m.WithContext(s.ctx).Where( + m.ProjectID.Eq(project.ID), + m.GameID.Eq(req.GetGameId()), + m.LinkID.Eq(req.GetLinkId()), + m.Ymd.Between(x[0], x[len(x)-1]), + ).Find() + if err != nil { + return + } + + var y []*pb.TrendRes_Y + for _, v := range list { + + visitNum := &pb.TrendRes_Y{ + Type: "visit_num", + Data: make([]int64, len(x)), + } + + visitNum.Data[xMap[v.Ymd]] = v.Pv + + visitUserNum := &pb.TrendRes_Y{ + Type: "visit_user_num", + Data: make([]int64, len(x)), + } + + visitUserNum.Data[xMap[v.Ymd]] = v.Uv + + y = append(y, visitNum, visitUserNum) + } + + *res = pb.TrendRes{ + X: x, + Y: y, + } + + return +} diff --git a/internal/service/w_library.go b/internal/service/w_library.go new file mode 100644 index 0000000..5a72060 --- /dev/null +++ b/internal/service/w_library.go @@ -0,0 +1,645 @@ +package service + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/containers" + "joybuywork/internal/utils" + pb "joybuywork/proto/go_proto/w_library" + "joybuywork/proto/go_proto/workerr" + "time" + + "gorm.io/gen" +) + +type WLibrary struct { + Service +} + +// QaGroup 题库列表 +func (s *WLibrary) QaGroup(req *pb.QaGroupReq, res *pb.QaGroupRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + return + } + + m := s.GetDao().LibraryQaGroup + var cond = []gen.Condition{ + m.DelTime.Eq(0), + m.ProjectID.Eq(project.ID), + } + + if req.GetTitle() != "" { + cond = append(cond, m.Title.Like(utils.DbAllLike(req.GetTitle()))) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.QaGroupRes{ + List: make([]*pb.QaGroupRes_One, 0, len(list)), + Total: total, + } + + if total == 0 { + return + } + + var ids []int64 + for _, item := range list { + ids = append(ids, item.ID) + } + + type num struct { + GroupID int64 `json:"group_id"` + Num int64 `json:"num"` + } + + var nums []*num + qaM := s.GetDao().LibraryQa + err = qaM.WithContext(s.ctx).Select(qaM.GroupID, qaM.ID.Count().As("num")).Where(qaM.GroupID.In(ids...)).Group(qaM.GroupID).Scan(&nums) + if err != nil { + return s.BE().MysqlError(err) + } + + var numMap = make(map[int64]int64, len(list)) + for _, v := range nums { + numMap[v.GroupID] = v.Num + } + + for _, v := range list { + res.List = append(res.List, &pb.QaGroupRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + CreatedAt: v.CreatedAt, + QaCount: numMap[v.ID], + }) + } + + return +} + +// StoreQaGroup 创建题库 +func (s *WLibrary) StoreQaGroup(req *pb.StoreQaGroupReq, res *pb.StoreQaGroupRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + m := s.GetDao().LibraryQaGroup + exist, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.Title.Eq(req.GetTitle()), m.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if exist != nil { + err = workerr.VerifyError("title exist") + return + } + + err = m.WithContext(s.ctx).Create(withdefault.LibraryQaGroup(&model.LibraryQaGroup{ + ProjectID: project.ID, + Title: req.GetTitle(), + DelTime: 0, + })) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.StoreQaGroupRes{} + return +} + +// UpdateQaGroup 更新题库 +func (s *WLibrary) UpdateQaGroup(req *pb.UpdateQaGroupReq, res *pb.UpdateQaGroupRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + group, err := cache.NewLibraryQaGroup(s.ctx).FindByHashId(req.GetHashId()) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil || group.DelTime > 0 || group.ProjectID != project.ID { + err = workerr.NotFound("not found qa group") + return + } + + m := s.GetDao().LibraryQaGroup + exist, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.Title.Eq(req.GetTitle()), m.ID.Neq(group.ID), m.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if exist != nil { + err = workerr.VerifyError("title exist") + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(group.ID)).UpdateSimple(m.Title.Value(req.GetTitle())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewLibraryQaGroup(s.ctx).Clear(group) + + *res = pb.UpdateQaGroupRes{} + return +} + +// DestroyQaGroup 删除题库 +func (s *WLibrary) DestroyQaGroup(req *pb.DestroyQaGroupReq, res *pb.DestroyQaGroupRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + err = workerr.NotFound("not found project") + return + } + + group, err := cache.NewLibraryQaGroup(s.ctx).FindByHashId(req.GetHashId()) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil || group.DelTime > 0 || group.ProjectID != project.ID { + return + } + + m := s.GetDao().LibraryQaGroup + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(group.ID)).UpdateSimple(m.DelTime.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewLibraryQaGroup(s.ctx).Clear(group) + + *res = pb.DestroyQaGroupRes{} + return +} + +// QaList 问题列表 +func (s *WLibrary) QaList(req *pb.QaListReq, res *pb.QaListRes) (err error) { + defer s.checkErr() + groupM := s.GetDao().LibraryQaGroup + group, err := groupM.WithContext(s.ctx).Where(groupM.HashID.Eq(req.GetGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil { + return + } + + m := s.GetDao().LibraryQa + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.GroupID.Eq(group.ID), + } + + if req.GetTitle() != "" { + cond = append(cond, m.Title.Like(utils.DbAllLike(req.GetTitle()))) + } + + if req.GetMark() != "" { + cond = append(cond, m.Mark.Eq(req.GetMark())) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.QaListRes{ + List: make([]*pb.QaListRes_One, 0, len(list)), + Total: total, + } + + if total == 0 { + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + optionM := s.GetDao().LibraryQaOption + options, err := optionM.WithContext(s.ctx).Where(optionM.QaID.In(ids...), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var opMap = make(map[int64][]*model.LibraryQaOption) + for _, v := range options { + opMap[v.QaID] = append(opMap[v.QaID], v) + } + + for _, v := range list { + one := &pb.QaListRes_One{ + Id: v.ID, + HashId: v.HashID, + Mark: v.Mark, + Title: v.Title, + CoverUrl: v.CoverURL, + LinkUrl: v.LinkURL, + ExplainText: v.ExplainText, + ExplainImg: v.ExplainImg, + Options: make([]*pb.QaListRes_Option, 0, len(opMap[v.ID])), + CreatedAt: v.CreatedAt, + AnswerMark: v.AnswerMark, + } + + for _, option := range opMap[v.ID] { + one.Options = append(one.Options, &pb.QaListRes_Option{ + Id: option.ID, + Title: option.Title, + ImgUrl: option.ImgURL, + IsRight: int32(option.IsRight), + }) + } + + res.List = append(res.List, one) + } + + return +} + +// StoreQa 创建题目 +func (s *WLibrary) StoreQa(req *pb.StoreQaReq, res *pb.StoreQaRes) (err error) { + defer s.checkErr() + groupM := s.GetDao().LibraryQaGroup + group, err := groupM.WithContext(s.ctx).Where(groupM.HashID.Eq(req.GetGroupHashId()), groupM.DelTime.Eq(0)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if group == nil { + err = workerr.NotFound("not found qa group") + return + } + + tx := s.GetDao().Begin() + defer func() { + if err != nil { + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + m := tx.LibraryQa + qa := withdefault.LibraryQa(&model.LibraryQa{ + ProjectID: group.ProjectID, + GroupID: group.ID, + Mark: req.GetMark(), + Title: req.GetTitle(), + LinkURL: req.GetLinkUrl(), + CoverURL: req.GetCoverUrl(), + ExplainText: req.GetExplainText(), + ExplainImg: req.GetExplainImg(), + AnswerMark: req.GetAnswerMark(), + }) + + if err = m.WithContext(s.ctx).Create(qa); err != nil { + err = s.BE().MysqlError(err) + return + } + + var options []*model.LibraryQaOption + optionM := tx.LibraryQaOption + for _, v := range req.GetOptions() { + options = append(options, withdefault.LibraryQaOption(&model.LibraryQaOption{ + QaID: qa.ID, + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + IsRight: int8(v.GetIsRight()), + })) + } + + if len(options) > 0 { + if err = optionM.WithContext(s.ctx).Create(options...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + *res = pb.StoreQaRes{} + return +} + +// UpdateQa 更新题目 +func (s *WLibrary) UpdateQa(req *pb.UpdateQaReq, res *pb.UpdateQaRes) (err error) { + defer s.checkErr() + m := s.GetDao().LibraryQa + + qa, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetHashId()), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if qa == nil { + err = workerr.NotFound("not found question") + return + } + + tx := s.GetDao().Begin() + defer func() { + if err != nil { + _ = tx.Rollback() + return + } + _ = tx.Commit() + }() + + mtx := tx.LibraryQa + + _, err = mtx.WithContext(s.ctx).Where(mtx.ID.Eq(qa.ID)).UpdateSimple( + mtx.Mark.Value(req.GetMark()), + mtx.Title.Value(req.GetTitle()), + mtx.LinkURL.Value(req.GetLinkUrl()), + mtx.CoverURL.Value(req.GetCoverUrl()), + mtx.ExplainText.Value(req.GetExplainText()), + mtx.ExplainImg.Value(req.GetExplainImg()), + mtx.AnswerMark.Value(req.GetAnswerMark()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + optionTx := tx.LibraryQaOption + old, err := optionTx.WithContext(s.ctx).Where(optionTx.QaID.Eq(qa.ID), optionTx.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]struct{}, len(old)) + for _, v := range old { + oldMap[v.ID] = struct{}{} + } + + var newMap = make(map[int64]struct{}) + var add []*model.LibraryQaOption + for _, v := range req.GetOptions() { + + _, ok := oldMap[v.GetId()] + if !ok { + add = append(add, withdefault.LibraryQaOption(&model.LibraryQaOption{ + QaID: qa.ID, + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + IsRight: int8(v.GetIsRight()), + })) + continue + } + + newMap[v.GetId()] = struct{}{} + + _, err = optionTx.WithContext(s.ctx).Where(optionTx.ID.Eq(v.GetId())).UpdateSimple( + optionTx.Title.Value(v.GetTitle()), + optionTx.ImgURL.Value(v.GetImgUrl()), + optionTx.IsRight.Value(int8(v.GetIsRight())), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + var delIds []int64 + for _, v := range old { + if _, ok := newMap[v.ID]; !ok { + delIds = append(delIds, v.ID) + } + } + + if len(add) > 0 { + if err = optionTx.WithContext(s.ctx).Create(add...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(delIds) > 0 { + _, err = optionTx.WithContext(s.ctx).Where(optionTx.ID.In(delIds...), optionTx.QaID.Eq(qa.ID)).UpdateSimple(optionTx.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + *res = pb.UpdateQaRes{} + return +} + +// DestroyQa 删除题目 +func (s *WLibrary) DestroyQa(req *pb.DestroyQaReq, res *pb.DestroyQaRes) (err error) { + defer s.checkErr() + m := s.GetDao().LibraryQa + + qa, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetHashId()), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if qa == nil { + return + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(qa.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.DestroyQaRes{} + return +} + +// QaGroupSelect 题库选项 +func (s *WLibrary) QaGroupSelect(req *pb.QaGroupSelectReq, res *pb.QaGroupSelectRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + return + } + + groupM := s.GetDao().LibraryQaGroup + list, err := groupM.WithContext(s.ctx).Where(groupM.ProjectID.Eq(project.ID), groupM.DelTime.Eq(0)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + var ids = make([]int64, 0, len(list)) + for _, v := range list { + ids = append(ids, v.ID) + } + + var total []struct { + GroupId int64 `json:"group_id"` + Num int64 `json:"num"` + } + + m := s.GetDao().LibraryQa + var cond = []gen.Condition{ + m.IsDel.Eq(mtype.No), + m.GroupID.In(ids...), + } + + if req.GetMark() != "" { + cond = append(cond, m.Mark.Eq(req.GetMark())) + } + + err = m.WithContext(s.ctx). + Select(m.GroupID, m.ID.Count().As("num")). + Where(cond...). + Group(m.GroupID). + Scan(&total) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var totalMap = make(map[int64]int64, len(total)) + for _, v := range total { + totalMap[v.GroupId] = v.Num + } + + *res = pb.QaGroupSelectRes{ + List: make([]*pb.QaGroupSelectRes_One, 0), + } + + for _, v := range list { + res.List = append(res.List, &pb.QaGroupSelectRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + QaNum: totalMap[v.ID], + }) + } + + return +} + +// QaRand 随机问题 +func (s *WLibrary) QaRand(req *pb.QaRandReq, res *pb.QaRandRes) (err error) { + defer s.checkErr() + + container := new(containers.LibraryQaRand) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// QaShow 问题详情 +func (s *WLibrary) QaShow(req *pb.QaShowReq, res *pb.QaShowRes) (err error) { + defer s.checkErr() + m := s.GetDao().LibraryQa + + qa, err := m.WithContext(s.ctx).Where(m.HashID.Eq(req.GetHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if qa == nil { + err = workerr.NotFound("not found qa") + return + } + + optionM := s.GetDao().LibraryQaOption + + options, err := optionM.WithContext(s.ctx).Where(optionM.QaID.Eq(qa.ID), optionM.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.QaShowRes{ + Id: qa.ID, + HashId: qa.HashID, + Mark: qa.Mark, + Title: qa.Title, + CoverUrl: qa.CoverURL, + LinkUrl: qa.LinkURL, + ExplainText: qa.ExplainText, + ExplainImg: qa.ExplainImg, + Options: make([]*pb.QaShowRes_Option, 0, len(options)), + CreatedAt: qa.CreatedAt, + AnswerMark: qa.AnswerMark, + } + + for _, v := range options { + res.Options = append(res.Options, &pb.QaShowRes_Option{ + Id: v.ID, + Title: v.Title, + ImgUrl: v.ImgURL, + IsRight: int32(v.IsRight), + }) + } + + return +} diff --git a/internal/service/w_mall.go b/internal/service/w_mall.go new file mode 100644 index 0000000..dc714f7 --- /dev/null +++ b/internal/service/w_mall.go @@ -0,0 +1,282 @@ +package service + +import ( + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + containers "joybuywork/internal/service/containers/mall" + "joybuywork/internal/service/provider/malls" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_mall" + + "gorm.io/gen/field" +) + +type WMall struct { + Service +} + +// List 商城列表 +func (s *WMall) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + *res = pb.ListRes{} + container := new(containers.List) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Store 商城创建 +func (s *WMall) Store(req *pb.StoreReq, res *pb.StoreRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + mall := withdefault.RedeemMall(&model.RedeemMall{ + ProjectID: project.ID, + Title: req.GetTitle(), + }) + + if err = s.GetDao().RedeemMall.WithContext(s.ctx).Create(mall); err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.StoreRes{ + Id: mall.ID, + } + + return +} + +// Update 商城更新 +func (s *WMall) Update(req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + defer s.checkErr() + mall, err := cache.NewRedeemMall(s.ctx).FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if mall == nil { + return + } + + m := s.GetDao().RedeemMall + var up []field.AssignExpr + if req.GetTitle() != mall.Title { + up = append(up, m.Title.Value(req.GetTitle())) + } + + if len(up) > 0 { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(mall.ID)).UpdateSimple(up...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewRedeemMall(s.ctx).Clear(mall) + } + + *res = pb.UpdateRes{ + Id: mall.ID, + } + + return +} + +// Destroy 商城删除 +func (s *WMall) Destroy(req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + defer s.checkErr() + mall, err := cache.NewRedeemMall(s.ctx).FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if mall == nil || mall.IsDel == mtype.Yes { + return + } + + relateM := s.GetDao().RedeemMallRelate + count, err := relateM.WithContext(s.ctx).Where(relateM.MallID.Eq(mall.ID), relateM.CancelTime.Eq(mtype.No)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if count > 0 { + err = s.BE().VerifyError("mall used") + return + } + + m := s.GetDao().RedeemMall + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(mall.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.DestroyRes{} + + return +} + +// ItemList 商城奖品列表 +func (s *WMall) ItemList(req *pb.ItemListReq, res *pb.ItemListRes) (err error) { + defer s.checkErr() + *res = pb.ItemListRes{} + container := new(containers.ItemList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ItemStore 商城奖品创建 +func (s *WMall) ItemStore(req *pb.ItemStoreReq, res *pb.ItemStoreRes) (err error) { + defer s.checkErr() + + container := new(containers.ItemStore) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ItemUpdate 商城奖品更新 +func (s *WMall) ItemUpdate(req *pb.ItemUpdateReq, res *pb.ItemUpdateRes) (err error) { + defer s.checkErr() + *res = pb.ItemUpdateRes{} + container := new(containers.ItemUpdate) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ItemStatus 商城奖品状态修改 +func (s *WMall) ItemStatus(req *pb.ItemStatusReq, res *pb.ItemStatusRes) (err error) { + defer s.checkErr() + *res = pb.ItemStatusRes{} + container := new(containers.ItemStatus) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ItemSort 商城奖品排序 +func (s *WMall) ItemSort(req *pb.ItemSortReq, res *pb.ItemSortRes) (err error) { + defer s.checkErr() + + m := s.GetDao().RedeemMallItem + + l := len(req.GetIds()) + for i, id := range req.GetIds() { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(id)).UpdateSimple(m.Sort.Value(int32(l - i))) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + *res = pb.ItemSortRes{} + + return +} + +// Select 商城选择 +func (s *WMall) Select(req *pb.SelectReq, res *pb.SelectRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().RedeemMall + list, err := m.WithContext(s.ctx).Select(m.ID, m.Title).Where(m.ProjectID.Eq(project.ID), m.IsDel.Eq(mtype.No)).Order(m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.SelectRes{ + List: make([]*pb.SelectRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.SelectRes_One{ + Id: v.ID, + Title: v.Title, + }) + } + + return +} + +// RelateMall 关联商城 +func (s *WMall) RelateMall(req *pb.RelateMallReq, res *pb.RelateMallRes) (err error) { + defer s.checkErr() + relate, err := malls.NewRelate(s.ctx, req.GetRelateId(), req.GetRelateTable()) + if err != nil { + return + } + + err = relate.Related(int8(req.GetSource()), req.GetMallIds()...) + if err != nil { + return + } + + *res = pb.RelateMallRes{} + return +} + +// UserItemList 用户商城奖品列表 +func (s *WMall) UserItemList(req *pb.UserItemListReq, res *pb.UserItemListRes) (err error) { + defer s.checkErr() + + *res = pb.UserItemListRes{} + container := new(containers.UserItemList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// ExchangeItem 商城奖品兑换 +func (s *WMall) ExchangeItem(req *pb.ExchangeItemReq, res *pb.ExchangeItemRes) (err error) { + defer s.checkErr() + *res = pb.ExchangeItemRes{} + container := new(containers.ExchangeItem) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} diff --git a/internal/service/w_open_platform.go b/internal/service/w_open_platform.go new file mode 100644 index 0000000..64217a3 --- /dev/null +++ b/internal/service/w_open_platform.go @@ -0,0 +1,53 @@ +package service + +import ( + containers "joybuywork/internal/service/containers/openplatform" + pb "joybuywork/proto/go_proto/w_open_platform" +) + +type WOpenPlatform struct { + Service +} + +// UserList 开放平台用户列表 +func (s *WOpenPlatform) UserList(req *pb.UserListReq, res *pb.UserListRes) (err error) { + defer s.checkErr() + + container := new(containers.UserList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// CampaignInfo 开发平台活动信息 +func (s *WOpenPlatform) CampaignInfo(req *pb.CampaignInfoReq, res *pb.CampaignInfoRes) (err error) { + defer s.checkErr() + + *res = pb.CampaignInfoRes{} + container := new(containers.CampaignInfo) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Player 用户在活动中的玩家数据 +func (s *WOpenPlatform) Player(req *pb.PlayerReq, res *pb.PlayerRes) (err error) { + defer s.checkErr() + *res = pb.PlayerRes{} + container := new(containers.Player) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} diff --git a/internal/service/w_project.go b/internal/service/w_project.go new file mode 100644 index 0000000..a0633a7 --- /dev/null +++ b/internal/service/w_project.go @@ -0,0 +1,507 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/encrypt" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/containers" + "joybuywork/internal/service/provider" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_project" + "joybuywork/proto/go_proto/workerr" + "time" +) + +type WProject struct { + Service +} + +// Select 选择列表 +func (s *WProject) Select(req *pb.SelectReq, res *pb.SelectRes) (err error) { + defer s.checkErr() + + m := s.GetDao().Project + + var list []*model.Project + if req.ShowUser { + relateM := s.GetDao().UserProjectRelate + var projectIds []int64 + + err = relateM.WithContext(s.ctx).Where(relateM.UserID.Eq(req.GetUserId()), relateM.IsDel.Eq(mtype.No)).Pluck(relateM.ProjectID, &projectIds) + if err != nil { + return s.BE().MysqlError(err) + } + + if len(projectIds) > 0 { + list, err = m.WithContext(s.ctx).Where(m.ID.In(projectIds...), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + } + + } else { + list, err = m.WithContext(s.ctx).Where(m.CompanyID.Eq(req.GetCompanyId()), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + } + + *res = pb.SelectRes{ + List: make([]*pb.SelectRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.SelectRes_One{ + Id: v.ID, + HashId: v.HashID, + Title: v.Title, + Scene: int32(v.Scene), + LogoUrl: v.LogoURL, + IsTest: int32(v.IsTest), + }) + } + + return +} + +// List 用户列表 +func (s *WProject) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + *res = pb.ListRes{} + + container := new(containers.ProjectList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Store 创建项目 +func (s *WProject) Store(req *pb.StoreReq, res *pb.StoreRes) (err error) { + defer s.checkErr() + *res = pb.StoreRes{} + container := new(containers.ProjectStore) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Update 更新项目 +func (s *WProject) Update(req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + defer s.checkErr() + *res = pb.UpdateRes{} + + container := new(containers.ProjectUpdate) + { + container.Init(s.ctx, logic.WithTran()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Destroy 删除项目 +func (s *WProject) Destroy(req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + defer s.checkErr() + *res = pb.DestroyRes{} + + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return + } + + m := s.GetDao().Project + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(project.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + + err = cache.NewProject(s.ctx).Clear(project) + if err != nil { + return s.BE().CacheError(err) + } + + return +} + +// Cert 项目认证 +func (s *WProject) Cert(req *pb.CertReq, res *pb.CertRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("not found project") + } + + // 找没有删除的project 密钥,并且七天内删除的密钥 + secretM := s.GetDao().ProjectSecret + secrets, err := secretM.WithContext(s.ctx). + Where( + secretM.ProjectID.Eq(project.ID), + ).Where( + secretM.WithContext(s.ctx). + Where(secretM.IsDel.Eq(mtype.No)). + Or( + secretM.WithContext(s.ctx).Where( + secretM.UpdatedAt.Gte(time.Now().AddDate(0, 0, -7).Unix()), + secretM.IsDel.Eq(mtype.Yes), + ), + )). + Find() + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.CertRes{ + Id: project.ID, + HashId: project.HashID, + Title: project.Title, + EncryptStr: project.EncryptStr, + Scene: int32(project.Scene), + CertSecrets: make([]*pb.CertRes_CertSecret, 0, len(secrets)), + } + + for _, v := range secrets { + one := &pb.CertRes_CertSecret{ + Secret: v.AccessSecret, + ExpiredAt: 0, + } + + if v.IsDel == mtype.Yes { + one.ExpiredAt = v.UpdatedAt - time.Now().AddDate(0, 0, -7).Unix() + } + + res.CertSecrets = append(res.CertSecrets, one) + } + + return +} + +// ProjectSecret 项目私钥 +func (s *WProject) ProjectSecret(req *pb.ProjectSecretReq, res *pb.ProjectSecretRes) (err error) { + defer s.checkErr() + + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("not found project") + } + + m := s.GetDao().ProjectSecret + secret, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if secret == nil { + return nil + } + + *res = pb.ProjectSecretRes{ + Secret: secret.AccessSecret, + } + + return +} + +// ChangeSecret 修改密钥 +func (s *WProject) ChangeSecret(req *pb.ChangeSecretReq, res *pb.ChangeSecretRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + + //保证只有一个账号被创建 + onceKey := ckey.ProjectSecretOnce(project.ID) + lc := app.NewRedisLock(s.ctx, onceKey) + defer lc.Release() + if !lc.SoftLock() { + return workerr.OnceLockError + } + + m := s.GetDao().ProjectSecret + old, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + userM := s.GetDao().User + user, err := userM.WithContext(s.ctx).Where(userM.Username.Eq(req.GetUsername()), userM.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if user == nil || user.IsAdmin == mtype.No { + return workerr.ChangAuthError + } + + verify, err := encrypt.CheckUserPasswd(req.GetPasswd(), user.Passwd) + if err != nil || !verify { + return workerr.ChangAuthError + } + + if old != nil { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(old.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + } + + secret := withdefault.ProjectSecret(&model.ProjectSecret{ + CreatorID: req.GetId(), + ProjectID: project.ID, + AccessSecret: encrypt.ProjectSecret(project.ID), + }) + + err = m.WithContext(s.ctx).Create(secret) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.ChangeSecretRes{ + Secret: secret.AccessSecret, + } + return +} + +// Show 项目详情 +func (s *WProject) Show(req *pb.ShowReq, res *pb.ShowRes) (err error) { + defer s.checkErr() + + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + + *res = pb.ShowRes{ + Id: project.ID, + HashId: project.HashID, + Title: project.Title, + Domain: project.Domain, + CompanyId: project.CompanyID, + NotifyToken: project.NotifyToken, + EncryptStr: project.EncryptStr, + Scene: int32(project.Scene), + ThirdSecret: project.ThirdSecret, + FissionCertType: int32(project.FissionCertType), + ThirdUrl: project.ThirdURL, + ThirdReboostUrl: project.ThirdReboostURL, + } + return +} + +// DomainList 获取项目域名绑定的项目 +func (s *WProject) DomainList(req *pb.DomainListReq, res *pb.DomainListRes) (err error) { + defer s.checkErr() + + m := s.GetDao().Project + list, err := m.WithContext(s.ctx).Where(m.Domain.Eq(req.GetDomain())).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.DomainListRes{ + List: make([]*pb.DomainListRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.DomainListRes_One{ + Id: v.ID, + HashId: v.HashID, + CompanyId: v.CompanyID, + Title: v.Title, + Domain: v.Domain, + CreatedTime: v.CreatedAt, + }) + } + + return +} + +// ChangeOplatform 修改开放平台 +func (s *WProject) ChangeOplatform(req *pb.ChangeOplatformReq, res *pb.ChangeOplatformRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + p := s.GetDao().Project + _, err = p.WithContext(s.ctx).Where(p.HashID.Eq(req.GetHashId())).UpdateSimple(p.ThirdURL.Value(req.GetThirdUrl())) + if err != nil { + return s.BE().MysqlError(err) + } + // 清理缓存 + cache.NewProject(s.ctx).Clear(project) + + *res = pb.ChangeOplatformRes{} + return +} + +// SaveAdsConfig 保存广告修改 +func (s *WProject) SaveAdsConfig(req *pb.SaveAdsConfigReq, res *pb.SaveAdsConfigRes) (err error) { + defer s.checkErr() + *res = pb.SaveAdsConfigRes{} + container := new(containers.ProjectSaveAdsConfig) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOnce(ckey.ProjectAdsOnce(req.GetProjectHashId())), logic.WithOl()) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// AdsConfig 获取广告配置 +func (s *WProject) AdsConfig(req *pb.AdsConfigReq, res *pb.AdsConfigRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + ads, err := cache.NewProjectAd(s.ctx).FindByProjectId(project.ID) + if err != nil { + err = s.BE().CacheError(err) + } + + if ads == nil { + return + } + + *res = pb.AdsConfigRes{ + OpenAd: int32(ads.OpenAd), + CampaignAd: int32(ads.CampaignAd), + AdCustomUrl: int32(ads.AdCustomURL), + } + return +} + +// ChangeRebootUrl 修改开放平台的活动回调地址 +func (s *WProject) ChangeRebootUrl(req *pb.ChangeRebootUrlReq, res *pb.ChangeRebootUrlRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetId(), req.GetHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil || project.IsDel == mtype.Yes { + return workerr.NotFound("project not found") + } + p := s.GetDao().Project + _, err = p.WithContext(s.ctx).Where(p.ID.Eq(project.ID)).UpdateSimple(p.ThirdReboostURL.Value(req.GetThirdReboostUrl())) + if err != nil { + return s.BE().MysqlError(err) + } + // 清理缓存 + cache.NewProject(s.ctx).Clear(project) + *res = pb.ChangeRebootUrlRes{} + return +} + +// FissionConfig 获取广告配置 +func (s *WProject) FissionConfig(req *pb.FissionConfigReq, res *pb.FissionConfigRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if project == nil { + return + } + + conf, err := provider.NewFissionConfig(s.ctx, project) + if err != nil { + return + } + + *res = pb.FissionConfigRes{ + PushVisit: int32(conf.Config().PushVisit), + PushCampaignTask: int32(conf.Config().PushCampaignTask), + } + return +} + +// SetPushVisit 设置活动访问推送开关 +func (s *WProject) SetPushVisit(req *pb.SetPushVisitReq, res *pb.SetPushVisitRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + conf, err := provider.NewFissionConfig(s.ctx, project) + if err != nil { + return + } + + err = conf.SetPushVisit(req.GetPushVisit()) + if err != nil { + return + } + + *res = pb.SetPushVisitRes{} + return +} + +// SetPushCampaignTask 设置活动任务完成推送开关 +func (s *WProject) SetPushCampaignTask(req *pb.SetPushCampaignTaskReq, res *pb.SetPushCampaignTaskRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + conf, err := provider.NewFissionConfig(s.ctx, project) + if err != nil { + return + } + + err = conf.SetPushCampaignTask(req.GetPushCampaignTask()) + if err != nil { + return + } + + *res = pb.SetPushCampaignTaskRes{} + return +} diff --git a/internal/service/w_project_user.go b/internal/service/w_project_user.go new file mode 100644 index 0000000..d8c805a --- /dev/null +++ b/internal/service/w_project_user.go @@ -0,0 +1,63 @@ +package service + +import ( + containers "joybuywork/internal/service/containers/projectuser" + "joybuywork/internal/service/provider/projectuser" + pb "joybuywork/proto/go_proto/w_project_user" +) + +type WProjectUser struct { + Service +} + +// Point 积分 +func (s *WProjectUser) Point(req *pb.PointReq, res *pb.PointRes) (err error) { + defer s.checkErr() + + *res = pb.PointRes{} + container := new(containers.Point) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// EarnCoin 获取积分 +func (s *WProjectUser) EarnCoin(req *pb.EarnCoinReq, res *pb.EarnCoinRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectId()) + if err != nil { + return + } + + pu, err := projectuser.NewProjectUser(s.ctx, projectuser.WithInit(project.ID, req.GetUserId())) + if err != nil { + return + } + + var earns []*projectuser.EarnCoinParam + + for _, earn := range req.GetEarns() { + earns = append(earns, &projectuser.EarnCoinParam{ + CoinNum: earn.GetCoinNum(), + IsExpired: int8(earn.GetIsExpired()), + ExpiredAt: earn.GetExpiredAt(), + Source: earn.GetSource(), + SourceID: earn.GetSourceId(), + SourceData: earn.GetSourceData(), + Operate: earn.GetOperate(), + }) + } + + err = pu.EarnCoin(earns...) + if err != nil { + return + } + + *res = pb.EarnCoinRes{} + + return +} diff --git a/internal/service/w_register.go b/internal/service/w_register.go new file mode 100644 index 0000000..908a61e --- /dev/null +++ b/internal/service/w_register.go @@ -0,0 +1,35 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/service/containers" + "joybuywork/internal/utils/logic" + pb "joybuywork/proto/go_proto/w_register" +) + +type WRegister struct { + Service +} + +// Store 添加注册申请 +func (s *WRegister) Store(req *pb.StoreReq, res *pb.StoreRes) (err error) { + defer s.checkErr() + + *res = pb.StoreRes{} + + container := new(containers.RegisterStore) + { + container.Init(s.ctx, logic.WithTran(), logic.WithOnce(ckey.UserStoreOnce(req.GetUsername()))) + container.Req = req + container.Res = res + } + + err = container.Run() + + if err == nil { + app.FeishuNoticeSend("[%s] 已注册", req.GetUsername()) + } + + return +} diff --git a/internal/service/w_reward.go b/internal/service/w_reward.go new file mode 100644 index 0000000..cd229cf --- /dev/null +++ b/internal/service/w_reward.go @@ -0,0 +1,1380 @@ +package service + +import ( + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/containers" + "joybuywork/internal/service/provider" + "joybuywork/internal/service/provider/s2s" + "joybuywork/internal/utils" + "joybuywork/internal/utils/verify" + pb "joybuywork/proto/go_proto/w_reward" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + "gorm.io/gen" +) + +type WReward struct { + Service +} + +// List 奖品列表 +func (s *WReward) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + + *res = pb.ListRes{} + + container := new(containers.RewardList) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + return container.Run() +} + +// Select 奖品选择 +func (s *WReward) Select(req *pb.SelectReq, res *pb.SelectRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + rewards, err := provider.NewRewards(s.ctx, project.ID) + if err != nil { + return + } + + list, err := rewards.InfoList() + if err != nil { + return + } + + *res = pb.SelectRes{ + List: make([]*pb.SelectRes_One, 0, len(list)), + } + + for _, v := range list { + + if req.GetReceiveType() > 0 && v.ReceiveType != req.GetReceiveType() { + continue + } + + one := &pb.SelectRes_One{ + Id: v.Id, + RewardTitle: v.RewardTitle, + Title: "", + ImgUrl: "", + LangMark: "", + ReceiveType: v.ReceiveType, + KvData: make([]*pb.SelectRes_KV, 0, len(v.KvData)), + Contact: v.Contact, + Url: v.Url, + FormTitle: v.FormTitle, + } + + for _, kv := range v.KvData { + one.KvData = append(one.KvData, &pb.SelectRes_KV{ + Key: kv.Key, + Value: kv.Value, + IsShow: kv.IsShow, + }) + } + + lang := rewards.AutoLang(v.Id, req.GetLangMark()) + one.Title, one.ImgUrl, one.LangMark = lang.Title, lang.ImgUrl, lang.Mark + + res.List = append(res.List, one) + } + + return +} + +// Show 奖品详情 +func (s *WReward) Show(req *pb.ShowReq, res *pb.ShowRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + reward, err := cache.NewReward(s.ctx).FindById(req.GetId()) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if reward == nil || reward.IsDel == mtype.Yes || reward.ProjectID != project.ID { + err = workerr.NotFound("not found reward") + return + } + + rlm := s.GetDao().RewardLang + rls, err := rlm.WithContext(s.ctx).Where(rlm.RewardID.Eq(reward.ID), rlm.IsDel.Eq(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + relateM := s.GetDao().RewardRelated + relateNum, err := relateM.WithContext(s.ctx).Where(relateM.RewardID.Eq(reward.ID), relateM.CancelTime.Eq(0)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.ShowRes{ + Id: reward.ID, + RewardTitle: reward.RewardTitle, + ReceiveType: int32(reward.ReceiveType), + UrlId: reward.URLID, + Contact: reward.Contact, + KvData: nil, + Langs: make([]*pb.ShowRes_Lang, 0, len(rls)), + FormId: reward.FormID, + RelateNum: relateNum, + DyRewardType: int32(reward.DyRewardType), + } + + _ = jsonm.StrUnmarshal(reward.KvData, &res.KvData) + + for _, v := range rls { + res.Langs = append(res.Langs, &pb.ShowRes_Lang{ + Mark: v.Mark, + Title: v.Title, + ImgUrl: v.ImgURL, + IsDefault: int32(v.IsDefault), + LangType: int32(mtype.MarkToLangType[v.Mark]), + OpenToUse: int32(v.OpenToUse), + WebUrl: v.WebURL, + AppParam: v.AppParam, + PcParam: v.PcParam, + }) + } + + return +} + +// Store 创建奖品 +func (s *WReward) Store(req *pb.StoreReq, res *pb.StoreRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + // 验证kv是否存在 + var kvData []*mtype.RewardKV + var kvStr, kvMark string + if verify.InArray[int32](req.GetReceiveType(), mtype.RewardReceiveTypeNotify, mtype.RewardReceiveTypeClient) { + kvData = make([]*mtype.RewardKV, 0, len(req.GetKvData())) + markStruct := make([]*mtype.KV, 0, len(req.GetKvData())) + for _, v := range req.GetKvData() { + markStruct = append(markStruct, &mtype.KV{ + Key: v.GetKey(), + Value: v.GetValue(), + }) + + kvData = append(kvData, &mtype.RewardKV{ + Key: v.GetKey(), + Value: v.GetValue(), + IsShow: utils.Ternary(req.GetDyRewardType() == mtype.RewardDyRewardTypeNone, v.GetIsShow(), mtype.No), + }) + } + + kvStr, _ = jsonm.MarshalToString(markStruct) + kvMark = utils.Md5String(kvStr) + + m := s.GetDao().Reward + var exist *model.Reward + exist, err = m.WithContext(s.ctx).Where( + m.ProjectID.Eq(project.ID), + m.KvMark.Eq(kvMark), + m.ReceiveType.Eq(int8(req.GetReceiveType())), + m.IsDel.Eq(mtype.No)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if exist != nil { + return workerr.RewardKvExistError + } + } + + tran := s.GetDao().Begin() + defer func() { + if err != nil { + _ = tran.Rollback() + return + } + _ = tran.Commit() + }() + + m := tran.Reward + reward := withdefault.Reward(&model.Reward{ + ProjectID: project.ID, + ReceiveType: int8(req.GetReceiveType()), + KvData: "", + KvMark: kvMark, + URLID: req.GetUrlId(), + Contact: req.GetContact(), + RewardTitle: req.GetRewardTitle(), + TitleDefault: 0, + FormID: req.GetFormId(), + DyRewardType: int8(req.GetDyRewardType()), + Source: int8(req.GetSource()), + }) + + reward.SetKvData(kvData) + + if req.GetRewardTitle() == "" { + for _, v := range req.GetLangs() { + if v.GetIsDefault() == mtype.Yes { + reward.RewardTitle = v.GetTitle() + reward.TitleDefault = mtype.Yes + break + } + } + } + + err = m.WithContext(s.ctx).Create(reward) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var imgIds []int64 + for _, v := range req.GetLangs() { + if v.GetImageId() > 0 { + imgIds = append(imgIds, v.GetImageId()) + } + } + + var imgMap = make(map[int64]string, len(imgIds)) + if len(imgIds) > 0 { + mm := s.GetDao().Material + var materials []*model.Material + materials, err = mm.WithContext(s.ctx).Where(mm.ID.In(imgIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(materials) != len(imgIds) { + err = workerr.RewardImageInvalidError + return + } + + for _, v := range materials { + imgMap[v.ID] = v.MaterialData + } + } + + var langs = make([]*model.RewardLang, 0, len(req.GetLangs())) + for _, v := range req.GetLangs() { + one := withdefault.RewardLang(&model.RewardLang{ + ProjectID: project.ID, + RewardID: reward.ID, + Mark: v.GetMark(), + Title: v.GetTitle(), + ImgURL: v.GetImgUrl(), + IsDefault: int8(v.GetIsDefault()), + OpenToUse: int8(v.GetOpenToUse()), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + ImageID: v.GetImageId(), + PcParam: v.GetPcParam(), + }) + if _, ok := imgMap[v.GetImageId()]; ok { + one.ImgURL = imgMap[v.GetImageId()] + } + + langs = append(langs, one) + } + + rlm := s.GetDao().RewardLang + err = rlm.WithContext(s.ctx).Create(langs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.StoreRes{ + Id: reward.ID, + } + return +} + +// Update 更新奖品 +func (s *WReward) Update(req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + c := cache.NewReward(s.ctx) + reward, err := c.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if reward == nil || reward.IsDel == mtype.Yes || reward.ProjectID != project.ID { + err = workerr.NotFound("not found reward") + return + } + + if req.GetReceiveType() != int32(reward.ReceiveType) { + relateM := s.GetDao().RewardRelated + var count int64 + count, err = relateM.WithContext(s.ctx).Where(relateM.RewardID.Eq(reward.ID), relateM.CancelTime.Eq(0)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if count > 0 { + err = s.BE().VerifyError("奖品已经被绑定,无法修改奖品的发放类型") + return + } + + } + + // 验证kv是否存在 + var kvData []*mtype.RewardKV + var kvStr, kvMark string + if verify.InArray[int32](req.GetReceiveType(), mtype.RewardReceiveTypeNotify, mtype.RewardReceiveTypeClient) { + kvData = make([]*mtype.RewardKV, 0, len(req.GetKvData())) + markStruct := make([]*mtype.KV, 0, len(req.GetKvData())) + for _, v := range req.GetKvData() { + markStruct = append(markStruct, &mtype.KV{ + Key: v.GetKey(), + Value: v.GetValue(), + }) + + kvData = append(kvData, &mtype.RewardKV{ + Key: v.GetKey(), + Value: v.GetValue(), + IsShow: utils.Ternary(req.GetDyRewardType() == mtype.RewardDyRewardTypeNone, v.GetIsShow(), mtype.No), + }) + } + + kvStr, _ = jsonm.MarshalToString(markStruct) + kvMark = utils.Md5String(kvStr) + + m := s.GetDao().Reward + var exist *model.Reward + exist, err = m.WithContext(s.ctx).Where( + m.ProjectID.Eq(project.ID), + m.KvMark.Eq(kvMark), + m.ReceiveType.Eq(int8(req.GetReceiveType())), + m.IsDel.Eq(mtype.No), m.ID.Neq(reward.ID)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if exist != nil { + return workerr.RewardKvExistError + } + } + + // 语言数据 + rlm := s.GetDao().RewardLang + oldLang, err := rlm.WithContext(s.ctx).Where(rlm.RewardID.Eq(reward.ID)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldLangMap = make(map[string]*model.RewardLang) + for _, v := range oldLang { + oldLangMap[v.Mark] = v + } + + var imgIds []int64 + for _, v := range req.GetLangs() { + if v.GetImageId() > 0 { + imgIds = append(imgIds, v.GetImageId()) + } + } + + var imgMap = make(map[int64]string, len(imgIds)) + if len(imgIds) > 0 { + mm := s.GetDao().Material + var materials []*model.Material + materials, err = mm.WithContext(s.ctx).Where(mm.ID.In(imgIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(materials) != len(imgIds) { + err = workerr.RewardImageInvalidError + return + } + + for _, v := range materials { + imgMap[v.ID] = v.MaterialData + } + } + + tran := s.GetDao().Begin() + defer func() { + if err != nil { + _ = tran.Rollback() + return + } + _ = tran.Commit() + _ = c.Clear(reward) + }() + + m := tran.Reward + + var rewardTitle = req.GetRewardTitle() + var titleDefault int8 + if (reward.RewardTitle == rewardTitle && reward.TitleDefault == mtype.Yes) || rewardTitle == "" { + for _, v := range req.GetLangs() { + if v.GetIsDefault() == mtype.Yes { + rewardTitle = v.GetTitle() + titleDefault = mtype.Yes + break + } + } + } + + kvDataStr, _ := jsonm.MarshalToString(kvData) + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(reward.ID)).UpdateSimple( + m.Contact.Value(req.GetContact()), + m.KvData.Value(kvDataStr), + m.KvMark.Value(kvMark), + m.URLID.Value(req.GetUrlId()), + m.ReceiveType.Value(int8(req.GetReceiveType())), + m.RewardTitle.Value(rewardTitle), + m.TitleDefault.Value(titleDefault), + m.OldData.Value(mtype.No), + m.FormID.Value(req.GetFormId()), + m.DyRewardType.Value(int8(req.GetDyRewardType())), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var newLangMap = make(map[string]struct{}) + var addLangs []*model.RewardLang + rlm = tran.RewardLang + for _, v := range req.GetLangs() { + newLangMap[v.GetMark()] = struct{}{} + image := utils.Ternary(v.GetImageId() > 0, imgMap[v.GetImageId()], v.GetImgUrl()) + old, ok := oldLangMap[v.GetMark()] + if ok { + _, err = rlm.WithContext(s.ctx).Where(rlm.ID.Eq(old.ID)).UpdateSimple( + rlm.Title.Value(v.GetTitle()), + rlm.ImgURL.Value(image), + rlm.IsDefault.Value(int8(v.GetIsDefault())), + rlm.IsDel.Value(mtype.No), + rlm.OpenToUse.Value(int8(v.GetOpenToUse())), + rlm.WebURL.Value(v.GetWebUrl()), + rlm.AppParam.Value(v.GetAppParam()), + rlm.ImageID.Value(v.GetImageId()), + rlm.PcParam.Value(v.GetPcParam()), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + continue + } + + addLangs = append(addLangs, withdefault.RewardLang(&model.RewardLang{ + ProjectID: project.ID, + RewardID: reward.ID, + Mark: v.GetMark(), + Title: v.GetTitle(), + ImgURL: image, + IsDefault: int8(v.GetIsDefault()), + OpenToUse: int8(v.GetOpenToUse()), + WebURL: v.GetWebUrl(), + AppParam: v.GetAppParam(), + ImageID: v.GetImageId(), + PcParam: v.GetPcParam(), + })) + } + + for _, v := range oldLang { + if _, ok := newLangMap[v.Mark]; !ok { + _, err = rlm.WithContext(s.ctx).Where(rlm.ID.Eq(v.ID)).UpdateSimple(rlm.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + if len(addLangs) > 0 { + err = rlm.WithContext(s.ctx).Create(addLangs...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + + *res = pb.UpdateRes{ + Id: reward.ID, + } + return +} + +// Destroy 删除奖品 +func (s *WReward) Destroy(req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + defer s.checkErr() + + *res = pb.DestroyRes{} + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + sids := utils.SplitToInt64(req.GetIds(), ",") + + m := s.GetDao().Reward + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.ID.In(sids...), m.IsDel.Value(mtype.No)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + relateM := s.GetDao().RewardRelated + + var num []struct { + RewardId int64 + Num int64 + } + + err = relateM.WithContext(s.ctx). + Select(relateM.RewardID, relateM.ID.Count().As("num")). + Where(relateM.RewardID.In(ids...), relateM.CancelTime.Eq(0)). + Group(relateM.RewardID). + Scan(&num) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var bindMap = make(map[int64]int64) + for _, v := range num { + bindMap[v.RewardId] = v.Num + } + + var clearCache []*model.Reward + var delIds []int64 + for _, v := range list { + if _, ok := bindMap[v.ID]; !ok { + delIds = append(delIds, v.ID) + clearCache = append(clearCache, v) + } else { + res.Ids = append(res.Ids, fmt.Sprintf("%d", v.ID)) + } + } + + if len(delIds) > 0 { + _, err = m.WithContext(s.ctx).Where(m.ID.In(delIds...)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cache.NewReward(s.ctx).Clear(clearCache...) + } + + return +} + +// UrlList 回调地址列表 +func (s *WReward) UrlList(req *pb.UrlListReq, res *pb.UrlListRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().NotifyURL + + query := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.IsDel.Eq(mtype.No)) + switch req.GetOrderType() { + case 1: + query = query.Order(m.CreatedAt) + default: + query = query.Order(m.OldData, m.ID.Desc()) + } + + list, err := query.Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + *res = pb.UrlListRes{ + List: make([]*pb.UrlListRes_One, 0, len(list)), + } + + var urlIds []int64 + for _, v := range list { + urlIds = append(urlIds, v.ID) + } + + type Num struct { + UrlId int64 + Num int64 + } + + var num []*Num + rewardM := s.GetDao().Reward + err = rewardM.WithContext(s.ctx). + Select(rewardM.URLID, rewardM.ID.Count().As("num")). + Where(rewardM.URLID.In(urlIds...), rewardM.IsDel.Eq(mtype.No)). + Group(rewardM.URLID). + Scan(&num) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var numMap = map[int64]int64{} + for _, v := range num { + numMap[v.UrlId] = v.Num + } + + for _, v := range list { + headers := v.GetHeaders() + + one := &pb.UrlListRes_One{ + Id: v.ID, + Title: v.Title, + Url: v.URL, + Num: numMap[v.ID], + CreatedAt: v.CreatedAt, + Headers: make([]*pb.UrlListRes_Header, 0, len(headers)), + } + + for _, header := range headers { + one.Headers = append(one.Headers, &pb.UrlListRes_Header{ + Key: header.Key, + Mark: header.Mark, + Val: header.Val, + }) + } + + res.List = append(res.List, one) + } + + return +} + +// UrlStore 创建回调地址 +func (s *WReward) UrlStore(req *pb.UrlStoreReq, res *pb.UrlStoreRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().NotifyURL + + url := withdefault.NotifyURL(&model.NotifyURL{ + ProjectID: project.ID, + Title: req.GetTitle(), + URL: req.GetUrl(), + Source: int8(req.GetSource()), + }) + + url.Headers, _ = jsonm.ToSliceString(req.GetHeaders()) + + err = m.WithContext(s.ctx).Create(url) + + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.UrlStoreRes{ + Id: url.ID, + } + + return +} + +// UrlUpdate 更新回调地址 +func (s *WReward) UrlUpdate(req *pb.UrlUpdateReq, res *pb.UrlUpdateRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + c := cache.NewNotifyURL(s.ctx) + url, err := c.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if url == nil || url.IsDel == mtype.Yes || url.ProjectID != project.ID { + err = workerr.NotFound("not found url") + return + } + + headers, _ := jsonm.ToSliceString(req.GetHeaders()) + + m := s.GetDao().NotifyURL + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(url.ID)).UpdateSimple( + m.URL.Value(req.GetUrl()), + m.Title.Value(req.GetTitle()), + m.Headers.Value(headers), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = c.Clear(url) + + *res = pb.UrlUpdateRes{ + Id: url.ID, + } + return +} + +// UrlDestroy 删除回调地址 +func (s *WReward) UrlDestroy(req *pb.UrlDestroyReq, res *pb.UrlDestroyRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + c := cache.NewNotifyURL(s.ctx) + url, err := c.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if url == nil || url.IsDel == mtype.Yes || url.ProjectID != project.ID { + err = workerr.NotFound("not found url") + return + } + + rewardM := s.GetDao().Reward + bindNum, err := rewardM.WithContext(s.ctx).Where(rewardM.ProjectID.Eq(project.ID), rewardM.URLID.Eq(url.ID), rewardM.IsDel.Eq(mtype.No)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if bindNum > 0 { + err = s.BE().VerifyError("can not delete") + return + } + + m := s.GetDao().NotifyURL + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(url.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = c.Clear(url) + *res = pb.UrlDestroyRes{} + return +} + +// FormList 表单列表 +func (s *WReward) FormList(req *pb.FormListReq, res *pb.FormListRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + return + } + + if project == nil { + return + } + + m := s.GetDao().Form + + var cond = []gen.Condition{ + m.ProjectID.Eq(project.ID), + m.IsDel.Eq(mtype.No), + } + + if req.GetTitle() != "" { + cond = append(cond, m.Title.Like(utils.DbAllLike(req.GetTitle()))) + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + if total == 0 { + return + } + + var formIds []int64 + for _, v := range list { + formIds = append(formIds, v.ID) + } + + type Num struct { + FormId int64 + Num int64 + } + + var num []*Num + rewardM := s.GetDao().Reward + err = rewardM.WithContext(s.ctx). + Select(rewardM.FormID, rewardM.ID.Count().As("num")). + Where(rewardM.FormID.In(formIds...), rewardM.IsDel.Eq(mtype.No)). + Group(rewardM.FormID). + Scan(&num) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var numMap = map[int64]int64{} + for _, v := range num { + numMap[v.FormId] = v.Num + } + + *res = pb.FormListRes{ + List: make([]*pb.FormListRes_One, 0, len(list)), + Total: total, + } + + for _, v := range list { + items := v.GetItems() + one := &pb.FormListRes_One{ + Id: v.ID, + Title: v.Title, + CreatedAt: v.CreatedAt, + Items: make([]*pb.FormListRes_Item, 0, len(items)), + Num: numMap[v.ID], + } + + for _, item := range items { + one.Items = append(one.Items, &pb.FormListRes_Item{ + Name: item.Name, + }) + } + + res.List = append(res.List, one) + } + + return +} + +// FormSelect 表单选择 +func (s *WReward) FormSelect(req *pb.FormSelectReq, res *pb.FormSelectRes) (err error) { + defer s.checkErr() + project, err := finder.Project(s.ctx, req.GetProjectHashId()) + if err != nil { + return + } + + if project == nil { + return + } + + m := s.GetDao().Form + + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID), m.IsDel.Eq(mtype.No)).Order(m.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + *res = pb.FormSelectRes{ + List: make([]*pb.FormSelectRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.FormSelectRes_One{ + Id: v.ID, + Title: v.Title, + }) + } + + return +} + +// FormStore 创建表单 +func (s *WReward) FormStore(req *pb.FormStoreReq, res *pb.FormStoreRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + var items = make([]*mtype.FormItem, 0, len(req.GetItems())) + for _, item := range req.GetItems() { + trans := make([]*mtype.FormItemTran, 0, len(item.GetTrans())) + for _, tran := range item.GetTrans() { + trans = append(trans, &mtype.FormItemTran{ + Mark: tran.GetMark(), + Name: tran.GetName(), + IsDefault: tran.GetIsDefault(), + }) + } + + items = append(items, &mtype.FormItem{ + Name: item.GetName(), + Trans: trans, + }) + } + + form := withdefault.Form(&model.Form{ + ProjectID: project.ID, + Title: req.GetTitle(), + Items: "", + }) + form.SetItems(items) + + m := s.GetDao().Form + if err = m.WithContext(s.ctx).Create(form); err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.FormStoreRes{ + Id: form.ID, + } + return +} + +// FormUpdate 更新表单 +func (s *WReward) FormUpdate(req *pb.FormUpdateReq, res *pb.FormUpdateRes) (err error) { + defer s.checkErr() + + cc := cache.NewForm(s.ctx) + form, err := cc.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if form == nil || form.IsDel == mtype.Yes { + err = workerr.NotFound("form not found") + return + } + + var items = make([]*mtype.FormItem, 0, len(req.GetItems())) + for _, item := range req.GetItems() { + trans := make([]*mtype.FormItemTran, 0, len(item.GetTrans())) + for _, tran := range item.GetTrans() { + trans = append(trans, &mtype.FormItemTran{ + Mark: tran.GetMark(), + Name: tran.GetName(), + IsDefault: tran.GetIsDefault(), + }) + } + + items = append(items, &mtype.FormItem{ + Name: item.GetName(), + Trans: trans, + }) + } + + upItems, _ := jsonm.MarshalToString(items) + + m := s.GetDao().Form + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(form.ID)).UpdateSimple(m.Title.Value(req.GetTitle()), m.Items.Value(upItems)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(form) + + *res = pb.FormUpdateRes{ + Id: form.ID, + } + return +} + +// FormDestroy 删除表单 +func (s *WReward) FormDestroy(req *pb.FormDestroyReq, res *pb.FormDestroyRes) (err error) { + defer s.checkErr() + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + cc := cache.NewForm(s.ctx) + form, err := cc.FindById(req.GetId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if form == nil || form.IsDel == mtype.Yes { + return + } + + rewardM := s.GetDao().Reward + total, err := rewardM.WithContext(s.ctx).Where(rewardM.ProjectID.Eq(project.ID), rewardM.IsDel.Eq(mtype.No), rewardM.FormID.Eq(form.ID)).Count() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if total > 0 { + err = s.BE().VerifyError("can not delete") + return + } + + m := s.GetDao().Form + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(form.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _ = cc.Clear(form) + + *res = pb.FormDestroyRes{ + Id: form.ID, + } + return +} + +// Urls 回调地址列表 +func (s *WReward) Urls(req *pb.UrlsReq, res *pb.UrlsRes) (err error) { + defer s.checkErr() + + m := s.GetDao().NotifyURL + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(req.GetProjectId()), m.ID.In(req.GetIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + *res = pb.UrlsRes{ + List: make([]*pb.UrlsRes_One, 0, len(list)), + } + + for _, v := range list { + headers := v.GetHeaders() + + one := &pb.UrlsRes_One{ + Id: v.ID, + Title: v.Title, + Url: v.URL, + CreatedAt: v.CreatedAt, + Headers: make([]*pb.UrlsRes_Header, 0, len(headers)), + } + + for _, header := range headers { + one.Headers = append(one.Headers, &pb.UrlsRes_Header{ + Key: header.Key, + Mark: header.Mark, + Val: header.Val, + }) + } + + res.List = append(res.List, one) + } + + return +} + +// Rewards 奖品详情 +func (s *WReward) Rewards(req *pb.RewardsReq, res *pb.RewardsRes) (err error) { + defer s.checkErr() + + prewards, err := provider.NewRewards(s.ctx, req.GetProjectId(), req.GetIds()...) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + *res = pb.RewardsRes{ + List: make([]*pb.RewardsRes_One, 0, len(req.GetIds())), + } + + for _, id := range req.GetIds() { + info, _ := prewards.InfoAutoLang(id, req.GetLangMark()) + + one := &pb.RewardsRes_One{ + Id: info.Id, + RewardTitle: info.RewardTitle, + ReceiveType: info.ReceiveType, + UrlId: info.UrlId, + Contact: info.Contact, + KvData: make([]*pb.RewardsRes_KV, 0, len(info.KvData)), + Lang: &pb.RewardsRes_Lang{ + Mark: info.Mark, + Title: info.Title, + ImgUrl: info.ImgUrl, + IsDefault: info.IsDefault, + OpenToUse: info.OpenToUse, + WebUrl: info.WebUrl, + AppParam: info.AppParam, + PcParam: info.PcParam, + }, + FormId: info.FormId, + DyRewardType: info.DyRewardType, + } + + for _, v := range info.KvData { + one.KvData = append(one.KvData, &pb.RewardsRes_KV{ + Key: v.Key, + Value: v.Value, + IsShow: v.IsShow, + }) + } + + res.List = append(res.List, one) + } + + return +} + +// Forms 表单列表 +func (s *WReward) Forms(req *pb.FormsReq, res *pb.FormsRes) (err error) { + defer s.checkErr() + + m := s.GetDao().Form + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(req.GetProjectId()), m.ID.In(req.GetIds()...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + if len(list) == 0 { + return + } + + *res = pb.FormsRes{ + List: make([]*pb.FormsRes_One, 0, len(list)), + } + + for _, v := range list { + items := v.GetItems() + one := &pb.FormsRes_One{ + Id: v.ID, + Title: v.Title, + CreatedAt: v.CreatedAt, + Items: make([]*pb.FormsRes_Item, 0, len(items)), + } + + for _, item := range items { + one.Items = append(one.Items, &pb.FormsRes_Item{ + Name: item.Name, + }) + } + + res.List = append(res.List, one) + } + + return +} + +// RelateReward 关联奖品 +func (s *WReward) RelateReward(req *pb.RelateRewardReq, res *pb.RelateRewardRes) (err error) { + defer s.checkErr() + + m := s.GetDao().RewardRelated + list, err := m.WithContext(s.ctx).Where(m.RelateID.Eq(req.GetRelateId()), m.RelateTable.Eq(req.GetRelateTable())).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var oldMap = make(map[int64]*model.RewardRelated) + for _, v := range list { + oldMap[v.RewardID] = v + } + + var reRelate []int64 + var relates []*model.RewardRelated + for _, id := range req.GetRewardIds() { + old, ok := oldMap[id] + if !ok { + relates = append(relates, withdefault.RewardRelated(&model.RewardRelated{ + RewardID: id, + RelateID: req.GetRelateId(), + RelateTable: req.GetRelateTable(), + })) + + continue + } + + delete(oldMap, old.RewardID) + + if old.CancelTime == 0 { + continue + } + + reRelate = append(reRelate, old.ID) + } + + if len(relates) > 0 { + if err = m.WithContext(s.ctx).Create(relates...); err != nil { + err = s.BE().MysqlError(err) + return + } + } + + if len(reRelate) > 0 { + idGroup := utils.Groups[int64](reRelate, 200) + for _, ids := range idGroup { + _, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).UpdateSimple(m.CancelTime.Value(0)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + var cancelIds []int64 + for _, related := range oldMap { + cancelIds = append(cancelIds, related.ID) + } + + if len(cancelIds) > 0 { + idGroup := utils.Groups[int64](cancelIds, 200) + for _, ids := range idGroup { + _, err = m.WithContext(s.ctx).Where(m.ID.In(ids...)).UpdateSimple(m.CancelTime.Value(time.Now().Unix())) + if err != nil { + err = s.BE().MysqlError(err) + return + } + } + } + + *res = pb.RelateRewardRes{} + return +} + +// PushReward 奖品推送 +func (s *WReward) PushReward(req *pb.PushRewardReq, res *pb.PushRewardRes) (err error) { + defer s.checkErr() + reward, err := cache.NewReward(s.ctx).FindById(req.GetRewardId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if reward == nil || reward.ReceiveType != mtype.RewardReceiveTypeNotify { + return + } + + rp, err := s2s.NewReward(s.ctx, reward) + if err != nil { + return + } + + push, err := rp.CreatePush( + req.GetSource(), + req.GetSourceId(), + req.GetSourceSecondId(), + req.GetRelateId(), + int8(req.GetSync()), + mtype.RewardPushParam{ + SourceHashId: req.GetSourceHashId(), + RelateHashId: req.GetRelateHashId(), + UserId: req.GetUserId(), + UserPlatform: req.GetUserPlatform(), + ParentUserId: req.GetParentUserId(), + ParentUserPlatform: req.GetParentPlatform(), + Num: req.GetNum(), + Lang: req.GetLang(), + Title: req.GetTitle(), + RewardType: req.GetRewardType(), + RewardId: fmt.Sprintf("%d", req.GetRelateId()), + CampaignId: req.GetCampaignId(), + }, + ) + + if err != nil || push == nil { + return + } + + if req.GetSync() == mtype.Yes { + push, err = rp.Send(push, false) + if err != nil || push == nil { + return + } + } else { + rp.Async(push, 0) + } + + *res = pb.PushRewardRes{ + TaskId: push.ID, + RewardVal: push.RespData, + Status: int32(push.Status), + FailType: push.FailType, + FailMsg: push.FailMsg, + } + return +} + +// RewardIds 查询奖品id +func (s *WReward) RewardIds(req *pb.RewardIdsReq, res *pb.RewardIdsRes) (err error) { + defer s.checkErr() + m := s.GetDao().Reward + var cond = []gen.Condition{ + m.ProjectID.Eq(req.GetProjectId()), + } + + if req.GetRewardTitle() != "" { + cond = append(cond, m.RewardTitle.Like(utils.DbAllLike(req.GetRewardTitle()))) + } + + var ids []int64 + err = m.WithContext(s.ctx).Where(cond...).Pluck(m.ID, &ids) + if err != nil { + err = s.BE().MysqlError(err) + return + } + *res = pb.RewardIdsRes{ + Ids: ids, + } + return +} diff --git a/internal/service/w_script.go b/internal/service/w_script.go new file mode 100644 index 0000000..dae215d --- /dev/null +++ b/internal/service/w_script.go @@ -0,0 +1,611 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/provider/players" + "joybuywork/internal/service/script" + "joybuywork/internal/utils" + "joybuywork/internal/utils/timez" + pb "joybuywork/proto/go_proto/w_script" + "joybuywork/proto/go_proto/workerr" + "strings" + + "github.com/rs/xid" + ddevicepb "gits.branchcn.com/backend/deeplink/proto/go_proto/ddevice" + clientv3 "go.etcd.io/etcd/client/v3" + "gorm.io/gen" +) + +type WScript struct { + Service +} + +// Boot 运行脚本 +func (s *WScript) Boot(req *pb.BootReq, res *pb.BootRes) (err error) { + defer s.checkErr() + *res = pb.BootRes{ + TaskId: script.Boot(req), + } + return +} + +// RefreshDayLimit 刷新每日限制 +func (s *WScript) RefreshDayLimit(req *pb.RefreshDayLimitReq, res *pb.RefreshDayLimitRes) (err error) { + defer s.checkErr() + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil || cpn.Status != mtype.FissionCampaignStatusPubPre { + err = workerr.NotFound("can not do it") + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + err = workerr.NotFound("not found user") + return + } + + ticketM := s.GetDao().FissionCampaignTicket + ticket, err := ticketM.WithContext(s.ctx).Where( + ticketM.CampaignID.Eq(cpn.ID), + ticketM.Mark.Eq(mtype.FissionCampaignTicketCustom), + ticketM.Open.Eq(mtype.Yes), + ).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if ticket == nil { + err = workerr.NotFound("can not do it") + return + } + + m := s.GetDao().FissionUserCond + _, err = m.WithContext(s.ctx).Where(m.UserID.Eq(user.ID)).UpdateSimple( + m.Total.Value(""), + m.CountNum.Value(0), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + day, start, end := timez.GMTStartAndEndTs(cpn.TOffset) + + recordM := s.GetDao().FissionUserCondRecord + _, err = recordM.WithContext(s.ctx).Where( + recordM.UserID.Eq(user.ID), + recordM.BehaviorTime.Gte(start), + recordM.BehaviorTime.Lte(end), + ).UpdateSimple(recordM.BehaviorTime.Sub(86400)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + taskM := s.GetDao().FissionUserTaskRecord + _, err = taskM.WithContext(s.ctx).Where( + taskM.UserID.Eq(user.ID), + taskM.CreatedAt.Gte(start), + taskM.CreatedAt.Lte(end), + ).UpdateSimple(taskM.CreatedAt.Sub(86400)) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var condIds []int64 + condM := s.GetDao().FissionCampaignCond + err = condM.WithContext(s.ctx).Where(condM.CampaignID.Eq(cpn.ID), condM.IsDel.Eq(mtype.No)).Pluck(condM.ID, &condIds) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var taskIds []int64 + ctm := s.GetDao().FissionCampaignTask + err = ctm.WithContext(s.ctx).Where(ctm.CampaignID.Eq(cpn.ID), ctm.IsDel.Eq(mtype.No)).Pluck(ctm.ID, &taskIds) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var keys []string + for _, id := range condIds { + keys = append(keys, ckey.FissionUserCondDayLimit(day, user.ID, id)) + } + + for _, id := range taskIds { + keys = append(keys, ckey.FissionUserTaskDayLimit(day, user.ID, id)) + } + + app.Redis.Cache.Del(s.ctx, keys...) + *res = pb.RefreshDayLimitRes{} + return +} + +// NotifyList 奖品回调列表 +func (s *WScript) NotifyList(req *pb.NotifyListReq, res *pb.NotifyListRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return + } + + m := s.GetDao().FissionNotify + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + } + + if req.GetRewardHashId() != "" { + var record *model.FissionRewardRecord + recordM := s.GetDao().FissionRewardRecord.SubTable(cpn.ID) + record, err = recordM.WithContext(s.ctx).Where(recordM.HashID.Eq(req.GetRewardHashId())).Take() + if err = dbcheck.DbError(err); err != nil { + err = s.BE().MysqlError(err) + return + } + + if record != nil { + cond = append(cond, m.RecordID.Eq(record.ID)) + } else { + cond = append(cond, m.RecordID.Eq(0)) + } + + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.NotifyListRes{ + List: make([]*pb.NotifyListRes_One, 0, len(list)), + Total: total, + } + + if total == 0 { + return + } + + var ids []int64 + for _, v := range list { + ids = append(ids, v.ID) + } + + respM := s.GetDao().FissionNotifyResp + + respList, err := respM.WithContext(s.ctx).Where(respM.NotifyID.In(ids...)).Order(respM.ID.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var respMap = make(map[int64][]*model.FissionNotifyResp, len(ids)) + for _, v := range respList { + respMap[v.NotifyID] = append(respMap[v.NotifyID], v) + } + + for _, v := range list { + one := &pb.NotifyListRes_One{ + HashId: v.HashID, + CreatedAt: v.CreatedAt, + Body: v.Body, + NotifyUrl: v.NotifyURL, + Resp: nil, + } + + if resp, ok := respMap[v.ID]; ok { + one.Resp = make([]string, 0, len(resp)) + for i, v1 := range resp { + if i == 0 { + one.LastPush = v1.CreatedAt + } + one.Resp = append(one.Resp, v1.Resp) + } + } + + res.List = append(res.List, one) + } + + return +} + +// EtcdKey 查看etcd的key +func (s *WScript) EtcdKey(req *pb.EtcdKeyReq, res *pb.EtcdKeyRes) (err error) { + defer s.checkErr() + resp, err := app.EtcdCli.Get(s.ctx, req.GetPrefix(), clientv3.WithPrefix()) + if err != nil { + err = s.BE().VerifyError(err.Error()) + return + } + + *res = pb.EtcdKeyRes{ + Kvs: make([]*pb.EtcdKeyRes_KV, 0, len(resp.Kvs)), + } + + for _, ev := range resp.Kvs { + res.Kvs = append(res.Kvs, &pb.EtcdKeyRes_KV{ + Key: string(ev.Key), + Value: string(ev.Value), + }) + } + return +} + +// EventFlow 查看事件记录 +func (s *WScript) EventFlow(req *pb.EventFlowReq, res *pb.EventFlowRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + m := s.GetDao().ModuleStatisticsEventflow + list, err := m.WithContext(s.ctx).Where(m.ProjectID.Eq(project.ID)).Limit(100).Order(m.CreatedTime.Desc()).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + + var cpnHashIdMap = make(map[int64]string) + var cpnIds []int64 + for _, v := range list { + if _, ok := cpnHashIdMap[v.CampaignID]; !ok && v.CampaignID > 0 { + cpnIds = append(cpnIds, v.CampaignID) + cpnHashIdMap[v.CampaignID] = "" + } + } + + if len(cpnIds) > 0 { + cpnM := s.GetDao().FissionCampaign + + var cpnList []*model.FissionCampaign + cpnList, err = cpnM.WithContext(s.ctx).Where(cpnM.ID.In(cpnIds...)).Find() + if err != nil { + err = s.BE().MysqlError(err) + return + } + for _, cpn := range cpnList { + cpnHashIdMap[cpn.ID] = cpn.HashID + } + } + + *res = pb.EventFlowRes{ + List: make([]*pb.EventFlowRes_One, 0, len(list)), + } + + for _, v := range list { + res.List = append(res.List, &pb.EventFlowRes_One{ + LinkHashId: v.LinkHash, + DeviceId: v.DeviceID, + UserId: v.UserID, + EventTitle: v.EventKey, + IpAddress: v.IPAddress, + Os: v.Os, + OsVersion: v.OsVersion, + DeviceModel: v.DeviceModel, + EventData: v.EventData, + CreatedAt: int64(v.CreatedTime), + Source: utils.Ternary[int32](v.LinkID == 0, 1, utils.Ternary[int32](v.CampaignID == 0, 2, 3)), + CampaignHashId: cpnHashIdMap[v.CampaignID], + }) + } + + return +} + +// ClearDevice 清除设备信息 +func (s *WScript) ClearDevice(req *pb.ClearDeviceReq, res *pb.ClearDeviceRes) (err error) { + defer s.checkErr() + + project, err := s.ProjectErrNil(req.GetProjectHashId()) + if err != nil { + return + } + + if project.IsTest == mtype.No { + err = s.BE().VerifyError("not test project") + return + } + + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if cpn == nil { + err = s.BE().VerifyError("not found cpn") + return + } + + user, err := finder.FissionUser(s.ctx, cpn.ID, req.GetHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil || strings.HasPrefix(user.SubUserID, consts.TblPrefix) { + return + } + + cc := cache.NewFissionUser(s.ctx, cpn.ID) + + uid := consts.TblPrefix + xid.New().String() + + m := s.GetDao().FissionUser + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(user.ID)).UpdateSimple( + m.DeviceID.Value(""), + m.SubUserID.Value(uid), + m.UserMark.Value(uid), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + ms := s.GetDao().FissionUser.SubTable(cpn.ID) + _, err = ms.WithContext(s.ctx).Where(ms.ID.Eq(user.ID)).UpdateSimple( + ms.DeviceID.Value(""), + ms.SubUserID.Value(uid), + ms.UserMark.Value(uid), + ) + if err != nil { + err = s.BE().MysqlError(err) + return + } + + _, _ = app.NewDeepLinkDevice().DeleteDevice(s.ctx, &ddevicepb.DeleteDeviceReq{ + Code: user.DeviceID, + ProjectId: project.ID, + UserId: user.SubUserID, + }) + + _ = cc.Clear(user) + + iovdMark := ckey.FissionUserIovdMark(user.ID) + userMark := app.Redis.Cache.Get(s.ctx, iovdMark).Val() + + var keys = []string{ + ckey.FissionUserUniqMark(user.CampaignID, userMark), + } + + if user.DeviceID != "" { + keys = append(keys, cc.IdxKey("campaign_id", user.CampaignID, "device_id", user.DeviceID)) + } + + if user.SubUserID != "" { + keys = append(keys, cc.IdxKey("campaign_id", user.CampaignID, "sub_user_id", user.SubUserID)) + } + + app.Redis.Cache.Del(s.ctx, keys...) + + *res = pb.ClearDeviceRes{} + return +} + +// RefreshView 重新体验玩法 +func (s *WScript) RefreshView(req *pb.RefreshViewReq, res *pb.RefreshViewRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + err = s.BE().CacheError(err) + return + } + + user, err := cache.NewFissionUser(s.ctx, cpn.ID).FindBySubUserId(consts.FissionViewer) + if err != nil { + err = s.BE().CacheError(err) + return + } + + if user == nil { + return + } + + switch cpn.FissionID { + case consts.IdCash: + var cash *players.Cash + cash, err = players.NewCash(s.ctx, user) + if err != nil { + return + } + + err = cash.RefreshView() + if err != nil { + return + } + case consts.IdKeep: + var keep *players.KeepDog + keep, err = players.NewKeepDog(s.ctx, user) + if err != nil { + return + } + err = keep.RefreshView() + if err != nil { + return + } + case consts.IdChop: + var chop *players.Chop + chop, err = players.NewChop(s.ctx, user) + if err != nil { + return + } + err = chop.RefreshView() + if err != nil { + return + } + case consts.IdGold: + var chop *players.Gold + chop, err = players.NewGold(s.ctx, user) + if err != nil { + return + } + err = chop.RefreshView() + if err != nil { + return + } + } + + *res = pb.RefreshViewRes{} + return +} + +// ErrLog 错误日志记录 +func (s *WScript) ErrLog(req *pb.ErrLogReq, res *pb.ErrLogRes) (err error) { + defer s.checkErr() + + _ = s.GetDao().ErrLog.WithContext(s.ctx).Create(withdefault.ErrLog(&model.ErrLog{ + APIURL: req.GetApiUrl(), + Data: req.GetData(), + LinkURL: req.GetLinkUrl(), + Msg: req.GetMsg(), + })) + + *res = pb.ErrLogRes{} + return +} + +// PointsLog 领扣积分请求 +func (s *WScript) PointsLog(req *pb.PointsLogReq, res *pb.PointsLogRes) (err error) { + defer s.checkErr() + cpn, err := finder.Campaign(s.ctx, req.GetCampaignHashId()) + if err != nil { + return s.BE().CacheError(err) + } + + if cpn == nil || cpn.IsDel == mtype.Yes { + return + } + + m := s.GetDao().FissionPointsLog + var cond = []gen.Condition{ + m.CampaignID.Eq(cpn.ID), + } + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := m.WithContext(s.ctx).Where(cond...).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.PointsLogRes{ + List: make([]*pb.PointsLogRes_One, 0, len(list)), + Total: total, + } + + if total == 0 { + return + } + + for _, v := range list { + res.List = append(res.List, &pb.PointsLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Req: v.Req, + ReqUrl: v.ReqURL, + Token: v.Token, + ReqHeader: v.ReqHeader, + Resp: v.Resp, + ErrMsg: v.ErrMsg, + }) + } + + return +} + +// UserBehavior 用户行为日志 +func (s *WScript) UserBehavior(req *pb.UserBehaviorReq, res *pb.UserBehaviorRes) (err error) { + defer s.checkErr() + + _ = s.GetDao().UserBehavior.WithContext(s.ctx).Create(withdefault.UserBehavior(&model.UserBehavior{ + APIURL: req.GetApiUrl(), + Desc: req.GetDesc(), + CompanyID: req.GetCompanyId(), + UserID: req.GetUserId(), + ProjectID: req.GetProjectHashId(), + IP: req.GetIp(), + UaData: req.GetUaData(), + Req: req.GetReq(), + Res: req.GetRes(), + })) + + *res = pb.UserBehaviorRes{} + return +} + +// RewardPushLog 奖品推送日志 +func (s *WScript) RewardPushLog(req *pb.RewardPushLogReq, res *pb.RewardPushLogRes) (err error) { + defer s.checkErr() + + m := s.GetDao().RewardPush + + push, err := m.WithContext(s.ctx).Where( + m.Source.Eq(req.GetSource()), + m.FirstID.Eq(req.GetFirstId()), + m.SecondID.Eq(req.GetSecondId()), + m.RelateID.Eq(req.GetRelateId()), + ).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().CacheError(err) + } + + if push == nil { + return + } + + logM := s.GetDao().RewardPushLog + + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, total, err := logM.WithContext(s.ctx).Where(logM.PushID.Eq(push.ID)).Order(logM.CreatedAt.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.RewardPushLogRes{ + List: make([]*pb.RewardPushLogRes_One, 0, len(list)), + Total: total, + } + + for _, v := range list { + res.List = append(res.List, &pb.RewardPushLogRes_One{ + Id: v.ID, + CreatedAt: v.CreatedAt, + Req: v.Req, + ReqUrl: v.ReqURL, + Token: v.Token, + ReqHeader: v.ReqHeader, + Resp: v.Resp, + ErrMsg: v.ErrMsg, + ReqTime: v.ReqTime, + }) + } + + return +} diff --git a/internal/service/w_user.go b/internal/service/w_user.go new file mode 100644 index 0000000..bea561d --- /dev/null +++ b/internal/service/w_user.go @@ -0,0 +1,358 @@ +package service + +import ( + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/encrypt" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/dbcheck" + "joybuywork/internal/repository/finder" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/service/containers" + "joybuywork/internal/utils" + pb "joybuywork/proto/go_proto/w_user" + "joybuywork/proto/go_proto/workerr" + + c_userpb "gits.branchcn.com/backend/certified/proto/go_proto/c_user" + "gorm.io/gen/field" +) + +type WUser struct { + Service +} + +// Login 登陆 +func (s *WUser) Login(req *pb.LoginReq, res *pb.LoginRes) (err error) { + defer s.checkErr() + *res = pb.LoginRes{} + + container := new(containers.UserLogin) + { + container.Init(s.ctx) + container.Req = req + container.Res = res + } + + err = container.Run() + + return +} + +// List 用户列表 +func (s *WUser) List(req *pb.ListReq, res *pb.ListRes) (err error) { + defer s.checkErr() + + m := s.GetDao().User + offset, limit := utils.PpDbLo(req.GetPage(), req.GetPerPage()) + list, count, err := m.WithContext(s.ctx).Where(m.CompanyID.Eq(req.GetCompanyId()), m.IsDel.Eq(mtype.No)).Order(m.ID.Desc()).FindByPage(offset, limit) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.ListRes{ + List: make([]*pb.ListRes_One, 0, len(list)), + Total: count, + } + + if count == 0 { + return + } + + var userIds []int64 + for _, v := range list { + userIds = append(userIds, v.ID) + } + + //找员工和项目的关联关系 + relateM := s.GetDao().UserProjectRelate + relateList, err := relateM.WithContext(s.ctx).Where(relateM.UserID.In(userIds...), relateM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + //构建项目的hash表 + var projectMap = make(map[int64]*model.Project) + var userProjectMap = make(map[int64][]int64) + if len(relateList) > 0 { //有关联关系才处理 + + //得到关联的项目ID + var projectIds []int64 + for _, v := range relateList { + userProjectMap[v.UserID] = append(userProjectMap[v.UserID], v.ProjectID) + if _, ok := projectMap[v.ProjectID]; !ok { + projectIds = append(projectIds, v.ProjectID) + projectMap[v.ProjectID] = nil + } + } + + //查询表数据 + var projectList []*model.Project + projectM := s.GetDao().Project + projectList, err = projectM.WithContext(s.ctx).Where(projectM.ID.In(projectIds...), projectM.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range projectList { + projectMap[v.ID] = v + } + } + + for _, v := range list { + one := &pb.ListRes_One{ + Id: v.ID, + HashId: v.HashID, + ShowName: v.ShowName, + Username: v.Username, + Email: v.Email, + RoleName: utils.Ternary[string](v.IsAdmin == mtype.No, consts.NormalRoleName, consts.AdminRoleName), + } + + //写入关联项目数据 + if ids, ok := userProjectMap[v.ID]; ok { + for _, id := range ids { + if pro, ok1 := projectMap[id]; ok1 && pro != nil { + one.Projects = append(one.Projects, &pb.ListRes_Project{ + Id: pro.ID, + HashId: pro.HashID, + Title: pro.Title, + }) + } + + } + } + + res.List = append(res.List, one) + } + + return +} + +// Store 创建员工 +func (s *WUser) Store(req *pb.StoreReq, res *pb.StoreRes) (err error) { + defer s.checkErr() + + //保证只有一个账号被创建 + onceKey := ckey.UserStoreOnce(req.GetUsername()) + lc := app.NewRedisLock(s.ctx, onceKey) + defer lc.Release() + if !lc.SoftLock() { + return workerr.OnceLockError + } + + //验证用户名是否被使用 + m := s.GetDao().User + exist, err := m.WithContext(s.ctx).Where(m.Username.Eq(req.Username)).Take() + if err = dbcheck.DbError(err); err != nil { + return s.BE().MysqlError(err) + } + + if exist != nil && exist.IsDel == mtype.No { + return workerr.UserExistError + } + + user := withdefault.User(&model.User{ + CompanyID: req.GetCompanyId(), + Username: req.GetUsername(), + ShowName: req.GetShowName(), + Passwd: encrypt.UserPasswd(req.GetPasswd()), + Email: req.GetEmail(), + }) + + err = m.WithContext(s.ctx).Create(user) + if err != nil { + return s.BE().MysqlError(err) + } + + //创建项目 + pjm := s.GetDao().Project + var adds []*model.UserProjectRelate + var addMap = make(map[int64]struct{}) + //提交上来的项目id + if len(req.GetProjectHashIds()) > 0 { + var pjs []*model.Project + pjs, err = pjm.WithContext(s.ctx).Where(pjm.HashID.In(req.GetProjectHashIds()...), pjm.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range pjs { + adds = append(adds, withdefault.UserProjectRelate(&model.UserProjectRelate{ + UserID: user.ID, + ProjectID: v.ID, + })) + addMap[v.ID] = struct{}{} + } + } + + //标识为所有员工都可以看的项目 + var pjs []*model.Project + pjs, err = pjm.WithContext(s.ctx).Where(pjm.CompanyID.Eq(req.GetCompanyId()), pjm.IsAll.Eq(mtype.Yes), pjm.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range pjs { + //没有选中的才添加,避免重复添加 + if _, ok := addMap[v.ID]; !ok { + adds = append(adds, withdefault.UserProjectRelate(&model.UserProjectRelate{ + UserID: user.ID, + ProjectID: v.ID, + })) + } + } + + if len(adds) > 0 { + err = s.GetDao().UserProjectRelate.WithContext(s.ctx).Create(adds...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + *res = pb.StoreRes{} + + //清空缓存 + err = cache.NewUser(s.ctx).Clear(user) + if err != nil { + return s.BE().RedisError(err) + } + + return +} + +// Update 更新员工 +func (s *WUser) Update(req *pb.UpdateReq, res *pb.UpdateRes) (err error) { + defer s.checkErr() + m := s.GetDao().User + user, err := finder.User(s.ctx, req.GetHashId(), req.GetId()) + if err != nil { + return s.BE().CacheError(err) + } + + if user == nil || user.IsDel == mtype.Yes { + return workerr.NotFound("not found user") + } + + //找到和用户关联的项目id + var oldIds []int64 + uprM := s.GetDao().UserProjectRelate + err = uprM.WithContext(s.ctx).Where(uprM.UserID.Eq(user.ID), uprM.IsDel.Eq(mtype.No)).Pluck(uprM.ProjectID, &oldIds) + if err != nil { + return s.BE().MysqlError(err) + } + + *res = pb.UpdateRes{} + + var updateField []field.AssignExpr + if user.ShowName != req.GetShowName() { + updateField = append(updateField, m.ShowName.Value(req.ShowName)) + } + + if req.GetPasswd() != "" { + valid, _ := encrypt.CheckUserPasswd(req.GetPasswd(), user.Passwd) + if !valid { + updateField = append(updateField, m.Passwd.Value(encrypt.UserPasswd(req.GetPasswd()))) + } + } + + if len(updateField) > 0 { + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(updateField...) + if err != nil { + return s.BE().MysqlError(err) + } + } + + //清空缓存 + err = cache.NewUser(s.ctx).Clear(user) + if err != nil { + return s.BE().RedisError(err) + } + + return +} + +// Destroy 删除员工 +func (s *WUser) Destroy(req *pb.DestroyReq, res *pb.DestroyRes) (err error) { + defer s.checkErr() + *res = pb.DestroyRes{} + + m := s.GetDao().User + user, err := finder.User(s.ctx, req.GetHashId(), req.GetId()) + if err != nil { + return s.BE().CacheError(err) + } + + if user == nil || user.IsDel == mtype.Yes { + return + } + + if user.IsAdmin == mtype.Yes { + return workerr.UserDelError + } + + _, err = m.WithContext(s.ctx).Where(m.ID.Eq(user.ID)).UpdateSimple(m.IsDel.Value(mtype.Yes)) + if err != nil { + return s.BE().MysqlError(err) + } + + //清空缓存 + err = cache.NewUser(s.ctx).Clear(user) + if err != nil { + return s.BE().RedisError(err) + } + + _, _ = app.NewCertifiedUser().Destroy(s.ctx, &c_userpb.DestroyReq{Id: user.ID}) + + return +} + +// Show 员工详情 +func (s *WUser) Show(req *pb.ShowReq, res *pb.ShowRes) (err error) { + defer s.checkErr() + + user, err := finder.User(s.ctx, req.GetHashId(), req.GetId()) + if err != nil { + return s.BE().CacheError(err) + } + + if user == nil || user.IsDel == mtype.Yes { + return workerr.NotFound("not found user") + } + + *res = pb.ShowRes{ + Id: user.ID, + HashId: user.HashID, + ShowName: user.ShowName, + Username: user.Username, + Email: user.Email, + IsAdmin: user.IsAdmin == mtype.Yes, + } + + return +} + +// Select 用户选择列表 +func (s *WUser) Select(req *pb.SelectReq, res *pb.SelectRes) (err error) { + defer s.checkErr() + + *res = pb.SelectRes{} + + m := s.GetDao().User + list, err := m.WithContext(s.ctx).Where(m.CompanyID.Eq(req.GetCompanyId()), m.IsDel.Eq(mtype.No)).Find() + if err != nil { + return s.BE().MysqlError(err) + } + + for _, v := range list { + res.List = append(res.List, &pb.SelectRes_One{ + Id: v.ID, + HashId: v.HashID, + ShowName: v.ShowName, + }) + } + + return +} diff --git a/internal/utils/arr/arr.go b/internal/utils/arr/arr.go new file mode 100644 index 0000000..a32af66 --- /dev/null +++ b/internal/utils/arr/arr.go @@ -0,0 +1,28 @@ +package arr + +import "joybuywork/internal/consts" + +// NotExistAppend 不存在就数组里面就追加 +func NotExistAppend[T consts.NormalType](source, adds []T) []T { + + if len(source) == 0 { + return adds + } + + if len(adds) == 0 { + return source + } + + var data = make(map[T]struct{}, len(source)) + for _, v := range source { + data[v] = struct{}{} + } + + for _, v := range adds { + if _, ok := data[v]; !ok { + source = append(source, v) + } + } + + return source +} diff --git a/internal/utils/blink/ads_jump.go b/internal/utils/blink/ads_jump.go new file mode 100644 index 0000000..28d2e2c --- /dev/null +++ b/internal/utils/blink/ads_jump.go @@ -0,0 +1,56 @@ +package blink + +import ( + "joybuywork/internal/config" + "fmt" +) + +type AdsJump struct { + link + strategyId string //广告策略id + lang string //活动用户语言 +} + +func NewAdsJump(strategyId string, opts ...AdsJumpOption) AdsJump { + + l := AdsJump{ + link: link{ + host: config.Config.Server.AdsJump, + }, + strategyId: strategyId, + } + + for _, opt := range opts { + opt(&l) + } + + return l +} + +// AddOption 追加参数 +func (l AdsJump) AddOption(opts ...AdsJumpOption) AdsJump { + for _, opt := range opts { + opt(&l) + } + + return l +} + +// Link 跳转链接 +func (l AdsJump) Link() string { + return l.params(l.host) +} + +// 参数 +func (l AdsJump) params(link string) (url string) { + url = fmt.Sprintf( + "%s?%s=%s", + link, + adsJumpChannel, + l.strategyId, + ) + + url = queryAddStr(url, langParamKey, l.lang) + + return +} diff --git a/internal/utils/blink/ads_link.go b/internal/utils/blink/ads_link.go new file mode 100644 index 0000000..7802005 --- /dev/null +++ b/internal/utils/blink/ads_link.go @@ -0,0 +1,65 @@ +package blink + +import ( + "joybuywork/internal/config" + "joybuywork/internal/consts" + "fmt" +) + +type AdsLink struct { + link + userId string //活动用户id +} + +func NewAdsLink(domain, hashId, cmark string, opts ...AdsLinkOption) AdsLink { + switch config.Config.Server.Env { + case consts.Dev, consts.Local, consts.Test: + domain = fmt.Sprintf("dev%s", config.Config.Server.AdsDomain) + case consts.Prod: + domain = fmt.Sprintf("%s%s", domain, config.Config.Server.AdsDomain) + } + + l := AdsLink{ + link: link{ + host: fmt.Sprintf("%s%s", config.Config.Server.AdsDomainProto, domain), + hashId: hashId, + cmark: cmark, + }, + } + + for _, opt := range opts { + opt(&l) + } + + return l +} + +// AddOption 追加参数 +func (l AdsLink) AddOption(opts ...AdsLinkOption) AdsLink { + for _, opt := range opts { + opt(&l) + } + + return l +} + +// CampaignShareLink 活动链接 +func (l AdsLink) CampaignShareLink() string { + return l.params(fmt.Sprintf("%s/%s", l.host, route)) +} + +// 参数 +func (l AdsLink) params(link string) (url string) { + url = fmt.Sprintf( + "%s?%s=%s&%s=%s", + link, + campaignHashIdKey, + l.hashId, + campaignCmarkKey, + l.cmark, + ) + + url = queryAddStr(url, campaignUserIdKey, l.userId) + + return +} diff --git a/internal/utils/blink/campaign_link.go b/internal/utils/blink/campaign_link.go new file mode 100644 index 0000000..4f7a3af --- /dev/null +++ b/internal/utils/blink/campaign_link.go @@ -0,0 +1,142 @@ +package blink + +import ( + "joybuywork/internal/config" + "joybuywork/internal/consts" + "fmt" +) + +type CampaignLink struct { + link + cwMark string //站外渠道标识 + subUserId string //第三方用户id + lang string //语言标识 + lv string //用户等级标识 + scene int8 //项目应用场景类型 + dyLinkId string //动态下载页链接id + ctLinkId string //链接内容id + isView bool //是否预览用户 + userId string //活动用户id + center +} + +type center struct { + centerId string // 任务中心id + moduleId string // 模块id +} + +func NewCampaignLink(domain, hashId, cmark string, opts ...CpnLinkOption) CampaignLink { + switch config.Config.Server.Env { + case consts.Dev, consts.Local: + domain = "dev" + case consts.Test: + domain = "test" + } + + l := CampaignLink{ + link: link{ + host: fmt.Sprintf("%s%s%s", config.Config.Server.LinkDomainProto, domain, config.Config.Server.LinkDomain), + hashId: hashId, + cmark: cmark, + }, + } + + for _, opt := range opts { + opt(&l) + } + + return l +} + +// AddOption 追加参数 +func (l CampaignLink) AddOption(opts ...CpnLinkOption) CampaignLink { + for _, opt := range opts { + opt(&l) + } + + return l +} + +// CampaignCodeLink 口令链接 +func (l CampaignLink) CampaignCodeLink() string { + return l.params(fmt.Sprintf("%s/%s", l.host, route)) +} + +// CampaignShareLink 活动链接 +func (l CampaignLink) CampaignShareLink() string { + return l.params(fmt.Sprintf("%s/%s", l.host, route)) +} + +// CampaignDownloadLink 活动下载链接 +func (l CampaignLink) CampaignDownloadLink() string { + return l.params(fmt.Sprintf("%s/%s/%s", l.host, route, downloadRoute)) +} + +// CampaignWebLink 站外活动链接 +func (l CampaignLink) CampaignWebLink() string { + return l.params(fmt.Sprintf("%s/%s/%s", l.host, route, webRoute)) +} + +// CampaignWebShareLink WebToWeb分享链接 +func (l CampaignLink) CampaignWebShareLink() string { + return l.params(fmt.Sprintf("%s/%s/%s", l.host, route, downloadRoute)) +} + +// CampaignDynamicLink 活动动态下载页地址 +func (l CampaignLink) CampaignDynamicLink() string { + return l.params(fmt.Sprintf("%s/%s/%s", l.host, route, downloadRoute)) +} + +// CampaignContentLink 活动下载页内容链接 +func (l CampaignLink) CampaignContentLink() string { + return l.params(fmt.Sprintf("%s/%s/%s", l.host, route, downloadRoute)) +} + +// 参数 +func (l CampaignLink) params(link string) (url string) { + url = fmt.Sprintf( + "%s?%s=%s&%s=%s", + link, + campaignHashIdKey, + l.hashId, + campaignCmarkKey, + l.cmark, + ) + + url = queryAddStr(url, campaignCmarkWithWebKey, l.cwMark) + url = queryAddStr(url, subUserIdParamKey, l.subUserId) + url = queryAddStr(url, campaignDynamicKey, l.dyLinkId) + url = queryAddStr(url, campaignContentLinkKey, l.ctLinkId) + url = queryAddStr(url, langParamKey, l.lang) + url = queryAddStr(url, levelParamKey, l.lv) + url = queryAddStr(url, campaignUserIdKey, l.userId) + url = queryAddStr(url, centerHashIdKey, l.centerId) + url = queryAddStr(url, centerModuleIdKey, l.moduleId) + + url = queryAddInt(url, projectSceneKey, l.scene) + + url = queryAddBool(url, viewerParamKey, l.isView) + + return +} + +func queryAddStr(link, key string, value string) string { + if value == "" { + return link + } + return fmt.Sprintf("%s&%s=%s", link, key, value) +} + +func queryAddInt[T consts.IntType](link, key string, value T) string { + if value == 0 { + return link + } + return fmt.Sprintf("%s&%s=%v", link, key, value) +} + +func queryAddBool(link, key string, value bool) string { + if !value { + return link + } + return fmt.Sprintf("%s&%s=true", link, key) +} diff --git a/internal/utils/blink/game_link.go b/internal/utils/blink/game_link.go new file mode 100644 index 0000000..1764c2f --- /dev/null +++ b/internal/utils/blink/game_link.go @@ -0,0 +1,54 @@ +package blink + +import ( + "fmt" +) + +type GameLink struct { + link + tblpid string //项目id + tblgid string //游戏id +} + +func NewGameLink(host, tblpid string, opts ...GameLinkOption) GameLink { + l := GameLink{ + link: link{ + host: host, + }, + tblpid: tblpid, + } + + for _, opt := range opts { + opt(&l) + } + + return l +} + +// AddOption 追加参数 +func (l GameLink) AddOption(opts ...GameLinkOption) GameLink { + for _, opt := range opts { + opt(&l) + } + + return l +} + +// Link 游戏链接 +func (l GameLink) Link() string { + return l.params(l.host) +} + +// 参数 +func (l GameLink) params(link string) (url string) { + url = fmt.Sprintf( + "%s&%s=%s", + link, + gameProjectIdKey, + l.tblpid, + ) + + url = queryAddStr(url, gameLinkIdKey, l.tblgid) + + return +} diff --git a/internal/utils/blink/link.go b/internal/utils/blink/link.go new file mode 100644 index 0000000..fd8729c --- /dev/null +++ b/internal/utils/blink/link.go @@ -0,0 +1,56 @@ +package blink + +import "strings" + +const ( + route = "c" //H5活动路由关键字 + downloadRoute = "d" //H5活动下载页路由关键字 + webRoute = "p" //H5站外活动路由关键字 + + // query关键字 + + campaignHashIdKey = "l" //H5活动hash_id关键字 + campaignCmarkKey = "c" //H5活动渠道id关键字 + campaignCmarkWithWebKey = "cw" //H5活动渠道站外渠道 + subUserIdParamKey = "u" //H5活动第三方用户id分享关键字 + projectSceneKey = "s" //项目应用场景值 + campaignDynamicKey = "dy" //动态下载链接关键字 + campaignContentLinkKey = "ct" //下载页内容链接关键字 + langParamKey = "lg" //语言关键字 + levelParamKey = "lv" //用户等级关键字 + viewerParamKey = "vt" //预览用户关键字 + campaignUserIdKey = "user_id" //活动用户id关键字 + adsJumpChannel = "channel" //广告策略id关键字 + centerHashIdKey = "t" //任务中心hash_id关键字 + centerModuleIdKey = "tm" //任务中心模块id关键字 + gameLinkIdKey = "tlgid" //游戏id关键字 + gameProjectIdKey = "tlpid" //项目id关键字 +) + +type link struct { + host string //域名 + hashId string //活动hashId + cmark string //渠道标识 +} + +// GetUrlCampaignHashId 获取url中的活动hashid +func GetUrlCampaignHashId(url string) string { + _, query, found := strings.Cut(url, "?") + if !found || query == "" { + return "" + } + + paramsArr := strings.Split(query, "&") + for _, v := range paramsArr { + key, val, ok := strings.Cut(v, "=") + if !ok { + continue + } + + if key == campaignHashIdKey { + return val + } + } + + return "" +} diff --git a/internal/utils/blink/option.go b/internal/utils/blink/option.go new file mode 100644 index 0000000..d502bb1 --- /dev/null +++ b/internal/utils/blink/option.go @@ -0,0 +1,105 @@ +package blink + +import "fmt" + +type CpnLinkOption func(link *CampaignLink) + +// SetUserId 第三方用户id +func SetUserId(userId string) CpnLinkOption { + return func(link *CampaignLink) { + link.userId = userId + } +} + +// SetCwMark 站外渠道标识 +func SetCwMark(cwMark string) CpnLinkOption { + return func(link *CampaignLink) { + link.cwMark = cwMark + } +} + +// SetSubUserId 简写key的第三方用户id +func SetSubUserId(subUserId string) CpnLinkOption { + return func(link *CampaignLink) { + link.subUserId = subUserId + } +} + +// SetLang 语言标识 +func SetLang(lang string) CpnLinkOption { + return func(link *CampaignLink) { + link.lang = lang + } +} + +// SetLevel 用户等级标识 +func SetLevel(lv string) CpnLinkOption { + return func(link *CampaignLink) { + link.lv = lv + } +} + +// SetScene 项目应用场景类型 +func SetScene(scene int8) CpnLinkOption { + return func(link *CampaignLink) { + link.scene = scene + } +} + +// SetDyLinkId 动态下载页链接id +func SetDyLinkId(dyLinkId string) CpnLinkOption { + return func(link *CampaignLink) { + link.dyLinkId = dyLinkId + } +} + +// SetCtLinkId 链接内容id +func SetCtLinkId(ctLinkId string) CpnLinkOption { + return func(link *CampaignLink) { + link.ctLinkId = ctLinkId + } +} + +// SetView 是否预览用户 +func SetView() CpnLinkOption { + return func(link *CampaignLink) { + link.isView = true + } +} + +// SetTaskCenter 链接内容id +func SetTaskCenter(centerHashId string, moduleId int64) CpnLinkOption { + return func(link *CampaignLink) { + link.center = center{ + centerId: centerHashId, + moduleId: fmt.Sprint(moduleId), + } + } +} + +type AdsLinkOption func(link *AdsLink) + +// SetAdsUserId 第三方用户id +func SetAdsUserId(userId string) AdsLinkOption { + return func(link *AdsLink) { + link.userId = userId + } +} + +type AdsJumpOption func(link *AdsJump) + +// SetAdsJumpLg 第三方用户语言 +func SetAdsJumpLg(lang string) AdsJumpOption { + return func(link *AdsJump) { + link.lang = lang + } +} + +type GameLinkOption func(link *GameLink) + +// SetGameLinkId 游戏链接id +func SetGameLinkId(linkId string) GameLinkOption { + return func(link *GameLink) { + link.tblgid = linkId + } +} diff --git a/internal/utils/decimal/decimal.go b/internal/utils/decimal/decimal.go new file mode 100644 index 0000000..4373d7e --- /dev/null +++ b/internal/utils/decimal/decimal.go @@ -0,0 +1,39 @@ +package decimal + +import ( + "github.com/shopspring/decimal" +) + +// Div 除以 +func Div(numerator, denominator int64) decimal.Decimal { + num, den := decimal.NewFromInt(numerator), decimal.NewFromInt(denominator) + return num.Div(den) +} + +// Percent 百分额 +func Percent(numerator, denominator int64) decimal.Decimal { + return Div(numerator, denominator).Mul(decimal.NewFromFloat(100)) +} + +// Chain 环比 +func Chain(numerator, denominator int64) decimal.Decimal { + num, den := decimal.NewFromInt(numerator), decimal.NewFromInt(denominator) + return num.Sub(den).Div(den) +} + +// DenZero 分母0处理 +func DenZero(numerator, denominator, max int64) (decimal.Decimal, bool) { + if denominator != 0 { + return decimal.Decimal{}, false + } + + if numerator == 0 { + return decimal.Zero, true + } + + if numerator > max { + numerator = max + } + + return decimal.NewFromInt(max), true +} diff --git a/internal/utils/decimal/helper.go b/internal/utils/decimal/helper.go new file mode 100644 index 0000000..1de4286 --- /dev/null +++ b/internal/utils/decimal/helper.go @@ -0,0 +1,108 @@ +package decimal + +import ( + "github.com/shopspring/decimal" +) + +// Percent2PointMax9999 百分额,保留2位小数,如果分母为0 ,最大返回9999% +func Percent2PointMax9999(numerator, denominator int64) string { + zero, ok := DenZero(numerator, denominator, 9999) + if ok { + return zero.StringFixedBank(2) + } + + val := Percent(numerator, denominator) + fnum := val.InexactFloat64() + if fnum > 0 && fnum < 0.01 { + return "0.01" + } + + return val.StringFixedBank(2) +} + +// Chain1PointMax999 环比,保留1位小数据,如果分母为0 ,最大返回999% +func Chain1PointMax999(numerator, denominator int64) (int32, string) { + if numerator == 0 { + return 0, "0" + } + + zero, ok := DenZero(numerator, denominator, 999) + if ok { + return 1, zero.StringFixed(1) + } + + var status int32 + + val := Chain(numerator, denominator).Mul(decimal.NewFromFloat(100)) + + fnum := val.InexactFloat64() + if fnum < 0 { + status = 2 + } else if fnum > 0 { + status = 1 + } + + val = val.Abs() + + fnum = val.InexactFloat64() + if fnum > 0 && fnum < 0.1 { + return status, "0.1" + } + + return status, val.StringFixed(1) +} + +// Percent2PointMap 百分额hash表,保证计算合计100% +func Percent2PointMap(children []*Operator, denominator int64) OperatorMap { + om := make(OperatorMap, len(children)) + + var oc []*Operator + for _, child := range children { + if child.Num == 0 || denominator == 0 { + om[child.Id] = "0.00" + } else { + oc = append(oc, child) + } + } + + lid := len(oc) + if lid > 1 { + var zero = decimal.Zero + var dec = make(map[int64]decimal.Decimal) + var maxChild = decimal.Zero + var maxIdx int64 + for _, child := range oc { + val := Percent(child.Num, denominator) + if val.InexactFloat64() < 0.01 { + val = decimal.NewFromFloat(0.01) + } + + // 只要小数后两位 + val = val.RoundBank(2) + + if val.GreaterThan(maxChild) { + maxChild = val + maxIdx = child.Id + } + + dec[child.Id] = val + zero = zero.Add(val) + } + + var hundred = decimal.NewFromFloat(100) + + if zero.GreaterThan(hundred) { + dec[maxIdx] = dec[maxIdx].Sub(zero.Sub(hundred)) + } else if zero.LessThan(hundred) { + dec[maxIdx] = dec[maxIdx].Add(hundred.Sub(zero)) + } + + for id, v := range dec { + om[id] = v.StringFixedBank(2) + } + } else if lid == 1 { + om[oc[0].Id] = "100.00" + } + + return om +} diff --git a/internal/utils/decimal/helper_test.go b/internal/utils/decimal/helper_test.go new file mode 100644 index 0000000..e3ca0fe --- /dev/null +++ b/internal/utils/decimal/helper_test.go @@ -0,0 +1,25 @@ +package decimal + +import "testing" + +func TestPercent2PointMap(t *testing.T) { + + var children = []*Operator{ + { + Id: 1, + Num: 1, + }, { + Id: 2, + Num: 2, + }, { + Id: 3, + Num: 3, + }, { + Id: 5, + Num: 5, + }, + } + var denominator int64 = 11 + + t.Logf("%+v", Percent2PointMap(children, denominator)) +} diff --git a/internal/utils/decimal/types.go b/internal/utils/decimal/types.go new file mode 100644 index 0000000..06ec462 --- /dev/null +++ b/internal/utils/decimal/types.go @@ -0,0 +1,8 @@ +package decimal + +type Operator struct { + Id int64 + Num int64 +} + +type OperatorMap map[int64]string diff --git a/internal/utils/ept/ept.go b/internal/utils/ept/ept.go new file mode 100644 index 0000000..a25b7c2 --- /dev/null +++ b/internal/utils/ept/ept.go @@ -0,0 +1,45 @@ +package ept + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/internal/plugins/export" + "joybuywork/internal/plugins/jsonm" + "fmt" + rp "gits.branchcn.com/backend/microcode/plugins/derivative/progress" + "time" +) + +// GetExportHashAndInitProgress 获取导出唯一标识并初始化进度 +func GetExportHashAndInitProgress(ctx context.Context) (hs, key string) { + hs = export.BuildHashMark() + key = ckey.ExportKey(hs) + + app.NewRedisProgress(ctx, key).CreateProgress() + return +} + +// WaitExportResult 等待导出结果,拿到导出结果后,缓存的导出结果会被删除 +func WaitExportResult(ctx context.Context, key string) (url, err string) { + progress := app.NewRedisProgress(ctx, key) + defer progress.Release() + for { + select { + case <-ctx.Done(): + return + default: + res := progress.GetExportProgress() + if res.Status == rp.StatusSuccess || res.Status == rp.StatusFail { + return res.Content, res.ErrMsg + } + time.Sleep(50 * time.Millisecond) + } + } +} + +// PrintExportProgress 打印导出进度 +func PrintExportProgress(ctx context.Context, progress *rp.Progress) { + b, _ := jsonm.MarshalToString(progress.GetExportProgress()) + app.Logger.Info(ctx, fmt.Sprintf("[%s]当前导出进度数据:%s", progress.Key, b)) +} diff --git a/internal/utils/helper.go b/internal/utils/helper.go new file mode 100644 index 0000000..42c42e1 --- /dev/null +++ b/internal/utils/helper.go @@ -0,0 +1,112 @@ +// Package utils 依赖 joybuywork/internal 里面的东西写到这个文件 +package utils + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/repository/mtype" + "joybuywork/internal/utils/verify" + "fmt" + "math/rand" + "strings" + "time" + + "github.com/golang-module/carbon/v2" +) + +func GetRandEnStr(l int) string { + b := make([]byte, l) + for i := range b { + c := rand.Intn(len(consts.RandEnStr)) + b[i] = consts.RandEnStr[c] + } + + return string(b) +} + +// CampaignArchiveEnd 活动归档结束 +func CampaignArchiveEnd(endTime int64) time.Time { + return carbon.CreateFromTimestamp(endTime).EndOfDay().ToStdTime() +} + +// BehaviorFormatMark 行为带特殊id的标识 +func BehaviorFormatMark(bt int32, markId any) string { + return fmt.Sprintf("%s%s%v", mtype.BehaviorTypeToMark[bt], consts.Colon, markId) +} + +// BehaviorMarkToType 带特殊id的标识转换成类型 +func BehaviorMarkToType(mark string) int32 { + mk := strings.Split(mark, consts.Colon) + return mtype.BehaviorMarkToType[mk[0]] +} + +// BehaviorMarkId 获取带特殊id的标识的id +func BehaviorMarkId(mark string) string { + _, id, _ := strings.Cut(mark, consts.Colon) + return id +} + +// FissionCampaignTaskMarkCondOneVal 完成任意事件的标识值 +func FissionCampaignTaskMarkCondOneVal(condId int64) string { + return fmt.Sprintf("%s%s%d", mtype.FissionCampaignTaskMarkCondOne, consts.Colon, condId) +} + +// FissionCampaignTaskMarkCondOneCondId 完成任意事件的条件ID +func FissionCampaignTaskMarkCondOneCondId(taskMark string) int64 { + _, id, _ := strings.Cut(taskMark, consts.Colon) + return StrToInt64(id) +} + +// FissionCampaignTaskMarkRewardOneVal 完成奖品任务的标识值 +func FissionCampaignTaskMarkRewardOneVal(rewardId int64) string { + return fmt.Sprintf("%s%s%d", mtype.FissionCampaignTaskMarkRewardOne, consts.Colon, rewardId) +} + +// FissionCampaignTaskMarkRewardOneRewardId 完成奖品任务的奖品ID +func FissionCampaignTaskMarkRewardOneRewardId(taskMark string) int64 { + _, id, _ := strings.Cut(taskMark, consts.Colon) + return StrToInt64(id) +} + +type CondTotalFinishRes struct { + Num int32 // 完成的次数 + Remain string // 剩余累计计算数值 +} + +// CondTotalFinishNum 条件累计值完成次数 +func CondTotalFinishNum(total, condVal string, bk ...func(doneNum int32) bool) (res *CondTotalFinishRes) { + res = &CondTotalFinishRes{} + + t, cv := StrToFloat64(total), StrToFloat64(condVal) + defer func() { + res.Remain = t.String() + }() + if t.LessThan(cv) { + return + } + + idx := 0 + for { + + idx++ + res.Num++ + t = t.Sub(cv) + + if len(bk) > 0 && bk[0](res.Num) { + return + } + + if t.LessThan(cv) || idx >= 50 { + return + } + + } +} + +// NewGlobalTrigger 全局驱动 +func NewGlobalTrigger(fissionId int64, t int32) int32 { + if t == 0 || verify.InArray(fissionId, consts.IdReferral) { + return mtype.FissionCampaignCondTriggerTypeGlobal + } + + return t +} diff --git a/internal/utils/lockdo/lock_do.go b/internal/utils/lockdo/lock_do.go new file mode 100644 index 0000000..bc0e138 --- /dev/null +++ b/internal/utils/lockdo/lock_do.go @@ -0,0 +1,140 @@ +package lockdo + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts/ckey" + "joybuywork/proto/go_proto/workerr" + "errors" + "math/rand" + "time" + + grds "github.com/go-redis/redis/v8" +) + +func Int64(ctx context.Context, key string, find func() (num int64, err error)) (num int64, err error) { + num, err = app.Redis.Cache.Get(ctx, key).Int64() + if !errors.Is(err, grds.Nil) { + if err != nil { + return + } + return num, nil + } + + lc := app.NewFollower(ctx, ckey.ForLock(key)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + num, err = app.Redis.Cache.Get(ctx, key).Int64() + if !errors.Is(err, grds.Nil) { + if err != nil { + return + } + return num, nil + } + + num, err = find() + if err != nil { + return + } + + app.Redis.Cache.IncrBy(ctx, key, num) + app.Redis.Cache.Expire(ctx, key, Rand2HourExp()) + + return +} + +func Bytes(ctx context.Context, key string, find func() (data []byte, err error)) (data []byte, err error) { + data, err = app.Redis.Cache.Get(ctx, key).Bytes() + if !errors.Is(err, grds.Nil) { + if err != nil { + return + } + return data, nil + } + + lc := app.NewFollower(ctx, ckey.ForLock(key)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + data, err = app.Redis.Cache.Get(ctx, key).Bytes() + if !errors.Is(err, grds.Nil) { + if err != nil { + return + } + return data, nil + } + + data, err = find() + if err != nil { + return + } + + app.Redis.Cache.Set(ctx, key, data, Rand2HourExp()) + return +} + +// ExistDo Key如果存在就返回,不存在就锁住做一些操作 +func ExistDo(ctx context.Context, key string, fn func(exist bool) (err error)) (err error) { + exist, err := app.Redis.Exists(ctx, key) + if err != nil { + return + } + + if exist { + return fn(true) + } + + lc := app.NewFollower(ctx, ckey.ForLock(key)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + exist, err = app.Redis.Exists(ctx, key) + if err != nil { + return + } + + return fn(exist) +} + +func FindNilDo(ctx context.Context, key string, find func() (none bool, err error), create func() (err error)) (err error) { + none, err := find() + if err != nil { + return + } + + if !none { + return + } + + lc := app.NewFollower(ctx, ckey.ForLock(key)).Lock() + defer lc.Release() + if lc.Error() != nil { + err = workerr.BusyError + return + } + + none, err = find() + if err != nil { + return + } + + if !none { + return + } + + return create() +} + +func Rand2HourExp() time.Duration { + return time.Duration(rand.Intn(60)+60) * time.Minute +} diff --git a/internal/utils/logic/context.go b/internal/utils/logic/context.go new file mode 100644 index 0000000..6a3fb15 --- /dev/null +++ b/internal/utils/logic/context.go @@ -0,0 +1,139 @@ +package logic + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/consts" + "joybuywork/internal/repository/dao" + "joybuywork/internal/service/provider/traces" + "joybuywork/internal/utils/merr" + "fmt" + + "go-micro.dev/v4/metadata" +) + +type after struct { + done []func() + errDone []func() + okDone []func() +} + +func (s *after) AddDone(dc ...func()) { + s.done = append(s.done, dc...) +} + +func (s *after) AddErrDone(dc ...func()) { + s.errDone = append(s.errDone, dc...) +} + +func (s *after) AddOkDone(dc ...func()) { + s.okDone = append(s.okDone, dc...) +} + +func (s *after) AfterDo(err error) { + for _, fc := range s.done { + fc() + } + + if err != nil { + for _, fc := range s.errDone { + fc() + } + } else { + for _, fc := range s.okDone { + fc() + } + } + +} + +type Context struct { + Ctx context.Context + be *merr.BusinessError + dao *dao.Query + daoTx *dao.QueryTx + withTran bool + rollback string + + fnTimer *traces.FnTimers + + after +} + +// Init 初始化一个逻辑类 +func (c *Context) Init(ctx context.Context, dao *dao.Query, be *merr.BusinessError) { + c.BaseInit(ctx, be, WithDao(dao)) +} + +// BaseInit 基础初始化一个逻辑类 +func (c *Context) BaseInit(ctx context.Context, be *merr.BusinessError, opts ...CtxOption) { + c.Ctx = ctx + c.be = be + c.dao = dao.Q + + for _, opt := range opts { + opt(c) + } +} + +// GetDao 获取dao +func (c *Context) GetDao() *dao.Query { + if c.withTran { + return c.daoTx.Query + } + + return c.dao +} + +// Tran 事务开启 +func (c *Context) Tran() { + c.daoTx = c.dao.Begin() + c.withTran = true + + return +} + +// TranCommit 事务提交 +func (c *Context) TranCommit(err error) { + if !c.withTran { + return + } + + c.withTran = false + + if err != nil { + _ = c.daoTx.Rollback() + app.Logger.Warn(c.Ctx, fmt.Sprintf("事务回滚了,原因:%v", err)) + return + } + + if c.rollback != "" { + _ = c.daoTx.Rollback() + app.Logger.Warn(c.Ctx, fmt.Sprintf("事务回滚了,原因:%s", c.rollback)) + return + } + + _ = c.daoTx.Commit() + + return +} + +func (c *Context) BE() *merr.BusinessError { + return c.be +} + +func (c *Context) FnTm() *traces.FnTimers { + return c.fnTimer +} + +func (c *Context) Debug() { + val, ok := metadata.Get(c.Ctx, consts.DebugKey) + if !ok || val != "open" { + return + } + c.fnTimer = traces.NewFnTimers(c.Ctx) +} + +func (c *Context) Rollback(reason string) { + c.rollback = reason +} diff --git a/internal/utils/logic/logic.go b/internal/utils/logic/logic.go new file mode 100644 index 0000000..8755b4f --- /dev/null +++ b/internal/utils/logic/logic.go @@ -0,0 +1,258 @@ +package logic + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/operatelog" + "joybuywork/internal/utils/merr" + "joybuywork/proto/go_proto/workerr" + "fmt" + "time" + + grds "github.com/go-redis/redis/v8" + "gits.branchcn.com/backend/microcode/plugins/derivative/lock" + "go-micro.dev/v4/errors" +) + +type afterRunFunc func() (err error) + +type afterRuns struct { + runs []afterRunFunc + errRuns []afterRunFunc + mustRuns []afterRunFunc +} + +type errNotify struct { + eqCode []int32 + neqCode map[int32]struct{} +} + +type once struct { + key string + lock *lock.RedisLock +} + +type Logic struct { + Context + cache *grds.Client + stop bool + afterRuns afterRuns + afterErr []error + + once *once // 锁 + + errNotify errNotify // 错误通知 + + markPoint *fissionaction.MarkPoint // 埋点 + + ol *operatelog.OperateLog // 操作日志 + + errData jsonm.JsonM +} + +// Dao 获取初始化的dao +func (l *Logic) Dao() *dao.Query { + return l.dao +} + +// GetCache 获取cache +func (l *Logic) GetCache() *grds.Client { + return l.cache +} + +// Init 初始化一个逻辑类 +func (l *Logic) Init(ctx context.Context, opts ...Option) { + l.Context.Init(ctx, dao.Q, merr.NewBE(ctx)) + + l.cache = app.Redis.Cache + for _, opt := range opts { + opt(l) + } +} + +// AddAfterRun 追加运行完之后要执行的方法 +func (l *Logic) AddAfterRun(fn afterRunFunc) { + l.afterRuns.runs = append(l.afterRuns.runs, fn) +} + +// AddErrRun 追加错误运行之后要执行的方法 +func (l *Logic) AddErrRun(fn afterRunFunc) { + l.afterRuns.errRuns = append(l.afterRuns.errRuns, fn) +} + +// AddMustRun 追加运行之后必须要执行的方法 +func (l *Logic) AddMustRun(fn afterRunFunc) { + l.afterRuns.mustRuns = append(l.afterRuns.mustRuns, fn) +} + +// After 执行逻辑后要处理的东西 +func (l *Logic) After(err error) { + l.release() + + // 必须执行 + for _, fn := range l.afterRuns.mustRuns { + frr := fn() + if frr == nil { + continue + } + + if l.stop { + return + } + + l.afterErr = append(l.afterErr, frr) + } + + // 出错了要执行的 + if err != nil { + for _, fn := range l.afterRuns.errRuns { + frr := fn() + if frr == nil { + continue + } + + if l.stop { + return + } + + l.afterErr = append(l.afterErr, frr) + } + + return + } + + // 没有错误要执行的 + for _, fn := range l.afterRuns.runs { + frr := fn() + if frr == nil { + continue + } + + if l.stop { + return + } + + l.afterErr = append(l.afterErr, frr) + } + + if l.markPoint != nil { + l.markPoint.Push() + } + + if l.ol != nil { + l.ol.InDB() + } + + if l.fnTimer != nil { + l.fnTimer.Push() + } + + return +} + +// CacheSet 缓存设置 +func (l *Logic) CacheSet(key string, value any, exp time.Duration) error { + return l.cacheDone(func() error { + return l.cache.Set(l.Ctx, key, value, exp).Err() + }) +} + +// CacheDel 删除缓存 +func (l *Logic) CacheDel(keys ...string) error { + return l.cacheDone(func() error { + return l.cache.Del(l.Ctx, keys...).Err() + }) +} + +// 缓存操作 +func (l *Logic) cacheDone(fn func() error) error { + if !l.withTran { + return fn() + } + + l.AddAfterRun(func() error { + if err := fn(); err != nil { + return workerr.InternalServerError(err.Error()) + } + return nil + }) + return nil +} + +// 锁操作 +func (l *Logic) lock() (err error) { + //不需要锁,或者锁成功了 + if l.once == nil || l.once.lock.SoftLock() { + return + } + + return workerr.OnceLockError +} + +// 解锁 +func (l *Logic) release() { + + if l.once != nil { + l.once.lock.Release() + } + + return +} + +// Before 执行之前 +func (l *Logic) Before() (err error) { + //先锁任务 + err = l.lock() + if err != nil { + return + } + + return +} + +// GetAfterErr 获取执行错误 +func (l *Logic) GetAfterErr() []error { + return l.afterErr +} + +func (l *Logic) Data() (data jsonm.JsonM) { + return l.errData +} + +// PushErr 推送错误 +func (l *Logic) PushErr(data jsonm.JsonM, err error) { + wrr, ok := errors.As(err) + if !ok { + app.Logger.Error(l.Ctx, fmt.Sprintf("逻辑处理未定义错误: %v, 数据: %s", err, data.ToString())) + return + } + + if len(l.errNotify.eqCode) > 0 { + for _, v := range l.errNotify.eqCode { + if wrr.GetCode() == v { + app.Logger.Error(l.Ctx, fmt.Sprintf("逻辑处理错误: %v, 数据: %s", err, data.ToString())) + return + } + } + } + + if len(l.errNotify.neqCode) > 0 { + if _, ok1 := l.errNotify.neqCode[wrr.GetCode()]; !ok1 { + app.Logger.Error(l.Ctx, fmt.Sprintf("逻辑处理错误: %v, 数据: %s", err, data.ToString())) + return + } + } +} + +// MP 埋点 +func (l *Logic) MP() *fissionaction.MarkPoint { + return l.markPoint +} + +// OL 操作记录 +func (l *Logic) OL() *operatelog.OperateLog { + return l.ol +} diff --git a/internal/utils/logic/option.go b/internal/utils/logic/option.go new file mode 100644 index 0000000..5e9fe84 --- /dev/null +++ b/internal/utils/logic/option.go @@ -0,0 +1,78 @@ +package logic + +import ( + "joybuywork/internal/app" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/service/provider/fissionaction" + "joybuywork/internal/service/provider/operatelog" + "joybuywork/internal/service/provider/traces" +) + +type CtxOption func(ctx *Context) + +func WithDao(dao *dao.Query) CtxOption { + return func(ctx *Context) { + ctx.dao = dao + } +} + +func WithFnTm(fnTm *traces.FnTimers) CtxOption { + return func(ctx *Context) { + ctx.fnTimer = fnTm + } +} + +type Option func(logic *Logic) + +// WithTran 使用事务的dao +func WithTran() Option { + return func(logic *Logic) { + logic.Tran() + } +} + +// WithOnce 启用锁 +func WithOnce(key string) Option { + return func(logic *Logic) { + logic.once = &once{ + key: key, + lock: app.NewRedisLock(logic.Ctx, key), + } + } +} + +// WithBp 启用埋点 +func WithBp() Option { + return func(logic *Logic) { + logic.markPoint = fissionaction.NewMarkPoint(logic.Ctx, fissionaction.SetBatch()) + } +} + +func WithErrNotifyEqCode(code ...int32) Option { + return func(logic *Logic) { + logic.errNotify.eqCode = code + } +} + +func WithErrNotifyNeqCode(code ...int32) Option { + return func(logic *Logic) { + logic.errNotify.neqCode = make(map[int32]struct{}, len(code)) + for _, v := range code { + logic.errNotify.neqCode[v] = struct{}{} + } + } +} + +func WithErrData(data any) Option { + return func(logic *Logic) { + logic.errData, _ = jsonm.Marshal(data) + } +} + +// WithOl 启用操作记录 +func WithOl() Option { + return func(logic *Logic) { + logic.ol = operatelog.NewOperateLog(logic.Ctx, operatelog.SetBatch()) + } +} diff --git a/internal/utils/logic/run.go b/internal/utils/logic/run.go new file mode 100644 index 0000000..f2947b9 --- /dev/null +++ b/internal/utils/logic/run.go @@ -0,0 +1,32 @@ +package logic + +import "joybuywork/internal/plugins/jsonm" + +type Container interface { + Exec() (err error) //执行逻辑 + Before() (err error) //执行逻辑之前做的 + Data() (data jsonm.JsonM) //执行逻辑 + After(err error) //执行逻辑之后做的 + TranCommit(err error) //提交事务 + PushErr(data jsonm.JsonM, err error) //推送错误 +} + +// Run 运行逻辑 +func Run(container Container) (err error) { + defer func() { + container.TranCommit(err) + container.After(err) + }() + defer func() { + if r := recover(); r != nil { + err = r.(error) + container.PushErr(container.Data(), err) + } + }() + err = container.Before() + if err != nil { + return + } + + return container.Exec() +} diff --git a/internal/utils/merr/business_error.go b/internal/utils/merr/business_error.go new file mode 100644 index 0000000..db3397e --- /dev/null +++ b/internal/utils/merr/business_error.go @@ -0,0 +1,77 @@ +package merr + +import ( + "context" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/proto/go_proto/workerr" + "errors" + "fmt" +) + +var ProdErr = errors.New("有一些错误在处理中,请稍后重试~") + +// BusinessError 业务相关的错误,自己定义错误码的错误 +type BusinessError struct { + ctx context.Context +} + +func NewBE(ctx context.Context) *BusinessError { + return &BusinessError{ + ctx: ctx, + } +} + +// MysqlError mysql 组件错误 +func (be *BusinessError) MysqlError(err error) error { + if config.Config.Server.Env == consts.Prod { + return workerr.MysqlError(ProdErr) + } + + return workerr.MysqlError(err) +} + +// RedisError redis 组件错误 +func (be *BusinessError) RedisError(err error, warnLv ...bool) error { + if len(warnLv) > 0 && warnLv[0] { + app.Logger.Warn(be.ctx, fmt.Sprintf("redis err: %s", err.Error())) + } else { + app.Logger.Error(be.ctx, fmt.Sprintf("redis err: %s", err.Error())) + } + + if config.Config.Server.Env == consts.Prod { + return workerr.RedisError(ProdErr) + } + + return workerr.RedisError(err) +} + +// CacheError cache 组件错误 +func (be *BusinessError) CacheError(err error, warnLv ...bool) error { + if len(warnLv) > 0 && warnLv[0] { + app.Logger.Warn(be.ctx, fmt.Sprintf("cache err: %s", err.Error())) + } else { + app.Logger.Error(be.ctx, fmt.Sprintf("cache err: %s", err.Error())) + } + + if config.Config.Server.Env == consts.Prod { + return workerr.CacheError(ProdErr) + } + + return workerr.CacheError(err) +} + +// VerifyError 参数错误 +func (be *BusinessError) VerifyError(tip string) error { + if tip == "" { + return workerr.VerifyError("参数错误") + } + + return workerr.VerifyError(tip) +} + +// CChanceNoneError 抽奖次数不足 +func (be *BusinessError) CChanceNoneError() error { + return workerr.CChanceNoneError +} diff --git a/internal/utils/randext/rand_ext_test.go b/internal/utils/randext/rand_ext_test.go new file mode 100644 index 0000000..395924f --- /dev/null +++ b/internal/utils/randext/rand_ext_test.go @@ -0,0 +1,14 @@ +package randext + +import "testing" + +func TestName(t *testing.T) { + var p = 3.2 + for p > 1 { + p -= 1 + } + + t.Log(p) + + t.Log(3 << 5) +} diff --git a/internal/utils/randext/rand_str.go b/internal/utils/randext/rand_str.go new file mode 100644 index 0000000..be0ffb9 --- /dev/null +++ b/internal/utils/randext/rand_str.go @@ -0,0 +1,37 @@ +package randext + +import ( + "math/rand" + "time" + "unsafe" +) + +const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +var src = rand.NewSource(time.Now().UnixNano()) + +const ( + // 6 bits to represent a letter index + letterIdBits = 6 + // All 1-bits as many as letterIdBits + letterIdMask = 1<= 0; { + if remain == 0 { + cache, remain = src.Int63(), letterIdMax + } + if idx := int(cache & letterIdMask); idx < len(letters) { + b[i] = letters[idx] + i-- + } + cache >>= letterIdBits + remain-- + } + return *(*string)(unsafe.Pointer(&b)) +} diff --git a/internal/utils/timez/str_parse.go b/internal/utils/timez/str_parse.go new file mode 100644 index 0000000..e4f3837 --- /dev/null +++ b/internal/utils/timez/str_parse.go @@ -0,0 +1,39 @@ +package timez + +import "time" + +func YmdHiParse(parse string, tOffset int32) (Parse, error) { + p := NewParse(parse, tOffset) + return p.YmdHiParse() +} + +type Parse struct { + t time.Time + parse string + tOffset int32 +} + +func NewParse(parse string, tOffset int32) Parse { + return Parse{ + parse: parse, + tOffset: tOffset, + } +} + +func (s Parse) YmdHiParse() (Parse, error) { + t, err := time.ParseInLocation("2006-01-02 15:04", s.parse, Location(s.tOffset)) + if err != nil { + return Parse{}, err + } + + return Parse{ + t: t, + }, nil +} + +func (s Parse) Unix() int64 { + if s.t.IsZero() { + return 0 + } + return s.t.Unix() +} diff --git a/internal/utils/timez/timez.go b/internal/utils/timez/timez.go new file mode 100644 index 0000000..d8f984f --- /dev/null +++ b/internal/utils/timez/timez.go @@ -0,0 +1,114 @@ +package timez + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/utils" + "time" + + "github.com/golang-module/carbon/v2" +) + +var utc = map[int32]string{ + -12: "UTC-12", -11: "UTC-11", -10: "UTC-10", + -9: "UTC-9", -8: "UTC-8", -7: "UTC-7", + -6: "UTC-6", -5: "UTC-5", -4: "UTC-4", + -3: "UTC-3", -2: "UTC-2", -1: "UTC-1", + 0: "UTC", + 1: "UTC+1", 2: "UTC+2", 3: "UTC+3", + 4: "UTC+4", 5: "UTC+5", 6: "UTC+6", + 7: "UTC+7", 8: "UTC+8", 9: "UTC+9", + 10: "UTC+10", 11: "UTC+11", 12: "UTC+12", +} + +type Time struct { +} + +const ( + ShortDateOnly = "20060102" + ListDate = "2006/01/02 15:04:05" // 列表使用的时间格式 + PointYmdHi = "2006.01.02 15:04" // 点样式时间格式 +) + +// GMT 北京时间的时间戳变成GMT时间时间戳 +func GMT(tt int64, tOffset int32) int64 { + if tt == 0 { + return 0 + } + return tt + int64((consts.CampaignTzOffset-tOffset)*3600) +} + +// GMTInsideEndless 转换成GMT时间做区间比较,如果为结束为0代表正无穷 +func GMTInsideEndless(tOffset int32, start, end int64, vals ...int64) bool { + var val = time.Now().Unix() + if len(vals) > 0 { + val = vals[0] + } + + start, end = GMT(start, tOffset), GMT(end, tOffset) + + if end == 0 { + return val >= start + } + + return val >= start && val <= end +} + +// STZ GMT时间的时间戳变成北京时间时间戳 +func STZ(tt int64, tOffset int32) int64 { + if tt == 0 { + return 0 + } + return tt + int64((tOffset-consts.CampaignTzOffset)*3600) +} + +// GMTCarbon GMT的carbon组件 +func GMTCarbon(tOffset int32) carbon.Carbon { + return carbon.SetLocation(Location(tOffset)) +} + +// GMTTime GMT的time组件 +func GMTTime(tOffset int32, sec ...int64) time.Time { + if len(sec) > 0 && sec[0] > 0 { + return time.Unix(sec[0], 0).In(Location(tOffset)) + } + + return time.Now().In(Location(tOffset)) +} + +// GMTTimeStart GMT的time组件变成那一天的开始 +func GMTTimeStart(tOffset int32, sec ...int64) (time.Time, error) { + t := GMTTime(tOffset, sec...) + + // 当地是哪一天的 + day := t.Format(time.DateOnly) + + // 变成当天的开始 + return time.ParseInLocation(time.DateOnly, day, Location(tOffset)) +} + +// GMTStartAndEndTs 基于时区的开始和结束 如:2024-10-19 00:00:00 - 2024-10-19 23:59:59 +func GMTStartAndEndTs(tOffset int32, sec ...int64) (day string, start, end int64) { + st, _ := GMTTimeStart(tOffset, sec...) + + return st.Format(time.DateOnly), st.Unix(), st.Unix() + 86399 +} + +// GetWeekEnd 获取某个节点一周的开始和结束 如:2024-10-19 00:00:00 - 2024-10-26 23:59:59 +func GetWeekEnd(tOffset, weekNum int32) (start, end int64) { + t, _ := GMTTimeStart(tOffset) + w := utils.Ternary[int32](t.Weekday() == 0, 7, int32(t.Weekday())) + + var ws int64 = 7 * 86400 + if w < weekNum { + end = t.Unix() + int64((weekNum-w)*86400) + } else { + end = t.Unix() + int64((7-(w-weekNum))*86400) + } + + return end - ws, end - 1 +} + +// Location 活动时区 +func Location(tOffset int32) *time.Location { + return time.FixedZone(utc[tOffset], int(tOffset)*3600) +} diff --git a/internal/utils/timez/timez_test.go b/internal/utils/timez/timez_test.go new file mode 100644 index 0000000..d340c9e --- /dev/null +++ b/internal/utils/timez/timez_test.go @@ -0,0 +1,50 @@ +package timez + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/utils" + "testing" + "time" + + "github.com/golang-module/carbon/v2" +) + +func TestName(t *testing.T) { + f, _ := time.ParseInLocation("2006-01-02 15:04:05", "2024-08-07 00:00:00", time.FixedZone(consts.CampaignTz, 8*3600)) + //f, _ := time.Parse("2006-01-02 15:04:05", "2024-08-07 00:00:00") + t.Log(f, f.Unix()) + var of int32 = 9 + start := carbon.CreateFromTimestamp(f.Unix()) + start1 := GMTCarbon(of).CreateFromTimestamp(f.Unix()) + + s := GMT(carbon.Parse(start1.ToShortDateString()).Timestamp(), of) + e := GMT(carbon.Parse(start1.ToShortDateString()).EndOfDay().Timestamp(), of) + + day, s1, e1 := GMTStartAndEndTs(of, f.Unix()) + + t.Log(start.ToDateTimeString(), start1.ToDateTimeString(), carbon.CreateFromTimestamp(s).ToDateTimeString(), carbon.CreateFromTimestamp(e).ToDateTimeString()) + + t.Log(day, carbon.CreateFromTimestamp(s1).ToDateTimeString(), carbon.CreateFromTimestamp(e1).ToDateTimeString()) +} + +func TestWeekend(t *testing.T) { + start, end := getWeekEnd(4) + st := GMTTime(8, start) + et := GMTTime(8, end) + + t.Log(st.Format(time.DateTime), et.Format(time.DateTime)) +} + +func getWeekEnd(weekNum int32) (start, end int64) { + t, _ := GMTTimeStart(8) + w := utils.Ternary[int32](t.Weekday() == 0, 7, int32(t.Weekday())) + + var ws int64 = 7 * 86400 + if w < weekNum { + end = t.Unix() + int64((weekNum-w)*86400) + } else { + end = t.Unix() + int64((7-(w-weekNum))*86400) + } + + return end - ws, end +} diff --git a/internal/utils/upload/oss_test.go b/internal/utils/upload/oss_test.go new file mode 100644 index 0000000..1bb074e --- /dev/null +++ b/internal/utils/upload/oss_test.go @@ -0,0 +1,194 @@ +package upload + +import ( + "joybuywork/internal/repository/mtype" + "fmt" + "io/fs" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/aliyun/aliyun-oss-go-sdk/oss" +) + +func TestName(t *testing.T) { + // 创建OSSClient实例。 + // yourEndpoint填写Bucket对应的Endpoint,以华东1(杭州)为例,填写为https://oss-cn-hangzhou.aliyuncs.com。其它Region请按实际情况填写。 + // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。 + client, err := oss.New("https://oss-cn-shenzhen.aliyuncs.com", "LTAI5tNvMLF181bTb3qCZxk4", "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + // 填写存储空间名称,例如examplebucket。 + bucket, err := client.Bucket("client-project-resource") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + name := "ftg/answer_tmb/answer_bg.png" + fmt.Println(name) + + // 依次填写Object的完整路径(例如exampledir/exampleobject.txt)和本地文件的完整路径(例如D:\\localpath\\examplefile.txt)。 + err = bucket.PutObjectFromFile(name, "./a/answer_bg.png") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } +} + +const offerwall = "offerwall/" +const taskcenter = "taskcenter/" +const ads = "ads/article/" +const static = "static/" +const staticH5 = "static/deepView" + +func TestName2(t *testing.T) { + // 创建OSSClient实例。 + // yourEndpoint填写Bucket对应的Endpoint,以华东1(杭州)为例,填写为https://oss-cn-hangzhou.aliyuncs.com。其它Region请按实际情况填写。 + // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。 + client, err := oss.New("https://oss-cn-shenzhen.aliyuncs.com", "LTAI5tNvMLF181bTb3qCZxk4", "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + // 填写存储空间名称,例如examplebucket。 + + var del []string + bucket, err := client.Bucket("client-project-resource") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + files, _ := os.ReadDir("./a") + for _, v := range files { + //name := static + "games/" + v.Name() + name := "ftg/gasha/topic/lavender/" + v.Name() + + //fn := strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(v.Name(), "zh_TW", "zh-TW"), "{{", ""), "}}", "") + // + //name := "ftg/gold/" + strings.ReplaceAll(fn, ".green.", ".dark_green.") + // 依次填写Object的完整路径(例如exampledir/exampleobject.txt)和本地文件的完整路径(例如D:\\localpath\\examplefile.txt)。 + err = bucket.PutObjectFromFile(name, "./a/"+v.Name()) + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + t.Log(name) + + del = append(del, name) + } + + //res, err := bucket.DeleteObjects(del) + //if err != nil { + // fmt.Println("Error:", err) + // os.Exit(-1) + //} + //t.Log(res) + +} + +func TestName3(t *testing.T) { + // 创建OSSClient实例。 + // yourEndpoint填写Bucket对应的Endpoint,以华东1(杭州)为例,填写为https://oss-cn-hangzhou.aliyuncs.com。其它Region请按实际情况填写。 + // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。 + client, err := oss.New("https://oss-cn-shenzhen.aliyuncs.com", "LTAI5tNvMLF181bTb3qCZxk4", "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + //填写存储空间名称,例如examplebucket。 + bucket, err := client.Bucket("client-project-resource") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + name := "ftg/gasha/topic" + var del []string + err = filepath.Walk("./a", func(path string, info fs.FileInfo, err error) error { + + if err != nil { + return err + } + + if info.IsDir() { + return nil + } + + filename := name + strings.ReplaceAll(strings.TrimPrefix(path, "a"), "\\", "/") + path = "./" + path + + t.Log(filename, path) + + //依次填写Object的完整路径(例如exampledir/exampleobject.txt)和本地文件的完整路径(例如D:\\localpath\\examplefile.txt)。 + err = bucket.PutObjectFromFile(filename, path) + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + del = append(del, filename) + + return nil + }) + + //res, err := bucket.DeleteObjects(del) + //if err != nil { + // fmt.Println("Error:", err) + // os.Exit(-1) + //} + //t.Log(res) + + t.Log(err) +} + +func TestName4(t *testing.T) { + // 创建OSSClient实例。 + // yourEndpoint填写Bucket对应的Endpoint,以华东1(杭州)为例,填写为https://oss-cn-hangzhou.aliyuncs.com。其它Region请按实际情况填写。 + // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。 + client, err := oss.New("https://oss-cn-shenzhen.aliyuncs.com", "LTAI5tNvMLF181bTb3qCZxk4", "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + // 填写存储空间名称,例如examplebucket。 + + var del []string + bucket, err := client.Bucket("client-project-resource") + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + + files, _ := os.ReadDir("./a") + for _, v := range files { + //name := static + v.Name() + name := "ftg/dice/" + v.Name() + + t.Log(name) + + del = append(del, name) + } + + for mark := range mtype.MarkToLangType { + del = append(del, fmt.Sprintf("taskcenter/lang/dev/%s.json", mark)) + } + + t.Log(del) + + res, err := bucket.DeleteObjects(del) + if err != nil { + fmt.Println("Error:", err) + os.Exit(-1) + } + t.Log(res) + +} diff --git a/internal/utils/upload/policy_token.go b/internal/utils/upload/policy_token.go new file mode 100644 index 0000000..e53b9bf --- /dev/null +++ b/internal/utils/upload/policy_token.go @@ -0,0 +1,67 @@ +package upload + +import ( + "bytes" + "crypto/hmac" + "crypto/sha1" + "joybuywork/internal/config" + "encoding/base64" + "encoding/json" + "fmt" + "github.com/rs/xid" + "hash" + "io" + "time" +) + +type ConfigStruct struct { + Expiration string `json:"expiration"` + Conditions [][]string `json:"conditions"` +} + +type PolicyToken struct { + Expire int64 + Signature string + Policy string + Directory string + Key string +} + +// GetPolicy 获取上传token +func GetPolicy(fileSuffix string) (policyToken PolicyToken) { + var ( + exp = time.Now().Add(30 * time.Second) + expDate = exp.Format("2006-01-02T15:04:05Z") + secret = bytes.NewBufferString(config.Config.Upload.Secret) + dir = fmt.Sprintf("%s%s/", config.Config.Upload.Prefix, time.Now().Format("2006/01/02")) + filename = xid.New().String() + ) + + if fileSuffix != "" { + filename = fmt.Sprintf("%s.%s", filename, fileSuffix) + } + + //create post policy json + var conf ConfigStruct + conf.Expiration = expDate + var condition []string + condition = append(condition, "starts-with") + condition = append(condition, "$key") + condition = append(condition, dir) + conf.Conditions = append(conf.Conditions, condition) + + //calucate signature + result, _ := json.Marshal(conf) + debyte := base64.StdEncoding.EncodeToString(result) + h := hmac.New(func() hash.Hash { return sha1.New() }, secret.Bytes()) + io.WriteString(h, debyte) + signedStr := base64.StdEncoding.EncodeToString(h.Sum(nil)) + + policyToken.Expire = int64(exp.Sub(time.Now()).Seconds()) + policyToken.Signature = signedStr + policyToken.Directory = dir + policyToken.Policy = debyte + policyToken.Key = filename + + return +} diff --git a/internal/utils/upload/policy_token_test.go b/internal/utils/upload/policy_token_test.go new file mode 100644 index 0000000..d44ab91 --- /dev/null +++ b/internal/utils/upload/policy_token_test.go @@ -0,0 +1,26 @@ +package upload + +import ( + "joybuywork/internal/config" + "testing" +) + +func init() { + config.Config.Upload = config.Oss{ + AccessKey: "LTAI5tNvMLF181bTb3qCZxk4", + Secret: "9HXWh6yTXhbBQ7WaMkS1c3o0UNtl7A", + Endpoint: "https://oss-cn-shenzhen.aliyuncs.com", + BucketName: "client-project-resource", + Prefix: "resource/", + } +} + +func TestGetPolicy(t *testing.T) { + t.Run("有suffix", func(t *testing.T) { + t.Log(GetPolicy("jpg")) + }) + + t.Run("没suffix", func(t *testing.T) { + t.Log(GetPolicy("")) + }) +} diff --git a/internal/utils/upload/upload.go b/internal/utils/upload/upload.go new file mode 100644 index 0000000..953ae9f --- /dev/null +++ b/internal/utils/upload/upload.go @@ -0,0 +1,39 @@ +package upload + +import ( + "joybuywork/internal/config" + "fmt" + "github.com/aliyun/aliyun-oss-go-sdk/oss" + "github.com/golang-module/carbon/v2" +) + +func File(fullPath, filename string) (path string, err error) { + client, err := oss.New(config.Config.Upload.Endpoint, config.Config.Upload.AccessKey, config.Config.Upload.Secret) + if err != nil { + return + } + + bucket, err := client.Bucket(config.Config.Upload.BucketName) + if err != nil { + return + } + + path = fmt.Sprintf("%sept/%s/%s", config.Config.Upload.Prefix, carbon.Now().ToShortDateString(), filename) + err = bucket.PutObjectFromFile(path, fullPath) + return +} + +func Delete(filenames ...string) (err error) { + client, err := oss.New(config.Config.Upload.Endpoint, config.Config.Upload.AccessKey, config.Config.Upload.Secret) + if err != nil { + return + } + + bucket, err := client.Bucket(config.Config.Upload.BucketName) + if err != nil { + return + } + + _, err = bucket.DeleteObjects(filenames) + return +} diff --git a/internal/utils/utils.go b/internal/utils/utils.go new file mode 100644 index 0000000..4a51246 --- /dev/null +++ b/internal/utils/utils.go @@ -0,0 +1,376 @@ +// Package utils 不依赖 joybuywork/internal 里面的东西写到这个文件 +package utils + +import ( + "bytes" + "crypto/md5" + "crypto/rand" + "joybuywork/internal/consts" + "encoding/hex" + "encoding/json" + "fmt" + "math" + "math/big" + "net" + "strconv" + "strings" + "time" + + "github.com/golang-module/carbon/v2" + "github.com/shopspring/decimal" +) + +// Ternary 三元运算 +func Ternary[T any](cond bool, t, f T) T { + if cond { + return t + } + return f +} + +// STernary 如果c==t 就取f 否则 取 c +func STernary[T consts.NormalType](c, t, f T) T { + if c == t { + return f + } + return c +} + +// PpDbLo page perPage 获取db limit和offset +func PpDbLo(page, perPage int32) (offset, limit int) { + page = Ternary(page == 0, 1, page) + perPage = Ternary(perPage == 0, 20, perPage) + + limit = int(perPage) + offset = int((page - 1) * perPage) + + return +} + +// DbAllLike 全模糊查询 +func DbAllLike(str string) string { + return "%" + str + "%" +} + +// BetweenDay 获取区间日期 +func BetweenDay(start, end carbon.Carbon, format ...string) (days []string) { + for { + if start.Gte(end) { + return + } + + if len(format) == 0 { + days = append(days, start.ToShortDateString()) + } else if format[0] == time.DateOnly { + days = append(days, start.ToDateString()) + } + + start = start.AddDay() + } +} + +// BetweenHour 获取区间小时 +func BetweenHour(start, end carbon.Carbon) (hours []int) { + for { + if start.Gte(end) { + return + } + hours = append(hours, start.Hour()) + start = start.AddHour() + } +} + +// PercentNoZero 百分额不要0 +func PercentNoZero[T consts.NumberType](num, den T) string { + if den == 0 { + return "0" + } + + return strings.TrimSuffix(strings.TrimRight(fmt.Sprintf("%.2f", Percent(num, den)), "0"), ".") +} + +// Percent 百分额 +func Percent[T consts.NumberType](num, den T) float64 { + if den == 0 { + return 0 + } + + return (float64(num) / float64(den)) * 100 +} + +// StrToInt64 字符串转成int64 +func StrToInt64(v string) int64 { + id, _ := strconv.ParseInt(v, 10, 64) + return id +} + +// StrToInt 字符串转成int +func StrToInt(v string) int { + id, _ := strconv.Atoi(v) + return id +} + +// StrToFloat64 字符串转成 float64 +func StrToFloat64(v string) decimal.Decimal { + val, _ := decimal.NewFromString(v) + return val +} + +// Bs []byte转化成string +func Bs(m []byte) string { + return bytes.NewBuffer(m).String() +} + +// Md5String md5字符串 +func Md5String(v string) string { + return Md5([]byte(v)) +} + +// Md5Any 任意md5 +func Md5Any(v any) string { + b, _ := json.Marshal(v) + return Md5(b) +} + +func Md5(v []byte) string { + hash := md5.New() + hash.Write(v) + b := hash.Sum(nil) + + return hex.EncodeToString(b) +} + +// StrAdd 字符串相加 +func StrAdd(nums ...string) string { + + v := decimal.NewFromFloat(0) + for _, num := range nums { + d, _ := decimal.NewFromString(num) + v = v.Add(d) + } + + return v.String() +} + +// NumberStrCompareGte 第一个数字字符串大于或等于第二个数字字符串 +func NumberStrCompareGte(first, second string) bool { + return NumberStrCompare(first, second, "gte") +} + +// NumberStrCompare 第一个数字字符串比较第二个数字字符串 +func NumberStrCompare(first, second, compare string) bool { + f, s := StrToFloat64(first), StrToFloat64(second) + + switch compare { + case ">=", "gte": + return f.GreaterThanOrEqual(s) + } + + return false +} + +// UserMark 获取iovd的用户hash标识 +func UserMark(ip, os, ver, deviceModel string) string { + return Md5String(fmt.Sprintf("%v_%v_%v_%v", ip, os, ver, deviceModel)) +} + +// Join 用字符关联数据 +func Join[T consts.NumberType](elems []T, sep string) (str string) { + if len(elems) == 0 { + return + } + + str = fmt.Sprint(elems[0]) + + for _, v := range elems[1:] { + str += fmt.Sprintf("%s%v", sep, v) + } + + return +} + +// RandNumber 随机数字 +func RandNumber(max int64) int64 { + n, _ := rand.Int(rand.Reader, big.NewInt(max)) + + return n.Int64() +} + +func GetIp() string { + // 获取所有网络接口的信息 + interfaces, _ := net.Interfaces() + + // 遍历网络接口,查找非回环和非虚拟接口的IP地址 + for _, iface := range interfaces { + if iface.Flags&net.FlagLoopback == 0 && iface.Flags&net.FlagUp != 0 { + addresses, err := iface.Addrs() + if err != nil { + continue + } + for _, addr := range addresses { + ipNet, ok := addr.(*net.IPNet) + if ok && !ipNet.IP.IsLoopback() && ipNet.IP.To4() != nil { + return ipNet.IP.String() + } + } + } + } + return "" +} + +// Groups 数据分组 +func Groups[T any](ids []T, nums int) (groups [][]T) { + + l := len(ids) + if l <= nums { + groups = append(groups, ids) + return + } + + var start int + var end = nums + for { + groups = append(groups, ids[start:end]) + + start += nums + end += nums + if start >= l { + return + } + + if end > l { + end = l + } + } + +} + +// SplitToInt64 字符串变成int64 +func SplitToInt64(str string, sep string) []int64 { + if str == "" { + return nil + } + + arr := strings.Split(str, sep) + + var ids = make([]int64, len(arr)) + for i := 0; i < len(arr); i++ { + ids[i] = StrToInt64(arr[i]) + } + + return ids +} + +// NotExistGetFirst 选不中就用第一个 +func NotExistGetFirst[T consts.NormalType](selected T, options []T) (show T) { + if len(options) == 0 { + return + } + for _, v := range options { + if selected == v { + return v + } + } + + return options[0] +} + +// SupportPlatform 支持的平台 +func SupportPlatform(platform string) string { + if platform == "" { + return "" + } + platform = strings.ToLower(platform) + switch platform { + case consts.PlatformIOS, consts.PlatformWeb, consts.PlatformAndroid, consts.PlatformIPad: + return platform + } + + return consts.PlatformOther +} + +// PercentCutZero 百分数去掉0 +func PercentCutZero(val float64) string { + return strconv.FormatFloat(val, 'f', -1, 64) +} + +// Float64PointCutZero 保留位数去0 +func Float64PointCutZero(val float64, prec int) string { + fl, _ := strconv.ParseFloat(strconv.FormatFloat(val, 'f', prec, 64), 64) + return strconv.FormatFloat(fl, 'f', -1, 64) +} + +// NormalizeDecimalStrings 将数字字符串切片归一化为相同小数位数的整数 +// 1. 找出所有字符串中的最大小数位数 +// 2. 将所有数字乘以 10^最大小数位数,转换为整数 +// 返回: (整数切片, 扩展倍数) +type decimalInfo struct { + integerPart string + decimalPart string + places int +} + +func NormalizeDecimalStrings(strs []string) ([]int, int) { + if len(strs) == 0 { + return []int{}, 0 + } + + // 第一步:找出最大小数位数 + maxDecimalPlaces := 0 + decimalInfos := make([]decimalInfo, len(strs)) + + for i, s := range strs { + s = strings.TrimSpace(s) + if s == "" { + s = "0" + } + + negative := false + if s[0] == '-' { + negative = true + s = s[1:] + } else if s[0] == '+' { + s = s[1:] + } + + // 查找小数点 + decimalIndex := strings.Index(s, ".") + + var integerPart, decimalPart string + if decimalIndex == -1 { + integerPart = s + decimalPart = "" + decimalInfos[i].places = 0 + } else { + integerPart = s[:decimalIndex] + decimalPart = s[decimalIndex+1:] + decimalInfos[i].places = len(decimalPart) + } + + decimalInfos[i].integerPart = integerPart + decimalInfos[i].decimalPart = decimalPart + + if decimalInfos[i].places > maxDecimalPlaces { + maxDecimalPlaces = decimalInfos[i].places + } + + if negative { + decimalInfos[i].integerPart = "-" + decimalInfos[i].integerPart + } + } + + multiplier := int(math.Pow10(maxDecimalPlaces)) + + result := make([]int, len(strs)) + for i, info := range decimalInfos { + paddedDecimalPart := info.decimalPart + if len(paddedDecimalPart) < maxDecimalPlaces { + paddedDecimalPart = paddedDecimalPart + strings.Repeat("0", maxDecimalPlaces-len(paddedDecimalPart)) + } + + num, _ := strconv.Atoi(info.integerPart + paddedDecimalPart) + result[i] = num + } + + return result, multiplier +} diff --git a/internal/utils/utils_test.go b/internal/utils/utils_test.go new file mode 100644 index 0000000..20de179 --- /dev/null +++ b/internal/utils/utils_test.go @@ -0,0 +1,78 @@ +package utils + +import ( + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "fmt" + "strconv" + "strings" + "testing" + "time" + + "github.com/golang-module/carbon/v2" +) + +func TestName(t *testing.T) { + var val = "ftg/slot/default_thank_ja.png" + + idx := strings.LastIndex(val, "/") + + t.Log(val[:idx+1], val[idx+1:]) + +} + +type name struct { + A int +} + +type name2 struct { + A int +} + +var a = map[string]string{ + "1": "1", + "2": "2", + "3": "3", +} + +func TestD(t *testing.T) { + now := carbon.Now().StartOfDay() + lastSign := carbon.ParseByFormat("", consts.Ymd) + + t.Log(lastSign.Lt(now)) +} + +type AS struct { + A int `json:"a,omitempty"` +} + +func TestGroups(t *testing.T) { + var b = AS{ + A: 0, + } + c, _ := jsonm.Marshal(b) + t.Log(string(c)) +} + +func TestMd5(t *testing.T) { + t.Log(Md5String(fmt.Sprintf("%v_%v_%v_%v", "223.104.67.190", "Android", "13", "V2203A"))) + t.Log(Md5String(fmt.Sprintf("%v_%v_%v_%v", "223.39.212.67", "iOS", "17.4.1", "iPhone"))) +} + +func TestCondTotalFinishNum(t *testing.T) { + res := CondTotalFinishNum("13", "12", func(doneNum int32) bool { + return doneNum == 2 + }) + + t.Log(res) +} + +func Test3434(t *testing.T) { + t1 := fmt.Sprintf("%d", time.Now().Unix()) + + ts := t1[:len(t1)-1] + "0" + + ti, _ := strconv.ParseInt(ts, 10, 64) + + t.Log(t1, ti) +} diff --git a/internal/utils/verify/integer.go b/internal/utils/verify/integer.go new file mode 100644 index 0000000..da79ad1 --- /dev/null +++ b/internal/utils/verify/integer.go @@ -0,0 +1,77 @@ +package verify + +import ( + "joybuywork/internal/consts" +) + +// InArray 在数值里面 +func InArray[T consts.NormalType](val T, arr ...T) bool { + for _, v := range arr { + if v == val { + return true + } + } + + return false +} + +// AllInArray 都在数值里面 +func AllInArray[T consts.NormalType](vals, arr []T) bool { + if len(arr) != len(vals) { + return false + } + + var arrMap = make(map[T]struct{}, len(arr)) + for _, v := range arr { + arrMap[v] = struct{}{} + } + + var num int + for _, v := range vals { + if _, ok := arrMap[v]; ok { + num++ + } + } + + return num == len(vals) +} + +// OneInArray 有一个在数值里面 +func OneInArray[T consts.NormalType](vals, arr []T) bool { + + var arrMap = make(map[T]struct{}, len(arr)) + for _, v := range arr { + arrMap[v] = struct{}{} + } + + for _, v := range vals { + if _, ok := arrMap[v]; ok { + return true + } + } + + return false +} + +// OutSide 不在区间里面 +func OutSide[T consts.IntType](val, min, max T) bool { + return !Inside(val, min, max) +} + +// Inside 在区间里面 +func Inside[T consts.IntType](val, min, max T) bool { + if val >= min && val <= max { + return true + } + + return false +} + +// LInside 左闭在区间里面 +func LInside[T consts.IntType](val, min, max T) bool { + if val >= min && val < max { + return true + } + + return false +} diff --git a/internal/utils/verify/slices.go b/internal/utils/verify/slices.go new file mode 100644 index 0000000..40724a3 --- /dev/null +++ b/internal/utils/verify/slices.go @@ -0,0 +1,19 @@ +package verify + +// SliceEq slice相等 +func SliceEq[T comparable](a []T, b []T) bool { + if len(a) != len(b) { + return false + } + + var m = make(map[T]struct{}, len(a)) + for _, v := range a { + m[v] = struct{}{} + } + + for _, v := range b { + delete(m, v) + } + + return len(m) == 0 +} diff --git a/internal/utils/verify/string.go b/internal/utils/verify/string.go new file mode 100644 index 0000000..ef3d8be --- /dev/null +++ b/internal/utils/verify/string.go @@ -0,0 +1,10 @@ +package verify + +import ( + "strings" +) + +// EmptyString 空字符串 +func EmptyString(str string) bool { + return strings.Trim(str, " ") == "" +} diff --git a/microg.toml b/microg.toml new file mode 100755 index 0000000..e976cae --- /dev/null +++ b/microg.toml @@ -0,0 +1,319 @@ +[Service] +ModuleName = 'joybuywork' +ServiceName = 'joybuywork' + +[Dir] +Etc = 'etc' +Handler = 'internal/handler' +Service = 'internal/service' +App = 'internal/app' +Config = 'internal/config' +Repository = 'internal/repository' +Proto = 'proto' + +[Plugins] +[Plugins.Etcd] +EnableG = true +Address = ['127.0.0.1:2379'] + +[Plugins.Logger] +EnableG = true +StdOut = true +FileOut = true +Path = './logs/server.log' +MaxSize = 10 +MaxBackups = 5 +MaxAge = 30 +Compress = false + +[Plugins.Database] +EnableG = true +URL = 'root:123456@tcp(127.0.0.1:3306)/dplk_db?charset=utf8mb4&parseTime=True&loc=Local' +MaxIdleConn = 100 +MaxOpenConn = 100 +ConnMaxLifetime = 3600000000000 +SlowThreshold = 300000000 +Tables = [ + 'user', + 'user_behavior', + + 'company', + 'company_made', + + 'project', + 'project_secret', + 'project_ad', + 'project_user', + 'project_user_coin', + 'project_user_coin_use', + 'project_user_coin_expired', + 'project_user_coin_log', + 'project_user_coin_deduct', + 'project_user_coin_record', + 'project_user_info_log', + + + 'register', + 'register_audit', + 'user_project_relate', + + 'fission_temp', + 'fission_temp_image', + 'fission_temp_lang', + 'fission_temp_group', + 'fission_temp_group_lang', + + 'fission_lang_module', + + 'fission_campaign', + 'fission_campaign_channel', + 'fission_campaign_config', + 'fission_campaign_style', + 'fission_campaign_cond', + 'fission_campaign_reward', + 'fission_campaign_reward_rule', + 'fission_campaign_reward_add', + 'fission_campaign_reward_add_log', + 'fission_campaign_lang', + 'fission_campaign_task', + 'fission_campaign_ticket', + 'fission_campaign_long_img', + 'fission_campaign_long_img_zone', + 'fission_campaign_points_use', + 'fission_campaign_chat', + + 'fission_campaign_quiz', + 'fission_campaign_quiz_option', + 'fission_quiz', + 'fission_quiz_log', + + 'fission_campaign_qa', + 'fission_campaign_qa_option', + 'fission_campaign_qa_question', + 'fission_qa', + 'fission_qa_log', + + 'fission_campaign_wheel', + 'fission_prize_wheel', + 'fission_prize_wheel_log', + + 'fission_campaign_slot', + 'fission_slot', + 'fission_slot_log', + + 'fission_campaign_flip', + 'fission_flip', + 'fission_flip_log', + + 'fission_campaign_gold', + 'fission_gold', + 'fission_gold_log', + + 'fission_campaign_grid', + 'fission_grid', + 'fission_grid_log', + + 'fission_campaign_ballot', + 'fission_ballot', + 'fission_ballot_log', + + 'fission_campaign_blind', + 'fission_blind', + 'fission_blind_log', + + 'fission_campaign_referral', + 'fission_referral', + + 'fission_campaign_win', + 'fission_win', + + 'fission_campaign_cash', + 'fission_cash', + 'fission_cash_record', + + 'fission_campaign_sign', + 'fission_sign', + 'fission_sign_day', + 'fission_sign_log', + + 'fission_campaign_dice', + 'fission_dice', + 'fission_dice_run', + 'fission_dice_record', + 'fission_dice_collect', + 'fission_dice_map', + 'fission_dice_map_group', + 'fission_dice_props', + + 'fission_campaign_grow', + 'fission_campaign_grow_step', + 'fission_grow', + 'fission_grow_life', + 'fission_grow_record', + + 'fission_campaign_chop', + 'fission_chop', + 'fission_chop_help', + 'fission_chop_reward', + + 'fission_campaign_vs', + 'fission_campaign_vs_schedule', + 'fission_campaign_vs_team', + 'fission_vs', + 'fission_vs_vote', + 'fission_vs_vote_settlement', + 'fission_vs_log', + + 'fission_campaign_uno', + 'fission_campaign_uno_group', + 'fission_campaign_uno_card', + 'fission_uno', + 'fission_uno_collect', + 'fission_uno_log', + + 'fission_campaign_gashapon', + 'fission_gashapon', + 'fission_gashapon_log', + + 'fission_user', + 'fission_user_attr', + 'fission_user_jattr', + 'fission_user_attr_total', + 'fission_user_stat', + 'fission_user_cond', + 'fission_user_cond_record', + 'fission_user_dylink', + 'fission_user_ctlink', + 'fission_user_level', + 'fission_user_level_related', + 'fission_user_task_record', + 'fission_user_task_reward', + 'fission_user_task_valid', + + 'fission_notify', + 'fission_notify_resp', + 'fission_notify_task', + + 'fission_archive_task', + + 'fission_behavior', + + 'fission_total', + 'fission_total_cycle', + + + 'fission_web_user', + + 'fission_reward_record', + 'fission_reward_record_form', + + 'fission_client_reward', + + 'fission_target_record', + + 'fission_config', + + 'server_whitelist', + + 'library_qa', + 'library_qa_group', + 'library_qa_option', + + 'export_task', + + 'lang', + 'lang_text_mark', + + 'reward', + 'reward_lang', + 'reward_related', + 'reward_push', + 'reward_push_log', + 'reward_push_task', + + 'notify_url', + + 'operate_log', + + 'form', + + 'module_statistics_eventflow', + + 'slow_log', + 'err_log', + + 'material', + + 'fission_campaign_keep', + 'fission_campaign_keep_step', + 'fission_keep', + 'fission_keep_log', + + 'fission_user_pre_cond', + + 'fission_campaign_push', + + 'fission_campaign_event', + + 'fission_user_event', + + 'fission_user_active', + + 'fission_campaign_child', + + 'fission_child_user', + 'fission_child_user_record', + + 'fission_campaign_coin', + 'fission_coin', + 'fission_coin_scene', + 'fission_coin_log', + + 'fission_points_log', + 'fission_point_deduct', + + 'fission_custom_btn', + + 'fission_unlock_reward', + + 'lv_api_log', + + 'fission_chat', + 'fission_chat_msg', + + 't_coin', + 't_coin_lang', + + 'cron_log', + + 'redeem_mall', + 'redeem_mall_item', + 'redeem_mall_item_task', + 'redeem_mall_relate', + 'redeem_mall_record', + + 'game_link', + 'game_user', + 'game_action', + 'game_total', + 'game_total_date', +] + +[Plugins.Redis] +EnableG = true +Addr = '127.0.0.1:6379' +Password = 'secret_redis' +DB = 0 +Sentinel = '' +SentinelMasterName = '' + +[Plugins.Kafka] +EnableG = true +Brokers = ['127.0.0.1:9093'] + +[Plugins.Alert] +EnableG = true + +[Plugins.Alert.FeiShu] +Url = '' +Secret = '' diff --git a/proto/go_proto/go.mod b/proto/go_proto/go.mod new file mode 100644 index 0000000..600300a --- /dev/null +++ b/proto/go_proto/go.mod @@ -0,0 +1,28 @@ +module gits.branchcn.com/backend/joybuywork/proto/go_proto + +go 1.20 + +require ( + go-micro.dev/v4 v4.10.2 + google.golang.org/protobuf v1.28.1 +) + +require ( + github.com/evanphx/json-patch/v5 v5.5.0 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/go-acme/lego/v4 v4.4.0 // indirect + github.com/gobwas/httphead v0.1.0 // indirect + github.com/gobwas/pool v0.2.1 // indirect + github.com/gobwas/ws v1.0.4 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/gorilla/handlers v1.5.1 // indirect + github.com/miekg/dns v1.1.43 // indirect + github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/pkg/errors v0.9.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect +) diff --git a/proto/go_proto/w_campaign/w_campaign.pb.go b/proto/go_proto/w_campaign/w_campaign.pb.go new file mode 100644 index 0000000..87a3289 --- /dev/null +++ b/proto/go_proto/w_campaign/w_campaign.pb.go @@ -0,0 +1,47812 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_campaign.proto + +package w_campaignpb + +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 ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ProjectId int64 `protobuf:"varint,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + ProjectHashId string `protobuf:"bytes,4,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //活动标题筛选 + Link string `protobuf:"bytes,6,opt,name=link,proto3" json:"link,omitempty"` //活动链接筛选 + Status []int32 `protobuf:"varint,7,rep,packed,name=status,proto3" json:"status,omitempty"` //活动状态(1-待发布,2-已发布,3-已下线,4-预发布) + FissionId []int64 `protobuf:"varint,8,rep,packed,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //活动类型标识 + Start int64 `protobuf:"varint,9,opt,name=start,proto3" json:"start,omitempty"` //活动时间开始时间戳 + End int64 `protobuf:"varint,10,opt,name=end,proto3" json:"end,omitempty"` //活动时间结束时间戳 + OrderById bool `protobuf:"varint,11,opt,name=order_by_id,json=orderById,proto3" json:"order_by_id,omitempty"` //是否id升序 + Targets []int32 `protobuf:"varint,12,rep,packed,name=targets,proto3" json:"targets,omitempty"` //活动目标集合 + UpdatedStart int64 `protobuf:"varint,13,opt,name=updated_start,json=updatedStart,proto3" json:"updated_start,omitempty"` //最后更新时间开始时间戳 + UpdatedEnd int64 `protobuf:"varint,14,opt,name=updated_end,json=updatedEnd,proto3" json:"updated_end,omitempty"` //最后更新时间结束时间戳 +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ListReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListReq) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +func (x *ListReq) GetStatus() []int32 { + if x != nil { + return x.Status + } + return nil +} + +func (x *ListReq) GetFissionId() []int64 { + if x != nil { + return x.FissionId + } + return nil +} + +func (x *ListReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ListReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *ListReq) GetOrderById() bool { + if x != nil { + return x.OrderById + } + return false +} + +func (x *ListReq) GetTargets() []int32 { + if x != nil { + return x.Targets + } + return nil +} + +func (x *ListReq) GetUpdatedStart() int64 { + if x != nil { + return x.UpdatedStart + } + return 0 +} + +func (x *ListReq) GetUpdatedEnd() int64 { + if x != nil { + return x.UpdatedEnd + } + return 0 +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ShareReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ShareReq) Reset() { + *x = ShareReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShareReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShareReq) ProtoMessage() {} + +func (x *ShareReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ShareReq.ProtoReflect.Descriptor instead. +func (*ShareReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{2} +} + +type ShareRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Loc []*ShareRes_One `protobuf:"bytes,1,rep,name=loc,proto3" json:"loc,omitempty"` //国内 + OverSea []*ShareRes_One `protobuf:"bytes,2,rep,name=over_sea,json=overSea,proto3" json:"over_sea,omitempty"` //国外 +} + +func (x *ShareRes) Reset() { + *x = ShareRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShareRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShareRes) ProtoMessage() {} + +func (x *ShareRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ShareRes.ProtoReflect.Descriptor instead. +func (*ShareRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{3} +} + +func (x *ShareRes) GetLoc() []*ShareRes_One { + if x != nil { + return x.Loc + } + return nil +} + +func (x *ShareRes) GetOverSea() []*ShareRes_One { + if x != nil { + return x.OverSea + } + return nil +} + +type StatusReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //发布状态(2-已发布,3-已下线,4-预发布) + PreRunTime int64 `protobuf:"varint,4,opt,name=pre_run_time,json=preRunTime,proto3" json:"pre_run_time,omitempty"` //预发布转正式发布时间戳 +} + +func (x *StatusReq) Reset() { + *x = StatusReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusReq) ProtoMessage() {} + +func (x *StatusReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 StatusReq.ProtoReflect.Descriptor instead. +func (*StatusReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{4} +} + +func (x *StatusReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *StatusReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *StatusReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *StatusReq) GetPreRunTime() int64 { + if x != nil { + return x.PreRunTime + } + return 0 +} + +type StatusRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StatusRes) Reset() { + *x = StatusRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRes) ProtoMessage() {} + +func (x *StatusRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 StatusRes.ProtoReflect.Descriptor instead. +func (*StatusRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{5} +} + +type DestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //发布状态(2-已发布,3-已下线) +} + +func (x *DestroyReq) Reset() { + *x = DestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyReq) ProtoMessage() {} + +func (x *DestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 DestroyReq.ProtoReflect.Descriptor instead. +func (*DestroyReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{6} +} + +func (x *DestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DestroyReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *DestroyReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type DestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DestroyRes) Reset() { + *x = DestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyRes) ProtoMessage() {} + +func (x *DestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 DestroyRes.ProtoReflect.Descriptor instead. +func (*DestroyRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{7} +} + +type StoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + TemplateId string `protobuf:"bytes,2,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` //模版id + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + StartTime int64 `protobuf:"varint,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + CoverUrl string `protobuf:"bytes,7,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //活动封面图 + Config *StoreReq_Config `protobuf:"bytes,8,opt,name=config,proto3" json:"config,omitempty"` //活动基础配置 + CampaignData []*StoreReq_KV `protobuf:"bytes,9,rep,name=campaign_data,json=campaignData,proto3" json:"campaign_data,omitempty"` //前端组件位置偏移数据 + PrizeWheel *StoreReq_LotteryConfig `protobuf:"bytes,10,opt,name=prize_wheel,json=prizeWheel,proto3" json:"prize_wheel,omitempty"` //大转盘配置(大转盘玩法必传) + Slot *StoreReq_LotteryConfig `protobuf:"bytes,11,opt,name=slot,proto3" json:"slot,omitempty"` //老虎机配置(老虎机玩法必传) + Blind *StoreReq_LotteryConfig `protobuf:"bytes,12,opt,name=blind,proto3" json:"blind,omitempty"` //盲盒配置(盲盒玩法必传) + Grid *StoreReq_LotteryConfig `protobuf:"bytes,13,opt,name=grid,proto3" json:"grid,omitempty"` //九宫格配置(九宫格玩法必传) + Referral *StoreReq_InviteConfig `protobuf:"bytes,14,opt,name=referral,proto3" json:"referral,omitempty"` //老带新配置(老带新玩法必传) + QuestionAnswer *StoreReq_QuestionAnswer `protobuf:"bytes,15,opt,name=question_answer,json=questionAnswer,proto3" json:"question_answer,omitempty"` //趣味问答配置(趣味问答玩法必传) + Quiz *StoreReq_Quiz `protobuf:"bytes,16,opt,name=quiz,proto3" json:"quiz,omitempty"` //有奖竞猜配置(有奖竞猜玩法必传) + Win *StoreReq_InviteConfig `protobuf:"bytes,17,opt,name=win,proto3" json:"win,omitempty"` //一起赢配置(一起赢玩法必传) + TOffset int32 `protobuf:"varint,18,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + Target *StoreReq_Target `protobuf:"bytes,19,opt,name=target,proto3" json:"target,omitempty"` //活动目标 + Sign *StoreReq_Sign `protobuf:"bytes,20,opt,name=sign,proto3" json:"sign,omitempty"` //签到配置(签到玩法必传) + Dice *StoreReq_Dice `protobuf:"bytes,21,opt,name=dice,proto3" json:"dice,omitempty"` //大富翁配置(大富翁玩法必传) + Grow *StoreReq_Grow `protobuf:"bytes,22,opt,name=grow,proto3" json:"grow,omitempty"` //农场配置(农场玩法必传) + Ballot *StoreReq_Ballot `protobuf:"bytes,23,opt,name=ballot,proto3" json:"ballot,omitempty"` //抽签配置(抽签玩法必传) + Chop *StoreReq_Chop `protobuf:"bytes,24,opt,name=chop,proto3" json:"chop,omitempty"` //砍一刀配置(砍一刀玩法必传) + DelayLinkData []*StoreReq_KV `protobuf:"bytes,25,rep,name=delay_link_data,json=delayLinkData,proto3" json:"delay_link_data,omitempty"` //延迟深度链接自定义键值数据 + Rewards *StoreReq_Rewards `protobuf:"bytes,26,opt,name=rewards,proto3" json:"rewards,omitempty"` //站内奖品 + RewardsWeb []*StoreReq_Reward `protobuf:"bytes,27,rep,name=rewards_web,json=rewardsWeb,proto3" json:"rewards_web,omitempty"` //站外奖品 + RewardsExtra []*StoreReq_Reward `protobuf:"bytes,28,rep,name=rewards_extra,json=rewardsExtra,proto3" json:"rewards_extra,omitempty"` //额外奖品 + RewardsNewcomer []*StoreReq_Reward `protobuf:"bytes,29,rep,name=rewards_newcomer,json=rewardsNewcomer,proto3" json:"rewards_newcomer,omitempty"` //新人奖 + TargetOption *StoreReq_TargetOption `protobuf:"bytes,30,opt,name=target_option,json=targetOption,proto3" json:"target_option,omitempty"` //目标配置选项 + Cash *StoreReq_Cash `protobuf:"bytes,31,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖配置(现金抽奖玩法必传) + LongImgs []*StoreReq_LongImg `protobuf:"bytes,32,rep,name=long_imgs,json=longImgs,proto3" json:"long_imgs,omitempty"` //长图配置 + Flip *StoreReq_Flip `protobuf:"bytes,33,opt,name=flip,proto3" json:"flip,omitempty"` //翻牌配置(翻牌玩法必传) + CopyCampaignId string `protobuf:"bytes,34,opt,name=copy_campaign_id,json=copyCampaignId,proto3" json:"copy_campaign_id,omitempty"` //复制的活动id + KeepDog *StoreReq_Keep `protobuf:"bytes,35,opt,name=keep_dog,json=keepDog,proto3" json:"keep_dog,omitempty"` //养狗(养狗配置必传) + Ip string `protobuf:"bytes,36,opt,name=ip,proto3" json:"ip,omitempty"` //操作ip + Push *StoreReq_Push `protobuf:"bytes,37,opt,name=push,proto3" json:"push,omitempty"` //推送配置 + Child []*StoreReq_Child `protobuf:"bytes,38,rep,name=child,proto3" json:"child,omitempty"` //关联的子活动 + WheelStyle *StoreReq_WheelStyle `protobuf:"bytes,39,opt,name=wheel_style,json=wheelStyle,proto3" json:"wheel_style,omitempty"` //转盘自定义样式 + Gold *StoreReq_Gold `protobuf:"bytes,40,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务配置(金币任务玩法必传) + Coin *StoreReq_Coin `protobuf:"bytes,41,opt,name=coin,proto3" json:"coin,omitempty"` //金币池配置(金币池玩法必传) + GridStyle *StoreReq_GridStyle `protobuf:"bytes,42,opt,name=grid_style,json=gridStyle,proto3" json:"grid_style,omitempty"` //九宫格自定义样式 + FlipStyle *StoreReq_FlipStyle `protobuf:"bytes,43,opt,name=flip_style,json=flipStyle,proto3" json:"flip_style,omitempty"` //翻牌自定义样式 + PointsUse *StoreReq_PointsUse `protobuf:"bytes,44,opt,name=points_use,json=pointsUse,proto3" json:"points_use,omitempty"` //积分消耗 + Chat *StoreReq_Chat `protobuf:"bytes,45,opt,name=chat,proto3" json:"chat,omitempty"` //ai陪伴 + Vs *StoreReq_Vs `protobuf:"bytes,46,opt,name=vs,proto3" json:"vs,omitempty"` //赛事竞猜配置(赛事竞猜玩法必传) + Uno *StoreReq_Uno `protobuf:"bytes,47,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌配置(uno卡牌玩法必传) + Event *StoreReq_Event `protobuf:"bytes,48,opt,name=event,proto3" json:"event,omitempty"` //事件配置(活动事件) + Gashapon *StoreReq_LotteryConfig `protobuf:"bytes,49,opt,name=gashapon,proto3" json:"gashapon,omitempty"` //扭蛋机配置(扭蛋机玩法必传) + GashaponStyle *StoreReq_GashaponStyle `protobuf:"bytes,50,opt,name=gashapon_style,json=gashaponStyle,proto3" json:"gashapon_style,omitempty"` //扭蛋机自定义样式 +} + +func (x *StoreReq) Reset() { + *x = StoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq) ProtoMessage() {} + +func (x *StoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 StoreReq.ProtoReflect.Descriptor instead. +func (*StoreReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8} +} + +func (x *StoreReq) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *StoreReq) GetTemplateId() string { + if x != nil { + return x.TemplateId + } + return "" +} + +func (x *StoreReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *StoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *StoreReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *StoreReq) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *StoreReq) GetConfig() *StoreReq_Config { + if x != nil { + return x.Config + } + return nil +} + +func (x *StoreReq) GetCampaignData() []*StoreReq_KV { + if x != nil { + return x.CampaignData + } + return nil +} + +func (x *StoreReq) GetPrizeWheel() *StoreReq_LotteryConfig { + if x != nil { + return x.PrizeWheel + } + return nil +} + +func (x *StoreReq) GetSlot() *StoreReq_LotteryConfig { + if x != nil { + return x.Slot + } + return nil +} + +func (x *StoreReq) GetBlind() *StoreReq_LotteryConfig { + if x != nil { + return x.Blind + } + return nil +} + +func (x *StoreReq) GetGrid() *StoreReq_LotteryConfig { + if x != nil { + return x.Grid + } + return nil +} + +func (x *StoreReq) GetReferral() *StoreReq_InviteConfig { + if x != nil { + return x.Referral + } + return nil +} + +func (x *StoreReq) GetQuestionAnswer() *StoreReq_QuestionAnswer { + if x != nil { + return x.QuestionAnswer + } + return nil +} + +func (x *StoreReq) GetQuiz() *StoreReq_Quiz { + if x != nil { + return x.Quiz + } + return nil +} + +func (x *StoreReq) GetWin() *StoreReq_InviteConfig { + if x != nil { + return x.Win + } + return nil +} + +func (x *StoreReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *StoreReq) GetTarget() *StoreReq_Target { + if x != nil { + return x.Target + } + return nil +} + +func (x *StoreReq) GetSign() *StoreReq_Sign { + if x != nil { + return x.Sign + } + return nil +} + +func (x *StoreReq) GetDice() *StoreReq_Dice { + if x != nil { + return x.Dice + } + return nil +} + +func (x *StoreReq) GetGrow() *StoreReq_Grow { + if x != nil { + return x.Grow + } + return nil +} + +func (x *StoreReq) GetBallot() *StoreReq_Ballot { + if x != nil { + return x.Ballot + } + return nil +} + +func (x *StoreReq) GetChop() *StoreReq_Chop { + if x != nil { + return x.Chop + } + return nil +} + +func (x *StoreReq) GetDelayLinkData() []*StoreReq_KV { + if x != nil { + return x.DelayLinkData + } + return nil +} + +func (x *StoreReq) GetRewards() *StoreReq_Rewards { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *StoreReq) GetRewardsWeb() []*StoreReq_Reward { + if x != nil { + return x.RewardsWeb + } + return nil +} + +func (x *StoreReq) GetRewardsExtra() []*StoreReq_Reward { + if x != nil { + return x.RewardsExtra + } + return nil +} + +func (x *StoreReq) GetRewardsNewcomer() []*StoreReq_Reward { + if x != nil { + return x.RewardsNewcomer + } + return nil +} + +func (x *StoreReq) GetTargetOption() *StoreReq_TargetOption { + if x != nil { + return x.TargetOption + } + return nil +} + +func (x *StoreReq) GetCash() *StoreReq_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *StoreReq) GetLongImgs() []*StoreReq_LongImg { + if x != nil { + return x.LongImgs + } + return nil +} + +func (x *StoreReq) GetFlip() *StoreReq_Flip { + if x != nil { + return x.Flip + } + return nil +} + +func (x *StoreReq) GetCopyCampaignId() string { + if x != nil { + return x.CopyCampaignId + } + return "" +} + +func (x *StoreReq) GetKeepDog() *StoreReq_Keep { + if x != nil { + return x.KeepDog + } + return nil +} + +func (x *StoreReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *StoreReq) GetPush() *StoreReq_Push { + if x != nil { + return x.Push + } + return nil +} + +func (x *StoreReq) GetChild() []*StoreReq_Child { + if x != nil { + return x.Child + } + return nil +} + +func (x *StoreReq) GetWheelStyle() *StoreReq_WheelStyle { + if x != nil { + return x.WheelStyle + } + return nil +} + +func (x *StoreReq) GetGold() *StoreReq_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *StoreReq) GetCoin() *StoreReq_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *StoreReq) GetGridStyle() *StoreReq_GridStyle { + if x != nil { + return x.GridStyle + } + return nil +} + +func (x *StoreReq) GetFlipStyle() *StoreReq_FlipStyle { + if x != nil { + return x.FlipStyle + } + return nil +} + +func (x *StoreReq) GetPointsUse() *StoreReq_PointsUse { + if x != nil { + return x.PointsUse + } + return nil +} + +func (x *StoreReq) GetChat() *StoreReq_Chat { + if x != nil { + return x.Chat + } + return nil +} + +func (x *StoreReq) GetVs() *StoreReq_Vs { + if x != nil { + return x.Vs + } + return nil +} + +func (x *StoreReq) GetUno() *StoreReq_Uno { + if x != nil { + return x.Uno + } + return nil +} + +func (x *StoreReq) GetEvent() *StoreReq_Event { + if x != nil { + return x.Event + } + return nil +} + +func (x *StoreReq) GetGashapon() *StoreReq_LotteryConfig { + if x != nil { + return x.Gashapon + } + return nil +} + +func (x *StoreReq) GetGashaponStyle() *StoreReq_GashaponStyle { + if x != nil { + return x.GashaponStyle + } + return nil +} + +type StoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id +} + +func (x *StoreRes) Reset() { + *x = StoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreRes) ProtoMessage() {} + +func (x *StoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 StoreRes.ProtoReflect.Descriptor instead. +func (*StoreRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{9} +} + +func (x *StoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *StoreRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type UpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + StartTime int64 `protobuf:"varint,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + CoverUrl string `protobuf:"bytes,6,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //活动封面图 + Config *UpdateReq_Config `protobuf:"bytes,7,opt,name=config,proto3" json:"config,omitempty"` //活动基础配置 + CampaignData []*UpdateReq_KV `protobuf:"bytes,8,rep,name=campaign_data,json=campaignData,proto3" json:"campaign_data,omitempty"` //前端组件位置偏移数据 + PrizeWheel *UpdateReq_LotteryConfig `protobuf:"bytes,9,opt,name=prize_wheel,json=prizeWheel,proto3" json:"prize_wheel,omitempty"` //大转盘配置(大转盘玩法必传) + Slot *UpdateReq_LotteryConfig `protobuf:"bytes,10,opt,name=slot,proto3" json:"slot,omitempty"` //老虎机配置(老虎机玩法必传) + Blind *UpdateReq_LotteryConfig `protobuf:"bytes,11,opt,name=blind,proto3" json:"blind,omitempty"` //盲盒配置(盲盒玩法必传) + Grid *UpdateReq_LotteryConfig `protobuf:"bytes,12,opt,name=grid,proto3" json:"grid,omitempty"` //九宫格配置(九宫格玩法必传) + Referral *UpdateReq_InviteConfig `protobuf:"bytes,13,opt,name=referral,proto3" json:"referral,omitempty"` //老带新配置(老带新玩法必传) + QuestionAnswer *UpdateReq_QuestionAnswer `protobuf:"bytes,14,opt,name=question_answer,json=questionAnswer,proto3" json:"question_answer,omitempty"` //趣味问答配置(趣味问答玩法必传) + Quiz *UpdateReq_Quiz `protobuf:"bytes,15,opt,name=quiz,proto3" json:"quiz,omitempty"` //有奖竞猜配置(有奖竞猜玩法必传) + Win *UpdateReq_InviteConfig `protobuf:"bytes,16,opt,name=win,proto3" json:"win,omitempty"` //一起赢配置(一起赢玩法必传) + TOffset int32 `protobuf:"varint,17,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + Target *UpdateReq_Target `protobuf:"bytes,18,opt,name=target,proto3" json:"target,omitempty"` //活动目标 + Sign *UpdateReq_Sign `protobuf:"bytes,19,opt,name=sign,proto3" json:"sign,omitempty"` //签到配置(签到玩法必传) + Dice *UpdateReq_Dice `protobuf:"bytes,20,opt,name=dice,proto3" json:"dice,omitempty"` //大富翁配置(大富翁玩法必传) + Grow *UpdateReq_Grow `protobuf:"bytes,21,opt,name=grow,proto3" json:"grow,omitempty"` //农场配置(农场玩法必传) + Ballot *UpdateReq_Ballot `protobuf:"bytes,22,opt,name=ballot,proto3" json:"ballot,omitempty"` //抽签配置(抽签玩法必传) + Chop *UpdateReq_Chop `protobuf:"bytes,23,opt,name=chop,proto3" json:"chop,omitempty"` //砍一刀配置(砍一刀玩法必传) + DelayLinkData []*UpdateReq_KV `protobuf:"bytes,24,rep,name=delay_link_data,json=delayLinkData,proto3" json:"delay_link_data,omitempty"` //延迟深度链接自定义键值数据 + Rewards *UpdateReq_Rewards `protobuf:"bytes,25,opt,name=rewards,proto3" json:"rewards,omitempty"` //站内奖品 + RewardsWeb []*UpdateReq_Reward `protobuf:"bytes,26,rep,name=rewards_web,json=rewardsWeb,proto3" json:"rewards_web,omitempty"` //站外奖品 + RewardsExtra []*UpdateReq_Reward `protobuf:"bytes,27,rep,name=rewards_extra,json=rewardsExtra,proto3" json:"rewards_extra,omitempty"` //额外奖品 + RewardsNewcomer []*UpdateReq_Reward `protobuf:"bytes,28,rep,name=rewards_newcomer,json=rewardsNewcomer,proto3" json:"rewards_newcomer,omitempty"` //新人奖 + UserId int64 `protobuf:"varint,29,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //id + Ip string `protobuf:"bytes,30,opt,name=ip,proto3" json:"ip,omitempty"` //操作ip + TargetOption *UpdateReq_TargetOption `protobuf:"bytes,31,opt,name=target_option,json=targetOption,proto3" json:"target_option,omitempty"` //目标配置选项 + Cash *UpdateReq_Cash `protobuf:"bytes,32,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖配置(现金抽奖玩法必传) + LongImgs []*UpdateReq_LongImg `protobuf:"bytes,33,rep,name=long_imgs,json=longImgs,proto3" json:"long_imgs,omitempty"` //长图配置 + Flip *UpdateReq_Flip `protobuf:"bytes,34,opt,name=flip,proto3" json:"flip,omitempty"` //翻牌配置(翻牌玩法必传) + KeepDog *UpdateReq_Keep `protobuf:"bytes,35,opt,name=keep_dog,json=keepDog,proto3" json:"keep_dog,omitempty"` //养狗(养狗配置必传) + Push *UpdateReq_Push `protobuf:"bytes,36,opt,name=push,proto3" json:"push,omitempty"` //推送配置 + Child []*UpdateReq_Child `protobuf:"bytes,37,rep,name=child,proto3" json:"child,omitempty"` //关联的子活动 + WheelStyle *UpdateReq_WheelStyle `protobuf:"bytes,38,opt,name=wheel_style,json=wheelStyle,proto3" json:"wheel_style,omitempty"` //转盘自定义样式 + Gold *UpdateReq_Gold `protobuf:"bytes,39,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务配置(金币任务玩法必传) + Coin *UpdateReq_Coin `protobuf:"bytes,40,opt,name=coin,proto3" json:"coin,omitempty"` //金币池配置(金币池玩法必传) + GridStyle *UpdateReq_GridStyle `protobuf:"bytes,41,opt,name=grid_style,json=gridStyle,proto3" json:"grid_style,omitempty"` //九宫格自定义样式 + FlipStyle *UpdateReq_FlipStyle `protobuf:"bytes,42,opt,name=flip_style,json=flipStyle,proto3" json:"flip_style,omitempty"` //翻牌自定义样式 + PointsUse *UpdateReq_PointsUse `protobuf:"bytes,43,opt,name=points_use,json=pointsUse,proto3" json:"points_use,omitempty"` //积分消耗 + Chat *UpdateReq_Chat `protobuf:"bytes,44,opt,name=chat,proto3" json:"chat,omitempty"` //ai陪伴 + Vs *UpdateReq_Vs `protobuf:"bytes,45,opt,name=vs,proto3" json:"vs,omitempty"` //赛事竞猜配置(赛事竞猜玩法必传) + Uno *UpdateReq_Uno `protobuf:"bytes,46,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌配置(uno卡牌玩法必传) + Event *UpdateReq_Event `protobuf:"bytes,47,opt,name=event,proto3" json:"event,omitempty"` //事件配置(活动事件) + Gashapon *UpdateReq_LotteryConfig `protobuf:"bytes,48,opt,name=gashapon,proto3" json:"gashapon,omitempty"` //扭蛋机配置(扭蛋机玩法必传) + GashaponStyle *UpdateReq_GashaponStyle `protobuf:"bytes,49,opt,name=gashapon_style,json=gashaponStyle,proto3" json:"gashapon_style,omitempty"` //扭蛋机自定义样式 +} + +func (x *UpdateReq) Reset() { + *x = UpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq) ProtoMessage() {} + +func (x *UpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 UpdateReq.ProtoReflect.Descriptor instead. +func (*UpdateReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10} +} + +func (x *UpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *UpdateReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *UpdateReq) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *UpdateReq) GetConfig() *UpdateReq_Config { + if x != nil { + return x.Config + } + return nil +} + +func (x *UpdateReq) GetCampaignData() []*UpdateReq_KV { + if x != nil { + return x.CampaignData + } + return nil +} + +func (x *UpdateReq) GetPrizeWheel() *UpdateReq_LotteryConfig { + if x != nil { + return x.PrizeWheel + } + return nil +} + +func (x *UpdateReq) GetSlot() *UpdateReq_LotteryConfig { + if x != nil { + return x.Slot + } + return nil +} + +func (x *UpdateReq) GetBlind() *UpdateReq_LotteryConfig { + if x != nil { + return x.Blind + } + return nil +} + +func (x *UpdateReq) GetGrid() *UpdateReq_LotteryConfig { + if x != nil { + return x.Grid + } + return nil +} + +func (x *UpdateReq) GetReferral() *UpdateReq_InviteConfig { + if x != nil { + return x.Referral + } + return nil +} + +func (x *UpdateReq) GetQuestionAnswer() *UpdateReq_QuestionAnswer { + if x != nil { + return x.QuestionAnswer + } + return nil +} + +func (x *UpdateReq) GetQuiz() *UpdateReq_Quiz { + if x != nil { + return x.Quiz + } + return nil +} + +func (x *UpdateReq) GetWin() *UpdateReq_InviteConfig { + if x != nil { + return x.Win + } + return nil +} + +func (x *UpdateReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *UpdateReq) GetTarget() *UpdateReq_Target { + if x != nil { + return x.Target + } + return nil +} + +func (x *UpdateReq) GetSign() *UpdateReq_Sign { + if x != nil { + return x.Sign + } + return nil +} + +func (x *UpdateReq) GetDice() *UpdateReq_Dice { + if x != nil { + return x.Dice + } + return nil +} + +func (x *UpdateReq) GetGrow() *UpdateReq_Grow { + if x != nil { + return x.Grow + } + return nil +} + +func (x *UpdateReq) GetBallot() *UpdateReq_Ballot { + if x != nil { + return x.Ballot + } + return nil +} + +func (x *UpdateReq) GetChop() *UpdateReq_Chop { + if x != nil { + return x.Chop + } + return nil +} + +func (x *UpdateReq) GetDelayLinkData() []*UpdateReq_KV { + if x != nil { + return x.DelayLinkData + } + return nil +} + +func (x *UpdateReq) GetRewards() *UpdateReq_Rewards { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *UpdateReq) GetRewardsWeb() []*UpdateReq_Reward { + if x != nil { + return x.RewardsWeb + } + return nil +} + +func (x *UpdateReq) GetRewardsExtra() []*UpdateReq_Reward { + if x != nil { + return x.RewardsExtra + } + return nil +} + +func (x *UpdateReq) GetRewardsNewcomer() []*UpdateReq_Reward { + if x != nil { + return x.RewardsNewcomer + } + return nil +} + +func (x *UpdateReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UpdateReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *UpdateReq) GetTargetOption() *UpdateReq_TargetOption { + if x != nil { + return x.TargetOption + } + return nil +} + +func (x *UpdateReq) GetCash() *UpdateReq_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *UpdateReq) GetLongImgs() []*UpdateReq_LongImg { + if x != nil { + return x.LongImgs + } + return nil +} + +func (x *UpdateReq) GetFlip() *UpdateReq_Flip { + if x != nil { + return x.Flip + } + return nil +} + +func (x *UpdateReq) GetKeepDog() *UpdateReq_Keep { + if x != nil { + return x.KeepDog + } + return nil +} + +func (x *UpdateReq) GetPush() *UpdateReq_Push { + if x != nil { + return x.Push + } + return nil +} + +func (x *UpdateReq) GetChild() []*UpdateReq_Child { + if x != nil { + return x.Child + } + return nil +} + +func (x *UpdateReq) GetWheelStyle() *UpdateReq_WheelStyle { + if x != nil { + return x.WheelStyle + } + return nil +} + +func (x *UpdateReq) GetGold() *UpdateReq_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *UpdateReq) GetCoin() *UpdateReq_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *UpdateReq) GetGridStyle() *UpdateReq_GridStyle { + if x != nil { + return x.GridStyle + } + return nil +} + +func (x *UpdateReq) GetFlipStyle() *UpdateReq_FlipStyle { + if x != nil { + return x.FlipStyle + } + return nil +} + +func (x *UpdateReq) GetPointsUse() *UpdateReq_PointsUse { + if x != nil { + return x.PointsUse + } + return nil +} + +func (x *UpdateReq) GetChat() *UpdateReq_Chat { + if x != nil { + return x.Chat + } + return nil +} + +func (x *UpdateReq) GetVs() *UpdateReq_Vs { + if x != nil { + return x.Vs + } + return nil +} + +func (x *UpdateReq) GetUno() *UpdateReq_Uno { + if x != nil { + return x.Uno + } + return nil +} + +func (x *UpdateReq) GetEvent() *UpdateReq_Event { + if x != nil { + return x.Event + } + return nil +} + +func (x *UpdateReq) GetGashapon() *UpdateReq_LotteryConfig { + if x != nil { + return x.Gashapon + } + return nil +} + +func (x *UpdateReq) GetGashaponStyle() *UpdateReq_GashaponStyle { + if x != nil { + return x.GashaponStyle + } + return nil +} + +type UpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id + AddTask bool `protobuf:"varint,3,opt,name=add_task,json=addTask,proto3" json:"add_task,omitempty"` //新加了任务 +} + +func (x *UpdateRes) Reset() { + *x = UpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRes) ProtoMessage() {} + +func (x *UpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 UpdateRes.ProtoReflect.Descriptor instead. +func (*UpdateRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{11} +} + +func (x *UpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateRes) GetAddTask() bool { + if x != nil { + return x.AddTask + } + return false +} + +type ShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动gid + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + NotReward bool `protobuf:"varint,3,opt,name=not_reward,json=notReward,proto3" json:"not_reward,omitempty"` //不需要奖品 +} + +func (x *ShowReq) Reset() { + *x = ShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowReq) ProtoMessage() {} + +func (x *ShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ShowReq.ProtoReflect.Descriptor instead. +func (*ShowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{12} +} + +func (x *ShowReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ShowReq) GetNotReward() bool { + if x != nil { + return x.NotReward + } + return false +} + +type ShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动gid + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + StartTime int64 `protobuf:"varint,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) + FissionMark string `protobuf:"bytes,7,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //活动类型玩法标识 + TempId int64 `protobuf:"varint,8,opt,name=temp_id,json=tempId,proto3" json:"temp_id,omitempty"` //模版id + ProjectId int64 `protobuf:"varint,9,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //模版id + CoverUrl string `protobuf:"bytes,10,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //活动封面图 + Config *ShowRes_Config `protobuf:"bytes,11,opt,name=config,proto3" json:"config,omitempty"` //活动基础配置 + Share []*ShowRes_Share `protobuf:"bytes,12,rep,name=share,proto3" json:"share,omitempty"` //选择的社媒 + CampaignData []*ShowRes_KV `protobuf:"bytes,13,rep,name=campaign_data,json=campaignData,proto3" json:"campaign_data,omitempty"` //前端组件位置偏移数据 + PrizeWheel *ShowRes_LotteryConfig `protobuf:"bytes,14,opt,name=prize_wheel,json=prizeWheel,proto3" json:"prize_wheel,omitempty"` //大转盘配置(大转盘玩法必传) + Slot *ShowRes_LotteryConfig `protobuf:"bytes,15,opt,name=slot,proto3" json:"slot,omitempty"` //老虎机配置(老虎机玩法必传) + Blind *ShowRes_LotteryConfig `protobuf:"bytes,16,opt,name=blind,proto3" json:"blind,omitempty"` //盲盒配置(盲盒玩法必传) + Grid *ShowRes_LotteryConfig `protobuf:"bytes,17,opt,name=grid,proto3" json:"grid,omitempty"` //九宫格配置(九宫格玩法必传) + Referral *ShowRes_InviteConfig `protobuf:"bytes,18,opt,name=referral,proto3" json:"referral,omitempty"` //老带新配置(老带新玩法必传) + QuestionAnswer *ShowRes_QuestionAnswer `protobuf:"bytes,19,opt,name=question_answer,json=questionAnswer,proto3" json:"question_answer,omitempty"` //趣味问答配置(趣味问答玩法必传) + Quiz *ShowRes_Quiz `protobuf:"bytes,20,opt,name=quiz,proto3" json:"quiz,omitempty"` //有奖竞猜配置(有奖竞猜玩法必传) + Win *ShowRes_InviteConfig `protobuf:"bytes,21,opt,name=win,proto3" json:"win,omitempty"` //一起赢配置(一起赢玩法必传) + TOffset int32 `protobuf:"varint,22,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + TStart int64 `protobuf:"varint,23,opt,name=t_start,json=tStart,proto3" json:"t_start,omitempty"` //展示的开始时间时间戳 + TEnd int64 `protobuf:"varint,24,opt,name=t_end,json=tEnd,proto3" json:"t_end,omitempty"` //展示的结束时间时间戳 + Target *ShowRes_Target `protobuf:"bytes,25,opt,name=target,proto3" json:"target,omitempty"` //活动目标 + Sign *ShowRes_Sign `protobuf:"bytes,26,opt,name=sign,proto3" json:"sign,omitempty"` //签到配置(签到玩法必传) + Dice *ShowRes_Dice `protobuf:"bytes,27,opt,name=dice,proto3" json:"dice,omitempty"` //大富翁配置(大富翁玩法必传) + Grow *ShowRes_Grow `protobuf:"bytes,28,opt,name=grow,proto3" json:"grow,omitempty"` //农场配置(农场玩法必传) + Ballot *ShowRes_Ballot `protobuf:"bytes,29,opt,name=ballot,proto3" json:"ballot,omitempty"` //抽签配置(抽签玩法必传) + Chop *ShowRes_Chop `protobuf:"bytes,30,opt,name=chop,proto3" json:"chop,omitempty"` //砍一刀配置(砍一刀玩法必传) + DelayLinkData []*ShowRes_KV `protobuf:"bytes,31,rep,name=delay_link_data,json=delayLinkData,proto3" json:"delay_link_data,omitempty"` //延迟深度链接自定义键值数据 + Rewards *ShowRes_Rewards `protobuf:"bytes,32,opt,name=rewards,proto3" json:"rewards,omitempty"` //站内奖品 + RewardsWeb []*ShowRes_Reward `protobuf:"bytes,33,rep,name=rewards_web,json=rewardsWeb,proto3" json:"rewards_web,omitempty"` //站外奖品 + RewardsExtra []*ShowRes_Reward `protobuf:"bytes,34,rep,name=rewards_extra,json=rewardsExtra,proto3" json:"rewards_extra,omitempty"` //额外奖品 + RewardsNewcomer []*ShowRes_Reward `protobuf:"bytes,35,rep,name=rewards_newcomer,json=rewardsNewcomer,proto3" json:"rewards_newcomer,omitempty"` //新人奖 + LangMarks []string `protobuf:"bytes,36,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //支持的语种 + TargetOption *ShowRes_TargetOption `protobuf:"bytes,37,opt,name=target_option,json=targetOption,proto3" json:"target_option,omitempty"` //目标配置选项 + Cash *ShowRes_Cash `protobuf:"bytes,38,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖配置(现金抽奖玩法必传) + LongImgs []*ShowRes_LongImg `protobuf:"bytes,39,rep,name=long_imgs,json=longImgs,proto3" json:"long_imgs,omitempty"` //长图配置 + Flip *ShowRes_Flip `protobuf:"bytes,40,opt,name=flip,proto3" json:"flip,omitempty"` //翻牌配置(翻牌玩法必传) + KeepDog *ShowRes_Keep `protobuf:"bytes,41,opt,name=keep_dog,json=keepDog,proto3" json:"keep_dog,omitempty"` //养狗(养狗配置必传) + Push *ShowRes_Push `protobuf:"bytes,42,opt,name=push,proto3" json:"push,omitempty"` //推送配置 + Child []*ShowRes_Child `protobuf:"bytes,43,rep,name=child,proto3" json:"child,omitempty"` //关联的子活动 + WheelStyle *ShowRes_WheelStyle `protobuf:"bytes,44,opt,name=wheel_style,json=wheelStyle,proto3" json:"wheel_style,omitempty"` //转盘自定义样式 + Gold *ShowRes_Gold `protobuf:"bytes,45,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务配置(金币任务玩法必传) + FissionId int64 `protobuf:"varint,46,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + Coin *ShowRes_Coin `protobuf:"bytes,47,opt,name=coin,proto3" json:"coin,omitempty"` //金币池配置(金币池玩法必传) + GridStyle *ShowRes_GridStyle `protobuf:"bytes,48,opt,name=grid_style,json=gridStyle,proto3" json:"grid_style,omitempty"` //九宫格自定义样式 + FlipStyle *ShowRes_FlipStyle `protobuf:"bytes,49,opt,name=flip_style,json=flipStyle,proto3" json:"flip_style,omitempty"` //翻牌自定义样式 + PointsUse *ShowRes_PointsUse `protobuf:"bytes,50,opt,name=points_use,json=pointsUse,proto3" json:"points_use,omitempty"` //积分消耗 + Chat *ShowRes_Chat `protobuf:"bytes,51,opt,name=chat,proto3" json:"chat,omitempty"` //ai陪伴 + Vs *ShowRes_Vs `protobuf:"bytes,52,opt,name=vs,proto3" json:"vs,omitempty"` //赛事竞猜配置(赛事竞猜玩法必传) + Uno *ShowRes_Uno `protobuf:"bytes,53,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌配置(uno卡牌玩法必传) + Event *ShowRes_Event `protobuf:"bytes,54,opt,name=event,proto3" json:"event,omitempty"` //事件配置(活动事件) + Gashapon *ShowRes_LotteryConfig `protobuf:"bytes,55,opt,name=gashapon,proto3" json:"gashapon,omitempty"` //扭蛋机配置(扭蛋机玩法必传) + GashaponStyle *ShowRes_GashaponStyle `protobuf:"bytes,56,opt,name=gashapon_style,json=gashaponStyle,proto3" json:"gashapon_style,omitempty"` //扭蛋机自定义样式 +} + +func (x *ShowRes) Reset() { + *x = ShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes) ProtoMessage() {} + +func (x *ShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ShowRes.ProtoReflect.Descriptor instead. +func (*ShowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13} +} + +func (x *ShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ShowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ShowRes) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ShowRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ShowRes) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *ShowRes) GetTempId() int64 { + if x != nil { + return x.TempId + } + return 0 +} + +func (x *ShowRes) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ShowRes) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *ShowRes) GetConfig() *ShowRes_Config { + if x != nil { + return x.Config + } + return nil +} + +func (x *ShowRes) GetShare() []*ShowRes_Share { + if x != nil { + return x.Share + } + return nil +} + +func (x *ShowRes) GetCampaignData() []*ShowRes_KV { + if x != nil { + return x.CampaignData + } + return nil +} + +func (x *ShowRes) GetPrizeWheel() *ShowRes_LotteryConfig { + if x != nil { + return x.PrizeWheel + } + return nil +} + +func (x *ShowRes) GetSlot() *ShowRes_LotteryConfig { + if x != nil { + return x.Slot + } + return nil +} + +func (x *ShowRes) GetBlind() *ShowRes_LotteryConfig { + if x != nil { + return x.Blind + } + return nil +} + +func (x *ShowRes) GetGrid() *ShowRes_LotteryConfig { + if x != nil { + return x.Grid + } + return nil +} + +func (x *ShowRes) GetReferral() *ShowRes_InviteConfig { + if x != nil { + return x.Referral + } + return nil +} + +func (x *ShowRes) GetQuestionAnswer() *ShowRes_QuestionAnswer { + if x != nil { + return x.QuestionAnswer + } + return nil +} + +func (x *ShowRes) GetQuiz() *ShowRes_Quiz { + if x != nil { + return x.Quiz + } + return nil +} + +func (x *ShowRes) GetWin() *ShowRes_InviteConfig { + if x != nil { + return x.Win + } + return nil +} + +func (x *ShowRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ShowRes) GetTStart() int64 { + if x != nil { + return x.TStart + } + return 0 +} + +func (x *ShowRes) GetTEnd() int64 { + if x != nil { + return x.TEnd + } + return 0 +} + +func (x *ShowRes) GetTarget() *ShowRes_Target { + if x != nil { + return x.Target + } + return nil +} + +func (x *ShowRes) GetSign() *ShowRes_Sign { + if x != nil { + return x.Sign + } + return nil +} + +func (x *ShowRes) GetDice() *ShowRes_Dice { + if x != nil { + return x.Dice + } + return nil +} + +func (x *ShowRes) GetGrow() *ShowRes_Grow { + if x != nil { + return x.Grow + } + return nil +} + +func (x *ShowRes) GetBallot() *ShowRes_Ballot { + if x != nil { + return x.Ballot + } + return nil +} + +func (x *ShowRes) GetChop() *ShowRes_Chop { + if x != nil { + return x.Chop + } + return nil +} + +func (x *ShowRes) GetDelayLinkData() []*ShowRes_KV { + if x != nil { + return x.DelayLinkData + } + return nil +} + +func (x *ShowRes) GetRewards() *ShowRes_Rewards { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ShowRes) GetRewardsWeb() []*ShowRes_Reward { + if x != nil { + return x.RewardsWeb + } + return nil +} + +func (x *ShowRes) GetRewardsExtra() []*ShowRes_Reward { + if x != nil { + return x.RewardsExtra + } + return nil +} + +func (x *ShowRes) GetRewardsNewcomer() []*ShowRes_Reward { + if x != nil { + return x.RewardsNewcomer + } + return nil +} + +func (x *ShowRes) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ShowRes) GetTargetOption() *ShowRes_TargetOption { + if x != nil { + return x.TargetOption + } + return nil +} + +func (x *ShowRes) GetCash() *ShowRes_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *ShowRes) GetLongImgs() []*ShowRes_LongImg { + if x != nil { + return x.LongImgs + } + return nil +} + +func (x *ShowRes) GetFlip() *ShowRes_Flip { + if x != nil { + return x.Flip + } + return nil +} + +func (x *ShowRes) GetKeepDog() *ShowRes_Keep { + if x != nil { + return x.KeepDog + } + return nil +} + +func (x *ShowRes) GetPush() *ShowRes_Push { + if x != nil { + return x.Push + } + return nil +} + +func (x *ShowRes) GetChild() []*ShowRes_Child { + if x != nil { + return x.Child + } + return nil +} + +func (x *ShowRes) GetWheelStyle() *ShowRes_WheelStyle { + if x != nil { + return x.WheelStyle + } + return nil +} + +func (x *ShowRes) GetGold() *ShowRes_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *ShowRes) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ShowRes) GetCoin() *ShowRes_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *ShowRes) GetGridStyle() *ShowRes_GridStyle { + if x != nil { + return x.GridStyle + } + return nil +} + +func (x *ShowRes) GetFlipStyle() *ShowRes_FlipStyle { + if x != nil { + return x.FlipStyle + } + return nil +} + +func (x *ShowRes) GetPointsUse() *ShowRes_PointsUse { + if x != nil { + return x.PointsUse + } + return nil +} + +func (x *ShowRes) GetChat() *ShowRes_Chat { + if x != nil { + return x.Chat + } + return nil +} + +func (x *ShowRes) GetVs() *ShowRes_Vs { + if x != nil { + return x.Vs + } + return nil +} + +func (x *ShowRes) GetUno() *ShowRes_Uno { + if x != nil { + return x.Uno + } + return nil +} + +func (x *ShowRes) GetEvent() *ShowRes_Event { + if x != nil { + return x.Event + } + return nil +} + +func (x *ShowRes) GetGashapon() *ShowRes_LotteryConfig { + if x != nil { + return x.Gashapon + } + return nil +} + +func (x *ShowRes) GetGashaponStyle() *ShowRes_GashaponStyle { + if x != nil { + return x.GashaponStyle + } + return nil +} + +type ChannelListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动对外id +} + +func (x *ChannelListReq) Reset() { + *x = ChannelListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelListReq) ProtoMessage() {} + +func (x *ChannelListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelListReq.ProtoReflect.Descriptor instead. +func (*ChannelListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{14} +} + +func (x *ChannelListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ChannelListReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type ChannelListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ChannelListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //站内渠道列表数据 + WebList []*ChannelListRes_One `protobuf:"bytes,2,rep,name=web_list,json=webList,proto3" json:"web_list,omitempty"` //站外渠道列表数据 +} + +func (x *ChannelListRes) Reset() { + *x = ChannelListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelListRes) ProtoMessage() {} + +func (x *ChannelListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelListRes.ProtoReflect.Descriptor instead. +func (*ChannelListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{15} +} + +func (x *ChannelListRes) GetList() []*ChannelListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ChannelListRes) GetWebList() []*ChannelListRes_One { + if x != nil { + return x.WebList + } + return nil +} + +type ChannelCreateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //渠道名称 + CType int32 `protobuf:"varint,4,opt,name=c_type,json=cType,proto3" json:"c_type,omitempty"` //渠道类型(1-站内渠道,2-站外渠道) +} + +func (x *ChannelCreateReq) Reset() { + *x = ChannelCreateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelCreateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelCreateReq) ProtoMessage() {} + +func (x *ChannelCreateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelCreateReq.ProtoReflect.Descriptor instead. +func (*ChannelCreateReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{16} +} + +func (x *ChannelCreateReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ChannelCreateReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *ChannelCreateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChannelCreateReq) GetCType() int32 { + if x != nil { + return x.CType + } + return 0 +} + +type ChannelCreateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //渠道id + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` //渠道链接 +} + +func (x *ChannelCreateRes) Reset() { + *x = ChannelCreateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelCreateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelCreateRes) ProtoMessage() {} + +func (x *ChannelCreateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelCreateRes.ProtoReflect.Descriptor instead. +func (*ChannelCreateRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{17} +} + +func (x *ChannelCreateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChannelCreateRes) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +type ChannelUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //渠道id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //渠道名称 +} + +func (x *ChannelUpdateReq) Reset() { + *x = ChannelUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelUpdateReq) ProtoMessage() {} + +func (x *ChannelUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelUpdateReq.ProtoReflect.Descriptor instead. +func (*ChannelUpdateReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{18} +} + +func (x *ChannelUpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChannelUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type ChannelUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChannelUpdateRes) Reset() { + *x = ChannelUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelUpdateRes) ProtoMessage() {} + +func (x *ChannelUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelUpdateRes.ProtoReflect.Descriptor instead. +func (*ChannelUpdateRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{19} +} + +type ChannelDestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //渠道id +} + +func (x *ChannelDestroyReq) Reset() { + *x = ChannelDestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelDestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelDestroyReq) ProtoMessage() {} + +func (x *ChannelDestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelDestroyReq.ProtoReflect.Descriptor instead. +func (*ChannelDestroyReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{20} +} + +func (x *ChannelDestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ChannelDestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChannelDestroyRes) Reset() { + *x = ChannelDestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelDestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelDestroyRes) ProtoMessage() {} + +func (x *ChannelDestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 ChannelDestroyRes.ProtoReflect.Descriptor instead. +func (*ChannelDestroyRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{21} +} + +type KvDataReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id +} + +func (x *KvDataReq) Reset() { + *x = KvDataReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KvDataReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KvDataReq) ProtoMessage() {} + +func (x *KvDataReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 KvDataReq.ProtoReflect.Descriptor instead. +func (*KvDataReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{22} +} + +func (x *KvDataReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type KvDataRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kv []*KvDataRes_KV `protobuf:"bytes,1,rep,name=kv,proto3" json:"kv,omitempty"` //活动键值对 +} + +func (x *KvDataRes) Reset() { + *x = KvDataRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KvDataRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KvDataRes) ProtoMessage() {} + +func (x *KvDataRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_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 KvDataRes.ProtoReflect.Descriptor instead. +func (*KvDataRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{23} +} + +func (x *KvDataRes) GetKv() []*KvDataRes_KV { + if x != nil { + return x.Kv + } + return nil +} + +type CertReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动 + ProjectId int64 `protobuf:"varint,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + ProjectHashId string `protobuf:"bytes,4,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *CertReq) Reset() { + *x = CertReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertReq) ProtoMessage() {} + +func (x *CertReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[24] + 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 CertReq.ProtoReflect.Descriptor instead. +func (*CertReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{24} +} + +func (x *CertReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CertReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CertReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *CertReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type CertRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cert bool `protobuf:"varint,1,opt,name=cert,proto3" json:"cert,omitempty"` //认证失败 + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,3,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动 + ProjectId int64 `protobuf:"varint,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + ProjectHashId string `protobuf:"bytes,5,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` //活动标题 +} + +func (x *CertRes) Reset() { + *x = CertRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertRes) ProtoMessage() {} + +func (x *CertRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[25] + 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 CertRes.ProtoReflect.Descriptor instead. +func (*CertRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{25} +} + +func (x *CertRes) GetCert() bool { + if x != nil { + return x.Cert + } + return false +} + +func (x *CertRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CertRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CertRes) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *CertRes) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *CertRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type BarrageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动 + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语种标识 + Lv string `protobuf:"bytes,4,opt,name=lv,proto3" json:"lv,omitempty"` //用户等级标识 + ShowLang string `protobuf:"bytes,5,opt,name=show_lang,json=showLang,proto3" json:"show_lang,omitempty"` //展示的语种 + CountryMark string `protobuf:"bytes,6,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 + UserId int64 `protobuf:"varint,7,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *BarrageReq) Reset() { + *x = BarrageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BarrageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BarrageReq) ProtoMessage() {} + +func (x *BarrageReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[26] + 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 BarrageReq.ProtoReflect.Descriptor instead. +func (*BarrageReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{26} +} + +func (x *BarrageReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *BarrageReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *BarrageReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *BarrageReq) GetLv() string { + if x != nil { + return x.Lv + } + return "" +} + +func (x *BarrageReq) GetShowLang() string { + if x != nil { + return x.ShowLang + } + return "" +} + +func (x *BarrageReq) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *BarrageReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type BarrageRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Content []string `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` //内容 + TranContent []*BarrageRes_TranContent `protobuf:"bytes,2,rep,name=tran_content,json=tranContent,proto3" json:"tran_content,omitempty"` //内容 +} + +func (x *BarrageRes) Reset() { + *x = BarrageRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BarrageRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BarrageRes) ProtoMessage() {} + +func (x *BarrageRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[27] + 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 BarrageRes.ProtoReflect.Descriptor instead. +func (*BarrageRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{27} +} + +func (x *BarrageRes) GetContent() []string { + if x != nil { + return x.Content + } + return nil +} + +func (x *BarrageRes) GetTranContent() []*BarrageRes_TranContent { + if x != nil { + return x.TranContent + } + return nil +} + +type OptionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动 +} + +func (x *OptionReq) Reset() { + *x = OptionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionReq) ProtoMessage() {} + +func (x *OptionReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[28] + 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 OptionReq.ProtoReflect.Descriptor instead. +func (*OptionReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{28} +} + +func (x *OptionReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *OptionReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type OptionRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Options []*OptionRes_Option `protobuf:"bytes,1,rep,name=options,proto3" json:"options,omitempty"` //内容 + RightId int64 `protobuf:"varint,2,opt,name=right_id,json=rightId,proto3" json:"right_id,omitempty"` //开奖后正确选项,只有开奖后才有数据 +} + +func (x *OptionRes) Reset() { + *x = OptionRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionRes) ProtoMessage() {} + +func (x *OptionRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[29] + 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 OptionRes.ProtoReflect.Descriptor instead. +func (*OptionRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{29} +} + +func (x *OptionRes) GetOptions() []*OptionRes_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *OptionRes) GetRightId() int64 { + if x != nil { + return x.RightId + } + return 0 +} + +type RelateDdlReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Close bool `protobuf:"varint,3,opt,name=close,proto3" json:"close,omitempty"` //是否关闭 +} + +func (x *RelateDdlReq) Reset() { + *x = RelateDdlReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelateDdlReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelateDdlReq) ProtoMessage() {} + +func (x *RelateDdlReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[30] + 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 RelateDdlReq.ProtoReflect.Descriptor instead. +func (*RelateDdlReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{30} +} + +func (x *RelateDdlReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *RelateDdlReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *RelateDdlReq) GetClose() bool { + if x != nil { + return x.Close + } + return false +} + +type RelateDdlRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RelateDdlRes) Reset() { + *x = RelateDdlRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelateDdlRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelateDdlRes) ProtoMessage() {} + +func (x *RelateDdlRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[31] + 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 RelateDdlRes.ProtoReflect.Descriptor instead. +func (*RelateDdlRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{31} +} + +type DdlCampaignReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *DdlCampaignReq) Reset() { + *x = DdlCampaignReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DdlCampaignReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DdlCampaignReq) ProtoMessage() {} + +func (x *DdlCampaignReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[32] + 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 DdlCampaignReq.ProtoReflect.Descriptor instead. +func (*DdlCampaignReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{32} +} + +func (x *DdlCampaignReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type DdlCampaignRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) +} + +func (x *DdlCampaignRes) Reset() { + *x = DdlCampaignRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DdlCampaignRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DdlCampaignRes) ProtoMessage() {} + +func (x *DdlCampaignRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[33] + 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 DdlCampaignRes.ProtoReflect.Descriptor instead. +func (*DdlCampaignRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{33} +} + +func (x *DdlCampaignRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *DdlCampaignRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DdlCampaignRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type LangsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *LangsReq) Reset() { + *x = LangsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsReq) ProtoMessage() {} + +func (x *LangsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[34] + 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 LangsReq.ProtoReflect.Descriptor instead. +func (*LangsReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{34} +} + +func (x *LangsReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type LangsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HasWeb bool `protobuf:"varint,1,opt,name=has_web,json=hasWeb,proto3" json:"has_web,omitempty"` //是否开启站外 + HasWarn bool `protobuf:"varint,2,opt,name=has_warn,json=hasWarn,proto3" json:"has_warn,omitempty"` //是否开启预热 + DlType int32 `protobuf:"varint,3,opt,name=dl_type,json=dlType,proto3" json:"dl_type,omitempty"` //下载引导页类型(1-通用,2-自定义多媒体) + DlBannerType int32 `protobuf:"varint,4,opt,name=dl_banner_type,json=dlBannerType,proto3" json:"dl_banner_type,omitempty"` //下载页横幅类型(1-默认,2-自定义) + WindowCover int32 `protobuf:"varint,5,opt,name=window_cover,json=windowCover,proto3" json:"window_cover,omitempty"` //是否开启全屏封面(0-关闭,1-开启) + RewardGroup int32 `protobuf:"varint,6,opt,name=reward_group,json=rewardGroup,proto3" json:"reward_group,omitempty"` //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品) + Langs []*LangsRes_Lang `protobuf:"bytes,7,rep,name=langs,proto3" json:"langs,omitempty"` //语言列表 + NotSupport []*LangsRes_Lang `protobuf:"bytes,8,rep,name=not_support,json=notSupport,proto3" json:"not_support,omitempty"` //不支持的语言列表 + FissionMark string `protobuf:"bytes,9,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //玩法标识 + TempGroupMark string `protobuf:"bytes,10,opt,name=temp_group_mark,json=tempGroupMark,proto3" json:"temp_group_mark,omitempty"` //模版组标识 + HasLongImg bool `protobuf:"varint,11,opt,name=has_long_img,json=hasLongImg,proto3" json:"has_long_img,omitempty"` //是否开启长图 + RuleType int32 `protobuf:"varint,12,opt,name=rule_type,json=ruleType,proto3" json:"rule_type,omitempty"` //规则展示类型(0-文本,1-图片) + Title string `protobuf:"bytes,13,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + FissionMarkTitle string `protobuf:"bytes,14,opt,name=fission_mark_title,json=fissionMarkTitle,proto3" json:"fission_mark_title,omitempty"` //玩法标识说明 +} + +func (x *LangsRes) Reset() { + *x = LangsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes) ProtoMessage() {} + +func (x *LangsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[35] + 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 LangsRes.ProtoReflect.Descriptor instead. +func (*LangsRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35} +} + +func (x *LangsRes) GetHasWeb() bool { + if x != nil { + return x.HasWeb + } + return false +} + +func (x *LangsRes) GetHasWarn() bool { + if x != nil { + return x.HasWarn + } + return false +} + +func (x *LangsRes) GetDlType() int32 { + if x != nil { + return x.DlType + } + return 0 +} + +func (x *LangsRes) GetDlBannerType() int32 { + if x != nil { + return x.DlBannerType + } + return 0 +} + +func (x *LangsRes) GetWindowCover() int32 { + if x != nil { + return x.WindowCover + } + return 0 +} + +func (x *LangsRes) GetRewardGroup() int32 { + if x != nil { + return x.RewardGroup + } + return 0 +} + +func (x *LangsRes) GetLangs() []*LangsRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *LangsRes) GetNotSupport() []*LangsRes_Lang { + if x != nil { + return x.NotSupport + } + return nil +} + +func (x *LangsRes) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *LangsRes) GetTempGroupMark() string { + if x != nil { + return x.TempGroupMark + } + return "" +} + +func (x *LangsRes) GetHasLongImg() bool { + if x != nil { + return x.HasLongImg + } + return false +} + +func (x *LangsRes) GetRuleType() int32 { + if x != nil { + return x.RuleType + } + return 0 +} + +func (x *LangsRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes) GetFissionMarkTitle() string { + if x != nil { + return x.FissionMarkTitle + } + return "" +} + +type LangReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言对应的唯一标识 +} + +func (x *LangReq) Reset() { + *x = LangReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangReq) ProtoMessage() {} + +func (x *LangReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[36] + 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 LangReq.ProtoReflect.Descriptor instead. +func (*LangReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{36} +} + +func (x *LangReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *LangReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type LangRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //语言配置信息ID + PageTitle string `protobuf:"bytes,2,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + ImageMain string `protobuf:"bytes,3,opt,name=image_main,json=imageMain,proto3" json:"image_main,omitempty"` //活动主图 + DownloadPageImage string `protobuf:"bytes,4,opt,name=download_page_image,json=downloadPageImage,proto3" json:"download_page_image,omitempty"` //下载引导页的图片 + WechatPageImage string `protobuf:"bytes,5,opt,name=wechat_page_image,json=wechatPageImage,proto3" json:"wechat_page_image,omitempty"` //微信引导页的图片 + ContentImg string `protobuf:"bytes,6,opt,name=content_img,json=contentImg,proto3" json:"content_img,omitempty"` //内容背景图 + WebBgImg string `protobuf:"bytes,7,opt,name=web_bg_img,json=webBgImg,proto3" json:"web_bg_img,omitempty"` //站外背景图地址 + WarmUpImg string `protobuf:"bytes,8,opt,name=warm_up_img,json=warmUpImg,proto3" json:"warm_up_img,omitempty"` //预热海报图 + DlBgImg string `protobuf:"bytes,9,opt,name=dl_bg_img,json=dlBgImg,proto3" json:"dl_bg_img,omitempty"` //引导页背景图 + DlBannerImg string `protobuf:"bytes,10,opt,name=dl_banner_img,json=dlBannerImg,proto3" json:"dl_banner_img,omitempty"` //下载页横幅自定义图 + DlBannerAppLogo string `protobuf:"bytes,11,opt,name=dl_banner_app_logo,json=dlBannerAppLogo,proto3" json:"dl_banner_app_logo,omitempty"` //下载页横幅applogo图片 + DlBannerAppName string `protobuf:"bytes,12,opt,name=dl_banner_app_name,json=dlBannerAppName,proto3" json:"dl_banner_app_name,omitempty"` //下载页横幅app名称 + DlBannerAppBtn string `protobuf:"bytes,13,opt,name=dl_banner_app_btn,json=dlBannerAppBtn,proto3" json:"dl_banner_app_btn,omitempty"` //下载页横幅app按钮文案 + ShareText string `protobuf:"bytes,14,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,15,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + Rule string `protobuf:"bytes,16,opt,name=rule,proto3" json:"rule,omitempty"` //活动规则 + Conds []*LangRes_Cond `protobuf:"bytes,17,rep,name=conds,proto3" json:"conds,omitempty"` //事件驱动的条件描述 + Quit *LangRes_Quit `protobuf:"bytes,18,opt,name=quit,proto3" json:"quit,omitempty"` //赛事竞猜选项翻译 + Questions []*LangRes_Question `protobuf:"bytes,19,rep,name=questions,proto3" json:"questions,omitempty"` //问题翻译 + LongImgs []*LangRes_LongImg `protobuf:"bytes,20,rep,name=long_imgs,json=longImgs,proto3" json:"long_imgs,omitempty"` //长图配置 + Cash *LangRes_Cash `protobuf:"bytes,21,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖配置 + TOffset int32 `protobuf:"varint,22,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区偏移值 + QaGroup *LangRes_QaGroup `protobuf:"bytes,23,opt,name=qa_group,json=qaGroup,proto3" json:"qa_group,omitempty"` //题库数据 + TalkText []*LangRes_Talk `protobuf:"bytes,24,rep,name=talk_text,json=talkText,proto3" json:"talk_text,omitempty"` //对话文案 + Gold *LangRes_Gold `protobuf:"bytes,25,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务配置 + Coin *LangRes_Coin `protobuf:"bytes,26,opt,name=coin,proto3" json:"coin,omitempty"` //金币池配置 + TopicColor string `protobuf:"bytes,27,opt,name=topic_color,json=topicColor,proto3" json:"topic_color,omitempty"` //主题色 + PcBg string `protobuf:"bytes,28,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc背景 + RuleImg string `protobuf:"bytes,29,opt,name=rule_img,json=ruleImg,proto3" json:"rule_img,omitempty"` //规则展示图 + Schedules []*LangRes_Schedule `protobuf:"bytes,30,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛事时间表 + Uno *LangRes_Uno `protobuf:"bytes,31,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌配置 +} + +func (x *LangRes) Reset() { + *x = LangRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes) ProtoMessage() {} + +func (x *LangRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[37] + 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 LangRes.ProtoReflect.Descriptor instead. +func (*LangRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37} +} + +func (x *LangRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *LangRes) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *LangRes) GetImageMain() string { + if x != nil { + return x.ImageMain + } + return "" +} + +func (x *LangRes) GetDownloadPageImage() string { + if x != nil { + return x.DownloadPageImage + } + return "" +} + +func (x *LangRes) GetWechatPageImage() string { + if x != nil { + return x.WechatPageImage + } + return "" +} + +func (x *LangRes) GetContentImg() string { + if x != nil { + return x.ContentImg + } + return "" +} + +func (x *LangRes) GetWebBgImg() string { + if x != nil { + return x.WebBgImg + } + return "" +} + +func (x *LangRes) GetWarmUpImg() string { + if x != nil { + return x.WarmUpImg + } + return "" +} + +func (x *LangRes) GetDlBgImg() string { + if x != nil { + return x.DlBgImg + } + return "" +} + +func (x *LangRes) GetDlBannerImg() string { + if x != nil { + return x.DlBannerImg + } + return "" +} + +func (x *LangRes) GetDlBannerAppLogo() string { + if x != nil { + return x.DlBannerAppLogo + } + return "" +} + +func (x *LangRes) GetDlBannerAppName() string { + if x != nil { + return x.DlBannerAppName + } + return "" +} + +func (x *LangRes) GetDlBannerAppBtn() string { + if x != nil { + return x.DlBannerAppBtn + } + return "" +} + +func (x *LangRes) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *LangRes) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *LangRes) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *LangRes) GetConds() []*LangRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +func (x *LangRes) GetQuit() *LangRes_Quit { + if x != nil { + return x.Quit + } + return nil +} + +func (x *LangRes) GetQuestions() []*LangRes_Question { + if x != nil { + return x.Questions + } + return nil +} + +func (x *LangRes) GetLongImgs() []*LangRes_LongImg { + if x != nil { + return x.LongImgs + } + return nil +} + +func (x *LangRes) GetCash() *LangRes_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *LangRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *LangRes) GetQaGroup() *LangRes_QaGroup { + if x != nil { + return x.QaGroup + } + return nil +} + +func (x *LangRes) GetTalkText() []*LangRes_Talk { + if x != nil { + return x.TalkText + } + return nil +} + +func (x *LangRes) GetGold() *LangRes_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *LangRes) GetCoin() *LangRes_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *LangRes) GetTopicColor() string { + if x != nil { + return x.TopicColor + } + return "" +} + +func (x *LangRes) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *LangRes) GetRuleImg() string { + if x != nil { + return x.RuleImg + } + return "" +} + +func (x *LangRes) GetSchedules() []*LangRes_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *LangRes) GetUno() *LangRes_Uno { + if x != nil { + return x.Uno + } + return nil +} + +type SaveLangReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ToView bool `protobuf:"varint,1,opt,name=to_view,json=toView,proto3" json:"to_view,omitempty"` //是否需要去预览页 + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言对应的唯一标识 + PageTitle string `protobuf:"bytes,4,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + ImageMain string `protobuf:"bytes,5,opt,name=image_main,json=imageMain,proto3" json:"image_main,omitempty"` //活动主图 + DownloadPageImage string `protobuf:"bytes,6,opt,name=download_page_image,json=downloadPageImage,proto3" json:"download_page_image,omitempty"` //下载引导页的图片 + WechatPageImage string `protobuf:"bytes,7,opt,name=wechat_page_image,json=wechatPageImage,proto3" json:"wechat_page_image,omitempty"` //微信引导页的图片 + ContentImg string `protobuf:"bytes,8,opt,name=content_img,json=contentImg,proto3" json:"content_img,omitempty"` //内容背景图 + WebBgImg string `protobuf:"bytes,9,opt,name=web_bg_img,json=webBgImg,proto3" json:"web_bg_img,omitempty"` //站外背景图地址 + WarmUpImg string `protobuf:"bytes,10,opt,name=warm_up_img,json=warmUpImg,proto3" json:"warm_up_img,omitempty"` //预热海报图 + DlBgImg string `protobuf:"bytes,11,opt,name=dl_bg_img,json=dlBgImg,proto3" json:"dl_bg_img,omitempty"` //引导页背景图 + DlBannerImg string `protobuf:"bytes,12,opt,name=dl_banner_img,json=dlBannerImg,proto3" json:"dl_banner_img,omitempty"` //下载页横幅自定义图 + DlBannerAppLogo string `protobuf:"bytes,13,opt,name=dl_banner_app_logo,json=dlBannerAppLogo,proto3" json:"dl_banner_app_logo,omitempty"` //下载页横幅applogo图片 + DlBannerAppName string `protobuf:"bytes,14,opt,name=dl_banner_app_name,json=dlBannerAppName,proto3" json:"dl_banner_app_name,omitempty"` //下载页横幅app名称 + DlBannerAppBtn string `protobuf:"bytes,15,opt,name=dl_banner_app_btn,json=dlBannerAppBtn,proto3" json:"dl_banner_app_btn,omitempty"` //下载页横幅app按钮文案 + ShareText string `protobuf:"bytes,16,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,17,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + Rule string `protobuf:"bytes,18,opt,name=rule,proto3" json:"rule,omitempty"` //活动规则 + Conds []*SaveLangReq_Cond `protobuf:"bytes,19,rep,name=conds,proto3" json:"conds,omitempty"` //事件驱动的条件描述 + Quit *SaveLangReq_Quit `protobuf:"bytes,20,opt,name=quit,proto3" json:"quit,omitempty"` //赛事竞猜选项翻译 + Questions []*SaveLangReq_Question `protobuf:"bytes,21,rep,name=questions,proto3" json:"questions,omitempty"` //问题翻译 + LongImgs []*SaveLangReq_LongImg `protobuf:"bytes,22,rep,name=long_imgs,json=longImgs,proto3" json:"long_imgs,omitempty"` //长图配置 + Cash *SaveLangReq_Cash `protobuf:"bytes,23,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖配置 + TOffset int32 `protobuf:"varint,24,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区偏移值 + QaGroup *SaveLangReq_QaGroup `protobuf:"bytes,25,opt,name=qa_group,json=qaGroup,proto3" json:"qa_group,omitempty"` //题库数据 + TalkText []*SaveLangReq_Talk `protobuf:"bytes,26,rep,name=talk_text,json=talkText,proto3" json:"talk_text,omitempty"` //对话文案 + Gold *SaveLangReq_Gold `protobuf:"bytes,27,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务配置 + Coin *SaveLangReq_Coin `protobuf:"bytes,28,opt,name=coin,proto3" json:"coin,omitempty"` //金币池配置 + TopicColor string `protobuf:"bytes,29,opt,name=topic_color,json=topicColor,proto3" json:"topic_color,omitempty"` //主题色 + PcBg string `protobuf:"bytes,30,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc背景 + RuleImg string `protobuf:"bytes,31,opt,name=rule_img,json=ruleImg,proto3" json:"rule_img,omitempty"` //规则展示图 + Schedules []*SaveLangReq_Schedule `protobuf:"bytes,32,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛事时间表 + Uno *SaveLangReq_Uno `protobuf:"bytes,33,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌配置 +} + +func (x *SaveLangReq) Reset() { + *x = SaveLangReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq) ProtoMessage() {} + +func (x *SaveLangReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[38] + 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 SaveLangReq.ProtoReflect.Descriptor instead. +func (*SaveLangReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38} +} + +func (x *SaveLangReq) GetToView() bool { + if x != nil { + return x.ToView + } + return false +} + +func (x *SaveLangReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *SaveLangReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *SaveLangReq) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *SaveLangReq) GetImageMain() string { + if x != nil { + return x.ImageMain + } + return "" +} + +func (x *SaveLangReq) GetDownloadPageImage() string { + if x != nil { + return x.DownloadPageImage + } + return "" +} + +func (x *SaveLangReq) GetWechatPageImage() string { + if x != nil { + return x.WechatPageImage + } + return "" +} + +func (x *SaveLangReq) GetContentImg() string { + if x != nil { + return x.ContentImg + } + return "" +} + +func (x *SaveLangReq) GetWebBgImg() string { + if x != nil { + return x.WebBgImg + } + return "" +} + +func (x *SaveLangReq) GetWarmUpImg() string { + if x != nil { + return x.WarmUpImg + } + return "" +} + +func (x *SaveLangReq) GetDlBgImg() string { + if x != nil { + return x.DlBgImg + } + return "" +} + +func (x *SaveLangReq) GetDlBannerImg() string { + if x != nil { + return x.DlBannerImg + } + return "" +} + +func (x *SaveLangReq) GetDlBannerAppLogo() string { + if x != nil { + return x.DlBannerAppLogo + } + return "" +} + +func (x *SaveLangReq) GetDlBannerAppName() string { + if x != nil { + return x.DlBannerAppName + } + return "" +} + +func (x *SaveLangReq) GetDlBannerAppBtn() string { + if x != nil { + return x.DlBannerAppBtn + } + return "" +} + +func (x *SaveLangReq) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *SaveLangReq) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *SaveLangReq) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *SaveLangReq) GetConds() []*SaveLangReq_Cond { + if x != nil { + return x.Conds + } + return nil +} + +func (x *SaveLangReq) GetQuit() *SaveLangReq_Quit { + if x != nil { + return x.Quit + } + return nil +} + +func (x *SaveLangReq) GetQuestions() []*SaveLangReq_Question { + if x != nil { + return x.Questions + } + return nil +} + +func (x *SaveLangReq) GetLongImgs() []*SaveLangReq_LongImg { + if x != nil { + return x.LongImgs + } + return nil +} + +func (x *SaveLangReq) GetCash() *SaveLangReq_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *SaveLangReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *SaveLangReq) GetQaGroup() *SaveLangReq_QaGroup { + if x != nil { + return x.QaGroup + } + return nil +} + +func (x *SaveLangReq) GetTalkText() []*SaveLangReq_Talk { + if x != nil { + return x.TalkText + } + return nil +} + +func (x *SaveLangReq) GetGold() *SaveLangReq_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *SaveLangReq) GetCoin() *SaveLangReq_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *SaveLangReq) GetTopicColor() string { + if x != nil { + return x.TopicColor + } + return "" +} + +func (x *SaveLangReq) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *SaveLangReq) GetRuleImg() string { + if x != nil { + return x.RuleImg + } + return "" +} + +func (x *SaveLangReq) GetSchedules() []*SaveLangReq_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *SaveLangReq) GetUno() *SaveLangReq_Uno { + if x != nil { + return x.Uno + } + return nil +} + +type SaveLangRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ViewLink string `protobuf:"bytes,1,opt,name=view_link,json=viewLink,proto3" json:"view_link,omitempty"` //预览地址 +} + +func (x *SaveLangRes) Reset() { + *x = SaveLangRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangRes) ProtoMessage() {} + +func (x *SaveLangRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[39] + 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 SaveLangRes.ProtoReflect.Descriptor instead. +func (*SaveLangRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{39} +} + +func (x *SaveLangRes) GetViewLink() string { + if x != nil { + return x.ViewLink + } + return "" +} + +type DestroyLangReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //语言配置信息ID +} + +func (x *DestroyLangReq) Reset() { + *x = DestroyLangReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyLangReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyLangReq) ProtoMessage() {} + +func (x *DestroyLangReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[40] + 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 DestroyLangReq.ProtoReflect.Descriptor instead. +func (*DestroyLangReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{40} +} + +func (x *DestroyLangReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DestroyLangRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DestroyLangRes) Reset() { + *x = DestroyLangRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyLangRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyLangRes) ProtoMessage() {} + +func (x *DestroyLangRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[41] + 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 DestroyLangRes.ProtoReflect.Descriptor instead. +func (*DestroyLangRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{41} +} + +type LangSelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *LangSelectReq) Reset() { + *x = LangSelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangSelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangSelectReq) ProtoMessage() {} + +func (x *LangSelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[42] + 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 LangSelectReq.ProtoReflect.Descriptor instead. +func (*LangSelectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{42} +} + +func (x *LangSelectReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type LangSelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*LangSelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //选择 +} + +func (x *LangSelectRes) Reset() { + *x = LangSelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangSelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangSelectRes) ProtoMessage() {} + +func (x *LangSelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[43] + 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 LangSelectRes.ProtoReflect.Descriptor instead. +func (*LangSelectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{43} +} + +func (x *LangSelectRes) GetList() []*LangSelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type CampaignInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + Lang string `protobuf:"bytes,4,opt,name=lang,proto3" json:"lang,omitempty"` //语言标识 +} + +func (x *CampaignInfoReq) Reset() { + *x = CampaignInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignInfoReq) ProtoMessage() {} + +func (x *CampaignInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[44] + 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 CampaignInfoReq.ProtoReflect.Descriptor instead. +func (*CampaignInfoReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{44} +} + +func (x *CampaignInfoReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *CampaignInfoReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *CampaignInfoReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *CampaignInfoReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +type CampaignInfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + PageTitle string `protobuf:"bytes,4,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + FissionMark string `protobuf:"bytes,5,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //玩法标识 + FissionTitle string `protobuf:"bytes,6,opt,name=fission_title,json=fissionTitle,proto3" json:"fission_title,omitempty"` //活动类型说明 + StartTime int64 `protobuf:"varint,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //提交的开始时间(+8时区算出来的时间戳) + EndTime int64 `protobuf:"varint,8,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //提交的结束时间(+8时区算出来的时间戳) + Status int32 `protobuf:"varint,9,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) + TOffset int32 `protobuf:"varint,10,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + LangTypes []string `protobuf:"bytes,11,rep,name=lang_types,json=langTypes,proto3" json:"lang_types,omitempty"` //支持的语种 + ShareImg string `protobuf:"bytes,12,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + Link string `protobuf:"bytes,13,opt,name=link,proto3" json:"link,omitempty"` //活动地址 + ImgHost string `protobuf:"bytes,14,opt,name=img_host,json=imgHost,proto3" json:"img_host,omitempty"` //图片全球地址 + PcBg string `protobuf:"bytes,15,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc适配背景 + Target int32 `protobuf:"varint,16,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告) + StartAt int64 `protobuf:"varint,17,opt,name=start_at,json=startAt,proto3" json:"start_at,omitempty"` //开始时间戳 + EndAt int64 `protobuf:"varint,18,opt,name=end_at,json=endAt,proto3" json:"end_at,omitempty"` //结束时间戳 + ProjectId int64 `protobuf:"varint,19,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id +} + +func (x *CampaignInfoRes) Reset() { + *x = CampaignInfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignInfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignInfoRes) ProtoMessage() {} + +func (x *CampaignInfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[45] + 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 CampaignInfoRes.ProtoReflect.Descriptor instead. +func (*CampaignInfoRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{45} +} + +func (x *CampaignInfoRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CampaignInfoRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CampaignInfoRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CampaignInfoRes) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *CampaignInfoRes) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *CampaignInfoRes) GetFissionTitle() string { + if x != nil { + return x.FissionTitle + } + return "" +} + +func (x *CampaignInfoRes) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *CampaignInfoRes) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *CampaignInfoRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *CampaignInfoRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *CampaignInfoRes) GetLangTypes() []string { + if x != nil { + return x.LangTypes + } + return nil +} + +func (x *CampaignInfoRes) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *CampaignInfoRes) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +func (x *CampaignInfoRes) GetImgHost() string { + if x != nil { + return x.ImgHost + } + return "" +} + +func (x *CampaignInfoRes) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *CampaignInfoRes) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *CampaignInfoRes) GetStartAt() int64 { + if x != nil { + return x.StartAt + } + return 0 +} + +func (x *CampaignInfoRes) GetEndAt() int64 { + if x != nil { + return x.EndAt + } + return 0 +} + +func (x *CampaignInfoRes) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +type ShowRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + LevelMark string `protobuf:"bytes,3,opt,name=level_mark,json=levelMark,proto3" json:"level_mark,omitempty"` //用户标识 + ShowLang string `protobuf:"bytes,4,opt,name=show_lang,json=showLang,proto3" json:"show_lang,omitempty"` //奖品展示的语言标识 + CountryMark string `protobuf:"bytes,5,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 +} + +func (x *ShowRewardReq) Reset() { + *x = ShowRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRewardReq) ProtoMessage() {} + +func (x *ShowRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[46] + 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 ShowRewardReq.ProtoReflect.Descriptor instead. +func (*ShowRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{46} +} + +func (x *ShowRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ShowRewardReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ShowRewardReq) GetLevelMark() string { + if x != nil { + return x.LevelMark + } + return "" +} + +func (x *ShowRewardReq) GetShowLang() string { + if x != nil { + return x.ShowLang + } + return "" +} + +func (x *ShowRewardReq) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +type ShowRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*ShowRewardRes_Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //站内奖品 + RewardsWeb []*ShowRewardRes_Reward `protobuf:"bytes,2,rep,name=rewards_web,json=rewardsWeb,proto3" json:"rewards_web,omitempty"` //站外奖品 + RewardsExtra []*ShowRewardRes_Reward `protobuf:"bytes,3,rep,name=rewards_extra,json=rewardsExtra,proto3" json:"rewards_extra,omitempty"` //额外奖品 + RewardsNewcomer []*ShowRewardRes_Reward `protobuf:"bytes,4,rep,name=rewards_newcomer,json=rewardsNewcomer,proto3" json:"rewards_newcomer,omitempty"` //新人奖 +} + +func (x *ShowRewardRes) Reset() { + *x = ShowRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRewardRes) ProtoMessage() {} + +func (x *ShowRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[47] + 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 ShowRewardRes.ProtoReflect.Descriptor instead. +func (*ShowRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{47} +} + +func (x *ShowRewardRes) GetRewards() []*ShowRewardRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ShowRewardRes) GetRewardsWeb() []*ShowRewardRes_Reward { + if x != nil { + return x.RewardsWeb + } + return nil +} + +func (x *ShowRewardRes) GetRewardsExtra() []*ShowRewardRes_Reward { + if x != nil { + return x.RewardsExtra + } + return nil +} + +func (x *ShowRewardRes) GetRewardsNewcomer() []*ShowRewardRes_Reward { + if x != nil { + return x.RewardsNewcomer + } + return nil +} + +type AdsStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TemplateId string `protobuf:"bytes,1,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` //玩法模板ID + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目ID + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + PageTitle string `protobuf:"bytes,4,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + BgImg string `protobuf:"bytes,5,opt,name=bg_img,json=bgImg,proto3" json:"bg_img,omitempty"` //活动背景图 + DelayLinkData []*AdsStoreReq_KV `protobuf:"bytes,6,rep,name=delay_link_data,json=delayLinkData,proto3" json:"delay_link_data,omitempty"` //延迟深度链接自定义参数 + Rewards []*AdsStoreReq_Reward `protobuf:"bytes,7,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 + UserId int64 `protobuf:"varint,8,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //创建人id + Countdown int32 `protobuf:"varint,9,opt,name=countdown,proto3" json:"countdown,omitempty"` //倒计时 + Flip *AdsStoreReq_Flip `protobuf:"bytes,10,opt,name=flip,proto3" json:"flip,omitempty"` //翻牌配置(翻牌玩法必传) +} + +func (x *AdsStoreReq) Reset() { + *x = AdsStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStoreReq) ProtoMessage() {} + +func (x *AdsStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[48] + 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 AdsStoreReq.ProtoReflect.Descriptor instead. +func (*AdsStoreReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{48} +} + +func (x *AdsStoreReq) GetTemplateId() string { + if x != nil { + return x.TemplateId + } + return "" +} + +func (x *AdsStoreReq) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *AdsStoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsStoreReq) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *AdsStoreReq) GetBgImg() string { + if x != nil { + return x.BgImg + } + return "" +} + +func (x *AdsStoreReq) GetDelayLinkData() []*AdsStoreReq_KV { + if x != nil { + return x.DelayLinkData + } + return nil +} + +func (x *AdsStoreReq) GetRewards() []*AdsStoreReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *AdsStoreReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *AdsStoreReq) GetCountdown() int32 { + if x != nil { + return x.Countdown + } + return 0 +} + +func (x *AdsStoreReq) GetFlip() *AdsStoreReq_Flip { + if x != nil { + return x.Flip + } + return nil +} + +type AdsStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id +} + +func (x *AdsStoreRes) Reset() { + *x = AdsStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStoreRes) ProtoMessage() {} + +func (x *AdsStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[49] + 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 AdsStoreRes.ProtoReflect.Descriptor instead. +func (*AdsStoreRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{49} +} + +func (x *AdsStoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsStoreRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type AdsUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + PageTitle string `protobuf:"bytes,3,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + BgImg string `protobuf:"bytes,4,opt,name=bg_img,json=bgImg,proto3" json:"bg_img,omitempty"` //活动背景图 + DelayLinkData []*AdsUpdateReq_KV `protobuf:"bytes,5,rep,name=delay_link_data,json=delayLinkData,proto3" json:"delay_link_data,omitempty"` //延迟深度链接自定义参数 + Rewards []*AdsUpdateReq_Reward `protobuf:"bytes,6,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 + Countdown int32 `protobuf:"varint,7,opt,name=countdown,proto3" json:"countdown,omitempty"` //倒计时 + Flip *AdsUpdateReq_Flip `protobuf:"bytes,8,opt,name=flip,proto3" json:"flip,omitempty"` //翻牌配置(翻牌玩法必传) +} + +func (x *AdsUpdateReq) Reset() { + *x = AdsUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUpdateReq) ProtoMessage() {} + +func (x *AdsUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[50] + 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 AdsUpdateReq.ProtoReflect.Descriptor instead. +func (*AdsUpdateReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{50} +} + +func (x *AdsUpdateReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *AdsUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsUpdateReq) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *AdsUpdateReq) GetBgImg() string { + if x != nil { + return x.BgImg + } + return "" +} + +func (x *AdsUpdateReq) GetDelayLinkData() []*AdsUpdateReq_KV { + if x != nil { + return x.DelayLinkData + } + return nil +} + +func (x *AdsUpdateReq) GetRewards() []*AdsUpdateReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *AdsUpdateReq) GetCountdown() int32 { + if x != nil { + return x.Countdown + } + return 0 +} + +func (x *AdsUpdateReq) GetFlip() *AdsUpdateReq_Flip { + if x != nil { + return x.Flip + } + return nil +} + +type AdsUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id +} + +func (x *AdsUpdateRes) Reset() { + *x = AdsUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUpdateRes) ProtoMessage() {} + +func (x *AdsUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[51] + 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 AdsUpdateRes.ProtoReflect.Descriptor instead. +func (*AdsUpdateRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{51} +} + +func (x *AdsUpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsUpdateRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type AdsShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id +} + +func (x *AdsShowReq) Reset() { + *x = AdsShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsShowReq) ProtoMessage() {} + +func (x *AdsShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[52] + 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 AdsShowReq.ProtoReflect.Descriptor instead. +func (*AdsShowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{52} +} + +func (x *AdsShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type AdsShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + ProjectId int64 `protobuf:"varint,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //模版id + TempId int64 `protobuf:"varint,4,opt,name=temp_id,json=tempId,proto3" json:"temp_id,omitempty"` //模版id + TOffset int32 `protobuf:"varint,5,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + Target int32 `protobuf:"varint,6,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告) + TStart int64 `protobuf:"varint,7,opt,name=t_start,json=tStart,proto3" json:"t_start,omitempty"` //展示的开始时间时间戳 + TEnd int64 `protobuf:"varint,8,opt,name=t_end,json=tEnd,proto3" json:"t_end,omitempty"` //展示的结束时间时间戳 + FissionMark string `protobuf:"bytes,9,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //活动类型玩法标识 + Title string `protobuf:"bytes,10,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + CoverUrl string `protobuf:"bytes,11,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面地址 + PageTitle string `protobuf:"bytes,12,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + BgImg string `protobuf:"bytes,13,opt,name=bg_img,json=bgImg,proto3" json:"bg_img,omitempty"` //活动背景图 + Status int32 `protobuf:"varint,14,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) + DelayLinkData []*AdsShowRes_KV `protobuf:"bytes,15,rep,name=delay_link_data,json=delayLinkData,proto3" json:"delay_link_data,omitempty"` //延迟深度链接自定义参数 + Rewards []*AdsShowRes_Reward `protobuf:"bytes,16,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 + Countdown int32 `protobuf:"varint,17,opt,name=countdown,proto3" json:"countdown,omitempty"` //倒计时 + FissionId int64 `protobuf:"varint,18,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + Flip *AdsShowRes_Flip `protobuf:"bytes,19,opt,name=flip,proto3" json:"flip,omitempty"` //翻牌配置(翻牌玩法必传) +} + +func (x *AdsShowRes) Reset() { + *x = AdsShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsShowRes) ProtoMessage() {} + +func (x *AdsShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[53] + 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 AdsShowRes.ProtoReflect.Descriptor instead. +func (*AdsShowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{53} +} + +func (x *AdsShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsShowRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *AdsShowRes) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *AdsShowRes) GetTempId() int64 { + if x != nil { + return x.TempId + } + return 0 +} + +func (x *AdsShowRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *AdsShowRes) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *AdsShowRes) GetTStart() int64 { + if x != nil { + return x.TStart + } + return 0 +} + +func (x *AdsShowRes) GetTEnd() int64 { + if x != nil { + return x.TEnd + } + return 0 +} + +func (x *AdsShowRes) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *AdsShowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsShowRes) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *AdsShowRes) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *AdsShowRes) GetBgImg() string { + if x != nil { + return x.BgImg + } + return "" +} + +func (x *AdsShowRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *AdsShowRes) GetDelayLinkData() []*AdsShowRes_KV { + if x != nil { + return x.DelayLinkData + } + return nil +} + +func (x *AdsShowRes) GetRewards() []*AdsShowRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *AdsShowRes) GetCountdown() int32 { + if x != nil { + return x.Countdown + } + return 0 +} + +func (x *AdsShowRes) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *AdsShowRes) GetFlip() *AdsShowRes_Flip { + if x != nil { + return x.Flip + } + return nil +} + +type CampaignSelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Targets []int32 `protobuf:"varint,3,rep,packed,name=targets,proto3" json:"targets,omitempty"` //活动目标集合 + Child bool `protobuf:"varint,4,opt,name=child,proto3" json:"child,omitempty"` //子活动 + ChildWith string `protobuf:"bytes,5,opt,name=child_with,json=childWith,proto3" json:"child_with,omitempty"` //绑定子活动的活动id + ChildType int32 `protobuf:"varint,6,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务) + TempHashId string `protobuf:"bytes,7,opt,name=temp_hash_id,json=tempHashId,proto3" json:"temp_hash_id,omitempty"` //模版hash_id + Status []int32 `protobuf:"varint,8,rep,packed,name=status,proto3" json:"status,omitempty"` //活动状态(1-待发布,2-已发布,3-已下线,4-预发布) +} + +func (x *CampaignSelectReq) Reset() { + *x = CampaignSelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignSelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignSelectReq) ProtoMessage() {} + +func (x *CampaignSelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[54] + 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 CampaignSelectReq.ProtoReflect.Descriptor instead. +func (*CampaignSelectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{54} +} + +func (x *CampaignSelectReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *CampaignSelectReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *CampaignSelectReq) GetTargets() []int32 { + if x != nil { + return x.Targets + } + return nil +} + +func (x *CampaignSelectReq) GetChild() bool { + if x != nil { + return x.Child + } + return false +} + +func (x *CampaignSelectReq) GetChildWith() string { + if x != nil { + return x.ChildWith + } + return "" +} + +func (x *CampaignSelectReq) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *CampaignSelectReq) GetTempHashId() string { + if x != nil { + return x.TempHashId + } + return "" +} + +func (x *CampaignSelectReq) GetStatus() []int32 { + if x != nil { + return x.Status + } + return nil +} + +type CampaignSelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CampaignSelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *CampaignSelectRes) Reset() { + *x = CampaignSelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignSelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignSelectRes) ProtoMessage() {} + +func (x *CampaignSelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[55] + 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 CampaignSelectRes.ProtoReflect.Descriptor instead. +func (*CampaignSelectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{55} +} + +func (x *CampaignSelectRes) GetList() []*CampaignSelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type RewardDetailReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id +} + +func (x *RewardDetailReq) Reset() { + *x = RewardDetailReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailReq) ProtoMessage() {} + +func (x *RewardDetailReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[56] + 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 RewardDetailReq.ProtoReflect.Descriptor instead. +func (*RewardDetailReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{56} +} + +func (x *RewardDetailReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type RewardDetailRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardGroup int32 `protobuf:"varint,1,opt,name=reward_group,json=rewardGroup,proto3" json:"reward_group,omitempty"` //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + Normal []*RewardDetailRes_Reward `protobuf:"bytes,2,rep,name=normal,proto3" json:"normal,omitempty"` //常规奖品 + UserLevel []*RewardDetailRes_UserLevelOne `protobuf:"bytes,3,rep,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` //用户类型奖品 + Langs []*RewardDetailRes_LangOne `protobuf:"bytes,4,rep,name=langs,proto3" json:"langs,omitempty"` //语言奖品 + LangUserLevel []*RewardDetailRes_LangUserLevelOne `protobuf:"bytes,5,rep,name=lang_user_level,json=langUserLevel,proto3" json:"lang_user_level,omitempty"` //语言+用户类型奖品 + Country []*RewardDetailRes_CountryOne `protobuf:"bytes,6,rep,name=country,proto3" json:"country,omitempty"` //国家奖品 + StepReward []*RewardDetailRes_Reward `protobuf:"bytes,7,rep,name=step_reward,json=stepReward,proto3" json:"step_reward,omitempty"` //阶梯奖品 + ExtraReward []*RewardDetailRes_Reward `protobuf:"bytes,8,rep,name=extra_reward,json=extraReward,proto3" json:"extra_reward,omitempty"` //额外奖品 + NewcomerReward []*RewardDetailRes_Reward `protobuf:"bytes,9,rep,name=newcomer_reward,json=newcomerReward,proto3" json:"newcomer_reward,omitempty"` //新人奖品 + All int64 `protobuf:"varint,10,opt,name=all,proto3" json:"all,omitempty"` //活动总预算 + AllUse int64 `protobuf:"varint,11,opt,name=all_use,json=allUse,proto3" json:"all_use,omitempty"` //已使用的活动预算 + RewardType []string `protobuf:"bytes,12,rep,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品tab集合(app-活动主奖品,app_sign-签到活动主奖品,extra-额外奖品,step-阶梯奖,newcomer-新人奖,pool-奖池记录,task-任务奖励) + ShowAll int32 `protobuf:"varint,13,opt,name=show_all,json=showAll,proto3" json:"show_all,omitempty"` //是否展示总预算模块(0-否,1-是) + ShowSelect int32 `protobuf:"varint,14,opt,name=show_select,json=showSelect,proto3" json:"show_select,omitempty"` //是否显示选择数(0-否,1-是) + TaskReward []*RewardDetailRes_Reward `protobuf:"bytes,15,rep,name=task_reward,json=taskReward,proto3" json:"task_reward,omitempty"` //任务奖品 + Pools []*RewardDetailRes_Pool `protobuf:"bytes,16,rep,name=pools,proto3" json:"pools,omitempty"` //奖池记录 + Schedules []*RewardDetailRes_Schedule `protobuf:"bytes,17,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛程记录 + UnoCards []*RewardDetailRes_UnoCard `protobuf:"bytes,18,rep,name=uno_cards,json=unoCards,proto3" json:"uno_cards,omitempty"` //uno卡牌奖励 +} + +func (x *RewardDetailRes) Reset() { + *x = RewardDetailRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes) ProtoMessage() {} + +func (x *RewardDetailRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[57] + 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 RewardDetailRes.ProtoReflect.Descriptor instead. +func (*RewardDetailRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57} +} + +func (x *RewardDetailRes) GetRewardGroup() int32 { + if x != nil { + return x.RewardGroup + } + return 0 +} + +func (x *RewardDetailRes) GetNormal() []*RewardDetailRes_Reward { + if x != nil { + return x.Normal + } + return nil +} + +func (x *RewardDetailRes) GetUserLevel() []*RewardDetailRes_UserLevelOne { + if x != nil { + return x.UserLevel + } + return nil +} + +func (x *RewardDetailRes) GetLangs() []*RewardDetailRes_LangOne { + if x != nil { + return x.Langs + } + return nil +} + +func (x *RewardDetailRes) GetLangUserLevel() []*RewardDetailRes_LangUserLevelOne { + if x != nil { + return x.LangUserLevel + } + return nil +} + +func (x *RewardDetailRes) GetCountry() []*RewardDetailRes_CountryOne { + if x != nil { + return x.Country + } + return nil +} + +func (x *RewardDetailRes) GetStepReward() []*RewardDetailRes_Reward { + if x != nil { + return x.StepReward + } + return nil +} + +func (x *RewardDetailRes) GetExtraReward() []*RewardDetailRes_Reward { + if x != nil { + return x.ExtraReward + } + return nil +} + +func (x *RewardDetailRes) GetNewcomerReward() []*RewardDetailRes_Reward { + if x != nil { + return x.NewcomerReward + } + return nil +} + +func (x *RewardDetailRes) GetAll() int64 { + if x != nil { + return x.All + } + return 0 +} + +func (x *RewardDetailRes) GetAllUse() int64 { + if x != nil { + return x.AllUse + } + return 0 +} + +func (x *RewardDetailRes) GetRewardType() []string { + if x != nil { + return x.RewardType + } + return nil +} + +func (x *RewardDetailRes) GetShowAll() int32 { + if x != nil { + return x.ShowAll + } + return 0 +} + +func (x *RewardDetailRes) GetShowSelect() int32 { + if x != nil { + return x.ShowSelect + } + return 0 +} + +func (x *RewardDetailRes) GetTaskReward() []*RewardDetailRes_Reward { + if x != nil { + return x.TaskReward + } + return nil +} + +func (x *RewardDetailRes) GetPools() []*RewardDetailRes_Pool { + if x != nil { + return x.Pools + } + return nil +} + +func (x *RewardDetailRes) GetSchedules() []*RewardDetailRes_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *RewardDetailRes) GetUnoCards() []*RewardDetailRes_UnoCard { + if x != nil { + return x.UnoCards + } + return nil +} + +type UpdateStockReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Stock int32 `protobuf:"varint,2,opt,name=stock,proto3" json:"stock,omitempty"` //修改的库存值 + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //修改的 + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` //ip地址 +} + +func (x *UpdateStockReq) Reset() { + *x = UpdateStockReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateStockReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateStockReq) ProtoMessage() {} + +func (x *UpdateStockReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[58] + 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 UpdateStockReq.ProtoReflect.Descriptor instead. +func (*UpdateStockReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{58} +} + +func (x *UpdateStockReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateStockReq) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *UpdateStockReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UpdateStockReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type UpdateStockRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateStockRes) Reset() { + *x = UpdateStockRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateStockRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateStockRes) ProtoMessage() {} + +func (x *UpdateStockRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[59] + 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 UpdateStockRes.ProtoReflect.Descriptor instead. +func (*UpdateStockRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{59} +} + +type CampaignTzReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id +} + +func (x *CampaignTzReq) Reset() { + *x = CampaignTzReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignTzReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignTzReq) ProtoMessage() {} + +func (x *CampaignTzReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[60] + 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 CampaignTzReq.ProtoReflect.Descriptor instead. +func (*CampaignTzReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{60} +} + +func (x *CampaignTzReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type CampaignTzRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CampaignTzRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //语言数据 +} + +func (x *CampaignTzRes) Reset() { + *x = CampaignTzRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignTzRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignTzRes) ProtoMessage() {} + +func (x *CampaignTzRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[61] + 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 CampaignTzRes.ProtoReflect.Descriptor instead. +func (*CampaignTzRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{61} +} + +func (x *CampaignTzRes) GetList() []*CampaignTzRes_One { + if x != nil { + return x.List + } + return nil +} + +type CampaignRewardTypeReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id +} + +func (x *CampaignRewardTypeReq) Reset() { + *x = CampaignRewardTypeReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignRewardTypeReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignRewardTypeReq) ProtoMessage() {} + +func (x *CampaignRewardTypeReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[62] + 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 CampaignRewardTypeReq.ProtoReflect.Descriptor instead. +func (*CampaignRewardTypeReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{62} +} + +func (x *CampaignRewardTypeReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type CampaignRewardTypeRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CampaignRewardTypeRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //语言数据 +} + +func (x *CampaignRewardTypeRes) Reset() { + *x = CampaignRewardTypeRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignRewardTypeRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignRewardTypeRes) ProtoMessage() {} + +func (x *CampaignRewardTypeRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[63] + 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 CampaignRewardTypeRes.ProtoReflect.Descriptor instead. +func (*CampaignRewardTypeRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{63} +} + +func (x *CampaignRewardTypeRes) GetList() []*CampaignRewardTypeRes_One { + if x != nil { + return x.List + } + return nil +} + +type ChildListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ProjectId int64 `protobuf:"varint,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + ProjectHashId string `protobuf:"bytes,4,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //活动标题筛选 + Status []int32 `protobuf:"varint,6,rep,packed,name=status,proto3" json:"status,omitempty"` //活动状态(1-待发布,2-已发布,3-已下线) + ChildType []int32 `protobuf:"varint,7,rep,packed,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + FissionId []int64 `protobuf:"varint,8,rep,packed,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //活动类型标识 + CampaignId []int64 `protobuf:"varint,9,rep,packed,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //绑定的活动id + Start int64 `protobuf:"varint,10,opt,name=start,proto3" json:"start,omitempty"` //活动时间开始时间戳 + End int64 `protobuf:"varint,11,opt,name=end,proto3" json:"end,omitempty"` //活动时间结束时间戳 + Pids []int64 `protobuf:"varint,12,rep,packed,name=pids,proto3" json:"pids,omitempty"` //上级活动id +} + +func (x *ChildListReq) Reset() { + *x = ChildListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListReq) ProtoMessage() {} + +func (x *ChildListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[64] + 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 ChildListReq.ProtoReflect.Descriptor instead. +func (*ChildListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{64} +} + +func (x *ChildListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ChildListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ChildListReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ChildListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ChildListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildListReq) GetStatus() []int32 { + if x != nil { + return x.Status + } + return nil +} + +func (x *ChildListReq) GetChildType() []int32 { + if x != nil { + return x.ChildType + } + return nil +} + +func (x *ChildListReq) GetFissionId() []int64 { + if x != nil { + return x.FissionId + } + return nil +} + +func (x *ChildListReq) GetCampaignId() []int64 { + if x != nil { + return x.CampaignId + } + return nil +} + +func (x *ChildListReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ChildListReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *ChildListReq) GetPids() []int64 { + if x != nil { + return x.Pids + } + return nil +} + +type ChildListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ChildListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ChildListRes) Reset() { + *x = ChildListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListRes) ProtoMessage() {} + +func (x *ChildListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[65] + 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 ChildListRes.ProtoReflect.Descriptor instead. +func (*ChildListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{65} +} + +func (x *ChildListRes) GetList() []*ChildListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ChildListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ChildStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id + Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` //操作ip + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + FissionId int64 `protobuf:"varint,5,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + StartTime int64 `protobuf:"varint,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + ChildType int32 `protobuf:"varint,8,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + PlayType int32 `protobuf:"varint,9,opt,name=play_type,json=playType,proto3" json:"play_type,omitempty"` //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率) + Rewards []*ChildStoreReq_Reward `protobuf:"bytes,10,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 + Win_1 *ChildStoreReq_TaskGroup `protobuf:"bytes,11,opt,name=win_1,json=win1,proto3" json:"win_1,omitempty"` //任务组1 + Win_2 *ChildStoreReq_TaskGroup `protobuf:"bytes,12,opt,name=win_2,json=win2,proto3" json:"win_2,omitempty"` //任务组2 + Win_3 *ChildStoreReq_TaskGroup `protobuf:"bytes,13,opt,name=win_3,json=win3,proto3" json:"win_3,omitempty"` //任务组3 +} + +func (x *ChildStoreReq) Reset() { + *x = ChildStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildStoreReq) ProtoMessage() {} + +func (x *ChildStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[66] + 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 ChildStoreReq.ProtoReflect.Descriptor instead. +func (*ChildStoreReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{66} +} + +func (x *ChildStoreReq) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ChildStoreReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChildStoreReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *ChildStoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildStoreReq) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ChildStoreReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ChildStoreReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ChildStoreReq) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *ChildStoreReq) GetPlayType() int32 { + if x != nil { + return x.PlayType + } + return 0 +} + +func (x *ChildStoreReq) GetRewards() []*ChildStoreReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ChildStoreReq) GetWin_1() *ChildStoreReq_TaskGroup { + if x != nil { + return x.Win_1 + } + return nil +} + +func (x *ChildStoreReq) GetWin_2() *ChildStoreReq_TaskGroup { + if x != nil { + return x.Win_2 + } + return nil +} + +func (x *ChildStoreReq) GetWin_3() *ChildStoreReq_TaskGroup { + if x != nil { + return x.Win_3 + } + return nil +} + +type ChildStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id +} + +func (x *ChildStoreRes) Reset() { + *x = ChildStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildStoreRes) ProtoMessage() {} + +func (x *ChildStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[67] + 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 ChildStoreRes.ProtoReflect.Descriptor instead. +func (*ChildStoreRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{67} +} + +func (x *ChildStoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildStoreRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ChildUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` //操作ip + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + FissionId int64 `protobuf:"varint,6,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + StartTime int64 `protobuf:"varint,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,8,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + ChildType int32 `protobuf:"varint,9,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + PlayType int32 `protobuf:"varint,10,opt,name=play_type,json=playType,proto3" json:"play_type,omitempty"` //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率) + Rewards []*ChildUpdateReq_Reward `protobuf:"bytes,11,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 + Win_1 *ChildUpdateReq_TaskGroup `protobuf:"bytes,12,opt,name=win_1,json=win1,proto3" json:"win_1,omitempty"` //任务组1 + Win_2 *ChildUpdateReq_TaskGroup `protobuf:"bytes,13,opt,name=win_2,json=win2,proto3" json:"win_2,omitempty"` //任务组2 + Win_3 *ChildUpdateReq_TaskGroup `protobuf:"bytes,14,opt,name=win_3,json=win3,proto3" json:"win_3,omitempty"` //任务组3 +} + +func (x *ChildUpdateReq) Reset() { + *x = ChildUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildUpdateReq) ProtoMessage() {} + +func (x *ChildUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[68] + 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 ChildUpdateReq.ProtoReflect.Descriptor instead. +func (*ChildUpdateReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{68} +} + +func (x *ChildUpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildUpdateReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChildUpdateReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChildUpdateReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *ChildUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildUpdateReq) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ChildUpdateReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ChildUpdateReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ChildUpdateReq) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *ChildUpdateReq) GetPlayType() int32 { + if x != nil { + return x.PlayType + } + return 0 +} + +func (x *ChildUpdateReq) GetRewards() []*ChildUpdateReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ChildUpdateReq) GetWin_1() *ChildUpdateReq_TaskGroup { + if x != nil { + return x.Win_1 + } + return nil +} + +func (x *ChildUpdateReq) GetWin_2() *ChildUpdateReq_TaskGroup { + if x != nil { + return x.Win_2 + } + return nil +} + +func (x *ChildUpdateReq) GetWin_3() *ChildUpdateReq_TaskGroup { + if x != nil { + return x.Win_3 + } + return nil +} + +type ChildUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id +} + +func (x *ChildUpdateRes) Reset() { + *x = ChildUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildUpdateRes) ProtoMessage() {} + +func (x *ChildUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[69] + 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 ChildUpdateRes.ProtoReflect.Descriptor instead. +func (*ChildUpdateRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{69} +} + +func (x *ChildUpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildUpdateRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ChildShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动id +} + +func (x *ChildShowReq) Reset() { + *x = ChildShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildShowReq) ProtoMessage() {} + +func (x *ChildShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[70] + 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 ChildShowReq.ProtoReflect.Descriptor instead. +func (*ChildShowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{70} +} + +func (x *ChildShowReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ChildShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + FissionId int64 `protobuf:"varint,2,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + TStart int64 `protobuf:"varint,3,opt,name=t_start,json=tStart,proto3" json:"t_start,omitempty"` //开始时间时间戳 + TEnd int64 `protobuf:"varint,4,opt,name=t_end,json=tEnd,proto3" json:"t_end,omitempty"` //结束时间时间戳 + ChildType int32 `protobuf:"varint,5,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + PlayType int32 `protobuf:"varint,6,opt,name=play_type,json=playType,proto3" json:"play_type,omitempty"` //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率) + Rewards []*ChildShowRes_Reward `protobuf:"bytes,7,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 + Win_1 *ChildShowRes_TaskGroup `protobuf:"bytes,8,opt,name=win_1,json=win1,proto3" json:"win_1,omitempty"` //任务组1 + Win_2 *ChildShowRes_TaskGroup `protobuf:"bytes,9,opt,name=win_2,json=win2,proto3" json:"win_2,omitempty"` //任务组2 + Win_3 *ChildShowRes_TaskGroup `protobuf:"bytes,10,opt,name=win_3,json=win3,proto3" json:"win_3,omitempty"` //任务组3 +} + +func (x *ChildShowRes) Reset() { + *x = ChildShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildShowRes) ProtoMessage() {} + +func (x *ChildShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[71] + 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 ChildShowRes.ProtoReflect.Descriptor instead. +func (*ChildShowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{71} +} + +func (x *ChildShowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildShowRes) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ChildShowRes) GetTStart() int64 { + if x != nil { + return x.TStart + } + return 0 +} + +func (x *ChildShowRes) GetTEnd() int64 { + if x != nil { + return x.TEnd + } + return 0 +} + +func (x *ChildShowRes) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *ChildShowRes) GetPlayType() int32 { + if x != nil { + return x.PlayType + } + return 0 +} + +func (x *ChildShowRes) GetRewards() []*ChildShowRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ChildShowRes) GetWin_1() *ChildShowRes_TaskGroup { + if x != nil { + return x.Win_1 + } + return nil +} + +func (x *ChildShowRes) GetWin_2() *ChildShowRes_TaskGroup { + if x != nil { + return x.Win_2 + } + return nil +} + +func (x *ChildShowRes) GetWin_3() *ChildShowRes_TaskGroup { + if x != nil { + return x.Win_3 + } + return nil +} + +type TaskCenterJumpReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CenterHashId string `protobuf:"bytes,1,opt,name=center_hash_id,json=centerHashId,proto3" json:"center_hash_id,omitempty"` //任务中心hash_id + ModuleId int64 `protobuf:"varint,2,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"` //模块id + CpnIds []int64 `protobuf:"varint,3,rep,packed,name=cpn_ids,json=cpnIds,proto3" json:"cpn_ids,omitempty"` //活动id +} + +func (x *TaskCenterJumpReq) Reset() { + *x = TaskCenterJumpReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskCenterJumpReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskCenterJumpReq) ProtoMessage() {} + +func (x *TaskCenterJumpReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[72] + 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 TaskCenterJumpReq.ProtoReflect.Descriptor instead. +func (*TaskCenterJumpReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{72} +} + +func (x *TaskCenterJumpReq) GetCenterHashId() string { + if x != nil { + return x.CenterHashId + } + return "" +} + +func (x *TaskCenterJumpReq) GetModuleId() int64 { + if x != nil { + return x.ModuleId + } + return 0 +} + +func (x *TaskCenterJumpReq) GetCpnIds() []int64 { + if x != nil { + return x.CpnIds + } + return nil +} + +type TaskCenterJumpRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*TaskCenterJumpRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *TaskCenterJumpRes) Reset() { + *x = TaskCenterJumpRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskCenterJumpRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskCenterJumpRes) ProtoMessage() {} + +func (x *TaskCenterJumpRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[73] + 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 TaskCenterJumpRes.ProtoReflect.Descriptor instead. +func (*TaskCenterJumpRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{73} +} + +func (x *TaskCenterJumpRes) GetList() []*TaskCenterJumpRes_One { + if x != nil { + return x.List + } + return nil +} + +type CondListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` //任务id +} + +func (x *CondListReq) Reset() { + *x = CondListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CondListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CondListReq) ProtoMessage() {} + +func (x *CondListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[74] + 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 CondListReq.ProtoReflect.Descriptor instead. +func (*CondListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{74} +} + +func (x *CondListReq) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +type CondListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CondListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //数据集合 +} + +func (x *CondListRes) Reset() { + *x = CondListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CondListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CondListRes) ProtoMessage() {} + +func (x *CondListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[75] + 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 CondListRes.ProtoReflect.Descriptor instead. +func (*CondListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{75} +} + +func (x *CondListRes) GetList() []*CondListRes_One { + if x != nil { + return x.List + } + return nil +} + +type CampaignsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + CampaignIds []int64 `protobuf:"varint,2,rep,packed,name=campaign_ids,json=campaignIds,proto3" json:"campaign_ids,omitempty"` //活动集合 +} + +func (x *CampaignsReq) Reset() { + *x = CampaignsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignsReq) ProtoMessage() {} + +func (x *CampaignsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[76] + 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 CampaignsReq.ProtoReflect.Descriptor instead. +func (*CampaignsReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{76} +} + +func (x *CampaignsReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *CampaignsReq) GetCampaignIds() []int64 { + if x != nil { + return x.CampaignIds + } + return nil +} + +type CampaignsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CampaignsRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *CampaignsRes) Reset() { + *x = CampaignsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignsRes) ProtoMessage() {} + +func (x *CampaignsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[77] + 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 CampaignsRes.ProtoReflect.Descriptor instead. +func (*CampaignsRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{77} +} + +func (x *CampaignsRes) GetList() []*CampaignsRes_One { + if x != nil { + return x.List + } + return nil +} + +type SetLvApiReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + UrlId int64 `protobuf:"varint,2,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //地址id +} + +func (x *SetLvApiReq) Reset() { + *x = SetLvApiReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetLvApiReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetLvApiReq) ProtoMessage() {} + +func (x *SetLvApiReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[78] + 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 SetLvApiReq.ProtoReflect.Descriptor instead. +func (*SetLvApiReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{78} +} + +func (x *SetLvApiReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SetLvApiReq) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +type SetLvApiRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetLvApiRes) Reset() { + *x = SetLvApiRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[79] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetLvApiRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetLvApiRes) ProtoMessage() {} + +func (x *SetLvApiRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[79] + 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 SetLvApiRes.ProtoReflect.Descriptor instead. +func (*SetLvApiRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{79} +} + +type GetLvApiReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *GetLvApiReq) Reset() { + *x = GetLvApiReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[80] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLvApiReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLvApiReq) ProtoMessage() {} + +func (x *GetLvApiReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[80] + 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 GetLvApiReq.ProtoReflect.Descriptor instead. +func (*GetLvApiReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{80} +} + +func (x *GetLvApiReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type GetLvApiRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UrlId int64 `protobuf:"varint,1,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //地址id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //地址备注 +} + +func (x *GetLvApiRes) Reset() { + *x = GetLvApiRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLvApiRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLvApiRes) ProtoMessage() {} + +func (x *GetLvApiRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[81] + 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 GetLvApiRes.ProtoReflect.Descriptor instead. +func (*GetLvApiRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{81} +} + +func (x *GetLvApiRes) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *GetLvApiRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type VsSettlementReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + ScheduleId int64 `protobuf:"varint,2,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"` //赛事id + WinTeamId int64 `protobuf:"varint,3,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //胜利队伍id + Scores []*VsSettlementReq_Score `protobuf:"bytes,4,rep,name=scores,proto3" json:"scores,omitempty"` //队伍得分 +} + +func (x *VsSettlementReq) Reset() { + *x = VsSettlementReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[82] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementReq) ProtoMessage() {} + +func (x *VsSettlementReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[82] + 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 VsSettlementReq.ProtoReflect.Descriptor instead. +func (*VsSettlementReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{82} +} + +func (x *VsSettlementReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *VsSettlementReq) GetScheduleId() int64 { + if x != nil { + return x.ScheduleId + } + return 0 +} + +func (x *VsSettlementReq) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *VsSettlementReq) GetScores() []*VsSettlementReq_Score { + if x != nil { + return x.Scores + } + return nil +} + +type VsSettlementRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScheduleId int32 `protobuf:"varint,1,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"` //赛程id + PkTeam *VsSettlementRes_PkTeam `protobuf:"bytes,2,opt,name=pk_team,json=pkTeam,proto3" json:"pk_team,omitempty"` //比赛数据 +} + +func (x *VsSettlementRes) Reset() { + *x = VsSettlementRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[83] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementRes) ProtoMessage() {} + +func (x *VsSettlementRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[83] + 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 VsSettlementRes.ProtoReflect.Descriptor instead. +func (*VsSettlementRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{83} +} + +func (x *VsSettlementRes) GetScheduleId() int32 { + if x != nil { + return x.ScheduleId + } + return 0 +} + +func (x *VsSettlementRes) GetPkTeam() *VsSettlementRes_PkTeam { + if x != nil { + return x.PkTeam + } + return nil +} + +type VsSettlementInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + ScheduleId int64 `protobuf:"varint,2,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"` //赛事id +} + +func (x *VsSettlementInfoReq) Reset() { + *x = VsSettlementInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementInfoReq) ProtoMessage() {} + +func (x *VsSettlementInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[84] + 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 VsSettlementInfoReq.ProtoReflect.Descriptor instead. +func (*VsSettlementInfoReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{84} +} + +func (x *VsSettlementInfoReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *VsSettlementInfoReq) GetScheduleId() int64 { + if x != nil { + return x.ScheduleId + } + return 0 +} + +type VsSettlementInfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WinType int32 `protobuf:"varint,1,opt,name=win_type,json=winType,proto3" json:"win_type,omitempty"` //结算获奖类型(1-队伍胜利,2-平局) + WinTeamId int64 `protobuf:"varint,2,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //胜利队伍id + Teams []*VsSettlementInfoRes_Team `protobuf:"bytes,3,rep,name=teams,proto3" json:"teams,omitempty"` //队伍数据 +} + +func (x *VsSettlementInfoRes) Reset() { + *x = VsSettlementInfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[85] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementInfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementInfoRes) ProtoMessage() {} + +func (x *VsSettlementInfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[85] + 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 VsSettlementInfoRes.ProtoReflect.Descriptor instead. +func (*VsSettlementInfoRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{85} +} + +func (x *VsSettlementInfoRes) GetWinType() int32 { + if x != nil { + return x.WinType + } + return 0 +} + +func (x *VsSettlementInfoRes) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *VsSettlementInfoRes) GetTeams() []*VsSettlementInfoRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +type ActionListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *ActionListReq) Reset() { + *x = ActionListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[86] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionListReq) ProtoMessage() {} + +func (x *ActionListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[86] + 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 ActionListReq.ProtoReflect.Descriptor instead. +func (*ActionListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{86} +} + +func (x *ActionListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ActionListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ActionTypes []int32 `protobuf:"varint,1,rep,packed,name=action_types,json=actionTypes,proto3" json:"action_types,omitempty"` //行为集合 +} + +func (x *ActionListRes) Reset() { + *x = ActionListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[87] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionListRes) ProtoMessage() {} + +func (x *ActionListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[87] + 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 ActionListRes.ProtoReflect.Descriptor instead. +func (*ActionListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{87} +} + +func (x *ActionListRes) GetActionTypes() []int32 { + if x != nil { + return x.ActionTypes + } + return nil +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + CoverUrl string `protobuf:"bytes,4,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //活动封面 + TempGroupMark string `protobuf:"bytes,5,opt,name=temp_group_mark,json=tempGroupMark,proto3" json:"temp_group_mark,omitempty"` //模版组标识 + TempHashId string `protobuf:"bytes,6,opt,name=temp_hash_id,json=tempHashId,proto3" json:"temp_hash_id,omitempty"` //模版hash_id + FissionId int64 `protobuf:"varint,7,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法ID + FissionMark string `protobuf:"bytes,8,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //活动类型玩法标识 + StartTime int64 `protobuf:"varint,9,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,10,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + ShareLink string `protobuf:"bytes,11,opt,name=share_link,json=shareLink,proto3" json:"share_link,omitempty"` //分享链接 + VisitorNum int64 `protobuf:"varint,12,opt,name=visitor_num,json=visitorNum,proto3" json:"visitor_num,omitempty"` //访问人数 + DownloadNum int64 `protobuf:"varint,13,opt,name=download_num,json=downloadNum,proto3" json:"download_num,omitempty"` //新增下载数 + Status int32 `protobuf:"varint,14,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + ViewLink string `protobuf:"bytes,15,opt,name=view_link,json=viewLink,proto3" json:"view_link,omitempty"` //预览地址 + TOffset int32 `protobuf:"varint,16,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + LangTypes []int32 `protobuf:"varint,17,rep,packed,name=lang_types,json=langTypes,proto3" json:"lang_types,omitempty"` //支持的语种 + TempLangType int32 `protobuf:"varint,18,opt,name=temp_lang_type,json=tempLangType,proto3" json:"temp_lang_type,omitempty"` //模版支持语言 + Target int32 `protobuf:"varint,19,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告) + HasWeb int32 `protobuf:"varint,20,opt,name=has_web,json=hasWeb,proto3" json:"has_web,omitempty"` //是否有站外活动(0-否,1-是) + HasWarmUp int32 `protobuf:"varint,21,opt,name=has_warm_up,json=hasWarmUp,proto3" json:"has_warm_up,omitempty"` //是否开启预热(0-否,1-是) + PreRunTime int64 `protobuf:"varint,22,opt,name=pre_run_time,json=preRunTime,proto3" json:"pre_run_time,omitempty"` //预发布转正式发布时间戳 + AdsType int32 `protobuf:"varint,23,opt,name=ads_type,json=adsType,proto3" json:"ads_type,omitempty"` //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + NewReport bool `protobuf:"varint,24,opt,name=new_report,json=newReport,proto3" json:"new_report,omitempty"` //是否使用新报表 + LangTz []*ListRes_LangTz `protobuf:"bytes,25,rep,name=lang_tz,json=langTz,proto3" json:"lang_tz,omitempty"` //语言时区数据是 + CreatedAt int64 `protobuf:"varint,26,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + WhileList []string `protobuf:"bytes,27,rep,name=while_list,json=whileList,proto3" json:"while_list,omitempty"` //白名单用户id列表 + UpdatedAt int64 `protobuf:"varint,28,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` //更新时间 + ChannelList []*ListRes_Channel `protobuf:"bytes,29,rep,name=channel_list,json=channelList,proto3" json:"channel_list,omitempty"` //渠道列表 + CondList []*ListRes_Cond `protobuf:"bytes,30,rep,name=cond_list,json=condList,proto3" json:"cond_list,omitempty"` //任务列表 + CreatorName string `protobuf:"bytes,31,opt,name=creator_name,json=creatorName,proto3" json:"creator_name,omitempty"` //活动创建者在后台的名称 + CreatorAccount string `protobuf:"bytes,32,opt,name=creator_account,json=creatorAccount,proto3" json:"creator_account,omitempty"` //活动创建者在后台的登陆账号 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[88] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[88] + 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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_One) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *ListRes_One) GetTempGroupMark() string { + if x != nil { + return x.TempGroupMark + } + return "" +} + +func (x *ListRes_One) GetTempHashId() string { + if x != nil { + return x.TempHashId + } + return "" +} + +func (x *ListRes_One) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ListRes_One) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *ListRes_One) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ListRes_One) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ListRes_One) GetShareLink() string { + if x != nil { + return x.ShareLink + } + return "" +} + +func (x *ListRes_One) GetVisitorNum() int64 { + if x != nil { + return x.VisitorNum + } + return 0 +} + +func (x *ListRes_One) GetDownloadNum() int64 { + if x != nil { + return x.DownloadNum + } + return 0 +} + +func (x *ListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ListRes_One) GetViewLink() string { + if x != nil { + return x.ViewLink + } + return "" +} + +func (x *ListRes_One) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ListRes_One) GetLangTypes() []int32 { + if x != nil { + return x.LangTypes + } + return nil +} + +func (x *ListRes_One) GetTempLangType() int32 { + if x != nil { + return x.TempLangType + } + return 0 +} + +func (x *ListRes_One) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *ListRes_One) GetHasWeb() int32 { + if x != nil { + return x.HasWeb + } + return 0 +} + +func (x *ListRes_One) GetHasWarmUp() int32 { + if x != nil { + return x.HasWarmUp + } + return 0 +} + +func (x *ListRes_One) GetPreRunTime() int64 { + if x != nil { + return x.PreRunTime + } + return 0 +} + +func (x *ListRes_One) GetAdsType() int32 { + if x != nil { + return x.AdsType + } + return 0 +} + +func (x *ListRes_One) GetNewReport() bool { + if x != nil { + return x.NewReport + } + return false +} + +func (x *ListRes_One) GetLangTz() []*ListRes_LangTz { + if x != nil { + return x.LangTz + } + return nil +} + +func (x *ListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ListRes_One) GetWhileList() []string { + if x != nil { + return x.WhileList + } + return nil +} + +func (x *ListRes_One) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *ListRes_One) GetChannelList() []*ListRes_Channel { + if x != nil { + return x.ChannelList + } + return nil +} + +func (x *ListRes_One) GetCondList() []*ListRes_Cond { + if x != nil { + return x.CondList + } + return nil +} + +func (x *ListRes_One) GetCreatorName() string { + if x != nil { + return x.CreatorName + } + return "" +} + +func (x *ListRes_One) GetCreatorAccount() string { + if x != nil { + return x.CreatorAccount + } + return "" +} + +type ListRes_LangTz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //对应语言标识 + TOffset int32 `protobuf:"varint,2,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + LangType int32 `protobuf:"varint,4,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言数字标识 +} + +func (x *ListRes_LangTz) Reset() { + *x = ListRes_LangTz{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[89] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_LangTz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_LangTz) ProtoMessage() {} + +func (x *ListRes_LangTz) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[89] + 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 ListRes_LangTz.ProtoReflect.Descriptor instead. +func (*ListRes_LangTz) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *ListRes_LangTz) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ListRes_LangTz) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ListRes_LangTz) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ListRes_LangTz) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +type ListRes_Channel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //渠道标题 + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` //渠道链接 + CType int32 `protobuf:"varint,3,opt,name=c_type,json=cType,proto3" json:"c_type,omitempty"` //渠道类型(1-站内渠道,2-站外渠道) +} + +func (x *ListRes_Channel) Reset() { + *x = ListRes_Channel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[90] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Channel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Channel) ProtoMessage() {} + +func (x *ListRes_Channel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[90] + 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 ListRes_Channel.ProtoReflect.Descriptor instead. +func (*ListRes_Channel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *ListRes_Channel) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_Channel) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ListRes_Channel) GetCType() int32 { + if x != nil { + return x.CType + } + return 0 +} + +type ListRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` //事件 + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` //事件key + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //事件key对应的值 +} + +func (x *ListRes_Cond) Reset() { + *x = ListRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[91] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Cond) ProtoMessage() {} + +func (x *ListRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[91] + 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 ListRes_Cond.ProtoReflect.Descriptor instead. +func (*ListRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{1, 3} +} + +func (x *ListRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *ListRes_Cond) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ListRes_Cond) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type ShareRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //标题 + Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` //图标 + Scheme string `protobuf:"bytes,4,opt,name=scheme,proto3" json:"scheme,omitempty"` //Scheme + IosScheme string `protobuf:"bytes,5,opt,name=ios_scheme,json=iosScheme,proto3" json:"ios_scheme,omitempty"` //ios Scheme +} + +func (x *ShareRes_One) Reset() { + *x = ShareRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[92] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShareRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShareRes_One) ProtoMessage() {} + +func (x *ShareRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[92] + 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 ShareRes_One.ProtoReflect.Descriptor instead. +func (*ShareRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ShareRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShareRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShareRes_One) GetLogo() string { + if x != nil { + return x.Logo + } + return "" +} + +func (x *ShareRes_One) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + +func (x *ShareRes_One) GetIosScheme() string { + if x != nil { + return x.IosScheme + } + return "" +} + +type StoreReq_GashaponStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + MachineImg string `protobuf:"bytes,4,opt,name=machine_img,json=machineImg,proto3" json:"machine_img,omitempty"` //机器图 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + EggType int32 `protobuf:"varint,6,opt,name=egg_type,json=eggType,proto3" json:"egg_type,omitempty"` //类型 + EggImgs []string `protobuf:"bytes,7,rep,name=egg_imgs,json=eggImgs,proto3" json:"egg_imgs,omitempty"` //扭蛋素材 +} + +func (x *StoreReq_GashaponStyle) Reset() { + *x = StoreReq_GashaponStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[93] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_GashaponStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_GashaponStyle) ProtoMessage() {} + +func (x *StoreReq_GashaponStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[93] + 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 StoreReq_GashaponStyle.ProtoReflect.Descriptor instead. +func (*StoreReq_GashaponStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *StoreReq_GashaponStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *StoreReq_GashaponStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *StoreReq_GashaponStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *StoreReq_GashaponStyle) GetMachineImg() string { + if x != nil { + return x.MachineImg + } + return "" +} + +func (x *StoreReq_GashaponStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *StoreReq_GashaponStyle) GetEggType() int32 { + if x != nil { + return x.EggType + } + return 0 +} + +func (x *StoreReq_GashaponStyle) GetEggImgs() []string { + if x != nil { + return x.EggImgs + } + return nil +} + +type StoreReq_Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FirstVisit *StoreReq_EventOne `protobuf:"bytes,1,opt,name=first_visit,json=firstVisit,proto3" json:"first_visit,omitempty"` //首次访问 +} + +func (x *StoreReq_Event) Reset() { + *x = StoreReq_Event{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[94] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Event) ProtoMessage() {} + +func (x *StoreReq_Event) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[94] + 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 StoreReq_Event.ProtoReflect.Descriptor instead. +func (*StoreReq_Event) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 1} +} + +func (x *StoreReq_Event) GetFirstVisit() *StoreReq_EventOne { + if x != nil { + return x.FirstVisit + } + return nil +} + +type StoreReq_EventOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + Rewards []*StoreReq_EventReward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖励 +} + +func (x *StoreReq_EventOne) Reset() { + *x = StoreReq_EventOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[95] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_EventOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_EventOne) ProtoMessage() {} + +func (x *StoreReq_EventOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[95] + 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 StoreReq_EventOne.ProtoReflect.Descriptor instead. +func (*StoreReq_EventOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 2} +} + +func (x *StoreReq_EventOne) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_EventOne) GetRewards() []*StoreReq_EventReward { + if x != nil { + return x.Rewards + } + return nil +} + +type StoreReq_EventReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PropMark string `protobuf:"bytes,1,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward *StoreReq_Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 + ExpiredDay string `protobuf:"bytes,4,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 +} + +func (x *StoreReq_EventReward) Reset() { + *x = StoreReq_EventReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[96] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_EventReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_EventReward) ProtoMessage() {} + +func (x *StoreReq_EventReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[96] + 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 StoreReq_EventReward.ProtoReflect.Descriptor instead. +func (*StoreReq_EventReward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 3} +} + +func (x *StoreReq_EventReward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *StoreReq_EventReward) GetReward() *StoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *StoreReq_EventReward) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_EventReward) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +type StoreReq_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖次数 + PropMarks []string `protobuf:"bytes,2,rep,name=prop_marks,json=propMarks,proto3" json:"prop_marks,omitempty"` //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌) + Red *StoreReq_UnoGroup `protobuf:"bytes,3,opt,name=red,proto3" json:"red,omitempty"` //红牌配置 + Yellow *StoreReq_UnoGroup `protobuf:"bytes,4,opt,name=yellow,proto3" json:"yellow,omitempty"` //黄牌配置 + Blue *StoreReq_UnoGroup `protobuf:"bytes,5,opt,name=blue,proto3" json:"blue,omitempty"` //黑牌配置 + Green *StoreReq_UnoGroup `protobuf:"bytes,6,opt,name=green,proto3" json:"green,omitempty"` //绿牌配置 +} + +func (x *StoreReq_Uno) Reset() { + *x = StoreReq_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[97] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Uno) ProtoMessage() {} + +func (x *StoreReq_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[97] + 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 StoreReq_Uno.ProtoReflect.Descriptor instead. +func (*StoreReq_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 4} +} + +func (x *StoreReq_Uno) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_Uno) GetPropMarks() []string { + if x != nil { + return x.PropMarks + } + return nil +} + +func (x *StoreReq_Uno) GetRed() *StoreReq_UnoGroup { + if x != nil { + return x.Red + } + return nil +} + +func (x *StoreReq_Uno) GetYellow() *StoreReq_UnoGroup { + if x != nil { + return x.Yellow + } + return nil +} + +func (x *StoreReq_Uno) GetBlue() *StoreReq_UnoGroup { + if x != nil { + return x.Blue + } + return nil +} + +func (x *StoreReq_Uno) GetGreen() *StoreReq_UnoGroup { + if x != nil { + return x.Green + } + return nil +} + +type StoreReq_UnoGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Odds string `protobuf:"bytes,1,opt,name=odds,proto3" json:"odds,omitempty"` //获得牌型概率 + Reward *StoreReq_Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + OpenRule int32 `protobuf:"varint,3,opt,name=open_rule,json=openRule,proto3" json:"open_rule,omitempty"` //是否开启得牌规则(0-否,1-是) + LimitRule *StoreReq_UnoLimitRule `protobuf:"bytes,4,opt,name=limit_rule,json=limitRule,proto3" json:"limit_rule,omitempty"` //得牌规则 + CustomCard int32 `protobuf:"varint,5,opt,name=custom_card,json=customCard,proto3" json:"custom_card,omitempty"` //自定义卡牌(0-否,1-是) + Cards []*StoreReq_UnoCard `protobuf:"bytes,6,rep,name=cards,proto3" json:"cards,omitempty"` //自定义卡牌 +} + +func (x *StoreReq_UnoGroup) Reset() { + *x = StoreReq_UnoGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[98] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_UnoGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_UnoGroup) ProtoMessage() {} + +func (x *StoreReq_UnoGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[98] + 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 StoreReq_UnoGroup.ProtoReflect.Descriptor instead. +func (*StoreReq_UnoGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 5} +} + +func (x *StoreReq_UnoGroup) GetOdds() string { + if x != nil { + return x.Odds + } + return "" +} + +func (x *StoreReq_UnoGroup) GetReward() *StoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *StoreReq_UnoGroup) GetOpenRule() int32 { + if x != nil { + return x.OpenRule + } + return 0 +} + +func (x *StoreReq_UnoGroup) GetLimitRule() *StoreReq_UnoLimitRule { + if x != nil { + return x.LimitRule + } + return nil +} + +func (x *StoreReq_UnoGroup) GetCustomCard() int32 { + if x != nil { + return x.CustomCard + } + return 0 +} + +func (x *StoreReq_UnoGroup) GetCards() []*StoreReq_UnoCard { + if x != nil { + return x.Cards + } + return nil +} + +type StoreReq_UnoLimitRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitNum int32 `protobuf:"varint,1,opt,name=init_num,json=initNum,proto3" json:"init_num,omitempty"` //初始的最大可获得牌型数 + SignDay int32 `protobuf:"varint,2,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + AddNum int32 `protobuf:"varint,3,opt,name=add_num,json=addNum,proto3" json:"add_num,omitempty"` //完成条件可获得最大牌型数 + ResetType int32 `protobuf:"varint,4,opt,name=reset_type,json=resetType,proto3" json:"reset_type,omitempty"` //重置规则(1-不重置,2-获奖后重置) +} + +func (x *StoreReq_UnoLimitRule) Reset() { + *x = StoreReq_UnoLimitRule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[99] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_UnoLimitRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_UnoLimitRule) ProtoMessage() {} + +func (x *StoreReq_UnoLimitRule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[99] + 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 StoreReq_UnoLimitRule.ProtoReflect.Descriptor instead. +func (*StoreReq_UnoLimitRule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 6} +} + +func (x *StoreReq_UnoLimitRule) GetInitNum() int32 { + if x != nil { + return x.InitNum + } + return 0 +} + +func (x *StoreReq_UnoLimitRule) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *StoreReq_UnoLimitRule) GetAddNum() int32 { + if x != nil { + return x.AddNum + } + return 0 +} + +func (x *StoreReq_UnoLimitRule) GetResetType() int32 { + if x != nil { + return x.ResetType + } + return 0 +} + +type StoreReq_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //跳转按钮文案 + ImgUrl string `protobuf:"bytes,2,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,3,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web跳转地址 + AppParam string `protobuf:"bytes,4,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App跳转参数 + PcParam string `protobuf:"bytes,5,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc跳转参数 +} + +func (x *StoreReq_UnoCard) Reset() { + *x = StoreReq_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[100] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_UnoCard) ProtoMessage() {} + +func (x *StoreReq_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[100] + 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 StoreReq_UnoCard.ProtoReflect.Descriptor instead. +func (*StoreReq_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 7} +} + +func (x *StoreReq_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq_UnoCard) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *StoreReq_UnoCard) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *StoreReq_UnoCard) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *StoreReq_UnoCard) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type StoreReq_Vs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始投票次数 + EachLimitNum int32 `protobuf:"varint,2,opt,name=each_limit_num,json=eachLimitNum,proto3" json:"each_limit_num,omitempty"` //每场可投票次数 + OpenPoint int32 `protobuf:"varint,3,opt,name=open_point,json=openPoint,proto3" json:"open_point,omitempty"` //是否开启积分(0-否,1-是) + PointsNum int32 `protobuf:"varint,4,opt,name=points_num,json=pointsNum,proto3" json:"points_num,omitempty"` //投票扣除积分数 + MallOpen int32 `protobuf:"varint,5,opt,name=mall_open,json=mallOpen,proto3" json:"mall_open,omitempty"` //是否使用积分商城(0-否,1-是) + MallId int64 `protobuf:"varint,6,opt,name=mall_id,json=mallId,proto3" json:"mall_id,omitempty"` //兑换商城id + VsTz int32 `protobuf:"varint,7,opt,name=vs_tz,json=vsTz,proto3" json:"vs_tz,omitempty"` //比赛时区 + ClaimType int32 `protobuf:"varint,8,opt,name=claim_type,json=claimType,proto3" json:"claim_type,omitempty"` //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + Schedules []*StoreReq_Schedule `protobuf:"bytes,9,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛事时间表 + IconMall string `protobuf:"bytes,10,opt,name=icon_mall,json=iconMall,proto3" json:"icon_mall,omitempty"` //商城图标 + IconReward string `protobuf:"bytes,11,opt,name=icon_reward,json=iconReward,proto3" json:"icon_reward,omitempty"` //奖励记录图标 + IconSchedule string `protobuf:"bytes,12,opt,name=icon_schedule,json=iconSchedule,proto3" json:"icon_schedule,omitempty"` //赛程图标 +} + +func (x *StoreReq_Vs) Reset() { + *x = StoreReq_Vs{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[101] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Vs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Vs) ProtoMessage() {} + +func (x *StoreReq_Vs) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[101] + 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 StoreReq_Vs.ProtoReflect.Descriptor instead. +func (*StoreReq_Vs) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 8} +} + +func (x *StoreReq_Vs) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_Vs) GetEachLimitNum() int32 { + if x != nil { + return x.EachLimitNum + } + return 0 +} + +func (x *StoreReq_Vs) GetOpenPoint() int32 { + if x != nil { + return x.OpenPoint + } + return 0 +} + +func (x *StoreReq_Vs) GetPointsNum() int32 { + if x != nil { + return x.PointsNum + } + return 0 +} + +func (x *StoreReq_Vs) GetMallOpen() int32 { + if x != nil { + return x.MallOpen + } + return 0 +} + +func (x *StoreReq_Vs) GetMallId() int64 { + if x != nil { + return x.MallId + } + return 0 +} + +func (x *StoreReq_Vs) GetVsTz() int32 { + if x != nil { + return x.VsTz + } + return 0 +} + +func (x *StoreReq_Vs) GetClaimType() int32 { + if x != nil { + return x.ClaimType + } + return 0 +} + +func (x *StoreReq_Vs) GetSchedules() []*StoreReq_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *StoreReq_Vs) GetIconMall() string { + if x != nil { + return x.IconMall + } + return "" +} + +func (x *StoreReq_Vs) GetIconReward() string { + if x != nil { + return x.IconReward + } + return "" +} + +func (x *StoreReq_Vs) GetIconSchedule() string { + if x != nil { + return x.IconSchedule + } + return "" +} + +type StoreReq_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PkTeams []*StoreReq_PkTeam `protobuf:"bytes,1,rep,name=pk_teams,json=pkTeams,proto3" json:"pk_teams,omitempty"` //队伍 +} + +func (x *StoreReq_Schedule) Reset() { + *x = StoreReq_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[102] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Schedule) ProtoMessage() {} + +func (x *StoreReq_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[102] + 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 StoreReq_Schedule.ProtoReflect.Descriptor instead. +func (*StoreReq_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 9} +} + +func (x *StoreReq_Schedule) GetPkTeams() []*StoreReq_PkTeam { + if x != nil { + return x.PkTeams + } + return nil +} + +type StoreReq_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Teams []*StoreReq_Team `protobuf:"bytes,1,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + VoteStart string `protobuf:"bytes,2,opt,name=vote_start,json=voteStart,proto3" json:"vote_start,omitempty"` //开始时间 + VoteEnd string `protobuf:"bytes,3,opt,name=vote_end,json=voteEnd,proto3" json:"vote_end,omitempty"` //结束时间 + VsDate string `protobuf:"bytes,4,opt,name=vs_date,json=vsDate,proto3" json:"vs_date,omitempty"` //比赛开始时间 + VsImg string `protobuf:"bytes,5,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //比赛图 + Desc string `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` //标题描述 + PropMark string `protobuf:"bytes,7,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(reward-奖品,point-积分) + RewardId int64 `protobuf:"varint,8,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库奖品id + PropNum int32 `protobuf:"varint,9,opt,name=prop_num,json=propNum,proto3" json:"prop_num,omitempty"` //道具数量 + ExpiredDay string `protobuf:"bytes,10,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + OtherVote []string `protobuf:"bytes,11,rep,name=other_vote,json=otherVote,proto3" json:"other_vote,omitempty"` //其他投票方式 + OpenOdds int32 `protobuf:"varint,12,opt,name=open_odds,json=openOdds,proto3" json:"open_odds,omitempty"` //是否开启赔率(0-否,1-是) + OddsLeft string `protobuf:"bytes,13,opt,name=odds_left,json=oddsLeft,proto3" json:"odds_left,omitempty"` //左边赔率 + OddsRight string `protobuf:"bytes,14,opt,name=odds_right,json=oddsRight,proto3" json:"odds_right,omitempty"` //右边赔率 + OddsDraw string `protobuf:"bytes,15,opt,name=odds_draw,json=oddsDraw,proto3" json:"odds_draw,omitempty"` //平局赔率 +} + +func (x *StoreReq_PkTeam) Reset() { + *x = StoreReq_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[103] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_PkTeam) ProtoMessage() {} + +func (x *StoreReq_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[103] + 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 StoreReq_PkTeam.ProtoReflect.Descriptor instead. +func (*StoreReq_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 10} +} + +func (x *StoreReq_PkTeam) GetTeams() []*StoreReq_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *StoreReq_PkTeam) GetVoteStart() string { + if x != nil { + return x.VoteStart + } + return "" +} + +func (x *StoreReq_PkTeam) GetVoteEnd() string { + if x != nil { + return x.VoteEnd + } + return "" +} + +func (x *StoreReq_PkTeam) GetVsDate() string { + if x != nil { + return x.VsDate + } + return "" +} + +func (x *StoreReq_PkTeam) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *StoreReq_PkTeam) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *StoreReq_PkTeam) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *StoreReq_PkTeam) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *StoreReq_PkTeam) GetPropNum() int32 { + if x != nil { + return x.PropNum + } + return 0 +} + +func (x *StoreReq_PkTeam) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *StoreReq_PkTeam) GetOtherVote() []string { + if x != nil { + return x.OtherVote + } + return nil +} + +func (x *StoreReq_PkTeam) GetOpenOdds() int32 { + if x != nil { + return x.OpenOdds + } + return 0 +} + +func (x *StoreReq_PkTeam) GetOddsLeft() string { + if x != nil { + return x.OddsLeft + } + return "" +} + +func (x *StoreReq_PkTeam) GetOddsRight() string { + if x != nil { + return x.OddsRight + } + return "" +} + +func (x *StoreReq_PkTeam) GetOddsDraw() string { + if x != nil { + return x.OddsDraw + } + return "" +} + +type StoreReq_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,2,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *StoreReq_Team) Reset() { + *x = StoreReq_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[104] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Team) ProtoMessage() {} + +func (x *StoreReq_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[104] + 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 StoreReq_Team.ProtoReflect.Descriptor instead. +func (*StoreReq_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 11} +} + +func (x *StoreReq_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StoreReq_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type StoreReq_Chat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启ai陪伴(0-关闭,1-开启) + HeaderImg string `protobuf:"bytes,2,opt,name=header_img,json=headerImg,proto3" json:"header_img,omitempty"` //宠物头像 + ChatBg string `protobuf:"bytes,3,opt,name=chat_bg,json=chatBg,proto3" json:"chat_bg,omitempty"` //聊天背景 + DayLimit int32 `protobuf:"varint,4,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日聊天上限 +} + +func (x *StoreReq_Chat) Reset() { + *x = StoreReq_Chat{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[105] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Chat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Chat) ProtoMessage() {} + +func (x *StoreReq_Chat) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[105] + 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 StoreReq_Chat.ProtoReflect.Descriptor instead. +func (*StoreReq_Chat) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 12} +} + +func (x *StoreReq_Chat) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_Chat) GetHeaderImg() string { + if x != nil { + return x.HeaderImg + } + return "" +} + +func (x *StoreReq_Chat) GetChatBg() string { + if x != nil { + return x.ChatBg + } + return "" +} + +func (x *StoreReq_Chat) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +type StoreReq_PointsUse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启积分消耗(0-否,1-是) + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` //积分icon图 + UrlId int64 `protobuf:"varint,3,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + UseNum int32 `protobuf:"varint,4,opt,name=use_num,json=useNum,proto3" json:"use_num,omitempty"` //单次兑换使用积分数量 + DayLimit int32 `protobuf:"varint,5,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日可兑换次数 + TotalLimit int32 `protobuf:"varint,6,opt,name=total_limit,json=totalLimit,proto3" json:"total_limit,omitempty"` //总兑换次数 +} + +func (x *StoreReq_PointsUse) Reset() { + *x = StoreReq_PointsUse{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[106] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_PointsUse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_PointsUse) ProtoMessage() {} + +func (x *StoreReq_PointsUse) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[106] + 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 StoreReq_PointsUse.ProtoReflect.Descriptor instead. +func (*StoreReq_PointsUse) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 13} +} + +func (x *StoreReq_PointsUse) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_PointsUse) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *StoreReq_PointsUse) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *StoreReq_PointsUse) GetUseNum() int32 { + if x != nil { + return x.UseNum + } + return 0 +} + +func (x *StoreReq_PointsUse) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *StoreReq_PointsUse) GetTotalLimit() int32 { + if x != nil { + return x.TotalLimit + } + return 0 +} + +type StoreReq_FlipStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `protobuf:"bytes,4,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + CardImg string `protobuf:"bytes,6,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡片素材 +} + +func (x *StoreReq_FlipStyle) Reset() { + *x = StoreReq_FlipStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[107] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_FlipStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_FlipStyle) ProtoMessage() {} + +func (x *StoreReq_FlipStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[107] + 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 StoreReq_FlipStyle.ProtoReflect.Descriptor instead. +func (*StoreReq_FlipStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 14} +} + +func (x *StoreReq_FlipStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *StoreReq_FlipStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *StoreReq_FlipStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *StoreReq_FlipStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *StoreReq_FlipStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *StoreReq_FlipStyle) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +type StoreReq_GridStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `protobuf:"bytes,4,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + DisablePlayImg string `protobuf:"bytes,6,opt,name=disable_play_img,json=disablePlayImg,proto3" json:"disable_play_img,omitempty"` //Go按钮禁用 + MachineImg string `protobuf:"bytes,7,opt,name=machine_img,json=machineImg,proto3" json:"machine_img,omitempty"` //机器图 + GridImg string `protobuf:"bytes,8,opt,name=grid_img,json=gridImg,proto3" json:"grid_img,omitempty"` //方格图 + ActivateImg string `protobuf:"bytes,9,opt,name=activate_img,json=activateImg,proto3" json:"activate_img,omitempty"` //方格激活图 +} + +func (x *StoreReq_GridStyle) Reset() { + *x = StoreReq_GridStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[108] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_GridStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_GridStyle) ProtoMessage() {} + +func (x *StoreReq_GridStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[108] + 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 StoreReq_GridStyle.ProtoReflect.Descriptor instead. +func (*StoreReq_GridStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 15} +} + +func (x *StoreReq_GridStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *StoreReq_GridStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *StoreReq_GridStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *StoreReq_GridStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *StoreReq_GridStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *StoreReq_GridStyle) GetDisablePlayImg() string { + if x != nil { + return x.DisablePlayImg + } + return "" +} + +func (x *StoreReq_GridStyle) GetMachineImg() string { + if x != nil { + return x.MachineImg + } + return "" +} + +func (x *StoreReq_GridStyle) GetGridImg() string { + if x != nil { + return x.GridImg + } + return "" +} + +func (x *StoreReq_GridStyle) GetActivateImg() string { + if x != nil { + return x.ActivateImg + } + return "" +} + +type StoreReq_WheelStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + Bottom1 string `protobuf:"bytes,4,opt,name=bottom1,proto3" json:"bottom1,omitempty"` //底部颜色1 + Bottom2 string `protobuf:"bytes,5,opt,name=bottom2,proto3" json:"bottom2,omitempty"` //底部颜色2 + Bottom3 string `protobuf:"bytes,6,opt,name=bottom3,proto3" json:"bottom3,omitempty"` //底部颜色3 + Pointer string `protobuf:"bytes,7,opt,name=pointer,proto3" json:"pointer,omitempty"` //指针图片 + PlayBtn string `protobuf:"bytes,8,opt,name=play_btn,json=playBtn,proto3" json:"play_btn,omitempty"` //玩法按钮图片 + BorderImg string `protobuf:"bytes,9,opt,name=border_img,json=borderImg,proto3" json:"border_img,omitempty"` //边框图片 + ButtonColor string `protobuf:"bytes,10,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + WheelTextColor string `protobuf:"bytes,11,opt,name=wheel_text_color,json=wheelTextColor,proto3" json:"wheel_text_color,omitempty"` //转盘文字颜色 +} + +func (x *StoreReq_WheelStyle) Reset() { + *x = StoreReq_WheelStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[109] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_WheelStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_WheelStyle) ProtoMessage() {} + +func (x *StoreReq_WheelStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[109] + 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 StoreReq_WheelStyle.ProtoReflect.Descriptor instead. +func (*StoreReq_WheelStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 16} +} + +func (x *StoreReq_WheelStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *StoreReq_WheelStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *StoreReq_WheelStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *StoreReq_WheelStyle) GetBottom1() string { + if x != nil { + return x.Bottom1 + } + return "" +} + +func (x *StoreReq_WheelStyle) GetBottom2() string { + if x != nil { + return x.Bottom2 + } + return "" +} + +func (x *StoreReq_WheelStyle) GetBottom3() string { + if x != nil { + return x.Bottom3 + } + return "" +} + +func (x *StoreReq_WheelStyle) GetPointer() string { + if x != nil { + return x.Pointer + } + return "" +} + +func (x *StoreReq_WheelStyle) GetPlayBtn() string { + if x != nil { + return x.PlayBtn + } + return "" +} + +func (x *StoreReq_WheelStyle) GetBorderImg() string { + if x != nil { + return x.BorderImg + } + return "" +} + +func (x *StoreReq_WheelStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *StoreReq_WheelStyle) GetWheelTextColor() string { + if x != nil { + return x.WheelTextColor + } + return "" +} + +type StoreReq_Child struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + ChildType int32 `protobuf:"varint,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 +} + +func (x *StoreReq_Child) Reset() { + *x = StoreReq_Child{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[110] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Child) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Child) ProtoMessage() {} + +func (x *StoreReq_Child) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[110] + 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 StoreReq_Child.ProtoReflect.Descriptor instead. +func (*StoreReq_Child) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 17} +} + +func (x *StoreReq_Child) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *StoreReq_Child) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +type StoreReq_Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RuleTextColor string `protobuf:"bytes,1,opt,name=rule_text_color,json=ruleTextColor,proto3" json:"rule_text_color,omitempty"` //规则文字颜色 + RuleBgColor string `protobuf:"bytes,2,opt,name=rule_bg_color,json=ruleBgColor,proto3" json:"rule_bg_color,omitempty"` //规则背景颜色 + ShareText string `protobuf:"bytes,3,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,4,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + HasRank int32 `protobuf:"varint,5,opt,name=has_rank,json=hasRank,proto3" json:"has_rank,omitempty"` //是否展示中奖纪录(1-是,0-否) + RankBackgroundColor string `protobuf:"bytes,6,opt,name=rank_background_color,json=rankBackgroundColor,proto3" json:"rank_background_color,omitempty"` //排行榜背景颜色 + RankTextColor string `protobuf:"bytes,7,opt,name=rank_text_color,json=rankTextColor,proto3" json:"rank_text_color,omitempty"` //排行榜背景颜色 + DownloadPageImage string `protobuf:"bytes,8,opt,name=download_page_image,json=downloadPageImage,proto3" json:"download_page_image,omitempty"` //下载引导页的图片 + IsDefaultDownload int32 `protobuf:"varint,9,opt,name=is_default_download,json=isDefaultDownload,proto3" json:"is_default_download,omitempty"` //是否使用默认下载图(1-是,0-否) + WechatPageImage string `protobuf:"bytes,10,opt,name=wechat_page_image,json=wechatPageImage,proto3" json:"wechat_page_image,omitempty"` //微信引导页的图片 + IsDefaultWechat int32 `protobuf:"varint,11,opt,name=is_default_wechat,json=isDefaultWechat,proto3" json:"is_default_wechat,omitempty"` //是否使用默认微信引导图(1-是,0-否) + ImageMain string `protobuf:"bytes,12,opt,name=image_main,json=imageMain,proto3" json:"image_main,omitempty"` //活动主图 + IsDefaultMain int32 `protobuf:"varint,13,opt,name=is_default_main,json=isDefaultMain,proto3" json:"is_default_main,omitempty"` //是否使用默认活动主图(1-是,0-否) + ImagePreview string `protobuf:"bytes,14,opt,name=image_preview,json=imagePreview,proto3" json:"image_preview,omitempty"` //问题页背景图 + LinkBtnTextColor string `protobuf:"bytes,15,opt,name=link_btn_text_color,json=linkBtnTextColor,proto3" json:"link_btn_text_color,omitempty"` //分享链接按钮文字颜色 + LinkBtnBgColor string `protobuf:"bytes,16,opt,name=link_btn_bg_color,json=linkBtnBgColor,proto3" json:"link_btn_bg_color,omitempty"` //分享链接按钮背景颜色 + LinkTextColor string `protobuf:"bytes,17,opt,name=link_text_color,json=linkTextColor,proto3" json:"link_text_color,omitempty"` //分享链接文字颜色 + ShowShare int32 `protobuf:"varint,18,opt,name=show_share,json=showShare,proto3" json:"show_share,omitempty"` //是否显示分享社交媒体(0-否,1-是) + Share []int64 `protobuf:"varint,19,rep,packed,name=share,proto3" json:"share,omitempty"` //要分享的社交媒体,例如[1,2,3] + PlayRule string `protobuf:"bytes,20,opt,name=play_rule,json=playRule,proto3" json:"play_rule,omitempty"` //玩法规则 + PageTitle string `protobuf:"bytes,21,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + DmShow int32 `protobuf:"varint,22,opt,name=dm_show,json=dmShow,proto3" json:"dm_show,omitempty"` //是否显示弹幕(0-否,1-是) + WebBgImg string `protobuf:"bytes,23,opt,name=web_bg_img,json=webBgImg,proto3" json:"web_bg_img,omitempty"` //站外活动背景图 + HasWarmUp int32 `protobuf:"varint,24,opt,name=has_warm_up,json=hasWarmUp,proto3" json:"has_warm_up,omitempty"` //是否预热(0-否,1-是) + WarmUpImg string `protobuf:"bytes,25,opt,name=warm_up_img,json=warmUpImg,proto3" json:"warm_up_img,omitempty"` //预热海报图 + WarmUpEnd int32 `protobuf:"varint,26,opt,name=warm_up_end,json=warmUpEnd,proto3" json:"warm_up_end,omitempty"` //活动开始前多少分钟结束预热 + IconType int32 `protobuf:"varint,27,opt,name=icon_type,json=iconType,proto3" json:"icon_type,omitempty"` //活动挂件类型(用于前端挂件选用判断) + IconBgColor string `protobuf:"bytes,28,opt,name=icon_bg_color,json=iconBgColor,proto3" json:"icon_bg_color,omitempty"` //活动挂件背景色 + DlType int32 `protobuf:"varint,29,opt,name=dl_type,json=dlType,proto3" json:"dl_type,omitempty"` //下载引导页类型(1-通用,2-自定义多媒体) + DlBannerType int32 `protobuf:"varint,30,opt,name=dl_banner_type,json=dlBannerType,proto3" json:"dl_banner_type,omitempty"` //下载页横幅类型(1-默认,2-自定义) + DlBannerImg string `protobuf:"bytes,31,opt,name=dl_banner_img,json=dlBannerImg,proto3" json:"dl_banner_img,omitempty"` //下载页横幅自定义图 + DlBannerAppLogo string `protobuf:"bytes,32,opt,name=dl_banner_app_logo,json=dlBannerAppLogo,proto3" json:"dl_banner_app_logo,omitempty"` //下载页横幅applogo图片 + DlBannerAppName string `protobuf:"bytes,33,opt,name=dl_banner_app_name,json=dlBannerAppName,proto3" json:"dl_banner_app_name,omitempty"` //下载页横幅app名称 + DlBannerAppBtn string `protobuf:"bytes,34,opt,name=dl_banner_app_btn,json=dlBannerAppBtn,proto3" json:"dl_banner_app_btn,omitempty"` //下载页横幅app按钮文案 + DlBannerPosition int32 `protobuf:"varint,35,opt,name=dl_banner_position,json=dlBannerPosition,proto3" json:"dl_banner_position,omitempty"` //下载页横幅位置(1-顶部,2-底部) + TopicColor string `protobuf:"bytes,36,opt,name=topic_color,json=topicColor,proto3" json:"topic_color,omitempty"` //主题色 + WindowCover int32 `protobuf:"varint,37,opt,name=window_cover,json=windowCover,proto3" json:"window_cover,omitempty"` //是否显示弹幕(0-否,1-是) + IconOpen []int32 `protobuf:"varint,38,rep,packed,name=icon_open,json=iconOpen,proto3" json:"icon_open,omitempty"` //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3] + HasWhite int32 `protobuf:"varint,39,opt,name=has_white,json=hasWhite,proto3" json:"has_white,omitempty"` //是否开启白名单(0-否,1-是) + WhiteList string `protobuf:"bytes,40,opt,name=white_list,json=whiteList,proto3" json:"white_list,omitempty"` //白名单列表(多个用英文;分割) + PcBg string `protobuf:"bytes,41,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc适配背景图 + AdsType int32 `protobuf:"varint,42,opt,name=ads_type,json=adsType,proto3" json:"ads_type,omitempty"` //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + LinkTempId string `protobuf:"bytes,43,opt,name=link_temp_id,json=linkTempId,proto3" json:"link_temp_id,omitempty"` //链接模板id + RuleTimeOpen int32 `protobuf:"varint,44,opt,name=rule_time_open,json=ruleTimeOpen,proto3" json:"rule_time_open,omitempty"` //是否展示规则中的活动时间(0-否,1-是) + OutsideTask int32 `protobuf:"varint,45,opt,name=outside_task,json=outsideTask,proto3" json:"outside_task,omitempty"` //是否外显任务(0-否,1-是) + IconTextColor string `protobuf:"bytes,46,opt,name=icon_text_color,json=iconTextColor,proto3" json:"icon_text_color,omitempty"` //活动挂件字体色 + OpenShare int32 `protobuf:"varint,47,opt,name=open_share,json=openShare,proto3" json:"open_share,omitempty"` //是否启用分享模块(0-否,1-是) + ShowToUse int32 `protobuf:"varint,48,opt,name=show_to_use,json=showToUse,proto3" json:"show_to_use,omitempty"` //是否展示奖品弹窗的去使用(0-不展示,1-展示) + RuleType int32 `protobuf:"varint,49,opt,name=rule_type,json=ruleType,proto3" json:"rule_type,omitempty"` //规则展示类型(0-文本,1-图片) + RuleImg string `protobuf:"bytes,50,opt,name=rule_img,json=ruleImg,proto3" json:"rule_img,omitempty"` //规则展示图 + RuleOutside int32 `protobuf:"varint,51,opt,name=rule_outside,json=ruleOutside,proto3" json:"rule_outside,omitempty"` //规则是否外显(0-否,1-是) + DeviceOnce int32 `protobuf:"varint,52,opt,name=device_once,json=deviceOnce,proto3" json:"device_once,omitempty"` //设备唯一(0-否,1-是) +} + +func (x *StoreReq_Config) Reset() { + *x = StoreReq_Config{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[111] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Config) ProtoMessage() {} + +func (x *StoreReq_Config) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[111] + 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 StoreReq_Config.ProtoReflect.Descriptor instead. +func (*StoreReq_Config) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 18} +} + +func (x *StoreReq_Config) GetRuleTextColor() string { + if x != nil { + return x.RuleTextColor + } + return "" +} + +func (x *StoreReq_Config) GetRuleBgColor() string { + if x != nil { + return x.RuleBgColor + } + return "" +} + +func (x *StoreReq_Config) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *StoreReq_Config) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *StoreReq_Config) GetHasRank() int32 { + if x != nil { + return x.HasRank + } + return 0 +} + +func (x *StoreReq_Config) GetRankBackgroundColor() string { + if x != nil { + return x.RankBackgroundColor + } + return "" +} + +func (x *StoreReq_Config) GetRankTextColor() string { + if x != nil { + return x.RankTextColor + } + return "" +} + +func (x *StoreReq_Config) GetDownloadPageImage() string { + if x != nil { + return x.DownloadPageImage + } + return "" +} + +func (x *StoreReq_Config) GetIsDefaultDownload() int32 { + if x != nil { + return x.IsDefaultDownload + } + return 0 +} + +func (x *StoreReq_Config) GetWechatPageImage() string { + if x != nil { + return x.WechatPageImage + } + return "" +} + +func (x *StoreReq_Config) GetIsDefaultWechat() int32 { + if x != nil { + return x.IsDefaultWechat + } + return 0 +} + +func (x *StoreReq_Config) GetImageMain() string { + if x != nil { + return x.ImageMain + } + return "" +} + +func (x *StoreReq_Config) GetIsDefaultMain() int32 { + if x != nil { + return x.IsDefaultMain + } + return 0 +} + +func (x *StoreReq_Config) GetImagePreview() string { + if x != nil { + return x.ImagePreview + } + return "" +} + +func (x *StoreReq_Config) GetLinkBtnTextColor() string { + if x != nil { + return x.LinkBtnTextColor + } + return "" +} + +func (x *StoreReq_Config) GetLinkBtnBgColor() string { + if x != nil { + return x.LinkBtnBgColor + } + return "" +} + +func (x *StoreReq_Config) GetLinkTextColor() string { + if x != nil { + return x.LinkTextColor + } + return "" +} + +func (x *StoreReq_Config) GetShowShare() int32 { + if x != nil { + return x.ShowShare + } + return 0 +} + +func (x *StoreReq_Config) GetShare() []int64 { + if x != nil { + return x.Share + } + return nil +} + +func (x *StoreReq_Config) GetPlayRule() string { + if x != nil { + return x.PlayRule + } + return "" +} + +func (x *StoreReq_Config) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *StoreReq_Config) GetDmShow() int32 { + if x != nil { + return x.DmShow + } + return 0 +} + +func (x *StoreReq_Config) GetWebBgImg() string { + if x != nil { + return x.WebBgImg + } + return "" +} + +func (x *StoreReq_Config) GetHasWarmUp() int32 { + if x != nil { + return x.HasWarmUp + } + return 0 +} + +func (x *StoreReq_Config) GetWarmUpImg() string { + if x != nil { + return x.WarmUpImg + } + return "" +} + +func (x *StoreReq_Config) GetWarmUpEnd() int32 { + if x != nil { + return x.WarmUpEnd + } + return 0 +} + +func (x *StoreReq_Config) GetIconType() int32 { + if x != nil { + return x.IconType + } + return 0 +} + +func (x *StoreReq_Config) GetIconBgColor() string { + if x != nil { + return x.IconBgColor + } + return "" +} + +func (x *StoreReq_Config) GetDlType() int32 { + if x != nil { + return x.DlType + } + return 0 +} + +func (x *StoreReq_Config) GetDlBannerType() int32 { + if x != nil { + return x.DlBannerType + } + return 0 +} + +func (x *StoreReq_Config) GetDlBannerImg() string { + if x != nil { + return x.DlBannerImg + } + return "" +} + +func (x *StoreReq_Config) GetDlBannerAppLogo() string { + if x != nil { + return x.DlBannerAppLogo + } + return "" +} + +func (x *StoreReq_Config) GetDlBannerAppName() string { + if x != nil { + return x.DlBannerAppName + } + return "" +} + +func (x *StoreReq_Config) GetDlBannerAppBtn() string { + if x != nil { + return x.DlBannerAppBtn + } + return "" +} + +func (x *StoreReq_Config) GetDlBannerPosition() int32 { + if x != nil { + return x.DlBannerPosition + } + return 0 +} + +func (x *StoreReq_Config) GetTopicColor() string { + if x != nil { + return x.TopicColor + } + return "" +} + +func (x *StoreReq_Config) GetWindowCover() int32 { + if x != nil { + return x.WindowCover + } + return 0 +} + +func (x *StoreReq_Config) GetIconOpen() []int32 { + if x != nil { + return x.IconOpen + } + return nil +} + +func (x *StoreReq_Config) GetHasWhite() int32 { + if x != nil { + return x.HasWhite + } + return 0 +} + +func (x *StoreReq_Config) GetWhiteList() string { + if x != nil { + return x.WhiteList + } + return "" +} + +func (x *StoreReq_Config) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *StoreReq_Config) GetAdsType() int32 { + if x != nil { + return x.AdsType + } + return 0 +} + +func (x *StoreReq_Config) GetLinkTempId() string { + if x != nil { + return x.LinkTempId + } + return "" +} + +func (x *StoreReq_Config) GetRuleTimeOpen() int32 { + if x != nil { + return x.RuleTimeOpen + } + return 0 +} + +func (x *StoreReq_Config) GetOutsideTask() int32 { + if x != nil { + return x.OutsideTask + } + return 0 +} + +func (x *StoreReq_Config) GetIconTextColor() string { + if x != nil { + return x.IconTextColor + } + return "" +} + +func (x *StoreReq_Config) GetOpenShare() int32 { + if x != nil { + return x.OpenShare + } + return 0 +} + +func (x *StoreReq_Config) GetShowToUse() int32 { + if x != nil { + return x.ShowToUse + } + return 0 +} + +func (x *StoreReq_Config) GetRuleType() int32 { + if x != nil { + return x.RuleType + } + return 0 +} + +func (x *StoreReq_Config) GetRuleImg() string { + if x != nil { + return x.RuleImg + } + return "" +} + +func (x *StoreReq_Config) GetRuleOutside() int32 { + if x != nil { + return x.RuleOutside + } + return 0 +} + +func (x *StoreReq_Config) GetDeviceOnce() int32 { + if x != nil { + return x.DeviceOnce + } + return 0 +} + +type StoreReq_LongImg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImgUrl string `protobuf:"bytes,1,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickType int32 `protobuf:"varint,4,opt,name=click_type,json=clickType,proto3" json:"click_type,omitempty"` //点击类型(1-整图点击,2-区域点击) + HotZone []*StoreReq_HotZone `protobuf:"bytes,5,rep,name=hot_zone,json=hotZone,proto3" json:"hot_zone,omitempty"` //点击区域 + TargetType int32 `protobuf:"varint,6,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,7,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,8,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *StoreReq_LongImg) Reset() { + *x = StoreReq_LongImg{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[112] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_LongImg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_LongImg) ProtoMessage() {} + +func (x *StoreReq_LongImg) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[112] + 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 StoreReq_LongImg.ProtoReflect.Descriptor instead. +func (*StoreReq_LongImg) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 19} +} + +func (x *StoreReq_LongImg) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *StoreReq_LongImg) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *StoreReq_LongImg) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *StoreReq_LongImg) GetClickType() int32 { + if x != nil { + return x.ClickType + } + return 0 +} + +func (x *StoreReq_LongImg) GetHotZone() []*StoreReq_HotZone { + if x != nil { + return x.HotZone + } + return nil +} + +func (x *StoreReq_LongImg) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *StoreReq_LongImg) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *StoreReq_LongImg) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type StoreReq_HotZone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WebUrl string `protobuf:"bytes,1,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,2,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickX float64 `protobuf:"fixed64,3,opt,name=click_x,json=clickX,proto3" json:"click_x,omitempty"` //点击区域x + ClickY float64 `protobuf:"fixed64,4,opt,name=click_y,json=clickY,proto3" json:"click_y,omitempty"` //点击区域y + ClickW float64 `protobuf:"fixed64,5,opt,name=click_w,json=clickW,proto3" json:"click_w,omitempty"` //点击区域w + ClickH float64 `protobuf:"fixed64,6,opt,name=click_h,json=clickH,proto3" json:"click_h,omitempty"` //点击区域h + TargetType int32 `protobuf:"varint,7,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,8,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *StoreReq_HotZone) Reset() { + *x = StoreReq_HotZone{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[113] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_HotZone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_HotZone) ProtoMessage() {} + +func (x *StoreReq_HotZone) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[113] + 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 StoreReq_HotZone.ProtoReflect.Descriptor instead. +func (*StoreReq_HotZone) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 20} +} + +func (x *StoreReq_HotZone) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *StoreReq_HotZone) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *StoreReq_HotZone) GetClickX() float64 { + if x != nil { + return x.ClickX + } + return 0 +} + +func (x *StoreReq_HotZone) GetClickY() float64 { + if x != nil { + return x.ClickY + } + return 0 +} + +func (x *StoreReq_HotZone) GetClickW() float64 { + if x != nil { + return x.ClickW + } + return 0 +} + +func (x *StoreReq_HotZone) GetClickH() float64 { + if x != nil { + return x.ClickH + } + return 0 +} + +func (x *StoreReq_HotZone) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *StoreReq_HotZone) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *StoreReq_HotZone) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type StoreReq_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target int32 `protobuf:"varint,1,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Option int32 `protobuf:"varint,2,opt,name=option,proto3" json:"option,omitempty"` //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + AppEvent int32 `protobuf:"varint,3,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //目标选择类型为1(option=1)的选项(1-安装;2-注册) + BothType int32 `protobuf:"varint,4,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Cond []*StoreReq_Cond `protobuf:"bytes,5,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *StoreReq_BothAll `protobuf:"bytes,6,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 + NormalData *StoreReq_NormalData `protobuf:"bytes,7,opt,name=normal_data,json=normalData,proto3" json:"normal_data,omitempty"` //通用事件的数据 +} + +func (x *StoreReq_Target) Reset() { + *x = StoreReq_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[114] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Target) ProtoMessage() {} + +func (x *StoreReq_Target) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[114] + 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 StoreReq_Target.ProtoReflect.Descriptor instead. +func (*StoreReq_Target) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 21} +} + +func (x *StoreReq_Target) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *StoreReq_Target) GetOption() int32 { + if x != nil { + return x.Option + } + return 0 +} + +func (x *StoreReq_Target) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *StoreReq_Target) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *StoreReq_Target) GetCond() []*StoreReq_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *StoreReq_Target) GetBothAll() *StoreReq_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +func (x *StoreReq_Target) GetNormalData() *StoreReq_NormalData { + if x != nil { + return x.NormalData + } + return nil +} + +type StoreReq_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,2,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,3,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TaskLimit int32 `protobuf:"varint,6,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,7,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + TriggerType int32 `protobuf:"varint,8,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + DayLimit int32 `protobuf:"varint,9,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,10,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + EventType int32 `protobuf:"varint,11,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,12,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + LangMarks []string `protobuf:"bytes,13,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WatchSec int32 `protobuf:"varint,14,opt,name=watch_sec,json=watchSec,proto3" json:"watch_sec,omitempty"` //观看秒数 + WeekLimit int32 `protobuf:"varint,15,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,16,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + OpenJump int32 `protobuf:"varint,17,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,18,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,19,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + GoShow int32 `protobuf:"varint,20,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,21,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,22,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,23,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置条件(0-否,1-是) + PreCond int32 `protobuf:"varint,24,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + ExpiredMin int32 `protobuf:"varint,25,opt,name=expired_min,json=expiredMin,proto3" json:"expired_min,omitempty"` //过期分钟数 + Reward *StoreReq_Reward `protobuf:"bytes,26,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,27,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Sort int32 `protobuf:"varint,28,opt,name=sort,proto3" json:"sort,omitempty"` //排序 + OpenPush int32 `protobuf:"varint,29,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //是否开启完成推送(0-否,1-是) + PcParam string `protobuf:"bytes,30,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 + AwardMode int32 `protobuf:"varint,31,opt,name=award_mode,json=awardMode,proto3" json:"award_mode,omitempty"` //领奖模式(1-自动领奖,2-手动领奖) + GoText string `protobuf:"bytes,32,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 + ClickEffectOpen int32 `protobuf:"varint,33,opt,name=click_effect_open,json=clickEffectOpen,proto3" json:"click_effect_open,omitempty"` //是否开启点击有效(0-否,1-是) + ClickEffect int32 `protobuf:"varint,34,opt,name=click_effect,json=clickEffect,proto3" json:"click_effect,omitempty"` //点击有效值 + ClickEffectUnit string `protobuf:"bytes,35,opt,name=click_effect_unit,json=clickEffectUnit,proto3" json:"click_effect_unit,omitempty"` //点击有效单位(min-分钟,hour-小时,day-天) + ExpiredDay string `protobuf:"bytes,36,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + PullInvite int32 `protobuf:"varint,37,opt,name=pull_invite,json=pullInvite,proto3" json:"pull_invite,omitempty"` //是否拉起邀请(0-否,1-是) +} + +func (x *StoreReq_Cond) Reset() { + *x = StoreReq_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[115] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Cond) ProtoMessage() {} + +func (x *StoreReq_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[115] + 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 StoreReq_Cond.ProtoReflect.Descriptor instead. +func (*StoreReq_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 22} +} + +func (x *StoreReq_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *StoreReq_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *StoreReq_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *StoreReq_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *StoreReq_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *StoreReq_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *StoreReq_Cond) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *StoreReq_Cond) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *StoreReq_Cond) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *StoreReq_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *StoreReq_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *StoreReq_Cond) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *StoreReq_Cond) GetWatchSec() int32 { + if x != nil { + return x.WatchSec + } + return 0 +} + +func (x *StoreReq_Cond) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *StoreReq_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *StoreReq_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *StoreReq_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *StoreReq_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *StoreReq_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *StoreReq_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *StoreReq_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *StoreReq_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *StoreReq_Cond) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +func (x *StoreReq_Cond) GetExpiredMin() int32 { + if x != nil { + return x.ExpiredMin + } + return 0 +} + +func (x *StoreReq_Cond) GetReward() *StoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *StoreReq_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *StoreReq_Cond) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *StoreReq_Cond) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +func (x *StoreReq_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *StoreReq_Cond) GetAwardMode() int32 { + if x != nil { + return x.AwardMode + } + return 0 +} + +func (x *StoreReq_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +func (x *StoreReq_Cond) GetClickEffectOpen() int32 { + if x != nil { + return x.ClickEffectOpen + } + return 0 +} + +func (x *StoreReq_Cond) GetClickEffect() int32 { + if x != nil { + return x.ClickEffect + } + return 0 +} + +func (x *StoreReq_Cond) GetClickEffectUnit() string { + if x != nil { + return x.ClickEffectUnit + } + return "" +} + +func (x *StoreReq_Cond) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *StoreReq_Cond) GetPullInvite() int32 { + if x != nil { + return x.PullInvite + } + return 0 +} + +type StoreReq_BothAll struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskLimit int32 `protobuf:"varint,1,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + DayLimit int32 `protobuf:"varint,3,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,4,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + LangMarks []string `protobuf:"bytes,5,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WeekLimit int32 `protobuf:"varint,6,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,7,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + Reward *StoreReq_Reward `protobuf:"bytes,8,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,9,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + ExpiredDay string `protobuf:"bytes,10,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 +} + +func (x *StoreReq_BothAll) Reset() { + *x = StoreReq_BothAll{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[116] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_BothAll) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_BothAll) ProtoMessage() {} + +func (x *StoreReq_BothAll) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[116] + 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 StoreReq_BothAll.ProtoReflect.Descriptor instead. +func (*StoreReq_BothAll) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 23} +} + +func (x *StoreReq_BothAll) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *StoreReq_BothAll) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_BothAll) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *StoreReq_BothAll) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *StoreReq_BothAll) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *StoreReq_BothAll) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *StoreReq_BothAll) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *StoreReq_BothAll) GetReward() *StoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *StoreReq_BothAll) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *StoreReq_BothAll) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +type StoreReq_NormalData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,3,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) +} + +func (x *StoreReq_NormalData) Reset() { + *x = StoreReq_NormalData{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[117] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_NormalData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_NormalData) ProtoMessage() {} + +func (x *StoreReq_NormalData) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[117] + 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 StoreReq_NormalData.ProtoReflect.Descriptor instead. +func (*StoreReq_NormalData) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 24} +} + +func (x *StoreReq_NormalData) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *StoreReq_NormalData) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_NormalData) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +type StoreReq_TargetOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target int32 `protobuf:"varint,1,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Fixed *StoreReq_Fixed `protobuf:"bytes,2,opt,name=fixed,proto3" json:"fixed,omitempty"` //固定事件 + Custom *StoreReq_Custom `protobuf:"bytes,3,opt,name=custom,proto3" json:"custom,omitempty"` //自定义事件 +} + +func (x *StoreReq_TargetOption) Reset() { + *x = StoreReq_TargetOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[118] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_TargetOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_TargetOption) ProtoMessage() {} + +func (x *StoreReq_TargetOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[118] + 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 StoreReq_TargetOption.ProtoReflect.Descriptor instead. +func (*StoreReq_TargetOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 25} +} + +func (x *StoreReq_TargetOption) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *StoreReq_TargetOption) GetFixed() *StoreReq_Fixed { + if x != nil { + return x.Fixed + } + return nil +} + +func (x *StoreReq_TargetOption) GetCustom() *StoreReq_Custom { + if x != nil { + return x.Custom + } + return nil +} + +type StoreReq_Fixed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + AppEvent int32 `protobuf:"varint,2,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //固定事件类型(1-安装;2-注册) + TargetNum int32 `protobuf:"varint,3,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,5,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) + Percent float64 `protobuf:"fixed64,6,opt,name=percent,proto3" json:"percent,omitempty"` //百分比值(如:获得的能量点) +} + +func (x *StoreReq_Fixed) Reset() { + *x = StoreReq_Fixed{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[119] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Fixed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Fixed) ProtoMessage() {} + +func (x *StoreReq_Fixed) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[119] + 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 StoreReq_Fixed.ProtoReflect.Descriptor instead. +func (*StoreReq_Fixed) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 26} +} + +func (x *StoreReq_Fixed) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_Fixed) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *StoreReq_Fixed) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *StoreReq_Fixed) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_Fixed) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +func (x *StoreReq_Fixed) GetPercent() float64 { + if x != nil { + return x.Percent + } + return 0 +} + +type StoreReq_Custom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + BothType int32 `protobuf:"varint,2,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Cond []*StoreReq_Cond `protobuf:"bytes,3,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *StoreReq_BothAll `protobuf:"bytes,4,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 + PreEvent int32 `protobuf:"varint,5,opt,name=pre_event,json=preEvent,proto3" json:"pre_event,omitempty"` //自定义事件前置事件(0-任意事件;1-安装;2-注册) +} + +func (x *StoreReq_Custom) Reset() { + *x = StoreReq_Custom{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[120] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Custom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Custom) ProtoMessage() {} + +func (x *StoreReq_Custom) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[120] + 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 StoreReq_Custom.ProtoReflect.Descriptor instead. +func (*StoreReq_Custom) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 27} +} + +func (x *StoreReq_Custom) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_Custom) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *StoreReq_Custom) GetCond() []*StoreReq_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *StoreReq_Custom) GetBothAll() *StoreReq_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +func (x *StoreReq_Custom) GetPreEvent() int32 { + if x != nil { + return x.PreEvent + } + return 0 +} + +type StoreReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *StoreReq_KV) Reset() { + *x = StoreReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[121] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_KV) ProtoMessage() {} + +func (x *StoreReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[121] + 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 StoreReq_KV.ProtoReflect.Descriptor instead. +func (*StoreReq_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 28} +} + +func (x *StoreReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *StoreReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type StoreReq_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Stock int32 `protobuf:"varint,2,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,3,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,4,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,5,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,6,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,7,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,8,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,9,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + Help int32 `protobuf:"varint,10,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,11,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,12,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,13,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,14,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,15,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,16,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,17,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + Odds int32 `protobuf:"varint,18,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + JumpUrl string `protobuf:"bytes,19,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + CampaignLimit int32 `protobuf:"varint,20,opt,name=campaign_limit,json=campaignLimit,proto3" json:"campaign_limit,omitempty"` //活动内单个用户可获取该奖品次数 + Register int32 `protobuf:"varint,21,opt,name=register,proto3" json:"register,omitempty"` //开启注册助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,22,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个注册获得的进度比率 + InitPercent float64 `protobuf:"fixed64,23,opt,name=init_percent,json=initPercent,proto3" json:"init_percent,omitempty"` //初始助力进度 + CollectRule *StoreReq_CollectRule `protobuf:"bytes,24,opt,name=collect_rule,json=collectRule,proto3" json:"collect_rule,omitempty"` //收集规则 + ExpiredDay string `protobuf:"bytes,25,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + OpenAdd *StoreReq_OpenAdd `protobuf:"bytes,26,opt,name=open_add,json=openAdd,proto3" json:"open_add,omitempty"` //库存增加规则 + RewardTask *StoreReq_RewardTask `protobuf:"bytes,27,opt,name=reward_task,json=rewardTask,proto3" json:"reward_task,omitempty"` //解锁任务 +} + +func (x *StoreReq_Reward) Reset() { + *x = StoreReq_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[122] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Reward) ProtoMessage() {} + +func (x *StoreReq_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[122] + 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 StoreReq_Reward.ProtoReflect.Descriptor instead. +func (*StoreReq_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 29} +} + +func (x *StoreReq_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *StoreReq_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *StoreReq_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *StoreReq_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *StoreReq_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *StoreReq_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *StoreReq_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *StoreReq_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *StoreReq_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *StoreReq_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *StoreReq_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *StoreReq_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *StoreReq_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *StoreReq_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *StoreReq_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *StoreReq_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *StoreReq_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *StoreReq_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *StoreReq_Reward) GetCampaignLimit() int32 { + if x != nil { + return x.CampaignLimit + } + return 0 +} + +func (x *StoreReq_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *StoreReq_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +func (x *StoreReq_Reward) GetInitPercent() float64 { + if x != nil { + return x.InitPercent + } + return 0 +} + +func (x *StoreReq_Reward) GetCollectRule() *StoreReq_CollectRule { + if x != nil { + return x.CollectRule + } + return nil +} + +func (x *StoreReq_Reward) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *StoreReq_Reward) GetOpenAdd() *StoreReq_OpenAdd { + if x != nil { + return x.OpenAdd + } + return nil +} + +func (x *StoreReq_Reward) GetRewardTask() *StoreReq_RewardTask { + if x != nil { + return x.RewardTask + } + return nil +} + +type StoreReq_RewardTask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,3,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,4,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TriggerType int32 `protobuf:"varint,6,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + EventType int32 `protobuf:"varint,7,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + OpenPush int32 `protobuf:"varint,8,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //是否开启完成推送(0-否,1-是) +} + +func (x *StoreReq_RewardTask) Reset() { + *x = StoreReq_RewardTask{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[123] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_RewardTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_RewardTask) ProtoMessage() {} + +func (x *StoreReq_RewardTask) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[123] + 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 StoreReq_RewardTask.ProtoReflect.Descriptor instead. +func (*StoreReq_RewardTask) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 30} +} + +func (x *StoreReq_RewardTask) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_RewardTask) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *StoreReq_RewardTask) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *StoreReq_RewardTask) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *StoreReq_RewardTask) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *StoreReq_RewardTask) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *StoreReq_RewardTask) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *StoreReq_RewardTask) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +type StoreReq_OpenAdd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启动态库存规则(0-否,1-是) + Start int64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` //开始时间 + End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` //结束时间 + DayNum int32 `protobuf:"varint,4,opt,name=day_num,json=dayNum,proto3" json:"day_num,omitempty"` //天数 + DayAdd int32 `protobuf:"varint,5,opt,name=day_add,json=dayAdd,proto3" json:"day_add,omitempty"` //增加的库存量 +} + +func (x *StoreReq_OpenAdd) Reset() { + *x = StoreReq_OpenAdd{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[124] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_OpenAdd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_OpenAdd) ProtoMessage() {} + +func (x *StoreReq_OpenAdd) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[124] + 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 StoreReq_OpenAdd.ProtoReflect.Descriptor instead. +func (*StoreReq_OpenAdd) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 31} +} + +func (x *StoreReq_OpenAdd) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_OpenAdd) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *StoreReq_OpenAdd) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *StoreReq_OpenAdd) GetDayNum() int32 { + if x != nil { + return x.DayNum + } + return 0 +} + +func (x *StoreReq_OpenAdd) GetDayAdd() int32 { + if x != nil { + return x.DayAdd + } + return 0 +} + +type StoreReq_CollectRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启碎片规则(0-否,1-是) + InitCollect int32 `protobuf:"varint,2,opt,name=init_collect,json=initCollect,proto3" json:"init_collect,omitempty"` //初始的最大可获得碎片数 + SignDay int32 `protobuf:"varint,3,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + AddCollect int32 `protobuf:"varint,4,opt,name=add_collect,json=addCollect,proto3" json:"add_collect,omitempty"` //完成条件可获得最大碎片数 + ResetType int32 `protobuf:"varint,5,opt,name=reset_type,json=resetType,proto3" json:"reset_type,omitempty"` //重置碎片规则(1-不重置,2-获奖后重置) +} + +func (x *StoreReq_CollectRule) Reset() { + *x = StoreReq_CollectRule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[125] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_CollectRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_CollectRule) ProtoMessage() {} + +func (x *StoreReq_CollectRule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[125] + 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 StoreReq_CollectRule.ProtoReflect.Descriptor instead. +func (*StoreReq_CollectRule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 32} +} + +func (x *StoreReq_CollectRule) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_CollectRule) GetInitCollect() int32 { + if x != nil { + return x.InitCollect + } + return 0 +} + +func (x *StoreReq_CollectRule) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *StoreReq_CollectRule) GetAddCollect() int32 { + if x != nil { + return x.AddCollect + } + return 0 +} + +func (x *StoreReq_CollectRule) GetResetType() int32 { + if x != nil { + return x.ResetType + } + return 0 +} + +type StoreReq_Rewards struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardGroup int32 `protobuf:"varint,1,opt,name=reward_group,json=rewardGroup,proto3" json:"reward_group,omitempty"` //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + Normal []*StoreReq_Reward `protobuf:"bytes,2,rep,name=normal,proto3" json:"normal,omitempty"` //常规奖品 + UserLevel *StoreReq_UserLevel `protobuf:"bytes,3,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` //用户类型奖品 + Langs []*StoreReq_Lang `protobuf:"bytes,4,rep,name=langs,proto3" json:"langs,omitempty"` //语言奖品 + LangUserLevel []*StoreReq_LangUserLevel `protobuf:"bytes,5,rep,name=lang_user_level,json=langUserLevel,proto3" json:"lang_user_level,omitempty"` //语言+用户类型奖品 + Country *StoreReq_Country `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"` //国家奖品 +} + +func (x *StoreReq_Rewards) Reset() { + *x = StoreReq_Rewards{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[126] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Rewards) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Rewards) ProtoMessage() {} + +func (x *StoreReq_Rewards) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[126] + 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 StoreReq_Rewards.ProtoReflect.Descriptor instead. +func (*StoreReq_Rewards) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 33} +} + +func (x *StoreReq_Rewards) GetRewardGroup() int32 { + if x != nil { + return x.RewardGroup + } + return 0 +} + +func (x *StoreReq_Rewards) GetNormal() []*StoreReq_Reward { + if x != nil { + return x.Normal + } + return nil +} + +func (x *StoreReq_Rewards) GetUserLevel() *StoreReq_UserLevel { + if x != nil { + return x.UserLevel + } + return nil +} + +func (x *StoreReq_Rewards) GetLangs() []*StoreReq_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *StoreReq_Rewards) GetLangUserLevel() []*StoreReq_LangUserLevel { + if x != nil { + return x.LangUserLevel + } + return nil +} + +func (x *StoreReq_Rewards) GetCountry() *StoreReq_Country { + if x != nil { + return x.Country + } + return nil +} + +type StoreReq_UserLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultLevelId int64 `protobuf:"varint,1,opt,name=default_level_id,json=defaultLevelId,proto3" json:"default_level_id,omitempty"` //默认用户类型id + LevelList []*StoreReq_UserLevelOne `protobuf:"bytes,2,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //用户类型奖品 +} + +func (x *StoreReq_UserLevel) Reset() { + *x = StoreReq_UserLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[127] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_UserLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_UserLevel) ProtoMessage() {} + +func (x *StoreReq_UserLevel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[127] + 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 StoreReq_UserLevel.ProtoReflect.Descriptor instead. +func (*StoreReq_UserLevel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 34} +} + +func (x *StoreReq_UserLevel) GetDefaultLevelId() int64 { + if x != nil { + return x.DefaultLevelId + } + return 0 +} + +func (x *StoreReq_UserLevel) GetLevelList() []*StoreReq_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type StoreReq_UserLevelOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LevelId int64 `protobuf:"varint,1,opt,name=level_id,json=levelId,proto3" json:"level_id,omitempty"` //用户类型id + Rewards []*StoreReq_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *StoreReq_UserLevelOne) Reset() { + *x = StoreReq_UserLevelOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[128] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_UserLevelOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_UserLevelOne) ProtoMessage() {} + +func (x *StoreReq_UserLevelOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[128] + 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 StoreReq_UserLevelOne.ProtoReflect.Descriptor instead. +func (*StoreReq_UserLevelOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 35} +} + +func (x *StoreReq_UserLevelOne) GetLevelId() int64 { + if x != nil { + return x.LevelId + } + return 0 +} + +func (x *StoreReq_UserLevelOne) GetRewards() []*StoreReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type StoreReq_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + Rewards []*StoreReq_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *StoreReq_Lang) Reset() { + *x = StoreReq_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[129] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Lang) ProtoMessage() {} + +func (x *StoreReq_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[129] + 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 StoreReq_Lang.ProtoReflect.Descriptor instead. +func (*StoreReq_Lang) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 36} +} + +func (x *StoreReq_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *StoreReq_Lang) GetRewards() []*StoreReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type StoreReq_LangUserLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + DefaultLevelId int64 `protobuf:"varint,2,opt,name=default_level_id,json=defaultLevelId,proto3" json:"default_level_id,omitempty"` //默认用户类型id + LevelList []*StoreReq_UserLevelOne `protobuf:"bytes,3,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //用户类型奖品 +} + +func (x *StoreReq_LangUserLevel) Reset() { + *x = StoreReq_LangUserLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[130] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_LangUserLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_LangUserLevel) ProtoMessage() {} + +func (x *StoreReq_LangUserLevel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[130] + 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 StoreReq_LangUserLevel.ProtoReflect.Descriptor instead. +func (*StoreReq_LangUserLevel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 37} +} + +func (x *StoreReq_LangUserLevel) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *StoreReq_LangUserLevel) GetDefaultLevelId() int64 { + if x != nil { + return x.DefaultLevelId + } + return 0 +} + +func (x *StoreReq_LangUserLevel) GetLevelList() []*StoreReq_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type StoreReq_Country struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultCountryMark string `protobuf:"bytes,1,opt,name=default_country_mark,json=defaultCountryMark,proto3" json:"default_country_mark,omitempty"` //默认国家 + CountryList []*StoreReq_CountryOne `protobuf:"bytes,2,rep,name=country_list,json=countryList,proto3" json:"country_list,omitempty"` //国家的奖品 +} + +func (x *StoreReq_Country) Reset() { + *x = StoreReq_Country{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[131] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Country) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Country) ProtoMessage() {} + +func (x *StoreReq_Country) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[131] + 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 StoreReq_Country.ProtoReflect.Descriptor instead. +func (*StoreReq_Country) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 38} +} + +func (x *StoreReq_Country) GetDefaultCountryMark() string { + if x != nil { + return x.DefaultCountryMark + } + return "" +} + +func (x *StoreReq_Country) GetCountryList() []*StoreReq_CountryOne { + if x != nil { + return x.CountryList + } + return nil +} + +type StoreReq_CountryOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CountryMark string `protobuf:"bytes,1,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 + Rewards []*StoreReq_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *StoreReq_CountryOne) Reset() { + *x = StoreReq_CountryOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[132] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_CountryOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_CountryOne) ProtoMessage() {} + +func (x *StoreReq_CountryOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[132] + 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 StoreReq_CountryOne.ProtoReflect.Descriptor instead. +func (*StoreReq_CountryOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 39} +} + +func (x *StoreReq_CountryOne) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *StoreReq_CountryOne) GetRewards() []*StoreReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type StoreReq_QaQuestion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //题目 + Score int32 `protobuf:"varint,2,opt,name=score,proto3" json:"score,omitempty"` //得分 + Options []*StoreReq_QaOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` //选项 +} + +func (x *StoreReq_QaQuestion) Reset() { + *x = StoreReq_QaQuestion{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[133] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_QaQuestion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_QaQuestion) ProtoMessage() {} + +func (x *StoreReq_QaQuestion) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[133] + 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 StoreReq_QaQuestion.ProtoReflect.Descriptor instead. +func (*StoreReq_QaQuestion) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 40} +} + +func (x *StoreReq_QaQuestion) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq_QaQuestion) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *StoreReq_QaQuestion) GetOptions() []*StoreReq_QaOption { + if x != nil { + return x.Options + } + return nil +} + +type StoreReq_QaOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + IsRight int32 `protobuf:"varint,2,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *StoreReq_QaOption) Reset() { + *x = StoreReq_QaOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[134] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_QaOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_QaOption) ProtoMessage() {} + +func (x *StoreReq_QaOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[134] + 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 StoreReq_QaOption.ProtoReflect.Descriptor instead. +func (*StoreReq_QaOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 41} +} + +func (x *StoreReq_QaOption) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq_QaOption) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type StoreReq_QuizOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,2,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 + IsRight int32 `protobuf:"varint,3,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确选项(1-是,0-否) +} + +func (x *StoreReq_QuizOption) Reset() { + *x = StoreReq_QuizOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[135] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_QuizOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_QuizOption) ProtoMessage() {} + +func (x *StoreReq_QuizOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[135] + 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 StoreReq_QuizOption.ProtoReflect.Descriptor instead. +func (*StoreReq_QuizOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 42} +} + +func (x *StoreReq_QuizOption) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq_QuizOption) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *StoreReq_QuizOption) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type StoreReq_Quiz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + InitChance int32 `protobuf:"varint,2,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始答题机会次数 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的答题机会次数 + RewardRule int32 `protobuf:"varint,4,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //奖励规则(1-投票结果排名,2-自定义竞猜结果) + OpenPrize int64 `protobuf:"varint,5,opt,name=open_prize,json=openPrize,proto3" json:"open_prize,omitempty"` //开奖时间 + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` //选择标题 + Options []*StoreReq_QuizOption `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` //有奖竞猜选项 +} + +func (x *StoreReq_Quiz) Reset() { + *x = StoreReq_Quiz{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[136] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Quiz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Quiz) ProtoMessage() {} + +func (x *StoreReq_Quiz) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[136] + 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 StoreReq_Quiz.ProtoReflect.Descriptor instead. +func (*StoreReq_Quiz) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 43} +} + +func (x *StoreReq_Quiz) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *StoreReq_Quiz) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_Quiz) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_Quiz) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *StoreReq_Quiz) GetOpenPrize() int64 { + if x != nil { + return x.OpenPrize + } + return 0 +} + +func (x *StoreReq_Quiz) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq_Quiz) GetOptions() []*StoreReq_QuizOption { + if x != nil { + return x.Options + } + return nil +} + +type StoreReq_QuestionAnswer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //达标条件后可获取的答题次数 + InitChance int32 `protobuf:"varint,3,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始答题机会次数 + QuestionAskTime int32 `protobuf:"varint,4,opt,name=question_ask_time,json=questionAskTime,proto3" json:"question_ask_time,omitempty"` //答题时间限制(单位:S,如:1 就是1秒) + Questions []*StoreReq_QaQuestion `protobuf:"bytes,5,rep,name=questions,proto3" json:"questions,omitempty"` //题目 + GroupHashId string `protobuf:"bytes,6,opt,name=group_hash_id,json=groupHashId,proto3" json:"group_hash_id,omitempty"` //题库对外id + QaNum int32 `protobuf:"varint,7,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题库选取数量 + DayChance int32 `protobuf:"varint,8,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日签到获得的答题数 + OpenGuide int32 `protobuf:"varint,9,opt,name=open_guide,json=openGuide,proto3" json:"open_guide,omitempty"` //是否开启引导(0-否,1-是) + GuideGroupHashId string `protobuf:"bytes,10,opt,name=guide_group_hash_id,json=guideGroupHashId,proto3" json:"guide_group_hash_id,omitempty"` //引导组hash_id +} + +func (x *StoreReq_QuestionAnswer) Reset() { + *x = StoreReq_QuestionAnswer{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[137] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_QuestionAnswer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_QuestionAnswer) ProtoMessage() {} + +func (x *StoreReq_QuestionAnswer) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[137] + 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 StoreReq_QuestionAnswer.ProtoReflect.Descriptor instead. +func (*StoreReq_QuestionAnswer) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 44} +} + +func (x *StoreReq_QuestionAnswer) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetQuestionAskTime() int32 { + if x != nil { + return x.QuestionAskTime + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetQuestions() []*StoreReq_QaQuestion { + if x != nil { + return x.Questions + } + return nil +} + +func (x *StoreReq_QuestionAnswer) GetGroupHashId() string { + if x != nil { + return x.GroupHashId + } + return "" +} + +func (x *StoreReq_QuestionAnswer) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetOpenGuide() int32 { + if x != nil { + return x.OpenGuide + } + return 0 +} + +func (x *StoreReq_QuestionAnswer) GetGuideGroupHashId() string { + if x != nil { + return x.GuideGroupHashId + } + return "" +} + +type StoreReq_LotteryConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + InitChance int32 `protobuf:"varint,2,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖机会次数 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的抽奖机会次数 + DayChance int32 `protobuf:"varint,4,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽奖机会次数 +} + +func (x *StoreReq_LotteryConfig) Reset() { + *x = StoreReq_LotteryConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[138] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_LotteryConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_LotteryConfig) ProtoMessage() {} + +func (x *StoreReq_LotteryConfig) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[138] + 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 StoreReq_LotteryConfig.ProtoReflect.Descriptor instead. +func (*StoreReq_LotteryConfig) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 45} +} + +func (x *StoreReq_LotteryConfig) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *StoreReq_LotteryConfig) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_LotteryConfig) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *StoreReq_LotteryConfig) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type StoreReq_InviteConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardLimit int32 `protobuf:"varint,1,opt,name=reward_limit,json=rewardLimit,proto3" json:"reward_limit,omitempty"` //活动总奖励上限 + RewardRule int32 `protobuf:"varint,2,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //用户奖励规则(1-阶梯,2-非阶梯) + InviteLimit int32 `protobuf:"varint,3,opt,name=invite_limit,json=inviteLimit,proto3" json:"invite_limit,omitempty"` //邀请超过多少人不能再获得奖励 + NewcomerCond int32 `protobuf:"varint,4,opt,name=newcomer_cond,json=newcomerCond,proto3" json:"newcomer_cond,omitempty"` //新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + StepLoop int32 `protobuf:"varint,5,opt,name=step_loop,json=stepLoop,proto3" json:"step_loop,omitempty"` //阶梯是否支持循环(0-不支持,1-支持) +} + +func (x *StoreReq_InviteConfig) Reset() { + *x = StoreReq_InviteConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[139] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_InviteConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_InviteConfig) ProtoMessage() {} + +func (x *StoreReq_InviteConfig) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[139] + 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 StoreReq_InviteConfig.ProtoReflect.Descriptor instead. +func (*StoreReq_InviteConfig) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 46} +} + +func (x *StoreReq_InviteConfig) GetRewardLimit() int32 { + if x != nil { + return x.RewardLimit + } + return 0 +} + +func (x *StoreReq_InviteConfig) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *StoreReq_InviteConfig) GetInviteLimit() int32 { + if x != nil { + return x.InviteLimit + } + return 0 +} + +func (x *StoreReq_InviteConfig) GetNewcomerCond() int32 { + if x != nil { + return x.NewcomerCond + } + return 0 +} + +func (x *StoreReq_InviteConfig) GetStepLoop() int32 { + if x != nil { + return x.StepLoop + } + return 0 +} + +type StoreReq_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignType int32 `protobuf:"varint,1,opt,name=sign_type,json=signType,proto3" json:"sign_type,omitempty"` //签到类型(1-普通签到,2-阶梯签到) + IsContinue int32 `protobuf:"varint,2,opt,name=is_continue,json=isContinue,proto3" json:"is_continue,omitempty"` //是否连续签到(1-是,0-否) + HasCard int32 `protobuf:"varint,3,opt,name=has_card,json=hasCard,proto3" json:"has_card,omitempty"` //是否开启签到卡(1-开启,0-不开启) + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //邀请好友数可获得的1张签到卡 + LimitCardNum int32 `protobuf:"varint,5,opt,name=limit_card_num,json=limitCardNum,proto3" json:"limit_card_num,omitempty"` //可获得幸运卡的最大张数 + IsLoop int32 `protobuf:"varint,6,opt,name=is_loop,json=isLoop,proto3" json:"is_loop,omitempty"` //是否支持循环(0-否,1-是) + SignCycle int32 `protobuf:"varint,7,opt,name=sign_cycle,json=signCycle,proto3" json:"sign_cycle,omitempty"` //签到周期 + RecycleType int32 `protobuf:"varint,8,opt,name=recycle_type,json=recycleType,proto3" json:"recycle_type,omitempty"` //重新签到模式(1-断签重签,2-周期重签) + Color string `protobuf:"bytes,9,opt,name=color,proto3" json:"color,omitempty"` //签到主题颜色 +} + +func (x *StoreReq_Sign) Reset() { + *x = StoreReq_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[140] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Sign) ProtoMessage() {} + +func (x *StoreReq_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[140] + 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 StoreReq_Sign.ProtoReflect.Descriptor instead. +func (*StoreReq_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 47} +} + +func (x *StoreReq_Sign) GetSignType() int32 { + if x != nil { + return x.SignType + } + return 0 +} + +func (x *StoreReq_Sign) GetIsContinue() int32 { + if x != nil { + return x.IsContinue + } + return 0 +} + +func (x *StoreReq_Sign) GetHasCard() int32 { + if x != nil { + return x.HasCard + } + return 0 +} + +func (x *StoreReq_Sign) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *StoreReq_Sign) GetLimitCardNum() int32 { + if x != nil { + return x.LimitCardNum + } + return 0 +} + +func (x *StoreReq_Sign) GetIsLoop() int32 { + if x != nil { + return x.IsLoop + } + return 0 +} + +func (x *StoreReq_Sign) GetSignCycle() int32 { + if x != nil { + return x.SignCycle + } + return 0 +} + +func (x *StoreReq_Sign) GetRecycleType() int32 { + if x != nil { + return x.RecycleType + } + return 0 +} + +func (x *StoreReq_Sign) GetColor() string { + if x != nil { + return x.Color + } + return "" +} + +type StoreReq_Dice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始骰子数 + DayChance int32 `protobuf:"varint,2,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的骰子数 + FixDice int32 `protobuf:"varint,3,opt,name=fix_dice,json=fixDice,proto3" json:"fix_dice,omitempty"` //开启固定骰子(0-不开启,1-开启) + FixDiceTarget int32 `protobuf:"varint,4,opt,name=fix_dice_target,json=fixDiceTarget,proto3" json:"fix_dice_target,omitempty"` //获得固定骰子需要邀请的人数 + FixDiceLimit int32 `protobuf:"varint,5,opt,name=fix_dice_limit,json=fixDiceLimit,proto3" json:"fix_dice_limit,omitempty"` //固定骰子限制获取数 + CustomDice string `protobuf:"bytes,6,opt,name=custom_dice,json=customDice,proto3" json:"custom_dice,omitempty"` //自定义骰子图片 + OpenMapPoint int32 `protobuf:"varint,7,opt,name=open_map_point,json=openMapPoint,proto3" json:"open_map_point,omitempty"` //开启自定义底座(0-不开启,1-开启) + MapPoint *StoreReq_MapPoint `protobuf:"bytes,8,opt,name=map_point,json=mapPoint,proto3" json:"map_point,omitempty"` //自定义底座数据 + AwardType int32 `protobuf:"varint,9,opt,name=award_type,json=awardType,proto3" json:"award_type,omitempty"` //奖品碎片收集方式(1-随机收集,2-概率收集) + OpenInvite int32 `protobuf:"varint,10,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请挂件(0-关闭,1-开启) + RollAgain int32 `protobuf:"varint,11,opt,name=roll_again,json=rollAgain,proto3" json:"roll_again,omitempty"` //开启再摇一次(0-关闭,1-开启) + FixDiceCond int32 `protobuf:"varint,12,opt,name=fix_dice_cond,json=fixDiceCond,proto3" json:"fix_dice_cond,omitempty"` //邀请事件(1-安装,2-注册) + Odds int32 `protobuf:"varint,13,opt,name=odds,proto3" json:"odds,omitempty"` //概率收集方式的中奖概率 + PlayImg string `protobuf:"bytes,14,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //play按钮图 + CloudImg string `protobuf:"bytes,15,opt,name=cloud_img,json=cloudImg,proto3" json:"cloud_img,omitempty"` //云朵图 +} + +func (x *StoreReq_Dice) Reset() { + *x = StoreReq_Dice{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[141] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Dice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Dice) ProtoMessage() {} + +func (x *StoreReq_Dice) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[141] + 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 StoreReq_Dice.ProtoReflect.Descriptor instead. +func (*StoreReq_Dice) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 48} +} + +func (x *StoreReq_Dice) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_Dice) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +func (x *StoreReq_Dice) GetFixDice() int32 { + if x != nil { + return x.FixDice + } + return 0 +} + +func (x *StoreReq_Dice) GetFixDiceTarget() int32 { + if x != nil { + return x.FixDiceTarget + } + return 0 +} + +func (x *StoreReq_Dice) GetFixDiceLimit() int32 { + if x != nil { + return x.FixDiceLimit + } + return 0 +} + +func (x *StoreReq_Dice) GetCustomDice() string { + if x != nil { + return x.CustomDice + } + return "" +} + +func (x *StoreReq_Dice) GetOpenMapPoint() int32 { + if x != nil { + return x.OpenMapPoint + } + return 0 +} + +func (x *StoreReq_Dice) GetMapPoint() *StoreReq_MapPoint { + if x != nil { + return x.MapPoint + } + return nil +} + +func (x *StoreReq_Dice) GetAwardType() int32 { + if x != nil { + return x.AwardType + } + return 0 +} + +func (x *StoreReq_Dice) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *StoreReq_Dice) GetRollAgain() int32 { + if x != nil { + return x.RollAgain + } + return 0 +} + +func (x *StoreReq_Dice) GetFixDiceCond() int32 { + if x != nil { + return x.FixDiceCond + } + return 0 +} + +func (x *StoreReq_Dice) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *StoreReq_Dice) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *StoreReq_Dice) GetCloudImg() string { + if x != nil { + return x.CloudImg + } + return "" +} + +type StoreReq_MapPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blank string `protobuf:"bytes,1,opt,name=blank,proto3" json:"blank,omitempty"` //空白底座 + Again string `protobuf:"bytes,2,opt,name=again,proto3" json:"again,omitempty"` //再摇一次底座 + Normal string `protobuf:"bytes,3,opt,name=normal,proto3" json:"normal,omitempty"` //普通奖品底座 + Supper string `protobuf:"bytes,4,opt,name=supper,proto3" json:"supper,omitempty"` //超级大奖底座 +} + +func (x *StoreReq_MapPoint) Reset() { + *x = StoreReq_MapPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[142] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_MapPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_MapPoint) ProtoMessage() {} + +func (x *StoreReq_MapPoint) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[142] + 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 StoreReq_MapPoint.ProtoReflect.Descriptor instead. +func (*StoreReq_MapPoint) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 49} +} + +func (x *StoreReq_MapPoint) GetBlank() string { + if x != nil { + return x.Blank + } + return "" +} + +func (x *StoreReq_MapPoint) GetAgain() string { + if x != nil { + return x.Again + } + return "" +} + +func (x *StoreReq_MapPoint) GetNormal() string { + if x != nil { + return x.Normal + } + return "" +} + +func (x *StoreReq_MapPoint) GetSupper() string { + if x != nil { + return x.Supper + } + return "" +} + +type StoreReq_Grow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AutoHour int32 `protobuf:"varint,1,opt,name=auto_hour,json=autoHour,proto3" json:"auto_hour,omitempty"` //自动生产成长道具小时数 + AutoNum int32 `protobuf:"varint,2,opt,name=auto_num,json=autoNum,proto3" json:"auto_num,omitempty"` //生产的成长道具数 + GrowNum int32 `protobuf:"varint,3,opt,name=grow_num,json=growNum,proto3" json:"grow_num,omitempty"` //邀请可获得的成长道具数量 + TargetNum int32 `protobuf:"varint,4,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //获得成长道具需要邀请的人数 + Revive int32 `protobuf:"varint,5,opt,name=revive,proto3" json:"revive,omitempty"` //是否支持复活(0-否,1-是) + ReviveNum int32 `protobuf:"varint,6,opt,name=revive_num,json=reviveNum,proto3" json:"revive_num,omitempty"` //复活需要邀请的好友数 + DieHour int32 `protobuf:"varint,7,opt,name=die_hour,json=dieHour,proto3" json:"die_hour,omitempty"` //未获得成长道具导致的死亡时间 + Steps []*StoreReq_GrowStep `protobuf:"bytes,8,rep,name=steps,proto3" json:"steps,omitempty"` //成长阶段 + InitNum int32 `protobuf:"varint,9,opt,name=init_num,json=initNum,proto3" json:"init_num,omitempty"` //初始成长道具数量 +} + +func (x *StoreReq_Grow) Reset() { + *x = StoreReq_Grow{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[143] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Grow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Grow) ProtoMessage() {} + +func (x *StoreReq_Grow) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[143] + 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 StoreReq_Grow.ProtoReflect.Descriptor instead. +func (*StoreReq_Grow) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 50} +} + +func (x *StoreReq_Grow) GetAutoHour() int32 { + if x != nil { + return x.AutoHour + } + return 0 +} + +func (x *StoreReq_Grow) GetAutoNum() int32 { + if x != nil { + return x.AutoNum + } + return 0 +} + +func (x *StoreReq_Grow) GetGrowNum() int32 { + if x != nil { + return x.GrowNum + } + return 0 +} + +func (x *StoreReq_Grow) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *StoreReq_Grow) GetRevive() int32 { + if x != nil { + return x.Revive + } + return 0 +} + +func (x *StoreReq_Grow) GetReviveNum() int32 { + if x != nil { + return x.ReviveNum + } + return 0 +} + +func (x *StoreReq_Grow) GetDieHour() int32 { + if x != nil { + return x.DieHour + } + return 0 +} + +func (x *StoreReq_Grow) GetSteps() []*StoreReq_GrowStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *StoreReq_Grow) GetInitNum() int32 { + if x != nil { + return x.InitNum + } + return 0 +} + +type StoreReq_GrowStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Num int32 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` //需要的养成道具数量 +} + +func (x *StoreReq_GrowStep) Reset() { + *x = StoreReq_GrowStep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[144] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_GrowStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_GrowStep) ProtoMessage() {} + +func (x *StoreReq_GrowStep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[144] + 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 StoreReq_GrowStep.ProtoReflect.Descriptor instead. +func (*StoreReq_GrowStep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 51} +} + +func (x *StoreReq_GrowStep) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type StoreReq_Ballot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽签数 + DayChance int32 `protobuf:"varint,2,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽签数 +} + +func (x *StoreReq_Ballot) Reset() { + *x = StoreReq_Ballot{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[145] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Ballot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Ballot) ProtoMessage() {} + +func (x *StoreReq_Ballot) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[145] + 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 StoreReq_Ballot.ProtoReflect.Descriptor instead. +func (*StoreReq_Ballot) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 52} +} + +func (x *StoreReq_Ballot) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_Ballot) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type StoreReq_Chop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ShowBar int32 `protobuf:"varint,1,opt,name=show_bar,json=showBar,proto3" json:"show_bar,omitempty"` //是否展示进度条(0-否,1-是) +} + +func (x *StoreReq_Chop) Reset() { + *x = StoreReq_Chop{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[146] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Chop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Chop) ProtoMessage() {} + +func (x *StoreReq_Chop) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[146] + 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 StoreReq_Chop.ProtoReflect.Descriptor instead. +func (*StoreReq_Chop) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 53} +} + +func (x *StoreReq_Chop) GetShowBar() int32 { + if x != nil { + return x.ShowBar + } + return 0 +} + +type StoreReq_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExpiredDay int32 `protobuf:"varint,1,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //任务重置天数 + Price int32 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + PriceNum int32 `protobuf:"varint,3,opt,name=price_num,json=priceNum,proto3" json:"price_num,omitempty"` //奖品总份额 + Currency int32 `protobuf:"varint,4,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 + LoopNum int32 `protobuf:"varint,5,opt,name=loop_num,json=loopNum,proto3" json:"loop_num,omitempty"` //支持循环次数 +} + +func (x *StoreReq_Cash) Reset() { + *x = StoreReq_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[147] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Cash) ProtoMessage() {} + +func (x *StoreReq_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[147] + 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 StoreReq_Cash.ProtoReflect.Descriptor instead. +func (*StoreReq_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 54} +} + +func (x *StoreReq_Cash) GetExpiredDay() int32 { + if x != nil { + return x.ExpiredDay + } + return 0 +} + +func (x *StoreReq_Cash) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *StoreReq_Cash) GetPriceNum() int32 { + if x != nil { + return x.PriceNum + } + return 0 +} + +func (x *StoreReq_Cash) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +func (x *StoreReq_Cash) GetLoopNum() int32 { + if x != nil { + return x.LoopNum + } + return 0 +} + +type StoreReq_Flip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖机会次数 + CardImg string `protobuf:"bytes,2,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡牌图片 + DayChance int32 `protobuf:"varint,3,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽奖机会次数 +} + +func (x *StoreReq_Flip) Reset() { + *x = StoreReq_Flip{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[148] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Flip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Flip) ProtoMessage() {} + +func (x *StoreReq_Flip) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[148] + 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 StoreReq_Flip.ProtoReflect.Descriptor instead. +func (*StoreReq_Flip) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 55} +} + +func (x *StoreReq_Flip) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *StoreReq_Flip) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +func (x *StoreReq_Flip) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type StoreReq_Keep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Collect int32 `protobuf:"varint,1,opt,name=collect,proto3" json:"collect,omitempty"` //获得最终奖品需要的总收集数 + CollectSecond int32 `protobuf:"varint,2,opt,name=collect_second,json=collectSecond,proto3" json:"collect_second,omitempty"` //单个收集需要的二级资源数 + OpenInvite int32 `protobuf:"varint,3,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请(0-关闭,1-开启) + Invite *StoreReq_Invite `protobuf:"bytes,4,opt,name=invite,proto3" json:"invite,omitempty"` //拉新配置 + InitGet int32 `protobuf:"varint,5,opt,name=init_get,json=initGet,proto3" json:"init_get,omitempty"` //初始道具数 + SecGet float64 `protobuf:"fixed64,6,opt,name=sec_get,json=secGet,proto3" json:"sec_get,omitempty"` //每秒获得道具数 + FeedNum int32 `protobuf:"varint,7,opt,name=feed_num,json=feedNum,proto3" json:"feed_num,omitempty"` //每次使用道具数 + FeedCycle int32 `protobuf:"varint,8,opt,name=feed_cycle,json=feedCycle,proto3" json:"feed_cycle,omitempty"` //喂养周期(单位:天) + MaxFeed int32 `protobuf:"varint,9,opt,name=max_feed,json=maxFeed,proto3" json:"max_feed,omitempty"` //最大可领养次数 + FeedGet int32 `protobuf:"varint,10,opt,name=feed_get,json=feedGet,proto3" json:"feed_get,omitempty"` //喂养能得到的道具数 + FeedGetNum int32 `protobuf:"varint,11,opt,name=feed_get_num,json=feedGetNum,proto3" json:"feed_get_num,omitempty"` //得到喂养道具需要的喂养次数 + TalkText []*StoreReq_Talk `protobuf:"bytes,12,rep,name=talk_text,json=talkText,proto3" json:"talk_text,omitempty"` //对话文案 + Steps []*StoreReq_KeepStep `protobuf:"bytes,13,rep,name=steps,proto3" json:"steps,omitempty"` //养成阶梯 + SecGetDayLimit float64 `protobuf:"fixed64,14,opt,name=sec_get_day_limit,json=secGetDayLimit,proto3" json:"sec_get_day_limit,omitempty"` //每秒获得道具每日上限 + MachineType int32 `protobuf:"varint,15,opt,name=machine_type,json=machineType,proto3" json:"machine_type,omitempty"` //狗粮机类型(1-在线收益,2-离线收益) + OfflineMin int32 `protobuf:"varint,16,opt,name=offline_min,json=offlineMin,proto3" json:"offline_min,omitempty"` //离线分钟时长 + OfflineGet int32 `protobuf:"varint,17,opt,name=offline_get,json=offlineGet,proto3" json:"offline_get,omitempty"` //离线收益最大值 + OfflineLimit int32 `protobuf:"varint,18,opt,name=offline_limit,json=offlineLimit,proto3" json:"offline_limit,omitempty"` //离线收益最大领取次数 +} + +func (x *StoreReq_Keep) Reset() { + *x = StoreReq_Keep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[149] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Keep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Keep) ProtoMessage() {} + +func (x *StoreReq_Keep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[149] + 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 StoreReq_Keep.ProtoReflect.Descriptor instead. +func (*StoreReq_Keep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 56} +} + +func (x *StoreReq_Keep) GetCollect() int32 { + if x != nil { + return x.Collect + } + return 0 +} + +func (x *StoreReq_Keep) GetCollectSecond() int32 { + if x != nil { + return x.CollectSecond + } + return 0 +} + +func (x *StoreReq_Keep) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *StoreReq_Keep) GetInvite() *StoreReq_Invite { + if x != nil { + return x.Invite + } + return nil +} + +func (x *StoreReq_Keep) GetInitGet() int32 { + if x != nil { + return x.InitGet + } + return 0 +} + +func (x *StoreReq_Keep) GetSecGet() float64 { + if x != nil { + return x.SecGet + } + return 0 +} + +func (x *StoreReq_Keep) GetFeedNum() int32 { + if x != nil { + return x.FeedNum + } + return 0 +} + +func (x *StoreReq_Keep) GetFeedCycle() int32 { + if x != nil { + return x.FeedCycle + } + return 0 +} + +func (x *StoreReq_Keep) GetMaxFeed() int32 { + if x != nil { + return x.MaxFeed + } + return 0 +} + +func (x *StoreReq_Keep) GetFeedGet() int32 { + if x != nil { + return x.FeedGet + } + return 0 +} + +func (x *StoreReq_Keep) GetFeedGetNum() int32 { + if x != nil { + return x.FeedGetNum + } + return 0 +} + +func (x *StoreReq_Keep) GetTalkText() []*StoreReq_Talk { + if x != nil { + return x.TalkText + } + return nil +} + +func (x *StoreReq_Keep) GetSteps() []*StoreReq_KeepStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *StoreReq_Keep) GetSecGetDayLimit() float64 { + if x != nil { + return x.SecGetDayLimit + } + return 0 +} + +func (x *StoreReq_Keep) GetMachineType() int32 { + if x != nil { + return x.MachineType + } + return 0 +} + +func (x *StoreReq_Keep) GetOfflineMin() int32 { + if x != nil { + return x.OfflineMin + } + return 0 +} + +func (x *StoreReq_Keep) GetOfflineGet() int32 { + if x != nil { + return x.OfflineGet + } + return 0 +} + +func (x *StoreReq_Keep) GetOfflineLimit() int32 { + if x != nil { + return x.OfflineLimit + } + return 0 +} + +type StoreReq_Invite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InviteType int32 `protobuf:"varint,1,opt,name=invite_type,json=inviteType,proto3" json:"invite_type,omitempty"` //邀请类型(1-下载,2-安装) + InviteGet int32 `protobuf:"varint,2,opt,name=invite_get,json=inviteGet,proto3" json:"invite_get,omitempty"` //邀请可获得的道具数量 + RewardSelected int32 `protobuf:"varint,3,opt,name=reward_selected,json=rewardSelected,proto3" json:"reward_selected,omitempty"` //选择礼品可获得的道具数 + FeedThird int32 `protobuf:"varint,4,opt,name=feed_third,json=feedThird,proto3" json:"feed_third,omitempty"` //喂养3次可获得的道具数 + DayFirstInvite int32 `protobuf:"varint,5,opt,name=day_first_invite,json=dayFirstInvite,proto3" json:"day_first_invite,omitempty"` //是否开启每日首次拉新(0-否,1-是) + DayFirstGet int32 `protobuf:"varint,6,opt,name=day_first_get,json=dayFirstGet,proto3" json:"day_first_get,omitempty"` //每日首次拉新可获得的道具数 + DayFirstSelected int32 `protobuf:"varint,7,opt,name=day_first_selected,json=dayFirstSelected,proto3" json:"day_first_selected,omitempty"` //每日首日选择礼物可获得的道具数 + DayFirstThird int32 `protobuf:"varint,8,opt,name=day_first_third,json=dayFirstThird,proto3" json:"day_first_third,omitempty"` //每日首次喂养三次可获得的道具数 + InviteMaxGet int32 `protobuf:"varint,9,opt,name=invite_max_get,json=inviteMaxGet,proto3" json:"invite_max_get,omitempty"` //邀请人可获得的最大道具数 +} + +func (x *StoreReq_Invite) Reset() { + *x = StoreReq_Invite{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[150] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Invite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Invite) ProtoMessage() {} + +func (x *StoreReq_Invite) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[150] + 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 StoreReq_Invite.ProtoReflect.Descriptor instead. +func (*StoreReq_Invite) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 57} +} + +func (x *StoreReq_Invite) GetInviteType() int32 { + if x != nil { + return x.InviteType + } + return 0 +} + +func (x *StoreReq_Invite) GetInviteGet() int32 { + if x != nil { + return x.InviteGet + } + return 0 +} + +func (x *StoreReq_Invite) GetRewardSelected() int32 { + if x != nil { + return x.RewardSelected + } + return 0 +} + +func (x *StoreReq_Invite) GetFeedThird() int32 { + if x != nil { + return x.FeedThird + } + return 0 +} + +func (x *StoreReq_Invite) GetDayFirstInvite() int32 { + if x != nil { + return x.DayFirstInvite + } + return 0 +} + +func (x *StoreReq_Invite) GetDayFirstGet() int32 { + if x != nil { + return x.DayFirstGet + } + return 0 +} + +func (x *StoreReq_Invite) GetDayFirstSelected() int32 { + if x != nil { + return x.DayFirstSelected + } + return 0 +} + +func (x *StoreReq_Invite) GetDayFirstThird() int32 { + if x != nil { + return x.DayFirstThird + } + return 0 +} + +func (x *StoreReq_Invite) GetInviteMaxGet() int32 { + if x != nil { + return x.InviteMaxGet + } + return 0 +} + +type StoreReq_Talk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextType int32 `protobuf:"varint,1,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 +} + +func (x *StoreReq_Talk) Reset() { + *x = StoreReq_Talk{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[151] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Talk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Talk) ProtoMessage() {} + +func (x *StoreReq_Talk) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[151] + 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 StoreReq_Talk.ProtoReflect.Descriptor instead. +func (*StoreReq_Talk) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 58} +} + +func (x *StoreReq_Talk) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *StoreReq_Talk) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type StoreReq_KeepStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Step int32 `protobuf:"varint,1,opt,name=step,proto3" json:"step,omitempty"` //阶段 + Percent int32 `protobuf:"varint,2,opt,name=percent,proto3" json:"percent,omitempty"` //对应的进度条数值 + RewardType int32 `protobuf:"varint,3,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品类型(1-成长道具,2-奖品) + Reward *StoreReq_Reward `protobuf:"bytes,4,opt,name=reward,proto3" json:"reward,omitempty"` //奖品数据时 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放道具数量 +} + +func (x *StoreReq_KeepStep) Reset() { + *x = StoreReq_KeepStep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[152] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_KeepStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_KeepStep) ProtoMessage() {} + +func (x *StoreReq_KeepStep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[152] + 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 StoreReq_KeepStep.ProtoReflect.Descriptor instead. +func (*StoreReq_KeepStep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 59} +} + +func (x *StoreReq_KeepStep) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *StoreReq_KeepStep) GetPercent() int32 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *StoreReq_KeepStep) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *StoreReq_KeepStep) GetReward() *StoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *StoreReq_KeepStep) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +type StoreReq_Push struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskReset *StoreReq_PushOne `protobuf:"bytes,1,opt,name=task_reset,json=taskReset,proto3" json:"task_reset,omitempty"` //重制提醒 + Active *StoreReq_PushOne `protobuf:"bytes,2,opt,name=active,proto3" json:"active,omitempty"` //活跃提醒 + Offline *StoreReq_PushOne `protobuf:"bytes,3,opt,name=offline,proto3" json:"offline,omitempty"` //离线提醒 + Visit *StoreReq_PushOne `protobuf:"bytes,4,opt,name=visit,proto3" json:"visit,omitempty"` //访问提醒 +} + +func (x *StoreReq_Push) Reset() { + *x = StoreReq_Push{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[153] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Push) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Push) ProtoMessage() {} + +func (x *StoreReq_Push) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[153] + 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 StoreReq_Push.ProtoReflect.Descriptor instead. +func (*StoreReq_Push) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 60} +} + +func (x *StoreReq_Push) GetTaskReset() *StoreReq_PushOne { + if x != nil { + return x.TaskReset + } + return nil +} + +func (x *StoreReq_Push) GetActive() *StoreReq_PushOne { + if x != nil { + return x.Active + } + return nil +} + +func (x *StoreReq_Push) GetOffline() *StoreReq_PushOne { + if x != nil { + return x.Offline + } + return nil +} + +func (x *StoreReq_Push) GetVisit() *StoreReq_PushOne { + if x != nil { + return x.Visit + } + return nil +} + +type StoreReq_PushOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + PushCond []*StoreReq_PushCond `protobuf:"bytes,2,rep,name=push_cond,json=pushCond,proto3" json:"push_cond,omitempty"` //条件内容 +} + +func (x *StoreReq_PushOne) Reset() { + *x = StoreReq_PushOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[154] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_PushOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_PushOne) ProtoMessage() {} + +func (x *StoreReq_PushOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[154] + 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 StoreReq_PushOne.ProtoReflect.Descriptor instead. +func (*StoreReq_PushOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 61} +} + +func (x *StoreReq_PushOne) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *StoreReq_PushOne) GetPushCond() []*StoreReq_PushCond { + if x != nil { + return x.PushCond + } + return nil +} + +type StoreReq_PushCond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //条件标识 + Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"` //标识值 +} + +func (x *StoreReq_PushCond) Reset() { + *x = StoreReq_PushCond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[155] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_PushCond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_PushCond) ProtoMessage() {} + +func (x *StoreReq_PushCond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[155] + 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 StoreReq_PushCond.ProtoReflect.Descriptor instead. +func (*StoreReq_PushCond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 62} +} + +func (x *StoreReq_PushCond) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *StoreReq_PushCond) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type StoreReq_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GoldNum int32 `protobuf:"varint,1,opt,name=gold_num,json=goldNum,proto3" json:"gold_num,omitempty"` //任务重置天数 + ExpiredDay int32 `protobuf:"varint,2,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //任务重置天数 + Price float64 `protobuf:"fixed64,3,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + PriceNum int32 `protobuf:"varint,4,opt,name=price_num,json=priceNum,proto3" json:"price_num,omitempty"` //奖品总份额 + Currency int32 `protobuf:"varint,5,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *StoreReq_Gold) Reset() { + *x = StoreReq_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[156] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Gold) ProtoMessage() {} + +func (x *StoreReq_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[156] + 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 StoreReq_Gold.ProtoReflect.Descriptor instead. +func (*StoreReq_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 63} +} + +func (x *StoreReq_Gold) GetGoldNum() int32 { + if x != nil { + return x.GoldNum + } + return 0 +} + +func (x *StoreReq_Gold) GetExpiredDay() int32 { + if x != nil { + return x.ExpiredDay + } + return 0 +} + +func (x *StoreReq_Gold) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *StoreReq_Gold) GetPriceNum() int32 { + if x != nil { + return x.PriceNum + } + return 0 +} + +func (x *StoreReq_Gold) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type StoreReq_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CoinImg string `protobuf:"bytes,1,opt,name=coin_img,json=coinImg,proto3" json:"coin_img,omitempty"` //金币图片 + OpenDays int32 `protobuf:"varint,2,opt,name=open_days,json=openDays,proto3" json:"open_days,omitempty"` //开奖天数 + OpenLimit int32 `protobuf:"varint,3,opt,name=open_limit,json=openLimit,proto3" json:"open_limit,omitempty"` //开奖次数限制 + InitCoin int32 `protobuf:"varint,4,opt,name=init_coin,json=initCoin,proto3" json:"init_coin,omitempty"` //初始金币数 + InitUse int32 `protobuf:"varint,5,opt,name=init_use,json=initUse,proto3" json:"init_use,omitempty"` //初始投放次数 + UseCoin int32 `protobuf:"varint,6,opt,name=use_coin,json=useCoin,proto3" json:"use_coin,omitempty"` //单次投放消耗金币数 + UseLimit int32 `protobuf:"varint,7,opt,name=use_limit,json=useLimit,proto3" json:"use_limit,omitempty"` //单次瓜分最多投放次数 + UrlId int64 `protobuf:"varint,8,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + LackBtn []int32 `protobuf:"varint,9,rep,packed,name=lack_btn,json=lackBtn,proto3" json:"lack_btn,omitempty"` //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2] + CustomBtnText string `protobuf:"bytes,10,opt,name=custom_btn_text,json=customBtnText,proto3" json:"custom_btn_text,omitempty"` //自定义按钮文案 + CustomWebUrl string `protobuf:"bytes,11,opt,name=custom_web_url,json=customWebUrl,proto3" json:"custom_web_url,omitempty"` //自定义web端url + CustomExtraParam string `protobuf:"bytes,12,opt,name=custom_extra_param,json=customExtraParam,proto3" json:"custom_extra_param,omitempty"` //自定义app附加参数 + CustomPcParam string `protobuf:"bytes,13,opt,name=custom_pc_param,json=customPcParam,proto3" json:"custom_pc_param,omitempty"` //自定义pc附加参数 +} + +func (x *StoreReq_Coin) Reset() { + *x = StoreReq_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[157] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Coin) ProtoMessage() {} + +func (x *StoreReq_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[157] + 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 StoreReq_Coin.ProtoReflect.Descriptor instead. +func (*StoreReq_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{8, 64} +} + +func (x *StoreReq_Coin) GetCoinImg() string { + if x != nil { + return x.CoinImg + } + return "" +} + +func (x *StoreReq_Coin) GetOpenDays() int32 { + if x != nil { + return x.OpenDays + } + return 0 +} + +func (x *StoreReq_Coin) GetOpenLimit() int32 { + if x != nil { + return x.OpenLimit + } + return 0 +} + +func (x *StoreReq_Coin) GetInitCoin() int32 { + if x != nil { + return x.InitCoin + } + return 0 +} + +func (x *StoreReq_Coin) GetInitUse() int32 { + if x != nil { + return x.InitUse + } + return 0 +} + +func (x *StoreReq_Coin) GetUseCoin() int32 { + if x != nil { + return x.UseCoin + } + return 0 +} + +func (x *StoreReq_Coin) GetUseLimit() int32 { + if x != nil { + return x.UseLimit + } + return 0 +} + +func (x *StoreReq_Coin) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *StoreReq_Coin) GetLackBtn() []int32 { + if x != nil { + return x.LackBtn + } + return nil +} + +func (x *StoreReq_Coin) GetCustomBtnText() string { + if x != nil { + return x.CustomBtnText + } + return "" +} + +func (x *StoreReq_Coin) GetCustomWebUrl() string { + if x != nil { + return x.CustomWebUrl + } + return "" +} + +func (x *StoreReq_Coin) GetCustomExtraParam() string { + if x != nil { + return x.CustomExtraParam + } + return "" +} + +func (x *StoreReq_Coin) GetCustomPcParam() string { + if x != nil { + return x.CustomPcParam + } + return "" +} + +type UpdateReq_GashaponStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + MachineImg string `protobuf:"bytes,4,opt,name=machine_img,json=machineImg,proto3" json:"machine_img,omitempty"` //机器图 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + EggType int32 `protobuf:"varint,6,opt,name=egg_type,json=eggType,proto3" json:"egg_type,omitempty"` //类型 + EggImgs []string `protobuf:"bytes,7,rep,name=egg_imgs,json=eggImgs,proto3" json:"egg_imgs,omitempty"` //扭蛋素材 +} + +func (x *UpdateReq_GashaponStyle) Reset() { + *x = UpdateReq_GashaponStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[158] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_GashaponStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_GashaponStyle) ProtoMessage() {} + +func (x *UpdateReq_GashaponStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[158] + 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 UpdateReq_GashaponStyle.ProtoReflect.Descriptor instead. +func (*UpdateReq_GashaponStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *UpdateReq_GashaponStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *UpdateReq_GashaponStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *UpdateReq_GashaponStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *UpdateReq_GashaponStyle) GetMachineImg() string { + if x != nil { + return x.MachineImg + } + return "" +} + +func (x *UpdateReq_GashaponStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *UpdateReq_GashaponStyle) GetEggType() int32 { + if x != nil { + return x.EggType + } + return 0 +} + +func (x *UpdateReq_GashaponStyle) GetEggImgs() []string { + if x != nil { + return x.EggImgs + } + return nil +} + +type UpdateReq_Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FirstVisit *UpdateReq_EventOne `protobuf:"bytes,1,opt,name=first_visit,json=firstVisit,proto3" json:"first_visit,omitempty"` //首次访问 +} + +func (x *UpdateReq_Event) Reset() { + *x = UpdateReq_Event{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[159] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Event) ProtoMessage() {} + +func (x *UpdateReq_Event) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[159] + 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 UpdateReq_Event.ProtoReflect.Descriptor instead. +func (*UpdateReq_Event) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *UpdateReq_Event) GetFirstVisit() *UpdateReq_EventOne { + if x != nil { + return x.FirstVisit + } + return nil +} + +type UpdateReq_EventOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + Rewards []*UpdateReq_EventReward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖励 +} + +func (x *UpdateReq_EventOne) Reset() { + *x = UpdateReq_EventOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[160] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_EventOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_EventOne) ProtoMessage() {} + +func (x *UpdateReq_EventOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[160] + 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 UpdateReq_EventOne.ProtoReflect.Descriptor instead. +func (*UpdateReq_EventOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 2} +} + +func (x *UpdateReq_EventOne) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_EventOne) GetRewards() []*UpdateReq_EventReward { + if x != nil { + return x.Rewards + } + return nil +} + +type UpdateReq_EventReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + PropMark string `protobuf:"bytes,2,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward *UpdateReq_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 + ExpiredDay string `protobuf:"bytes,5,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 +} + +func (x *UpdateReq_EventReward) Reset() { + *x = UpdateReq_EventReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[161] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_EventReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_EventReward) ProtoMessage() {} + +func (x *UpdateReq_EventReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[161] + 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 UpdateReq_EventReward.ProtoReflect.Descriptor instead. +func (*UpdateReq_EventReward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 3} +} + +func (x *UpdateReq_EventReward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_EventReward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *UpdateReq_EventReward) GetReward() *UpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *UpdateReq_EventReward) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_EventReward) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +type UpdateReq_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖次数 + PropMarks []string `protobuf:"bytes,2,rep,name=prop_marks,json=propMarks,proto3" json:"prop_marks,omitempty"` //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌) + Red *UpdateReq_UnoGroup `protobuf:"bytes,3,opt,name=red,proto3" json:"red,omitempty"` //红牌配置 + Yellow *UpdateReq_UnoGroup `protobuf:"bytes,4,opt,name=yellow,proto3" json:"yellow,omitempty"` //黄牌配置 + Blue *UpdateReq_UnoGroup `protobuf:"bytes,5,opt,name=blue,proto3" json:"blue,omitempty"` //黑牌配置 + Green *UpdateReq_UnoGroup `protobuf:"bytes,6,opt,name=green,proto3" json:"green,omitempty"` //绿牌配置 +} + +func (x *UpdateReq_Uno) Reset() { + *x = UpdateReq_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[162] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Uno) ProtoMessage() {} + +func (x *UpdateReq_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[162] + 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 UpdateReq_Uno.ProtoReflect.Descriptor instead. +func (*UpdateReq_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 4} +} + +func (x *UpdateReq_Uno) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_Uno) GetPropMarks() []string { + if x != nil { + return x.PropMarks + } + return nil +} + +func (x *UpdateReq_Uno) GetRed() *UpdateReq_UnoGroup { + if x != nil { + return x.Red + } + return nil +} + +func (x *UpdateReq_Uno) GetYellow() *UpdateReq_UnoGroup { + if x != nil { + return x.Yellow + } + return nil +} + +func (x *UpdateReq_Uno) GetBlue() *UpdateReq_UnoGroup { + if x != nil { + return x.Blue + } + return nil +} + +func (x *UpdateReq_Uno) GetGreen() *UpdateReq_UnoGroup { + if x != nil { + return x.Green + } + return nil +} + +type UpdateReq_UnoGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //牌型id + Odds string `protobuf:"bytes,2,opt,name=odds,proto3" json:"odds,omitempty"` //获得牌型概率 + Reward *UpdateReq_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + OpenRule int32 `protobuf:"varint,4,opt,name=open_rule,json=openRule,proto3" json:"open_rule,omitempty"` //是否开启得牌规则(0-否,1-是) + LimitRule *UpdateReq_UnoLimitRule `protobuf:"bytes,5,opt,name=limit_rule,json=limitRule,proto3" json:"limit_rule,omitempty"` //得牌规则 + CustomCard int32 `protobuf:"varint,6,opt,name=custom_card,json=customCard,proto3" json:"custom_card,omitempty"` //自定义卡牌(0-否,1-是) + Cards []*UpdateReq_UnoCard `protobuf:"bytes,7,rep,name=cards,proto3" json:"cards,omitempty"` //自定义卡牌 +} + +func (x *UpdateReq_UnoGroup) Reset() { + *x = UpdateReq_UnoGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[163] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_UnoGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_UnoGroup) ProtoMessage() {} + +func (x *UpdateReq_UnoGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[163] + 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 UpdateReq_UnoGroup.ProtoReflect.Descriptor instead. +func (*UpdateReq_UnoGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 5} +} + +func (x *UpdateReq_UnoGroup) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_UnoGroup) GetOdds() string { + if x != nil { + return x.Odds + } + return "" +} + +func (x *UpdateReq_UnoGroup) GetReward() *UpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *UpdateReq_UnoGroup) GetOpenRule() int32 { + if x != nil { + return x.OpenRule + } + return 0 +} + +func (x *UpdateReq_UnoGroup) GetLimitRule() *UpdateReq_UnoLimitRule { + if x != nil { + return x.LimitRule + } + return nil +} + +func (x *UpdateReq_UnoGroup) GetCustomCard() int32 { + if x != nil { + return x.CustomCard + } + return 0 +} + +func (x *UpdateReq_UnoGroup) GetCards() []*UpdateReq_UnoCard { + if x != nil { + return x.Cards + } + return nil +} + +type UpdateReq_UnoLimitRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitNum int32 `protobuf:"varint,1,opt,name=init_num,json=initNum,proto3" json:"init_num,omitempty"` //初始的最大可获得牌型数 + SignDay int32 `protobuf:"varint,2,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + AddNum int32 `protobuf:"varint,3,opt,name=add_num,json=addNum,proto3" json:"add_num,omitempty"` //完成条件可获得最大牌型数 + ResetType int32 `protobuf:"varint,4,opt,name=reset_type,json=resetType,proto3" json:"reset_type,omitempty"` //重置规则(1-不重置,2-获奖后重置) +} + +func (x *UpdateReq_UnoLimitRule) Reset() { + *x = UpdateReq_UnoLimitRule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[164] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_UnoLimitRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_UnoLimitRule) ProtoMessage() {} + +func (x *UpdateReq_UnoLimitRule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[164] + 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 UpdateReq_UnoLimitRule.ProtoReflect.Descriptor instead. +func (*UpdateReq_UnoLimitRule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 6} +} + +func (x *UpdateReq_UnoLimitRule) GetInitNum() int32 { + if x != nil { + return x.InitNum + } + return 0 +} + +func (x *UpdateReq_UnoLimitRule) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *UpdateReq_UnoLimitRule) GetAddNum() int32 { + if x != nil { + return x.AddNum + } + return 0 +} + +func (x *UpdateReq_UnoLimitRule) GetResetType() int32 { + if x != nil { + return x.ResetType + } + return 0 +} + +type UpdateReq_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //牌id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //跳转按钮文案 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web跳转地址 + AppParam string `protobuf:"bytes,5,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App跳转参数 + PcParam string `protobuf:"bytes,6,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc跳转参数 +} + +func (x *UpdateReq_UnoCard) Reset() { + *x = UpdateReq_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[165] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_UnoCard) ProtoMessage() {} + +func (x *UpdateReq_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[165] + 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 UpdateReq_UnoCard.ProtoReflect.Descriptor instead. +func (*UpdateReq_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 7} +} + +func (x *UpdateReq_UnoCard) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq_UnoCard) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UpdateReq_UnoCard) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *UpdateReq_UnoCard) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *UpdateReq_UnoCard) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type UpdateReq_Vs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始投票次数 + EachLimitNum int32 `protobuf:"varint,2,opt,name=each_limit_num,json=eachLimitNum,proto3" json:"each_limit_num,omitempty"` //每场可投票次数 + OpenPoint int32 `protobuf:"varint,3,opt,name=open_point,json=openPoint,proto3" json:"open_point,omitempty"` //是否开启积分(0-否,1-是) + PointsNum int32 `protobuf:"varint,4,opt,name=points_num,json=pointsNum,proto3" json:"points_num,omitempty"` //投票扣除积分数 + MallOpen int32 `protobuf:"varint,5,opt,name=mall_open,json=mallOpen,proto3" json:"mall_open,omitempty"` //是否使用积分商城(0-否,1-是) + MallId int64 `protobuf:"varint,6,opt,name=mall_id,json=mallId,proto3" json:"mall_id,omitempty"` //兑换商城id + VsTz int32 `protobuf:"varint,7,opt,name=vs_tz,json=vsTz,proto3" json:"vs_tz,omitempty"` //比赛时区 + ClaimType int32 `protobuf:"varint,8,opt,name=claim_type,json=claimType,proto3" json:"claim_type,omitempty"` //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + Schedules []*UpdateReq_Schedule `protobuf:"bytes,9,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛事时间表 + IconMall string `protobuf:"bytes,10,opt,name=icon_mall,json=iconMall,proto3" json:"icon_mall,omitempty"` //商城图标 + IconReward string `protobuf:"bytes,11,opt,name=icon_reward,json=iconReward,proto3" json:"icon_reward,omitempty"` //奖励记录图标 + IconSchedule string `protobuf:"bytes,12,opt,name=icon_schedule,json=iconSchedule,proto3" json:"icon_schedule,omitempty"` //赛程图标 +} + +func (x *UpdateReq_Vs) Reset() { + *x = UpdateReq_Vs{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[166] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Vs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Vs) ProtoMessage() {} + +func (x *UpdateReq_Vs) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[166] + 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 UpdateReq_Vs.ProtoReflect.Descriptor instead. +func (*UpdateReq_Vs) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 8} +} + +func (x *UpdateReq_Vs) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_Vs) GetEachLimitNum() int32 { + if x != nil { + return x.EachLimitNum + } + return 0 +} + +func (x *UpdateReq_Vs) GetOpenPoint() int32 { + if x != nil { + return x.OpenPoint + } + return 0 +} + +func (x *UpdateReq_Vs) GetPointsNum() int32 { + if x != nil { + return x.PointsNum + } + return 0 +} + +func (x *UpdateReq_Vs) GetMallOpen() int32 { + if x != nil { + return x.MallOpen + } + return 0 +} + +func (x *UpdateReq_Vs) GetMallId() int64 { + if x != nil { + return x.MallId + } + return 0 +} + +func (x *UpdateReq_Vs) GetVsTz() int32 { + if x != nil { + return x.VsTz + } + return 0 +} + +func (x *UpdateReq_Vs) GetClaimType() int32 { + if x != nil { + return x.ClaimType + } + return 0 +} + +func (x *UpdateReq_Vs) GetSchedules() []*UpdateReq_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *UpdateReq_Vs) GetIconMall() string { + if x != nil { + return x.IconMall + } + return "" +} + +func (x *UpdateReq_Vs) GetIconReward() string { + if x != nil { + return x.IconReward + } + return "" +} + +func (x *UpdateReq_Vs) GetIconSchedule() string { + if x != nil { + return x.IconSchedule + } + return "" +} + +type UpdateReq_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PkTeams []*UpdateReq_PkTeam `protobuf:"bytes,1,rep,name=pk_teams,json=pkTeams,proto3" json:"pk_teams,omitempty"` //队伍 +} + +func (x *UpdateReq_Schedule) Reset() { + *x = UpdateReq_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[167] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Schedule) ProtoMessage() {} + +func (x *UpdateReq_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[167] + 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 UpdateReq_Schedule.ProtoReflect.Descriptor instead. +func (*UpdateReq_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 9} +} + +func (x *UpdateReq_Schedule) GetPkTeams() []*UpdateReq_PkTeam { + if x != nil { + return x.PkTeams + } + return nil +} + +type UpdateReq_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Teams []*UpdateReq_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + VoteStart string `protobuf:"bytes,3,opt,name=vote_start,json=voteStart,proto3" json:"vote_start,omitempty"` //开始时间 + VoteEnd string `protobuf:"bytes,4,opt,name=vote_end,json=voteEnd,proto3" json:"vote_end,omitempty"` //结束时间 + VsDate string `protobuf:"bytes,5,opt,name=vs_date,json=vsDate,proto3" json:"vs_date,omitempty"` //比赛开始时间 + VsImg string `protobuf:"bytes,6,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //比赛图 + Desc string `protobuf:"bytes,7,opt,name=desc,proto3" json:"desc,omitempty"` //标题描述 + PropMark string `protobuf:"bytes,8,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(reward-奖品,point-积分) + RewardId int64 `protobuf:"varint,9,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库奖品id + PropNum int32 `protobuf:"varint,10,opt,name=prop_num,json=propNum,proto3" json:"prop_num,omitempty"` //道具数量 + ExpiredDay string `protobuf:"bytes,11,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + OtherVote []string `protobuf:"bytes,12,rep,name=other_vote,json=otherVote,proto3" json:"other_vote,omitempty"` //其他投票方式 + OpenOdds int32 `protobuf:"varint,13,opt,name=open_odds,json=openOdds,proto3" json:"open_odds,omitempty"` //是否开启赔率(0-否,1-是) + OddsLeft string `protobuf:"bytes,14,opt,name=odds_left,json=oddsLeft,proto3" json:"odds_left,omitempty"` //左边赔率 + OddsRight string `protobuf:"bytes,15,opt,name=odds_right,json=oddsRight,proto3" json:"odds_right,omitempty"` //右边赔率 + OddsDraw string `protobuf:"bytes,16,opt,name=odds_draw,json=oddsDraw,proto3" json:"odds_draw,omitempty"` //平局赔率 +} + +func (x *UpdateReq_PkTeam) Reset() { + *x = UpdateReq_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[168] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_PkTeam) ProtoMessage() {} + +func (x *UpdateReq_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[168] + 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 UpdateReq_PkTeam.ProtoReflect.Descriptor instead. +func (*UpdateReq_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 10} +} + +func (x *UpdateReq_PkTeam) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_PkTeam) GetTeams() []*UpdateReq_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *UpdateReq_PkTeam) GetVoteStart() string { + if x != nil { + return x.VoteStart + } + return "" +} + +func (x *UpdateReq_PkTeam) GetVoteEnd() string { + if x != nil { + return x.VoteEnd + } + return "" +} + +func (x *UpdateReq_PkTeam) GetVsDate() string { + if x != nil { + return x.VsDate + } + return "" +} + +func (x *UpdateReq_PkTeam) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *UpdateReq_PkTeam) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UpdateReq_PkTeam) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *UpdateReq_PkTeam) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *UpdateReq_PkTeam) GetPropNum() int32 { + if x != nil { + return x.PropNum + } + return 0 +} + +func (x *UpdateReq_PkTeam) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *UpdateReq_PkTeam) GetOtherVote() []string { + if x != nil { + return x.OtherVote + } + return nil +} + +func (x *UpdateReq_PkTeam) GetOpenOdds() int32 { + if x != nil { + return x.OpenOdds + } + return 0 +} + +func (x *UpdateReq_PkTeam) GetOddsLeft() string { + if x != nil { + return x.OddsLeft + } + return "" +} + +func (x *UpdateReq_PkTeam) GetOddsRight() string { + if x != nil { + return x.OddsRight + } + return "" +} + +func (x *UpdateReq_PkTeam) GetOddsDraw() string { + if x != nil { + return x.OddsDraw + } + return "" +} + +type UpdateReq_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *UpdateReq_Team) Reset() { + *x = UpdateReq_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[169] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Team) ProtoMessage() {} + +func (x *UpdateReq_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[169] + 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 UpdateReq_Team.ProtoReflect.Descriptor instead. +func (*UpdateReq_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 11} +} + +func (x *UpdateReq_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateReq_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type UpdateReq_Chat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启ai陪伴(0-关闭,1-开启) + HeaderImg string `protobuf:"bytes,2,opt,name=header_img,json=headerImg,proto3" json:"header_img,omitempty"` //宠物头像 + ChatBg string `protobuf:"bytes,3,opt,name=chat_bg,json=chatBg,proto3" json:"chat_bg,omitempty"` //聊天背景 + DayLimit int32 `protobuf:"varint,4,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日聊天上限 +} + +func (x *UpdateReq_Chat) Reset() { + *x = UpdateReq_Chat{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[170] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Chat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Chat) ProtoMessage() {} + +func (x *UpdateReq_Chat) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[170] + 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 UpdateReq_Chat.ProtoReflect.Descriptor instead. +func (*UpdateReq_Chat) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 12} +} + +func (x *UpdateReq_Chat) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_Chat) GetHeaderImg() string { + if x != nil { + return x.HeaderImg + } + return "" +} + +func (x *UpdateReq_Chat) GetChatBg() string { + if x != nil { + return x.ChatBg + } + return "" +} + +func (x *UpdateReq_Chat) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +type UpdateReq_PointsUse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启积分消耗(0-否,1-是) + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` //积分icon图 + UrlId int64 `protobuf:"varint,3,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + UseNum int32 `protobuf:"varint,4,opt,name=use_num,json=useNum,proto3" json:"use_num,omitempty"` //单次兑换使用积分数量 + DayLimit int32 `protobuf:"varint,5,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日可兑换次数 + TotalLimit int32 `protobuf:"varint,6,opt,name=total_limit,json=totalLimit,proto3" json:"total_limit,omitempty"` //总兑换次数 +} + +func (x *UpdateReq_PointsUse) Reset() { + *x = UpdateReq_PointsUse{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[171] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_PointsUse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_PointsUse) ProtoMessage() {} + +func (x *UpdateReq_PointsUse) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[171] + 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 UpdateReq_PointsUse.ProtoReflect.Descriptor instead. +func (*UpdateReq_PointsUse) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 13} +} + +func (x *UpdateReq_PointsUse) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_PointsUse) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *UpdateReq_PointsUse) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *UpdateReq_PointsUse) GetUseNum() int32 { + if x != nil { + return x.UseNum + } + return 0 +} + +func (x *UpdateReq_PointsUse) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *UpdateReq_PointsUse) GetTotalLimit() int32 { + if x != nil { + return x.TotalLimit + } + return 0 +} + +type UpdateReq_FlipStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `protobuf:"bytes,4,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + CardImg string `protobuf:"bytes,6,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡片素材 +} + +func (x *UpdateReq_FlipStyle) Reset() { + *x = UpdateReq_FlipStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[172] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_FlipStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_FlipStyle) ProtoMessage() {} + +func (x *UpdateReq_FlipStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[172] + 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 UpdateReq_FlipStyle.ProtoReflect.Descriptor instead. +func (*UpdateReq_FlipStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 14} +} + +func (x *UpdateReq_FlipStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *UpdateReq_FlipStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *UpdateReq_FlipStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *UpdateReq_FlipStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *UpdateReq_FlipStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *UpdateReq_FlipStyle) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +type UpdateReq_GridStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `protobuf:"bytes,4,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + DisablePlayImg string `protobuf:"bytes,6,opt,name=disable_play_img,json=disablePlayImg,proto3" json:"disable_play_img,omitempty"` //Go按钮禁用 + MachineImg string `protobuf:"bytes,7,opt,name=machine_img,json=machineImg,proto3" json:"machine_img,omitempty"` //机器图 + GridImg string `protobuf:"bytes,8,opt,name=grid_img,json=gridImg,proto3" json:"grid_img,omitempty"` //方格图 + ActivateImg string `protobuf:"bytes,9,opt,name=activate_img,json=activateImg,proto3" json:"activate_img,omitempty"` //方格激活图 +} + +func (x *UpdateReq_GridStyle) Reset() { + *x = UpdateReq_GridStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[173] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_GridStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_GridStyle) ProtoMessage() {} + +func (x *UpdateReq_GridStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[173] + 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 UpdateReq_GridStyle.ProtoReflect.Descriptor instead. +func (*UpdateReq_GridStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 15} +} + +func (x *UpdateReq_GridStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *UpdateReq_GridStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *UpdateReq_GridStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *UpdateReq_GridStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *UpdateReq_GridStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *UpdateReq_GridStyle) GetDisablePlayImg() string { + if x != nil { + return x.DisablePlayImg + } + return "" +} + +func (x *UpdateReq_GridStyle) GetMachineImg() string { + if x != nil { + return x.MachineImg + } + return "" +} + +func (x *UpdateReq_GridStyle) GetGridImg() string { + if x != nil { + return x.GridImg + } + return "" +} + +func (x *UpdateReq_GridStyle) GetActivateImg() string { + if x != nil { + return x.ActivateImg + } + return "" +} + +type UpdateReq_WheelStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + Bottom1 string `protobuf:"bytes,4,opt,name=bottom1,proto3" json:"bottom1,omitempty"` //底部颜色1 + Bottom2 string `protobuf:"bytes,5,opt,name=bottom2,proto3" json:"bottom2,omitempty"` //底部颜色2 + Bottom3 string `protobuf:"bytes,6,opt,name=bottom3,proto3" json:"bottom3,omitempty"` //底部颜色3 + Pointer string `protobuf:"bytes,7,opt,name=pointer,proto3" json:"pointer,omitempty"` //指针图片 + PlayBtn string `protobuf:"bytes,8,opt,name=play_btn,json=playBtn,proto3" json:"play_btn,omitempty"` //玩法按钮图片 + BorderImg string `protobuf:"bytes,9,opt,name=border_img,json=borderImg,proto3" json:"border_img,omitempty"` //边框图片 + ButtonColor string `protobuf:"bytes,10,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + WheelTextColor string `protobuf:"bytes,11,opt,name=wheel_text_color,json=wheelTextColor,proto3" json:"wheel_text_color,omitempty"` //转盘文字颜色 +} + +func (x *UpdateReq_WheelStyle) Reset() { + *x = UpdateReq_WheelStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[174] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_WheelStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_WheelStyle) ProtoMessage() {} + +func (x *UpdateReq_WheelStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[174] + 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 UpdateReq_WheelStyle.ProtoReflect.Descriptor instead. +func (*UpdateReq_WheelStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 16} +} + +func (x *UpdateReq_WheelStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetBottom1() string { + if x != nil { + return x.Bottom1 + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetBottom2() string { + if x != nil { + return x.Bottom2 + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetBottom3() string { + if x != nil { + return x.Bottom3 + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetPointer() string { + if x != nil { + return x.Pointer + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetPlayBtn() string { + if x != nil { + return x.PlayBtn + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetBorderImg() string { + if x != nil { + return x.BorderImg + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *UpdateReq_WheelStyle) GetWheelTextColor() string { + if x != nil { + return x.WheelTextColor + } + return "" +} + +type UpdateReq_Child struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + ChildType int32 `protobuf:"varint,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 +} + +func (x *UpdateReq_Child) Reset() { + *x = UpdateReq_Child{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[175] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Child) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Child) ProtoMessage() {} + +func (x *UpdateReq_Child) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[175] + 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 UpdateReq_Child.ProtoReflect.Descriptor instead. +func (*UpdateReq_Child) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 17} +} + +func (x *UpdateReq_Child) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateReq_Child) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +type UpdateReq_Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RuleTextColor string `protobuf:"bytes,1,opt,name=rule_text_color,json=ruleTextColor,proto3" json:"rule_text_color,omitempty"` //规则文字颜色 + RuleBgColor string `protobuf:"bytes,2,opt,name=rule_bg_color,json=ruleBgColor,proto3" json:"rule_bg_color,omitempty"` //规则背景颜色 + ShareText string `protobuf:"bytes,3,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,4,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + HasRank int32 `protobuf:"varint,5,opt,name=has_rank,json=hasRank,proto3" json:"has_rank,omitempty"` //是否展示中奖纪录(1-是,0-否) + RankBackgroundColor string `protobuf:"bytes,6,opt,name=rank_background_color,json=rankBackgroundColor,proto3" json:"rank_background_color,omitempty"` //排行榜背景颜色 + RankTextColor string `protobuf:"bytes,7,opt,name=rank_text_color,json=rankTextColor,proto3" json:"rank_text_color,omitempty"` //排行榜背景颜色 + DownloadPageImage string `protobuf:"bytes,8,opt,name=download_page_image,json=downloadPageImage,proto3" json:"download_page_image,omitempty"` //下载引导页的图片 + IsDefaultDownload int32 `protobuf:"varint,9,opt,name=is_default_download,json=isDefaultDownload,proto3" json:"is_default_download,omitempty"` //是否使用默认下载图(1-是,0-否) + WechatPageImage string `protobuf:"bytes,10,opt,name=wechat_page_image,json=wechatPageImage,proto3" json:"wechat_page_image,omitempty"` //微信引导页的图片 + IsDefaultWechat int32 `protobuf:"varint,11,opt,name=is_default_wechat,json=isDefaultWechat,proto3" json:"is_default_wechat,omitempty"` //是否使用默认微信引导图(1-是,0-否) + ImageMain string `protobuf:"bytes,12,opt,name=image_main,json=imageMain,proto3" json:"image_main,omitempty"` //活动主图 + IsDefaultMain int32 `protobuf:"varint,13,opt,name=is_default_main,json=isDefaultMain,proto3" json:"is_default_main,omitempty"` //是否使用默认活动主图(1-是,0-否) + ImagePreview string `protobuf:"bytes,14,opt,name=image_preview,json=imagePreview,proto3" json:"image_preview,omitempty"` //问题页背景图 + LinkBtnTextColor string `protobuf:"bytes,15,opt,name=link_btn_text_color,json=linkBtnTextColor,proto3" json:"link_btn_text_color,omitempty"` //分享链接按钮文字颜色 + LinkBtnBgColor string `protobuf:"bytes,16,opt,name=link_btn_bg_color,json=linkBtnBgColor,proto3" json:"link_btn_bg_color,omitempty"` //分享链接按钮背景颜色 + LinkTextColor string `protobuf:"bytes,17,opt,name=link_text_color,json=linkTextColor,proto3" json:"link_text_color,omitempty"` //分享链接文字颜色 + ShowShare int32 `protobuf:"varint,18,opt,name=show_share,json=showShare,proto3" json:"show_share,omitempty"` //是否显示分享社交媒体(0-否,1-是) + Share []int64 `protobuf:"varint,19,rep,packed,name=share,proto3" json:"share,omitempty"` //要分享的社交媒体,例如[1,2,3] + PlayRule string `protobuf:"bytes,20,opt,name=play_rule,json=playRule,proto3" json:"play_rule,omitempty"` //玩法规则 + PageTitle string `protobuf:"bytes,21,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + DmShow int32 `protobuf:"varint,22,opt,name=dm_show,json=dmShow,proto3" json:"dm_show,omitempty"` //是否显示弹幕(0-否,1-是) + WebBgImg string `protobuf:"bytes,23,opt,name=web_bg_img,json=webBgImg,proto3" json:"web_bg_img,omitempty"` //站外活动背景图 + HasWarmUp int32 `protobuf:"varint,24,opt,name=has_warm_up,json=hasWarmUp,proto3" json:"has_warm_up,omitempty"` //是否预热(0-否,1-是) + WarmUpImg string `protobuf:"bytes,25,opt,name=warm_up_img,json=warmUpImg,proto3" json:"warm_up_img,omitempty"` //预热海报图 + WarmUpEnd int32 `protobuf:"varint,26,opt,name=warm_up_end,json=warmUpEnd,proto3" json:"warm_up_end,omitempty"` //活动开始前多少分钟结束预热 + IconType int32 `protobuf:"varint,27,opt,name=icon_type,json=iconType,proto3" json:"icon_type,omitempty"` //活动挂件类型(用于前端挂件选用判断) + IconBgColor string `protobuf:"bytes,28,opt,name=icon_bg_color,json=iconBgColor,proto3" json:"icon_bg_color,omitempty"` //活动挂件背景色 + DlType int32 `protobuf:"varint,29,opt,name=dl_type,json=dlType,proto3" json:"dl_type,omitempty"` //下载引导页类型(1-通用,2-自定义多媒体) + DlBannerType int32 `protobuf:"varint,30,opt,name=dl_banner_type,json=dlBannerType,proto3" json:"dl_banner_type,omitempty"` //下载页横幅类型(1-默认,2-自定义) + DlBannerImg string `protobuf:"bytes,31,opt,name=dl_banner_img,json=dlBannerImg,proto3" json:"dl_banner_img,omitempty"` //下载页横幅自定义图 + DlBannerAppLogo string `protobuf:"bytes,32,opt,name=dl_banner_app_logo,json=dlBannerAppLogo,proto3" json:"dl_banner_app_logo,omitempty"` //下载页横幅applogo图片 + DlBannerAppName string `protobuf:"bytes,33,opt,name=dl_banner_app_name,json=dlBannerAppName,proto3" json:"dl_banner_app_name,omitempty"` //下载页横幅app名称 + DlBannerAppBtn string `protobuf:"bytes,34,opt,name=dl_banner_app_btn,json=dlBannerAppBtn,proto3" json:"dl_banner_app_btn,omitempty"` //下载页横幅app按钮文案 + DlBannerPosition int32 `protobuf:"varint,35,opt,name=dl_banner_position,json=dlBannerPosition,proto3" json:"dl_banner_position,omitempty"` //下载页横幅位置(1-顶部,2-底部) + TopicColor string `protobuf:"bytes,36,opt,name=topic_color,json=topicColor,proto3" json:"topic_color,omitempty"` //主题色 + WindowCover int32 `protobuf:"varint,37,opt,name=window_cover,json=windowCover,proto3" json:"window_cover,omitempty"` //是否显示弹幕(0-否,1-是) + IconOpen []int32 `protobuf:"varint,38,rep,packed,name=icon_open,json=iconOpen,proto3" json:"icon_open,omitempty"` //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3] + HasWhite int32 `protobuf:"varint,39,opt,name=has_white,json=hasWhite,proto3" json:"has_white,omitempty"` //是否开启白名单(0-否,1-是) + WhiteList string `protobuf:"bytes,40,opt,name=white_list,json=whiteList,proto3" json:"white_list,omitempty"` //白名单列表(多个用英文;分割) + PcBg string `protobuf:"bytes,41,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc适配背景图 + AdsType int32 `protobuf:"varint,42,opt,name=ads_type,json=adsType,proto3" json:"ads_type,omitempty"` //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + LevelIds []int64 `protobuf:"varint,43,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + LinkTempId string `protobuf:"bytes,44,opt,name=link_temp_id,json=linkTempId,proto3" json:"link_temp_id,omitempty"` //链接模板id + RuleTimeOpen int32 `protobuf:"varint,45,opt,name=rule_time_open,json=ruleTimeOpen,proto3" json:"rule_time_open,omitempty"` //是否展示规则中的活动时间(0-否,1-是) + OutsideTask int32 `protobuf:"varint,46,opt,name=outside_task,json=outsideTask,proto3" json:"outside_task,omitempty"` //是否外显任务(0-否,1-是) + IconTextColor string `protobuf:"bytes,47,opt,name=icon_text_color,json=iconTextColor,proto3" json:"icon_text_color,omitempty"` //活动挂件字体色 + OpenShare int32 `protobuf:"varint,48,opt,name=open_share,json=openShare,proto3" json:"open_share,omitempty"` //是否启用分享模块(0-否,1-是) + ShowToUse int32 `protobuf:"varint,49,opt,name=show_to_use,json=showToUse,proto3" json:"show_to_use,omitempty"` //是否展示奖品弹窗的去使用(0-不展示,1-展示) + RuleType int32 `protobuf:"varint,50,opt,name=rule_type,json=ruleType,proto3" json:"rule_type,omitempty"` //规则展示类型(0-文本,1-图片) + RuleImg string `protobuf:"bytes,51,opt,name=rule_img,json=ruleImg,proto3" json:"rule_img,omitempty"` //规则展示图 + RuleOutside int32 `protobuf:"varint,52,opt,name=rule_outside,json=ruleOutside,proto3" json:"rule_outside,omitempty"` //规则是否外显(0-否,1-是) + DeviceOnce int32 `protobuf:"varint,53,opt,name=device_once,json=deviceOnce,proto3" json:"device_once,omitempty"` //设备唯一(0-否,1-是) +} + +func (x *UpdateReq_Config) Reset() { + *x = UpdateReq_Config{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[176] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Config) ProtoMessage() {} + +func (x *UpdateReq_Config) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[176] + 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 UpdateReq_Config.ProtoReflect.Descriptor instead. +func (*UpdateReq_Config) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 18} +} + +func (x *UpdateReq_Config) GetRuleTextColor() string { + if x != nil { + return x.RuleTextColor + } + return "" +} + +func (x *UpdateReq_Config) GetRuleBgColor() string { + if x != nil { + return x.RuleBgColor + } + return "" +} + +func (x *UpdateReq_Config) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *UpdateReq_Config) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *UpdateReq_Config) GetHasRank() int32 { + if x != nil { + return x.HasRank + } + return 0 +} + +func (x *UpdateReq_Config) GetRankBackgroundColor() string { + if x != nil { + return x.RankBackgroundColor + } + return "" +} + +func (x *UpdateReq_Config) GetRankTextColor() string { + if x != nil { + return x.RankTextColor + } + return "" +} + +func (x *UpdateReq_Config) GetDownloadPageImage() string { + if x != nil { + return x.DownloadPageImage + } + return "" +} + +func (x *UpdateReq_Config) GetIsDefaultDownload() int32 { + if x != nil { + return x.IsDefaultDownload + } + return 0 +} + +func (x *UpdateReq_Config) GetWechatPageImage() string { + if x != nil { + return x.WechatPageImage + } + return "" +} + +func (x *UpdateReq_Config) GetIsDefaultWechat() int32 { + if x != nil { + return x.IsDefaultWechat + } + return 0 +} + +func (x *UpdateReq_Config) GetImageMain() string { + if x != nil { + return x.ImageMain + } + return "" +} + +func (x *UpdateReq_Config) GetIsDefaultMain() int32 { + if x != nil { + return x.IsDefaultMain + } + return 0 +} + +func (x *UpdateReq_Config) GetImagePreview() string { + if x != nil { + return x.ImagePreview + } + return "" +} + +func (x *UpdateReq_Config) GetLinkBtnTextColor() string { + if x != nil { + return x.LinkBtnTextColor + } + return "" +} + +func (x *UpdateReq_Config) GetLinkBtnBgColor() string { + if x != nil { + return x.LinkBtnBgColor + } + return "" +} + +func (x *UpdateReq_Config) GetLinkTextColor() string { + if x != nil { + return x.LinkTextColor + } + return "" +} + +func (x *UpdateReq_Config) GetShowShare() int32 { + if x != nil { + return x.ShowShare + } + return 0 +} + +func (x *UpdateReq_Config) GetShare() []int64 { + if x != nil { + return x.Share + } + return nil +} + +func (x *UpdateReq_Config) GetPlayRule() string { + if x != nil { + return x.PlayRule + } + return "" +} + +func (x *UpdateReq_Config) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *UpdateReq_Config) GetDmShow() int32 { + if x != nil { + return x.DmShow + } + return 0 +} + +func (x *UpdateReq_Config) GetWebBgImg() string { + if x != nil { + return x.WebBgImg + } + return "" +} + +func (x *UpdateReq_Config) GetHasWarmUp() int32 { + if x != nil { + return x.HasWarmUp + } + return 0 +} + +func (x *UpdateReq_Config) GetWarmUpImg() string { + if x != nil { + return x.WarmUpImg + } + return "" +} + +func (x *UpdateReq_Config) GetWarmUpEnd() int32 { + if x != nil { + return x.WarmUpEnd + } + return 0 +} + +func (x *UpdateReq_Config) GetIconType() int32 { + if x != nil { + return x.IconType + } + return 0 +} + +func (x *UpdateReq_Config) GetIconBgColor() string { + if x != nil { + return x.IconBgColor + } + return "" +} + +func (x *UpdateReq_Config) GetDlType() int32 { + if x != nil { + return x.DlType + } + return 0 +} + +func (x *UpdateReq_Config) GetDlBannerType() int32 { + if x != nil { + return x.DlBannerType + } + return 0 +} + +func (x *UpdateReq_Config) GetDlBannerImg() string { + if x != nil { + return x.DlBannerImg + } + return "" +} + +func (x *UpdateReq_Config) GetDlBannerAppLogo() string { + if x != nil { + return x.DlBannerAppLogo + } + return "" +} + +func (x *UpdateReq_Config) GetDlBannerAppName() string { + if x != nil { + return x.DlBannerAppName + } + return "" +} + +func (x *UpdateReq_Config) GetDlBannerAppBtn() string { + if x != nil { + return x.DlBannerAppBtn + } + return "" +} + +func (x *UpdateReq_Config) GetDlBannerPosition() int32 { + if x != nil { + return x.DlBannerPosition + } + return 0 +} + +func (x *UpdateReq_Config) GetTopicColor() string { + if x != nil { + return x.TopicColor + } + return "" +} + +func (x *UpdateReq_Config) GetWindowCover() int32 { + if x != nil { + return x.WindowCover + } + return 0 +} + +func (x *UpdateReq_Config) GetIconOpen() []int32 { + if x != nil { + return x.IconOpen + } + return nil +} + +func (x *UpdateReq_Config) GetHasWhite() int32 { + if x != nil { + return x.HasWhite + } + return 0 +} + +func (x *UpdateReq_Config) GetWhiteList() string { + if x != nil { + return x.WhiteList + } + return "" +} + +func (x *UpdateReq_Config) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *UpdateReq_Config) GetAdsType() int32 { + if x != nil { + return x.AdsType + } + return 0 +} + +func (x *UpdateReq_Config) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *UpdateReq_Config) GetLinkTempId() string { + if x != nil { + return x.LinkTempId + } + return "" +} + +func (x *UpdateReq_Config) GetRuleTimeOpen() int32 { + if x != nil { + return x.RuleTimeOpen + } + return 0 +} + +func (x *UpdateReq_Config) GetOutsideTask() int32 { + if x != nil { + return x.OutsideTask + } + return 0 +} + +func (x *UpdateReq_Config) GetIconTextColor() string { + if x != nil { + return x.IconTextColor + } + return "" +} + +func (x *UpdateReq_Config) GetOpenShare() int32 { + if x != nil { + return x.OpenShare + } + return 0 +} + +func (x *UpdateReq_Config) GetShowToUse() int32 { + if x != nil { + return x.ShowToUse + } + return 0 +} + +func (x *UpdateReq_Config) GetRuleType() int32 { + if x != nil { + return x.RuleType + } + return 0 +} + +func (x *UpdateReq_Config) GetRuleImg() string { + if x != nil { + return x.RuleImg + } + return "" +} + +func (x *UpdateReq_Config) GetRuleOutside() int32 { + if x != nil { + return x.RuleOutside + } + return 0 +} + +func (x *UpdateReq_Config) GetDeviceOnce() int32 { + if x != nil { + return x.DeviceOnce + } + return 0 +} + +type UpdateReq_LongImg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImgUrl string `protobuf:"bytes,1,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //长图id + ClickType int32 `protobuf:"varint,5,opt,name=click_type,json=clickType,proto3" json:"click_type,omitempty"` //点击类型(1-整图点击,2-区域点击) + HotZone []*UpdateReq_HotZone `protobuf:"bytes,6,rep,name=hot_zone,json=hotZone,proto3" json:"hot_zone,omitempty"` //点击区域 + TargetType int32 `protobuf:"varint,7,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,8,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *UpdateReq_LongImg) Reset() { + *x = UpdateReq_LongImg{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[177] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_LongImg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_LongImg) ProtoMessage() {} + +func (x *UpdateReq_LongImg) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[177] + 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 UpdateReq_LongImg.ProtoReflect.Descriptor instead. +func (*UpdateReq_LongImg) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 19} +} + +func (x *UpdateReq_LongImg) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UpdateReq_LongImg) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *UpdateReq_LongImg) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *UpdateReq_LongImg) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_LongImg) GetClickType() int32 { + if x != nil { + return x.ClickType + } + return 0 +} + +func (x *UpdateReq_LongImg) GetHotZone() []*UpdateReq_HotZone { + if x != nil { + return x.HotZone + } + return nil +} + +func (x *UpdateReq_LongImg) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *UpdateReq_LongImg) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *UpdateReq_LongImg) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type UpdateReq_HotZone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //热区id + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickX float64 `protobuf:"fixed64,4,opt,name=click_x,json=clickX,proto3" json:"click_x,omitempty"` //点击区域x + ClickY float64 `protobuf:"fixed64,5,opt,name=click_y,json=clickY,proto3" json:"click_y,omitempty"` //点击区域y + ClickW float64 `protobuf:"fixed64,6,opt,name=click_w,json=clickW,proto3" json:"click_w,omitempty"` //点击区域w + ClickH float64 `protobuf:"fixed64,7,opt,name=click_h,json=clickH,proto3" json:"click_h,omitempty"` //点击区域h + TargetType int32 `protobuf:"varint,8,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,9,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,10,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *UpdateReq_HotZone) Reset() { + *x = UpdateReq_HotZone{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[178] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_HotZone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_HotZone) ProtoMessage() {} + +func (x *UpdateReq_HotZone) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[178] + 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 UpdateReq_HotZone.ProtoReflect.Descriptor instead. +func (*UpdateReq_HotZone) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 20} +} + +func (x *UpdateReq_HotZone) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_HotZone) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *UpdateReq_HotZone) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *UpdateReq_HotZone) GetClickX() float64 { + if x != nil { + return x.ClickX + } + return 0 +} + +func (x *UpdateReq_HotZone) GetClickY() float64 { + if x != nil { + return x.ClickY + } + return 0 +} + +func (x *UpdateReq_HotZone) GetClickW() float64 { + if x != nil { + return x.ClickW + } + return 0 +} + +func (x *UpdateReq_HotZone) GetClickH() float64 { + if x != nil { + return x.ClickH + } + return 0 +} + +func (x *UpdateReq_HotZone) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *UpdateReq_HotZone) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *UpdateReq_HotZone) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type UpdateReq_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target int32 `protobuf:"varint,1,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Option int32 `protobuf:"varint,2,opt,name=option,proto3" json:"option,omitempty"` //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + AppEvent int32 `protobuf:"varint,3,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //目标选择类型为1(option=1)的选项(1-安装;2-注册) + BothType int32 `protobuf:"varint,4,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Cond []*UpdateReq_Cond `protobuf:"bytes,5,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *UpdateReq_BothAll `protobuf:"bytes,6,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 + NormalData *UpdateReq_NormalData `protobuf:"bytes,7,opt,name=normal_data,json=normalData,proto3" json:"normal_data,omitempty"` //通用事件的数据 +} + +func (x *UpdateReq_Target) Reset() { + *x = UpdateReq_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[179] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Target) ProtoMessage() {} + +func (x *UpdateReq_Target) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[179] + 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 UpdateReq_Target.ProtoReflect.Descriptor instead. +func (*UpdateReq_Target) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 21} +} + +func (x *UpdateReq_Target) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *UpdateReq_Target) GetOption() int32 { + if x != nil { + return x.Option + } + return 0 +} + +func (x *UpdateReq_Target) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *UpdateReq_Target) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *UpdateReq_Target) GetCond() []*UpdateReq_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *UpdateReq_Target) GetBothAll() *UpdateReq_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +func (x *UpdateReq_Target) GetNormalData() *UpdateReq_NormalData { + if x != nil { + return x.NormalData + } + return nil +} + +type UpdateReq_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //条件id + Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,3,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,4,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + IfCond int32 `protobuf:"varint,6,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TaskLimit int32 `protobuf:"varint,7,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,8,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + TriggerType int32 `protobuf:"varint,9,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + DayLimit int32 `protobuf:"varint,10,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,11,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + EventType int32 `protobuf:"varint,12,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,13,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + LangMarks []string `protobuf:"bytes,14,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WatchSec int32 `protobuf:"varint,15,opt,name=watch_sec,json=watchSec,proto3" json:"watch_sec,omitempty"` //观看秒数 + WeekLimit int32 `protobuf:"varint,16,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,17,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + OpenJump int32 `protobuf:"varint,18,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,19,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,20,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + GoShow int32 `protobuf:"varint,21,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,22,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,23,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,24,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置条件(0-否,1-是) + PreCond int32 `protobuf:"varint,25,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + ExpiredMin int32 `protobuf:"varint,26,opt,name=expired_min,json=expiredMin,proto3" json:"expired_min,omitempty"` //过期分钟数 + Reward *UpdateReq_Reward `protobuf:"bytes,27,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,28,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Sort int32 `protobuf:"varint,29,opt,name=sort,proto3" json:"sort,omitempty"` //排序 + OpenPush int32 `protobuf:"varint,30,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //是否开启完成推送(0-否,1-是) + PcParam string `protobuf:"bytes,31,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 + AwardMode int32 `protobuf:"varint,32,opt,name=award_mode,json=awardMode,proto3" json:"award_mode,omitempty"` //领奖模式(1-自动领奖,2-手动领奖) + GoText string `protobuf:"bytes,33,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 + ClickEffectOpen int32 `protobuf:"varint,34,opt,name=click_effect_open,json=clickEffectOpen,proto3" json:"click_effect_open,omitempty"` //是否开启点击有效(0-否,1-是) + ClickEffect int32 `protobuf:"varint,35,opt,name=click_effect,json=clickEffect,proto3" json:"click_effect,omitempty"` //点击有效值 + ClickEffectUnit string `protobuf:"bytes,36,opt,name=click_effect_unit,json=clickEffectUnit,proto3" json:"click_effect_unit,omitempty"` //点击有效单位(min-分钟,hour-小时,day-天) + ExpiredDay string `protobuf:"bytes,37,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + PullInvite int32 `protobuf:"varint,38,opt,name=pull_invite,json=pullInvite,proto3" json:"pull_invite,omitempty"` //是否拉起邀请(0-否,1-是) +} + +func (x *UpdateReq_Cond) Reset() { + *x = UpdateReq_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[180] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Cond) ProtoMessage() {} + +func (x *UpdateReq_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[180] + 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 UpdateReq_Cond.ProtoReflect.Descriptor instead. +func (*UpdateReq_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 22} +} + +func (x *UpdateReq_Cond) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *UpdateReq_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *UpdateReq_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *UpdateReq_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UpdateReq_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *UpdateReq_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *UpdateReq_Cond) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *UpdateReq_Cond) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *UpdateReq_Cond) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *UpdateReq_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *UpdateReq_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *UpdateReq_Cond) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *UpdateReq_Cond) GetWatchSec() int32 { + if x != nil { + return x.WatchSec + } + return 0 +} + +func (x *UpdateReq_Cond) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *UpdateReq_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *UpdateReq_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *UpdateReq_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *UpdateReq_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *UpdateReq_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *UpdateReq_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *UpdateReq_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *UpdateReq_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *UpdateReq_Cond) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +func (x *UpdateReq_Cond) GetExpiredMin() int32 { + if x != nil { + return x.ExpiredMin + } + return 0 +} + +func (x *UpdateReq_Cond) GetReward() *UpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *UpdateReq_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *UpdateReq_Cond) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *UpdateReq_Cond) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +func (x *UpdateReq_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *UpdateReq_Cond) GetAwardMode() int32 { + if x != nil { + return x.AwardMode + } + return 0 +} + +func (x *UpdateReq_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +func (x *UpdateReq_Cond) GetClickEffectOpen() int32 { + if x != nil { + return x.ClickEffectOpen + } + return 0 +} + +func (x *UpdateReq_Cond) GetClickEffect() int32 { + if x != nil { + return x.ClickEffect + } + return 0 +} + +func (x *UpdateReq_Cond) GetClickEffectUnit() string { + if x != nil { + return x.ClickEffectUnit + } + return "" +} + +func (x *UpdateReq_Cond) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *UpdateReq_Cond) GetPullInvite() int32 { + if x != nil { + return x.PullInvite + } + return 0 +} + +type UpdateReq_BothAll struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskLimit int32 `protobuf:"varint,1,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + DayLimit int32 `protobuf:"varint,3,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,4,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + LangMarks []string `protobuf:"bytes,5,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WeekLimit int32 `protobuf:"varint,6,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,7,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + Reward *UpdateReq_Reward `protobuf:"bytes,8,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,9,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + ExpiredDay string `protobuf:"bytes,10,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 +} + +func (x *UpdateReq_BothAll) Reset() { + *x = UpdateReq_BothAll{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[181] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_BothAll) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_BothAll) ProtoMessage() {} + +func (x *UpdateReq_BothAll) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[181] + 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 UpdateReq_BothAll.ProtoReflect.Descriptor instead. +func (*UpdateReq_BothAll) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 23} +} + +func (x *UpdateReq_BothAll) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *UpdateReq_BothAll) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_BothAll) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *UpdateReq_BothAll) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *UpdateReq_BothAll) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *UpdateReq_BothAll) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *UpdateReq_BothAll) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *UpdateReq_BothAll) GetReward() *UpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *UpdateReq_BothAll) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *UpdateReq_BothAll) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +type UpdateReq_NormalData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,3,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) +} + +func (x *UpdateReq_NormalData) Reset() { + *x = UpdateReq_NormalData{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[182] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_NormalData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_NormalData) ProtoMessage() {} + +func (x *UpdateReq_NormalData) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[182] + 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 UpdateReq_NormalData.ProtoReflect.Descriptor instead. +func (*UpdateReq_NormalData) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 24} +} + +func (x *UpdateReq_NormalData) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *UpdateReq_NormalData) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_NormalData) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +type UpdateReq_TargetOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target int32 `protobuf:"varint,1,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Fixed *UpdateReq_Fixed `protobuf:"bytes,2,opt,name=fixed,proto3" json:"fixed,omitempty"` //固定事件 + Custom *UpdateReq_Custom `protobuf:"bytes,3,opt,name=custom,proto3" json:"custom,omitempty"` //自定义事件 +} + +func (x *UpdateReq_TargetOption) Reset() { + *x = UpdateReq_TargetOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[183] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_TargetOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_TargetOption) ProtoMessage() {} + +func (x *UpdateReq_TargetOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[183] + 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 UpdateReq_TargetOption.ProtoReflect.Descriptor instead. +func (*UpdateReq_TargetOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 25} +} + +func (x *UpdateReq_TargetOption) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *UpdateReq_TargetOption) GetFixed() *UpdateReq_Fixed { + if x != nil { + return x.Fixed + } + return nil +} + +func (x *UpdateReq_TargetOption) GetCustom() *UpdateReq_Custom { + if x != nil { + return x.Custom + } + return nil +} + +type UpdateReq_Fixed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + AppEvent int32 `protobuf:"varint,2,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //固定事件类型(1-安装;2-注册) + TargetNum int32 `protobuf:"varint,3,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,5,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) + Percent float64 `protobuf:"fixed64,6,opt,name=percent,proto3" json:"percent,omitempty"` //百分比值(如:获得的能量点) +} + +func (x *UpdateReq_Fixed) Reset() { + *x = UpdateReq_Fixed{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[184] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Fixed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Fixed) ProtoMessage() {} + +func (x *UpdateReq_Fixed) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[184] + 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 UpdateReq_Fixed.ProtoReflect.Descriptor instead. +func (*UpdateReq_Fixed) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 26} +} + +func (x *UpdateReq_Fixed) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_Fixed) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *UpdateReq_Fixed) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *UpdateReq_Fixed) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_Fixed) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +func (x *UpdateReq_Fixed) GetPercent() float64 { + if x != nil { + return x.Percent + } + return 0 +} + +type UpdateReq_Custom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + BothType int32 `protobuf:"varint,2,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Cond []*UpdateReq_Cond `protobuf:"bytes,3,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *UpdateReq_BothAll `protobuf:"bytes,4,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 + PreEvent int32 `protobuf:"varint,5,opt,name=pre_event,json=preEvent,proto3" json:"pre_event,omitempty"` //自定义事件前置事件(0-任意事件;1-安装;2-注册) +} + +func (x *UpdateReq_Custom) Reset() { + *x = UpdateReq_Custom{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[185] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Custom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Custom) ProtoMessage() {} + +func (x *UpdateReq_Custom) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[185] + 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 UpdateReq_Custom.ProtoReflect.Descriptor instead. +func (*UpdateReq_Custom) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 27} +} + +func (x *UpdateReq_Custom) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_Custom) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *UpdateReq_Custom) GetCond() []*UpdateReq_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *UpdateReq_Custom) GetBothAll() *UpdateReq_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +func (x *UpdateReq_Custom) GetPreEvent() int32 { + if x != nil { + return x.PreEvent + } + return 0 +} + +type UpdateReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *UpdateReq_KV) Reset() { + *x = UpdateReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[186] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_KV) ProtoMessage() {} + +func (x *UpdateReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[186] + 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 UpdateReq_KV.ProtoReflect.Descriptor instead. +func (*UpdateReq_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 28} +} + +func (x *UpdateReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type UpdateReq_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Stock int32 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,6,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,7,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,8,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,9,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,10,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + Help int32 `protobuf:"varint,11,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,12,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,13,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,14,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,15,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,16,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,17,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,18,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + Odds int32 `protobuf:"varint,19,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + JumpUrl string `protobuf:"bytes,20,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + CampaignLimit int32 `protobuf:"varint,21,opt,name=campaign_limit,json=campaignLimit,proto3" json:"campaign_limit,omitempty"` //活动内单个用户可获取该奖品次数 + Register int32 `protobuf:"varint,22,opt,name=register,proto3" json:"register,omitempty"` //开启注册助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,23,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个注册获得的进度比率 + InitPercent float64 `protobuf:"fixed64,24,opt,name=init_percent,json=initPercent,proto3" json:"init_percent,omitempty"` //初始助力进度 + CollectRule *UpdateReq_CollectRule `protobuf:"bytes,25,opt,name=collect_rule,json=collectRule,proto3" json:"collect_rule,omitempty"` //收集规则 + ExpiredDay string `protobuf:"bytes,26,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + OpenAdd *UpdateReq_OpenAdd `protobuf:"bytes,27,opt,name=open_add,json=openAdd,proto3" json:"open_add,omitempty"` //库存增加规则 + RewardTask *UpdateReq_RewardTask `protobuf:"bytes,28,opt,name=reward_task,json=rewardTask,proto3" json:"reward_task,omitempty"` //解锁任务 +} + +func (x *UpdateReq_Reward) Reset() { + *x = UpdateReq_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[187] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Reward) ProtoMessage() {} + +func (x *UpdateReq_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[187] + 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 UpdateReq_Reward.ProtoReflect.Descriptor instead. +func (*UpdateReq_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 29} +} + +func (x *UpdateReq_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *UpdateReq_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *UpdateReq_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *UpdateReq_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *UpdateReq_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *UpdateReq_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *UpdateReq_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *UpdateReq_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *UpdateReq_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *UpdateReq_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *UpdateReq_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *UpdateReq_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *UpdateReq_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *UpdateReq_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *UpdateReq_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *UpdateReq_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *UpdateReq_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *UpdateReq_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *UpdateReq_Reward) GetCampaignLimit() int32 { + if x != nil { + return x.CampaignLimit + } + return 0 +} + +func (x *UpdateReq_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *UpdateReq_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +func (x *UpdateReq_Reward) GetInitPercent() float64 { + if x != nil { + return x.InitPercent + } + return 0 +} + +func (x *UpdateReq_Reward) GetCollectRule() *UpdateReq_CollectRule { + if x != nil { + return x.CollectRule + } + return nil +} + +func (x *UpdateReq_Reward) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *UpdateReq_Reward) GetOpenAdd() *UpdateReq_OpenAdd { + if x != nil { + return x.OpenAdd + } + return nil +} + +func (x *UpdateReq_Reward) GetRewardTask() *UpdateReq_RewardTask { + if x != nil { + return x.RewardTask + } + return nil +} + +type UpdateReq_RewardTask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,3,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,4,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TriggerType int32 `protobuf:"varint,6,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + EventType int32 `protobuf:"varint,7,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + OpenPush int32 `protobuf:"varint,8,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //是否开启完成推送(0-否,1-是) +} + +func (x *UpdateReq_RewardTask) Reset() { + *x = UpdateReq_RewardTask{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[188] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_RewardTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_RewardTask) ProtoMessage() {} + +func (x *UpdateReq_RewardTask) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[188] + 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 UpdateReq_RewardTask.ProtoReflect.Descriptor instead. +func (*UpdateReq_RewardTask) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 30} +} + +func (x *UpdateReq_RewardTask) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_RewardTask) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *UpdateReq_RewardTask) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *UpdateReq_RewardTask) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *UpdateReq_RewardTask) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *UpdateReq_RewardTask) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *UpdateReq_RewardTask) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *UpdateReq_RewardTask) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +type UpdateReq_OpenAdd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启动态库存规则(0-否,1-是) + Start int64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` //开始时间 + End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` //结束时间 + DayNum int32 `protobuf:"varint,4,opt,name=day_num,json=dayNum,proto3" json:"day_num,omitempty"` //天数 + DayAdd int32 `protobuf:"varint,5,opt,name=day_add,json=dayAdd,proto3" json:"day_add,omitempty"` //增加的库存量 +} + +func (x *UpdateReq_OpenAdd) Reset() { + *x = UpdateReq_OpenAdd{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[189] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_OpenAdd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_OpenAdd) ProtoMessage() {} + +func (x *UpdateReq_OpenAdd) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[189] + 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 UpdateReq_OpenAdd.ProtoReflect.Descriptor instead. +func (*UpdateReq_OpenAdd) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 31} +} + +func (x *UpdateReq_OpenAdd) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_OpenAdd) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *UpdateReq_OpenAdd) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *UpdateReq_OpenAdd) GetDayNum() int32 { + if x != nil { + return x.DayNum + } + return 0 +} + +func (x *UpdateReq_OpenAdd) GetDayAdd() int32 { + if x != nil { + return x.DayAdd + } + return 0 +} + +type UpdateReq_CollectRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启碎片规则(0-否,1-是) + InitCollect int32 `protobuf:"varint,2,opt,name=init_collect,json=initCollect,proto3" json:"init_collect,omitempty"` //初始的最大可获得碎片数 + SignDay int32 `protobuf:"varint,3,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + AddCollect int32 `protobuf:"varint,4,opt,name=add_collect,json=addCollect,proto3" json:"add_collect,omitempty"` //完成条件可获得最大碎片数 + ResetType int32 `protobuf:"varint,5,opt,name=reset_type,json=resetType,proto3" json:"reset_type,omitempty"` //重置碎片规则(1-不重置,2-获奖后重置) +} + +func (x *UpdateReq_CollectRule) Reset() { + *x = UpdateReq_CollectRule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[190] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_CollectRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_CollectRule) ProtoMessage() {} + +func (x *UpdateReq_CollectRule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[190] + 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 UpdateReq_CollectRule.ProtoReflect.Descriptor instead. +func (*UpdateReq_CollectRule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 32} +} + +func (x *UpdateReq_CollectRule) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_CollectRule) GetInitCollect() int32 { + if x != nil { + return x.InitCollect + } + return 0 +} + +func (x *UpdateReq_CollectRule) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *UpdateReq_CollectRule) GetAddCollect() int32 { + if x != nil { + return x.AddCollect + } + return 0 +} + +func (x *UpdateReq_CollectRule) GetResetType() int32 { + if x != nil { + return x.ResetType + } + return 0 +} + +type UpdateReq_Rewards struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardGroup int32 `protobuf:"varint,1,opt,name=reward_group,json=rewardGroup,proto3" json:"reward_group,omitempty"` //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + Normal []*UpdateReq_Reward `protobuf:"bytes,2,rep,name=normal,proto3" json:"normal,omitempty"` //常规奖品 + UserLevel *UpdateReq_UserLevel `protobuf:"bytes,3,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` //用户类型奖品 + Langs []*UpdateReq_Lang `protobuf:"bytes,4,rep,name=langs,proto3" json:"langs,omitempty"` //语言奖品 + LangUserLevel []*UpdateReq_LangUserLevel `protobuf:"bytes,5,rep,name=lang_user_level,json=langUserLevel,proto3" json:"lang_user_level,omitempty"` //语言+用户类型奖品 + Country *UpdateReq_Country `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"` //国家奖品 +} + +func (x *UpdateReq_Rewards) Reset() { + *x = UpdateReq_Rewards{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[191] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Rewards) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Rewards) ProtoMessage() {} + +func (x *UpdateReq_Rewards) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[191] + 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 UpdateReq_Rewards.ProtoReflect.Descriptor instead. +func (*UpdateReq_Rewards) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 33} +} + +func (x *UpdateReq_Rewards) GetRewardGroup() int32 { + if x != nil { + return x.RewardGroup + } + return 0 +} + +func (x *UpdateReq_Rewards) GetNormal() []*UpdateReq_Reward { + if x != nil { + return x.Normal + } + return nil +} + +func (x *UpdateReq_Rewards) GetUserLevel() *UpdateReq_UserLevel { + if x != nil { + return x.UserLevel + } + return nil +} + +func (x *UpdateReq_Rewards) GetLangs() []*UpdateReq_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *UpdateReq_Rewards) GetLangUserLevel() []*UpdateReq_LangUserLevel { + if x != nil { + return x.LangUserLevel + } + return nil +} + +func (x *UpdateReq_Rewards) GetCountry() *UpdateReq_Country { + if x != nil { + return x.Country + } + return nil +} + +type UpdateReq_UserLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultLevelId int64 `protobuf:"varint,1,opt,name=default_level_id,json=defaultLevelId,proto3" json:"default_level_id,omitempty"` //默认用户类型id + LevelList []*UpdateReq_UserLevelOne `protobuf:"bytes,2,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //用户类型奖品 +} + +func (x *UpdateReq_UserLevel) Reset() { + *x = UpdateReq_UserLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[192] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_UserLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_UserLevel) ProtoMessage() {} + +func (x *UpdateReq_UserLevel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[192] + 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 UpdateReq_UserLevel.ProtoReflect.Descriptor instead. +func (*UpdateReq_UserLevel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 34} +} + +func (x *UpdateReq_UserLevel) GetDefaultLevelId() int64 { + if x != nil { + return x.DefaultLevelId + } + return 0 +} + +func (x *UpdateReq_UserLevel) GetLevelList() []*UpdateReq_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type UpdateReq_UserLevelOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LevelId int64 `protobuf:"varint,1,opt,name=level_id,json=levelId,proto3" json:"level_id,omitempty"` //用户类型id + Rewards []*UpdateReq_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *UpdateReq_UserLevelOne) Reset() { + *x = UpdateReq_UserLevelOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[193] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_UserLevelOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_UserLevelOne) ProtoMessage() {} + +func (x *UpdateReq_UserLevelOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[193] + 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 UpdateReq_UserLevelOne.ProtoReflect.Descriptor instead. +func (*UpdateReq_UserLevelOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 35} +} + +func (x *UpdateReq_UserLevelOne) GetLevelId() int64 { + if x != nil { + return x.LevelId + } + return 0 +} + +func (x *UpdateReq_UserLevelOne) GetRewards() []*UpdateReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type UpdateReq_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + Rewards []*UpdateReq_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *UpdateReq_Lang) Reset() { + *x = UpdateReq_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[194] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Lang) ProtoMessage() {} + +func (x *UpdateReq_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[194] + 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 UpdateReq_Lang.ProtoReflect.Descriptor instead. +func (*UpdateReq_Lang) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 36} +} + +func (x *UpdateReq_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *UpdateReq_Lang) GetRewards() []*UpdateReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type UpdateReq_LangUserLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + DefaultLevelId int64 `protobuf:"varint,2,opt,name=default_level_id,json=defaultLevelId,proto3" json:"default_level_id,omitempty"` //默认用户类型id + LevelList []*UpdateReq_UserLevelOne `protobuf:"bytes,3,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //用户类型奖品 +} + +func (x *UpdateReq_LangUserLevel) Reset() { + *x = UpdateReq_LangUserLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[195] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_LangUserLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_LangUserLevel) ProtoMessage() {} + +func (x *UpdateReq_LangUserLevel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[195] + 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 UpdateReq_LangUserLevel.ProtoReflect.Descriptor instead. +func (*UpdateReq_LangUserLevel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 37} +} + +func (x *UpdateReq_LangUserLevel) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *UpdateReq_LangUserLevel) GetDefaultLevelId() int64 { + if x != nil { + return x.DefaultLevelId + } + return 0 +} + +func (x *UpdateReq_LangUserLevel) GetLevelList() []*UpdateReq_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type UpdateReq_Country struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultCountryMark string `protobuf:"bytes,1,opt,name=default_country_mark,json=defaultCountryMark,proto3" json:"default_country_mark,omitempty"` //默认国家 + CountryList []*UpdateReq_CountryOne `protobuf:"bytes,2,rep,name=country_list,json=countryList,proto3" json:"country_list,omitempty"` //国家的奖品 +} + +func (x *UpdateReq_Country) Reset() { + *x = UpdateReq_Country{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[196] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Country) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Country) ProtoMessage() {} + +func (x *UpdateReq_Country) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[196] + 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 UpdateReq_Country.ProtoReflect.Descriptor instead. +func (*UpdateReq_Country) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 38} +} + +func (x *UpdateReq_Country) GetDefaultCountryMark() string { + if x != nil { + return x.DefaultCountryMark + } + return "" +} + +func (x *UpdateReq_Country) GetCountryList() []*UpdateReq_CountryOne { + if x != nil { + return x.CountryList + } + return nil +} + +type UpdateReq_CountryOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CountryMark string `protobuf:"bytes,1,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 + Rewards []*UpdateReq_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *UpdateReq_CountryOne) Reset() { + *x = UpdateReq_CountryOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[197] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_CountryOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_CountryOne) ProtoMessage() {} + +func (x *UpdateReq_CountryOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[197] + 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 UpdateReq_CountryOne.ProtoReflect.Descriptor instead. +func (*UpdateReq_CountryOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 39} +} + +func (x *UpdateReq_CountryOne) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *UpdateReq_CountryOne) GetRewards() []*UpdateReq_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type UpdateReq_QaQuestion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //题目id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //题目 + Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` //得分 + Options []*UpdateReq_QaOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` //选项 +} + +func (x *UpdateReq_QaQuestion) Reset() { + *x = UpdateReq_QaQuestion{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[198] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_QaQuestion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_QaQuestion) ProtoMessage() {} + +func (x *UpdateReq_QaQuestion) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[198] + 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 UpdateReq_QaQuestion.ProtoReflect.Descriptor instead. +func (*UpdateReq_QaQuestion) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 40} +} + +func (x *UpdateReq_QaQuestion) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_QaQuestion) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq_QaQuestion) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *UpdateReq_QaQuestion) GetOptions() []*UpdateReq_QaOption { + if x != nil { + return x.Options + } + return nil +} + +type UpdateReq_QaOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //答案id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + IsRight int32 `protobuf:"varint,3,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *UpdateReq_QaOption) Reset() { + *x = UpdateReq_QaOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[199] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_QaOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_QaOption) ProtoMessage() {} + +func (x *UpdateReq_QaOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[199] + 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 UpdateReq_QaOption.ProtoReflect.Descriptor instead. +func (*UpdateReq_QaOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 41} +} + +func (x *UpdateReq_QaOption) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_QaOption) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq_QaOption) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type UpdateReq_QuizOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确选项(1-是,0-否) +} + +func (x *UpdateReq_QuizOption) Reset() { + *x = UpdateReq_QuizOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[200] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_QuizOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_QuizOption) ProtoMessage() {} + +func (x *UpdateReq_QuizOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[200] + 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 UpdateReq_QuizOption.ProtoReflect.Descriptor instead. +func (*UpdateReq_QuizOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 42} +} + +func (x *UpdateReq_QuizOption) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_QuizOption) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq_QuizOption) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UpdateReq_QuizOption) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type UpdateReq_Quiz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + InitChance int32 `protobuf:"varint,2,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始答题机会次数 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的答题机会次数 + RewardRule int32 `protobuf:"varint,4,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //奖励规则(1-投票结果排名,2-自定义竞猜结果) + OpenPrize int64 `protobuf:"varint,5,opt,name=open_prize,json=openPrize,proto3" json:"open_prize,omitempty"` //开奖时间 + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + Options []*UpdateReq_QuizOption `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` //有奖竞猜选项 +} + +func (x *UpdateReq_Quiz) Reset() { + *x = UpdateReq_Quiz{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[201] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Quiz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Quiz) ProtoMessage() {} + +func (x *UpdateReq_Quiz) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[201] + 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 UpdateReq_Quiz.ProtoReflect.Descriptor instead. +func (*UpdateReq_Quiz) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 43} +} + +func (x *UpdateReq_Quiz) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *UpdateReq_Quiz) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_Quiz) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_Quiz) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *UpdateReq_Quiz) GetOpenPrize() int64 { + if x != nil { + return x.OpenPrize + } + return 0 +} + +func (x *UpdateReq_Quiz) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq_Quiz) GetOptions() []*UpdateReq_QuizOption { + if x != nil { + return x.Options + } + return nil +} + +type UpdateReq_QuestionAnswer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //达标条件后可获取的答题次数 + InitChance int32 `protobuf:"varint,3,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始答题机会次数 + QuestionAskTime int32 `protobuf:"varint,4,opt,name=question_ask_time,json=questionAskTime,proto3" json:"question_ask_time,omitempty"` //答题时间限制(单位:S,如:1 就是1秒) + Questions []*UpdateReq_QaQuestion `protobuf:"bytes,5,rep,name=questions,proto3" json:"questions,omitempty"` //题目 + GroupHashId string `protobuf:"bytes,6,opt,name=group_hash_id,json=groupHashId,proto3" json:"group_hash_id,omitempty"` //题库对外id + QaNum int32 `protobuf:"varint,7,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题库选取数量 + DayChance int32 `protobuf:"varint,8,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日签到获得的答题数 + OpenGuide int32 `protobuf:"varint,9,opt,name=open_guide,json=openGuide,proto3" json:"open_guide,omitempty"` //是否开启引导(0-否,1-是) + GuideGroupHashId string `protobuf:"bytes,10,opt,name=guide_group_hash_id,json=guideGroupHashId,proto3" json:"guide_group_hash_id,omitempty"` //引导组hash_id +} + +func (x *UpdateReq_QuestionAnswer) Reset() { + *x = UpdateReq_QuestionAnswer{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[202] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_QuestionAnswer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_QuestionAnswer) ProtoMessage() {} + +func (x *UpdateReq_QuestionAnswer) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[202] + 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 UpdateReq_QuestionAnswer.ProtoReflect.Descriptor instead. +func (*UpdateReq_QuestionAnswer) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 44} +} + +func (x *UpdateReq_QuestionAnswer) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetQuestionAskTime() int32 { + if x != nil { + return x.QuestionAskTime + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetQuestions() []*UpdateReq_QaQuestion { + if x != nil { + return x.Questions + } + return nil +} + +func (x *UpdateReq_QuestionAnswer) GetGroupHashId() string { + if x != nil { + return x.GroupHashId + } + return "" +} + +func (x *UpdateReq_QuestionAnswer) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetOpenGuide() int32 { + if x != nil { + return x.OpenGuide + } + return 0 +} + +func (x *UpdateReq_QuestionAnswer) GetGuideGroupHashId() string { + if x != nil { + return x.GuideGroupHashId + } + return "" +} + +type UpdateReq_LotteryConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + InitChance int32 `protobuf:"varint,2,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖机会次数 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的抽奖机会次数 + DayChance int32 `protobuf:"varint,4,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽奖机会次数 +} + +func (x *UpdateReq_LotteryConfig) Reset() { + *x = UpdateReq_LotteryConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[203] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_LotteryConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_LotteryConfig) ProtoMessage() {} + +func (x *UpdateReq_LotteryConfig) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[203] + 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 UpdateReq_LotteryConfig.ProtoReflect.Descriptor instead. +func (*UpdateReq_LotteryConfig) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 45} +} + +func (x *UpdateReq_LotteryConfig) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *UpdateReq_LotteryConfig) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_LotteryConfig) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *UpdateReq_LotteryConfig) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type UpdateReq_InviteConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardLimit int32 `protobuf:"varint,1,opt,name=reward_limit,json=rewardLimit,proto3" json:"reward_limit,omitempty"` //活动总奖励上限 + RewardRule int32 `protobuf:"varint,2,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //用户奖励规则(1-阶梯,2-非阶梯) + InviteLimit int32 `protobuf:"varint,3,opt,name=invite_limit,json=inviteLimit,proto3" json:"invite_limit,omitempty"` //邀请超过多少人不能再获得奖励 + NewcomerCond int32 `protobuf:"varint,4,opt,name=newcomer_cond,json=newcomerCond,proto3" json:"newcomer_cond,omitempty"` //新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + StepLoop int32 `protobuf:"varint,5,opt,name=step_loop,json=stepLoop,proto3" json:"step_loop,omitempty"` //阶梯是否支持循环(0-不支持,1-支持) +} + +func (x *UpdateReq_InviteConfig) Reset() { + *x = UpdateReq_InviteConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[204] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_InviteConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_InviteConfig) ProtoMessage() {} + +func (x *UpdateReq_InviteConfig) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[204] + 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 UpdateReq_InviteConfig.ProtoReflect.Descriptor instead. +func (*UpdateReq_InviteConfig) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 46} +} + +func (x *UpdateReq_InviteConfig) GetRewardLimit() int32 { + if x != nil { + return x.RewardLimit + } + return 0 +} + +func (x *UpdateReq_InviteConfig) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *UpdateReq_InviteConfig) GetInviteLimit() int32 { + if x != nil { + return x.InviteLimit + } + return 0 +} + +func (x *UpdateReq_InviteConfig) GetNewcomerCond() int32 { + if x != nil { + return x.NewcomerCond + } + return 0 +} + +func (x *UpdateReq_InviteConfig) GetStepLoop() int32 { + if x != nil { + return x.StepLoop + } + return 0 +} + +type UpdateReq_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignType int32 `protobuf:"varint,1,opt,name=sign_type,json=signType,proto3" json:"sign_type,omitempty"` //签到类型(1-普通签到,2-阶梯签到) + IsContinue int32 `protobuf:"varint,2,opt,name=is_continue,json=isContinue,proto3" json:"is_continue,omitempty"` //是否连续签到(1-是,0-否) + HasCard int32 `protobuf:"varint,3,opt,name=has_card,json=hasCard,proto3" json:"has_card,omitempty"` //是否开启签到卡(1-开启,0-不开启) + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //邀请好友数可获得的1张签到卡 + LimitCardNum int32 `protobuf:"varint,5,opt,name=limit_card_num,json=limitCardNum,proto3" json:"limit_card_num,omitempty"` //可获得幸运卡的最大张数 + IsLoop int32 `protobuf:"varint,6,opt,name=is_loop,json=isLoop,proto3" json:"is_loop,omitempty"` //是否支持循环(0-否,1-是) + SignCycle int32 `protobuf:"varint,7,opt,name=sign_cycle,json=signCycle,proto3" json:"sign_cycle,omitempty"` //签到周期 + RecycleType int32 `protobuf:"varint,8,opt,name=recycle_type,json=recycleType,proto3" json:"recycle_type,omitempty"` //重新签到模式(1-断签重签,2-周期重签) + Color string `protobuf:"bytes,9,opt,name=color,proto3" json:"color,omitempty"` //签到主题颜色 +} + +func (x *UpdateReq_Sign) Reset() { + *x = UpdateReq_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[205] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Sign) ProtoMessage() {} + +func (x *UpdateReq_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[205] + 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 UpdateReq_Sign.ProtoReflect.Descriptor instead. +func (*UpdateReq_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 47} +} + +func (x *UpdateReq_Sign) GetSignType() int32 { + if x != nil { + return x.SignType + } + return 0 +} + +func (x *UpdateReq_Sign) GetIsContinue() int32 { + if x != nil { + return x.IsContinue + } + return 0 +} + +func (x *UpdateReq_Sign) GetHasCard() int32 { + if x != nil { + return x.HasCard + } + return 0 +} + +func (x *UpdateReq_Sign) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *UpdateReq_Sign) GetLimitCardNum() int32 { + if x != nil { + return x.LimitCardNum + } + return 0 +} + +func (x *UpdateReq_Sign) GetIsLoop() int32 { + if x != nil { + return x.IsLoop + } + return 0 +} + +func (x *UpdateReq_Sign) GetSignCycle() int32 { + if x != nil { + return x.SignCycle + } + return 0 +} + +func (x *UpdateReq_Sign) GetRecycleType() int32 { + if x != nil { + return x.RecycleType + } + return 0 +} + +func (x *UpdateReq_Sign) GetColor() string { + if x != nil { + return x.Color + } + return "" +} + +type UpdateReq_Dice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始骰子数 + DayChance int32 `protobuf:"varint,2,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的骰子数 + FixDice int32 `protobuf:"varint,3,opt,name=fix_dice,json=fixDice,proto3" json:"fix_dice,omitempty"` //开启固定骰子(0-不开启,1-开启) + FixDiceTarget int32 `protobuf:"varint,4,opt,name=fix_dice_target,json=fixDiceTarget,proto3" json:"fix_dice_target,omitempty"` //获得固定骰子需要邀请的人数 + FixDiceLimit int32 `protobuf:"varint,5,opt,name=fix_dice_limit,json=fixDiceLimit,proto3" json:"fix_dice_limit,omitempty"` //固定骰子限制获取数 + CustomDice string `protobuf:"bytes,6,opt,name=custom_dice,json=customDice,proto3" json:"custom_dice,omitempty"` //自定义骰子图片 + OpenMapPoint int32 `protobuf:"varint,7,opt,name=open_map_point,json=openMapPoint,proto3" json:"open_map_point,omitempty"` //开启自定义底座(0-不开启,1-开启) + MapPoint *UpdateReq_MapPoint `protobuf:"bytes,8,opt,name=map_point,json=mapPoint,proto3" json:"map_point,omitempty"` //自定义底座数据 + AwardType int32 `protobuf:"varint,9,opt,name=award_type,json=awardType,proto3" json:"award_type,omitempty"` //奖品碎片收集方式(1-随机收集,2-概率收集) + OpenInvite int32 `protobuf:"varint,10,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请挂件(0-关闭,1-开启) + RollAgain int32 `protobuf:"varint,11,opt,name=roll_again,json=rollAgain,proto3" json:"roll_again,omitempty"` //开启再摇一次(0-关闭,1-开启) + FixDiceCond int32 `protobuf:"varint,12,opt,name=fix_dice_cond,json=fixDiceCond,proto3" json:"fix_dice_cond,omitempty"` //邀请事件(1-安装,2-注册) + Odds int32 `protobuf:"varint,13,opt,name=odds,proto3" json:"odds,omitempty"` //概率收集方式的中奖概率 + PlayImg string `protobuf:"bytes,14,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //play按钮图 + CloudImg string `protobuf:"bytes,15,opt,name=cloud_img,json=cloudImg,proto3" json:"cloud_img,omitempty"` //云朵图 +} + +func (x *UpdateReq_Dice) Reset() { + *x = UpdateReq_Dice{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[206] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Dice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Dice) ProtoMessage() {} + +func (x *UpdateReq_Dice) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[206] + 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 UpdateReq_Dice.ProtoReflect.Descriptor instead. +func (*UpdateReq_Dice) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 48} +} + +func (x *UpdateReq_Dice) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_Dice) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +func (x *UpdateReq_Dice) GetFixDice() int32 { + if x != nil { + return x.FixDice + } + return 0 +} + +func (x *UpdateReq_Dice) GetFixDiceTarget() int32 { + if x != nil { + return x.FixDiceTarget + } + return 0 +} + +func (x *UpdateReq_Dice) GetFixDiceLimit() int32 { + if x != nil { + return x.FixDiceLimit + } + return 0 +} + +func (x *UpdateReq_Dice) GetCustomDice() string { + if x != nil { + return x.CustomDice + } + return "" +} + +func (x *UpdateReq_Dice) GetOpenMapPoint() int32 { + if x != nil { + return x.OpenMapPoint + } + return 0 +} + +func (x *UpdateReq_Dice) GetMapPoint() *UpdateReq_MapPoint { + if x != nil { + return x.MapPoint + } + return nil +} + +func (x *UpdateReq_Dice) GetAwardType() int32 { + if x != nil { + return x.AwardType + } + return 0 +} + +func (x *UpdateReq_Dice) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *UpdateReq_Dice) GetRollAgain() int32 { + if x != nil { + return x.RollAgain + } + return 0 +} + +func (x *UpdateReq_Dice) GetFixDiceCond() int32 { + if x != nil { + return x.FixDiceCond + } + return 0 +} + +func (x *UpdateReq_Dice) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *UpdateReq_Dice) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *UpdateReq_Dice) GetCloudImg() string { + if x != nil { + return x.CloudImg + } + return "" +} + +type UpdateReq_MapPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blank string `protobuf:"bytes,1,opt,name=blank,proto3" json:"blank,omitempty"` //空白底座 + Again string `protobuf:"bytes,2,opt,name=again,proto3" json:"again,omitempty"` //再摇一次底座 + Normal string `protobuf:"bytes,3,opt,name=normal,proto3" json:"normal,omitempty"` //普通奖品底座 + Supper string `protobuf:"bytes,4,opt,name=supper,proto3" json:"supper,omitempty"` //超级大奖底座 +} + +func (x *UpdateReq_MapPoint) Reset() { + *x = UpdateReq_MapPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[207] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_MapPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_MapPoint) ProtoMessage() {} + +func (x *UpdateReq_MapPoint) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[207] + 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 UpdateReq_MapPoint.ProtoReflect.Descriptor instead. +func (*UpdateReq_MapPoint) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 49} +} + +func (x *UpdateReq_MapPoint) GetBlank() string { + if x != nil { + return x.Blank + } + return "" +} + +func (x *UpdateReq_MapPoint) GetAgain() string { + if x != nil { + return x.Again + } + return "" +} + +func (x *UpdateReq_MapPoint) GetNormal() string { + if x != nil { + return x.Normal + } + return "" +} + +func (x *UpdateReq_MapPoint) GetSupper() string { + if x != nil { + return x.Supper + } + return "" +} + +type UpdateReq_Grow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AutoHour int32 `protobuf:"varint,1,opt,name=auto_hour,json=autoHour,proto3" json:"auto_hour,omitempty"` //自动生产成长道具小时数 + AutoNum int32 `protobuf:"varint,2,opt,name=auto_num,json=autoNum,proto3" json:"auto_num,omitempty"` //生产的成长道具数 + GrowNum int32 `protobuf:"varint,3,opt,name=grow_num,json=growNum,proto3" json:"grow_num,omitempty"` //邀请可获得的成长道具数量 + TargetNum int32 `protobuf:"varint,4,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //获得成长道具需要邀请的人数 + Revive int32 `protobuf:"varint,5,opt,name=revive,proto3" json:"revive,omitempty"` //是否支持复活(0-否,1-是) + ReviveNum int32 `protobuf:"varint,6,opt,name=revive_num,json=reviveNum,proto3" json:"revive_num,omitempty"` //复活需要邀请的好友数 + DieHour int32 `protobuf:"varint,7,opt,name=die_hour,json=dieHour,proto3" json:"die_hour,omitempty"` //未获得成长道具导致的死亡时间 + Steps []*UpdateReq_GrowStep `protobuf:"bytes,8,rep,name=steps,proto3" json:"steps,omitempty"` //成长阶段 + InitNum int32 `protobuf:"varint,9,opt,name=init_num,json=initNum,proto3" json:"init_num,omitempty"` //初始成长道具数量 +} + +func (x *UpdateReq_Grow) Reset() { + *x = UpdateReq_Grow{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[208] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Grow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Grow) ProtoMessage() {} + +func (x *UpdateReq_Grow) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[208] + 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 UpdateReq_Grow.ProtoReflect.Descriptor instead. +func (*UpdateReq_Grow) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 50} +} + +func (x *UpdateReq_Grow) GetAutoHour() int32 { + if x != nil { + return x.AutoHour + } + return 0 +} + +func (x *UpdateReq_Grow) GetAutoNum() int32 { + if x != nil { + return x.AutoNum + } + return 0 +} + +func (x *UpdateReq_Grow) GetGrowNum() int32 { + if x != nil { + return x.GrowNum + } + return 0 +} + +func (x *UpdateReq_Grow) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *UpdateReq_Grow) GetRevive() int32 { + if x != nil { + return x.Revive + } + return 0 +} + +func (x *UpdateReq_Grow) GetReviveNum() int32 { + if x != nil { + return x.ReviveNum + } + return 0 +} + +func (x *UpdateReq_Grow) GetDieHour() int32 { + if x != nil { + return x.DieHour + } + return 0 +} + +func (x *UpdateReq_Grow) GetSteps() []*UpdateReq_GrowStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *UpdateReq_Grow) GetInitNum() int32 { + if x != nil { + return x.InitNum + } + return 0 +} + +type UpdateReq_GrowStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //需要的养成道具数量 +} + +func (x *UpdateReq_GrowStep) Reset() { + *x = UpdateReq_GrowStep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[209] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_GrowStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_GrowStep) ProtoMessage() {} + +func (x *UpdateReq_GrowStep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[209] + 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 UpdateReq_GrowStep.ProtoReflect.Descriptor instead. +func (*UpdateReq_GrowStep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 51} +} + +func (x *UpdateReq_GrowStep) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq_GrowStep) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type UpdateReq_Ballot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽签数 + DayChance int32 `protobuf:"varint,2,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽签数 +} + +func (x *UpdateReq_Ballot) Reset() { + *x = UpdateReq_Ballot{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[210] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Ballot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Ballot) ProtoMessage() {} + +func (x *UpdateReq_Ballot) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[210] + 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 UpdateReq_Ballot.ProtoReflect.Descriptor instead. +func (*UpdateReq_Ballot) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 52} +} + +func (x *UpdateReq_Ballot) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_Ballot) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type UpdateReq_Chop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ShowBar int32 `protobuf:"varint,1,opt,name=show_bar,json=showBar,proto3" json:"show_bar,omitempty"` //是否展示进度条(0-否,1-是) +} + +func (x *UpdateReq_Chop) Reset() { + *x = UpdateReq_Chop{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[211] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Chop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Chop) ProtoMessage() {} + +func (x *UpdateReq_Chop) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[211] + 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 UpdateReq_Chop.ProtoReflect.Descriptor instead. +func (*UpdateReq_Chop) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 53} +} + +func (x *UpdateReq_Chop) GetShowBar() int32 { + if x != nil { + return x.ShowBar + } + return 0 +} + +type UpdateReq_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExpiredDay int32 `protobuf:"varint,1,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //任务重置天数 + Price int32 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + PriceNum int32 `protobuf:"varint,3,opt,name=price_num,json=priceNum,proto3" json:"price_num,omitempty"` //奖品总份额 + Currency int32 `protobuf:"varint,4,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 + LoopNum int32 `protobuf:"varint,5,opt,name=loop_num,json=loopNum,proto3" json:"loop_num,omitempty"` //支持循环次数 +} + +func (x *UpdateReq_Cash) Reset() { + *x = UpdateReq_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[212] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Cash) ProtoMessage() {} + +func (x *UpdateReq_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[212] + 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 UpdateReq_Cash.ProtoReflect.Descriptor instead. +func (*UpdateReq_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 54} +} + +func (x *UpdateReq_Cash) GetExpiredDay() int32 { + if x != nil { + return x.ExpiredDay + } + return 0 +} + +func (x *UpdateReq_Cash) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *UpdateReq_Cash) GetPriceNum() int32 { + if x != nil { + return x.PriceNum + } + return 0 +} + +func (x *UpdateReq_Cash) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +func (x *UpdateReq_Cash) GetLoopNum() int32 { + if x != nil { + return x.LoopNum + } + return 0 +} + +type UpdateReq_Flip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖机会次数 + CardImg string `protobuf:"bytes,2,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡牌图片 + DayChance int32 `protobuf:"varint,3,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽奖机会次数 +} + +func (x *UpdateReq_Flip) Reset() { + *x = UpdateReq_Flip{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[213] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Flip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Flip) ProtoMessage() {} + +func (x *UpdateReq_Flip) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[213] + 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 UpdateReq_Flip.ProtoReflect.Descriptor instead. +func (*UpdateReq_Flip) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 55} +} + +func (x *UpdateReq_Flip) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *UpdateReq_Flip) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +func (x *UpdateReq_Flip) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type UpdateReq_Keep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Collect int32 `protobuf:"varint,1,opt,name=collect,proto3" json:"collect,omitempty"` //获得最终奖品需要的总收集数 + CollectSecond int32 `protobuf:"varint,2,opt,name=collect_second,json=collectSecond,proto3" json:"collect_second,omitempty"` //单个收集需要的二级资源数 + OpenInvite int32 `protobuf:"varint,3,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请(0-关闭,1-开启) + Invite *UpdateReq_Invite `protobuf:"bytes,4,opt,name=invite,proto3" json:"invite,omitempty"` //拉新配置 + InitGet int32 `protobuf:"varint,5,opt,name=init_get,json=initGet,proto3" json:"init_get,omitempty"` //初始道具数 + SecGet float64 `protobuf:"fixed64,6,opt,name=sec_get,json=secGet,proto3" json:"sec_get,omitempty"` //每秒获得道具数 + FeedNum int32 `protobuf:"varint,7,opt,name=feed_num,json=feedNum,proto3" json:"feed_num,omitempty"` //每次使用道具数 + FeedCycle int32 `protobuf:"varint,8,opt,name=feed_cycle,json=feedCycle,proto3" json:"feed_cycle,omitempty"` //喂养周期(单位:天) + MaxFeed int32 `protobuf:"varint,9,opt,name=max_feed,json=maxFeed,proto3" json:"max_feed,omitempty"` //最大可领养次数 + FeedGet int32 `protobuf:"varint,10,opt,name=feed_get,json=feedGet,proto3" json:"feed_get,omitempty"` //喂养能得到的道具数 + FeedGetNum int32 `protobuf:"varint,11,opt,name=feed_get_num,json=feedGetNum,proto3" json:"feed_get_num,omitempty"` //得到喂养道具需要的喂养次数 + TalkText []*UpdateReq_Talk `protobuf:"bytes,12,rep,name=talk_text,json=talkText,proto3" json:"talk_text,omitempty"` //对话文案 + Steps []*UpdateReq_KeepStep `protobuf:"bytes,13,rep,name=steps,proto3" json:"steps,omitempty"` //养成阶梯 + SecGetDayLimit float64 `protobuf:"fixed64,14,opt,name=sec_get_day_limit,json=secGetDayLimit,proto3" json:"sec_get_day_limit,omitempty"` //每秒获得道具每日上限 + MachineType int32 `protobuf:"varint,15,opt,name=machine_type,json=machineType,proto3" json:"machine_type,omitempty"` //狗粮机类型(1-在线收益,2-离线收益) + OfflineMin int32 `protobuf:"varint,16,opt,name=offline_min,json=offlineMin,proto3" json:"offline_min,omitempty"` //离线分钟时长 + OfflineGet int32 `protobuf:"varint,17,opt,name=offline_get,json=offlineGet,proto3" json:"offline_get,omitempty"` //离线收益最大值 + OfflineLimit int32 `protobuf:"varint,18,opt,name=offline_limit,json=offlineLimit,proto3" json:"offline_limit,omitempty"` //离线收益最大领取次数 +} + +func (x *UpdateReq_Keep) Reset() { + *x = UpdateReq_Keep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[214] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Keep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Keep) ProtoMessage() {} + +func (x *UpdateReq_Keep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[214] + 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 UpdateReq_Keep.ProtoReflect.Descriptor instead. +func (*UpdateReq_Keep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 56} +} + +func (x *UpdateReq_Keep) GetCollect() int32 { + if x != nil { + return x.Collect + } + return 0 +} + +func (x *UpdateReq_Keep) GetCollectSecond() int32 { + if x != nil { + return x.CollectSecond + } + return 0 +} + +func (x *UpdateReq_Keep) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *UpdateReq_Keep) GetInvite() *UpdateReq_Invite { + if x != nil { + return x.Invite + } + return nil +} + +func (x *UpdateReq_Keep) GetInitGet() int32 { + if x != nil { + return x.InitGet + } + return 0 +} + +func (x *UpdateReq_Keep) GetSecGet() float64 { + if x != nil { + return x.SecGet + } + return 0 +} + +func (x *UpdateReq_Keep) GetFeedNum() int32 { + if x != nil { + return x.FeedNum + } + return 0 +} + +func (x *UpdateReq_Keep) GetFeedCycle() int32 { + if x != nil { + return x.FeedCycle + } + return 0 +} + +func (x *UpdateReq_Keep) GetMaxFeed() int32 { + if x != nil { + return x.MaxFeed + } + return 0 +} + +func (x *UpdateReq_Keep) GetFeedGet() int32 { + if x != nil { + return x.FeedGet + } + return 0 +} + +func (x *UpdateReq_Keep) GetFeedGetNum() int32 { + if x != nil { + return x.FeedGetNum + } + return 0 +} + +func (x *UpdateReq_Keep) GetTalkText() []*UpdateReq_Talk { + if x != nil { + return x.TalkText + } + return nil +} + +func (x *UpdateReq_Keep) GetSteps() []*UpdateReq_KeepStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *UpdateReq_Keep) GetSecGetDayLimit() float64 { + if x != nil { + return x.SecGetDayLimit + } + return 0 +} + +func (x *UpdateReq_Keep) GetMachineType() int32 { + if x != nil { + return x.MachineType + } + return 0 +} + +func (x *UpdateReq_Keep) GetOfflineMin() int32 { + if x != nil { + return x.OfflineMin + } + return 0 +} + +func (x *UpdateReq_Keep) GetOfflineGet() int32 { + if x != nil { + return x.OfflineGet + } + return 0 +} + +func (x *UpdateReq_Keep) GetOfflineLimit() int32 { + if x != nil { + return x.OfflineLimit + } + return 0 +} + +type UpdateReq_Invite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InviteType int32 `protobuf:"varint,1,opt,name=invite_type,json=inviteType,proto3" json:"invite_type,omitempty"` //邀请类型(1-下载,2-安装) + InviteGet int32 `protobuf:"varint,2,opt,name=invite_get,json=inviteGet,proto3" json:"invite_get,omitempty"` //邀请可获得的道具数量 + RewardSelected int32 `protobuf:"varint,3,opt,name=reward_selected,json=rewardSelected,proto3" json:"reward_selected,omitempty"` //选择礼品可获得的道具数 + FeedThird int32 `protobuf:"varint,4,opt,name=feed_third,json=feedThird,proto3" json:"feed_third,omitempty"` //喂养3次可获得的道具数 + DayFirstInvite int32 `protobuf:"varint,5,opt,name=day_first_invite,json=dayFirstInvite,proto3" json:"day_first_invite,omitempty"` //是否开启每日首次拉新(0-否,1-是) + DayFirstGet int32 `protobuf:"varint,6,opt,name=day_first_get,json=dayFirstGet,proto3" json:"day_first_get,omitempty"` //每日首次拉新可获得的道具数 + DayFirstSelected int32 `protobuf:"varint,7,opt,name=day_first_selected,json=dayFirstSelected,proto3" json:"day_first_selected,omitempty"` //每日首日选择礼物可获得的道具数 + DayFirstThird int32 `protobuf:"varint,8,opt,name=day_first_third,json=dayFirstThird,proto3" json:"day_first_third,omitempty"` //每日首次喂养三次可获得的道具数 + InviteMaxGet int32 `protobuf:"varint,9,opt,name=invite_max_get,json=inviteMaxGet,proto3" json:"invite_max_get,omitempty"` //邀请人可获得的最大道具数 +} + +func (x *UpdateReq_Invite) Reset() { + *x = UpdateReq_Invite{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[215] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Invite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Invite) ProtoMessage() {} + +func (x *UpdateReq_Invite) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[215] + 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 UpdateReq_Invite.ProtoReflect.Descriptor instead. +func (*UpdateReq_Invite) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 57} +} + +func (x *UpdateReq_Invite) GetInviteType() int32 { + if x != nil { + return x.InviteType + } + return 0 +} + +func (x *UpdateReq_Invite) GetInviteGet() int32 { + if x != nil { + return x.InviteGet + } + return 0 +} + +func (x *UpdateReq_Invite) GetRewardSelected() int32 { + if x != nil { + return x.RewardSelected + } + return 0 +} + +func (x *UpdateReq_Invite) GetFeedThird() int32 { + if x != nil { + return x.FeedThird + } + return 0 +} + +func (x *UpdateReq_Invite) GetDayFirstInvite() int32 { + if x != nil { + return x.DayFirstInvite + } + return 0 +} + +func (x *UpdateReq_Invite) GetDayFirstGet() int32 { + if x != nil { + return x.DayFirstGet + } + return 0 +} + +func (x *UpdateReq_Invite) GetDayFirstSelected() int32 { + if x != nil { + return x.DayFirstSelected + } + return 0 +} + +func (x *UpdateReq_Invite) GetDayFirstThird() int32 { + if x != nil { + return x.DayFirstThird + } + return 0 +} + +func (x *UpdateReq_Invite) GetInviteMaxGet() int32 { + if x != nil { + return x.InviteMaxGet + } + return 0 +} + +type UpdateReq_Talk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextType int32 `protobuf:"varint,1,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 +} + +func (x *UpdateReq_Talk) Reset() { + *x = UpdateReq_Talk{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[216] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Talk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Talk) ProtoMessage() {} + +func (x *UpdateReq_Talk) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[216] + 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 UpdateReq_Talk.ProtoReflect.Descriptor instead. +func (*UpdateReq_Talk) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 58} +} + +func (x *UpdateReq_Talk) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *UpdateReq_Talk) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type UpdateReq_KeepStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Step int32 `protobuf:"varint,1,opt,name=step,proto3" json:"step,omitempty"` //阶段 + Percent int32 `protobuf:"varint,2,opt,name=percent,proto3" json:"percent,omitempty"` //对应的进度条数值 + RewardType int32 `protobuf:"varint,3,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品类型(1-成长道具,2-奖品) + Reward *UpdateReq_Reward `protobuf:"bytes,4,opt,name=reward,proto3" json:"reward,omitempty"` //奖品数据时 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放道具数量 +} + +func (x *UpdateReq_KeepStep) Reset() { + *x = UpdateReq_KeepStep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[217] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_KeepStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_KeepStep) ProtoMessage() {} + +func (x *UpdateReq_KeepStep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[217] + 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 UpdateReq_KeepStep.ProtoReflect.Descriptor instead. +func (*UpdateReq_KeepStep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 59} +} + +func (x *UpdateReq_KeepStep) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *UpdateReq_KeepStep) GetPercent() int32 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *UpdateReq_KeepStep) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *UpdateReq_KeepStep) GetReward() *UpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *UpdateReq_KeepStep) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +type UpdateReq_Push struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskReset *UpdateReq_PushOne `protobuf:"bytes,1,opt,name=task_reset,json=taskReset,proto3" json:"task_reset,omitempty"` //重制提醒 + Active *UpdateReq_PushOne `protobuf:"bytes,2,opt,name=active,proto3" json:"active,omitempty"` //活跃提醒 + Offline *UpdateReq_PushOne `protobuf:"bytes,3,opt,name=offline,proto3" json:"offline,omitempty"` //离线提醒 + Visit *UpdateReq_PushOne `protobuf:"bytes,4,opt,name=visit,proto3" json:"visit,omitempty"` //访问提醒 +} + +func (x *UpdateReq_Push) Reset() { + *x = UpdateReq_Push{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[218] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Push) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Push) ProtoMessage() {} + +func (x *UpdateReq_Push) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[218] + 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 UpdateReq_Push.ProtoReflect.Descriptor instead. +func (*UpdateReq_Push) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 60} +} + +func (x *UpdateReq_Push) GetTaskReset() *UpdateReq_PushOne { + if x != nil { + return x.TaskReset + } + return nil +} + +func (x *UpdateReq_Push) GetActive() *UpdateReq_PushOne { + if x != nil { + return x.Active + } + return nil +} + +func (x *UpdateReq_Push) GetOffline() *UpdateReq_PushOne { + if x != nil { + return x.Offline + } + return nil +} + +func (x *UpdateReq_Push) GetVisit() *UpdateReq_PushOne { + if x != nil { + return x.Visit + } + return nil +} + +type UpdateReq_PushOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + PushCond []*UpdateReq_PushCond `protobuf:"bytes,2,rep,name=push_cond,json=pushCond,proto3" json:"push_cond,omitempty"` //条件内容 +} + +func (x *UpdateReq_PushOne) Reset() { + *x = UpdateReq_PushOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[219] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_PushOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_PushOne) ProtoMessage() {} + +func (x *UpdateReq_PushOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[219] + 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 UpdateReq_PushOne.ProtoReflect.Descriptor instead. +func (*UpdateReq_PushOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 61} +} + +func (x *UpdateReq_PushOne) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *UpdateReq_PushOne) GetPushCond() []*UpdateReq_PushCond { + if x != nil { + return x.PushCond + } + return nil +} + +type UpdateReq_PushCond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //条件标识 + Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"` //标识值 +} + +func (x *UpdateReq_PushCond) Reset() { + *x = UpdateReq_PushCond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[220] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_PushCond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_PushCond) ProtoMessage() {} + +func (x *UpdateReq_PushCond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[220] + 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 UpdateReq_PushCond.ProtoReflect.Descriptor instead. +func (*UpdateReq_PushCond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 62} +} + +func (x *UpdateReq_PushCond) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UpdateReq_PushCond) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type UpdateReq_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GoldNum int32 `protobuf:"varint,1,opt,name=gold_num,json=goldNum,proto3" json:"gold_num,omitempty"` //任务重置天数 + ExpiredDay int32 `protobuf:"varint,2,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //任务重置天数 + Price float64 `protobuf:"fixed64,3,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + PriceNum int32 `protobuf:"varint,4,opt,name=price_num,json=priceNum,proto3" json:"price_num,omitempty"` //奖品总份额 + Currency int32 `protobuf:"varint,5,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *UpdateReq_Gold) Reset() { + *x = UpdateReq_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[221] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Gold) ProtoMessage() {} + +func (x *UpdateReq_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[221] + 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 UpdateReq_Gold.ProtoReflect.Descriptor instead. +func (*UpdateReq_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 63} +} + +func (x *UpdateReq_Gold) GetGoldNum() int32 { + if x != nil { + return x.GoldNum + } + return 0 +} + +func (x *UpdateReq_Gold) GetExpiredDay() int32 { + if x != nil { + return x.ExpiredDay + } + return 0 +} + +func (x *UpdateReq_Gold) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *UpdateReq_Gold) GetPriceNum() int32 { + if x != nil { + return x.PriceNum + } + return 0 +} + +func (x *UpdateReq_Gold) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type UpdateReq_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CoinImg string `protobuf:"bytes,1,opt,name=coin_img,json=coinImg,proto3" json:"coin_img,omitempty"` //金币图片 + OpenDays int32 `protobuf:"varint,2,opt,name=open_days,json=openDays,proto3" json:"open_days,omitempty"` //开奖天数 + OpenLimit int32 `protobuf:"varint,3,opt,name=open_limit,json=openLimit,proto3" json:"open_limit,omitempty"` //开奖次数限制 + InitCoin int32 `protobuf:"varint,4,opt,name=init_coin,json=initCoin,proto3" json:"init_coin,omitempty"` //初始金币数 + InitUse int32 `protobuf:"varint,5,opt,name=init_use,json=initUse,proto3" json:"init_use,omitempty"` //初始投放次数 + UseCoin int32 `protobuf:"varint,6,opt,name=use_coin,json=useCoin,proto3" json:"use_coin,omitempty"` //单次投放消耗金币数 + UseLimit int32 `protobuf:"varint,7,opt,name=use_limit,json=useLimit,proto3" json:"use_limit,omitempty"` //单次瓜分最多投放次数 + UrlId int64 `protobuf:"varint,8,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + LackBtn []int32 `protobuf:"varint,9,rep,packed,name=lack_btn,json=lackBtn,proto3" json:"lack_btn,omitempty"` //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2] + CustomBtnText string `protobuf:"bytes,10,opt,name=custom_btn_text,json=customBtnText,proto3" json:"custom_btn_text,omitempty"` //自定义按钮文案 + CustomWebUrl string `protobuf:"bytes,11,opt,name=custom_web_url,json=customWebUrl,proto3" json:"custom_web_url,omitempty"` //自定义web端url + CustomExtraParam string `protobuf:"bytes,12,opt,name=custom_extra_param,json=customExtraParam,proto3" json:"custom_extra_param,omitempty"` //自定义app附加参数 + CustomPcParam string `protobuf:"bytes,13,opt,name=custom_pc_param,json=customPcParam,proto3" json:"custom_pc_param,omitempty"` //自定义pc附加参数 +} + +func (x *UpdateReq_Coin) Reset() { + *x = UpdateReq_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[222] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Coin) ProtoMessage() {} + +func (x *UpdateReq_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[222] + 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 UpdateReq_Coin.ProtoReflect.Descriptor instead. +func (*UpdateReq_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{10, 64} +} + +func (x *UpdateReq_Coin) GetCoinImg() string { + if x != nil { + return x.CoinImg + } + return "" +} + +func (x *UpdateReq_Coin) GetOpenDays() int32 { + if x != nil { + return x.OpenDays + } + return 0 +} + +func (x *UpdateReq_Coin) GetOpenLimit() int32 { + if x != nil { + return x.OpenLimit + } + return 0 +} + +func (x *UpdateReq_Coin) GetInitCoin() int32 { + if x != nil { + return x.InitCoin + } + return 0 +} + +func (x *UpdateReq_Coin) GetInitUse() int32 { + if x != nil { + return x.InitUse + } + return 0 +} + +func (x *UpdateReq_Coin) GetUseCoin() int32 { + if x != nil { + return x.UseCoin + } + return 0 +} + +func (x *UpdateReq_Coin) GetUseLimit() int32 { + if x != nil { + return x.UseLimit + } + return 0 +} + +func (x *UpdateReq_Coin) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *UpdateReq_Coin) GetLackBtn() []int32 { + if x != nil { + return x.LackBtn + } + return nil +} + +func (x *UpdateReq_Coin) GetCustomBtnText() string { + if x != nil { + return x.CustomBtnText + } + return "" +} + +func (x *UpdateReq_Coin) GetCustomWebUrl() string { + if x != nil { + return x.CustomWebUrl + } + return "" +} + +func (x *UpdateReq_Coin) GetCustomExtraParam() string { + if x != nil { + return x.CustomExtraParam + } + return "" +} + +func (x *UpdateReq_Coin) GetCustomPcParam() string { + if x != nil { + return x.CustomPcParam + } + return "" +} + +type ShowRes_GashaponStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + MachineImg string `protobuf:"bytes,4,opt,name=machine_img,json=machineImg,proto3" json:"machine_img,omitempty"` //机器图 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + EggType int32 `protobuf:"varint,6,opt,name=egg_type,json=eggType,proto3" json:"egg_type,omitempty"` //类型 + EggImgs []string `protobuf:"bytes,7,rep,name=egg_imgs,json=eggImgs,proto3" json:"egg_imgs,omitempty"` //扭蛋素材 +} + +func (x *ShowRes_GashaponStyle) Reset() { + *x = ShowRes_GashaponStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[223] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_GashaponStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_GashaponStyle) ProtoMessage() {} + +func (x *ShowRes_GashaponStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[223] + 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 ShowRes_GashaponStyle.ProtoReflect.Descriptor instead. +func (*ShowRes_GashaponStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *ShowRes_GashaponStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *ShowRes_GashaponStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *ShowRes_GashaponStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *ShowRes_GashaponStyle) GetMachineImg() string { + if x != nil { + return x.MachineImg + } + return "" +} + +func (x *ShowRes_GashaponStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *ShowRes_GashaponStyle) GetEggType() int32 { + if x != nil { + return x.EggType + } + return 0 +} + +func (x *ShowRes_GashaponStyle) GetEggImgs() []string { + if x != nil { + return x.EggImgs + } + return nil +} + +type ShowRes_Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FirstVisit *ShowRes_EventOne `protobuf:"bytes,1,opt,name=first_visit,json=firstVisit,proto3" json:"first_visit,omitempty"` //首次访问 +} + +func (x *ShowRes_Event) Reset() { + *x = ShowRes_Event{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[224] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Event) ProtoMessage() {} + +func (x *ShowRes_Event) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[224] + 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 ShowRes_Event.ProtoReflect.Descriptor instead. +func (*ShowRes_Event) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 1} +} + +func (x *ShowRes_Event) GetFirstVisit() *ShowRes_EventOne { + if x != nil { + return x.FirstVisit + } + return nil +} + +type ShowRes_EventOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + Rewards []*ShowRes_EventReward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖励 +} + +func (x *ShowRes_EventOne) Reset() { + *x = ShowRes_EventOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[225] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_EventOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_EventOne) ProtoMessage() {} + +func (x *ShowRes_EventOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[225] + 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 ShowRes_EventOne.ProtoReflect.Descriptor instead. +func (*ShowRes_EventOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 2} +} + +func (x *ShowRes_EventOne) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_EventOne) GetRewards() []*ShowRes_EventReward { + if x != nil { + return x.Rewards + } + return nil +} + +type ShowRes_EventReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + PropMark string `protobuf:"bytes,2,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward *ShowRes_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 + ExpiredDay string `protobuf:"bytes,5,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 +} + +func (x *ShowRes_EventReward) Reset() { + *x = ShowRes_EventReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[226] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_EventReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_EventReward) ProtoMessage() {} + +func (x *ShowRes_EventReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[226] + 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 ShowRes_EventReward.ProtoReflect.Descriptor instead. +func (*ShowRes_EventReward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 3} +} + +func (x *ShowRes_EventReward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_EventReward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ShowRes_EventReward) GetReward() *ShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ShowRes_EventReward) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_EventReward) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +type ShowRes_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖次数 + PropMarks []string `protobuf:"bytes,2,rep,name=prop_marks,json=propMarks,proto3" json:"prop_marks,omitempty"` //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌) + Red *ShowRes_UnoGroup `protobuf:"bytes,3,opt,name=red,proto3" json:"red,omitempty"` //红牌配置 + Yellow *ShowRes_UnoGroup `protobuf:"bytes,4,opt,name=yellow,proto3" json:"yellow,omitempty"` //黄牌配置 + Blue *ShowRes_UnoGroup `protobuf:"bytes,5,opt,name=blue,proto3" json:"blue,omitempty"` //黑牌配置 + Green *ShowRes_UnoGroup `protobuf:"bytes,6,opt,name=green,proto3" json:"green,omitempty"` //绿牌配置 +} + +func (x *ShowRes_Uno) Reset() { + *x = ShowRes_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[227] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Uno) ProtoMessage() {} + +func (x *ShowRes_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[227] + 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 ShowRes_Uno.ProtoReflect.Descriptor instead. +func (*ShowRes_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 4} +} + +func (x *ShowRes_Uno) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_Uno) GetPropMarks() []string { + if x != nil { + return x.PropMarks + } + return nil +} + +func (x *ShowRes_Uno) GetRed() *ShowRes_UnoGroup { + if x != nil { + return x.Red + } + return nil +} + +func (x *ShowRes_Uno) GetYellow() *ShowRes_UnoGroup { + if x != nil { + return x.Yellow + } + return nil +} + +func (x *ShowRes_Uno) GetBlue() *ShowRes_UnoGroup { + if x != nil { + return x.Blue + } + return nil +} + +func (x *ShowRes_Uno) GetGreen() *ShowRes_UnoGroup { + if x != nil { + return x.Green + } + return nil +} + +type ShowRes_UnoGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //牌型id + Odds string `protobuf:"bytes,2,opt,name=odds,proto3" json:"odds,omitempty"` //获得牌型概率 + Reward *ShowRes_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + OpenRule int32 `protobuf:"varint,4,opt,name=open_rule,json=openRule,proto3" json:"open_rule,omitempty"` //是否开启得牌规则(0-否,1-是) + LimitRule *ShowRes_UnoLimitRule `protobuf:"bytes,5,opt,name=limit_rule,json=limitRule,proto3" json:"limit_rule,omitempty"` //得牌规则 + CustomCard int32 `protobuf:"varint,6,opt,name=custom_card,json=customCard,proto3" json:"custom_card,omitempty"` //自定义卡牌(0-否,1-是) + Cards []*ShowRes_UnoCard `protobuf:"bytes,7,rep,name=cards,proto3" json:"cards,omitempty"` //自定义卡牌 +} + +func (x *ShowRes_UnoGroup) Reset() { + *x = ShowRes_UnoGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[228] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_UnoGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_UnoGroup) ProtoMessage() {} + +func (x *ShowRes_UnoGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[228] + 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 ShowRes_UnoGroup.ProtoReflect.Descriptor instead. +func (*ShowRes_UnoGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 5} +} + +func (x *ShowRes_UnoGroup) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_UnoGroup) GetOdds() string { + if x != nil { + return x.Odds + } + return "" +} + +func (x *ShowRes_UnoGroup) GetReward() *ShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ShowRes_UnoGroup) GetOpenRule() int32 { + if x != nil { + return x.OpenRule + } + return 0 +} + +func (x *ShowRes_UnoGroup) GetLimitRule() *ShowRes_UnoLimitRule { + if x != nil { + return x.LimitRule + } + return nil +} + +func (x *ShowRes_UnoGroup) GetCustomCard() int32 { + if x != nil { + return x.CustomCard + } + return 0 +} + +func (x *ShowRes_UnoGroup) GetCards() []*ShowRes_UnoCard { + if x != nil { + return x.Cards + } + return nil +} + +type ShowRes_UnoLimitRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitNum int32 `protobuf:"varint,1,opt,name=init_num,json=initNum,proto3" json:"init_num,omitempty"` //初始的最大可获得牌型数 + SignDay int32 `protobuf:"varint,2,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + AddNum int32 `protobuf:"varint,3,opt,name=add_num,json=addNum,proto3" json:"add_num,omitempty"` //完成条件可获得最大牌型数 + ResetType int32 `protobuf:"varint,4,opt,name=reset_type,json=resetType,proto3" json:"reset_type,omitempty"` //重置规则(1-不重置,2-获奖后重置) +} + +func (x *ShowRes_UnoLimitRule) Reset() { + *x = ShowRes_UnoLimitRule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[229] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_UnoLimitRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_UnoLimitRule) ProtoMessage() {} + +func (x *ShowRes_UnoLimitRule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[229] + 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 ShowRes_UnoLimitRule.ProtoReflect.Descriptor instead. +func (*ShowRes_UnoLimitRule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 6} +} + +func (x *ShowRes_UnoLimitRule) GetInitNum() int32 { + if x != nil { + return x.InitNum + } + return 0 +} + +func (x *ShowRes_UnoLimitRule) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ShowRes_UnoLimitRule) GetAddNum() int32 { + if x != nil { + return x.AddNum + } + return 0 +} + +func (x *ShowRes_UnoLimitRule) GetResetType() int32 { + if x != nil { + return x.ResetType + } + return 0 +} + +type ShowRes_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //牌id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //跳转按钮文案 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web跳转地址 + AppParam string `protobuf:"bytes,5,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App跳转参数 + PcParam string `protobuf:"bytes,6,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc跳转参数 + CardNo int32 `protobuf:"varint,7,opt,name=card_no,json=cardNo,proto3" json:"card_no,omitempty"` //牌号 +} + +func (x *ShowRes_UnoCard) Reset() { + *x = ShowRes_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[230] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_UnoCard) ProtoMessage() {} + +func (x *ShowRes_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[230] + 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 ShowRes_UnoCard.ProtoReflect.Descriptor instead. +func (*ShowRes_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 7} +} + +func (x *ShowRes_UnoCard) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_UnoCard) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_UnoCard) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ShowRes_UnoCard) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ShowRes_UnoCard) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ShowRes_UnoCard) GetCardNo() int32 { + if x != nil { + return x.CardNo + } + return 0 +} + +type ShowRes_Vs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始投票次数 + EachLimitNum int32 `protobuf:"varint,2,opt,name=each_limit_num,json=eachLimitNum,proto3" json:"each_limit_num,omitempty"` //每场可投票次数 + OpenPoint int32 `protobuf:"varint,3,opt,name=open_point,json=openPoint,proto3" json:"open_point,omitempty"` //是否开启积分(0-否,1-是) + PointsNum int32 `protobuf:"varint,4,opt,name=points_num,json=pointsNum,proto3" json:"points_num,omitempty"` //投票扣除积分数 + MallOpen int32 `protobuf:"varint,5,opt,name=mall_open,json=mallOpen,proto3" json:"mall_open,omitempty"` //是否使用积分商城(0-否,1-是) + MallId int64 `protobuf:"varint,6,opt,name=mall_id,json=mallId,proto3" json:"mall_id,omitempty"` //兑换商城id + VsTz int32 `protobuf:"varint,7,opt,name=vs_tz,json=vsTz,proto3" json:"vs_tz,omitempty"` //比赛时区 + ClaimType int32 `protobuf:"varint,8,opt,name=claim_type,json=claimType,proto3" json:"claim_type,omitempty"` //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + Schedules []*ShowRes_Schedule `protobuf:"bytes,9,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛事时间表 + IconMall string `protobuf:"bytes,10,opt,name=icon_mall,json=iconMall,proto3" json:"icon_mall,omitempty"` //商城图标 + IconReward string `protobuf:"bytes,11,opt,name=icon_reward,json=iconReward,proto3" json:"icon_reward,omitempty"` //奖励记录图标 + IconSchedule string `protobuf:"bytes,12,opt,name=icon_schedule,json=iconSchedule,proto3" json:"icon_schedule,omitempty"` //赛程图标 +} + +func (x *ShowRes_Vs) Reset() { + *x = ShowRes_Vs{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[231] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Vs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Vs) ProtoMessage() {} + +func (x *ShowRes_Vs) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[231] + 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 ShowRes_Vs.ProtoReflect.Descriptor instead. +func (*ShowRes_Vs) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 8} +} + +func (x *ShowRes_Vs) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_Vs) GetEachLimitNum() int32 { + if x != nil { + return x.EachLimitNum + } + return 0 +} + +func (x *ShowRes_Vs) GetOpenPoint() int32 { + if x != nil { + return x.OpenPoint + } + return 0 +} + +func (x *ShowRes_Vs) GetPointsNum() int32 { + if x != nil { + return x.PointsNum + } + return 0 +} + +func (x *ShowRes_Vs) GetMallOpen() int32 { + if x != nil { + return x.MallOpen + } + return 0 +} + +func (x *ShowRes_Vs) GetMallId() int64 { + if x != nil { + return x.MallId + } + return 0 +} + +func (x *ShowRes_Vs) GetVsTz() int32 { + if x != nil { + return x.VsTz + } + return 0 +} + +func (x *ShowRes_Vs) GetClaimType() int32 { + if x != nil { + return x.ClaimType + } + return 0 +} + +func (x *ShowRes_Vs) GetSchedules() []*ShowRes_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *ShowRes_Vs) GetIconMall() string { + if x != nil { + return x.IconMall + } + return "" +} + +func (x *ShowRes_Vs) GetIconReward() string { + if x != nil { + return x.IconReward + } + return "" +} + +func (x *ShowRes_Vs) GetIconSchedule() string { + if x != nil { + return x.IconSchedule + } + return "" +} + +type ShowRes_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + PkTeams []*ShowRes_PkTeam `protobuf:"bytes,2,rep,name=pk_teams,json=pkTeams,proto3" json:"pk_teams,omitempty"` //队伍 +} + +func (x *ShowRes_Schedule) Reset() { + *x = ShowRes_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[232] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Schedule) ProtoMessage() {} + +func (x *ShowRes_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[232] + 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 ShowRes_Schedule.ProtoReflect.Descriptor instead. +func (*ShowRes_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 9} +} + +func (x *ShowRes_Schedule) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_Schedule) GetPkTeams() []*ShowRes_PkTeam { + if x != nil { + return x.PkTeams + } + return nil +} + +type ShowRes_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Teams []*ShowRes_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + VoteStart int64 `protobuf:"varint,3,opt,name=vote_start,json=voteStart,proto3" json:"vote_start,omitempty"` //开始时间 + VoteEnd int64 `protobuf:"varint,4,opt,name=vote_end,json=voteEnd,proto3" json:"vote_end,omitempty"` //结束时间 + VsAt int64 `protobuf:"varint,5,opt,name=vs_at,json=vsAt,proto3" json:"vs_at,omitempty"` //比赛开始时间 + VsImg string `protobuf:"bytes,6,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //比赛图 + Desc string `protobuf:"bytes,7,opt,name=desc,proto3" json:"desc,omitempty"` //标题描述 + PropMark string `protobuf:"bytes,8,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(reward-奖品,point-积分) + RewardId int64 `protobuf:"varint,9,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库奖品id + PropNum int32 `protobuf:"varint,10,opt,name=prop_num,json=propNum,proto3" json:"prop_num,omitempty"` //道具数量 + ExpiredDay string `protobuf:"bytes,11,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + IsSettlement int32 `protobuf:"varint,12,opt,name=is_settlement,json=isSettlement,proto3" json:"is_settlement,omitempty"` //是否结算(0-否,1-是) + OtherVote []string `protobuf:"bytes,13,rep,name=other_vote,json=otherVote,proto3" json:"other_vote,omitempty"` //其他投票方式 + OpenOdds int32 `protobuf:"varint,14,opt,name=open_odds,json=openOdds,proto3" json:"open_odds,omitempty"` //是否开启赔率(0-否,1-是) + OddsLeft string `protobuf:"bytes,15,opt,name=odds_left,json=oddsLeft,proto3" json:"odds_left,omitempty"` //左边赔率 + OddsRight string `protobuf:"bytes,16,opt,name=odds_right,json=oddsRight,proto3" json:"odds_right,omitempty"` //右边赔率 + OddsDraw string `protobuf:"bytes,17,opt,name=odds_draw,json=oddsDraw,proto3" json:"odds_draw,omitempty"` //平局赔率 + Status int32 `protobuf:"varint,18,opt,name=status,proto3" json:"status,omitempty"` //投票状态(1-即将投票,2-投票中,3-待结算,4-已结算) +} + +func (x *ShowRes_PkTeam) Reset() { + *x = ShowRes_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[233] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_PkTeam) ProtoMessage() {} + +func (x *ShowRes_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[233] + 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 ShowRes_PkTeam.ProtoReflect.Descriptor instead. +func (*ShowRes_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 10} +} + +func (x *ShowRes_PkTeam) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_PkTeam) GetTeams() []*ShowRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *ShowRes_PkTeam) GetVoteStart() int64 { + if x != nil { + return x.VoteStart + } + return 0 +} + +func (x *ShowRes_PkTeam) GetVoteEnd() int64 { + if x != nil { + return x.VoteEnd + } + return 0 +} + +func (x *ShowRes_PkTeam) GetVsAt() int64 { + if x != nil { + return x.VsAt + } + return 0 +} + +func (x *ShowRes_PkTeam) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *ShowRes_PkTeam) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ShowRes_PkTeam) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ShowRes_PkTeam) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ShowRes_PkTeam) GetPropNum() int32 { + if x != nil { + return x.PropNum + } + return 0 +} + +func (x *ShowRes_PkTeam) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *ShowRes_PkTeam) GetIsSettlement() int32 { + if x != nil { + return x.IsSettlement + } + return 0 +} + +func (x *ShowRes_PkTeam) GetOtherVote() []string { + if x != nil { + return x.OtherVote + } + return nil +} + +func (x *ShowRes_PkTeam) GetOpenOdds() int32 { + if x != nil { + return x.OpenOdds + } + return 0 +} + +func (x *ShowRes_PkTeam) GetOddsLeft() string { + if x != nil { + return x.OddsLeft + } + return "" +} + +func (x *ShowRes_PkTeam) GetOddsRight() string { + if x != nil { + return x.OddsRight + } + return "" +} + +func (x *ShowRes_PkTeam) GetOddsDraw() string { + if x != nil { + return x.OddsDraw + } + return "" +} + +func (x *ShowRes_PkTeam) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ShowRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *ShowRes_Team) Reset() { + *x = ShowRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[234] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Team) ProtoMessage() {} + +func (x *ShowRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[234] + 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 ShowRes_Team.ProtoReflect.Descriptor instead. +func (*ShowRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 11} +} + +func (x *ShowRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ShowRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type ShowRes_Chat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启ai陪伴(0-关闭,1-开启) + HeaderImg string `protobuf:"bytes,2,opt,name=header_img,json=headerImg,proto3" json:"header_img,omitempty"` //宠物头像 + ChatBg string `protobuf:"bytes,3,opt,name=chat_bg,json=chatBg,proto3" json:"chat_bg,omitempty"` //聊天背景 + DayLimit int32 `protobuf:"varint,4,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日聊天上限 +} + +func (x *ShowRes_Chat) Reset() { + *x = ShowRes_Chat{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[235] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Chat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Chat) ProtoMessage() {} + +func (x *ShowRes_Chat) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[235] + 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 ShowRes_Chat.ProtoReflect.Descriptor instead. +func (*ShowRes_Chat) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 12} +} + +func (x *ShowRes_Chat) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_Chat) GetHeaderImg() string { + if x != nil { + return x.HeaderImg + } + return "" +} + +func (x *ShowRes_Chat) GetChatBg() string { + if x != nil { + return x.ChatBg + } + return "" +} + +func (x *ShowRes_Chat) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +type ShowRes_PointsUse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启积分消耗(0-否,1-是) + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` //积分icon图 + UrlId int64 `protobuf:"varint,3,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + UseNum int32 `protobuf:"varint,4,opt,name=use_num,json=useNum,proto3" json:"use_num,omitempty"` //单次兑换使用积分数量 + DayLimit int32 `protobuf:"varint,5,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日可兑换次数 + TotalLimit int32 `protobuf:"varint,6,opt,name=total_limit,json=totalLimit,proto3" json:"total_limit,omitempty"` //总兑换次数 +} + +func (x *ShowRes_PointsUse) Reset() { + *x = ShowRes_PointsUse{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[236] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_PointsUse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_PointsUse) ProtoMessage() {} + +func (x *ShowRes_PointsUse) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[236] + 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 ShowRes_PointsUse.ProtoReflect.Descriptor instead. +func (*ShowRes_PointsUse) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 13} +} + +func (x *ShowRes_PointsUse) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_PointsUse) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *ShowRes_PointsUse) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *ShowRes_PointsUse) GetUseNum() int32 { + if x != nil { + return x.UseNum + } + return 0 +} + +func (x *ShowRes_PointsUse) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *ShowRes_PointsUse) GetTotalLimit() int32 { + if x != nil { + return x.TotalLimit + } + return 0 +} + +type ShowRes_FlipStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `protobuf:"bytes,4,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + CardImg string `protobuf:"bytes,6,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡片素材 +} + +func (x *ShowRes_FlipStyle) Reset() { + *x = ShowRes_FlipStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[237] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_FlipStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_FlipStyle) ProtoMessage() {} + +func (x *ShowRes_FlipStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[237] + 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 ShowRes_FlipStyle.ProtoReflect.Descriptor instead. +func (*ShowRes_FlipStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 14} +} + +func (x *ShowRes_FlipStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *ShowRes_FlipStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *ShowRes_FlipStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *ShowRes_FlipStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *ShowRes_FlipStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *ShowRes_FlipStyle) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +type ShowRes_GridStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + ButtonColor string `protobuf:"bytes,4,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + PlayImg string `protobuf:"bytes,5,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //Go按钮图 + DisablePlayImg string `protobuf:"bytes,6,opt,name=disable_play_img,json=disablePlayImg,proto3" json:"disable_play_img,omitempty"` //Go按钮禁用 + MachineImg string `protobuf:"bytes,7,opt,name=machine_img,json=machineImg,proto3" json:"machine_img,omitempty"` //机器图 + GridImg string `protobuf:"bytes,8,opt,name=grid_img,json=gridImg,proto3" json:"grid_img,omitempty"` //方格图 + ActivateImg string `protobuf:"bytes,9,opt,name=activate_img,json=activateImg,proto3" json:"activate_img,omitempty"` //方格激活图 +} + +func (x *ShowRes_GridStyle) Reset() { + *x = ShowRes_GridStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[238] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_GridStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_GridStyle) ProtoMessage() {} + +func (x *ShowRes_GridStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[238] + 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 ShowRes_GridStyle.ProtoReflect.Descriptor instead. +func (*ShowRes_GridStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 15} +} + +func (x *ShowRes_GridStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *ShowRes_GridStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *ShowRes_GridStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *ShowRes_GridStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *ShowRes_GridStyle) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *ShowRes_GridStyle) GetDisablePlayImg() string { + if x != nil { + return x.DisablePlayImg + } + return "" +} + +func (x *ShowRes_GridStyle) GetMachineImg() string { + if x != nil { + return x.MachineImg + } + return "" +} + +func (x *ShowRes_GridStyle) GetGridImg() string { + if x != nil { + return x.GridImg + } + return "" +} + +func (x *ShowRes_GridStyle) GetActivateImg() string { + if x != nil { + return x.ActivateImg + } + return "" +} + +type ShowRes_WheelStyle struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopicMark string `protobuf:"bytes,1,opt,name=topic_mark,json=topicMark,proto3" json:"topic_mark,omitempty"` //主题标识 + MainImg string `protobuf:"bytes,2,opt,name=main_img,json=mainImg,proto3" json:"main_img,omitempty"` //活动背景图 + BgColor string `protobuf:"bytes,3,opt,name=bg_color,json=bgColor,proto3" json:"bg_color,omitempty"` //背景颜色 + Bottom1 string `protobuf:"bytes,4,opt,name=bottom1,proto3" json:"bottom1,omitempty"` //底部颜色1 + Bottom2 string `protobuf:"bytes,5,opt,name=bottom2,proto3" json:"bottom2,omitempty"` //底部颜色2 + Bottom3 string `protobuf:"bytes,6,opt,name=bottom3,proto3" json:"bottom3,omitempty"` //底部颜色3 + Pointer string `protobuf:"bytes,7,opt,name=pointer,proto3" json:"pointer,omitempty"` //指针图片 + PlayBtn string `protobuf:"bytes,8,opt,name=play_btn,json=playBtn,proto3" json:"play_btn,omitempty"` //玩法按钮图片 + BorderImg string `protobuf:"bytes,9,opt,name=border_img,json=borderImg,proto3" json:"border_img,omitempty"` //边框图片 + ButtonColor string `protobuf:"bytes,10,opt,name=button_color,json=buttonColor,proto3" json:"button_color,omitempty"` //按钮颜色 + WheelTextColor string `protobuf:"bytes,11,opt,name=wheel_text_color,json=wheelTextColor,proto3" json:"wheel_text_color,omitempty"` //转盘文字颜色 +} + +func (x *ShowRes_WheelStyle) Reset() { + *x = ShowRes_WheelStyle{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[239] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_WheelStyle) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_WheelStyle) ProtoMessage() {} + +func (x *ShowRes_WheelStyle) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[239] + 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 ShowRes_WheelStyle.ProtoReflect.Descriptor instead. +func (*ShowRes_WheelStyle) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 16} +} + +func (x *ShowRes_WheelStyle) GetTopicMark() string { + if x != nil { + return x.TopicMark + } + return "" +} + +func (x *ShowRes_WheelStyle) GetMainImg() string { + if x != nil { + return x.MainImg + } + return "" +} + +func (x *ShowRes_WheelStyle) GetBgColor() string { + if x != nil { + return x.BgColor + } + return "" +} + +func (x *ShowRes_WheelStyle) GetBottom1() string { + if x != nil { + return x.Bottom1 + } + return "" +} + +func (x *ShowRes_WheelStyle) GetBottom2() string { + if x != nil { + return x.Bottom2 + } + return "" +} + +func (x *ShowRes_WheelStyle) GetBottom3() string { + if x != nil { + return x.Bottom3 + } + return "" +} + +func (x *ShowRes_WheelStyle) GetPointer() string { + if x != nil { + return x.Pointer + } + return "" +} + +func (x *ShowRes_WheelStyle) GetPlayBtn() string { + if x != nil { + return x.PlayBtn + } + return "" +} + +func (x *ShowRes_WheelStyle) GetBorderImg() string { + if x != nil { + return x.BorderImg + } + return "" +} + +func (x *ShowRes_WheelStyle) GetButtonColor() string { + if x != nil { + return x.ButtonColor + } + return "" +} + +func (x *ShowRes_WheelStyle) GetWheelTextColor() string { + if x != nil { + return x.WheelTextColor + } + return "" +} + +type ShowRes_Child struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + ChildType int32 `protobuf:"varint,2,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 +} + +func (x *ShowRes_Child) Reset() { + *x = ShowRes_Child{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[240] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Child) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Child) ProtoMessage() {} + +func (x *ShowRes_Child) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[240] + 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 ShowRes_Child.ProtoReflect.Descriptor instead. +func (*ShowRes_Child) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 17} +} + +func (x *ShowRes_Child) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ShowRes_Child) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +type ShowRes_Share struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //标题 + Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` //图标 + Scheme string `protobuf:"bytes,4,opt,name=scheme,proto3" json:"scheme,omitempty"` //Scheme + IosScheme string `protobuf:"bytes,5,opt,name=ios_scheme,json=iosScheme,proto3" json:"ios_scheme,omitempty"` //ios Scheme +} + +func (x *ShowRes_Share) Reset() { + *x = ShowRes_Share{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[241] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Share) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Share) ProtoMessage() {} + +func (x *ShowRes_Share) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[241] + 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 ShowRes_Share.ProtoReflect.Descriptor instead. +func (*ShowRes_Share) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 18} +} + +func (x *ShowRes_Share) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_Share) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_Share) GetLogo() string { + if x != nil { + return x.Logo + } + return "" +} + +func (x *ShowRes_Share) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + +func (x *ShowRes_Share) GetIosScheme() string { + if x != nil { + return x.IosScheme + } + return "" +} + +type ShowRes_Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RuleTextColor string `protobuf:"bytes,1,opt,name=rule_text_color,json=ruleTextColor,proto3" json:"rule_text_color,omitempty"` //规则文字颜色 + RuleBgColor string `protobuf:"bytes,2,opt,name=rule_bg_color,json=ruleBgColor,proto3" json:"rule_bg_color,omitempty"` //规则背景颜色 + ShareText string `protobuf:"bytes,3,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,4,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + HasRank int32 `protobuf:"varint,5,opt,name=has_rank,json=hasRank,proto3" json:"has_rank,omitempty"` //是否展示中奖纪录(1-是,0-否) + RankBackgroundColor string `protobuf:"bytes,6,opt,name=rank_background_color,json=rankBackgroundColor,proto3" json:"rank_background_color,omitempty"` //排行榜背景颜色 + RankTextColor string `protobuf:"bytes,7,opt,name=rank_text_color,json=rankTextColor,proto3" json:"rank_text_color,omitempty"` //排行榜背景颜色 + DownloadPageImage string `protobuf:"bytes,8,opt,name=download_page_image,json=downloadPageImage,proto3" json:"download_page_image,omitempty"` //下载引导页的图片 + IsDefaultDownload int32 `protobuf:"varint,9,opt,name=is_default_download,json=isDefaultDownload,proto3" json:"is_default_download,omitempty"` //是否使用默认下载图(1-是,0-否) + WechatPageImage string `protobuf:"bytes,10,opt,name=wechat_page_image,json=wechatPageImage,proto3" json:"wechat_page_image,omitempty"` //微信引导页的图片 + IsDefaultWechat int32 `protobuf:"varint,11,opt,name=is_default_wechat,json=isDefaultWechat,proto3" json:"is_default_wechat,omitempty"` //是否使用默认微信引导图(1-是,0-否) + ImageMain string `protobuf:"bytes,12,opt,name=image_main,json=imageMain,proto3" json:"image_main,omitempty"` //活动主图 + IsDefaultMain int32 `protobuf:"varint,13,opt,name=is_default_main,json=isDefaultMain,proto3" json:"is_default_main,omitempty"` //是否使用默认活动主图(1-是,0-否) + ImagePreview string `protobuf:"bytes,14,opt,name=image_preview,json=imagePreview,proto3" json:"image_preview,omitempty"` //问题页背景图 + LinkBtnTextColor string `protobuf:"bytes,15,opt,name=link_btn_text_color,json=linkBtnTextColor,proto3" json:"link_btn_text_color,omitempty"` //分享链接按钮文字颜色 + LinkBtnBgColor string `protobuf:"bytes,16,opt,name=link_btn_bg_color,json=linkBtnBgColor,proto3" json:"link_btn_bg_color,omitempty"` //分享链接按钮背景颜色 + LinkTextColor string `protobuf:"bytes,17,opt,name=link_text_color,json=linkTextColor,proto3" json:"link_text_color,omitempty"` //分享链接文字颜色 + ShowShare int32 `protobuf:"varint,18,opt,name=show_share,json=showShare,proto3" json:"show_share,omitempty"` //是否显示分享社交媒体(0-否,1-是) + Share []int64 `protobuf:"varint,19,rep,packed,name=share,proto3" json:"share,omitempty"` //要分享的社交媒体,例如[1,2,3] + PlayRule string `protobuf:"bytes,20,opt,name=play_rule,json=playRule,proto3" json:"play_rule,omitempty"` //玩法规则 + PageTitle string `protobuf:"bytes,21,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + DmShow int32 `protobuf:"varint,22,opt,name=dm_show,json=dmShow,proto3" json:"dm_show,omitempty"` //是否显示弹幕(0-否,1-是) + WebBgImg string `protobuf:"bytes,23,opt,name=web_bg_img,json=webBgImg,proto3" json:"web_bg_img,omitempty"` //站外活动背景图 + HasWeb int32 `protobuf:"varint,24,opt,name=has_web,json=hasWeb,proto3" json:"has_web,omitempty"` //是否有站外活动(0-否,1-是) + HasWarmUp int32 `protobuf:"varint,25,opt,name=has_warm_up,json=hasWarmUp,proto3" json:"has_warm_up,omitempty"` //是否预热(0-否,1-是) + WarmUpImg string `protobuf:"bytes,26,opt,name=warm_up_img,json=warmUpImg,proto3" json:"warm_up_img,omitempty"` //预热海报图 + WarmUpEnd int32 `protobuf:"varint,27,opt,name=warm_up_end,json=warmUpEnd,proto3" json:"warm_up_end,omitempty"` //活动开始前多少分钟结束预热 + IconType int32 `protobuf:"varint,28,opt,name=icon_type,json=iconType,proto3" json:"icon_type,omitempty"` //活动挂件类型(用于前端挂件选用判断) + IconBgColor string `protobuf:"bytes,29,opt,name=icon_bg_color,json=iconBgColor,proto3" json:"icon_bg_color,omitempty"` //活动挂件背景色 + DlType int32 `protobuf:"varint,30,opt,name=dl_type,json=dlType,proto3" json:"dl_type,omitempty"` //下载引导页类型(1-通用,2-自定义多媒体) + DlBannerType int32 `protobuf:"varint,31,opt,name=dl_banner_type,json=dlBannerType,proto3" json:"dl_banner_type,omitempty"` //下载页横幅类型(1-默认,2-自定义) + DlBannerImg string `protobuf:"bytes,32,opt,name=dl_banner_img,json=dlBannerImg,proto3" json:"dl_banner_img,omitempty"` //下载页横幅自定义图 + DlBannerAppLogo string `protobuf:"bytes,33,opt,name=dl_banner_app_logo,json=dlBannerAppLogo,proto3" json:"dl_banner_app_logo,omitempty"` //下载页横幅applogo图片 + DlBannerAppName string `protobuf:"bytes,34,opt,name=dl_banner_app_name,json=dlBannerAppName,proto3" json:"dl_banner_app_name,omitempty"` //下载页横幅app名称 + DlBannerAppBtn string `protobuf:"bytes,35,opt,name=dl_banner_app_btn,json=dlBannerAppBtn,proto3" json:"dl_banner_app_btn,omitempty"` //下载页横幅app按钮文案 + DlBannerPosition int32 `protobuf:"varint,36,opt,name=dl_banner_position,json=dlBannerPosition,proto3" json:"dl_banner_position,omitempty"` //下载页横幅位置(1-顶部,2-底部) + TopicColor string `protobuf:"bytes,37,opt,name=topic_color,json=topicColor,proto3" json:"topic_color,omitempty"` //主题色 + WindowCover int32 `protobuf:"varint,38,opt,name=window_cover,json=windowCover,proto3" json:"window_cover,omitempty"` //是否全屏展示(0-否,1-是) + OpenAd int32 `protobuf:"varint,39,opt,name=open_ad,json=openAd,proto3" json:"open_ad,omitempty"` //是否开启广告(0-否,1-是) + CloseCopyShare int32 `protobuf:"varint,40,opt,name=close_copy_share,json=closeCopyShare,proto3" json:"close_copy_share,omitempty"` //关闭复制分享文案(0-否,1-是) + IconOpen []int32 `protobuf:"varint,41,rep,packed,name=icon_open,json=iconOpen,proto3" json:"icon_open,omitempty"` //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3] + HasWhite int32 `protobuf:"varint,42,opt,name=has_white,json=hasWhite,proto3" json:"has_white,omitempty"` //是否开启白名单(0-否,1-是) + WhiteList string `protobuf:"bytes,43,opt,name=white_list,json=whiteList,proto3" json:"white_list,omitempty"` //白名单列表(多个用英文;分割) + PcBg string `protobuf:"bytes,44,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc适配背景图 + AdsType int32 `protobuf:"varint,45,opt,name=ads_type,json=adsType,proto3" json:"ads_type,omitempty"` //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + LinkTempId string `protobuf:"bytes,46,opt,name=link_temp_id,json=linkTempId,proto3" json:"link_temp_id,omitempty"` //链接模板id + RuleTimeOpen int32 `protobuf:"varint,47,opt,name=rule_time_open,json=ruleTimeOpen,proto3" json:"rule_time_open,omitempty"` //是否展示规则中的活动时间(0-否,1-是) + OutsideTask int32 `protobuf:"varint,48,opt,name=outside_task,json=outsideTask,proto3" json:"outside_task,omitempty"` //是否外显任务(0-否,1-是) + IconTextColor string `protobuf:"bytes,49,opt,name=icon_text_color,json=iconTextColor,proto3" json:"icon_text_color,omitempty"` //活动挂件字体色 + OpenShare int32 `protobuf:"varint,50,opt,name=open_share,json=openShare,proto3" json:"open_share,omitempty"` //是否启用分享模块(0-否,1-是) + ShowToUse int32 `protobuf:"varint,51,opt,name=show_to_use,json=showToUse,proto3" json:"show_to_use,omitempty"` //是否展示奖品弹窗的去使用(0-不展示,1-展示) + RuleType int32 `protobuf:"varint,52,opt,name=rule_type,json=ruleType,proto3" json:"rule_type,omitempty"` //规则展示类型(0-文本,1-图片) + RuleImg string `protobuf:"bytes,53,opt,name=rule_img,json=ruleImg,proto3" json:"rule_img,omitempty"` //规则展示图 + RuleOutside int32 `protobuf:"varint,54,opt,name=rule_outside,json=ruleOutside,proto3" json:"rule_outside,omitempty"` //规则是否外显(0-否,1-是) + DeviceOnce int32 `protobuf:"varint,55,opt,name=device_once,json=deviceOnce,proto3" json:"device_once,omitempty"` //设备唯一(0-否,1-是) +} + +func (x *ShowRes_Config) Reset() { + *x = ShowRes_Config{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[242] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Config) ProtoMessage() {} + +func (x *ShowRes_Config) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[242] + 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 ShowRes_Config.ProtoReflect.Descriptor instead. +func (*ShowRes_Config) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 19} +} + +func (x *ShowRes_Config) GetRuleTextColor() string { + if x != nil { + return x.RuleTextColor + } + return "" +} + +func (x *ShowRes_Config) GetRuleBgColor() string { + if x != nil { + return x.RuleBgColor + } + return "" +} + +func (x *ShowRes_Config) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *ShowRes_Config) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *ShowRes_Config) GetHasRank() int32 { + if x != nil { + return x.HasRank + } + return 0 +} + +func (x *ShowRes_Config) GetRankBackgroundColor() string { + if x != nil { + return x.RankBackgroundColor + } + return "" +} + +func (x *ShowRes_Config) GetRankTextColor() string { + if x != nil { + return x.RankTextColor + } + return "" +} + +func (x *ShowRes_Config) GetDownloadPageImage() string { + if x != nil { + return x.DownloadPageImage + } + return "" +} + +func (x *ShowRes_Config) GetIsDefaultDownload() int32 { + if x != nil { + return x.IsDefaultDownload + } + return 0 +} + +func (x *ShowRes_Config) GetWechatPageImage() string { + if x != nil { + return x.WechatPageImage + } + return "" +} + +func (x *ShowRes_Config) GetIsDefaultWechat() int32 { + if x != nil { + return x.IsDefaultWechat + } + return 0 +} + +func (x *ShowRes_Config) GetImageMain() string { + if x != nil { + return x.ImageMain + } + return "" +} + +func (x *ShowRes_Config) GetIsDefaultMain() int32 { + if x != nil { + return x.IsDefaultMain + } + return 0 +} + +func (x *ShowRes_Config) GetImagePreview() string { + if x != nil { + return x.ImagePreview + } + return "" +} + +func (x *ShowRes_Config) GetLinkBtnTextColor() string { + if x != nil { + return x.LinkBtnTextColor + } + return "" +} + +func (x *ShowRes_Config) GetLinkBtnBgColor() string { + if x != nil { + return x.LinkBtnBgColor + } + return "" +} + +func (x *ShowRes_Config) GetLinkTextColor() string { + if x != nil { + return x.LinkTextColor + } + return "" +} + +func (x *ShowRes_Config) GetShowShare() int32 { + if x != nil { + return x.ShowShare + } + return 0 +} + +func (x *ShowRes_Config) GetShare() []int64 { + if x != nil { + return x.Share + } + return nil +} + +func (x *ShowRes_Config) GetPlayRule() string { + if x != nil { + return x.PlayRule + } + return "" +} + +func (x *ShowRes_Config) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *ShowRes_Config) GetDmShow() int32 { + if x != nil { + return x.DmShow + } + return 0 +} + +func (x *ShowRes_Config) GetWebBgImg() string { + if x != nil { + return x.WebBgImg + } + return "" +} + +func (x *ShowRes_Config) GetHasWeb() int32 { + if x != nil { + return x.HasWeb + } + return 0 +} + +func (x *ShowRes_Config) GetHasWarmUp() int32 { + if x != nil { + return x.HasWarmUp + } + return 0 +} + +func (x *ShowRes_Config) GetWarmUpImg() string { + if x != nil { + return x.WarmUpImg + } + return "" +} + +func (x *ShowRes_Config) GetWarmUpEnd() int32 { + if x != nil { + return x.WarmUpEnd + } + return 0 +} + +func (x *ShowRes_Config) GetIconType() int32 { + if x != nil { + return x.IconType + } + return 0 +} + +func (x *ShowRes_Config) GetIconBgColor() string { + if x != nil { + return x.IconBgColor + } + return "" +} + +func (x *ShowRes_Config) GetDlType() int32 { + if x != nil { + return x.DlType + } + return 0 +} + +func (x *ShowRes_Config) GetDlBannerType() int32 { + if x != nil { + return x.DlBannerType + } + return 0 +} + +func (x *ShowRes_Config) GetDlBannerImg() string { + if x != nil { + return x.DlBannerImg + } + return "" +} + +func (x *ShowRes_Config) GetDlBannerAppLogo() string { + if x != nil { + return x.DlBannerAppLogo + } + return "" +} + +func (x *ShowRes_Config) GetDlBannerAppName() string { + if x != nil { + return x.DlBannerAppName + } + return "" +} + +func (x *ShowRes_Config) GetDlBannerAppBtn() string { + if x != nil { + return x.DlBannerAppBtn + } + return "" +} + +func (x *ShowRes_Config) GetDlBannerPosition() int32 { + if x != nil { + return x.DlBannerPosition + } + return 0 +} + +func (x *ShowRes_Config) GetTopicColor() string { + if x != nil { + return x.TopicColor + } + return "" +} + +func (x *ShowRes_Config) GetWindowCover() int32 { + if x != nil { + return x.WindowCover + } + return 0 +} + +func (x *ShowRes_Config) GetOpenAd() int32 { + if x != nil { + return x.OpenAd + } + return 0 +} + +func (x *ShowRes_Config) GetCloseCopyShare() int32 { + if x != nil { + return x.CloseCopyShare + } + return 0 +} + +func (x *ShowRes_Config) GetIconOpen() []int32 { + if x != nil { + return x.IconOpen + } + return nil +} + +func (x *ShowRes_Config) GetHasWhite() int32 { + if x != nil { + return x.HasWhite + } + return 0 +} + +func (x *ShowRes_Config) GetWhiteList() string { + if x != nil { + return x.WhiteList + } + return "" +} + +func (x *ShowRes_Config) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *ShowRes_Config) GetAdsType() int32 { + if x != nil { + return x.AdsType + } + return 0 +} + +func (x *ShowRes_Config) GetLinkTempId() string { + if x != nil { + return x.LinkTempId + } + return "" +} + +func (x *ShowRes_Config) GetRuleTimeOpen() int32 { + if x != nil { + return x.RuleTimeOpen + } + return 0 +} + +func (x *ShowRes_Config) GetOutsideTask() int32 { + if x != nil { + return x.OutsideTask + } + return 0 +} + +func (x *ShowRes_Config) GetIconTextColor() string { + if x != nil { + return x.IconTextColor + } + return "" +} + +func (x *ShowRes_Config) GetOpenShare() int32 { + if x != nil { + return x.OpenShare + } + return 0 +} + +func (x *ShowRes_Config) GetShowToUse() int32 { + if x != nil { + return x.ShowToUse + } + return 0 +} + +func (x *ShowRes_Config) GetRuleType() int32 { + if x != nil { + return x.RuleType + } + return 0 +} + +func (x *ShowRes_Config) GetRuleImg() string { + if x != nil { + return x.RuleImg + } + return "" +} + +func (x *ShowRes_Config) GetRuleOutside() int32 { + if x != nil { + return x.RuleOutside + } + return 0 +} + +func (x *ShowRes_Config) GetDeviceOnce() int32 { + if x != nil { + return x.DeviceOnce + } + return 0 +} + +type ShowRes_LongImg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImgUrl string `protobuf:"bytes,1,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //长图id + ClickType int32 `protobuf:"varint,5,opt,name=click_type,json=clickType,proto3" json:"click_type,omitempty"` //点击类型(1-整图点击,2-区域点击) + HotZone []*ShowRes_HotZone `protobuf:"bytes,6,rep,name=hot_zone,json=hotZone,proto3" json:"hot_zone,omitempty"` //点击区域 + TargetType int32 `protobuf:"varint,7,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,8,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + TargetUrl string `protobuf:"bytes,9,opt,name=target_url,json=targetUrl,proto3" json:"target_url,omitempty"` //目标地址 + PcParam string `protobuf:"bytes,10,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *ShowRes_LongImg) Reset() { + *x = ShowRes_LongImg{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[243] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_LongImg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_LongImg) ProtoMessage() {} + +func (x *ShowRes_LongImg) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[243] + 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 ShowRes_LongImg.ProtoReflect.Descriptor instead. +func (*ShowRes_LongImg) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 20} +} + +func (x *ShowRes_LongImg) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_LongImg) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ShowRes_LongImg) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ShowRes_LongImg) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_LongImg) GetClickType() int32 { + if x != nil { + return x.ClickType + } + return 0 +} + +func (x *ShowRes_LongImg) GetHotZone() []*ShowRes_HotZone { + if x != nil { + return x.HotZone + } + return nil +} + +func (x *ShowRes_LongImg) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *ShowRes_LongImg) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *ShowRes_LongImg) GetTargetUrl() string { + if x != nil { + return x.TargetUrl + } + return "" +} + +func (x *ShowRes_LongImg) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type ShowRes_HotZone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //热区id + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickX float64 `protobuf:"fixed64,4,opt,name=click_x,json=clickX,proto3" json:"click_x,omitempty"` //点击区域x + ClickY float64 `protobuf:"fixed64,5,opt,name=click_y,json=clickY,proto3" json:"click_y,omitempty"` //点击区域y + ClickW float64 `protobuf:"fixed64,6,opt,name=click_w,json=clickW,proto3" json:"click_w,omitempty"` //点击区域w + ClickH float64 `protobuf:"fixed64,7,opt,name=click_h,json=clickH,proto3" json:"click_h,omitempty"` //点击区域h + TargetType int32 `protobuf:"varint,8,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,9,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + TargetUrl string `protobuf:"bytes,10,opt,name=target_url,json=targetUrl,proto3" json:"target_url,omitempty"` //目标地址 + PcParam string `protobuf:"bytes,11,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *ShowRes_HotZone) Reset() { + *x = ShowRes_HotZone{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[244] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_HotZone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_HotZone) ProtoMessage() {} + +func (x *ShowRes_HotZone) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[244] + 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 ShowRes_HotZone.ProtoReflect.Descriptor instead. +func (*ShowRes_HotZone) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 21} +} + +func (x *ShowRes_HotZone) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_HotZone) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ShowRes_HotZone) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ShowRes_HotZone) GetClickX() float64 { + if x != nil { + return x.ClickX + } + return 0 +} + +func (x *ShowRes_HotZone) GetClickY() float64 { + if x != nil { + return x.ClickY + } + return 0 +} + +func (x *ShowRes_HotZone) GetClickW() float64 { + if x != nil { + return x.ClickW + } + return 0 +} + +func (x *ShowRes_HotZone) GetClickH() float64 { + if x != nil { + return x.ClickH + } + return 0 +} + +func (x *ShowRes_HotZone) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *ShowRes_HotZone) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *ShowRes_HotZone) GetTargetUrl() string { + if x != nil { + return x.TargetUrl + } + return "" +} + +func (x *ShowRes_HotZone) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type ShowRes_Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target int32 `protobuf:"varint,1,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Option int32 `protobuf:"varint,2,opt,name=option,proto3" json:"option,omitempty"` //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + AppEvent int32 `protobuf:"varint,3,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //目标选择类型为1(option=1)的选项(1-安装;2-注册) + BothType int32 `protobuf:"varint,4,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Cond []*ShowRes_Cond `protobuf:"bytes,5,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *ShowRes_BothAll `protobuf:"bytes,6,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 + NormalData *ShowRes_NormalData `protobuf:"bytes,7,opt,name=normal_data,json=normalData,proto3" json:"normal_data,omitempty"` //通用事件的数据 +} + +func (x *ShowRes_Target) Reset() { + *x = ShowRes_Target{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[245] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Target) ProtoMessage() {} + +func (x *ShowRes_Target) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[245] + 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 ShowRes_Target.ProtoReflect.Descriptor instead. +func (*ShowRes_Target) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 22} +} + +func (x *ShowRes_Target) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *ShowRes_Target) GetOption() int32 { + if x != nil { + return x.Option + } + return 0 +} + +func (x *ShowRes_Target) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *ShowRes_Target) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *ShowRes_Target) GetCond() []*ShowRes_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *ShowRes_Target) GetBothAll() *ShowRes_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +func (x *ShowRes_Target) GetNormalData() *ShowRes_NormalData { + if x != nil { + return x.NormalData + } + return nil +} + +type ShowRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //条件id + Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,3,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,4,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + IfCond int32 `protobuf:"varint,6,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TaskLimit int32 `protobuf:"varint,7,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,8,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + TriggerType int32 `protobuf:"varint,9,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + DayLimit int32 `protobuf:"varint,10,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,11,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + EventType int32 `protobuf:"varint,12,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,13,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + LangMarks []string `protobuf:"bytes,14,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WatchSec int32 `protobuf:"varint,15,opt,name=watch_sec,json=watchSec,proto3" json:"watch_sec,omitempty"` //观看秒数 + WeekLimit int32 `protobuf:"varint,16,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,17,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + OpenJump int32 `protobuf:"varint,18,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,19,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,20,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + GoShow int32 `protobuf:"varint,21,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,22,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + AdsStrategyTitle string `protobuf:"bytes,23,opt,name=ads_strategy_title,json=adsStrategyTitle,proto3" json:"ads_strategy_title,omitempty"` //策略标题 + IsSuper int32 `protobuf:"varint,24,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,25,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置条件(0-否,1-是) + PreCond int32 `protobuf:"varint,26,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + ExpiredMin int32 `protobuf:"varint,27,opt,name=expired_min,json=expiredMin,proto3" json:"expired_min,omitempty"` //过期分钟数 + Reward *ShowRes_Reward `protobuf:"bytes,28,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,29,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Sort int32 `protobuf:"varint,30,opt,name=sort,proto3" json:"sort,omitempty"` //排序 + OpenPush int32 `protobuf:"varint,31,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //是否开启完成推送(0-否,1-是) + PcParam string `protobuf:"bytes,32,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 + AwardMode int32 `protobuf:"varint,33,opt,name=award_mode,json=awardMode,proto3" json:"award_mode,omitempty"` //领奖模式(1-自动领奖,2-手动领奖) + GoText string `protobuf:"bytes,34,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 + ClickEffectOpen int32 `protobuf:"varint,35,opt,name=click_effect_open,json=clickEffectOpen,proto3" json:"click_effect_open,omitempty"` //是否开启点击有效(0-否,1-是) + ClickEffect int32 `protobuf:"varint,36,opt,name=click_effect,json=clickEffect,proto3" json:"click_effect,omitempty"` //点击有效值 + ClickEffectUnit string `protobuf:"bytes,37,opt,name=click_effect_unit,json=clickEffectUnit,proto3" json:"click_effect_unit,omitempty"` //点击有效单位(min-分钟,hour-小时,day-天) + ExpiredDay string `protobuf:"bytes,38,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + PullInvite int32 `protobuf:"varint,39,opt,name=pull_invite,json=pullInvite,proto3" json:"pull_invite,omitempty"` //是否拉起邀请(0-否,1-是) +} + +func (x *ShowRes_Cond) Reset() { + *x = ShowRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[246] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Cond) ProtoMessage() {} + +func (x *ShowRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[246] + 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 ShowRes_Cond.ProtoReflect.Descriptor instead. +func (*ShowRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 23} +} + +func (x *ShowRes_Cond) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *ShowRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *ShowRes_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *ShowRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ShowRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *ShowRes_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *ShowRes_Cond) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *ShowRes_Cond) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *ShowRes_Cond) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *ShowRes_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *ShowRes_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *ShowRes_Cond) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ShowRes_Cond) GetWatchSec() int32 { + if x != nil { + return x.WatchSec + } + return 0 +} + +func (x *ShowRes_Cond) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *ShowRes_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *ShowRes_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *ShowRes_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ShowRes_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *ShowRes_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *ShowRes_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *ShowRes_Cond) GetAdsStrategyTitle() string { + if x != nil { + return x.AdsStrategyTitle + } + return "" +} + +func (x *ShowRes_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ShowRes_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *ShowRes_Cond) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +func (x *ShowRes_Cond) GetExpiredMin() int32 { + if x != nil { + return x.ExpiredMin + } + return 0 +} + +func (x *ShowRes_Cond) GetReward() *ShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ShowRes_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ShowRes_Cond) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *ShowRes_Cond) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +func (x *ShowRes_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ShowRes_Cond) GetAwardMode() int32 { + if x != nil { + return x.AwardMode + } + return 0 +} + +func (x *ShowRes_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +func (x *ShowRes_Cond) GetClickEffectOpen() int32 { + if x != nil { + return x.ClickEffectOpen + } + return 0 +} + +func (x *ShowRes_Cond) GetClickEffect() int32 { + if x != nil { + return x.ClickEffect + } + return 0 +} + +func (x *ShowRes_Cond) GetClickEffectUnit() string { + if x != nil { + return x.ClickEffectUnit + } + return "" +} + +func (x *ShowRes_Cond) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *ShowRes_Cond) GetPullInvite() int32 { + if x != nil { + return x.PullInvite + } + return 0 +} + +type ShowRes_BothAll struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskLimit int32 `protobuf:"varint,1,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + DayLimit int32 `protobuf:"varint,3,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,4,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + LangMarks []string `protobuf:"bytes,5,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WeekLimit int32 `protobuf:"varint,6,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,7,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + Reward *ShowRes_Reward `protobuf:"bytes,8,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,9,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + ExpiredDay string `protobuf:"bytes,10,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 +} + +func (x *ShowRes_BothAll) Reset() { + *x = ShowRes_BothAll{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[247] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_BothAll) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_BothAll) ProtoMessage() {} + +func (x *ShowRes_BothAll) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[247] + 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 ShowRes_BothAll.ProtoReflect.Descriptor instead. +func (*ShowRes_BothAll) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 24} +} + +func (x *ShowRes_BothAll) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *ShowRes_BothAll) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_BothAll) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *ShowRes_BothAll) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *ShowRes_BothAll) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ShowRes_BothAll) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *ShowRes_BothAll) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *ShowRes_BothAll) GetReward() *ShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ShowRes_BothAll) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ShowRes_BothAll) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +type ShowRes_NormalData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,3,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) +} + +func (x *ShowRes_NormalData) Reset() { + *x = ShowRes_NormalData{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[248] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_NormalData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_NormalData) ProtoMessage() {} + +func (x *ShowRes_NormalData) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[248] + 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 ShowRes_NormalData.ProtoReflect.Descriptor instead. +func (*ShowRes_NormalData) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 25} +} + +func (x *ShowRes_NormalData) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *ShowRes_NormalData) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_NormalData) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +type ShowRes_TargetOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target int32 `protobuf:"varint,1,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Fixed *ShowRes_Fixed `protobuf:"bytes,2,opt,name=fixed,proto3" json:"fixed,omitempty"` //固定事件 + Custom *ShowRes_Custom `protobuf:"bytes,3,opt,name=custom,proto3" json:"custom,omitempty"` //自定义事件 + Option int32 `protobuf:"varint,4,opt,name=option,proto3" json:"option,omitempty"` //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) +} + +func (x *ShowRes_TargetOption) Reset() { + *x = ShowRes_TargetOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[249] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_TargetOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_TargetOption) ProtoMessage() {} + +func (x *ShowRes_TargetOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[249] + 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 ShowRes_TargetOption.ProtoReflect.Descriptor instead. +func (*ShowRes_TargetOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 26} +} + +func (x *ShowRes_TargetOption) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *ShowRes_TargetOption) GetFixed() *ShowRes_Fixed { + if x != nil { + return x.Fixed + } + return nil +} + +func (x *ShowRes_TargetOption) GetCustom() *ShowRes_Custom { + if x != nil { + return x.Custom + } + return nil +} + +func (x *ShowRes_TargetOption) GetOption() int32 { + if x != nil { + return x.Option + } + return 0 +} + +type ShowRes_Fixed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + AppEvent int32 `protobuf:"varint,2,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //固定事件类型(1-安装;2-注册) + TargetNum int32 `protobuf:"varint,3,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,5,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) + Percent float64 `protobuf:"fixed64,6,opt,name=percent,proto3" json:"percent,omitempty"` //百分比值(如:获得的能量点) +} + +func (x *ShowRes_Fixed) Reset() { + *x = ShowRes_Fixed{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[250] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Fixed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Fixed) ProtoMessage() {} + +func (x *ShowRes_Fixed) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[250] + 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 ShowRes_Fixed.ProtoReflect.Descriptor instead. +func (*ShowRes_Fixed) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 27} +} + +func (x *ShowRes_Fixed) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_Fixed) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *ShowRes_Fixed) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *ShowRes_Fixed) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_Fixed) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +func (x *ShowRes_Fixed) GetPercent() float64 { + if x != nil { + return x.Percent + } + return 0 +} + +type ShowRes_Custom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + BothType int32 `protobuf:"varint,2,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Cond []*ShowRes_Cond `protobuf:"bytes,3,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *ShowRes_BothAll `protobuf:"bytes,4,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 + PreEvent int32 `protobuf:"varint,5,opt,name=pre_event,json=preEvent,proto3" json:"pre_event,omitempty"` //自定义事件前置事件(0-任意事件;1-安装;2-注册) +} + +func (x *ShowRes_Custom) Reset() { + *x = ShowRes_Custom{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[251] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Custom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Custom) ProtoMessage() {} + +func (x *ShowRes_Custom) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[251] + 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 ShowRes_Custom.ProtoReflect.Descriptor instead. +func (*ShowRes_Custom) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 28} +} + +func (x *ShowRes_Custom) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_Custom) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *ShowRes_Custom) GetCond() []*ShowRes_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *ShowRes_Custom) GetBothAll() *ShowRes_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +func (x *ShowRes_Custom) GetPreEvent() int32 { + if x != nil { + return x.PreEvent + } + return 0 +} + +type ShowRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *ShowRes_KV) Reset() { + *x = ShowRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[252] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_KV) ProtoMessage() {} + +func (x *ShowRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[252] + 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 ShowRes_KV.ProtoReflect.Descriptor instead. +func (*ShowRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 29} +} + +func (x *ShowRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ShowRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type ShowRes_WebReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片(相对路径) + KvData []*ShowRes_KV `protobuf:"bytes,4,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 +} + +func (x *ShowRes_WebReward) Reset() { + *x = ShowRes_WebReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[253] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_WebReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_WebReward) ProtoMessage() {} + +func (x *ShowRes_WebReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[253] + 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 ShowRes_WebReward.ProtoReflect.Descriptor instead. +func (*ShowRes_WebReward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 30} +} + +func (x *ShowRes_WebReward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_WebReward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_WebReward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_WebReward) GetKvData() []*ShowRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +type ShowRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Stock int32 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,6,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,7,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,8,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,9,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,10,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + KvData []*ShowRes_KV `protobuf:"bytes,11,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + Title string `protobuf:"bytes,12,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,13,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + ReceiveType int32 `protobuf:"varint,14,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-提交表单) + Contact string `protobuf:"bytes,15,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + Url string `protobuf:"bytes,16,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + Help int32 `protobuf:"varint,17,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,18,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,19,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,20,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,21,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,22,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,23,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,24,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + LangMark string `protobuf:"bytes,25,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //奖品语言标识 + Odds int32 `protobuf:"varint,26,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + JumpUrl string `protobuf:"bytes,27,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + FormTitle string `protobuf:"bytes,28,opt,name=form_title,json=formTitle,proto3" json:"form_title,omitempty"` //表单标题 + CampaignLimit int32 `protobuf:"varint,29,opt,name=campaign_limit,json=campaignLimit,proto3" json:"campaign_limit,omitempty"` //活动内单个用户可获取该奖品次数 + Register int32 `protobuf:"varint,30,opt,name=register,proto3" json:"register,omitempty"` //开启注册助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,31,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个注册获得的进度比率 + InitPercent float64 `protobuf:"fixed64,32,opt,name=init_percent,json=initPercent,proto3" json:"init_percent,omitempty"` //初始助力进度 + CollectRule *ShowRes_CollectRule `protobuf:"bytes,33,opt,name=collect_rule,json=collectRule,proto3" json:"collect_rule,omitempty"` //收集规则 + ExpiredDay string `protobuf:"bytes,34,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //过期天数 + OpenAdd *ShowRes_OpenAdd `protobuf:"bytes,35,opt,name=open_add,json=openAdd,proto3" json:"open_add,omitempty"` //库存增加规则 + RewardTask *ShowRes_RewardTask `protobuf:"bytes,36,opt,name=reward_task,json=rewardTask,proto3" json:"reward_task,omitempty"` //解锁任务 +} + +func (x *ShowRes_Reward) Reset() { + *x = ShowRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[254] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Reward) ProtoMessage() {} + +func (x *ShowRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[254] + 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 ShowRes_Reward.ProtoReflect.Descriptor instead. +func (*ShowRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 31} +} + +func (x *ShowRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ShowRes_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ShowRes_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ShowRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ShowRes_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *ShowRes_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ShowRes_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ShowRes_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *ShowRes_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ShowRes_Reward) GetKvData() []*ShowRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ShowRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ShowRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ShowRes_Reward) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ShowRes_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *ShowRes_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *ShowRes_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *ShowRes_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *ShowRes_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *ShowRes_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *ShowRes_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *ShowRes_Reward) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ShowRes_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *ShowRes_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *ShowRes_Reward) GetFormTitle() string { + if x != nil { + return x.FormTitle + } + return "" +} + +func (x *ShowRes_Reward) GetCampaignLimit() int32 { + if x != nil { + return x.CampaignLimit + } + return 0 +} + +func (x *ShowRes_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *ShowRes_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +func (x *ShowRes_Reward) GetInitPercent() float64 { + if x != nil { + return x.InitPercent + } + return 0 +} + +func (x *ShowRes_Reward) GetCollectRule() *ShowRes_CollectRule { + if x != nil { + return x.CollectRule + } + return nil +} + +func (x *ShowRes_Reward) GetExpiredDay() string { + if x != nil { + return x.ExpiredDay + } + return "" +} + +func (x *ShowRes_Reward) GetOpenAdd() *ShowRes_OpenAdd { + if x != nil { + return x.OpenAdd + } + return nil +} + +func (x *ShowRes_Reward) GetRewardTask() *ShowRes_RewardTask { + if x != nil { + return x.RewardTask + } + return nil +} + +type ShowRes_RewardTask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,3,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,4,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TriggerType int32 `protobuf:"varint,6,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + EventType int32 `protobuf:"varint,7,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + OpenPush int32 `protobuf:"varint,8,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //是否开启完成推送(0-否,1-是) +} + +func (x *ShowRes_RewardTask) Reset() { + *x = ShowRes_RewardTask{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[255] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_RewardTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_RewardTask) ProtoMessage() {} + +func (x *ShowRes_RewardTask) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[255] + 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 ShowRes_RewardTask.ProtoReflect.Descriptor instead. +func (*ShowRes_RewardTask) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 32} +} + +func (x *ShowRes_RewardTask) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_RewardTask) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *ShowRes_RewardTask) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *ShowRes_RewardTask) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *ShowRes_RewardTask) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *ShowRes_RewardTask) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *ShowRes_RewardTask) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *ShowRes_RewardTask) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +type ShowRes_OpenAdd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启动态库存规则(0-否,1-是) + Start int64 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` //开始时间 + End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"` //结束时间 + DayNum int32 `protobuf:"varint,4,opt,name=day_num,json=dayNum,proto3" json:"day_num,omitempty"` //天数 + DayAdd int32 `protobuf:"varint,5,opt,name=day_add,json=dayAdd,proto3" json:"day_add,omitempty"` //增加的库存量 +} + +func (x *ShowRes_OpenAdd) Reset() { + *x = ShowRes_OpenAdd{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[256] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_OpenAdd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_OpenAdd) ProtoMessage() {} + +func (x *ShowRes_OpenAdd) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[256] + 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 ShowRes_OpenAdd.ProtoReflect.Descriptor instead. +func (*ShowRes_OpenAdd) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 33} +} + +func (x *ShowRes_OpenAdd) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_OpenAdd) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ShowRes_OpenAdd) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *ShowRes_OpenAdd) GetDayNum() int32 { + if x != nil { + return x.DayNum + } + return 0 +} + +func (x *ShowRes_OpenAdd) GetDayAdd() int32 { + if x != nil { + return x.DayAdd + } + return 0 +} + +type ShowRes_CollectRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //开启碎片规则(0-否,1-是) + InitCollect int32 `protobuf:"varint,2,opt,name=init_collect,json=initCollect,proto3" json:"init_collect,omitempty"` //初始的最大可获得碎片数 + SignDay int32 `protobuf:"varint,3,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + AddCollect int32 `protobuf:"varint,4,opt,name=add_collect,json=addCollect,proto3" json:"add_collect,omitempty"` //完成条件可获得最大碎片数 + ResetType int32 `protobuf:"varint,5,opt,name=reset_type,json=resetType,proto3" json:"reset_type,omitempty"` //重置碎片规则(1-不重置,2-获奖后重置) +} + +func (x *ShowRes_CollectRule) Reset() { + *x = ShowRes_CollectRule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[257] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_CollectRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_CollectRule) ProtoMessage() {} + +func (x *ShowRes_CollectRule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[257] + 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 ShowRes_CollectRule.ProtoReflect.Descriptor instead. +func (*ShowRes_CollectRule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 34} +} + +func (x *ShowRes_CollectRule) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_CollectRule) GetInitCollect() int32 { + if x != nil { + return x.InitCollect + } + return 0 +} + +func (x *ShowRes_CollectRule) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ShowRes_CollectRule) GetAddCollect() int32 { + if x != nil { + return x.AddCollect + } + return 0 +} + +func (x *ShowRes_CollectRule) GetResetType() int32 { + if x != nil { + return x.ResetType + } + return 0 +} + +type ShowRes_Rewards struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardGroup int32 `protobuf:"varint,1,opt,name=reward_group,json=rewardGroup,proto3" json:"reward_group,omitempty"` //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + Normal []*ShowRes_Reward `protobuf:"bytes,2,rep,name=normal,proto3" json:"normal,omitempty"` //常规奖品 + UserLevel *ShowRes_UserLevel `protobuf:"bytes,3,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` //用户类型奖品 + Langs []*ShowRes_Lang `protobuf:"bytes,4,rep,name=langs,proto3" json:"langs,omitempty"` //语言奖品 + LangUserLevel []*ShowRes_LangUserLevel `protobuf:"bytes,5,rep,name=lang_user_level,json=langUserLevel,proto3" json:"lang_user_level,omitempty"` //语言+用户类型奖品 + Country *ShowRes_Country `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"` //国家奖品 +} + +func (x *ShowRes_Rewards) Reset() { + *x = ShowRes_Rewards{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[258] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Rewards) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Rewards) ProtoMessage() {} + +func (x *ShowRes_Rewards) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[258] + 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 ShowRes_Rewards.ProtoReflect.Descriptor instead. +func (*ShowRes_Rewards) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 35} +} + +func (x *ShowRes_Rewards) GetRewardGroup() int32 { + if x != nil { + return x.RewardGroup + } + return 0 +} + +func (x *ShowRes_Rewards) GetNormal() []*ShowRes_Reward { + if x != nil { + return x.Normal + } + return nil +} + +func (x *ShowRes_Rewards) GetUserLevel() *ShowRes_UserLevel { + if x != nil { + return x.UserLevel + } + return nil +} + +func (x *ShowRes_Rewards) GetLangs() []*ShowRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *ShowRes_Rewards) GetLangUserLevel() []*ShowRes_LangUserLevel { + if x != nil { + return x.LangUserLevel + } + return nil +} + +func (x *ShowRes_Rewards) GetCountry() *ShowRes_Country { + if x != nil { + return x.Country + } + return nil +} + +type ShowRes_UserLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultLevelId int64 `protobuf:"varint,1,opt,name=default_level_id,json=defaultLevelId,proto3" json:"default_level_id,omitempty"` //默认用户类型id + DefaultLevelTitle string `protobuf:"bytes,2,opt,name=default_level_title,json=defaultLevelTitle,proto3" json:"default_level_title,omitempty"` //默认用户类型标题 + LevelList []*ShowRes_UserLevelOne `protobuf:"bytes,3,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //用户类型奖品 +} + +func (x *ShowRes_UserLevel) Reset() { + *x = ShowRes_UserLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[259] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_UserLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_UserLevel) ProtoMessage() {} + +func (x *ShowRes_UserLevel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[259] + 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 ShowRes_UserLevel.ProtoReflect.Descriptor instead. +func (*ShowRes_UserLevel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 36} +} + +func (x *ShowRes_UserLevel) GetDefaultLevelId() int64 { + if x != nil { + return x.DefaultLevelId + } + return 0 +} + +func (x *ShowRes_UserLevel) GetDefaultLevelTitle() string { + if x != nil { + return x.DefaultLevelTitle + } + return "" +} + +func (x *ShowRes_UserLevel) GetLevelList() []*ShowRes_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type ShowRes_UserLevelOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LevelId int64 `protobuf:"varint,1,opt,name=level_id,json=levelId,proto3" json:"level_id,omitempty"` //用户类型id + LevelTitle string `protobuf:"bytes,2,opt,name=level_title,json=levelTitle,proto3" json:"level_title,omitempty"` //用户类型标题 + Rewards []*ShowRes_Reward `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *ShowRes_UserLevelOne) Reset() { + *x = ShowRes_UserLevelOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[260] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_UserLevelOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_UserLevelOne) ProtoMessage() {} + +func (x *ShowRes_UserLevelOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[260] + 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 ShowRes_UserLevelOne.ProtoReflect.Descriptor instead. +func (*ShowRes_UserLevelOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 37} +} + +func (x *ShowRes_UserLevelOne) GetLevelId() int64 { + if x != nil { + return x.LevelId + } + return 0 +} + +func (x *ShowRes_UserLevelOne) GetLevelTitle() string { + if x != nil { + return x.LevelTitle + } + return "" +} + +func (x *ShowRes_UserLevelOne) GetRewards() []*ShowRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type ShowRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangType int32 `protobuf:"varint,1,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言标识数字 + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + DefaultLang bool `protobuf:"varint,3,opt,name=default_lang,json=defaultLang,proto3" json:"default_lang,omitempty"` //是否默认语言 + Rewards []*ShowRes_Reward `protobuf:"bytes,4,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *ShowRes_Lang) Reset() { + *x = ShowRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[261] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Lang) ProtoMessage() {} + +func (x *ShowRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[261] + 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 ShowRes_Lang.ProtoReflect.Descriptor instead. +func (*ShowRes_Lang) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 38} +} + +func (x *ShowRes_Lang) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *ShowRes_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ShowRes_Lang) GetDefaultLang() bool { + if x != nil { + return x.DefaultLang + } + return false +} + +func (x *ShowRes_Lang) GetRewards() []*ShowRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type ShowRes_LangUserLevel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + LangType int32 `protobuf:"varint,2,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言标识数字 + DefaultLang bool `protobuf:"varint,3,opt,name=default_lang,json=defaultLang,proto3" json:"default_lang,omitempty"` //是否默认语言 + DefaultLevelId int64 `protobuf:"varint,4,opt,name=default_level_id,json=defaultLevelId,proto3" json:"default_level_id,omitempty"` //默认用户类型id + DefaultLevelTitle string `protobuf:"bytes,5,opt,name=default_level_title,json=defaultLevelTitle,proto3" json:"default_level_title,omitempty"` //默认用户类型标题 + LevelList []*ShowRes_UserLevelOne `protobuf:"bytes,6,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //用户类型奖品 +} + +func (x *ShowRes_LangUserLevel) Reset() { + *x = ShowRes_LangUserLevel{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[262] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_LangUserLevel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_LangUserLevel) ProtoMessage() {} + +func (x *ShowRes_LangUserLevel) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[262] + 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 ShowRes_LangUserLevel.ProtoReflect.Descriptor instead. +func (*ShowRes_LangUserLevel) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 39} +} + +func (x *ShowRes_LangUserLevel) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ShowRes_LangUserLevel) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *ShowRes_LangUserLevel) GetDefaultLang() bool { + if x != nil { + return x.DefaultLang + } + return false +} + +func (x *ShowRes_LangUserLevel) GetDefaultLevelId() int64 { + if x != nil { + return x.DefaultLevelId + } + return 0 +} + +func (x *ShowRes_LangUserLevel) GetDefaultLevelTitle() string { + if x != nil { + return x.DefaultLevelTitle + } + return "" +} + +func (x *ShowRes_LangUserLevel) GetLevelList() []*ShowRes_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type ShowRes_Country struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultCountryMark string `protobuf:"bytes,1,opt,name=default_country_mark,json=defaultCountryMark,proto3" json:"default_country_mark,omitempty"` //默认国家 + CountryList []*ShowRes_CountryOne `protobuf:"bytes,2,rep,name=country_list,json=countryList,proto3" json:"country_list,omitempty"` //国家的奖品 +} + +func (x *ShowRes_Country) Reset() { + *x = ShowRes_Country{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[263] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Country) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Country) ProtoMessage() {} + +func (x *ShowRes_Country) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[263] + 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 ShowRes_Country.ProtoReflect.Descriptor instead. +func (*ShowRes_Country) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 40} +} + +func (x *ShowRes_Country) GetDefaultCountryMark() string { + if x != nil { + return x.DefaultCountryMark + } + return "" +} + +func (x *ShowRes_Country) GetCountryList() []*ShowRes_CountryOne { + if x != nil { + return x.CountryList + } + return nil +} + +type ShowRes_CountryOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CountryMark string `protobuf:"bytes,1,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 + Rewards []*ShowRes_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *ShowRes_CountryOne) Reset() { + *x = ShowRes_CountryOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[264] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_CountryOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_CountryOne) ProtoMessage() {} + +func (x *ShowRes_CountryOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[264] + 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 ShowRes_CountryOne.ProtoReflect.Descriptor instead. +func (*ShowRes_CountryOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 41} +} + +func (x *ShowRes_CountryOne) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *ShowRes_CountryOne) GetRewards() []*ShowRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type ShowRes_QaQuestion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //题目id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //题目 + Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` //得分 + Options []*ShowRes_QaOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` //选项 +} + +func (x *ShowRes_QaQuestion) Reset() { + *x = ShowRes_QaQuestion{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[265] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_QaQuestion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_QaQuestion) ProtoMessage() {} + +func (x *ShowRes_QaQuestion) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[265] + 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 ShowRes_QaQuestion.ProtoReflect.Descriptor instead. +func (*ShowRes_QaQuestion) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 42} +} + +func (x *ShowRes_QaQuestion) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_QaQuestion) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_QaQuestion) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ShowRes_QaQuestion) GetOptions() []*ShowRes_QaOption { + if x != nil { + return x.Options + } + return nil +} + +type ShowRes_QaOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //答案id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + IsRight int32 `protobuf:"varint,3,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *ShowRes_QaOption) Reset() { + *x = ShowRes_QaOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[266] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_QaOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_QaOption) ProtoMessage() {} + +func (x *ShowRes_QaOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[266] + 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 ShowRes_QaOption.ProtoReflect.Descriptor instead. +func (*ShowRes_QaOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 43} +} + +func (x *ShowRes_QaOption) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_QaOption) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_QaOption) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type ShowRes_QuizOption struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确选项(1-是,0-否) + VoteNum int64 `protobuf:"varint,5,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"` //投票人数 +} + +func (x *ShowRes_QuizOption) Reset() { + *x = ShowRes_QuizOption{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[267] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_QuizOption) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_QuizOption) ProtoMessage() {} + +func (x *ShowRes_QuizOption) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[267] + 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 ShowRes_QuizOption.ProtoReflect.Descriptor instead. +func (*ShowRes_QuizOption) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 44} +} + +func (x *ShowRes_QuizOption) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_QuizOption) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_QuizOption) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_QuizOption) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +func (x *ShowRes_QuizOption) GetVoteNum() int64 { + if x != nil { + return x.VoteNum + } + return 0 +} + +type ShowRes_Quiz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + InitChance int32 `protobuf:"varint,2,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始答题机会次数 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的答题机会次数 + RewardRule int32 `protobuf:"varint,4,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //奖励规则(1-投票结果排名,2-自定义竞猜结果) + OpenPrize int64 `protobuf:"varint,5,opt,name=open_prize,json=openPrize,proto3" json:"open_prize,omitempty"` //开奖时间 + Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` //选择标题 + OpenType int32 `protobuf:"varint,7,opt,name=open_type,json=openType,proto3" json:"open_type,omitempty"` //开奖状态(1-未开奖,2-已开奖,3-不开奖) + Options []*ShowRes_QuizOption `protobuf:"bytes,8,rep,name=options,proto3" json:"options,omitempty"` //有奖竞猜选项 + TOpen int64 `protobuf:"varint,9,opt,name=t_open,json=tOpen,proto3" json:"t_open,omitempty"` //偏移对比的开奖北京时间 +} + +func (x *ShowRes_Quiz) Reset() { + *x = ShowRes_Quiz{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[268] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Quiz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Quiz) ProtoMessage() {} + +func (x *ShowRes_Quiz) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[268] + 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 ShowRes_Quiz.ProtoReflect.Descriptor instead. +func (*ShowRes_Quiz) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 45} +} + +func (x *ShowRes_Quiz) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *ShowRes_Quiz) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_Quiz) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_Quiz) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *ShowRes_Quiz) GetOpenPrize() int64 { + if x != nil { + return x.OpenPrize + } + return 0 +} + +func (x *ShowRes_Quiz) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_Quiz) GetOpenType() int32 { + if x != nil { + return x.OpenType + } + return 0 +} + +func (x *ShowRes_Quiz) GetOptions() []*ShowRes_QuizOption { + if x != nil { + return x.Options + } + return nil +} + +func (x *ShowRes_Quiz) GetTOpen() int64 { + if x != nil { + return x.TOpen + } + return 0 +} + +type ShowRes_QuestionAnswer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //达标条件后可获取的答题次数 + InitChance int32 `protobuf:"varint,3,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始答题机会次数 + QuestionAskTime int32 `protobuf:"varint,4,opt,name=question_ask_time,json=questionAskTime,proto3" json:"question_ask_time,omitempty"` //答题时间限制(单位:S,如:1 就是1秒) + Questions []*ShowRes_QaQuestion `protobuf:"bytes,5,rep,name=questions,proto3" json:"questions,omitempty"` //题目 + GroupHashId string `protobuf:"bytes,6,opt,name=group_hash_id,json=groupHashId,proto3" json:"group_hash_id,omitempty"` //题库对外id + QaNum int32 `protobuf:"varint,7,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题库选取数量 + DayChance int32 `protobuf:"varint,8,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日签到获得的答题数 + OpenGuide int32 `protobuf:"varint,9,opt,name=open_guide,json=openGuide,proto3" json:"open_guide,omitempty"` //是否开启引导(0-否,1-是) + GuideGroupHashId string `protobuf:"bytes,10,opt,name=guide_group_hash_id,json=guideGroupHashId,proto3" json:"guide_group_hash_id,omitempty"` //引导组hash_id +} + +func (x *ShowRes_QuestionAnswer) Reset() { + *x = ShowRes_QuestionAnswer{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[269] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_QuestionAnswer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_QuestionAnswer) ProtoMessage() {} + +func (x *ShowRes_QuestionAnswer) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[269] + 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 ShowRes_QuestionAnswer.ProtoReflect.Descriptor instead. +func (*ShowRes_QuestionAnswer) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 46} +} + +func (x *ShowRes_QuestionAnswer) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetQuestionAskTime() int32 { + if x != nil { + return x.QuestionAskTime + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetQuestions() []*ShowRes_QaQuestion { + if x != nil { + return x.Questions + } + return nil +} + +func (x *ShowRes_QuestionAnswer) GetGroupHashId() string { + if x != nil { + return x.GroupHashId + } + return "" +} + +func (x *ShowRes_QuestionAnswer) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetOpenGuide() int32 { + if x != nil { + return x.OpenGuide + } + return 0 +} + +func (x *ShowRes_QuestionAnswer) GetGuideGroupHashId() string { + if x != nil { + return x.GuideGroupHashId + } + return "" +} + +type ShowRes_LotteryConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int32 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + InitChance int32 `protobuf:"varint,2,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖机会次数 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的抽奖机会次数 + DayChance int32 `protobuf:"varint,4,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽奖机会次数 +} + +func (x *ShowRes_LotteryConfig) Reset() { + *x = ShowRes_LotteryConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[270] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_LotteryConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_LotteryConfig) ProtoMessage() {} + +func (x *ShowRes_LotteryConfig) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[270] + 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 ShowRes_LotteryConfig.ProtoReflect.Descriptor instead. +func (*ShowRes_LotteryConfig) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 47} +} + +func (x *ShowRes_LotteryConfig) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *ShowRes_LotteryConfig) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_LotteryConfig) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ShowRes_LotteryConfig) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type ShowRes_InviteConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardLimit int32 `protobuf:"varint,1,opt,name=reward_limit,json=rewardLimit,proto3" json:"reward_limit,omitempty"` //活动总奖励上限 + RewardRule int32 `protobuf:"varint,2,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //用户奖励规则(1-阶梯,2-非阶梯) + InviteLimit int32 `protobuf:"varint,3,opt,name=invite_limit,json=inviteLimit,proto3" json:"invite_limit,omitempty"` //邀请超过多少人不能再获得奖励 + NewcomerCond int32 `protobuf:"varint,4,opt,name=newcomer_cond,json=newcomerCond,proto3" json:"newcomer_cond,omitempty"` //新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + StepLoop int32 `protobuf:"varint,5,opt,name=step_loop,json=stepLoop,proto3" json:"step_loop,omitempty"` //阶梯是否支持循环(0-不支持,1-支持) +} + +func (x *ShowRes_InviteConfig) Reset() { + *x = ShowRes_InviteConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[271] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_InviteConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_InviteConfig) ProtoMessage() {} + +func (x *ShowRes_InviteConfig) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[271] + 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 ShowRes_InviteConfig.ProtoReflect.Descriptor instead. +func (*ShowRes_InviteConfig) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 48} +} + +func (x *ShowRes_InviteConfig) GetRewardLimit() int32 { + if x != nil { + return x.RewardLimit + } + return 0 +} + +func (x *ShowRes_InviteConfig) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *ShowRes_InviteConfig) GetInviteLimit() int32 { + if x != nil { + return x.InviteLimit + } + return 0 +} + +func (x *ShowRes_InviteConfig) GetNewcomerCond() int32 { + if x != nil { + return x.NewcomerCond + } + return 0 +} + +func (x *ShowRes_InviteConfig) GetStepLoop() int32 { + if x != nil { + return x.StepLoop + } + return 0 +} + +type ShowRes_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignType int32 `protobuf:"varint,1,opt,name=sign_type,json=signType,proto3" json:"sign_type,omitempty"` //签到类型(1-普通签到,2-阶梯签到) + IsContinue int32 `protobuf:"varint,2,opt,name=is_continue,json=isContinue,proto3" json:"is_continue,omitempty"` //是否连续签到(1-是,0-否) + HasCard int32 `protobuf:"varint,3,opt,name=has_card,json=hasCard,proto3" json:"has_card,omitempty"` //是否开启签到卡(1-开启,0-不开启) + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //邀请好友数可获得的1张签到卡 + LimitCardNum int32 `protobuf:"varint,5,opt,name=limit_card_num,json=limitCardNum,proto3" json:"limit_card_num,omitempty"` //可获得幸运卡的最大张数 + IsLoop int32 `protobuf:"varint,6,opt,name=is_loop,json=isLoop,proto3" json:"is_loop,omitempty"` //是否支持循环(0-否,1-是) + SignCycle int32 `protobuf:"varint,7,opt,name=sign_cycle,json=signCycle,proto3" json:"sign_cycle,omitempty"` //签到周期 + RecycleType int32 `protobuf:"varint,8,opt,name=recycle_type,json=recycleType,proto3" json:"recycle_type,omitempty"` //重新签到模式(1-断签重签,2-周期重签) + Color string `protobuf:"bytes,9,opt,name=color,proto3" json:"color,omitempty"` //签到主题颜色 +} + +func (x *ShowRes_Sign) Reset() { + *x = ShowRes_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[272] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Sign) ProtoMessage() {} + +func (x *ShowRes_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[272] + 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 ShowRes_Sign.ProtoReflect.Descriptor instead. +func (*ShowRes_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 49} +} + +func (x *ShowRes_Sign) GetSignType() int32 { + if x != nil { + return x.SignType + } + return 0 +} + +func (x *ShowRes_Sign) GetIsContinue() int32 { + if x != nil { + return x.IsContinue + } + return 0 +} + +func (x *ShowRes_Sign) GetHasCard() int32 { + if x != nil { + return x.HasCard + } + return 0 +} + +func (x *ShowRes_Sign) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ShowRes_Sign) GetLimitCardNum() int32 { + if x != nil { + return x.LimitCardNum + } + return 0 +} + +func (x *ShowRes_Sign) GetIsLoop() int32 { + if x != nil { + return x.IsLoop + } + return 0 +} + +func (x *ShowRes_Sign) GetSignCycle() int32 { + if x != nil { + return x.SignCycle + } + return 0 +} + +func (x *ShowRes_Sign) GetRecycleType() int32 { + if x != nil { + return x.RecycleType + } + return 0 +} + +func (x *ShowRes_Sign) GetColor() string { + if x != nil { + return x.Color + } + return "" +} + +type ShowRes_Dice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始骰子数 + DayChance int32 `protobuf:"varint,2,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的骰子数 + FixDice int32 `protobuf:"varint,3,opt,name=fix_dice,json=fixDice,proto3" json:"fix_dice,omitempty"` //开启固定骰子(0-不开启,1-开启) + FixDiceTarget int32 `protobuf:"varint,4,opt,name=fix_dice_target,json=fixDiceTarget,proto3" json:"fix_dice_target,omitempty"` //获得固定骰子需要邀请的人数 + FixDiceLimit int32 `protobuf:"varint,5,opt,name=fix_dice_limit,json=fixDiceLimit,proto3" json:"fix_dice_limit,omitempty"` //固定骰子限制获取数 + CustomDice string `protobuf:"bytes,6,opt,name=custom_dice,json=customDice,proto3" json:"custom_dice,omitempty"` //自定义骰子图片 + OpenMapPoint int32 `protobuf:"varint,7,opt,name=open_map_point,json=openMapPoint,proto3" json:"open_map_point,omitempty"` //开启自定义底座(0-不开启,1-开启) + MapPoint *ShowRes_MapPoint `protobuf:"bytes,8,opt,name=map_point,json=mapPoint,proto3" json:"map_point,omitempty"` //自定义底座数据 + AwardType int32 `protobuf:"varint,9,opt,name=award_type,json=awardType,proto3" json:"award_type,omitempty"` //奖品碎片收集方式(1-随机收集,2-概率收集) + OpenInvite int32 `protobuf:"varint,10,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请挂件(0-关闭,1-开启) + RollAgain int32 `protobuf:"varint,11,opt,name=roll_again,json=rollAgain,proto3" json:"roll_again,omitempty"` //开启再摇一次(0-关闭,1-开启) + FixDiceCond int32 `protobuf:"varint,12,opt,name=fix_dice_cond,json=fixDiceCond,proto3" json:"fix_dice_cond,omitempty"` //邀请事件(1-安装,2-注册) + Odds int32 `protobuf:"varint,13,opt,name=odds,proto3" json:"odds,omitempty"` //概率收集方式的中奖概率 + PlayImg string `protobuf:"bytes,14,opt,name=play_img,json=playImg,proto3" json:"play_img,omitempty"` //play按钮图 + CloudImg string `protobuf:"bytes,15,opt,name=cloud_img,json=cloudImg,proto3" json:"cloud_img,omitempty"` //云朵图 +} + +func (x *ShowRes_Dice) Reset() { + *x = ShowRes_Dice{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[273] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Dice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Dice) ProtoMessage() {} + +func (x *ShowRes_Dice) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[273] + 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 ShowRes_Dice.ProtoReflect.Descriptor instead. +func (*ShowRes_Dice) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 50} +} + +func (x *ShowRes_Dice) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_Dice) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +func (x *ShowRes_Dice) GetFixDice() int32 { + if x != nil { + return x.FixDice + } + return 0 +} + +func (x *ShowRes_Dice) GetFixDiceTarget() int32 { + if x != nil { + return x.FixDiceTarget + } + return 0 +} + +func (x *ShowRes_Dice) GetFixDiceLimit() int32 { + if x != nil { + return x.FixDiceLimit + } + return 0 +} + +func (x *ShowRes_Dice) GetCustomDice() string { + if x != nil { + return x.CustomDice + } + return "" +} + +func (x *ShowRes_Dice) GetOpenMapPoint() int32 { + if x != nil { + return x.OpenMapPoint + } + return 0 +} + +func (x *ShowRes_Dice) GetMapPoint() *ShowRes_MapPoint { + if x != nil { + return x.MapPoint + } + return nil +} + +func (x *ShowRes_Dice) GetAwardType() int32 { + if x != nil { + return x.AwardType + } + return 0 +} + +func (x *ShowRes_Dice) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *ShowRes_Dice) GetRollAgain() int32 { + if x != nil { + return x.RollAgain + } + return 0 +} + +func (x *ShowRes_Dice) GetFixDiceCond() int32 { + if x != nil { + return x.FixDiceCond + } + return 0 +} + +func (x *ShowRes_Dice) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *ShowRes_Dice) GetPlayImg() string { + if x != nil { + return x.PlayImg + } + return "" +} + +func (x *ShowRes_Dice) GetCloudImg() string { + if x != nil { + return x.CloudImg + } + return "" +} + +type ShowRes_MapPoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blank string `protobuf:"bytes,1,opt,name=blank,proto3" json:"blank,omitempty"` //空白底座 + Again string `protobuf:"bytes,2,opt,name=again,proto3" json:"again,omitempty"` //再摇一次底座 + Normal string `protobuf:"bytes,3,opt,name=normal,proto3" json:"normal,omitempty"` //普通奖品底座 + Supper string `protobuf:"bytes,4,opt,name=supper,proto3" json:"supper,omitempty"` //超级大奖底座 +} + +func (x *ShowRes_MapPoint) Reset() { + *x = ShowRes_MapPoint{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[274] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_MapPoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_MapPoint) ProtoMessage() {} + +func (x *ShowRes_MapPoint) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[274] + 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 ShowRes_MapPoint.ProtoReflect.Descriptor instead. +func (*ShowRes_MapPoint) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 51} +} + +func (x *ShowRes_MapPoint) GetBlank() string { + if x != nil { + return x.Blank + } + return "" +} + +func (x *ShowRes_MapPoint) GetAgain() string { + if x != nil { + return x.Again + } + return "" +} + +func (x *ShowRes_MapPoint) GetNormal() string { + if x != nil { + return x.Normal + } + return "" +} + +func (x *ShowRes_MapPoint) GetSupper() string { + if x != nil { + return x.Supper + } + return "" +} + +type ShowRes_Grow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AutoHour int32 `protobuf:"varint,1,opt,name=auto_hour,json=autoHour,proto3" json:"auto_hour,omitempty"` //自动生产成长道具小时数 + AutoNum int32 `protobuf:"varint,2,opt,name=auto_num,json=autoNum,proto3" json:"auto_num,omitempty"` //生产的成长道具数 + GrowNum int32 `protobuf:"varint,3,opt,name=grow_num,json=growNum,proto3" json:"grow_num,omitempty"` //邀请可获得的成长道具数量 + TargetNum int32 `protobuf:"varint,4,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //获得成长道具需要邀请的人数 + Revive int32 `protobuf:"varint,5,opt,name=revive,proto3" json:"revive,omitempty"` //是否支持复活(0-否,1-是) + ReviveNum int32 `protobuf:"varint,6,opt,name=revive_num,json=reviveNum,proto3" json:"revive_num,omitempty"` //复活需要邀请的好友数 + DieHour int32 `protobuf:"varint,7,opt,name=die_hour,json=dieHour,proto3" json:"die_hour,omitempty"` //未获得成长道具导致的死亡时间 + Steps []*ShowRes_GrowStep `protobuf:"bytes,8,rep,name=steps,proto3" json:"steps,omitempty"` //成长阶段 + InitNum int32 `protobuf:"varint,9,opt,name=init_num,json=initNum,proto3" json:"init_num,omitempty"` //初始成长道具数量 +} + +func (x *ShowRes_Grow) Reset() { + *x = ShowRes_Grow{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[275] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Grow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Grow) ProtoMessage() {} + +func (x *ShowRes_Grow) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[275] + 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 ShowRes_Grow.ProtoReflect.Descriptor instead. +func (*ShowRes_Grow) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 52} +} + +func (x *ShowRes_Grow) GetAutoHour() int32 { + if x != nil { + return x.AutoHour + } + return 0 +} + +func (x *ShowRes_Grow) GetAutoNum() int32 { + if x != nil { + return x.AutoNum + } + return 0 +} + +func (x *ShowRes_Grow) GetGrowNum() int32 { + if x != nil { + return x.GrowNum + } + return 0 +} + +func (x *ShowRes_Grow) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *ShowRes_Grow) GetRevive() int32 { + if x != nil { + return x.Revive + } + return 0 +} + +func (x *ShowRes_Grow) GetReviveNum() int32 { + if x != nil { + return x.ReviveNum + } + return 0 +} + +func (x *ShowRes_Grow) GetDieHour() int32 { + if x != nil { + return x.DieHour + } + return 0 +} + +func (x *ShowRes_Grow) GetSteps() []*ShowRes_GrowStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *ShowRes_Grow) GetInitNum() int32 { + if x != nil { + return x.InitNum + } + return 0 +} + +type ShowRes_GrowStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //需要的养成道具数量 +} + +func (x *ShowRes_GrowStep) Reset() { + *x = ShowRes_GrowStep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[276] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_GrowStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_GrowStep) ProtoMessage() {} + +func (x *ShowRes_GrowStep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[276] + 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 ShowRes_GrowStep.ProtoReflect.Descriptor instead. +func (*ShowRes_GrowStep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 53} +} + +func (x *ShowRes_GrowStep) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_GrowStep) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type ShowRes_Ballot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽签数 + DayChance int32 `protobuf:"varint,2,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽签数 +} + +func (x *ShowRes_Ballot) Reset() { + *x = ShowRes_Ballot{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[277] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Ballot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Ballot) ProtoMessage() {} + +func (x *ShowRes_Ballot) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[277] + 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 ShowRes_Ballot.ProtoReflect.Descriptor instead. +func (*ShowRes_Ballot) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 54} +} + +func (x *ShowRes_Ballot) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_Ballot) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type ShowRes_Chop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ShowBar int32 `protobuf:"varint,1,opt,name=show_bar,json=showBar,proto3" json:"show_bar,omitempty"` //是否展示进度条(0-否,1-是) +} + +func (x *ShowRes_Chop) Reset() { + *x = ShowRes_Chop{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[278] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Chop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Chop) ProtoMessage() {} + +func (x *ShowRes_Chop) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[278] + 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 ShowRes_Chop.ProtoReflect.Descriptor instead. +func (*ShowRes_Chop) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 55} +} + +func (x *ShowRes_Chop) GetShowBar() int32 { + if x != nil { + return x.ShowBar + } + return 0 +} + +type ShowRes_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExpiredDay int32 `protobuf:"varint,1,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //任务重置天数 + Price int32 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + PriceNum int32 `protobuf:"varint,3,opt,name=price_num,json=priceNum,proto3" json:"price_num,omitempty"` //奖品总份额 + SpinCash []*ShowRes_SpinCash `protobuf:"bytes,4,rep,name=spin_cash,json=spinCash,proto3" json:"spin_cash,omitempty"` //金额 + Lack int32 `protobuf:"varint,5,opt,name=lack,proto3" json:"lack,omitempty"` //是否缺乏库存(0-否,1-是) + Currency int32 `protobuf:"varint,6,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 + LoopNum int32 `protobuf:"varint,7,opt,name=loop_num,json=loopNum,proto3" json:"loop_num,omitempty"` //支持循环次数 +} + +func (x *ShowRes_Cash) Reset() { + *x = ShowRes_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[279] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Cash) ProtoMessage() {} + +func (x *ShowRes_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[279] + 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 ShowRes_Cash.ProtoReflect.Descriptor instead. +func (*ShowRes_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 56} +} + +func (x *ShowRes_Cash) GetExpiredDay() int32 { + if x != nil { + return x.ExpiredDay + } + return 0 +} + +func (x *ShowRes_Cash) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *ShowRes_Cash) GetPriceNum() int32 { + if x != nil { + return x.PriceNum + } + return 0 +} + +func (x *ShowRes_Cash) GetSpinCash() []*ShowRes_SpinCash { + if x != nil { + return x.SpinCash + } + return nil +} + +func (x *ShowRes_Cash) GetLack() int32 { + if x != nil { + return x.Lack + } + return 0 +} + +func (x *ShowRes_Cash) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +func (x *ShowRes_Cash) GetLoopNum() int32 { + if x != nil { + return x.LoopNum + } + return 0 +} + +type ShowRes_SpinCash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //唯一id + Cash float64 `protobuf:"fixed64,2,opt,name=cash,proto3" json:"cash,omitempty"` //单位奖品总价值 +} + +func (x *ShowRes_SpinCash) Reset() { + *x = ShowRes_SpinCash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[280] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_SpinCash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_SpinCash) ProtoMessage() {} + +func (x *ShowRes_SpinCash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[280] + 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 ShowRes_SpinCash.ProtoReflect.Descriptor instead. +func (*ShowRes_SpinCash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 57} +} + +func (x *ShowRes_SpinCash) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes_SpinCash) GetCash() float64 { + if x != nil { + return x.Cash + } + return 0 +} + +type ShowRes_Flip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitChance int32 `protobuf:"varint,1,opt,name=init_chance,json=initChance,proto3" json:"init_chance,omitempty"` //初始抽奖机会次数 + CardImg string `protobuf:"bytes,2,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡牌图片 + DayChance int32 `protobuf:"varint,3,opt,name=day_chance,json=dayChance,proto3" json:"day_chance,omitempty"` //每日获得的抽奖机会次数 +} + +func (x *ShowRes_Flip) Reset() { + *x = ShowRes_Flip{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[281] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Flip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Flip) ProtoMessage() {} + +func (x *ShowRes_Flip) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[281] + 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 ShowRes_Flip.ProtoReflect.Descriptor instead. +func (*ShowRes_Flip) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 58} +} + +func (x *ShowRes_Flip) GetInitChance() int32 { + if x != nil { + return x.InitChance + } + return 0 +} + +func (x *ShowRes_Flip) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +func (x *ShowRes_Flip) GetDayChance() int32 { + if x != nil { + return x.DayChance + } + return 0 +} + +type ShowRes_Keep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Collect int32 `protobuf:"varint,1,opt,name=collect,proto3" json:"collect,omitempty"` //获得最终奖品需要的总收集数 + CollectSecond int32 `protobuf:"varint,2,opt,name=collect_second,json=collectSecond,proto3" json:"collect_second,omitempty"` //单个收集需要的二级资源数 + OpenInvite int32 `protobuf:"varint,3,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请(0-关闭,1-开启) + Invite *ShowRes_Invite `protobuf:"bytes,4,opt,name=invite,proto3" json:"invite,omitempty"` //拉新配置 + InitGet int32 `protobuf:"varint,5,opt,name=init_get,json=initGet,proto3" json:"init_get,omitempty"` //初始道具数 + SecGet float64 `protobuf:"fixed64,6,opt,name=sec_get,json=secGet,proto3" json:"sec_get,omitempty"` //每秒获得道具数 + FeedNum int32 `protobuf:"varint,7,opt,name=feed_num,json=feedNum,proto3" json:"feed_num,omitempty"` //每次使用道具数 + FeedCycle int32 `protobuf:"varint,8,opt,name=feed_cycle,json=feedCycle,proto3" json:"feed_cycle,omitempty"` //喂养周期(单位:天) + MaxFeed int32 `protobuf:"varint,9,opt,name=max_feed,json=maxFeed,proto3" json:"max_feed,omitempty"` //最大可领养次数 + FeedGet int32 `protobuf:"varint,10,opt,name=feed_get,json=feedGet,proto3" json:"feed_get,omitempty"` //喂养能得到的道具数 + FeedGetNum int32 `protobuf:"varint,11,opt,name=feed_get_num,json=feedGetNum,proto3" json:"feed_get_num,omitempty"` //得到喂养道具需要的喂养次数 + TalkText []*ShowRes_Talk `protobuf:"bytes,12,rep,name=talk_text,json=talkText,proto3" json:"talk_text,omitempty"` //对话文案 + Steps []*ShowRes_KeepStep `protobuf:"bytes,13,rep,name=steps,proto3" json:"steps,omitempty"` //养成阶梯 + SecGetDayLimit float64 `protobuf:"fixed64,14,opt,name=sec_get_day_limit,json=secGetDayLimit,proto3" json:"sec_get_day_limit,omitempty"` //每秒获得道具每日上限 + MachineType int32 `protobuf:"varint,15,opt,name=machine_type,json=machineType,proto3" json:"machine_type,omitempty"` //狗粮机类型(1-在线收益,2-离线收益) + OfflineMin int32 `protobuf:"varint,16,opt,name=offline_min,json=offlineMin,proto3" json:"offline_min,omitempty"` //离线分钟时长 + OfflineGet int32 `protobuf:"varint,17,opt,name=offline_get,json=offlineGet,proto3" json:"offline_get,omitempty"` //离线收益最大值 + OfflineLimit int32 `protobuf:"varint,18,opt,name=offline_limit,json=offlineLimit,proto3" json:"offline_limit,omitempty"` //离线收益最大领取次数 +} + +func (x *ShowRes_Keep) Reset() { + *x = ShowRes_Keep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[282] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Keep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Keep) ProtoMessage() {} + +func (x *ShowRes_Keep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[282] + 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 ShowRes_Keep.ProtoReflect.Descriptor instead. +func (*ShowRes_Keep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 59} +} + +func (x *ShowRes_Keep) GetCollect() int32 { + if x != nil { + return x.Collect + } + return 0 +} + +func (x *ShowRes_Keep) GetCollectSecond() int32 { + if x != nil { + return x.CollectSecond + } + return 0 +} + +func (x *ShowRes_Keep) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *ShowRes_Keep) GetInvite() *ShowRes_Invite { + if x != nil { + return x.Invite + } + return nil +} + +func (x *ShowRes_Keep) GetInitGet() int32 { + if x != nil { + return x.InitGet + } + return 0 +} + +func (x *ShowRes_Keep) GetSecGet() float64 { + if x != nil { + return x.SecGet + } + return 0 +} + +func (x *ShowRes_Keep) GetFeedNum() int32 { + if x != nil { + return x.FeedNum + } + return 0 +} + +func (x *ShowRes_Keep) GetFeedCycle() int32 { + if x != nil { + return x.FeedCycle + } + return 0 +} + +func (x *ShowRes_Keep) GetMaxFeed() int32 { + if x != nil { + return x.MaxFeed + } + return 0 +} + +func (x *ShowRes_Keep) GetFeedGet() int32 { + if x != nil { + return x.FeedGet + } + return 0 +} + +func (x *ShowRes_Keep) GetFeedGetNum() int32 { + if x != nil { + return x.FeedGetNum + } + return 0 +} + +func (x *ShowRes_Keep) GetTalkText() []*ShowRes_Talk { + if x != nil { + return x.TalkText + } + return nil +} + +func (x *ShowRes_Keep) GetSteps() []*ShowRes_KeepStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *ShowRes_Keep) GetSecGetDayLimit() float64 { + if x != nil { + return x.SecGetDayLimit + } + return 0 +} + +func (x *ShowRes_Keep) GetMachineType() int32 { + if x != nil { + return x.MachineType + } + return 0 +} + +func (x *ShowRes_Keep) GetOfflineMin() int32 { + if x != nil { + return x.OfflineMin + } + return 0 +} + +func (x *ShowRes_Keep) GetOfflineGet() int32 { + if x != nil { + return x.OfflineGet + } + return 0 +} + +func (x *ShowRes_Keep) GetOfflineLimit() int32 { + if x != nil { + return x.OfflineLimit + } + return 0 +} + +type ShowRes_Invite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InviteType int32 `protobuf:"varint,1,opt,name=invite_type,json=inviteType,proto3" json:"invite_type,omitempty"` //邀请类型(1-下载,2-安装) + InviteGet int32 `protobuf:"varint,2,opt,name=invite_get,json=inviteGet,proto3" json:"invite_get,omitempty"` //邀请可获得的道具数量 + RewardSelected int32 `protobuf:"varint,3,opt,name=reward_selected,json=rewardSelected,proto3" json:"reward_selected,omitempty"` //选择礼品可获得的道具数 + FeedThird int32 `protobuf:"varint,4,opt,name=feed_third,json=feedThird,proto3" json:"feed_third,omitempty"` //喂养3次可获得的道具数 + DayFirstInvite int32 `protobuf:"varint,5,opt,name=day_first_invite,json=dayFirstInvite,proto3" json:"day_first_invite,omitempty"` //是否开启每日首次拉新(0-否,1-是) + DayFirstGet int32 `protobuf:"varint,6,opt,name=day_first_get,json=dayFirstGet,proto3" json:"day_first_get,omitempty"` //每日首次拉新可获得的道具数 + DayFirstSelected int32 `protobuf:"varint,7,opt,name=day_first_selected,json=dayFirstSelected,proto3" json:"day_first_selected,omitempty"` //每日首日选择礼物可获得的道具数 + DayFirstThird int32 `protobuf:"varint,8,opt,name=day_first_third,json=dayFirstThird,proto3" json:"day_first_third,omitempty"` //每日首次喂养三次可获得的道具数 + InviteMaxGet int32 `protobuf:"varint,9,opt,name=invite_max_get,json=inviteMaxGet,proto3" json:"invite_max_get,omitempty"` //邀请人可获得的最大道具数 +} + +func (x *ShowRes_Invite) Reset() { + *x = ShowRes_Invite{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[283] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Invite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Invite) ProtoMessage() {} + +func (x *ShowRes_Invite) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[283] + 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 ShowRes_Invite.ProtoReflect.Descriptor instead. +func (*ShowRes_Invite) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 60} +} + +func (x *ShowRes_Invite) GetInviteType() int32 { + if x != nil { + return x.InviteType + } + return 0 +} + +func (x *ShowRes_Invite) GetInviteGet() int32 { + if x != nil { + return x.InviteGet + } + return 0 +} + +func (x *ShowRes_Invite) GetRewardSelected() int32 { + if x != nil { + return x.RewardSelected + } + return 0 +} + +func (x *ShowRes_Invite) GetFeedThird() int32 { + if x != nil { + return x.FeedThird + } + return 0 +} + +func (x *ShowRes_Invite) GetDayFirstInvite() int32 { + if x != nil { + return x.DayFirstInvite + } + return 0 +} + +func (x *ShowRes_Invite) GetDayFirstGet() int32 { + if x != nil { + return x.DayFirstGet + } + return 0 +} + +func (x *ShowRes_Invite) GetDayFirstSelected() int32 { + if x != nil { + return x.DayFirstSelected + } + return 0 +} + +func (x *ShowRes_Invite) GetDayFirstThird() int32 { + if x != nil { + return x.DayFirstThird + } + return 0 +} + +func (x *ShowRes_Invite) GetInviteMaxGet() int32 { + if x != nil { + return x.InviteMaxGet + } + return 0 +} + +type ShowRes_Talk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextType int32 `protobuf:"varint,1,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 +} + +func (x *ShowRes_Talk) Reset() { + *x = ShowRes_Talk{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[284] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Talk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Talk) ProtoMessage() {} + +func (x *ShowRes_Talk) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[284] + 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 ShowRes_Talk.ProtoReflect.Descriptor instead. +func (*ShowRes_Talk) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 61} +} + +func (x *ShowRes_Talk) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *ShowRes_Talk) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type ShowRes_KeepStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Step int32 `protobuf:"varint,1,opt,name=step,proto3" json:"step,omitempty"` //阶段 + Percent int32 `protobuf:"varint,2,opt,name=percent,proto3" json:"percent,omitempty"` //对应的进度条数值 + RewardType int32 `protobuf:"varint,3,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品类型(1-成长道具,2-奖品) + Reward *ShowRes_Reward `protobuf:"bytes,4,opt,name=reward,proto3" json:"reward,omitempty"` //奖品数据时 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放道具数量 +} + +func (x *ShowRes_KeepStep) Reset() { + *x = ShowRes_KeepStep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[285] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_KeepStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_KeepStep) ProtoMessage() {} + +func (x *ShowRes_KeepStep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[285] + 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 ShowRes_KeepStep.ProtoReflect.Descriptor instead. +func (*ShowRes_KeepStep) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 62} +} + +func (x *ShowRes_KeepStep) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *ShowRes_KeepStep) GetPercent() int32 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *ShowRes_KeepStep) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *ShowRes_KeepStep) GetReward() *ShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ShowRes_KeepStep) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +type ShowRes_Push struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskReset *ShowRes_PushOne `protobuf:"bytes,1,opt,name=task_reset,json=taskReset,proto3" json:"task_reset,omitempty"` //重制提醒 + Active *ShowRes_PushOne `protobuf:"bytes,2,opt,name=active,proto3" json:"active,omitempty"` //活跃提醒 + Offline *ShowRes_PushOne `protobuf:"bytes,3,opt,name=offline,proto3" json:"offline,omitempty"` //离线提醒 + Visit *ShowRes_PushOne `protobuf:"bytes,4,opt,name=visit,proto3" json:"visit,omitempty"` //访问提醒 +} + +func (x *ShowRes_Push) Reset() { + *x = ShowRes_Push{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[286] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Push) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Push) ProtoMessage() {} + +func (x *ShowRes_Push) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[286] + 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 ShowRes_Push.ProtoReflect.Descriptor instead. +func (*ShowRes_Push) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 63} +} + +func (x *ShowRes_Push) GetTaskReset() *ShowRes_PushOne { + if x != nil { + return x.TaskReset + } + return nil +} + +func (x *ShowRes_Push) GetActive() *ShowRes_PushOne { + if x != nil { + return x.Active + } + return nil +} + +func (x *ShowRes_Push) GetOffline() *ShowRes_PushOne { + if x != nil { + return x.Offline + } + return nil +} + +func (x *ShowRes_Push) GetVisit() *ShowRes_PushOne { + if x != nil { + return x.Visit + } + return nil +} + +type ShowRes_PushOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + PushCond []*ShowRes_PushCond `protobuf:"bytes,2,rep,name=push_cond,json=pushCond,proto3" json:"push_cond,omitempty"` //条件内容 +} + +func (x *ShowRes_PushOne) Reset() { + *x = ShowRes_PushOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[287] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_PushOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_PushOne) ProtoMessage() {} + +func (x *ShowRes_PushOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[287] + 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 ShowRes_PushOne.ProtoReflect.Descriptor instead. +func (*ShowRes_PushOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 64} +} + +func (x *ShowRes_PushOne) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRes_PushOne) GetPushCond() []*ShowRes_PushCond { + if x != nil { + return x.PushCond + } + return nil +} + +type ShowRes_PushCond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //条件标识 + Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"` //标识值 +} + +func (x *ShowRes_PushCond) Reset() { + *x = ShowRes_PushCond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[288] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_PushCond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_PushCond) ProtoMessage() {} + +func (x *ShowRes_PushCond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[288] + 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 ShowRes_PushCond.ProtoReflect.Descriptor instead. +func (*ShowRes_PushCond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 65} +} + +func (x *ShowRes_PushCond) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *ShowRes_PushCond) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type ShowRes_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GoldNum int32 `protobuf:"varint,1,opt,name=gold_num,json=goldNum,proto3" json:"gold_num,omitempty"` //任务重置天数 + ExpiredDay int32 `protobuf:"varint,2,opt,name=expired_day,json=expiredDay,proto3" json:"expired_day,omitempty"` //任务重置天数 + Price float64 `protobuf:"fixed64,3,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + PriceNum int32 `protobuf:"varint,4,opt,name=price_num,json=priceNum,proto3" json:"price_num,omitempty"` //奖品总份额 + Currency int32 `protobuf:"varint,5,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 + SpinCash []*ShowRes_SpinCash `protobuf:"bytes,6,rep,name=spin_cash,json=spinCash,proto3" json:"spin_cash,omitempty"` //金额 + Lack int32 `protobuf:"varint,7,opt,name=lack,proto3" json:"lack,omitempty"` //是否缺乏库存(0-否,1-是) +} + +func (x *ShowRes_Gold) Reset() { + *x = ShowRes_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[289] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Gold) ProtoMessage() {} + +func (x *ShowRes_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[289] + 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 ShowRes_Gold.ProtoReflect.Descriptor instead. +func (*ShowRes_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 66} +} + +func (x *ShowRes_Gold) GetGoldNum() int32 { + if x != nil { + return x.GoldNum + } + return 0 +} + +func (x *ShowRes_Gold) GetExpiredDay() int32 { + if x != nil { + return x.ExpiredDay + } + return 0 +} + +func (x *ShowRes_Gold) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *ShowRes_Gold) GetPriceNum() int32 { + if x != nil { + return x.PriceNum + } + return 0 +} + +func (x *ShowRes_Gold) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +func (x *ShowRes_Gold) GetSpinCash() []*ShowRes_SpinCash { + if x != nil { + return x.SpinCash + } + return nil +} + +func (x *ShowRes_Gold) GetLack() int32 { + if x != nil { + return x.Lack + } + return 0 +} + +type ShowRes_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CoinImg string `protobuf:"bytes,1,opt,name=coin_img,json=coinImg,proto3" json:"coin_img,omitempty"` //金币图片 + OpenDays int32 `protobuf:"varint,2,opt,name=open_days,json=openDays,proto3" json:"open_days,omitempty"` //开奖天数 + OpenLimit int32 `protobuf:"varint,3,opt,name=open_limit,json=openLimit,proto3" json:"open_limit,omitempty"` //开奖次数限制 + InitCoin int32 `protobuf:"varint,4,opt,name=init_coin,json=initCoin,proto3" json:"init_coin,omitempty"` //初始金币数 + InitUse int32 `protobuf:"varint,5,opt,name=init_use,json=initUse,proto3" json:"init_use,omitempty"` //初始投放次数 + UseCoin int32 `protobuf:"varint,6,opt,name=use_coin,json=useCoin,proto3" json:"use_coin,omitempty"` //单次投放消耗金币数 + UseLimit int32 `protobuf:"varint,7,opt,name=use_limit,json=useLimit,proto3" json:"use_limit,omitempty"` //单次瓜分最多投放次数 + UrlId int64 `protobuf:"varint,8,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + LackBtn []int32 `protobuf:"varint,9,rep,packed,name=lack_btn,json=lackBtn,proto3" json:"lack_btn,omitempty"` //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2] + CustomBtnText string `protobuf:"bytes,10,opt,name=custom_btn_text,json=customBtnText,proto3" json:"custom_btn_text,omitempty"` //自定义按钮文案 + CustomWebUrl string `protobuf:"bytes,11,opt,name=custom_web_url,json=customWebUrl,proto3" json:"custom_web_url,omitempty"` //自定义web端url + CustomExtraParam string `protobuf:"bytes,12,opt,name=custom_extra_param,json=customExtraParam,proto3" json:"custom_extra_param,omitempty"` //自定义app附加参数 + CustomBtnId int64 `protobuf:"varint,13,opt,name=custom_btn_id,json=customBtnId,proto3" json:"custom_btn_id,omitempty"` //自定义按钮ID + CustomPcParam string `protobuf:"bytes,14,opt,name=custom_pc_param,json=customPcParam,proto3" json:"custom_pc_param,omitempty"` //自定义pc附加参数 +} + +func (x *ShowRes_Coin) Reset() { + *x = ShowRes_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[290] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Coin) ProtoMessage() {} + +func (x *ShowRes_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[290] + 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 ShowRes_Coin.ProtoReflect.Descriptor instead. +func (*ShowRes_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{13, 67} +} + +func (x *ShowRes_Coin) GetCoinImg() string { + if x != nil { + return x.CoinImg + } + return "" +} + +func (x *ShowRes_Coin) GetOpenDays() int32 { + if x != nil { + return x.OpenDays + } + return 0 +} + +func (x *ShowRes_Coin) GetOpenLimit() int32 { + if x != nil { + return x.OpenLimit + } + return 0 +} + +func (x *ShowRes_Coin) GetInitCoin() int32 { + if x != nil { + return x.InitCoin + } + return 0 +} + +func (x *ShowRes_Coin) GetInitUse() int32 { + if x != nil { + return x.InitUse + } + return 0 +} + +func (x *ShowRes_Coin) GetUseCoin() int32 { + if x != nil { + return x.UseCoin + } + return 0 +} + +func (x *ShowRes_Coin) GetUseLimit() int32 { + if x != nil { + return x.UseLimit + } + return 0 +} + +func (x *ShowRes_Coin) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *ShowRes_Coin) GetLackBtn() []int32 { + if x != nil { + return x.LackBtn + } + return nil +} + +func (x *ShowRes_Coin) GetCustomBtnText() string { + if x != nil { + return x.CustomBtnText + } + return "" +} + +func (x *ShowRes_Coin) GetCustomWebUrl() string { + if x != nil { + return x.CustomWebUrl + } + return "" +} + +func (x *ShowRes_Coin) GetCustomExtraParam() string { + if x != nil { + return x.CustomExtraParam + } + return "" +} + +func (x *ShowRes_Coin) GetCustomBtnId() int64 { + if x != nil { + return x.CustomBtnId + } + return 0 +} + +func (x *ShowRes_Coin) GetCustomPcParam() string { + if x != nil { + return x.CustomPcParam + } + return "" +} + +type ChannelListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //渠道id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //渠道标题 + IsDefault int32 `protobuf:"varint,3,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否是默认值(0-否,1-是) + Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` //渠道链接 + Code string `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"` //口令码 +} + +func (x *ChannelListRes_One) Reset() { + *x = ChannelListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[291] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelListRes_One) ProtoMessage() {} + +func (x *ChannelListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[291] + 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 ChannelListRes_One.ProtoReflect.Descriptor instead. +func (*ChannelListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *ChannelListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChannelListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChannelListRes_One) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *ChannelListRes_One) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ChannelListRes_One) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type KvDataRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *KvDataRes_KV) Reset() { + *x = KvDataRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[292] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KvDataRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KvDataRes_KV) ProtoMessage() {} + +func (x *KvDataRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[292] + 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 KvDataRes_KV.ProtoReflect.Descriptor instead. +func (*KvDataRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{23, 0} +} + +func (x *KvDataRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KvDataRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type BarrageRes_TranContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言包标识 + ReplaceKv []*BarrageRes_KV `protobuf:"bytes,2,rep,name=replace_kv,json=replaceKv,proto3" json:"replace_kv,omitempty"` //是否是默认值(0-否,1-是) + RewardImg string `protobuf:"bytes,3,opt,name=reward_img,json=rewardImg,proto3" json:"reward_img,omitempty"` //奖品图片 +} + +func (x *BarrageRes_TranContent) Reset() { + *x = BarrageRes_TranContent{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[293] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BarrageRes_TranContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BarrageRes_TranContent) ProtoMessage() {} + +func (x *BarrageRes_TranContent) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[293] + 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 BarrageRes_TranContent.ProtoReflect.Descriptor instead. +func (*BarrageRes_TranContent) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{27, 0} +} + +func (x *BarrageRes_TranContent) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *BarrageRes_TranContent) GetReplaceKv() []*BarrageRes_KV { + if x != nil { + return x.ReplaceKv + } + return nil +} + +func (x *BarrageRes_TranContent) GetRewardImg() string { + if x != nil { + return x.RewardImg + } + return "" +} + +type BarrageRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //语言包中变量的替换关键字 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //replace的值 +} + +func (x *BarrageRes_KV) Reset() { + *x = BarrageRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[294] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BarrageRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BarrageRes_KV) ProtoMessage() {} + +func (x *BarrageRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[294] + 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 BarrageRes_KV.ProtoReflect.Descriptor instead. +func (*BarrageRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{27, 1} +} + +func (x *BarrageRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *BarrageRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type OptionRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确选项(1-是,0-否) + VoteNum int64 `protobuf:"varint,5,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"` //投票人数 +} + +func (x *OptionRes_Option) Reset() { + *x = OptionRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[295] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionRes_Option) ProtoMessage() {} + +func (x *OptionRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[295] + 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 OptionRes_Option.ProtoReflect.Descriptor instead. +func (*OptionRes_Option) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{29, 0} +} + +func (x *OptionRes_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *OptionRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *OptionRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *OptionRes_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +func (x *OptionRes_Option) GetVoteNum() int64 { + if x != nil { + return x.VoteNum + } + return 0 +} + +type LangsRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //语言配置信息ID + IsDefault bool `protobuf:"varint,2,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认配置语言 + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言对应的唯一标识 + LangType int32 `protobuf:"varint,4,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言数字类型唯一标识 + PageTitle string `protobuf:"bytes,5,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + ImageMain string `protobuf:"bytes,6,opt,name=image_main,json=imageMain,proto3" json:"image_main,omitempty"` //活动主图 + DownloadPageImage string `protobuf:"bytes,7,opt,name=download_page_image,json=downloadPageImage,proto3" json:"download_page_image,omitempty"` //下载引导页的图片 + WechatPageImage string `protobuf:"bytes,8,opt,name=wechat_page_image,json=wechatPageImage,proto3" json:"wechat_page_image,omitempty"` //微信引导页的图片 + ContentImg string `protobuf:"bytes,9,opt,name=content_img,json=contentImg,proto3" json:"content_img,omitempty"` //内容背景图 + WebBgImg string `protobuf:"bytes,10,opt,name=web_bg_img,json=webBgImg,proto3" json:"web_bg_img,omitempty"` //站外背景图地址 + WarmUpImg string `protobuf:"bytes,11,opt,name=warm_up_img,json=warmUpImg,proto3" json:"warm_up_img,omitempty"` //预热海报图 + DlBgImg string `protobuf:"bytes,12,opt,name=dl_bg_img,json=dlBgImg,proto3" json:"dl_bg_img,omitempty"` //引导页背景图 + DlBannerImg string `protobuf:"bytes,13,opt,name=dl_banner_img,json=dlBannerImg,proto3" json:"dl_banner_img,omitempty"` //下载页横幅自定义图 + DlBannerAppLogo string `protobuf:"bytes,14,opt,name=dl_banner_app_logo,json=dlBannerAppLogo,proto3" json:"dl_banner_app_logo,omitempty"` //下载页横幅applogo图片 + DlBannerAppName string `protobuf:"bytes,15,opt,name=dl_banner_app_name,json=dlBannerAppName,proto3" json:"dl_banner_app_name,omitempty"` //下载页横幅app名称 + DlBannerAppBtn string `protobuf:"bytes,16,opt,name=dl_banner_app_btn,json=dlBannerAppBtn,proto3" json:"dl_banner_app_btn,omitempty"` //下载页横幅app按钮文案 + ShareText string `protobuf:"bytes,17,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,18,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //分享图片 + Rule string `protobuf:"bytes,19,opt,name=rule,proto3" json:"rule,omitempty"` //活动规则 + Conds []*LangsRes_Cond `protobuf:"bytes,20,rep,name=conds,proto3" json:"conds,omitempty"` //事件驱动的条件描述 + Quit *LangsRes_Quit `protobuf:"bytes,21,opt,name=quit,proto3" json:"quit,omitempty"` //赛事竞猜选项翻译 + Questions []*LangsRes_Question `protobuf:"bytes,22,rep,name=questions,proto3" json:"questions,omitempty"` //问题翻译 + Wait bool `protobuf:"varint,23,opt,name=wait,proto3" json:"wait,omitempty"` //是否待配置 + Rewards *LangsRes_Rewards `protobuf:"bytes,24,opt,name=rewards,proto3" json:"rewards,omitempty"` //站内奖品 + RewardsWeb []*LangsRes_Reward `protobuf:"bytes,25,rep,name=rewards_web,json=rewardsWeb,proto3" json:"rewards_web,omitempty"` //站外奖品 + RewardsExtra []*LangsRes_Reward `protobuf:"bytes,26,rep,name=rewards_extra,json=rewardsExtra,proto3" json:"rewards_extra,omitempty"` //额外奖品 + RewardsNewcomer []*LangsRes_Reward `protobuf:"bytes,27,rep,name=rewards_newcomer,json=rewardsNewcomer,proto3" json:"rewards_newcomer,omitempty"` //新人奖 + LongImgs []*LangsRes_LongImg `protobuf:"bytes,28,rep,name=long_imgs,json=longImgs,proto3" json:"long_imgs,omitempty"` //长图配置 + Cash *LangsRes_Cash `protobuf:"bytes,29,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖配置 + TOffset int32 `protobuf:"varint,30,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区偏移值 + TStart int64 `protobuf:"varint,31,opt,name=t_start,json=tStart,proto3" json:"t_start,omitempty"` //开始时间 + TEnd int64 `protobuf:"varint,32,opt,name=t_end,json=tEnd,proto3" json:"t_end,omitempty"` //结束时间 + QaGroup *LangsRes_QaGroup `protobuf:"bytes,33,opt,name=qa_group,json=qaGroup,proto3" json:"qa_group,omitempty"` //题库数据 + TalkText []*LangsRes_Talk `protobuf:"bytes,34,rep,name=talk_text,json=talkText,proto3" json:"talk_text,omitempty"` //对话文案 + Gold *LangsRes_Gold `protobuf:"bytes,35,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务配置 + Coin *LangsRes_Coin `protobuf:"bytes,36,opt,name=coin,proto3" json:"coin,omitempty"` //金币池配置 + TopicColor string `protobuf:"bytes,37,opt,name=topic_color,json=topicColor,proto3" json:"topic_color,omitempty"` //主题色 + PcBg string `protobuf:"bytes,38,opt,name=pc_bg,json=pcBg,proto3" json:"pc_bg,omitempty"` //pc背景 + RuleImg string `protobuf:"bytes,39,opt,name=rule_img,json=ruleImg,proto3" json:"rule_img,omitempty"` //规则展示图 + Schedules []*LangsRes_Schedule `protobuf:"bytes,40,rep,name=schedules,proto3" json:"schedules,omitempty"` //赛事时间表 + Uno *LangsRes_Uno `protobuf:"bytes,41,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌配置 +} + +func (x *LangsRes_Lang) Reset() { + *x = LangsRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[296] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Lang) ProtoMessage() {} + +func (x *LangsRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[296] + 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 LangsRes_Lang.ProtoReflect.Descriptor instead. +func (*LangsRes_Lang) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 0} +} + +func (x *LangsRes_Lang) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *LangsRes_Lang) GetIsDefault() bool { + if x != nil { + return x.IsDefault + } + return false +} + +func (x *LangsRes_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *LangsRes_Lang) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *LangsRes_Lang) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *LangsRes_Lang) GetImageMain() string { + if x != nil { + return x.ImageMain + } + return "" +} + +func (x *LangsRes_Lang) GetDownloadPageImage() string { + if x != nil { + return x.DownloadPageImage + } + return "" +} + +func (x *LangsRes_Lang) GetWechatPageImage() string { + if x != nil { + return x.WechatPageImage + } + return "" +} + +func (x *LangsRes_Lang) GetContentImg() string { + if x != nil { + return x.ContentImg + } + return "" +} + +func (x *LangsRes_Lang) GetWebBgImg() string { + if x != nil { + return x.WebBgImg + } + return "" +} + +func (x *LangsRes_Lang) GetWarmUpImg() string { + if x != nil { + return x.WarmUpImg + } + return "" +} + +func (x *LangsRes_Lang) GetDlBgImg() string { + if x != nil { + return x.DlBgImg + } + return "" +} + +func (x *LangsRes_Lang) GetDlBannerImg() string { + if x != nil { + return x.DlBannerImg + } + return "" +} + +func (x *LangsRes_Lang) GetDlBannerAppLogo() string { + if x != nil { + return x.DlBannerAppLogo + } + return "" +} + +func (x *LangsRes_Lang) GetDlBannerAppName() string { + if x != nil { + return x.DlBannerAppName + } + return "" +} + +func (x *LangsRes_Lang) GetDlBannerAppBtn() string { + if x != nil { + return x.DlBannerAppBtn + } + return "" +} + +func (x *LangsRes_Lang) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *LangsRes_Lang) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +func (x *LangsRes_Lang) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *LangsRes_Lang) GetConds() []*LangsRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +func (x *LangsRes_Lang) GetQuit() *LangsRes_Quit { + if x != nil { + return x.Quit + } + return nil +} + +func (x *LangsRes_Lang) GetQuestions() []*LangsRes_Question { + if x != nil { + return x.Questions + } + return nil +} + +func (x *LangsRes_Lang) GetWait() bool { + if x != nil { + return x.Wait + } + return false +} + +func (x *LangsRes_Lang) GetRewards() *LangsRes_Rewards { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *LangsRes_Lang) GetRewardsWeb() []*LangsRes_Reward { + if x != nil { + return x.RewardsWeb + } + return nil +} + +func (x *LangsRes_Lang) GetRewardsExtra() []*LangsRes_Reward { + if x != nil { + return x.RewardsExtra + } + return nil +} + +func (x *LangsRes_Lang) GetRewardsNewcomer() []*LangsRes_Reward { + if x != nil { + return x.RewardsNewcomer + } + return nil +} + +func (x *LangsRes_Lang) GetLongImgs() []*LangsRes_LongImg { + if x != nil { + return x.LongImgs + } + return nil +} + +func (x *LangsRes_Lang) GetCash() *LangsRes_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *LangsRes_Lang) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *LangsRes_Lang) GetTStart() int64 { + if x != nil { + return x.TStart + } + return 0 +} + +func (x *LangsRes_Lang) GetTEnd() int64 { + if x != nil { + return x.TEnd + } + return 0 +} + +func (x *LangsRes_Lang) GetQaGroup() *LangsRes_QaGroup { + if x != nil { + return x.QaGroup + } + return nil +} + +func (x *LangsRes_Lang) GetTalkText() []*LangsRes_Talk { + if x != nil { + return x.TalkText + } + return nil +} + +func (x *LangsRes_Lang) GetGold() *LangsRes_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *LangsRes_Lang) GetCoin() *LangsRes_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *LangsRes_Lang) GetTopicColor() string { + if x != nil { + return x.TopicColor + } + return "" +} + +func (x *LangsRes_Lang) GetPcBg() string { + if x != nil { + return x.PcBg + } + return "" +} + +func (x *LangsRes_Lang) GetRuleImg() string { + if x != nil { + return x.RuleImg + } + return "" +} + +func (x *LangsRes_Lang) GetSchedules() []*LangsRes_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *LangsRes_Lang) GetUno() *LangsRes_Uno { + if x != nil { + return x.Uno + } + return nil +} + +type LangsRes_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Red []*LangsRes_UnoCard `protobuf:"bytes,1,rep,name=red,proto3" json:"red,omitempty"` //红牌配置 + Yellow []*LangsRes_UnoCard `protobuf:"bytes,2,rep,name=yellow,proto3" json:"yellow,omitempty"` //黄牌配置 + Blue []*LangsRes_UnoCard `protobuf:"bytes,3,rep,name=blue,proto3" json:"blue,omitempty"` //黑牌配置 + Green []*LangsRes_UnoCard `protobuf:"bytes,4,rep,name=green,proto3" json:"green,omitempty"` //绿牌配置 +} + +func (x *LangsRes_Uno) Reset() { + *x = LangsRes_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[297] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Uno) ProtoMessage() {} + +func (x *LangsRes_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[297] + 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 LangsRes_Uno.ProtoReflect.Descriptor instead. +func (*LangsRes_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 1} +} + +func (x *LangsRes_Uno) GetRed() []*LangsRes_UnoCard { + if x != nil { + return x.Red + } + return nil +} + +func (x *LangsRes_Uno) GetYellow() []*LangsRes_UnoCard { + if x != nil { + return x.Yellow + } + return nil +} + +func (x *LangsRes_Uno) GetBlue() []*LangsRes_UnoCard { + if x != nil { + return x.Blue + } + return nil +} + +func (x *LangsRes_Uno) GetGreen() []*LangsRes_UnoCard { + if x != nil { + return x.Green + } + return nil +} + +type LangsRes_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //牌id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //跳转按钮文案 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web跳转地址 + AppParam string `protobuf:"bytes,5,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App跳转参数 + PcParam string `protobuf:"bytes,6,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc跳转参数 +} + +func (x *LangsRes_UnoCard) Reset() { + *x = LangsRes_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[298] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_UnoCard) ProtoMessage() {} + +func (x *LangsRes_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[298] + 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 LangsRes_UnoCard.ProtoReflect.Descriptor instead. +func (*LangsRes_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 2} +} + +func (x *LangsRes_UnoCard) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangsRes_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes_UnoCard) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *LangsRes_UnoCard) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangsRes_UnoCard) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LangsRes_UnoCard) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type LangsRes_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + PkTeams []*LangsRes_PkTeam `protobuf:"bytes,2,rep,name=pk_teams,json=pkTeams,proto3" json:"pk_teams,omitempty"` //队伍 +} + +func (x *LangsRes_Schedule) Reset() { + *x = LangsRes_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[299] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Schedule) ProtoMessage() {} + +func (x *LangsRes_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[299] + 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 LangsRes_Schedule.ProtoReflect.Descriptor instead. +func (*LangsRes_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 3} +} + +func (x *LangsRes_Schedule) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangsRes_Schedule) GetPkTeams() []*LangsRes_PkTeam { + if x != nil { + return x.PkTeams + } + return nil +} + +type LangsRes_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Teams []*LangsRes_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + VsImg string `protobuf:"bytes,3,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //比赛图 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //标题描述 +} + +func (x *LangsRes_PkTeam) Reset() { + *x = LangsRes_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[300] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_PkTeam) ProtoMessage() {} + +func (x *LangsRes_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[300] + 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 LangsRes_PkTeam.ProtoReflect.Descriptor instead. +func (*LangsRes_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 4} +} + +func (x *LangsRes_PkTeam) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangsRes_PkTeam) GetTeams() []*LangsRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *LangsRes_PkTeam) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *LangsRes_PkTeam) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type LangsRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *LangsRes_Team) Reset() { + *x = LangsRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[301] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Team) ProtoMessage() {} + +func (x *LangsRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[301] + 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 LangsRes_Team.ProtoReflect.Descriptor instead. +func (*LangsRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 5} +} + +func (x *LangsRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangsRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LangsRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type LangsRes_QaGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QaGroupId string `protobuf:"bytes,1,opt,name=qa_group_id,json=qaGroupId,proto3" json:"qa_group_id,omitempty"` //题库hash_id + QaNum int32 `protobuf:"varint,2,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题库选取数量 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //题库标题 + OpenGuide int32 `protobuf:"varint,4,opt,name=open_guide,json=openGuide,proto3" json:"open_guide,omitempty"` //是否开启引导(0-否,1-是) + GuideGroupId string `protobuf:"bytes,5,opt,name=guide_group_id,json=guideGroupId,proto3" json:"guide_group_id,omitempty"` //引导组hash_id +} + +func (x *LangsRes_QaGroup) Reset() { + *x = LangsRes_QaGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[302] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_QaGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_QaGroup) ProtoMessage() {} + +func (x *LangsRes_QaGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[302] + 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 LangsRes_QaGroup.ProtoReflect.Descriptor instead. +func (*LangsRes_QaGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 6} +} + +func (x *LangsRes_QaGroup) GetQaGroupId() string { + if x != nil { + return x.QaGroupId + } + return "" +} + +func (x *LangsRes_QaGroup) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *LangsRes_QaGroup) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes_QaGroup) GetOpenGuide() int32 { + if x != nil { + return x.OpenGuide + } + return 0 +} + +func (x *LangsRes_QaGroup) GetGuideGroupId() string { + if x != nil { + return x.GuideGroupId + } + return "" +} + +type LangsRes_Talk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextType int32 `protobuf:"varint,1,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 +} + +func (x *LangsRes_Talk) Reset() { + *x = LangsRes_Talk{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[303] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Talk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Talk) ProtoMessage() {} + +func (x *LangsRes_Talk) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[303] + 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 LangsRes_Talk.ProtoReflect.Descriptor instead. +func (*LangsRes_Talk) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 7} +} + +func (x *LangsRes_Talk) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *LangsRes_Talk) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type LangsRes_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Price int32 `protobuf:"varint,1,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + Currency int32 `protobuf:"varint,2,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *LangsRes_Cash) Reset() { + *x = LangsRes_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[304] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Cash) ProtoMessage() {} + +func (x *LangsRes_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[304] + 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 LangsRes_Cash.ProtoReflect.Descriptor instead. +func (*LangsRes_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 8} +} + +func (x *LangsRes_Cash) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *LangsRes_Cash) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type LangsRes_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Price float64 `protobuf:"fixed64,1,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + Currency int32 `protobuf:"varint,2,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *LangsRes_Gold) Reset() { + *x = LangsRes_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[305] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Gold) ProtoMessage() {} + +func (x *LangsRes_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[305] + 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 LangsRes_Gold.ProtoReflect.Descriptor instead. +func (*LangsRes_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 9} +} + +func (x *LangsRes_Gold) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *LangsRes_Gold) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type LangsRes_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CustomBtnText string `protobuf:"bytes,1,opt,name=custom_btn_text,json=customBtnText,proto3" json:"custom_btn_text,omitempty"` //自定义按钮文案 + CustomWebUrl string `protobuf:"bytes,2,opt,name=custom_web_url,json=customWebUrl,proto3" json:"custom_web_url,omitempty"` //自定义web端url + CustomExtraParam string `protobuf:"bytes,3,opt,name=custom_extra_param,json=customExtraParam,proto3" json:"custom_extra_param,omitempty"` //自定义app附加参数 + CustomPcParam string `protobuf:"bytes,4,opt,name=custom_pc_param,json=customPcParam,proto3" json:"custom_pc_param,omitempty"` //自定义pc附加参数 +} + +func (x *LangsRes_Coin) Reset() { + *x = LangsRes_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[306] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Coin) ProtoMessage() {} + +func (x *LangsRes_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[306] + 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 LangsRes_Coin.ProtoReflect.Descriptor instead. +func (*LangsRes_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 10} +} + +func (x *LangsRes_Coin) GetCustomBtnText() string { + if x != nil { + return x.CustomBtnText + } + return "" +} + +func (x *LangsRes_Coin) GetCustomWebUrl() string { + if x != nil { + return x.CustomWebUrl + } + return "" +} + +func (x *LangsRes_Coin) GetCustomExtraParam() string { + if x != nil { + return x.CustomExtraParam + } + return "" +} + +func (x *LangsRes_Coin) GetCustomPcParam() string { + if x != nil { + return x.CustomPcParam + } + return "" +} + +type LangsRes_LongImg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImgUrl string `protobuf:"bytes,1,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //长图id + ClickType int32 `protobuf:"varint,5,opt,name=click_type,json=clickType,proto3" json:"click_type,omitempty"` //点击类型(1-整图点击,2-区域点击) + HotZone []*LangsRes_HotZone `protobuf:"bytes,6,rep,name=hot_zone,json=hotZone,proto3" json:"hot_zone,omitempty"` //点击区域 + TargetType int32 `protobuf:"varint,7,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,8,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + LangSourceId int64 `protobuf:"varint,10,opt,name=lang_source_id,json=langSourceId,proto3" json:"lang_source_id,omitempty"` //语言长图源ID +} + +func (x *LangsRes_LongImg) Reset() { + *x = LangsRes_LongImg{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[307] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_LongImg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_LongImg) ProtoMessage() {} + +func (x *LangsRes_LongImg) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[307] + 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 LangsRes_LongImg.ProtoReflect.Descriptor instead. +func (*LangsRes_LongImg) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 11} +} + +func (x *LangsRes_LongImg) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *LangsRes_LongImg) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangsRes_LongImg) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LangsRes_LongImg) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangsRes_LongImg) GetClickType() int32 { + if x != nil { + return x.ClickType + } + return 0 +} + +func (x *LangsRes_LongImg) GetHotZone() []*LangsRes_HotZone { + if x != nil { + return x.HotZone + } + return nil +} + +func (x *LangsRes_LongImg) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *LangsRes_LongImg) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *LangsRes_LongImg) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *LangsRes_LongImg) GetLangSourceId() int64 { + if x != nil { + return x.LangSourceId + } + return 0 +} + +type LangsRes_HotZone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //热区id + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickX float64 `protobuf:"fixed64,4,opt,name=click_x,json=clickX,proto3" json:"click_x,omitempty"` //点击区域x + ClickY float64 `protobuf:"fixed64,5,opt,name=click_y,json=clickY,proto3" json:"click_y,omitempty"` //点击区域y + ClickW float64 `protobuf:"fixed64,6,opt,name=click_w,json=clickW,proto3" json:"click_w,omitempty"` //点击区域w + ClickH float64 `protobuf:"fixed64,7,opt,name=click_h,json=clickH,proto3" json:"click_h,omitempty"` //点击区域h + TargetType int32 `protobuf:"varint,8,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,9,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,10,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *LangsRes_HotZone) Reset() { + *x = LangsRes_HotZone{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[308] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_HotZone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_HotZone) ProtoMessage() {} + +func (x *LangsRes_HotZone) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[308] + 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 LangsRes_HotZone.ProtoReflect.Descriptor instead. +func (*LangsRes_HotZone) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 12} +} + +func (x *LangsRes_HotZone) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangsRes_HotZone) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangsRes_HotZone) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LangsRes_HotZone) GetClickX() float64 { + if x != nil { + return x.ClickX + } + return 0 +} + +func (x *LangsRes_HotZone) GetClickY() float64 { + if x != nil { + return x.ClickY + } + return 0 +} + +func (x *LangsRes_HotZone) GetClickW() float64 { + if x != nil { + return x.ClickW + } + return 0 +} + +func (x *LangsRes_HotZone) GetClickH() float64 { + if x != nil { + return x.ClickH + } + return 0 +} + +func (x *LangsRes_HotZone) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *LangsRes_HotZone) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *LangsRes_HotZone) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type LangsRes_Rewards struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Normal []*LangsRes_Reward `protobuf:"bytes,1,rep,name=normal,proto3" json:"normal,omitempty"` //常规奖品 + UserLevel []*LangsRes_UserLevelOne `protobuf:"bytes,2,rep,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` //用户类型奖品 + Langs []*LangsRes_Reward `protobuf:"bytes,3,rep,name=langs,proto3" json:"langs,omitempty"` //语言奖品 + LangUserLevel []*LangsRes_UserLevelOne `protobuf:"bytes,4,rep,name=lang_user_level,json=langUserLevel,proto3" json:"lang_user_level,omitempty"` //语言+用户类型奖品 + Country []*LangsRes_CountryOne `protobuf:"bytes,5,rep,name=country,proto3" json:"country,omitempty"` //国家奖品 +} + +func (x *LangsRes_Rewards) Reset() { + *x = LangsRes_Rewards{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[309] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Rewards) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Rewards) ProtoMessage() {} + +func (x *LangsRes_Rewards) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[309] + 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 LangsRes_Rewards.ProtoReflect.Descriptor instead. +func (*LangsRes_Rewards) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 13} +} + +func (x *LangsRes_Rewards) GetNormal() []*LangsRes_Reward { + if x != nil { + return x.Normal + } + return nil +} + +func (x *LangsRes_Rewards) GetUserLevel() []*LangsRes_UserLevelOne { + if x != nil { + return x.UserLevel + } + return nil +} + +func (x *LangsRes_Rewards) GetLangs() []*LangsRes_Reward { + if x != nil { + return x.Langs + } + return nil +} + +func (x *LangsRes_Rewards) GetLangUserLevel() []*LangsRes_UserLevelOne { + if x != nil { + return x.LangUserLevel + } + return nil +} + +func (x *LangsRes_Rewards) GetCountry() []*LangsRes_CountryOne { + if x != nil { + return x.Country + } + return nil +} + +type LangsRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + FindDefault bool `protobuf:"varint,4,opt,name=find_default,json=findDefault,proto3" json:"find_default,omitempty"` //是否只能显示默认奖品 +} + +func (x *LangsRes_Reward) Reset() { + *x = LangsRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[310] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Reward) ProtoMessage() {} + +func (x *LangsRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[310] + 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 LangsRes_Reward.ProtoReflect.Descriptor instead. +func (*LangsRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 14} +} + +func (x *LangsRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *LangsRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *LangsRes_Reward) GetFindDefault() bool { + if x != nil { + return x.FindDefault + } + return false +} + +type LangsRes_UserLevelOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LevelId int64 `protobuf:"varint,1,opt,name=level_id,json=levelId,proto3" json:"level_id,omitempty"` //用户类型id + LevelTitle string `protobuf:"bytes,2,opt,name=level_title,json=levelTitle,proto3" json:"level_title,omitempty"` //用户等级名称 + Rewards []*LangsRes_Reward `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *LangsRes_UserLevelOne) Reset() { + *x = LangsRes_UserLevelOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[311] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_UserLevelOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_UserLevelOne) ProtoMessage() {} + +func (x *LangsRes_UserLevelOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[311] + 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 LangsRes_UserLevelOne.ProtoReflect.Descriptor instead. +func (*LangsRes_UserLevelOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 15} +} + +func (x *LangsRes_UserLevelOne) GetLevelId() int64 { + if x != nil { + return x.LevelId + } + return 0 +} + +func (x *LangsRes_UserLevelOne) GetLevelTitle() string { + if x != nil { + return x.LevelTitle + } + return "" +} + +func (x *LangsRes_UserLevelOne) GetRewards() []*LangsRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type LangsRes_CountryOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CountryMark string `protobuf:"bytes,1,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家类型标识 + Rewards []*LangsRes_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *LangsRes_CountryOne) Reset() { + *x = LangsRes_CountryOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[312] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_CountryOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_CountryOne) ProtoMessage() {} + +func (x *LangsRes_CountryOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[312] + 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 LangsRes_CountryOne.ProtoReflect.Descriptor instead. +func (*LangsRes_CountryOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 16} +} + +func (x *LangsRes_CountryOne) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *LangsRes_CountryOne) GetRewards() []*LangsRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type LangsRes_Quit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //标题 + Options []*LangsRes_Option `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` //选项集合 +} + +func (x *LangsRes_Quit) Reset() { + *x = LangsRes_Quit{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[313] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Quit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Quit) ProtoMessage() {} + +func (x *LangsRes_Quit) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[313] + 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 LangsRes_Quit.ProtoReflect.Descriptor instead. +func (*LangsRes_Quit) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 17} +} + +func (x *LangsRes_Quit) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes_Quit) GetOptions() []*LangsRes_Option { + if x != nil { + return x.Options + } + return nil +} + +type LangsRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OptionId int64 `protobuf:"varint,1,opt,name=option_id,json=optionId,proto3" json:"option_id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 +} + +func (x *LangsRes_Option) Reset() { + *x = LangsRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[314] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Option) ProtoMessage() {} + +func (x *LangsRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[314] + 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 LangsRes_Option.ProtoReflect.Descriptor instead. +func (*LangsRes_Option) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 18} +} + +func (x *LangsRes_Option) GetOptionId() int64 { + if x != nil { + return x.OptionId + } + return 0 +} + +func (x *LangsRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type LangsRes_Question struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QaId int64 `protobuf:"varint,1,opt,name=qa_id,json=qaId,proto3" json:"qa_id,omitempty"` //问题id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //题目 + Options []*LangsRes_Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` //选项集合 +} + +func (x *LangsRes_Question) Reset() { + *x = LangsRes_Question{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[315] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Question) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Question) ProtoMessage() {} + +func (x *LangsRes_Question) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[315] + 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 LangsRes_Question.ProtoReflect.Descriptor instead. +func (*LangsRes_Question) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 19} +} + +func (x *LangsRes_Question) GetQaId() int64 { + if x != nil { + return x.QaId + } + return 0 +} + +func (x *LangsRes_Question) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangsRes_Question) GetOptions() []*LangsRes_Option { + if x != nil { + return x.Options + } + return nil +} + +type LangsRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CondId int64 `protobuf:"varint,1,opt,name=cond_id,json=condId,proto3" json:"cond_id,omitempty"` //条件id + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //对应的语言描述 + OpenJump int32 `protobuf:"varint,3,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,5,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + PcParam string `protobuf:"bytes,6,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 + GoText string `protobuf:"bytes,7,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 +} + +func (x *LangsRes_Cond) Reset() { + *x = LangsRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[316] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangsRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangsRes_Cond) ProtoMessage() {} + +func (x *LangsRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[316] + 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 LangsRes_Cond.ProtoReflect.Descriptor instead. +func (*LangsRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{35, 20} +} + +func (x *LangsRes_Cond) GetCondId() int64 { + if x != nil { + return x.CondId + } + return 0 +} + +func (x *LangsRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *LangsRes_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *LangsRes_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangsRes_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *LangsRes_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *LangsRes_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +type LangRes_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Red []*LangRes_UnoCard `protobuf:"bytes,1,rep,name=red,proto3" json:"red,omitempty"` //红牌配置 + Yellow []*LangRes_UnoCard `protobuf:"bytes,2,rep,name=yellow,proto3" json:"yellow,omitempty"` //黄牌配置 + Blue []*LangRes_UnoCard `protobuf:"bytes,3,rep,name=blue,proto3" json:"blue,omitempty"` //黑牌配置 + Green []*LangRes_UnoCard `protobuf:"bytes,4,rep,name=green,proto3" json:"green,omitempty"` //绿牌配置 +} + +func (x *LangRes_Uno) Reset() { + *x = LangRes_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[317] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Uno) ProtoMessage() {} + +func (x *LangRes_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[317] + 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 LangRes_Uno.ProtoReflect.Descriptor instead. +func (*LangRes_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 0} +} + +func (x *LangRes_Uno) GetRed() []*LangRes_UnoCard { + if x != nil { + return x.Red + } + return nil +} + +func (x *LangRes_Uno) GetYellow() []*LangRes_UnoCard { + if x != nil { + return x.Yellow + } + return nil +} + +func (x *LangRes_Uno) GetBlue() []*LangRes_UnoCard { + if x != nil { + return x.Blue + } + return nil +} + +func (x *LangRes_Uno) GetGreen() []*LangRes_UnoCard { + if x != nil { + return x.Green + } + return nil +} + +type LangRes_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CardNo int32 `protobuf:"varint,1,opt,name=card_no,json=cardNo,proto3" json:"card_no,omitempty"` //牌号 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //跳转按钮文案 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web跳转地址 + AppParam string `protobuf:"bytes,5,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App跳转参数 + PcParam string `protobuf:"bytes,6,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc跳转参数 +} + +func (x *LangRes_UnoCard) Reset() { + *x = LangRes_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[318] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_UnoCard) ProtoMessage() {} + +func (x *LangRes_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[318] + 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 LangRes_UnoCard.ProtoReflect.Descriptor instead. +func (*LangRes_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 1} +} + +func (x *LangRes_UnoCard) GetCardNo() int32 { + if x != nil { + return x.CardNo + } + return 0 +} + +func (x *LangRes_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangRes_UnoCard) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *LangRes_UnoCard) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangRes_UnoCard) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LangRes_UnoCard) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type LangRes_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + PkTeams []*LangRes_PkTeam `protobuf:"bytes,2,rep,name=pk_teams,json=pkTeams,proto3" json:"pk_teams,omitempty"` //队伍 +} + +func (x *LangRes_Schedule) Reset() { + *x = LangRes_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[319] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Schedule) ProtoMessage() {} + +func (x *LangRes_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[319] + 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 LangRes_Schedule.ProtoReflect.Descriptor instead. +func (*LangRes_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 2} +} + +func (x *LangRes_Schedule) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangRes_Schedule) GetPkTeams() []*LangRes_PkTeam { + if x != nil { + return x.PkTeams + } + return nil +} + +type LangRes_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Teams []*LangRes_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + VsImg string `protobuf:"bytes,3,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //比赛图 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //标题描述 +} + +func (x *LangRes_PkTeam) Reset() { + *x = LangRes_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[320] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_PkTeam) ProtoMessage() {} + +func (x *LangRes_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[320] + 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 LangRes_PkTeam.ProtoReflect.Descriptor instead. +func (*LangRes_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 3} +} + +func (x *LangRes_PkTeam) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangRes_PkTeam) GetTeams() []*LangRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *LangRes_PkTeam) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *LangRes_PkTeam) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type LangRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *LangRes_Team) Reset() { + *x = LangRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[321] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Team) ProtoMessage() {} + +func (x *LangRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[321] + 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 LangRes_Team.ProtoReflect.Descriptor instead. +func (*LangRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 4} +} + +func (x *LangRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LangRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type LangRes_Talk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextType int32 `protobuf:"varint,1,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 +} + +func (x *LangRes_Talk) Reset() { + *x = LangRes_Talk{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[322] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Talk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Talk) ProtoMessage() {} + +func (x *LangRes_Talk) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[322] + 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 LangRes_Talk.ProtoReflect.Descriptor instead. +func (*LangRes_Talk) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 5} +} + +func (x *LangRes_Talk) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *LangRes_Talk) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type LangRes_QaGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QaGroupId string `protobuf:"bytes,1,opt,name=qa_group_id,json=qaGroupId,proto3" json:"qa_group_id,omitempty"` //题库hash_id + QaNum int32 `protobuf:"varint,2,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题库选取数量 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //题库标题 + GuideGroupId string `protobuf:"bytes,4,opt,name=guide_group_id,json=guideGroupId,proto3" json:"guide_group_id,omitempty"` //引导组hash_id +} + +func (x *LangRes_QaGroup) Reset() { + *x = LangRes_QaGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[323] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_QaGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_QaGroup) ProtoMessage() {} + +func (x *LangRes_QaGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[323] + 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 LangRes_QaGroup.ProtoReflect.Descriptor instead. +func (*LangRes_QaGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 6} +} + +func (x *LangRes_QaGroup) GetQaGroupId() string { + if x != nil { + return x.QaGroupId + } + return "" +} + +func (x *LangRes_QaGroup) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *LangRes_QaGroup) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangRes_QaGroup) GetGuideGroupId() string { + if x != nil { + return x.GuideGroupId + } + return "" +} + +type LangRes_Quit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //标题 + Options []*LangRes_Option `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` //选项集合 +} + +func (x *LangRes_Quit) Reset() { + *x = LangRes_Quit{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[324] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Quit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Quit) ProtoMessage() {} + +func (x *LangRes_Quit) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[324] + 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 LangRes_Quit.ProtoReflect.Descriptor instead. +func (*LangRes_Quit) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 7} +} + +func (x *LangRes_Quit) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangRes_Quit) GetOptions() []*LangRes_Option { + if x != nil { + return x.Options + } + return nil +} + +type LangRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OptionId int64 `protobuf:"varint,1,opt,name=option_id,json=optionId,proto3" json:"option_id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 +} + +func (x *LangRes_Option) Reset() { + *x = LangRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[325] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Option) ProtoMessage() {} + +func (x *LangRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[325] + 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 LangRes_Option.ProtoReflect.Descriptor instead. +func (*LangRes_Option) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 8} +} + +func (x *LangRes_Option) GetOptionId() int64 { + if x != nil { + return x.OptionId + } + return 0 +} + +func (x *LangRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type LangRes_Question struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QaId int64 `protobuf:"varint,1,opt,name=qa_id,json=qaId,proto3" json:"qa_id,omitempty"` //问题id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //题目 + Options []*LangRes_Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` //选项集合 +} + +func (x *LangRes_Question) Reset() { + *x = LangRes_Question{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[326] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Question) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Question) ProtoMessage() {} + +func (x *LangRes_Question) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[326] + 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 LangRes_Question.ProtoReflect.Descriptor instead. +func (*LangRes_Question) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 9} +} + +func (x *LangRes_Question) GetQaId() int64 { + if x != nil { + return x.QaId + } + return 0 +} + +func (x *LangRes_Question) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LangRes_Question) GetOptions() []*LangRes_Option { + if x != nil { + return x.Options + } + return nil +} + +type LangRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CondId int64 `protobuf:"varint,1,opt,name=cond_id,json=condId,proto3" json:"cond_id,omitempty"` //条件id + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //对应的语言描述 + WebUrl string `protobuf:"bytes,3,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,4,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + PcParam string `protobuf:"bytes,5,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 + GoText string `protobuf:"bytes,6,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 +} + +func (x *LangRes_Cond) Reset() { + *x = LangRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[327] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Cond) ProtoMessage() {} + +func (x *LangRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[327] + 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 LangRes_Cond.ProtoReflect.Descriptor instead. +func (*LangRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 10} +} + +func (x *LangRes_Cond) GetCondId() int64 { + if x != nil { + return x.CondId + } + return 0 +} + +func (x *LangRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *LangRes_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangRes_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *LangRes_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *LangRes_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +type LangRes_LongImg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImgUrl string `protobuf:"bytes,1,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //长图id + ClickType int32 `protobuf:"varint,5,opt,name=click_type,json=clickType,proto3" json:"click_type,omitempty"` //点击类型(1-整图点击,2-区域点击) + HotZone []*LangRes_HotZone `protobuf:"bytes,6,rep,name=hot_zone,json=hotZone,proto3" json:"hot_zone,omitempty"` //点击区域 + TargetType int32 `protobuf:"varint,7,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,8,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + TargetUrl string `protobuf:"bytes,9,opt,name=target_url,json=targetUrl,proto3" json:"target_url,omitempty"` //目标地址 + PcParam string `protobuf:"bytes,10,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *LangRes_LongImg) Reset() { + *x = LangRes_LongImg{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[328] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_LongImg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_LongImg) ProtoMessage() {} + +func (x *LangRes_LongImg) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[328] + 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 LangRes_LongImg.ProtoReflect.Descriptor instead. +func (*LangRes_LongImg) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 11} +} + +func (x *LangRes_LongImg) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *LangRes_LongImg) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangRes_LongImg) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LangRes_LongImg) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangRes_LongImg) GetClickType() int32 { + if x != nil { + return x.ClickType + } + return 0 +} + +func (x *LangRes_LongImg) GetHotZone() []*LangRes_HotZone { + if x != nil { + return x.HotZone + } + return nil +} + +func (x *LangRes_LongImg) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *LangRes_LongImg) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *LangRes_LongImg) GetTargetUrl() string { + if x != nil { + return x.TargetUrl + } + return "" +} + +func (x *LangRes_LongImg) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type LangRes_HotZone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //热区id + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickX float64 `protobuf:"fixed64,4,opt,name=click_x,json=clickX,proto3" json:"click_x,omitempty"` //点击区域x + ClickY float64 `protobuf:"fixed64,5,opt,name=click_y,json=clickY,proto3" json:"click_y,omitempty"` //点击区域y + ClickW float64 `protobuf:"fixed64,6,opt,name=click_w,json=clickW,proto3" json:"click_w,omitempty"` //点击区域w + ClickH float64 `protobuf:"fixed64,7,opt,name=click_h,json=clickH,proto3" json:"click_h,omitempty"` //点击区域h + TargetType int32 `protobuf:"varint,8,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,9,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + TargetUrl string `protobuf:"bytes,10,opt,name=target_url,json=targetUrl,proto3" json:"target_url,omitempty"` //目标地址 + PcParam string `protobuf:"bytes,11,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *LangRes_HotZone) Reset() { + *x = LangRes_HotZone{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[329] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_HotZone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_HotZone) ProtoMessage() {} + +func (x *LangRes_HotZone) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[329] + 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 LangRes_HotZone.ProtoReflect.Descriptor instead. +func (*LangRes_HotZone) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 12} +} + +func (x *LangRes_HotZone) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LangRes_HotZone) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LangRes_HotZone) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LangRes_HotZone) GetClickX() float64 { + if x != nil { + return x.ClickX + } + return 0 +} + +func (x *LangRes_HotZone) GetClickY() float64 { + if x != nil { + return x.ClickY + } + return 0 +} + +func (x *LangRes_HotZone) GetClickW() float64 { + if x != nil { + return x.ClickW + } + return 0 +} + +func (x *LangRes_HotZone) GetClickH() float64 { + if x != nil { + return x.ClickH + } + return 0 +} + +func (x *LangRes_HotZone) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *LangRes_HotZone) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *LangRes_HotZone) GetTargetUrl() string { + if x != nil { + return x.TargetUrl + } + return "" +} + +func (x *LangRes_HotZone) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type LangRes_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Price int32 `protobuf:"varint,1,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + Currency int32 `protobuf:"varint,2,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *LangRes_Cash) Reset() { + *x = LangRes_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[330] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Cash) ProtoMessage() {} + +func (x *LangRes_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[330] + 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 LangRes_Cash.ProtoReflect.Descriptor instead. +func (*LangRes_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 13} +} + +func (x *LangRes_Cash) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *LangRes_Cash) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type LangRes_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Price float64 `protobuf:"fixed64,1,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + Currency int32 `protobuf:"varint,2,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *LangRes_Gold) Reset() { + *x = LangRes_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[331] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Gold) ProtoMessage() {} + +func (x *LangRes_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[331] + 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 LangRes_Gold.ProtoReflect.Descriptor instead. +func (*LangRes_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 14} +} + +func (x *LangRes_Gold) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *LangRes_Gold) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type LangRes_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CustomBtnText string `protobuf:"bytes,1,opt,name=custom_btn_text,json=customBtnText,proto3" json:"custom_btn_text,omitempty"` //自定义按钮文案 + CustomWebUrl string `protobuf:"bytes,2,opt,name=custom_web_url,json=customWebUrl,proto3" json:"custom_web_url,omitempty"` //自定义web端url + CustomExtraParam string `protobuf:"bytes,3,opt,name=custom_extra_param,json=customExtraParam,proto3" json:"custom_extra_param,omitempty"` //自定义app附加参数 + CustomPcParam string `protobuf:"bytes,4,opt,name=custom_pc_param,json=customPcParam,proto3" json:"custom_pc_param,omitempty"` //自定义pc附加参数 +} + +func (x *LangRes_Coin) Reset() { + *x = LangRes_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[332] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangRes_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangRes_Coin) ProtoMessage() {} + +func (x *LangRes_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[332] + 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 LangRes_Coin.ProtoReflect.Descriptor instead. +func (*LangRes_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{37, 15} +} + +func (x *LangRes_Coin) GetCustomBtnText() string { + if x != nil { + return x.CustomBtnText + } + return "" +} + +func (x *LangRes_Coin) GetCustomWebUrl() string { + if x != nil { + return x.CustomWebUrl + } + return "" +} + +func (x *LangRes_Coin) GetCustomExtraParam() string { + if x != nil { + return x.CustomExtraParam + } + return "" +} + +func (x *LangRes_Coin) GetCustomPcParam() string { + if x != nil { + return x.CustomPcParam + } + return "" +} + +type SaveLangReq_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Red []*SaveLangReq_UnoCard `protobuf:"bytes,1,rep,name=red,proto3" json:"red,omitempty"` //红牌配置 + Yellow []*SaveLangReq_UnoCard `protobuf:"bytes,2,rep,name=yellow,proto3" json:"yellow,omitempty"` //黄牌配置 + Blue []*SaveLangReq_UnoCard `protobuf:"bytes,3,rep,name=blue,proto3" json:"blue,omitempty"` //黑牌配置 + Green []*SaveLangReq_UnoCard `protobuf:"bytes,4,rep,name=green,proto3" json:"green,omitempty"` //绿牌配置 +} + +func (x *SaveLangReq_Uno) Reset() { + *x = SaveLangReq_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[333] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Uno) ProtoMessage() {} + +func (x *SaveLangReq_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[333] + 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 SaveLangReq_Uno.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 0} +} + +func (x *SaveLangReq_Uno) GetRed() []*SaveLangReq_UnoCard { + if x != nil { + return x.Red + } + return nil +} + +func (x *SaveLangReq_Uno) GetYellow() []*SaveLangReq_UnoCard { + if x != nil { + return x.Yellow + } + return nil +} + +func (x *SaveLangReq_Uno) GetBlue() []*SaveLangReq_UnoCard { + if x != nil { + return x.Blue + } + return nil +} + +func (x *SaveLangReq_Uno) GetGreen() []*SaveLangReq_UnoCard { + if x != nil { + return x.Green + } + return nil +} + +type SaveLangReq_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CardNo int32 `protobuf:"varint,1,opt,name=card_no,json=cardNo,proto3" json:"card_no,omitempty"` //牌号 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //跳转按钮文案 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,4,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web跳转地址 + AppParam string `protobuf:"bytes,5,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App跳转参数 + PcParam string `protobuf:"bytes,6,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc跳转参数 +} + +func (x *SaveLangReq_UnoCard) Reset() { + *x = SaveLangReq_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[334] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_UnoCard) ProtoMessage() {} + +func (x *SaveLangReq_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[334] + 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 SaveLangReq_UnoCard.ProtoReflect.Descriptor instead. +func (*SaveLangReq_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 1} +} + +func (x *SaveLangReq_UnoCard) GetCardNo() int32 { + if x != nil { + return x.CardNo + } + return 0 +} + +func (x *SaveLangReq_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SaveLangReq_UnoCard) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *SaveLangReq_UnoCard) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *SaveLangReq_UnoCard) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *SaveLangReq_UnoCard) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type SaveLangReq_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id + PkTeams []*SaveLangReq_PkTeam `protobuf:"bytes,2,rep,name=pk_teams,json=pkTeams,proto3" json:"pk_teams,omitempty"` //队伍 +} + +func (x *SaveLangReq_Schedule) Reset() { + *x = SaveLangReq_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[335] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Schedule) ProtoMessage() {} + +func (x *SaveLangReq_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[335] + 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 SaveLangReq_Schedule.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 2} +} + +func (x *SaveLangReq_Schedule) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SaveLangReq_Schedule) GetPkTeams() []*SaveLangReq_PkTeam { + if x != nil { + return x.PkTeams + } + return nil +} + +type SaveLangReq_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Teams []*SaveLangReq_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + VsImg string `protobuf:"bytes,3,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //比赛图 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //标题描述 +} + +func (x *SaveLangReq_PkTeam) Reset() { + *x = SaveLangReq_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[336] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_PkTeam) ProtoMessage() {} + +func (x *SaveLangReq_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[336] + 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 SaveLangReq_PkTeam.ProtoReflect.Descriptor instead. +func (*SaveLangReq_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 3} +} + +func (x *SaveLangReq_PkTeam) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SaveLangReq_PkTeam) GetTeams() []*SaveLangReq_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *SaveLangReq_PkTeam) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *SaveLangReq_PkTeam) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type SaveLangReq_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *SaveLangReq_Team) Reset() { + *x = SaveLangReq_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[337] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Team) ProtoMessage() {} + +func (x *SaveLangReq_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[337] + 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 SaveLangReq_Team.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 4} +} + +func (x *SaveLangReq_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SaveLangReq_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SaveLangReq_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type SaveLangReq_Talk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TextType int32 `protobuf:"varint,1,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 +} + +func (x *SaveLangReq_Talk) Reset() { + *x = SaveLangReq_Talk{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[338] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Talk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Talk) ProtoMessage() {} + +func (x *SaveLangReq_Talk) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[338] + 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 SaveLangReq_Talk.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Talk) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 5} +} + +func (x *SaveLangReq_Talk) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *SaveLangReq_Talk) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type SaveLangReq_QaGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QaGroupId string `protobuf:"bytes,1,opt,name=qa_group_id,json=qaGroupId,proto3" json:"qa_group_id,omitempty"` //题库hash_id + QaNum int32 `protobuf:"varint,2,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题库选取数量 + GuideGroupId string `protobuf:"bytes,3,opt,name=guide_group_id,json=guideGroupId,proto3" json:"guide_group_id,omitempty"` //引导组hash_id +} + +func (x *SaveLangReq_QaGroup) Reset() { + *x = SaveLangReq_QaGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[339] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_QaGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_QaGroup) ProtoMessage() {} + +func (x *SaveLangReq_QaGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[339] + 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 SaveLangReq_QaGroup.ProtoReflect.Descriptor instead. +func (*SaveLangReq_QaGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 6} +} + +func (x *SaveLangReq_QaGroup) GetQaGroupId() string { + if x != nil { + return x.QaGroupId + } + return "" +} + +func (x *SaveLangReq_QaGroup) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *SaveLangReq_QaGroup) GetGuideGroupId() string { + if x != nil { + return x.GuideGroupId + } + return "" +} + +type SaveLangReq_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Price int32 `protobuf:"varint,1,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + Currency int32 `protobuf:"varint,2,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *SaveLangReq_Cash) Reset() { + *x = SaveLangReq_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[340] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Cash) ProtoMessage() {} + +func (x *SaveLangReq_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[340] + 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 SaveLangReq_Cash.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 7} +} + +func (x *SaveLangReq_Cash) GetPrice() int32 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *SaveLangReq_Cash) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type SaveLangReq_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Price float64 `protobuf:"fixed64,1,opt,name=price,proto3" json:"price,omitempty"` //单位奖品总价值 + Currency int32 `protobuf:"varint,2,opt,name=currency,proto3" json:"currency,omitempty"` //货币id标识 +} + +func (x *SaveLangReq_Gold) Reset() { + *x = SaveLangReq_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[341] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Gold) ProtoMessage() {} + +func (x *SaveLangReq_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[341] + 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 SaveLangReq_Gold.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 8} +} + +func (x *SaveLangReq_Gold) GetPrice() float64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *SaveLangReq_Gold) GetCurrency() int32 { + if x != nil { + return x.Currency + } + return 0 +} + +type SaveLangReq_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CustomBtnText string `protobuf:"bytes,1,opt,name=custom_btn_text,json=customBtnText,proto3" json:"custom_btn_text,omitempty"` //自定义按钮文案 + CustomWebUrl string `protobuf:"bytes,2,opt,name=custom_web_url,json=customWebUrl,proto3" json:"custom_web_url,omitempty"` //自定义web端url + CustomExtraParam string `protobuf:"bytes,3,opt,name=custom_extra_param,json=customExtraParam,proto3" json:"custom_extra_param,omitempty"` //自定义app附加参数 + CustomPcParam string `protobuf:"bytes,4,opt,name=custom_pc_param,json=customPcParam,proto3" json:"custom_pc_param,omitempty"` //自定义pc附加参数 +} + +func (x *SaveLangReq_Coin) Reset() { + *x = SaveLangReq_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[342] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Coin) ProtoMessage() {} + +func (x *SaveLangReq_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[342] + 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 SaveLangReq_Coin.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 9} +} + +func (x *SaveLangReq_Coin) GetCustomBtnText() string { + if x != nil { + return x.CustomBtnText + } + return "" +} + +func (x *SaveLangReq_Coin) GetCustomWebUrl() string { + if x != nil { + return x.CustomWebUrl + } + return "" +} + +func (x *SaveLangReq_Coin) GetCustomExtraParam() string { + if x != nil { + return x.CustomExtraParam + } + return "" +} + +func (x *SaveLangReq_Coin) GetCustomPcParam() string { + if x != nil { + return x.CustomPcParam + } + return "" +} + +type SaveLangReq_Quit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //标题 + Options []*SaveLangReq_Option `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` //选项集合 +} + +func (x *SaveLangReq_Quit) Reset() { + *x = SaveLangReq_Quit{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[343] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Quit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Quit) ProtoMessage() {} + +func (x *SaveLangReq_Quit) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[343] + 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 SaveLangReq_Quit.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Quit) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 10} +} + +func (x *SaveLangReq_Quit) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SaveLangReq_Quit) GetOptions() []*SaveLangReq_Option { + if x != nil { + return x.Options + } + return nil +} + +type SaveLangReq_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OptionId int64 `protobuf:"varint,1,opt,name=option_id,json=optionId,proto3" json:"option_id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //选项标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //选项图片 +} + +func (x *SaveLangReq_Option) Reset() { + *x = SaveLangReq_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[344] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Option) ProtoMessage() {} + +func (x *SaveLangReq_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[344] + 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 SaveLangReq_Option.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Option) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 11} +} + +func (x *SaveLangReq_Option) GetOptionId() int64 { + if x != nil { + return x.OptionId + } + return 0 +} + +func (x *SaveLangReq_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SaveLangReq_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type SaveLangReq_Question struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QaId int64 `protobuf:"varint,1,opt,name=qa_id,json=qaId,proto3" json:"qa_id,omitempty"` //问题id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //题目 + Options []*SaveLangReq_Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` //选项集合 +} + +func (x *SaveLangReq_Question) Reset() { + *x = SaveLangReq_Question{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[345] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Question) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Question) ProtoMessage() {} + +func (x *SaveLangReq_Question) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[345] + 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 SaveLangReq_Question.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Question) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 12} +} + +func (x *SaveLangReq_Question) GetQaId() int64 { + if x != nil { + return x.QaId + } + return 0 +} + +func (x *SaveLangReq_Question) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SaveLangReq_Question) GetOptions() []*SaveLangReq_Option { + if x != nil { + return x.Options + } + return nil +} + +type SaveLangReq_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CondId int64 `protobuf:"varint,1,opt,name=cond_id,json=condId,proto3" json:"cond_id,omitempty"` //条件id + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //对应的语言描述 + WebUrl string `protobuf:"bytes,3,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,4,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + PcParam string `protobuf:"bytes,5,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 + GoText string `protobuf:"bytes,6,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 +} + +func (x *SaveLangReq_Cond) Reset() { + *x = SaveLangReq_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[346] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_Cond) ProtoMessage() {} + +func (x *SaveLangReq_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[346] + 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 SaveLangReq_Cond.ProtoReflect.Descriptor instead. +func (*SaveLangReq_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 13} +} + +func (x *SaveLangReq_Cond) GetCondId() int64 { + if x != nil { + return x.CondId + } + return 0 +} + +func (x *SaveLangReq_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *SaveLangReq_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *SaveLangReq_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *SaveLangReq_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *SaveLangReq_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +type SaveLangReq_LongImg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImgUrl string `protobuf:"bytes,1,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //长图id + ClickType int32 `protobuf:"varint,5,opt,name=click_type,json=clickType,proto3" json:"click_type,omitempty"` //点击类型(1-整图点击,2-区域点击) + HotZone []*SaveLangReq_HotZone `protobuf:"bytes,6,rep,name=hot_zone,json=hotZone,proto3" json:"hot_zone,omitempty"` //点击区域 + TargetType int32 `protobuf:"varint,7,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,8,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + LangSourceId int64 `protobuf:"varint,10,opt,name=lang_source_id,json=langSourceId,proto3" json:"lang_source_id,omitempty"` //语言长图源ID +} + +func (x *SaveLangReq_LongImg) Reset() { + *x = SaveLangReq_LongImg{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[347] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_LongImg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_LongImg) ProtoMessage() {} + +func (x *SaveLangReq_LongImg) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[347] + 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 SaveLangReq_LongImg.ProtoReflect.Descriptor instead. +func (*SaveLangReq_LongImg) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 14} +} + +func (x *SaveLangReq_LongImg) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *SaveLangReq_LongImg) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *SaveLangReq_LongImg) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *SaveLangReq_LongImg) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SaveLangReq_LongImg) GetClickType() int32 { + if x != nil { + return x.ClickType + } + return 0 +} + +func (x *SaveLangReq_LongImg) GetHotZone() []*SaveLangReq_HotZone { + if x != nil { + return x.HotZone + } + return nil +} + +func (x *SaveLangReq_LongImg) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *SaveLangReq_LongImg) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *SaveLangReq_LongImg) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *SaveLangReq_LongImg) GetLangSourceId() int64 { + if x != nil { + return x.LangSourceId + } + return 0 +} + +type SaveLangReq_HotZone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //热区id + WebUrl string `protobuf:"bytes,2,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,3,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ClickX float64 `protobuf:"fixed64,4,opt,name=click_x,json=clickX,proto3" json:"click_x,omitempty"` //点击区域x + ClickY float64 `protobuf:"fixed64,5,opt,name=click_y,json=clickY,proto3" json:"click_y,omitempty"` //点击区域y + ClickW float64 `protobuf:"fixed64,6,opt,name=click_w,json=clickW,proto3" json:"click_w,omitempty"` //点击区域w + ClickH float64 `protobuf:"fixed64,7,opt,name=click_h,json=clickH,proto3" json:"click_h,omitempty"` //点击区域h + TargetType int32 `protobuf:"varint,8,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` //跳转目标(1-指定地址,2-活动) + TargetId int64 `protobuf:"varint,9,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` //目标id + PcParam string `protobuf:"bytes,10,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *SaveLangReq_HotZone) Reset() { + *x = SaveLangReq_HotZone{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[348] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveLangReq_HotZone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveLangReq_HotZone) ProtoMessage() {} + +func (x *SaveLangReq_HotZone) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[348] + 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 SaveLangReq_HotZone.ProtoReflect.Descriptor instead. +func (*SaveLangReq_HotZone) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{38, 15} +} + +func (x *SaveLangReq_HotZone) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *SaveLangReq_HotZone) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *SaveLangReq_HotZone) GetClickX() float64 { + if x != nil { + return x.ClickX + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetClickY() float64 { + if x != nil { + return x.ClickY + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetClickW() float64 { + if x != nil { + return x.ClickW + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetClickH() float64 { + if x != nil { + return x.ClickH + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetTargetType() int32 { + if x != nil { + return x.TargetType + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *SaveLangReq_HotZone) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type LangSelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangType int32 `protobuf:"varint,1,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言数字类型 + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言iso标准 + Selected bool `protobuf:"varint,3,opt,name=selected,proto3" json:"selected,omitempty"` //是否已经被使用 +} + +func (x *LangSelectRes_One) Reset() { + *x = LangSelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[349] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LangSelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LangSelectRes_One) ProtoMessage() {} + +func (x *LangSelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[349] + 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 LangSelectRes_One.ProtoReflect.Descriptor instead. +func (*LangSelectRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{43, 0} +} + +func (x *LangSelectRes_One) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *LangSelectRes_One) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *LangSelectRes_One) GetSelected() bool { + if x != nil { + return x.Selected + } + return false +} + +type ShowRewardRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + Stock int32 `protobuf:"varint,4,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,5,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,6,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,7,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,8,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,9,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,10,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,11,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + ReceiveType int32 `protobuf:"varint,12,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服) + KvData []*ShowRewardRes_KV `protobuf:"bytes,13,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Contact string `protobuf:"bytes,14,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + Url string `protobuf:"bytes,15,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + Help int32 `protobuf:"varint,16,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,17,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,18,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,19,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,20,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,21,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,22,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,23,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + JumpUrl string `protobuf:"bytes,24,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + RewardId int64 `protobuf:"varint,25,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库奖品id + Register int32 `protobuf:"varint,26,opt,name=register,proto3" json:"register,omitempty"` //开启下载助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,27,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个下载获得的进度比率 +} + +func (x *ShowRewardRes_Reward) Reset() { + *x = ShowRewardRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[350] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRewardRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRewardRes_Reward) ProtoMessage() {} + +func (x *ShowRewardRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[350] + 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 ShowRewardRes_Reward.ProtoReflect.Descriptor instead. +func (*ShowRewardRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{47, 0} +} + +func (x *ShowRewardRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRewardRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRewardRes_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetKvData() []*ShowRewardRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ShowRewardRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ShowRewardRes_Reward) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ShowRewardRes_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *ShowRewardRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *ShowRewardRes_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +type ShowRewardRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *ShowRewardRes_KV) Reset() { + *x = ShowRewardRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[351] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRewardRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRewardRes_KV) ProtoMessage() {} + +func (x *ShowRewardRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[351] + 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 ShowRewardRes_KV.ProtoReflect.Descriptor instead. +func (*ShowRewardRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{47, 1} +} + +func (x *ShowRewardRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ShowRewardRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type AdsStoreReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *AdsStoreReq_KV) Reset() { + *x = AdsStoreReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[352] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStoreReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStoreReq_KV) ProtoMessage() {} + +func (x *AdsStoreReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[352] + 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 AdsStoreReq_KV.ProtoReflect.Descriptor instead. +func (*AdsStoreReq_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{48, 0} +} + +func (x *AdsStoreReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *AdsStoreReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type AdsStoreReq_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Odds int32 `protobuf:"varint,2,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 +} + +func (x *AdsStoreReq_Reward) Reset() { + *x = AdsStoreReq_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[353] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStoreReq_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStoreReq_Reward) ProtoMessage() {} + +func (x *AdsStoreReq_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[353] + 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 AdsStoreReq_Reward.ProtoReflect.Descriptor instead. +func (*AdsStoreReq_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{48, 1} +} + +func (x *AdsStoreReq_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *AdsStoreReq_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +type AdsStoreReq_Flip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CardImg string `protobuf:"bytes,1,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡牌图片 +} + +func (x *AdsStoreReq_Flip) Reset() { + *x = AdsStoreReq_Flip{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[354] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStoreReq_Flip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStoreReq_Flip) ProtoMessage() {} + +func (x *AdsStoreReq_Flip) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[354] + 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 AdsStoreReq_Flip.ProtoReflect.Descriptor instead. +func (*AdsStoreReq_Flip) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{48, 2} +} + +func (x *AdsStoreReq_Flip) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +type AdsUpdateReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *AdsUpdateReq_KV) Reset() { + *x = AdsUpdateReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[355] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUpdateReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUpdateReq_KV) ProtoMessage() {} + +func (x *AdsUpdateReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[355] + 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 AdsUpdateReq_KV.ProtoReflect.Descriptor instead. +func (*AdsUpdateReq_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{50, 0} +} + +func (x *AdsUpdateReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *AdsUpdateReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type AdsUpdateReq_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Odds int32 `protobuf:"varint,3,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 +} + +func (x *AdsUpdateReq_Reward) Reset() { + *x = AdsUpdateReq_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[356] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUpdateReq_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUpdateReq_Reward) ProtoMessage() {} + +func (x *AdsUpdateReq_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[356] + 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 AdsUpdateReq_Reward.ProtoReflect.Descriptor instead. +func (*AdsUpdateReq_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{50, 1} +} + +func (x *AdsUpdateReq_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsUpdateReq_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *AdsUpdateReq_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +type AdsUpdateReq_Flip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CardImg string `protobuf:"bytes,1,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡牌图片 +} + +func (x *AdsUpdateReq_Flip) Reset() { + *x = AdsUpdateReq_Flip{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[357] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUpdateReq_Flip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUpdateReq_Flip) ProtoMessage() {} + +func (x *AdsUpdateReq_Flip) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[357] + 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 AdsUpdateReq_Flip.ProtoReflect.Descriptor instead. +func (*AdsUpdateReq_Flip) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{50, 2} +} + +func (x *AdsUpdateReq_Flip) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +type AdsShowRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *AdsShowRes_KV) Reset() { + *x = AdsShowRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[358] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsShowRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsShowRes_KV) ProtoMessage() {} + +func (x *AdsShowRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[358] + 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 AdsShowRes_KV.ProtoReflect.Descriptor instead. +func (*AdsShowRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{53, 0} +} + +func (x *AdsShowRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *AdsShowRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type AdsShowRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Odds int32 `protobuf:"varint,3,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,5,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + KvData []*AdsShowRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-实物) + Contact string `protobuf:"bytes,8,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + Url string `protobuf:"bytes,9,opt,name=url,proto3" json:"url,omitempty"` //回调地址 +} + +func (x *AdsShowRes_Reward) Reset() { + *x = AdsShowRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[359] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsShowRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsShowRes_Reward) ProtoMessage() {} + +func (x *AdsShowRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[359] + 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 AdsShowRes_Reward.ProtoReflect.Descriptor instead. +func (*AdsShowRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{53, 1} +} + +func (x *AdsShowRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsShowRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *AdsShowRes_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *AdsShowRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsShowRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *AdsShowRes_Reward) GetKvData() []*AdsShowRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *AdsShowRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *AdsShowRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *AdsShowRes_Reward) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +type AdsShowRes_Flip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CardImg string `protobuf:"bytes,1,opt,name=card_img,json=cardImg,proto3" json:"card_img,omitempty"` //卡牌图片 +} + +func (x *AdsShowRes_Flip) Reset() { + *x = AdsShowRes_Flip{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[360] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsShowRes_Flip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsShowRes_Flip) ProtoMessage() {} + +func (x *AdsShowRes_Flip) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[360] + 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 AdsShowRes_Flip.ProtoReflect.Descriptor instead. +func (*AdsShowRes_Flip) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{53, 2} +} + +func (x *AdsShowRes_Flip) GetCardImg() string { + if x != nil { + return x.CardImg + } + return "" +} + +type CampaignSelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) + ChildType int32 `protobuf:"varint,5,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务) +} + +func (x *CampaignSelectRes_One) Reset() { + *x = CampaignSelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[361] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignSelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignSelectRes_One) ProtoMessage() {} + +func (x *CampaignSelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[361] + 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 CampaignSelectRes_One.ProtoReflect.Descriptor instead. +func (*CampaignSelectRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{55, 0} +} + +func (x *CampaignSelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CampaignSelectRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CampaignSelectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CampaignSelectRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *CampaignSelectRes_One) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +type RewardDetailRes_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //牌组id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //牌组标识 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + Stock int64 `protobuf:"varint,4,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + Remain int64 `protobuf:"varint,5,opt,name=remain,proto3" json:"remain,omitempty"` //剩余库存 + PreIntactNum int64 `protobuf:"varint,6,opt,name=pre_intact_num,json=preIntactNum,proto3" json:"pre_intact_num,omitempty"` //待合成奖品数 + IntactNum int64 `protobuf:"varint,7,opt,name=intact_num,json=intactNum,proto3" json:"intact_num,omitempty"` //完整奖品数 +} + +func (x *RewardDetailRes_UnoCard) Reset() { + *x = RewardDetailRes_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[362] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_UnoCard) ProtoMessage() {} + +func (x *RewardDetailRes_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[362] + 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 RewardDetailRes_UnoCard.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 0} +} + +func (x *RewardDetailRes_UnoCard) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardDetailRes_UnoCard) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *RewardDetailRes_UnoCard) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardDetailRes_UnoCard) GetStock() int64 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *RewardDetailRes_UnoCard) GetRemain() int64 { + if x != nil { + return x.Remain + } + return 0 +} + +func (x *RewardDetailRes_UnoCard) GetPreIntactNum() int64 { + if x != nil { + return x.PreIntactNum + } + return 0 +} + +func (x *RewardDetailRes_UnoCard) GetIntactNum() int64 { + if x != nil { + return x.IntactNum + } + return 0 +} + +type RewardDetailRes_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + VsAt int64 `protobuf:"varint,2,opt,name=vs_at,json=vsAt,proto3" json:"vs_at,omitempty"` //开赛时间 + VoteStart int64 `protobuf:"varint,3,opt,name=vote_start,json=voteStart,proto3" json:"vote_start,omitempty"` //投票开始时间 + VoteEnd int64 `protobuf:"varint,4,opt,name=vote_end,json=voteEnd,proto3" json:"vote_end,omitempty"` //投票结束时间 + Teams []*RewardDetailRes_Team `protobuf:"bytes,5,rep,name=teams,proto3" json:"teams,omitempty"` //队伍数据 + Votes []*RewardDetailRes_Vote `protobuf:"bytes,6,rep,name=votes,proto3" json:"votes,omitempty"` //投票数据 + WinType int32 `protobuf:"varint,7,opt,name=win_type,json=winType,proto3" json:"win_type,omitempty"` //结算获奖类型(1-队伍胜利,2-平局) + WinTeamId int64 `protobuf:"varint,8,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //胜利队伍id + PreRewardNum int64 `protobuf:"varint,9,opt,name=pre_reward_num,json=preRewardNum,proto3" json:"pre_reward_num,omitempty"` //预计发放奖励数 + RewardNum int64 `protobuf:"varint,10,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //实际领取奖励数 + Tz int32 `protobuf:"varint,11,opt,name=tz,proto3" json:"tz,omitempty"` //时区 +} + +func (x *RewardDetailRes_Schedule) Reset() { + *x = RewardDetailRes_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[363] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_Schedule) ProtoMessage() {} + +func (x *RewardDetailRes_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[363] + 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 RewardDetailRes_Schedule.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 1} +} + +func (x *RewardDetailRes_Schedule) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetVsAt() int64 { + if x != nil { + return x.VsAt + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetVoteStart() int64 { + if x != nil { + return x.VoteStart + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetVoteEnd() int64 { + if x != nil { + return x.VoteEnd + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetTeams() []*RewardDetailRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *RewardDetailRes_Schedule) GetVotes() []*RewardDetailRes_Vote { + if x != nil { + return x.Votes + } + return nil +} + +func (x *RewardDetailRes_Schedule) GetWinType() int32 { + if x != nil { + return x.WinType + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetPreRewardNum() int64 { + if x != nil { + return x.PreRewardNum + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetRewardNum() int64 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *RewardDetailRes_Schedule) GetTz() int32 { + if x != nil { + return x.Tz + } + return 0 +} + +type RewardDetailRes_Vote struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WinType int32 `protobuf:"varint,1,opt,name=win_type,json=winType,proto3" json:"win_type,omitempty"` //结算获奖类型(1-队伍胜利,2-平局) + WinTeamId int64 `protobuf:"varint,2,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //队伍id + VoteNum int64 `protobuf:"varint,3,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"` //投票数 + VoteUserNum int64 `protobuf:"varint,4,opt,name=vote_user_num,json=voteUserNum,proto3" json:"vote_user_num,omitempty"` //投票数 +} + +func (x *RewardDetailRes_Vote) Reset() { + *x = RewardDetailRes_Vote{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[364] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_Vote) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_Vote) ProtoMessage() {} + +func (x *RewardDetailRes_Vote) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[364] + 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 RewardDetailRes_Vote.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_Vote) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 2} +} + +func (x *RewardDetailRes_Vote) GetWinType() int32 { + if x != nil { + return x.WinType + } + return 0 +} + +func (x *RewardDetailRes_Vote) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *RewardDetailRes_Vote) GetVoteNum() int64 { + if x != nil { + return x.VoteNum + } + return 0 +} + +func (x *RewardDetailRes_Vote) GetVoteUserNum() int64 { + if x != nil { + return x.VoteUserNum + } + return 0 +} + +type RewardDetailRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *RewardDetailRes_Team) Reset() { + *x = RewardDetailRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[365] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_Team) ProtoMessage() {} + +func (x *RewardDetailRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[365] + 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 RewardDetailRes_Team.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 3} +} + +func (x *RewardDetailRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardDetailRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RewardDetailRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type RewardDetailRes_Pool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //id标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //场次说明 + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //状态(1-进行中 2-领奖中,3-已结算) + InitCoin int32 `protobuf:"varint,4,opt,name=init_coin,json=initCoin,proto3" json:"init_coin,omitempty"` //奖池初始金额 + UserCoin int64 `protobuf:"varint,5,opt,name=user_coin,json=userCoin,proto3" json:"user_coin,omitempty"` //用户投放金币数 + InitUse int32 `protobuf:"varint,6,opt,name=init_use,json=initUse,proto3" json:"init_use,omitempty"` //初始投放次数 + JoinNum int64 `protobuf:"varint,7,opt,name=join_num,json=joinNum,proto3" json:"join_num,omitempty"` //投放次数 + OneUseCoin int64 `protobuf:"varint,8,opt,name=one_use_coin,json=oneUseCoin,proto3" json:"one_use_coin,omitempty"` //用户单次可领取的金币数 + JoinUserNum int64 `protobuf:"varint,9,opt,name=join_user_num,json=joinUserNum,proto3" json:"join_user_num,omitempty"` //投放人数 + GetNum int64 `protobuf:"varint,10,opt,name=get_num,json=getNum,proto3" json:"get_num,omitempty"` //领奖总人数 + JoinAvg int64 `protobuf:"varint,11,opt,name=join_avg,json=joinAvg,proto3" json:"join_avg,omitempty"` //平均每人发放金币数 + GetCoin int64 `protobuf:"varint,12,opt,name=get_coin,json=getCoin,proto3" json:"get_coin,omitempty"` //领取的总金币数 +} + +func (x *RewardDetailRes_Pool) Reset() { + *x = RewardDetailRes_Pool{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[366] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_Pool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_Pool) ProtoMessage() {} + +func (x *RewardDetailRes_Pool) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[366] + 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 RewardDetailRes_Pool.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_Pool) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 4} +} + +func (x *RewardDetailRes_Pool) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardDetailRes_Pool) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetInitCoin() int32 { + if x != nil { + return x.InitCoin + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetUserCoin() int64 { + if x != nil { + return x.UserCoin + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetInitUse() int32 { + if x != nil { + return x.InitUse + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetJoinNum() int64 { + if x != nil { + return x.JoinNum + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetOneUseCoin() int64 { + if x != nil { + return x.OneUseCoin + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetJoinUserNum() int64 { + if x != nil { + return x.JoinUserNum + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetGetNum() int64 { + if x != nil { + return x.GetNum + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetJoinAvg() int64 { + if x != nil { + return x.JoinAvg + } + return 0 +} + +func (x *RewardDetailRes_Pool) GetGetCoin() int64 { + if x != nil { + return x.GetCoin + } + return 0 +} + +type RewardDetailRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + Stock int64 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + Remain int64 `protobuf:"varint,4,opt,name=remain,proto3" json:"remain,omitempty"` //剩余库存 + Given int64 `protobuf:"varint,5,opt,name=given,proto3" json:"given,omitempty"` //已发放奖品数 + CanUp bool `protobuf:"varint,6,opt,name=can_up,json=canUp,proto3" json:"can_up,omitempty"` //是否可更新库存 + IsThank int32 `protobuf:"varint,7,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + SelectNum int64 `protobuf:"varint,8,opt,name=select_num,json=selectNum,proto3" json:"select_num,omitempty"` //选择数 + TaskTitle string `protobuf:"bytes,9,opt,name=task_title,json=taskTitle,proto3" json:"task_title,omitempty"` //任务标题 + SignDay int32 `protobuf:"varint,10,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 +} + +func (x *RewardDetailRes_Reward) Reset() { + *x = RewardDetailRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[367] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_Reward) ProtoMessage() {} + +func (x *RewardDetailRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[367] + 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 RewardDetailRes_Reward.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 5} +} + +func (x *RewardDetailRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardDetailRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardDetailRes_Reward) GetStock() int64 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *RewardDetailRes_Reward) GetRemain() int64 { + if x != nil { + return x.Remain + } + return 0 +} + +func (x *RewardDetailRes_Reward) GetGiven() int64 { + if x != nil { + return x.Given + } + return 0 +} + +func (x *RewardDetailRes_Reward) GetCanUp() bool { + if x != nil { + return x.CanUp + } + return false +} + +func (x *RewardDetailRes_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *RewardDetailRes_Reward) GetSelectNum() int64 { + if x != nil { + return x.SelectNum + } + return 0 +} + +func (x *RewardDetailRes_Reward) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *RewardDetailRes_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +type RewardDetailRes_UserLevelOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LevelId int64 `protobuf:"varint,1,opt,name=level_id,json=levelId,proto3" json:"level_id,omitempty"` //用户类型id + LevelTitle string `protobuf:"bytes,2,opt,name=level_title,json=levelTitle,proto3" json:"level_title,omitempty"` //用户类型标题 + Rewards []*RewardDetailRes_Reward `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *RewardDetailRes_UserLevelOne) Reset() { + *x = RewardDetailRes_UserLevelOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[368] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_UserLevelOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_UserLevelOne) ProtoMessage() {} + +func (x *RewardDetailRes_UserLevelOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[368] + 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 RewardDetailRes_UserLevelOne.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_UserLevelOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 6} +} + +func (x *RewardDetailRes_UserLevelOne) GetLevelId() int64 { + if x != nil { + return x.LevelId + } + return 0 +} + +func (x *RewardDetailRes_UserLevelOne) GetLevelTitle() string { + if x != nil { + return x.LevelTitle + } + return "" +} + +func (x *RewardDetailRes_UserLevelOne) GetRewards() []*RewardDetailRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type RewardDetailRes_LangOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + Rewards []*RewardDetailRes_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *RewardDetailRes_LangOne) Reset() { + *x = RewardDetailRes_LangOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[369] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_LangOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_LangOne) ProtoMessage() {} + +func (x *RewardDetailRes_LangOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[369] + 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 RewardDetailRes_LangOne.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_LangOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 7} +} + +func (x *RewardDetailRes_LangOne) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *RewardDetailRes_LangOne) GetRewards() []*RewardDetailRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type RewardDetailRes_LangUserLevelOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + LevelList []*RewardDetailRes_UserLevelOne `protobuf:"bytes,2,rep,name=level_list,json=levelList,proto3" json:"level_list,omitempty"` //奖品 +} + +func (x *RewardDetailRes_LangUserLevelOne) Reset() { + *x = RewardDetailRes_LangUserLevelOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[370] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_LangUserLevelOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_LangUserLevelOne) ProtoMessage() {} + +func (x *RewardDetailRes_LangUserLevelOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[370] + 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 RewardDetailRes_LangUserLevelOne.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_LangUserLevelOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 8} +} + +func (x *RewardDetailRes_LangUserLevelOne) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *RewardDetailRes_LangUserLevelOne) GetLevelList() []*RewardDetailRes_UserLevelOne { + if x != nil { + return x.LevelList + } + return nil +} + +type RewardDetailRes_CountryOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CountryMark string `protobuf:"bytes,1,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 + Rewards []*RewardDetailRes_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品 +} + +func (x *RewardDetailRes_CountryOne) Reset() { + *x = RewardDetailRes_CountryOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[371] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardDetailRes_CountryOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardDetailRes_CountryOne) ProtoMessage() {} + +func (x *RewardDetailRes_CountryOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[371] + 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 RewardDetailRes_CountryOne.ProtoReflect.Descriptor instead. +func (*RewardDetailRes_CountryOne) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{57, 9} +} + +func (x *RewardDetailRes_CountryOne) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *RewardDetailRes_CountryOne) GetRewards() []*RewardDetailRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type CampaignTzRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + TOffset int32 `protobuf:"varint,2,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //语言对应的时区 +} + +func (x *CampaignTzRes_One) Reset() { + *x = CampaignTzRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[372] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignTzRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignTzRes_One) ProtoMessage() {} + +func (x *CampaignTzRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[372] + 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 CampaignTzRes_One.ProtoReflect.Descriptor instead. +func (*CampaignTzRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{61, 0} +} + +func (x *CampaignTzRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *CampaignTzRes_One) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +type CampaignRewardTypeRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardType int32 `protobuf:"varint,2,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品类型 +} + +func (x *CampaignRewardTypeRes_One) Reset() { + *x = CampaignRewardTypeRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[373] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignRewardTypeRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignRewardTypeRes_One) ProtoMessage() {} + +func (x *CampaignRewardTypeRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[373] + 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 CampaignRewardTypeRes_One.ProtoReflect.Descriptor instead. +func (*CampaignRewardTypeRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{63, 0} +} + +func (x *CampaignRewardTypeRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CampaignRewardTypeRes_One) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +type ChildListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + FissionId int64 `protobuf:"varint,4,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法ID + FissionMark string `protobuf:"bytes,5,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //活动类型玩法标识 + StartTime int64 `protobuf:"varint,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + Status int32 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + ChildType int32 `protobuf:"varint,9,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + BindCampaign string `protobuf:"bytes,10,opt,name=bind_campaign,json=bindCampaign,proto3" json:"bind_campaign,omitempty"` //绑定的活动名称 + HasReport int32 `protobuf:"varint,11,opt,name=has_report,json=hasReport,proto3" json:"has_report,omitempty"` //是否有报表 +} + +func (x *ChildListRes_One) Reset() { + *x = ChildListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[374] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListRes_One) ProtoMessage() {} + +func (x *ChildListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[374] + 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 ChildListRes_One.ProtoReflect.Descriptor instead. +func (*ChildListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{65, 0} +} + +func (x *ChildListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChildListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildListRes_One) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ChildListRes_One) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *ChildListRes_One) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ChildListRes_One) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ChildListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildListRes_One) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *ChildListRes_One) GetBindCampaign() string { + if x != nil { + return x.BindCampaign + } + return "" +} + +func (x *ChildListRes_One) GetHasReport() int32 { + if x != nil { + return x.HasReport + } + return 0 +} + +type ChildStoreReq_TaskGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + Reward *ChildStoreReq_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,4,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + Conds []*ChildStoreReq_Cond `protobuf:"bytes,5,rep,name=conds,proto3" json:"conds,omitempty"` //任务 +} + +func (x *ChildStoreReq_TaskGroup) Reset() { + *x = ChildStoreReq_TaskGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[375] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildStoreReq_TaskGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildStoreReq_TaskGroup) ProtoMessage() {} + +func (x *ChildStoreReq_TaskGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[375] + 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 ChildStoreReq_TaskGroup.ProtoReflect.Descriptor instead. +func (*ChildStoreReq_TaskGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{66, 0} +} + +func (x *ChildStoreReq_TaskGroup) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildStoreReq_TaskGroup) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ChildStoreReq_TaskGroup) GetReward() *ChildStoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ChildStoreReq_TaskGroup) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildStoreReq_TaskGroup) GetConds() []*ChildStoreReq_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type ChildStoreReq_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Stock int32 `protobuf:"varint,2,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,3,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,4,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,5,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,6,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,7,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,8,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,9,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + Help int32 `protobuf:"varint,10,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,11,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,12,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,13,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,14,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,15,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,16,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,17,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + Odds int32 `protobuf:"varint,18,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + JumpUrl string `protobuf:"bytes,19,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + CampaignLimit int32 `protobuf:"varint,20,opt,name=campaign_limit,json=campaignLimit,proto3" json:"campaign_limit,omitempty"` //活动内单个用户可获取该奖品次数 + Register int32 `protobuf:"varint,21,opt,name=register,proto3" json:"register,omitempty"` //开启注册助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,22,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个注册获得的进度比率 + InitPercent float64 `protobuf:"fixed64,23,opt,name=init_percent,json=initPercent,proto3" json:"init_percent,omitempty"` //初始助力进度 + PropMark string `protobuf:"bytes,24,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) +} + +func (x *ChildStoreReq_Reward) Reset() { + *x = ChildStoreReq_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[376] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildStoreReq_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildStoreReq_Reward) ProtoMessage() {} + +func (x *ChildStoreReq_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[376] + 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 ChildStoreReq_Reward.ProtoReflect.Descriptor instead. +func (*ChildStoreReq_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{66, 1} +} + +func (x *ChildStoreReq_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *ChildStoreReq_Reward) GetCampaignLimit() int32 { + if x != nil { + return x.CampaignLimit + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetInitPercent() float64 { + if x != nil { + return x.InitPercent + } + return 0 +} + +func (x *ChildStoreReq_Reward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +type ChildStoreReq_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,2,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,3,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TaskLimit int32 `protobuf:"varint,6,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,7,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + TriggerType int32 `protobuf:"varint,8,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + DayLimit int32 `protobuf:"varint,9,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,10,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + EventType int32 `protobuf:"varint,11,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,12,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + LangMarks []string `protobuf:"bytes,13,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WatchSec int32 `protobuf:"varint,14,opt,name=watch_sec,json=watchSec,proto3" json:"watch_sec,omitempty"` //观看秒数 + WeekLimit int32 `protobuf:"varint,15,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,16,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + OpenJump int32 `protobuf:"varint,17,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,18,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,19,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + GoShow int32 `protobuf:"varint,20,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,21,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,22,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,23,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置条件(0-否,1-是) + PreCond int32 `protobuf:"varint,24,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + ExpiredMin int32 `protobuf:"varint,25,opt,name=expired_min,json=expiredMin,proto3" json:"expired_min,omitempty"` //过期分钟数 + Reward *ChildStoreReq_Reward `protobuf:"bytes,26,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,27,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + Sort int32 `protobuf:"varint,28,opt,name=sort,proto3" json:"sort,omitempty"` //排序 + PcParam string `protobuf:"bytes,29,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 +} + +func (x *ChildStoreReq_Cond) Reset() { + *x = ChildStoreReq_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[377] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildStoreReq_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildStoreReq_Cond) ProtoMessage() {} + +func (x *ChildStoreReq_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[377] + 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 ChildStoreReq_Cond.ProtoReflect.Descriptor instead. +func (*ChildStoreReq_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{66, 2} +} + +func (x *ChildStoreReq_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *ChildStoreReq_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *ChildStoreReq_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *ChildStoreReq_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ChildStoreReq_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *ChildStoreReq_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ChildStoreReq_Cond) GetWatchSec() int32 { + if x != nil { + return x.WatchSec + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ChildStoreReq_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *ChildStoreReq_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *ChildStoreReq_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetExpiredMin() int32 { + if x != nil { + return x.ExpiredMin + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetReward() *ChildStoreReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ChildStoreReq_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildStoreReq_Cond) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *ChildStoreReq_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type ChildUpdateReq_TaskGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + Reward *ChildUpdateReq_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,4,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + Conds []*ChildUpdateReq_Cond `protobuf:"bytes,5,rep,name=conds,proto3" json:"conds,omitempty"` //任务 +} + +func (x *ChildUpdateReq_TaskGroup) Reset() { + *x = ChildUpdateReq_TaskGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[378] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildUpdateReq_TaskGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildUpdateReq_TaskGroup) ProtoMessage() {} + +func (x *ChildUpdateReq_TaskGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[378] + 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 ChildUpdateReq_TaskGroup.ProtoReflect.Descriptor instead. +func (*ChildUpdateReq_TaskGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{68, 0} +} + +func (x *ChildUpdateReq_TaskGroup) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildUpdateReq_TaskGroup) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ChildUpdateReq_TaskGroup) GetReward() *ChildUpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ChildUpdateReq_TaskGroup) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildUpdateReq_TaskGroup) GetConds() []*ChildUpdateReq_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type ChildUpdateReq_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Stock int32 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,6,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,7,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,8,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,9,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,10,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + Help int32 `protobuf:"varint,11,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,12,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,13,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,14,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,15,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,16,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,17,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,18,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + Odds int32 `protobuf:"varint,19,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + JumpUrl string `protobuf:"bytes,20,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + CampaignLimit int32 `protobuf:"varint,21,opt,name=campaign_limit,json=campaignLimit,proto3" json:"campaign_limit,omitempty"` //活动内单个用户可获取该奖品次数 + Register int32 `protobuf:"varint,22,opt,name=register,proto3" json:"register,omitempty"` //开启注册助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,23,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个注册获得的进度比率 + InitPercent float64 `protobuf:"fixed64,24,opt,name=init_percent,json=initPercent,proto3" json:"init_percent,omitempty"` //初始助力进度 + PropMark string `protobuf:"bytes,25,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) +} + +func (x *ChildUpdateReq_Reward) Reset() { + *x = ChildUpdateReq_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[379] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildUpdateReq_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildUpdateReq_Reward) ProtoMessage() {} + +func (x *ChildUpdateReq_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[379] + 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 ChildUpdateReq_Reward.ProtoReflect.Descriptor instead. +func (*ChildUpdateReq_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{68, 1} +} + +func (x *ChildUpdateReq_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *ChildUpdateReq_Reward) GetCampaignLimit() int32 { + if x != nil { + return x.CampaignLimit + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetInitPercent() float64 { + if x != nil { + return x.InitPercent + } + return 0 +} + +func (x *ChildUpdateReq_Reward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +type ChildUpdateReq_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,2,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,3,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TaskLimit int32 `protobuf:"varint,6,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,7,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + TriggerType int32 `protobuf:"varint,8,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + DayLimit int32 `protobuf:"varint,9,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,10,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + EventType int32 `protobuf:"varint,11,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,12,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + LangMarks []string `protobuf:"bytes,13,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WatchSec int32 `protobuf:"varint,14,opt,name=watch_sec,json=watchSec,proto3" json:"watch_sec,omitempty"` //观看秒数 + WeekLimit int32 `protobuf:"varint,15,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,16,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + OpenJump int32 `protobuf:"varint,17,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,18,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,19,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + GoShow int32 `protobuf:"varint,20,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,21,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,22,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,23,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置条件(0-否,1-是) + PreCond int32 `protobuf:"varint,24,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + ExpiredMin int32 `protobuf:"varint,25,opt,name=expired_min,json=expiredMin,proto3" json:"expired_min,omitempty"` //过期分钟数 + Reward *ChildUpdateReq_Reward `protobuf:"bytes,26,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,27,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + Sort int32 `protobuf:"varint,28,opt,name=sort,proto3" json:"sort,omitempty"` //排序 + PcParam string `protobuf:"bytes,29,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 +} + +func (x *ChildUpdateReq_Cond) Reset() { + *x = ChildUpdateReq_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[380] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildUpdateReq_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildUpdateReq_Cond) ProtoMessage() {} + +func (x *ChildUpdateReq_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[380] + 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 ChildUpdateReq_Cond.ProtoReflect.Descriptor instead. +func (*ChildUpdateReq_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{68, 2} +} + +func (x *ChildUpdateReq_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *ChildUpdateReq_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ChildUpdateReq_Cond) GetWatchSec() int32 { + if x != nil { + return x.WatchSec + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetExpiredMin() int32 { + if x != nil { + return x.ExpiredMin + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetReward() *ChildUpdateReq_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ChildUpdateReq_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildUpdateReq_Cond) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *ChildUpdateReq_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type ChildShowRes_TaskGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + Reward *ChildShowRes_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,4,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + Conds []*ChildShowRes_Cond `protobuf:"bytes,5,rep,name=conds,proto3" json:"conds,omitempty"` //任务 +} + +func (x *ChildShowRes_TaskGroup) Reset() { + *x = ChildShowRes_TaskGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[381] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildShowRes_TaskGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildShowRes_TaskGroup) ProtoMessage() {} + +func (x *ChildShowRes_TaskGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[381] + 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 ChildShowRes_TaskGroup.ProtoReflect.Descriptor instead. +func (*ChildShowRes_TaskGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{71, 0} +} + +func (x *ChildShowRes_TaskGroup) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildShowRes_TaskGroup) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ChildShowRes_TaskGroup) GetReward() *ChildShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ChildShowRes_TaskGroup) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildShowRes_TaskGroup) GetConds() []*ChildShowRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type ChildShowRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品库的奖品id + Stock int32 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + InviteNum int32 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //需要邀请的人数 + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + IsThank int32 `protobuf:"varint,6,opt,name=is_thank,json=isThank,proto3" json:"is_thank,omitempty"` //是否谢谢参与(0-否,1-是) + Score int32 `protobuf:"varint,7,opt,name=score,proto3" json:"score,omitempty"` //领取奖品的分数 + SignDay int32 `protobuf:"varint,8,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + CollectNum int32 `protobuf:"varint,9,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片数 + IsSuper int32 `protobuf:"varint,10,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + KvData []*ChildShowRes_KV `protobuf:"bytes,11,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + Title string `protobuf:"bytes,12,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,13,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + ReceiveType int32 `protobuf:"varint,14,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-提交表单) + Contact string `protobuf:"bytes,15,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + Url string `protobuf:"bytes,16,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + Help int32 `protobuf:"varint,17,opt,name=help,proto3" json:"help,omitempty"` //开启下载助力(0-否,1-是) + HelpPercent float64 `protobuf:"fixed64,18,opt,name=help_percent,json=helpPercent,proto3" json:"help_percent,omitempty"` //每个下载获得的进度比率 + Click int32 `protobuf:"varint,19,opt,name=click,proto3" json:"click,omitempty"` //开启点击助力(0-否,1-是) + ClickPercent float64 `protobuf:"fixed64,20,opt,name=click_percent,json=clickPercent,proto3" json:"click_percent,omitempty"` //每个点击助力获得的进度比率 + ClickPercentLimit float64 `protobuf:"fixed64,21,opt,name=click_percent_limit,json=clickPercentLimit,proto3" json:"click_percent_limit,omitempty"` //可获得的最大点击助力获得的进度比率 + Open int32 `protobuf:"varint,22,opt,name=open,proto3" json:"open,omitempty"` //开启拉日活(0-否,1-是) + OpenPercent float64 `protobuf:"fixed64,23,opt,name=open_percent,json=openPercent,proto3" json:"open_percent,omitempty"` //每个拉日活力获得的进度比率 + OpenPercentLimit float64 `protobuf:"fixed64,24,opt,name=open_percent_limit,json=openPercentLimit,proto3" json:"open_percent_limit,omitempty"` //可获得的最大拉日活获得的进度比率 + LangMark string `protobuf:"bytes,25,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //奖品语言标识 + Odds int32 `protobuf:"varint,26,opt,name=odds,proto3" json:"odds,omitempty"` //中奖率 + JumpUrl string `protobuf:"bytes,27,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + FormTitle string `protobuf:"bytes,28,opt,name=form_title,json=formTitle,proto3" json:"form_title,omitempty"` //表单标题 + CampaignLimit int32 `protobuf:"varint,29,opt,name=campaign_limit,json=campaignLimit,proto3" json:"campaign_limit,omitempty"` //活动内单个用户可获取该奖品次数 + Register int32 `protobuf:"varint,30,opt,name=register,proto3" json:"register,omitempty"` //开启注册助力(0-否,1-是) + RegisterPercent float64 `protobuf:"fixed64,31,opt,name=register_percent,json=registerPercent,proto3" json:"register_percent,omitempty"` //每个注册获得的进度比率 + InitPercent float64 `protobuf:"fixed64,32,opt,name=init_percent,json=initPercent,proto3" json:"init_percent,omitempty"` //初始助力进度 + PropMark string `protobuf:"bytes,33,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) +} + +func (x *ChildShowRes_Reward) Reset() { + *x = ChildShowRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[382] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildShowRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildShowRes_Reward) ProtoMessage() {} + +func (x *ChildShowRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[382] + 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 ChildShowRes_Reward.ProtoReflect.Descriptor instead. +func (*ChildShowRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{71, 1} +} + +func (x *ChildShowRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildShowRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildShowRes_Reward) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ChildShowRes_Reward) GetInviteNum() int32 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ChildShowRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ChildShowRes_Reward) GetIsThank() int32 { + if x != nil { + return x.IsThank + } + return 0 +} + +func (x *ChildShowRes_Reward) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ChildShowRes_Reward) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ChildShowRes_Reward) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *ChildShowRes_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildShowRes_Reward) GetKvData() []*ChildShowRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ChildShowRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildShowRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ChildShowRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ChildShowRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ChildShowRes_Reward) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ChildShowRes_Reward) GetHelp() int32 { + if x != nil { + return x.Help + } + return 0 +} + +func (x *ChildShowRes_Reward) GetHelpPercent() float64 { + if x != nil { + return x.HelpPercent + } + return 0 +} + +func (x *ChildShowRes_Reward) GetClick() int32 { + if x != nil { + return x.Click + } + return 0 +} + +func (x *ChildShowRes_Reward) GetClickPercent() float64 { + if x != nil { + return x.ClickPercent + } + return 0 +} + +func (x *ChildShowRes_Reward) GetClickPercentLimit() float64 { + if x != nil { + return x.ClickPercentLimit + } + return 0 +} + +func (x *ChildShowRes_Reward) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildShowRes_Reward) GetOpenPercent() float64 { + if x != nil { + return x.OpenPercent + } + return 0 +} + +func (x *ChildShowRes_Reward) GetOpenPercentLimit() float64 { + if x != nil { + return x.OpenPercentLimit + } + return 0 +} + +func (x *ChildShowRes_Reward) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ChildShowRes_Reward) GetOdds() int32 { + if x != nil { + return x.Odds + } + return 0 +} + +func (x *ChildShowRes_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *ChildShowRes_Reward) GetFormTitle() string { + if x != nil { + return x.FormTitle + } + return "" +} + +func (x *ChildShowRes_Reward) GetCampaignLimit() int32 { + if x != nil { + return x.CampaignLimit + } + return 0 +} + +func (x *ChildShowRes_Reward) GetRegister() int32 { + if x != nil { + return x.Register + } + return 0 +} + +func (x *ChildShowRes_Reward) GetRegisterPercent() float64 { + if x != nil { + return x.RegisterPercent + } + return 0 +} + +func (x *ChildShowRes_Reward) GetInitPercent() float64 { + if x != nil { + return x.InitPercent + } + return 0 +} + +func (x *ChildShowRes_Reward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +type ChildShowRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,2,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,3,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + IfCond int32 `protobuf:"varint,5,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + TaskLimit int32 `protobuf:"varint,6,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务次数限制 + Chance int32 `protobuf:"varint,7,opt,name=chance,proto3" json:"chance,omitempty"` //完成任务获得的数量(如:骰子数) + TriggerType int32 `protobuf:"varint,8,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + DayLimit int32 `protobuf:"varint,9,opt,name=day_limit,json=dayLimit,proto3" json:"day_limit,omitempty"` //每日任务次数限制(0为不限制) + LevelIds []int64 `protobuf:"varint,10,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //限制的用户类型id集合 + EventType int32 `protobuf:"varint,11,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,12,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + LangMarks []string `protobuf:"bytes,13,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //限制的语言集合 + WatchSec int32 `protobuf:"varint,14,opt,name=watch_sec,json=watchSec,proto3" json:"watch_sec,omitempty"` //观看秒数 + WeekLimit int32 `protobuf:"varint,15,opt,name=week_limit,json=weekLimit,proto3" json:"week_limit,omitempty"` //广告观看次数 + WeekNum int32 `protobuf:"varint,16,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //观看秒数 + OpenJump int32 `protobuf:"varint,17,opt,name=open_jump,json=openJump,proto3" json:"open_jump,omitempty"` //开启活动跳转(0-否,1-是) + WebUrl string `protobuf:"bytes,18,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端url长度 + ExtraParam string `protobuf:"bytes,19,opt,name=extra_param,json=extraParam,proto3" json:"extra_param,omitempty"` //附加参数 + GoShow int32 `protobuf:"varint,20,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,21,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,22,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,23,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置条件(0-否,1-是) + PreCond int32 `protobuf:"varint,24,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + ExpiredMin int32 `protobuf:"varint,25,opt,name=expired_min,json=expiredMin,proto3" json:"expired_min,omitempty"` //过期分钟数 + Reward *ChildShowRes_Reward `protobuf:"bytes,26,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,27,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + Sort int32 `protobuf:"varint,28,opt,name=sort,proto3" json:"sort,omitempty"` //排序 + PcParam string `protobuf:"bytes,29,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端附加参数 +} + +func (x *ChildShowRes_Cond) Reset() { + *x = ChildShowRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[383] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildShowRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildShowRes_Cond) ProtoMessage() {} + +func (x *ChildShowRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[383] + 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 ChildShowRes_Cond.ProtoReflect.Descriptor instead. +func (*ChildShowRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{71, 2} +} + +func (x *ChildShowRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *ChildShowRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *ChildShowRes_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *ChildShowRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ChildShowRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *ChildShowRes_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *ChildShowRes_Cond) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ChildShowRes_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *ChildShowRes_Cond) GetDayLimit() int32 { + if x != nil { + return x.DayLimit + } + return 0 +} + +func (x *ChildShowRes_Cond) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *ChildShowRes_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *ChildShowRes_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *ChildShowRes_Cond) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ChildShowRes_Cond) GetWatchSec() int32 { + if x != nil { + return x.WatchSec + } + return 0 +} + +func (x *ChildShowRes_Cond) GetWeekLimit() int32 { + if x != nil { + return x.WeekLimit + } + return 0 +} + +func (x *ChildShowRes_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *ChildShowRes_Cond) GetOpenJump() int32 { + if x != nil { + return x.OpenJump + } + return 0 +} + +func (x *ChildShowRes_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ChildShowRes_Cond) GetExtraParam() string { + if x != nil { + return x.ExtraParam + } + return "" +} + +func (x *ChildShowRes_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *ChildShowRes_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *ChildShowRes_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildShowRes_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *ChildShowRes_Cond) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +func (x *ChildShowRes_Cond) GetExpiredMin() int32 { + if x != nil { + return x.ExpiredMin + } + return 0 +} + +func (x *ChildShowRes_Cond) GetReward() *ChildShowRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ChildShowRes_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildShowRes_Cond) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *ChildShowRes_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type ChildShowRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *ChildShowRes_KV) Reset() { + *x = ChildShowRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[384] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildShowRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildShowRes_KV) ProtoMessage() {} + +func (x *ChildShowRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[384] + 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 ChildShowRes_KV.ProtoReflect.Descriptor instead. +func (*ChildShowRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{71, 3} +} + +func (x *ChildShowRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ChildShowRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type TaskCenterJumpRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + JumpUrl string `protobuf:"bytes,2,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 +} + +func (x *TaskCenterJumpRes_One) Reset() { + *x = TaskCenterJumpRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[385] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskCenterJumpRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskCenterJumpRes_One) ProtoMessage() {} + +func (x *TaskCenterJumpRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[385] + 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 TaskCenterJumpRes_One.ProtoReflect.Descriptor instead. +func (*TaskCenterJumpRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{73, 0} +} + +func (x *TaskCenterJumpRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TaskCenterJumpRes_One) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +type CondListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //任务id + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //条件描述 + Event string `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + Conds []*CondListRes_Cond `protobuf:"bytes,4,rep,name=conds,proto3" json:"conds,omitempty"` //事件key +} + +func (x *CondListRes_One) Reset() { + *x = CondListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[386] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CondListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CondListRes_One) ProtoMessage() {} + +func (x *CondListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[386] + 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 CondListRes_One.ProtoReflect.Descriptor instead. +func (*CondListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{75, 0} +} + +func (x *CondListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CondListRes_One) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *CondListRes_One) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *CondListRes_One) GetConds() []*CondListRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type CondListRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EventKey string `protobuf:"bytes,1,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,2,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + IfCond int32 `protobuf:"varint,3,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) +} + +func (x *CondListRes_Cond) Reset() { + *x = CondListRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[387] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CondListRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CondListRes_Cond) ProtoMessage() {} + +func (x *CondListRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[387] + 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 CondListRes_Cond.ProtoReflect.Descriptor instead. +func (*CondListRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{75, 1} +} + +func (x *CondListRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *CondListRes_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *CondListRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +type CampaignsRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //活动标题 +} + +func (x *CampaignsRes_One) Reset() { + *x = CampaignsRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[388] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignsRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignsRes_One) ProtoMessage() {} + +func (x *CampaignsRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[388] + 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 CampaignsRes_One.ProtoReflect.Descriptor instead. +func (*CampaignsRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{77, 0} +} + +func (x *CampaignsRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CampaignsRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type VsSettlementReq_Score struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TeamId int64 `protobuf:"varint,1,opt,name=team_id,json=teamId,proto3" json:"team_id,omitempty"` //队伍id + Score string `protobuf:"bytes,2,opt,name=score,proto3" json:"score,omitempty"` //胜利得分 +} + +func (x *VsSettlementReq_Score) Reset() { + *x = VsSettlementReq_Score{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[389] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementReq_Score) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementReq_Score) ProtoMessage() {} + +func (x *VsSettlementReq_Score) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[389] + 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 VsSettlementReq_Score.ProtoReflect.Descriptor instead. +func (*VsSettlementReq_Score) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{82, 0} +} + +func (x *VsSettlementReq_Score) GetTeamId() int64 { + if x != nil { + return x.TeamId + } + return 0 +} + +func (x *VsSettlementReq_Score) GetScore() string { + if x != nil { + return x.Score + } + return "" +} + +type VsSettlementRes_PkTeam struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //比赛id + Teams []*VsSettlementRes_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍集合 +} + +func (x *VsSettlementRes_PkTeam) Reset() { + *x = VsSettlementRes_PkTeam{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[390] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementRes_PkTeam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementRes_PkTeam) ProtoMessage() {} + +func (x *VsSettlementRes_PkTeam) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[390] + 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 VsSettlementRes_PkTeam.ProtoReflect.Descriptor instead. +func (*VsSettlementRes_PkTeam) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{83, 0} +} + +func (x *VsSettlementRes_PkTeam) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VsSettlementRes_PkTeam) GetTeams() []*VsSettlementRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +type VsSettlementRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *VsSettlementRes_Team) Reset() { + *x = VsSettlementRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[391] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementRes_Team) ProtoMessage() {} + +func (x *VsSettlementRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[391] + 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 VsSettlementRes_Team.ProtoReflect.Descriptor instead. +func (*VsSettlementRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{83, 1} +} + +func (x *VsSettlementRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VsSettlementRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *VsSettlementRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type VsSettlementInfoRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 + Score string `protobuf:"bytes,4,opt,name=score,proto3" json:"score,omitempty"` //胜利得分 +} + +func (x *VsSettlementInfoRes_Team) Reset() { + *x = VsSettlementInfoRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_proto_msgTypes[392] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsSettlementInfoRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsSettlementInfoRes_Team) ProtoMessage() {} + +func (x *VsSettlementInfoRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_proto_msgTypes[392] + 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 VsSettlementInfoRes_Team.ProtoReflect.Descriptor instead. +func (*VsSettlementInfoRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_proto_rawDescGZIP(), []int{85, 0} +} + +func (x *VsSettlementInfoRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VsSettlementInfoRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *VsSettlementInfoRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +func (x *VsSettlementInfoRes_Team) GetScore() string { + if x != nil { + return x.Score + } + return "" +} + +var File_w_campaign_proto protoreflect.FileDescriptor + +var file_w_campaign_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0c, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x22, 0x88, 0x03, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x64, 0x22, 0xfb, 0x0a, 0x0a, 0x07, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, + 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xa7, 0x08, 0x0a, + 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, + 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x65, 0x6d, 0x70, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x74, 0x65, 0x6d, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, + 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x64, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x19, + 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x6c, + 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, + 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x74, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x65, + 0x62, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x57, 0x65, 0x62, 0x12, + 0x1e, 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x18, 0x15, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x61, 0x73, 0x57, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x12, + 0x20, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x64, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x17, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x6e, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x6e, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x35, 0x0a, 0x07, 0x6c, + 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x7a, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x54, 0x7a, 0x52, 0x06, 0x6c, 0x61, 0x6e, 0x67, + 0x54, 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x1a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x1b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x1c, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x40, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x37, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x1e, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, + 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, + 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x75, 0x0a, 0x06, 0x4c, 0x61, 0x6e, 0x67, 0x54, 0x7a, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, + 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x48, 0x0a, + 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x63, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x40, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x0a, 0x0a, 0x08, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x22, 0xe7, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x03, 0x6c, 0x6f, 0x63, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x03, 0x6c, 0x6f, 0x63, + 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x61, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x07, + 0x6f, 0x76, 0x65, 0x72, 0x53, 0x65, 0x61, 0x1a, 0x76, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6f, 0x73, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6f, 0x73, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, + 0x6e, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, + 0x0c, 0x70, 0x72, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, + 0x0b, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x22, 0x4d, 0x0a, 0x0a, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x0c, 0x0a, 0x0a, 0x44, + 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x96, 0x90, 0x01, 0x0a, 0x08, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x35, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x0c, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x5f, 0x77, 0x68, + 0x65, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x0a, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x57, 0x68, 0x65, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x04, 0x73, + 0x6c, 0x6f, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x3a, 0x0a, 0x05, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x74, + 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x62, 0x6c, 0x69, 0x6e, + 0x64, 0x12, 0x38, 0x0a, 0x04, 0x67, 0x72, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x04, 0x67, 0x72, 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x72, + 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x12, 0x4e, 0x0a, 0x0f, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x0e, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x04, + 0x71, 0x75, 0x69, 0x7a, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x51, 0x75, 0x69, 0x7a, 0x52, 0x04, 0x71, 0x75, 0x69, 0x7a, 0x12, 0x35, 0x0a, + 0x03, 0x77, 0x69, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x03, 0x77, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x35, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x14, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x65, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x44, 0x69, + 0x63, 0x65, 0x52, 0x04, 0x64, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x67, 0x72, 0x6f, 0x77, + 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, + 0x72, 0x6f, 0x77, 0x52, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x12, 0x35, 0x0a, 0x06, 0x62, 0x61, 0x6c, + 0x6c, 0x6f, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x42, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x52, 0x06, 0x62, 0x61, 0x6c, 0x6c, 0x6f, 0x74, + 0x12, 0x2f, 0x0a, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x04, 0x63, 0x68, 0x6f, + 0x70, 0x12, 0x41, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6e, 0x6b, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3e, + 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x18, 0x1b, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x57, 0x65, 0x62, 0x12, 0x42, + 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, + 0x1c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x45, 0x78, 0x74, + 0x72, 0x61, 0x12, 0x48, 0x0a, 0x10, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6e, 0x65, + 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x18, 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x0d, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x04, 0x63, 0x61, 0x73, 0x68, 0x18, 0x1f, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x61, 0x73, + 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x3b, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, + 0x69, 0x6d, 0x67, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x52, 0x08, 0x6c, 0x6f, 0x6e, 0x67, + 0x49, 0x6d, 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x21, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, + 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x6f, 0x70, 0x79, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x36, 0x0a, 0x08, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x64, 0x6f, 0x67, 0x18, 0x23, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x07, + 0x6b, 0x65, 0x65, 0x70, 0x44, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x24, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x2f, 0x0a, 0x04, 0x70, 0x75, 0x73, 0x68, 0x18, + 0x25, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, + 0x73, 0x68, 0x52, 0x04, 0x70, 0x75, 0x73, 0x68, 0x12, 0x32, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x18, 0x26, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x42, 0x0a, 0x0b, + 0x77, 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x27, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x57, 0x68, 0x65, 0x65, 0x6c, 0x53, + 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0a, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, + 0x12, 0x2f, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x04, 0x67, 0x6f, 0x6c, + 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x29, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, + 0x69, 0x6e, 0x12, 0x3f, 0x0a, 0x0a, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, + 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, + 0x72, 0x69, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x67, 0x72, 0x69, 0x64, 0x53, 0x74, + 0x79, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x5f, 0x73, 0x74, 0x79, 0x6c, + 0x65, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x46, 0x6c, 0x69, 0x70, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x66, 0x6c, 0x69, 0x70, 0x53, + 0x74, 0x79, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x55, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x18, 0x2d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x68, 0x61, 0x74, + 0x52, 0x04, 0x63, 0x68, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x02, 0x76, 0x73, 0x18, 0x2e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x56, 0x73, 0x52, 0x02, 0x76, + 0x73, 0x12, 0x2c, 0x0a, 0x03, 0x75, 0x6e, 0x6f, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, 0x12, + 0x32, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x30, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x18, + 0x31, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, + 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x67, 0x61, 0x73, + 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x0e, 0x67, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, + 0x6e, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x53, 0x74, + 0x79, 0x6c, 0x65, 0x52, 0x0d, 0x67, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x53, 0x74, 0x79, + 0x6c, 0x65, 0x1a, 0xd6, 0x01, 0x0a, 0x0d, 0x47, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x53, + 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, + 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, + 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, + 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, + 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x67, 0x67, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x67, 0x67, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x65, 0x67, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x65, 0x67, 0x67, 0x49, 0x6d, 0x67, 0x73, 0x1a, 0x49, 0x0a, 0x05, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x76, 0x69, + 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x65, 0x52, 0x0a, 0x66, 0x69, 0x72, 0x73, + 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x1a, 0x5c, 0x0a, 0x08, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4f, + 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x1a, 0x9a, 0x01, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, + 0x6b, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, + 0x79, 0x1a, 0x9d, 0x02, 0x0a, 0x03, 0x55, 0x6e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, + 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, + 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x31, 0x0a, 0x03, 0x72, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, + 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x06, + 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x79, + 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x33, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x67, 0x72, + 0x65, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x65, 0x65, + 0x6e, 0x1a, 0x8d, 0x02, 0x0a, 0x08, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, + 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6f, 0x64, + 0x64, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, + 0x65, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x42, 0x0a, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, + 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x09, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x12, 0x34, 0x0a, 0x05, 0x63, + 0x61, 0x72, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x05, 0x63, 0x61, 0x72, 0x64, + 0x73, 0x1a, 0x7c, 0x0a, 0x0c, 0x55, 0x6e, 0x6f, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x64, 0x64, 0x4e, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, + 0x89, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, + 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x95, 0x03, 0x0a, 0x02, + 0x56, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x61, 0x63, 0x68, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x61, 0x63, + 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, + 0x70, 0x65, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x6c, 0x6c, + 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x13, 0x0a, + 0x05, 0x76, 0x73, 0x5f, 0x74, 0x7a, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x76, 0x73, + 0x54, 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x4d, 0x61, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x69, 0x63, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x63, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x1a, 0x44, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, + 0x38, 0x0a, 0x08, 0x70, 0x6b, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, + 0x52, 0x07, 0x70, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0xc4, 0x03, 0x0a, 0x06, 0x50, 0x6b, + 0x54, 0x65, 0x61, 0x6d, 0x12, 0x31, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x65, 0x61, 0x6d, + 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x5f, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x6f, 0x74, + 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, + 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x6e, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x76, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x76, 0x73, 0x44, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x73, + 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x73, 0x49, 0x6d, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, + 0x74, 0x68, 0x65, 0x72, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, + 0x65, 0x6e, 0x5f, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, + 0x70, 0x65, 0x6e, 0x4f, 0x64, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x64, 0x64, 0x73, 0x5f, + 0x6c, 0x65, 0x66, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x64, 0x64, 0x73, + 0x4c, 0x65, 0x66, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x64, 0x64, 0x73, 0x5f, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x64, 0x64, 0x73, 0x52, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x64, 0x64, 0x73, 0x5f, 0x64, 0x72, 0x61, 0x77, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x64, 0x64, 0x73, 0x44, 0x72, 0x61, 0x77, + 0x1a, 0x35, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x1a, 0x6f, 0x0a, 0x04, 0x43, 0x68, 0x61, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, + 0x70, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, + 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x62, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x68, 0x61, 0x74, 0x42, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x64, + 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xa1, 0x01, 0x0a, 0x09, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x15, + 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, + 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xb9, 0x01, 0x0a, + 0x09, 0x46, 0x6c, 0x69, 0x70, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, + 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, + 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, + 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x1a, 0xa7, 0x02, 0x0a, 0x09, 0x47, 0x72, 0x69, + 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, + 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x62, + 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, + 0x49, 0x6d, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x69, 0x6d, 0x67, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x69, 0x64, 0x49, 0x6d, 0x67, 0x12, + 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, + 0x6d, 0x67, 0x1a, 0xd0, 0x02, 0x0a, 0x0a, 0x57, 0x68, 0x65, 0x65, 0x6c, 0x53, 0x74, 0x79, 0x6c, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, + 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, + 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, + 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x31, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, + 0x74, 0x74, 0x6f, 0x6d, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, + 0x74, 0x6f, 0x6d, 0x33, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x42, 0x74, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, 0x74, + 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x77, + 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x54, 0x65, 0x78, 0x74, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, 0x3f, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xa7, 0x0e, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x75, 0x6c, 0x65, + 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x72, 0x75, 0x6c, + 0x65, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x72, 0x75, 0x6c, 0x65, 0x42, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, + 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, + 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x68, 0x61, 0x73, + 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x32, 0x0a, 0x15, 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x62, 0x61, 0x63, + 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x61, 0x6e, 0x6b, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x61, 0x6e, 0x6b, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, + 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x12, 0x2e, 0x0a, 0x13, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x64, + 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x69, + 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x2a, 0x0a, 0x11, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x65, 0x63, + 0x68, 0x61, 0x74, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2a, 0x0a, 0x11, + 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x77, 0x65, 0x63, 0x68, 0x61, + 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x4d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x73, 0x5f, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x12, + 0x23, 0x0a, 0x0d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x72, 0x65, + 0x76, 0x69, 0x65, 0x77, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x62, 0x74, 0x6e, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x74, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x12, 0x29, 0x0a, 0x11, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x62, 0x74, 0x6e, 0x5f, + 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x74, 0x6e, 0x42, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x26, + 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x65, 0x78, + 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x77, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x13, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x6c, 0x61, 0x79, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x6d, 0x5f, 0x73, 0x68, + 0x6f, 0x77, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x6d, 0x53, 0x68, 0x6f, 0x77, + 0x12, 0x1c, 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x5f, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x17, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x65, 0x62, 0x42, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x1e, + 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x61, 0x73, 0x57, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x12, 0x1e, + 0x0a, 0x0b, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x19, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x49, 0x6d, 0x67, 0x12, 0x1e, + 0x0a, 0x0b, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x1a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x45, 0x6e, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x69, + 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x1c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x69, 0x63, 0x6f, 0x6e, 0x42, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, + 0x17, 0x0a, 0x07, 0x64, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x64, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x6c, 0x5f, 0x62, + 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, + 0x0a, 0x0d, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x49, + 0x6d, 0x67, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, + 0x61, 0x70, 0x70, 0x5f, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x4c, 0x6f, 0x67, 0x6f, 0x12, + 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, + 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x11, + 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x74, + 0x6e, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, + 0x72, 0x41, 0x70, 0x70, 0x42, 0x74, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, + 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x23, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x10, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x50, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x5f, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x25, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6f, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x26, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x69, 0x63, + 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x68, + 0x69, 0x74, 0x65, 0x18, 0x27, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x68, 0x61, 0x73, 0x57, 0x68, + 0x69, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x68, 0x69, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x63, 0x5f, 0x62, 0x67, 0x18, 0x29, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x63, 0x42, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x64, 0x73, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, 0x64, 0x73, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x65, + 0x6d, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x75, + 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, + 0x74, 0x73, 0x69, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x26, 0x0a, + 0x0f, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x18, 0x2e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x6f, 0x5f, + 0x75, 0x73, 0x65, 0x18, 0x30, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x54, + 0x6f, 0x55, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x31, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x32, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x18, 0x33, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x72, 0x75, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x34, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x6e, 0x63, 0x65, + 0x1a, 0x8b, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x68, 0x6f, + 0x74, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x52, 0x07, 0x68, 0x6f, + 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0xfc, + 0x01, 0x0a, 0x07, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, + 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x58, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x5f, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x59, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x77, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x57, 0x12, 0x17, 0x0a, 0x07, 0x63, + 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x48, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0xa2, 0x02, + 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x70, 0x70, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, + 0x6f, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x42, 0x6f, + 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x42, + 0x0a, 0x0b, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4e, 0x6f, 0x72, 0x6d, + 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x44, 0x61, + 0x74, 0x61, 0x1a, 0xe6, 0x08, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1b, + 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, + 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, + 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, + 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x77, 0x61, 0x74, 0x63, + 0x68, 0x53, 0x65, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x1b, + 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x77, + 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, + 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x73, 0x68, 0x6f, 0x77, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x26, + 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x5f, 0x69, + 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x73, 0x53, 0x74, 0x72, 0x61, + 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, + 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x18, 0x17, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, + 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, + 0x72, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x18, 0x1d, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, + 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, + 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2a, + 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, + 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x22, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x2a, 0x0a, + 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x6e, + 0x69, 0x74, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, + 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x1a, 0xc8, 0x02, 0x0a, 0x07, + 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, + 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, + 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, + 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, + 0x6d, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x1a, 0x66, 0x0a, 0x0a, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x91, + 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x52, 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x06, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x1a, 0xac, 0x01, 0x0a, 0x05, 0x46, 0x69, 0x78, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x1a, 0xc2, 0x01, 0x0a, 0x06, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, + 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, + 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x39, + 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, + 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x65, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x1a, 0xaf, 0x07, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, + 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, 0x68, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, + 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, + 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, + 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, + 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x25, + 0x0a, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x17, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, + 0x45, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, + 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x39, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x61, 0x64, 0x64, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x41, + 0x64, 0x64, 0x12, 0x42, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x61, 0x73, + 0x6b, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x1a, 0xe8, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, + 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, + 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, 0x73, + 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, 0x73, + 0x68, 0x1a, 0x77, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x61, 0x79, 0x4e, 0x75, + 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x64, 0x61, 0x79, 0x41, 0x64, 0x64, 0x1a, 0x9f, 0x01, 0x0a, 0x0b, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, + 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, + 0x61, 0x64, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x61, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xdf, 0x02, 0x0a, + 0x07, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x35, 0x0a, 0x06, 0x6e, + 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, + 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, + 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x12, 0x4c, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x1a, 0x79, + 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x10, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x62, 0x0a, 0x0c, 0x55, 0x73, 0x65, + 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x5c, 0x0a, + 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x9a, 0x01, 0x0a, 0x0d, + 0x4c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, + 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x81, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x44, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x52, + 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x68, 0x0a, 0x0a, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x37, 0x0a, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x73, 0x0a, 0x0a, 0x51, 0x61, 0x51, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x61, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3b, 0x0a, 0x08, 0x51, + 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x1a, 0x56, 0x0a, 0x0a, 0x51, 0x75, 0x69, 0x7a, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, + 0x1a, 0xf1, 0x01, 0x0a, 0x04, 0x51, 0x75, 0x69, 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, + 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x7a, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x72, 0x69, 0x7a, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x51, 0x75, 0x69, 0x7a, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xfd, 0x02, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x6b, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x09, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x61, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x15, 0x0a, 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x71, 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, + 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x67, + 0x75, 0x69, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, + 0x47, 0x75, 0x69, 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x67, 0x75, 0x69, 0x64, 0x65, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x67, 0x75, 0x69, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x1a, 0x86, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0xb7, 0x01, + 0x0a, 0x0c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, + 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x65, + 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, + 0x65, 0x70, 0x5f, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, + 0x74, 0x65, 0x70, 0x4c, 0x6f, 0x6f, 0x70, 0x1a, 0x95, 0x02, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x68, 0x61, 0x73, 0x43, 0x61, 0x72, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x69, 0x73, 0x4c, 0x6f, 0x6f, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x79, 0x63, 0x6c, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, + 0x83, 0x04, 0x0a, 0x04, 0x44, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, + 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, + 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x78, 0x5f, + 0x64, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x69, 0x78, 0x44, + 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x5f, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69, + 0x78, 0x44, 0x69, 0x63, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x66, + 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x64, 0x69, 0x63, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x69, + 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, + 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x08, 0x6d, 0x61, + 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x6e, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x61, + 0x67, 0x61, 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x6c, + 0x41, 0x67, 0x61, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x69, + 0x78, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, + 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, + 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x49, 0x6d, 0x67, 0x1a, 0x66, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x61, 0x69, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, + 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, + 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x1a, 0x9c, 0x02, + 0x0a, 0x04, 0x47, 0x72, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x68, + 0x6f, 0x75, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x48, + 0x6f, 0x75, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, 0x75, 0x74, 0x6f, 0x4e, 0x75, 0x6d, 0x12, 0x19, + 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x67, 0x72, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x76, 0x69, + 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x12, + 0x19, 0x0a, 0x08, 0x64, 0x69, 0x65, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x64, 0x69, 0x65, 0x48, 0x6f, 0x75, 0x72, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, + 0x65, 0x70, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, + 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x1a, 0x1c, 0x0a, 0x08, + 0x47, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0x48, 0x0a, 0x06, 0x42, 0x61, + 0x6c, 0x6c, 0x6f, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x21, 0x0a, 0x04, 0x43, 0x68, 0x6f, 0x70, 0x12, 0x19, 0x0a, 0x08, + 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x62, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x73, 0x68, 0x6f, 0x77, 0x42, 0x61, 0x72, 0x1a, 0x91, 0x01, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, + 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x6c, 0x6f, 0x6f, 0x70, 0x4e, 0x75, 0x6d, 0x1a, 0x61, 0x0a, 0x04, 0x46, + 0x6c, 0x69, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x12, + 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x8b, + 0x05, 0x0a, 0x04, 0x4b, 0x65, 0x65, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, + 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x73, + 0x65, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x73, 0x65, + 0x63, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x65, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x12, + 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x65, 0x64, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x65, 0x65, + 0x64, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x65, 0x65, + 0x64, 0x47, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x66, 0x65, 0x65, 0x64, + 0x47, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x5f, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x54, 0x61, 0x6c, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x6c, 0x6b, 0x54, 0x65, 0x78, 0x74, + 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x74, 0x65, 0x70, + 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x12, 0x29, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x5f, 0x67, + 0x65, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x47, 0x65, 0x74, 0x44, 0x61, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, + 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x66, 0x66, 0x6c, + 0x69, 0x6e, 0x65, 0x4d, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, + 0x65, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x66, 0x66, + 0x6c, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x66, 0x66, 0x6c, 0x69, + 0x6e, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xda, 0x02, 0x0a, + 0x06, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x47, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x64, 0x61, 0x79, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x61, 0x79, + 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, + 0x12, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x64, 0x61, 0x79, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x64, + 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x54, 0x68, + 0x69, 0x72, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6d, 0x61, + 0x78, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x4d, 0x61, 0x78, 0x47, 0x65, 0x74, 0x1a, 0x3d, 0x0a, 0x04, 0x54, 0x61, 0x6c, + 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0xaf, 0x01, 0x0a, 0x08, 0x4b, 0x65, 0x65, + 0x70, 0x53, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, 0xed, 0x01, 0x0a, 0x04, 0x50, + 0x75, 0x73, 0x68, 0x12, 0x3d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x65, 0x73, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, + 0x6e, 0x65, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x66, + 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x07, 0x6f, 0x66, 0x66, + 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x69, 0x73, 0x69, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, + 0x4f, 0x6e, 0x65, 0x52, 0x05, 0x76, 0x69, 0x73, 0x69, 0x74, 0x1a, 0x5b, 0x0a, 0x07, 0x50, 0x75, + 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x09, 0x70, 0x75, 0x73, + 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x08, 0x70, + 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x1a, 0x30, 0x0a, 0x08, 0x50, 0x75, 0x73, 0x68, 0x43, + 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x1a, 0x91, 0x01, 0x0a, 0x04, 0x47, 0x6f, + 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, + 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x63, 0x65, 0x4e, 0x75, + 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x1a, 0xa3, 0x03, + 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x49, 0x6d, + 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, + 0x69, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, + 0x69, 0x74, 0x55, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x69, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x0a, + 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, + 0x72, 0x6c, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x62, 0x74, 0x6e, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x61, 0x63, 0x6b, 0x42, 0x74, 0x6e, 0x12, + 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x42, 0x74, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x57, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x2c, 0x0a, + 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x63, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x22, 0x33, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x9f, 0x92, 0x01, 0x0a, 0x09, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x36, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x0c, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x5f, + 0x77, 0x68, 0x65, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x57, 0x68, 0x65, 0x65, 0x6c, 0x12, 0x39, + 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x62, 0x6c, 0x69, + 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x05, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x04, 0x67, 0x72, 0x69, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, + 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x04, 0x67, 0x72, 0x69, + 0x64, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x72, 0x61, 0x6c, 0x12, 0x4f, 0x0a, 0x0f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x52, 0x0e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x04, 0x71, 0x75, 0x69, 0x7a, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75, 0x69, 0x7a, + 0x52, 0x04, 0x71, 0x75, 0x69, 0x7a, 0x12, 0x36, 0x0a, 0x03, 0x77, 0x69, 0x6e, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x03, 0x77, 0x69, 0x6e, 0x12, 0x19, + 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x30, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, 0x73, + 0x69, 0x67, 0x6e, 0x12, 0x30, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, + 0x04, 0x64, 0x69, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, 0x72, 0x6f, + 0x77, 0x52, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x12, 0x36, 0x0a, 0x06, 0x62, 0x61, 0x6c, 0x6c, 0x6f, + 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x42, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x52, 0x06, 0x62, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x12, + 0x30, 0x0a, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x04, 0x63, 0x68, 0x6f, + 0x70, 0x12, 0x42, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6e, + 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x12, 0x3f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x18, + 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x57, 0x65, + 0x62, 0x12, 0x43, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x49, 0x0a, 0x10, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x18, 0x1c, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, + 0x72, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x1d, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, + 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x49, 0x0a, 0x0d, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1f, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x04, 0x63, 0x61, 0x73, 0x68, 0x18, 0x20, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x61, 0x73, + 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x3c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, + 0x69, 0x6d, 0x67, 0x73, 0x18, 0x21, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x52, 0x08, 0x6c, 0x6f, 0x6e, + 0x67, 0x49, 0x6d, 0x67, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x22, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x46, 0x6c, 0x69, + 0x70, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x6b, 0x65, 0x65, 0x70, 0x5f, + 0x64, 0x6f, 0x67, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x07, 0x6b, 0x65, 0x65, 0x70, 0x44, 0x6f, 0x67, + 0x12, 0x30, 0x0a, 0x04, 0x70, 0x75, 0x73, 0x68, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x04, 0x70, 0x75, + 0x73, 0x68, 0x12, 0x33, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x25, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, + 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x43, 0x0a, 0x0b, 0x77, 0x68, 0x65, 0x65, 0x6c, + 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x57, 0x68, 0x65, 0x65, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, + 0x52, 0x0a, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x30, 0x0a, 0x04, + 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x30, + 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, + 0x12, 0x40, 0x0a, 0x0a, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x29, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, 0x72, + 0x69, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x67, 0x72, 0x69, 0x64, 0x53, 0x74, 0x79, + 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, + 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x46, 0x6c, 0x69, 0x70, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x66, 0x6c, 0x69, 0x70, 0x53, + 0x74, 0x79, 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x52, 0x09, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x18, 0x2c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x68, + 0x61, 0x74, 0x52, 0x04, 0x63, 0x68, 0x61, 0x74, 0x12, 0x2a, 0x0a, 0x02, 0x76, 0x73, 0x18, 0x2d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x56, 0x73, + 0x52, 0x02, 0x76, 0x73, 0x12, 0x2d, 0x0a, 0x03, 0x75, 0x6e, 0x6f, 0x18, 0x2e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x03, + 0x75, 0x6e, 0x6f, 0x12, 0x33, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x2f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x68, + 0x61, 0x70, 0x6f, 0x6e, 0x18, 0x30, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x08, 0x67, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0e, 0x67, + 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x31, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x47, 0x61, 0x73, + 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0d, 0x67, 0x61, 0x73, 0x68, + 0x61, 0x70, 0x6f, 0x6e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x1a, 0xd6, 0x01, 0x0a, 0x0d, 0x47, 0x61, + 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, + 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, + 0x67, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, + 0x65, 0x67, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x65, 0x67, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x67, 0x67, 0x5f, 0x69, + 0x6d, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x67, 0x67, 0x49, 0x6d, + 0x67, 0x73, 0x1a, 0x4a, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0b, 0x66, + 0x69, 0x72, 0x73, 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4f, + 0x6e, 0x65, 0x52, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x1a, 0x5d, + 0x0a, 0x08, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3d, + 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0xab, 0x01, + 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x1a, 0xa1, 0x02, 0x0a, 0x03, + 0x55, 0x6e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, + 0x72, 0x6b, 0x73, 0x12, 0x32, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, + 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, + 0x77, 0x12, 0x34, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x1a, + 0xa0, 0x02, 0x0a, 0x08, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6f, 0x64, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, + 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x72, + 0x75, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x09, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x12, 0x35, 0x0a, 0x05, 0x63, + 0x61, 0x72, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x05, 0x63, 0x61, 0x72, + 0x64, 0x73, 0x1a, 0x7c, 0x0a, 0x0c, 0x55, 0x6e, 0x6f, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, + 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x64, 0x64, 0x4e, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x1a, 0x99, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, + 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, + 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x96, 0x03, 0x0a, + 0x02, 0x56, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x61, 0x63, 0x68, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x61, + 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, + 0x65, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x6c, 0x6c, + 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x6c, + 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x13, + 0x0a, 0x05, 0x76, 0x73, 0x5f, 0x74, 0x7a, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x76, + 0x73, 0x54, 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x4d, 0x61, 0x6c, 0x6c, 0x12, + 0x1f, 0x0a, 0x0b, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x63, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x63, 0x6f, 0x6e, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x1a, 0x45, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x12, 0x39, 0x0a, 0x08, 0x70, 0x6b, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x6b, 0x54, + 0x65, 0x61, 0x6d, 0x52, 0x07, 0x70, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0xd5, 0x03, 0x0a, + 0x06, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x76, + 0x6f, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x76, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, + 0x74, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6f, + 0x74, 0x65, 0x45, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x76, 0x73, 0x5f, 0x64, 0x61, 0x74, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x73, 0x44, 0x61, 0x74, 0x65, 0x12, 0x15, + 0x0a, 0x06, 0x76, 0x73, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, + 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, + 0x1d, 0x0a, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0c, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4f, 0x64, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6f, + 0x64, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x64, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x64, 0x64, 0x73, + 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x64, + 0x64, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x64, 0x64, 0x73, 0x5f, + 0x64, 0x72, 0x61, 0x77, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x64, 0x64, 0x73, + 0x44, 0x72, 0x61, 0x77, 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x1a, 0x6f, 0x0a, 0x04, 0x43, + 0x68, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x62, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x68, 0x61, 0x74, 0x42, 0x67, 0x12, + 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xa1, 0x01, 0x0a, + 0x09, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, + 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x4e, + 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x1a, 0xb9, 0x01, 0x0a, 0x09, 0x46, 0x6c, 0x69, 0x70, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, + 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, + 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, + 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x1a, 0xa7, 0x02, 0x0a, + 0x09, 0x47, 0x72, 0x69, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, + 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, + 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, + 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x28, 0x0a, + 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x50, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x69, 0x64, + 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x69, 0x64, + 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x49, 0x6d, 0x67, 0x1a, 0xd0, 0x02, 0x0a, 0x0a, 0x57, 0x68, 0x65, 0x65, 0x6c, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, + 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, + 0x74, 0x74, 0x6f, 0x6d, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, + 0x74, 0x6f, 0x6d, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x32, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x32, 0x12, 0x18, + 0x0a, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x33, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x42, 0x74, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, + 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, + 0x28, 0x0a, 0x10, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x68, 0x65, 0x65, 0x6c, + 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, 0x3f, 0x0a, 0x05, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xc4, 0x0e, 0x0a, 0x06, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x65, + 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x72, 0x75, 0x6c, 0x65, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x22, 0x0a, + 0x0d, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6c, 0x65, 0x42, 0x67, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, + 0x08, 0x68, 0x61, 0x73, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x68, 0x61, 0x73, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x32, 0x0a, 0x15, 0x72, 0x61, 0x6e, 0x6b, + 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x61, 0x6e, 0x6b, 0x42, 0x61, 0x63, + 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x0f, + 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x65, 0x78, 0x74, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x67, 0x65, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x11, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x77, + 0x65, 0x63, 0x68, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x69, 0x73, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x69, + 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4d, + 0x61, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x65, 0x77, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x69, 0x6e, 0x6b, + 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x74, 0x6e, 0x54, 0x65, + 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x29, 0x0a, 0x11, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x62, 0x74, 0x6e, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x74, 0x6e, 0x42, 0x67, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x69, 0x6e, + 0x6b, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, + 0x6f, 0x77, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x73, 0x68, 0x6f, 0x77, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x18, 0x13, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, + 0x6d, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x6d, + 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1c, 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x5f, 0x62, 0x67, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x65, 0x62, 0x42, 0x67, 0x49, + 0x6d, 0x67, 0x12, 0x1e, 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, + 0x70, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x61, 0x73, 0x57, 0x61, 0x72, 0x6d, + 0x55, 0x70, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x49, + 0x6d, 0x67, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x65, 0x6e, + 0x64, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x45, + 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x1b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x22, 0x0a, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x63, 0x6f, 0x6e, 0x42, 0x67, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, + 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1e, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6c, 0x42, 0x61, 0x6e, + 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, + 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x20, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x4c, + 0x6f, 0x67, 0x6f, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, + 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x29, 0x0a, 0x11, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, + 0x70, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x6c, 0x42, + 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x42, 0x74, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x64, + 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x23, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, + 0x72, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x25, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x26, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, + 0x73, 0x5f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x18, 0x27, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x68, + 0x61, 0x73, 0x57, 0x68, 0x69, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x68, 0x69, 0x74, 0x65, + 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x68, 0x69, + 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x63, 0x5f, 0x62, 0x67, 0x18, + 0x29, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x63, 0x42, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x61, + 0x64, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, + 0x64, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x6d, 0x70, + 0x5f, 0x69, 0x64, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x54, + 0x65, 0x6d, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, + 0x75, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, + 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x2e, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x26, + 0x0a, 0x0f, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x54, 0x65, 0x78, + 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x18, 0x30, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x6f, + 0x5f, 0x75, 0x73, 0x65, 0x18, 0x31, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x77, + 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x32, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x18, 0x34, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x75, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x65, 0x18, + 0x35, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x6e, 0x63, + 0x65, 0x1a, 0x9c, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, + 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x68, + 0x6f, 0x74, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x52, 0x07, + 0x68, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x1a, 0x8c, 0x02, 0x0a, 0x07, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, + 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x78, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x58, 0x12, 0x17, 0x0a, 0x07, 0x63, + 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x59, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x77, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x57, 0x12, 0x17, 0x0a, + 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x48, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, + 0xa5, 0x02, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, + 0x70, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, + 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x68, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x64, + 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x61, + 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, 0x41, + 0x6c, 0x6c, 0x12, 0x43, 0x0a, 0x0b, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x6e, 0x6f, 0x72, + 0x6d, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x1a, 0xf7, 0x08, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x64, 0x65, 0x73, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, + 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, + 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x77, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x65, + 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, + 0x65, 0x65, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, + 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6a, 0x75, 0x6d, 0x70, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4a, 0x75, 0x6d, 0x70, + 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x13, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, + 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, + 0x68, 0x6f, 0x77, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, + 0x73, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, + 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x06, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, + 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, 0x73, + 0x68, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, 0x73, + 0x68, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x1f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, + 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x67, + 0x6f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x6f, + 0x54, 0x65, 0x78, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x22, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x65, 0x6e, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x18, 0x23, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x25, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, + 0x26, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x1a, 0xc9, 0x02, 0x0a, 0x07, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x1a, 0x66, 0x0a, + 0x0a, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x93, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x33, + 0x0a, 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x52, 0x05, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0xac, 0x01, 0x0a, 0x05, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x70, + 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x1a, 0xc4, 0x01, 0x0a, 0x06, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, + 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, + 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, + 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x68, + 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x52, 0x07, 0x62, 0x6f, 0x74, + 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x65, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, + 0xc2, 0x07, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x73, 0x54, 0x68, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, + 0x75, 0x70, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, + 0x70, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x6c, 0x70, 0x5f, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, + 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, + 0x64, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, + 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x69, + 0x6e, 0x69, 0x74, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, + 0x79, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x44, 0x61, 0x79, 0x12, 0x3a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x18, + 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4f, + 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x12, + 0x43, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x1c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x54, 0x61, 0x73, 0x6b, 0x1a, 0xe8, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, + 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, + 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, + 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, 0x73, 0x68, 0x1a, + 0x77, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x61, 0x79, 0x4e, 0x75, 0x6d, 0x12, + 0x17, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x64, 0x61, 0x79, 0x41, 0x64, 0x64, 0x1a, 0x9f, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x64, + 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x61, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xe4, 0x02, 0x0a, 0x07, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x6e, 0x6f, 0x72, + 0x6d, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, + 0x6c, 0x12, 0x40, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x61, 0x6e, 0x67, + 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x55, 0x73, + 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, + 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x1a, 0x7a, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x28, + 0x0a, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, + 0x6e, 0x65, 0x52, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x63, 0x0a, + 0x0c, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x1a, 0x5d, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, + 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, + 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x38, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x1a, 0x9b, 0x01, 0x0a, 0x0d, 0x4c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x28, 0x0a, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, + 0x82, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x45, 0x0a, + 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x69, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4f, + 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x38, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, + 0x84, 0x01, 0x0a, 0x0a, 0x51, 0x61, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x51, 0x61, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, + 0x67, 0x68, 0x74, 0x1a, 0x66, 0x0a, 0x0a, 0x51, 0x75, 0x69, 0x7a, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x1a, 0xf2, 0x01, 0x0a, 0x04, + 0x51, 0x75, 0x69, 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75, 0x69, + 0x7a, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x1a, 0xfe, 0x02, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, + 0x77, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, + 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, + 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x73, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x51, 0x61, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x15, 0x0a, + 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x71, + 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x67, 0x75, 0x69, 0x64, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x47, 0x75, 0x69, + 0x64, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x67, 0x75, 0x69, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x67, 0x75, 0x69, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x1a, 0x86, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, + 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, + 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0xb7, 0x01, 0x0a, 0x0c, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x63, + 0x6f, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x65, 0x77, 0x63, 0x6f, + 0x6d, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x65, 0x70, 0x5f, + 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x65, 0x70, + 0x4c, 0x6f, 0x6f, 0x70, 0x1a, 0x95, 0x02, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x69, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x68, + 0x61, 0x73, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x68, + 0x61, 0x73, 0x43, 0x61, 0x72, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x63, + 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x73, 0x5f, 0x6c, 0x6f, 0x6f, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, + 0x4c, 0x6f, 0x6f, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x63, 0x79, 0x63, + 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x79, + 0x63, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x79, 0x63, + 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, 0x84, 0x04, 0x0a, + 0x04, 0x44, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, + 0x12, 0x26, 0x0a, 0x0f, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69, 0x78, 0x44, 0x69, + 0x63, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x5f, + 0x64, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x69, 0x63, 0x65, 0x12, + 0x24, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x4d, 0x61, 0x70, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x61, 0x67, 0x61, + 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x6c, 0x41, 0x67, + 0x61, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x69, 0x78, 0x44, + 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, + 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x49, 0x6d, 0x67, 0x1a, 0x66, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x72, + 0x6d, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x1a, 0x9d, 0x02, 0x0a, 0x04, + 0x47, 0x72, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x68, 0x6f, 0x75, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x48, 0x6f, 0x75, + 0x72, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, 0x75, 0x74, 0x6f, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x67, 0x72, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x67, 0x72, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, + 0x08, 0x64, 0x69, 0x65, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x64, 0x69, 0x65, 0x48, 0x6f, 0x75, 0x72, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x1a, 0x2c, 0x0a, 0x08, 0x47, + 0x72, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0x48, 0x0a, 0x06, 0x42, 0x61, 0x6c, + 0x6c, 0x6f, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x1a, 0x21, 0x0a, 0x04, 0x43, 0x68, 0x6f, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x73, + 0x68, 0x6f, 0x77, 0x5f, 0x62, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, + 0x68, 0x6f, 0x77, 0x42, 0x61, 0x72, 0x1a, 0x91, 0x01, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x12, + 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, + 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x6f, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x6c, 0x6f, 0x6f, 0x70, 0x4e, 0x75, 0x6d, 0x1a, 0x61, 0x0a, 0x04, 0x46, 0x6c, + 0x69, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x12, 0x1d, + 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x8e, 0x05, + 0x0a, 0x04, 0x4b, 0x65, 0x65, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, + 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x73, + 0x65, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x73, 0x65, + 0x63, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x65, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x12, + 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x65, 0x64, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x65, 0x65, + 0x64, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x65, 0x65, + 0x64, 0x47, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x66, 0x65, 0x65, 0x64, + 0x47, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x39, 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x5f, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x54, 0x61, 0x6c, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x6c, 0x6b, 0x54, 0x65, 0x78, + 0x74, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x74, + 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x12, 0x29, 0x0a, 0x11, 0x73, 0x65, 0x63, + 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x47, 0x65, 0x74, 0x44, 0x61, 0x79, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, + 0x6e, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x66, + 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x66, 0x66, 0x6c, + 0x69, 0x6e, 0x65, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x66, 0x66, + 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xda, + 0x02, 0x0a, 0x06, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x47, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, + 0x64, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x64, 0x61, 0x79, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, + 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x47, 0x65, 0x74, 0x12, + 0x2c, 0x0a, 0x12, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x64, 0x61, 0x79, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x26, 0x0a, + 0x0f, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x74, 0x68, 0x69, 0x72, 0x64, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, + 0x54, 0x68, 0x69, 0x72, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, + 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, 0x61, 0x78, 0x47, 0x65, 0x74, 0x1a, 0x3d, 0x0a, 0x04, 0x54, + 0x61, 0x6c, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0xb0, 0x01, 0x0a, 0x08, 0x4b, + 0x65, 0x65, 0x70, 0x53, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, 0xf1, 0x01, + 0x0a, 0x04, 0x50, 0x75, 0x73, 0x68, 0x12, 0x3e, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x74, 0x61, 0x73, + 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, + 0x39, 0x0a, 0x07, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, + 0x65, 0x52, 0x07, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x69, + 0x73, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x05, 0x76, 0x69, 0x73, 0x69, + 0x74, 0x1a, 0x5c, 0x0a, 0x07, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x12, 0x3d, 0x0a, 0x09, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x75, 0x73, + 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x08, 0x70, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x1a, + 0x30, 0x0a, 0x08, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, + 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, + 0x6c, 0x1a, 0x91, 0x01, 0x0a, 0x04, 0x47, 0x6f, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x6f, + 0x6c, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x6f, + 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x70, 0x72, 0x69, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x1a, 0xa3, 0x03, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, + 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, + 0x65, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, + 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, + 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, 0x55, 0x73, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, + 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, + 0x6c, 0x61, 0x63, 0x6b, 0x42, 0x74, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x74, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x12, + 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x57, + 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x63, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x4f, 0x0a, 0x09, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x64, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x61, 0x64, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x51, 0x0a, 0x07, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, + 0xa5, 0x9d, 0x01, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, + 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x74, 0x65, 0x6d, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x0a, 0x05, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x3d, + 0x0a, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, + 0x0c, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x44, 0x0a, + 0x0b, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x5f, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, + 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x57, 0x68, + 0x65, 0x65, 0x6c, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x05, + 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x05, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x12, 0x37, 0x0a, 0x04, 0x67, 0x72, 0x69, 0x64, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x74, + 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x04, 0x67, 0x72, 0x69, 0x64, + 0x12, 0x3e, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, + 0x12, 0x4d, 0x0a, 0x0f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6e, 0x73, + 0x77, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, + 0x0e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, + 0x2e, 0x0a, 0x04, 0x71, 0x75, 0x69, 0x7a, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x75, 0x69, 0x7a, 0x52, 0x04, 0x71, 0x75, 0x69, 0x7a, 0x12, + 0x34, 0x0a, 0x03, 0x77, 0x69, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x03, 0x77, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x5f, 0x65, + 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x45, 0x6e, 0x64, 0x12, 0x34, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x1a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, + 0x73, 0x69, 0x67, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x65, 0x18, 0x1b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, 0x04, + 0x64, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x18, 0x1c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x04, + 0x67, 0x72, 0x6f, 0x77, 0x12, 0x34, 0x0a, 0x06, 0x62, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x18, 0x1d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x42, 0x61, 0x6c, 0x6c, + 0x6f, 0x74, 0x52, 0x06, 0x62, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x68, + 0x6f, 0x70, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x43, 0x68, 0x6f, 0x70, 0x52, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x12, 0x40, 0x0a, 0x0f, 0x64, 0x65, + 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x1f, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x0d, 0x64, + 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x37, 0x0a, 0x07, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x5f, 0x77, 0x65, 0x62, 0x18, 0x21, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x57, 0x65, 0x62, 0x12, 0x41, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x47, 0x0a, 0x10, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x18, 0x23, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, + 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x24, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, + 0x47, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x25, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x61, 0x73, 0x68, + 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x61, + 0x73, 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, + 0x5f, 0x69, 0x6d, 0x67, 0x73, 0x18, 0x27, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x52, 0x08, 0x6c, 0x6f, 0x6e, 0x67, + 0x49, 0x6d, 0x67, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x28, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x04, + 0x66, 0x6c, 0x69, 0x70, 0x12, 0x35, 0x0a, 0x08, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x64, 0x6f, 0x67, + 0x18, 0x29, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, + 0x65, 0x70, 0x52, 0x07, 0x6b, 0x65, 0x65, 0x70, 0x44, 0x6f, 0x67, 0x12, 0x2e, 0x0a, 0x04, 0x70, + 0x75, 0x73, 0x68, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x04, 0x70, 0x75, 0x73, 0x68, 0x12, 0x31, 0x0a, 0x05, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x18, 0x2b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x41, + 0x0a, 0x0b, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x2c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x57, 0x68, 0x65, 0x65, 0x6c, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0a, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x53, 0x74, 0x79, 0x6c, + 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x04, 0x67, 0x6f, 0x6c, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x2e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, + 0x12, 0x3e, 0x0a, 0x0a, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x30, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x72, 0x69, 0x64, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x67, 0x72, 0x69, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, + 0x12, 0x3e, 0x0a, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x31, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x46, 0x6c, 0x69, 0x70, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x09, 0x66, 0x6c, 0x69, 0x70, 0x53, 0x74, 0x79, 0x6c, 0x65, + 0x12, 0x3e, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x32, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x55, 0x73, 0x65, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, + 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x18, 0x33, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x04, 0x63, 0x68, 0x61, 0x74, + 0x12, 0x28, 0x0a, 0x02, 0x76, 0x73, 0x18, 0x34, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x56, 0x73, 0x52, 0x02, 0x76, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x75, 0x6e, + 0x6f, 0x18, 0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, 0x12, 0x31, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x18, 0x36, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x08, 0x67, 0x61, + 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x18, 0x37, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x08, 0x67, 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x0e, 0x67, + 0x61, 0x73, 0x68, 0x61, 0x70, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x38, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x61, 0x73, 0x68, 0x61, + 0x70, 0x6f, 0x6e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0d, 0x67, 0x61, 0x73, 0x68, 0x61, 0x70, + 0x6f, 0x6e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x1a, 0xd6, 0x01, 0x0a, 0x0d, 0x47, 0x61, 0x73, 0x68, + 0x61, 0x70, 0x6f, 0x6e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, + 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, + 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, + 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x67, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x67, + 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x67, + 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x67, 0x67, 0x5f, 0x69, 0x6d, 0x67, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x67, 0x67, 0x49, 0x6d, 0x67, 0x73, + 0x1a, 0x48, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x0b, 0x66, 0x69, 0x72, + 0x73, 0x74, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x65, 0x52, 0x0a, + 0x66, 0x69, 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x1a, 0x5b, 0x0a, 0x08, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0xa9, 0x01, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, + 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x44, 0x61, 0x79, 0x1a, 0x99, 0x02, 0x0a, 0x03, 0x55, 0x6e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x69, + 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x30, 0x0a, 0x03, 0x72, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x36, 0x0a, + 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x79, + 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x67, 0x72, 0x65, + 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x1a, + 0x9a, 0x02, 0x0a, 0x08, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6f, 0x64, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, + 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x72, + 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x52, + 0x75, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x75, 0x6c, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6f, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x63, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x12, 0x33, 0x0a, 0x05, 0x63, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, + 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x05, 0x63, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x7c, 0x0a, 0x0c, + 0x55, 0x6e, 0x6f, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x69, 0x6e, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, + 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, + 0x61, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, 0xb2, 0x01, 0x0a, 0x07, 0x55, + 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, + 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6e, + 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x4e, 0x6f, 0x1a, + 0x94, 0x03, 0x0a, 0x02, 0x56, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x61, 0x63, 0x68, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x65, 0x61, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, + 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6d, + 0x61, 0x6c, 0x6c, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x6d, 0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x6c, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x6c, 0x6c, 0x49, + 0x64, 0x12, 0x13, 0x0a, 0x05, 0x76, 0x73, 0x5f, 0x74, 0x7a, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x76, 0x73, 0x54, 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x4d, 0x61, 0x6c, 0x6c, + 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x63, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x63, 0x6f, 0x6e, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x1a, 0x53, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x70, 0x6b, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x6b, 0x54, 0x65, + 0x61, 0x6d, 0x52, 0x07, 0x70, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x8c, 0x04, 0x0a, 0x06, + 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, + 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x6f, 0x74, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x76, 0x6f, + 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, + 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x45, + 0x6e, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x76, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x04, 0x76, 0x73, 0x41, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x73, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, + 0x73, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x73, + 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x69, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4f, 0x64, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x64, 0x64, + 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x64, + 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x64, 0x64, 0x73, 0x5f, 0x72, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x64, 0x64, 0x73, + 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x64, 0x64, 0x73, 0x5f, 0x64, 0x72, + 0x61, 0x77, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x64, 0x64, 0x73, 0x44, 0x72, + 0x61, 0x77, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, + 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, + 0x67, 0x1a, 0x6f, 0x0a, 0x04, 0x43, 0x68, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, + 0x63, 0x68, 0x61, 0x74, 0x5f, 0x62, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, + 0x68, 0x61, 0x74, 0x42, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x1a, 0xa1, 0x01, 0x0a, 0x09, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xb9, 0x01, 0x0a, 0x09, 0x46, 0x6c, 0x69, 0x70, 0x53, + 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, + 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, + 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, + 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, + 0x6d, 0x67, 0x1a, 0xa7, 0x02, 0x0a, 0x09, 0x47, 0x72, 0x69, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, + 0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, + 0x49, 0x6d, 0x67, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, + 0x6c, 0x61, 0x79, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x49, 0x6d, 0x67, 0x12, 0x1f, 0x0a, + 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, + 0x0a, 0x08, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x67, 0x72, 0x69, 0x64, 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x67, 0x1a, 0xd0, 0x02, 0x0a, + 0x0a, 0x57, 0x68, 0x65, 0x65, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, + 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, + 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, + 0x74, 0x74, 0x6f, 0x6d, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, + 0x74, 0x6f, 0x6d, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x33, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x33, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, + 0x42, 0x74, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, + 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x74, + 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, + 0x3f, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x1a, 0x78, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, + 0x6f, 0x67, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, + 0x6f, 0x73, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x69, 0x6f, 0x73, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x1a, 0x83, 0x0f, 0x0a, 0x06, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x65, + 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x72, 0x75, 0x6c, 0x65, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x22, 0x0a, + 0x0d, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6c, 0x65, 0x42, 0x67, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x19, 0x0a, + 0x08, 0x68, 0x61, 0x73, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x68, 0x61, 0x73, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x32, 0x0a, 0x15, 0x72, 0x61, 0x6e, 0x6b, + 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x61, 0x6e, 0x6b, 0x42, 0x61, 0x63, + 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x0f, + 0x72, 0x61, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x65, 0x78, 0x74, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x67, 0x65, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x11, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x77, + 0x65, 0x63, 0x68, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x69, 0x73, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x69, + 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4d, + 0x61, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x65, 0x77, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x69, 0x6e, 0x6b, + 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x74, 0x6e, 0x54, 0x65, + 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x29, 0x0a, 0x11, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x62, 0x74, 0x6e, 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x74, 0x6e, 0x42, 0x67, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x69, 0x6e, + 0x6b, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, + 0x6f, 0x77, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x73, 0x68, 0x6f, 0x77, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x18, 0x13, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, + 0x6d, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x6d, + 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1c, 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x5f, 0x62, 0x67, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x65, 0x62, 0x42, 0x67, 0x49, + 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x57, 0x65, 0x62, 0x12, 0x1e, 0x0a, 0x0b, 0x68, + 0x61, 0x73, 0x5f, 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x68, 0x61, 0x73, 0x57, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x12, 0x1e, 0x0a, 0x0b, 0x77, + 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x49, 0x6d, 0x67, 0x12, 0x1e, 0x0a, 0x0b, 0x77, + 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x45, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x69, 0x63, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x63, 0x6f, 0x6e, + 0x5f, 0x62, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x69, 0x63, 0x6f, 0x6e, 0x42, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, + 0x64, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, + 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, + 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, + 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, + 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x20, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, + 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, + 0x5f, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, + 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x4c, 0x6f, 0x67, 0x6f, 0x12, 0x2b, 0x0a, 0x12, + 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, + 0x65, 0x72, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x11, 0x64, 0x6c, 0x5f, + 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x23, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, + 0x70, 0x42, 0x74, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, + 0x72, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x24, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x10, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x18, 0x26, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x61, + 0x64, 0x18, 0x27, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x18, 0x28, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x63, 0x6c, 0x6f, 0x73, 0x65, + 0x43, 0x6f, 0x70, 0x79, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6f, + 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x29, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x69, 0x63, + 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x68, + 0x69, 0x74, 0x65, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x68, 0x61, 0x73, 0x57, 0x68, + 0x69, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x68, 0x69, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x63, 0x5f, 0x62, 0x67, 0x18, 0x2c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x63, 0x42, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x64, 0x73, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, 0x64, 0x73, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x2e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x65, + 0x6d, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x75, + 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, + 0x74, 0x73, 0x69, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x30, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x26, 0x0a, + 0x0f, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x18, 0x31, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x63, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x18, 0x32, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x6f, 0x5f, + 0x75, 0x73, 0x65, 0x18, 0x33, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x54, + 0x6f, 0x55, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x34, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x35, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x18, 0x36, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x72, 0x75, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x37, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x6e, 0x63, 0x65, + 0x1a, 0xb9, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x68, 0x6f, + 0x74, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x52, 0x07, 0x68, 0x6f, 0x74, + 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x72, + 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0xab, 0x02, 0x0a, + 0x07, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, + 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x58, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, + 0x5f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x59, + 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x57, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x5f, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x48, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x72, 0x6c, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x9f, 0x02, 0x0a, 0x06, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x70, 0x70, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x2e, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, + 0x38, 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, + 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x41, 0x0a, 0x0b, 0x6e, 0x6f, 0x72, + 0x6d, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x1a, 0xa3, 0x09, 0x0a, + 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, + 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, + 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, + 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x77, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x63, 0x12, 0x1d, + 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, + 0x6e, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, + 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x67, 0x6f, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x61, 0x64, 0x73, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, + 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x64, + 0x73, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x5f, 0x70, 0x72, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, + 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x1a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x1b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x34, + 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, + 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, + 0x73, 0x68, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, + 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x20, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x21, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x67, 0x6f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, + 0x6f, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x23, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x65, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x18, 0x24, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x69, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, + 0x26, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, + 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x18, 0x27, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x1a, 0xc7, 0x02, 0x0a, 0x07, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1d, + 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x1a, 0x66, 0x0a, 0x0a, + 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x1a, 0xa7, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x31, 0x0a, + 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x52, 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x12, 0x34, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x06, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xac, + 0x01, 0x0a, 0x05, 0x46, 0x69, 0x78, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x70, 0x70, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x61, 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x1a, 0xc0, 0x01, + 0x0a, 0x06, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, + 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x62, 0x6f, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x6f, 0x6e, + 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, + 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x38, 0x0a, 0x08, 0x62, 0x6f, 0x74, + 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, + 0x41, 0x6c, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x7d, + 0x0a, 0x09, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x31, 0x0a, 0x07, 0x6b, 0x76, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x1a, 0xa9, 0x09, + 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, + 0x74, 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, + 0x68, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, + 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, + 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, + 0x72, 0x12, 0x31, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, + 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, + 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, 0x65, + 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x16, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, + 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, + 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x1a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, + 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, + 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0b, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x38, 0x0a, 0x08, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x07, 0x6f, + 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x12, 0x41, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x1a, 0xe8, 0x01, 0x0a, 0x0a, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, + 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x70, 0x75, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, + 0x50, 0x75, 0x73, 0x68, 0x1a, 0x77, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, + 0x70, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, + 0x61, 0x79, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x61, + 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x61, 0x79, 0x41, 0x64, 0x64, 0x1a, 0x9f, 0x01, + 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, + 0x1f, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x1a, + 0xda, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x34, + 0x0a, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x6e, 0x6f, + 0x72, 0x6d, 0x61, 0x6c, 0x12, 0x3e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, + 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x1a, 0xa8, 0x01, 0x0a, + 0x09, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x82, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x9b, 0x01, 0x0a, + 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x61, + 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x89, 0x02, 0x0a, 0x0d, 0x4c, + 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, + 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, + 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x80, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x12, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x43, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x52, 0x0b, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x67, 0x0a, 0x0a, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x1a, 0x82, 0x01, 0x0a, 0x0a, 0x51, 0x61, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x38, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x51, 0x61, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, + 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, + 0x69, 0x67, 0x68, 0x74, 0x1a, 0x81, 0x01, 0x0a, 0x0a, 0x51, 0x75, 0x69, 0x7a, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x76, 0x6f, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x1a, 0xa4, 0x02, 0x0a, 0x04, 0x51, 0x75, 0x69, + 0x7a, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, + 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, + 0x65, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3a, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x75, 0x69, 0x7a, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x5f, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x1a, + 0xfc, 0x02, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, + 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, + 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, + 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x41, + 0x73, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x2e, 0x51, 0x61, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x71, 0x61, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x71, 0x61, 0x4e, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x47, 0x75, 0x69, 0x64, 0x65, 0x12, + 0x2d, 0x0a, 0x13, 0x67, 0x75, 0x69, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x67, 0x75, + 0x69, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x1a, 0x86, + 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, + 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, + 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0xb7, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x65, 0x70, 0x5f, 0x6c, 0x6f, 0x6f, + 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x65, 0x70, 0x4c, 0x6f, 0x6f, + 0x70, 0x1a, 0x95, 0x02, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, + 0x69, 0x67, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x73, + 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, + 0x63, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x68, 0x61, 0x73, 0x43, + 0x61, 0x72, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, + 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x43, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, + 0x6f, 0x6f, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x6f, 0x6f, + 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x79, 0x63, 0x6c, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, 0x82, 0x04, 0x0a, 0x04, 0x44, 0x69, + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, + 0x0f, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, + 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x66, + 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x69, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x70, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x61, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x6c, 0x41, 0x67, 0x61, 0x69, 0x6e, 0x12, 0x22, + 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x49, 0x6d, + 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6d, 0x67, 0x1a, 0x66, + 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, + 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x6c, 0x61, 0x6e, 0x6b, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x1a, 0x9b, 0x02, 0x0a, 0x04, 0x47, 0x72, 0x6f, 0x77, 0x12, + 0x1b, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x68, 0x6f, 0x75, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x61, 0x75, 0x74, 0x6f, 0x48, 0x6f, 0x75, 0x72, 0x12, 0x19, 0x0a, 0x08, + 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x61, 0x75, 0x74, 0x6f, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x77, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x77, 0x4e, + 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, + 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x72, 0x65, 0x76, 0x69, 0x76, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x76, + 0x69, 0x76, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, + 0x65, 0x76, 0x69, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x69, 0x65, 0x5f, + 0x68, 0x6f, 0x75, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x69, 0x65, 0x48, + 0x6f, 0x75, 0x72, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x53, 0x74, + 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, + 0x74, 0x4e, 0x75, 0x6d, 0x1a, 0x2c, 0x0a, 0x08, 0x47, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, + 0x75, 0x6d, 0x1a, 0x48, 0x0a, 0x06, 0x42, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x64, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x21, 0x0a, 0x04, + 0x43, 0x68, 0x6f, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x62, 0x61, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x6f, 0x77, 0x42, 0x61, 0x72, 0x1a, + 0xe2, 0x01, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x3b, 0x0a, 0x09, + 0x73, 0x70, 0x69, 0x6e, 0x5f, 0x63, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x70, 0x69, 0x6e, 0x43, 0x61, 0x73, 0x68, 0x52, + 0x08, 0x73, 0x70, 0x69, 0x6e, 0x43, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x1a, 0x0a, + 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x6f, + 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x6f, 0x6f, + 0x70, 0x4e, 0x75, 0x6d, 0x1a, 0x2e, 0x0a, 0x08, 0x53, 0x70, 0x69, 0x6e, 0x43, 0x61, 0x73, 0x68, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, + 0x63, 0x61, 0x73, 0x68, 0x1a, 0x61, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x79, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, + 0x79, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x88, 0x05, 0x0a, 0x04, 0x4b, 0x65, 0x65, 0x70, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x69, 0x74, + 0x5f, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6e, 0x69, 0x74, + 0x47, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x65, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x73, 0x65, 0x63, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x66, 0x65, 0x65, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x66, 0x65, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x5f, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x65, + 0x64, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, + 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x65, 0x65, 0x64, 0x47, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0c, + 0x66, 0x65, 0x65, 0x64, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x47, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x37, + 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, 0x6c, 0x6b, 0x52, 0x08, 0x74, + 0x61, 0x6c, 0x6b, 0x54, 0x65, 0x78, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, + 0x65, 0x70, 0x53, 0x74, 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x12, 0x29, 0x0a, + 0x11, 0x73, 0x65, 0x63, 0x5f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x47, 0x65, 0x74, + 0x44, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, + 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x1a, 0xda, 0x02, 0x0a, 0x06, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x47, 0x65, 0x74, 0x12, 0x27, 0x0a, + 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x74, + 0x68, 0x69, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x65, 0x65, 0x64, + 0x54, 0x68, 0x69, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, + 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0e, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, + 0x22, 0x0a, 0x0d, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x67, 0x65, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, + 0x47, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, + 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x10, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x74, + 0x68, 0x69, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x64, 0x61, 0x79, 0x46, + 0x69, 0x72, 0x73, 0x74, 0x54, 0x68, 0x69, 0x72, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, 0x61, 0x78, 0x47, 0x65, 0x74, 0x1a, + 0x3d, 0x0a, 0x04, 0x54, 0x61, 0x6c, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0xae, + 0x01, 0x0a, 0x08, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, + 0xe9, 0x01, 0x0a, 0x04, 0x50, 0x75, 0x73, 0x68, 0x12, 0x3c, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x74, 0x61, 0x73, + 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x75, + 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x37, 0x0a, + 0x07, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x07, 0x6f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x69, 0x73, 0x69, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x73, + 0x68, 0x4f, 0x6e, 0x65, 0x52, 0x05, 0x76, 0x69, 0x73, 0x69, 0x74, 0x1a, 0x5a, 0x0a, 0x07, 0x50, + 0x75, 0x73, 0x68, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x09, 0x70, 0x75, + 0x73, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x08, 0x70, + 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x64, 0x1a, 0x30, 0x0a, 0x08, 0x50, 0x75, 0x73, 0x68, 0x43, + 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x1a, 0xe2, 0x01, 0x0a, 0x04, 0x47, 0x6f, + 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, + 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x44, 0x61, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x63, 0x65, 0x4e, 0x75, + 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3b, 0x0a, + 0x09, 0x73, 0x70, 0x69, 0x6e, 0x5f, 0x63, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x70, 0x69, 0x6e, 0x43, 0x61, 0x73, 0x68, + 0x52, 0x08, 0x73, 0x70, 0x69, 0x6e, 0x43, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, + 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x1a, 0xc7, + 0x03, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x49, + 0x6d, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x44, 0x61, 0x79, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x6e, 0x69, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x6e, 0x69, 0x74, 0x55, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, + 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x69, + 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x15, + 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x62, 0x74, + 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x61, 0x63, 0x6b, 0x42, 0x74, 0x6e, + 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x42, 0x74, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x57, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x2c, + 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x22, 0x0a, 0x0d, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x74, 0x6e, 0x49, 0x64, + 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x63, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x50, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x5b, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xf5, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x3b, + 0x0a, 0x08, 0x77, 0x65, 0x62, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x07, 0x77, 0x65, 0x62, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x70, 0x0a, 0x03, 0x4f, + 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x8a, 0x01, + 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x54, 0x79, 0x70, 0x65, 0x22, 0x34, 0x0a, 0x10, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x22, 0x38, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x23, + 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x65, + 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x1b, 0x0a, 0x09, 0x4b, 0x76, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x65, 0x0a, 0x09, 0x4b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x02, 0x6b, 0x76, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4b, 0x76, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x02, 0x6b, 0x76, 0x1a, 0x2c, + 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x79, 0x0a, 0x07, + 0x43, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, + 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xa3, 0x01, 0x0a, 0x07, 0x43, 0x65, 0x72, 0x74, + 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x65, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x04, 0x63, 0x65, 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, + 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xbb, 0x01, + 0x0a, 0x0a, 0x42, 0x61, 0x72, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x6c, 0x76, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4c, 0x61, 0x6e, 0x67, 0x12, + 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x9b, 0x02, 0x0a, 0x0a, + 0x42, 0x61, 0x72, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, 0x72, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x7c, 0x0a, + 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, + 0x12, 0x3a, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x76, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4b, + 0x56, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4b, 0x76, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, + 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x34, 0x0a, 0x09, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, + 0xdf, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x49, 0x64, 0x1a, 0x7d, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x22, 0x65, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x64, 0x6c, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x44, 0x64, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x38, 0x0a, 0x0e, 0x44, 0x64, 0x6c, 0x43, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x22, 0x57, 0x0a, 0x0e, 0x44, 0x64, 0x6c, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x34, 0x0a, 0x08, 0x4c, + 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x22, 0x81, 0x28, 0x0a, 0x08, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x57, 0x65, 0x62, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x77, + 0x61, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x57, 0x61, + 0x72, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x64, + 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x43, + 0x6f, 0x76, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x6e, 0x6f, + 0x74, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x0a, 0x6e, 0x6f, + 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x26, 0x0a, 0x0f, 0x74, + 0x65, 0x6d, 0x70, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x61, 0x72, 0x6b, 0x12, 0x20, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x68, 0x61, 0x73, 0x4c, 0x6f, + 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x66, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, + 0x6b, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0x91, 0x0d, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x69, 0x6e, 0x12, + 0x2e, 0x0a, 0x13, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x65, 0x63, 0x68, + 0x61, 0x74, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x67, 0x12, 0x1c, 0x0a, 0x0a, + 0x77, 0x65, 0x62, 0x5f, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x77, 0x65, 0x62, 0x42, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x61, + 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x49, 0x6d, 0x67, 0x12, 0x1a, 0x0a, 0x09, 0x64, 0x6c, + 0x5f, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, + 0x6c, 0x42, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, + 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, + 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6c, 0x6f, 0x67, 0x6f, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, + 0x41, 0x70, 0x70, 0x4c, 0x6f, 0x67, 0x6f, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, + 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x11, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x42, 0x74, 0x6e, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x72, + 0x75, 0x6c, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, + 0x31, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x71, 0x75, 0x69, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x52, 0x04, 0x71, + 0x75, 0x69, 0x74, 0x12, 0x3d, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x51, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x61, 0x69, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x77, 0x61, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x12, 0x3e, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x18, + 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x57, 0x65, 0x62, + 0x12, 0x42, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x45, + 0x78, 0x74, 0x72, 0x61, 0x12, 0x48, 0x0a, 0x10, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, + 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x3b, + 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x73, 0x18, 0x1c, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, + 0x67, 0x52, 0x08, 0x6c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x63, + 0x61, 0x73, 0x68, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, + 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x5f, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x13, 0x0a, 0x05, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x20, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x74, 0x45, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x71, 0x61, 0x5f, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, + 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, 0x71, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x38, 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x22, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, 0x6c, 0x6b, + 0x52, 0x08, 0x74, 0x61, 0x6c, 0x6b, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2f, 0x0a, 0x04, 0x67, 0x6f, + 0x6c, 0x64, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x63, + 0x6f, 0x69, 0x6e, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x25, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x13, 0x0a, + 0x05, 0x70, 0x63, 0x5f, 0x62, 0x67, 0x18, 0x26, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x63, + 0x42, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x27, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x3d, 0x0a, + 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x28, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x03, + 0x75, 0x6e, 0x6f, 0x18, 0x29, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, + 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, 0x1a, 0xd9, 0x01, 0x0a, 0x03, 0x55, + 0x6e, 0x6f, 0x12, 0x30, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, + 0x03, 0x72, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, + 0x43, 0x61, 0x72, 0x64, 0x52, 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x32, 0x0a, 0x04, + 0x62, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, + 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, + 0x12, 0x34, 0x0a, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, + 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x1a, 0x99, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, 0x61, + 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, + 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, + 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, + 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x1a, 0x54, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, + 0x0a, 0x08, 0x70, 0x6b, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x07, 0x70, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x76, 0x0a, 0x06, 0x50, 0x6b, 0x54, 0x65, + 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x31, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, + 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x73, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x1a, 0x9b, 0x01, 0x0a, 0x07, 0x51, 0x61, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x12, 0x1e, 0x0a, 0x0b, 0x71, 0x61, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x61, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x71, 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x67, 0x75, 0x69, 0x64, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x47, 0x75, 0x69, 0x64, 0x65, 0x12, + 0x24, 0x0a, 0x0e, 0x67, 0x75, 0x69, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, 0x75, 0x69, 0x64, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x64, 0x1a, 0x3d, 0x0a, 0x04, 0x54, 0x61, 0x6c, 0x6b, 0x12, 0x1b, 0x0a, + 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x38, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x1a, 0x38, + 0x0a, 0x04, 0x47, 0x6f, 0x6c, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x1a, 0xaa, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x69, + 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x42, 0x74, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x57, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, + 0x2c, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x26, 0x0a, + 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x63, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0xc1, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, + 0x67, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, + 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x39, 0x0a, 0x08, 0x68, 0x6f, 0x74, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, + 0x65, 0x52, 0x07, 0x68, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x6e, + 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x8c, 0x02, 0x0a, 0x07, 0x48, 0x6f, + 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x63, + 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x58, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x59, 0x12, 0x17, 0x0a, + 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x57, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, + 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x48, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0xc3, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x12, 0x42, 0x0a, 0x0a, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x33, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x05, 0x6c, + 0x61, 0x6e, 0x67, 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, + 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, + 0x6e, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x3b, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x1a, 0x77, + 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, + 0x67, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x64, 0x5f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x64, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x83, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x68, 0x0a, + 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x37, + 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x55, 0x0a, 0x04, 0x51, 0x75, 0x69, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x54, + 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, + 0x67, 0x55, 0x72, 0x6c, 0x1a, 0x6e, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x13, 0x0a, 0x05, 0x71, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x71, 0x61, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, + 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xbe, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, + 0x65, 0x6e, 0x5f, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, + 0x70, 0x65, 0x6e, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, + 0x67, 0x6f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, + 0x6f, 0x54, 0x65, 0x78, 0x74, 0x22, 0x47, 0x0a, 0x07, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x22, 0xfd, + 0x1a, 0x0a, 0x07, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x69, + 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, + 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x65, + 0x63, 0x68, 0x61, 0x74, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x67, 0x12, 0x1c, + 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x5f, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x77, 0x65, 0x62, 0x42, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x1e, 0x0a, 0x0b, + 0x77, 0x61, 0x72, 0x6d, 0x5f, 0x75, 0x70, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x77, 0x61, 0x72, 0x6d, 0x55, 0x70, 0x49, 0x6d, 0x67, 0x12, 0x1a, 0x0a, 0x09, + 0x64, 0x6c, 0x5f, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x6c, 0x42, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6c, 0x5f, 0x62, + 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x2b, 0x0a, 0x12, + 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6c, 0x6f, + 0x67, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, + 0x65, 0x72, 0x41, 0x70, 0x70, 0x4c, 0x6f, 0x67, 0x6f, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, + 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, + 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x11, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, + 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x42, 0x74, + 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, + 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x75, 0x6c, + 0x65, 0x12, 0x30, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x71, 0x75, 0x69, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x52, 0x04, 0x71, + 0x75, 0x69, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x3a, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x73, 0x18, 0x14, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, + 0x49, 0x6d, 0x67, 0x52, 0x08, 0x6c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x73, 0x12, 0x2e, 0x0a, + 0x04, 0x63, 0x61, 0x73, 0x68, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, + 0x65, 0x73, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, + 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x71, 0x61, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, 0x71, 0x61, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x37, 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, 0x6c, + 0x6b, 0x52, 0x08, 0x74, 0x61, 0x6c, 0x6b, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x67, + 0x6f, 0x6c, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x63, + 0x6f, 0x69, 0x6e, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x6f, 0x70, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x13, 0x0a, 0x05, + 0x70, 0x63, 0x5f, 0x62, 0x67, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x63, 0x42, + 0x67, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x1d, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x3c, 0x0a, 0x09, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x75, 0x6e, + 0x6f, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, 0x1a, 0xd5, 0x01, 0x0a, 0x03, 0x55, 0x6e, 0x6f, 0x12, + 0x2f, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x03, 0x72, 0x65, 0x64, + 0x12, 0x35, 0x0a, 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, + 0x06, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x31, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, + 0x43, 0x61, 0x72, 0x64, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x67, 0x72, + 0x65, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x1a, + 0xa2, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, + 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, + 0x72, 0x64, 0x4e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, + 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, + 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x53, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x37, 0x0a, 0x08, 0x70, 0x6b, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, + 0x52, 0x07, 0x70, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x75, 0x0a, 0x06, 0x50, 0x6b, 0x54, + 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, + 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x73, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x1a, 0x3d, 0x0a, 0x04, 0x54, 0x61, 0x6c, 0x6b, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x7c, 0x0a, 0x07, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x1e, 0x0a, 0x0b, 0x71, 0x61, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x12, 0x15, 0x0a, 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x71, 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x24, + 0x0a, 0x0e, 0x67, 0x75, 0x69, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, 0x75, 0x69, 0x64, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x1a, 0x54, 0x0a, 0x04, 0x51, 0x75, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x54, 0x0a, 0x06, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, + 0x1a, 0x6d, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x05, + 0x71, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x71, 0x61, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, + 0xa1, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x64, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x6f, 0x54, + 0x65, 0x78, 0x74, 0x1a, 0xb9, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, + 0x08, 0x68, 0x6f, 0x74, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x52, 0x07, + 0x68, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, + 0xab, 0x02, 0x0a, 0x07, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x77, + 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, + 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x78, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x58, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x5f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x59, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x77, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x57, 0x12, 0x17, 0x0a, 0x07, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, + 0x6c, 0x69, 0x63, 0x6b, 0x48, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, + 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x38, 0x0a, + 0x04, 0x43, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x1a, 0x38, 0x0a, 0x04, 0x47, 0x6f, 0x6c, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x1a, 0xaa, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x74, 0x6e, 0x54, 0x65, + 0x78, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x77, 0x65, 0x62, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x57, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x78, 0x74, 0x72, + 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0xea, + 0x1b, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x74, 0x6f, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x74, 0x6f, 0x56, 0x69, 0x65, 0x77, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x69, 0x6e, 0x12, 0x2e, 0x0a, 0x13, + 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x6c, + 0x6f, 0x61, 0x64, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2a, 0x0a, 0x11, + 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x6d, 0x67, 0x12, 0x1c, 0x0a, 0x0a, 0x77, 0x65, 0x62, + 0x5f, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, + 0x65, 0x62, 0x42, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x61, 0x72, 0x6d, 0x5f, + 0x75, 0x70, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x61, + 0x72, 0x6d, 0x55, 0x70, 0x49, 0x6d, 0x67, 0x12, 0x1a, 0x0a, 0x09, 0x64, 0x6c, 0x5f, 0x62, 0x67, + 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x6c, 0x42, 0x67, + 0x49, 0x6d, 0x67, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x6c, 0x42, 0x61, + 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x67, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, + 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, + 0x4c, 0x6f, 0x67, 0x6f, 0x12, 0x2b, 0x0a, 0x12, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x64, 0x6c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x29, 0x0a, 0x11, 0x64, 0x6c, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, + 0x70, 0x70, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x6c, + 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x70, 0x70, 0x42, 0x74, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x05, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x71, 0x75, 0x69, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75, 0x69, 0x74, + 0x52, 0x04, 0x71, 0x75, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, + 0x5f, 0x69, 0x6d, 0x67, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x52, 0x08, + 0x6c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x63, 0x61, 0x73, 0x68, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, + 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x3c, 0x0a, 0x08, 0x71, 0x61, 0x5f, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, 0x71, 0x61, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3b, 0x0a, 0x09, 0x74, 0x61, 0x6c, 0x6b, 0x5f, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x6c, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x6c, 0x6b, 0x54, 0x65, + 0x78, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x47, 0x6f, 0x6c, 0x64, + 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x32, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x1c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x13, 0x0a, 0x05, 0x70, + 0x63, 0x5f, 0x62, 0x67, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x63, 0x42, 0x67, + 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x1f, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x40, 0x0a, 0x09, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, + 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2f, 0x0a, + 0x03, 0x75, 0x6e, 0x6f, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, 0x1a, 0xe5, + 0x01, 0x0a, 0x03, 0x55, 0x6e, 0x6f, 0x12, 0x33, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x55, + 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x79, + 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x06, + 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, + 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x37, 0x0a, + 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, + 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, + 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x1a, 0xa2, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, 0x61, + 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x4e, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, + 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x57, 0x0a, 0x08, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x08, 0x70, 0x6b, 0x5f, 0x74, 0x65, + 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x70, 0x6b, 0x54, + 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x79, 0x0a, 0x06, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, + 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, + 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, + 0x65, 0x61, 0x6d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x73, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x1a, + 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, + 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, + 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x1a, 0x3d, 0x0a, 0x04, 0x54, 0x61, 0x6c, 0x6b, 0x12, 0x1b, + 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x66, 0x0a, 0x07, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x1e, 0x0a, 0x0b, 0x71, 0x61, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, + 0x12, 0x15, 0x0a, 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x71, 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x67, 0x75, 0x69, 0x64, 0x65, + 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x67, 0x75, 0x69, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x1a, 0x38, 0x0a, + 0x04, 0x43, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x1a, 0x38, 0x0a, 0x04, 0x47, 0x6f, 0x6c, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x1a, 0xaa, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x74, 0x6e, 0x54, 0x65, + 0x78, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x77, 0x65, 0x62, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x57, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x78, 0x74, 0x72, + 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x58, + 0x0a, 0x04, 0x51, 0x75, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x3a, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, + 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x54, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x1a, 0x71, + 0x0a, 0x08, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x05, 0x71, 0x61, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x71, 0x61, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x1a, 0xa1, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, + 0x67, 0x6f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, + 0x6f, 0x54, 0x65, 0x78, 0x74, 0x1a, 0xc4, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x6e, 0x67, 0x49, 0x6d, + 0x67, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, + 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x3c, 0x0a, 0x08, 0x68, 0x6f, 0x74, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x6f, 0x74, + 0x5a, 0x6f, 0x6e, 0x65, 0x52, 0x07, 0x68, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, + 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, + 0x6c, 0x61, 0x6e, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x8c, 0x02, 0x0a, + 0x07, 0x48, 0x6f, 0x74, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, + 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x58, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, + 0x5f, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x59, + 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x57, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x5f, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x48, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x2a, 0x0a, 0x0b, 0x53, + 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, + 0x65, 0x77, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, + 0x69, 0x65, 0x77, 0x4c, 0x69, 0x6e, 0x6b, 0x22, 0x29, 0x0a, 0x0e, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x0d, 0x4c, 0x61, 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, + 0xa1, 0x01, 0x0a, 0x0d, 0x4c, 0x61, 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x33, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, + 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x5b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, + 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, + 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x0f, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x8d, 0x04, 0x0a, 0x0f, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x6d, 0x67, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x69, 0x6d, 0x67, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x70, 0x63, 0x5f, 0x62, 0x67, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x63, 0x42, 0x67, 0x12, 0x16, 0x0a, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x61, 0x74, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x74, 0x12, + 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0xac, 0x01, 0x0a, 0x0d, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, + 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6c, 0x61, 0x6e, + 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4c, 0x61, 0x6e, + 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x4d, 0x61, 0x72, 0x6b, 0x22, 0x8c, 0x09, 0x0a, 0x0d, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, + 0x77, 0x65, 0x62, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x57, 0x65, 0x62, 0x12, 0x47, 0x0a, 0x0d, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x45, 0x78, 0x74, + 0x72, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x5f, 0x6e, 0x65, + 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x0f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, + 0x72, 0x1a, 0xb1, 0x06, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, + 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, + 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, 0x68, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, + 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6b, 0x76, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x72, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, + 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x6c, 0x70, 0x50, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x18, + 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x13, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x70, 0x65, + 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x17, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x19, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x1b, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x92, 0x04, 0x0a, 0x0b, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x67, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x67, 0x49, 0x6d, 0x67, 0x12, + 0x44, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6e, + 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3a, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x32, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x1a, 0x2c, 0x0a, 0x02, + 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x39, 0x0a, 0x06, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x6f, 0x64, 0x64, 0x73, 0x1a, 0x21, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x22, 0x36, 0x0a, 0x0b, 0x41, 0x64, 0x73, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x22, 0xe6, 0x03, 0x0a, 0x0c, 0x41, 0x64, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x15, 0x0a, 0x06, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x62, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x45, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, + 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, + 0x64, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x0d, + 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, + 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x1a, 0x2c, 0x0a, + 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x49, 0x0a, 0x06, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x1a, 0x21, 0x0a, 0x04, 0x46, 0x6c, 0x69, 0x70, 0x12, 0x19, + 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x22, 0x37, 0x0a, 0x0c, 0x41, 0x64, 0x73, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x22, 0x25, 0x0a, 0x0a, 0x41, 0x64, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xb3, 0x07, 0x0a, 0x0a, 0x41, 0x64, + 0x73, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x74, 0x65, 0x6d, 0x70, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, + 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x45, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x15, 0x0a, 0x06, 0x62, 0x67, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x62, 0x67, 0x49, 0x6d, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x43, + 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6e, 0x6b, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x10, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x04, 0x66, + 0x6c, 0x69, 0x70, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x46, 0x6c, 0x69, 0x70, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x1a, 0x2c, + 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0xfd, 0x01, 0x0a, + 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x34, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x1a, 0x21, 0x0a, 0x04, + 0x46, 0x6c, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6d, 0x67, 0x22, + 0x82, 0x02, 0x0a, 0x11, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x57, 0x69, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x65, + 0x6d, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0xc9, 0x01, 0x0a, 0x11, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x1a, 0x7b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x2a, 0x0a, 0x0f, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xa9, 0x16, 0x0a, + 0x0f, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, + 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x12, 0x3c, 0x0a, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, + 0x6c, 0x12, 0x49, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, + 0x65, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x05, + 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x4f, + 0x6e, 0x65, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x12, 0x56, 0x0a, 0x0f, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, + 0x6e, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x42, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x52, 0x07, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x73, 0x74, 0x65, 0x70, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x0a, 0x73, 0x74, 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x47, 0x0a, 0x0c, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x4d, 0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, + 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x0e, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x6c, 0x6c, 0x5f, 0x75, 0x73, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x6f, 0x77, 0x41, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x73, + 0x68, 0x6f, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x45, 0x0a, 0x0b, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x0f, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, + 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x38, 0x0a, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x10, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x73, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x44, 0x0a, + 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x75, 0x6e, 0x6f, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x08, 0x75, + 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x73, 0x1a, 0xb6, 0x01, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, + 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, + 0x6f, 0x63, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x24, 0x0a, 0x0e, 0x70, + 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x49, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x4e, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x4e, 0x75, 0x6d, + 0x1a, 0xed, 0x02, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x13, 0x0a, + 0x05, 0x76, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x76, 0x73, + 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x76, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x64, 0x12, 0x38, 0x0a, 0x05, + 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, + 0x12, 0x19, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x77, + 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x77, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, + 0x72, 0x65, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, + 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x7a, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x74, 0x7a, + 0x1a, 0x80, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x69, 0x6e, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x6d, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x77, 0x69, 0x6e, 0x54, 0x65, + 0x61, 0x6d, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, + 0x22, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x75, 0x6d, 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x1a, 0xc9, 0x02, 0x0a, 0x04, 0x50, + 0x6f, 0x6f, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1b, + 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x6e, 0x69, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x6e, 0x69, 0x74, 0x55, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x4e, 0x75, + 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x6e, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x69, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6f, 0x6e, 0x65, 0x55, 0x73, 0x65, 0x43, + 0x6f, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6a, 0x6f, 0x69, 0x6e, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x65, 0x74, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, + 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x61, 0x76, 0x67, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x41, 0x76, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x67, + 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, + 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x1a, 0xfd, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x16, 0x0a, + 0x06, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, + 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x63, + 0x61, 0x6e, 0x5f, 0x75, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x61, 0x6e, + 0x55, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x74, 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, 0x68, 0x61, 0x6e, 0x6b, 0x12, 0x1d, 0x0a, + 0x0a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, + 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, + 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x1a, 0x8a, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x1a, 0x66, 0x0a, 0x07, 0x4c, 0x61, 0x6e, 0x67, 0x4f, 0x6e, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x3e, 0x0a, 0x07, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x7a, 0x0a, 0x10, 0x4c, + 0x61, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x49, 0x0a, 0x0a, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x09, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x6f, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x4f, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x3e, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x5f, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x43, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x7a, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x7a, 0x0a, 0x0d, + 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x7a, 0x52, 0x65, 0x73, 0x12, 0x33, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x54, 0x7a, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x1a, 0x34, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, + 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x27, 0x0a, 0x15, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x15, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x36, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x22, 0xcd, 0x02, 0x0a, 0x0c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, + 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, + 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x69, 0x64, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x03, 0x52, 0x04, 0x70, 0x69, 0x64, 0x73, + 0x22, 0x96, 0x03, 0x0a, 0x0c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x32, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xbb, 0x02, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x69, + 0x6e, 0x64, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x61, + 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x68, 0x61, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x83, 0x12, 0x0a, 0x0d, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3c, + 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3a, 0x0a, 0x05, + 0x77, 0x69, 0x6e, 0x5f, 0x31, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x04, 0x77, 0x69, 0x6e, 0x31, 0x12, 0x3a, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, + 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, + 0x77, 0x69, 0x6e, 0x32, 0x12, 0x3a, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, 0x33, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x77, 0x69, 0x6e, 0x33, + 0x1a, 0xc8, 0x01, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, + 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, + 0x61, 0x72, 0x6b, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xe5, 0x05, 0x0a, 0x06, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x74, 0x68, + 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, 0x68, 0x61, + 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, + 0x5f, 0x64, 0x61, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, + 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, + 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x6c, 0x70, 0x50, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, + 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x70, 0x65, + 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, + 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, + 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, 0x50, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, + 0x61, 0x72, 0x6b, 0x1a, 0xd9, 0x06, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, + 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, + 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, + 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x77, 0x61, 0x74, + 0x63, 0x68, 0x53, 0x65, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, 0x12, + 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x07, + 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, + 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x73, 0x68, 0x6f, + 0x77, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, 0x68, 0x6f, 0x77, 0x12, + 0x26, 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x73, 0x53, 0x74, 0x72, + 0x61, 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, + 0x70, 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, + 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x18, 0x17, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, + 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, + 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x73, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, + 0x38, 0x0a, 0x0d, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xa5, 0x12, 0x0a, 0x0e, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x70, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3b, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, + 0x31, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x04, 0x77, 0x69, 0x6e, 0x31, 0x12, 0x3b, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, 0x32, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x77, 0x69, + 0x6e, 0x32, 0x12, 0x3b, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, 0x33, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x77, 0x69, 0x6e, 0x33, 0x1a, + 0xca, 0x01, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, + 0x61, 0x72, 0x6b, 0x12, 0x37, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xf5, 0x05, 0x0a, + 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x74, + 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, 0x68, + 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, + 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, + 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x68, 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x6c, 0x70, + 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x70, + 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6a, + 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, + 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x17, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x69, 0x6e, 0x69, 0x74, + 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x4d, 0x61, 0x72, 0x6b, 0x1a, 0xda, 0x06, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, + 0x63, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, + 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, + 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, + 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x61, 0x74, + 0x63, 0x68, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x77, 0x61, + 0x74, 0x63, 0x68, 0x53, 0x65, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, + 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x17, 0x0a, + 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x73, 0x68, + 0x6f, 0x77, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, 0x68, 0x6f, 0x77, + 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, + 0x5f, 0x69, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x73, 0x53, 0x74, + 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, + 0x75, 0x70, 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, + 0x70, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x18, 0x17, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x3b, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x22, 0x39, 0x0a, 0x0e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x0c, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xd7, 0x13, 0x0a, 0x0c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, + 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, + 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x45, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, + 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x77, 0x69, 0x6e, 0x31, 0x12, 0x39, 0x0a, + 0x05, 0x77, 0x69, 0x6e, 0x5f, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x04, 0x77, 0x69, 0x6e, 0x32, 0x12, 0x39, 0x0a, 0x05, 0x77, 0x69, 0x6e, 0x5f, + 0x33, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x77, + 0x69, 0x6e, 0x33, 0x1a, 0xc6, 0x01, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x39, 0x0a, + 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x35, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xe7, 0x07, 0x0a, + 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x74, + 0x68, 0x61, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x54, 0x68, + 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, + 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, + 0x6e, 0x44, 0x61, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x12, 0x36, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, + 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, + 0x6c, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x0b, 0x68, 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6c, + 0x69, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x01, 0x52, 0x11, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x17, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, + 0x2c, 0x0a, 0x12, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x6f, 0x70, 0x65, + 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, + 0x64, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x19, + 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x6f, 0x72, + 0x6d, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, + 0x6f, 0x72, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, + 0x1f, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x69, 0x6e, + 0x69, 0x74, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, + 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x1a, 0xd8, 0x06, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, + 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x79, 0x5f, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x61, 0x79, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, + 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x77, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, + 0x65, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, + 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6a, 0x75, 0x6d, 0x70, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4a, 0x75, 0x6d, 0x70, 0x12, + 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, + 0x73, 0x68, 0x6f, 0x77, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, 0x68, + 0x6f, 0x77, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x67, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x73, + 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, + 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, + 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x12, 0x39, 0x0a, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, + 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x6f, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4a, 0x75, 0x6d, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x65, + 0x6e, 0x74, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x70, 0x6e, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x63, 0x70, 0x6e, 0x49, 0x64, 0x73, + 0x22, 0x7e, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4a, 0x75, + 0x6d, 0x70, 0x52, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4a, 0x75, 0x6d, + 0x70, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x30, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, + 0x22, 0x1f, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, + 0x73, 0x22, 0x92, 0x02, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x31, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x75, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0x59, 0x0a, 0x04, 0x43, + 0x6f, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x22, 0x50, 0x0a, 0x0c, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x73, 0x22, 0x6f, 0x0a, 0x0c, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x2b, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x4c, 0x0a, 0x0b, 0x53, 0x65, 0x74, + 0x4c, 0x76, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x4c, 0x76, + 0x41, 0x70, 0x69, 0x52, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x76, 0x41, + 0x70, 0x69, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x3a, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x76, 0x41, 0x70, 0x69, 0x52, 0x65, 0x73, 0x12, 0x15, 0x0a, 0x06, + 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x72, + 0x6c, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xf1, 0x01, 0x0a, 0x0f, 0x56, 0x73, + 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, + 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x5f, + 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x77, + 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x72, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x06, 0x73, + 0x63, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x36, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x8c, 0x02, + 0x0a, 0x0f, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x07, 0x70, 0x6b, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x2e, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x06, 0x70, 0x6b, 0x54, 0x65, 0x61, + 0x6d, 0x1a, 0x52, 0x0a, 0x06, 0x50, 0x6b, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x05, 0x74, + 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, + 0x74, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x22, 0x60, 0x0a, 0x13, + 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xeb, + 0x01, 0x0a, 0x13, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x77, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x49, + 0x64, 0x12, 0x3c, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x1a, + 0x5b, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, + 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, + 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x30, 0x0a, 0x0d, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x32, + 0x0a, 0x0d, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x73, 0x32, 0xd7, 0x18, 0x0a, 0x09, 0x57, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x12, 0x36, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, + 0x65, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x3f, 0x0a, 0x07, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x18, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, + 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3c, 0x0a, + 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x04, 0x53, + 0x68, 0x6f, 0x77, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x51, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x44, + 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x06, + 0x4b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, + 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4b, + 0x76, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x04, 0x43, 0x65, + 0x72, 0x74, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x07, 0x42, 0x61, 0x72, 0x72, 0x61, 0x67, 0x65, 0x12, 0x18, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, + 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x45, 0x0a, 0x09, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x64, 0x6c, 0x12, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x6c, 0x61, 0x74, 0x65, 0x44, 0x64, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x44, 0x64, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0b, 0x44, 0x64, 0x6c, 0x43, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x64, 0x6c, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x64, 0x6c, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x12, 0x16, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x36, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, + 0x15, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, + 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x08, 0x53, 0x61, 0x76, 0x65, + 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, + 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, + 0x61, 0x76, 0x65, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0b, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1c, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, 0x4c, 0x61, 0x6e, + 0x67, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0c, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, + 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1b, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x42, 0x0a, + 0x08, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x45, 0x0a, 0x09, 0x41, 0x64, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, + 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x07, 0x41, 0x64, 0x73, 0x53, + 0x68, 0x6f, 0x77, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0e, 0x43, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x4e, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x4b, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, + 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x7a, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x54, 0x7a, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, + 0x7a, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x12, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x09, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x48, 0x0a, 0x0a, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x1b, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0b, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x09, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, + 0x68, 0x6f, 0x77, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, + 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x54, 0x0a, + 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4a, 0x75, 0x6d, 0x70, 0x12, + 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x54, + 0x61, 0x73, 0x6b, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x65, 0x71, + 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x09, 0x43, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x73, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x42, + 0x0a, 0x08, 0x53, 0x65, 0x74, 0x4c, 0x76, 0x41, 0x70, 0x69, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x76, 0x41, + 0x70, 0x69, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x76, 0x41, 0x70, 0x69, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x42, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4c, 0x76, 0x41, 0x70, 0x69, 0x12, 0x19, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x4c, 0x76, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x76, 0x41, 0x70, + 0x69, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0c, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x10, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x56, 0x73, 0x53, + 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, + 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_campaign_proto_rawDescOnce sync.Once + file_w_campaign_proto_rawDescData = file_w_campaign_proto_rawDesc +) + +func file_w_campaign_proto_rawDescGZIP() []byte { + file_w_campaign_proto_rawDescOnce.Do(func() { + file_w_campaign_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_campaign_proto_rawDescData) + }) + return file_w_campaign_proto_rawDescData +} + +var file_w_campaign_proto_msgTypes = make([]protoimpl.MessageInfo, 393) +var file_w_campaign_proto_goTypes = []interface{}{ + (*ListReq)(nil), // 0: w_campaignpb.ListReq + (*ListRes)(nil), // 1: w_campaignpb.ListRes + (*ShareReq)(nil), // 2: w_campaignpb.ShareReq + (*ShareRes)(nil), // 3: w_campaignpb.ShareRes + (*StatusReq)(nil), // 4: w_campaignpb.StatusReq + (*StatusRes)(nil), // 5: w_campaignpb.StatusRes + (*DestroyReq)(nil), // 6: w_campaignpb.DestroyReq + (*DestroyRes)(nil), // 7: w_campaignpb.DestroyRes + (*StoreReq)(nil), // 8: w_campaignpb.StoreReq + (*StoreRes)(nil), // 9: w_campaignpb.StoreRes + (*UpdateReq)(nil), // 10: w_campaignpb.UpdateReq + (*UpdateRes)(nil), // 11: w_campaignpb.UpdateRes + (*ShowReq)(nil), // 12: w_campaignpb.ShowReq + (*ShowRes)(nil), // 13: w_campaignpb.ShowRes + (*ChannelListReq)(nil), // 14: w_campaignpb.ChannelListReq + (*ChannelListRes)(nil), // 15: w_campaignpb.ChannelListRes + (*ChannelCreateReq)(nil), // 16: w_campaignpb.ChannelCreateReq + (*ChannelCreateRes)(nil), // 17: w_campaignpb.ChannelCreateRes + (*ChannelUpdateReq)(nil), // 18: w_campaignpb.ChannelUpdateReq + (*ChannelUpdateRes)(nil), // 19: w_campaignpb.ChannelUpdateRes + (*ChannelDestroyReq)(nil), // 20: w_campaignpb.ChannelDestroyReq + (*ChannelDestroyRes)(nil), // 21: w_campaignpb.ChannelDestroyRes + (*KvDataReq)(nil), // 22: w_campaignpb.KvDataReq + (*KvDataRes)(nil), // 23: w_campaignpb.KvDataRes + (*CertReq)(nil), // 24: w_campaignpb.CertReq + (*CertRes)(nil), // 25: w_campaignpb.CertRes + (*BarrageReq)(nil), // 26: w_campaignpb.BarrageReq + (*BarrageRes)(nil), // 27: w_campaignpb.BarrageRes + (*OptionReq)(nil), // 28: w_campaignpb.OptionReq + (*OptionRes)(nil), // 29: w_campaignpb.OptionRes + (*RelateDdlReq)(nil), // 30: w_campaignpb.RelateDdlReq + (*RelateDdlRes)(nil), // 31: w_campaignpb.RelateDdlRes + (*DdlCampaignReq)(nil), // 32: w_campaignpb.DdlCampaignReq + (*DdlCampaignRes)(nil), // 33: w_campaignpb.DdlCampaignRes + (*LangsReq)(nil), // 34: w_campaignpb.LangsReq + (*LangsRes)(nil), // 35: w_campaignpb.LangsRes + (*LangReq)(nil), // 36: w_campaignpb.LangReq + (*LangRes)(nil), // 37: w_campaignpb.LangRes + (*SaveLangReq)(nil), // 38: w_campaignpb.SaveLangReq + (*SaveLangRes)(nil), // 39: w_campaignpb.SaveLangRes + (*DestroyLangReq)(nil), // 40: w_campaignpb.DestroyLangReq + (*DestroyLangRes)(nil), // 41: w_campaignpb.DestroyLangRes + (*LangSelectReq)(nil), // 42: w_campaignpb.LangSelectReq + (*LangSelectRes)(nil), // 43: w_campaignpb.LangSelectRes + (*CampaignInfoReq)(nil), // 44: w_campaignpb.CampaignInfoReq + (*CampaignInfoRes)(nil), // 45: w_campaignpb.CampaignInfoRes + (*ShowRewardReq)(nil), // 46: w_campaignpb.ShowRewardReq + (*ShowRewardRes)(nil), // 47: w_campaignpb.ShowRewardRes + (*AdsStoreReq)(nil), // 48: w_campaignpb.AdsStoreReq + (*AdsStoreRes)(nil), // 49: w_campaignpb.AdsStoreRes + (*AdsUpdateReq)(nil), // 50: w_campaignpb.AdsUpdateReq + (*AdsUpdateRes)(nil), // 51: w_campaignpb.AdsUpdateRes + (*AdsShowReq)(nil), // 52: w_campaignpb.AdsShowReq + (*AdsShowRes)(nil), // 53: w_campaignpb.AdsShowRes + (*CampaignSelectReq)(nil), // 54: w_campaignpb.CampaignSelectReq + (*CampaignSelectRes)(nil), // 55: w_campaignpb.CampaignSelectRes + (*RewardDetailReq)(nil), // 56: w_campaignpb.RewardDetailReq + (*RewardDetailRes)(nil), // 57: w_campaignpb.RewardDetailRes + (*UpdateStockReq)(nil), // 58: w_campaignpb.UpdateStockReq + (*UpdateStockRes)(nil), // 59: w_campaignpb.UpdateStockRes + (*CampaignTzReq)(nil), // 60: w_campaignpb.CampaignTzReq + (*CampaignTzRes)(nil), // 61: w_campaignpb.CampaignTzRes + (*CampaignRewardTypeReq)(nil), // 62: w_campaignpb.CampaignRewardTypeReq + (*CampaignRewardTypeRes)(nil), // 63: w_campaignpb.CampaignRewardTypeRes + (*ChildListReq)(nil), // 64: w_campaignpb.ChildListReq + (*ChildListRes)(nil), // 65: w_campaignpb.ChildListRes + (*ChildStoreReq)(nil), // 66: w_campaignpb.ChildStoreReq + (*ChildStoreRes)(nil), // 67: w_campaignpb.ChildStoreRes + (*ChildUpdateReq)(nil), // 68: w_campaignpb.ChildUpdateReq + (*ChildUpdateRes)(nil), // 69: w_campaignpb.ChildUpdateRes + (*ChildShowReq)(nil), // 70: w_campaignpb.ChildShowReq + (*ChildShowRes)(nil), // 71: w_campaignpb.ChildShowRes + (*TaskCenterJumpReq)(nil), // 72: w_campaignpb.TaskCenterJumpReq + (*TaskCenterJumpRes)(nil), // 73: w_campaignpb.TaskCenterJumpRes + (*CondListReq)(nil), // 74: w_campaignpb.CondListReq + (*CondListRes)(nil), // 75: w_campaignpb.CondListRes + (*CampaignsReq)(nil), // 76: w_campaignpb.CampaignsReq + (*CampaignsRes)(nil), // 77: w_campaignpb.CampaignsRes + (*SetLvApiReq)(nil), // 78: w_campaignpb.SetLvApiReq + (*SetLvApiRes)(nil), // 79: w_campaignpb.SetLvApiRes + (*GetLvApiReq)(nil), // 80: w_campaignpb.GetLvApiReq + (*GetLvApiRes)(nil), // 81: w_campaignpb.GetLvApiRes + (*VsSettlementReq)(nil), // 82: w_campaignpb.VsSettlementReq + (*VsSettlementRes)(nil), // 83: w_campaignpb.VsSettlementRes + (*VsSettlementInfoReq)(nil), // 84: w_campaignpb.VsSettlementInfoReq + (*VsSettlementInfoRes)(nil), // 85: w_campaignpb.VsSettlementInfoRes + (*ActionListReq)(nil), // 86: w_campaignpb.ActionListReq + (*ActionListRes)(nil), // 87: w_campaignpb.ActionListRes + (*ListRes_One)(nil), // 88: w_campaignpb.ListRes.One + (*ListRes_LangTz)(nil), // 89: w_campaignpb.ListRes.LangTz + (*ListRes_Channel)(nil), // 90: w_campaignpb.ListRes.Channel + (*ListRes_Cond)(nil), // 91: w_campaignpb.ListRes.Cond + (*ShareRes_One)(nil), // 92: w_campaignpb.ShareRes.One + (*StoreReq_GashaponStyle)(nil), // 93: w_campaignpb.StoreReq.GashaponStyle + (*StoreReq_Event)(nil), // 94: w_campaignpb.StoreReq.Event + (*StoreReq_EventOne)(nil), // 95: w_campaignpb.StoreReq.EventOne + (*StoreReq_EventReward)(nil), // 96: w_campaignpb.StoreReq.EventReward + (*StoreReq_Uno)(nil), // 97: w_campaignpb.StoreReq.Uno + (*StoreReq_UnoGroup)(nil), // 98: w_campaignpb.StoreReq.UnoGroup + (*StoreReq_UnoLimitRule)(nil), // 99: w_campaignpb.StoreReq.UnoLimitRule + (*StoreReq_UnoCard)(nil), // 100: w_campaignpb.StoreReq.UnoCard + (*StoreReq_Vs)(nil), // 101: w_campaignpb.StoreReq.Vs + (*StoreReq_Schedule)(nil), // 102: w_campaignpb.StoreReq.Schedule + (*StoreReq_PkTeam)(nil), // 103: w_campaignpb.StoreReq.PkTeam + (*StoreReq_Team)(nil), // 104: w_campaignpb.StoreReq.Team + (*StoreReq_Chat)(nil), // 105: w_campaignpb.StoreReq.Chat + (*StoreReq_PointsUse)(nil), // 106: w_campaignpb.StoreReq.PointsUse + (*StoreReq_FlipStyle)(nil), // 107: w_campaignpb.StoreReq.FlipStyle + (*StoreReq_GridStyle)(nil), // 108: w_campaignpb.StoreReq.GridStyle + (*StoreReq_WheelStyle)(nil), // 109: w_campaignpb.StoreReq.WheelStyle + (*StoreReq_Child)(nil), // 110: w_campaignpb.StoreReq.Child + (*StoreReq_Config)(nil), // 111: w_campaignpb.StoreReq.Config + (*StoreReq_LongImg)(nil), // 112: w_campaignpb.StoreReq.LongImg + (*StoreReq_HotZone)(nil), // 113: w_campaignpb.StoreReq.HotZone + (*StoreReq_Target)(nil), // 114: w_campaignpb.StoreReq.Target + (*StoreReq_Cond)(nil), // 115: w_campaignpb.StoreReq.Cond + (*StoreReq_BothAll)(nil), // 116: w_campaignpb.StoreReq.BothAll + (*StoreReq_NormalData)(nil), // 117: w_campaignpb.StoreReq.NormalData + (*StoreReq_TargetOption)(nil), // 118: w_campaignpb.StoreReq.TargetOption + (*StoreReq_Fixed)(nil), // 119: w_campaignpb.StoreReq.Fixed + (*StoreReq_Custom)(nil), // 120: w_campaignpb.StoreReq.Custom + (*StoreReq_KV)(nil), // 121: w_campaignpb.StoreReq.KV + (*StoreReq_Reward)(nil), // 122: w_campaignpb.StoreReq.Reward + (*StoreReq_RewardTask)(nil), // 123: w_campaignpb.StoreReq.RewardTask + (*StoreReq_OpenAdd)(nil), // 124: w_campaignpb.StoreReq.OpenAdd + (*StoreReq_CollectRule)(nil), // 125: w_campaignpb.StoreReq.CollectRule + (*StoreReq_Rewards)(nil), // 126: w_campaignpb.StoreReq.Rewards + (*StoreReq_UserLevel)(nil), // 127: w_campaignpb.StoreReq.UserLevel + (*StoreReq_UserLevelOne)(nil), // 128: w_campaignpb.StoreReq.UserLevelOne + (*StoreReq_Lang)(nil), // 129: w_campaignpb.StoreReq.Lang + (*StoreReq_LangUserLevel)(nil), // 130: w_campaignpb.StoreReq.LangUserLevel + (*StoreReq_Country)(nil), // 131: w_campaignpb.StoreReq.Country + (*StoreReq_CountryOne)(nil), // 132: w_campaignpb.StoreReq.CountryOne + (*StoreReq_QaQuestion)(nil), // 133: w_campaignpb.StoreReq.QaQuestion + (*StoreReq_QaOption)(nil), // 134: w_campaignpb.StoreReq.QaOption + (*StoreReq_QuizOption)(nil), // 135: w_campaignpb.StoreReq.QuizOption + (*StoreReq_Quiz)(nil), // 136: w_campaignpb.StoreReq.Quiz + (*StoreReq_QuestionAnswer)(nil), // 137: w_campaignpb.StoreReq.QuestionAnswer + (*StoreReq_LotteryConfig)(nil), // 138: w_campaignpb.StoreReq.LotteryConfig + (*StoreReq_InviteConfig)(nil), // 139: w_campaignpb.StoreReq.InviteConfig + (*StoreReq_Sign)(nil), // 140: w_campaignpb.StoreReq.Sign + (*StoreReq_Dice)(nil), // 141: w_campaignpb.StoreReq.Dice + (*StoreReq_MapPoint)(nil), // 142: w_campaignpb.StoreReq.MapPoint + (*StoreReq_Grow)(nil), // 143: w_campaignpb.StoreReq.Grow + (*StoreReq_GrowStep)(nil), // 144: w_campaignpb.StoreReq.GrowStep + (*StoreReq_Ballot)(nil), // 145: w_campaignpb.StoreReq.Ballot + (*StoreReq_Chop)(nil), // 146: w_campaignpb.StoreReq.Chop + (*StoreReq_Cash)(nil), // 147: w_campaignpb.StoreReq.Cash + (*StoreReq_Flip)(nil), // 148: w_campaignpb.StoreReq.Flip + (*StoreReq_Keep)(nil), // 149: w_campaignpb.StoreReq.Keep + (*StoreReq_Invite)(nil), // 150: w_campaignpb.StoreReq.Invite + (*StoreReq_Talk)(nil), // 151: w_campaignpb.StoreReq.Talk + (*StoreReq_KeepStep)(nil), // 152: w_campaignpb.StoreReq.KeepStep + (*StoreReq_Push)(nil), // 153: w_campaignpb.StoreReq.Push + (*StoreReq_PushOne)(nil), // 154: w_campaignpb.StoreReq.PushOne + (*StoreReq_PushCond)(nil), // 155: w_campaignpb.StoreReq.PushCond + (*StoreReq_Gold)(nil), // 156: w_campaignpb.StoreReq.Gold + (*StoreReq_Coin)(nil), // 157: w_campaignpb.StoreReq.Coin + (*UpdateReq_GashaponStyle)(nil), // 158: w_campaignpb.UpdateReq.GashaponStyle + (*UpdateReq_Event)(nil), // 159: w_campaignpb.UpdateReq.Event + (*UpdateReq_EventOne)(nil), // 160: w_campaignpb.UpdateReq.EventOne + (*UpdateReq_EventReward)(nil), // 161: w_campaignpb.UpdateReq.EventReward + (*UpdateReq_Uno)(nil), // 162: w_campaignpb.UpdateReq.Uno + (*UpdateReq_UnoGroup)(nil), // 163: w_campaignpb.UpdateReq.UnoGroup + (*UpdateReq_UnoLimitRule)(nil), // 164: w_campaignpb.UpdateReq.UnoLimitRule + (*UpdateReq_UnoCard)(nil), // 165: w_campaignpb.UpdateReq.UnoCard + (*UpdateReq_Vs)(nil), // 166: w_campaignpb.UpdateReq.Vs + (*UpdateReq_Schedule)(nil), // 167: w_campaignpb.UpdateReq.Schedule + (*UpdateReq_PkTeam)(nil), // 168: w_campaignpb.UpdateReq.PkTeam + (*UpdateReq_Team)(nil), // 169: w_campaignpb.UpdateReq.Team + (*UpdateReq_Chat)(nil), // 170: w_campaignpb.UpdateReq.Chat + (*UpdateReq_PointsUse)(nil), // 171: w_campaignpb.UpdateReq.PointsUse + (*UpdateReq_FlipStyle)(nil), // 172: w_campaignpb.UpdateReq.FlipStyle + (*UpdateReq_GridStyle)(nil), // 173: w_campaignpb.UpdateReq.GridStyle + (*UpdateReq_WheelStyle)(nil), // 174: w_campaignpb.UpdateReq.WheelStyle + (*UpdateReq_Child)(nil), // 175: w_campaignpb.UpdateReq.Child + (*UpdateReq_Config)(nil), // 176: w_campaignpb.UpdateReq.Config + (*UpdateReq_LongImg)(nil), // 177: w_campaignpb.UpdateReq.LongImg + (*UpdateReq_HotZone)(nil), // 178: w_campaignpb.UpdateReq.HotZone + (*UpdateReq_Target)(nil), // 179: w_campaignpb.UpdateReq.Target + (*UpdateReq_Cond)(nil), // 180: w_campaignpb.UpdateReq.Cond + (*UpdateReq_BothAll)(nil), // 181: w_campaignpb.UpdateReq.BothAll + (*UpdateReq_NormalData)(nil), // 182: w_campaignpb.UpdateReq.NormalData + (*UpdateReq_TargetOption)(nil), // 183: w_campaignpb.UpdateReq.TargetOption + (*UpdateReq_Fixed)(nil), // 184: w_campaignpb.UpdateReq.Fixed + (*UpdateReq_Custom)(nil), // 185: w_campaignpb.UpdateReq.Custom + (*UpdateReq_KV)(nil), // 186: w_campaignpb.UpdateReq.KV + (*UpdateReq_Reward)(nil), // 187: w_campaignpb.UpdateReq.Reward + (*UpdateReq_RewardTask)(nil), // 188: w_campaignpb.UpdateReq.RewardTask + (*UpdateReq_OpenAdd)(nil), // 189: w_campaignpb.UpdateReq.OpenAdd + (*UpdateReq_CollectRule)(nil), // 190: w_campaignpb.UpdateReq.CollectRule + (*UpdateReq_Rewards)(nil), // 191: w_campaignpb.UpdateReq.Rewards + (*UpdateReq_UserLevel)(nil), // 192: w_campaignpb.UpdateReq.UserLevel + (*UpdateReq_UserLevelOne)(nil), // 193: w_campaignpb.UpdateReq.UserLevelOne + (*UpdateReq_Lang)(nil), // 194: w_campaignpb.UpdateReq.Lang + (*UpdateReq_LangUserLevel)(nil), // 195: w_campaignpb.UpdateReq.LangUserLevel + (*UpdateReq_Country)(nil), // 196: w_campaignpb.UpdateReq.Country + (*UpdateReq_CountryOne)(nil), // 197: w_campaignpb.UpdateReq.CountryOne + (*UpdateReq_QaQuestion)(nil), // 198: w_campaignpb.UpdateReq.QaQuestion + (*UpdateReq_QaOption)(nil), // 199: w_campaignpb.UpdateReq.QaOption + (*UpdateReq_QuizOption)(nil), // 200: w_campaignpb.UpdateReq.QuizOption + (*UpdateReq_Quiz)(nil), // 201: w_campaignpb.UpdateReq.Quiz + (*UpdateReq_QuestionAnswer)(nil), // 202: w_campaignpb.UpdateReq.QuestionAnswer + (*UpdateReq_LotteryConfig)(nil), // 203: w_campaignpb.UpdateReq.LotteryConfig + (*UpdateReq_InviteConfig)(nil), // 204: w_campaignpb.UpdateReq.InviteConfig + (*UpdateReq_Sign)(nil), // 205: w_campaignpb.UpdateReq.Sign + (*UpdateReq_Dice)(nil), // 206: w_campaignpb.UpdateReq.Dice + (*UpdateReq_MapPoint)(nil), // 207: w_campaignpb.UpdateReq.MapPoint + (*UpdateReq_Grow)(nil), // 208: w_campaignpb.UpdateReq.Grow + (*UpdateReq_GrowStep)(nil), // 209: w_campaignpb.UpdateReq.GrowStep + (*UpdateReq_Ballot)(nil), // 210: w_campaignpb.UpdateReq.Ballot + (*UpdateReq_Chop)(nil), // 211: w_campaignpb.UpdateReq.Chop + (*UpdateReq_Cash)(nil), // 212: w_campaignpb.UpdateReq.Cash + (*UpdateReq_Flip)(nil), // 213: w_campaignpb.UpdateReq.Flip + (*UpdateReq_Keep)(nil), // 214: w_campaignpb.UpdateReq.Keep + (*UpdateReq_Invite)(nil), // 215: w_campaignpb.UpdateReq.Invite + (*UpdateReq_Talk)(nil), // 216: w_campaignpb.UpdateReq.Talk + (*UpdateReq_KeepStep)(nil), // 217: w_campaignpb.UpdateReq.KeepStep + (*UpdateReq_Push)(nil), // 218: w_campaignpb.UpdateReq.Push + (*UpdateReq_PushOne)(nil), // 219: w_campaignpb.UpdateReq.PushOne + (*UpdateReq_PushCond)(nil), // 220: w_campaignpb.UpdateReq.PushCond + (*UpdateReq_Gold)(nil), // 221: w_campaignpb.UpdateReq.Gold + (*UpdateReq_Coin)(nil), // 222: w_campaignpb.UpdateReq.Coin + (*ShowRes_GashaponStyle)(nil), // 223: w_campaignpb.ShowRes.GashaponStyle + (*ShowRes_Event)(nil), // 224: w_campaignpb.ShowRes.Event + (*ShowRes_EventOne)(nil), // 225: w_campaignpb.ShowRes.EventOne + (*ShowRes_EventReward)(nil), // 226: w_campaignpb.ShowRes.EventReward + (*ShowRes_Uno)(nil), // 227: w_campaignpb.ShowRes.Uno + (*ShowRes_UnoGroup)(nil), // 228: w_campaignpb.ShowRes.UnoGroup + (*ShowRes_UnoLimitRule)(nil), // 229: w_campaignpb.ShowRes.UnoLimitRule + (*ShowRes_UnoCard)(nil), // 230: w_campaignpb.ShowRes.UnoCard + (*ShowRes_Vs)(nil), // 231: w_campaignpb.ShowRes.Vs + (*ShowRes_Schedule)(nil), // 232: w_campaignpb.ShowRes.Schedule + (*ShowRes_PkTeam)(nil), // 233: w_campaignpb.ShowRes.PkTeam + (*ShowRes_Team)(nil), // 234: w_campaignpb.ShowRes.Team + (*ShowRes_Chat)(nil), // 235: w_campaignpb.ShowRes.Chat + (*ShowRes_PointsUse)(nil), // 236: w_campaignpb.ShowRes.PointsUse + (*ShowRes_FlipStyle)(nil), // 237: w_campaignpb.ShowRes.FlipStyle + (*ShowRes_GridStyle)(nil), // 238: w_campaignpb.ShowRes.GridStyle + (*ShowRes_WheelStyle)(nil), // 239: w_campaignpb.ShowRes.WheelStyle + (*ShowRes_Child)(nil), // 240: w_campaignpb.ShowRes.Child + (*ShowRes_Share)(nil), // 241: w_campaignpb.ShowRes.Share + (*ShowRes_Config)(nil), // 242: w_campaignpb.ShowRes.Config + (*ShowRes_LongImg)(nil), // 243: w_campaignpb.ShowRes.LongImg + (*ShowRes_HotZone)(nil), // 244: w_campaignpb.ShowRes.HotZone + (*ShowRes_Target)(nil), // 245: w_campaignpb.ShowRes.Target + (*ShowRes_Cond)(nil), // 246: w_campaignpb.ShowRes.Cond + (*ShowRes_BothAll)(nil), // 247: w_campaignpb.ShowRes.BothAll + (*ShowRes_NormalData)(nil), // 248: w_campaignpb.ShowRes.NormalData + (*ShowRes_TargetOption)(nil), // 249: w_campaignpb.ShowRes.TargetOption + (*ShowRes_Fixed)(nil), // 250: w_campaignpb.ShowRes.Fixed + (*ShowRes_Custom)(nil), // 251: w_campaignpb.ShowRes.Custom + (*ShowRes_KV)(nil), // 252: w_campaignpb.ShowRes.KV + (*ShowRes_WebReward)(nil), // 253: w_campaignpb.ShowRes.WebReward + (*ShowRes_Reward)(nil), // 254: w_campaignpb.ShowRes.Reward + (*ShowRes_RewardTask)(nil), // 255: w_campaignpb.ShowRes.RewardTask + (*ShowRes_OpenAdd)(nil), // 256: w_campaignpb.ShowRes.OpenAdd + (*ShowRes_CollectRule)(nil), // 257: w_campaignpb.ShowRes.CollectRule + (*ShowRes_Rewards)(nil), // 258: w_campaignpb.ShowRes.Rewards + (*ShowRes_UserLevel)(nil), // 259: w_campaignpb.ShowRes.UserLevel + (*ShowRes_UserLevelOne)(nil), // 260: w_campaignpb.ShowRes.UserLevelOne + (*ShowRes_Lang)(nil), // 261: w_campaignpb.ShowRes.Lang + (*ShowRes_LangUserLevel)(nil), // 262: w_campaignpb.ShowRes.LangUserLevel + (*ShowRes_Country)(nil), // 263: w_campaignpb.ShowRes.Country + (*ShowRes_CountryOne)(nil), // 264: w_campaignpb.ShowRes.CountryOne + (*ShowRes_QaQuestion)(nil), // 265: w_campaignpb.ShowRes.QaQuestion + (*ShowRes_QaOption)(nil), // 266: w_campaignpb.ShowRes.QaOption + (*ShowRes_QuizOption)(nil), // 267: w_campaignpb.ShowRes.QuizOption + (*ShowRes_Quiz)(nil), // 268: w_campaignpb.ShowRes.Quiz + (*ShowRes_QuestionAnswer)(nil), // 269: w_campaignpb.ShowRes.QuestionAnswer + (*ShowRes_LotteryConfig)(nil), // 270: w_campaignpb.ShowRes.LotteryConfig + (*ShowRes_InviteConfig)(nil), // 271: w_campaignpb.ShowRes.InviteConfig + (*ShowRes_Sign)(nil), // 272: w_campaignpb.ShowRes.Sign + (*ShowRes_Dice)(nil), // 273: w_campaignpb.ShowRes.Dice + (*ShowRes_MapPoint)(nil), // 274: w_campaignpb.ShowRes.MapPoint + (*ShowRes_Grow)(nil), // 275: w_campaignpb.ShowRes.Grow + (*ShowRes_GrowStep)(nil), // 276: w_campaignpb.ShowRes.GrowStep + (*ShowRes_Ballot)(nil), // 277: w_campaignpb.ShowRes.Ballot + (*ShowRes_Chop)(nil), // 278: w_campaignpb.ShowRes.Chop + (*ShowRes_Cash)(nil), // 279: w_campaignpb.ShowRes.Cash + (*ShowRes_SpinCash)(nil), // 280: w_campaignpb.ShowRes.SpinCash + (*ShowRes_Flip)(nil), // 281: w_campaignpb.ShowRes.Flip + (*ShowRes_Keep)(nil), // 282: w_campaignpb.ShowRes.Keep + (*ShowRes_Invite)(nil), // 283: w_campaignpb.ShowRes.Invite + (*ShowRes_Talk)(nil), // 284: w_campaignpb.ShowRes.Talk + (*ShowRes_KeepStep)(nil), // 285: w_campaignpb.ShowRes.KeepStep + (*ShowRes_Push)(nil), // 286: w_campaignpb.ShowRes.Push + (*ShowRes_PushOne)(nil), // 287: w_campaignpb.ShowRes.PushOne + (*ShowRes_PushCond)(nil), // 288: w_campaignpb.ShowRes.PushCond + (*ShowRes_Gold)(nil), // 289: w_campaignpb.ShowRes.Gold + (*ShowRes_Coin)(nil), // 290: w_campaignpb.ShowRes.Coin + (*ChannelListRes_One)(nil), // 291: w_campaignpb.ChannelListRes.One + (*KvDataRes_KV)(nil), // 292: w_campaignpb.KvDataRes.KV + (*BarrageRes_TranContent)(nil), // 293: w_campaignpb.BarrageRes.TranContent + (*BarrageRes_KV)(nil), // 294: w_campaignpb.BarrageRes.KV + (*OptionRes_Option)(nil), // 295: w_campaignpb.OptionRes.Option + (*LangsRes_Lang)(nil), // 296: w_campaignpb.LangsRes.Lang + (*LangsRes_Uno)(nil), // 297: w_campaignpb.LangsRes.Uno + (*LangsRes_UnoCard)(nil), // 298: w_campaignpb.LangsRes.UnoCard + (*LangsRes_Schedule)(nil), // 299: w_campaignpb.LangsRes.Schedule + (*LangsRes_PkTeam)(nil), // 300: w_campaignpb.LangsRes.PkTeam + (*LangsRes_Team)(nil), // 301: w_campaignpb.LangsRes.Team + (*LangsRes_QaGroup)(nil), // 302: w_campaignpb.LangsRes.QaGroup + (*LangsRes_Talk)(nil), // 303: w_campaignpb.LangsRes.Talk + (*LangsRes_Cash)(nil), // 304: w_campaignpb.LangsRes.Cash + (*LangsRes_Gold)(nil), // 305: w_campaignpb.LangsRes.Gold + (*LangsRes_Coin)(nil), // 306: w_campaignpb.LangsRes.Coin + (*LangsRes_LongImg)(nil), // 307: w_campaignpb.LangsRes.LongImg + (*LangsRes_HotZone)(nil), // 308: w_campaignpb.LangsRes.HotZone + (*LangsRes_Rewards)(nil), // 309: w_campaignpb.LangsRes.Rewards + (*LangsRes_Reward)(nil), // 310: w_campaignpb.LangsRes.Reward + (*LangsRes_UserLevelOne)(nil), // 311: w_campaignpb.LangsRes.UserLevelOne + (*LangsRes_CountryOne)(nil), // 312: w_campaignpb.LangsRes.CountryOne + (*LangsRes_Quit)(nil), // 313: w_campaignpb.LangsRes.Quit + (*LangsRes_Option)(nil), // 314: w_campaignpb.LangsRes.Option + (*LangsRes_Question)(nil), // 315: w_campaignpb.LangsRes.Question + (*LangsRes_Cond)(nil), // 316: w_campaignpb.LangsRes.Cond + (*LangRes_Uno)(nil), // 317: w_campaignpb.LangRes.Uno + (*LangRes_UnoCard)(nil), // 318: w_campaignpb.LangRes.UnoCard + (*LangRes_Schedule)(nil), // 319: w_campaignpb.LangRes.Schedule + (*LangRes_PkTeam)(nil), // 320: w_campaignpb.LangRes.PkTeam + (*LangRes_Team)(nil), // 321: w_campaignpb.LangRes.Team + (*LangRes_Talk)(nil), // 322: w_campaignpb.LangRes.Talk + (*LangRes_QaGroup)(nil), // 323: w_campaignpb.LangRes.QaGroup + (*LangRes_Quit)(nil), // 324: w_campaignpb.LangRes.Quit + (*LangRes_Option)(nil), // 325: w_campaignpb.LangRes.Option + (*LangRes_Question)(nil), // 326: w_campaignpb.LangRes.Question + (*LangRes_Cond)(nil), // 327: w_campaignpb.LangRes.Cond + (*LangRes_LongImg)(nil), // 328: w_campaignpb.LangRes.LongImg + (*LangRes_HotZone)(nil), // 329: w_campaignpb.LangRes.HotZone + (*LangRes_Cash)(nil), // 330: w_campaignpb.LangRes.Cash + (*LangRes_Gold)(nil), // 331: w_campaignpb.LangRes.Gold + (*LangRes_Coin)(nil), // 332: w_campaignpb.LangRes.Coin + (*SaveLangReq_Uno)(nil), // 333: w_campaignpb.SaveLangReq.Uno + (*SaveLangReq_UnoCard)(nil), // 334: w_campaignpb.SaveLangReq.UnoCard + (*SaveLangReq_Schedule)(nil), // 335: w_campaignpb.SaveLangReq.Schedule + (*SaveLangReq_PkTeam)(nil), // 336: w_campaignpb.SaveLangReq.PkTeam + (*SaveLangReq_Team)(nil), // 337: w_campaignpb.SaveLangReq.Team + (*SaveLangReq_Talk)(nil), // 338: w_campaignpb.SaveLangReq.Talk + (*SaveLangReq_QaGroup)(nil), // 339: w_campaignpb.SaveLangReq.QaGroup + (*SaveLangReq_Cash)(nil), // 340: w_campaignpb.SaveLangReq.Cash + (*SaveLangReq_Gold)(nil), // 341: w_campaignpb.SaveLangReq.Gold + (*SaveLangReq_Coin)(nil), // 342: w_campaignpb.SaveLangReq.Coin + (*SaveLangReq_Quit)(nil), // 343: w_campaignpb.SaveLangReq.Quit + (*SaveLangReq_Option)(nil), // 344: w_campaignpb.SaveLangReq.Option + (*SaveLangReq_Question)(nil), // 345: w_campaignpb.SaveLangReq.Question + (*SaveLangReq_Cond)(nil), // 346: w_campaignpb.SaveLangReq.Cond + (*SaveLangReq_LongImg)(nil), // 347: w_campaignpb.SaveLangReq.LongImg + (*SaveLangReq_HotZone)(nil), // 348: w_campaignpb.SaveLangReq.HotZone + (*LangSelectRes_One)(nil), // 349: w_campaignpb.LangSelectRes.One + (*ShowRewardRes_Reward)(nil), // 350: w_campaignpb.ShowRewardRes.Reward + (*ShowRewardRes_KV)(nil), // 351: w_campaignpb.ShowRewardRes.KV + (*AdsStoreReq_KV)(nil), // 352: w_campaignpb.AdsStoreReq.KV + (*AdsStoreReq_Reward)(nil), // 353: w_campaignpb.AdsStoreReq.Reward + (*AdsStoreReq_Flip)(nil), // 354: w_campaignpb.AdsStoreReq.Flip + (*AdsUpdateReq_KV)(nil), // 355: w_campaignpb.AdsUpdateReq.KV + (*AdsUpdateReq_Reward)(nil), // 356: w_campaignpb.AdsUpdateReq.Reward + (*AdsUpdateReq_Flip)(nil), // 357: w_campaignpb.AdsUpdateReq.Flip + (*AdsShowRes_KV)(nil), // 358: w_campaignpb.AdsShowRes.KV + (*AdsShowRes_Reward)(nil), // 359: w_campaignpb.AdsShowRes.Reward + (*AdsShowRes_Flip)(nil), // 360: w_campaignpb.AdsShowRes.Flip + (*CampaignSelectRes_One)(nil), // 361: w_campaignpb.CampaignSelectRes.One + (*RewardDetailRes_UnoCard)(nil), // 362: w_campaignpb.RewardDetailRes.UnoCard + (*RewardDetailRes_Schedule)(nil), // 363: w_campaignpb.RewardDetailRes.Schedule + (*RewardDetailRes_Vote)(nil), // 364: w_campaignpb.RewardDetailRes.Vote + (*RewardDetailRes_Team)(nil), // 365: w_campaignpb.RewardDetailRes.Team + (*RewardDetailRes_Pool)(nil), // 366: w_campaignpb.RewardDetailRes.Pool + (*RewardDetailRes_Reward)(nil), // 367: w_campaignpb.RewardDetailRes.Reward + (*RewardDetailRes_UserLevelOne)(nil), // 368: w_campaignpb.RewardDetailRes.UserLevelOne + (*RewardDetailRes_LangOne)(nil), // 369: w_campaignpb.RewardDetailRes.LangOne + (*RewardDetailRes_LangUserLevelOne)(nil), // 370: w_campaignpb.RewardDetailRes.LangUserLevelOne + (*RewardDetailRes_CountryOne)(nil), // 371: w_campaignpb.RewardDetailRes.CountryOne + (*CampaignTzRes_One)(nil), // 372: w_campaignpb.CampaignTzRes.One + (*CampaignRewardTypeRes_One)(nil), // 373: w_campaignpb.CampaignRewardTypeRes.One + (*ChildListRes_One)(nil), // 374: w_campaignpb.ChildListRes.One + (*ChildStoreReq_TaskGroup)(nil), // 375: w_campaignpb.ChildStoreReq.TaskGroup + (*ChildStoreReq_Reward)(nil), // 376: w_campaignpb.ChildStoreReq.Reward + (*ChildStoreReq_Cond)(nil), // 377: w_campaignpb.ChildStoreReq.Cond + (*ChildUpdateReq_TaskGroup)(nil), // 378: w_campaignpb.ChildUpdateReq.TaskGroup + (*ChildUpdateReq_Reward)(nil), // 379: w_campaignpb.ChildUpdateReq.Reward + (*ChildUpdateReq_Cond)(nil), // 380: w_campaignpb.ChildUpdateReq.Cond + (*ChildShowRes_TaskGroup)(nil), // 381: w_campaignpb.ChildShowRes.TaskGroup + (*ChildShowRes_Reward)(nil), // 382: w_campaignpb.ChildShowRes.Reward + (*ChildShowRes_Cond)(nil), // 383: w_campaignpb.ChildShowRes.Cond + (*ChildShowRes_KV)(nil), // 384: w_campaignpb.ChildShowRes.KV + (*TaskCenterJumpRes_One)(nil), // 385: w_campaignpb.TaskCenterJumpRes.One + (*CondListRes_One)(nil), // 386: w_campaignpb.CondListRes.One + (*CondListRes_Cond)(nil), // 387: w_campaignpb.CondListRes.Cond + (*CampaignsRes_One)(nil), // 388: w_campaignpb.CampaignsRes.One + (*VsSettlementReq_Score)(nil), // 389: w_campaignpb.VsSettlementReq.Score + (*VsSettlementRes_PkTeam)(nil), // 390: w_campaignpb.VsSettlementRes.PkTeam + (*VsSettlementRes_Team)(nil), // 391: w_campaignpb.VsSettlementRes.Team + (*VsSettlementInfoRes_Team)(nil), // 392: w_campaignpb.VsSettlementInfoRes.Team +} +var file_w_campaign_proto_depIdxs = []int32{ + 88, // 0: w_campaignpb.ListRes.list:type_name -> w_campaignpb.ListRes.One + 92, // 1: w_campaignpb.ShareRes.loc:type_name -> w_campaignpb.ShareRes.One + 92, // 2: w_campaignpb.ShareRes.over_sea:type_name -> w_campaignpb.ShareRes.One + 111, // 3: w_campaignpb.StoreReq.config:type_name -> w_campaignpb.StoreReq.Config + 121, // 4: w_campaignpb.StoreReq.campaign_data:type_name -> w_campaignpb.StoreReq.KV + 138, // 5: w_campaignpb.StoreReq.prize_wheel:type_name -> w_campaignpb.StoreReq.LotteryConfig + 138, // 6: w_campaignpb.StoreReq.slot:type_name -> w_campaignpb.StoreReq.LotteryConfig + 138, // 7: w_campaignpb.StoreReq.blind:type_name -> w_campaignpb.StoreReq.LotteryConfig + 138, // 8: w_campaignpb.StoreReq.grid:type_name -> w_campaignpb.StoreReq.LotteryConfig + 139, // 9: w_campaignpb.StoreReq.referral:type_name -> w_campaignpb.StoreReq.InviteConfig + 137, // 10: w_campaignpb.StoreReq.question_answer:type_name -> w_campaignpb.StoreReq.QuestionAnswer + 136, // 11: w_campaignpb.StoreReq.quiz:type_name -> w_campaignpb.StoreReq.Quiz + 139, // 12: w_campaignpb.StoreReq.win:type_name -> w_campaignpb.StoreReq.InviteConfig + 114, // 13: w_campaignpb.StoreReq.target:type_name -> w_campaignpb.StoreReq.Target + 140, // 14: w_campaignpb.StoreReq.sign:type_name -> w_campaignpb.StoreReq.Sign + 141, // 15: w_campaignpb.StoreReq.dice:type_name -> w_campaignpb.StoreReq.Dice + 143, // 16: w_campaignpb.StoreReq.grow:type_name -> w_campaignpb.StoreReq.Grow + 145, // 17: w_campaignpb.StoreReq.ballot:type_name -> w_campaignpb.StoreReq.Ballot + 146, // 18: w_campaignpb.StoreReq.chop:type_name -> w_campaignpb.StoreReq.Chop + 121, // 19: w_campaignpb.StoreReq.delay_link_data:type_name -> w_campaignpb.StoreReq.KV + 126, // 20: w_campaignpb.StoreReq.rewards:type_name -> w_campaignpb.StoreReq.Rewards + 122, // 21: w_campaignpb.StoreReq.rewards_web:type_name -> w_campaignpb.StoreReq.Reward + 122, // 22: w_campaignpb.StoreReq.rewards_extra:type_name -> w_campaignpb.StoreReq.Reward + 122, // 23: w_campaignpb.StoreReq.rewards_newcomer:type_name -> w_campaignpb.StoreReq.Reward + 118, // 24: w_campaignpb.StoreReq.target_option:type_name -> w_campaignpb.StoreReq.TargetOption + 147, // 25: w_campaignpb.StoreReq.cash:type_name -> w_campaignpb.StoreReq.Cash + 112, // 26: w_campaignpb.StoreReq.long_imgs:type_name -> w_campaignpb.StoreReq.LongImg + 148, // 27: w_campaignpb.StoreReq.flip:type_name -> w_campaignpb.StoreReq.Flip + 149, // 28: w_campaignpb.StoreReq.keep_dog:type_name -> w_campaignpb.StoreReq.Keep + 153, // 29: w_campaignpb.StoreReq.push:type_name -> w_campaignpb.StoreReq.Push + 110, // 30: w_campaignpb.StoreReq.child:type_name -> w_campaignpb.StoreReq.Child + 109, // 31: w_campaignpb.StoreReq.wheel_style:type_name -> w_campaignpb.StoreReq.WheelStyle + 156, // 32: w_campaignpb.StoreReq.gold:type_name -> w_campaignpb.StoreReq.Gold + 157, // 33: w_campaignpb.StoreReq.coin:type_name -> w_campaignpb.StoreReq.Coin + 108, // 34: w_campaignpb.StoreReq.grid_style:type_name -> w_campaignpb.StoreReq.GridStyle + 107, // 35: w_campaignpb.StoreReq.flip_style:type_name -> w_campaignpb.StoreReq.FlipStyle + 106, // 36: w_campaignpb.StoreReq.points_use:type_name -> w_campaignpb.StoreReq.PointsUse + 105, // 37: w_campaignpb.StoreReq.chat:type_name -> w_campaignpb.StoreReq.Chat + 101, // 38: w_campaignpb.StoreReq.vs:type_name -> w_campaignpb.StoreReq.Vs + 97, // 39: w_campaignpb.StoreReq.uno:type_name -> w_campaignpb.StoreReq.Uno + 94, // 40: w_campaignpb.StoreReq.event:type_name -> w_campaignpb.StoreReq.Event + 138, // 41: w_campaignpb.StoreReq.gashapon:type_name -> w_campaignpb.StoreReq.LotteryConfig + 93, // 42: w_campaignpb.StoreReq.gashapon_style:type_name -> w_campaignpb.StoreReq.GashaponStyle + 176, // 43: w_campaignpb.UpdateReq.config:type_name -> w_campaignpb.UpdateReq.Config + 186, // 44: w_campaignpb.UpdateReq.campaign_data:type_name -> w_campaignpb.UpdateReq.KV + 203, // 45: w_campaignpb.UpdateReq.prize_wheel:type_name -> w_campaignpb.UpdateReq.LotteryConfig + 203, // 46: w_campaignpb.UpdateReq.slot:type_name -> w_campaignpb.UpdateReq.LotteryConfig + 203, // 47: w_campaignpb.UpdateReq.blind:type_name -> w_campaignpb.UpdateReq.LotteryConfig + 203, // 48: w_campaignpb.UpdateReq.grid:type_name -> w_campaignpb.UpdateReq.LotteryConfig + 204, // 49: w_campaignpb.UpdateReq.referral:type_name -> w_campaignpb.UpdateReq.InviteConfig + 202, // 50: w_campaignpb.UpdateReq.question_answer:type_name -> w_campaignpb.UpdateReq.QuestionAnswer + 201, // 51: w_campaignpb.UpdateReq.quiz:type_name -> w_campaignpb.UpdateReq.Quiz + 204, // 52: w_campaignpb.UpdateReq.win:type_name -> w_campaignpb.UpdateReq.InviteConfig + 179, // 53: w_campaignpb.UpdateReq.target:type_name -> w_campaignpb.UpdateReq.Target + 205, // 54: w_campaignpb.UpdateReq.sign:type_name -> w_campaignpb.UpdateReq.Sign + 206, // 55: w_campaignpb.UpdateReq.dice:type_name -> w_campaignpb.UpdateReq.Dice + 208, // 56: w_campaignpb.UpdateReq.grow:type_name -> w_campaignpb.UpdateReq.Grow + 210, // 57: w_campaignpb.UpdateReq.ballot:type_name -> w_campaignpb.UpdateReq.Ballot + 211, // 58: w_campaignpb.UpdateReq.chop:type_name -> w_campaignpb.UpdateReq.Chop + 186, // 59: w_campaignpb.UpdateReq.delay_link_data:type_name -> w_campaignpb.UpdateReq.KV + 191, // 60: w_campaignpb.UpdateReq.rewards:type_name -> w_campaignpb.UpdateReq.Rewards + 187, // 61: w_campaignpb.UpdateReq.rewards_web:type_name -> w_campaignpb.UpdateReq.Reward + 187, // 62: w_campaignpb.UpdateReq.rewards_extra:type_name -> w_campaignpb.UpdateReq.Reward + 187, // 63: w_campaignpb.UpdateReq.rewards_newcomer:type_name -> w_campaignpb.UpdateReq.Reward + 183, // 64: w_campaignpb.UpdateReq.target_option:type_name -> w_campaignpb.UpdateReq.TargetOption + 212, // 65: w_campaignpb.UpdateReq.cash:type_name -> w_campaignpb.UpdateReq.Cash + 177, // 66: w_campaignpb.UpdateReq.long_imgs:type_name -> w_campaignpb.UpdateReq.LongImg + 213, // 67: w_campaignpb.UpdateReq.flip:type_name -> w_campaignpb.UpdateReq.Flip + 214, // 68: w_campaignpb.UpdateReq.keep_dog:type_name -> w_campaignpb.UpdateReq.Keep + 218, // 69: w_campaignpb.UpdateReq.push:type_name -> w_campaignpb.UpdateReq.Push + 175, // 70: w_campaignpb.UpdateReq.child:type_name -> w_campaignpb.UpdateReq.Child + 174, // 71: w_campaignpb.UpdateReq.wheel_style:type_name -> w_campaignpb.UpdateReq.WheelStyle + 221, // 72: w_campaignpb.UpdateReq.gold:type_name -> w_campaignpb.UpdateReq.Gold + 222, // 73: w_campaignpb.UpdateReq.coin:type_name -> w_campaignpb.UpdateReq.Coin + 173, // 74: w_campaignpb.UpdateReq.grid_style:type_name -> w_campaignpb.UpdateReq.GridStyle + 172, // 75: w_campaignpb.UpdateReq.flip_style:type_name -> w_campaignpb.UpdateReq.FlipStyle + 171, // 76: w_campaignpb.UpdateReq.points_use:type_name -> w_campaignpb.UpdateReq.PointsUse + 170, // 77: w_campaignpb.UpdateReq.chat:type_name -> w_campaignpb.UpdateReq.Chat + 166, // 78: w_campaignpb.UpdateReq.vs:type_name -> w_campaignpb.UpdateReq.Vs + 162, // 79: w_campaignpb.UpdateReq.uno:type_name -> w_campaignpb.UpdateReq.Uno + 159, // 80: w_campaignpb.UpdateReq.event:type_name -> w_campaignpb.UpdateReq.Event + 203, // 81: w_campaignpb.UpdateReq.gashapon:type_name -> w_campaignpb.UpdateReq.LotteryConfig + 158, // 82: w_campaignpb.UpdateReq.gashapon_style:type_name -> w_campaignpb.UpdateReq.GashaponStyle + 242, // 83: w_campaignpb.ShowRes.config:type_name -> w_campaignpb.ShowRes.Config + 241, // 84: w_campaignpb.ShowRes.share:type_name -> w_campaignpb.ShowRes.Share + 252, // 85: w_campaignpb.ShowRes.campaign_data:type_name -> w_campaignpb.ShowRes.KV + 270, // 86: w_campaignpb.ShowRes.prize_wheel:type_name -> w_campaignpb.ShowRes.LotteryConfig + 270, // 87: w_campaignpb.ShowRes.slot:type_name -> w_campaignpb.ShowRes.LotteryConfig + 270, // 88: w_campaignpb.ShowRes.blind:type_name -> w_campaignpb.ShowRes.LotteryConfig + 270, // 89: w_campaignpb.ShowRes.grid:type_name -> w_campaignpb.ShowRes.LotteryConfig + 271, // 90: w_campaignpb.ShowRes.referral:type_name -> w_campaignpb.ShowRes.InviteConfig + 269, // 91: w_campaignpb.ShowRes.question_answer:type_name -> w_campaignpb.ShowRes.QuestionAnswer + 268, // 92: w_campaignpb.ShowRes.quiz:type_name -> w_campaignpb.ShowRes.Quiz + 271, // 93: w_campaignpb.ShowRes.win:type_name -> w_campaignpb.ShowRes.InviteConfig + 245, // 94: w_campaignpb.ShowRes.target:type_name -> w_campaignpb.ShowRes.Target + 272, // 95: w_campaignpb.ShowRes.sign:type_name -> w_campaignpb.ShowRes.Sign + 273, // 96: w_campaignpb.ShowRes.dice:type_name -> w_campaignpb.ShowRes.Dice + 275, // 97: w_campaignpb.ShowRes.grow:type_name -> w_campaignpb.ShowRes.Grow + 277, // 98: w_campaignpb.ShowRes.ballot:type_name -> w_campaignpb.ShowRes.Ballot + 278, // 99: w_campaignpb.ShowRes.chop:type_name -> w_campaignpb.ShowRes.Chop + 252, // 100: w_campaignpb.ShowRes.delay_link_data:type_name -> w_campaignpb.ShowRes.KV + 258, // 101: w_campaignpb.ShowRes.rewards:type_name -> w_campaignpb.ShowRes.Rewards + 254, // 102: w_campaignpb.ShowRes.rewards_web:type_name -> w_campaignpb.ShowRes.Reward + 254, // 103: w_campaignpb.ShowRes.rewards_extra:type_name -> w_campaignpb.ShowRes.Reward + 254, // 104: w_campaignpb.ShowRes.rewards_newcomer:type_name -> w_campaignpb.ShowRes.Reward + 249, // 105: w_campaignpb.ShowRes.target_option:type_name -> w_campaignpb.ShowRes.TargetOption + 279, // 106: w_campaignpb.ShowRes.cash:type_name -> w_campaignpb.ShowRes.Cash + 243, // 107: w_campaignpb.ShowRes.long_imgs:type_name -> w_campaignpb.ShowRes.LongImg + 281, // 108: w_campaignpb.ShowRes.flip:type_name -> w_campaignpb.ShowRes.Flip + 282, // 109: w_campaignpb.ShowRes.keep_dog:type_name -> w_campaignpb.ShowRes.Keep + 286, // 110: w_campaignpb.ShowRes.push:type_name -> w_campaignpb.ShowRes.Push + 240, // 111: w_campaignpb.ShowRes.child:type_name -> w_campaignpb.ShowRes.Child + 239, // 112: w_campaignpb.ShowRes.wheel_style:type_name -> w_campaignpb.ShowRes.WheelStyle + 289, // 113: w_campaignpb.ShowRes.gold:type_name -> w_campaignpb.ShowRes.Gold + 290, // 114: w_campaignpb.ShowRes.coin:type_name -> w_campaignpb.ShowRes.Coin + 238, // 115: w_campaignpb.ShowRes.grid_style:type_name -> w_campaignpb.ShowRes.GridStyle + 237, // 116: w_campaignpb.ShowRes.flip_style:type_name -> w_campaignpb.ShowRes.FlipStyle + 236, // 117: w_campaignpb.ShowRes.points_use:type_name -> w_campaignpb.ShowRes.PointsUse + 235, // 118: w_campaignpb.ShowRes.chat:type_name -> w_campaignpb.ShowRes.Chat + 231, // 119: w_campaignpb.ShowRes.vs:type_name -> w_campaignpb.ShowRes.Vs + 227, // 120: w_campaignpb.ShowRes.uno:type_name -> w_campaignpb.ShowRes.Uno + 224, // 121: w_campaignpb.ShowRes.event:type_name -> w_campaignpb.ShowRes.Event + 270, // 122: w_campaignpb.ShowRes.gashapon:type_name -> w_campaignpb.ShowRes.LotteryConfig + 223, // 123: w_campaignpb.ShowRes.gashapon_style:type_name -> w_campaignpb.ShowRes.GashaponStyle + 291, // 124: w_campaignpb.ChannelListRes.list:type_name -> w_campaignpb.ChannelListRes.One + 291, // 125: w_campaignpb.ChannelListRes.web_list:type_name -> w_campaignpb.ChannelListRes.One + 292, // 126: w_campaignpb.KvDataRes.kv:type_name -> w_campaignpb.KvDataRes.KV + 293, // 127: w_campaignpb.BarrageRes.tran_content:type_name -> w_campaignpb.BarrageRes.TranContent + 295, // 128: w_campaignpb.OptionRes.options:type_name -> w_campaignpb.OptionRes.Option + 296, // 129: w_campaignpb.LangsRes.langs:type_name -> w_campaignpb.LangsRes.Lang + 296, // 130: w_campaignpb.LangsRes.not_support:type_name -> w_campaignpb.LangsRes.Lang + 327, // 131: w_campaignpb.LangRes.conds:type_name -> w_campaignpb.LangRes.Cond + 324, // 132: w_campaignpb.LangRes.quit:type_name -> w_campaignpb.LangRes.Quit + 326, // 133: w_campaignpb.LangRes.questions:type_name -> w_campaignpb.LangRes.Question + 328, // 134: w_campaignpb.LangRes.long_imgs:type_name -> w_campaignpb.LangRes.LongImg + 330, // 135: w_campaignpb.LangRes.cash:type_name -> w_campaignpb.LangRes.Cash + 323, // 136: w_campaignpb.LangRes.qa_group:type_name -> w_campaignpb.LangRes.QaGroup + 322, // 137: w_campaignpb.LangRes.talk_text:type_name -> w_campaignpb.LangRes.Talk + 331, // 138: w_campaignpb.LangRes.gold:type_name -> w_campaignpb.LangRes.Gold + 332, // 139: w_campaignpb.LangRes.coin:type_name -> w_campaignpb.LangRes.Coin + 319, // 140: w_campaignpb.LangRes.schedules:type_name -> w_campaignpb.LangRes.Schedule + 317, // 141: w_campaignpb.LangRes.uno:type_name -> w_campaignpb.LangRes.Uno + 346, // 142: w_campaignpb.SaveLangReq.conds:type_name -> w_campaignpb.SaveLangReq.Cond + 343, // 143: w_campaignpb.SaveLangReq.quit:type_name -> w_campaignpb.SaveLangReq.Quit + 345, // 144: w_campaignpb.SaveLangReq.questions:type_name -> w_campaignpb.SaveLangReq.Question + 347, // 145: w_campaignpb.SaveLangReq.long_imgs:type_name -> w_campaignpb.SaveLangReq.LongImg + 340, // 146: w_campaignpb.SaveLangReq.cash:type_name -> w_campaignpb.SaveLangReq.Cash + 339, // 147: w_campaignpb.SaveLangReq.qa_group:type_name -> w_campaignpb.SaveLangReq.QaGroup + 338, // 148: w_campaignpb.SaveLangReq.talk_text:type_name -> w_campaignpb.SaveLangReq.Talk + 341, // 149: w_campaignpb.SaveLangReq.gold:type_name -> w_campaignpb.SaveLangReq.Gold + 342, // 150: w_campaignpb.SaveLangReq.coin:type_name -> w_campaignpb.SaveLangReq.Coin + 335, // 151: w_campaignpb.SaveLangReq.schedules:type_name -> w_campaignpb.SaveLangReq.Schedule + 333, // 152: w_campaignpb.SaveLangReq.uno:type_name -> w_campaignpb.SaveLangReq.Uno + 349, // 153: w_campaignpb.LangSelectRes.list:type_name -> w_campaignpb.LangSelectRes.One + 350, // 154: w_campaignpb.ShowRewardRes.rewards:type_name -> w_campaignpb.ShowRewardRes.Reward + 350, // 155: w_campaignpb.ShowRewardRes.rewards_web:type_name -> w_campaignpb.ShowRewardRes.Reward + 350, // 156: w_campaignpb.ShowRewardRes.rewards_extra:type_name -> w_campaignpb.ShowRewardRes.Reward + 350, // 157: w_campaignpb.ShowRewardRes.rewards_newcomer:type_name -> w_campaignpb.ShowRewardRes.Reward + 352, // 158: w_campaignpb.AdsStoreReq.delay_link_data:type_name -> w_campaignpb.AdsStoreReq.KV + 353, // 159: w_campaignpb.AdsStoreReq.rewards:type_name -> w_campaignpb.AdsStoreReq.Reward + 354, // 160: w_campaignpb.AdsStoreReq.flip:type_name -> w_campaignpb.AdsStoreReq.Flip + 355, // 161: w_campaignpb.AdsUpdateReq.delay_link_data:type_name -> w_campaignpb.AdsUpdateReq.KV + 356, // 162: w_campaignpb.AdsUpdateReq.rewards:type_name -> w_campaignpb.AdsUpdateReq.Reward + 357, // 163: w_campaignpb.AdsUpdateReq.flip:type_name -> w_campaignpb.AdsUpdateReq.Flip + 358, // 164: w_campaignpb.AdsShowRes.delay_link_data:type_name -> w_campaignpb.AdsShowRes.KV + 359, // 165: w_campaignpb.AdsShowRes.rewards:type_name -> w_campaignpb.AdsShowRes.Reward + 360, // 166: w_campaignpb.AdsShowRes.flip:type_name -> w_campaignpb.AdsShowRes.Flip + 361, // 167: w_campaignpb.CampaignSelectRes.list:type_name -> w_campaignpb.CampaignSelectRes.One + 367, // 168: w_campaignpb.RewardDetailRes.normal:type_name -> w_campaignpb.RewardDetailRes.Reward + 368, // 169: w_campaignpb.RewardDetailRes.user_level:type_name -> w_campaignpb.RewardDetailRes.UserLevelOne + 369, // 170: w_campaignpb.RewardDetailRes.langs:type_name -> w_campaignpb.RewardDetailRes.LangOne + 370, // 171: w_campaignpb.RewardDetailRes.lang_user_level:type_name -> w_campaignpb.RewardDetailRes.LangUserLevelOne + 371, // 172: w_campaignpb.RewardDetailRes.country:type_name -> w_campaignpb.RewardDetailRes.CountryOne + 367, // 173: w_campaignpb.RewardDetailRes.step_reward:type_name -> w_campaignpb.RewardDetailRes.Reward + 367, // 174: w_campaignpb.RewardDetailRes.extra_reward:type_name -> w_campaignpb.RewardDetailRes.Reward + 367, // 175: w_campaignpb.RewardDetailRes.newcomer_reward:type_name -> w_campaignpb.RewardDetailRes.Reward + 367, // 176: w_campaignpb.RewardDetailRes.task_reward:type_name -> w_campaignpb.RewardDetailRes.Reward + 366, // 177: w_campaignpb.RewardDetailRes.pools:type_name -> w_campaignpb.RewardDetailRes.Pool + 363, // 178: w_campaignpb.RewardDetailRes.schedules:type_name -> w_campaignpb.RewardDetailRes.Schedule + 362, // 179: w_campaignpb.RewardDetailRes.uno_cards:type_name -> w_campaignpb.RewardDetailRes.UnoCard + 372, // 180: w_campaignpb.CampaignTzRes.list:type_name -> w_campaignpb.CampaignTzRes.One + 373, // 181: w_campaignpb.CampaignRewardTypeRes.list:type_name -> w_campaignpb.CampaignRewardTypeRes.One + 374, // 182: w_campaignpb.ChildListRes.list:type_name -> w_campaignpb.ChildListRes.One + 376, // 183: w_campaignpb.ChildStoreReq.rewards:type_name -> w_campaignpb.ChildStoreReq.Reward + 375, // 184: w_campaignpb.ChildStoreReq.win_1:type_name -> w_campaignpb.ChildStoreReq.TaskGroup + 375, // 185: w_campaignpb.ChildStoreReq.win_2:type_name -> w_campaignpb.ChildStoreReq.TaskGroup + 375, // 186: w_campaignpb.ChildStoreReq.win_3:type_name -> w_campaignpb.ChildStoreReq.TaskGroup + 379, // 187: w_campaignpb.ChildUpdateReq.rewards:type_name -> w_campaignpb.ChildUpdateReq.Reward + 378, // 188: w_campaignpb.ChildUpdateReq.win_1:type_name -> w_campaignpb.ChildUpdateReq.TaskGroup + 378, // 189: w_campaignpb.ChildUpdateReq.win_2:type_name -> w_campaignpb.ChildUpdateReq.TaskGroup + 378, // 190: w_campaignpb.ChildUpdateReq.win_3:type_name -> w_campaignpb.ChildUpdateReq.TaskGroup + 382, // 191: w_campaignpb.ChildShowRes.rewards:type_name -> w_campaignpb.ChildShowRes.Reward + 381, // 192: w_campaignpb.ChildShowRes.win_1:type_name -> w_campaignpb.ChildShowRes.TaskGroup + 381, // 193: w_campaignpb.ChildShowRes.win_2:type_name -> w_campaignpb.ChildShowRes.TaskGroup + 381, // 194: w_campaignpb.ChildShowRes.win_3:type_name -> w_campaignpb.ChildShowRes.TaskGroup + 385, // 195: w_campaignpb.TaskCenterJumpRes.list:type_name -> w_campaignpb.TaskCenterJumpRes.One + 386, // 196: w_campaignpb.CondListRes.list:type_name -> w_campaignpb.CondListRes.One + 388, // 197: w_campaignpb.CampaignsRes.list:type_name -> w_campaignpb.CampaignsRes.One + 389, // 198: w_campaignpb.VsSettlementReq.scores:type_name -> w_campaignpb.VsSettlementReq.Score + 390, // 199: w_campaignpb.VsSettlementRes.pk_team:type_name -> w_campaignpb.VsSettlementRes.PkTeam + 392, // 200: w_campaignpb.VsSettlementInfoRes.teams:type_name -> w_campaignpb.VsSettlementInfoRes.Team + 89, // 201: w_campaignpb.ListRes.One.lang_tz:type_name -> w_campaignpb.ListRes.LangTz + 90, // 202: w_campaignpb.ListRes.One.channel_list:type_name -> w_campaignpb.ListRes.Channel + 91, // 203: w_campaignpb.ListRes.One.cond_list:type_name -> w_campaignpb.ListRes.Cond + 95, // 204: w_campaignpb.StoreReq.Event.first_visit:type_name -> w_campaignpb.StoreReq.EventOne + 96, // 205: w_campaignpb.StoreReq.EventOne.rewards:type_name -> w_campaignpb.StoreReq.EventReward + 122, // 206: w_campaignpb.StoreReq.EventReward.reward:type_name -> w_campaignpb.StoreReq.Reward + 98, // 207: w_campaignpb.StoreReq.Uno.red:type_name -> w_campaignpb.StoreReq.UnoGroup + 98, // 208: w_campaignpb.StoreReq.Uno.yellow:type_name -> w_campaignpb.StoreReq.UnoGroup + 98, // 209: w_campaignpb.StoreReq.Uno.blue:type_name -> w_campaignpb.StoreReq.UnoGroup + 98, // 210: w_campaignpb.StoreReq.Uno.green:type_name -> w_campaignpb.StoreReq.UnoGroup + 122, // 211: w_campaignpb.StoreReq.UnoGroup.reward:type_name -> w_campaignpb.StoreReq.Reward + 99, // 212: w_campaignpb.StoreReq.UnoGroup.limit_rule:type_name -> w_campaignpb.StoreReq.UnoLimitRule + 100, // 213: w_campaignpb.StoreReq.UnoGroup.cards:type_name -> w_campaignpb.StoreReq.UnoCard + 102, // 214: w_campaignpb.StoreReq.Vs.schedules:type_name -> w_campaignpb.StoreReq.Schedule + 103, // 215: w_campaignpb.StoreReq.Schedule.pk_teams:type_name -> w_campaignpb.StoreReq.PkTeam + 104, // 216: w_campaignpb.StoreReq.PkTeam.teams:type_name -> w_campaignpb.StoreReq.Team + 113, // 217: w_campaignpb.StoreReq.LongImg.hot_zone:type_name -> w_campaignpb.StoreReq.HotZone + 115, // 218: w_campaignpb.StoreReq.Target.cond:type_name -> w_campaignpb.StoreReq.Cond + 116, // 219: w_campaignpb.StoreReq.Target.both_all:type_name -> w_campaignpb.StoreReq.BothAll + 117, // 220: w_campaignpb.StoreReq.Target.normal_data:type_name -> w_campaignpb.StoreReq.NormalData + 122, // 221: w_campaignpb.StoreReq.Cond.reward:type_name -> w_campaignpb.StoreReq.Reward + 122, // 222: w_campaignpb.StoreReq.BothAll.reward:type_name -> w_campaignpb.StoreReq.Reward + 119, // 223: w_campaignpb.StoreReq.TargetOption.fixed:type_name -> w_campaignpb.StoreReq.Fixed + 120, // 224: w_campaignpb.StoreReq.TargetOption.custom:type_name -> w_campaignpb.StoreReq.Custom + 115, // 225: w_campaignpb.StoreReq.Custom.cond:type_name -> w_campaignpb.StoreReq.Cond + 116, // 226: w_campaignpb.StoreReq.Custom.both_all:type_name -> w_campaignpb.StoreReq.BothAll + 125, // 227: w_campaignpb.StoreReq.Reward.collect_rule:type_name -> w_campaignpb.StoreReq.CollectRule + 124, // 228: w_campaignpb.StoreReq.Reward.open_add:type_name -> w_campaignpb.StoreReq.OpenAdd + 123, // 229: w_campaignpb.StoreReq.Reward.reward_task:type_name -> w_campaignpb.StoreReq.RewardTask + 122, // 230: w_campaignpb.StoreReq.Rewards.normal:type_name -> w_campaignpb.StoreReq.Reward + 127, // 231: w_campaignpb.StoreReq.Rewards.user_level:type_name -> w_campaignpb.StoreReq.UserLevel + 129, // 232: w_campaignpb.StoreReq.Rewards.langs:type_name -> w_campaignpb.StoreReq.Lang + 130, // 233: w_campaignpb.StoreReq.Rewards.lang_user_level:type_name -> w_campaignpb.StoreReq.LangUserLevel + 131, // 234: w_campaignpb.StoreReq.Rewards.country:type_name -> w_campaignpb.StoreReq.Country + 128, // 235: w_campaignpb.StoreReq.UserLevel.level_list:type_name -> w_campaignpb.StoreReq.UserLevelOne + 122, // 236: w_campaignpb.StoreReq.UserLevelOne.rewards:type_name -> w_campaignpb.StoreReq.Reward + 122, // 237: w_campaignpb.StoreReq.Lang.rewards:type_name -> w_campaignpb.StoreReq.Reward + 128, // 238: w_campaignpb.StoreReq.LangUserLevel.level_list:type_name -> w_campaignpb.StoreReq.UserLevelOne + 132, // 239: w_campaignpb.StoreReq.Country.country_list:type_name -> w_campaignpb.StoreReq.CountryOne + 122, // 240: w_campaignpb.StoreReq.CountryOne.rewards:type_name -> w_campaignpb.StoreReq.Reward + 134, // 241: w_campaignpb.StoreReq.QaQuestion.options:type_name -> w_campaignpb.StoreReq.QaOption + 135, // 242: w_campaignpb.StoreReq.Quiz.options:type_name -> w_campaignpb.StoreReq.QuizOption + 133, // 243: w_campaignpb.StoreReq.QuestionAnswer.questions:type_name -> w_campaignpb.StoreReq.QaQuestion + 142, // 244: w_campaignpb.StoreReq.Dice.map_point:type_name -> w_campaignpb.StoreReq.MapPoint + 144, // 245: w_campaignpb.StoreReq.Grow.steps:type_name -> w_campaignpb.StoreReq.GrowStep + 150, // 246: w_campaignpb.StoreReq.Keep.invite:type_name -> w_campaignpb.StoreReq.Invite + 151, // 247: w_campaignpb.StoreReq.Keep.talk_text:type_name -> w_campaignpb.StoreReq.Talk + 152, // 248: w_campaignpb.StoreReq.Keep.steps:type_name -> w_campaignpb.StoreReq.KeepStep + 122, // 249: w_campaignpb.StoreReq.KeepStep.reward:type_name -> w_campaignpb.StoreReq.Reward + 154, // 250: w_campaignpb.StoreReq.Push.task_reset:type_name -> w_campaignpb.StoreReq.PushOne + 154, // 251: w_campaignpb.StoreReq.Push.active:type_name -> w_campaignpb.StoreReq.PushOne + 154, // 252: w_campaignpb.StoreReq.Push.offline:type_name -> w_campaignpb.StoreReq.PushOne + 154, // 253: w_campaignpb.StoreReq.Push.visit:type_name -> w_campaignpb.StoreReq.PushOne + 155, // 254: w_campaignpb.StoreReq.PushOne.push_cond:type_name -> w_campaignpb.StoreReq.PushCond + 160, // 255: w_campaignpb.UpdateReq.Event.first_visit:type_name -> w_campaignpb.UpdateReq.EventOne + 161, // 256: w_campaignpb.UpdateReq.EventOne.rewards:type_name -> w_campaignpb.UpdateReq.EventReward + 187, // 257: w_campaignpb.UpdateReq.EventReward.reward:type_name -> w_campaignpb.UpdateReq.Reward + 163, // 258: w_campaignpb.UpdateReq.Uno.red:type_name -> w_campaignpb.UpdateReq.UnoGroup + 163, // 259: w_campaignpb.UpdateReq.Uno.yellow:type_name -> w_campaignpb.UpdateReq.UnoGroup + 163, // 260: w_campaignpb.UpdateReq.Uno.blue:type_name -> w_campaignpb.UpdateReq.UnoGroup + 163, // 261: w_campaignpb.UpdateReq.Uno.green:type_name -> w_campaignpb.UpdateReq.UnoGroup + 187, // 262: w_campaignpb.UpdateReq.UnoGroup.reward:type_name -> w_campaignpb.UpdateReq.Reward + 164, // 263: w_campaignpb.UpdateReq.UnoGroup.limit_rule:type_name -> w_campaignpb.UpdateReq.UnoLimitRule + 165, // 264: w_campaignpb.UpdateReq.UnoGroup.cards:type_name -> w_campaignpb.UpdateReq.UnoCard + 167, // 265: w_campaignpb.UpdateReq.Vs.schedules:type_name -> w_campaignpb.UpdateReq.Schedule + 168, // 266: w_campaignpb.UpdateReq.Schedule.pk_teams:type_name -> w_campaignpb.UpdateReq.PkTeam + 169, // 267: w_campaignpb.UpdateReq.PkTeam.teams:type_name -> w_campaignpb.UpdateReq.Team + 178, // 268: w_campaignpb.UpdateReq.LongImg.hot_zone:type_name -> w_campaignpb.UpdateReq.HotZone + 180, // 269: w_campaignpb.UpdateReq.Target.cond:type_name -> w_campaignpb.UpdateReq.Cond + 181, // 270: w_campaignpb.UpdateReq.Target.both_all:type_name -> w_campaignpb.UpdateReq.BothAll + 182, // 271: w_campaignpb.UpdateReq.Target.normal_data:type_name -> w_campaignpb.UpdateReq.NormalData + 187, // 272: w_campaignpb.UpdateReq.Cond.reward:type_name -> w_campaignpb.UpdateReq.Reward + 187, // 273: w_campaignpb.UpdateReq.BothAll.reward:type_name -> w_campaignpb.UpdateReq.Reward + 184, // 274: w_campaignpb.UpdateReq.TargetOption.fixed:type_name -> w_campaignpb.UpdateReq.Fixed + 185, // 275: w_campaignpb.UpdateReq.TargetOption.custom:type_name -> w_campaignpb.UpdateReq.Custom + 180, // 276: w_campaignpb.UpdateReq.Custom.cond:type_name -> w_campaignpb.UpdateReq.Cond + 181, // 277: w_campaignpb.UpdateReq.Custom.both_all:type_name -> w_campaignpb.UpdateReq.BothAll + 190, // 278: w_campaignpb.UpdateReq.Reward.collect_rule:type_name -> w_campaignpb.UpdateReq.CollectRule + 189, // 279: w_campaignpb.UpdateReq.Reward.open_add:type_name -> w_campaignpb.UpdateReq.OpenAdd + 188, // 280: w_campaignpb.UpdateReq.Reward.reward_task:type_name -> w_campaignpb.UpdateReq.RewardTask + 187, // 281: w_campaignpb.UpdateReq.Rewards.normal:type_name -> w_campaignpb.UpdateReq.Reward + 192, // 282: w_campaignpb.UpdateReq.Rewards.user_level:type_name -> w_campaignpb.UpdateReq.UserLevel + 194, // 283: w_campaignpb.UpdateReq.Rewards.langs:type_name -> w_campaignpb.UpdateReq.Lang + 195, // 284: w_campaignpb.UpdateReq.Rewards.lang_user_level:type_name -> w_campaignpb.UpdateReq.LangUserLevel + 196, // 285: w_campaignpb.UpdateReq.Rewards.country:type_name -> w_campaignpb.UpdateReq.Country + 193, // 286: w_campaignpb.UpdateReq.UserLevel.level_list:type_name -> w_campaignpb.UpdateReq.UserLevelOne + 187, // 287: w_campaignpb.UpdateReq.UserLevelOne.rewards:type_name -> w_campaignpb.UpdateReq.Reward + 187, // 288: w_campaignpb.UpdateReq.Lang.rewards:type_name -> w_campaignpb.UpdateReq.Reward + 193, // 289: w_campaignpb.UpdateReq.LangUserLevel.level_list:type_name -> w_campaignpb.UpdateReq.UserLevelOne + 197, // 290: w_campaignpb.UpdateReq.Country.country_list:type_name -> w_campaignpb.UpdateReq.CountryOne + 187, // 291: w_campaignpb.UpdateReq.CountryOne.rewards:type_name -> w_campaignpb.UpdateReq.Reward + 199, // 292: w_campaignpb.UpdateReq.QaQuestion.options:type_name -> w_campaignpb.UpdateReq.QaOption + 200, // 293: w_campaignpb.UpdateReq.Quiz.options:type_name -> w_campaignpb.UpdateReq.QuizOption + 198, // 294: w_campaignpb.UpdateReq.QuestionAnswer.questions:type_name -> w_campaignpb.UpdateReq.QaQuestion + 207, // 295: w_campaignpb.UpdateReq.Dice.map_point:type_name -> w_campaignpb.UpdateReq.MapPoint + 209, // 296: w_campaignpb.UpdateReq.Grow.steps:type_name -> w_campaignpb.UpdateReq.GrowStep + 215, // 297: w_campaignpb.UpdateReq.Keep.invite:type_name -> w_campaignpb.UpdateReq.Invite + 216, // 298: w_campaignpb.UpdateReq.Keep.talk_text:type_name -> w_campaignpb.UpdateReq.Talk + 217, // 299: w_campaignpb.UpdateReq.Keep.steps:type_name -> w_campaignpb.UpdateReq.KeepStep + 187, // 300: w_campaignpb.UpdateReq.KeepStep.reward:type_name -> w_campaignpb.UpdateReq.Reward + 219, // 301: w_campaignpb.UpdateReq.Push.task_reset:type_name -> w_campaignpb.UpdateReq.PushOne + 219, // 302: w_campaignpb.UpdateReq.Push.active:type_name -> w_campaignpb.UpdateReq.PushOne + 219, // 303: w_campaignpb.UpdateReq.Push.offline:type_name -> w_campaignpb.UpdateReq.PushOne + 219, // 304: w_campaignpb.UpdateReq.Push.visit:type_name -> w_campaignpb.UpdateReq.PushOne + 220, // 305: w_campaignpb.UpdateReq.PushOne.push_cond:type_name -> w_campaignpb.UpdateReq.PushCond + 225, // 306: w_campaignpb.ShowRes.Event.first_visit:type_name -> w_campaignpb.ShowRes.EventOne + 226, // 307: w_campaignpb.ShowRes.EventOne.rewards:type_name -> w_campaignpb.ShowRes.EventReward + 254, // 308: w_campaignpb.ShowRes.EventReward.reward:type_name -> w_campaignpb.ShowRes.Reward + 228, // 309: w_campaignpb.ShowRes.Uno.red:type_name -> w_campaignpb.ShowRes.UnoGroup + 228, // 310: w_campaignpb.ShowRes.Uno.yellow:type_name -> w_campaignpb.ShowRes.UnoGroup + 228, // 311: w_campaignpb.ShowRes.Uno.blue:type_name -> w_campaignpb.ShowRes.UnoGroup + 228, // 312: w_campaignpb.ShowRes.Uno.green:type_name -> w_campaignpb.ShowRes.UnoGroup + 254, // 313: w_campaignpb.ShowRes.UnoGroup.reward:type_name -> w_campaignpb.ShowRes.Reward + 229, // 314: w_campaignpb.ShowRes.UnoGroup.limit_rule:type_name -> w_campaignpb.ShowRes.UnoLimitRule + 230, // 315: w_campaignpb.ShowRes.UnoGroup.cards:type_name -> w_campaignpb.ShowRes.UnoCard + 232, // 316: w_campaignpb.ShowRes.Vs.schedules:type_name -> w_campaignpb.ShowRes.Schedule + 233, // 317: w_campaignpb.ShowRes.Schedule.pk_teams:type_name -> w_campaignpb.ShowRes.PkTeam + 234, // 318: w_campaignpb.ShowRes.PkTeam.teams:type_name -> w_campaignpb.ShowRes.Team + 244, // 319: w_campaignpb.ShowRes.LongImg.hot_zone:type_name -> w_campaignpb.ShowRes.HotZone + 246, // 320: w_campaignpb.ShowRes.Target.cond:type_name -> w_campaignpb.ShowRes.Cond + 247, // 321: w_campaignpb.ShowRes.Target.both_all:type_name -> w_campaignpb.ShowRes.BothAll + 248, // 322: w_campaignpb.ShowRes.Target.normal_data:type_name -> w_campaignpb.ShowRes.NormalData + 254, // 323: w_campaignpb.ShowRes.Cond.reward:type_name -> w_campaignpb.ShowRes.Reward + 254, // 324: w_campaignpb.ShowRes.BothAll.reward:type_name -> w_campaignpb.ShowRes.Reward + 250, // 325: w_campaignpb.ShowRes.TargetOption.fixed:type_name -> w_campaignpb.ShowRes.Fixed + 251, // 326: w_campaignpb.ShowRes.TargetOption.custom:type_name -> w_campaignpb.ShowRes.Custom + 246, // 327: w_campaignpb.ShowRes.Custom.cond:type_name -> w_campaignpb.ShowRes.Cond + 247, // 328: w_campaignpb.ShowRes.Custom.both_all:type_name -> w_campaignpb.ShowRes.BothAll + 252, // 329: w_campaignpb.ShowRes.WebReward.kv_data:type_name -> w_campaignpb.ShowRes.KV + 252, // 330: w_campaignpb.ShowRes.Reward.kv_data:type_name -> w_campaignpb.ShowRes.KV + 257, // 331: w_campaignpb.ShowRes.Reward.collect_rule:type_name -> w_campaignpb.ShowRes.CollectRule + 256, // 332: w_campaignpb.ShowRes.Reward.open_add:type_name -> w_campaignpb.ShowRes.OpenAdd + 255, // 333: w_campaignpb.ShowRes.Reward.reward_task:type_name -> w_campaignpb.ShowRes.RewardTask + 254, // 334: w_campaignpb.ShowRes.Rewards.normal:type_name -> w_campaignpb.ShowRes.Reward + 259, // 335: w_campaignpb.ShowRes.Rewards.user_level:type_name -> w_campaignpb.ShowRes.UserLevel + 261, // 336: w_campaignpb.ShowRes.Rewards.langs:type_name -> w_campaignpb.ShowRes.Lang + 262, // 337: w_campaignpb.ShowRes.Rewards.lang_user_level:type_name -> w_campaignpb.ShowRes.LangUserLevel + 263, // 338: w_campaignpb.ShowRes.Rewards.country:type_name -> w_campaignpb.ShowRes.Country + 260, // 339: w_campaignpb.ShowRes.UserLevel.level_list:type_name -> w_campaignpb.ShowRes.UserLevelOne + 254, // 340: w_campaignpb.ShowRes.UserLevelOne.rewards:type_name -> w_campaignpb.ShowRes.Reward + 254, // 341: w_campaignpb.ShowRes.Lang.rewards:type_name -> w_campaignpb.ShowRes.Reward + 260, // 342: w_campaignpb.ShowRes.LangUserLevel.level_list:type_name -> w_campaignpb.ShowRes.UserLevelOne + 264, // 343: w_campaignpb.ShowRes.Country.country_list:type_name -> w_campaignpb.ShowRes.CountryOne + 254, // 344: w_campaignpb.ShowRes.CountryOne.rewards:type_name -> w_campaignpb.ShowRes.Reward + 266, // 345: w_campaignpb.ShowRes.QaQuestion.options:type_name -> w_campaignpb.ShowRes.QaOption + 267, // 346: w_campaignpb.ShowRes.Quiz.options:type_name -> w_campaignpb.ShowRes.QuizOption + 265, // 347: w_campaignpb.ShowRes.QuestionAnswer.questions:type_name -> w_campaignpb.ShowRes.QaQuestion + 274, // 348: w_campaignpb.ShowRes.Dice.map_point:type_name -> w_campaignpb.ShowRes.MapPoint + 276, // 349: w_campaignpb.ShowRes.Grow.steps:type_name -> w_campaignpb.ShowRes.GrowStep + 280, // 350: w_campaignpb.ShowRes.Cash.spin_cash:type_name -> w_campaignpb.ShowRes.SpinCash + 283, // 351: w_campaignpb.ShowRes.Keep.invite:type_name -> w_campaignpb.ShowRes.Invite + 284, // 352: w_campaignpb.ShowRes.Keep.talk_text:type_name -> w_campaignpb.ShowRes.Talk + 285, // 353: w_campaignpb.ShowRes.Keep.steps:type_name -> w_campaignpb.ShowRes.KeepStep + 254, // 354: w_campaignpb.ShowRes.KeepStep.reward:type_name -> w_campaignpb.ShowRes.Reward + 287, // 355: w_campaignpb.ShowRes.Push.task_reset:type_name -> w_campaignpb.ShowRes.PushOne + 287, // 356: w_campaignpb.ShowRes.Push.active:type_name -> w_campaignpb.ShowRes.PushOne + 287, // 357: w_campaignpb.ShowRes.Push.offline:type_name -> w_campaignpb.ShowRes.PushOne + 287, // 358: w_campaignpb.ShowRes.Push.visit:type_name -> w_campaignpb.ShowRes.PushOne + 288, // 359: w_campaignpb.ShowRes.PushOne.push_cond:type_name -> w_campaignpb.ShowRes.PushCond + 280, // 360: w_campaignpb.ShowRes.Gold.spin_cash:type_name -> w_campaignpb.ShowRes.SpinCash + 294, // 361: w_campaignpb.BarrageRes.TranContent.replace_kv:type_name -> w_campaignpb.BarrageRes.KV + 316, // 362: w_campaignpb.LangsRes.Lang.conds:type_name -> w_campaignpb.LangsRes.Cond + 313, // 363: w_campaignpb.LangsRes.Lang.quit:type_name -> w_campaignpb.LangsRes.Quit + 315, // 364: w_campaignpb.LangsRes.Lang.questions:type_name -> w_campaignpb.LangsRes.Question + 309, // 365: w_campaignpb.LangsRes.Lang.rewards:type_name -> w_campaignpb.LangsRes.Rewards + 310, // 366: w_campaignpb.LangsRes.Lang.rewards_web:type_name -> w_campaignpb.LangsRes.Reward + 310, // 367: w_campaignpb.LangsRes.Lang.rewards_extra:type_name -> w_campaignpb.LangsRes.Reward + 310, // 368: w_campaignpb.LangsRes.Lang.rewards_newcomer:type_name -> w_campaignpb.LangsRes.Reward + 307, // 369: w_campaignpb.LangsRes.Lang.long_imgs:type_name -> w_campaignpb.LangsRes.LongImg + 304, // 370: w_campaignpb.LangsRes.Lang.cash:type_name -> w_campaignpb.LangsRes.Cash + 302, // 371: w_campaignpb.LangsRes.Lang.qa_group:type_name -> w_campaignpb.LangsRes.QaGroup + 303, // 372: w_campaignpb.LangsRes.Lang.talk_text:type_name -> w_campaignpb.LangsRes.Talk + 305, // 373: w_campaignpb.LangsRes.Lang.gold:type_name -> w_campaignpb.LangsRes.Gold + 306, // 374: w_campaignpb.LangsRes.Lang.coin:type_name -> w_campaignpb.LangsRes.Coin + 299, // 375: w_campaignpb.LangsRes.Lang.schedules:type_name -> w_campaignpb.LangsRes.Schedule + 297, // 376: w_campaignpb.LangsRes.Lang.uno:type_name -> w_campaignpb.LangsRes.Uno + 298, // 377: w_campaignpb.LangsRes.Uno.red:type_name -> w_campaignpb.LangsRes.UnoCard + 298, // 378: w_campaignpb.LangsRes.Uno.yellow:type_name -> w_campaignpb.LangsRes.UnoCard + 298, // 379: w_campaignpb.LangsRes.Uno.blue:type_name -> w_campaignpb.LangsRes.UnoCard + 298, // 380: w_campaignpb.LangsRes.Uno.green:type_name -> w_campaignpb.LangsRes.UnoCard + 300, // 381: w_campaignpb.LangsRes.Schedule.pk_teams:type_name -> w_campaignpb.LangsRes.PkTeam + 301, // 382: w_campaignpb.LangsRes.PkTeam.teams:type_name -> w_campaignpb.LangsRes.Team + 308, // 383: w_campaignpb.LangsRes.LongImg.hot_zone:type_name -> w_campaignpb.LangsRes.HotZone + 310, // 384: w_campaignpb.LangsRes.Rewards.normal:type_name -> w_campaignpb.LangsRes.Reward + 311, // 385: w_campaignpb.LangsRes.Rewards.user_level:type_name -> w_campaignpb.LangsRes.UserLevelOne + 310, // 386: w_campaignpb.LangsRes.Rewards.langs:type_name -> w_campaignpb.LangsRes.Reward + 311, // 387: w_campaignpb.LangsRes.Rewards.lang_user_level:type_name -> w_campaignpb.LangsRes.UserLevelOne + 312, // 388: w_campaignpb.LangsRes.Rewards.country:type_name -> w_campaignpb.LangsRes.CountryOne + 310, // 389: w_campaignpb.LangsRes.UserLevelOne.rewards:type_name -> w_campaignpb.LangsRes.Reward + 310, // 390: w_campaignpb.LangsRes.CountryOne.rewards:type_name -> w_campaignpb.LangsRes.Reward + 314, // 391: w_campaignpb.LangsRes.Quit.options:type_name -> w_campaignpb.LangsRes.Option + 314, // 392: w_campaignpb.LangsRes.Question.options:type_name -> w_campaignpb.LangsRes.Option + 318, // 393: w_campaignpb.LangRes.Uno.red:type_name -> w_campaignpb.LangRes.UnoCard + 318, // 394: w_campaignpb.LangRes.Uno.yellow:type_name -> w_campaignpb.LangRes.UnoCard + 318, // 395: w_campaignpb.LangRes.Uno.blue:type_name -> w_campaignpb.LangRes.UnoCard + 318, // 396: w_campaignpb.LangRes.Uno.green:type_name -> w_campaignpb.LangRes.UnoCard + 320, // 397: w_campaignpb.LangRes.Schedule.pk_teams:type_name -> w_campaignpb.LangRes.PkTeam + 321, // 398: w_campaignpb.LangRes.PkTeam.teams:type_name -> w_campaignpb.LangRes.Team + 325, // 399: w_campaignpb.LangRes.Quit.options:type_name -> w_campaignpb.LangRes.Option + 325, // 400: w_campaignpb.LangRes.Question.options:type_name -> w_campaignpb.LangRes.Option + 329, // 401: w_campaignpb.LangRes.LongImg.hot_zone:type_name -> w_campaignpb.LangRes.HotZone + 334, // 402: w_campaignpb.SaveLangReq.Uno.red:type_name -> w_campaignpb.SaveLangReq.UnoCard + 334, // 403: w_campaignpb.SaveLangReq.Uno.yellow:type_name -> w_campaignpb.SaveLangReq.UnoCard + 334, // 404: w_campaignpb.SaveLangReq.Uno.blue:type_name -> w_campaignpb.SaveLangReq.UnoCard + 334, // 405: w_campaignpb.SaveLangReq.Uno.green:type_name -> w_campaignpb.SaveLangReq.UnoCard + 336, // 406: w_campaignpb.SaveLangReq.Schedule.pk_teams:type_name -> w_campaignpb.SaveLangReq.PkTeam + 337, // 407: w_campaignpb.SaveLangReq.PkTeam.teams:type_name -> w_campaignpb.SaveLangReq.Team + 344, // 408: w_campaignpb.SaveLangReq.Quit.options:type_name -> w_campaignpb.SaveLangReq.Option + 344, // 409: w_campaignpb.SaveLangReq.Question.options:type_name -> w_campaignpb.SaveLangReq.Option + 348, // 410: w_campaignpb.SaveLangReq.LongImg.hot_zone:type_name -> w_campaignpb.SaveLangReq.HotZone + 351, // 411: w_campaignpb.ShowRewardRes.Reward.kv_data:type_name -> w_campaignpb.ShowRewardRes.KV + 358, // 412: w_campaignpb.AdsShowRes.Reward.kv_data:type_name -> w_campaignpb.AdsShowRes.KV + 365, // 413: w_campaignpb.RewardDetailRes.Schedule.teams:type_name -> w_campaignpb.RewardDetailRes.Team + 364, // 414: w_campaignpb.RewardDetailRes.Schedule.votes:type_name -> w_campaignpb.RewardDetailRes.Vote + 367, // 415: w_campaignpb.RewardDetailRes.UserLevelOne.rewards:type_name -> w_campaignpb.RewardDetailRes.Reward + 367, // 416: w_campaignpb.RewardDetailRes.LangOne.rewards:type_name -> w_campaignpb.RewardDetailRes.Reward + 368, // 417: w_campaignpb.RewardDetailRes.LangUserLevelOne.level_list:type_name -> w_campaignpb.RewardDetailRes.UserLevelOne + 367, // 418: w_campaignpb.RewardDetailRes.CountryOne.rewards:type_name -> w_campaignpb.RewardDetailRes.Reward + 376, // 419: w_campaignpb.ChildStoreReq.TaskGroup.reward:type_name -> w_campaignpb.ChildStoreReq.Reward + 377, // 420: w_campaignpb.ChildStoreReq.TaskGroup.conds:type_name -> w_campaignpb.ChildStoreReq.Cond + 376, // 421: w_campaignpb.ChildStoreReq.Cond.reward:type_name -> w_campaignpb.ChildStoreReq.Reward + 379, // 422: w_campaignpb.ChildUpdateReq.TaskGroup.reward:type_name -> w_campaignpb.ChildUpdateReq.Reward + 380, // 423: w_campaignpb.ChildUpdateReq.TaskGroup.conds:type_name -> w_campaignpb.ChildUpdateReq.Cond + 379, // 424: w_campaignpb.ChildUpdateReq.Cond.reward:type_name -> w_campaignpb.ChildUpdateReq.Reward + 382, // 425: w_campaignpb.ChildShowRes.TaskGroup.reward:type_name -> w_campaignpb.ChildShowRes.Reward + 383, // 426: w_campaignpb.ChildShowRes.TaskGroup.conds:type_name -> w_campaignpb.ChildShowRes.Cond + 384, // 427: w_campaignpb.ChildShowRes.Reward.kv_data:type_name -> w_campaignpb.ChildShowRes.KV + 382, // 428: w_campaignpb.ChildShowRes.Cond.reward:type_name -> w_campaignpb.ChildShowRes.Reward + 387, // 429: w_campaignpb.CondListRes.One.conds:type_name -> w_campaignpb.CondListRes.Cond + 391, // 430: w_campaignpb.VsSettlementRes.PkTeam.teams:type_name -> w_campaignpb.VsSettlementRes.Team + 0, // 431: w_campaignpb.WCampaign.List:input_type -> w_campaignpb.ListReq + 2, // 432: w_campaignpb.WCampaign.Share:input_type -> w_campaignpb.ShareReq + 4, // 433: w_campaignpb.WCampaign.Status:input_type -> w_campaignpb.StatusReq + 6, // 434: w_campaignpb.WCampaign.Destroy:input_type -> w_campaignpb.DestroyReq + 8, // 435: w_campaignpb.WCampaign.Store:input_type -> w_campaignpb.StoreReq + 10, // 436: w_campaignpb.WCampaign.Update:input_type -> w_campaignpb.UpdateReq + 12, // 437: w_campaignpb.WCampaign.Show:input_type -> w_campaignpb.ShowReq + 14, // 438: w_campaignpb.WCampaign.ChannelList:input_type -> w_campaignpb.ChannelListReq + 16, // 439: w_campaignpb.WCampaign.ChannelCreate:input_type -> w_campaignpb.ChannelCreateReq + 18, // 440: w_campaignpb.WCampaign.ChannelUpdate:input_type -> w_campaignpb.ChannelUpdateReq + 20, // 441: w_campaignpb.WCampaign.ChannelDestroy:input_type -> w_campaignpb.ChannelDestroyReq + 22, // 442: w_campaignpb.WCampaign.KvData:input_type -> w_campaignpb.KvDataReq + 24, // 443: w_campaignpb.WCampaign.Cert:input_type -> w_campaignpb.CertReq + 26, // 444: w_campaignpb.WCampaign.Barrage:input_type -> w_campaignpb.BarrageReq + 28, // 445: w_campaignpb.WCampaign.Option:input_type -> w_campaignpb.OptionReq + 30, // 446: w_campaignpb.WCampaign.RelateDdl:input_type -> w_campaignpb.RelateDdlReq + 32, // 447: w_campaignpb.WCampaign.DdlCampaign:input_type -> w_campaignpb.DdlCampaignReq + 34, // 448: w_campaignpb.WCampaign.Langs:input_type -> w_campaignpb.LangsReq + 36, // 449: w_campaignpb.WCampaign.Lang:input_type -> w_campaignpb.LangReq + 38, // 450: w_campaignpb.WCampaign.SaveLang:input_type -> w_campaignpb.SaveLangReq + 40, // 451: w_campaignpb.WCampaign.DestroyLang:input_type -> w_campaignpb.DestroyLangReq + 42, // 452: w_campaignpb.WCampaign.LangSelect:input_type -> w_campaignpb.LangSelectReq + 44, // 453: w_campaignpb.WCampaign.CampaignInfo:input_type -> w_campaignpb.CampaignInfoReq + 46, // 454: w_campaignpb.WCampaign.ShowReward:input_type -> w_campaignpb.ShowRewardReq + 48, // 455: w_campaignpb.WCampaign.AdsStore:input_type -> w_campaignpb.AdsStoreReq + 50, // 456: w_campaignpb.WCampaign.AdsUpdate:input_type -> w_campaignpb.AdsUpdateReq + 52, // 457: w_campaignpb.WCampaign.AdsShow:input_type -> w_campaignpb.AdsShowReq + 54, // 458: w_campaignpb.WCampaign.CampaignSelect:input_type -> w_campaignpb.CampaignSelectReq + 56, // 459: w_campaignpb.WCampaign.RewardDetail:input_type -> w_campaignpb.RewardDetailReq + 58, // 460: w_campaignpb.WCampaign.UpdateStock:input_type -> w_campaignpb.UpdateStockReq + 60, // 461: w_campaignpb.WCampaign.CampaignTz:input_type -> w_campaignpb.CampaignTzReq + 62, // 462: w_campaignpb.WCampaign.CampaignRewardType:input_type -> w_campaignpb.CampaignRewardTypeReq + 64, // 463: w_campaignpb.WCampaign.ChildList:input_type -> w_campaignpb.ChildListReq + 66, // 464: w_campaignpb.WCampaign.ChildStore:input_type -> w_campaignpb.ChildStoreReq + 68, // 465: w_campaignpb.WCampaign.ChildUpdate:input_type -> w_campaignpb.ChildUpdateReq + 70, // 466: w_campaignpb.WCampaign.ChildShow:input_type -> w_campaignpb.ChildShowReq + 72, // 467: w_campaignpb.WCampaign.TaskCenterJump:input_type -> w_campaignpb.TaskCenterJumpReq + 74, // 468: w_campaignpb.WCampaign.CondList:input_type -> w_campaignpb.CondListReq + 76, // 469: w_campaignpb.WCampaign.Campaigns:input_type -> w_campaignpb.CampaignsReq + 78, // 470: w_campaignpb.WCampaign.SetLvApi:input_type -> w_campaignpb.SetLvApiReq + 80, // 471: w_campaignpb.WCampaign.GetLvApi:input_type -> w_campaignpb.GetLvApiReq + 82, // 472: w_campaignpb.WCampaign.VsSettlement:input_type -> w_campaignpb.VsSettlementReq + 84, // 473: w_campaignpb.WCampaign.VsSettlementInfo:input_type -> w_campaignpb.VsSettlementInfoReq + 86, // 474: w_campaignpb.WCampaign.ActionList:input_type -> w_campaignpb.ActionListReq + 1, // 475: w_campaignpb.WCampaign.List:output_type -> w_campaignpb.ListRes + 3, // 476: w_campaignpb.WCampaign.Share:output_type -> w_campaignpb.ShareRes + 5, // 477: w_campaignpb.WCampaign.Status:output_type -> w_campaignpb.StatusRes + 7, // 478: w_campaignpb.WCampaign.Destroy:output_type -> w_campaignpb.DestroyRes + 9, // 479: w_campaignpb.WCampaign.Store:output_type -> w_campaignpb.StoreRes + 11, // 480: w_campaignpb.WCampaign.Update:output_type -> w_campaignpb.UpdateRes + 13, // 481: w_campaignpb.WCampaign.Show:output_type -> w_campaignpb.ShowRes + 15, // 482: w_campaignpb.WCampaign.ChannelList:output_type -> w_campaignpb.ChannelListRes + 17, // 483: w_campaignpb.WCampaign.ChannelCreate:output_type -> w_campaignpb.ChannelCreateRes + 19, // 484: w_campaignpb.WCampaign.ChannelUpdate:output_type -> w_campaignpb.ChannelUpdateRes + 21, // 485: w_campaignpb.WCampaign.ChannelDestroy:output_type -> w_campaignpb.ChannelDestroyRes + 23, // 486: w_campaignpb.WCampaign.KvData:output_type -> w_campaignpb.KvDataRes + 25, // 487: w_campaignpb.WCampaign.Cert:output_type -> w_campaignpb.CertRes + 27, // 488: w_campaignpb.WCampaign.Barrage:output_type -> w_campaignpb.BarrageRes + 29, // 489: w_campaignpb.WCampaign.Option:output_type -> w_campaignpb.OptionRes + 31, // 490: w_campaignpb.WCampaign.RelateDdl:output_type -> w_campaignpb.RelateDdlRes + 33, // 491: w_campaignpb.WCampaign.DdlCampaign:output_type -> w_campaignpb.DdlCampaignRes + 35, // 492: w_campaignpb.WCampaign.Langs:output_type -> w_campaignpb.LangsRes + 37, // 493: w_campaignpb.WCampaign.Lang:output_type -> w_campaignpb.LangRes + 39, // 494: w_campaignpb.WCampaign.SaveLang:output_type -> w_campaignpb.SaveLangRes + 41, // 495: w_campaignpb.WCampaign.DestroyLang:output_type -> w_campaignpb.DestroyLangRes + 43, // 496: w_campaignpb.WCampaign.LangSelect:output_type -> w_campaignpb.LangSelectRes + 45, // 497: w_campaignpb.WCampaign.CampaignInfo:output_type -> w_campaignpb.CampaignInfoRes + 47, // 498: w_campaignpb.WCampaign.ShowReward:output_type -> w_campaignpb.ShowRewardRes + 49, // 499: w_campaignpb.WCampaign.AdsStore:output_type -> w_campaignpb.AdsStoreRes + 51, // 500: w_campaignpb.WCampaign.AdsUpdate:output_type -> w_campaignpb.AdsUpdateRes + 53, // 501: w_campaignpb.WCampaign.AdsShow:output_type -> w_campaignpb.AdsShowRes + 55, // 502: w_campaignpb.WCampaign.CampaignSelect:output_type -> w_campaignpb.CampaignSelectRes + 57, // 503: w_campaignpb.WCampaign.RewardDetail:output_type -> w_campaignpb.RewardDetailRes + 59, // 504: w_campaignpb.WCampaign.UpdateStock:output_type -> w_campaignpb.UpdateStockRes + 61, // 505: w_campaignpb.WCampaign.CampaignTz:output_type -> w_campaignpb.CampaignTzRes + 63, // 506: w_campaignpb.WCampaign.CampaignRewardType:output_type -> w_campaignpb.CampaignRewardTypeRes + 65, // 507: w_campaignpb.WCampaign.ChildList:output_type -> w_campaignpb.ChildListRes + 67, // 508: w_campaignpb.WCampaign.ChildStore:output_type -> w_campaignpb.ChildStoreRes + 69, // 509: w_campaignpb.WCampaign.ChildUpdate:output_type -> w_campaignpb.ChildUpdateRes + 71, // 510: w_campaignpb.WCampaign.ChildShow:output_type -> w_campaignpb.ChildShowRes + 73, // 511: w_campaignpb.WCampaign.TaskCenterJump:output_type -> w_campaignpb.TaskCenterJumpRes + 75, // 512: w_campaignpb.WCampaign.CondList:output_type -> w_campaignpb.CondListRes + 77, // 513: w_campaignpb.WCampaign.Campaigns:output_type -> w_campaignpb.CampaignsRes + 79, // 514: w_campaignpb.WCampaign.SetLvApi:output_type -> w_campaignpb.SetLvApiRes + 81, // 515: w_campaignpb.WCampaign.GetLvApi:output_type -> w_campaignpb.GetLvApiRes + 83, // 516: w_campaignpb.WCampaign.VsSettlement:output_type -> w_campaignpb.VsSettlementRes + 85, // 517: w_campaignpb.WCampaign.VsSettlementInfo:output_type -> w_campaignpb.VsSettlementInfoRes + 87, // 518: w_campaignpb.WCampaign.ActionList:output_type -> w_campaignpb.ActionListRes + 475, // [475:519] is the sub-list for method output_type + 431, // [431:475] is the sub-list for method input_type + 431, // [431:431] is the sub-list for extension type_name + 431, // [431:431] is the sub-list for extension extendee + 0, // [0:431] is the sub-list for field type_name +} + +func init() { file_w_campaign_proto_init() } +func file_w_campaign_proto_init() { + if File_w_campaign_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_campaign_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShareReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShareRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelCreateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelCreateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelDestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelDestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KvDataReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KvDataRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BarrageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BarrageRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelateDdlReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelateDdlRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DdlCampaignReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DdlCampaignRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyLangReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyLangRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangSelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangSelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignInfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignSelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignSelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateStockReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateStockRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignTzReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignTzRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignRewardTypeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignRewardTypeRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskCenterJumpReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskCenterJumpRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CondListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CondListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetLvApiReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetLvApiRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLvApiReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLvApiRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementInfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_LangTz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Channel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShareRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_GashaponStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_EventOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_EventReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_UnoGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_UnoLimitRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Vs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Chat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_PointsUse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_FlipStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_GridStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_WheelStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Child); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_LongImg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_HotZone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_BothAll); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_NormalData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_TargetOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Fixed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[120].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Custom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[122].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_RewardTask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[124].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_OpenAdd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[125].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_CollectRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[126].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Rewards); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[127].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_UserLevel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[128].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_UserLevelOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[129].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[130].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_LangUserLevel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[131].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Country); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[132].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_CountryOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[133].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_QaQuestion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[134].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_QaOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[135].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_QuizOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[136].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Quiz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[137].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_QuestionAnswer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_LotteryConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_InviteConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[140].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[141].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Dice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[142].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_MapPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[143].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Grow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[144].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_GrowStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[145].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Ballot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[146].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Chop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[147].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[148].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Flip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[149].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Keep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[150].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Invite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[151].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Talk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[152].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_KeepStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[153].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Push); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[154].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_PushOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[155].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_PushCond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[156].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[157].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[158].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_GashaponStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[159].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[160].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_EventOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[161].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_EventReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[162].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[163].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_UnoGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[164].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_UnoLimitRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[165].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[166].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Vs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[167].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[168].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[169].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[170].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Chat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[171].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_PointsUse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[172].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_FlipStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[173].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_GridStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[174].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_WheelStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[175].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Child); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[176].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[177].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_LongImg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[178].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_HotZone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[179].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[180].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[181].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_BothAll); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[182].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_NormalData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[183].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_TargetOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[184].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Fixed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[185].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Custom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[186].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[187].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[188].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_RewardTask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[189].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_OpenAdd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[190].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_CollectRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[191].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Rewards); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[192].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_UserLevel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[193].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_UserLevelOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[194].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[195].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_LangUserLevel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[196].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Country); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[197].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_CountryOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[198].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_QaQuestion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[199].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_QaOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[200].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_QuizOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[201].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Quiz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[202].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_QuestionAnswer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[203].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_LotteryConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[204].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_InviteConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[205].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[206].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Dice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[207].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_MapPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[208].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Grow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[209].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_GrowStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[210].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Ballot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[211].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Chop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[212].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[213].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Flip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[214].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Keep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[215].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Invite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[216].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Talk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[217].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_KeepStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[218].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Push); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[219].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_PushOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[220].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_PushCond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[221].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[222].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[223].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_GashaponStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[224].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[225].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_EventOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[226].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_EventReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[227].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[228].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_UnoGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[229].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_UnoLimitRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[230].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[231].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Vs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[232].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[233].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[234].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[235].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Chat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[236].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_PointsUse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[237].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_FlipStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[238].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_GridStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[239].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_WheelStyle); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[240].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Child); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[241].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Share); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[242].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[243].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_LongImg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[244].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_HotZone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[245].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[246].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[247].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_BothAll); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[248].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_NormalData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[249].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_TargetOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[250].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Fixed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[251].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Custom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[252].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[253].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_WebReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[254].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[255].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_RewardTask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[256].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_OpenAdd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[257].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_CollectRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[258].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Rewards); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[259].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_UserLevel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[260].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_UserLevelOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[261].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[262].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_LangUserLevel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[263].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Country); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[264].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_CountryOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[265].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_QaQuestion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[266].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_QaOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[267].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_QuizOption); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[268].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Quiz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[269].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_QuestionAnswer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[270].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_LotteryConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[271].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_InviteConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[272].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[273].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Dice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[274].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_MapPoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[275].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Grow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[276].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_GrowStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[277].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Ballot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[278].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Chop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[279].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[280].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_SpinCash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[281].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Flip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[282].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Keep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[283].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Invite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[284].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Talk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[285].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_KeepStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[286].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Push); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[287].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_PushOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[288].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_PushCond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[289].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[290].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[291].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[292].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KvDataRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[293].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BarrageRes_TranContent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[294].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BarrageRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[295].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[296].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[297].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[298].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[299].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[300].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[301].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[302].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_QaGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[303].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Talk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[304].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[305].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[306].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[307].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_LongImg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[308].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_HotZone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[309].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Rewards); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[310].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[311].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_UserLevelOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[312].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_CountryOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[313].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Quit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[314].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[315].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Question); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[316].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangsRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[317].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[318].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[319].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[320].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[321].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[322].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Talk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[323].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_QaGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[324].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Quit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[325].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[326].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Question); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[327].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[328].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_LongImg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[329].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_HotZone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[330].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[331].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[332].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangRes_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[333].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[334].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[335].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[336].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[337].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[338].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Talk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[339].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_QaGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[340].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[341].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[342].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[343].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Quit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[344].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[345].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Question); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[346].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[347].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_LongImg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[348].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveLangReq_HotZone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[349].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LangSelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[350].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRewardRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[351].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRewardRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[352].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStoreReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[353].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStoreReq_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[354].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStoreReq_Flip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[355].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUpdateReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[356].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUpdateReq_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[357].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUpdateReq_Flip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[358].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsShowRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[359].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsShowRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[360].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsShowRes_Flip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[361].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignSelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[362].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[363].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[364].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_Vote); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[365].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[366].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_Pool); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[367].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[368].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_UserLevelOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[369].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_LangOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[370].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_LangUserLevelOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[371].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardDetailRes_CountryOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[372].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignTzRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[373].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignRewardTypeRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[374].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[375].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildStoreReq_TaskGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[376].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildStoreReq_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[377].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildStoreReq_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[378].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildUpdateReq_TaskGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[379].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildUpdateReq_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[380].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildUpdateReq_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[381].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildShowRes_TaskGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[382].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildShowRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[383].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildShowRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[384].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildShowRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[385].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskCenterJumpRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[386].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CondListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[387].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CondListRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[388].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignsRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[389].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementReq_Score); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[390].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementRes_PkTeam); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[391].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_proto_msgTypes[392].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsSettlementInfoRes_Team); 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_w_campaign_proto_rawDesc, + NumEnums: 0, + NumMessages: 393, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_campaign_proto_goTypes, + DependencyIndexes: file_w_campaign_proto_depIdxs, + MessageInfos: file_w_campaign_proto_msgTypes, + }.Build() + File_w_campaign_proto = out.File + file_w_campaign_proto_rawDesc = nil + file_w_campaign_proto_goTypes = nil + file_w_campaign_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_campaign/w_campaign.pb.micro.go b/proto/go_proto/w_campaign/w_campaign.pb.micro.go new file mode 100644 index 0000000..d621c4b --- /dev/null +++ b/proto/go_proto/w_campaign/w_campaign.pb.micro.go @@ -0,0 +1,906 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_campaign.proto + +package w_campaignpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WCampaign service + +func NewWCampaignEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WCampaign service + +type WCampaignService interface { + // List 活动列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // Share 社媒选项 + Share(ctx context.Context, in *ShareReq, opts ...client.CallOption) (*ShareRes, error) + // Status 修改状态 + Status(ctx context.Context, in *StatusReq, opts ...client.CallOption) (*StatusRes, error) + // Destroy 删除活动 + Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) + // Store 创建活动 + Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) + // Update 更新活动 + Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) + // Show 活动详情 + Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) + // ChannelList 渠道列表 + ChannelList(ctx context.Context, in *ChannelListReq, opts ...client.CallOption) (*ChannelListRes, error) + // ChannelCreate 渠道创建 + ChannelCreate(ctx context.Context, in *ChannelCreateReq, opts ...client.CallOption) (*ChannelCreateRes, error) + // ChannelUpdate 渠道创建 + ChannelUpdate(ctx context.Context, in *ChannelUpdateReq, opts ...client.CallOption) (*ChannelUpdateRes, error) + // ChannelDestroy 渠道创建 + ChannelDestroy(ctx context.Context, in *ChannelDestroyReq, opts ...client.CallOption) (*ChannelDestroyRes, error) + // KvData 获取活动键值对 + KvData(ctx context.Context, in *KvDataReq, opts ...client.CallOption) (*KvDataRes, error) + // Cert 认证活动信息 + Cert(ctx context.Context, in *CertReq, opts ...client.CallOption) (*CertRes, error) + // Barrage 活动弹幕 + Barrage(ctx context.Context, in *BarrageReq, opts ...client.CallOption) (*BarrageRes, error) + // Option 投票选项 + Option(ctx context.Context, in *OptionReq, opts ...client.CallOption) (*OptionRes, error) + // RelateDdl 活动关联动态下载页 + RelateDdl(ctx context.Context, in *RelateDdlReq, opts ...client.CallOption) (*RelateDdlRes, error) + // DdlCampaign 关联动态下载页的活动 + DdlCampaign(ctx context.Context, in *DdlCampaignReq, opts ...client.CallOption) (*DdlCampaignRes, error) + // Langs 活动多语言配置信息 + Langs(ctx context.Context, in *LangsReq, opts ...client.CallOption) (*LangsRes, error) + // Lang 活动语言信息 + Lang(ctx context.Context, in *LangReq, opts ...client.CallOption) (*LangRes, error) + // SaveLang 保存活动多语言配置信息 + SaveLang(ctx context.Context, in *SaveLangReq, opts ...client.CallOption) (*SaveLangRes, error) + // DestroyLang 删除活动语言配置信息 + DestroyLang(ctx context.Context, in *DestroyLangReq, opts ...client.CallOption) (*DestroyLangRes, error) + // LangSelect 活动语言选择 + LangSelect(ctx context.Context, in *LangSelectReq, opts ...client.CallOption) (*LangSelectRes, error) + // CampaignInfo 活动信息 + CampaignInfo(ctx context.Context, in *CampaignInfoReq, opts ...client.CallOption) (*CampaignInfoRes, error) + // ShowReward 显示的奖品数据 + ShowReward(ctx context.Context, in *ShowRewardReq, opts ...client.CallOption) (*ShowRewardRes, error) + // AdsStore 创建Ads活动 + AdsStore(ctx context.Context, in *AdsStoreReq, opts ...client.CallOption) (*AdsStoreRes, error) + // AdsUpdate 更新Ads活动 + AdsUpdate(ctx context.Context, in *AdsUpdateReq, opts ...client.CallOption) (*AdsUpdateRes, error) + // AdsShow Ads活动详情 + AdsShow(ctx context.Context, in *AdsShowReq, opts ...client.CallOption) (*AdsShowRes, error) + // CampaignSelect 活动选择列表 + CampaignSelect(ctx context.Context, in *CampaignSelectReq, opts ...client.CallOption) (*CampaignSelectRes, error) + // RewardDetail 奖品详情 + RewardDetail(ctx context.Context, in *RewardDetailReq, opts ...client.CallOption) (*RewardDetailRes, error) + // UpdateStock 修改奖品库存 + UpdateStock(ctx context.Context, in *UpdateStockReq, opts ...client.CallOption) (*UpdateStockRes, error) + // CampaignTz 活动时区数据 + CampaignTz(ctx context.Context, in *CampaignTzReq, opts ...client.CallOption) (*CampaignTzRes, error) + // CampaignRewardType 活动奖品类型 + CampaignRewardType(ctx context.Context, in *CampaignRewardTypeReq, opts ...client.CallOption) (*CampaignRewardTypeRes, error) + // ChildList 子活动列表 + ChildList(ctx context.Context, in *ChildListReq, opts ...client.CallOption) (*ChildListRes, error) + // ChildStore 子活动列表 + ChildStore(ctx context.Context, in *ChildStoreReq, opts ...client.CallOption) (*ChildStoreRes, error) + // ChildUpdate 更新子活动 + ChildUpdate(ctx context.Context, in *ChildUpdateReq, opts ...client.CallOption) (*ChildUpdateRes, error) + // ChildShow 子活动活动 + ChildShow(ctx context.Context, in *ChildShowReq, opts ...client.CallOption) (*ChildShowRes, error) + // TaskCenterJump 任务中心活动跳转地址 + TaskCenterJump(ctx context.Context, in *TaskCenterJumpReq, opts ...client.CallOption) (*TaskCenterJumpRes, error) + // CondList 活动任务数据 + CondList(ctx context.Context, in *CondListReq, opts ...client.CallOption) (*CondListRes, error) + // Campaigns 获取活动数据 + Campaigns(ctx context.Context, in *CampaignsReq, opts ...client.CallOption) (*CampaignsRes, error) + // SetLvApi 设置动态用户等级动态api + SetLvApi(ctx context.Context, in *SetLvApiReq, opts ...client.CallOption) (*SetLvApiRes, error) + // GetLvApi 获取动态用户等级动态api + GetLvApi(ctx context.Context, in *GetLvApiReq, opts ...client.CallOption) (*GetLvApiRes, error) + // VsSettlement 赛事竞猜结算 + VsSettlement(ctx context.Context, in *VsSettlementReq, opts ...client.CallOption) (*VsSettlementRes, error) + // VsSettlementInfo 赛事竞猜结算 + VsSettlementInfo(ctx context.Context, in *VsSettlementInfoReq, opts ...client.CallOption) (*VsSettlementInfoRes, error) + // ActionList 行为列表 + ActionList(ctx context.Context, in *ActionListReq, opts ...client.CallOption) (*ActionListRes, error) +} + +type wCampaignService struct { + c client.Client + name string +} + +func NewWCampaignService(name string, c client.Client) WCampaignService { + return &wCampaignService{ + c: c, + name: name, + } +} + +func (c *wCampaignService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Share(ctx context.Context, in *ShareReq, opts ...client.CallOption) (*ShareRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Share", in) + out := new(ShareRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Status(ctx context.Context, in *StatusReq, opts ...client.CallOption) (*StatusRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Status", in) + out := new(StatusRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Destroy", in) + out := new(DestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Store", in) + out := new(StoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Update", in) + out := new(UpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Show", in) + out := new(ShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChannelList(ctx context.Context, in *ChannelListReq, opts ...client.CallOption) (*ChannelListRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChannelList", in) + out := new(ChannelListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChannelCreate(ctx context.Context, in *ChannelCreateReq, opts ...client.CallOption) (*ChannelCreateRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChannelCreate", in) + out := new(ChannelCreateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChannelUpdate(ctx context.Context, in *ChannelUpdateReq, opts ...client.CallOption) (*ChannelUpdateRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChannelUpdate", in) + out := new(ChannelUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChannelDestroy(ctx context.Context, in *ChannelDestroyReq, opts ...client.CallOption) (*ChannelDestroyRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChannelDestroy", in) + out := new(ChannelDestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) KvData(ctx context.Context, in *KvDataReq, opts ...client.CallOption) (*KvDataRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.KvData", in) + out := new(KvDataRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Cert(ctx context.Context, in *CertReq, opts ...client.CallOption) (*CertRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Cert", in) + out := new(CertRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Barrage(ctx context.Context, in *BarrageReq, opts ...client.CallOption) (*BarrageRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Barrage", in) + out := new(BarrageRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Option(ctx context.Context, in *OptionReq, opts ...client.CallOption) (*OptionRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Option", in) + out := new(OptionRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) RelateDdl(ctx context.Context, in *RelateDdlReq, opts ...client.CallOption) (*RelateDdlRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.RelateDdl", in) + out := new(RelateDdlRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) DdlCampaign(ctx context.Context, in *DdlCampaignReq, opts ...client.CallOption) (*DdlCampaignRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.DdlCampaign", in) + out := new(DdlCampaignRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Langs(ctx context.Context, in *LangsReq, opts ...client.CallOption) (*LangsRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Langs", in) + out := new(LangsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Lang(ctx context.Context, in *LangReq, opts ...client.CallOption) (*LangRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Lang", in) + out := new(LangRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) SaveLang(ctx context.Context, in *SaveLangReq, opts ...client.CallOption) (*SaveLangRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.SaveLang", in) + out := new(SaveLangRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) DestroyLang(ctx context.Context, in *DestroyLangReq, opts ...client.CallOption) (*DestroyLangRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.DestroyLang", in) + out := new(DestroyLangRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) LangSelect(ctx context.Context, in *LangSelectReq, opts ...client.CallOption) (*LangSelectRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.LangSelect", in) + out := new(LangSelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) CampaignInfo(ctx context.Context, in *CampaignInfoReq, opts ...client.CallOption) (*CampaignInfoRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.CampaignInfo", in) + out := new(CampaignInfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ShowReward(ctx context.Context, in *ShowRewardReq, opts ...client.CallOption) (*ShowRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ShowReward", in) + out := new(ShowRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) AdsStore(ctx context.Context, in *AdsStoreReq, opts ...client.CallOption) (*AdsStoreRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.AdsStore", in) + out := new(AdsStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) AdsUpdate(ctx context.Context, in *AdsUpdateReq, opts ...client.CallOption) (*AdsUpdateRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.AdsUpdate", in) + out := new(AdsUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) AdsShow(ctx context.Context, in *AdsShowReq, opts ...client.CallOption) (*AdsShowRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.AdsShow", in) + out := new(AdsShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) CampaignSelect(ctx context.Context, in *CampaignSelectReq, opts ...client.CallOption) (*CampaignSelectRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.CampaignSelect", in) + out := new(CampaignSelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) RewardDetail(ctx context.Context, in *RewardDetailReq, opts ...client.CallOption) (*RewardDetailRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.RewardDetail", in) + out := new(RewardDetailRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) UpdateStock(ctx context.Context, in *UpdateStockReq, opts ...client.CallOption) (*UpdateStockRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.UpdateStock", in) + out := new(UpdateStockRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) CampaignTz(ctx context.Context, in *CampaignTzReq, opts ...client.CallOption) (*CampaignTzRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.CampaignTz", in) + out := new(CampaignTzRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) CampaignRewardType(ctx context.Context, in *CampaignRewardTypeReq, opts ...client.CallOption) (*CampaignRewardTypeRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.CampaignRewardType", in) + out := new(CampaignRewardTypeRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChildList(ctx context.Context, in *ChildListReq, opts ...client.CallOption) (*ChildListRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChildList", in) + out := new(ChildListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChildStore(ctx context.Context, in *ChildStoreReq, opts ...client.CallOption) (*ChildStoreRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChildStore", in) + out := new(ChildStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChildUpdate(ctx context.Context, in *ChildUpdateReq, opts ...client.CallOption) (*ChildUpdateRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChildUpdate", in) + out := new(ChildUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ChildShow(ctx context.Context, in *ChildShowReq, opts ...client.CallOption) (*ChildShowRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ChildShow", in) + out := new(ChildShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) TaskCenterJump(ctx context.Context, in *TaskCenterJumpReq, opts ...client.CallOption) (*TaskCenterJumpRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.TaskCenterJump", in) + out := new(TaskCenterJumpRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) CondList(ctx context.Context, in *CondListReq, opts ...client.CallOption) (*CondListRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.CondList", in) + out := new(CondListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) Campaigns(ctx context.Context, in *CampaignsReq, opts ...client.CallOption) (*CampaignsRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.Campaigns", in) + out := new(CampaignsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) SetLvApi(ctx context.Context, in *SetLvApiReq, opts ...client.CallOption) (*SetLvApiRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.SetLvApi", in) + out := new(SetLvApiRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) GetLvApi(ctx context.Context, in *GetLvApiReq, opts ...client.CallOption) (*GetLvApiRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.GetLvApi", in) + out := new(GetLvApiRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) VsSettlement(ctx context.Context, in *VsSettlementReq, opts ...client.CallOption) (*VsSettlementRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.VsSettlement", in) + out := new(VsSettlementRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) VsSettlementInfo(ctx context.Context, in *VsSettlementInfoReq, opts ...client.CallOption) (*VsSettlementInfoRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.VsSettlementInfo", in) + out := new(VsSettlementInfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignService) ActionList(ctx context.Context, in *ActionListReq, opts ...client.CallOption) (*ActionListRes, error) { + req := c.c.NewRequest(c.name, "WCampaign.ActionList", in) + out := new(ActionListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WCampaign service + +type WCampaignHandler interface { + // List 活动列表 + List(context.Context, *ListReq, *ListRes) error + // Share 社媒选项 + Share(context.Context, *ShareReq, *ShareRes) error + // Status 修改状态 + Status(context.Context, *StatusReq, *StatusRes) error + // Destroy 删除活动 + Destroy(context.Context, *DestroyReq, *DestroyRes) error + // Store 创建活动 + Store(context.Context, *StoreReq, *StoreRes) error + // Update 更新活动 + Update(context.Context, *UpdateReq, *UpdateRes) error + // Show 活动详情 + Show(context.Context, *ShowReq, *ShowRes) error + // ChannelList 渠道列表 + ChannelList(context.Context, *ChannelListReq, *ChannelListRes) error + // ChannelCreate 渠道创建 + ChannelCreate(context.Context, *ChannelCreateReq, *ChannelCreateRes) error + // ChannelUpdate 渠道创建 + ChannelUpdate(context.Context, *ChannelUpdateReq, *ChannelUpdateRes) error + // ChannelDestroy 渠道创建 + ChannelDestroy(context.Context, *ChannelDestroyReq, *ChannelDestroyRes) error + // KvData 获取活动键值对 + KvData(context.Context, *KvDataReq, *KvDataRes) error + // Cert 认证活动信息 + Cert(context.Context, *CertReq, *CertRes) error + // Barrage 活动弹幕 + Barrage(context.Context, *BarrageReq, *BarrageRes) error + // Option 投票选项 + Option(context.Context, *OptionReq, *OptionRes) error + // RelateDdl 活动关联动态下载页 + RelateDdl(context.Context, *RelateDdlReq, *RelateDdlRes) error + // DdlCampaign 关联动态下载页的活动 + DdlCampaign(context.Context, *DdlCampaignReq, *DdlCampaignRes) error + // Langs 活动多语言配置信息 + Langs(context.Context, *LangsReq, *LangsRes) error + // Lang 活动语言信息 + Lang(context.Context, *LangReq, *LangRes) error + // SaveLang 保存活动多语言配置信息 + SaveLang(context.Context, *SaveLangReq, *SaveLangRes) error + // DestroyLang 删除活动语言配置信息 + DestroyLang(context.Context, *DestroyLangReq, *DestroyLangRes) error + // LangSelect 活动语言选择 + LangSelect(context.Context, *LangSelectReq, *LangSelectRes) error + // CampaignInfo 活动信息 + CampaignInfo(context.Context, *CampaignInfoReq, *CampaignInfoRes) error + // ShowReward 显示的奖品数据 + ShowReward(context.Context, *ShowRewardReq, *ShowRewardRes) error + // AdsStore 创建Ads活动 + AdsStore(context.Context, *AdsStoreReq, *AdsStoreRes) error + // AdsUpdate 更新Ads活动 + AdsUpdate(context.Context, *AdsUpdateReq, *AdsUpdateRes) error + // AdsShow Ads活动详情 + AdsShow(context.Context, *AdsShowReq, *AdsShowRes) error + // CampaignSelect 活动选择列表 + CampaignSelect(context.Context, *CampaignSelectReq, *CampaignSelectRes) error + // RewardDetail 奖品详情 + RewardDetail(context.Context, *RewardDetailReq, *RewardDetailRes) error + // UpdateStock 修改奖品库存 + UpdateStock(context.Context, *UpdateStockReq, *UpdateStockRes) error + // CampaignTz 活动时区数据 + CampaignTz(context.Context, *CampaignTzReq, *CampaignTzRes) error + // CampaignRewardType 活动奖品类型 + CampaignRewardType(context.Context, *CampaignRewardTypeReq, *CampaignRewardTypeRes) error + // ChildList 子活动列表 + ChildList(context.Context, *ChildListReq, *ChildListRes) error + // ChildStore 子活动列表 + ChildStore(context.Context, *ChildStoreReq, *ChildStoreRes) error + // ChildUpdate 更新子活动 + ChildUpdate(context.Context, *ChildUpdateReq, *ChildUpdateRes) error + // ChildShow 子活动活动 + ChildShow(context.Context, *ChildShowReq, *ChildShowRes) error + // TaskCenterJump 任务中心活动跳转地址 + TaskCenterJump(context.Context, *TaskCenterJumpReq, *TaskCenterJumpRes) error + // CondList 活动任务数据 + CondList(context.Context, *CondListReq, *CondListRes) error + // Campaigns 获取活动数据 + Campaigns(context.Context, *CampaignsReq, *CampaignsRes) error + // SetLvApi 设置动态用户等级动态api + SetLvApi(context.Context, *SetLvApiReq, *SetLvApiRes) error + // GetLvApi 获取动态用户等级动态api + GetLvApi(context.Context, *GetLvApiReq, *GetLvApiRes) error + // VsSettlement 赛事竞猜结算 + VsSettlement(context.Context, *VsSettlementReq, *VsSettlementRes) error + // VsSettlementInfo 赛事竞猜结算 + VsSettlementInfo(context.Context, *VsSettlementInfoReq, *VsSettlementInfoRes) error + // ActionList 行为列表 + ActionList(context.Context, *ActionListReq, *ActionListRes) error +} + +func RegisterWCampaignHandler(s server.Server, hdlr WCampaignHandler, opts ...server.HandlerOption) error { + type wCampaign interface { + List(ctx context.Context, in *ListReq, out *ListRes) error + Share(ctx context.Context, in *ShareReq, out *ShareRes) error + Status(ctx context.Context, in *StatusReq, out *StatusRes) error + Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error + Store(ctx context.Context, in *StoreReq, out *StoreRes) error + Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error + Show(ctx context.Context, in *ShowReq, out *ShowRes) error + ChannelList(ctx context.Context, in *ChannelListReq, out *ChannelListRes) error + ChannelCreate(ctx context.Context, in *ChannelCreateReq, out *ChannelCreateRes) error + ChannelUpdate(ctx context.Context, in *ChannelUpdateReq, out *ChannelUpdateRes) error + ChannelDestroy(ctx context.Context, in *ChannelDestroyReq, out *ChannelDestroyRes) error + KvData(ctx context.Context, in *KvDataReq, out *KvDataRes) error + Cert(ctx context.Context, in *CertReq, out *CertRes) error + Barrage(ctx context.Context, in *BarrageReq, out *BarrageRes) error + Option(ctx context.Context, in *OptionReq, out *OptionRes) error + RelateDdl(ctx context.Context, in *RelateDdlReq, out *RelateDdlRes) error + DdlCampaign(ctx context.Context, in *DdlCampaignReq, out *DdlCampaignRes) error + Langs(ctx context.Context, in *LangsReq, out *LangsRes) error + Lang(ctx context.Context, in *LangReq, out *LangRes) error + SaveLang(ctx context.Context, in *SaveLangReq, out *SaveLangRes) error + DestroyLang(ctx context.Context, in *DestroyLangReq, out *DestroyLangRes) error + LangSelect(ctx context.Context, in *LangSelectReq, out *LangSelectRes) error + CampaignInfo(ctx context.Context, in *CampaignInfoReq, out *CampaignInfoRes) error + ShowReward(ctx context.Context, in *ShowRewardReq, out *ShowRewardRes) error + AdsStore(ctx context.Context, in *AdsStoreReq, out *AdsStoreRes) error + AdsUpdate(ctx context.Context, in *AdsUpdateReq, out *AdsUpdateRes) error + AdsShow(ctx context.Context, in *AdsShowReq, out *AdsShowRes) error + CampaignSelect(ctx context.Context, in *CampaignSelectReq, out *CampaignSelectRes) error + RewardDetail(ctx context.Context, in *RewardDetailReq, out *RewardDetailRes) error + UpdateStock(ctx context.Context, in *UpdateStockReq, out *UpdateStockRes) error + CampaignTz(ctx context.Context, in *CampaignTzReq, out *CampaignTzRes) error + CampaignRewardType(ctx context.Context, in *CampaignRewardTypeReq, out *CampaignRewardTypeRes) error + ChildList(ctx context.Context, in *ChildListReq, out *ChildListRes) error + ChildStore(ctx context.Context, in *ChildStoreReq, out *ChildStoreRes) error + ChildUpdate(ctx context.Context, in *ChildUpdateReq, out *ChildUpdateRes) error + ChildShow(ctx context.Context, in *ChildShowReq, out *ChildShowRes) error + TaskCenterJump(ctx context.Context, in *TaskCenterJumpReq, out *TaskCenterJumpRes) error + CondList(ctx context.Context, in *CondListReq, out *CondListRes) error + Campaigns(ctx context.Context, in *CampaignsReq, out *CampaignsRes) error + SetLvApi(ctx context.Context, in *SetLvApiReq, out *SetLvApiRes) error + GetLvApi(ctx context.Context, in *GetLvApiReq, out *GetLvApiRes) error + VsSettlement(ctx context.Context, in *VsSettlementReq, out *VsSettlementRes) error + VsSettlementInfo(ctx context.Context, in *VsSettlementInfoReq, out *VsSettlementInfoRes) error + ActionList(ctx context.Context, in *ActionListReq, out *ActionListRes) error + } + type WCampaign struct { + wCampaign + } + h := &wCampaignHandler{hdlr} + return s.Handle(s.NewHandler(&WCampaign{h}, opts...)) +} + +type wCampaignHandler struct { + WCampaignHandler +} + +func (h *wCampaignHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WCampaignHandler.List(ctx, in, out) +} + +func (h *wCampaignHandler) Share(ctx context.Context, in *ShareReq, out *ShareRes) error { + return h.WCampaignHandler.Share(ctx, in, out) +} + +func (h *wCampaignHandler) Status(ctx context.Context, in *StatusReq, out *StatusRes) error { + return h.WCampaignHandler.Status(ctx, in, out) +} + +func (h *wCampaignHandler) Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error { + return h.WCampaignHandler.Destroy(ctx, in, out) +} + +func (h *wCampaignHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error { + return h.WCampaignHandler.Store(ctx, in, out) +} + +func (h *wCampaignHandler) Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error { + return h.WCampaignHandler.Update(ctx, in, out) +} + +func (h *wCampaignHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error { + return h.WCampaignHandler.Show(ctx, in, out) +} + +func (h *wCampaignHandler) ChannelList(ctx context.Context, in *ChannelListReq, out *ChannelListRes) error { + return h.WCampaignHandler.ChannelList(ctx, in, out) +} + +func (h *wCampaignHandler) ChannelCreate(ctx context.Context, in *ChannelCreateReq, out *ChannelCreateRes) error { + return h.WCampaignHandler.ChannelCreate(ctx, in, out) +} + +func (h *wCampaignHandler) ChannelUpdate(ctx context.Context, in *ChannelUpdateReq, out *ChannelUpdateRes) error { + return h.WCampaignHandler.ChannelUpdate(ctx, in, out) +} + +func (h *wCampaignHandler) ChannelDestroy(ctx context.Context, in *ChannelDestroyReq, out *ChannelDestroyRes) error { + return h.WCampaignHandler.ChannelDestroy(ctx, in, out) +} + +func (h *wCampaignHandler) KvData(ctx context.Context, in *KvDataReq, out *KvDataRes) error { + return h.WCampaignHandler.KvData(ctx, in, out) +} + +func (h *wCampaignHandler) Cert(ctx context.Context, in *CertReq, out *CertRes) error { + return h.WCampaignHandler.Cert(ctx, in, out) +} + +func (h *wCampaignHandler) Barrage(ctx context.Context, in *BarrageReq, out *BarrageRes) error { + return h.WCampaignHandler.Barrage(ctx, in, out) +} + +func (h *wCampaignHandler) Option(ctx context.Context, in *OptionReq, out *OptionRes) error { + return h.WCampaignHandler.Option(ctx, in, out) +} + +func (h *wCampaignHandler) RelateDdl(ctx context.Context, in *RelateDdlReq, out *RelateDdlRes) error { + return h.WCampaignHandler.RelateDdl(ctx, in, out) +} + +func (h *wCampaignHandler) DdlCampaign(ctx context.Context, in *DdlCampaignReq, out *DdlCampaignRes) error { + return h.WCampaignHandler.DdlCampaign(ctx, in, out) +} + +func (h *wCampaignHandler) Langs(ctx context.Context, in *LangsReq, out *LangsRes) error { + return h.WCampaignHandler.Langs(ctx, in, out) +} + +func (h *wCampaignHandler) Lang(ctx context.Context, in *LangReq, out *LangRes) error { + return h.WCampaignHandler.Lang(ctx, in, out) +} + +func (h *wCampaignHandler) SaveLang(ctx context.Context, in *SaveLangReq, out *SaveLangRes) error { + return h.WCampaignHandler.SaveLang(ctx, in, out) +} + +func (h *wCampaignHandler) DestroyLang(ctx context.Context, in *DestroyLangReq, out *DestroyLangRes) error { + return h.WCampaignHandler.DestroyLang(ctx, in, out) +} + +func (h *wCampaignHandler) LangSelect(ctx context.Context, in *LangSelectReq, out *LangSelectRes) error { + return h.WCampaignHandler.LangSelect(ctx, in, out) +} + +func (h *wCampaignHandler) CampaignInfo(ctx context.Context, in *CampaignInfoReq, out *CampaignInfoRes) error { + return h.WCampaignHandler.CampaignInfo(ctx, in, out) +} + +func (h *wCampaignHandler) ShowReward(ctx context.Context, in *ShowRewardReq, out *ShowRewardRes) error { + return h.WCampaignHandler.ShowReward(ctx, in, out) +} + +func (h *wCampaignHandler) AdsStore(ctx context.Context, in *AdsStoreReq, out *AdsStoreRes) error { + return h.WCampaignHandler.AdsStore(ctx, in, out) +} + +func (h *wCampaignHandler) AdsUpdate(ctx context.Context, in *AdsUpdateReq, out *AdsUpdateRes) error { + return h.WCampaignHandler.AdsUpdate(ctx, in, out) +} + +func (h *wCampaignHandler) AdsShow(ctx context.Context, in *AdsShowReq, out *AdsShowRes) error { + return h.WCampaignHandler.AdsShow(ctx, in, out) +} + +func (h *wCampaignHandler) CampaignSelect(ctx context.Context, in *CampaignSelectReq, out *CampaignSelectRes) error { + return h.WCampaignHandler.CampaignSelect(ctx, in, out) +} + +func (h *wCampaignHandler) RewardDetail(ctx context.Context, in *RewardDetailReq, out *RewardDetailRes) error { + return h.WCampaignHandler.RewardDetail(ctx, in, out) +} + +func (h *wCampaignHandler) UpdateStock(ctx context.Context, in *UpdateStockReq, out *UpdateStockRes) error { + return h.WCampaignHandler.UpdateStock(ctx, in, out) +} + +func (h *wCampaignHandler) CampaignTz(ctx context.Context, in *CampaignTzReq, out *CampaignTzRes) error { + return h.WCampaignHandler.CampaignTz(ctx, in, out) +} + +func (h *wCampaignHandler) CampaignRewardType(ctx context.Context, in *CampaignRewardTypeReq, out *CampaignRewardTypeRes) error { + return h.WCampaignHandler.CampaignRewardType(ctx, in, out) +} + +func (h *wCampaignHandler) ChildList(ctx context.Context, in *ChildListReq, out *ChildListRes) error { + return h.WCampaignHandler.ChildList(ctx, in, out) +} + +func (h *wCampaignHandler) ChildStore(ctx context.Context, in *ChildStoreReq, out *ChildStoreRes) error { + return h.WCampaignHandler.ChildStore(ctx, in, out) +} + +func (h *wCampaignHandler) ChildUpdate(ctx context.Context, in *ChildUpdateReq, out *ChildUpdateRes) error { + return h.WCampaignHandler.ChildUpdate(ctx, in, out) +} + +func (h *wCampaignHandler) ChildShow(ctx context.Context, in *ChildShowReq, out *ChildShowRes) error { + return h.WCampaignHandler.ChildShow(ctx, in, out) +} + +func (h *wCampaignHandler) TaskCenterJump(ctx context.Context, in *TaskCenterJumpReq, out *TaskCenterJumpRes) error { + return h.WCampaignHandler.TaskCenterJump(ctx, in, out) +} + +func (h *wCampaignHandler) CondList(ctx context.Context, in *CondListReq, out *CondListRes) error { + return h.WCampaignHandler.CondList(ctx, in, out) +} + +func (h *wCampaignHandler) Campaigns(ctx context.Context, in *CampaignsReq, out *CampaignsRes) error { + return h.WCampaignHandler.Campaigns(ctx, in, out) +} + +func (h *wCampaignHandler) SetLvApi(ctx context.Context, in *SetLvApiReq, out *SetLvApiRes) error { + return h.WCampaignHandler.SetLvApi(ctx, in, out) +} + +func (h *wCampaignHandler) GetLvApi(ctx context.Context, in *GetLvApiReq, out *GetLvApiRes) error { + return h.WCampaignHandler.GetLvApi(ctx, in, out) +} + +func (h *wCampaignHandler) VsSettlement(ctx context.Context, in *VsSettlementReq, out *VsSettlementRes) error { + return h.WCampaignHandler.VsSettlement(ctx, in, out) +} + +func (h *wCampaignHandler) VsSettlementInfo(ctx context.Context, in *VsSettlementInfoReq, out *VsSettlementInfoRes) error { + return h.WCampaignHandler.VsSettlementInfo(ctx, in, out) +} + +func (h *wCampaignHandler) ActionList(ctx context.Context, in *ActionListReq, out *ActionListRes) error { + return h.WCampaignHandler.ActionList(ctx, in, out) +} diff --git a/proto/go_proto/w_campaign_stat/w_campaign_stat.pb.go b/proto/go_proto/w_campaign_stat/w_campaign_stat.pb.go new file mode 100644 index 0000000..6f5b706 --- /dev/null +++ b/proto/go_proto/w_campaign_stat/w_campaign_stat.pb.go @@ -0,0 +1,6792 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_campaign_stat.proto + +package w_campaign_statpb + +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 SummaryReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *SummaryReq) Reset() { + *x = SummaryReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryReq) ProtoMessage() {} + +func (x *SummaryReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 SummaryReq.ProtoReflect.Descriptor instead. +func (*SummaryReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{0} +} + +func (x *SummaryReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *SummaryReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type SummaryRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //列表数据 + StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //活动开始时间时间戳 + EndTime int64 `protobuf:"varint,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //活动结束时间时间戳 + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` //活动状态(1-待发布,2-已发布,3-下线) + InstallNum int64 `protobuf:"varint,5,opt,name=install_num,json=installNum,proto3" json:"install_num,omitempty"` //下载次数|注册次数 + ShareUserNum int64 `protobuf:"varint,6,opt,name=share_user_num,json=shareUserNum,proto3" json:"share_user_num,omitempty"` //邀请按钮点击人数 + ViewNum int64 `protobuf:"varint,7,opt,name=view_num,json=viewNum,proto3" json:"view_num,omitempty"` //访问总次数 + ViewUserNum int64 `protobuf:"varint,8,opt,name=view_user_num,json=viewUserNum,proto3" json:"view_user_num,omitempty"` //访问总人数 + MaxDeep int64 `protobuf:"varint,9,opt,name=max_deep,json=maxDeep,proto3" json:"max_deep,omitempty"` //最高裂变层级 + TodayViewNum int64 `protobuf:"varint,10,opt,name=today_view_num,json=todayViewNum,proto3" json:"today_view_num,omitempty"` //今日访问次数 + TodayUserNum int64 `protobuf:"varint,11,opt,name=today_user_num,json=todayUserNum,proto3" json:"today_user_num,omitempty"` //今日参与人数 + CoverUrl string `protobuf:"bytes,12,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //活动名称 + Target int32 `protobuf:"varint,13,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + EventData *SummaryRes_EventData `protobuf:"bytes,14,opt,name=event_data,json=eventData,proto3" json:"event_data,omitempty"` //事件统计数据 + Option int32 `protobuf:"varint,15,opt,name=option,proto3" json:"option,omitempty"` //目标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗) + Type int32 `protobuf:"varint,16,opt,name=type,proto3" json:"type,omitempty"` //报表类型(1-下载,2-注册,3-事件,4-报表,5-养成) + SignNum int64 `protobuf:"varint,17,opt,name=sign_num,json=signNum,proto3" json:"sign_num,omitempty"` //总签到人数 + SignTargetNum int64 `protobuf:"varint,18,opt,name=sign_target_num,json=signTargetNum,proto3" json:"sign_target_num,omitempty"` //总签到达标人数 + TodaySignNum int64 `protobuf:"varint,19,opt,name=today_sign_num,json=todaySignNum,proto3" json:"today_sign_num,omitempty"` //今日总签到人数 + TodaySignTargetNum int64 `protobuf:"varint,20,opt,name=today_sign_target_num,json=todaySignTargetNum,proto3" json:"today_sign_target_num,omitempty"` //今日总签到达标人数 + Grow *SummaryRes_Grow `protobuf:"bytes,21,opt,name=grow,proto3" json:"grow,omitempty"` //养成类型特定统计参数 +} + +func (x *SummaryRes) Reset() { + *x = SummaryRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryRes) ProtoMessage() {} + +func (x *SummaryRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 SummaryRes.ProtoReflect.Descriptor instead. +func (*SummaryRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{1} +} + +func (x *SummaryRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SummaryRes) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *SummaryRes) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *SummaryRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *SummaryRes) GetInstallNum() int64 { + if x != nil { + return x.InstallNum + } + return 0 +} + +func (x *SummaryRes) GetShareUserNum() int64 { + if x != nil { + return x.ShareUserNum + } + return 0 +} + +func (x *SummaryRes) GetViewNum() int64 { + if x != nil { + return x.ViewNum + } + return 0 +} + +func (x *SummaryRes) GetViewUserNum() int64 { + if x != nil { + return x.ViewUserNum + } + return 0 +} + +func (x *SummaryRes) GetMaxDeep() int64 { + if x != nil { + return x.MaxDeep + } + return 0 +} + +func (x *SummaryRes) GetTodayViewNum() int64 { + if x != nil { + return x.TodayViewNum + } + return 0 +} + +func (x *SummaryRes) GetTodayUserNum() int64 { + if x != nil { + return x.TodayUserNum + } + return 0 +} + +func (x *SummaryRes) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *SummaryRes) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *SummaryRes) GetEventData() *SummaryRes_EventData { + if x != nil { + return x.EventData + } + return nil +} + +func (x *SummaryRes) GetOption() int32 { + if x != nil { + return x.Option + } + return 0 +} + +func (x *SummaryRes) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *SummaryRes) GetSignNum() int64 { + if x != nil { + return x.SignNum + } + return 0 +} + +func (x *SummaryRes) GetSignTargetNum() int64 { + if x != nil { + return x.SignTargetNum + } + return 0 +} + +func (x *SummaryRes) GetTodaySignNum() int64 { + if x != nil { + return x.TodaySignNum + } + return 0 +} + +func (x *SummaryRes) GetTodaySignTargetNum() int64 { + if x != nil { + return x.TodaySignTargetNum + } + return 0 +} + +func (x *SummaryRes) GetGrow() *SummaryRes_Grow { + if x != nil { + return x.Grow + } + return nil +} + +type CampaignReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //统计开始时间时间戳 + EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //统计结束时间时间戳 +} + +func (x *CampaignReq) Reset() { + *x = CampaignReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignReq) ProtoMessage() {} + +func (x *CampaignReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 CampaignReq.ProtoReflect.Descriptor instead. +func (*CampaignReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{2} +} + +func (x *CampaignReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *CampaignReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *CampaignReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *CampaignReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type CampaignRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X []string `protobuf:"bytes,1,rep,name=x,proto3" json:"x,omitempty"` //x轴 + ReportUser *CampaignRes_Report `protobuf:"bytes,2,opt,name=report_user,json=reportUser,proto3" json:"report_user,omitempty"` //人数报告 + ReportNum *CampaignRes_Report `protobuf:"bytes,3,opt,name=report_num,json=reportNum,proto3" json:"report_num,omitempty"` //次数报告 + ShowType int32 `protobuf:"varint,4,opt,name=show_type,json=showType,proto3" json:"show_type,omitempty"` //展示类型(1-活动访问,2-达标条件,3-签到,4-养成) +} + +func (x *CampaignRes) Reset() { + *x = CampaignRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignRes) ProtoMessage() {} + +func (x *CampaignRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 CampaignRes.ProtoReflect.Descriptor instead. +func (*CampaignRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{3} +} + +func (x *CampaignRes) GetX() []string { + if x != nil { + return x.X + } + return nil +} + +func (x *CampaignRes) GetReportUser() *CampaignRes_Report { + if x != nil { + return x.ReportUser + } + return nil +} + +func (x *CampaignRes) GetReportNum() *CampaignRes_Report { + if x != nil { + return x.ReportNum + } + return nil +} + +func (x *CampaignRes) GetShowType() int32 { + if x != nil { + return x.ShowType + } + return 0 +} + +type RelatedReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //统计开始时间时间戳 + EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //统计结束时间时间戳 +} + +func (x *RelatedReq) Reset() { + *x = RelatedReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelatedReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelatedReq) ProtoMessage() {} + +func (x *RelatedReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 RelatedReq.ProtoReflect.Descriptor instead. +func (*RelatedReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{4} +} + +func (x *RelatedReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *RelatedReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *RelatedReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *RelatedReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type RelatedRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X []string `protobuf:"bytes,1,rep,name=x,proto3" json:"x,omitempty"` //x轴 + ReportUser *RelatedRes_Report `protobuf:"bytes,2,opt,name=report_user,json=reportUser,proto3" json:"report_user,omitempty"` //人数报告 + ReportNum *RelatedRes_Report `protobuf:"bytes,3,opt,name=report_num,json=reportNum,proto3" json:"report_num,omitempty"` //次数报告 +} + +func (x *RelatedRes) Reset() { + *x = RelatedRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelatedRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelatedRes) ProtoMessage() {} + +func (x *RelatedRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 RelatedRes.ProtoReflect.Descriptor instead. +func (*RelatedRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{5} +} + +func (x *RelatedRes) GetX() []string { + if x != nil { + return x.X + } + return nil +} + +func (x *RelatedRes) GetReportUser() *RelatedRes_Report { + if x != nil { + return x.ReportUser + } + return nil +} + +func (x *RelatedRes) GetReportNum() *RelatedRes_Report { + if x != nil { + return x.ReportNum + } + return nil +} + +type StatReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + BehaviorType int32 `protobuf:"varint,2,opt,name=behavior_type,json=behaviorType,proto3" json:"behavior_type,omitempty"` //用户行为类型 + BehaviorTime int64 `protobuf:"varint,3,opt,name=behavior_time,json=behaviorTime,proto3" json:"behavior_time,omitempty"` //用户行为时间 + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` //用户ip + Os string `protobuf:"bytes,5,opt,name=os,proto3" json:"os,omitempty"` //系统 + OsVer string `protobuf:"bytes,6,opt,name=os_ver,json=osVer,proto3" json:"os_ver,omitempty"` //用户版本 + DeviceModel string `protobuf:"bytes,7,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"` //设备型号 + SubUserId string `protobuf:"bytes,8,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //活动用户外部id + ParentUserId string `protobuf:"bytes,9,opt,name=parent_user_id,json=parentUserId,proto3" json:"parent_user_id,omitempty"` //用户上级用户外部id + MediaId int64 `protobuf:"varint,10,opt,name=media_id,json=mediaId,proto3" json:"media_id,omitempty"` //社媒id + CMark string `protobuf:"bytes,11,opt,name=c_mark,json=cMark,proto3" json:"c_mark,omitempty"` //渠道标识 + Icon string `protobuf:"bytes,12,opt,name=icon,proto3" json:"icon,omitempty"` //图标标识(invite-邀请框icon) + Wid string `protobuf:"bytes,13,opt,name=wid,proto3" json:"wid,omitempty"` //浏览器id +} + +func (x *StatReq) Reset() { + *x = StatReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatReq) ProtoMessage() {} + +func (x *StatReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 StatReq.ProtoReflect.Descriptor instead. +func (*StatReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{6} +} + +func (x *StatReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *StatReq) GetBehaviorType() int32 { + if x != nil { + return x.BehaviorType + } + return 0 +} + +func (x *StatReq) GetBehaviorTime() int64 { + if x != nil { + return x.BehaviorTime + } + return 0 +} + +func (x *StatReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *StatReq) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *StatReq) GetOsVer() string { + if x != nil { + return x.OsVer + } + return "" +} + +func (x *StatReq) GetDeviceModel() string { + if x != nil { + return x.DeviceModel + } + return "" +} + +func (x *StatReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *StatReq) GetParentUserId() string { + if x != nil { + return x.ParentUserId + } + return "" +} + +func (x *StatReq) GetMediaId() int64 { + if x != nil { + return x.MediaId + } + return 0 +} + +func (x *StatReq) GetCMark() string { + if x != nil { + return x.CMark + } + return "" +} + +func (x *StatReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *StatReq) GetWid() string { + if x != nil { + return x.Wid + } + return "" +} + +type StatRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StatRes) Reset() { + *x = StatRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatRes) ProtoMessage() {} + +func (x *StatRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 StatRes.ProtoReflect.Descriptor instead. +func (*StatRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{7} +} + +type ChannelReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + CType int32 `protobuf:"varint,2,opt,name=c_type,json=cType,proto3" json:"c_type,omitempty"` //渠道类型(1-站内渠道,2-站外渠道) + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //统计开始时间时间戳 + EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //统计结束时间时间戳 + Page int32 `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,6,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 +} + +func (x *ChannelReq) Reset() { + *x = ChannelReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelReq) ProtoMessage() {} + +func (x *ChannelReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 ChannelReq.ProtoReflect.Descriptor instead. +func (*ChannelReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{8} +} + +func (x *ChannelReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *ChannelReq) GetCType() int32 { + if x != nil { + return x.CType + } + return 0 +} + +func (x *ChannelReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ChannelReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ChannelReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ChannelReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +type ChannelRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ChannelRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ChannelRes) Reset() { + *x = ChannelRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelRes) ProtoMessage() {} + +func (x *ChannelRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 ChannelRes.ProtoReflect.Descriptor instead. +func (*ChannelRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{9} +} + +func (x *ChannelRes) GetList() []*ChannelRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ChannelRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type AdsSummaryReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *AdsSummaryReq) Reset() { + *x = AdsSummaryReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsSummaryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsSummaryReq) ProtoMessage() {} + +func (x *AdsSummaryReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 AdsSummaryReq.ProtoReflect.Descriptor instead. +func (*AdsSummaryReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{10} +} + +func (x *AdsSummaryReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type AdsSummaryRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VisitorNum int64 `protobuf:"varint,1,opt,name=visitor_num,json=visitorNum,proto3" json:"visitor_num,omitempty"` //访问量 + VisitorNumToday int64 `protobuf:"varint,2,opt,name=visitor_num_today,json=visitorNumToday,proto3" json:"visitor_num_today,omitempty"` //今日访问量 + VisitorNumYesterday int64 `protobuf:"varint,3,opt,name=visitor_num_yesterday,json=visitorNumYesterday,proto3" json:"visitor_num_yesterday,omitempty"` //昨日访问量 + VisitorUser int64 `protobuf:"varint,4,opt,name=visitor_user,json=visitorUser,proto3" json:"visitor_user,omitempty"` //访问人数 + VisitorUserToday int64 `protobuf:"varint,5,opt,name=visitor_user_today,json=visitorUserToday,proto3" json:"visitor_user_today,omitempty"` //今日访问人数 + VisitorUserYesterday int64 `protobuf:"varint,6,opt,name=visitor_user_yesterday,json=visitorUserYesterday,proto3" json:"visitor_user_yesterday,omitempty"` //昨日访问人数 + VisitorUserDayCompare string `protobuf:"bytes,7,opt,name=visitor_user_day_compare,json=visitorUserDayCompare,proto3" json:"visitor_user_day_compare,omitempty"` //访问人数日坏比 + VisitorUserDayCompareUp int32 `protobuf:"varint,8,opt,name=visitor_user_day_compare_up,json=visitorUserDayCompareUp,proto3" json:"visitor_user_day_compare_up,omitempty"` //访问人数日坏比趋势,0-无变化,1-上涨,2-下降 + InstallNum int64 `protobuf:"varint,9,opt,name=install_num,json=installNum,proto3" json:"install_num,omitempty"` //下载量 + InstallNumToday int64 `protobuf:"varint,10,opt,name=install_num_today,json=installNumToday,proto3" json:"install_num_today,omitempty"` //今日下载量 + InstallNumYesterday int64 `protobuf:"varint,11,opt,name=install_num_yesterday,json=installNumYesterday,proto3" json:"install_num_yesterday,omitempty"` //昨日下载量 + InstallUser int64 `protobuf:"varint,12,opt,name=install_user,json=installUser,proto3" json:"install_user,omitempty"` //下载人数 + InstallUserToday int64 `protobuf:"varint,13,opt,name=install_user_today,json=installUserToday,proto3" json:"install_user_today,omitempty"` //今日下载人数 + InstallUserYesterday int64 `protobuf:"varint,14,opt,name=install_user_yesterday,json=installUserYesterday,proto3" json:"install_user_yesterday,omitempty"` //昨日下载人数 + InstallUserDayCompare string `protobuf:"bytes,15,opt,name=install_user_day_compare,json=installUserDayCompare,proto3" json:"install_user_day_compare,omitempty"` //下载人数日坏比 + InstallUserDayCompareUp int32 `protobuf:"varint,16,opt,name=install_user_day_compare_up,json=installUserDayCompareUp,proto3" json:"install_user_day_compare_up,omitempty"` //下载人数日坏比趋势,0-无变化,1-上涨,2-下降 + RewardUserAppToday int64 `protobuf:"varint,17,opt,name=reward_user_app_today,json=rewardUserAppToday,proto3" json:"reward_user_app_today,omitempty"` //今日领奖人数 +} + +func (x *AdsSummaryRes) Reset() { + *x = AdsSummaryRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsSummaryRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsSummaryRes) ProtoMessage() {} + +func (x *AdsSummaryRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 AdsSummaryRes.ProtoReflect.Descriptor instead. +func (*AdsSummaryRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{11} +} + +func (x *AdsSummaryRes) GetVisitorNum() int64 { + if x != nil { + return x.VisitorNum + } + return 0 +} + +func (x *AdsSummaryRes) GetVisitorNumToday() int64 { + if x != nil { + return x.VisitorNumToday + } + return 0 +} + +func (x *AdsSummaryRes) GetVisitorNumYesterday() int64 { + if x != nil { + return x.VisitorNumYesterday + } + return 0 +} + +func (x *AdsSummaryRes) GetVisitorUser() int64 { + if x != nil { + return x.VisitorUser + } + return 0 +} + +func (x *AdsSummaryRes) GetVisitorUserToday() int64 { + if x != nil { + return x.VisitorUserToday + } + return 0 +} + +func (x *AdsSummaryRes) GetVisitorUserYesterday() int64 { + if x != nil { + return x.VisitorUserYesterday + } + return 0 +} + +func (x *AdsSummaryRes) GetVisitorUserDayCompare() string { + if x != nil { + return x.VisitorUserDayCompare + } + return "" +} + +func (x *AdsSummaryRes) GetVisitorUserDayCompareUp() int32 { + if x != nil { + return x.VisitorUserDayCompareUp + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallNum() int64 { + if x != nil { + return x.InstallNum + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallNumToday() int64 { + if x != nil { + return x.InstallNumToday + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallNumYesterday() int64 { + if x != nil { + return x.InstallNumYesterday + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallUser() int64 { + if x != nil { + return x.InstallUser + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallUserToday() int64 { + if x != nil { + return x.InstallUserToday + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallUserYesterday() int64 { + if x != nil { + return x.InstallUserYesterday + } + return 0 +} + +func (x *AdsSummaryRes) GetInstallUserDayCompare() string { + if x != nil { + return x.InstallUserDayCompare + } + return "" +} + +func (x *AdsSummaryRes) GetInstallUserDayCompareUp() int32 { + if x != nil { + return x.InstallUserDayCompareUp + } + return 0 +} + +func (x *AdsSummaryRes) GetRewardUserAppToday() int64 { + if x != nil { + return x.RewardUserAppToday + } + return 0 +} + +type AdsTableReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //统计开始时间时间戳 + EndTime int64 `protobuf:"varint,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //统计结束时间时间戳 +} + +func (x *AdsTableReq) Reset() { + *x = AdsTableReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsTableReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsTableReq) ProtoMessage() {} + +func (x *AdsTableReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 AdsTableReq.ProtoReflect.Descriptor instead. +func (*AdsTableReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{12} +} + +func (x *AdsTableReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *AdsTableReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *AdsTableReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type AdsTableRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VisitorUser int64 `protobuf:"varint,1,opt,name=visitor_user,json=visitorUser,proto3" json:"visitor_user,omitempty"` //区间访问人数 + InstallUser int64 `protobuf:"varint,2,opt,name=install_user,json=installUser,proto3" json:"install_user,omitempty"` //区间下载人数 + InstallUserCompare string `protobuf:"bytes,3,opt,name=install_user_compare,json=installUserCompare,proto3" json:"install_user_compare,omitempty"` //下载转化率 + X []string `protobuf:"bytes,4,rep,name=x,proto3" json:"x,omitempty"` //x轴 + Y []*AdsTableRes_Y `protobuf:"bytes,5,rep,name=y,proto3" json:"y,omitempty"` //x轴 +} + +func (x *AdsTableRes) Reset() { + *x = AdsTableRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsTableRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsTableRes) ProtoMessage() {} + +func (x *AdsTableRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 AdsTableRes.ProtoReflect.Descriptor instead. +func (*AdsTableRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{13} +} + +func (x *AdsTableRes) GetVisitorUser() int64 { + if x != nil { + return x.VisitorUser + } + return 0 +} + +func (x *AdsTableRes) GetInstallUser() int64 { + if x != nil { + return x.InstallUser + } + return 0 +} + +func (x *AdsTableRes) GetInstallUserCompare() string { + if x != nil { + return x.InstallUserCompare + } + return "" +} + +func (x *AdsTableRes) GetX() []string { + if x != nil { + return x.X + } + return nil +} + +func (x *AdsTableRes) GetY() []*AdsTableRes_Y { + if x != nil { + return x.Y + } + return nil +} + +type AdsRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *AdsRewardReq) Reset() { + *x = AdsRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsRewardReq) ProtoMessage() {} + +func (x *AdsRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 AdsRewardReq.ProtoReflect.Descriptor instead. +func (*AdsRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{14} +} + +func (x *AdsRewardReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type AdsRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WebNum int64 `protobuf:"varint,1,opt,name=web_num,json=webNum,proto3" json:"web_num,omitempty"` //奖品发放总数 + AppNum int64 `protobuf:"varint,2,opt,name=app_num,json=appNum,proto3" json:"app_num,omitempty"` //奖品领取总数 + Rewards []*AdsRewardRes_Reward `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品列表 +} + +func (x *AdsRewardRes) Reset() { + *x = AdsRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsRewardRes) ProtoMessage() {} + +func (x *AdsRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 AdsRewardRes.ProtoReflect.Descriptor instead. +func (*AdsRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{15} +} + +func (x *AdsRewardRes) GetWebNum() int64 { + if x != nil { + return x.WebNum + } + return 0 +} + +func (x *AdsRewardRes) GetAppNum() int64 { + if x != nil { + return x.AppNum + } + return 0 +} + +func (x *AdsRewardRes) GetRewards() []*AdsRewardRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type InAppBPReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //埋点类型(1-访问活动,5-活动按钮点击,6-点击分享按钮,10-点击去完成,18-点击去使用,19-点击长图) + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + MediaId int64 `protobuf:"varint,3,opt,name=media_id,json=mediaId,proto3" json:"media_id,omitempty"` //社媒id + CondId int64 `protobuf:"varint,4,opt,name=cond_id,json=condId,proto3" json:"cond_id,omitempty"` //条件ID + RewardId int64 `protobuf:"varint,5,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Ip string `protobuf:"bytes,6,opt,name=ip,proto3" json:"ip,omitempty"` //访问ip + ImgUrl string `protobuf:"bytes,7,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + From string `protobuf:"bytes,8,opt,name=from,proto3" json:"from,omitempty"` //埋点类型来源 + FormShowStatus string `protobuf:"bytes,9,opt,name=form_show_status,json=formShowStatus,proto3" json:"form_show_status,omitempty"` //展示的表单状态 + RewardRecordId int64 `protobuf:"varint,10,opt,name=reward_record_id,json=rewardRecordId,proto3" json:"reward_record_id,omitempty"` //奖品领取记录id + Os string `protobuf:"bytes,11,opt,name=os,proto3" json:"os,omitempty"` //系统 + OsVersion string `protobuf:"bytes,12,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` //系统版本 + DeviceModel string `protobuf:"bytes,13,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"` //系统型号 + CampaiginId int64 `protobuf:"varint,14,opt,name=campaigin_id,json=campaiginId,proto3" json:"campaigin_id,omitempty"` //活动id + QaId int64 `protobuf:"varint,15,opt,name=qa_id,json=qaId,proto3" json:"qa_id,omitempty"` //题目id + QaOptionId int64 `protobuf:"varint,16,opt,name=qa_option_id,json=qaOptionId,proto3" json:"qa_option_id,omitempty"` //选择的选项id + IsRight int32 `protobuf:"varint,17,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(-1:不正确,1:正确) + ImgId int64 `protobuf:"varint,18,opt,name=img_id,json=imgId,proto3" json:"img_id,omitempty"` //长图id + ZoneId int64 `protobuf:"varint,19,opt,name=zone_id,json=zoneId,proto3" json:"zone_id,omitempty"` //热区id + ClickFlipStatus string `protobuf:"bytes,20,opt,name=click_flip_status,json=clickFlipStatus,proto3" json:"click_flip_status,omitempty"` //点击立即翻牌状态(有抽奖机会 - has_lucky,没有抽奖机会 - none_lucky) + CustomBtnId int64 `protobuf:"varint,21,opt,name=custom_btn_id,json=customBtnId,proto3" json:"custom_btn_id,omitempty"` //自定义按钮id + ChatFrom string `protobuf:"bytes,22,opt,name=chat_from,json=chatFrom,proto3" json:"chat_from,omitempty"` //进入ai对话来源(icon-图标,tip-宠物文案) + ChatTipMsg string `protobuf:"bytes,23,opt,name=chat_tip_msg,json=chatTipMsg,proto3" json:"chat_tip_msg,omitempty"` //tip宠物文案内容 + ColorMark string `protobuf:"bytes,24,opt,name=color_mark,json=colorMark,proto3" json:"color_mark,omitempty"` //uno颜色 + CardNo string `protobuf:"bytes,25,opt,name=card_no,json=cardNo,proto3" json:"card_no,omitempty"` //uno牌型 + UnoCardId int64 `protobuf:"varint,26,opt,name=uno_card_id,json=unoCardId,proto3" json:"uno_card_id,omitempty"` //uno卡Id +} + +func (x *InAppBPReq) Reset() { + *x = InAppBPReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InAppBPReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InAppBPReq) ProtoMessage() {} + +func (x *InAppBPReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 InAppBPReq.ProtoReflect.Descriptor instead. +func (*InAppBPReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{16} +} + +func (x *InAppBPReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *InAppBPReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *InAppBPReq) GetMediaId() int64 { + if x != nil { + return x.MediaId + } + return 0 +} + +func (x *InAppBPReq) GetCondId() int64 { + if x != nil { + return x.CondId + } + return 0 +} + +func (x *InAppBPReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *InAppBPReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *InAppBPReq) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *InAppBPReq) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *InAppBPReq) GetFormShowStatus() string { + if x != nil { + return x.FormShowStatus + } + return "" +} + +func (x *InAppBPReq) GetRewardRecordId() int64 { + if x != nil { + return x.RewardRecordId + } + return 0 +} + +func (x *InAppBPReq) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *InAppBPReq) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *InAppBPReq) GetDeviceModel() string { + if x != nil { + return x.DeviceModel + } + return "" +} + +func (x *InAppBPReq) GetCampaiginId() int64 { + if x != nil { + return x.CampaiginId + } + return 0 +} + +func (x *InAppBPReq) GetQaId() int64 { + if x != nil { + return x.QaId + } + return 0 +} + +func (x *InAppBPReq) GetQaOptionId() int64 { + if x != nil { + return x.QaOptionId + } + return 0 +} + +func (x *InAppBPReq) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +func (x *InAppBPReq) GetImgId() int64 { + if x != nil { + return x.ImgId + } + return 0 +} + +func (x *InAppBPReq) GetZoneId() int64 { + if x != nil { + return x.ZoneId + } + return 0 +} + +func (x *InAppBPReq) GetClickFlipStatus() string { + if x != nil { + return x.ClickFlipStatus + } + return "" +} + +func (x *InAppBPReq) GetCustomBtnId() int64 { + if x != nil { + return x.CustomBtnId + } + return 0 +} + +func (x *InAppBPReq) GetChatFrom() string { + if x != nil { + return x.ChatFrom + } + return "" +} + +func (x *InAppBPReq) GetChatTipMsg() string { + if x != nil { + return x.ChatTipMsg + } + return "" +} + +func (x *InAppBPReq) GetColorMark() string { + if x != nil { + return x.ColorMark + } + return "" +} + +func (x *InAppBPReq) GetCardNo() string { + if x != nil { + return x.CardNo + } + return "" +} + +func (x *InAppBPReq) GetUnoCardId() int64 { + if x != nil { + return x.UnoCardId + } + return 0 +} + +type InAppBPRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *InAppBPRes) Reset() { + *x = InAppBPRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InAppBPRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InAppBPRes) ProtoMessage() {} + +func (x *InAppBPRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 InAppBPRes.ProtoReflect.Descriptor instead. +func (*InAppBPRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{17} +} + +type ChildBPReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaiginId int64 `protobuf:"varint,2,opt,name=campaigin_id,json=campaiginId,proto3" json:"campaigin_id,omitempty"` //活动id + ChildHashId string `protobuf:"bytes,3,opt,name=child_hash_id,json=childHashId,proto3" json:"child_hash_id,omitempty"` //子活动id + Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` //埋点类型(43-打开子活动入口) +} + +func (x *ChildBPReq) Reset() { + *x = ChildBPReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildBPReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildBPReq) ProtoMessage() {} + +func (x *ChildBPReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 ChildBPReq.ProtoReflect.Descriptor instead. +func (*ChildBPReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{18} +} + +func (x *ChildBPReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChildBPReq) GetCampaiginId() int64 { + if x != nil { + return x.CampaiginId + } + return 0 +} + +func (x *ChildBPReq) GetChildHashId() string { + if x != nil { + return x.ChildHashId + } + return "" +} + +func (x *ChildBPReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +type ChildBPRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChildBPRes) Reset() { + *x = ChildBPRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildBPRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildBPRes) ProtoMessage() {} + +func (x *ChildBPRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 ChildBPRes.ProtoReflect.Descriptor instead. +func (*ChildBPRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{19} +} + +type OutAppBPReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //埋点类型(12-访问站外链接,13-站外活动按钮点击,7-浏览下载页行为, 8-点击下载按钮,9-浏览微信页行为) + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + WebId string `protobuf:"bytes,3,opt,name=web_id,json=webId,proto3" json:"web_id,omitempty"` //用户id + DownloadFrom string `protobuf:"bytes,4,opt,name=download_from,json=downloadFrom,proto3" json:"download_from,omitempty"` //下载页来源 + ParentUserId string `protobuf:"bytes,5,opt,name=parent_user_id,json=parentUserId,proto3" json:"parent_user_id,omitempty"` //上级用户id + Lang string `protobuf:"bytes,6,opt,name=lang,proto3" json:"lang,omitempty"` //语言标识 + Ip string `protobuf:"bytes,7,opt,name=ip,proto3" json:"ip,omitempty"` //访问ip + Cid string `protobuf:"bytes,8,opt,name=cid,proto3" json:"cid,omitempty"` //渠道标识 + Platform string `protobuf:"bytes,9,opt,name=platform,proto3" json:"platform,omitempty"` //平台 + Os string `protobuf:"bytes,10,opt,name=os,proto3" json:"os,omitempty"` //系统 + OsVersion string `protobuf:"bytes,11,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` //系统版本 + DeviceModel string `protobuf:"bytes,12,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"` //系统型号 + Blackbox string `protobuf:"bytes,13,opt,name=blackbox,proto3" json:"blackbox,omitempty"` //黑盒数据 + Uid string `protobuf:"bytes,14,opt,name=uid,proto3" json:"uid,omitempty"` //第三方用户id +} + +func (x *OutAppBPReq) Reset() { + *x = OutAppBPReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OutAppBPReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OutAppBPReq) ProtoMessage() {} + +func (x *OutAppBPReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 OutAppBPReq.ProtoReflect.Descriptor instead. +func (*OutAppBPReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{20} +} + +func (x *OutAppBPReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *OutAppBPReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *OutAppBPReq) GetWebId() string { + if x != nil { + return x.WebId + } + return "" +} + +func (x *OutAppBPReq) GetDownloadFrom() string { + if x != nil { + return x.DownloadFrom + } + return "" +} + +func (x *OutAppBPReq) GetParentUserId() string { + if x != nil { + return x.ParentUserId + } + return "" +} + +func (x *OutAppBPReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *OutAppBPReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *OutAppBPReq) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *OutAppBPReq) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *OutAppBPReq) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *OutAppBPReq) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *OutAppBPReq) GetDeviceModel() string { + if x != nil { + return x.DeviceModel + } + return "" +} + +func (x *OutAppBPReq) GetBlackbox() string { + if x != nil { + return x.Blackbox + } + return "" +} + +func (x *OutAppBPReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +type OutAppBPRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OutAppBPRes) Reset() { + *x = OutAppBPRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OutAppBPRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OutAppBPRes) ProtoMessage() {} + +func (x *OutAppBPRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 OutAppBPRes.ProtoReflect.Descriptor instead. +func (*OutAppBPRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{21} +} + +type ReportInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id +} + +func (x *ReportInfoReq) Reset() { + *x = ReportInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportInfoReq) ProtoMessage() {} + +func (x *ReportInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 ReportInfoReq.ProtoReflect.Descriptor instead. +func (*ReportInfoReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{22} +} + +func (x *ReportInfoReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ReportInfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + CoverUrl string `protobuf:"bytes,3,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //活动封面 + FissionMark string `protobuf:"bytes,4,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //玩法标识 + StartTime int64 `protobuf:"varint,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) + TOffset int32 `protobuf:"varint,8,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + Target int32 `protobuf:"varint,9,opt,name=target,proto3" json:"target,omitempty"` //活动目标 + Events []*ReportInfoRes_Event `protobuf:"bytes,10,rep,name=events,proto3" json:"events,omitempty"` //支持的埋点事件 + FixDimensions []*ReportInfoRes_Dimension `protobuf:"bytes,11,rep,name=fix_dimensions,json=fixDimensions,proto3" json:"fix_dimensions,omitempty"` //固定维度 + LangOffset []*ReportInfoRes_LangOffset `protobuf:"bytes,12,rep,name=lang_offset,json=langOffset,proto3" json:"lang_offset,omitempty"` //语言时区 + OpenFixed int32 `protobuf:"varint,13,opt,name=open_fixed,json=openFixed,proto3" json:"open_fixed,omitempty"` //开始固定事件(0-否,1-是) + OpenCustom int32 `protobuf:"varint,14,opt,name=open_custom,json=openCustom,proto3" json:"open_custom,omitempty"` //开始自定义事件(0-否,1-是) + RewardType []string `protobuf:"bytes,15,rep,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品tab集合(app-活动主奖品,extra-额外奖品,step-阶梯奖,newcomer-新人奖) + ShowAll int32 `protobuf:"varint,16,opt,name=show_all,json=showAll,proto3" json:"show_all,omitempty"` //是否展示总预算模块(0-否,1-是) + ShowSelect int32 `protobuf:"varint,17,opt,name=show_select,json=showSelect,proto3" json:"show_select,omitempty"` //是否显示选择数(0-否,1-是) +} + +func (x *ReportInfoRes) Reset() { + *x = ReportInfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportInfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportInfoRes) ProtoMessage() {} + +func (x *ReportInfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_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 ReportInfoRes.ProtoReflect.Descriptor instead. +func (*ReportInfoRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{23} +} + +func (x *ReportInfoRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ReportInfoRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ReportInfoRes) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *ReportInfoRes) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *ReportInfoRes) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ReportInfoRes) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ReportInfoRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ReportInfoRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ReportInfoRes) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *ReportInfoRes) GetEvents() []*ReportInfoRes_Event { + if x != nil { + return x.Events + } + return nil +} + +func (x *ReportInfoRes) GetFixDimensions() []*ReportInfoRes_Dimension { + if x != nil { + return x.FixDimensions + } + return nil +} + +func (x *ReportInfoRes) GetLangOffset() []*ReportInfoRes_LangOffset { + if x != nil { + return x.LangOffset + } + return nil +} + +func (x *ReportInfoRes) GetOpenFixed() int32 { + if x != nil { + return x.OpenFixed + } + return 0 +} + +func (x *ReportInfoRes) GetOpenCustom() int32 { + if x != nil { + return x.OpenCustom + } + return 0 +} + +func (x *ReportInfoRes) GetRewardType() []string { + if x != nil { + return x.RewardType + } + return nil +} + +func (x *ReportInfoRes) GetShowAll() int32 { + if x != nil { + return x.ShowAll + } + return 0 +} + +func (x *ReportInfoRes) GetShowSelect() int32 { + if x != nil { + return x.ShowSelect + } + return 0 +} + +type StatEventReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //活动hash_id +} + +func (x *StatEventReq) Reset() { + *x = StatEventReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatEventReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatEventReq) ProtoMessage() {} + +func (x *StatEventReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[24] + 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 StatEventReq.ProtoReflect.Descriptor instead. +func (*StatEventReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{24} +} + +func (x *StatEventReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *StatEventReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *StatEventReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type StatEventRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + TOffect int32 `protobuf:"varint,2,opt,name=t_offect,json=tOffect,proto3" json:"t_offect,omitempty"` //时区 + EventIds []int32 `protobuf:"varint,3,rep,packed,name=event_ids,json=eventIds,proto3" json:"event_ids,omitempty"` //事件ids + Tasks []*StatEventRes_Task `protobuf:"bytes,4,rep,name=tasks,proto3" json:"tasks,omitempty"` //任务数据 + HelpEvent []string `protobuf:"bytes,5,rep,name=help_event,json=helpEvent,proto3" json:"help_event,omitempty"` //助力事件 +} + +func (x *StatEventRes) Reset() { + *x = StatEventRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatEventRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatEventRes) ProtoMessage() {} + +func (x *StatEventRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[25] + 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 StatEventRes.ProtoReflect.Descriptor instead. +func (*StatEventRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{25} +} + +func (x *StatEventRes) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *StatEventRes) GetTOffect() int32 { + if x != nil { + return x.TOffect + } + return 0 +} + +func (x *StatEventRes) GetEventIds() []int32 { + if x != nil { + return x.EventIds + } + return nil +} + +func (x *StatEventRes) GetTasks() []*StatEventRes_Task { + if x != nil { + return x.Tasks + } + return nil +} + +func (x *StatEventRes) GetHelpEvent() []string { + if x != nil { + return x.HelpEvent + } + return nil +} + +type DemTitleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + RewardIds []int64 `protobuf:"varint,2,rep,packed,name=reward_ids,json=rewardIds,proto3" json:"reward_ids,omitempty"` //奖品id集合 + CondIds []int64 `protobuf:"varint,3,rep,packed,name=cond_ids,json=condIds,proto3" json:"cond_ids,omitempty"` //任务id集合 + MediaIds []int64 `protobuf:"varint,4,rep,packed,name=media_ids,json=mediaIds,proto3" json:"media_ids,omitempty"` //社媒id集合 + ChannelIds []int64 `protobuf:"varint,5,rep,packed,name=channel_ids,json=channelIds,proto3" json:"channel_ids,omitempty"` //渠道id集合 + LevelIds []int64 `protobuf:"varint,6,rep,packed,name=level_ids,json=levelIds,proto3" json:"level_ids,omitempty"` //用户类型id集合 + QaIds []int64 `protobuf:"varint,7,rep,packed,name=qa_ids,json=qaIds,proto3" json:"qa_ids,omitempty"` //题库题目id集合 + QaOptionIds []int64 `protobuf:"varint,8,rep,packed,name=qa_option_ids,json=qaOptionIds,proto3" json:"qa_option_ids,omitempty"` //题库题目选项id集合 + QaGroupIds []int64 `protobuf:"varint,9,rep,packed,name=qa_group_ids,json=qaGroupIds,proto3" json:"qa_group_ids,omitempty"` //题库id集合 + SceneIds []int64 `protobuf:"varint,10,rep,packed,name=scene_ids,json=sceneIds,proto3" json:"scene_ids,omitempty"` //场次集合 + CustomBtnIds []int64 `protobuf:"varint,11,rep,packed,name=custom_btn_ids,json=customBtnIds,proto3" json:"custom_btn_ids,omitempty"` //自定义按钮id集合 + TaskIds []int64 `protobuf:"varint,12,rep,packed,name=taskIds,proto3" json:"taskIds,omitempty"` //任务id集合 + ParentIds []int64 `protobuf:"varint,13,rep,packed,name=parent_ids,json=parentIds,proto3" json:"parent_ids,omitempty"` //上级用户id集合 + CampaignId int64 `protobuf:"varint,14,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + ImgIds []int64 `protobuf:"varint,15,rep,packed,name=img_ids,json=imgIds,proto3" json:"img_ids,omitempty"` //长图id集合 + ZoneIds []int64 `protobuf:"varint,16,rep,packed,name=zone_ids,json=zoneIds,proto3" json:"zone_ids,omitempty"` //热区id集合 + CpnIds []int64 `protobuf:"varint,17,rep,packed,name=cpn_ids,json=cpnIds,proto3" json:"cpn_ids,omitempty"` //活动id集合 + ScheduleIds []int64 `protobuf:"varint,18,rep,packed,name=schedule_ids,json=scheduleIds,proto3" json:"schedule_ids,omitempty"` //活动时间id集合 + MallIds []int64 `protobuf:"varint,19,rep,packed,name=mall_ids,json=mallIds,proto3" json:"mall_ids,omitempty"` //商城id集合 + MallItemIds []int64 `protobuf:"varint,20,rep,packed,name=mall_item_ids,json=mallItemIds,proto3" json:"mall_item_ids,omitempty"` //商城商品id集合 + UnoCardIds []int64 `protobuf:"varint,21,rep,packed,name=uno_card_ids,json=unoCardIds,proto3" json:"uno_card_ids,omitempty"` //uno卡id集合 +} + +func (x *DemTitleReq) Reset() { + *x = DemTitleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DemTitleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DemTitleReq) ProtoMessage() {} + +func (x *DemTitleReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[26] + 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 DemTitleReq.ProtoReflect.Descriptor instead. +func (*DemTitleReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{26} +} + +func (x *DemTitleReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DemTitleReq) GetRewardIds() []int64 { + if x != nil { + return x.RewardIds + } + return nil +} + +func (x *DemTitleReq) GetCondIds() []int64 { + if x != nil { + return x.CondIds + } + return nil +} + +func (x *DemTitleReq) GetMediaIds() []int64 { + if x != nil { + return x.MediaIds + } + return nil +} + +func (x *DemTitleReq) GetChannelIds() []int64 { + if x != nil { + return x.ChannelIds + } + return nil +} + +func (x *DemTitleReq) GetLevelIds() []int64 { + if x != nil { + return x.LevelIds + } + return nil +} + +func (x *DemTitleReq) GetQaIds() []int64 { + if x != nil { + return x.QaIds + } + return nil +} + +func (x *DemTitleReq) GetQaOptionIds() []int64 { + if x != nil { + return x.QaOptionIds + } + return nil +} + +func (x *DemTitleReq) GetQaGroupIds() []int64 { + if x != nil { + return x.QaGroupIds + } + return nil +} + +func (x *DemTitleReq) GetSceneIds() []int64 { + if x != nil { + return x.SceneIds + } + return nil +} + +func (x *DemTitleReq) GetCustomBtnIds() []int64 { + if x != nil { + return x.CustomBtnIds + } + return nil +} + +func (x *DemTitleReq) GetTaskIds() []int64 { + if x != nil { + return x.TaskIds + } + return nil +} + +func (x *DemTitleReq) GetParentIds() []int64 { + if x != nil { + return x.ParentIds + } + return nil +} + +func (x *DemTitleReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *DemTitleReq) GetImgIds() []int64 { + if x != nil { + return x.ImgIds + } + return nil +} + +func (x *DemTitleReq) GetZoneIds() []int64 { + if x != nil { + return x.ZoneIds + } + return nil +} + +func (x *DemTitleReq) GetCpnIds() []int64 { + if x != nil { + return x.CpnIds + } + return nil +} + +func (x *DemTitleReq) GetScheduleIds() []int64 { + if x != nil { + return x.ScheduleIds + } + return nil +} + +func (x *DemTitleReq) GetMallIds() []int64 { + if x != nil { + return x.MallIds + } + return nil +} + +func (x *DemTitleReq) GetMallItemIds() []int64 { + if x != nil { + return x.MallItemIds + } + return nil +} + +func (x *DemTitleReq) GetUnoCardIds() []int64 { + if x != nil { + return x.UnoCardIds + } + return nil +} + +type DemTitleRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + TOffect int32 `protobuf:"varint,2,opt,name=t_offect,json=tOffect,proto3" json:"t_offect,omitempty"` //时区 + Conds []*DemTitleRes_Title `protobuf:"bytes,3,rep,name=conds,proto3" json:"conds,omitempty"` //任务数据 + Media []*DemTitleRes_Title `protobuf:"bytes,4,rep,name=media,proto3" json:"media,omitempty"` //社媒数据 + Channel []*DemTitleRes_Title `protobuf:"bytes,5,rep,name=channel,proto3" json:"channel,omitempty"` //渠道数据 + Rewards []*DemTitleRes_Title `protobuf:"bytes,6,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品数据 + UserLv []*DemTitleRes_Title `protobuf:"bytes,7,rep,name=user_lv,json=userLv,proto3" json:"user_lv,omitempty"` //用户等级 + Qa []*DemTitleRes_Title `protobuf:"bytes,8,rep,name=qa,proto3" json:"qa,omitempty"` //题库题目 + QaOption []*DemTitleRes_Title `protobuf:"bytes,9,rep,name=qa_option,json=qaOption,proto3" json:"qa_option,omitempty"` //题库题目选项 + QaGroup []*DemTitleRes_Title `protobuf:"bytes,10,rep,name=qa_group,json=qaGroup,proto3" json:"qa_group,omitempty"` //题库题目选项 + Scenes []*DemTitleRes_Title `protobuf:"bytes,11,rep,name=scenes,proto3" json:"scenes,omitempty"` //场次 + CustomBtn []*DemTitleRes_Title `protobuf:"bytes,12,rep,name=custom_btn,json=customBtn,proto3" json:"custom_btn,omitempty"` //按钮文案 + Tasks []*DemTitleRes_Title `protobuf:"bytes,13,rep,name=tasks,proto3" json:"tasks,omitempty"` //任务文案 + Parents []*DemTitleRes_Title `protobuf:"bytes,14,rep,name=parents,proto3" json:"parents,omitempty"` //上级用户 + Imgs []*DemTitleRes_Title `protobuf:"bytes,15,rep,name=imgs,proto3" json:"imgs,omitempty"` //长图参数 + Zones []*DemTitleRes_Title `protobuf:"bytes,16,rep,name=zones,proto3" json:"zones,omitempty"` //热区 + Cpns []*DemTitleRes_Title `protobuf:"bytes,17,rep,name=cpns,proto3" json:"cpns,omitempty"` //活动 + Schedules []*DemTitleRes_Schedule `protobuf:"bytes,18,rep,name=schedules,proto3" json:"schedules,omitempty"` //活动时间 + Malls []*DemTitleRes_Title `protobuf:"bytes,19,rep,name=malls,proto3" json:"malls,omitempty"` //商城 + MallItems []*DemTitleRes_Title `protobuf:"bytes,20,rep,name=mall_items,json=mallItems,proto3" json:"mall_items,omitempty"` //商城商品 + UnoCards []*DemTitleRes_Title `protobuf:"bytes,21,rep,name=uno_cards,json=unoCards,proto3" json:"uno_cards,omitempty"` //uno卡 +} + +func (x *DemTitleRes) Reset() { + *x = DemTitleRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DemTitleRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DemTitleRes) ProtoMessage() {} + +func (x *DemTitleRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[27] + 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 DemTitleRes.ProtoReflect.Descriptor instead. +func (*DemTitleRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{27} +} + +func (x *DemTitleRes) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *DemTitleRes) GetTOffect() int32 { + if x != nil { + return x.TOffect + } + return 0 +} + +func (x *DemTitleRes) GetConds() []*DemTitleRes_Title { + if x != nil { + return x.Conds + } + return nil +} + +func (x *DemTitleRes) GetMedia() []*DemTitleRes_Title { + if x != nil { + return x.Media + } + return nil +} + +func (x *DemTitleRes) GetChannel() []*DemTitleRes_Title { + if x != nil { + return x.Channel + } + return nil +} + +func (x *DemTitleRes) GetRewards() []*DemTitleRes_Title { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *DemTitleRes) GetUserLv() []*DemTitleRes_Title { + if x != nil { + return x.UserLv + } + return nil +} + +func (x *DemTitleRes) GetQa() []*DemTitleRes_Title { + if x != nil { + return x.Qa + } + return nil +} + +func (x *DemTitleRes) GetQaOption() []*DemTitleRes_Title { + if x != nil { + return x.QaOption + } + return nil +} + +func (x *DemTitleRes) GetQaGroup() []*DemTitleRes_Title { + if x != nil { + return x.QaGroup + } + return nil +} + +func (x *DemTitleRes) GetScenes() []*DemTitleRes_Title { + if x != nil { + return x.Scenes + } + return nil +} + +func (x *DemTitleRes) GetCustomBtn() []*DemTitleRes_Title { + if x != nil { + return x.CustomBtn + } + return nil +} + +func (x *DemTitleRes) GetTasks() []*DemTitleRes_Title { + if x != nil { + return x.Tasks + } + return nil +} + +func (x *DemTitleRes) GetParents() []*DemTitleRes_Title { + if x != nil { + return x.Parents + } + return nil +} + +func (x *DemTitleRes) GetImgs() []*DemTitleRes_Title { + if x != nil { + return x.Imgs + } + return nil +} + +func (x *DemTitleRes) GetZones() []*DemTitleRes_Title { + if x != nil { + return x.Zones + } + return nil +} + +func (x *DemTitleRes) GetCpns() []*DemTitleRes_Title { + if x != nil { + return x.Cpns + } + return nil +} + +func (x *DemTitleRes) GetSchedules() []*DemTitleRes_Schedule { + if x != nil { + return x.Schedules + } + return nil +} + +func (x *DemTitleRes) GetMalls() []*DemTitleRes_Title { + if x != nil { + return x.Malls + } + return nil +} + +func (x *DemTitleRes) GetMallItems() []*DemTitleRes_Title { + if x != nil { + return x.MallItems + } + return nil +} + +func (x *DemTitleRes) GetUnoCards() []*DemTitleRes_Title { + if x != nil { + return x.UnoCards + } + return nil +} + +type TopTenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *TopTenReq) Reset() { + *x = TopTenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenReq) ProtoMessage() {} + +func (x *TopTenReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[28] + 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 TopTenReq.ProtoReflect.Descriptor instead. +func (*TopTenReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{28} +} + +func (x *TopTenReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type TopTenRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxLv int64 `protobuf:"varint,1,opt,name=max_lv,json=maxLv,proto3" json:"max_lv,omitempty"` //最高裂变层级 + Invite []*TopTenRes_Invite `protobuf:"bytes,2,rep,name=invite,proto3" json:"invite,omitempty"` //邀请人数 + Event []*TopTenRes_Event `protobuf:"bytes,3,rep,name=event,proto3" json:"event,omitempty"` //任务数据 + Grow []*TopTenRes_Grow `protobuf:"bytes,4,rep,name=grow,proto3" json:"grow,omitempty"` //领养数据 + Help []*TopTenRes_Help `protobuf:"bytes,5,rep,name=help,proto3" json:"help,omitempty"` //助力数据 + Sign []*TopTenRes_Sign `protobuf:"bytes,6,rep,name=sign,proto3" json:"sign,omitempty"` //签到排行榜 +} + +func (x *TopTenRes) Reset() { + *x = TopTenRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes) ProtoMessage() {} + +func (x *TopTenRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[29] + 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 TopTenRes.ProtoReflect.Descriptor instead. +func (*TopTenRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29} +} + +func (x *TopTenRes) GetMaxLv() int64 { + if x != nil { + return x.MaxLv + } + return 0 +} + +func (x *TopTenRes) GetInvite() []*TopTenRes_Invite { + if x != nil { + return x.Invite + } + return nil +} + +func (x *TopTenRes) GetEvent() []*TopTenRes_Event { + if x != nil { + return x.Event + } + return nil +} + +func (x *TopTenRes) GetGrow() []*TopTenRes_Grow { + if x != nil { + return x.Grow + } + return nil +} + +func (x *TopTenRes) GetHelp() []*TopTenRes_Help { + if x != nil { + return x.Help + } + return nil +} + +func (x *TopTenRes) GetSign() []*TopTenRes_Sign { + if x != nil { + return x.Sign + } + return nil +} + +type UserCycleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *UserCycleReq) Reset() { + *x = UserCycleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCycleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCycleReq) ProtoMessage() {} + +func (x *UserCycleReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[30] + 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 UserCycleReq.ProtoReflect.Descriptor instead. +func (*UserCycleReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{30} +} + +func (x *UserCycleReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type UserCycleRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UserCycleRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //最高裂变层级 +} + +func (x *UserCycleRes) Reset() { + *x = UserCycleRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCycleRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCycleRes) ProtoMessage() {} + +func (x *UserCycleRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[31] + 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 UserCycleRes.ProtoReflect.Descriptor instead. +func (*UserCycleRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{31} +} + +func (x *UserCycleRes) GetList() []*UserCycleRes_One { + if x != nil { + return x.List + } + return nil +} + +type ActiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *ActiveReq) Reset() { + *x = ActiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActiveReq) ProtoMessage() {} + +func (x *ActiveReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[32] + 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 ActiveReq.ProtoReflect.Descriptor instead. +func (*ActiveReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{32} +} + +func (x *ActiveReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ActiveReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ActiveRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ActiveRes) Reset() { + *x = ActiveRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActiveRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActiveRes) ProtoMessage() {} + +func (x *ActiveRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[33] + 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 ActiveRes.ProtoReflect.Descriptor instead. +func (*ActiveRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{33} +} + +type ChildReportInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id +} + +func (x *ChildReportInfoReq) Reset() { + *x = ChildReportInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildReportInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildReportInfoReq) ProtoMessage() {} + +func (x *ChildReportInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[34] + 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 ChildReportInfoReq.ProtoReflect.Descriptor instead. +func (*ChildReportInfoReq) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{34} +} + +func (x *ChildReportInfoReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ChildReportInfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间时间戳 + EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间时间戳 + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` //发布状态(1-待发布,2-已发布,3-已下线) + TOffset int32 `protobuf:"varint,6,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时间偏移量 + ChildType int32 `protobuf:"varint,7,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + PTitle string `protobuf:"bytes,8,opt,name=p_title,json=pTitle,proto3" json:"p_title,omitempty"` //父活动标题 +} + +func (x *ChildReportInfoRes) Reset() { + *x = ChildReportInfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildReportInfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildReportInfoRes) ProtoMessage() {} + +func (x *ChildReportInfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[35] + 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 ChildReportInfoRes.ProtoReflect.Descriptor instead. +func (*ChildReportInfoRes) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{35} +} + +func (x *ChildReportInfoRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChildReportInfoRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildReportInfoRes) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ChildReportInfoRes) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ChildReportInfoRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildReportInfoRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ChildReportInfoRes) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *ChildReportInfoRes) GetPTitle() string { + if x != nil { + return x.PTitle + } + return "" +} + +type SummaryRes_EventData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetNum int64 `protobuf:"varint,1,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标次数 + TargetUserNum int64 `protobuf:"varint,2,opt,name=target_user_num,json=targetUserNum,proto3" json:"target_user_num,omitempty"` //达标人数 + Conds []*SummaryRes_Cond `protobuf:"bytes,3,rep,name=conds,proto3" json:"conds,omitempty"` //事件数据 +} + +func (x *SummaryRes_EventData) Reset() { + *x = SummaryRes_EventData{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryRes_EventData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryRes_EventData) ProtoMessage() {} + +func (x *SummaryRes_EventData) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[36] + 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 SummaryRes_EventData.ProtoReflect.Descriptor instead. +func (*SummaryRes_EventData) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *SummaryRes_EventData) GetTargetNum() int64 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *SummaryRes_EventData) GetTargetUserNum() int64 { + if x != nil { + return x.TargetUserNum + } + return 0 +} + +func (x *SummaryRes_EventData) GetConds() []*SummaryRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type SummaryRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Event string `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,2,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //标识说明 + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //触发次数 + UserNum int64 `protobuf:"varint,4,opt,name=user_num,json=userNum,proto3" json:"user_num,omitempty"` //触发人数 + Total float64 `protobuf:"fixed64,5,opt,name=total,proto3" json:"total,omitempty"` //累计总值 + IfCond int32 `protobuf:"varint,6,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) +} + +func (x *SummaryRes_Cond) Reset() { + *x = SummaryRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryRes_Cond) ProtoMessage() {} + +func (x *SummaryRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[37] + 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 SummaryRes_Cond.ProtoReflect.Descriptor instead. +func (*SummaryRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *SummaryRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *SummaryRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *SummaryRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *SummaryRes_Cond) GetUserNum() int64 { + if x != nil { + return x.UserNum + } + return 0 +} + +func (x *SummaryRes_Cond) GetTotal() float64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *SummaryRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +type SummaryRes_Grow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` //总养成人数 + Today int64 `protobuf:"varint,2,opt,name=today,proto3" json:"today,omitempty"` //今日养成人数 +} + +func (x *SummaryRes_Grow) Reset() { + *x = SummaryRes_Grow{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SummaryRes_Grow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SummaryRes_Grow) ProtoMessage() {} + +func (x *SummaryRes_Grow) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[38] + 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 SummaryRes_Grow.ProtoReflect.Descriptor instead. +func (*SummaryRes_Grow) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *SummaryRes_Grow) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *SummaryRes_Grow) GetToday() int64 { + if x != nil { + return x.Today + } + return 0 +} + +type CampaignRes_Y struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //线类型 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //标识说明 + Data []int64 `protobuf:"varint,3,rep,packed,name=data,proto3" json:"data,omitempty"` //数据 +} + +func (x *CampaignRes_Y) Reset() { + *x = CampaignRes_Y{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignRes_Y) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignRes_Y) ProtoMessage() {} + +func (x *CampaignRes_Y) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[39] + 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 CampaignRes_Y.ProtoReflect.Descriptor instead. +func (*CampaignRes_Y) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *CampaignRes_Y) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *CampaignRes_Y) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CampaignRes_Y) GetData() []int64 { + if x != nil { + return x.Data + } + return nil +} + +type CampaignRes_Report struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ViewNum int64 `protobuf:"varint,1,opt,name=view_num,json=viewNum,proto3" json:"view_num,omitempty"` //活动页面访问人数 + Fun string `protobuf:"bytes,2,opt,name=fun,proto3" json:"fun,omitempty"` //活动兴趣度,如(2.5) + Change string `protobuf:"bytes,3,opt,name=change,proto3" json:"change,omitempty"` //活动转化率,如(2.5) + Y []*CampaignRes_Y `protobuf:"bytes,4,rep,name=y,proto3" json:"y,omitempty"` //展示的线数据 + Target string `protobuf:"bytes,5,opt,name=target,proto3" json:"target,omitempty"` //活动达标率,如(2.5) + TargetNum int64 `protobuf:"varint,6,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //活动达标数 + Sign string `protobuf:"bytes,7,opt,name=sign,proto3" json:"sign,omitempty"` //签到达标率,如(2.5) + SignNum int64 `protobuf:"varint,8,opt,name=sign_num,json=signNum,proto3" json:"sign_num,omitempty"` //签到数 + Grow string `protobuf:"bytes,9,opt,name=grow,proto3" json:"grow,omitempty"` //养成达标率,如(2.5) +} + +func (x *CampaignRes_Report) Reset() { + *x = CampaignRes_Report{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignRes_Report) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignRes_Report) ProtoMessage() {} + +func (x *CampaignRes_Report) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[40] + 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 CampaignRes_Report.ProtoReflect.Descriptor instead. +func (*CampaignRes_Report) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *CampaignRes_Report) GetViewNum() int64 { + if x != nil { + return x.ViewNum + } + return 0 +} + +func (x *CampaignRes_Report) GetFun() string { + if x != nil { + return x.Fun + } + return "" +} + +func (x *CampaignRes_Report) GetChange() string { + if x != nil { + return x.Change + } + return "" +} + +func (x *CampaignRes_Report) GetY() []*CampaignRes_Y { + if x != nil { + return x.Y + } + return nil +} + +func (x *CampaignRes_Report) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +func (x *CampaignRes_Report) GetTargetNum() int64 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *CampaignRes_Report) GetSign() string { + if x != nil { + return x.Sign + } + return "" +} + +func (x *CampaignRes_Report) GetSignNum() int64 { + if x != nil { + return x.SignNum + } + return 0 +} + +func (x *CampaignRes_Report) GetGrow() string { + if x != nil { + return x.Grow + } + return "" +} + +type RelatedRes_Y struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //线类型 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //标识说明 + Data []int64 `protobuf:"varint,3,rep,packed,name=data,proto3" json:"data,omitempty"` //数据 +} + +func (x *RelatedRes_Y) Reset() { + *x = RelatedRes_Y{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelatedRes_Y) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelatedRes_Y) ProtoMessage() {} + +func (x *RelatedRes_Y) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[41] + 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 RelatedRes_Y.ProtoReflect.Descriptor instead. +func (*RelatedRes_Y) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *RelatedRes_Y) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *RelatedRes_Y) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RelatedRes_Y) GetData() []int64 { + if x != nil { + return x.Data + } + return nil +} + +type RelatedRes_Report struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Share string `protobuf:"bytes,1,opt,name=share,proto3" json:"share,omitempty"` //邀请链接曝光转化,如(2.5) + Wechat string `protobuf:"bytes,2,opt,name=wechat,proto3" json:"wechat,omitempty"` //微信页转化率,如(2.5) + Download string `protobuf:"bytes,3,opt,name=download,proto3" json:"download,omitempty"` //下载页转化率,如(2.5) + Y []*RelatedRes_Y `protobuf:"bytes,4,rep,name=y,proto3" json:"y,omitempty"` //展示的线数据 + Media string `protobuf:"bytes,5,opt,name=media,proto3" json:"media,omitempty"` //社媒分享转化率,如(2.5) + MediaNum int64 `protobuf:"varint,6,opt,name=media_num,json=mediaNum,proto3" json:"media_num,omitempty"` //社媒总数 + MediaData []*RelatedRes_MediaData `protobuf:"bytes,7,rep,name=media_data,json=mediaData,proto3" json:"media_data,omitempty"` //社媒数据 +} + +func (x *RelatedRes_Report) Reset() { + *x = RelatedRes_Report{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelatedRes_Report) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelatedRes_Report) ProtoMessage() {} + +func (x *RelatedRes_Report) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[42] + 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 RelatedRes_Report.ProtoReflect.Descriptor instead. +func (*RelatedRes_Report) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *RelatedRes_Report) GetShare() string { + if x != nil { + return x.Share + } + return "" +} + +func (x *RelatedRes_Report) GetWechat() string { + if x != nil { + return x.Wechat + } + return "" +} + +func (x *RelatedRes_Report) GetDownload() string { + if x != nil { + return x.Download + } + return "" +} + +func (x *RelatedRes_Report) GetY() []*RelatedRes_Y { + if x != nil { + return x.Y + } + return nil +} + +func (x *RelatedRes_Report) GetMedia() string { + if x != nil { + return x.Media + } + return "" +} + +func (x *RelatedRes_Report) GetMediaNum() int64 { + if x != nil { + return x.MediaNum + } + return 0 +} + +func (x *RelatedRes_Report) GetMediaData() []*RelatedRes_MediaData { + if x != nil { + return x.MediaData + } + return nil +} + +type RelatedRes_MediaData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //社媒名称 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //总数 +} + +func (x *RelatedRes_MediaData) Reset() { + *x = RelatedRes_MediaData{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelatedRes_MediaData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelatedRes_MediaData) ProtoMessage() {} + +func (x *RelatedRes_MediaData) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[43] + 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 RelatedRes_MediaData.ProtoReflect.Descriptor instead. +func (*RelatedRes_MediaData) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{5, 2} +} + +func (x *RelatedRes_MediaData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RelatedRes_MediaData) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ChannelRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //渠道id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //渠道名称 + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` //渠道链接 + ClickNum int64 `protobuf:"varint,4,opt,name=click_num,json=clickNum,proto3" json:"click_num,omitempty"` //点击次数 + ClickUserNum int64 `protobuf:"varint,5,opt,name=click_user_num,json=clickUserNum,proto3" json:"click_user_num,omitempty"` //点击人数 + InstallNum int64 `protobuf:"varint,6,opt,name=install_num,json=installNum,proto3" json:"install_num,omitempty"` //安装数 + OpenNum int64 `protobuf:"varint,7,opt,name=open_num,json=openNum,proto3" json:"open_num,omitempty"` //打开app次数 + OpenUserNum int64 `protobuf:"varint,8,opt,name=open_user_num,json=openUserNum,proto3" json:"open_user_num,omitempty"` //打开app人数 + InstallUserNum int64 `protobuf:"varint,9,opt,name=install_user_num,json=installUserNum,proto3" json:"install_user_num,omitempty"` //安装人数 +} + +func (x *ChannelRes_One) Reset() { + *x = ChannelRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelRes_One) ProtoMessage() {} + +func (x *ChannelRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[44] + 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 ChannelRes_One.ProtoReflect.Descriptor instead. +func (*ChannelRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *ChannelRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChannelRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChannelRes_One) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ChannelRes_One) GetClickNum() int64 { + if x != nil { + return x.ClickNum + } + return 0 +} + +func (x *ChannelRes_One) GetClickUserNum() int64 { + if x != nil { + return x.ClickUserNum + } + return 0 +} + +func (x *ChannelRes_One) GetInstallNum() int64 { + if x != nil { + return x.InstallNum + } + return 0 +} + +func (x *ChannelRes_One) GetOpenNum() int64 { + if x != nil { + return x.OpenNum + } + return 0 +} + +func (x *ChannelRes_One) GetOpenUserNum() int64 { + if x != nil { + return x.OpenUserNum + } + return 0 +} + +func (x *ChannelRes_One) GetInstallUserNum() int64 { + if x != nil { + return x.InstallUserNum + } + return 0 +} + +type AdsTableRes_Y struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` //线类型(app_install-安装,view-访问) + Data []int64 `protobuf:"varint,2,rep,packed,name=data,proto3" json:"data,omitempty"` //y轴数据 +} + +func (x *AdsTableRes_Y) Reset() { + *x = AdsTableRes_Y{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsTableRes_Y) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsTableRes_Y) ProtoMessage() {} + +func (x *AdsTableRes_Y) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[45] + 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 AdsTableRes_Y.ProtoReflect.Descriptor instead. +func (*AdsTableRes_Y) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *AdsTableRes_Y) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *AdsTableRes_Y) GetData() []int64 { + if x != nil { + return x.Data + } + return nil +} + +type AdsRewardRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + WebNum int64 `protobuf:"varint,3,opt,name=web_num,json=webNum,proto3" json:"web_num,omitempty"` //奖品发放总数 + WebCompare string `protobuf:"bytes,4,opt,name=web_compare,json=webCompare,proto3" json:"web_compare,omitempty"` //奖品发放占比 + AppNum int64 `protobuf:"varint,5,opt,name=app_num,json=appNum,proto3" json:"app_num,omitempty"` //奖品领取总数 + AppCompare string `protobuf:"bytes,6,opt,name=app_compare,json=appCompare,proto3" json:"app_compare,omitempty"` //奖品领取占比 + Compare string `protobuf:"bytes,7,opt,name=compare,proto3" json:"compare,omitempty"` //领奖率 +} + +func (x *AdsRewardRes_Reward) Reset() { + *x = AdsRewardRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsRewardRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsRewardRes_Reward) ProtoMessage() {} + +func (x *AdsRewardRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[46] + 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 AdsRewardRes_Reward.ProtoReflect.Descriptor instead. +func (*AdsRewardRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *AdsRewardRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsRewardRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsRewardRes_Reward) GetWebNum() int64 { + if x != nil { + return x.WebNum + } + return 0 +} + +func (x *AdsRewardRes_Reward) GetWebCompare() string { + if x != nil { + return x.WebCompare + } + return "" +} + +func (x *AdsRewardRes_Reward) GetAppNum() int64 { + if x != nil { + return x.AppNum + } + return 0 +} + +func (x *AdsRewardRes_Reward) GetAppCompare() string { + if x != nil { + return x.AppCompare + } + return "" +} + +func (x *AdsRewardRes_Reward) GetCompare() string { + if x != nil { + return x.Compare + } + return "" +} + +type ReportInfoRes_LangOffset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TOffset int32 `protobuf:"varint,1,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //语言标识 + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //时区偏移值 +} + +func (x *ReportInfoRes_LangOffset) Reset() { + *x = ReportInfoRes_LangOffset{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportInfoRes_LangOffset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportInfoRes_LangOffset) ProtoMessage() {} + +func (x *ReportInfoRes_LangOffset) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[47] + 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 ReportInfoRes_LangOffset.ProtoReflect.Descriptor instead. +func (*ReportInfoRes_LangOffset) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{23, 0} +} + +func (x *ReportInfoRes_LangOffset) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ReportInfoRes_LangOffset) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type ReportInfoRes_Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //活动奖品id + Dimensions []*ReportInfoRes_Dimension `protobuf:"bytes,2,rep,name=dimensions,proto3" json:"dimensions,omitempty"` //维度数据 +} + +func (x *ReportInfoRes_Event) Reset() { + *x = ReportInfoRes_Event{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportInfoRes_Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportInfoRes_Event) ProtoMessage() {} + +func (x *ReportInfoRes_Event) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[48] + 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 ReportInfoRes_Event.ProtoReflect.Descriptor instead. +func (*ReportInfoRes_Event) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{23, 1} +} + +func (x *ReportInfoRes_Event) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *ReportInfoRes_Event) GetDimensions() []*ReportInfoRes_Dimension { + if x != nil { + return x.Dimensions + } + return nil +} + +type ReportInfoRes_Dimension struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //活动奖品id +} + +func (x *ReportInfoRes_Dimension) Reset() { + *x = ReportInfoRes_Dimension{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportInfoRes_Dimension) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportInfoRes_Dimension) ProtoMessage() {} + +func (x *ReportInfoRes_Dimension) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[49] + 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 ReportInfoRes_Dimension.ProtoReflect.Descriptor instead. +func (*ReportInfoRes_Dimension) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{23, 2} +} + +func (x *ReportInfoRes_Dimension) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type StatEventRes_Task struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //任务id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //任务名称 +} + +func (x *StatEventRes_Task) Reset() { + *x = StatEventRes_Task{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatEventRes_Task) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatEventRes_Task) ProtoMessage() {} + +func (x *StatEventRes_Task) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[50] + 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 StatEventRes_Task.ProtoReflect.Descriptor instead. +func (*StatEventRes_Task) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{25, 0} +} + +func (x *StatEventRes_Task) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *StatEventRes_Task) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type DemTitleRes_Title struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //字符串标识 + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //标识 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //说明 + SecondId int64 `protobuf:"varint,4,opt,name=second_id,json=secondId,proto3" json:"second_id,omitempty"` //二级标识 +} + +func (x *DemTitleRes_Title) Reset() { + *x = DemTitleRes_Title{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DemTitleRes_Title) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DemTitleRes_Title) ProtoMessage() {} + +func (x *DemTitleRes_Title) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[51] + 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 DemTitleRes_Title.ProtoReflect.Descriptor instead. +func (*DemTitleRes_Title) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{27, 0} +} + +func (x *DemTitleRes_Title) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *DemTitleRes_Title) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DemTitleRes_Title) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DemTitleRes_Title) GetSecondId() int64 { + if x != nil { + return x.SecondId + } + return 0 +} + +type DemTitleRes_Schedule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //说明 + Teams []*DemTitleRes_Team `protobuf:"bytes,3,rep,name=teams,proto3" json:"teams,omitempty"` //队伍数据 +} + +func (x *DemTitleRes_Schedule) Reset() { + *x = DemTitleRes_Schedule{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DemTitleRes_Schedule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DemTitleRes_Schedule) ProtoMessage() {} + +func (x *DemTitleRes_Schedule) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[52] + 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 DemTitleRes_Schedule.ProtoReflect.Descriptor instead. +func (*DemTitleRes_Schedule) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{27, 1} +} + +func (x *DemTitleRes_Schedule) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DemTitleRes_Schedule) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DemTitleRes_Schedule) GetTeams() []*DemTitleRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +type DemTitleRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //说明 +} + +func (x *DemTitleRes_Team) Reset() { + *x = DemTitleRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DemTitleRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DemTitleRes_Team) ProtoMessage() {} + +func (x *DemTitleRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[53] + 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 DemTitleRes_Team.ProtoReflect.Descriptor instead. +func (*DemTitleRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{27, 2} +} + +func (x *DemTitleRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DemTitleRes_Team) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type TopTenRes_Invite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` //排名 + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + EffectNum int64 `protobuf:"varint,3,opt,name=effect_num,json=effectNum,proto3" json:"effect_num,omitempty"` //有效邀请人数 + InviteNum int64 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //邀请总人数 +} + +func (x *TopTenRes_Invite) Reset() { + *x = TopTenRes_Invite{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Invite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Invite) ProtoMessage() {} + +func (x *TopTenRes_Invite) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[54] + 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 TopTenRes_Invite.ProtoReflect.Descriptor instead. +func (*TopTenRes_Invite) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 0} +} + +func (x *TopTenRes_Invite) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *TopTenRes_Invite) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *TopTenRes_Invite) GetEffectNum() int64 { + if x != nil { + return x.EffectNum + } + return 0 +} + +func (x *TopTenRes_Invite) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +type TopTenRes_Event struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` //排名 + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //数量 + Conds []*TopTenRes_Cond `protobuf:"bytes,4,rep,name=conds,proto3" json:"conds,omitempty"` //具体达标条件数据 +} + +func (x *TopTenRes_Event) Reset() { + *x = TopTenRes_Event{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Event) ProtoMessage() {} + +func (x *TopTenRes_Event) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[55] + 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 TopTenRes_Event.ProtoReflect.Descriptor instead. +func (*TopTenRes_Event) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 1} +} + +func (x *TopTenRes_Event) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *TopTenRes_Event) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *TopTenRes_Event) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *TopTenRes_Event) GetConds() []*TopTenRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type TopTenRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` //条件说明 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //数量 +} + +func (x *TopTenRes_Cond) Reset() { + *x = TopTenRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Cond) ProtoMessage() {} + +func (x *TopTenRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[56] + 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 TopTenRes_Cond.ProtoReflect.Descriptor instead. +func (*TopTenRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 2} +} + +func (x *TopTenRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *TopTenRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type TopTenRes_Grow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` //排名 + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + GrowNum int64 `protobuf:"varint,3,opt,name=grow_num,json=growNum,proto3" json:"grow_num,omitempty"` //领养数量 + GrowRewardNum int64 `protobuf:"varint,4,opt,name=grow_reward_num,json=growRewardNum,proto3" json:"grow_reward_num,omitempty"` //养成数量 +} + +func (x *TopTenRes_Grow) Reset() { + *x = TopTenRes_Grow{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Grow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Grow) ProtoMessage() {} + +func (x *TopTenRes_Grow) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[57] + 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 TopTenRes_Grow.ProtoReflect.Descriptor instead. +func (*TopTenRes_Grow) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 3} +} + +func (x *TopTenRes_Grow) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *TopTenRes_Grow) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *TopTenRes_Grow) GetGrowNum() int64 { + if x != nil { + return x.GrowNum + } + return 0 +} + +func (x *TopTenRes_Grow) GetGrowRewardNum() int64 { + if x != nil { + return x.GrowRewardNum + } + return 0 +} + +type TopTenRes_Help struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` //排名 + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //助力数量 + Detail []*TopTenRes_Detail `protobuf:"bytes,4,rep,name=detail,proto3" json:"detail,omitempty"` //领养详情 +} + +func (x *TopTenRes_Help) Reset() { + *x = TopTenRes_Help{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Help) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Help) ProtoMessage() {} + +func (x *TopTenRes_Help) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[58] + 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 TopTenRes_Help.ProtoReflect.Descriptor instead. +func (*TopTenRes_Help) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 4} +} + +func (x *TopTenRes_Help) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *TopTenRes_Help) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *TopTenRes_Help) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *TopTenRes_Help) GetDetail() []*TopTenRes_Detail { + if x != nil { + return x.Detail + } + return nil +} + +type TopTenRes_Detail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //标题 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //数量 +} + +func (x *TopTenRes_Detail) Reset() { + *x = TopTenRes_Detail{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Detail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Detail) ProtoMessage() {} + +func (x *TopTenRes_Detail) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[59] + 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 TopTenRes_Detail.ProtoReflect.Descriptor instead. +func (*TopTenRes_Detail) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 5} +} + +func (x *TopTenRes_Detail) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TopTenRes_Detail) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type TopTenRes_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` //排名 + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + SignDay int64 `protobuf:"varint,3,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + SignRewardNum int64 `protobuf:"varint,4,opt,name=sign_reward_num,json=signRewardNum,proto3" json:"sign_reward_num,omitempty"` //签到达标数 +} + +func (x *TopTenRes_Sign) Reset() { + *x = TopTenRes_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TopTenRes_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TopTenRes_Sign) ProtoMessage() {} + +func (x *TopTenRes_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[60] + 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 TopTenRes_Sign.ProtoReflect.Descriptor instead. +func (*TopTenRes_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{29, 6} +} + +func (x *TopTenRes_Sign) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *TopTenRes_Sign) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *TopTenRes_Sign) GetSignDay() int64 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *TopTenRes_Sign) GetSignRewardNum() int64 { + if x != nil { + return x.SignRewardNum + } + return 0 +} + +type UserCycleRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //占比标识(platform-平台占比,channel-渠道占比,media-社媒占比) + Parts []*UserCycleRes_Part `protobuf:"bytes,2,rep,name=parts,proto3" json:"parts,omitempty"` //占比数据 +} + +func (x *UserCycleRes_One) Reset() { + *x = UserCycleRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCycleRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCycleRes_One) ProtoMessage() {} + +func (x *UserCycleRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[61] + 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 UserCycleRes_One.ProtoReflect.Descriptor instead. +func (*UserCycleRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{31, 0} +} + +func (x *UserCycleRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UserCycleRes_One) GetParts() []*UserCycleRes_Part { + if x != nil { + return x.Parts + } + return nil +} + +type UserCycleRes_Part struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //标题 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //数量 +} + +func (x *UserCycleRes_Part) Reset() { + *x = UserCycleRes_Part{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_stat_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCycleRes_Part) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCycleRes_Part) ProtoMessage() {} + +func (x *UserCycleRes_Part) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_stat_proto_msgTypes[62] + 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 UserCycleRes_Part.ProtoReflect.Descriptor instead. +func (*UserCycleRes_Part) Descriptor() ([]byte, []int) { + return file_w_campaign_stat_proto_rawDescGZIP(), []int{31, 1} +} + +func (x *UserCycleRes_Part) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UserCycleRes_Part) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +var File_w_campaign_stat_proto protoreflect.FileDescriptor + +var file_w_campaign_stat_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x22, 0x57, 0x0a, 0x0a, 0x53, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x22, 0xb9, 0x08, 0x0a, 0x0a, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x69, 0x65, 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x22, 0x0a, 0x0d, + 0x76, 0x69, 0x65, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0b, 0x76, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, + 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x65, 0x70, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x65, 0x70, 0x12, 0x24, 0x0a, 0x0e, 0x74, + 0x6f, 0x64, 0x61, 0x79, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0c, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x56, 0x69, 0x65, 0x77, 0x4e, 0x75, + 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x74, 0x6f, 0x64, 0x61, 0x79, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x46, 0x0a, 0x0a, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x73, + 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x5f, 0x73, 0x69, 0x67, + 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x74, 0x6f, 0x64, + 0x61, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x31, 0x0a, 0x15, 0x74, 0x6f, 0x64, + 0x61, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x53, + 0x69, 0x67, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x04, + 0x67, 0x72, 0x6f, 0x77, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x04, + 0x67, 0x72, 0x6f, 0x77, 0x1a, 0x8c, 0x01, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, + 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x38, 0x0a, 0x05, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x1a, 0x95, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x1a, 0x32, 0x0a, 0x04, 0x47, + 0x72, 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x64, + 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x22, + 0x92, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x81, 0x04, 0x0a, 0x0b, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x52, 0x65, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x01, 0x78, 0x12, 0x46, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x0a, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0a, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x75, 0x6d, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x3f, 0x0a, + 0x01, 0x59, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xf7, + 0x01, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x65, + 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x69, 0x65, + 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x75, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x66, 0x75, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2e, + 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x59, 0x52, 0x01, 0x79, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, + 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x69, 0x67, + 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x22, 0x91, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x9d, 0x04, 0x0a, + 0x0a, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x78, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x45, 0x0a, 0x0b, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x1a, 0x3f, 0x0a, 0x01, 0x59, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xfc, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x65, 0x63, 0x68, 0x61, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2d, 0x0a, 0x01, 0x79, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x59, 0x52, 0x01, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x46, 0x0a, + 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x35, 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0xf5, 0x02, 0x0a, + 0x07, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x65, 0x68, 0x61, 0x76, + 0x69, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x65, 0x68, 0x61, 0x76, + 0x69, 0x6f, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, + 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x15, 0x0a, 0x06, + 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x73, + 0x56, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, + 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x77, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x77, 0x69, 0x64, 0x22, 0x09, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x22, + 0xb6, 0x01, 0x0a, 0x0a, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x28, + 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0xe6, 0x02, 0x0a, 0x0a, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0x8a, 0x02, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x4e, 0x75, + 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, + 0x4e, 0x75, 0x6d, 0x12, 0x22, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x6e, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, + 0x6d, 0x22, 0x39, 0x0a, 0x0d, 0x41, 0x64, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xc0, 0x06, 0x0a, + 0x0d, 0x41, 0x64, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x12, + 0x2a, 0x0a, 0x11, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x74, + 0x6f, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x76, 0x69, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x76, + 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x79, 0x65, 0x73, 0x74, 0x65, + 0x72, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x76, 0x69, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x59, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, 0x12, + 0x21, 0x0a, 0x0c, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, + 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x64, 0x61, 0x79, + 0x12, 0x34, 0x0a, 0x16, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x14, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x59, 0x65, 0x73, + 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, 0x12, 0x37, 0x0a, 0x18, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, + 0x3c, 0x0a, 0x1b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x64, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x75, 0x70, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x17, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, + 0x72, 0x44, 0x61, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x55, 0x70, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x2a, + 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x6f, + 0x64, 0x61, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x4e, 0x75, 0x6d, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, + 0x64, 0x61, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x4e, 0x75, 0x6d, 0x59, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, 0x12, 0x21, + 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x12, + 0x34, 0x0a, 0x16, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x59, 0x65, 0x73, 0x74, + 0x65, 0x72, 0x64, 0x61, 0x79, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, + 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x3c, + 0x0a, 0x1b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, + 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x75, 0x70, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x17, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, + 0x44, 0x61, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x55, 0x70, 0x12, 0x31, 0x0a, 0x15, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x5f, + 0x74, 0x6f, 0x64, 0x61, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x70, 0x70, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x22, + 0x71, 0x0a, 0x0b, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x28, + 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x22, 0xf0, 0x01, 0x0a, 0x0b, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x55, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x2e, 0x0a, 0x01, 0x79, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x2e, 0x59, 0x52, 0x01, 0x79, 0x1a, 0x2b, 0x0a, 0x01, 0x59, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x38, 0x0a, 0x0c, 0x41, 0x64, 0x73, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, + 0xc1, 0x02, 0x0a, 0x0c, 0x41, 0x64, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x77, 0x65, 0x62, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x70, 0x70, 0x4e, + 0x75, 0x6d, 0x12, 0x40, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x1a, 0xbc, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x77, 0x65, 0x62, 0x4e, 0x75, 0x6d, 0x12, 0x1f, + 0x0a, 0x0b, 0x77, 0x65, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x65, 0x62, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x61, 0x70, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, + 0x70, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x72, 0x65, 0x22, 0xf9, 0x05, 0x0a, 0x0a, 0x49, 0x6e, 0x41, 0x70, 0x70, 0x42, 0x50, 0x52, + 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x64, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, + 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x28, 0x0a, + 0x10, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x68, 0x6f, + 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, + 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, + 0x64, 0x65, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x69, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x71, 0x61, 0x5f, 0x69, 0x64, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x71, 0x61, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x71, + 0x61, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x71, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x6d, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6d, 0x67, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x7a, 0x6f, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x7a, 0x6f, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x5f, 0x66, 0x6c, 0x69, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x46, 0x6c, 0x69, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, + 0x74, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x42, 0x74, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x74, + 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x61, + 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x74, 0x69, + 0x70, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, + 0x74, 0x54, 0x69, 0x70, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6f, 0x72, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6e, + 0x6f, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x4e, 0x6f, 0x12, + 0x1e, 0x0a, 0x0b, 0x75, 0x6e, 0x6f, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x1a, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, + 0x0c, 0x0a, 0x0a, 0x49, 0x6e, 0x41, 0x70, 0x70, 0x42, 0x50, 0x52, 0x65, 0x73, 0x22, 0x80, 0x01, + 0x0a, 0x0a, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x42, 0x50, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x42, 0x50, 0x52, 0x65, 0x73, 0x22, 0xff, + 0x02, 0x0a, 0x0b, 0x4f, 0x75, 0x74, 0x41, 0x70, 0x70, 0x42, 0x50, 0x52, 0x65, 0x71, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, + 0x77, 0x65, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x77, 0x65, + 0x62, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, + 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, + 0x22, 0x0d, 0x0a, 0x0b, 0x4f, 0x75, 0x74, 0x41, 0x70, 0x70, 0x42, 0x50, 0x52, 0x65, 0x73, 0x22, + 0x28, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xcf, 0x06, 0x0a, 0x0d, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, + 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, + 0x3e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x51, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x2e, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x66, 0x69, 0x78, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x0b, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x4f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x52, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x6f, 0x77, 0x41, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, + 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x1a, 0x44, 0x0a, + 0x0a, 0x4c, 0x61, 0x6e, 0x67, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, + 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, + 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, + 0x61, 0x72, 0x6b, 0x1a, 0x67, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x4a, 0x0a, 0x0a, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x2e, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x0a, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x1d, 0x0a, 0x09, + 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x76, 0x0a, 0x0c, 0x53, + 0x74, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, + 0x61, 0x72, 0x6b, 0x22, 0xf0, 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x05, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x73, 0x12, 0x3a, 0x0a, + 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x65, 0x6c, + 0x70, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x68, + 0x65, 0x6c, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x2c, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x97, 0x05, 0x0a, 0x0b, 0x44, 0x65, 0x6d, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x12, + 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x49, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x71, 0x61, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x71, 0x61, 0x49, 0x64, 0x73, 0x12, 0x22, 0x0a, 0x0d, + 0x71, 0x61, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x0b, 0x71, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, + 0x12, 0x20, 0x0a, 0x0c, 0x71, 0x61, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x73, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x71, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, + 0x0a, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x49, 0x64, 0x73, 0x12, + 0x24, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x5f, 0x69, 0x64, + 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, + 0x74, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x06, 0x69, 0x6d, 0x67, 0x49, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x7a, 0x6f, 0x6e, 0x65, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x7a, 0x6f, 0x6e, 0x65, + 0x49, 0x64, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x70, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x11, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x63, 0x70, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x0c, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x12, 0x20, 0x03, + 0x28, 0x03, 0x52, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x12, + 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, + 0x03, 0x52, 0x07, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x61, + 0x6c, 0x6c, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, + 0x03, 0x52, 0x0b, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x73, 0x12, 0x20, + 0x0a, 0x0c, 0x75, 0x6e, 0x6f, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x15, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, + 0x22, 0xef, 0x0b, 0x0a, 0x0b, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x3a, 0x0a, 0x05, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, + 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x05, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x12, 0x3e, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x76, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x4c, 0x76, 0x12, 0x34, 0x0a, 0x02, 0x71, 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, + 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x02, 0x71, 0x61, 0x12, 0x41, 0x0a, 0x09, 0x71, 0x61, 0x5f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, + 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x52, 0x08, 0x71, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x08, + 0x71, 0x61, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x52, 0x07, 0x71, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3c, 0x0a, + 0x06, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, + 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x52, 0x06, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0a, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x74, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, + 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x09, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x74, 0x6e, + 0x12, 0x3a, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, + 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x3e, 0x0a, 0x07, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, + 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x38, 0x0a, 0x04, + 0x69, 0x6d, 0x67, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, + 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x52, 0x04, 0x69, 0x6d, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x7a, 0x6f, 0x6e, 0x65, 0x73, 0x18, + 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x05, 0x7a, 0x6f, 0x6e, + 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x63, 0x70, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x04, 0x63, 0x70, 0x6e, 0x73, 0x12, 0x45, 0x0a, 0x09, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x6d, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x13, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x05, 0x6d, 0x61, 0x6c, 0x6c, 0x73, 0x12, + 0x43, 0x0a, 0x0a, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x14, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x6c, 0x6c, 0x49, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x75, 0x6e, 0x6f, 0x5f, 0x63, 0x61, 0x72, 0x64, + 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x08, 0x75, + 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x5e, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x1a, 0x6b, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x74, 0x65, 0x61, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6d, + 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, + 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x22, 0x35, 0x0a, 0x09, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x89, 0x08, 0x0a, 0x09, 0x54, 0x6f, + 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x61, 0x78, 0x5f, 0x6c, + 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x61, 0x78, 0x4c, 0x76, 0x12, 0x3b, + 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, + 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x12, 0x35, 0x0a, 0x04, + 0x68, 0x65, 0x6c, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, + 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x04, 0x68, + 0x65, 0x6c, 0x70, 0x12, 0x35, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x1a, 0x73, 0x0a, 0x06, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x1a, + 0x7f, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x37, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x1a, 0x2c, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0x76, + 0x0a, 0x04, 0x47, 0x72, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x26, + 0x0a, 0x0f, 0x67, 0x72, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x67, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, 0x82, 0x01, 0x0a, 0x04, 0x48, 0x65, 0x6c, 0x70, 0x12, + 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, + 0x61, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x3b, + 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x1a, 0x30, 0x0a, 0x06, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0x76, 0x0a, + 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x26, 0x0a, + 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x22, 0x38, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, + 0xce, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x37, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x55, 0x0a, 0x03, 0x4f, 0x6e, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x3a, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6c, + 0x65, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, + 0x1a, 0x2e, 0x0a, 0x04, 0x50, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, + 0x22, 0x45, 0x0a, 0x09, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x0b, 0x0a, 0x09, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x73, 0x22, 0x2d, 0x0a, 0x12, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x22, 0xe8, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x74, + 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, + 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x32, 0x8e, + 0x0b, 0x0a, 0x0d, 0x57, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x12, 0x49, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x43, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, + 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x74, 0x61, 0x74, 0x12, 0x1a, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, + 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x41, 0x64, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x41, 0x64, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x49, 0x6e, 0x41, 0x70, 0x70, 0x42, 0x50, 0x12, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x41, 0x70, 0x70, 0x42, 0x50, 0x52, 0x65, 0x71, 0x1a, 0x1d, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x41, 0x70, 0x70, 0x42, 0x50, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x49, 0x0a, 0x07, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x42, 0x50, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x42, 0x50, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x42, 0x50, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x4f, 0x75, + 0x74, 0x41, 0x70, 0x70, 0x42, 0x50, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x41, 0x70, + 0x70, 0x42, 0x50, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x41, 0x70, + 0x70, 0x42, 0x50, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, + 0x53, 0x74, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, + 0x08, 0x44, 0x65, 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, + 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, + 0x6d, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x54, + 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x6f, 0x70, 0x54, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6c, 0x65, + 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x70, 0x62, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x0f, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, + 0x16, 0x5a, 0x14, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_campaign_stat_proto_rawDescOnce sync.Once + file_w_campaign_stat_proto_rawDescData = file_w_campaign_stat_proto_rawDesc +) + +func file_w_campaign_stat_proto_rawDescGZIP() []byte { + file_w_campaign_stat_proto_rawDescOnce.Do(func() { + file_w_campaign_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_campaign_stat_proto_rawDescData) + }) + return file_w_campaign_stat_proto_rawDescData +} + +var file_w_campaign_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 63) +var file_w_campaign_stat_proto_goTypes = []interface{}{ + (*SummaryReq)(nil), // 0: w_campaign_statpb.SummaryReq + (*SummaryRes)(nil), // 1: w_campaign_statpb.SummaryRes + (*CampaignReq)(nil), // 2: w_campaign_statpb.CampaignReq + (*CampaignRes)(nil), // 3: w_campaign_statpb.CampaignRes + (*RelatedReq)(nil), // 4: w_campaign_statpb.RelatedReq + (*RelatedRes)(nil), // 5: w_campaign_statpb.RelatedRes + (*StatReq)(nil), // 6: w_campaign_statpb.StatReq + (*StatRes)(nil), // 7: w_campaign_statpb.StatRes + (*ChannelReq)(nil), // 8: w_campaign_statpb.ChannelReq + (*ChannelRes)(nil), // 9: w_campaign_statpb.ChannelRes + (*AdsSummaryReq)(nil), // 10: w_campaign_statpb.AdsSummaryReq + (*AdsSummaryRes)(nil), // 11: w_campaign_statpb.AdsSummaryRes + (*AdsTableReq)(nil), // 12: w_campaign_statpb.AdsTableReq + (*AdsTableRes)(nil), // 13: w_campaign_statpb.AdsTableRes + (*AdsRewardReq)(nil), // 14: w_campaign_statpb.AdsRewardReq + (*AdsRewardRes)(nil), // 15: w_campaign_statpb.AdsRewardRes + (*InAppBPReq)(nil), // 16: w_campaign_statpb.InAppBPReq + (*InAppBPRes)(nil), // 17: w_campaign_statpb.InAppBPRes + (*ChildBPReq)(nil), // 18: w_campaign_statpb.ChildBPReq + (*ChildBPRes)(nil), // 19: w_campaign_statpb.ChildBPRes + (*OutAppBPReq)(nil), // 20: w_campaign_statpb.OutAppBPReq + (*OutAppBPRes)(nil), // 21: w_campaign_statpb.OutAppBPRes + (*ReportInfoReq)(nil), // 22: w_campaign_statpb.ReportInfoReq + (*ReportInfoRes)(nil), // 23: w_campaign_statpb.ReportInfoRes + (*StatEventReq)(nil), // 24: w_campaign_statpb.StatEventReq + (*StatEventRes)(nil), // 25: w_campaign_statpb.StatEventRes + (*DemTitleReq)(nil), // 26: w_campaign_statpb.DemTitleReq + (*DemTitleRes)(nil), // 27: w_campaign_statpb.DemTitleRes + (*TopTenReq)(nil), // 28: w_campaign_statpb.TopTenReq + (*TopTenRes)(nil), // 29: w_campaign_statpb.TopTenRes + (*UserCycleReq)(nil), // 30: w_campaign_statpb.UserCycleReq + (*UserCycleRes)(nil), // 31: w_campaign_statpb.UserCycleRes + (*ActiveReq)(nil), // 32: w_campaign_statpb.ActiveReq + (*ActiveRes)(nil), // 33: w_campaign_statpb.ActiveRes + (*ChildReportInfoReq)(nil), // 34: w_campaign_statpb.ChildReportInfoReq + (*ChildReportInfoRes)(nil), // 35: w_campaign_statpb.ChildReportInfoRes + (*SummaryRes_EventData)(nil), // 36: w_campaign_statpb.SummaryRes.EventData + (*SummaryRes_Cond)(nil), // 37: w_campaign_statpb.SummaryRes.Cond + (*SummaryRes_Grow)(nil), // 38: w_campaign_statpb.SummaryRes.Grow + (*CampaignRes_Y)(nil), // 39: w_campaign_statpb.CampaignRes.Y + (*CampaignRes_Report)(nil), // 40: w_campaign_statpb.CampaignRes.Report + (*RelatedRes_Y)(nil), // 41: w_campaign_statpb.RelatedRes.Y + (*RelatedRes_Report)(nil), // 42: w_campaign_statpb.RelatedRes.Report + (*RelatedRes_MediaData)(nil), // 43: w_campaign_statpb.RelatedRes.MediaData + (*ChannelRes_One)(nil), // 44: w_campaign_statpb.ChannelRes.One + (*AdsTableRes_Y)(nil), // 45: w_campaign_statpb.AdsTableRes.Y + (*AdsRewardRes_Reward)(nil), // 46: w_campaign_statpb.AdsRewardRes.Reward + (*ReportInfoRes_LangOffset)(nil), // 47: w_campaign_statpb.ReportInfoRes.LangOffset + (*ReportInfoRes_Event)(nil), // 48: w_campaign_statpb.ReportInfoRes.Event + (*ReportInfoRes_Dimension)(nil), // 49: w_campaign_statpb.ReportInfoRes.Dimension + (*StatEventRes_Task)(nil), // 50: w_campaign_statpb.StatEventRes.Task + (*DemTitleRes_Title)(nil), // 51: w_campaign_statpb.DemTitleRes.Title + (*DemTitleRes_Schedule)(nil), // 52: w_campaign_statpb.DemTitleRes.Schedule + (*DemTitleRes_Team)(nil), // 53: w_campaign_statpb.DemTitleRes.Team + (*TopTenRes_Invite)(nil), // 54: w_campaign_statpb.TopTenRes.Invite + (*TopTenRes_Event)(nil), // 55: w_campaign_statpb.TopTenRes.Event + (*TopTenRes_Cond)(nil), // 56: w_campaign_statpb.TopTenRes.Cond + (*TopTenRes_Grow)(nil), // 57: w_campaign_statpb.TopTenRes.Grow + (*TopTenRes_Help)(nil), // 58: w_campaign_statpb.TopTenRes.Help + (*TopTenRes_Detail)(nil), // 59: w_campaign_statpb.TopTenRes.Detail + (*TopTenRes_Sign)(nil), // 60: w_campaign_statpb.TopTenRes.Sign + (*UserCycleRes_One)(nil), // 61: w_campaign_statpb.UserCycleRes.One + (*UserCycleRes_Part)(nil), // 62: w_campaign_statpb.UserCycleRes.Part +} +var file_w_campaign_stat_proto_depIdxs = []int32{ + 36, // 0: w_campaign_statpb.SummaryRes.event_data:type_name -> w_campaign_statpb.SummaryRes.EventData + 38, // 1: w_campaign_statpb.SummaryRes.grow:type_name -> w_campaign_statpb.SummaryRes.Grow + 40, // 2: w_campaign_statpb.CampaignRes.report_user:type_name -> w_campaign_statpb.CampaignRes.Report + 40, // 3: w_campaign_statpb.CampaignRes.report_num:type_name -> w_campaign_statpb.CampaignRes.Report + 42, // 4: w_campaign_statpb.RelatedRes.report_user:type_name -> w_campaign_statpb.RelatedRes.Report + 42, // 5: w_campaign_statpb.RelatedRes.report_num:type_name -> w_campaign_statpb.RelatedRes.Report + 44, // 6: w_campaign_statpb.ChannelRes.list:type_name -> w_campaign_statpb.ChannelRes.One + 45, // 7: w_campaign_statpb.AdsTableRes.y:type_name -> w_campaign_statpb.AdsTableRes.Y + 46, // 8: w_campaign_statpb.AdsRewardRes.rewards:type_name -> w_campaign_statpb.AdsRewardRes.Reward + 48, // 9: w_campaign_statpb.ReportInfoRes.events:type_name -> w_campaign_statpb.ReportInfoRes.Event + 49, // 10: w_campaign_statpb.ReportInfoRes.fix_dimensions:type_name -> w_campaign_statpb.ReportInfoRes.Dimension + 47, // 11: w_campaign_statpb.ReportInfoRes.lang_offset:type_name -> w_campaign_statpb.ReportInfoRes.LangOffset + 50, // 12: w_campaign_statpb.StatEventRes.tasks:type_name -> w_campaign_statpb.StatEventRes.Task + 51, // 13: w_campaign_statpb.DemTitleRes.conds:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 14: w_campaign_statpb.DemTitleRes.media:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 15: w_campaign_statpb.DemTitleRes.channel:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 16: w_campaign_statpb.DemTitleRes.rewards:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 17: w_campaign_statpb.DemTitleRes.user_lv:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 18: w_campaign_statpb.DemTitleRes.qa:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 19: w_campaign_statpb.DemTitleRes.qa_option:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 20: w_campaign_statpb.DemTitleRes.qa_group:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 21: w_campaign_statpb.DemTitleRes.scenes:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 22: w_campaign_statpb.DemTitleRes.custom_btn:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 23: w_campaign_statpb.DemTitleRes.tasks:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 24: w_campaign_statpb.DemTitleRes.parents:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 25: w_campaign_statpb.DemTitleRes.imgs:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 26: w_campaign_statpb.DemTitleRes.zones:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 27: w_campaign_statpb.DemTitleRes.cpns:type_name -> w_campaign_statpb.DemTitleRes.Title + 52, // 28: w_campaign_statpb.DemTitleRes.schedules:type_name -> w_campaign_statpb.DemTitleRes.Schedule + 51, // 29: w_campaign_statpb.DemTitleRes.malls:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 30: w_campaign_statpb.DemTitleRes.mall_items:type_name -> w_campaign_statpb.DemTitleRes.Title + 51, // 31: w_campaign_statpb.DemTitleRes.uno_cards:type_name -> w_campaign_statpb.DemTitleRes.Title + 54, // 32: w_campaign_statpb.TopTenRes.invite:type_name -> w_campaign_statpb.TopTenRes.Invite + 55, // 33: w_campaign_statpb.TopTenRes.event:type_name -> w_campaign_statpb.TopTenRes.Event + 57, // 34: w_campaign_statpb.TopTenRes.grow:type_name -> w_campaign_statpb.TopTenRes.Grow + 58, // 35: w_campaign_statpb.TopTenRes.help:type_name -> w_campaign_statpb.TopTenRes.Help + 60, // 36: w_campaign_statpb.TopTenRes.sign:type_name -> w_campaign_statpb.TopTenRes.Sign + 61, // 37: w_campaign_statpb.UserCycleRes.list:type_name -> w_campaign_statpb.UserCycleRes.One + 37, // 38: w_campaign_statpb.SummaryRes.EventData.conds:type_name -> w_campaign_statpb.SummaryRes.Cond + 39, // 39: w_campaign_statpb.CampaignRes.Report.y:type_name -> w_campaign_statpb.CampaignRes.Y + 41, // 40: w_campaign_statpb.RelatedRes.Report.y:type_name -> w_campaign_statpb.RelatedRes.Y + 43, // 41: w_campaign_statpb.RelatedRes.Report.media_data:type_name -> w_campaign_statpb.RelatedRes.MediaData + 49, // 42: w_campaign_statpb.ReportInfoRes.Event.dimensions:type_name -> w_campaign_statpb.ReportInfoRes.Dimension + 53, // 43: w_campaign_statpb.DemTitleRes.Schedule.teams:type_name -> w_campaign_statpb.DemTitleRes.Team + 56, // 44: w_campaign_statpb.TopTenRes.Event.conds:type_name -> w_campaign_statpb.TopTenRes.Cond + 59, // 45: w_campaign_statpb.TopTenRes.Help.detail:type_name -> w_campaign_statpb.TopTenRes.Detail + 62, // 46: w_campaign_statpb.UserCycleRes.One.parts:type_name -> w_campaign_statpb.UserCycleRes.Part + 0, // 47: w_campaign_statpb.WCampaignStat.Summary:input_type -> w_campaign_statpb.SummaryReq + 2, // 48: w_campaign_statpb.WCampaignStat.Campaign:input_type -> w_campaign_statpb.CampaignReq + 4, // 49: w_campaign_statpb.WCampaignStat.Related:input_type -> w_campaign_statpb.RelatedReq + 6, // 50: w_campaign_statpb.WCampaignStat.Stat:input_type -> w_campaign_statpb.StatReq + 8, // 51: w_campaign_statpb.WCampaignStat.Channel:input_type -> w_campaign_statpb.ChannelReq + 10, // 52: w_campaign_statpb.WCampaignStat.AdsSummary:input_type -> w_campaign_statpb.AdsSummaryReq + 12, // 53: w_campaign_statpb.WCampaignStat.AdsTable:input_type -> w_campaign_statpb.AdsTableReq + 14, // 54: w_campaign_statpb.WCampaignStat.AdsReward:input_type -> w_campaign_statpb.AdsRewardReq + 16, // 55: w_campaign_statpb.WCampaignStat.InAppBP:input_type -> w_campaign_statpb.InAppBPReq + 18, // 56: w_campaign_statpb.WCampaignStat.ChildBP:input_type -> w_campaign_statpb.ChildBPReq + 20, // 57: w_campaign_statpb.WCampaignStat.OutAppBP:input_type -> w_campaign_statpb.OutAppBPReq + 22, // 58: w_campaign_statpb.WCampaignStat.ReportInfo:input_type -> w_campaign_statpb.ReportInfoReq + 24, // 59: w_campaign_statpb.WCampaignStat.StatEvent:input_type -> w_campaign_statpb.StatEventReq + 26, // 60: w_campaign_statpb.WCampaignStat.DemTitle:input_type -> w_campaign_statpb.DemTitleReq + 28, // 61: w_campaign_statpb.WCampaignStat.TopTen:input_type -> w_campaign_statpb.TopTenReq + 30, // 62: w_campaign_statpb.WCampaignStat.UserCycle:input_type -> w_campaign_statpb.UserCycleReq + 32, // 63: w_campaign_statpb.WCampaignStat.Active:input_type -> w_campaign_statpb.ActiveReq + 34, // 64: w_campaign_statpb.WCampaignStat.ChildReportInfo:input_type -> w_campaign_statpb.ChildReportInfoReq + 1, // 65: w_campaign_statpb.WCampaignStat.Summary:output_type -> w_campaign_statpb.SummaryRes + 3, // 66: w_campaign_statpb.WCampaignStat.Campaign:output_type -> w_campaign_statpb.CampaignRes + 5, // 67: w_campaign_statpb.WCampaignStat.Related:output_type -> w_campaign_statpb.RelatedRes + 7, // 68: w_campaign_statpb.WCampaignStat.Stat:output_type -> w_campaign_statpb.StatRes + 9, // 69: w_campaign_statpb.WCampaignStat.Channel:output_type -> w_campaign_statpb.ChannelRes + 11, // 70: w_campaign_statpb.WCampaignStat.AdsSummary:output_type -> w_campaign_statpb.AdsSummaryRes + 13, // 71: w_campaign_statpb.WCampaignStat.AdsTable:output_type -> w_campaign_statpb.AdsTableRes + 15, // 72: w_campaign_statpb.WCampaignStat.AdsReward:output_type -> w_campaign_statpb.AdsRewardRes + 17, // 73: w_campaign_statpb.WCampaignStat.InAppBP:output_type -> w_campaign_statpb.InAppBPRes + 19, // 74: w_campaign_statpb.WCampaignStat.ChildBP:output_type -> w_campaign_statpb.ChildBPRes + 21, // 75: w_campaign_statpb.WCampaignStat.OutAppBP:output_type -> w_campaign_statpb.OutAppBPRes + 23, // 76: w_campaign_statpb.WCampaignStat.ReportInfo:output_type -> w_campaign_statpb.ReportInfoRes + 25, // 77: w_campaign_statpb.WCampaignStat.StatEvent:output_type -> w_campaign_statpb.StatEventRes + 27, // 78: w_campaign_statpb.WCampaignStat.DemTitle:output_type -> w_campaign_statpb.DemTitleRes + 29, // 79: w_campaign_statpb.WCampaignStat.TopTen:output_type -> w_campaign_statpb.TopTenRes + 31, // 80: w_campaign_statpb.WCampaignStat.UserCycle:output_type -> w_campaign_statpb.UserCycleRes + 33, // 81: w_campaign_statpb.WCampaignStat.Active:output_type -> w_campaign_statpb.ActiveRes + 35, // 82: w_campaign_statpb.WCampaignStat.ChildReportInfo:output_type -> w_campaign_statpb.ChildReportInfoRes + 65, // [65:83] is the sub-list for method output_type + 47, // [47:65] is the sub-list for method input_type + 47, // [47:47] is the sub-list for extension type_name + 47, // [47:47] is the sub-list for extension extendee + 0, // [0:47] is the sub-list for field type_name +} + +func init() { file_w_campaign_stat_proto_init() } +func file_w_campaign_stat_proto_init() { + if File_w_campaign_stat_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_campaign_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelatedReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelatedRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsSummaryReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsSummaryRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsTableReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsTableRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InAppBPReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InAppBPRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildBPReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildBPRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OutAppBPReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OutAppBPRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportInfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatEventReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatEventRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DemTitleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DemTitleRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserCycleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserCycleRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActiveRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildReportInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildReportInfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryRes_EventData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SummaryRes_Grow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignRes_Y); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignRes_Report); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelatedRes_Y); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelatedRes_Report); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelatedRes_MediaData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsTableRes_Y); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsRewardRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportInfoRes_LangOffset); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportInfoRes_Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportInfoRes_Dimension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatEventRes_Task); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DemTitleRes_Title); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DemTitleRes_Schedule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DemTitleRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Invite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Grow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Help); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Detail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TopTenRes_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserCycleRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_stat_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserCycleRes_Part); 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_w_campaign_stat_proto_rawDesc, + NumEnums: 0, + NumMessages: 63, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_campaign_stat_proto_goTypes, + DependencyIndexes: file_w_campaign_stat_proto_depIdxs, + MessageInfos: file_w_campaign_stat_proto_msgTypes, + }.Build() + File_w_campaign_stat_proto = out.File + file_w_campaign_stat_proto_rawDesc = nil + file_w_campaign_stat_proto_goTypes = nil + file_w_campaign_stat_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_campaign_stat/w_campaign_stat.pb.micro.go b/proto/go_proto/w_campaign_stat/w_campaign_stat.pb.micro.go new file mode 100644 index 0000000..ac3ab0d --- /dev/null +++ b/proto/go_proto/w_campaign_stat/w_campaign_stat.pb.micro.go @@ -0,0 +1,412 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_campaign_stat.proto + +package w_campaign_statpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WCampaignStat service + +func NewWCampaignStatEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WCampaignStat service + +type WCampaignStatService interface { + // Summary 活动概览数据 + Summary(ctx context.Context, in *SummaryReq, opts ...client.CallOption) (*SummaryRes, error) + // Campaign 活动数据 + Campaign(ctx context.Context, in *CampaignReq, opts ...client.CallOption) (*CampaignRes, error) + // Related 裂变数据 + Related(ctx context.Context, in *RelatedReq, opts ...client.CallOption) (*RelatedRes, error) + // Stat 统计事件数据 + Stat(ctx context.Context, in *StatReq, opts ...client.CallOption) (*StatRes, error) + // Channel 渠道统计 + Channel(ctx context.Context, in *ChannelReq, opts ...client.CallOption) (*ChannelRes, error) + // AdsSummary Ads总揽数据 + AdsSummary(ctx context.Context, in *AdsSummaryReq, opts ...client.CallOption) (*AdsSummaryRes, error) + // AdsTable Ads报表 + AdsTable(ctx context.Context, in *AdsTableReq, opts ...client.CallOption) (*AdsTableRes, error) + // AdsReward Ads奖品 + AdsReward(ctx context.Context, in *AdsRewardReq, opts ...client.CallOption) (*AdsRewardRes, error) + // InAppBP 应用内埋点 + InAppBP(ctx context.Context, in *InAppBPReq, opts ...client.CallOption) (*InAppBPRes, error) + // ChildBP 应用内埋点 + ChildBP(ctx context.Context, in *ChildBPReq, opts ...client.CallOption) (*ChildBPRes, error) + // OutAppBP 应用外埋点 + OutAppBP(ctx context.Context, in *OutAppBPReq, opts ...client.CallOption) (*OutAppBPRes, error) + // ReportInfo 报表信息 + ReportInfo(ctx context.Context, in *ReportInfoReq, opts ...client.CallOption) (*ReportInfoRes, error) + // StatEvent 活动统计的维度 + StatEvent(ctx context.Context, in *StatEventReq, opts ...client.CallOption) (*StatEventRes, error) + // DemTitle 维度标题数据 + DemTitle(ctx context.Context, in *DemTitleReq, opts ...client.CallOption) (*DemTitleRes, error) + // TopTen 活动前十排行榜 + TopTen(ctx context.Context, in *TopTenReq, opts ...client.CallOption) (*TopTenRes, error) + // UserCycle 用户明细占比数据 + UserCycle(ctx context.Context, in *UserCycleReq, opts ...client.CallOption) (*UserCycleRes, error) + // Active 用户活跃 + Active(ctx context.Context, in *ActiveReq, opts ...client.CallOption) (*ActiveRes, error) + // ChildReportInfo 子活动报表信息 + ChildReportInfo(ctx context.Context, in *ChildReportInfoReq, opts ...client.CallOption) (*ChildReportInfoRes, error) +} + +type wCampaignStatService struct { + c client.Client + name string +} + +func NewWCampaignStatService(name string, c client.Client) WCampaignStatService { + return &wCampaignStatService{ + c: c, + name: name, + } +} + +func (c *wCampaignStatService) Summary(ctx context.Context, in *SummaryReq, opts ...client.CallOption) (*SummaryRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.Summary", in) + out := new(SummaryRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) Campaign(ctx context.Context, in *CampaignReq, opts ...client.CallOption) (*CampaignRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.Campaign", in) + out := new(CampaignRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) Related(ctx context.Context, in *RelatedReq, opts ...client.CallOption) (*RelatedRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.Related", in) + out := new(RelatedRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) Stat(ctx context.Context, in *StatReq, opts ...client.CallOption) (*StatRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.Stat", in) + out := new(StatRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) Channel(ctx context.Context, in *ChannelReq, opts ...client.CallOption) (*ChannelRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.Channel", in) + out := new(ChannelRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) AdsSummary(ctx context.Context, in *AdsSummaryReq, opts ...client.CallOption) (*AdsSummaryRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.AdsSummary", in) + out := new(AdsSummaryRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) AdsTable(ctx context.Context, in *AdsTableReq, opts ...client.CallOption) (*AdsTableRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.AdsTable", in) + out := new(AdsTableRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) AdsReward(ctx context.Context, in *AdsRewardReq, opts ...client.CallOption) (*AdsRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.AdsReward", in) + out := new(AdsRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) InAppBP(ctx context.Context, in *InAppBPReq, opts ...client.CallOption) (*InAppBPRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.InAppBP", in) + out := new(InAppBPRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) ChildBP(ctx context.Context, in *ChildBPReq, opts ...client.CallOption) (*ChildBPRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.ChildBP", in) + out := new(ChildBPRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) OutAppBP(ctx context.Context, in *OutAppBPReq, opts ...client.CallOption) (*OutAppBPRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.OutAppBP", in) + out := new(OutAppBPRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) ReportInfo(ctx context.Context, in *ReportInfoReq, opts ...client.CallOption) (*ReportInfoRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.ReportInfo", in) + out := new(ReportInfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) StatEvent(ctx context.Context, in *StatEventReq, opts ...client.CallOption) (*StatEventRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.StatEvent", in) + out := new(StatEventRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) DemTitle(ctx context.Context, in *DemTitleReq, opts ...client.CallOption) (*DemTitleRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.DemTitle", in) + out := new(DemTitleRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) TopTen(ctx context.Context, in *TopTenReq, opts ...client.CallOption) (*TopTenRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.TopTen", in) + out := new(TopTenRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) UserCycle(ctx context.Context, in *UserCycleReq, opts ...client.CallOption) (*UserCycleRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.UserCycle", in) + out := new(UserCycleRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) Active(ctx context.Context, in *ActiveReq, opts ...client.CallOption) (*ActiveRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.Active", in) + out := new(ActiveRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignStatService) ChildReportInfo(ctx context.Context, in *ChildReportInfoReq, opts ...client.CallOption) (*ChildReportInfoRes, error) { + req := c.c.NewRequest(c.name, "WCampaignStat.ChildReportInfo", in) + out := new(ChildReportInfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WCampaignStat service + +type WCampaignStatHandler interface { + // Summary 活动概览数据 + Summary(context.Context, *SummaryReq, *SummaryRes) error + // Campaign 活动数据 + Campaign(context.Context, *CampaignReq, *CampaignRes) error + // Related 裂变数据 + Related(context.Context, *RelatedReq, *RelatedRes) error + // Stat 统计事件数据 + Stat(context.Context, *StatReq, *StatRes) error + // Channel 渠道统计 + Channel(context.Context, *ChannelReq, *ChannelRes) error + // AdsSummary Ads总揽数据 + AdsSummary(context.Context, *AdsSummaryReq, *AdsSummaryRes) error + // AdsTable Ads报表 + AdsTable(context.Context, *AdsTableReq, *AdsTableRes) error + // AdsReward Ads奖品 + AdsReward(context.Context, *AdsRewardReq, *AdsRewardRes) error + // InAppBP 应用内埋点 + InAppBP(context.Context, *InAppBPReq, *InAppBPRes) error + // ChildBP 应用内埋点 + ChildBP(context.Context, *ChildBPReq, *ChildBPRes) error + // OutAppBP 应用外埋点 + OutAppBP(context.Context, *OutAppBPReq, *OutAppBPRes) error + // ReportInfo 报表信息 + ReportInfo(context.Context, *ReportInfoReq, *ReportInfoRes) error + // StatEvent 活动统计的维度 + StatEvent(context.Context, *StatEventReq, *StatEventRes) error + // DemTitle 维度标题数据 + DemTitle(context.Context, *DemTitleReq, *DemTitleRes) error + // TopTen 活动前十排行榜 + TopTen(context.Context, *TopTenReq, *TopTenRes) error + // UserCycle 用户明细占比数据 + UserCycle(context.Context, *UserCycleReq, *UserCycleRes) error + // Active 用户活跃 + Active(context.Context, *ActiveReq, *ActiveRes) error + // ChildReportInfo 子活动报表信息 + ChildReportInfo(context.Context, *ChildReportInfoReq, *ChildReportInfoRes) error +} + +func RegisterWCampaignStatHandler(s server.Server, hdlr WCampaignStatHandler, opts ...server.HandlerOption) error { + type wCampaignStat interface { + Summary(ctx context.Context, in *SummaryReq, out *SummaryRes) error + Campaign(ctx context.Context, in *CampaignReq, out *CampaignRes) error + Related(ctx context.Context, in *RelatedReq, out *RelatedRes) error + Stat(ctx context.Context, in *StatReq, out *StatRes) error + Channel(ctx context.Context, in *ChannelReq, out *ChannelRes) error + AdsSummary(ctx context.Context, in *AdsSummaryReq, out *AdsSummaryRes) error + AdsTable(ctx context.Context, in *AdsTableReq, out *AdsTableRes) error + AdsReward(ctx context.Context, in *AdsRewardReq, out *AdsRewardRes) error + InAppBP(ctx context.Context, in *InAppBPReq, out *InAppBPRes) error + ChildBP(ctx context.Context, in *ChildBPReq, out *ChildBPRes) error + OutAppBP(ctx context.Context, in *OutAppBPReq, out *OutAppBPRes) error + ReportInfo(ctx context.Context, in *ReportInfoReq, out *ReportInfoRes) error + StatEvent(ctx context.Context, in *StatEventReq, out *StatEventRes) error + DemTitle(ctx context.Context, in *DemTitleReq, out *DemTitleRes) error + TopTen(ctx context.Context, in *TopTenReq, out *TopTenRes) error + UserCycle(ctx context.Context, in *UserCycleReq, out *UserCycleRes) error + Active(ctx context.Context, in *ActiveReq, out *ActiveRes) error + ChildReportInfo(ctx context.Context, in *ChildReportInfoReq, out *ChildReportInfoRes) error + } + type WCampaignStat struct { + wCampaignStat + } + h := &wCampaignStatHandler{hdlr} + return s.Handle(s.NewHandler(&WCampaignStat{h}, opts...)) +} + +type wCampaignStatHandler struct { + WCampaignStatHandler +} + +func (h *wCampaignStatHandler) Summary(ctx context.Context, in *SummaryReq, out *SummaryRes) error { + return h.WCampaignStatHandler.Summary(ctx, in, out) +} + +func (h *wCampaignStatHandler) Campaign(ctx context.Context, in *CampaignReq, out *CampaignRes) error { + return h.WCampaignStatHandler.Campaign(ctx, in, out) +} + +func (h *wCampaignStatHandler) Related(ctx context.Context, in *RelatedReq, out *RelatedRes) error { + return h.WCampaignStatHandler.Related(ctx, in, out) +} + +func (h *wCampaignStatHandler) Stat(ctx context.Context, in *StatReq, out *StatRes) error { + return h.WCampaignStatHandler.Stat(ctx, in, out) +} + +func (h *wCampaignStatHandler) Channel(ctx context.Context, in *ChannelReq, out *ChannelRes) error { + return h.WCampaignStatHandler.Channel(ctx, in, out) +} + +func (h *wCampaignStatHandler) AdsSummary(ctx context.Context, in *AdsSummaryReq, out *AdsSummaryRes) error { + return h.WCampaignStatHandler.AdsSummary(ctx, in, out) +} + +func (h *wCampaignStatHandler) AdsTable(ctx context.Context, in *AdsTableReq, out *AdsTableRes) error { + return h.WCampaignStatHandler.AdsTable(ctx, in, out) +} + +func (h *wCampaignStatHandler) AdsReward(ctx context.Context, in *AdsRewardReq, out *AdsRewardRes) error { + return h.WCampaignStatHandler.AdsReward(ctx, in, out) +} + +func (h *wCampaignStatHandler) InAppBP(ctx context.Context, in *InAppBPReq, out *InAppBPRes) error { + return h.WCampaignStatHandler.InAppBP(ctx, in, out) +} + +func (h *wCampaignStatHandler) ChildBP(ctx context.Context, in *ChildBPReq, out *ChildBPRes) error { + return h.WCampaignStatHandler.ChildBP(ctx, in, out) +} + +func (h *wCampaignStatHandler) OutAppBP(ctx context.Context, in *OutAppBPReq, out *OutAppBPRes) error { + return h.WCampaignStatHandler.OutAppBP(ctx, in, out) +} + +func (h *wCampaignStatHandler) ReportInfo(ctx context.Context, in *ReportInfoReq, out *ReportInfoRes) error { + return h.WCampaignStatHandler.ReportInfo(ctx, in, out) +} + +func (h *wCampaignStatHandler) StatEvent(ctx context.Context, in *StatEventReq, out *StatEventRes) error { + return h.WCampaignStatHandler.StatEvent(ctx, in, out) +} + +func (h *wCampaignStatHandler) DemTitle(ctx context.Context, in *DemTitleReq, out *DemTitleRes) error { + return h.WCampaignStatHandler.DemTitle(ctx, in, out) +} + +func (h *wCampaignStatHandler) TopTen(ctx context.Context, in *TopTenReq, out *TopTenRes) error { + return h.WCampaignStatHandler.TopTen(ctx, in, out) +} + +func (h *wCampaignStatHandler) UserCycle(ctx context.Context, in *UserCycleReq, out *UserCycleRes) error { + return h.WCampaignStatHandler.UserCycle(ctx, in, out) +} + +func (h *wCampaignStatHandler) Active(ctx context.Context, in *ActiveReq, out *ActiveRes) error { + return h.WCampaignStatHandler.Active(ctx, in, out) +} + +func (h *wCampaignStatHandler) ChildReportInfo(ctx context.Context, in *ChildReportInfoReq, out *ChildReportInfoRes) error { + return h.WCampaignStatHandler.ChildReportInfo(ctx, in, out) +} diff --git a/proto/go_proto/w_campaign_user/w_campaign_user.pb.go b/proto/go_proto/w_campaign_user/w_campaign_user.pb.go new file mode 100644 index 0000000..73c74c5 --- /dev/null +++ b/proto/go_proto/w_campaign_user/w_campaign_user.pb.go @@ -0,0 +1,32547 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_campaign_user.proto + +package w_campaign_userpb + +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 ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,4,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + Pid int64 `protobuf:"varint,5,opt,name=pid,proto3" json:"pid,omitempty"` //父级id + UserMark string `protobuf:"bytes,6,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,7,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,8,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + OrderByTimeAsc bool `protobuf:"varint,9,opt,name=order_by_time_asc,json=orderByTimeAsc,proto3" json:"order_by_time_asc,omitempty"` //根据参与时间升序 + ParentUserMark string `protobuf:"bytes,10,opt,name=parent_user_mark,json=parentUserMark,proto3" json:"parent_user_mark,omitempty"` //上级用户标识关键字 + Source int32 `protobuf:"varint,11,opt,name=source,proto3" json:"source,omitempty"` //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + LangMark string `protobuf:"bytes,12,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + TOffset int32 `protobuf:"varint,13,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + PidType int32 `protobuf:"varint,14,opt,name=pid_type,json=pidType,proto3" json:"pid_type,omitempty"` //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + JoinType int32 `protobuf:"varint,15,opt,name=join_type,json=joinType,proto3" json:"join_type,omitempty"` //上级用户类型(1-进入过活动的用户,2-没有进入过活动的用户) + UserCond []int32 `protobuf:"varint,16,rep,packed,name=user_cond,json=userCond,proto3" json:"user_cond,omitempty"` //用户条件(1-有安装的用户,2-有注册的用户) +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ListReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *ListReq) GetPid() int64 { + if x != nil { + return x.Pid + } + return 0 +} + +func (x *ListReq) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *ListReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ListReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *ListReq) GetOrderByTimeAsc() bool { + if x != nil { + return x.OrderByTimeAsc + } + return false +} + +func (x *ListReq) GetParentUserMark() string { + if x != nil { + return x.ParentUserMark + } + return "" +} + +func (x *ListReq) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *ListReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ListReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ListReq) GetPidType() int32 { + if x != nil { + return x.PidType + } + return 0 +} + +func (x *ListReq) GetJoinType() int32 { + if x != nil { + return x.JoinType + } + return 0 +} + +func (x *ListReq) GetUserCond() []int32 { + if x != nil { + return x.UserCond + } + return nil +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 + TOffset int32 `protobuf:"varint,3,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + FissionId int64 `protobuf:"varint,4,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + FissionMark string `protobuf:"bytes,5,opt,name=fission_mark,json=fissionMark,proto3" json:"fission_mark,omitempty"` //活动类型玩法标识 + FixDice int32 `protobuf:"varint,6,opt,name=fix_dice,json=fixDice,proto3" json:"fix_dice,omitempty"` //开启固定骰子(0-不开启,1-开启) +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ListRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ListRes) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *ListRes) GetFissionMark() string { + if x != nil { + return x.FissionMark + } + return "" +} + +func (x *ListRes) GetFixDice() int32 { + if x != nil { + return x.FixDice + } + return 0 +} + +type RewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,4,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + FuserId int64 `protobuf:"varint,5,opt,name=fuser_id,json=fuserId,proto3" json:"fuser_id,omitempty"` //活动用户id + UserMark string `protobuf:"bytes,6,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,7,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,8,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + Status []int32 `protobuf:"varint,9,rep,packed,name=status,proto3" json:"status,omitempty"` //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发放) + RewardTitle string `protobuf:"bytes,10,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + TOffset int32 `protobuf:"varint,11,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + IsChild int32 `protobuf:"varint,12,opt,name=is_child,json=isChild,proto3" json:"is_child,omitempty"` //是否子活动奖品 +} + +func (x *RewardReq) Reset() { + *x = RewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardReq) ProtoMessage() {} + +func (x *RewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 RewardReq.ProtoReflect.Descriptor instead. +func (*RewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{2} +} + +func (x *RewardReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *RewardReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *RewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *RewardReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *RewardReq) GetFuserId() int64 { + if x != nil { + return x.FuserId + } + return 0 +} + +func (x *RewardReq) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *RewardReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *RewardReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *RewardReq) GetStatus() []int32 { + if x != nil { + return x.Status + } + return nil +} + +func (x *RewardReq) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *RewardReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *RewardReq) GetIsChild() int32 { + if x != nil { + return x.IsChild + } + return 0 +} + +type RewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*RewardRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 + TOffset int32 `protobuf:"varint,3,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 +} + +func (x *RewardRes) Reset() { + *x = RewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardRes) ProtoMessage() {} + +func (x *RewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 RewardRes.ProtoReflect.Descriptor instead. +func (*RewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{3} +} + +func (x *RewardRes) GetList() []*RewardRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *RewardRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *RewardRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +type VisitReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hid string `protobuf:"bytes,1,opt,name=hid,proto3" json:"hid,omitempty"` //活动hash_id + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` //关注用户ID + Cid string `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"` //渠道ID + Wid string `protobuf:"bytes,4,opt,name=wid,proto3" json:"wid,omitempty"` //浏览器唯一id + Lang string `protobuf:"bytes,5,opt,name=lang,proto3" json:"lang,omitempty"` //语种标识 + Lv string `protobuf:"bytes,6,opt,name=lv,proto3" json:"lv,omitempty"` //用户等级 + Cert *VisitReq_Cert `protobuf:"bytes,7,opt,name=cert,proto3" json:"cert,omitempty"` //验签数据 + Ip string `protobuf:"bytes,8,opt,name=ip,proto3" json:"ip,omitempty"` //客户端ip + Platform string `protobuf:"bytes,9,opt,name=platform,proto3" json:"platform,omitempty"` //平台 + Os string `protobuf:"bytes,10,opt,name=os,proto3" json:"os,omitempty"` //系统 + OsVersion string `protobuf:"bytes,11,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` //系统版本 + DeviceModel string `protobuf:"bytes,12,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"` //系统型号 + CustomParam string `protobuf:"bytes,13,opt,name=custom_param,json=customParam,proto3" json:"custom_param,omitempty"` //额外信息 + CenterId string `protobuf:"bytes,14,opt,name=center_id,json=centerId,proto3" json:"center_id,omitempty"` //任务中心ID + ModuleId string `protobuf:"bytes,15,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"` //任务中心模块ID +} + +func (x *VisitReq) Reset() { + *x = VisitReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisitReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisitReq) ProtoMessage() {} + +func (x *VisitReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 VisitReq.ProtoReflect.Descriptor instead. +func (*VisitReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{4} +} + +func (x *VisitReq) GetHid() string { + if x != nil { + return x.Hid + } + return "" +} + +func (x *VisitReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *VisitReq) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *VisitReq) GetWid() string { + if x != nil { + return x.Wid + } + return "" +} + +func (x *VisitReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *VisitReq) GetLv() string { + if x != nil { + return x.Lv + } + return "" +} + +func (x *VisitReq) GetCert() *VisitReq_Cert { + if x != nil { + return x.Cert + } + return nil +} + +func (x *VisitReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *VisitReq) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *VisitReq) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *VisitReq) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *VisitReq) GetDeviceModel() string { + if x != nil { + return x.DeviceModel + } + return "" +} + +func (x *VisitReq) GetCustomParam() string { + if x != nil { + return x.CustomParam + } + return "" +} + +func (x *VisitReq) GetCenterId() string { + if x != nil { + return x.CenterId + } + return "" +} + +func (x *VisitReq) GetModuleId() string { + if x != nil { + return x.ModuleId + } + return "" +} + +type VisitRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` //身份token + Expired int64 `protobuf:"varint,4,opt,name=expired,proto3" json:"expired,omitempty"` //token过期时间,单位:秒(s) + IsView int32 `protobuf:"varint,5,opt,name=is_view,json=isView,proto3" json:"is_view,omitempty"` //是否预览用户(1-是,0-否) + HasParent bool `protobuf:"varint,6,opt,name=has_parent,json=hasParent,proto3" json:"has_parent,omitempty"` //是否有上级 +} + +func (x *VisitRes) Reset() { + *x = VisitRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisitRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisitRes) ProtoMessage() {} + +func (x *VisitRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 VisitRes.ProtoReflect.Descriptor instead. +func (*VisitRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{5} +} + +func (x *VisitRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VisitRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *VisitRes) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *VisitRes) GetExpired() int64 { + if x != nil { + return x.Expired + } + return 0 +} + +func (x *VisitRes) GetIsView() int32 { + if x != nil { + return x.IsView + } + return 0 +} + +func (x *VisitRes) GetHasParent() bool { + if x != nil { + return x.HasParent + } + return false +} + +type PlayReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *PlayReq) Reset() { + *x = PlayReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayReq) ProtoMessage() {} + +func (x *PlayReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 PlayReq.ProtoReflect.Descriptor instead. +func (*PlayReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{6} +} + +func (x *PlayReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type PlayRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //关注用户ID + ParentUserId string `protobuf:"bytes,2,opt,name=parent_user_id,json=parentUserId,proto3" json:"parent_user_id,omitempty"` //用户上级用户外部id + DeviceId string `protobuf:"bytes,3,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //设备ID + ShareLink string `protobuf:"bytes,4,opt,name=share_link,json=shareLink,proto3" json:"share_link,omitempty"` //分享链接 + ChancePlayer *PlayRes_ChancePlayer `protobuf:"bytes,5,opt,name=chance_player,json=chancePlayer,proto3" json:"chance_player,omitempty"` //大转盘,九宫格,老虎机,盲盒,趣味问答,抽签 + InvitePlayer *PlayRes_InvitePalyer `protobuf:"bytes,6,opt,name=invite_player,json=invitePlayer,proto3" json:"invite_player,omitempty"` //老带新,一起赢 + Quiz *PlayRes_Quiz `protobuf:"bytes,7,opt,name=quiz,proto3" json:"quiz,omitempty"` //有奖竞猜(有奖竞猜活动才有) + Sign *PlayRes_Sign `protobuf:"bytes,8,opt,name=sign,proto3" json:"sign,omitempty"` //签到(签到活动才有) + Dice *PlayRes_Dice `protobuf:"bytes,9,opt,name=dice,proto3" json:"dice,omitempty"` //大富翁(大富翁活动才有) + Grow *PlayRes_Grow `protobuf:"bytes,10,opt,name=grow,proto3" json:"grow,omitempty"` //农场(农场活动才有) + Chop *PlayRes_Chop `protobuf:"bytes,11,opt,name=chop,proto3" json:"chop,omitempty"` //砍一刀(砍一刀活动才有) + FissionId int64 `protobuf:"varint,12,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法Id + Task *PlayRes_Task `protobuf:"bytes,13,opt,name=task,proto3" json:"task,omitempty"` //用户任务 + Cash *PlayRes_Cash `protobuf:"bytes,14,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖(现金抽奖才有) + Clue []*PlayRes_Clue `protobuf:"bytes,15,rep,name=clue,proto3" json:"clue,omitempty"` //通知数据 + KeepDog *PlayRes_Keep `protobuf:"bytes,16,opt,name=keep_dog,json=keepDog,proto3" json:"keep_dog,omitempty"` //养狗数据 + Gold *PlayRes_Gold `protobuf:"bytes,17,opt,name=gold,proto3" json:"gold,omitempty"` //金币任务 + Coin *PlayRes_Coin `protobuf:"bytes,18,opt,name=coin,proto3" json:"coin,omitempty"` //瓜分金币 + Vs *PlayRes_Vs `protobuf:"bytes,19,opt,name=vs,proto3" json:"vs,omitempty"` //赛事竞猜 + Uno *PlayRes_Uno `protobuf:"bytes,20,opt,name=uno,proto3" json:"uno,omitempty"` //Uno卡牌 +} + +func (x *PlayRes) Reset() { + *x = PlayRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes) ProtoMessage() {} + +func (x *PlayRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 PlayRes.ProtoReflect.Descriptor instead. +func (*PlayRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7} +} + +func (x *PlayRes) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *PlayRes) GetParentUserId() string { + if x != nil { + return x.ParentUserId + } + return "" +} + +func (x *PlayRes) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *PlayRes) GetShareLink() string { + if x != nil { + return x.ShareLink + } + return "" +} + +func (x *PlayRes) GetChancePlayer() *PlayRes_ChancePlayer { + if x != nil { + return x.ChancePlayer + } + return nil +} + +func (x *PlayRes) GetInvitePlayer() *PlayRes_InvitePalyer { + if x != nil { + return x.InvitePlayer + } + return nil +} + +func (x *PlayRes) GetQuiz() *PlayRes_Quiz { + if x != nil { + return x.Quiz + } + return nil +} + +func (x *PlayRes) GetSign() *PlayRes_Sign { + if x != nil { + return x.Sign + } + return nil +} + +func (x *PlayRes) GetDice() *PlayRes_Dice { + if x != nil { + return x.Dice + } + return nil +} + +func (x *PlayRes) GetGrow() *PlayRes_Grow { + if x != nil { + return x.Grow + } + return nil +} + +func (x *PlayRes) GetChop() *PlayRes_Chop { + if x != nil { + return x.Chop + } + return nil +} + +func (x *PlayRes) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *PlayRes) GetTask() *PlayRes_Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *PlayRes) GetCash() *PlayRes_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *PlayRes) GetClue() []*PlayRes_Clue { + if x != nil { + return x.Clue + } + return nil +} + +func (x *PlayRes) GetKeepDog() *PlayRes_Keep { + if x != nil { + return x.KeepDog + } + return nil +} + +func (x *PlayRes) GetGold() *PlayRes_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *PlayRes) GetCoin() *PlayRes_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *PlayRes) GetVs() *PlayRes_Vs { + if x != nil { + return x.Vs + } + return nil +} + +func (x *PlayRes) GetUno() *PlayRes_Uno { + if x != nil { + return x.Uno + } + return nil +} + +type RewardUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,4,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *RewardUserReq) Reset() { + *x = RewardUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardUserReq) ProtoMessage() {} + +func (x *RewardUserReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 RewardUserReq.ProtoReflect.Descriptor instead. +func (*RewardUserReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{8} +} + +func (x *RewardUserReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *RewardUserReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *RewardUserReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *RewardUserReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type RewardUserRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*RewardUserRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *RewardUserRes) Reset() { + *x = RewardUserRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardUserRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardUserRes) ProtoMessage() {} + +func (x *RewardUserRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 RewardUserRes.ProtoReflect.Descriptor instead. +func (*RewardUserRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{9} +} + +func (x *RewardUserRes) GetList() []*RewardUserRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *RewardUserRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type InfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + SubUserId string `protobuf:"bytes,3,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //活动用户外部id +} + +func (x *InfoReq) Reset() { + *x = InfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoReq) ProtoMessage() {} + +func (x *InfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 InfoReq.ProtoReflect.Descriptor instead. +func (*InfoReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{10} +} + +func (x *InfoReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *InfoReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *InfoReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +type InfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //活动用户外部id + PsuId string `protobuf:"bytes,2,opt,name=psu_id,json=psuId,proto3" json:"psu_id,omitempty"` //上级用户id + DirectNum int64 `protobuf:"varint,3,opt,name=direct_num,json=directNum,proto3" json:"direct_num,omitempty"` //直接裂变 + IndirectNum int64 `protobuf:"varint,4,opt,name=indirect_num,json=indirectNum,proto3" json:"indirect_num,omitempty"` //间接裂变 + Rewards []*InfoRes_Reward `protobuf:"bytes,5,rep,name=rewards,proto3" json:"rewards,omitempty"` //中奖奖品 +} + +func (x *InfoRes) Reset() { + *x = InfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoRes) ProtoMessage() {} + +func (x *InfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 InfoRes.ProtoReflect.Descriptor instead. +func (*InfoRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{11} +} + +func (x *InfoRes) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *InfoRes) GetPsuId() string { + if x != nil { + return x.PsuId + } + return "" +} + +func (x *InfoRes) GetDirectNum() int64 { + if x != nil { + return x.DirectNum + } + return 0 +} + +func (x *InfoRes) GetIndirectNum() int64 { + if x != nil { + return x.IndirectNum + } + return 0 +} + +func (x *InfoRes) GetRewards() []*InfoRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type RankReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,4,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *RankReq) Reset() { + *x = RankReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankReq) ProtoMessage() {} + +func (x *RankReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 RankReq.ProtoReflect.Descriptor instead. +func (*RankReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{12} +} + +func (x *RankReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *RankReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *RankReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *RankReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type RankRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*RankRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 + Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` //类型(1-下载,2-注册,3-达标,4-邀请好友达标) +} + +func (x *RankRes) Reset() { + *x = RankRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankRes) ProtoMessage() {} + +func (x *RankRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 RankRes.ProtoReflect.Descriptor instead. +func (*RankRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{13} +} + +func (x *RankRes) GetList() []*RankRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *RankRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *RankRes) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +type LotteryReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *LotteryReq) Reset() { + *x = LotteryReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LotteryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LotteryReq) ProtoMessage() {} + +func (x *LotteryReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 LotteryReq.ProtoReflect.Descriptor instead. +func (*LotteryReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{14} +} + +func (x *LotteryReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *LotteryReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type LotteryRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + Win bool `protobuf:"varint,3,opt,name=win,proto3" json:"win,omitempty"` //是否中奖 + Img string `protobuf:"bytes,4,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + JumpUrl string `protobuf:"bytes,5,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + KvData []*LotteryRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器,4-提交表单) + RewardHashId string `protobuf:"bytes,8,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,10,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *LotteryRes) Reset() { + *x = LotteryRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LotteryRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LotteryRes) ProtoMessage() {} + +func (x *LotteryRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 LotteryRes.ProtoReflect.Descriptor instead. +func (*LotteryRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{15} +} + +func (x *LotteryRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LotteryRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LotteryRes) GetWin() bool { + if x != nil { + return x.Win + } + return false +} + +func (x *LotteryRes) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *LotteryRes) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *LotteryRes) GetKvData() []*LotteryRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *LotteryRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *LotteryRes) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *LotteryRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *LotteryRes) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *LotteryRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *LotteryRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *LotteryRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type AnswerReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + Submits []*AnswerReq_Submit `protobuf:"bytes,2,rep,name=submits,proto3" json:"submits,omitempty"` //提交的答案 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID + LangMark string `protobuf:"bytes,4,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //活动语言 +} + +func (x *AnswerReq) Reset() { + *x = AnswerReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerReq) ProtoMessage() {} + +func (x *AnswerReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 AnswerReq.ProtoReflect.Descriptor instead. +func (*AnswerReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{16} +} + +func (x *AnswerReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *AnswerReq) GetSubmits() []*AnswerReq_Submit { + if x != nil { + return x.Submits + } + return nil +} + +func (x *AnswerReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *AnswerReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type AnswerRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + Win bool `protobuf:"varint,3,opt,name=win,proto3" json:"win,omitempty"` //是否中奖 + Img string `protobuf:"bytes,4,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + KvData []*AnswerRes_KV `protobuf:"bytes,5,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `protobuf:"varint,6,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + Score int32 `protobuf:"varint,7,opt,name=score,proto3" json:"score,omitempty"` //获得的分数 + RewardHashId string `protobuf:"bytes,8,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,10,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + QaNum int32 `protobuf:"varint,14,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //答题数 + QaRightNum int32 `protobuf:"varint,15,opt,name=qa_right_num,json=qaRightNum,proto3" json:"qa_right_num,omitempty"` //正确数 +} + +func (x *AnswerRes) Reset() { + *x = AnswerRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerRes) ProtoMessage() {} + +func (x *AnswerRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 AnswerRes.ProtoReflect.Descriptor instead. +func (*AnswerRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{17} +} + +func (x *AnswerRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AnswerRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AnswerRes) GetWin() bool { + if x != nil { + return x.Win + } + return false +} + +func (x *AnswerRes) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *AnswerRes) GetKvData() []*AnswerRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *AnswerRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *AnswerRes) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *AnswerRes) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *AnswerRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *AnswerRes) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *AnswerRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *AnswerRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *AnswerRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *AnswerRes) GetQaNum() int32 { + if x != nil { + return x.QaNum + } + return 0 +} + +func (x *AnswerRes) GetQaRightNum() int32 { + if x != nil { + return x.QaRightNum + } + return 0 +} + +type AnswerHistoryReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID + RewardHashId string `protobuf:"bytes,2,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id +} + +func (x *AnswerHistoryReq) Reset() { + *x = AnswerHistoryReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerHistoryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerHistoryReq) ProtoMessage() {} + +func (x *AnswerHistoryReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 AnswerHistoryReq.ProtoReflect.Descriptor instead. +func (*AnswerHistoryReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{18} +} + +func (x *AnswerHistoryReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *AnswerHistoryReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +type AnswerHistoryRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*AnswerHistoryRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *AnswerHistoryRes) Reset() { + *x = AnswerHistoryRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerHistoryRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerHistoryRes) ProtoMessage() {} + +func (x *AnswerHistoryRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 AnswerHistoryRes.ProtoReflect.Descriptor instead. +func (*AnswerHistoryRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{19} +} + +func (x *AnswerHistoryRes) GetList() []*AnswerHistoryRes_One { + if x != nil { + return x.List + } + return nil +} + +type VoteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + OptionId int64 `protobuf:"varint,2,opt,name=option_id,json=optionId,proto3" json:"option_id,omitempty"` //选项id + VoteNum int32 `protobuf:"varint,3,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"` //投票数 + CampaignId int64 `protobuf:"varint,4,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID + ScheduleId int64 `protobuf:"varint,5,opt,name=schedule_id,json=scheduleId,proto3" json:"schedule_id,omitempty"` //赛程id + TeamId int64 `protobuf:"varint,6,opt,name=team_id,json=teamId,proto3" json:"team_id,omitempty"` //队伍id +} + +func (x *VoteReq) Reset() { + *x = VoteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VoteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteReq) ProtoMessage() {} + +func (x *VoteReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 VoteReq.ProtoReflect.Descriptor instead. +func (*VoteReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{20} +} + +func (x *VoteReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *VoteReq) GetOptionId() int64 { + if x != nil { + return x.OptionId + } + return 0 +} + +func (x *VoteReq) GetVoteNum() int32 { + if x != nil { + return x.VoteNum + } + return 0 +} + +func (x *VoteReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *VoteReq) GetScheduleId() int64 { + if x != nil { + return x.ScheduleId + } + return 0 +} + +func (x *VoteReq) GetTeamId() int64 { + if x != nil { + return x.TeamId + } + return 0 +} + +type VoteRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常,1-非投票时间无法投票,2-投票机会不足,3-积分不足,4-投票已达最大次数,5-投票失败) +} + +func (x *VoteRes) Reset() { + *x = VoteRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VoteRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteRes) ProtoMessage() {} + +func (x *VoteRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 VoteRes.ProtoReflect.Descriptor instead. +func (*VoteRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{21} +} + +func (x *VoteRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type NotifyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + RewardHashId string `protobuf:"bytes,2,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` //推送的数据 + Resp string `protobuf:"bytes,4,opt,name=resp,proto3" json:"resp,omitempty"` //客户端返回的内容 + CampaignId int64 `protobuf:"varint,5,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *NotifyReq) Reset() { + *x = NotifyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyReq) ProtoMessage() {} + +func (x *NotifyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 NotifyReq.ProtoReflect.Descriptor instead. +func (*NotifyReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{22} +} + +func (x *NotifyReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *NotifyReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *NotifyReq) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *NotifyReq) GetResp() string { + if x != nil { + return x.Resp + } + return "" +} + +func (x *NotifyReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type NotifyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NotifyRes) Reset() { + *x = NotifyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyRes) ProtoMessage() {} + +func (x *NotifyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_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 NotifyRes.ProtoReflect.Descriptor instead. +func (*NotifyRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{23} +} + +type AcceptRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + RewardHashId string `protobuf:"bytes,2,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id +} + +func (x *AcceptRewardReq) Reset() { + *x = AcceptRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcceptRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptRewardReq) ProtoMessage() {} + +func (x *AcceptRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[24] + 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 AcceptRewardReq.ProtoReflect.Descriptor instead. +func (*AcceptRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{24} +} + +func (x *AcceptRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *AcceptRewardReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +type AcceptRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AcceptRewardRes) Reset() { + *x = AcceptRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcceptRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptRewardRes) ProtoMessage() {} + +func (x *AcceptRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[25] + 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 AcceptRewardRes.ProtoReflect.Descriptor instead. +func (*AcceptRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{25} +} + +type TargetRuleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *TargetRuleReq) Reset() { + *x = TargetRuleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetRuleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetRuleReq) ProtoMessage() {} + +func (x *TargetRuleReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[26] + 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 TargetRuleReq.ProtoReflect.Descriptor instead. +func (*TargetRuleReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{26} +} + +func (x *TargetRuleReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *TargetRuleReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *TargetRuleReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *TargetRuleReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type TargetRuleRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*TargetRuleRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 + TargetNum int64 `protobuf:"varint,3,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标次数 +} + +func (x *TargetRuleRes) Reset() { + *x = TargetRuleRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetRuleRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetRuleRes) ProtoMessage() {} + +func (x *TargetRuleRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[27] + 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 TargetRuleRes.ProtoReflect.Descriptor instead. +func (*TargetRuleRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{27} +} + +func (x *TargetRuleRes) GetList() []*TargetRuleRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *TargetRuleRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *TargetRuleRes) GetTargetNum() int64 { + if x != nil { + return x.TargetNum + } + return 0 +} + +type TaskReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *TaskReq) Reset() { + *x = TaskReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskReq) ProtoMessage() {} + +func (x *TaskReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[28] + 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 TaskReq.ProtoReflect.Descriptor instead. +func (*TaskReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{28} +} + +func (x *TaskReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *TaskReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type TaskRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FixDay *TaskRes_Day `protobuf:"bytes,1,opt,name=fix_day,json=fixDay,proto3" json:"fix_day,omitempty"` //固定的每日任务 + Fixed *TaskRes_Fixed `protobuf:"bytes,2,opt,name=fixed,proto3" json:"fixed,omitempty"` //固定任务 + Custom *TaskRes_Custom `protobuf:"bytes,3,opt,name=custom,proto3" json:"custom,omitempty"` //自定义任务 + PreCond []int32 `protobuf:"varint,4,rep,packed,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //用户可触发的前置任务 +} + +func (x *TaskRes) Reset() { + *x = TaskRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes) ProtoMessage() {} + +func (x *TaskRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[29] + 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 TaskRes.ProtoReflect.Descriptor instead. +func (*TaskRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29} +} + +func (x *TaskRes) GetFixDay() *TaskRes_Day { + if x != nil { + return x.FixDay + } + return nil +} + +func (x *TaskRes) GetFixed() *TaskRes_Fixed { + if x != nil { + return x.Fixed + } + return nil +} + +func (x *TaskRes) GetCustom() *TaskRes_Custom { + if x != nil { + return x.Custom + } + return nil +} + +func (x *TaskRes) GetPreCond() []int32 { + if x != nil { + return x.PreCond + } + return nil +} + +type ResendReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardHashId string `protobuf:"bytes,1,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //奖品hash_id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id +} + +func (x *ResendReq) Reset() { + *x = ResendReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResendReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResendReq) ProtoMessage() {} + +func (x *ResendReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[30] + 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 ResendReq.ProtoReflect.Descriptor instead. +func (*ResendReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{30} +} + +func (x *ResendReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *ResendReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type ResendRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发送) + FailType string `protobuf:"bytes,2,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败原因标识(system-自己系统的问题,client-对方系统的问题,undefined-没有分析到的问题 + FailMsg string `protobuf:"bytes,3,opt,name=fail_msg,json=failMsg,proto3" json:"fail_msg,omitempty"` //失败具体原因说明 +} + +func (x *ResendRes) Reset() { + *x = ResendRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResendRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResendRes) ProtoMessage() {} + +func (x *ResendRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[31] + 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 ResendRes.ProtoReflect.Descriptor instead. +func (*ResendRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{31} +} + +func (x *ResendRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ResendRes) GetFailType() string { + if x != nil { + return x.FailType + } + return "" +} + +func (x *ResendRes) GetFailMsg() string { + if x != nil { + return x.FailMsg + } + return "" +} + +type DynamicLinkReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目 + SubUserId string `protobuf:"bytes,2,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //第三方用户id + MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` //动态数据类型(1-图文) + ImageText []*DynamicLinkReq_ImageText `protobuf:"bytes,4,rep,name=image_text,json=imageText,proto3" json:"image_text,omitempty"` //图文消息 + CampaignHashId string `protobuf:"bytes,5,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id +} + +func (x *DynamicLinkReq) Reset() { + *x = DynamicLinkReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DynamicLinkReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DynamicLinkReq) ProtoMessage() {} + +func (x *DynamicLinkReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[32] + 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 DynamicLinkReq.ProtoReflect.Descriptor instead. +func (*DynamicLinkReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{32} +} + +func (x *DynamicLinkReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *DynamicLinkReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *DynamicLinkReq) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *DynamicLinkReq) GetImageText() []*DynamicLinkReq_ImageText { + if x != nil { + return x.ImageText + } + return nil +} + +func (x *DynamicLinkReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type DynamicLinkRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LinkUrl string `protobuf:"bytes,1,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //链接地址 +} + +func (x *DynamicLinkRes) Reset() { + *x = DynamicLinkRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DynamicLinkRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DynamicLinkRes) ProtoMessage() {} + +func (x *DynamicLinkRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[33] + 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 DynamicLinkRes.ProtoReflect.Descriptor instead. +func (*DynamicLinkRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{33} +} + +func (x *DynamicLinkRes) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +type DylinkShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //动态链接hash_id +} + +func (x *DylinkShowReq) Reset() { + *x = DylinkShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DylinkShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DylinkShowReq) ProtoMessage() {} + +func (x *DylinkShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[34] + 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 DylinkShowReq.ProtoReflect.Descriptor instead. +func (*DylinkShowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{34} +} + +func (x *DylinkShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DylinkShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` //媒体类型 ImageText(图文) + ImageText []*DylinkShowRes_ImageText `protobuf:"bytes,2,rep,name=image_text,json=imageText,proto3" json:"image_text,omitempty"` //图文消息 +} + +func (x *DylinkShowRes) Reset() { + *x = DylinkShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DylinkShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DylinkShowRes) ProtoMessage() {} + +func (x *DylinkShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[35] + 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 DylinkShowRes.ProtoReflect.Descriptor instead. +func (*DylinkShowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{35} +} + +func (x *DylinkShowRes) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *DylinkShowRes) GetImageText() []*DylinkShowRes_ImageText { + if x != nil { + return x.ImageText + } + return nil +} + +type SignInReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + NowMouth string `protobuf:"bytes,2,opt,name=now_mouth,json=nowMouth,proto3" json:"now_mouth,omitempty"` //当前月 + PageType int32 `protobuf:"varint,3,opt,name=page_type,json=pageType,proto3" json:"page_type,omitempty"` //页面类型(0-当前月,1-下一个月,2-上一个月) + CampaignId int64 `protobuf:"varint,4,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *SignInReq) Reset() { + *x = SignInReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInReq) ProtoMessage() {} + +func (x *SignInReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[36] + 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 SignInReq.ProtoReflect.Descriptor instead. +func (*SignInReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{36} +} + +func (x *SignInReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *SignInReq) GetNowMouth() string { + if x != nil { + return x.NowMouth + } + return "" +} + +func (x *SignInReq) GetPageType() int32 { + if x != nil { + return x.PageType + } + return 0 +} + +func (x *SignInReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type SignInRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignDate []*SignInRes_SignDate `protobuf:"bytes,1,rep,name=sign_date,json=signDate,proto3" json:"sign_date,omitempty"` //签到板信息 + NowMouth string `protobuf:"bytes,2,opt,name=now_mouth,json=nowMouth,proto3" json:"now_mouth,omitempty"` //当前月 + CycleDate []*SignInRes_CycleDate `protobuf:"bytes,3,rep,name=cycle_date,json=cycleDate,proto3" json:"cycle_date,omitempty"` //周期签到板信息 +} + +func (x *SignInRes) Reset() { + *x = SignInRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInRes) ProtoMessage() {} + +func (x *SignInRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[37] + 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 SignInRes.ProtoReflect.Descriptor instead. +func (*SignInRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{37} +} + +func (x *SignInRes) GetSignDate() []*SignInRes_SignDate { + if x != nil { + return x.SignDate + } + return nil +} + +func (x *SignInRes) GetNowMouth() string { + if x != nil { + return x.NowMouth + } + return "" +} + +func (x *SignInRes) GetCycleDate() []*SignInRes_CycleDate { + if x != nil { + return x.CycleDate + } + return nil +} + +type SignReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + SignDate int64 `protobuf:"varint,2,opt,name=sign_date,json=signDate,proto3" json:"sign_date,omitempty"` //签到日期时间戳 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *SignReq) Reset() { + *x = SignReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignReq) ProtoMessage() {} + +func (x *SignReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[38] + 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 SignReq.ProtoReflect.Descriptor instead. +func (*SignReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{38} +} + +func (x *SignReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *SignReq) GetSignDate() int64 { + if x != nil { + return x.SignDate + } + return 0 +} + +func (x *SignReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type SignRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FailType int32 `protobuf:"varint,1,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败状态(0-签到成功,1-签到失败,2-补签卡不足,3-已签到,4-补签签到,5-活动未开启) + HasReward bool `protobuf:"varint,2,opt,name=has_reward,json=hasReward,proto3" json:"has_reward,omitempty"` //是否有礼物 + RewardTitle string `protobuf:"bytes,3,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + RewardNum int32 `protobuf:"varint,4,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //获得的奖品数量 + ImgUrl string `protobuf:"bytes,5,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + RewardId int64 `protobuf:"varint,6,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + KvData []*SignRes_KV `protobuf:"bytes,8,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 +} + +func (x *SignRes) Reset() { + *x = SignRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignRes) ProtoMessage() {} + +func (x *SignRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[39] + 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 SignRes.ProtoReflect.Descriptor instead. +func (*SignRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{39} +} + +func (x *SignRes) GetFailType() int32 { + if x != nil { + return x.FailType + } + return 0 +} + +func (x *SignRes) GetHasReward() bool { + if x != nil { + return x.HasReward + } + return false +} + +func (x *SignRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *SignRes) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *SignRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *SignRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *SignRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *SignRes) GetKvData() []*SignRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *SignRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +type DiceMapReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + MapHashId string `protobuf:"bytes,2,opt,name=map_hash_id,json=mapHashId,proto3" json:"map_hash_id,omitempty"` //渲染地图的最后一格id,不传是当前用户所在位置外后54格 + PrefixStep int32 `protobuf:"varint,3,opt,name=prefix_step,json=prefixStep,proto3" json:"prefix_step,omitempty"` //返回前面的格子数字 + GoShowStep int64 `protobuf:"varint,4,opt,name=go_show_step,json=goShowStep,proto3" json:"go_show_step,omitempty"` //用户多少步之前都要返回GO这格子 + CampaignId int64 `protobuf:"varint,5,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *DiceMapReq) Reset() { + *x = DiceMapReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceMapReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceMapReq) ProtoMessage() {} + +func (x *DiceMapReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[40] + 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 DiceMapReq.ProtoReflect.Descriptor instead. +func (*DiceMapReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{40} +} + +func (x *DiceMapReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *DiceMapReq) GetMapHashId() string { + if x != nil { + return x.MapHashId + } + return "" +} + +func (x *DiceMapReq) GetPrefixStep() int32 { + if x != nil { + return x.PrefixStep + } + return 0 +} + +func (x *DiceMapReq) GetGoShowStep() int64 { + if x != nil { + return x.GoShowStep + } + return 0 +} + +func (x *DiceMapReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type DiceMapRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DiceMapRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //奖品图片 +} + +func (x *DiceMapRes) Reset() { + *x = DiceMapRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceMapRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceMapRes) ProtoMessage() {} + +func (x *DiceMapRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[41] + 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 DiceMapRes.ProtoReflect.Descriptor instead. +func (*DiceMapRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{41} +} + +func (x *DiceMapRes) GetList() []*DiceMapRes_One { + if x != nil { + return x.List + } + return nil +} + +type DiceReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //道具标识(chance-再来一次,fixed_roll-固定点数) + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //道具值 + CampaignId int64 `protobuf:"varint,4,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *DiceReq) Reset() { + *x = DiceReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceReq) ProtoMessage() {} + +func (x *DiceReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[42] + 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 DiceReq.ProtoReflect.Descriptor instead. +func (*DiceReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{42} +} + +func (x *DiceReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *DiceReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *DiceReq) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +func (x *DiceReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type DiceRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FailType int32 `protobuf:"varint,1,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败状态(0-成功,1-骰子不足,2-道具不足) + MapHashId string `protobuf:"bytes,2,opt,name=map_hash_id,json=mapHashId,proto3" json:"map_hash_id,omitempty"` //地图id + RollNum int32 `protobuf:"varint,3,opt,name=roll_num,json=rollNum,proto3" json:"roll_num,omitempty"` //点数 + MarkType int32 `protobuf:"varint,4,opt,name=mark_type,json=markType,proto3" json:"mark_type,omitempty"` //格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几) + RewardTitle string `protobuf:"bytes,5,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,6,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + IsIntact bool `protobuf:"varint,7,opt,name=is_intact,json=isIntact,proto3" json:"is_intact,omitempty"` //是否是完整奖品 + Lack bool `protobuf:"varint,8,opt,name=lack,proto3" json:"lack,omitempty"` //奖品无库存 + RewardId int64 `protobuf:"varint,9,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品ID +} + +func (x *DiceRes) Reset() { + *x = DiceRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceRes) ProtoMessage() {} + +func (x *DiceRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[43] + 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 DiceRes.ProtoReflect.Descriptor instead. +func (*DiceRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{43} +} + +func (x *DiceRes) GetFailType() int32 { + if x != nil { + return x.FailType + } + return 0 +} + +func (x *DiceRes) GetMapHashId() string { + if x != nil { + return x.MapHashId + } + return "" +} + +func (x *DiceRes) GetRollNum() int32 { + if x != nil { + return x.RollNum + } + return 0 +} + +func (x *DiceRes) GetMarkType() int32 { + if x != nil { + return x.MarkType + } + return 0 +} + +func (x *DiceRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *DiceRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *DiceRes) GetIsIntact() bool { + if x != nil { + return x.IsIntact + } + return false +} + +func (x *DiceRes) GetLack() bool { + if x != nil { + return x.Lack + } + return false +} + +func (x *DiceRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +type GrowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 +} + +func (x *GrowReq) Reset() { + *x = GrowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowReq) ProtoMessage() {} + +func (x *GrowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[44] + 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 GrowReq.ProtoReflect.Descriptor instead. +func (*GrowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{44} +} + +func (x *GrowReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GrowReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *GrowReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type GrowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GetGrow bool `protobuf:"varint,1,opt,name=get_grow,json=getGrow,proto3" json:"get_grow,omitempty"` //是否需要领取生命体 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //名称 + Step int32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` //当前等级 + Num int32 `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"` //当前拥有道具值 + LvUpNum int32 `protobuf:"varint,5,opt,name=lv_up_num,json=lvUpNum,proto3" json:"lv_up_num,omitempty"` //升级需要的道具值 + DiffP string `protobuf:"bytes,6,opt,name=diff_p,json=diffP,proto3" json:"diff_p,omitempty"` //剩余进度(36.9%) + WillDie bool `protobuf:"varint,7,opt,name=will_die,json=willDie,proto3" json:"will_die,omitempty"` //是否将要死亡 + IsDie bool `protobuf:"varint,8,opt,name=is_die,json=isDie,proto3" json:"is_die,omitempty"` //是否已死亡 + MaxLv bool `protobuf:"varint,9,opt,name=max_lv,json=maxLv,proto3" json:"max_lv,omitempty"` //是否最高等级 + RewardTitle string `protobuf:"bytes,10,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + RewardUrl string `protobuf:"bytes,11,opt,name=reward_url,json=rewardUrl,proto3" json:"reward_url,omitempty"` //奖品图片 + Lack bool `protobuf:"varint,12,opt,name=lack,proto3" json:"lack,omitempty"` //奖品是否没有库存的 + RewardId int64 `protobuf:"varint,13,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品Id +} + +func (x *GrowRes) Reset() { + *x = GrowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowRes) ProtoMessage() {} + +func (x *GrowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[45] + 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 GrowRes.ProtoReflect.Descriptor instead. +func (*GrowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{45} +} + +func (x *GrowRes) GetGetGrow() bool { + if x != nil { + return x.GetGrow + } + return false +} + +func (x *GrowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *GrowRes) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *GrowRes) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *GrowRes) GetLvUpNum() int32 { + if x != nil { + return x.LvUpNum + } + return 0 +} + +func (x *GrowRes) GetDiffP() string { + if x != nil { + return x.DiffP + } + return "" +} + +func (x *GrowRes) GetWillDie() bool { + if x != nil { + return x.WillDie + } + return false +} + +func (x *GrowRes) GetIsDie() bool { + if x != nil { + return x.IsDie + } + return false +} + +func (x *GrowRes) GetMaxLv() bool { + if x != nil { + return x.MaxLv + } + return false +} + +func (x *GrowRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *GrowRes) GetRewardUrl() string { + if x != nil { + return x.RewardUrl + } + return "" +} + +func (x *GrowRes) GetLack() bool { + if x != nil { + return x.Lack + } + return false +} + +func (x *GrowRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +type GetGrowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //生命体名称 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *GetGrowReq) Reset() { + *x = GetGrowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGrowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGrowReq) ProtoMessage() {} + +func (x *GetGrowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[46] + 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 GetGrowReq.ProtoReflect.Descriptor instead. +func (*GetGrowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{46} +} + +func (x *GetGrowReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GetGrowReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *GetGrowReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type GetGrowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetGrowRes) Reset() { + *x = GetGrowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGrowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGrowRes) ProtoMessage() {} + +func (x *GetGrowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[47] + 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 GetGrowRes.ProtoReflect.Descriptor instead. +func (*GetGrowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{47} +} + +type FeedReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //饲养道具数量 +} + +func (x *FeedReq) Reset() { + *x = FeedReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeedReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeedReq) ProtoMessage() {} + +func (x *FeedReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[48] + 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 FeedReq.ProtoReflect.Descriptor instead. +func (*FeedReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{48} +} + +func (x *FeedReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *FeedReq) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type FeedRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FailType int32 `protobuf:"varint,1,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败类型(0-饲养成功,1-道具不足,2-不能继续升级,3-生命体死亡) + LvUp bool `protobuf:"varint,2,opt,name=lv_up,json=lvUp,proto3" json:"lv_up,omitempty"` //是否升级 + Step int32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` //当前等级 + UpStep int32 `protobuf:"varint,4,opt,name=up_step,json=upStep,proto3" json:"up_step,omitempty"` //升级后的等级 + HasReward int32 `protobuf:"varint,5,opt,name=has_reward,json=hasReward,proto3" json:"has_reward,omitempty"` //可领奖类型(0-无奖品,1-领奖,2-库存不足) + RewardTitle string `protobuf:"bytes,6,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + RewardUrl string `protobuf:"bytes,7,opt,name=reward_url,json=rewardUrl,proto3" json:"reward_url,omitempty"` //奖品图片 + RewardId int64 `protobuf:"varint,8,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品Id + ReceiveType int32 `protobuf:"varint,9,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + KvData []*FeedRes_KV `protobuf:"bytes,10,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Contact string `protobuf:"bytes,11,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 +} + +func (x *FeedRes) Reset() { + *x = FeedRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeedRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeedRes) ProtoMessage() {} + +func (x *FeedRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[49] + 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 FeedRes.ProtoReflect.Descriptor instead. +func (*FeedRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{49} +} + +func (x *FeedRes) GetFailType() int32 { + if x != nil { + return x.FailType + } + return 0 +} + +func (x *FeedRes) GetLvUp() bool { + if x != nil { + return x.LvUp + } + return false +} + +func (x *FeedRes) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *FeedRes) GetUpStep() int32 { + if x != nil { + return x.UpStep + } + return 0 +} + +func (x *FeedRes) GetHasReward() int32 { + if x != nil { + return x.HasReward + } + return 0 +} + +func (x *FeedRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *FeedRes) GetRewardUrl() string { + if x != nil { + return x.RewardUrl + } + return "" +} + +func (x *FeedRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *FeedRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *FeedRes) GetKvData() []*FeedRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *FeedRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +type GetFeedReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //领取饲养道具标识(auto-自动产生的道具) + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *GetFeedReq) Reset() { + *x = GetFeedReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFeedReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeedReq) ProtoMessage() {} + +func (x *GetFeedReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[50] + 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 GetFeedReq.ProtoReflect.Descriptor instead. +func (*GetFeedReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{50} +} + +func (x *GetFeedReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GetFeedReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *GetFeedReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type GetFeedRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetFeedRes) Reset() { + *x = GetFeedRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFeedRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeedRes) ProtoMessage() {} + +func (x *GetFeedRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[51] + 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 GetFeedRes.ProtoReflect.Descriptor instead. +func (*GetFeedRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{51} +} + +type GrowRecordReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Date string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"` //最后一组数据的日期 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *GrowRecordReq) Reset() { + *x = GrowRecordReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowRecordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowRecordReq) ProtoMessage() {} + +func (x *GrowRecordReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[52] + 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 GrowRecordReq.ProtoReflect.Descriptor instead. +func (*GrowRecordReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{52} +} + +func (x *GrowRecordReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GrowRecordReq) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *GrowRecordReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type GrowRecordRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*GrowRecordRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *GrowRecordRes) Reset() { + *x = GrowRecordRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowRecordRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowRecordRes) ProtoMessage() {} + +func (x *GrowRecordRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[53] + 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 GrowRecordRes.ProtoReflect.Descriptor instead. +func (*GrowRecordRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{53} +} + +func (x *GrowRecordRes) GetList() []*GrowRecordRes_One { + if x != nil { + return x.List + } + return nil +} + +type ContentLinkReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //内容标识(qa-问题类型,ballot-抽签,chop-砍一刀) + MarkId int64 `protobuf:"varint,3,opt,name=mark_id,json=markId,proto3" json:"mark_id,omitempty"` //id标识(qa-题目id,ballot-奖品id,chop-奖品id) + CampaignId int64 `protobuf:"varint,4,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *ContentLinkReq) Reset() { + *x = ContentLinkReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContentLinkReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContentLinkReq) ProtoMessage() {} + +func (x *ContentLinkReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[54] + 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 ContentLinkReq.ProtoReflect.Descriptor instead. +func (*ContentLinkReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{54} +} + +func (x *ContentLinkReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ContentLinkReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *ContentLinkReq) GetMarkId() int64 { + if x != nil { + return x.MarkId + } + return 0 +} + +func (x *ContentLinkReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ContentLinkRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LinkUrl string `protobuf:"bytes,1,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //分享链接 +} + +func (x *ContentLinkRes) Reset() { + *x = ContentLinkRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContentLinkRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContentLinkRes) ProtoMessage() {} + +func (x *ContentLinkRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[55] + 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 ContentLinkRes.ProtoReflect.Descriptor instead. +func (*ContentLinkRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{55} +} + +func (x *ContentLinkRes) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +type LinkContentReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CtId string `protobuf:"bytes,1,opt,name=ct_id,json=ctId,proto3" json:"ct_id,omitempty"` //内容hash_id +} + +func (x *LinkContentReq) Reset() { + *x = LinkContentReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentReq) ProtoMessage() {} + +func (x *LinkContentReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[56] + 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 LinkContentReq.ProtoReflect.Descriptor instead. +func (*LinkContentReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{56} +} + +func (x *LinkContentReq) GetCtId() string { + if x != nil { + return x.CtId + } + return "" +} + +type LinkContentRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //内容标识(qa-问题类型,ballot-抽签,chop-砍一刀) + Qa *LinkContentRes_Qa `protobuf:"bytes,2,opt,name=qa,proto3" json:"qa,omitempty"` //问题内容 + Ballot *LinkContentRes_Ballot `protobuf:"bytes,3,opt,name=ballot,proto3" json:"ballot,omitempty"` //抽签内容 + Chop *LinkContentRes_Chop `protobuf:"bytes,4,opt,name=chop,proto3" json:"chop,omitempty"` //砍一刀内容 +} + +func (x *LinkContentRes) Reset() { + *x = LinkContentRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentRes) ProtoMessage() {} + +func (x *LinkContentRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[57] + 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 LinkContentRes.ProtoReflect.Descriptor instead. +func (*LinkContentRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{57} +} + +func (x *LinkContentRes) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *LinkContentRes) GetQa() *LinkContentRes_Qa { + if x != nil { + return x.Qa + } + return nil +} + +func (x *LinkContentRes) GetBallot() *LinkContentRes_Ballot { + if x != nil { + return x.Ballot + } + return nil +} + +func (x *LinkContentRes) GetChop() *LinkContentRes_Chop { + if x != nil { + return x.Chop + } + return nil +} + +type ChopSelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *ChopSelectReq) Reset() { + *x = ChopSelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopSelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopSelectReq) ProtoMessage() {} + +func (x *ChopSelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[58] + 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 ChopSelectReq.ProtoReflect.Descriptor instead. +func (*ChopSelectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{58} +} + +func (x *ChopSelectReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChopSelectReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChopSelectReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ChopSelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChopSelectRes) Reset() { + *x = ChopSelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopSelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopSelectRes) ProtoMessage() {} + +func (x *ChopSelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[59] + 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 ChopSelectRes.ProtoReflect.Descriptor instead. +func (*ChopSelectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{59} +} + +type ChopReselectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChopRewardId int64 `protobuf:"varint,1,opt,name=chop_reward_id,json=chopRewardId,proto3" json:"chop_reward_id,omitempty"` //选择的奖品id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *ChopReselectReq) Reset() { + *x = ChopReselectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopReselectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopReselectReq) ProtoMessage() {} + +func (x *ChopReselectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[60] + 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 ChopReselectReq.ProtoReflect.Descriptor instead. +func (*ChopReselectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{60} +} + +func (x *ChopReselectReq) GetChopRewardId() int64 { + if x != nil { + return x.ChopRewardId + } + return 0 +} + +func (x *ChopReselectReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChopReselectReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ChopReselectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardNone bool `protobuf:"varint,1,opt,name=reward_none,json=rewardNone,proto3" json:"reward_none,omitempty"` //是否没有可选奖品了 +} + +func (x *ChopReselectRes) Reset() { + *x = ChopReselectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopReselectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopReselectRes) ProtoMessage() {} + +func (x *ChopReselectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[61] + 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 ChopReselectRes.ProtoReflect.Descriptor instead. +func (*ChopReselectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{61} +} + +func (x *ChopReselectRes) GetRewardNone() bool { + if x != nil { + return x.RewardNone + } + return false +} + +type ChopHelpReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,4,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *ChopHelpReq) Reset() { + *x = ChopHelpReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopHelpReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopHelpReq) ProtoMessage() {} + +func (x *ChopHelpReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[62] + 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 ChopHelpReq.ProtoReflect.Descriptor instead. +func (*ChopHelpReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{62} +} + +func (x *ChopHelpReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ChopHelpReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ChopHelpReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChopHelpReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ChopHelpRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ChopHelpRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ChopHelpRes) Reset() { + *x = ChopHelpRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopHelpRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopHelpRes) ProtoMessage() {} + +func (x *ChopHelpRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[63] + 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 ChopHelpRes.ProtoReflect.Descriptor instead. +func (*ChopHelpRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{63} +} + +func (x *ChopHelpRes) GetList() []*ChopHelpRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ChopHelpRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ProjectListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ProjectHashId string `protobuf:"bytes,3,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //活动id + Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,5,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 +} + +func (x *ProjectListReq) Reset() { + *x = ProjectListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectListReq) ProtoMessage() {} + +func (x *ProjectListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[64] + 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 ProjectListReq.ProtoReflect.Descriptor instead. +func (*ProjectListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{64} +} + +func (x *ProjectListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ProjectListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ProjectListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ProjectListReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ProjectListReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +type ProjectListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ProjectListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ProjectListRes) Reset() { + *x = ProjectListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectListRes) ProtoMessage() {} + +func (x *ProjectListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[65] + 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 ProjectListRes.ProtoReflect.Descriptor instead. +func (*ProjectListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{65} +} + +func (x *ProjectListRes) GetList() []*ProjectListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ProjectListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type LevelListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *LevelListReq) Reset() { + *x = LevelListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelListReq) ProtoMessage() {} + +func (x *LevelListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[66] + 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 LevelListReq.ProtoReflect.Descriptor instead. +func (*LevelListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{66} +} + +func (x *LevelListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type LevelListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*LevelListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *LevelListRes) Reset() { + *x = LevelListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelListRes) ProtoMessage() {} + +func (x *LevelListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[67] + 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 LevelListRes.ProtoReflect.Descriptor instead. +func (*LevelListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{67} +} + +func (x *LevelListRes) GetList() []*LevelListRes_One { + if x != nil { + return x.List + } + return nil +} + +type LevelStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //用户等级 + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //用户等级标识 +} + +func (x *LevelStoreReq) Reset() { + *x = LevelStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelStoreReq) ProtoMessage() {} + +func (x *LevelStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[68] + 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 LevelStoreReq.ProtoReflect.Descriptor instead. +func (*LevelStoreReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{68} +} + +func (x *LevelStoreReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *LevelStoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LevelStoreReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +type LevelStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LevelStoreRes) Reset() { + *x = LevelStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelStoreRes) ProtoMessage() {} + +func (x *LevelStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[69] + 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 LevelStoreRes.ProtoReflect.Descriptor instead. +func (*LevelStoreRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{69} +} + +type LevelEditReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户等级ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //用户等级 + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //用户等级标识 +} + +func (x *LevelEditReq) Reset() { + *x = LevelEditReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelEditReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelEditReq) ProtoMessage() {} + +func (x *LevelEditReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[70] + 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 LevelEditReq.ProtoReflect.Descriptor instead. +func (*LevelEditReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{70} +} + +func (x *LevelEditReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LevelEditReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LevelEditReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +type LevelEditRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LevelEditRes) Reset() { + *x = LevelEditRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelEditRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelEditRes) ProtoMessage() {} + +func (x *LevelEditRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[71] + 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 LevelEditRes.ProtoReflect.Descriptor instead. +func (*LevelEditRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{71} +} + +type LevelDestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户等级ID +} + +func (x *LevelDestroyReq) Reset() { + *x = LevelDestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelDestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelDestroyReq) ProtoMessage() {} + +func (x *LevelDestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[72] + 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 LevelDestroyReq.ProtoReflect.Descriptor instead. +func (*LevelDestroyReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{72} +} + +func (x *LevelDestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type LevelDestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LevelDestroyRes) Reset() { + *x = LevelDestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelDestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelDestroyRes) ProtoMessage() {} + +func (x *LevelDestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[73] + 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 LevelDestroyRes.ProtoReflect.Descriptor instead. +func (*LevelDestroyRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{73} +} + +type MarkLevelReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + Marks []string `protobuf:"bytes,2,rep,name=marks,proto3" json:"marks,omitempty"` //用不标识集合 +} + +func (x *MarkLevelReq) Reset() { + *x = MarkLevelReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkLevelReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkLevelReq) ProtoMessage() {} + +func (x *MarkLevelReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[74] + 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 MarkLevelReq.ProtoReflect.Descriptor instead. +func (*MarkLevelReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{74} +} + +func (x *MarkLevelReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *MarkLevelReq) GetMarks() []string { + if x != nil { + return x.Marks + } + return nil +} + +type MarkLevelRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*MarkLevelRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *MarkLevelRes) Reset() { + *x = MarkLevelRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkLevelRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkLevelRes) ProtoMessage() {} + +func (x *MarkLevelRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[75] + 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 MarkLevelRes.ProtoReflect.Descriptor instead. +func (*MarkLevelRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{75} +} + +func (x *MarkLevelRes) GetList() []*MarkLevelRes_One { + if x != nil { + return x.List + } + return nil +} + +type FinishStepReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Step string `protobuf:"bytes,2,opt,name=step,proto3" json:"step,omitempty"` //进度节点(open_gift-开奖奖品盒子,trigger_share-触发分享) + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *FinishStepReq) Reset() { + *x = FinishStepReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FinishStepReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinishStepReq) ProtoMessage() {} + +func (x *FinishStepReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[76] + 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 FinishStepReq.ProtoReflect.Descriptor instead. +func (*FinishStepReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{76} +} + +func (x *FinishStepReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *FinishStepReq) GetStep() string { + if x != nil { + return x.Step + } + return "" +} + +func (x *FinishStepReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type FinishStepRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenBox int32 `protobuf:"varint,1,opt,name=open_box,json=openBox,proto3" json:"open_box,omitempty"` //开奖金额 + LeftBox int32 `protobuf:"varint,2,opt,name=left_box,json=leftBox,proto3" json:"left_box,omitempty"` //左边的盒子金额 + RightBox int32 `protobuf:"varint,3,opt,name=right_box,json=rightBox,proto3" json:"right_box,omitempty"` //右边的盒子金额 +} + +func (x *FinishStepRes) Reset() { + *x = FinishStepRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FinishStepRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinishStepRes) ProtoMessage() {} + +func (x *FinishStepRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[77] + 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 FinishStepRes.ProtoReflect.Descriptor instead. +func (*FinishStepRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{77} +} + +func (x *FinishStepRes) GetOpenBox() int32 { + if x != nil { + return x.OpenBox + } + return 0 +} + +func (x *FinishStepRes) GetLeftBox() int32 { + if x != nil { + return x.LeftBox + } + return 0 +} + +func (x *FinishStepRes) GetRightBox() int32 { + if x != nil { + return x.RightBox + } + return 0 +} + +type SpinReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *SpinReq) Reset() { + *x = SpinReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SpinReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpinReq) ProtoMessage() {} + +func (x *SpinReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[78] + 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 SpinReq.ProtoReflect.Descriptor instead. +func (*SpinReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{78} +} + +func (x *SpinReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *SpinReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type SpinRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FailType int32 `protobuf:"varint,1,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败类型(0-正常,1-缺乏能量,2-库存不足) + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //转盘id +} + +func (x *SpinRes) Reset() { + *x = SpinRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[79] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SpinRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpinRes) ProtoMessage() {} + +func (x *SpinRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[79] + 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 SpinRes.ProtoReflect.Descriptor instead. +func (*SpinRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{79} +} + +func (x *SpinRes) GetFailType() int32 { + if x != nil { + return x.FailType + } + return 0 +} + +func (x *SpinRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type CashRecordsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` //记录类型(1-邀请,2-金额情况,3-能量情况,4-奖品记录) + CampaignId int64 `protobuf:"varint,5,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *CashRecordsReq) Reset() { + *x = CashRecordsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[80] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CashRecordsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CashRecordsReq) ProtoMessage() {} + +func (x *CashRecordsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[80] + 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 CashRecordsReq.ProtoReflect.Descriptor instead. +func (*CashRecordsReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{80} +} + +func (x *CashRecordsReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *CashRecordsReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *CashRecordsReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *CashRecordsReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *CashRecordsReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type CashRecordsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CashRecordsRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *CashRecordsRes) Reset() { + *x = CashRecordsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CashRecordsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CashRecordsRes) ProtoMessage() {} + +func (x *CashRecordsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[81] + 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 CashRecordsRes.ProtoReflect.Descriptor instead. +func (*CashRecordsRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{81} +} + +func (x *CashRecordsRes) GetList() []*CashRecordsRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *CashRecordsRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type MixRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *MixRewardReq) Reset() { + *x = MixRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[82] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MixRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MixRewardReq) ProtoMessage() {} + +func (x *MixRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[82] + 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 MixRewardReq.ProtoReflect.Descriptor instead. +func (*MixRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{82} +} + +func (x *MixRewardReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *MixRewardReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *MixRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type MixRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Lack bool `protobuf:"varint,1,opt,name=lack,proto3" json:"lack,omitempty"` //奖品无库存 + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品ID + RewardTitle string `protobuf:"bytes,3,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + ReceiveType int32 `protobuf:"varint,5,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + KvData []*MixRewardRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Contact string `protobuf:"bytes,7,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + RewardHashId string `protobuf:"bytes,8,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + OpenToUse int32 `protobuf:"varint,9,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,10,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,11,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,12,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *MixRewardRes) Reset() { + *x = MixRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[83] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MixRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MixRewardRes) ProtoMessage() {} + +func (x *MixRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[83] + 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 MixRewardRes.ProtoReflect.Descriptor instead. +func (*MixRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{83} +} + +func (x *MixRewardRes) GetLack() bool { + if x != nil { + return x.Lack + } + return false +} + +func (x *MixRewardRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *MixRewardRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *MixRewardRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *MixRewardRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *MixRewardRes) GetKvData() []*MixRewardRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *MixRewardRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *MixRewardRes) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *MixRewardRes) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *MixRewardRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *MixRewardRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *MixRewardRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type DiceRecordReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + UserHashId string `protobuf:"bytes,2,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //用户hash_id + RecordType int32 `protobuf:"varint,3,opt,name=record_type,json=recordType,proto3" json:"record_type,omitempty"` //记录类型(1-骰子记录,2-奖品记录) + Mark string `protobuf:"bytes,4,opt,name=mark,proto3" json:"mark,omitempty"` //记录标识 + Page int32 `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,6,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,7,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID + CampaignHashId string `protobuf:"bytes,8,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + Conds []int32 `protobuf:"varint,9,rep,packed,name=conds,proto3" json:"conds,omitempty"` //过滤条件(1-获得骰子;2-获得奖品;3-获得碎片;4-获得幸运骰;5-掷骰子;6-使用幸运骰子;7-完成任务;8-获得奖品) +} + +func (x *DiceRecordReq) Reset() { + *x = DiceRecordReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceRecordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceRecordReq) ProtoMessage() {} + +func (x *DiceRecordReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[84] + 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 DiceRecordReq.ProtoReflect.Descriptor instead. +func (*DiceRecordReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{84} +} + +func (x *DiceRecordReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *DiceRecordReq) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *DiceRecordReq) GetRecordType() int32 { + if x != nil { + return x.RecordType + } + return 0 +} + +func (x *DiceRecordReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *DiceRecordReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *DiceRecordReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *DiceRecordReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *DiceRecordReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DiceRecordReq) GetConds() []int32 { + if x != nil { + return x.Conds + } + return nil +} + +type DiceRecordRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DiceRecordRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *DiceRecordRes) Reset() { + *x = DiceRecordRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[85] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceRecordRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceRecordRes) ProtoMessage() {} + +func (x *DiceRecordRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[85] + 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 DiceRecordRes.ProtoReflect.Descriptor instead. +func (*DiceRecordRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{85} +} + +func (x *DiceRecordRes) GetList() []*DiceRecordRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *DiceRecordRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type RewardFormReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardHashId string `protobuf:"bytes,1,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //展示的语言 + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + UserId int64 `protobuf:"varint,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,5,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID + CampaignHashId string `protobuf:"bytes,6,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *RewardFormReq) Reset() { + *x = RewardFormReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[86] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardFormReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardFormReq) ProtoMessage() {} + +func (x *RewardFormReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[86] + 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 RewardFormReq.ProtoReflect.Descriptor instead. +func (*RewardFormReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{86} +} + +func (x *RewardFormReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *RewardFormReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *RewardFormReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *RewardFormReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *RewardFormReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *RewardFormReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type RewardFormRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsSubmit bool `protobuf:"varint,1,opt,name=is_submit,json=isSubmit,proto3" json:"is_submit,omitempty"` //是否已经填写表单 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //表单标题 + Items []*RewardFormRes_Item `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` //表单项 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //奖品记录id + RewardId int64 `protobuf:"varint,5,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id +} + +func (x *RewardFormRes) Reset() { + *x = RewardFormRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[87] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardFormRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardFormRes) ProtoMessage() {} + +func (x *RewardFormRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[87] + 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 RewardFormRes.ProtoReflect.Descriptor instead. +func (*RewardFormRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{87} +} + +func (x *RewardFormRes) GetIsSubmit() bool { + if x != nil { + return x.IsSubmit + } + return false +} + +func (x *RewardFormRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardFormRes) GetItems() []*RewardFormRes_Item { + if x != nil { + return x.Items + } + return nil +} + +func (x *RewardFormRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardFormRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +type SubmitFormReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardHashId string `protobuf:"bytes,1,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + Items []*SubmitFormReq_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` //表单项 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动ID +} + +func (x *SubmitFormReq) Reset() { + *x = SubmitFormReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[88] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitFormReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitFormReq) ProtoMessage() {} + +func (x *SubmitFormReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[88] + 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 SubmitFormReq.ProtoReflect.Descriptor instead. +func (*SubmitFormReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{88} +} + +func (x *SubmitFormReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *SubmitFormReq) GetItems() []*SubmitFormReq_Item { + if x != nil { + return x.Items + } + return nil +} + +func (x *SubmitFormReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type SubmitFormRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FailType int32 `protobuf:"varint,1,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //提交失败状态(0-提交成功,1-不能重复提交,2-表单参数异常,需要刷新表单,3-非需要填写表单奖品) +} + +func (x *SubmitFormRes) Reset() { + *x = SubmitFormRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[89] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitFormRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitFormRes) ProtoMessage() {} + +func (x *SubmitFormRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[89] + 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 SubmitFormRes.ProtoReflect.Descriptor instead. +func (*SubmitFormRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{89} +} + +func (x *SubmitFormRes) GetFailType() int32 { + if x != nil { + return x.FailType + } + return 0 +} + +type GetAdsUrlReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CondId int64 `protobuf:"varint,1,opt,name=cond_id,json=condId,proto3" json:"cond_id,omitempty"` //条件id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //条件id +} + +func (x *GetAdsUrlReq) Reset() { + *x = GetAdsUrlReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[90] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAdsUrlReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAdsUrlReq) ProtoMessage() {} + +func (x *GetAdsUrlReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[90] + 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 GetAdsUrlReq.ProtoReflect.Descriptor instead. +func (*GetAdsUrlReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{90} +} + +func (x *GetAdsUrlReq) GetCondId() int64 { + if x != nil { + return x.CondId + } + return 0 +} + +func (x *GetAdsUrlReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type GetAdsUrlRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` //广告地址 + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` //token + UserHashId string `protobuf:"bytes,3,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //用户hash_id + Event string `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,5,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,6,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + JumpTime int64 `protobuf:"varint,7,opt,name=jump_time,json=jumpTime,proto3" json:"jump_time,omitempty"` //跳转到时间 + AdG *GetAdsUrlRes_AdG `protobuf:"bytes,8,opt,name=ad_g,json=adG,proto3" json:"ad_g,omitempty"` //谷歌账号信息 +} + +func (x *GetAdsUrlRes) Reset() { + *x = GetAdsUrlRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[91] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAdsUrlRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAdsUrlRes) ProtoMessage() {} + +func (x *GetAdsUrlRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[91] + 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 GetAdsUrlRes.ProtoReflect.Descriptor instead. +func (*GetAdsUrlRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{91} +} + +func (x *GetAdsUrlRes) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *GetAdsUrlRes) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *GetAdsUrlRes) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *GetAdsUrlRes) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *GetAdsUrlRes) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *GetAdsUrlRes) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *GetAdsUrlRes) GetJumpTime() int64 { + if x != nil { + return x.JumpTime + } + return 0 +} + +func (x *GetAdsUrlRes) GetAdG() *GetAdsUrlRes_AdG { + if x != nil { + return x.AdG + } + return nil +} + +type AdsStayReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` //token + UserHashId string `protobuf:"bytes,2,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //用户hash_id + Event string `protobuf:"bytes,3,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,4,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,5,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + JumpTime int64 `protobuf:"varint,6,opt,name=jump_time,json=jumpTime,proto3" json:"jump_time,omitempty"` //跳转到时间 +} + +func (x *AdsStayReq) Reset() { + *x = AdsStayReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[92] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStayReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStayReq) ProtoMessage() {} + +func (x *AdsStayReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[92] + 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 AdsStayReq.ProtoReflect.Descriptor instead. +func (*AdsStayReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{92} +} + +func (x *AdsStayReq) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *AdsStayReq) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *AdsStayReq) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *AdsStayReq) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *AdsStayReq) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *AdsStayReq) GetJumpTime() int64 { + if x != nil { + return x.JumpTime + } + return 0 +} + +type AdsStayRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StayLave int32 `protobuf:"varint,1,opt,name=stay_lave,json=stayLave,proto3" json:"stay_lave,omitempty"` //剩余时长(单位:s) + Done bool `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"` //是否完成任务 +} + +func (x *AdsStayRes) Reset() { + *x = AdsStayRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[93] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsStayRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsStayRes) ProtoMessage() {} + +func (x *AdsStayRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[93] + 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 AdsStayRes.ProtoReflect.Descriptor instead. +func (*AdsStayRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{93} +} + +func (x *AdsStayRes) GetStayLave() int32 { + if x != nil { + return x.StayLave + } + return 0 +} + +func (x *AdsStayRes) GetDone() bool { + if x != nil { + return x.Done + } + return false +} + +type ClueNotifiedReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //跳转到时间 +} + +func (x *ClueNotifiedReq) Reset() { + *x = ClueNotifiedReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[94] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClueNotifiedReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClueNotifiedReq) ProtoMessage() {} + +func (x *ClueNotifiedReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[94] + 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 ClueNotifiedReq.ProtoReflect.Descriptor instead. +func (*ClueNotifiedReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{94} +} + +func (x *ClueNotifiedReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type ClueNotifiedRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClueNotifiedRes) Reset() { + *x = ClueNotifiedRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[95] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClueNotifiedRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClueNotifiedRes) ProtoMessage() {} + +func (x *ClueNotifiedRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[95] + 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 ClueNotifiedRes.ProtoReflect.Descriptor instead. +func (*ClueNotifiedRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{95} +} + +type ChangeUserLevelReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + SubUserId string `protobuf:"bytes,2,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //第三方的用户id + UserLevel string `protobuf:"bytes,3,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` //用户等级,多个用逗号分隔 +} + +func (x *ChangeUserLevelReq) Reset() { + *x = ChangeUserLevelReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[96] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeUserLevelReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeUserLevelReq) ProtoMessage() {} + +func (x *ChangeUserLevelReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[96] + 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 ChangeUserLevelReq.ProtoReflect.Descriptor instead. +func (*ChangeUserLevelReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{96} +} + +func (x *ChangeUserLevelReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ChangeUserLevelReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *ChangeUserLevelReq) GetUserLevel() string { + if x != nil { + return x.UserLevel + } + return "" +} + +type ChangeUserLevelRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeUserLevelRes) Reset() { + *x = ChangeUserLevelRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[97] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeUserLevelRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeUserLevelRes) ProtoMessage() {} + +func (x *ChangeUserLevelRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[97] + 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 ChangeUserLevelRes.ProtoReflect.Descriptor instead. +func (*ChangeUserLevelRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{97} +} + +type ChopRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *ChopRewardReq) Reset() { + *x = ChopRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[98] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopRewardReq) ProtoMessage() {} + +func (x *ChopRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[98] + 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 ChopRewardReq.ProtoReflect.Descriptor instead. +func (*ChopRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{98} +} + +func (x *ChopRewardReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChopRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type ChopRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*ChopRewardRes_Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品列表 +} + +func (x *ChopRewardRes) Reset() { + *x = ChopRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[99] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopRewardRes) ProtoMessage() {} + +func (x *ChopRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[99] + 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 ChopRewardRes.ProtoReflect.Descriptor instead. +func (*ChopRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{99} +} + +func (x *ChopRewardRes) GetRewards() []*ChopRewardRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type HelpPercentReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *HelpPercentReq) Reset() { + *x = HelpPercentReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[100] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelpPercentReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelpPercentReq) ProtoMessage() {} + +func (x *HelpPercentReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[100] + 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 HelpPercentReq.ProtoReflect.Descriptor instead. +func (*HelpPercentReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{100} +} + +func (x *HelpPercentReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *HelpPercentReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type HelpPercentRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsFix bool `protobuf:"varint,1,opt,name=is_fix,json=isFix,proto3" json:"is_fix,omitempty"` //是否是默认赠送的 + OldPercent float64 `protobuf:"fixed64,2,opt,name=old_percent,json=oldPercent,proto3" json:"old_percent,omitempty"` //追加前的进度 + AddPercent float64 `protobuf:"fixed64,3,opt,name=add_percent,json=addPercent,proto3" json:"add_percent,omitempty"` //追加进度 +} + +func (x *HelpPercentRes) Reset() { + *x = HelpPercentRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[101] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelpPercentRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelpPercentRes) ProtoMessage() {} + +func (x *HelpPercentRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[101] + 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 HelpPercentRes.ProtoReflect.Descriptor instead. +func (*HelpPercentRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{101} +} + +func (x *HelpPercentRes) GetIsFix() bool { + if x != nil { + return x.IsFix + } + return false +} + +func (x *HelpPercentRes) GetOldPercent() float64 { + if x != nil { + return x.OldPercent + } + return 0 +} + +func (x *HelpPercentRes) GetAddPercent() float64 { + if x != nil { + return x.AddPercent + } + return 0 +} + +type InvokeCondReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + PreCond int32 `protobuf:"varint,3,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) +} + +func (x *InvokeCondReq) Reset() { + *x = InvokeCondReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[102] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvokeCondReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvokeCondReq) ProtoMessage() {} + +func (x *InvokeCondReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[102] + 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 InvokeCondReq.ProtoReflect.Descriptor instead. +func (*InvokeCondReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{102} +} + +func (x *InvokeCondReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *InvokeCondReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *InvokeCondReq) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +type InvokeCondRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //达标条件ID + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //达标条件 + IfCond int32 `protobuf:"varint,3,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + Event string `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,5,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,6,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + TaskChance int32 `protobuf:"varint,7,opt,name=task_chance,json=taskChance,proto3" json:"task_chance,omitempty"` //完成发放的次数(如:骰子数) + WebUrl string `protobuf:"bytes,8,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端跳转地址 + AppParam string `protobuf:"bytes,9,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //app事件参数 + EventType int32 `protobuf:"varint,10,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,11,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + GoShow int32 `protobuf:"varint,12,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,13,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,14,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,15,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置任务(0-否,1-是) + Reward *InvokeCondRes_Reward `protobuf:"bytes,16,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,17,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + ExpiredSec int64 `protobuf:"varint,18,opt,name=expired_sec,json=expiredSec,proto3" json:"expired_sec,omitempty"` //距离过期还有多少秒 + PcParam string `protobuf:"bytes,19,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc事件参数 +} + +func (x *InvokeCondRes) Reset() { + *x = InvokeCondRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[103] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvokeCondRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvokeCondRes) ProtoMessage() {} + +func (x *InvokeCondRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[103] + 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 InvokeCondRes.ProtoReflect.Descriptor instead. +func (*InvokeCondRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{103} +} + +func (x *InvokeCondRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *InvokeCondRes) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *InvokeCondRes) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *InvokeCondRes) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *InvokeCondRes) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *InvokeCondRes) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *InvokeCondRes) GetTaskChance() int32 { + if x != nil { + return x.TaskChance + } + return 0 +} + +func (x *InvokeCondRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *InvokeCondRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *InvokeCondRes) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *InvokeCondRes) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *InvokeCondRes) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *InvokeCondRes) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *InvokeCondRes) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *InvokeCondRes) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *InvokeCondRes) GetReward() *InvokeCondRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *InvokeCondRes) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *InvokeCondRes) GetExpiredSec() int64 { + if x != nil { + return x.ExpiredSec + } + return 0 +} + +func (x *InvokeCondRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type KeepRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *KeepRewardReq) Reset() { + *x = KeepRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[104] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepRewardReq) ProtoMessage() {} + +func (x *KeepRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[104] + 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 KeepRewardReq.ProtoReflect.Descriptor instead. +func (*KeepRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{104} +} + +func (x *KeepRewardReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *KeepRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type KeepRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*KeepRewardRes_Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品列表 +} + +func (x *KeepRewardRes) Reset() { + *x = KeepRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[105] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepRewardRes) ProtoMessage() {} + +func (x *KeepRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[105] + 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 KeepRewardRes.ProtoReflect.Descriptor instead. +func (*KeepRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{105} +} + +func (x *KeepRewardRes) GetRewards() []*KeepRewardRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type KeepSelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *KeepSelectReq) Reset() { + *x = KeepSelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[106] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepSelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepSelectReq) ProtoMessage() {} + +func (x *KeepSelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[106] + 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 KeepSelectReq.ProtoReflect.Descriptor instead. +func (*KeepSelectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{106} +} + +func (x *KeepSelectReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *KeepSelectReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepSelectReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type KeepSelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常,1-奖品下架,2-库存不足,3-超过获取上限) +} + +func (x *KeepSelectRes) Reset() { + *x = KeepSelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[107] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepSelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepSelectRes) ProtoMessage() {} + +func (x *KeepSelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[107] + 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 KeepSelectRes.ProtoReflect.Descriptor instead. +func (*KeepSelectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{107} +} + +func (x *KeepSelectRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type KeepCollectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *KeepCollectReq) Reset() { + *x = KeepCollectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[108] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepCollectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepCollectReq) ProtoMessage() {} + +func (x *KeepCollectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[108] + 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 KeepCollectReq.ProtoReflect.Descriptor instead. +func (*KeepCollectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{108} +} + +func (x *KeepCollectReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepCollectReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type KeepCollectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Gets []*KeepCollectRes_Reward `protobuf:"bytes,1,rep,name=gets,proto3" json:"gets,omitempty"` //获得的奖励 + Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //收集的爱心数 +} + +func (x *KeepCollectRes) Reset() { + *x = KeepCollectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[109] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepCollectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepCollectRes) ProtoMessage() {} + +func (x *KeepCollectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[109] + 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 KeepCollectRes.ProtoReflect.Descriptor instead. +func (*KeepCollectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{109} +} + +func (x *KeepCollectRes) GetGets() []*KeepCollectRes_Reward { + if x != nil { + return x.Gets + } + return nil +} + +func (x *KeepCollectRes) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type KeepFeedReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *KeepFeedReq) Reset() { + *x = KeepFeedReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[110] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepFeedReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepFeedReq) ProtoMessage() {} + +func (x *KeepFeedReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[110] + 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 KeepFeedReq.ProtoReflect.Descriptor instead. +func (*KeepFeedReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{110} +} + +func (x *KeepFeedReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepFeedReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type KeepFeedRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常,1-请收爱心,2-狗粮不足) + AddPercent int32 `protobuf:"varint,2,opt,name=add_percent,json=addPercent,proto3" json:"add_percent,omitempty"` //获得的奖励 +} + +func (x *KeepFeedRes) Reset() { + *x = KeepFeedRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[111] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepFeedRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepFeedRes) ProtoMessage() {} + +func (x *KeepFeedRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[111] + 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 KeepFeedRes.ProtoReflect.Descriptor instead. +func (*KeepFeedRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{111} +} + +func (x *KeepFeedRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *KeepFeedRes) GetAddPercent() int32 { + if x != nil { + return x.AddPercent + } + return 0 +} + +type MachineSaveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Num float64 `protobuf:"fixed64,3,opt,name=num,proto3" json:"num,omitempty"` //道具数量 +} + +func (x *MachineSaveReq) Reset() { + *x = MachineSaveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[112] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineSaveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineSaveReq) ProtoMessage() {} + +func (x *MachineSaveReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[112] + 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 MachineSaveReq.ProtoReflect.Descriptor instead. +func (*MachineSaveReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{112} +} + +func (x *MachineSaveReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *MachineSaveReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *MachineSaveReq) GetNum() float64 { + if x != nil { + return x.Num + } + return 0 +} + +type MachineSaveRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MachineSaveRes) Reset() { + *x = MachineSaveRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[113] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineSaveRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineSaveRes) ProtoMessage() {} + +func (x *MachineSaveRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[113] + 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 MachineSaveRes.ProtoReflect.Descriptor instead. +func (*MachineSaveRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{113} +} + +type MachineRecycleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Num float64 `protobuf:"fixed64,3,opt,name=num,proto3" json:"num,omitempty"` //道具数量 +} + +func (x *MachineRecycleReq) Reset() { + *x = MachineRecycleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[114] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineRecycleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineRecycleReq) ProtoMessage() {} + +func (x *MachineRecycleReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[114] + 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 MachineRecycleReq.ProtoReflect.Descriptor instead. +func (*MachineRecycleReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{114} +} + +func (x *MachineRecycleReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *MachineRecycleReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *MachineRecycleReq) GetNum() float64 { + if x != nil { + return x.Num + } + return 0 +} + +type MachineRecycleRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MachineLimit int32 `protobuf:"varint,1,opt,name=machine_limit,json=machineLimit,proto3" json:"machine_limit,omitempty"` //机器被限制(0-正常,1-每日限制) + NextFull int64 `protobuf:"varint,2,opt,name=next_full,json=nextFull,proto3" json:"next_full,omitempty"` //离线狗粮机填满剩余秒数 + GetNum int32 `protobuf:"varint,3,opt,name=get_num,json=getNum,proto3" json:"get_num,omitempty"` //进入粮食袋的狗粮 +} + +func (x *MachineRecycleRes) Reset() { + *x = MachineRecycleRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[115] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineRecycleRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineRecycleRes) ProtoMessage() {} + +func (x *MachineRecycleRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[115] + 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 MachineRecycleRes.ProtoReflect.Descriptor instead. +func (*MachineRecycleRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{115} +} + +func (x *MachineRecycleRes) GetMachineLimit() int32 { + if x != nil { + return x.MachineLimit + } + return 0 +} + +func (x *MachineRecycleRes) GetNextFull() int64 { + if x != nil { + return x.NextFull + } + return 0 +} + +func (x *MachineRecycleRes) GetGetNum() int32 { + if x != nil { + return x.GetNum + } + return 0 +} + +type GetPropFeedReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *GetPropFeedReq) Reset() { + *x = GetPropFeedReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[116] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPropFeedReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPropFeedReq) ProtoMessage() {} + +func (x *GetPropFeedReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[116] + 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 GetPropFeedReq.ProtoReflect.Descriptor instead. +func (*GetPropFeedReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{116} +} + +func (x *GetPropFeedReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *GetPropFeedReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type GetPropFeedRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Num int32 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` //道具数量 +} + +func (x *GetPropFeedRes) Reset() { + *x = GetPropFeedRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[117] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPropFeedRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPropFeedRes) ProtoMessage() {} + +func (x *GetPropFeedRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[117] + 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 GetPropFeedRes.ProtoReflect.Descriptor instead. +func (*GetPropFeedRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{117} +} + +func (x *GetPropFeedRes) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type KeepLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Type []int32 `protobuf:"varint,5,rep,packed,name=type,proto3" json:"type,omitempty"` //类型 +} + +func (x *KeepLogReq) Reset() { + *x = KeepLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[118] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepLogReq) ProtoMessage() {} + +func (x *KeepLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[118] + 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 KeepLogReq.ProtoReflect.Descriptor instead. +func (*KeepLogReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{118} +} + +func (x *KeepLogReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *KeepLogReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *KeepLogReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepLogReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *KeepLogReq) GetType() []int32 { + if x != nil { + return x.Type + } + return nil +} + +type KeepLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*KeepLogRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *KeepLogRes) Reset() { + *x = KeepLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[119] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepLogRes) ProtoMessage() {} + +func (x *KeepLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[119] + 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 KeepLogRes.ProtoReflect.Descriptor instead. +func (*KeepLogRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{119} +} + +func (x *KeepLogRes) GetList() []*KeepLogRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *KeepLogRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type KeepReselectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *KeepReselectReq) Reset() { + *x = KeepReselectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[120] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepReselectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepReselectReq) ProtoMessage() {} + +func (x *KeepReselectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[120] + 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 KeepReselectReq.ProtoReflect.Descriptor instead. +func (*KeepReselectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{120} +} + +func (x *KeepReselectReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepReselectReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type KeepReselectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常,1-超过最大养成次数,2-当前宠物还能养) +} + +func (x *KeepReselectRes) Reset() { + *x = KeepReselectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[121] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepReselectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepReselectRes) ProtoMessage() {} + +func (x *KeepReselectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[121] + 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 KeepReselectRes.ProtoReflect.Descriptor instead. +func (*KeepReselectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{121} +} + +func (x *KeepReselectRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type KeepGuideReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *KeepGuideReq) Reset() { + *x = KeepGuideReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[122] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepGuideReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepGuideReq) ProtoMessage() {} + +func (x *KeepGuideReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[122] + 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 KeepGuideReq.ProtoReflect.Descriptor instead. +func (*KeepGuideReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{122} +} + +func (x *KeepGuideReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepGuideReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type KeepGuideRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardType int32 `protobuf:"varint,1,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖励类型(1-道具,2-奖品) + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,4,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + RewardImg string `protobuf:"bytes,5,opt,name=reward_img,json=rewardImg,proto3" json:"reward_img,omitempty"` //奖品图片 + Lack bool `protobuf:"varint,6,opt,name=lack,proto3" json:"lack,omitempty"` //奖品没有库存 + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-监听器,4-提交表单) +} + +func (x *KeepGuideRes) Reset() { + *x = KeepGuideRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[123] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepGuideRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepGuideRes) ProtoMessage() {} + +func (x *KeepGuideRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[123] + 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 KeepGuideRes.ProtoReflect.Descriptor instead. +func (*KeepGuideRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{123} +} + +func (x *KeepGuideRes) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *KeepGuideRes) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *KeepGuideRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *KeepGuideRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *KeepGuideRes) GetRewardImg() string { + if x != nil { + return x.RewardImg + } + return "" +} + +func (x *KeepGuideRes) GetLack() bool { + if x != nil { + return x.Lack + } + return false +} + +func (x *KeepGuideRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +type KeepFirstInviteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *KeepFirstInviteReq) Reset() { + *x = KeepFirstInviteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[124] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepFirstInviteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepFirstInviteReq) ProtoMessage() {} + +func (x *KeepFirstInviteReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[124] + 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 KeepFirstInviteReq.ProtoReflect.Descriptor instead. +func (*KeepFirstInviteReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{124} +} + +func (x *KeepFirstInviteReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *KeepFirstInviteReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type KeepFirstInviteRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenInvite int32 `protobuf:"varint,1,opt,name=open_invite,json=openInvite,proto3" json:"open_invite,omitempty"` //开启邀请(0-关闭,1-开启) + DayFirstInvite int32 `protobuf:"varint,2,opt,name=day_first_invite,json=dayFirstInvite,proto3" json:"day_first_invite,omitempty"` //当天是否还没完成第一次邀请(0-否,1-是) + DayFirstFeed int32 `protobuf:"varint,3,opt,name=day_first_feed,json=dayFirstFeed,proto3" json:"day_first_feed,omitempty"` //当天是否还没完成第一次喂养(0-否,1-是) + ExpiredSec int64 `protobuf:"varint,4,opt,name=expired_sec,json=expiredSec,proto3" json:"expired_sec,omitempty"` //过期剩余秒数 +} + +func (x *KeepFirstInviteRes) Reset() { + *x = KeepFirstInviteRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[125] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepFirstInviteRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepFirstInviteRes) ProtoMessage() {} + +func (x *KeepFirstInviteRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[125] + 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 KeepFirstInviteRes.ProtoReflect.Descriptor instead. +func (*KeepFirstInviteRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{125} +} + +func (x *KeepFirstInviteRes) GetOpenInvite() int32 { + if x != nil { + return x.OpenInvite + } + return 0 +} + +func (x *KeepFirstInviteRes) GetDayFirstInvite() int32 { + if x != nil { + return x.DayFirstInvite + } + return 0 +} + +func (x *KeepFirstInviteRes) GetDayFirstFeed() int32 { + if x != nil { + return x.DayFirstFeed + } + return 0 +} + +func (x *KeepFirstInviteRes) GetExpiredSec() int64 { + if x != nil { + return x.ExpiredSec + } + return 0 +} + +type ChildReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *ChildReq) Reset() { + *x = ChildReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[126] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildReq) ProtoMessage() {} + +func (x *ChildReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[126] + 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 ChildReq.ProtoReflect.Descriptor instead. +func (*ChildReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{126} +} + +func (x *ChildReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ChildReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type ChildRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blind *ChildRes_Blind `protobuf:"bytes,1,opt,name=blind,proto3" json:"blind,omitempty"` //每日盲盒 + Lucky *ChildRes_Lucky `protobuf:"bytes,2,opt,name=lucky,proto3" json:"lucky,omitempty"` //每日抽奖 + Sign *ChildRes_Sign `protobuf:"bytes,3,opt,name=sign,proto3" json:"sign,omitempty"` //签到抽奖 + Invite *ChildRes_Invite `protobuf:"bytes,4,opt,name=invite,proto3" json:"invite,omitempty"` //竞赛抽奖 +} + +func (x *ChildRes) Reset() { + *x = ChildRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[127] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes) ProtoMessage() {} + +func (x *ChildRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[127] + 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 ChildRes.ProtoReflect.Descriptor instead. +func (*ChildRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127} +} + +func (x *ChildRes) GetBlind() *ChildRes_Blind { + if x != nil { + return x.Blind + } + return nil +} + +func (x *ChildRes) GetLucky() *ChildRes_Lucky { + if x != nil { + return x.Lucky + } + return nil +} + +func (x *ChildRes) GetSign() *ChildRes_Sign { + if x != nil { + return x.Sign + } + return nil +} + +func (x *ChildRes) GetInvite() *ChildRes_Invite { + if x != nil { + return x.Invite + } + return nil +} + +type ChildActiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + ChildType int32 `protobuf:"varint,3,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务) +} + +func (x *ChildActiveReq) Reset() { + *x = ChildActiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[128] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildActiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildActiveReq) ProtoMessage() {} + +func (x *ChildActiveReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[128] + 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 ChildActiveReq.ProtoReflect.Descriptor instead. +func (*ChildActiveReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{128} +} + +func (x *ChildActiveReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ChildActiveReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChildActiveReq) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +type ChildActiveRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常,1-尚未结算) + Record *ChildActiveRes_Record `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` //奖品信息 +} + +func (x *ChildActiveRes) Reset() { + *x = ChildActiveRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[129] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildActiveRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildActiveRes) ProtoMessage() {} + +func (x *ChildActiveRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[129] + 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 ChildActiveRes.ProtoReflect.Descriptor instead. +func (*ChildActiveRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{129} +} + +func (x *ChildActiveRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildActiveRes) GetRecord() *ChildActiveRes_Record { + if x != nil { + return x.Record + } + return nil +} + +type GoldFinishStepReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + Step string `protobuf:"bytes,2,opt,name=step,proto3" json:"step,omitempty"` //进度节点(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, trigger_share-赠送能量) + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *GoldFinishStepReq) Reset() { + *x = GoldFinishStepReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[130] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldFinishStepReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldFinishStepReq) ProtoMessage() {} + +func (x *GoldFinishStepReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[130] + 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 GoldFinishStepReq.ProtoReflect.Descriptor instead. +func (*GoldFinishStepReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{130} +} + +func (x *GoldFinishStepReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GoldFinishStepReq) GetStep() string { + if x != nil { + return x.Step + } + return "" +} + +func (x *GoldFinishStepReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type GoldFinishStepRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenBox float64 `protobuf:"fixed64,1,opt,name=open_box,json=openBox,proto3" json:"open_box,omitempty"` //开奖金额 + LeftBox float64 `protobuf:"fixed64,2,opt,name=left_box,json=leftBox,proto3" json:"left_box,omitempty"` //左边的盒子金额 + RightBox float64 `protobuf:"fixed64,3,opt,name=right_box,json=rightBox,proto3" json:"right_box,omitempty"` //右边的盒子金额 +} + +func (x *GoldFinishStepRes) Reset() { + *x = GoldFinishStepRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[131] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldFinishStepRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldFinishStepRes) ProtoMessage() {} + +func (x *GoldFinishStepRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[131] + 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 GoldFinishStepRes.ProtoReflect.Descriptor instead. +func (*GoldFinishStepRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{131} +} + +func (x *GoldFinishStepRes) GetOpenBox() float64 { + if x != nil { + return x.OpenBox + } + return 0 +} + +func (x *GoldFinishStepRes) GetLeftBox() float64 { + if x != nil { + return x.LeftBox + } + return 0 +} + +func (x *GoldFinishStepRes) GetRightBox() float64 { + if x != nil { + return x.RightBox + } + return 0 +} + +type GoldNotifyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *GoldNotifyReq) Reset() { + *x = GoldNotifyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[132] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldNotifyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldNotifyReq) ProtoMessage() {} + +func (x *GoldNotifyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[132] + 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 GoldNotifyReq.ProtoReflect.Descriptor instead. +func (*GoldNotifyReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{132} +} + +func (x *GoldNotifyReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GoldNotifyReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type GoldNotifyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OldGold int32 `protobuf:"varint,1,opt,name=old_gold,json=oldGold,proto3" json:"old_gold,omitempty"` //追加前的进度 + AddGold int32 `protobuf:"varint,2,opt,name=add_gold,json=addGold,proto3" json:"add_gold,omitempty"` //追加进度 +} + +func (x *GoldNotifyRes) Reset() { + *x = GoldNotifyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[133] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldNotifyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldNotifyRes) ProtoMessage() {} + +func (x *GoldNotifyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[133] + 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 GoldNotifyRes.ProtoReflect.Descriptor instead. +func (*GoldNotifyRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{133} +} + +func (x *GoldNotifyRes) GetOldGold() int32 { + if x != nil { + return x.OldGold + } + return 0 +} + +func (x *GoldNotifyRes) GetAddGold() int32 { + if x != nil { + return x.AddGold + } + return 0 +} + +type GoldRecordReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,4,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 +} + +func (x *GoldRecordReq) Reset() { + *x = GoldRecordReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[134] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldRecordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldRecordReq) ProtoMessage() {} + +func (x *GoldRecordReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[134] + 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 GoldRecordReq.ProtoReflect.Descriptor instead. +func (*GoldRecordReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{134} +} + +func (x *GoldRecordReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GoldRecordReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *GoldRecordReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GoldRecordReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +type GoldRecordRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*GoldRecordRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *GoldRecordRes) Reset() { + *x = GoldRecordRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[135] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldRecordRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldRecordRes) ProtoMessage() {} + +func (x *GoldRecordRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[135] + 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 GoldRecordRes.ProtoReflect.Descriptor instead. +func (*GoldRecordRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{135} +} + +func (x *GoldRecordRes) GetList() []*GoldRecordRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *GoldRecordRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type DeductReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *DeductReq) Reset() { + *x = DeductReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[136] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeductReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeductReq) ProtoMessage() {} + +func (x *DeductReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[136] + 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 DeductReq.ProtoReflect.Descriptor instead. +func (*DeductReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{136} +} + +func (x *DeductReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *DeductReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type DeductRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //扣除状态(0-正常,1-缺积分,2-达到上限,3-当前场次已经结束,无法参加) + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //总奖池金币数 + UseNum int32 `protobuf:"varint,3,opt,name=use_num,json=useNum,proto3" json:"use_num,omitempty"` //参与了几次 + GetCoin int64 `protobuf:"varint,4,opt,name=get_coin,json=getCoin,proto3" json:"get_coin,omitempty"` //获得的金币数 + OpenSec int64 `protobuf:"varint,5,opt,name=open_sec,json=openSec,proto3" json:"open_sec,omitempty"` //距离开奖的秒数 +} + +func (x *DeductRes) Reset() { + *x = DeductRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[137] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeductRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeductRes) ProtoMessage() {} + +func (x *DeductRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[137] + 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 DeductRes.ProtoReflect.Descriptor instead. +func (*DeductRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{137} +} + +func (x *DeductRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *DeductRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *DeductRes) GetUseNum() int32 { + if x != nil { + return x.UseNum + } + return 0 +} + +func (x *DeductRes) GetGetCoin() int64 { + if x != nil { + return x.GetCoin + } + return 0 +} + +func (x *DeductRes) GetOpenSec() int64 { + if x != nil { + return x.OpenSec + } + return 0 +} + +type GainReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *GainReq) Reset() { + *x = GainReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[138] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GainReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GainReq) ProtoMessage() {} + +func (x *GainReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[138] + 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 GainReq.ProtoReflect.Descriptor instead. +func (*GainReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{138} +} + +func (x *GainReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GainReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type GainRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常;1-没到开奖时间;2-参与次数不足;3-领奖超时;4-已领取不能再领) + GetCoin int64 `protobuf:"varint,2,opt,name=get_coin,json=getCoin,proto3" json:"get_coin,omitempty"` //领取的积分数量 +} + +func (x *GainRes) Reset() { + *x = GainRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[139] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GainRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GainRes) ProtoMessage() {} + +func (x *GainRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[139] + 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 GainRes.ProtoReflect.Descriptor instead. +func (*GainRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{139} +} + +func (x *GainRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *GainRes) GetGetCoin() int64 { + if x != nil { + return x.GetCoin + } + return 0 +} + +type CoinRecordReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,3,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,5,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + SceneId int64 `protobuf:"varint,6,opt,name=scene_id,json=sceneId,proto3" json:"scene_id,omitempty"` //场次id + Type []int32 `protobuf:"varint,7,rep,packed,name=type,proto3" json:"type,omitempty"` //日志类型(1-消耗金币,2-获得金币,3-奖励) + Source string `protobuf:"bytes,8,opt,name=source,proto3" json:"source,omitempty"` //来源标识 + TOffset int32 `protobuf:"varint,9,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + Start int64 `protobuf:"varint,10,opt,name=start,proto3" json:"start,omitempty"` //创建时间开始时间戳 + End int64 `protobuf:"varint,11,opt,name=end,proto3" json:"end,omitempty"` //创建时间结束时间戳 + SubUserId string `protobuf:"bytes,12,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户id +} + +func (x *CoinRecordReq) Reset() { + *x = CoinRecordReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[140] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoinRecordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinRecordReq) ProtoMessage() {} + +func (x *CoinRecordReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[140] + 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 CoinRecordReq.ProtoReflect.Descriptor instead. +func (*CoinRecordReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{140} +} + +func (x *CoinRecordReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *CoinRecordReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *CoinRecordReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *CoinRecordReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *CoinRecordReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *CoinRecordReq) GetSceneId() int64 { + if x != nil { + return x.SceneId + } + return 0 +} + +func (x *CoinRecordReq) GetType() []int32 { + if x != nil { + return x.Type + } + return nil +} + +func (x *CoinRecordReq) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *CoinRecordReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *CoinRecordReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *CoinRecordReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *CoinRecordReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +type CoinRecordRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CoinRecordRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *CoinRecordRes) Reset() { + *x = CoinRecordRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[141] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoinRecordRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinRecordRes) ProtoMessage() {} + +func (x *CoinRecordRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[141] + 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 CoinRecordRes.ProtoReflect.Descriptor instead. +func (*CoinRecordRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{141} +} + +func (x *CoinRecordRes) GetList() []*CoinRecordRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *CoinRecordRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ChildListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + UserMark string `protobuf:"bytes,4,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,5,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,6,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + TOffset int32 `protobuf:"varint,7,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + PidType int32 `protobuf:"varint,8,opt,name=pid_type,json=pidType,proto3" json:"pid_type,omitempty"` //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + ParentUserMark string `protobuf:"bytes,9,opt,name=parent_user_mark,json=parentUserMark,proto3" json:"parent_user_mark,omitempty"` //上级用户标识关键字 +} + +func (x *ChildListReq) Reset() { + *x = ChildListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[142] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListReq) ProtoMessage() {} + +func (x *ChildListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[142] + 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 ChildListReq.ProtoReflect.Descriptor instead. +func (*ChildListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{142} +} + +func (x *ChildListReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *ChildListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ChildListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ChildListReq) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *ChildListReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ChildListReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *ChildListReq) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *ChildListReq) GetPidType() int32 { + if x != nil { + return x.PidType + } + return 0 +} + +func (x *ChildListReq) GetParentUserMark() string { + if x != nil { + return x.ParentUserMark + } + return "" +} + +type ChildListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ChildListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 + ChildType int32 `protobuf:"varint,3,opt,name=child_type,json=childType,proto3" json:"child_type,omitempty"` //子活动类型 + TOffset int32 `protobuf:"varint,4,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 +} + +func (x *ChildListRes) Reset() { + *x = ChildListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[143] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListRes) ProtoMessage() {} + +func (x *ChildListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[143] + 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 ChildListRes.ProtoReflect.Descriptor instead. +func (*ChildListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{143} +} + +func (x *ChildListRes) GetList() []*ChildListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ChildListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ChildListRes) GetChildType() int32 { + if x != nil { + return x.ChildType + } + return 0 +} + +func (x *ChildListRes) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +type ReceiveRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + TaskId int64 `protobuf:"varint,3,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` //任务id +} + +func (x *ReceiveRewardReq) Reset() { + *x = ReceiveRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[144] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReceiveRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReceiveRewardReq) ProtoMessage() {} + +func (x *ReceiveRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[144] + 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 ReceiveRewardReq.ProtoReflect.Descriptor instead. +func (*ReceiveRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{144} +} + +func (x *ReceiveRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ReceiveRewardReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ReceiveRewardReq) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +type ReceiveRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PropMark string `protobuf:"bytes,1,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //任务道具 + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //获得道具的数量 + Reward *ReceiveRewardRes_Reward `protobuf:"bytes,3,opt,name=reward,proto3" json:"reward,omitempty"` //奖品信息 +} + +func (x *ReceiveRewardRes) Reset() { + *x = ReceiveRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[145] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReceiveRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReceiveRewardRes) ProtoMessage() {} + +func (x *ReceiveRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[145] + 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 ReceiveRewardRes.ProtoReflect.Descriptor instead. +func (*ReceiveRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{145} +} + +func (x *ReceiveRewardRes) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ReceiveRewardRes) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ReceiveRewardRes) GetReward() *ReceiveRewardRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +type LotteryLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignHashId string `protobuf:"bytes,3,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id + UserHashId string `protobuf:"bytes,4,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //用户id + SubUserId string `protobuf:"bytes,5,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户id + Source []string `protobuf:"bytes,6,rep,name=source,proto3" json:"source,omitempty"` //记录标识(sign-每日签到,install-安装拉新任务,register-注册拉新任务,cond_all-完成配置任务,cond_one-完成指定任务,manual_cond_all-手动领取完成配置任务,manual_cond_one-手动领取完成的指定任务,lottery-抽奖) +} + +func (x *LotteryLogReq) Reset() { + *x = LotteryLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[146] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LotteryLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LotteryLogReq) ProtoMessage() {} + +func (x *LotteryLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[146] + 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 LotteryLogReq.ProtoReflect.Descriptor instead. +func (*LotteryLogReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{146} +} + +func (x *LotteryLogReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *LotteryLogReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *LotteryLogReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *LotteryLogReq) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *LotteryLogReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *LotteryLogReq) GetSource() []string { + if x != nil { + return x.Source + } + return nil +} + +type LotteryLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*LotteryLogRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *LotteryLogRes) Reset() { + *x = LotteryLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[147] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LotteryLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LotteryLogRes) ProtoMessage() {} + +func (x *LotteryLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[147] + 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 LotteryLogRes.ProtoReflect.Descriptor instead. +func (*LotteryLogRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{147} +} + +func (x *LotteryLogRes) GetList() []*LotteryLogRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *LotteryLogRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type UserListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` //用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *UserListReq) Reset() { + *x = UserListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[148] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListReq) ProtoMessage() {} + +func (x *UserListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[148] + 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 UserListReq.ProtoReflect.Descriptor instead. +func (*UserListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{148} +} + +func (x *UserListReq) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +func (x *UserListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type UserListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UserListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //数据集合 +} + +func (x *UserListRes) Reset() { + *x = UserListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[149] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListRes) ProtoMessage() {} + +func (x *UserListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[149] + 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 UserListRes.ProtoReflect.Descriptor instead. +func (*UserListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{149} +} + +func (x *UserListRes) GetList() []*UserListRes_One { + if x != nil { + return x.List + } + return nil +} + +type CashAgainReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id +} + +func (x *CashAgainReq) Reset() { + *x = CashAgainReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[150] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CashAgainReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CashAgainReq) ProtoMessage() {} + +func (x *CashAgainReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[150] + 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 CashAgainReq.ProtoReflect.Descriptor instead. +func (*CashAgainReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{150} +} + +func (x *CashAgainReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *CashAgainReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type CashAgainRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CashAgainRes) Reset() { + *x = CashAgainRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[151] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CashAgainRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CashAgainRes) ProtoMessage() {} + +func (x *CashAgainRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[151] + 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 CashAgainRes.ProtoReflect.Descriptor instead. +func (*CashAgainRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{151} +} + +type DiceCollectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户id +} + +func (x *DiceCollectReq) Reset() { + *x = DiceCollectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[152] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceCollectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceCollectReq) ProtoMessage() {} + +func (x *DiceCollectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[152] + 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 DiceCollectReq.ProtoReflect.Descriptor instead. +func (*DiceCollectReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{152} +} + +func (x *DiceCollectReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DiceCollectReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DiceCollectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DiceCollectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //数据集合 +} + +func (x *DiceCollectRes) Reset() { + *x = DiceCollectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[153] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceCollectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceCollectRes) ProtoMessage() {} + +func (x *DiceCollectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[153] + 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 DiceCollectRes.ProtoReflect.Descriptor instead. +func (*DiceCollectRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{153} +} + +func (x *DiceCollectRes) GetList() []*DiceCollectRes_One { + if x != nil { + return x.List + } + return nil +} + +type ClientRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //第三方用户id + PorjectHashId string `protobuf:"bytes,2,opt,name=porject_hash_id,json=porjectHashId,proto3" json:"porject_hash_id,omitempty"` //项目id + CampaignId int64 `protobuf:"varint,3,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignUserId int64 `protobuf:"varint,4,opt,name=campaign_user_id,json=campaignUserId,proto3" json:"campaign_user_id,omitempty"` //活动用户id +} + +func (x *ClientRewardReq) Reset() { + *x = ClientRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[154] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientRewardReq) ProtoMessage() {} + +func (x *ClientRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[154] + 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 ClientRewardReq.ProtoReflect.Descriptor instead. +func (*ClientRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{154} +} + +func (x *ClientRewardReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ClientRewardReq) GetPorjectHashId() string { + if x != nil { + return x.PorjectHashId + } + return "" +} + +func (x *ClientRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ClientRewardReq) GetCampaignUserId() int64 { + if x != nil { + return x.CampaignUserId + } + return 0 +} + +type ClientRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*ClientRewardRes_Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品集合 +} + +func (x *ClientRewardRes) Reset() { + *x = ClientRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[155] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientRewardRes) ProtoMessage() {} + +func (x *ClientRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[155] + 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 ClientRewardRes.ProtoReflect.Descriptor instead. +func (*ClientRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{155} +} + +func (x *ClientRewardRes) GetRewards() []*ClientRewardRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type PointsUseReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *PointsUseReq) Reset() { + *x = PointsUseReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[156] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointsUseReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointsUseReq) ProtoMessage() {} + +func (x *PointsUseReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[156] + 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 PointsUseReq.ProtoReflect.Descriptor instead. +func (*PointsUseReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{156} +} + +func (x *PointsUseReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *PointsUseReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type PointsUseRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-成功,1-积分不足,2-积分使用关闭,3-积分每日使用次数超限额,4-积分使用次数超限额) +} + +func (x *PointsUseRes) Reset() { + *x = PointsUseRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[157] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointsUseRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointsUseRes) ProtoMessage() {} + +func (x *PointsUseRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[157] + 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 PointsUseRes.ProtoReflect.Descriptor instead. +func (*PointsUseRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{157} +} + +func (x *PointsUseRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ChatReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + Input string `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"` //发送信息 +} + +func (x *ChatReq) Reset() { + *x = ChatReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[158] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatReq) ProtoMessage() {} + +func (x *ChatReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[158] + 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 ChatReq.ProtoReflect.Descriptor instead. +func (*ChatReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{158} +} + +func (x *ChatReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChatReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ChatReq) GetInput() string { + if x != nil { + return x.Input + } + return "" +} + +type ChatRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-成功,1-token不足,2-每日限制) + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` //内容 + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` //来源(input-输入,output-输出,system-系统) + MsgType int32 `protobuf:"varint,4,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` //消息类型(1-文本,2-固定文案,3-系统通知) + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + MsgId int64 `protobuf:"varint,6,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"` //消息id +} + +func (x *ChatRes) Reset() { + *x = ChatRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[159] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatRes) ProtoMessage() {} + +func (x *ChatRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[159] + 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 ChatRes.ProtoReflect.Descriptor instead. +func (*ChatRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{159} +} + +func (x *ChatRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChatRes) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *ChatRes) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *ChatRes) GetMsgType() int32 { + if x != nil { + return x.MsgType + } + return 0 +} + +func (x *ChatRes) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ChatRes) GetMsgId() int64 { + if x != nil { + return x.MsgId + } + return 0 +} + +type ChatListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + LastId int64 `protobuf:"varint,3,opt,name=last_id,json=lastId,proto3" json:"last_id,omitempty"` //最后一条记录id + PerPage int32 `protobuf:"varint,4,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 +} + +func (x *ChatListReq) Reset() { + *x = ChatListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[160] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatListReq) ProtoMessage() {} + +func (x *ChatListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[160] + 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 ChatListReq.ProtoReflect.Descriptor instead. +func (*ChatListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{160} +} + +func (x *ChatListReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChatListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ChatListReq) GetLastId() int64 { + if x != nil { + return x.LastId + } + return 0 +} + +func (x *ChatListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +type ChatListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ChatListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *ChatListRes) Reset() { + *x = ChatListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[161] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatListRes) ProtoMessage() {} + +func (x *ChatListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[161] + 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 ChatListRes.ProtoReflect.Descriptor instead. +func (*ChatListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{161} +} + +func (x *ChatListRes) GetList() []*ChatListRes_One { + if x != nil { + return x.List + } + return nil +} + +type ScheduleListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + TabType int32 `protobuf:"varint,3,opt,name=tab_type,json=tabType,proto3" json:"tab_type,omitempty"` //赛程类型(1-进行赛事,2-全部,3-已参与) +} + +func (x *ScheduleListReq) Reset() { + *x = ScheduleListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[162] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListReq) ProtoMessage() {} + +func (x *ScheduleListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[162] + 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 ScheduleListReq.ProtoReflect.Descriptor instead. +func (*ScheduleListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{162} +} + +func (x *ScheduleListReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ScheduleListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ScheduleListReq) GetTabType() int32 { + if x != nil { + return x.TabType + } + return 0 +} + +type ScheduleListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ScheduleListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *ScheduleListRes) Reset() { + *x = ScheduleListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[163] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes) ProtoMessage() {} + +func (x *ScheduleListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[163] + 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 ScheduleListRes.ProtoReflect.Descriptor instead. +func (*ScheduleListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163} +} + +func (x *ScheduleListRes) GetList() []*ScheduleListRes_One { + if x != nil { + return x.List + } + return nil +} + +type MallListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *MallListReq) Reset() { + *x = MallListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[164] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MallListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MallListReq) ProtoMessage() {} + +func (x *MallListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[164] + 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 MallListReq.ProtoReflect.Descriptor instead. +func (*MallListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{164} +} + +func (x *MallListReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *MallListReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type MallListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*MallListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *MallListRes) Reset() { + *x = MallListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[165] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MallListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MallListRes) ProtoMessage() {} + +func (x *MallListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[165] + 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 MallListRes.ProtoReflect.Descriptor instead. +func (*MallListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{165} +} + +func (x *MallListRes) GetList() []*MallListRes_One { + if x != nil { + return x.List + } + return nil +} + +type ExchangeReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + MallItemId int64 `protobuf:"varint,3,opt,name=mall_item_id,json=mallItemId,proto3" json:"mall_item_id,omitempty"` //商城商品id +} + +func (x *ExchangeReq) Reset() { + *x = ExchangeReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[166] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeReq) ProtoMessage() {} + +func (x *ExchangeReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[166] + 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 ExchangeReq.ProtoReflect.Descriptor instead. +func (*ExchangeReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{166} +} + +func (x *ExchangeReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ExchangeReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *ExchangeReq) GetMallItemId() int64 { + if x != nil { + return x.MallItemId + } + return 0 +} + +type ExchangeRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-成功,1-库存不足,2-兑换上限,3-商品已下架) + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //兑换记录id + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,5,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + KvData []*ExchangeRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品对应的键值数据 + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + Contact string `protobuf:"bytes,8,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,9,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + CustomRewardVal string `protobuf:"bytes,10,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义数据 + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + FailType string `protobuf:"bytes,14,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败类型 + FailMsg string `protobuf:"bytes,15,opt,name=fail_msg,json=failMsg,proto3" json:"fail_msg,omitempty"` //失败具体原因 +} + +func (x *ExchangeRes) Reset() { + *x = ExchangeRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[167] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeRes) ProtoMessage() {} + +func (x *ExchangeRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[167] + 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 ExchangeRes.ProtoReflect.Descriptor instead. +func (*ExchangeRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{167} +} + +func (x *ExchangeRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ExchangeRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ExchangeRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ExchangeRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ExchangeRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ExchangeRes) GetKvData() []*ExchangeRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ExchangeRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ExchangeRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ExchangeRes) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ExchangeRes) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *ExchangeRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ExchangeRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ExchangeRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ExchangeRes) GetFailType() string { + if x != nil { + return x.FailType + } + return "" +} + +func (x *ExchangeRes) GetFailMsg() string { + if x != nil { + return x.FailMsg + } + return "" +} + +type VoteListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserHashId string `protobuf:"bytes,1,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //活动用户id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id +} + +func (x *VoteListReq) Reset() { + *x = VoteListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[168] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VoteListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteListReq) ProtoMessage() {} + +func (x *VoteListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[168] + 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 VoteListReq.ProtoReflect.Descriptor instead. +func (*VoteListReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{168} +} + +func (x *VoteListReq) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *VoteListReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type VoteListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*VoteListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //投票列表 +} + +func (x *VoteListRes) Reset() { + *x = VoteListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[169] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VoteListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteListRes) ProtoMessage() {} + +func (x *VoteListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[169] + 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 VoteListRes.ProtoReflect.Descriptor instead. +func (*VoteListRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{169} +} + +func (x *VoteListRes) GetList() []*VoteListRes_One { + if x != nil { + return x.List + } + return nil +} + +type VsTipRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *VsTipRewardReq) Reset() { + *x = VsTipRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[170] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsTipRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsTipRewardReq) ProtoMessage() {} + +func (x *VsTipRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[170] + 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 VsTipRewardReq.ProtoReflect.Descriptor instead. +func (*VsTipRewardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{170} +} + +func (x *VsTipRewardReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *VsTipRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type VsTipRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *VsTipRewardRes) Reset() { + *x = VsTipRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[171] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VsTipRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VsTipRewardRes) ProtoMessage() {} + +func (x *VsTipRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[171] + 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 VsTipRewardRes.ProtoReflect.Descriptor instead. +func (*VsTipRewardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{171} +} + +type UnoRandCardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + PropMark string `protobuf:"bytes,3,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //道具类型(three- +3道具,five- +5道具, fix-固定道具) + ColorMark string `protobuf:"bytes,4,opt,name=color_mark,json=colorMark,proto3" json:"color_mark,omitempty"` //道具颜色类型(red-红,green-绿,blue-蓝,yellow-黄) +} + +func (x *UnoRandCardReq) Reset() { + *x = UnoRandCardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[172] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoRandCardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoRandCardReq) ProtoMessage() {} + +func (x *UnoRandCardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[172] + 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 UnoRandCardReq.ProtoReflect.Descriptor instead. +func (*UnoRandCardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{172} +} + +func (x *UnoRandCardReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UnoRandCardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *UnoRandCardReq) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *UnoRandCardReq) GetColorMark() string { + if x != nil { + return x.ColorMark + } + return "" +} + +type UnoRandCardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-成功,1- 抽奖次数不足,2-道具不足,3-道具不存在) + Cards []*UnoRandCardRes_Card `protobuf:"bytes,2,rep,name=cards,proto3" json:"cards,omitempty"` //获得的牌牌 +} + +func (x *UnoRandCardRes) Reset() { + *x = UnoRandCardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[173] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoRandCardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoRandCardRes) ProtoMessage() {} + +func (x *UnoRandCardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[173] + 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 UnoRandCardRes.ProtoReflect.Descriptor instead. +func (*UnoRandCardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{173} +} + +func (x *UnoRandCardRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UnoRandCardRes) GetCards() []*UnoRandCardRes_Card { + if x != nil { + return x.Cards + } + return nil +} + +type UnoClaimReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + ColorMark string `protobuf:"bytes,3,opt,name=color_mark,json=colorMark,proto3" json:"color_mark,omitempty"` //道具颜色类型(red-红,green-绿,blue-蓝,yellow-黄) +} + +func (x *UnoClaimReq) Reset() { + *x = UnoClaimReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[174] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoClaimReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoClaimReq) ProtoMessage() {} + +func (x *UnoClaimReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[174] + 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 UnoClaimReq.ProtoReflect.Descriptor instead. +func (*UnoClaimReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{174} +} + +func (x *UnoClaimReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UnoClaimReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *UnoClaimReq) GetColorMark() string { + if x != nil { + return x.ColorMark + } + return "" +} + +type UnoClaimRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-成功,1-正在收集中,2-已经收集过了) + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //记录id + HashId string `protobuf:"bytes,3,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //记录hash_id + RewardId int64 `protobuf:"varint,4,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,6,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + KvData []*UnoClaimRes_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品对应的键值数据 + ReceiveType int32 `protobuf:"varint,8,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,10,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + CustomRewardVal string `protobuf:"bytes,11,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义数据 + WebUrl string `protobuf:"bytes,12,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,13,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,14,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *UnoClaimRes) Reset() { + *x = UnoClaimRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[175] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoClaimRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoClaimRes) ProtoMessage() {} + +func (x *UnoClaimRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[175] + 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 UnoClaimRes.ProtoReflect.Descriptor instead. +func (*UnoClaimRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{175} +} + +func (x *UnoClaimRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UnoClaimRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UnoClaimRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UnoClaimRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *UnoClaimRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UnoClaimRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UnoClaimRes) GetKvData() []*UnoClaimRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *UnoClaimRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *UnoClaimRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *UnoClaimRes) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *UnoClaimRes) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *UnoClaimRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *UnoClaimRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *UnoClaimRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type UnoCardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserHashId string `protobuf:"bytes,1,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //活动用户id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id +} + +func (x *UnoCardReq) Reset() { + *x = UnoCardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[176] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoCardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoCardReq) ProtoMessage() {} + +func (x *UnoCardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[176] + 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 UnoCardReq.ProtoReflect.Descriptor instead. +func (*UnoCardReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{176} +} + +func (x *UnoCardReq) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *UnoCardReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type UnoCardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UnoCardRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //投票列表 +} + +func (x *UnoCardRes) Reset() { + *x = UnoCardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[177] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoCardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoCardRes) ProtoMessage() {} + +func (x *UnoCardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[177] + 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 UnoCardRes.ProtoReflect.Descriptor instead. +func (*UnoCardRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{177} +} + +func (x *UnoCardRes) GetList() []*UnoCardRes_One { + if x != nil { + return x.List + } + return nil +} + +type ShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserHashId string `protobuf:"bytes,1,opt,name=user_hash_id,json=userHashId,proto3" json:"user_hash_id,omitempty"` //活动用户id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id +} + +func (x *ShowReq) Reset() { + *x = ShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[178] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowReq) ProtoMessage() {} + +func (x *ShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[178] + 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 ShowReq.ProtoReflect.Descriptor instead. +func (*ShowReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{178} +} + +func (x *ShowReq) GetUserHashId() string { + if x != nil { + return x.UserHashId + } + return "" +} + +func (x *ShowReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type ShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户列表对外id + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //第三方用户id + DeviceId string `protobuf:"bytes,4,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //设备id + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //参与时间 + Source int32 `protobuf:"varint,6,opt,name=source,proto3" json:"source,omitempty"` //参与来源 + LangMark string `protobuf:"bytes,7,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + LangMarks []string `protobuf:"bytes,8,rep,name=lang_marks,json=langMarks,proto3" json:"lang_marks,omitempty"` //历史关联语言 + LvMark string `protobuf:"bytes,9,opt,name=lv_mark,json=lvMark,proto3" json:"lv_mark,omitempty"` //用户标签 + LvMarks string `protobuf:"bytes,10,opt,name=lv_marks,json=lvMarks,proto3" json:"lv_marks,omitempty"` //历史用户标签 + Os string `protobuf:"bytes,11,opt,name=os,proto3" json:"os,omitempty"` //操作系统 + Oss string `protobuf:"bytes,12,opt,name=oss,proto3" json:"oss,omitempty"` //历史操作系统 + JoinAt int64 `protobuf:"varint,13,opt,name=join_at,json=joinAt,proto3" json:"join_at,omitempty"` //首次访问时间 + JoinAtLast int64 `protobuf:"varint,14,opt,name=join_at_last,json=joinAtLast,proto3" json:"join_at_last,omitempty"` //最后访问时间 + Tz int32 `protobuf:"varint,15,opt,name=tz,proto3" json:"tz,omitempty"` //所属时区 +} + +func (x *ShowRes) Reset() { + *x = ShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[179] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes) ProtoMessage() {} + +func (x *ShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[179] + 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 ShowRes.ProtoReflect.Descriptor instead. +func (*ShowRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{179} +} + +func (x *ShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ShowRes) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ShowRes) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *ShowRes) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ShowRes) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *ShowRes) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ShowRes) GetLangMarks() []string { + if x != nil { + return x.LangMarks + } + return nil +} + +func (x *ShowRes) GetLvMark() string { + if x != nil { + return x.LvMark + } + return "" +} + +func (x *ShowRes) GetLvMarks() string { + if x != nil { + return x.LvMarks + } + return "" +} + +func (x *ShowRes) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *ShowRes) GetOss() string { + if x != nil { + return x.Oss + } + return "" +} + +func (x *ShowRes) GetJoinAt() int64 { + if x != nil { + return x.JoinAt + } + return 0 +} + +func (x *ShowRes) GetJoinAtLast() int64 { + if x != nil { + return x.JoinAtLast + } + return 0 +} + +func (x *ShowRes) GetTz() int32 { + if x != nil { + return x.Tz + } + return 0 +} + +type EventFirstVisitReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *EventFirstVisitReq) Reset() { + *x = EventFirstVisitReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[180] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFirstVisitReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFirstVisitReq) ProtoMessage() {} + +func (x *EventFirstVisitReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[180] + 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 EventFirstVisitReq.ProtoReflect.Descriptor instead. +func (*EventFirstVisitReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{180} +} + +func (x *EventFirstVisitReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *EventFirstVisitReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type EventFirstVisitRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*EventFirstVisitRes_EventReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖励 +} + +func (x *EventFirstVisitRes) Reset() { + *x = EventFirstVisitRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[181] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFirstVisitRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFirstVisitRes) ProtoMessage() {} + +func (x *EventFirstVisitRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[181] + 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 EventFirstVisitRes.ProtoReflect.Descriptor instead. +func (*EventFirstVisitRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{181} +} + +func (x *EventFirstVisitRes) GetRewards() []*EventFirstVisitRes_EventReward { + if x != nil { + return x.Rewards + } + return nil +} + +type FindByUniqReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + SubUserId string `protobuf:"bytes,2,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户id + DeviceId string `protobuf:"bytes,3,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //设备id +} + +func (x *FindByUniqReq) Reset() { + *x = FindByUniqReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[182] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindByUniqReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindByUniqReq) ProtoMessage() {} + +func (x *FindByUniqReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[182] + 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 FindByUniqReq.ProtoReflect.Descriptor instead. +func (*FindByUniqReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{182} +} + +func (x *FindByUniqReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *FindByUniqReq) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *FindByUniqReq) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +type FindByUniqRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id +} + +func (x *FindByUniqRes) Reset() { + *x = FindByUniqRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[183] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindByUniqRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindByUniqRes) ProtoMessage() {} + +func (x *FindByUniqRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[183] + 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 FindByUniqRes.ProtoReflect.Descriptor instead. +func (*FindByUniqRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{183} +} + +func (x *FindByUniqRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type TaskTipReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id +} + +func (x *TaskTipReq) Reset() { + *x = TaskTipReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[184] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipReq) ProtoMessage() {} + +func (x *TaskTipReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[184] + 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 TaskTipReq.ProtoReflect.Descriptor instead. +func (*TaskTipReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{184} +} + +func (x *TaskTipReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *TaskTipReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type TaskTipRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*TaskTipRes_EventReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖励 + L int32 `protobuf:"varint,2,opt,name=l,proto3" json:"l,omitempty"` //长度 +} + +func (x *TaskTipRes) Reset() { + *x = TaskTipRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[185] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipRes) ProtoMessage() {} + +func (x *TaskTipRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[185] + 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 TaskTipRes.ProtoReflect.Descriptor instead. +func (*TaskTipRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{185} +} + +func (x *TaskTipRes) GetRewards() []*TaskTipRes_EventReward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *TaskTipRes) GetL() int32 { + if x != nil { + return x.L + } + return 0 +} + +type TaskTipOkReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + L int32 `protobuf:"varint,3,opt,name=l,proto3" json:"l,omitempty"` //长度 +} + +func (x *TaskTipOkReq) Reset() { + *x = TaskTipOkReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[186] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipOkReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipOkReq) ProtoMessage() {} + +func (x *TaskTipOkReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[186] + 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 TaskTipOkReq.ProtoReflect.Descriptor instead. +func (*TaskTipOkReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{186} +} + +func (x *TaskTipOkReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *TaskTipOkReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *TaskTipOkReq) GetL() int32 { + if x != nil { + return x.L + } + return 0 +} + +type TaskTipOkRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TaskTipOkRes) Reset() { + *x = TaskTipOkRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[187] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipOkRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipOkRes) ProtoMessage() {} + +func (x *TaskTipOkRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[187] + 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 TaskTipOkRes.ProtoReflect.Descriptor instead. +func (*TaskTipOkRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{187} +} + +type CoinLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,4,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"` //每页条数 +} + +func (x *CoinLogReq) Reset() { + *x = CoinLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[188] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoinLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinLogReq) ProtoMessage() {} + +func (x *CoinLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[188] + 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 CoinLogReq.ProtoReflect.Descriptor instead. +func (*CoinLogReq) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{188} +} + +func (x *CoinLogReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *CoinLogReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *CoinLogReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *CoinLogReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *CoinLogReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +type CoinLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CoinLogRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *CoinLogRes) Reset() { + *x = CoinLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[189] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoinLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinLogRes) ProtoMessage() {} + +func (x *CoinLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[189] + 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 CoinLogRes.ProtoReflect.Descriptor instead. +func (*CoinLogRes) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{189} +} + +func (x *CoinLogRes) GetList() []*CoinLogRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *CoinLogRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动用户ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动用户对外id + SubUserId string `protobuf:"bytes,3,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户 + Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"` //用户上级 + ChildNum int64 `protobuf:"varint,5,opt,name=child_num,json=childNum,proto3" json:"child_num,omitempty"` //下级数量 + IndirectNum int64 `protobuf:"varint,6,opt,name=indirect_num,json=indirectNum,proto3" json:"indirect_num,omitempty"` //间接裂变 + IsNew int32 `protobuf:"varint,7,opt,name=is_new,json=isNew,proto3" json:"is_new,omitempty"` //是否新安装用户(1-是,0-否) + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Chance int32 `protobuf:"varint,9,opt,name=chance,proto3" json:"chance,omitempty"` //剩余的抽奖次数|答题次数|投票票数 + IsHelp int32 `protobuf:"varint,10,opt,name=is_help,json=isHelp,proto3" json:"is_help,omitempty"` //助力状态(0-无此状态,1-助力成功,2-助力失败) + Dice *ListRes_Dice `protobuf:"bytes,11,opt,name=dice,proto3" json:"dice,omitempty"` //大富翁数据 + ChannelTitle string `protobuf:"bytes,12,opt,name=channel_title,json=channelTitle,proto3" json:"channel_title,omitempty"` //渠道名称 + Source int32 `protobuf:"varint,13,opt,name=source,proto3" json:"source,omitempty"` //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + EffectNum int64 `protobuf:"varint,14,opt,name=effect_num,json=effectNum,proto3" json:"effect_num,omitempty"` //有效拉新人数 + LangMark string `protobuf:"bytes,15,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //用户语种标识 + CountryMark string `protobuf:"bytes,16,opt,name=country_mark,json=countryMark,proto3" json:"country_mark,omitempty"` //国家标识 + LvTitle string `protobuf:"bytes,17,opt,name=lv_title,json=lvTitle,proto3" json:"lv_title,omitempty"` //用户等级 + Platform string `protobuf:"bytes,18,opt,name=platform,proto3" json:"platform,omitempty"` //操作系统 + UserMark string `protobuf:"bytes,19,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识 + UserMarkSource int32 `protobuf:"varint,20,opt,name=user_mark_source,json=userMarkSource,proto3" json:"user_mark_source,omitempty"` //用户标识来源(1-设备id,2-用户id) + Conds []*ListRes_Cond `protobuf:"bytes,21,rep,name=conds,proto3" json:"conds,omitempty"` //用户完成的任务详情 + Chop *ListRes_Chop `protobuf:"bytes,22,opt,name=chop,proto3" json:"chop,omitempty"` //砍一刀数据 + FailMark string `protobuf:"bytes,23,opt,name=fail_mark,json=failMark,proto3" json:"fail_mark,omitempty"` //助力失败原因 + Win *ListRes_Win `protobuf:"bytes,24,opt,name=win,proto3" json:"win,omitempty"` //一起赢奖励特有参数 + KeepDog *ListRes_Keep `protobuf:"bytes,25,opt,name=keep_dog,json=keepDog,proto3" json:"keep_dog,omitempty"` //养狗数据 + Cash *ListRes_Cash `protobuf:"bytes,26,opt,name=cash,proto3" json:"cash,omitempty"` //现金抽奖数据 + DeviceId string `protobuf:"bytes,27,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //设备id + Gold *ListRes_Gold `protobuf:"bytes,28,opt,name=gold,proto3" json:"gold,omitempty"` //现金抽奖数据 + Coin *ListRes_Coin `protobuf:"bytes,29,opt,name=coin,proto3" json:"coin,omitempty"` //金币池数据 + Sign *ListRes_Sign `protobuf:"bytes,30,opt,name=sign,proto3" json:"sign,omitempty"` //签到数据 + JoinAt int64 `protobuf:"varint,31,opt,name=join_at,json=joinAt,proto3" json:"join_at,omitempty"` //访问活动时间 + InstallAt int64 `protobuf:"varint,32,opt,name=install_at,json=installAt,proto3" json:"install_at,omitempty"` //安装时间 + RegisterAt int64 `protobuf:"varint,33,opt,name=register_at,json=registerAt,proto3" json:"register_at,omitempty"` //注册时间 + Vs *ListRes_Vs `protobuf:"bytes,34,opt,name=vs,proto3" json:"vs,omitempty"` //投票数据 + Uno *ListRes_Uno `protobuf:"bytes,35,opt,name=uno,proto3" json:"uno,omitempty"` //uno卡牌数据 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[190] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[190] + 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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ListRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *ListRes_One) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListRes_One) GetChildNum() int64 { + if x != nil { + return x.ChildNum + } + return 0 +} + +func (x *ListRes_One) GetIndirectNum() int64 { + if x != nil { + return x.IndirectNum + } + return 0 +} + +func (x *ListRes_One) GetIsNew() int32 { + if x != nil { + return x.IsNew + } + return 0 +} + +func (x *ListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ListRes_One) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ListRes_One) GetIsHelp() int32 { + if x != nil { + return x.IsHelp + } + return 0 +} + +func (x *ListRes_One) GetDice() *ListRes_Dice { + if x != nil { + return x.Dice + } + return nil +} + +func (x *ListRes_One) GetChannelTitle() string { + if x != nil { + return x.ChannelTitle + } + return "" +} + +func (x *ListRes_One) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *ListRes_One) GetEffectNum() int64 { + if x != nil { + return x.EffectNum + } + return 0 +} + +func (x *ListRes_One) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ListRes_One) GetCountryMark() string { + if x != nil { + return x.CountryMark + } + return "" +} + +func (x *ListRes_One) GetLvTitle() string { + if x != nil { + return x.LvTitle + } + return "" +} + +func (x *ListRes_One) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *ListRes_One) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *ListRes_One) GetUserMarkSource() int32 { + if x != nil { + return x.UserMarkSource + } + return 0 +} + +func (x *ListRes_One) GetConds() []*ListRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +func (x *ListRes_One) GetChop() *ListRes_Chop { + if x != nil { + return x.Chop + } + return nil +} + +func (x *ListRes_One) GetFailMark() string { + if x != nil { + return x.FailMark + } + return "" +} + +func (x *ListRes_One) GetWin() *ListRes_Win { + if x != nil { + return x.Win + } + return nil +} + +func (x *ListRes_One) GetKeepDog() *ListRes_Keep { + if x != nil { + return x.KeepDog + } + return nil +} + +func (x *ListRes_One) GetCash() *ListRes_Cash { + if x != nil { + return x.Cash + } + return nil +} + +func (x *ListRes_One) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *ListRes_One) GetGold() *ListRes_Gold { + if x != nil { + return x.Gold + } + return nil +} + +func (x *ListRes_One) GetCoin() *ListRes_Coin { + if x != nil { + return x.Coin + } + return nil +} + +func (x *ListRes_One) GetSign() *ListRes_Sign { + if x != nil { + return x.Sign + } + return nil +} + +func (x *ListRes_One) GetJoinAt() int64 { + if x != nil { + return x.JoinAt + } + return 0 +} + +func (x *ListRes_One) GetInstallAt() int64 { + if x != nil { + return x.InstallAt + } + return 0 +} + +func (x *ListRes_One) GetRegisterAt() int64 { + if x != nil { + return x.RegisterAt + } + return 0 +} + +func (x *ListRes_One) GetVs() *ListRes_Vs { + if x != nil { + return x.Vs + } + return nil +} + +func (x *ListRes_One) GetUno() *ListRes_Uno { + if x != nil { + return x.Uno + } + return nil +} + +type ListRes_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chance int32 `protobuf:"varint,1,opt,name=chance,proto3" json:"chance,omitempty"` //剩余投票次数 + ThreeNum int32 `protobuf:"varint,2,opt,name=three_num,json=threeNum,proto3" json:"three_num,omitempty"` //+3道具牌数量 + FiveNum int32 `protobuf:"varint,3,opt,name=five_num,json=fiveNum,proto3" json:"five_num,omitempty"` //+5道具牌数量 + FixNum int32 `protobuf:"varint,4,opt,name=fix_num,json=fixNum,proto3" json:"fix_num,omitempty"` //固定颜色道具牌数量 +} + +func (x *ListRes_Uno) Reset() { + *x = ListRes_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[191] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Uno) ProtoMessage() {} + +func (x *ListRes_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[191] + 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 ListRes_Uno.ProtoReflect.Descriptor instead. +func (*ListRes_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *ListRes_Uno) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ListRes_Uno) GetThreeNum() int32 { + if x != nil { + return x.ThreeNum + } + return 0 +} + +func (x *ListRes_Uno) GetFiveNum() int32 { + if x != nil { + return x.FiveNum + } + return 0 +} + +func (x *ListRes_Uno) GetFixNum() int32 { + if x != nil { + return x.FixNum + } + return 0 +} + +type ListRes_Vs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chance int32 `protobuf:"varint,1,opt,name=chance,proto3" json:"chance,omitempty"` //剩余投票次数 + VoteNum int32 `protobuf:"varint,2,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"` //投票次数 + CoinGet int32 `protobuf:"varint,3,opt,name=coin_get,json=coinGet,proto3" json:"coin_get,omitempty"` //积分获取数 + CoinUse int32 `protobuf:"varint,4,opt,name=coin_use,json=coinUse,proto3" json:"coin_use,omitempty"` //积分消耗数 +} + +func (x *ListRes_Vs) Reset() { + *x = ListRes_Vs{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[192] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Vs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Vs) ProtoMessage() {} + +func (x *ListRes_Vs) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[192] + 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 ListRes_Vs.ProtoReflect.Descriptor instead. +func (*ListRes_Vs) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *ListRes_Vs) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ListRes_Vs) GetVoteNum() int32 { + if x != nil { + return x.VoteNum + } + return 0 +} + +func (x *ListRes_Vs) GetCoinGet() int32 { + if x != nil { + return x.CoinGet + } + return 0 +} + +func (x *ListRes_Vs) GetCoinUse() int32 { + if x != nil { + return x.CoinUse + } + return 0 +} + +type ListRes_Dice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chance int32 `protobuf:"varint,1,opt,name=chance,proto3" json:"chance,omitempty"` //骰子次数 + LuckyChance int32 `protobuf:"varint,2,opt,name=lucky_chance,json=luckyChance,proto3" json:"lucky_chance,omitempty"` //幸运骰次数 +} + +func (x *ListRes_Dice) Reset() { + *x = ListRes_Dice{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[193] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Dice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Dice) ProtoMessage() {} + +func (x *ListRes_Dice) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[193] + 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 ListRes_Dice.ProtoReflect.Descriptor instead. +func (*ListRes_Dice) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 3} +} + +func (x *ListRes_Dice) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *ListRes_Dice) GetLuckyChance() int32 { + if x != nil { + return x.LuckyChance + } + return 0 +} + +type ListRes_Chop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChopRewardId int64 `protobuf:"varint,1,opt,name=chop_reward_id,json=chopRewardId,proto3" json:"chop_reward_id,omitempty"` //选中的奖品id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + Percent string `protobuf:"bytes,3,opt,name=percent,proto3" json:"percent,omitempty"` //当前进度 +} + +func (x *ListRes_Chop) Reset() { + *x = ListRes_Chop{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[194] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Chop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Chop) ProtoMessage() {} + +func (x *ListRes_Chop) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[194] + 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 ListRes_Chop.ProtoReflect.Descriptor instead. +func (*ListRes_Chop) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 4} +} + +func (x *ListRes_Chop) GetChopRewardId() int64 { + if x != nil { + return x.ChopRewardId + } + return 0 +} + +func (x *ListRes_Chop) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *ListRes_Chop) GetPercent() string { + if x != nil { + return x.Percent + } + return "" +} + +type ListRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` //标题 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //数量 +} + +func (x *ListRes_Cond) Reset() { + *x = ListRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[195] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Cond) ProtoMessage() {} + +func (x *ListRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[195] + 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 ListRes_Cond.ProtoReflect.Descriptor instead. +func (*ListRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 5} +} + +func (x *ListRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ListRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type ListRes_Win struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsNewcomer int32 `protobuf:"varint,1,opt,name=is_newcomer,json=isNewcomer,proto3" json:"is_newcomer,omitempty"` //是否是新人用户 +} + +func (x *ListRes_Win) Reset() { + *x = ListRes_Win{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[196] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Win) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Win) ProtoMessage() {} + +func (x *ListRes_Win) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[196] + 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 ListRes_Win.ProtoReflect.Descriptor instead. +func (*ListRes_Win) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 6} +} + +func (x *ListRes_Win) GetIsNewcomer() int32 { + if x != nil { + return x.IsNewcomer + } + return 0 +} + +type ListRes_Keep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectNum int32 `protobuf:"varint,1,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //已收集爱心数 + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //剩余狗粮数 +} + +func (x *ListRes_Keep) Reset() { + *x = ListRes_Keep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[197] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Keep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Keep) ProtoMessage() {} + +func (x *ListRes_Keep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[197] + 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 ListRes_Keep.ProtoReflect.Descriptor instead. +func (*ListRes_Keep) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 7} +} + +func (x *ListRes_Keep) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *ListRes_Keep) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *ListRes_Keep) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +type ListRes_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExpiredAt int64 `protobuf:"varint,1,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` //任务重制时间 +} + +func (x *ListRes_Cash) Reset() { + *x = ListRes_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[198] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Cash) ProtoMessage() {} + +func (x *ListRes_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[198] + 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 ListRes_Cash.ProtoReflect.Descriptor instead. +func (*ListRes_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 8} +} + +func (x *ListRes_Cash) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +type ListRes_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GoldNum int32 `protobuf:"varint,1,opt,name=gold_num,json=goldNum,proto3" json:"gold_num,omitempty"` //金币数量 + ExpiredAt int64 `protobuf:"varint,2,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` //任务重制时间 +} + +func (x *ListRes_Gold) Reset() { + *x = ListRes_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[199] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Gold) ProtoMessage() {} + +func (x *ListRes_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[199] + 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 ListRes_Gold.ProtoReflect.Descriptor instead. +func (*ListRes_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 9} +} + +func (x *ListRes_Gold) GetGoldNum() int32 { + if x != nil { + return x.GoldNum + } + return 0 +} + +func (x *ListRes_Gold) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +type ListRes_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalUse int32 `protobuf:"varint,1,opt,name=total_use,json=totalUse,proto3" json:"total_use,omitempty"` //投放总次数 + TotalNum int32 `protobuf:"varint,2,opt,name=total_num,json=totalNum,proto3" json:"total_num,omitempty"` //总收益 + Scenes []*ListRes_CoinScene `protobuf:"bytes,3,rep,name=scenes,proto3" json:"scenes,omitempty"` //场次明细 +} + +func (x *ListRes_Coin) Reset() { + *x = ListRes_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[200] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Coin) ProtoMessage() {} + +func (x *ListRes_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[200] + 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 ListRes_Coin.ProtoReflect.Descriptor instead. +func (*ListRes_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 10} +} + +func (x *ListRes_Coin) GetTotalUse() int32 { + if x != nil { + return x.TotalUse + } + return 0 +} + +func (x *ListRes_Coin) GetTotalNum() int32 { + if x != nil { + return x.TotalNum + } + return 0 +} + +func (x *ListRes_Coin) GetScenes() []*ListRes_CoinScene { + if x != nil { + return x.Scenes + } + return nil +} + +type ListRes_CoinScene struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //开奖时间 + UseNum int32 `protobuf:"varint,2,opt,name=use_num,json=useNum,proto3" json:"use_num,omitempty"` //投放次数 + GetCoin int32 `protobuf:"varint,3,opt,name=get_coin,json=getCoin,proto3" json:"get_coin,omitempty"` //获得金币数 +} + +func (x *ListRes_CoinScene) Reset() { + *x = ListRes_CoinScene{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[201] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_CoinScene) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_CoinScene) ProtoMessage() {} + +func (x *ListRes_CoinScene) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[201] + 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 ListRes_CoinScene.ProtoReflect.Descriptor instead. +func (*ListRes_CoinScene) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 11} +} + +func (x *ListRes_CoinScene) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_CoinScene) GetUseNum() int32 { + if x != nil { + return x.UseNum + } + return 0 +} + +func (x *ListRes_CoinScene) GetGetCoin() int32 { + if x != nil { + return x.GetCoin + } + return 0 +} + +type ListRes_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignDay int32 `protobuf:"varint,1,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + MaxContinue int32 `protobuf:"varint,2,opt,name=max_continue,json=maxContinue,proto3" json:"max_continue,omitempty"` //连续签到天数 +} + +func (x *ListRes_Sign) Reset() { + *x = ListRes_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[202] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Sign) ProtoMessage() {} + +func (x *ListRes_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[202] + 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 ListRes_Sign.ProtoReflect.Descriptor instead. +func (*ListRes_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{1, 12} +} + +func (x *ListRes_Sign) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *ListRes_Sign) GetMaxContinue() int32 { + if x != nil { + return x.MaxContinue + } + return 0 +} + +type RewardRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //活动用户对外id + CreatedTime int64 `protobuf:"varint,2,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //奖励时间时间戳 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 + KvData []*RewardRes_KV `protobuf:"bytes,4,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对 + Img string `protobuf:"bytes,5,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + JumpUrl string `protobuf:"bytes,6,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + IsPush bool `protobuf:"varint,8,opt,name=is_push,json=isPush,proto3" json:"is_push,omitempty"` //是否已经推给客户 + Id int64 `protobuf:"varint,9,opt,name=id,proto3" json:"id,omitempty"` //奖品记录int型id + HashId string `protobuf:"bytes,10,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //奖品记录string型hash_id + Status int32 `protobuf:"varint,11,opt,name=status,proto3" json:"status,omitempty"` //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发送) + FailType string `protobuf:"bytes,12,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败原因标识(system-自己系统的问题,client-对方系统的问题,undefined-没有分析到的问题) + FailMsg string `protobuf:"bytes,13,opt,name=fail_msg,json=failMsg,proto3" json:"fail_msg,omitempty"` //失败具体原因说明 + RewardTitle string `protobuf:"bytes,14,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + Contact string `protobuf:"bytes,15,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,16,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,17,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,18,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + RewardId int64 `protobuf:"varint,19,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + DyRewardType int32 `protobuf:"varint,20,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) + CustomRewardVal string `protobuf:"bytes,21,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义的奖品值 + RewardType int32 `protobuf:"varint,22,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励) + ChildTitle string `protobuf:"bytes,23,opt,name=child_title,json=childTitle,proto3" json:"child_title,omitempty"` //子活动标题 + PropMark string `protobuf:"bytes,24,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + ChanceMark string `protobuf:"bytes,25,opt,name=chance_mark,json=chanceMark,proto3" json:"chance_mark,omitempty"` //道具标识(dog_food-狗粮) + RewardNum int32 `protobuf:"varint,26,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //奖励数量 + PcParam string `protobuf:"bytes,27,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *RewardRes_One) Reset() { + *x = RewardRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[203] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardRes_One) ProtoMessage() {} + +func (x *RewardRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[203] + 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 RewardRes_One.ProtoReflect.Descriptor instead. +func (*RewardRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *RewardRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *RewardRes_One) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +func (x *RewardRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardRes_One) GetKvData() []*RewardRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *RewardRes_One) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *RewardRes_One) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *RewardRes_One) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *RewardRes_One) GetIsPush() bool { + if x != nil { + return x.IsPush + } + return false +} + +func (x *RewardRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *RewardRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *RewardRes_One) GetFailType() string { + if x != nil { + return x.FailType + } + return "" +} + +func (x *RewardRes_One) GetFailMsg() string { + if x != nil { + return x.FailMsg + } + return "" +} + +func (x *RewardRes_One) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *RewardRes_One) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *RewardRes_One) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *RewardRes_One) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *RewardRes_One) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *RewardRes_One) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *RewardRes_One) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +func (x *RewardRes_One) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *RewardRes_One) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *RewardRes_One) GetChildTitle() string { + if x != nil { + return x.ChildTitle + } + return "" +} + +func (x *RewardRes_One) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *RewardRes_One) GetChanceMark() string { + if x != nil { + return x.ChanceMark + } + return "" +} + +func (x *RewardRes_One) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *RewardRes_One) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type RewardRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *RewardRes_KV) Reset() { + *x = RewardRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[204] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardRes_KV) ProtoMessage() {} + +func (x *RewardRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[204] + 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 RewardRes_KV.ProtoReflect.Descriptor instead. +func (*RewardRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *RewardRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *RewardRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *RewardRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type VisitReq_Cert struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` //时间戳 + Blackbox string `protobuf:"bytes,2,opt,name=blackbox,proto3" json:"blackbox,omitempty"` //通过blackBox可以在后台查询出 + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` //加解密版本 + Platform string `protobuf:"bytes,4,opt,name=platform,proto3" json:"platform,omitempty"` //平台 + Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` //加密串 +} + +func (x *VisitReq_Cert) Reset() { + *x = VisitReq_Cert{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[205] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisitReq_Cert) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisitReq_Cert) ProtoMessage() {} + +func (x *VisitReq_Cert) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[205] + 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 VisitReq_Cert.ProtoReflect.Descriptor instead. +func (*VisitReq_Cert) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *VisitReq_Cert) GetTime() int64 { + if x != nil { + return x.Time + } + return 0 +} + +func (x *VisitReq_Cert) GetBlackbox() string { + if x != nil { + return x.Blackbox + } + return "" +} + +func (x *VisitReq_Cert) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *VisitReq_Cert) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *VisitReq_Cert) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type PlayRes_Uno struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chance int32 `protobuf:"varint,1,opt,name=chance,proto3" json:"chance,omitempty"` //抽奖机会数 + ThreeNum int32 `protobuf:"varint,2,opt,name=three_num,json=threeNum,proto3" json:"three_num,omitempty"` //+3道具牌数量 + FiveNum int32 `protobuf:"varint,3,opt,name=five_num,json=fiveNum,proto3" json:"five_num,omitempty"` //+5道具牌数量 + FixNum int32 `protobuf:"varint,4,opt,name=fix_num,json=fixNum,proto3" json:"fix_num,omitempty"` //固定颜色道具牌数量 + Red *PlayRes_UnoGroup `protobuf:"bytes,5,opt,name=red,proto3" json:"red,omitempty"` //红牌信息 + Blue *PlayRes_UnoGroup `protobuf:"bytes,6,opt,name=blue,proto3" json:"blue,omitempty"` //蓝牌信息 + Green *PlayRes_UnoGroup `protobuf:"bytes,7,opt,name=green,proto3" json:"green,omitempty"` //绿牌信息 + Yellow *PlayRes_UnoGroup `protobuf:"bytes,8,opt,name=yellow,proto3" json:"yellow,omitempty"` //黄牌信息 +} + +func (x *PlayRes_Uno) Reset() { + *x = PlayRes_Uno{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[206] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Uno) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Uno) ProtoMessage() {} + +func (x *PlayRes_Uno) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[206] + 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 PlayRes_Uno.ProtoReflect.Descriptor instead. +func (*PlayRes_Uno) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *PlayRes_Uno) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Uno) GetThreeNum() int32 { + if x != nil { + return x.ThreeNum + } + return 0 +} + +func (x *PlayRes_Uno) GetFiveNum() int32 { + if x != nil { + return x.FiveNum + } + return 0 +} + +func (x *PlayRes_Uno) GetFixNum() int32 { + if x != nil { + return x.FixNum + } + return 0 +} + +func (x *PlayRes_Uno) GetRed() *PlayRes_UnoGroup { + if x != nil { + return x.Red + } + return nil +} + +func (x *PlayRes_Uno) GetBlue() *PlayRes_UnoGroup { + if x != nil { + return x.Blue + } + return nil +} + +func (x *PlayRes_Uno) GetGreen() *PlayRes_UnoGroup { + if x != nil { + return x.Green + } + return nil +} + +func (x *PlayRes_Uno) GetYellow() *PlayRes_UnoGroup { + if x != nil { + return x.Yellow + } + return nil +} + +type PlayRes_UnoGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectNum int32 `protobuf:"varint,1,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集数量 + Cards []*PlayRes_UnoCard `protobuf:"bytes,2,rep,name=cards,proto3" json:"cards,omitempty"` //牌号 +} + +func (x *PlayRes_UnoGroup) Reset() { + *x = PlayRes_UnoGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[207] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_UnoGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_UnoGroup) ProtoMessage() {} + +func (x *PlayRes_UnoGroup) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[207] + 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 PlayRes_UnoGroup.ProtoReflect.Descriptor instead. +func (*PlayRes_UnoGroup) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 1} +} + +func (x *PlayRes_UnoGroup) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *PlayRes_UnoGroup) GetCards() []*PlayRes_UnoCard { + if x != nil { + return x.Cards + } + return nil +} + +type PlayRes_UnoCard struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CardNo int32 `protobuf:"varint,1,opt,name=card_no,json=cardNo,proto3" json:"card_no,omitempty"` //牌号 + CardNum int32 `protobuf:"varint,2,opt,name=card_num,json=cardNum,proto3" json:"card_num,omitempty"` //获得的牌数量 +} + +func (x *PlayRes_UnoCard) Reset() { + *x = PlayRes_UnoCard{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[208] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_UnoCard) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_UnoCard) ProtoMessage() {} + +func (x *PlayRes_UnoCard) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[208] + 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 PlayRes_UnoCard.ProtoReflect.Descriptor instead. +func (*PlayRes_UnoCard) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 2} +} + +func (x *PlayRes_UnoCard) GetCardNo() int32 { + if x != nil { + return x.CardNo + } + return 0 +} + +func (x *PlayRes_UnoCard) GetCardNum() int32 { + if x != nil { + return x.CardNum + } + return 0 +} + +type PlayRes_Vs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CoinNum int64 `protobuf:"varint,1,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //积分数 + CoinTitle string `protobuf:"bytes,2,opt,name=coin_title,json=coinTitle,proto3" json:"coin_title,omitempty"` //积分标题 + CoinImg string `protobuf:"bytes,3,opt,name=coin_img,json=coinImg,proto3" json:"coin_img,omitempty"` //积分图片 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //投票机会数 + WinRewards []*PlayRes_GetReward `protobuf:"bytes,5,rep,name=win_rewards,json=winRewards,proto3" json:"win_rewards,omitempty"` //投票奖励 +} + +func (x *PlayRes_Vs) Reset() { + *x = PlayRes_Vs{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[209] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Vs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Vs) ProtoMessage() {} + +func (x *PlayRes_Vs) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[209] + 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 PlayRes_Vs.ProtoReflect.Descriptor instead. +func (*PlayRes_Vs) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 3} +} + +func (x *PlayRes_Vs) GetCoinNum() int64 { + if x != nil { + return x.CoinNum + } + return 0 +} + +func (x *PlayRes_Vs) GetCoinTitle() string { + if x != nil { + return x.CoinTitle + } + return "" +} + +func (x *PlayRes_Vs) GetCoinImg() string { + if x != nil { + return x.CoinImg + } + return "" +} + +func (x *PlayRes_Vs) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Vs) GetWinRewards() []*PlayRes_GetReward { + if x != nil { + return x.WinRewards + } + return nil +} + +type PlayRes_Coin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GetCoin int64 `protobuf:"varint,1,opt,name=get_coin,json=getCoin,proto3" json:"get_coin,omitempty"` //获得的金币数 + AllCoin int64 `protobuf:"varint,2,opt,name=all_coin,json=allCoin,proto3" json:"all_coin,omitempty"` //总奖池金额 + OpenSec int64 `protobuf:"varint,3,opt,name=open_sec,json=openSec,proto3" json:"open_sec,omitempty"` //剩余开奖时间(秒) + UseNum int32 `protobuf:"varint,4,opt,name=use_num,json=useNum,proto3" json:"use_num,omitempty"` //投放次数 + CanGet int32 `protobuf:"varint,5,opt,name=can_get,json=canGet,proto3" json:"can_get,omitempty"` //是否可以领取瓜分了 + End int32 `protobuf:"varint,6,opt,name=end,proto3" json:"end,omitempty"` //是否没有下一场了 +} + +func (x *PlayRes_Coin) Reset() { + *x = PlayRes_Coin{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[210] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Coin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Coin) ProtoMessage() {} + +func (x *PlayRes_Coin) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[210] + 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 PlayRes_Coin.ProtoReflect.Descriptor instead. +func (*PlayRes_Coin) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 4} +} + +func (x *PlayRes_Coin) GetGetCoin() int64 { + if x != nil { + return x.GetCoin + } + return 0 +} + +func (x *PlayRes_Coin) GetAllCoin() int64 { + if x != nil { + return x.AllCoin + } + return 0 +} + +func (x *PlayRes_Coin) GetOpenSec() int64 { + if x != nil { + return x.OpenSec + } + return 0 +} + +func (x *PlayRes_Coin) GetUseNum() int32 { + if x != nil { + return x.UseNum + } + return 0 +} + +func (x *PlayRes_Coin) GetCanGet() int32 { + if x != nil { + return x.CanGet + } + return 0 +} + +func (x *PlayRes_Coin) GetEnd() int32 { + if x != nil { + return x.End + } + return 0 +} + +type PlayRes_Clue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //通知类型(1-获得抽奖机会通知,2-完成前置任务) + Chance int64 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //获得的抽奖机会次数 + PreCond int32 `protobuf:"varint,3,opt,name=pre_cond,json=preCond,proto3" json:"pre_cond,omitempty"` //完成的前置任务标识 +} + +func (x *PlayRes_Clue) Reset() { + *x = PlayRes_Clue{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[211] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Clue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Clue) ProtoMessage() {} + +func (x *PlayRes_Clue) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[211] + 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 PlayRes_Clue.ProtoReflect.Descriptor instead. +func (*PlayRes_Clue) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 5} +} + +func (x *PlayRes_Clue) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *PlayRes_Clue) GetChance() int64 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Clue) GetPreCond() int32 { + if x != nil { + return x.PreCond + } + return 0 +} + +type PlayRes_Task struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fixed *PlayRes_Fixed `protobuf:"bytes,1,opt,name=fixed,proto3" json:"fixed,omitempty"` //固定任务 + Custom *PlayRes_Custom `protobuf:"bytes,2,opt,name=custom,proto3" json:"custom,omitempty"` //自定义任务 +} + +func (x *PlayRes_Task) Reset() { + *x = PlayRes_Task{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[212] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Task) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Task) ProtoMessage() {} + +func (x *PlayRes_Task) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[212] + 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 PlayRes_Task.ProtoReflect.Descriptor instead. +func (*PlayRes_Task) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 6} +} + +func (x *PlayRes_Task) GetFixed() *PlayRes_Fixed { + if x != nil { + return x.Fixed + } + return nil +} + +func (x *PlayRes_Task) GetCustom() *PlayRes_Custom { + if x != nil { + return x.Custom + } + return nil +} + +type PlayRes_Fixed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + AppEvent int32 `protobuf:"varint,2,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //固定事件类型(1-安装;2-注册) + TargetNum int32 `protobuf:"varint,3,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,5,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) +} + +func (x *PlayRes_Fixed) Reset() { + *x = PlayRes_Fixed{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[213] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Fixed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Fixed) ProtoMessage() {} + +func (x *PlayRes_Fixed) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[213] + 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 PlayRes_Fixed.ProtoReflect.Descriptor instead. +func (*PlayRes_Fixed) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 7} +} + +func (x *PlayRes_Fixed) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *PlayRes_Fixed) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *PlayRes_Fixed) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *PlayRes_Fixed) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Fixed) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +type PlayRes_Custom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + BothType int32 `protobuf:"varint,2,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //总发放的数(如:骰子数) + Cond []*PlayRes_Cond `protobuf:"bytes,4,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *PlayRes_BothAll `protobuf:"bytes,5,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 +} + +func (x *PlayRes_Custom) Reset() { + *x = PlayRes_Custom{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[214] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Custom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Custom) ProtoMessage() {} + +func (x *PlayRes_Custom) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[214] + 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 PlayRes_Custom.ProtoReflect.Descriptor instead. +func (*PlayRes_Custom) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 8} +} + +func (x *PlayRes_Custom) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *PlayRes_Custom) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *PlayRes_Custom) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Custom) GetCond() []*PlayRes_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *PlayRes_Custom) GetBothAll() *PlayRes_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +type PlayRes_BothAll struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskChance int32 `protobuf:"varint,1,opt,name=task_chance,json=taskChance,proto3" json:"task_chance,omitempty"` //完成任务获得的次数(如:骰子数) + TaskLimit int32 `protobuf:"varint,2,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务最大可完成次数(0不限制) + Finish int64 `protobuf:"varint,3,opt,name=finish,proto3" json:"finish,omitempty"` //完成任务的次数 +} + +func (x *PlayRes_BothAll) Reset() { + *x = PlayRes_BothAll{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[215] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_BothAll) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_BothAll) ProtoMessage() {} + +func (x *PlayRes_BothAll) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[215] + 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 PlayRes_BothAll.ProtoReflect.Descriptor instead. +func (*PlayRes_BothAll) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 9} +} + +func (x *PlayRes_BothAll) GetTaskChance() int32 { + if x != nil { + return x.TaskChance + } + return 0 +} + +func (x *PlayRes_BothAll) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *PlayRes_BothAll) GetFinish() int64 { + if x != nil { + return x.Finish + } + return 0 +} + +type PlayRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //达标条件ID + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //达标条件 + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //完成次数 + IfCond int32 `protobuf:"varint,4,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + Total string `protobuf:"bytes,5,opt,name=total,proto3" json:"total,omitempty"` //累计值 + Event string `protobuf:"bytes,6,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,7,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,8,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + TaskChance int32 `protobuf:"varint,9,opt,name=task_chance,json=taskChance,proto3" json:"task_chance,omitempty"` //完成发放的次数(如:骰子数) + TaskLimit int32 `protobuf:"varint,10,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务最大可完成次数(0不限制) +} + +func (x *PlayRes_Cond) Reset() { + *x = PlayRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[216] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Cond) ProtoMessage() {} + +func (x *PlayRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[216] + 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 PlayRes_Cond.ProtoReflect.Descriptor instead. +func (*PlayRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 10} +} + +func (x *PlayRes_Cond) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *PlayRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *PlayRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *PlayRes_Cond) GetTotal() string { + if x != nil { + return x.Total + } + return "" +} + +func (x *PlayRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *PlayRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *PlayRes_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *PlayRes_Cond) GetTaskChance() int32 { + if x != nil { + return x.TaskChance + } + return 0 +} + +func (x *PlayRes_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +type PlayRes_ChancePlayer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //大转盘用户数据id + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //抽奖机会数 + InviteNum int64 `protobuf:"varint,3,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //已邀请人数 +} + +func (x *PlayRes_ChancePlayer) Reset() { + *x = PlayRes_ChancePlayer{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[217] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_ChancePlayer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_ChancePlayer) ProtoMessage() {} + +func (x *PlayRes_ChancePlayer) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[217] + 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 PlayRes_ChancePlayer.ProtoReflect.Descriptor instead. +func (*PlayRes_ChancePlayer) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 11} +} + +func (x *PlayRes_ChancePlayer) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_ChancePlayer) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_ChancePlayer) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +type PlayRes_Quiz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //有奖竞猜用户数据id + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //投票机会次数 + OptionId int64 `protobuf:"varint,3,opt,name=option_id,json=optionId,proto3" json:"option_id,omitempty"` //选择的选项id + Win bool `protobuf:"varint,4,opt,name=win,proto3" json:"win,omitempty"` //是否已经赢得奖励 + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,6,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + InviteNum int64 `protobuf:"varint,7,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //已邀请人数 + RewardHashId string `protobuf:"bytes,8,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + ReceiveType int32 `protobuf:"varint,9,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + IsPush bool `protobuf:"varint,10,opt,name=is_push,json=isPush,proto3" json:"is_push,omitempty"` //是否已经推给客户 + KvData []*PlayRes_KV `protobuf:"bytes,11,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对数据 + OpenType int32 `protobuf:"varint,12,opt,name=open_type,json=openType,proto3" json:"open_type,omitempty"` //1-为开奖,2-已开奖,3-不开奖 + RewardId int64 `protobuf:"varint,13,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Contact string `protobuf:"bytes,14,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 +} + +func (x *PlayRes_Quiz) Reset() { + *x = PlayRes_Quiz{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[218] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Quiz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Quiz) ProtoMessage() {} + +func (x *PlayRes_Quiz) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[218] + 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 PlayRes_Quiz.ProtoReflect.Descriptor instead. +func (*PlayRes_Quiz) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 12} +} + +func (x *PlayRes_Quiz) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Quiz) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Quiz) GetOptionId() int64 { + if x != nil { + return x.OptionId + } + return 0 +} + +func (x *PlayRes_Quiz) GetWin() bool { + if x != nil { + return x.Win + } + return false +} + +func (x *PlayRes_Quiz) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PlayRes_Quiz) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *PlayRes_Quiz) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *PlayRes_Quiz) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *PlayRes_Quiz) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *PlayRes_Quiz) GetIsPush() bool { + if x != nil { + return x.IsPush + } + return false +} + +func (x *PlayRes_Quiz) GetKvData() []*PlayRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *PlayRes_Quiz) GetOpenType() int32 { + if x != nil { + return x.OpenType + } + return 0 +} + +func (x *PlayRes_Quiz) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *PlayRes_Quiz) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +type PlayRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否显示 +} + +func (x *PlayRes_KV) Reset() { + *x = PlayRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[219] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_KV) ProtoMessage() {} + +func (x *PlayRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[219] + 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 PlayRes_KV.ProtoReflect.Descriptor instead. +func (*PlayRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 13} +} + +func (x *PlayRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PlayRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *PlayRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type PlayRes_InvitePalyer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //老带新用户数据id + InviteNum int64 `protobuf:"varint,2,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //已邀请人数 + NeedNum int64 `protobuf:"varint,3,opt,name=need_num,json=needNum,proto3" json:"need_num,omitempty"` //还需要邀请人数 + LimitStatus int32 `protobuf:"varint,4,opt,name=limit_status,json=limitStatus,proto3" json:"limit_status,omitempty"` //任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制) + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //将要获得的奖品名称|已获得的奖品名称 + RewardNum int64 `protobuf:"varint,6,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //将要获得的奖品数量|已获得的奖品数量 + RewardRule int32 `protobuf:"varint,7,opt,name=reward_rule,json=rewardRule,proto3" json:"reward_rule,omitempty"` //用户奖励规则(1-阶梯,2-非阶梯) + ExtraTitle string `protobuf:"bytes,8,opt,name=extra_title,json=extraTitle,proto3" json:"extra_title,omitempty"` //额外奖品名称 + ExtraRewardNum int64 `protobuf:"varint,9,opt,name=extra_reward_num,json=extraRewardNum,proto3" json:"extra_reward_num,omitempty"` //额外奖品数量 + RewardId int64 `protobuf:"varint,10,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + ExtraRewardId int64 `protobuf:"varint,11,opt,name=extra_reward_id,json=extraRewardId,proto3" json:"extra_reward_id,omitempty"` //奖品id + NoticeReward *PlayRes_NoticeReward `protobuf:"bytes,12,opt,name=notice_reward,json=noticeReward,proto3" json:"notice_reward,omitempty"` //需要通知的奖品(没有的时候为空) + HasNewcomerReward bool `protobuf:"varint,13,opt,name=has_newcomer_reward,json=hasNewcomerReward,proto3" json:"has_newcomer_reward,omitempty"` //是否可以领取新人奖 + HasHelpTask bool `protobuf:"varint,14,opt,name=has_help_task,json=hasHelpTask,proto3" json:"has_help_task,omitempty"` //是否有助力任务 +} + +func (x *PlayRes_InvitePalyer) Reset() { + *x = PlayRes_InvitePalyer{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[220] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_InvitePalyer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_InvitePalyer) ProtoMessage() {} + +func (x *PlayRes_InvitePalyer) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[220] + 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 PlayRes_InvitePalyer.ProtoReflect.Descriptor instead. +func (*PlayRes_InvitePalyer) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 14} +} + +func (x *PlayRes_InvitePalyer) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetNeedNum() int64 { + if x != nil { + return x.NeedNum + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetLimitStatus() int32 { + if x != nil { + return x.LimitStatus + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PlayRes_InvitePalyer) GetRewardNum() int64 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetRewardRule() int32 { + if x != nil { + return x.RewardRule + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetExtraTitle() string { + if x != nil { + return x.ExtraTitle + } + return "" +} + +func (x *PlayRes_InvitePalyer) GetExtraRewardNum() int64 { + if x != nil { + return x.ExtraRewardNum + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetExtraRewardId() int64 { + if x != nil { + return x.ExtraRewardId + } + return 0 +} + +func (x *PlayRes_InvitePalyer) GetNoticeReward() *PlayRes_NoticeReward { + if x != nil { + return x.NoticeReward + } + return nil +} + +func (x *PlayRes_InvitePalyer) GetHasNewcomerReward() bool { + if x != nil { + return x.HasNewcomerReward + } + return false +} + +func (x *PlayRes_InvitePalyer) GetHasHelpTask() bool { + if x != nil { + return x.HasHelpTask + } + return false +} + +type PlayRes_NoticeReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //奖品对外id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + RewardNum int32 `protobuf:"varint,3,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //奖品数量 + ReceiveType int32 `protobuf:"varint,4,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + KvData []*PlayRes_KV `protobuf:"bytes,5,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对数据 + RewardId int64 `protobuf:"varint,6,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Contact string `protobuf:"bytes,7,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 +} + +func (x *PlayRes_NoticeReward) Reset() { + *x = PlayRes_NoticeReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[221] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_NoticeReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_NoticeReward) ProtoMessage() {} + +func (x *PlayRes_NoticeReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[221] + 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 PlayRes_NoticeReward.ProtoReflect.Descriptor instead. +func (*PlayRes_NoticeReward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 15} +} + +func (x *PlayRes_NoticeReward) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *PlayRes_NoticeReward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PlayRes_NoticeReward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *PlayRes_NoticeReward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *PlayRes_NoticeReward) GetKvData() []*PlayRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *PlayRes_NoticeReward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *PlayRes_NoticeReward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +type PlayRes_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //签到用户数据id + SignDay int32 `protobuf:"varint,2,opt,name=sign_day,json=signDay,proto3" json:"sign_day,omitempty"` //签到天数 + ContinueDay int32 `protobuf:"varint,3,opt,name=continue_day,json=continueDay,proto3" json:"continue_day,omitempty"` //连续签到天数 + InviteNum int64 `protobuf:"varint,4,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //已邀请人数 + CardNum int32 `protobuf:"varint,5,opt,name=card_num,json=cardNum,proto3" json:"card_num,omitempty"` //补签卡数量 + MaxContinue int32 `protobuf:"varint,6,opt,name=max_continue,json=maxContinue,proto3" json:"max_continue,omitempty"` //最大连续签到天数 + TodaySign int32 `protobuf:"varint,7,opt,name=today_sign,json=todaySign,proto3" json:"today_sign,omitempty"` //今天是否有签到 (0-否,1-是) + CycleDay int32 `protobuf:"varint,8,opt,name=cycle_day,json=cycleDay,proto3" json:"cycle_day,omitempty"` //周期签到天数 +} + +func (x *PlayRes_Sign) Reset() { + *x = PlayRes_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[222] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Sign) ProtoMessage() {} + +func (x *PlayRes_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[222] + 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 PlayRes_Sign.ProtoReflect.Descriptor instead. +func (*PlayRes_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 16} +} + +func (x *PlayRes_Sign) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Sign) GetSignDay() int32 { + if x != nil { + return x.SignDay + } + return 0 +} + +func (x *PlayRes_Sign) GetContinueDay() int32 { + if x != nil { + return x.ContinueDay + } + return 0 +} + +func (x *PlayRes_Sign) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *PlayRes_Sign) GetCardNum() int32 { + if x != nil { + return x.CardNum + } + return 0 +} + +func (x *PlayRes_Sign) GetMaxContinue() int32 { + if x != nil { + return x.MaxContinue + } + return 0 +} + +func (x *PlayRes_Sign) GetTodaySign() int32 { + if x != nil { + return x.TodaySign + } + return 0 +} + +func (x *PlayRes_Sign) GetCycleDay() int32 { + if x != nil { + return x.CycleDay + } + return 0 +} + +type PlayRes_Dice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //签到用户数据id + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //骰子数 + MapHashId string `protobuf:"bytes,3,opt,name=map_hash_id,json=mapHashId,proto3" json:"map_hash_id,omitempty"` //当前所在地图位置 + PropsChance int32 `protobuf:"varint,4,opt,name=props_chance,json=propsChance,proto3" json:"props_chance,omitempty"` //再摇一次道具可用次数 + PropsFixedRoll int32 `protobuf:"varint,5,opt,name=props_fixed_roll,json=propsFixedRoll,proto3" json:"props_fixed_roll,omitempty"` //幸运骰子可用次数 + Collects []*PlayRes_Collect `protobuf:"bytes,6,rep,name=collects,proto3" json:"collects,omitempty"` //奖品碎片 + InviteNum int64 `protobuf:"varint,7,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //已邀请人数 + FixedRollTaskFinish int64 `protobuf:"varint,8,opt,name=fixed_roll_task_finish,json=fixedRollTaskFinish,proto3" json:"fixed_roll_task_finish,omitempty"` //幸运骰子任务完成次数 + DmgId int64 `protobuf:"varint,9,opt,name=dmg_id,json=dmgId,proto3" json:"dmg_id,omitempty"` //地图id +} + +func (x *PlayRes_Dice) Reset() { + *x = PlayRes_Dice{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[223] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Dice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Dice) ProtoMessage() {} + +func (x *PlayRes_Dice) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[223] + 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 PlayRes_Dice.ProtoReflect.Descriptor instead. +func (*PlayRes_Dice) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 17} +} + +func (x *PlayRes_Dice) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Dice) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *PlayRes_Dice) GetMapHashId() string { + if x != nil { + return x.MapHashId + } + return "" +} + +func (x *PlayRes_Dice) GetPropsChance() int32 { + if x != nil { + return x.PropsChance + } + return 0 +} + +func (x *PlayRes_Dice) GetPropsFixedRoll() int32 { + if x != nil { + return x.PropsFixedRoll + } + return 0 +} + +func (x *PlayRes_Dice) GetCollects() []*PlayRes_Collect { + if x != nil { + return x.Collects + } + return nil +} + +func (x *PlayRes_Dice) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *PlayRes_Dice) GetFixedRollTaskFinish() int64 { + if x != nil { + return x.FixedRollTaskFinish + } + return 0 +} + +func (x *PlayRes_Dice) GetDmgId() int64 { + if x != nil { + return x.DmgId + } + return 0 +} + +type PlayRes_Collect struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //当前拥有碎片数 + CollectNum int32 `protobuf:"varint,3,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片总数 + RewardTitle string `protobuf:"bytes,4,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,5,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片(相对路径) + IsSuper int32 `protobuf:"varint,6,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级奖品(0-否,1-是) +} + +func (x *PlayRes_Collect) Reset() { + *x = PlayRes_Collect{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[224] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Collect) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Collect) ProtoMessage() {} + +func (x *PlayRes_Collect) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[224] + 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 PlayRes_Collect.ProtoReflect.Descriptor instead. +func (*PlayRes_Collect) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 18} +} + +func (x *PlayRes_Collect) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Collect) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *PlayRes_Collect) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *PlayRes_Collect) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *PlayRes_Collect) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *PlayRes_Collect) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +type PlayRes_Grow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //签到用户数据id + GrowNum int32 `protobuf:"varint,2,opt,name=grow_num,json=growNum,proto3" json:"grow_num,omitempty"` //成长道具数量 + InviteNum int64 `protobuf:"varint,3,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //已邀请人数 + HasProps bool `protobuf:"varint,4,opt,name=has_props,json=hasProps,proto3" json:"has_props,omitempty"` //是否可以领取道具 + NextProps int64 `protobuf:"varint,5,opt,name=next_props,json=nextProps,proto3" json:"next_props,omitempty"` //多少秒后可以领取道具 +} + +func (x *PlayRes_Grow) Reset() { + *x = PlayRes_Grow{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[225] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Grow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Grow) ProtoMessage() {} + +func (x *PlayRes_Grow) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[225] + 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 PlayRes_Grow.ProtoReflect.Descriptor instead. +func (*PlayRes_Grow) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 19} +} + +func (x *PlayRes_Grow) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Grow) GetGrowNum() int32 { + if x != nil { + return x.GrowNum + } + return 0 +} + +func (x *PlayRes_Grow) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *PlayRes_Grow) GetHasProps() bool { + if x != nil { + return x.HasProps + } + return false +} + +func (x *PlayRes_Grow) GetNextProps() int64 { + if x != nil { + return x.NextProps + } + return 0 +} + +type PlayRes_Chop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户数据id + ChopRewardId int64 `protobuf:"varint,2,opt,name=chop_reward_id,json=chopRewardId,proto3" json:"chop_reward_id,omitempty"` //选择的奖品id,没有选择的时候为0 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片(相对路径) + Percent float64 `protobuf:"fixed64,5,opt,name=percent,proto3" json:"percent,omitempty"` //进度百分比 + Finish bool `protobuf:"varint,6,opt,name=finish,proto3" json:"finish,omitempty"` //是否完成进度任务 + RewardId int64 `protobuf:"varint,7,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + RewardNone bool `protobuf:"varint,8,opt,name=reward_none,json=rewardNone,proto3" json:"reward_none,omitempty"` //是否没有可选奖品了 +} + +func (x *PlayRes_Chop) Reset() { + *x = PlayRes_Chop{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[226] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Chop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Chop) ProtoMessage() {} + +func (x *PlayRes_Chop) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[226] + 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 PlayRes_Chop.ProtoReflect.Descriptor instead. +func (*PlayRes_Chop) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 20} +} + +func (x *PlayRes_Chop) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Chop) GetChopRewardId() int64 { + if x != nil { + return x.ChopRewardId + } + return 0 +} + +func (x *PlayRes_Chop) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PlayRes_Chop) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *PlayRes_Chop) GetPercent() float64 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *PlayRes_Chop) GetFinish() bool { + if x != nil { + return x.Finish + } + return false +} + +func (x *PlayRes_Chop) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *PlayRes_Chop) GetRewardNone() bool { + if x != nil { + return x.RewardNone + } + return false +} + +type PlayRes_Cash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户数据id + NextStep string `protobuf:"bytes,2,opt,name=next_step,json=nextStep,proto3" json:"next_step,omitempty"` //进度节点 + Energy int32 `protobuf:"varint,3,opt,name=energy,proto3" json:"energy,omitempty"` //剩余能量数 + LotteryNum int32 `protobuf:"varint,4,opt,name=lottery_num,json=lotteryNum,proto3" json:"lottery_num,omitempty"` //抽奖次数 + ShowPrice float64 `protobuf:"fixed64,5,opt,name=show_price,json=showPrice,proto3" json:"show_price,omitempty"` //当前累计金额 + ExpiredIn int64 `protobuf:"varint,6,opt,name=expired_in,json=expiredIn,proto3" json:"expired_in,omitempty"` //任务重置剩余时间(单位:s) + Rewards []*PlayRes_GetReward `protobuf:"bytes,7,rep,name=rewards,proto3" json:"rewards,omitempty"` //领取的现金抽奖奖品 + HasAgain bool `protobuf:"varint,8,opt,name=has_again,json=hasAgain,proto3" json:"has_again,omitempty"` //是否可以再玩一次 +} + +func (x *PlayRes_Cash) Reset() { + *x = PlayRes_Cash{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[227] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Cash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Cash) ProtoMessage() {} + +func (x *PlayRes_Cash) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[227] + 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 PlayRes_Cash.ProtoReflect.Descriptor instead. +func (*PlayRes_Cash) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 21} +} + +func (x *PlayRes_Cash) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Cash) GetNextStep() string { + if x != nil { + return x.NextStep + } + return "" +} + +func (x *PlayRes_Cash) GetEnergy() int32 { + if x != nil { + return x.Energy + } + return 0 +} + +func (x *PlayRes_Cash) GetLotteryNum() int32 { + if x != nil { + return x.LotteryNum + } + return 0 +} + +func (x *PlayRes_Cash) GetShowPrice() float64 { + if x != nil { + return x.ShowPrice + } + return 0 +} + +func (x *PlayRes_Cash) GetExpiredIn() int64 { + if x != nil { + return x.ExpiredIn + } + return 0 +} + +func (x *PlayRes_Cash) GetRewards() []*PlayRes_GetReward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *PlayRes_Cash) GetHasAgain() bool { + if x != nil { + return x.HasAgain + } + return false +} + +type PlayRes_Gold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户数据id + NextStep string `protobuf:"bytes,2,opt,name=next_step,json=nextStep,proto3" json:"next_step,omitempty"` //进度节点(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, trigger_share-赠送能量) + Energy int32 `protobuf:"varint,3,opt,name=energy,proto3" json:"energy,omitempty"` //剩余能量数 + ShowPrice float64 `protobuf:"fixed64,4,opt,name=show_price,json=showPrice,proto3" json:"show_price,omitempty"` //当前累计金额 + ExpiredIn int64 `protobuf:"varint,5,opt,name=expired_in,json=expiredIn,proto3" json:"expired_in,omitempty"` //任务重置剩余时间(单位:s) + GoldNum int32 `protobuf:"varint,6,opt,name=gold_num,json=goldNum,proto3" json:"gold_num,omitempty"` //获得的金币数 + Rewards []*PlayRes_GetReward `protobuf:"bytes,7,rep,name=rewards,proto3" json:"rewards,omitempty"` //领取的现金抽奖奖品 + AddNum int32 `protobuf:"varint,8,opt,name=add_num,json=addNum,proto3" json:"add_num,omitempty"` //追加的金币数 + HideCoins int32 `protobuf:"varint,9,opt,name=hide_coins,json=hideCoins,proto3" json:"hide_coins,omitempty"` //是否隐藏金币(0-否,1-是) +} + +func (x *PlayRes_Gold) Reset() { + *x = PlayRes_Gold{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[228] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Gold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Gold) ProtoMessage() {} + +func (x *PlayRes_Gold) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[228] + 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 PlayRes_Gold.ProtoReflect.Descriptor instead. +func (*PlayRes_Gold) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 22} +} + +func (x *PlayRes_Gold) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Gold) GetNextStep() string { + if x != nil { + return x.NextStep + } + return "" +} + +func (x *PlayRes_Gold) GetEnergy() int32 { + if x != nil { + return x.Energy + } + return 0 +} + +func (x *PlayRes_Gold) GetShowPrice() float64 { + if x != nil { + return x.ShowPrice + } + return 0 +} + +func (x *PlayRes_Gold) GetExpiredIn() int64 { + if x != nil { + return x.ExpiredIn + } + return 0 +} + +func (x *PlayRes_Gold) GetGoldNum() int32 { + if x != nil { + return x.GoldNum + } + return 0 +} + +func (x *PlayRes_Gold) GetRewards() []*PlayRes_GetReward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *PlayRes_Gold) GetAddNum() int32 { + if x != nil { + return x.AddNum + } + return 0 +} + +func (x *PlayRes_Gold) GetHideCoins() int32 { + if x != nil { + return x.HideCoins + } + return 0 +} + +type PlayRes_GetReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //领奖记录hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + Img string `protobuf:"bytes,3,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + JumpUrl string `protobuf:"bytes,4,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + KvData []*PlayRes_KV `protobuf:"bytes,5,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `protobuf:"varint,6,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + Contact string `protobuf:"bytes,7,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + OpenToUse int32 `protobuf:"varint,9,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,10,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,11,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,12,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + PropMark string `protobuf:"bytes,13,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //道具标记 + RewardNum int32 `protobuf:"varint,14,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //奖品数量 + RewardId int64 `protobuf:"varint,15,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id +} + +func (x *PlayRes_GetReward) Reset() { + *x = PlayRes_GetReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[229] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_GetReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_GetReward) ProtoMessage() {} + +func (x *PlayRes_GetReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[229] + 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 PlayRes_GetReward.ProtoReflect.Descriptor instead. +func (*PlayRes_GetReward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 23} +} + +func (x *PlayRes_GetReward) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *PlayRes_GetReward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PlayRes_GetReward) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *PlayRes_GetReward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *PlayRes_GetReward) GetKvData() []*PlayRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *PlayRes_GetReward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *PlayRes_GetReward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *PlayRes_GetReward) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *PlayRes_GetReward) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *PlayRes_GetReward) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *PlayRes_GetReward) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *PlayRes_GetReward) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *PlayRes_GetReward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *PlayRes_GetReward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *PlayRes_GetReward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +type PlayRes_Keep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户数据id + Percent string `protobuf:"bytes,2,opt,name=percent,proto3" json:"percent,omitempty"` //进度 + Num int32 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //剩余总道具数 + MachineNum float64 `protobuf:"fixed64,4,opt,name=machine_num,json=machineNum,proto3" json:"machine_num,omitempty"` //机器产生的道具数 + FeedLack int32 `protobuf:"varint,5,opt,name=feed_lack,json=feedLack,proto3" json:"feed_lack,omitempty"` //还差多次喂养能获得狗粮 + Collect int32 `protobuf:"varint,6,opt,name=collect,proto3" json:"collect,omitempty"` //当前可收集的数量 + SecondPercent int32 `protobuf:"varint,7,opt,name=second_percent,json=secondPercent,proto3" json:"second_percent,omitempty"` //收集需要的二级资源进度 + ExpiredSec int64 `protobuf:"varint,8,opt,name=expired_sec,json=expiredSec,proto3" json:"expired_sec,omitempty"` //养成过期剩余秒数 + Reward *PlayRes_KeepReward `protobuf:"bytes,9,opt,name=Reward,proto3" json:"Reward,omitempty"` //选择的奖品 + LeftCollect int32 `protobuf:"varint,10,opt,name=left_collect,json=leftCollect,proto3" json:"left_collect,omitempty"` //还差的爱一级道具数 + Guided int32 `protobuf:"varint,11,opt,name=guided,proto3" json:"guided,omitempty"` //是否出现了指引 + DayFirstInvite int32 `protobuf:"varint,12,opt,name=day_first_invite,json=dayFirstInvite,proto3" json:"day_first_invite,omitempty"` //当天是否还没完成第一次邀请(0-否,1-是) + DayFirstExpiredSec int64 `protobuf:"varint,13,opt,name=day_first_expired_sec,json=dayFirstExpiredSec,proto3" json:"day_first_expired_sec,omitempty"` //首邀任务过期剩余秒数 + MachineLimit int32 `protobuf:"varint,14,opt,name=machine_limit,json=machineLimit,proto3" json:"machine_limit,omitempty"` //机器被限制(0-正常,1-每日限制) + OfflineFull int64 `protobuf:"varint,15,opt,name=offline_full,json=offlineFull,proto3" json:"offline_full,omitempty"` //离线狗粮机填满剩余秒数 +} + +func (x *PlayRes_Keep) Reset() { + *x = PlayRes_Keep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[230] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_Keep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_Keep) ProtoMessage() {} + +func (x *PlayRes_Keep) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[230] + 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 PlayRes_Keep.ProtoReflect.Descriptor instead. +func (*PlayRes_Keep) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 24} +} + +func (x *PlayRes_Keep) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_Keep) GetPercent() string { + if x != nil { + return x.Percent + } + return "" +} + +func (x *PlayRes_Keep) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *PlayRes_Keep) GetMachineNum() float64 { + if x != nil { + return x.MachineNum + } + return 0 +} + +func (x *PlayRes_Keep) GetFeedLack() int32 { + if x != nil { + return x.FeedLack + } + return 0 +} + +func (x *PlayRes_Keep) GetCollect() int32 { + if x != nil { + return x.Collect + } + return 0 +} + +func (x *PlayRes_Keep) GetSecondPercent() int32 { + if x != nil { + return x.SecondPercent + } + return 0 +} + +func (x *PlayRes_Keep) GetExpiredSec() int64 { + if x != nil { + return x.ExpiredSec + } + return 0 +} + +func (x *PlayRes_Keep) GetReward() *PlayRes_KeepReward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *PlayRes_Keep) GetLeftCollect() int32 { + if x != nil { + return x.LeftCollect + } + return 0 +} + +func (x *PlayRes_Keep) GetGuided() int32 { + if x != nil { + return x.Guided + } + return 0 +} + +func (x *PlayRes_Keep) GetDayFirstInvite() int32 { + if x != nil { + return x.DayFirstInvite + } + return 0 +} + +func (x *PlayRes_Keep) GetDayFirstExpiredSec() int64 { + if x != nil { + return x.DayFirstExpiredSec + } + return 0 +} + +func (x *PlayRes_Keep) GetMachineLimit() int32 { + if x != nil { + return x.MachineLimit + } + return 0 +} + +func (x *PlayRes_Keep) GetOfflineFull() int64 { + if x != nil { + return x.OfflineFull + } + return 0 +} + +type PlayRes_KeepReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + RecordId int64 `protobuf:"varint,4,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` //记录id +} + +func (x *PlayRes_KeepReward) Reset() { + *x = PlayRes_KeepReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[231] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayRes_KeepReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayRes_KeepReward) ProtoMessage() {} + +func (x *PlayRes_KeepReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[231] + 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 PlayRes_KeepReward.ProtoReflect.Descriptor instead. +func (*PlayRes_KeepReward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{7, 25} +} + +func (x *PlayRes_KeepReward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayRes_KeepReward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PlayRes_KeepReward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *PlayRes_KeepReward) GetRecordId() int64 { + if x != nil { + return x.RecordId + } + return 0 +} + +type RewardUserRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //活动用户外部id + PsuId string `protobuf:"bytes,2,opt,name=psu_id,json=psuId,proto3" json:"psu_id,omitempty"` //上级用户id + DirectNum int64 `protobuf:"varint,3,opt,name=direct_num,json=directNum,proto3" json:"direct_num,omitempty"` //直接裂变 + IndirectNum int64 `protobuf:"varint,4,opt,name=indirect_num,json=indirectNum,proto3" json:"indirect_num,omitempty"` //间接裂变 + Rewards []*RewardUserRes_Reward `protobuf:"bytes,5,rep,name=rewards,proto3" json:"rewards,omitempty"` //中奖奖品 +} + +func (x *RewardUserRes_One) Reset() { + *x = RewardUserRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[232] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardUserRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardUserRes_One) ProtoMessage() {} + +func (x *RewardUserRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[232] + 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 RewardUserRes_One.ProtoReflect.Descriptor instead. +func (*RewardUserRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *RewardUserRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *RewardUserRes_One) GetPsuId() string { + if x != nil { + return x.PsuId + } + return "" +} + +func (x *RewardUserRes_One) GetDirectNum() int64 { + if x != nil { + return x.DirectNum + } + return 0 +} + +func (x *RewardUserRes_One) GetIndirectNum() int64 { + if x != nil { + return x.IndirectNum + } + return 0 +} + +func (x *RewardUserRes_One) GetRewards() []*RewardUserRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type RewardUserRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CreatedTime int64 `protobuf:"varint,1,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //奖励时间时间戳 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 + RewardHashId string `protobuf:"bytes,3,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id +} + +func (x *RewardUserRes_Reward) Reset() { + *x = RewardUserRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[233] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardUserRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardUserRes_Reward) ProtoMessage() {} + +func (x *RewardUserRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[233] + 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 RewardUserRes_Reward.ProtoReflect.Descriptor instead. +func (*RewardUserRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *RewardUserRes_Reward) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +func (x *RewardUserRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardUserRes_Reward) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +type InfoRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CreatedTime int64 `protobuf:"varint,1,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //奖励时间时间戳 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 +} + +func (x *InfoRes_Reward) Reset() { + *x = InfoRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[234] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InfoRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoRes_Reward) ProtoMessage() {} + +func (x *InfoRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[234] + 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 InfoRes_Reward.ProtoReflect.Descriptor instead. +func (*InfoRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *InfoRes_Reward) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +func (x *InfoRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type RankRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //活动用户外部id + DirectNum int64 `protobuf:"varint,2,opt,name=direct_num,json=directNum,proto3" json:"direct_num,omitempty"` //直接下载数|注册数|达标数|签到达标数 + IndirectNum int64 `protobuf:"varint,3,opt,name=indirect_num,json=indirectNum,proto3" json:"indirect_num,omitempty"` //间接下载数|注册数|达标数|签到数 + Conds []*RankRes_Cond `protobuf:"bytes,4,rep,name=conds,proto3" json:"conds,omitempty"` //具体达标条件数据 仅当type=3时候有值 +} + +func (x *RankRes_One) Reset() { + *x = RankRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[235] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankRes_One) ProtoMessage() {} + +func (x *RankRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[235] + 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 RankRes_One.ProtoReflect.Descriptor instead. +func (*RankRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *RankRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *RankRes_One) GetDirectNum() int64 { + if x != nil { + return x.DirectNum + } + return 0 +} + +func (x *RankRes_One) GetIndirectNum() int64 { + if x != nil { + return x.IndirectNum + } + return 0 +} + +func (x *RankRes_One) GetConds() []*RankRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type RankRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` //条件说明 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //完成次数 +} + +func (x *RankRes_Cond) Reset() { + *x = RankRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[236] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankRes_Cond) ProtoMessage() {} + +func (x *RankRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[236] + 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 RankRes_Cond.ProtoReflect.Descriptor instead. +func (*RankRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{13, 1} +} + +func (x *RankRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *RankRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type LotteryRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *LotteryRes_KV) Reset() { + *x = LotteryRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[237] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LotteryRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LotteryRes_KV) ProtoMessage() {} + +func (x *LotteryRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[237] + 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 LotteryRes_KV.ProtoReflect.Descriptor instead. +func (*LotteryRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *LotteryRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *LotteryRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *LotteryRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type AnswerReq_Submit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Qid int64 `protobuf:"varint,1,opt,name=qid,proto3" json:"qid,omitempty"` //题目id + Aid []int64 `protobuf:"varint,2,rep,packed,name=aid,proto3" json:"aid,omitempty"` //答案id +} + +func (x *AnswerReq_Submit) Reset() { + *x = AnswerReq_Submit{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[238] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerReq_Submit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerReq_Submit) ProtoMessage() {} + +func (x *AnswerReq_Submit) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[238] + 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 AnswerReq_Submit.ProtoReflect.Descriptor instead. +func (*AnswerReq_Submit) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *AnswerReq_Submit) GetQid() int64 { + if x != nil { + return x.Qid + } + return 0 +} + +func (x *AnswerReq_Submit) GetAid() []int64 { + if x != nil { + return x.Aid + } + return nil +} + +type AnswerRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *AnswerRes_KV) Reset() { + *x = AnswerRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[239] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerRes_KV) ProtoMessage() {} + +func (x *AnswerRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[239] + 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 AnswerRes_KV.ProtoReflect.Descriptor instead. +func (*AnswerRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{17, 0} +} + +func (x *AnswerRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *AnswerRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *AnswerRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type AnswerHistoryRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //问题ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,5,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,6,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + ExplainText string `protobuf:"bytes,7,opt,name=explain_text,json=explainText,proto3" json:"explain_text,omitempty"` //答案解析 + ExplainImg string `protobuf:"bytes,8,opt,name=explain_img,json=explainImg,proto3" json:"explain_img,omitempty"` //答案解析图 + Options []*AnswerHistoryRes_Option `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` //选项 + AnswerMark string `protobuf:"bytes,10,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) + SelectOptionId []int64 `protobuf:"varint,11,rep,packed,name=select_option_id,json=selectOptionId,proto3" json:"select_option_id,omitempty"` //选择的选项id +} + +func (x *AnswerHistoryRes_One) Reset() { + *x = AnswerHistoryRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[240] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerHistoryRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerHistoryRes_One) ProtoMessage() {} + +func (x *AnswerHistoryRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[240] + 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 AnswerHistoryRes_One.ProtoReflect.Descriptor instead. +func (*AnswerHistoryRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{19, 0} +} + +func (x *AnswerHistoryRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AnswerHistoryRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *AnswerHistoryRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *AnswerHistoryRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AnswerHistoryRes_One) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *AnswerHistoryRes_One) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *AnswerHistoryRes_One) GetExplainText() string { + if x != nil { + return x.ExplainText + } + return "" +} + +func (x *AnswerHistoryRes_One) GetExplainImg() string { + if x != nil { + return x.ExplainImg + } + return "" +} + +func (x *AnswerHistoryRes_One) GetOptions() []*AnswerHistoryRes_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *AnswerHistoryRes_One) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +func (x *AnswerHistoryRes_One) GetSelectOptionId() []int64 { + if x != nil { + return x.SelectOptionId + } + return nil +} + +type AnswerHistoryRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确 +} + +func (x *AnswerHistoryRes_Option) Reset() { + *x = AnswerHistoryRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[241] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnswerHistoryRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnswerHistoryRes_Option) ProtoMessage() {} + +func (x *AnswerHistoryRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[241] + 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 AnswerHistoryRes_Option.ProtoReflect.Descriptor instead. +func (*AnswerHistoryRes_Option) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{19, 1} +} + +func (x *AnswerHistoryRes_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AnswerHistoryRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AnswerHistoryRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *AnswerHistoryRes_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type TargetRuleRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户id + Cond []*TargetRuleRes_Cond `protobuf:"bytes,2,rep,name=cond,proto3" json:"cond,omitempty"` //条件 +} + +func (x *TargetRuleRes_One) Reset() { + *x = TargetRuleRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[242] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetRuleRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetRuleRes_One) ProtoMessage() {} + +func (x *TargetRuleRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[242] + 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 TargetRuleRes_One.ProtoReflect.Descriptor instead. +func (*TargetRuleRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{27, 0} +} + +func (x *TargetRuleRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *TargetRuleRes_One) GetCond() []*TargetRuleRes_Cond { + if x != nil { + return x.Cond + } + return nil +} + +type TargetRuleRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` //达标条件 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //完成次数 + CondId int64 `protobuf:"varint,3,opt,name=cond_id,json=condId,proto3" json:"cond_id,omitempty"` //达标条件ID +} + +func (x *TargetRuleRes_Cond) Reset() { + *x = TargetRuleRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[243] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TargetRuleRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TargetRuleRes_Cond) ProtoMessage() {} + +func (x *TargetRuleRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[243] + 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 TargetRuleRes_Cond.ProtoReflect.Descriptor instead. +func (*TargetRuleRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{27, 1} +} + +func (x *TargetRuleRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *TargetRuleRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *TargetRuleRes_Cond) GetCondId() int64 { + if x != nil { + return x.CondId + } + return 0 +} + +type TaskRes_Day struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //每日访问活动(如:骰子数) + CanDo bool `protobuf:"varint,3,opt,name=can_do,json=canDo,proto3" json:"can_do,omitempty"` //是否可完成 +} + +func (x *TaskRes_Day) Reset() { + *x = TaskRes_Day{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[244] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes_Day) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes_Day) ProtoMessage() {} + +func (x *TaskRes_Day) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[244] + 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 TaskRes_Day.ProtoReflect.Descriptor instead. +func (*TaskRes_Day) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29, 0} +} + +func (x *TaskRes_Day) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *TaskRes_Day) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *TaskRes_Day) GetCanDo() bool { + if x != nil { + return x.CanDo + } + return false +} + +type TaskRes_Fixed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + AppEvent int32 `protobuf:"varint,2,opt,name=app_event,json=appEvent,proto3" json:"app_event,omitempty"` //固定事件类型(1-安装;2-注册) + TargetNum int32 `protobuf:"varint,3,opt,name=target_num,json=targetNum,proto3" json:"target_num,omitempty"` //达标条件需要的新用户个数 + Chance int32 `protobuf:"varint,4,opt,name=chance,proto3" json:"chance,omitempty"` //达标获得的数量(如:骰子数) + ChanceLimit int32 `protobuf:"varint,5,opt,name=chance_limit,json=chanceLimit,proto3" json:"chance_limit,omitempty"` //最大获得数量(如:最大骰子数) + CanDo bool `protobuf:"varint,6,opt,name=can_do,json=canDo,proto3" json:"can_do,omitempty"` //是否可完成 +} + +func (x *TaskRes_Fixed) Reset() { + *x = TaskRes_Fixed{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[245] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes_Fixed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes_Fixed) ProtoMessage() {} + +func (x *TaskRes_Fixed) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[245] + 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 TaskRes_Fixed.ProtoReflect.Descriptor instead. +func (*TaskRes_Fixed) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29, 1} +} + +func (x *TaskRes_Fixed) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *TaskRes_Fixed) GetAppEvent() int32 { + if x != nil { + return x.AppEvent + } + return 0 +} + +func (x *TaskRes_Fixed) GetTargetNum() int32 { + if x != nil { + return x.TargetNum + } + return 0 +} + +func (x *TaskRes_Fixed) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *TaskRes_Fixed) GetChanceLimit() int32 { + if x != nil { + return x.ChanceLimit + } + return 0 +} + +func (x *TaskRes_Fixed) GetCanDo() bool { + if x != nil { + return x.CanDo + } + return false +} + +type TaskRes_Custom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + BothType int32 `protobuf:"varint,2,opt,name=both_type,json=bothType,proto3" json:"both_type,omitempty"` //满足条件(1-所有条件满足,2-任一条件满足) + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //总发放的数(如:骰子数) + Cond []*TaskRes_Cond `protobuf:"bytes,4,rep,name=cond,proto3" json:"cond,omitempty"` //达标条件 + BothAll *TaskRes_BothAll `protobuf:"bytes,5,opt,name=both_all,json=bothAll,proto3" json:"both_all,omitempty"` //满足条件为所有条件满足要提交的数据 +} + +func (x *TaskRes_Custom) Reset() { + *x = TaskRes_Custom{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[246] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes_Custom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes_Custom) ProtoMessage() {} + +func (x *TaskRes_Custom) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[246] + 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 TaskRes_Custom.ProtoReflect.Descriptor instead. +func (*TaskRes_Custom) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29, 2} +} + +func (x *TaskRes_Custom) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *TaskRes_Custom) GetBothType() int32 { + if x != nil { + return x.BothType + } + return 0 +} + +func (x *TaskRes_Custom) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *TaskRes_Custom) GetCond() []*TaskRes_Cond { + if x != nil { + return x.Cond + } + return nil +} + +func (x *TaskRes_Custom) GetBothAll() *TaskRes_BothAll { + if x != nil { + return x.BothAll + } + return nil +} + +type TaskRes_BothAll struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskChance int32 `protobuf:"varint,1,opt,name=task_chance,json=taskChance,proto3" json:"task_chance,omitempty"` //完成任务获得的次数(如:骰子数) + TaskLimit int32 `protobuf:"varint,2,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务最大可完成次数(0不限制) + Finish int64 `protobuf:"varint,3,opt,name=finish,proto3" json:"finish,omitempty"` //完成任务的次数 + Reward *TaskRes_Reward `protobuf:"bytes,4,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,5,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + TaskId int64 `protobuf:"varint,6,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` //任务id +} + +func (x *TaskRes_BothAll) Reset() { + *x = TaskRes_BothAll{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[247] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes_BothAll) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes_BothAll) ProtoMessage() {} + +func (x *TaskRes_BothAll) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[247] + 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 TaskRes_BothAll.ProtoReflect.Descriptor instead. +func (*TaskRes_BothAll) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29, 3} +} + +func (x *TaskRes_BothAll) GetTaskChance() int32 { + if x != nil { + return x.TaskChance + } + return 0 +} + +func (x *TaskRes_BothAll) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *TaskRes_BothAll) GetFinish() int64 { + if x != nil { + return x.Finish + } + return 0 +} + +func (x *TaskRes_BothAll) GetReward() *TaskRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *TaskRes_BothAll) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *TaskRes_BothAll) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +type TaskRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //达标条件ID + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //达标条件 + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //完成次数 + IfCond int32 `protobuf:"varint,4,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + Total string `protobuf:"bytes,5,opt,name=total,proto3" json:"total,omitempty"` //累计值 + Event string `protobuf:"bytes,6,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,7,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,8,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 + TaskChance int32 `protobuf:"varint,9,opt,name=task_chance,json=taskChance,proto3" json:"task_chance,omitempty"` //完成发放的次数(如:骰子数) + TaskLimit int32 `protobuf:"varint,10,opt,name=task_limit,json=taskLimit,proto3" json:"task_limit,omitempty"` //任务最大可完成次数(0不限制) + CanDo bool `protobuf:"varint,11,opt,name=can_do,json=canDo,proto3" json:"can_do,omitempty"` //是否可完成 + WebUrl string `protobuf:"bytes,12,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端跳转地址 + AppParam string `protobuf:"bytes,13,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //app事件参数 + TomorrowCanDo bool `protobuf:"varint,14,opt,name=tomorrow_can_do,json=tomorrowCanDo,proto3" json:"tomorrow_can_do,omitempty"` //是否显示明天再来 + EventType int32 `protobuf:"varint,15,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件来源(1-自定义事件,2-广告事件) + ViewType int32 `protobuf:"varint,16,opt,name=view_type,json=viewType,proto3" json:"view_type,omitempty"` //广告观看路径(1-APP内,2-APP外) + WeekCanDo int32 `protobuf:"varint,17,opt,name=week_can_do,json=weekCanDo,proto3" json:"week_can_do,omitempty"` //周状态(0-可做,1-下周再来,2-周几再来) + WeekNum int32 `protobuf:"varint,18,opt,name=week_num,json=weekNum,proto3" json:"week_num,omitempty"` //周几 + GoShow int32 `protobuf:"varint,19,opt,name=go_show,json=goShow,proto3" json:"go_show,omitempty"` //是否显示“去完成按钮”(0-否,1-是) + AdsStrategyId string `protobuf:"bytes,20,opt,name=ads_strategy_id,json=adsStrategyId,proto3" json:"ads_strategy_id,omitempty"` //策略id + IsSuper int32 `protobuf:"varint,21,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级任务(0-否,1-是) + HasPre int32 `protobuf:"varint,22,opt,name=has_pre,json=hasPre,proto3" json:"has_pre,omitempty"` //是否有前置任务(0-否,1-是) + Reward *TaskRes_Reward `protobuf:"bytes,23,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + PropMark string `protobuf:"bytes,24,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品) + ExpiredSec int64 `protobuf:"varint,25,opt,name=expired_sec,json=expiredSec,proto3" json:"expired_sec,omitempty"` //前置条件过期剩余的秒数 + PcParam string `protobuf:"bytes,26,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //app事件参数 + TaskId int64 `protobuf:"varint,27,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` //任务id + HasReceive int32 `protobuf:"varint,28,opt,name=has_receive,json=hasReceive,proto3" json:"has_receive,omitempty"` //是否有可领取奖品(0-否,1-是) + TriggerType int32 `protobuf:"varint,29,opt,name=trigger_type,json=triggerType,proto3" json:"trigger_type,omitempty"` //事件触发条件(1-点击去完成按钮,2-全局监听) + GoText string `protobuf:"bytes,30,opt,name=go_text,json=goText,proto3" json:"go_text,omitempty"` //去完成文案 + ClickEffectOpen int32 `protobuf:"varint,31,opt,name=click_effect_open,json=clickEffectOpen,proto3" json:"click_effect_open,omitempty"` //是否开启点击有效(0-否,1-是) + ClickEffect int32 `protobuf:"varint,32,opt,name=click_effect,json=clickEffect,proto3" json:"click_effect,omitempty"` //点击有效值 + ClickEffectUnit string `protobuf:"bytes,33,opt,name=click_effect_unit,json=clickEffectUnit,proto3" json:"click_effect_unit,omitempty"` //点击有效单位(min-分钟,hour-小时,day-天) + PullInvite int32 `protobuf:"varint,34,opt,name=pull_invite,json=pullInvite,proto3" json:"pull_invite,omitempty"` //是否拉取邀请(0-否,1-是) +} + +func (x *TaskRes_Cond) Reset() { + *x = TaskRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[248] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes_Cond) ProtoMessage() {} + +func (x *TaskRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[248] + 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 TaskRes_Cond.ProtoReflect.Descriptor instead. +func (*TaskRes_Cond) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29, 4} +} + +func (x *TaskRes_Cond) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TaskRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *TaskRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *TaskRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *TaskRes_Cond) GetTotal() string { + if x != nil { + return x.Total + } + return "" +} + +func (x *TaskRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *TaskRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *TaskRes_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +func (x *TaskRes_Cond) GetTaskChance() int32 { + if x != nil { + return x.TaskChance + } + return 0 +} + +func (x *TaskRes_Cond) GetTaskLimit() int32 { + if x != nil { + return x.TaskLimit + } + return 0 +} + +func (x *TaskRes_Cond) GetCanDo() bool { + if x != nil { + return x.CanDo + } + return false +} + +func (x *TaskRes_Cond) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *TaskRes_Cond) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *TaskRes_Cond) GetTomorrowCanDo() bool { + if x != nil { + return x.TomorrowCanDo + } + return false +} + +func (x *TaskRes_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *TaskRes_Cond) GetViewType() int32 { + if x != nil { + return x.ViewType + } + return 0 +} + +func (x *TaskRes_Cond) GetWeekCanDo() int32 { + if x != nil { + return x.WeekCanDo + } + return 0 +} + +func (x *TaskRes_Cond) GetWeekNum() int32 { + if x != nil { + return x.WeekNum + } + return 0 +} + +func (x *TaskRes_Cond) GetGoShow() int32 { + if x != nil { + return x.GoShow + } + return 0 +} + +func (x *TaskRes_Cond) GetAdsStrategyId() string { + if x != nil { + return x.AdsStrategyId + } + return "" +} + +func (x *TaskRes_Cond) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *TaskRes_Cond) GetHasPre() int32 { + if x != nil { + return x.HasPre + } + return 0 +} + +func (x *TaskRes_Cond) GetReward() *TaskRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *TaskRes_Cond) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *TaskRes_Cond) GetExpiredSec() int64 { + if x != nil { + return x.ExpiredSec + } + return 0 +} + +func (x *TaskRes_Cond) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *TaskRes_Cond) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *TaskRes_Cond) GetHasReceive() int32 { + if x != nil { + return x.HasReceive + } + return 0 +} + +func (x *TaskRes_Cond) GetTriggerType() int32 { + if x != nil { + return x.TriggerType + } + return 0 +} + +func (x *TaskRes_Cond) GetGoText() string { + if x != nil { + return x.GoText + } + return "" +} + +func (x *TaskRes_Cond) GetClickEffectOpen() int32 { + if x != nil { + return x.ClickEffectOpen + } + return 0 +} + +func (x *TaskRes_Cond) GetClickEffect() int32 { + if x != nil { + return x.ClickEffect + } + return 0 +} + +func (x *TaskRes_Cond) GetClickEffectUnit() string { + if x != nil { + return x.ClickEffectUnit + } + return "" +} + +func (x *TaskRes_Cond) GetPullInvite() int32 { + if x != nil { + return x.PullInvite + } + return 0 +} + +type TaskRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 +} + +func (x *TaskRes_Reward) Reset() { + *x = TaskRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[249] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskRes_Reward) ProtoMessage() {} + +func (x *TaskRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[249] + 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 TaskRes_Reward.ProtoReflect.Descriptor instead. +func (*TaskRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{29, 5} +} + +func (x *TaskRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TaskRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TaskRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type DynamicLinkReq_ImageText struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NickName string `protobuf:"bytes,1,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` //用户昵称 + Avatar string `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"` //用户头像 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //内容标题 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //内容描述 + Image string `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"` //内容封面 +} + +func (x *DynamicLinkReq_ImageText) Reset() { + *x = DynamicLinkReq_ImageText{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[250] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DynamicLinkReq_ImageText) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DynamicLinkReq_ImageText) ProtoMessage() {} + +func (x *DynamicLinkReq_ImageText) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[250] + 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 DynamicLinkReq_ImageText.ProtoReflect.Descriptor instead. +func (*DynamicLinkReq_ImageText) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{32, 0} +} + +func (x *DynamicLinkReq_ImageText) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *DynamicLinkReq_ImageText) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *DynamicLinkReq_ImageText) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DynamicLinkReq_ImageText) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *DynamicLinkReq_ImageText) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +type DylinkShowRes_ImageText struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NickName string `protobuf:"bytes,1,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` //用户昵称 + Avatar string `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"` //用户头像 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //内容标题 + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` //内容描述 + Image string `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"` //内容封面 +} + +func (x *DylinkShowRes_ImageText) Reset() { + *x = DylinkShowRes_ImageText{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[251] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DylinkShowRes_ImageText) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DylinkShowRes_ImageText) ProtoMessage() {} + +func (x *DylinkShowRes_ImageText) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[251] + 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 DylinkShowRes_ImageText.ProtoReflect.Descriptor instead. +func (*DylinkShowRes_ImageText) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{35, 0} +} + +func (x *DylinkShowRes_ImageText) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *DylinkShowRes_ImageText) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *DylinkShowRes_ImageText) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DylinkShowRes_ImageText) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *DylinkShowRes_ImageText) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +type SignInRes_SignDate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Y string `protobuf:"bytes,1,opt,name=y,proto3" json:"y,omitempty"` //年 + M string `protobuf:"bytes,2,opt,name=m,proto3" json:"m,omitempty"` //月 + D string `protobuf:"bytes,3,opt,name=d,proto3" json:"d,omitempty"` //日 + SignIn int32 `protobuf:"varint,4,opt,name=sign_in,json=signIn,proto3" json:"sign_in,omitempty"` //签到类型(0-未签,1-已签,2-漏签) + Ban bool `protobuf:"varint,5,opt,name=ban,proto3" json:"ban,omitempty"` //是否非签到日期 + RewardId int64 `protobuf:"varint,6,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id,0即没有礼物 + Open bool `protobuf:"varint,7,opt,name=open,proto3" json:"open,omitempty"` //是否已经领奖 + NowWeek bool `protobuf:"varint,8,opt,name=now_week,json=nowWeek,proto3" json:"now_week,omitempty"` //是否本周 + NowDay bool `protobuf:"varint,9,opt,name=now_day,json=nowDay,proto3" json:"now_day,omitempty"` //是否今天 + LastMiss bool `protobuf:"varint,10,opt,name=last_miss,json=lastMiss,proto3" json:"last_miss,omitempty"` //是否最后一个漏签 + NowMouth bool `protobuf:"varint,11,opt,name=now_mouth,json=nowMouth,proto3" json:"now_mouth,omitempty"` //是否本月 +} + +func (x *SignInRes_SignDate) Reset() { + *x = SignInRes_SignDate{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[252] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInRes_SignDate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInRes_SignDate) ProtoMessage() {} + +func (x *SignInRes_SignDate) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[252] + 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 SignInRes_SignDate.ProtoReflect.Descriptor instead. +func (*SignInRes_SignDate) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{37, 0} +} + +func (x *SignInRes_SignDate) GetY() string { + if x != nil { + return x.Y + } + return "" +} + +func (x *SignInRes_SignDate) GetM() string { + if x != nil { + return x.M + } + return "" +} + +func (x *SignInRes_SignDate) GetD() string { + if x != nil { + return x.D + } + return "" +} + +func (x *SignInRes_SignDate) GetSignIn() int32 { + if x != nil { + return x.SignIn + } + return 0 +} + +func (x *SignInRes_SignDate) GetBan() bool { + if x != nil { + return x.Ban + } + return false +} + +func (x *SignInRes_SignDate) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *SignInRes_SignDate) GetOpen() bool { + if x != nil { + return x.Open + } + return false +} + +func (x *SignInRes_SignDate) GetNowWeek() bool { + if x != nil { + return x.NowWeek + } + return false +} + +func (x *SignInRes_SignDate) GetNowDay() bool { + if x != nil { + return x.NowDay + } + return false +} + +func (x *SignInRes_SignDate) GetLastMiss() bool { + if x != nil { + return x.LastMiss + } + return false +} + +func (x *SignInRes_SignDate) GetNowMouth() bool { + if x != nil { + return x.NowMouth + } + return false +} + +type SignInRes_CycleDate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignTime int64 `protobuf:"varint,1,opt,name=sign_time,json=signTime,proto3" json:"sign_time,omitempty"` //签到时间 + SignIn int32 `protobuf:"varint,2,opt,name=sign_in,json=signIn,proto3" json:"sign_in,omitempty"` //签到类型(0-未签,1-已签,2-漏签) + NowDay bool `protobuf:"varint,3,opt,name=now_day,json=nowDay,proto3" json:"now_day,omitempty"` //是否今天 + RewardId int64 `protobuf:"varint,4,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id,0即没有礼物 + RewardImg string `protobuf:"bytes,5,opt,name=reward_img,json=rewardImg,proto3" json:"reward_img,omitempty"` //奖品图片 + RewardTitle string `protobuf:"bytes,6,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + IsSuper int32 `protobuf:"varint,7,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + Y string `protobuf:"bytes,8,opt,name=y,proto3" json:"y,omitempty"` //年 + M string `protobuf:"bytes,9,opt,name=m,proto3" json:"m,omitempty"` //月 + D string `protobuf:"bytes,10,opt,name=d,proto3" json:"d,omitempty"` //日 +} + +func (x *SignInRes_CycleDate) Reset() { + *x = SignInRes_CycleDate{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[253] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignInRes_CycleDate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignInRes_CycleDate) ProtoMessage() {} + +func (x *SignInRes_CycleDate) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[253] + 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 SignInRes_CycleDate.ProtoReflect.Descriptor instead. +func (*SignInRes_CycleDate) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{37, 1} +} + +func (x *SignInRes_CycleDate) GetSignTime() int64 { + if x != nil { + return x.SignTime + } + return 0 +} + +func (x *SignInRes_CycleDate) GetSignIn() int32 { + if x != nil { + return x.SignIn + } + return 0 +} + +func (x *SignInRes_CycleDate) GetNowDay() bool { + if x != nil { + return x.NowDay + } + return false +} + +func (x *SignInRes_CycleDate) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *SignInRes_CycleDate) GetRewardImg() string { + if x != nil { + return x.RewardImg + } + return "" +} + +func (x *SignInRes_CycleDate) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *SignInRes_CycleDate) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *SignInRes_CycleDate) GetY() string { + if x != nil { + return x.Y + } + return "" +} + +func (x *SignInRes_CycleDate) GetM() string { + if x != nil { + return x.M + } + return "" +} + +func (x *SignInRes_CycleDate) GetD() string { + if x != nil { + return x.D + } + return "" +} + +type SignRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *SignRes_KV) Reset() { + *x = SignRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[254] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignRes_KV) ProtoMessage() {} + +func (x *SignRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[254] + 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 SignRes_KV.ProtoReflect.Descriptor instead. +func (*SignRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{39, 0} +} + +func (x *SignRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *SignRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type DiceMapRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MapHashId string `protobuf:"bytes,1,opt,name=map_hash_id,json=mapHashId,proto3" json:"map_hash_id,omitempty"` //地图id + MarkType int32 `protobuf:"varint,2,opt,name=mark_type,json=markType,proto3" json:"mark_type,omitempty"` //格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几)) + RewardTitle string `protobuf:"bytes,3,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + RewardId int64 `protobuf:"varint,5,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品Id +} + +func (x *DiceMapRes_One) Reset() { + *x = DiceMapRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[255] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceMapRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceMapRes_One) ProtoMessage() {} + +func (x *DiceMapRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[255] + 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 DiceMapRes_One.ProtoReflect.Descriptor instead. +func (*DiceMapRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{41, 0} +} + +func (x *DiceMapRes_One) GetMapHashId() string { + if x != nil { + return x.MapHashId + } + return "" +} + +func (x *DiceMapRes_One) GetMarkType() int32 { + if x != nil { + return x.MarkType + } + return 0 +} + +func (x *DiceMapRes_One) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *DiceMapRes_One) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *DiceMapRes_One) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +type FeedRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *FeedRes_KV) Reset() { + *x = FeedRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[256] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeedRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeedRes_KV) ProtoMessage() {} + +func (x *FeedRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[256] + 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 FeedRes_KV.ProtoReflect.Descriptor instead. +func (*FeedRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{49, 0} +} + +func (x *FeedRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *FeedRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type GrowRecordRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Date string `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"` //日期 + Records []*GrowRecordRes_Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"` //记录 +} + +func (x *GrowRecordRes_One) Reset() { + *x = GrowRecordRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[257] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowRecordRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowRecordRes_One) ProtoMessage() {} + +func (x *GrowRecordRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[257] + 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 GrowRecordRes_One.ProtoReflect.Descriptor instead. +func (*GrowRecordRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{53, 0} +} + +func (x *GrowRecordRes_One) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *GrowRecordRes_One) GetRecords() []*GrowRecordRes_Record { + if x != nil { + return x.Records + } + return nil +} + +type GrowRecordRes_Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //标识(feed-喂养,get_grow-领取生命体,lv_up-升级,get_reward-领奖) + His string `protobuf:"bytes,2,opt,name=his,proto3" json:"his,omitempty"` //时分秒 + VarData []*GrowRecordRes_KV `protobuf:"bytes,3,rep,name=var_data,json=varData,proto3" json:"var_data,omitempty"` //变量数据 +} + +func (x *GrowRecordRes_Record) Reset() { + *x = GrowRecordRes_Record{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[258] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowRecordRes_Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowRecordRes_Record) ProtoMessage() {} + +func (x *GrowRecordRes_Record) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[258] + 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 GrowRecordRes_Record.ProtoReflect.Descriptor instead. +func (*GrowRecordRes_Record) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{53, 1} +} + +func (x *GrowRecordRes_Record) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *GrowRecordRes_Record) GetHis() string { + if x != nil { + return x.His + } + return "" +} + +func (x *GrowRecordRes_Record) GetVarData() []*GrowRecordRes_KV { + if x != nil { + return x.VarData + } + return nil +} + +type GrowRecordRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应语言包的关键字,如:{{num}} + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //关键字替换的值 + IdMark int64 `protobuf:"varint,3,opt,name=id_mark,json=idMark,proto3" json:"id_mark,omitempty"` //数字id标识 +} + +func (x *GrowRecordRes_KV) Reset() { + *x = GrowRecordRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[259] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrowRecordRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrowRecordRes_KV) ProtoMessage() {} + +func (x *GrowRecordRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[259] + 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 GrowRecordRes_KV.ProtoReflect.Descriptor instead. +func (*GrowRecordRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{53, 2} +} + +func (x *GrowRecordRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GrowRecordRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *GrowRecordRes_KV) GetIdMark() int64 { + if x != nil { + return x.IdMark + } + return 0 +} + +type LinkContentRes_Qa struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //问题ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,5,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,6,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + Options []*LinkContentRes_Option `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` //选项 + AnswerMark string `protobuf:"bytes,8,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) + HomeShare bool `protobuf:"varint,9,opt,name=home_share,json=homeShare,proto3" json:"home_share,omitempty"` //是否首页分享 +} + +func (x *LinkContentRes_Qa) Reset() { + *x = LinkContentRes_Qa{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[260] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentRes_Qa) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentRes_Qa) ProtoMessage() {} + +func (x *LinkContentRes_Qa) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[260] + 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 LinkContentRes_Qa.ProtoReflect.Descriptor instead. +func (*LinkContentRes_Qa) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{57, 0} +} + +func (x *LinkContentRes_Qa) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkContentRes_Qa) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *LinkContentRes_Qa) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *LinkContentRes_Qa) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LinkContentRes_Qa) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *LinkContentRes_Qa) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *LinkContentRes_Qa) GetOptions() []*LinkContentRes_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *LinkContentRes_Qa) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +func (x *LinkContentRes_Qa) GetHomeShare() bool { + if x != nil { + return x.HomeShare + } + return false +} + +type LinkContentRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 +} + +func (x *LinkContentRes_Option) Reset() { + *x = LinkContentRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[261] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentRes_Option) ProtoMessage() {} + +func (x *LinkContentRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[261] + 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 LinkContentRes_Option.ProtoReflect.Descriptor instead. +func (*LinkContentRes_Option) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{57, 1} +} + +func (x *LinkContentRes_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkContentRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LinkContentRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type LinkContentRes_Ballot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片(相对路径) +} + +func (x *LinkContentRes_Ballot) Reset() { + *x = LinkContentRes_Ballot{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[262] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentRes_Ballot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentRes_Ballot) ProtoMessage() {} + +func (x *LinkContentRes_Ballot) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[262] + 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 LinkContentRes_Ballot.ProtoReflect.Descriptor instead. +func (*LinkContentRes_Ballot) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{57, 2} +} + +func (x *LinkContentRes_Ballot) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkContentRes_Ballot) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LinkContentRes_Ballot) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type LinkContentRes_Chop struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rewards []*LinkContentRes_ChopReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品列表 +} + +func (x *LinkContentRes_Chop) Reset() { + *x = LinkContentRes_Chop{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[263] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentRes_Chop) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentRes_Chop) ProtoMessage() {} + +func (x *LinkContentRes_Chop) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[263] + 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 LinkContentRes_Chop.ProtoReflect.Descriptor instead. +func (*LinkContentRes_Chop) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{57, 3} +} + +func (x *LinkContentRes_Chop) GetRewards() []*LinkContentRes_ChopReward { + if x != nil { + return x.Rewards + } + return nil +} + +type LinkContentRes_ChopReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,2,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片(相对路径) + Selected bool `protobuf:"varint,3,opt,name=selected,proto3" json:"selected,omitempty"` //是否选中 + Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"` //奖品id +} + +func (x *LinkContentRes_ChopReward) Reset() { + *x = LinkContentRes_ChopReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[264] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkContentRes_ChopReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkContentRes_ChopReward) ProtoMessage() {} + +func (x *LinkContentRes_ChopReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[264] + 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 LinkContentRes_ChopReward.ProtoReflect.Descriptor instead. +func (*LinkContentRes_ChopReward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{57, 4} +} + +func (x *LinkContentRes_ChopReward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LinkContentRes_ChopReward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *LinkContentRes_ChopReward) GetSelected() bool { + if x != nil { + return x.Selected + } + return false +} + +func (x *LinkContentRes_ChopReward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ChopHelpRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动ID + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //助力标识 + Percent float64 `protobuf:"fixed64,3,opt,name=percent,proto3" json:"percent,omitempty"` //助力百分比 + CreatedTime int64 `protobuf:"varint,4,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //助力时间戳 +} + +func (x *ChopHelpRes_One) Reset() { + *x = ChopHelpRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[265] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopHelpRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopHelpRes_One) ProtoMessage() {} + +func (x *ChopHelpRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[265] + 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 ChopHelpRes_One.ProtoReflect.Descriptor instead. +func (*ChopHelpRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{63, 0} +} + +func (x *ChopHelpRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChopHelpRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *ChopHelpRes_One) GetPercent() float64 { + if x != nil { + return x.Percent + } + return 0 +} + +func (x *ChopHelpRes_One) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +type ProjectListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动用户ID + SubUserId string `protobuf:"bytes,2,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //第三方用户的user_id + HashId string `protobuf:"bytes,3,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动用户对外id + CampaignTitle string `protobuf:"bytes,4,opt,name=campaign_title,json=campaignTitle,proto3" json:"campaign_title,omitempty"` //活动标题 + CampaignHashId string `protobuf:"bytes,5,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + CreatedAt int64 `protobuf:"varint,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + EffectNum int64 `protobuf:"varint,7,opt,name=effect_num,json=effectNum,proto3" json:"effect_num,omitempty"` //有效拉新人数 + IsNew int32 `protobuf:"varint,8,opt,name=is_new,json=isNew,proto3" json:"is_new,omitempty"` //是否新用户(0-否,1-是) + HelpStatus int32 `protobuf:"varint,9,opt,name=help_status,json=helpStatus,proto3" json:"help_status,omitempty"` //助力状态(0-无此状态,1-助力成功,2-助力失败) +} + +func (x *ProjectListRes_One) Reset() { + *x = ProjectListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[266] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectListRes_One) ProtoMessage() {} + +func (x *ProjectListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[266] + 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 ProjectListRes_One.ProtoReflect.Descriptor instead. +func (*ProjectListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{65, 0} +} + +func (x *ProjectListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ProjectListRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *ProjectListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ProjectListRes_One) GetCampaignTitle() string { + if x != nil { + return x.CampaignTitle + } + return "" +} + +func (x *ProjectListRes_One) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *ProjectListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ProjectListRes_One) GetEffectNum() int64 { + if x != nil { + return x.EffectNum + } + return 0 +} + +func (x *ProjectListRes_One) GetIsNew() int32 { + if x != nil { + return x.IsNew + } + return 0 +} + +func (x *ProjectListRes_One) GetHelpStatus() int32 { + if x != nil { + return x.HelpStatus + } + return 0 +} + +type LevelListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户等级ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //用户等级 + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //用户等级标识 + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Num int64 `protobuf:"varint,5,opt,name=num,proto3" json:"num,omitempty"` //关联数量 +} + +func (x *LevelListRes_One) Reset() { + *x = LevelListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[267] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LevelListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LevelListRes_One) ProtoMessage() {} + +func (x *LevelListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[267] + 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 LevelListRes_One.ProtoReflect.Descriptor instead. +func (*LevelListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{67, 0} +} + +func (x *LevelListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LevelListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LevelListRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *LevelListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *LevelListRes_One) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type MarkLevelRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户等级ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //用户等级 + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //用户等级标识 +} + +func (x *MarkLevelRes_One) Reset() { + *x = MarkLevelRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[268] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkLevelRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkLevelRes_One) ProtoMessage() {} + +func (x *MarkLevelRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[268] + 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 MarkLevelRes_One.ProtoReflect.Descriptor instead. +func (*MarkLevelRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{75, 0} +} + +func (x *MarkLevelRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *MarkLevelRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MarkLevelRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +type CashRecordsRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //被邀请人的第三方用户ID + TitleMark string `protobuf:"bytes,2,opt,name=title_mark,json=titleMark,proto3" json:"title_mark,omitempty"` //语言包对应的翻译标识 + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + DecOrAdd string `protobuf:"bytes,4,opt,name=dec_or_add,json=decOrAdd,proto3" json:"dec_or_add,omitempty"` //减或者加(dec-减,add-加) + Val float64 `protobuf:"fixed64,5,opt,name=val,proto3" json:"val,omitempty"` //减或者加的值 + IsHelp bool `protobuf:"varint,6,opt,name=is_help,json=isHelp,proto3" json:"is_help,omitempty"` //是否助力成功 +} + +func (x *CashRecordsRes_One) Reset() { + *x = CashRecordsRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[269] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CashRecordsRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CashRecordsRes_One) ProtoMessage() {} + +func (x *CashRecordsRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[269] + 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 CashRecordsRes_One.ProtoReflect.Descriptor instead. +func (*CashRecordsRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{81, 0} +} + +func (x *CashRecordsRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *CashRecordsRes_One) GetTitleMark() string { + if x != nil { + return x.TitleMark + } + return "" +} + +func (x *CashRecordsRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *CashRecordsRes_One) GetDecOrAdd() string { + if x != nil { + return x.DecOrAdd + } + return "" +} + +func (x *CashRecordsRes_One) GetVal() float64 { + if x != nil { + return x.Val + } + return 0 +} + +func (x *CashRecordsRes_One) GetIsHelp() bool { + if x != nil { + return x.IsHelp + } + return false +} + +type MixRewardRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *MixRewardRes_KV) Reset() { + *x = MixRewardRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[270] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MixRewardRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MixRewardRes_KV) ProtoMessage() {} + +func (x *MixRewardRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[270] + 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 MixRewardRes_KV.ProtoReflect.Descriptor instead. +func (*MixRewardRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{83, 0} +} + +func (x *MixRewardRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *MixRewardRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type DiceRecordRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //记录标识(roll-掷骰子,get_roll_all-完成所有任务获得骰子,get_roll_task-完成任务获得骰子,roll_collect-获得碎片,roll_chance-再摇一次,lucky-使用幸运骰,get_lucky-获得幸运骰,normal_reward-普通奖品,supper_reward-超级大奖) + CreatedTime int64 `protobuf:"varint,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //记录时间 + Data *DiceRecordRes_Data `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` //数据 +} + +func (x *DiceRecordRes_One) Reset() { + *x = DiceRecordRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[271] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceRecordRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceRecordRes_One) ProtoMessage() {} + +func (x *DiceRecordRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[271] + 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 DiceRecordRes_One.ProtoReflect.Descriptor instead. +func (*DiceRecordRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{85, 0} +} + +func (x *DiceRecordRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DiceRecordRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *DiceRecordRes_One) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +func (x *DiceRecordRes_One) GetData() *DiceRecordRes_Data { + if x != nil { + return x.Data + } + return nil +} + +type DiceRecordRes_Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Point int32 `protobuf:"varint,1,opt,name=point,proto3" json:"point,omitempty"` //掷骰子的点数 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + RewardTitle string `protobuf:"bytes,3,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + RewardUrl string `protobuf:"bytes,4,opt,name=reward_url,json=rewardUrl,proto3" json:"reward_url,omitempty"` //奖品图片 + IsSupper int32 `protobuf:"varint,5,opt,name=is_supper,json=isSupper,proto3" json:"is_supper,omitempty"` //是否超级大奖 + Chance int32 `protobuf:"varint,6,opt,name=chance,proto3" json:"chance,omitempty"` //获得的骰子个数 + LuckyChance int32 `protobuf:"varint,7,opt,name=lucky_chance,json=luckyChance,proto3" json:"lucky_chance,omitempty"` //获得的幸运骰个数 + TaskTitle string `protobuf:"bytes,8,opt,name=task_title,json=taskTitle,proto3" json:"task_title,omitempty"` //完成任务的标题 + ReceiveType int32 `protobuf:"varint,9,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送,4-提交表单) + KvData []*DiceRecordRes_KV `protobuf:"bytes,10,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Contact string `protobuf:"bytes,11,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + RewardHashId string `protobuf:"bytes,12,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + OpenToUse int32 `protobuf:"varint,13,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,14,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,15,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + Lack bool `protobuf:"varint,16,opt,name=lack,proto3" json:"lack,omitempty"` //是否没有库存 + DyRewardType int32 `protobuf:"varint,17,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) + CustomRewardVal string `protobuf:"bytes,18,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义的奖品值 + PcParam string `protobuf:"bytes,19,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + RewardId int64 `protobuf:"varint,20,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + PointsUseNum int32 `protobuf:"varint,21,opt,name=points_use_num,json=pointsUseNum,proto3" json:"points_use_num,omitempty"` //消耗的积分 +} + +func (x *DiceRecordRes_Data) Reset() { + *x = DiceRecordRes_Data{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[272] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceRecordRes_Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceRecordRes_Data) ProtoMessage() {} + +func (x *DiceRecordRes_Data) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[272] + 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 DiceRecordRes_Data.ProtoReflect.Descriptor instead. +func (*DiceRecordRes_Data) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{85, 1} +} + +func (x *DiceRecordRes_Data) GetPoint() int32 { + if x != nil { + return x.Point + } + return 0 +} + +func (x *DiceRecordRes_Data) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DiceRecordRes_Data) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *DiceRecordRes_Data) GetRewardUrl() string { + if x != nil { + return x.RewardUrl + } + return "" +} + +func (x *DiceRecordRes_Data) GetIsSupper() int32 { + if x != nil { + return x.IsSupper + } + return 0 +} + +func (x *DiceRecordRes_Data) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *DiceRecordRes_Data) GetLuckyChance() int32 { + if x != nil { + return x.LuckyChance + } + return 0 +} + +func (x *DiceRecordRes_Data) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *DiceRecordRes_Data) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *DiceRecordRes_Data) GetKvData() []*DiceRecordRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *DiceRecordRes_Data) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *DiceRecordRes_Data) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *DiceRecordRes_Data) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *DiceRecordRes_Data) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *DiceRecordRes_Data) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *DiceRecordRes_Data) GetLack() bool { + if x != nil { + return x.Lack + } + return false +} + +func (x *DiceRecordRes_Data) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +func (x *DiceRecordRes_Data) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *DiceRecordRes_Data) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *DiceRecordRes_Data) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *DiceRecordRes_Data) GetPointsUseNum() int32 { + if x != nil { + return x.PointsUseNum + } + return 0 +} + +type DiceRecordRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *DiceRecordRes_KV) Reset() { + *x = DiceRecordRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[273] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceRecordRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceRecordRes_KV) ProtoMessage() {} + +func (x *DiceRecordRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[273] + 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 DiceRecordRes_KV.ProtoReflect.Descriptor instead. +func (*DiceRecordRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{85, 2} +} + +func (x *DiceRecordRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *DiceRecordRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *DiceRecordRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type RewardFormRes_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //表单项展示的名称 + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` //表单项需要提交的key + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` //表单项填写的值 +} + +func (x *RewardFormRes_Item) Reset() { + *x = RewardFormRes_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[274] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardFormRes_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardFormRes_Item) ProtoMessage() {} + +func (x *RewardFormRes_Item) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[274] + 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 RewardFormRes_Item.ProtoReflect.Descriptor instead. +func (*RewardFormRes_Item) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{87, 0} +} + +func (x *RewardFormRes_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RewardFormRes_Item) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *RewardFormRes_Item) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type SubmitFormReq_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //表单项展示的名称 + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` //表单项需要提交的key + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` //表单项填写的值 +} + +func (x *SubmitFormReq_Item) Reset() { + *x = SubmitFormReq_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[275] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitFormReq_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitFormReq_Item) ProtoMessage() {} + +func (x *SubmitFormReq_Item) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[275] + 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 SubmitFormReq_Item.ProtoReflect.Descriptor instead. +func (*SubmitFormReq_Item) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{88, 0} +} + +func (x *SubmitFormReq_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SubmitFormReq_Item) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *SubmitFormReq_Item) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type GetAdsUrlRes_AdG struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Adc string `protobuf:"bytes,1,opt,name=adc,proto3" json:"adc,omitempty"` //谷歌账号id + GaShowId string `protobuf:"bytes,2,opt,name=ga_show_id,json=gaShowId,proto3" json:"ga_show_id,omitempty"` //谷歌展示广告id + GaEmbedId string `protobuf:"bytes,3,opt,name=ga_embed_id,json=gaEmbedId,proto3" json:"ga_embed_id,omitempty"` //谷歌内嵌广告id + GaDoubleId string `protobuf:"bytes,4,opt,name=ga_double_id,json=gaDoubleId,proto3" json:"ga_double_id,omitempty"` //谷歌多重广告id +} + +func (x *GetAdsUrlRes_AdG) Reset() { + *x = GetAdsUrlRes_AdG{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[276] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAdsUrlRes_AdG) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAdsUrlRes_AdG) ProtoMessage() {} + +func (x *GetAdsUrlRes_AdG) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[276] + 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 GetAdsUrlRes_AdG.ProtoReflect.Descriptor instead. +func (*GetAdsUrlRes_AdG) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{91, 0} +} + +func (x *GetAdsUrlRes_AdG) GetAdc() string { + if x != nil { + return x.Adc + } + return "" +} + +func (x *GetAdsUrlRes_AdG) GetGaShowId() string { + if x != nil { + return x.GaShowId + } + return "" +} + +func (x *GetAdsUrlRes_AdG) GetGaEmbedId() string { + if x != nil { + return x.GaEmbedId + } + return "" +} + +func (x *GetAdsUrlRes_AdG) GetGaDoubleId() string { + if x != nil { + return x.GaDoubleId + } + return "" +} + +type ChopRewardRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 +} + +func (x *ChopRewardRes_Reward) Reset() { + *x = ChopRewardRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[277] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChopRewardRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChopRewardRes_Reward) ProtoMessage() {} + +func (x *ChopRewardRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[277] + 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 ChopRewardRes_Reward.ProtoReflect.Descriptor instead. +func (*ChopRewardRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{99, 0} +} + +func (x *ChopRewardRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChopRewardRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChopRewardRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type InvokeCondRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 +} + +func (x *InvokeCondRes_Reward) Reset() { + *x = InvokeCondRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[278] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvokeCondRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvokeCondRes_Reward) ProtoMessage() {} + +func (x *InvokeCondRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[278] + 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 InvokeCondRes_Reward.ProtoReflect.Descriptor instead. +func (*InvokeCondRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{103, 0} +} + +func (x *InvokeCondRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *InvokeCondRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *InvokeCondRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type KeepRewardRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + Num int64 `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"` //被选择的数量 + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` //奖品状态(0-正常,1-无库存,2-超过可获取上限) +} + +func (x *KeepRewardRes_Reward) Reset() { + *x = KeepRewardRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[279] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepRewardRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepRewardRes_Reward) ProtoMessage() {} + +func (x *KeepRewardRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[279] + 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 KeepRewardRes_Reward.ProtoReflect.Descriptor instead. +func (*KeepRewardRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{105, 0} +} + +func (x *KeepRewardRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *KeepRewardRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *KeepRewardRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *KeepRewardRes_Reward) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *KeepRewardRes_Reward) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type KeepCollectRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardType int32 `protobuf:"varint,1,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //奖励类型(1-道具,2-奖品) + Chance int32 `protobuf:"varint,2,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,4,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + RewardImg string `protobuf:"bytes,5,opt,name=reward_img,json=rewardImg,proto3" json:"reward_img,omitempty"` //奖品图片 + Lack bool `protobuf:"varint,6,opt,name=lack,proto3" json:"lack,omitempty"` //奖品没有库存 + LastReward bool `protobuf:"varint,7,opt,name=last_reward,json=lastReward,proto3" json:"last_reward,omitempty"` //是否最终奖品 + ReceiveType int32 `protobuf:"varint,8,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-监听器,4-提交表单) +} + +func (x *KeepCollectRes_Reward) Reset() { + *x = KeepCollectRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[280] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepCollectRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepCollectRes_Reward) ProtoMessage() {} + +func (x *KeepCollectRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[280] + 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 KeepCollectRes_Reward.ProtoReflect.Descriptor instead. +func (*KeepCollectRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{109, 0} +} + +func (x *KeepCollectRes_Reward) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *KeepCollectRes_Reward) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *KeepCollectRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *KeepCollectRes_Reward) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *KeepCollectRes_Reward) GetRewardImg() string { + if x != nil { + return x.RewardImg + } + return "" +} + +func (x *KeepCollectRes_Reward) GetLack() bool { + if x != nil { + return x.Lack + } + return false +} + +func (x *KeepCollectRes_Reward) GetLastReward() bool { + if x != nil { + return x.LastReward + } + return false +} + +func (x *KeepCollectRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +type KeepLogRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` //日志类型(1-收集爱心,2-获得狗粮,3-喂养狗粮) + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` //来源标识 + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //数值 + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 +} + +func (x *KeepLogRes_One) Reset() { + *x = KeepLogRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[281] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeepLogRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeepLogRes_One) ProtoMessage() {} + +func (x *KeepLogRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[281] + 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 KeepLogRes_One.ProtoReflect.Descriptor instead. +func (*KeepLogRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{119, 0} +} + +func (x *KeepLogRes_One) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *KeepLogRes_One) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *KeepLogRes_One) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +func (x *KeepLogRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type ChildRes_Invite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` //状态(1-待完成,2-已完成) + Start int64 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` //开始时间 + End int64 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` //结束时间 + InviteNum int64 `protobuf:"varint,5,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //邀请数 + Rank string `protobuf:"bytes,6,opt,name=rank,proto3" json:"rank,omitempty"` //排名 + RankList []*ChildRes_RankOne `protobuf:"bytes,7,rep,name=rank_list,json=rankList,proto3" json:"rank_list,omitempty"` //排行榜列表 + Record *ChildRes_Record `protobuf:"bytes,8,opt,name=record,proto3" json:"record,omitempty"` //奖品信息 + ChildHashId string `protobuf:"bytes,9,opt,name=child_hash_id,json=childHashId,proto3" json:"child_hash_id,omitempty"` //子活动hash_id +} + +func (x *ChildRes_Invite) Reset() { + *x = ChildRes_Invite{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[282] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_Invite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_Invite) ProtoMessage() {} + +func (x *ChildRes_Invite) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[282] + 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 ChildRes_Invite.ProtoReflect.Descriptor instead. +func (*ChildRes_Invite) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 0} +} + +func (x *ChildRes_Invite) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildRes_Invite) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildRes_Invite) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ChildRes_Invite) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *ChildRes_Invite) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ChildRes_Invite) GetRank() string { + if x != nil { + return x.Rank + } + return "" +} + +func (x *ChildRes_Invite) GetRankList() []*ChildRes_RankOne { + if x != nil { + return x.RankList + } + return nil +} + +func (x *ChildRes_Invite) GetRecord() *ChildRes_Record { + if x != nil { + return x.Record + } + return nil +} + +func (x *ChildRes_Invite) GetChildHashId() string { + if x != nil { + return x.ChildHashId + } + return "" +} + +type ChildRes_RankOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubUserId string `protobuf:"bytes,1,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户id + InviteNum int64 `protobuf:"varint,2,opt,name=invite_num,json=inviteNum,proto3" json:"invite_num,omitempty"` //邀请人数 + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 + Img string `protobuf:"bytes,5,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + PropMark string `protobuf:"bytes,6,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //道具类型(reward-奖品,chance-活动道具) + RewardNum int32 `protobuf:"varint,7,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放奖品数量 +} + +func (x *ChildRes_RankOne) Reset() { + *x = ChildRes_RankOne{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[283] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_RankOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_RankOne) ProtoMessage() {} + +func (x *ChildRes_RankOne) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[283] + 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 ChildRes_RankOne.ProtoReflect.Descriptor instead. +func (*ChildRes_RankOne) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 1} +} + +func (x *ChildRes_RankOne) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *ChildRes_RankOne) GetInviteNum() int64 { + if x != nil { + return x.InviteNum + } + return 0 +} + +func (x *ChildRes_RankOne) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildRes_RankOne) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildRes_RankOne) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ChildRes_RankOne) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildRes_RankOne) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +type ChildRes_Sign struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` //状态(1-待完成,2-已完成) + Rewards []*ChildRes_Reward `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards,omitempty"` //签到板数据 + Record *ChildRes_Record `protobuf:"bytes,4,opt,name=record,proto3" json:"record,omitempty"` //奖品信息 + RewardId int64 `protobuf:"varint,5,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //上一次中奖的活动奖品id + ChildHashId string `protobuf:"bytes,6,opt,name=child_hash_id,json=childHashId,proto3" json:"child_hash_id,omitempty"` //子活动hash_id +} + +func (x *ChildRes_Sign) Reset() { + *x = ChildRes_Sign{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[284] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_Sign) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_Sign) ProtoMessage() {} + +func (x *ChildRes_Sign) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[284] + 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 ChildRes_Sign.ProtoReflect.Descriptor instead. +func (*ChildRes_Sign) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 2} +} + +func (x *ChildRes_Sign) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildRes_Sign) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildRes_Sign) GetRewards() []*ChildRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ChildRes_Sign) GetRecord() *ChildRes_Record { + if x != nil { + return x.Record + } + return nil +} + +func (x *ChildRes_Sign) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildRes_Sign) GetChildHashId() string { + if x != nil { + return x.ChildHashId + } + return "" +} + +type ChildRes_Lucky struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` //状态(1-待完成,2-已完成) + Rewards []*ChildRes_Reward `protobuf:"bytes,3,rep,name=rewards,proto3" json:"rewards,omitempty"` //奖品列表 + Record *ChildRes_Record `protobuf:"bytes,4,opt,name=record,proto3" json:"record,omitempty"` //奖品信息 + ChildHashId string `protobuf:"bytes,5,opt,name=child_hash_id,json=childHashId,proto3" json:"child_hash_id,omitempty"` //子活动hash_id +} + +func (x *ChildRes_Lucky) Reset() { + *x = ChildRes_Lucky{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[285] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_Lucky) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_Lucky) ProtoMessage() {} + +func (x *ChildRes_Lucky) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[285] + 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 ChildRes_Lucky.ProtoReflect.Descriptor instead. +func (*ChildRes_Lucky) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 3} +} + +func (x *ChildRes_Lucky) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildRes_Lucky) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildRes_Lucky) GetRewards() []*ChildRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ChildRes_Lucky) GetRecord() *ChildRes_Record { + if x != nil { + return x.Record + } + return nil +} + +func (x *ChildRes_Lucky) GetChildHashId() string { + if x != nil { + return x.ChildHashId + } + return "" +} + +type ChildRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 + Img string `protobuf:"bytes,3,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + PropMark string `protobuf:"bytes,4,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //道具类型(reward-奖品,chance-活动道具) + RewardNum int32 `protobuf:"varint,5,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放奖品数量 + IsSuper int32 `protobuf:"varint,6,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + IsGet int32 `protobuf:"varint,7,opt,name=is_get,json=isGet,proto3" json:"is_get,omitempty"` //是否被领取(0-否,1-是) +} + +func (x *ChildRes_Reward) Reset() { + *x = ChildRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[286] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_Reward) ProtoMessage() {} + +func (x *ChildRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[286] + 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 ChildRes_Reward.ProtoReflect.Descriptor instead. +func (*ChildRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 4} +} + +func (x *ChildRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildRes_Reward) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ChildRes_Reward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ChildRes_Reward) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildRes_Reward) GetIsGet() int32 { + if x != nil { + return x.IsGet + } + return 0 +} + +type ChildRes_Blind struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Open int32 `protobuf:"varint,1,opt,name=open,proto3" json:"open,omitempty"` //是否开启(0-否,1-是) + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` //状态(1-待完成,2-已完成) + Record *ChildRes_Record `protobuf:"bytes,3,opt,name=record,proto3" json:"record,omitempty"` //奖品信息 + ChildHashId string `protobuf:"bytes,4,opt,name=child_hash_id,json=childHashId,proto3" json:"child_hash_id,omitempty"` //子活动hash_id +} + +func (x *ChildRes_Blind) Reset() { + *x = ChildRes_Blind{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[287] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_Blind) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_Blind) ProtoMessage() {} + +func (x *ChildRes_Blind) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[287] + 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 ChildRes_Blind.ProtoReflect.Descriptor instead. +func (*ChildRes_Blind) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 5} +} + +func (x *ChildRes_Blind) GetOpen() int32 { + if x != nil { + return x.Open + } + return 0 +} + +func (x *ChildRes_Blind) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ChildRes_Blind) GetRecord() *ChildRes_Record { + if x != nil { + return x.Record + } + return nil +} + +func (x *ChildRes_Blind) GetChildHashId() string { + if x != nil { + return x.ChildHashId + } + return "" +} + +type ChildRes_Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品记录int型id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //奖品记录string型hash_id + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 + KvData []*ChildRes_KV `protobuf:"bytes,5,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对 + Img string `protobuf:"bytes,6,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + Contact string `protobuf:"bytes,7,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,8,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,9,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,10,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + DyRewardType int32 `protobuf:"varint,11,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) + CustomRewardVal string `protobuf:"bytes,12,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义的奖品值 + PropMark string `protobuf:"bytes,13,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //道具类型(reward-奖品,chance-活动道具) + RewardNum int32 `protobuf:"varint,14,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放奖品数量 + IsSuper int32 `protobuf:"varint,15,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + PcParam string `protobuf:"bytes,16,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + ReceiveType int32 `protobuf:"varint,17,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(1-服务端推送,2-监听器,3-客户自主发放) +} + +func (x *ChildRes_Record) Reset() { + *x = ChildRes_Record{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[288] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_Record) ProtoMessage() {} + +func (x *ChildRes_Record) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[288] + 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 ChildRes_Record.ProtoReflect.Descriptor instead. +func (*ChildRes_Record) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 6} +} + +func (x *ChildRes_Record) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildRes_Record) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChildRes_Record) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildRes_Record) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildRes_Record) GetKvData() []*ChildRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ChildRes_Record) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ChildRes_Record) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ChildRes_Record) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ChildRes_Record) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ChildRes_Record) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ChildRes_Record) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +func (x *ChildRes_Record) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *ChildRes_Record) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildRes_Record) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ChildRes_Record) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildRes_Record) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ChildRes_Record) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +type ChildRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ChildRes_KV) Reset() { + *x = ChildRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[289] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildRes_KV) ProtoMessage() {} + +func (x *ChildRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[289] + 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 ChildRes_KV.ProtoReflect.Descriptor instead. +func (*ChildRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{127, 7} +} + +func (x *ChildRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ChildRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ChildRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type ChildActiveRes_Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖品id + PropMark string `protobuf:"bytes,2,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //道具类型(reward-奖品,chance-活动道具) + RewardNum int32 `protobuf:"varint,3,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //发放奖品数量 + IsSuper int32 `protobuf:"varint,4,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` //是否超级大奖(0-否,1-是) + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //奖励内容 + KvData []*ChildActiveRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对 + Img string `protobuf:"bytes,7,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + Contact string `protobuf:"bytes,8,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,9,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,10,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,11,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + DyRewardType int32 `protobuf:"varint,12,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) + Id int64 `protobuf:"varint,13,opt,name=id,proto3" json:"id,omitempty"` //奖品记录int型id + HashId string `protobuf:"bytes,14,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //奖品记录string型hash_id + CustomRewardVal string `protobuf:"bytes,15,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义的奖品值 + PcParam string `protobuf:"bytes,16,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + ReceiveType int32 `protobuf:"varint,17,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(1-服务端推送,2-监听器,3-客户自主发放) +} + +func (x *ChildActiveRes_Record) Reset() { + *x = ChildActiveRes_Record{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[290] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildActiveRes_Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildActiveRes_Record) ProtoMessage() {} + +func (x *ChildActiveRes_Record) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[290] + 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 ChildActiveRes_Record.ProtoReflect.Descriptor instead. +func (*ChildActiveRes_Record) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{129, 0} +} + +func (x *ChildActiveRes_Record) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ChildActiveRes_Record) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ChildActiveRes_Record) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *ChildActiveRes_Record) GetIsSuper() int32 { + if x != nil { + return x.IsSuper + } + return 0 +} + +func (x *ChildActiveRes_Record) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ChildActiveRes_Record) GetKvData() []*ChildActiveRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ChildActiveRes_Record) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ChildActiveRes_Record) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ChildActiveRes_Record) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ChildActiveRes_Record) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ChildActiveRes_Record) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ChildActiveRes_Record) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +func (x *ChildActiveRes_Record) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildActiveRes_Record) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChildActiveRes_Record) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *ChildActiveRes_Record) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ChildActiveRes_Record) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +type ChildActiveRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ChildActiveRes_KV) Reset() { + *x = ChildActiveRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[291] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildActiveRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildActiveRes_KV) ProtoMessage() {} + +func (x *ChildActiveRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[291] + 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 ChildActiveRes_KV.ProtoReflect.Descriptor instead. +func (*ChildActiveRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{129, 1} +} + +func (x *ChildActiveRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ChildActiveRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ChildActiveRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type GoldRecordRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //任务标题 + GoldNum int32 `protobuf:"varint,2,opt,name=gold_num,json=goldNum,proto3" json:"gold_num,omitempty"` //金币数量 + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Mark string `protobuf:"bytes,4,opt,name=mark,proto3" json:"mark,omitempty"` //语言包标识 +} + +func (x *GoldRecordRes_One) Reset() { + *x = GoldRecordRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[292] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GoldRecordRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GoldRecordRes_One) ProtoMessage() {} + +func (x *GoldRecordRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[292] + 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 GoldRecordRes_One.ProtoReflect.Descriptor instead. +func (*GoldRecordRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{135, 0} +} + +func (x *GoldRecordRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *GoldRecordRes_One) GetGoldNum() int32 { + if x != nil { + return x.GoldNum + } + return 0 +} + +func (x *GoldRecordRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *GoldRecordRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +type CoinRecordRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` //日志类型(1-消耗金币,2-获得金币) + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` //来源标识 + Num int64 `protobuf:"varint,5,opt,name=num,proto3" json:"num,omitempty"` //数量 + SubUserId string `protobuf:"bytes,6,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //第三方用户id + Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` //场次说明 +} + +func (x *CoinRecordRes_One) Reset() { + *x = CoinRecordRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[293] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoinRecordRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinRecordRes_One) ProtoMessage() {} + +func (x *CoinRecordRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[293] + 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 CoinRecordRes_One.ProtoReflect.Descriptor instead. +func (*CoinRecordRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{141, 0} +} + +func (x *CoinRecordRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CoinRecordRes_One) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *CoinRecordRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *CoinRecordRes_One) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *CoinRecordRes_One) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *CoinRecordRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *CoinRecordRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type ChildListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + JoinAt int64 `protobuf:"varint,2,opt,name=join_at,json=joinAt,proto3" json:"join_at,omitempty"` //参与时间 + SubUserId string `protobuf:"bytes,3,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户 + Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"` //用户上级 + Sign *ChildListRes_Num `protobuf:"bytes,5,opt,name=sign,proto3" json:"sign,omitempty"` //签到数据 + Invite *ChildListRes_Num `protobuf:"bytes,6,opt,name=invite,proto3" json:"invite,omitempty"` //邀请数据 + Blind *ChildListRes_Num `protobuf:"bytes,7,opt,name=blind,proto3" json:"blind,omitempty"` //盲盒数据 + Lottery *ChildListRes_Num `protobuf:"bytes,8,opt,name=lottery,proto3" json:"lottery,omitempty"` //抽奖数据 +} + +func (x *ChildListRes_One) Reset() { + *x = ChildListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[294] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListRes_One) ProtoMessage() {} + +func (x *ChildListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[294] + 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 ChildListRes_One.ProtoReflect.Descriptor instead. +func (*ChildListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{143, 0} +} + +func (x *ChildListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChildListRes_One) GetJoinAt() int64 { + if x != nil { + return x.JoinAt + } + return 0 +} + +func (x *ChildListRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *ChildListRes_One) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ChildListRes_One) GetSign() *ChildListRes_Num { + if x != nil { + return x.Sign + } + return nil +} + +func (x *ChildListRes_One) GetInvite() *ChildListRes_Num { + if x != nil { + return x.Invite + } + return nil +} + +func (x *ChildListRes_One) GetBlind() *ChildListRes_Num { + if x != nil { + return x.Blind + } + return nil +} + +func (x *ChildListRes_One) GetLottery() *ChildListRes_Num { + if x != nil { + return x.Lottery + } + return nil +} + +type ChildListRes_Num struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Num int64 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` //签到天数,邀请人数,开盒次数,抽奖次数 +} + +func (x *ChildListRes_Num) Reset() { + *x = ChildListRes_Num{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[295] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChildListRes_Num) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChildListRes_Num) ProtoMessage() {} + +func (x *ChildListRes_Num) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[295] + 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 ChildListRes_Num.ProtoReflect.Descriptor instead. +func (*ChildListRes_Num) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{143, 1} +} + +func (x *ChildListRes_Num) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type ReceiveRewardRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //领奖记录hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + Img string `protobuf:"bytes,3,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + JumpUrl string `protobuf:"bytes,4,opt,name=jump_url,json=jumpUrl,proto3" json:"jump_url,omitempty"` //跳转地址 + KvData []*ReceiveRewardRes_KV `protobuf:"bytes,5,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `protobuf:"varint,6,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + Contact string `protobuf:"bytes,7,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + OpenToUse int32 `protobuf:"varint,9,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,10,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,11,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,12,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + Lack int32 `protobuf:"varint,13,opt,name=lack,proto3" json:"lack,omitempty"` //是否缺乏库存(1-是,0-否) + RewardNum int32 `protobuf:"varint,14,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //奖励数量 +} + +func (x *ReceiveRewardRes_Reward) Reset() { + *x = ReceiveRewardRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[296] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReceiveRewardRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReceiveRewardRes_Reward) ProtoMessage() {} + +func (x *ReceiveRewardRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[296] + 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 ReceiveRewardRes_Reward.ProtoReflect.Descriptor instead. +func (*ReceiveRewardRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{145, 0} +} + +func (x *ReceiveRewardRes_Reward) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetJumpUrl() string { + if x != nil { + return x.JumpUrl + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetKvData() []*ReceiveRewardRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ReceiveRewardRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ReceiveRewardRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ReceiveRewardRes_Reward) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ReceiveRewardRes_Reward) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ReceiveRewardRes_Reward) GetLack() int32 { + if x != nil { + return x.Lack + } + return 0 +} + +func (x *ReceiveRewardRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +type ReceiveRewardRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ReceiveRewardRes_KV) Reset() { + *x = ReceiveRewardRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[297] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReceiveRewardRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReceiveRewardRes_KV) ProtoMessage() {} + +func (x *ReceiveRewardRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[297] + 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 ReceiveRewardRes_KV.ProtoReflect.Descriptor instead. +func (*ReceiveRewardRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{145, 1} +} + +func (x *ReceiveRewardRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ReceiveRewardRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ReceiveRewardRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type LotteryLogRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` //日志类型(1-获得抽奖机会,2-消耗抽奖机会) + Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` //记录标识(sign-每日签到,install-安装拉新任务,register-注册拉新任务,cond_all-完成配置任务,cond_one-完成指定任务,manual_cond_all-手动领取完成配置任务,manual_cond_one-手动领取完成的指定任务,lottery-抽奖) + TaskTitle string `protobuf:"bytes,5,opt,name=task_title,json=taskTitle,proto3" json:"task_title,omitempty"` //奖品图片 + RewardTitle string `protobuf:"bytes,6,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + Chance int32 `protobuf:"varint,7,opt,name=chance,proto3" json:"chance,omitempty"` //消耗或者获得的抽奖机会次数 + PointsUseNum int32 `protobuf:"varint,8,opt,name=points_use_num,json=pointsUseNum,proto3" json:"points_use_num,omitempty"` //消耗的积分 +} + +func (x *LotteryLogRes_One) Reset() { + *x = LotteryLogRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[298] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LotteryLogRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LotteryLogRes_One) ProtoMessage() {} + +func (x *LotteryLogRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[298] + 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 LotteryLogRes_One.ProtoReflect.Descriptor instead. +func (*LotteryLogRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{147, 0} +} + +func (x *LotteryLogRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LotteryLogRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *LotteryLogRes_One) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *LotteryLogRes_One) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *LotteryLogRes_One) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *LotteryLogRes_One) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *LotteryLogRes_One) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +func (x *LotteryLogRes_One) GetPointsUseNum() int32 { + if x != nil { + return x.PointsUseNum + } + return 0 +} + +type UserListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动用户ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动用户对外id + SubUserId string `protobuf:"bytes,3,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户 + DeviceId string `protobuf:"bytes,4,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //用户 +} + +func (x *UserListRes_One) Reset() { + *x = UserListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[299] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListRes_One) ProtoMessage() {} + +func (x *UserListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[299] + 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 UserListRes_One.ProtoReflect.Descriptor instead. +func (*UserListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{149, 0} +} + +func (x *UserListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UserListRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *UserListRes_One) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +type DiceCollectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Num int32 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //当前拥有碎片数 + CollectNum int32 `protobuf:"varint,3,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集碎片总数 + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + MixNum int32 `protobuf:"varint,5,opt,name=mix_num,json=mixNum,proto3" json:"mix_num,omitempty"` //合成次数 + MaxNum int32 `protobuf:"varint,6,opt,name=max_num,json=maxNum,proto3" json:"max_num,omitempty"` //可获得碎片上限 +} + +func (x *DiceCollectRes_One) Reset() { + *x = DiceCollectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[300] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DiceCollectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DiceCollectRes_One) ProtoMessage() {} + +func (x *DiceCollectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[300] + 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 DiceCollectRes_One.ProtoReflect.Descriptor instead. +func (*DiceCollectRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{153, 0} +} + +func (x *DiceCollectRes_One) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *DiceCollectRes_One) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *DiceCollectRes_One) GetCollectNum() int32 { + if x != nil { + return x.CollectNum + } + return 0 +} + +func (x *DiceCollectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DiceCollectRes_One) GetMixNum() int32 { + if x != nil { + return x.MixNum + } + return 0 +} + +func (x *DiceCollectRes_One) GetMaxNum() int32 { + if x != nil { + return x.MaxNum + } + return 0 +} + +type ClientRewardRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //发奖记录hash_id + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //发奖时间 + KvData []*ClientRewardRes_KV `protobuf:"bytes,3,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对 +} + +func (x *ClientRewardRes_Reward) Reset() { + *x = ClientRewardRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[301] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientRewardRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientRewardRes_Reward) ProtoMessage() {} + +func (x *ClientRewardRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[301] + 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 ClientRewardRes_Reward.ProtoReflect.Descriptor instead. +func (*ClientRewardRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{155, 0} +} + +func (x *ClientRewardRes_Reward) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ClientRewardRes_Reward) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ClientRewardRes_Reward) GetKvData() []*ClientRewardRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +type ClientRewardRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *ClientRewardRes_KV) Reset() { + *x = ClientRewardRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[302] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientRewardRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientRewardRes_KV) ProtoMessage() {} + +func (x *ClientRewardRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[302] + 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 ClientRewardRes_KV.ProtoReflect.Descriptor instead. +func (*ClientRewardRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{155, 1} +} + +func (x *ClientRewardRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ClientRewardRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type ChatListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` //内容 + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` //来源(input-输入,output-输出,system-系统) + MsgType int32 `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` //消息类型(1-文本,2-固定文案,3-系统通知) + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + MsgId int64 `protobuf:"varint,5,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"` //消息id +} + +func (x *ChatListRes_One) Reset() { + *x = ChatListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[303] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatListRes_One) ProtoMessage() {} + +func (x *ChatListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[303] + 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 ChatListRes_One.ProtoReflect.Descriptor instead. +func (*ChatListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{161, 0} +} + +func (x *ChatListRes_One) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *ChatListRes_One) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *ChatListRes_One) GetMsgType() int32 { + if x != nil { + return x.MsgType + } + return 0 +} + +func (x *ChatListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ChatListRes_One) GetMsgId() int64 { + if x != nil { + return x.MsgId + } + return 0 +} + +type ScheduleListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //赛程id + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //赛程标题 + VsImg string `protobuf:"bytes,3,opt,name=vs_img,json=vsImg,proto3" json:"vs_img,omitempty"` //赛程图片 + VsDate string `protobuf:"bytes,4,opt,name=vs_date,json=vsDate,proto3" json:"vs_date,omitempty"` //开赛日期 + VsTz int32 `protobuf:"varint,5,opt,name=vs_tz,json=vsTz,proto3" json:"vs_tz,omitempty"` //开赛时区 + VoteCountdown int64 `protobuf:"varint,6,opt,name=vote_countdown,json=voteCountdown,proto3" json:"vote_countdown,omitempty"` //投票倒计时 + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` //投票状态(1-即将投票,2-投票中,3-待结算,4-已结算) + WinType int32 `protobuf:"varint,8,opt,name=win_type,json=winType,proto3" json:"win_type,omitempty"` //结算获奖类型(1-队伍胜利,2-平局) + WinTeamId int64 `protobuf:"varint,9,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //结算获胜队伍id + Teams []*ScheduleListRes_Team `protobuf:"bytes,10,rep,name=teams,proto3" json:"teams,omitempty"` //队伍集合 + UserVote *ScheduleListRes_UserVote `protobuf:"bytes,11,opt,name=user_vote,json=userVote,proto3" json:"user_vote,omitempty"` //用户状态 + Reward *ScheduleListRes_Reward `protobuf:"bytes,12,opt,name=reward,proto3" json:"reward,omitempty"` //奖励 + Votes []*ScheduleListRes_Vote `protobuf:"bytes,13,rep,name=votes,proto3" json:"votes,omitempty"` //用户投票 + OtherVote []string `protobuf:"bytes,14,rep,name=other_vote,json=otherVote,proto3" json:"other_vote,omitempty"` //其他投票选项 + Scores []*ScheduleListRes_Score `protobuf:"bytes,15,rep,name=scores,proto3" json:"scores,omitempty"` //队伍分数 + OpenOdds int32 `protobuf:"varint,16,opt,name=open_odds,json=openOdds,proto3" json:"open_odds,omitempty"` //是否开启赔率(0-否,1-是) + OddsLeft string `protobuf:"bytes,17,opt,name=odds_left,json=oddsLeft,proto3" json:"odds_left,omitempty"` //队伍1赔率 + OddsRight string `protobuf:"bytes,18,opt,name=odds_right,json=oddsRight,proto3" json:"odds_right,omitempty"` //队伍2赔率 + OddsDraw string `protobuf:"bytes,19,opt,name=odds_draw,json=oddsDraw,proto3" json:"odds_draw,omitempty"` //平局赔率 +} + +func (x *ScheduleListRes_One) Reset() { + *x = ScheduleListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[304] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_One) ProtoMessage() {} + +func (x *ScheduleListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[304] + 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 ScheduleListRes_One.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 0} +} + +func (x *ScheduleListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ScheduleListRes_One) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ScheduleListRes_One) GetVsImg() string { + if x != nil { + return x.VsImg + } + return "" +} + +func (x *ScheduleListRes_One) GetVsDate() string { + if x != nil { + return x.VsDate + } + return "" +} + +func (x *ScheduleListRes_One) GetVsTz() int32 { + if x != nil { + return x.VsTz + } + return 0 +} + +func (x *ScheduleListRes_One) GetVoteCountdown() int64 { + if x != nil { + return x.VoteCountdown + } + return 0 +} + +func (x *ScheduleListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ScheduleListRes_One) GetWinType() int32 { + if x != nil { + return x.WinType + } + return 0 +} + +func (x *ScheduleListRes_One) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *ScheduleListRes_One) GetTeams() []*ScheduleListRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *ScheduleListRes_One) GetUserVote() *ScheduleListRes_UserVote { + if x != nil { + return x.UserVote + } + return nil +} + +func (x *ScheduleListRes_One) GetReward() *ScheduleListRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *ScheduleListRes_One) GetVotes() []*ScheduleListRes_Vote { + if x != nil { + return x.Votes + } + return nil +} + +func (x *ScheduleListRes_One) GetOtherVote() []string { + if x != nil { + return x.OtherVote + } + return nil +} + +func (x *ScheduleListRes_One) GetScores() []*ScheduleListRes_Score { + if x != nil { + return x.Scores + } + return nil +} + +func (x *ScheduleListRes_One) GetOpenOdds() int32 { + if x != nil { + return x.OpenOdds + } + return 0 +} + +func (x *ScheduleListRes_One) GetOddsLeft() string { + if x != nil { + return x.OddsLeft + } + return "" +} + +func (x *ScheduleListRes_One) GetOddsRight() string { + if x != nil { + return x.OddsRight + } + return "" +} + +func (x *ScheduleListRes_One) GetOddsDraw() string { + if x != nil { + return x.OddsDraw + } + return "" +} + +type ScheduleListRes_Score struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TeamId int64 `protobuf:"varint,1,opt,name=team_id,json=teamId,proto3" json:"team_id,omitempty"` //队伍id + Score string `protobuf:"bytes,2,opt,name=score,proto3" json:"score,omitempty"` //队伍分数 +} + +func (x *ScheduleListRes_Score) Reset() { + *x = ScheduleListRes_Score{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[305] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_Score) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_Score) ProtoMessage() {} + +func (x *ScheduleListRes_Score) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[305] + 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 ScheduleListRes_Score.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_Score) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 1} +} + +func (x *ScheduleListRes_Score) GetTeamId() int64 { + if x != nil { + return x.TeamId + } + return 0 +} + +func (x *ScheduleListRes_Score) GetScore() string { + if x != nil { + return x.Score + } + return "" +} + +type ScheduleListRes_Vote struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WinType int32 `protobuf:"varint,1,opt,name=win_type,json=winType,proto3" json:"win_type,omitempty"` //获奖类型(1-队伍胜利,2-平局) + WinTeamId int64 `protobuf:"varint,2,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //获胜队伍id + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //投票次数 +} + +func (x *ScheduleListRes_Vote) Reset() { + *x = ScheduleListRes_Vote{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[306] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_Vote) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_Vote) ProtoMessage() {} + +func (x *ScheduleListRes_Vote) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[306] + 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 ScheduleListRes_Vote.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_Vote) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 2} +} + +func (x *ScheduleListRes_Vote) GetWinType() int32 { + if x != nil { + return x.WinType + } + return 0 +} + +func (x *ScheduleListRes_Vote) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *ScheduleListRes_Vote) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type ScheduleListRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍logo + Score string `protobuf:"bytes,4,opt,name=score,proto3" json:"score,omitempty"` //队伍分数 +} + +func (x *ScheduleListRes_Team) Reset() { + *x = ScheduleListRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[307] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_Team) ProtoMessage() {} + +func (x *ScheduleListRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[307] + 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 ScheduleListRes_Team.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 3} +} + +func (x *ScheduleListRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ScheduleListRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ScheduleListRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +func (x *ScheduleListRes_Team) GetScore() string { + if x != nil { + return x.Score + } + return "" +} + +type ScheduleListRes_UserVote struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserWinType int32 `protobuf:"varint,1,opt,name=user_win_type,json=userWinType,proto3" json:"user_win_type,omitempty"` //用户选择的获奖类型(1-队伍胜利,2-平局) + UserWinTeamId int64 `protobuf:"varint,2,opt,name=user_win_team_id,json=userWinTeamId,proto3" json:"user_win_team_id,omitempty"` //用户选择的获胜队伍id + IsWin bool `protobuf:"varint,3,opt,name=is_win,json=isWin,proto3" json:"is_win,omitempty"` //是否赢得奖励 + VoteNum int32 `protobuf:"varint,4,opt,name=vote_num,json=voteNum,proto3" json:"vote_num,omitempty"` //投票次数 +} + +func (x *ScheduleListRes_UserVote) Reset() { + *x = ScheduleListRes_UserVote{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[308] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_UserVote) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_UserVote) ProtoMessage() {} + +func (x *ScheduleListRes_UserVote) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[308] + 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 ScheduleListRes_UserVote.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_UserVote) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 4} +} + +func (x *ScheduleListRes_UserVote) GetUserWinType() int32 { + if x != nil { + return x.UserWinType + } + return 0 +} + +func (x *ScheduleListRes_UserVote) GetUserWinTeamId() int64 { + if x != nil { + return x.UserWinTeamId + } + return 0 +} + +func (x *ScheduleListRes_UserVote) GetIsWin() bool { + if x != nil { + return x.IsWin + } + return false +} + +func (x *ScheduleListRes_UserVote) GetVoteNum() int32 { + if x != nil { + return x.VoteNum + } + return 0 +} + +type ScheduleListRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //活动奖励id + PropMark string `protobuf:"bytes,2,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖品类型(reward-奖品,point-积分) + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + Img string `protobuf:"bytes,4,opt,name=img,proto3" json:"img,omitempty"` //奖品图片 + KvData []*ScheduleListRes_KV `protobuf:"bytes,5,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品自定义参数数据 + ReceiveType int32 `protobuf:"varint,6,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + Contact string `protobuf:"bytes,7,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,8,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,9,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,10,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,11,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + PropNum int32 `protobuf:"varint,12,opt,name=prop_num,json=propNum,proto3" json:"prop_num,omitempty"` //道具数量 +} + +func (x *ScheduleListRes_Reward) Reset() { + *x = ScheduleListRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[309] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_Reward) ProtoMessage() {} + +func (x *ScheduleListRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[309] + 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 ScheduleListRes_Reward.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 5} +} + +func (x *ScheduleListRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ScheduleListRes_Reward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *ScheduleListRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ScheduleListRes_Reward) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ScheduleListRes_Reward) GetKvData() []*ScheduleListRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ScheduleListRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ScheduleListRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ScheduleListRes_Reward) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ScheduleListRes_Reward) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ScheduleListRes_Reward) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ScheduleListRes_Reward) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ScheduleListRes_Reward) GetPropNum() int32 { + if x != nil { + return x.PropNum + } + return 0 +} + +type ScheduleListRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ScheduleListRes_KV) Reset() { + *x = ScheduleListRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[310] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleListRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleListRes_KV) ProtoMessage() {} + +func (x *ScheduleListRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[310] + 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 ScheduleListRes_KV.ProtoReflect.Descriptor instead. +func (*ScheduleListRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{163, 6} +} + +func (x *ScheduleListRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ScheduleListRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ScheduleListRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type MallListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片URL + Remain int64 `protobuf:"varint,5,opt,name=remain,proto3" json:"remain,omitempty"` //剩余库存 + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` //状态(1-上架,2-待上架,3-下架,4-删除) + UpRemain int64 `protobuf:"varint,7,opt,name=up_remain,json=upRemain,proto3" json:"up_remain,omitempty"` //上架剩余时间 + CoinNum int32 `protobuf:"varint,8,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //奖品金币数量 +} + +func (x *MallListRes_One) Reset() { + *x = MallListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[311] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MallListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MallListRes_One) ProtoMessage() {} + +func (x *MallListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[311] + 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 MallListRes_One.ProtoReflect.Descriptor instead. +func (*MallListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{165, 0} +} + +func (x *MallListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *MallListRes_One) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *MallListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MallListRes_One) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *MallListRes_One) GetRemain() int64 { + if x != nil { + return x.Remain + } + return 0 +} + +func (x *MallListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MallListRes_One) GetUpRemain() int64 { + if x != nil { + return x.UpRemain + } + return 0 +} + +func (x *MallListRes_One) GetCoinNum() int32 { + if x != nil { + return x.CoinNum + } + return 0 +} + +type ExchangeRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ExchangeRes_KV) Reset() { + *x = ExchangeRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[312] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeRes_KV) ProtoMessage() {} + +func (x *ExchangeRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[312] + 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 ExchangeRes_KV.ProtoReflect.Descriptor instead. +func (*ExchangeRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{167, 0} +} + +func (x *ExchangeRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ExchangeRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ExchangeRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type VoteListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //投票id + Teams []*VoteListRes_Team `protobuf:"bytes,2,rep,name=teams,proto3" json:"teams,omitempty"` //队伍 + WinType int32 `protobuf:"varint,3,opt,name=win_type,json=winType,proto3" json:"win_type,omitempty"` //获奖类型(1-队伍胜利,2-平局) + WinTeamId int64 `protobuf:"varint,4,opt,name=win_team_id,json=winTeamId,proto3" json:"win_team_id,omitempty"` //获胜队伍id + FreeVote int32 `protobuf:"varint,5,opt,name=free_vote,json=freeVote,proto3" json:"free_vote,omitempty"` //免费投票次数 + PointVote int32 `protobuf:"varint,6,opt,name=point_vote,json=pointVote,proto3" json:"point_vote,omitempty"` //积分投票次数 +} + +func (x *VoteListRes_One) Reset() { + *x = VoteListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[313] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VoteListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteListRes_One) ProtoMessage() {} + +func (x *VoteListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[313] + 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 VoteListRes_One.ProtoReflect.Descriptor instead. +func (*VoteListRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{169, 0} +} + +func (x *VoteListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VoteListRes_One) GetTeams() []*VoteListRes_Team { + if x != nil { + return x.Teams + } + return nil +} + +func (x *VoteListRes_One) GetWinType() int32 { + if x != nil { + return x.WinType + } + return 0 +} + +func (x *VoteListRes_One) GetWinTeamId() int64 { + if x != nil { + return x.WinTeamId + } + return 0 +} + +func (x *VoteListRes_One) GetFreeVote() int32 { + if x != nil { + return x.FreeVote + } + return 0 +} + +func (x *VoteListRes_One) GetPointVote() int32 { + if x != nil { + return x.PointVote + } + return 0 +} + +type VoteListRes_Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //队伍id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //队伍名称 + LogoImg string `protobuf:"bytes,3,opt,name=logo_img,json=logoImg,proto3" json:"logo_img,omitempty"` //队伍图标 +} + +func (x *VoteListRes_Team) Reset() { + *x = VoteListRes_Team{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[314] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VoteListRes_Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VoteListRes_Team) ProtoMessage() {} + +func (x *VoteListRes_Team) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[314] + 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 VoteListRes_Team.ProtoReflect.Descriptor instead. +func (*VoteListRes_Team) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{169, 1} +} + +func (x *VoteListRes_Team) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VoteListRes_Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *VoteListRes_Team) GetLogoImg() string { + if x != nil { + return x.LogoImg + } + return "" +} + +type UnoRandCardRes_Card struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //卡颜色标识 + CardNo int32 `protobuf:"varint,2,opt,name=card_no,json=cardNo,proto3" json:"card_no,omitempty"` //卡编号 +} + +func (x *UnoRandCardRes_Card) Reset() { + *x = UnoRandCardRes_Card{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[315] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoRandCardRes_Card) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoRandCardRes_Card) ProtoMessage() {} + +func (x *UnoRandCardRes_Card) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[315] + 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 UnoRandCardRes_Card.ProtoReflect.Descriptor instead. +func (*UnoRandCardRes_Card) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{173, 0} +} + +func (x *UnoRandCardRes_Card) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UnoRandCardRes_Card) GetCardNo() int32 { + if x != nil { + return x.CardNo + } + return 0 +} + +type UnoClaimRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *UnoClaimRes_KV) Reset() { + *x = UnoClaimRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[316] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoClaimRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoClaimRes_KV) ProtoMessage() {} + +func (x *UnoClaimRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[316] + 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 UnoClaimRes_KV.ProtoReflect.Descriptor instead. +func (*UnoClaimRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{175, 0} +} + +func (x *UnoClaimRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UnoClaimRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *UnoClaimRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type UnoCardRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //卡组id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //颜色标识 + CardInfo []int32 `protobuf:"varint,3,rep,packed,name=card_info,json=cardInfo,proto3" json:"card_info,omitempty"` //卡牌信息 + PreIntactNum int32 `protobuf:"varint,4,opt,name=pre_intact_num,json=preIntactNum,proto3" json:"pre_intact_num,omitempty"` //待合成奖品数 + IntactNum int32 `protobuf:"varint,5,opt,name=intact_num,json=intactNum,proto3" json:"intact_num,omitempty"` //完整奖品数 + LimitNum int32 `protobuf:"varint,6,opt,name=limit_num,json=limitNum,proto3" json:"limit_num,omitempty"` //上限奖品数 +} + +func (x *UnoCardRes_One) Reset() { + *x = UnoCardRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[317] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnoCardRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnoCardRes_One) ProtoMessage() {} + +func (x *UnoCardRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[317] + 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 UnoCardRes_One.ProtoReflect.Descriptor instead. +func (*UnoCardRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{177, 0} +} + +func (x *UnoCardRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UnoCardRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UnoCardRes_One) GetCardInfo() []int32 { + if x != nil { + return x.CardInfo + } + return nil +} + +func (x *UnoCardRes_One) GetPreIntactNum() int32 { + if x != nil { + return x.PreIntactNum + } + return 0 +} + +func (x *UnoCardRes_One) GetIntactNum() int32 { + if x != nil { + return x.IntactNum + } + return 0 +} + +func (x *UnoCardRes_One) GetLimitNum() int32 { + if x != nil { + return x.LimitNum + } + return 0 +} + +type EventFirstVisitRes_EventReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PropMark string `protobuf:"bytes,1,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward *EventFirstVisitRes_Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 +} + +func (x *EventFirstVisitRes_EventReward) Reset() { + *x = EventFirstVisitRes_EventReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[318] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFirstVisitRes_EventReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFirstVisitRes_EventReward) ProtoMessage() {} + +func (x *EventFirstVisitRes_EventReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[318] + 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 EventFirstVisitRes_EventReward.ProtoReflect.Descriptor instead. +func (*EventFirstVisitRes_EventReward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{181, 0} +} + +func (x *EventFirstVisitRes_EventReward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *EventFirstVisitRes_EventReward) GetReward() *EventFirstVisitRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *EventFirstVisitRes_EventReward) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +type EventFirstVisitRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //记录hash_id + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + RewardNum int32 `protobuf:"varint,4,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //奖品数量 + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,6,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + KvData []*EventFirstVisitRes_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品对应的键值数据 + ReceiveType int32 `protobuf:"varint,8,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + CustomRewardVal string `protobuf:"bytes,10,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义数据 + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *EventFirstVisitRes_Reward) Reset() { + *x = EventFirstVisitRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[319] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFirstVisitRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFirstVisitRes_Reward) ProtoMessage() {} + +func (x *EventFirstVisitRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[319] + 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 EventFirstVisitRes_Reward.ProtoReflect.Descriptor instead. +func (*EventFirstVisitRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{181, 1} +} + +func (x *EventFirstVisitRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *EventFirstVisitRes_Reward) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *EventFirstVisitRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *EventFirstVisitRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetKvData() []*EventFirstVisitRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *EventFirstVisitRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *EventFirstVisitRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *EventFirstVisitRes_Reward) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type EventFirstVisitRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *EventFirstVisitRes_KV) Reset() { + *x = EventFirstVisitRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[320] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFirstVisitRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFirstVisitRes_KV) ProtoMessage() {} + +func (x *EventFirstVisitRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[320] + 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 EventFirstVisitRes_KV.ProtoReflect.Descriptor instead. +func (*EventFirstVisitRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{181, 2} +} + +func (x *EventFirstVisitRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EventFirstVisitRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *EventFirstVisitRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type TaskTipRes_EventReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PropMark string `protobuf:"bytes,1,opt,name=prop_mark,json=propMark,proto3" json:"prop_mark,omitempty"` //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward *TaskTipRes_Reward `protobuf:"bytes,2,opt,name=reward,proto3" json:"reward,omitempty"` //奖品 + Chance int32 `protobuf:"varint,3,opt,name=chance,proto3" json:"chance,omitempty"` //道具数量 +} + +func (x *TaskTipRes_EventReward) Reset() { + *x = TaskTipRes_EventReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[321] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipRes_EventReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipRes_EventReward) ProtoMessage() {} + +func (x *TaskTipRes_EventReward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[321] + 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 TaskTipRes_EventReward.ProtoReflect.Descriptor instead. +func (*TaskTipRes_EventReward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{185, 0} +} + +func (x *TaskTipRes_EventReward) GetPropMark() string { + if x != nil { + return x.PropMark + } + return "" +} + +func (x *TaskTipRes_EventReward) GetReward() *TaskTipRes_Reward { + if x != nil { + return x.Reward + } + return nil +} + +func (x *TaskTipRes_EventReward) GetChance() int32 { + if x != nil { + return x.Chance + } + return 0 +} + +type TaskTipRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //记录hash_id + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + RewardNum int32 `protobuf:"varint,4,opt,name=reward_num,json=rewardNum,proto3" json:"reward_num,omitempty"` //奖品数量 + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,6,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + KvData []*TaskTipRes_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品对应的键值数据 + ReceiveType int32 `protobuf:"varint,8,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + CustomRewardVal string `protobuf:"bytes,10,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义数据 + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *TaskTipRes_Reward) Reset() { + *x = TaskTipRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[322] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipRes_Reward) ProtoMessage() {} + +func (x *TaskTipRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[322] + 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 TaskTipRes_Reward.ProtoReflect.Descriptor instead. +func (*TaskTipRes_Reward) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{185, 1} +} + +func (x *TaskTipRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TaskTipRes_Reward) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *TaskTipRes_Reward) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *TaskTipRes_Reward) GetRewardNum() int32 { + if x != nil { + return x.RewardNum + } + return 0 +} + +func (x *TaskTipRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TaskTipRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *TaskTipRes_Reward) GetKvData() []*TaskTipRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *TaskTipRes_Reward) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *TaskTipRes_Reward) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *TaskTipRes_Reward) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *TaskTipRes_Reward) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *TaskTipRes_Reward) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *TaskTipRes_Reward) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type TaskTipRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *TaskTipRes_KV) Reset() { + *x = TaskTipRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[323] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskTipRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskTipRes_KV) ProtoMessage() {} + +func (x *TaskTipRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[323] + 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 TaskTipRes_KV.ProtoReflect.Descriptor instead. +func (*TaskTipRes_KV) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{185, 2} +} + +func (x *TaskTipRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *TaskTipRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *TaskTipRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type CoinLogRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CreatedAt int64 `protobuf:"varint,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //标识 + Num int32 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` //数量 + Type int32 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` //类型 +} + +func (x *CoinLogRes_One) Reset() { + *x = CoinLogRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_campaign_user_proto_msgTypes[324] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CoinLogRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CoinLogRes_One) ProtoMessage() {} + +func (x *CoinLogRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_campaign_user_proto_msgTypes[324] + 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 CoinLogRes_One.ProtoReflect.Descriptor instead. +func (*CoinLogRes_One) Descriptor() ([]byte, []int) { + return file_w_campaign_user_proto_rawDescGZIP(), []int{189, 0} +} + +func (x *CoinLogRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *CoinLogRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *CoinLogRes_One) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *CoinLogRes_One) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +var File_w_campaign_user_proto protoreflect.FileDescriptor + +var file_w_campaign_user_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x22, 0xd4, 0x03, 0x0a, 0x07, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, + 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, + 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x70, + 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x11, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x5f, 0x62, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x61, 0x73, 0x63, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x41, + 0x73, 0x63, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, + 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x69, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x70, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6a, 0x6f, 0x69, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, + 0x64, 0x18, 0x10, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x64, 0x22, 0x99, 0x13, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x32, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x69, 0x78, 0x44, 0x69, 0x63, 0x65, 0x1a, + 0xfe, 0x09, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x6e, + 0x65, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, + 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x68, 0x65, 0x6c, + 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x48, 0x65, 0x6c, 0x70, 0x12, + 0x33, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, 0x04, + 0x64, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x76, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6c, 0x76, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x28, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, + 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, + 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x18, 0x16, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x43, 0x68, 0x6f, 0x70, 0x52, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, + 0x69, 0x6c, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x61, 0x69, 0x6c, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x30, 0x0a, 0x03, 0x77, 0x69, 0x6e, 0x18, 0x18, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x2e, 0x57, 0x69, 0x6e, 0x52, 0x03, 0x77, 0x69, 0x6e, 0x12, 0x3a, 0x0a, 0x08, 0x6b, 0x65, 0x65, + 0x70, 0x5f, 0x64, 0x6f, 0x67, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x07, 0x6b, 0x65, + 0x65, 0x70, 0x44, 0x6f, 0x67, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x61, 0x73, 0x68, 0x18, 0x1a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x43, 0x61, 0x73, 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, + 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x33, 0x0a, 0x04, + 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, + 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x61, + 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6a, 0x6f, 0x69, 0x6e, 0x41, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x61, 0x74, 0x18, 0x20, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x41, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x61, 0x74, 0x18, 0x21, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x74, 0x12, + 0x2d, 0x0a, 0x02, 0x76, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x56, 0x73, 0x52, 0x02, 0x76, 0x73, 0x12, 0x30, + 0x0a, 0x03, 0x75, 0x6e, 0x6f, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, + 0x1a, 0x6e, 0x0a, 0x03, 0x55, 0x6e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x66, 0x69, 0x76, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x66, 0x69, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x78, 0x4e, 0x75, 0x6d, + 0x1a, 0x6d, 0x0a, 0x02, 0x56, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, + 0x6e, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, + 0x6e, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x1a, + 0x41, 0x0a, 0x04, 0x44, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x6c, 0x75, 0x63, 0x6b, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x75, 0x63, 0x6b, 0x79, 0x43, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x1a, 0x69, 0x0a, 0x04, 0x43, 0x68, 0x6f, 0x70, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x68, + 0x6f, 0x70, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0c, 0x63, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, + 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x1a, 0x2c, 0x0a, + 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0x26, 0x0a, 0x03, 0x57, + 0x69, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, + 0x6d, 0x65, 0x72, 0x1a, 0x62, 0x0a, 0x04, 0x4b, 0x65, 0x65, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x25, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x40, + 0x0a, 0x04, 0x47, 0x6f, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x6f, 0x6c, 0x64, 0x4e, 0x75, + 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, + 0x1a, 0x7e, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x55, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, + 0x75, 0x6d, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x52, 0x06, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x73, + 0x1a, 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x69, 0x6e, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x67, 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x1a, 0x44, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, + 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x22, 0xd6, 0x02, + 0x0a, 0x09, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x66, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x73, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x22, 0xf2, 0x07, 0x0a, 0x09, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x1a, 0xb6, 0x06, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x07, + 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, + 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, + 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x70, 0x75, 0x73, + 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x66, 0x61, 0x69, 0x6c, 0x4d, 0x73, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, + 0x5f, 0x75, 0x73, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, + 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x79, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, + 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x76, 0x61, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x8c, 0x04, 0x0a, 0x08, + 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x77, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x77, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x6c, 0x76, 0x12, 0x34, 0x0a, 0x04, 0x63, 0x65, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x2e, + 0x43, 0x65, 0x72, 0x74, 0x52, 0x04, 0x63, 0x65, 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x63, + 0x65, 0x6e, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x49, 0x64, 0x1a, 0x82, 0x01, 0x0a, 0x04, 0x43, 0x65, 0x72, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9b, 0x01, 0x0a, 0x08, 0x56, + 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x69, 0x73, 0x56, 0x69, 0x65, 0x77, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x61, 0x73, + 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, + 0x61, 0x73, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x22, 0xb1, 0x35, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x6c, 0x69, 0x6e, + 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, 0x72, 0x65, 0x4c, 0x69, + 0x6e, 0x6b, 0x12, 0x4c, 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, + 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x12, 0x4c, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x50, 0x61, 0x6c, 0x79, 0x65, 0x72, + 0x52, 0x0c, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x33, + 0x0a, 0x04, 0x71, 0x75, 0x69, 0x7a, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x75, 0x69, 0x7a, 0x52, 0x04, 0x71, + 0x75, 0x69, 0x7a, 0x12, 0x33, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, + 0x65, 0x73, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, 0x04, 0x64, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, + 0x04, 0x67, 0x72, 0x6f, 0x77, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x04, 0x67, 0x72, + 0x6f, 0x77, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x6f, + 0x70, 0x52, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x33, 0x0a, 0x04, 0x63, + 0x61, 0x73, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, + 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x04, 0x63, 0x61, 0x73, 0x68, + 0x12, 0x33, 0x0a, 0x04, 0x63, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x52, + 0x04, 0x63, 0x6c, 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x64, 0x6f, + 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x07, 0x6b, 0x65, 0x65, 0x70, 0x44, 0x6f, + 0x67, 0x12, 0x33, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x6f, 0x6c, 0x64, + 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x2d, 0x0a, 0x02, 0x76, + 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x2e, 0x56, 0x73, 0x52, 0x02, 0x76, 0x73, 0x12, 0x30, 0x0a, 0x03, 0x75, 0x6e, + 0x6f, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x03, 0x75, 0x6e, 0x6f, 0x1a, 0xd6, 0x02, 0x0a, + 0x03, 0x55, 0x6e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x74, 0x68, 0x72, 0x65, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x74, 0x68, 0x72, 0x65, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x76, + 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x69, 0x76, + 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x78, 0x4e, 0x75, 0x6d, 0x12, 0x35, 0x0a, + 0x03, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, + 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x03, 0x72, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, + 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x06, 0x79, 0x65, 0x6c, 0x6c, + 0x6f, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, + 0x79, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x79, + 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x1a, 0x65, 0x0a, 0x08, 0x55, 0x6e, 0x6f, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, + 0x75, 0x6d, 0x12, 0x38, 0x0a, 0x05, 0x63, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x6e, + 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x05, 0x63, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x3d, 0x0a, 0x07, + 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x72, 0x64, 0x5f, + 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x4e, 0x6f, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, 0xb8, 0x01, 0x0a, 0x02, + 0x56, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x63, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x45, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x77, 0x69, 0x6e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x9b, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x6c, + 0x6c, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x6c, + 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x73, 0x65, + 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x53, 0x65, 0x63, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x6e, + 0x5f, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x47, + 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x65, 0x6e, 0x64, 0x1a, 0x4d, 0x0a, 0x04, 0x43, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x65, 0x43, + 0x6f, 0x6e, 0x64, 0x1a, 0x79, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x36, 0x0a, 0x05, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, + 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x52, 0x05, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0x92, + 0x01, 0x0a, 0x05, 0x46, 0x69, 0x78, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x70, 0x70, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x61, 0x70, 0x70, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x1a, 0xc5, 0x01, 0x0a, 0x06, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, + 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x3d, 0x0a, 0x08, + 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, + 0x6c, 0x6c, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x1a, 0x61, 0x0a, 0x07, 0x42, + 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x73, + 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, + 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x1a, 0xfb, + 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6e, + 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x55, 0x0a, 0x0c, + 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x4e, 0x75, 0x6d, 0x1a, 0x99, 0x03, 0x0a, 0x04, 0x51, 0x75, 0x69, 0x7a, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x10, 0x0a, 0x03, 0x77, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, + 0x77, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, + 0x5f, 0x70, 0x75, 0x73, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, + 0x75, 0x73, 0x68, 0x12, 0x36, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, + 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x1a, + 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0x83, 0x04, 0x0a, 0x0c, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x50, 0x61, 0x6c, 0x79, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x65, 0x64, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6e, 0x65, 0x65, 0x64, 0x4e, 0x75, + 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, + 0x74, 0x72, 0x61, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x72, 0x61, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x0d, 0x6e, 0x6f, + 0x74, 0x69, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4e, 0x6f, + 0x74, 0x69, 0x63, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x68, 0x61, 0x73, 0x5f, + 0x6e, 0x65, 0x77, 0x63, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x77, 0x63, 0x6f, 0x6d, + 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x68, 0x61, 0x73, 0x5f, + 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x68, 0x61, 0x73, 0x48, 0x65, 0x6c, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x1a, 0xee, 0x01, 0x0a, + 0x0c, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, + 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, + 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x1a, 0xed, 0x01, + 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, + 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, + 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x5f, 0x64, 0x61, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, + 0x65, 0x44, 0x61, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x21, + 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x64, 0x61, 0x79, 0x53, 0x69, 0x67, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x44, 0x61, 0x79, 0x1a, 0xc6, 0x02, + 0x0a, 0x04, 0x44, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1e, + 0x0a, 0x0b, 0x6d, 0x61, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x5f, 0x72, 0x6f, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x70, 0x72, 0x6f, + 0x70, 0x73, 0x46, 0x69, 0x78, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x12, 0x3e, 0x0a, 0x08, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x08, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x33, 0x0a, 0x16, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x66, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x12, + 0x15, 0x0a, 0x06, 0x64, 0x6d, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x64, 0x6d, 0x67, 0x49, 0x64, 0x1a, 0xa3, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, + 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x1a, 0x8c, 0x01, 0x0a, + 0x04, 0x47, 0x72, 0x6f, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x77, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x77, 0x4e, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, + 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x68, 0x61, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x1a, 0xdb, 0x01, 0x0a, 0x04, + 0x43, 0x68, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x68, 0x6f, 0x70, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x68, + 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x6e, 0x6f, 0x6e, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x6f, 0x6e, 0x65, 0x1a, 0x87, 0x02, 0x0a, 0x04, 0x43, 0x61, + 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x74, 0x65, 0x70, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x74, 0x74, 0x65, + 0x72, 0x79, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6c, 0x6f, + 0x74, 0x74, 0x65, 0x72, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x77, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x68, + 0x6f, 0x77, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x12, 0x3e, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x67, + 0x61, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x68, 0x61, 0x73, 0x41, 0x67, + 0x61, 0x69, 0x6e, 0x1a, 0x9c, 0x02, 0x0a, 0x04, 0x47, 0x6f, 0x6c, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x74, 0x65, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, + 0x72, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, + 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x49, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x67, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x3e, 0x0a, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x64, 0x64, + 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x69, 0x6e, + 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x69, 0x64, 0x65, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x1a, 0xc5, 0x03, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, + 0x67, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x36, 0x0a, 0x07, + 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, + 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, + 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x1a, 0x81, 0x04, 0x0a, 0x04, 0x4b, + 0x65, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, + 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x63, 0x6b, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x65, 0x65, 0x64, 0x4c, 0x61, 0x63, 0x6b, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0d, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x53, 0x65, 0x63, 0x12, + 0x3d, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, 0x65, 0x70, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x65, 0x66, 0x74, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x75, 0x69, 0x64, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x67, 0x75, 0x69, 0x64, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x61, 0x79, + 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0e, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x15, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, + 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x12, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x53, 0x65, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0b, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x1a, 0x68, + 0x0a, 0x0a, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x22, 0x8c, 0x03, 0x0a, 0x0d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xc1, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1e, + 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x70, 0x73, 0x75, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x70, 0x73, 0x75, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x41, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x67, 0x0a, 0x06, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x24, 0x0a, + 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x22, 0x74, 0x0a, 0x07, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x82, 0x02, 0x0a, 0x07, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x73, 0x75, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x73, 0x75, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x69, + 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x3b, + 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x41, 0x0a, 0x06, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x83, + 0x01, 0x0a, 0x07, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x22, 0xb6, 0x02, 0x0a, 0x07, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, + 0x12, 0x32, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x9e, + 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x35, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, + 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, + 0x2c, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x46, 0x0a, + 0x0a, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0xc7, 0x03, 0x0a, 0x0a, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x77, 0x69, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x77, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, + 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x19, + 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x39, 0x0a, 0x07, 0x6b, 0x76, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, + 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, + 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, + 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, + 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, + 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, + 0xcf, 0x01, 0x0a, 0x09, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x73, 0x77, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x73, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, + 0x61, 0x72, 0x6b, 0x1a, 0x2c, 0x0a, 0x06, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x71, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x71, 0x69, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x61, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x61, 0x69, + 0x64, 0x22, 0xf9, 0x03, 0x0a, 0x09, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x77, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x03, 0x77, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x38, 0x0a, 0x07, 0x6b, 0x76, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, + 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x24, 0x0a, 0x0e, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0b, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, + 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x15, 0x0a, + 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x71, + 0x61, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x71, 0x61, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x71, 0x61, 0x52, 0x69, + 0x67, 0x68, 0x74, 0x4e, 0x75, 0x6d, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x59, 0x0a, + 0x10, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x9b, 0x04, 0x0a, 0x10, 0x41, 0x6e, 0x73, + 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xe5, 0x02, 0x0a, 0x03, 0x4f, + 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, + 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, + 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x54, 0x65, 0x78, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x49, 0x6d, + 0x67, 0x12, 0x44, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x73, 0x77, 0x65, + 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x03, 0x52, 0x0e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x1a, 0x62, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x22, 0xb5, 0x01, 0x0a, 0x07, 0x56, 0x6f, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, + 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x21, + 0x0a, 0x07, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x93, 0x01, 0x0a, 0x09, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x72, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x0b, 0x0a, 0x09, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x52, 0x65, 0x73, 0x22, 0x58, 0x0a, 0x0f, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x11, + 0x0a, 0x0f, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x78, 0x0a, 0x0d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xa7, 0x02, 0x0a, 0x0d, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x1a, 0x60, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x1a, 0x45, + 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x07, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, + 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb1, 0x0f, 0x0a, 0x07, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x5f, 0x64, 0x61, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x79, 0x52, 0x06, 0x66, 0x69, 0x78, 0x44, 0x61, 0x79, 0x12, + 0x36, 0x0a, 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x52, 0x05, 0x66, 0x69, 0x78, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x73, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x1a, 0x48, 0x0a, + 0x03, 0x44, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x15, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x5f, 0x64, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x63, 0x61, 0x6e, 0x44, 0x6f, 0x1a, 0xa9, 0x01, 0x0a, 0x05, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x70, 0x70, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, + 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x0a, 0x06, + 0x63, 0x61, 0x6e, 0x5f, 0x64, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x61, + 0x6e, 0x44, 0x6f, 0x1a, 0xc5, 0x01, 0x0a, 0x06, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, + 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x3d, 0x0a, 0x08, + 0x62, 0x6f, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x2e, 0x42, 0x6f, 0x74, 0x68, 0x41, + 0x6c, 0x6c, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x1a, 0xd2, 0x01, 0x0a, 0x07, + 0x42, 0x6f, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, + 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, + 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x12, + 0x39, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, + 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, + 0x1a, 0x82, 0x08, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, + 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, + 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x15, + 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x5f, 0x64, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x63, 0x61, 0x6e, 0x44, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x26, 0x0a, 0x0f, 0x74, + 0x6f, 0x6d, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x64, 0x6f, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x6f, 0x6d, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x43, 0x61, + 0x6e, 0x44, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1e, 0x0a, 0x0b, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x63, 0x61, 0x6e, 0x5f, 0x64, 0x6f, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x77, 0x65, 0x65, 0x6b, 0x43, 0x61, 0x6e, 0x44, 0x6f, 0x12, + 0x19, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x77, 0x65, 0x65, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, + 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, + 0x68, 0x6f, 0x77, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, + 0x73, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, + 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, + 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, + 0x39, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, + 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x19, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x53, 0x65, 0x63, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x1b, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x68, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x68, 0x61, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1d, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x65, 0x78, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x1f, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6c, 0x69, + 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6c, 0x69, 0x63, + 0x6b, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x21, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x18, 0x22, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x1a, 0x47, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x22, 0x5b, + 0x0a, 0x09, 0x52, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0e, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x09, 0x52, + 0x65, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x66, 0x61, 0x69, 0x6c, 0x4d, 0x73, 0x67, 0x22, 0xf0, 0x02, 0x0a, 0x0e, 0x44, 0x79, 0x6e, + 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x4a, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, + 0x65, 0x78, 0x74, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x28, + 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x1a, 0x80, 0x01, 0x0a, 0x09, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x69, 0x63, 0x6b, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x2b, 0x0a, 0x0e, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, + 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x22, 0x28, 0x0a, 0x0d, 0x44, 0x79, 0x6c, 0x69, + 0x6e, 0x6b, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x22, 0xfc, 0x01, 0x0a, 0x0d, 0x44, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6c, 0x69, + 0x6e, 0x6b, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, + 0x65, 0x78, 0x74, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x65, 0x78, 0x74, 0x1a, 0x80, + 0x01, 0x0a, 0x09, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x69, 0x63, 0x6b, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x22, 0x7f, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x77, 0x5f, 0x6d, + 0x6f, 0x75, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x77, 0x4d, + 0x6f, 0x75, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x22, 0xb5, 0x05, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x73, + 0x12, 0x42, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, + 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, + 0x44, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x75, 0x74, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x77, 0x4d, 0x6f, 0x75, 0x74, + 0x68, 0x12, 0x45, 0x0a, 0x0a, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, + 0x52, 0x65, 0x73, 0x2e, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x52, 0x09, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x1a, 0xfe, 0x01, 0x0a, 0x08, 0x53, 0x69, 0x67, + 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, + 0x6d, 0x12, 0x0c, 0x0a, 0x01, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x62, 0x61, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6e, + 0x6f, 0x77, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6e, + 0x6f, 0x77, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x77, 0x5f, 0x64, 0x61, + 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x77, 0x44, 0x61, 0x79, 0x12, + 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x69, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x6e, 0x6f, 0x77, 0x5f, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x6e, 0x6f, 0x77, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x1a, 0xfe, 0x01, 0x0a, 0x09, 0x43, 0x79, + 0x63, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x12, 0x17, 0x0a, + 0x07, 0x6e, 0x6f, 0x77, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x6e, 0x6f, 0x77, 0x44, 0x61, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, + 0x6d, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, + 0x0a, 0x01, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6d, 0x12, 0x0c, 0x0a, 0x01, + 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x64, 0x22, 0x60, 0x0a, 0x07, 0x53, 0x69, + 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0xe0, 0x02, 0x0a, + 0x07, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x61, 0x69, + 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, 0x61, 0x73, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x36, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, + 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0xa9, 0x01, 0x0a, 0x0a, 0x44, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x70, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, + 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x53, 0x74, 0x65, 0x70, 0x12, 0x20, 0x0a, 0x0c, 0x67, 0x6f, 0x5f, 0x73, + 0x68, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x67, 0x6f, 0x53, 0x68, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0xe1, 0x01, 0x0a, 0x0a, + 0x44, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, + 0x65, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x1a, 0x9b, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x70, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x61, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x72, + 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, + 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, + 0x69, 0x0a, 0x07, 0x44, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x88, 0x02, 0x0a, 0x07, 0x44, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x70, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x69, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x49, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, 0x60, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, + 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, + 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x22, 0xcf, 0x02, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x5f, 0x67, 0x72, 0x6f, 0x77, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x67, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x77, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x09, 0x6c, 0x76, + 0x5f, 0x75, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, + 0x76, 0x55, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x15, 0x0a, 0x06, 0x64, 0x69, 0x66, 0x66, 0x5f, 0x70, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x69, 0x66, 0x66, 0x50, 0x12, 0x19, 0x0a, + 0x08, 0x77, 0x69, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x77, 0x69, 0x6c, 0x6c, 0x44, 0x69, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x64, + 0x69, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x44, 0x69, 0x65, 0x12, + 0x15, 0x0a, 0x06, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x76, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x6d, 0x61, 0x78, 0x4c, 0x76, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, 0x6b, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, 0x5c, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x34, 0x0a, 0x07, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x89, 0x03, 0x0a, 0x07, + 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x6c, 0x76, 0x5f, 0x75, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x76, 0x55, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x70, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x75, 0x70, 0x53, 0x74, 0x65, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x61, 0x73, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x46, 0x65, 0x65, + 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5a, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x65, + 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x5d, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x22, 0xde, 0x02, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x5c, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, + 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x6e, 0x0a, 0x06, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x69, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x76, 0x61, + 0x72, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, + 0x56, 0x52, 0x07, 0x76, 0x61, 0x72, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x69, 0x64, 0x4d, 0x61, 0x72, + 0x6b, 0x22, 0x77, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, + 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, + 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, + 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x22, 0x25, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x6b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, 0x05, 0x63, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x74, 0x49, 0x64, 0x22, 0xb9, + 0x06, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x34, 0x0a, 0x02, 0x71, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x2e, 0x51, 0x61, 0x52, 0x02, 0x71, 0x61, 0x12, 0x40, 0x0a, 0x06, 0x62, + 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x42, + 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x52, 0x06, 0x62, 0x61, 0x6c, 0x6c, 0x6f, 0x74, 0x12, 0x3a, 0x0a, + 0x04, 0x63, 0x68, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, + 0x68, 0x6f, 0x70, 0x52, 0x04, 0x63, 0x68, 0x6f, 0x70, 0x1a, 0x93, 0x02, 0x0a, 0x02, 0x51, 0x61, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, + 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x42, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x6f, 0x6d, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, 0x6f, 0x6d, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x1a, + 0x47, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x1a, 0x47, 0x0a, 0x06, 0x42, 0x61, 0x6c, 0x6c, + 0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, + 0x6c, 0x1a, 0x4e, 0x0a, 0x04, 0x43, 0x68, 0x6f, 0x70, 0x12, 0x46, 0x0a, 0x07, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x68, + 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x1a, 0x67, 0x0a, 0x0a, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1a, + 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x66, 0x0a, 0x0d, 0x43, 0x68, + 0x6f, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x68, 0x6f, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x73, 0x22, 0x71, 0x0a, 0x0f, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x68, 0x6f, 0x70, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, + 0x63, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x0f, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x6f, 0x6e, 0x65, 0x22, 0x76, 0x0a, 0x0b, 0x43, 0x68, + 0x6f, 0x70, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x22, 0xc3, 0x01, 0x0a, 0x0b, 0x43, 0x68, 0x6f, 0x70, 0x48, 0x65, 0x6c, 0x70, 0x52, + 0x65, 0x73, 0x12, 0x36, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, + 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x1a, 0x66, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0xf9, 0x02, 0x0a, 0x0e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x39, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0x95, + 0x02, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x15, + 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x69, 0x73, 0x4e, 0x65, 0x77, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x65, 0x6c, 0x70, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x68, 0x65, 0x6c, 0x70, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x36, 0x0a, 0x0c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xb9, + 0x01, 0x0a, 0x0c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x37, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x70, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x61, 0x0a, 0x0d, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x0f, 0x0a, + 0x0d, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x48, + 0x0a, 0x0c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x0e, 0x0a, 0x0c, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, 0x22, 0x21, 0x0a, 0x0f, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x43, + 0x0a, 0x0c, 0x4d, 0x61, 0x72, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x61, + 0x72, 0x6b, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x0c, 0x4d, 0x61, 0x72, 0x6b, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x52, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x3f, 0x0a, + 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x5d, + 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x62, 0x0a, + 0x0d, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x12, 0x19, + 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x42, 0x6f, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x66, + 0x74, 0x5f, 0x62, 0x6f, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x66, + 0x74, 0x42, 0x6f, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x6f, + 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x42, 0x6f, + 0x78, 0x22, 0x43, 0x0a, 0x07, 0x53, 0x70, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x07, 0x53, 0x70, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8d, + 0x01, 0x0a, 0x0e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x90, + 0x02, 0x0a, 0x0e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, + 0x73, 0x12, 0x39, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, + 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x1a, 0xac, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, + 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x5f, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, + 0x63, 0x4f, 0x72, 0x41, 0x64, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x68, + 0x65, 0x6c, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x48, 0x65, 0x6c, + 0x70, 0x22, 0x65, 0x0a, 0x0c, 0x4d, 0x69, 0x78, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0xba, 0x03, 0x0a, 0x0c, 0x4d, 0x69, 0x78, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x1b, 0x0a, + 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x6b, 0x76, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, + 0x69, 0x78, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, + 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, + 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, + 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, + 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8f, 0x02, 0x0a, 0x0d, 0x44, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x20, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, + 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0xd9, 0x07, 0x0a, 0x0d, 0x44, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0x87, 0x01, 0x0a, 0x03, 0x4f, 0x6e, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x1a, 0xa6, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, + 0x5f, 0x73, 0x75, 0x70, 0x70, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, + 0x73, 0x53, 0x75, 0x70, 0x70, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x6c, 0x75, 0x63, 0x6b, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x75, 0x63, 0x6b, 0x79, 0x43, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x24, 0x0a, 0x0e, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, + 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, + 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, + 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, 0x6b, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x24, 0x0a, 0x0e, + 0x64, 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x5f, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x1a, 0x45, 0x0a, 0x02, + 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, + 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, + 0x68, 0x6f, 0x77, 0x22, 0xd3, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x46, 0x6f, + 0x72, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, + 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xf0, 0x01, 0x0a, 0x0d, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x73, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x69, 0x73, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x3b, + 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x2e, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x1a, 0x42, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd7, 0x01, 0x0a, + 0x0d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x24, + 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, + 0x72, 0x6d, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x1a, 0x42, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, + 0x54, 0x79, 0x70, 0x65, 0x22, 0x40, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x64, 0x73, 0x55, 0x72, + 0x6c, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xf6, 0x02, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x64, + 0x73, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x20, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36, + 0x0a, 0x04, 0x61, 0x64, 0x5f, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x73, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x2e, 0x41, 0x64, + 0x47, 0x52, 0x03, 0x61, 0x64, 0x47, 0x1a, 0x77, 0x0a, 0x03, 0x41, 0x64, 0x47, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x64, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x64, 0x63, 0x12, + 0x1c, 0x0a, 0x0a, 0x67, 0x61, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x61, 0x53, 0x68, 0x6f, 0x77, 0x49, 0x64, 0x12, 0x1e, 0x0a, + 0x0b, 0x67, 0x61, 0x5f, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x67, 0x61, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x49, 0x64, 0x12, 0x20, 0x0a, + 0x0c, 0x67, 0x61, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x61, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x22, + 0xb1, 0x01, 0x0a, 0x0a, 0x41, 0x64, 0x73, 0x53, 0x74, 0x61, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x54, + 0x69, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x0a, 0x41, 0x64, 0x73, 0x53, 0x74, 0x61, 0x79, 0x52, 0x65, + 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x79, 0x5f, 0x6c, 0x61, 0x76, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x79, 0x4c, 0x61, 0x76, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, + 0x6e, 0x65, 0x22, 0x2a, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x11, + 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x72, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x49, 0x0a, 0x0d, 0x43, + 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x9b, 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x6f, 0x70, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x47, 0x0a, 0x06, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, + 0x67, 0x55, 0x72, 0x6c, 0x22, 0x4a, 0x0a, 0x0e, 0x48, 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x22, 0x69, 0x0a, 0x0e, 0x48, 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x46, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x6c, 0x64, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, + 0x6f, 0x6c, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x64, + 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x0a, 0x61, 0x64, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x22, 0x64, 0x0a, 0x0d, 0x49, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, + 0x64, 0x22, 0x87, 0x05, 0x0a, 0x0d, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, + 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, + 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, + 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, + 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x6f, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x26, 0x0a, 0x0f, + 0x61, 0x64, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x5f, 0x69, 0x64, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x73, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x67, 0x79, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x76, + 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, + 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x64, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x53, 0x65, 0x63, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x1a, 0x47, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x22, 0x49, 0x0a, 0x0d, 0x4b, + 0x65, 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0xc5, 0x01, 0x0a, 0x0d, 0x4b, 0x65, 0x65, 0x70, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, + 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x71, 0x0a, 0x06, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, + 0x67, 0x55, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x66, + 0x0a, 0x0d, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0d, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0x4a, 0x0a, 0x0e, 0x4b, 0x65, 0x65, 0x70, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xdb, 0x02, 0x0a, 0x0e, + 0x4b, 0x65, 0x65, 0x70, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x3c, + 0x0a, 0x04, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x04, 0x67, 0x65, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0xf8, + 0x01, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x6d, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x47, 0x0a, 0x0b, 0x4b, 0x65, 0x65, + 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x22, 0x46, 0x0a, 0x0b, 0x4b, 0x65, 0x65, 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x64, 0x64, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x61, 0x64, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x22, 0x5c, 0x0a, 0x0e, 0x4d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x10, 0x0a, 0x0e, 0x4d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x11, 0x4d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x6e, 0x0a, 0x11, 0x4d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x75, + 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x46, 0x75, + 0x6c, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, 0x22, 0x4a, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x22, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x89, 0x01, 0x0a, 0x0a, + 0x4b, 0x65, 0x65, 0x70, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x0a, 0x4b, 0x65, 0x65, 0x70, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x1a, 0x62, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x4b, 0x0a, 0x0f, 0x4b, 0x65, 0x65, 0x70, 0x52, + 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x0f, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x73, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0x48, 0x0a, 0x0c, 0x4b, 0x65, 0x65, 0x70, 0x47, 0x75, 0x69, 0x64, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xdd, 0x01, 0x0a, 0x0c, 0x4b, 0x65, + 0x65, 0x70, 0x47, 0x75, 0x69, 0x64, 0x65, 0x52, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, + 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, + 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4e, 0x0a, 0x12, 0x4b, 0x65, 0x65, + 0x70, 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xa6, 0x01, 0x0a, 0x12, 0x4b, 0x65, + 0x65, 0x70, 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x64, 0x61, 0x79, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x64, + 0x61, 0x79, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x61, 0x79, 0x46, 0x69, 0x72, 0x73, 0x74, 0x46, 0x65, 0x65, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x53, + 0x65, 0x63, 0x22, 0x44, 0x0a, 0x08, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xd6, 0x10, 0x0a, 0x08, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x52, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x05, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, + 0x73, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x52, 0x05, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x12, 0x37, + 0x0a, 0x05, 0x6c, 0x75, 0x63, 0x6b, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x75, 0x63, 0x6b, 0x79, + 0x52, 0x05, 0x6c, 0x75, 0x63, 0x6b, 0x79, 0x12, 0x34, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, + 0x65, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x3a, 0x0a, + 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x1a, 0xb1, 0x02, 0x0a, 0x06, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x09, 0x72, + 0x61, 0x6e, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x6b, + 0x4f, 0x6e, 0x65, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3a, 0x0a, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x1a, 0xc9, 0x01, + 0x0a, 0x07, 0x52, 0x61, 0x6e, 0x6b, 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x69, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, + 0x6d, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, 0xed, 0x01, 0x0a, 0x04, 0x53, 0x69, + 0x67, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3c, + 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3a, 0x0a, 0x06, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x1a, 0xd1, 0x01, 0x0a, 0x05, 0x4c, 0x75, + 0x63, 0x6b, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3a, 0x0a, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x1a, 0xbb, 0x01, + 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, + 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, + 0x75, 0x70, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x67, 0x65, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x73, 0x47, 0x65, 0x74, 0x1a, 0x93, 0x01, 0x0a, 0x05, + 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x22, 0x0a, + 0x0d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x1a, 0x86, 0x04, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x69, 0x6d, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, + 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, + 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, + 0x77, 0x22, 0x69, 0x0a, 0x0e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x22, 0xc0, 0x05, 0x0a, + 0x0e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x8c, 0x04, 0x0a, 0x06, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x69, 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x3d, + 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, + 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, + 0x03, 0x69, 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, + 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, + 0x24, 0x0a, 0x0e, 0x64, 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x2a, + 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x76, 0x61, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, + 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, + 0x61, 0x0a, 0x11, 0x47, 0x6f, 0x6c, 0x64, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x65, + 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x22, 0x66, 0x0a, 0x11, 0x47, 0x6f, 0x6c, 0x64, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x42, + 0x6f, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x62, 0x6f, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6c, 0x65, 0x66, 0x74, 0x42, 0x6f, 0x78, 0x12, 0x1b, 0x0a, + 0x09, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x6f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x08, 0x72, 0x69, 0x67, 0x68, 0x74, 0x42, 0x6f, 0x78, 0x22, 0x49, 0x0a, 0x0d, 0x47, 0x6f, + 0x6c, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x67, 0x6f, + 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x47, 0x6f, 0x6c, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x64, 0x64, 0x5f, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x61, 0x64, 0x64, 0x47, 0x6f, 0x6c, 0x64, 0x22, 0x78, 0x0a, 0x0d, + 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, + 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, + 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0xca, 0x01, 0x0a, 0x0d, 0x47, 0x6f, 0x6c, 0x64, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0x69, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x6f, 0x6c, 0x64, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x6f, 0x6c, 0x64, 0x4e, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x22, 0x45, 0x0a, 0x09, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x44, + 0x65, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, + 0x65, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x70, + 0x65, 0x6e, 0x53, 0x65, 0x63, 0x22, 0x43, 0x0a, 0x07, 0x47, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x3c, 0x0a, 0x07, 0x47, 0x61, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, + 0x08, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x22, 0xcc, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x69, + 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, + 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8a, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x69, 0x6e, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xa8, 0x01, 0x0a, 0x03, 0x4f, 0x6e, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1e, + 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x22, 0x8c, 0x02, 0x0a, 0x0c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x65, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x69, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, + 0x61, 0x72, 0x6b, 0x22, 0x89, 0x04, 0x0a, 0x0c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x1a, 0xd6, 0x02, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x61, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6a, 0x6f, 0x69, 0x6e, 0x41, 0x74, 0x12, 0x1e, + 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, + 0x3b, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x05, + 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4e, 0x75, 0x6d, + 0x52, 0x05, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x12, 0x3d, 0x0a, 0x07, 0x6c, 0x6f, 0x74, 0x74, 0x65, + 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4e, 0x75, 0x6d, 0x52, 0x07, 0x6c, + 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x1a, 0x17, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x12, 0x10, 0x0a, + 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, + 0x65, 0x0a, 0x10, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0xfa, 0x04, 0x0a, 0x10, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x42, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x1a, 0xa5, 0x03, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, + 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x75, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6a, 0x75, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x3f, 0x0a, 0x07, 0x6b, + 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, + 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x63, + 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6c, 0x61, 0x63, 0x6b, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x1a, 0x45, 0x0a, 0x02, + 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, + 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, + 0x68, 0x6f, 0x77, 0x22, 0xc2, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, + 0x50, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x20, + 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xc2, 0x02, 0x0a, 0x0d, 0x4c, 0x6f, 0x74, + 0x74, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x74, + 0x74, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xe0, 0x01, 0x0a, 0x03, 0x4f, + 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x63, 0x68, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x40, 0x0a, + 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, + 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, + 0xb2, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x36, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x6b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, + 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x0c, 0x43, 0x61, 0x73, 0x68, 0x41, 0x67, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x0e, + 0x0a, 0x0c, 0x43, 0x61, 0x73, 0x68, 0x41, 0x67, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x53, + 0x0a, 0x0e, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x22, 0xeb, 0x01, 0x0a, 0x0e, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x1a, 0x9d, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x6d, 0x69, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x6d, 0x69, 0x78, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x4e, 0x75, + 0x6d, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x26, + 0x0a, 0x0f, 0x70, 0x6f, 0x72, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6f, 0x72, 0x6a, 0x65, 0x63, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x22, 0x87, 0x02, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x80, 0x01, 0x0a, 0x06, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3e, 0x0a, + 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x2c, 0x0a, + 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x48, 0x0a, 0x0c, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x26, 0x0a, 0x0c, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, + 0x73, 0x65, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x59, 0x0a, + 0x07, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0xa4, 0x01, 0x0a, 0x07, 0x43, 0x68, 0x61, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x73, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x22, + 0x7b, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x61, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0xd0, 0x01, 0x0a, + 0x0b, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x61, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x88, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x73, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x22, + 0x66, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, + 0x74, 0x61, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x74, 0x61, 0x62, 0x54, 0x79, 0x70, 0x65, 0x22, 0xcd, 0x0c, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xca, 0x05, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x73, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x73, 0x49, 0x6d, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x76, 0x73, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x73, 0x44, + 0x61, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x76, 0x73, 0x5f, 0x74, 0x7a, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x76, 0x73, 0x54, 0x7a, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x6f, 0x74, 0x65, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, + 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x77, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, + 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, + 0x73, 0x12, 0x48, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x74, + 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3d, + 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x06, + 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x2e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1b, + 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4f, 0x64, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6f, + 0x64, 0x64, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x64, 0x64, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x64, 0x64, 0x73, + 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x64, + 0x64, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x64, 0x64, 0x73, 0x5f, + 0x64, 0x72, 0x61, 0x77, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x64, 0x64, 0x73, + 0x44, 0x72, 0x61, 0x77, 0x1a, 0x36, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x53, 0x0a, 0x04, + 0x56, 0x6f, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1e, 0x0a, 0x0b, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x77, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, + 0x6d, 0x1a, 0x5b, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x89, + 0x01, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x57, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x27, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x61, 0x6d, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x57, + 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x77, + 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x12, + 0x19, 0x0a, 0x08, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x76, 0x6f, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x1a, 0xf3, 0x02, 0x0a, 0x06, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x69, 0x6d, 0x67, 0x12, 0x3e, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, + 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, + 0x75, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, + 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, + 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x70, 0x4e, 0x75, 0x6d, + 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x47, 0x0a, 0x0b, 0x4d, 0x61, 0x6c, 0x6c, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, + 0x22, 0x91, 0x02, 0x0a, 0x0b, 0x4d, 0x61, 0x6c, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x12, 0x36, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6c, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xc9, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, + 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x75, 0x70, 0x5f, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x75, 0x70, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, + 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, + 0x6e, 0x4e, 0x75, 0x6d, 0x22, 0x69, 0x0a, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x20, 0x0a, + 0x0c, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, + 0x96, 0x04, 0x0a, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, + 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, + 0x55, 0x72, 0x6c, 0x12, 0x3a, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0b, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x76, 0x61, + 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, + 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x61, + 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, + 0x73, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x4d, 0x73, + 0x67, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x59, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, + 0x73, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x22, 0xd6, 0x02, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xc7, 0x01, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x19, + 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x77, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x77, 0x69, 0x6e, + 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x77, 0x69, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x65, + 0x65, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x72, + 0x65, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, + 0x76, 0x6f, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x45, 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x49, 0x6d, 0x67, 0x22, 0x4a, 0x0a, 0x0e, + 0x56, 0x73, 0x54, 0x69, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x56, 0x73, 0x54, 0x69, + 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x0e, 0x55, + 0x6e, 0x6f, 0x52, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x4d, + 0x61, 0x72, 0x6b, 0x22, 0x9b, 0x01, 0x0a, 0x0e, 0x55, 0x6e, 0x6f, 0x52, 0x61, 0x6e, 0x64, 0x43, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3c, + 0x0a, 0x05, 0x63, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x2e, 0x43, 0x61, 0x72, 0x64, 0x52, 0x05, 0x63, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x33, 0x0a, 0x04, + 0x43, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x72, 0x64, + 0x5f, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x4e, + 0x6f, 0x22, 0x66, 0x0a, 0x0b, 0x55, 0x6e, 0x6f, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x22, 0xf7, 0x03, 0x0a, 0x0b, 0x55, 0x6e, + 0x6f, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x3a, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, + 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, + 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, + 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x45, 0x0a, 0x02, + 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, + 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, + 0x68, 0x6f, 0x77, 0x22, 0x58, 0x0a, 0x0a, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x20, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xee, 0x01, + 0x0a, 0x0a, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, + 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x1a, 0xa8, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, + 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x0e, + 0x70, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x49, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x4e, + 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x4e, 0x75, + 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x4e, 0x75, 0x6d, 0x22, 0x55, + 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0c, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x75, 0x73, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xfc, 0x02, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, + 0x72, 0x6b, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x76, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x76, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, + 0x6c, 0x76, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6c, 0x76, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x6f, 0x69, + 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6a, 0x6f, 0x69, 0x6e, + 0x41, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x5f, 0x6c, 0x61, + 0x73, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6a, 0x6f, 0x69, 0x6e, 0x41, 0x74, + 0x4c, 0x61, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x7a, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x02, 0x74, 0x7a, 0x22, 0x4e, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, + 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x49, 0x64, 0x22, 0xcf, 0x05, 0x0a, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x07, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x88, 0x01, 0x0a, 0x0b, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x44, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, + 0x69, 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x1a, 0x99, 0x03, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x12, 0x41, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, + 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, + 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x17, + 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, + 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x6d, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, + 0x55, 0x6e, 0x69, 0x71, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x1f, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x42, 0x79, 0x55, + 0x6e, 0x69, 0x71, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x46, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0xbd, + 0x05, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, 0x52, 0x65, 0x73, 0x12, 0x43, 0x0a, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, 0x52, 0x65, 0x73, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x6c, + 0x1a, 0x80, 0x01, 0x0a, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x70, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x3c, 0x0a, + 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, + 0x68, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x63, 0x65, 0x1a, 0x91, 0x03, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x12, 0x39, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, 0x52, + 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, + 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x56, + 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, 0x4f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x01, 0x6c, 0x22, 0x0e, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, + 0x70, 0x4f, 0x6b, 0x52, 0x65, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x69, 0x6e, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, + 0x73, 0x12, 0x35, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0x5e, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x32, 0xe2, + 0x3b, 0x0a, 0x0d, 0x57, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x40, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1c, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x05, 0x56, 0x69, + 0x73, 0x69, 0x74, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x40, 0x0a, 0x04, 0x50, 0x6c, 0x61, 0x79, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, + 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, + 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x4c, 0x6f, 0x74, + 0x74, 0x65, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0d, + 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x23, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x56, 0x6f, 0x74, + 0x65, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, + 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, + 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x40, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x12, 0x1c, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x44, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x53, 0x68, 0x6f, 0x77, + 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x53, 0x68, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, + 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1c, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, + 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, + 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x49, 0x0a, 0x07, 0x44, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x1d, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x44, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, + 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x44, + 0x69, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, + 0x04, 0x47, 0x72, 0x6f, 0x77, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, + 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x49, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x77, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x46, 0x65, + 0x65, 0x64, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x46, + 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x47, 0x72, 0x6f, 0x77, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x77, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x43, 0x68, 0x6f, + 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x6f, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x58, 0x0a, + 0x0c, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x43, 0x68, 0x6f, 0x70, 0x48, + 0x65, 0x6c, 0x70, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x48, 0x65, 0x6c, 0x70, + 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x48, 0x65, 0x6c, 0x70, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, + 0x0a, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x64, 0x69, 0x74, 0x12, 0x1f, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0c, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x12, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, + 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, + 0x4d, 0x61, 0x72, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x61, + 0x72, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, + 0x61, 0x72, 0x6b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, + 0x0a, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, 0x70, 0x12, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x70, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x70, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x70, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x43, 0x61, 0x73, 0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x4d, 0x69, + 0x78, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x69, 0x78, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x69, 0x78, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x44, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x44, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x1a, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, + 0x6d, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x6d, + 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, + 0x72, 0x6d, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, 0x64, + 0x73, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x73, 0x55, + 0x72, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x73, + 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x41, 0x64, 0x73, 0x53, + 0x74, 0x61, 0x79, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x61, 0x79, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x53, 0x74, 0x61, 0x79, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0c, 0x43, 0x6c, 0x75, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x12, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x75, 0x65, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x75, 0x65, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x61, 0x0a, + 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x12, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x52, 0x0a, 0x0a, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, + 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x6f, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x48, 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x50, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x50, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x49, + 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x49, 0x6e, + 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x52, 0x0a, 0x0a, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x4b, 0x65, 0x65, 0x70, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, + 0x65, 0x70, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, + 0x0a, 0x08, 0x4b, 0x65, 0x65, 0x70, 0x46, 0x65, 0x65, 0x64, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, + 0x65, 0x65, 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, + 0x65, 0x65, 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x61, 0x76, 0x65, 0x12, 0x21, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x21, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x52, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x46, 0x65, + 0x65, 0x64, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x46, 0x65, + 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, + 0x70, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x4b, 0x65, + 0x65, 0x70, 0x4c, 0x6f, 0x67, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0c, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, 0x65, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, + 0x65, 0x70, 0x52, 0x65, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x4f, 0x0a, 0x09, 0x4b, 0x65, 0x65, 0x70, 0x47, 0x75, 0x69, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x47, 0x75, 0x69, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x47, 0x75, 0x69, 0x64, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x61, 0x0a, 0x0f, 0x4b, 0x65, 0x65, 0x70, 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x46, 0x69, 0x72, 0x73, + 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4b, + 0x65, 0x65, 0x70, 0x46, 0x69, 0x72, 0x73, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x1b, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, + 0x68, 0x69, 0x6c, 0x64, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x5e, 0x0a, 0x0e, 0x47, 0x6f, 0x6c, 0x64, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, + 0x70, 0x12, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, + 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, + 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x52, 0x0a, 0x0a, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x12, 0x20, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x44, 0x65, 0x64, 0x75, 0x63, + 0x74, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x1c, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x40, 0x0a, 0x04, 0x47, 0x61, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x61, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, + 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0d, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4c, 0x6f, + 0x67, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x43, 0x61, 0x73, 0x68, 0x41, 0x67, 0x61, + 0x69, 0x6e, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x41, 0x67, 0x61, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x41, 0x67, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x58, 0x0a, + 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x22, 0x2e, + 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x55, 0x73, 0x65, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x55, + 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x55, 0x73, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x43, 0x68, 0x61, 0x74, + 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x43, 0x68, + 0x61, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0c, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x4d, 0x61, 0x6c, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6c, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6c, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x4c, 0x0a, 0x08, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, + 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, + 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, + 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x56, + 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, + 0x56, 0x73, 0x54, 0x69, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x56, 0x73, 0x54, 0x69, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x21, + 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x56, 0x73, 0x54, 0x69, 0x70, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0b, 0x55, 0x6e, 0x6f, 0x52, 0x61, 0x6e, 0x64, 0x43, 0x61, + 0x72, 0x64, 0x12, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x61, 0x6e, 0x64, 0x43, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x52, 0x61, 0x6e, + 0x64, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x08, 0x55, 0x6e, + 0x6f, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x55, 0x6e, 0x6f, 0x43, + 0x61, 0x72, 0x64, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x6f, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x04, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1a, 0x2e, 0x77, 0x5f, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x12, 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x25, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, 0x56, 0x69, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x64, + 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x12, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x42, + 0x79, 0x55, 0x6e, 0x69, 0x71, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, + 0x64, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, + 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, + 0x54, 0x69, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, + 0x69, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x54, + 0x69, 0x70, 0x4f, 0x6b, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, 0x70, + 0x4f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x69, + 0x70, 0x4f, 0x6b, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x43, 0x6f, 0x69, 0x6e, + 0x4c, 0x6f, 0x67, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x42, 0x16, 0x5a, 0x14, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_w_campaign_user_proto_rawDescOnce sync.Once + file_w_campaign_user_proto_rawDescData = file_w_campaign_user_proto_rawDesc +) + +func file_w_campaign_user_proto_rawDescGZIP() []byte { + file_w_campaign_user_proto_rawDescOnce.Do(func() { + file_w_campaign_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_campaign_user_proto_rawDescData) + }) + return file_w_campaign_user_proto_rawDescData +} + +var file_w_campaign_user_proto_msgTypes = make([]protoimpl.MessageInfo, 325) +var file_w_campaign_user_proto_goTypes = []interface{}{ + (*ListReq)(nil), // 0: w_campaign_userpb.ListReq + (*ListRes)(nil), // 1: w_campaign_userpb.ListRes + (*RewardReq)(nil), // 2: w_campaign_userpb.RewardReq + (*RewardRes)(nil), // 3: w_campaign_userpb.RewardRes + (*VisitReq)(nil), // 4: w_campaign_userpb.VisitReq + (*VisitRes)(nil), // 5: w_campaign_userpb.VisitRes + (*PlayReq)(nil), // 6: w_campaign_userpb.PlayReq + (*PlayRes)(nil), // 7: w_campaign_userpb.PlayRes + (*RewardUserReq)(nil), // 8: w_campaign_userpb.RewardUserReq + (*RewardUserRes)(nil), // 9: w_campaign_userpb.RewardUserRes + (*InfoReq)(nil), // 10: w_campaign_userpb.InfoReq + (*InfoRes)(nil), // 11: w_campaign_userpb.InfoRes + (*RankReq)(nil), // 12: w_campaign_userpb.RankReq + (*RankRes)(nil), // 13: w_campaign_userpb.RankRes + (*LotteryReq)(nil), // 14: w_campaign_userpb.LotteryReq + (*LotteryRes)(nil), // 15: w_campaign_userpb.LotteryRes + (*AnswerReq)(nil), // 16: w_campaign_userpb.AnswerReq + (*AnswerRes)(nil), // 17: w_campaign_userpb.AnswerRes + (*AnswerHistoryReq)(nil), // 18: w_campaign_userpb.AnswerHistoryReq + (*AnswerHistoryRes)(nil), // 19: w_campaign_userpb.AnswerHistoryRes + (*VoteReq)(nil), // 20: w_campaign_userpb.VoteReq + (*VoteRes)(nil), // 21: w_campaign_userpb.VoteRes + (*NotifyReq)(nil), // 22: w_campaign_userpb.NotifyReq + (*NotifyRes)(nil), // 23: w_campaign_userpb.NotifyRes + (*AcceptRewardReq)(nil), // 24: w_campaign_userpb.AcceptRewardReq + (*AcceptRewardRes)(nil), // 25: w_campaign_userpb.AcceptRewardRes + (*TargetRuleReq)(nil), // 26: w_campaign_userpb.TargetRuleReq + (*TargetRuleRes)(nil), // 27: w_campaign_userpb.TargetRuleRes + (*TaskReq)(nil), // 28: w_campaign_userpb.TaskReq + (*TaskRes)(nil), // 29: w_campaign_userpb.TaskRes + (*ResendReq)(nil), // 30: w_campaign_userpb.ResendReq + (*ResendRes)(nil), // 31: w_campaign_userpb.ResendRes + (*DynamicLinkReq)(nil), // 32: w_campaign_userpb.DynamicLinkReq + (*DynamicLinkRes)(nil), // 33: w_campaign_userpb.DynamicLinkRes + (*DylinkShowReq)(nil), // 34: w_campaign_userpb.DylinkShowReq + (*DylinkShowRes)(nil), // 35: w_campaign_userpb.DylinkShowRes + (*SignInReq)(nil), // 36: w_campaign_userpb.SignInReq + (*SignInRes)(nil), // 37: w_campaign_userpb.SignInRes + (*SignReq)(nil), // 38: w_campaign_userpb.SignReq + (*SignRes)(nil), // 39: w_campaign_userpb.SignRes + (*DiceMapReq)(nil), // 40: w_campaign_userpb.DiceMapReq + (*DiceMapRes)(nil), // 41: w_campaign_userpb.DiceMapRes + (*DiceReq)(nil), // 42: w_campaign_userpb.DiceReq + (*DiceRes)(nil), // 43: w_campaign_userpb.DiceRes + (*GrowReq)(nil), // 44: w_campaign_userpb.GrowReq + (*GrowRes)(nil), // 45: w_campaign_userpb.GrowRes + (*GetGrowReq)(nil), // 46: w_campaign_userpb.GetGrowReq + (*GetGrowRes)(nil), // 47: w_campaign_userpb.GetGrowRes + (*FeedReq)(nil), // 48: w_campaign_userpb.FeedReq + (*FeedRes)(nil), // 49: w_campaign_userpb.FeedRes + (*GetFeedReq)(nil), // 50: w_campaign_userpb.GetFeedReq + (*GetFeedRes)(nil), // 51: w_campaign_userpb.GetFeedRes + (*GrowRecordReq)(nil), // 52: w_campaign_userpb.GrowRecordReq + (*GrowRecordRes)(nil), // 53: w_campaign_userpb.GrowRecordRes + (*ContentLinkReq)(nil), // 54: w_campaign_userpb.ContentLinkReq + (*ContentLinkRes)(nil), // 55: w_campaign_userpb.ContentLinkRes + (*LinkContentReq)(nil), // 56: w_campaign_userpb.LinkContentReq + (*LinkContentRes)(nil), // 57: w_campaign_userpb.LinkContentRes + (*ChopSelectReq)(nil), // 58: w_campaign_userpb.ChopSelectReq + (*ChopSelectRes)(nil), // 59: w_campaign_userpb.ChopSelectRes + (*ChopReselectReq)(nil), // 60: w_campaign_userpb.ChopReselectReq + (*ChopReselectRes)(nil), // 61: w_campaign_userpb.ChopReselectRes + (*ChopHelpReq)(nil), // 62: w_campaign_userpb.ChopHelpReq + (*ChopHelpRes)(nil), // 63: w_campaign_userpb.ChopHelpRes + (*ProjectListReq)(nil), // 64: w_campaign_userpb.ProjectListReq + (*ProjectListRes)(nil), // 65: w_campaign_userpb.ProjectListRes + (*LevelListReq)(nil), // 66: w_campaign_userpb.LevelListReq + (*LevelListRes)(nil), // 67: w_campaign_userpb.LevelListRes + (*LevelStoreReq)(nil), // 68: w_campaign_userpb.LevelStoreReq + (*LevelStoreRes)(nil), // 69: w_campaign_userpb.LevelStoreRes + (*LevelEditReq)(nil), // 70: w_campaign_userpb.LevelEditReq + (*LevelEditRes)(nil), // 71: w_campaign_userpb.LevelEditRes + (*LevelDestroyReq)(nil), // 72: w_campaign_userpb.LevelDestroyReq + (*LevelDestroyRes)(nil), // 73: w_campaign_userpb.LevelDestroyRes + (*MarkLevelReq)(nil), // 74: w_campaign_userpb.MarkLevelReq + (*MarkLevelRes)(nil), // 75: w_campaign_userpb.MarkLevelRes + (*FinishStepReq)(nil), // 76: w_campaign_userpb.FinishStepReq + (*FinishStepRes)(nil), // 77: w_campaign_userpb.FinishStepRes + (*SpinReq)(nil), // 78: w_campaign_userpb.SpinReq + (*SpinRes)(nil), // 79: w_campaign_userpb.SpinRes + (*CashRecordsReq)(nil), // 80: w_campaign_userpb.CashRecordsReq + (*CashRecordsRes)(nil), // 81: w_campaign_userpb.CashRecordsRes + (*MixRewardReq)(nil), // 82: w_campaign_userpb.MixRewardReq + (*MixRewardRes)(nil), // 83: w_campaign_userpb.MixRewardRes + (*DiceRecordReq)(nil), // 84: w_campaign_userpb.DiceRecordReq + (*DiceRecordRes)(nil), // 85: w_campaign_userpb.DiceRecordRes + (*RewardFormReq)(nil), // 86: w_campaign_userpb.RewardFormReq + (*RewardFormRes)(nil), // 87: w_campaign_userpb.RewardFormRes + (*SubmitFormReq)(nil), // 88: w_campaign_userpb.SubmitFormReq + (*SubmitFormRes)(nil), // 89: w_campaign_userpb.SubmitFormRes + (*GetAdsUrlReq)(nil), // 90: w_campaign_userpb.GetAdsUrlReq + (*GetAdsUrlRes)(nil), // 91: w_campaign_userpb.GetAdsUrlRes + (*AdsStayReq)(nil), // 92: w_campaign_userpb.AdsStayReq + (*AdsStayRes)(nil), // 93: w_campaign_userpb.AdsStayRes + (*ClueNotifiedReq)(nil), // 94: w_campaign_userpb.ClueNotifiedReq + (*ClueNotifiedRes)(nil), // 95: w_campaign_userpb.ClueNotifiedRes + (*ChangeUserLevelReq)(nil), // 96: w_campaign_userpb.ChangeUserLevelReq + (*ChangeUserLevelRes)(nil), // 97: w_campaign_userpb.ChangeUserLevelRes + (*ChopRewardReq)(nil), // 98: w_campaign_userpb.ChopRewardReq + (*ChopRewardRes)(nil), // 99: w_campaign_userpb.ChopRewardRes + (*HelpPercentReq)(nil), // 100: w_campaign_userpb.HelpPercentReq + (*HelpPercentRes)(nil), // 101: w_campaign_userpb.HelpPercentRes + (*InvokeCondReq)(nil), // 102: w_campaign_userpb.InvokeCondReq + (*InvokeCondRes)(nil), // 103: w_campaign_userpb.InvokeCondRes + (*KeepRewardReq)(nil), // 104: w_campaign_userpb.KeepRewardReq + (*KeepRewardRes)(nil), // 105: w_campaign_userpb.KeepRewardRes + (*KeepSelectReq)(nil), // 106: w_campaign_userpb.KeepSelectReq + (*KeepSelectRes)(nil), // 107: w_campaign_userpb.KeepSelectRes + (*KeepCollectReq)(nil), // 108: w_campaign_userpb.KeepCollectReq + (*KeepCollectRes)(nil), // 109: w_campaign_userpb.KeepCollectRes + (*KeepFeedReq)(nil), // 110: w_campaign_userpb.KeepFeedReq + (*KeepFeedRes)(nil), // 111: w_campaign_userpb.KeepFeedRes + (*MachineSaveReq)(nil), // 112: w_campaign_userpb.MachineSaveReq + (*MachineSaveRes)(nil), // 113: w_campaign_userpb.MachineSaveRes + (*MachineRecycleReq)(nil), // 114: w_campaign_userpb.MachineRecycleReq + (*MachineRecycleRes)(nil), // 115: w_campaign_userpb.MachineRecycleRes + (*GetPropFeedReq)(nil), // 116: w_campaign_userpb.GetPropFeedReq + (*GetPropFeedRes)(nil), // 117: w_campaign_userpb.GetPropFeedRes + (*KeepLogReq)(nil), // 118: w_campaign_userpb.KeepLogReq + (*KeepLogRes)(nil), // 119: w_campaign_userpb.KeepLogRes + (*KeepReselectReq)(nil), // 120: w_campaign_userpb.KeepReselectReq + (*KeepReselectRes)(nil), // 121: w_campaign_userpb.KeepReselectRes + (*KeepGuideReq)(nil), // 122: w_campaign_userpb.KeepGuideReq + (*KeepGuideRes)(nil), // 123: w_campaign_userpb.KeepGuideRes + (*KeepFirstInviteReq)(nil), // 124: w_campaign_userpb.KeepFirstInviteReq + (*KeepFirstInviteRes)(nil), // 125: w_campaign_userpb.KeepFirstInviteRes + (*ChildReq)(nil), // 126: w_campaign_userpb.ChildReq + (*ChildRes)(nil), // 127: w_campaign_userpb.ChildRes + (*ChildActiveReq)(nil), // 128: w_campaign_userpb.ChildActiveReq + (*ChildActiveRes)(nil), // 129: w_campaign_userpb.ChildActiveRes + (*GoldFinishStepReq)(nil), // 130: w_campaign_userpb.GoldFinishStepReq + (*GoldFinishStepRes)(nil), // 131: w_campaign_userpb.GoldFinishStepRes + (*GoldNotifyReq)(nil), // 132: w_campaign_userpb.GoldNotifyReq + (*GoldNotifyRes)(nil), // 133: w_campaign_userpb.GoldNotifyRes + (*GoldRecordReq)(nil), // 134: w_campaign_userpb.GoldRecordReq + (*GoldRecordRes)(nil), // 135: w_campaign_userpb.GoldRecordRes + (*DeductReq)(nil), // 136: w_campaign_userpb.DeductReq + (*DeductRes)(nil), // 137: w_campaign_userpb.DeductRes + (*GainReq)(nil), // 138: w_campaign_userpb.GainReq + (*GainRes)(nil), // 139: w_campaign_userpb.GainRes + (*CoinRecordReq)(nil), // 140: w_campaign_userpb.CoinRecordReq + (*CoinRecordRes)(nil), // 141: w_campaign_userpb.CoinRecordRes + (*ChildListReq)(nil), // 142: w_campaign_userpb.ChildListReq + (*ChildListRes)(nil), // 143: w_campaign_userpb.ChildListRes + (*ReceiveRewardReq)(nil), // 144: w_campaign_userpb.ReceiveRewardReq + (*ReceiveRewardRes)(nil), // 145: w_campaign_userpb.ReceiveRewardRes + (*LotteryLogReq)(nil), // 146: w_campaign_userpb.LotteryLogReq + (*LotteryLogRes)(nil), // 147: w_campaign_userpb.LotteryLogRes + (*UserListReq)(nil), // 148: w_campaign_userpb.UserListReq + (*UserListRes)(nil), // 149: w_campaign_userpb.UserListRes + (*CashAgainReq)(nil), // 150: w_campaign_userpb.CashAgainReq + (*CashAgainRes)(nil), // 151: w_campaign_userpb.CashAgainRes + (*DiceCollectReq)(nil), // 152: w_campaign_userpb.DiceCollectReq + (*DiceCollectRes)(nil), // 153: w_campaign_userpb.DiceCollectRes + (*ClientRewardReq)(nil), // 154: w_campaign_userpb.ClientRewardReq + (*ClientRewardRes)(nil), // 155: w_campaign_userpb.ClientRewardRes + (*PointsUseReq)(nil), // 156: w_campaign_userpb.PointsUseReq + (*PointsUseRes)(nil), // 157: w_campaign_userpb.PointsUseRes + (*ChatReq)(nil), // 158: w_campaign_userpb.ChatReq + (*ChatRes)(nil), // 159: w_campaign_userpb.ChatRes + (*ChatListReq)(nil), // 160: w_campaign_userpb.ChatListReq + (*ChatListRes)(nil), // 161: w_campaign_userpb.ChatListRes + (*ScheduleListReq)(nil), // 162: w_campaign_userpb.ScheduleListReq + (*ScheduleListRes)(nil), // 163: w_campaign_userpb.ScheduleListRes + (*MallListReq)(nil), // 164: w_campaign_userpb.MallListReq + (*MallListRes)(nil), // 165: w_campaign_userpb.MallListRes + (*ExchangeReq)(nil), // 166: w_campaign_userpb.ExchangeReq + (*ExchangeRes)(nil), // 167: w_campaign_userpb.ExchangeRes + (*VoteListReq)(nil), // 168: w_campaign_userpb.VoteListReq + (*VoteListRes)(nil), // 169: w_campaign_userpb.VoteListRes + (*VsTipRewardReq)(nil), // 170: w_campaign_userpb.VsTipRewardReq + (*VsTipRewardRes)(nil), // 171: w_campaign_userpb.VsTipRewardRes + (*UnoRandCardReq)(nil), // 172: w_campaign_userpb.UnoRandCardReq + (*UnoRandCardRes)(nil), // 173: w_campaign_userpb.UnoRandCardRes + (*UnoClaimReq)(nil), // 174: w_campaign_userpb.UnoClaimReq + (*UnoClaimRes)(nil), // 175: w_campaign_userpb.UnoClaimRes + (*UnoCardReq)(nil), // 176: w_campaign_userpb.UnoCardReq + (*UnoCardRes)(nil), // 177: w_campaign_userpb.UnoCardRes + (*ShowReq)(nil), // 178: w_campaign_userpb.ShowReq + (*ShowRes)(nil), // 179: w_campaign_userpb.ShowRes + (*EventFirstVisitReq)(nil), // 180: w_campaign_userpb.EventFirstVisitReq + (*EventFirstVisitRes)(nil), // 181: w_campaign_userpb.EventFirstVisitRes + (*FindByUniqReq)(nil), // 182: w_campaign_userpb.FindByUniqReq + (*FindByUniqRes)(nil), // 183: w_campaign_userpb.FindByUniqRes + (*TaskTipReq)(nil), // 184: w_campaign_userpb.TaskTipReq + (*TaskTipRes)(nil), // 185: w_campaign_userpb.TaskTipRes + (*TaskTipOkReq)(nil), // 186: w_campaign_userpb.TaskTipOkReq + (*TaskTipOkRes)(nil), // 187: w_campaign_userpb.TaskTipOkRes + (*CoinLogReq)(nil), // 188: w_campaign_userpb.CoinLogReq + (*CoinLogRes)(nil), // 189: w_campaign_userpb.CoinLogRes + (*ListRes_One)(nil), // 190: w_campaign_userpb.ListRes.One + (*ListRes_Uno)(nil), // 191: w_campaign_userpb.ListRes.Uno + (*ListRes_Vs)(nil), // 192: w_campaign_userpb.ListRes.Vs + (*ListRes_Dice)(nil), // 193: w_campaign_userpb.ListRes.Dice + (*ListRes_Chop)(nil), // 194: w_campaign_userpb.ListRes.Chop + (*ListRes_Cond)(nil), // 195: w_campaign_userpb.ListRes.Cond + (*ListRes_Win)(nil), // 196: w_campaign_userpb.ListRes.Win + (*ListRes_Keep)(nil), // 197: w_campaign_userpb.ListRes.Keep + (*ListRes_Cash)(nil), // 198: w_campaign_userpb.ListRes.Cash + (*ListRes_Gold)(nil), // 199: w_campaign_userpb.ListRes.Gold + (*ListRes_Coin)(nil), // 200: w_campaign_userpb.ListRes.Coin + (*ListRes_CoinScene)(nil), // 201: w_campaign_userpb.ListRes.CoinScene + (*ListRes_Sign)(nil), // 202: w_campaign_userpb.ListRes.Sign + (*RewardRes_One)(nil), // 203: w_campaign_userpb.RewardRes.One + (*RewardRes_KV)(nil), // 204: w_campaign_userpb.RewardRes.KV + (*VisitReq_Cert)(nil), // 205: w_campaign_userpb.VisitReq.Cert + (*PlayRes_Uno)(nil), // 206: w_campaign_userpb.PlayRes.Uno + (*PlayRes_UnoGroup)(nil), // 207: w_campaign_userpb.PlayRes.UnoGroup + (*PlayRes_UnoCard)(nil), // 208: w_campaign_userpb.PlayRes.UnoCard + (*PlayRes_Vs)(nil), // 209: w_campaign_userpb.PlayRes.Vs + (*PlayRes_Coin)(nil), // 210: w_campaign_userpb.PlayRes.Coin + (*PlayRes_Clue)(nil), // 211: w_campaign_userpb.PlayRes.Clue + (*PlayRes_Task)(nil), // 212: w_campaign_userpb.PlayRes.Task + (*PlayRes_Fixed)(nil), // 213: w_campaign_userpb.PlayRes.Fixed + (*PlayRes_Custom)(nil), // 214: w_campaign_userpb.PlayRes.Custom + (*PlayRes_BothAll)(nil), // 215: w_campaign_userpb.PlayRes.BothAll + (*PlayRes_Cond)(nil), // 216: w_campaign_userpb.PlayRes.Cond + (*PlayRes_ChancePlayer)(nil), // 217: w_campaign_userpb.PlayRes.ChancePlayer + (*PlayRes_Quiz)(nil), // 218: w_campaign_userpb.PlayRes.Quiz + (*PlayRes_KV)(nil), // 219: w_campaign_userpb.PlayRes.KV + (*PlayRes_InvitePalyer)(nil), // 220: w_campaign_userpb.PlayRes.InvitePalyer + (*PlayRes_NoticeReward)(nil), // 221: w_campaign_userpb.PlayRes.NoticeReward + (*PlayRes_Sign)(nil), // 222: w_campaign_userpb.PlayRes.Sign + (*PlayRes_Dice)(nil), // 223: w_campaign_userpb.PlayRes.Dice + (*PlayRes_Collect)(nil), // 224: w_campaign_userpb.PlayRes.Collect + (*PlayRes_Grow)(nil), // 225: w_campaign_userpb.PlayRes.Grow + (*PlayRes_Chop)(nil), // 226: w_campaign_userpb.PlayRes.Chop + (*PlayRes_Cash)(nil), // 227: w_campaign_userpb.PlayRes.Cash + (*PlayRes_Gold)(nil), // 228: w_campaign_userpb.PlayRes.Gold + (*PlayRes_GetReward)(nil), // 229: w_campaign_userpb.PlayRes.GetReward + (*PlayRes_Keep)(nil), // 230: w_campaign_userpb.PlayRes.Keep + (*PlayRes_KeepReward)(nil), // 231: w_campaign_userpb.PlayRes.KeepReward + (*RewardUserRes_One)(nil), // 232: w_campaign_userpb.RewardUserRes.One + (*RewardUserRes_Reward)(nil), // 233: w_campaign_userpb.RewardUserRes.Reward + (*InfoRes_Reward)(nil), // 234: w_campaign_userpb.InfoRes.Reward + (*RankRes_One)(nil), // 235: w_campaign_userpb.RankRes.One + (*RankRes_Cond)(nil), // 236: w_campaign_userpb.RankRes.Cond + (*LotteryRes_KV)(nil), // 237: w_campaign_userpb.LotteryRes.KV + (*AnswerReq_Submit)(nil), // 238: w_campaign_userpb.AnswerReq.Submit + (*AnswerRes_KV)(nil), // 239: w_campaign_userpb.AnswerRes.KV + (*AnswerHistoryRes_One)(nil), // 240: w_campaign_userpb.AnswerHistoryRes.One + (*AnswerHistoryRes_Option)(nil), // 241: w_campaign_userpb.AnswerHistoryRes.Option + (*TargetRuleRes_One)(nil), // 242: w_campaign_userpb.TargetRuleRes.One + (*TargetRuleRes_Cond)(nil), // 243: w_campaign_userpb.TargetRuleRes.Cond + (*TaskRes_Day)(nil), // 244: w_campaign_userpb.TaskRes.Day + (*TaskRes_Fixed)(nil), // 245: w_campaign_userpb.TaskRes.Fixed + (*TaskRes_Custom)(nil), // 246: w_campaign_userpb.TaskRes.Custom + (*TaskRes_BothAll)(nil), // 247: w_campaign_userpb.TaskRes.BothAll + (*TaskRes_Cond)(nil), // 248: w_campaign_userpb.TaskRes.Cond + (*TaskRes_Reward)(nil), // 249: w_campaign_userpb.TaskRes.Reward + (*DynamicLinkReq_ImageText)(nil), // 250: w_campaign_userpb.DynamicLinkReq.ImageText + (*DylinkShowRes_ImageText)(nil), // 251: w_campaign_userpb.DylinkShowRes.ImageText + (*SignInRes_SignDate)(nil), // 252: w_campaign_userpb.SignInRes.SignDate + (*SignInRes_CycleDate)(nil), // 253: w_campaign_userpb.SignInRes.CycleDate + (*SignRes_KV)(nil), // 254: w_campaign_userpb.SignRes.KV + (*DiceMapRes_One)(nil), // 255: w_campaign_userpb.DiceMapRes.One + (*FeedRes_KV)(nil), // 256: w_campaign_userpb.FeedRes.KV + (*GrowRecordRes_One)(nil), // 257: w_campaign_userpb.GrowRecordRes.One + (*GrowRecordRes_Record)(nil), // 258: w_campaign_userpb.GrowRecordRes.Record + (*GrowRecordRes_KV)(nil), // 259: w_campaign_userpb.GrowRecordRes.KV + (*LinkContentRes_Qa)(nil), // 260: w_campaign_userpb.LinkContentRes.Qa + (*LinkContentRes_Option)(nil), // 261: w_campaign_userpb.LinkContentRes.Option + (*LinkContentRes_Ballot)(nil), // 262: w_campaign_userpb.LinkContentRes.Ballot + (*LinkContentRes_Chop)(nil), // 263: w_campaign_userpb.LinkContentRes.Chop + (*LinkContentRes_ChopReward)(nil), // 264: w_campaign_userpb.LinkContentRes.ChopReward + (*ChopHelpRes_One)(nil), // 265: w_campaign_userpb.ChopHelpRes.One + (*ProjectListRes_One)(nil), // 266: w_campaign_userpb.ProjectListRes.One + (*LevelListRes_One)(nil), // 267: w_campaign_userpb.LevelListRes.One + (*MarkLevelRes_One)(nil), // 268: w_campaign_userpb.MarkLevelRes.One + (*CashRecordsRes_One)(nil), // 269: w_campaign_userpb.CashRecordsRes.One + (*MixRewardRes_KV)(nil), // 270: w_campaign_userpb.MixRewardRes.KV + (*DiceRecordRes_One)(nil), // 271: w_campaign_userpb.DiceRecordRes.One + (*DiceRecordRes_Data)(nil), // 272: w_campaign_userpb.DiceRecordRes.Data + (*DiceRecordRes_KV)(nil), // 273: w_campaign_userpb.DiceRecordRes.KV + (*RewardFormRes_Item)(nil), // 274: w_campaign_userpb.RewardFormRes.Item + (*SubmitFormReq_Item)(nil), // 275: w_campaign_userpb.SubmitFormReq.Item + (*GetAdsUrlRes_AdG)(nil), // 276: w_campaign_userpb.GetAdsUrlRes.AdG + (*ChopRewardRes_Reward)(nil), // 277: w_campaign_userpb.ChopRewardRes.Reward + (*InvokeCondRes_Reward)(nil), // 278: w_campaign_userpb.InvokeCondRes.Reward + (*KeepRewardRes_Reward)(nil), // 279: w_campaign_userpb.KeepRewardRes.Reward + (*KeepCollectRes_Reward)(nil), // 280: w_campaign_userpb.KeepCollectRes.Reward + (*KeepLogRes_One)(nil), // 281: w_campaign_userpb.KeepLogRes.One + (*ChildRes_Invite)(nil), // 282: w_campaign_userpb.ChildRes.Invite + (*ChildRes_RankOne)(nil), // 283: w_campaign_userpb.ChildRes.RankOne + (*ChildRes_Sign)(nil), // 284: w_campaign_userpb.ChildRes.Sign + (*ChildRes_Lucky)(nil), // 285: w_campaign_userpb.ChildRes.Lucky + (*ChildRes_Reward)(nil), // 286: w_campaign_userpb.ChildRes.Reward + (*ChildRes_Blind)(nil), // 287: w_campaign_userpb.ChildRes.Blind + (*ChildRes_Record)(nil), // 288: w_campaign_userpb.ChildRes.Record + (*ChildRes_KV)(nil), // 289: w_campaign_userpb.ChildRes.KV + (*ChildActiveRes_Record)(nil), // 290: w_campaign_userpb.ChildActiveRes.Record + (*ChildActiveRes_KV)(nil), // 291: w_campaign_userpb.ChildActiveRes.KV + (*GoldRecordRes_One)(nil), // 292: w_campaign_userpb.GoldRecordRes.One + (*CoinRecordRes_One)(nil), // 293: w_campaign_userpb.CoinRecordRes.One + (*ChildListRes_One)(nil), // 294: w_campaign_userpb.ChildListRes.One + (*ChildListRes_Num)(nil), // 295: w_campaign_userpb.ChildListRes.Num + (*ReceiveRewardRes_Reward)(nil), // 296: w_campaign_userpb.ReceiveRewardRes.Reward + (*ReceiveRewardRes_KV)(nil), // 297: w_campaign_userpb.ReceiveRewardRes.KV + (*LotteryLogRes_One)(nil), // 298: w_campaign_userpb.LotteryLogRes.One + (*UserListRes_One)(nil), // 299: w_campaign_userpb.UserListRes.One + (*DiceCollectRes_One)(nil), // 300: w_campaign_userpb.DiceCollectRes.One + (*ClientRewardRes_Reward)(nil), // 301: w_campaign_userpb.ClientRewardRes.Reward + (*ClientRewardRes_KV)(nil), // 302: w_campaign_userpb.ClientRewardRes.KV + (*ChatListRes_One)(nil), // 303: w_campaign_userpb.ChatListRes.One + (*ScheduleListRes_One)(nil), // 304: w_campaign_userpb.ScheduleListRes.One + (*ScheduleListRes_Score)(nil), // 305: w_campaign_userpb.ScheduleListRes.Score + (*ScheduleListRes_Vote)(nil), // 306: w_campaign_userpb.ScheduleListRes.Vote + (*ScheduleListRes_Team)(nil), // 307: w_campaign_userpb.ScheduleListRes.Team + (*ScheduleListRes_UserVote)(nil), // 308: w_campaign_userpb.ScheduleListRes.UserVote + (*ScheduleListRes_Reward)(nil), // 309: w_campaign_userpb.ScheduleListRes.Reward + (*ScheduleListRes_KV)(nil), // 310: w_campaign_userpb.ScheduleListRes.KV + (*MallListRes_One)(nil), // 311: w_campaign_userpb.MallListRes.One + (*ExchangeRes_KV)(nil), // 312: w_campaign_userpb.ExchangeRes.KV + (*VoteListRes_One)(nil), // 313: w_campaign_userpb.VoteListRes.One + (*VoteListRes_Team)(nil), // 314: w_campaign_userpb.VoteListRes.Team + (*UnoRandCardRes_Card)(nil), // 315: w_campaign_userpb.UnoRandCardRes.Card + (*UnoClaimRes_KV)(nil), // 316: w_campaign_userpb.UnoClaimRes.KV + (*UnoCardRes_One)(nil), // 317: w_campaign_userpb.UnoCardRes.One + (*EventFirstVisitRes_EventReward)(nil), // 318: w_campaign_userpb.EventFirstVisitRes.EventReward + (*EventFirstVisitRes_Reward)(nil), // 319: w_campaign_userpb.EventFirstVisitRes.Reward + (*EventFirstVisitRes_KV)(nil), // 320: w_campaign_userpb.EventFirstVisitRes.KV + (*TaskTipRes_EventReward)(nil), // 321: w_campaign_userpb.TaskTipRes.EventReward + (*TaskTipRes_Reward)(nil), // 322: w_campaign_userpb.TaskTipRes.Reward + (*TaskTipRes_KV)(nil), // 323: w_campaign_userpb.TaskTipRes.KV + (*CoinLogRes_One)(nil), // 324: w_campaign_userpb.CoinLogRes.One +} +var file_w_campaign_user_proto_depIdxs = []int32{ + 190, // 0: w_campaign_userpb.ListRes.list:type_name -> w_campaign_userpb.ListRes.One + 203, // 1: w_campaign_userpb.RewardRes.list:type_name -> w_campaign_userpb.RewardRes.One + 205, // 2: w_campaign_userpb.VisitReq.cert:type_name -> w_campaign_userpb.VisitReq.Cert + 217, // 3: w_campaign_userpb.PlayRes.chance_player:type_name -> w_campaign_userpb.PlayRes.ChancePlayer + 220, // 4: w_campaign_userpb.PlayRes.invite_player:type_name -> w_campaign_userpb.PlayRes.InvitePalyer + 218, // 5: w_campaign_userpb.PlayRes.quiz:type_name -> w_campaign_userpb.PlayRes.Quiz + 222, // 6: w_campaign_userpb.PlayRes.sign:type_name -> w_campaign_userpb.PlayRes.Sign + 223, // 7: w_campaign_userpb.PlayRes.dice:type_name -> w_campaign_userpb.PlayRes.Dice + 225, // 8: w_campaign_userpb.PlayRes.grow:type_name -> w_campaign_userpb.PlayRes.Grow + 226, // 9: w_campaign_userpb.PlayRes.chop:type_name -> w_campaign_userpb.PlayRes.Chop + 212, // 10: w_campaign_userpb.PlayRes.task:type_name -> w_campaign_userpb.PlayRes.Task + 227, // 11: w_campaign_userpb.PlayRes.cash:type_name -> w_campaign_userpb.PlayRes.Cash + 211, // 12: w_campaign_userpb.PlayRes.clue:type_name -> w_campaign_userpb.PlayRes.Clue + 230, // 13: w_campaign_userpb.PlayRes.keep_dog:type_name -> w_campaign_userpb.PlayRes.Keep + 228, // 14: w_campaign_userpb.PlayRes.gold:type_name -> w_campaign_userpb.PlayRes.Gold + 210, // 15: w_campaign_userpb.PlayRes.coin:type_name -> w_campaign_userpb.PlayRes.Coin + 209, // 16: w_campaign_userpb.PlayRes.vs:type_name -> w_campaign_userpb.PlayRes.Vs + 206, // 17: w_campaign_userpb.PlayRes.uno:type_name -> w_campaign_userpb.PlayRes.Uno + 232, // 18: w_campaign_userpb.RewardUserRes.list:type_name -> w_campaign_userpb.RewardUserRes.One + 234, // 19: w_campaign_userpb.InfoRes.rewards:type_name -> w_campaign_userpb.InfoRes.Reward + 235, // 20: w_campaign_userpb.RankRes.list:type_name -> w_campaign_userpb.RankRes.One + 237, // 21: w_campaign_userpb.LotteryRes.kv_data:type_name -> w_campaign_userpb.LotteryRes.KV + 238, // 22: w_campaign_userpb.AnswerReq.submits:type_name -> w_campaign_userpb.AnswerReq.Submit + 239, // 23: w_campaign_userpb.AnswerRes.kv_data:type_name -> w_campaign_userpb.AnswerRes.KV + 240, // 24: w_campaign_userpb.AnswerHistoryRes.list:type_name -> w_campaign_userpb.AnswerHistoryRes.One + 242, // 25: w_campaign_userpb.TargetRuleRes.list:type_name -> w_campaign_userpb.TargetRuleRes.One + 244, // 26: w_campaign_userpb.TaskRes.fix_day:type_name -> w_campaign_userpb.TaskRes.Day + 245, // 27: w_campaign_userpb.TaskRes.fixed:type_name -> w_campaign_userpb.TaskRes.Fixed + 246, // 28: w_campaign_userpb.TaskRes.custom:type_name -> w_campaign_userpb.TaskRes.Custom + 250, // 29: w_campaign_userpb.DynamicLinkReq.image_text:type_name -> w_campaign_userpb.DynamicLinkReq.ImageText + 251, // 30: w_campaign_userpb.DylinkShowRes.image_text:type_name -> w_campaign_userpb.DylinkShowRes.ImageText + 252, // 31: w_campaign_userpb.SignInRes.sign_date:type_name -> w_campaign_userpb.SignInRes.SignDate + 253, // 32: w_campaign_userpb.SignInRes.cycle_date:type_name -> w_campaign_userpb.SignInRes.CycleDate + 254, // 33: w_campaign_userpb.SignRes.kv_data:type_name -> w_campaign_userpb.SignRes.KV + 255, // 34: w_campaign_userpb.DiceMapRes.list:type_name -> w_campaign_userpb.DiceMapRes.One + 256, // 35: w_campaign_userpb.FeedRes.kv_data:type_name -> w_campaign_userpb.FeedRes.KV + 257, // 36: w_campaign_userpb.GrowRecordRes.list:type_name -> w_campaign_userpb.GrowRecordRes.One + 260, // 37: w_campaign_userpb.LinkContentRes.qa:type_name -> w_campaign_userpb.LinkContentRes.Qa + 262, // 38: w_campaign_userpb.LinkContentRes.ballot:type_name -> w_campaign_userpb.LinkContentRes.Ballot + 263, // 39: w_campaign_userpb.LinkContentRes.chop:type_name -> w_campaign_userpb.LinkContentRes.Chop + 265, // 40: w_campaign_userpb.ChopHelpRes.list:type_name -> w_campaign_userpb.ChopHelpRes.One + 266, // 41: w_campaign_userpb.ProjectListRes.list:type_name -> w_campaign_userpb.ProjectListRes.One + 267, // 42: w_campaign_userpb.LevelListRes.list:type_name -> w_campaign_userpb.LevelListRes.One + 268, // 43: w_campaign_userpb.MarkLevelRes.list:type_name -> w_campaign_userpb.MarkLevelRes.One + 269, // 44: w_campaign_userpb.CashRecordsRes.list:type_name -> w_campaign_userpb.CashRecordsRes.One + 270, // 45: w_campaign_userpb.MixRewardRes.kv_data:type_name -> w_campaign_userpb.MixRewardRes.KV + 271, // 46: w_campaign_userpb.DiceRecordRes.list:type_name -> w_campaign_userpb.DiceRecordRes.One + 274, // 47: w_campaign_userpb.RewardFormRes.items:type_name -> w_campaign_userpb.RewardFormRes.Item + 275, // 48: w_campaign_userpb.SubmitFormReq.items:type_name -> w_campaign_userpb.SubmitFormReq.Item + 276, // 49: w_campaign_userpb.GetAdsUrlRes.ad_g:type_name -> w_campaign_userpb.GetAdsUrlRes.AdG + 277, // 50: w_campaign_userpb.ChopRewardRes.rewards:type_name -> w_campaign_userpb.ChopRewardRes.Reward + 278, // 51: w_campaign_userpb.InvokeCondRes.reward:type_name -> w_campaign_userpb.InvokeCondRes.Reward + 279, // 52: w_campaign_userpb.KeepRewardRes.rewards:type_name -> w_campaign_userpb.KeepRewardRes.Reward + 280, // 53: w_campaign_userpb.KeepCollectRes.gets:type_name -> w_campaign_userpb.KeepCollectRes.Reward + 281, // 54: w_campaign_userpb.KeepLogRes.list:type_name -> w_campaign_userpb.KeepLogRes.One + 287, // 55: w_campaign_userpb.ChildRes.blind:type_name -> w_campaign_userpb.ChildRes.Blind + 285, // 56: w_campaign_userpb.ChildRes.lucky:type_name -> w_campaign_userpb.ChildRes.Lucky + 284, // 57: w_campaign_userpb.ChildRes.sign:type_name -> w_campaign_userpb.ChildRes.Sign + 282, // 58: w_campaign_userpb.ChildRes.invite:type_name -> w_campaign_userpb.ChildRes.Invite + 290, // 59: w_campaign_userpb.ChildActiveRes.record:type_name -> w_campaign_userpb.ChildActiveRes.Record + 292, // 60: w_campaign_userpb.GoldRecordRes.list:type_name -> w_campaign_userpb.GoldRecordRes.One + 293, // 61: w_campaign_userpb.CoinRecordRes.list:type_name -> w_campaign_userpb.CoinRecordRes.One + 294, // 62: w_campaign_userpb.ChildListRes.list:type_name -> w_campaign_userpb.ChildListRes.One + 296, // 63: w_campaign_userpb.ReceiveRewardRes.reward:type_name -> w_campaign_userpb.ReceiveRewardRes.Reward + 298, // 64: w_campaign_userpb.LotteryLogRes.list:type_name -> w_campaign_userpb.LotteryLogRes.One + 299, // 65: w_campaign_userpb.UserListRes.list:type_name -> w_campaign_userpb.UserListRes.One + 300, // 66: w_campaign_userpb.DiceCollectRes.list:type_name -> w_campaign_userpb.DiceCollectRes.One + 301, // 67: w_campaign_userpb.ClientRewardRes.rewards:type_name -> w_campaign_userpb.ClientRewardRes.Reward + 303, // 68: w_campaign_userpb.ChatListRes.list:type_name -> w_campaign_userpb.ChatListRes.One + 304, // 69: w_campaign_userpb.ScheduleListRes.list:type_name -> w_campaign_userpb.ScheduleListRes.One + 311, // 70: w_campaign_userpb.MallListRes.list:type_name -> w_campaign_userpb.MallListRes.One + 312, // 71: w_campaign_userpb.ExchangeRes.kv_data:type_name -> w_campaign_userpb.ExchangeRes.KV + 313, // 72: w_campaign_userpb.VoteListRes.list:type_name -> w_campaign_userpb.VoteListRes.One + 315, // 73: w_campaign_userpb.UnoRandCardRes.cards:type_name -> w_campaign_userpb.UnoRandCardRes.Card + 316, // 74: w_campaign_userpb.UnoClaimRes.kv_data:type_name -> w_campaign_userpb.UnoClaimRes.KV + 317, // 75: w_campaign_userpb.UnoCardRes.list:type_name -> w_campaign_userpb.UnoCardRes.One + 318, // 76: w_campaign_userpb.EventFirstVisitRes.rewards:type_name -> w_campaign_userpb.EventFirstVisitRes.EventReward + 321, // 77: w_campaign_userpb.TaskTipRes.rewards:type_name -> w_campaign_userpb.TaskTipRes.EventReward + 324, // 78: w_campaign_userpb.CoinLogRes.list:type_name -> w_campaign_userpb.CoinLogRes.One + 193, // 79: w_campaign_userpb.ListRes.One.dice:type_name -> w_campaign_userpb.ListRes.Dice + 195, // 80: w_campaign_userpb.ListRes.One.conds:type_name -> w_campaign_userpb.ListRes.Cond + 194, // 81: w_campaign_userpb.ListRes.One.chop:type_name -> w_campaign_userpb.ListRes.Chop + 196, // 82: w_campaign_userpb.ListRes.One.win:type_name -> w_campaign_userpb.ListRes.Win + 197, // 83: w_campaign_userpb.ListRes.One.keep_dog:type_name -> w_campaign_userpb.ListRes.Keep + 198, // 84: w_campaign_userpb.ListRes.One.cash:type_name -> w_campaign_userpb.ListRes.Cash + 199, // 85: w_campaign_userpb.ListRes.One.gold:type_name -> w_campaign_userpb.ListRes.Gold + 200, // 86: w_campaign_userpb.ListRes.One.coin:type_name -> w_campaign_userpb.ListRes.Coin + 202, // 87: w_campaign_userpb.ListRes.One.sign:type_name -> w_campaign_userpb.ListRes.Sign + 192, // 88: w_campaign_userpb.ListRes.One.vs:type_name -> w_campaign_userpb.ListRes.Vs + 191, // 89: w_campaign_userpb.ListRes.One.uno:type_name -> w_campaign_userpb.ListRes.Uno + 201, // 90: w_campaign_userpb.ListRes.Coin.scenes:type_name -> w_campaign_userpb.ListRes.CoinScene + 204, // 91: w_campaign_userpb.RewardRes.One.kv_data:type_name -> w_campaign_userpb.RewardRes.KV + 207, // 92: w_campaign_userpb.PlayRes.Uno.red:type_name -> w_campaign_userpb.PlayRes.UnoGroup + 207, // 93: w_campaign_userpb.PlayRes.Uno.blue:type_name -> w_campaign_userpb.PlayRes.UnoGroup + 207, // 94: w_campaign_userpb.PlayRes.Uno.green:type_name -> w_campaign_userpb.PlayRes.UnoGroup + 207, // 95: w_campaign_userpb.PlayRes.Uno.yellow:type_name -> w_campaign_userpb.PlayRes.UnoGroup + 208, // 96: w_campaign_userpb.PlayRes.UnoGroup.cards:type_name -> w_campaign_userpb.PlayRes.UnoCard + 229, // 97: w_campaign_userpb.PlayRes.Vs.win_rewards:type_name -> w_campaign_userpb.PlayRes.GetReward + 213, // 98: w_campaign_userpb.PlayRes.Task.fixed:type_name -> w_campaign_userpb.PlayRes.Fixed + 214, // 99: w_campaign_userpb.PlayRes.Task.custom:type_name -> w_campaign_userpb.PlayRes.Custom + 216, // 100: w_campaign_userpb.PlayRes.Custom.cond:type_name -> w_campaign_userpb.PlayRes.Cond + 215, // 101: w_campaign_userpb.PlayRes.Custom.both_all:type_name -> w_campaign_userpb.PlayRes.BothAll + 219, // 102: w_campaign_userpb.PlayRes.Quiz.kv_data:type_name -> w_campaign_userpb.PlayRes.KV + 221, // 103: w_campaign_userpb.PlayRes.InvitePalyer.notice_reward:type_name -> w_campaign_userpb.PlayRes.NoticeReward + 219, // 104: w_campaign_userpb.PlayRes.NoticeReward.kv_data:type_name -> w_campaign_userpb.PlayRes.KV + 224, // 105: w_campaign_userpb.PlayRes.Dice.collects:type_name -> w_campaign_userpb.PlayRes.Collect + 229, // 106: w_campaign_userpb.PlayRes.Cash.rewards:type_name -> w_campaign_userpb.PlayRes.GetReward + 229, // 107: w_campaign_userpb.PlayRes.Gold.rewards:type_name -> w_campaign_userpb.PlayRes.GetReward + 219, // 108: w_campaign_userpb.PlayRes.GetReward.kv_data:type_name -> w_campaign_userpb.PlayRes.KV + 231, // 109: w_campaign_userpb.PlayRes.Keep.Reward:type_name -> w_campaign_userpb.PlayRes.KeepReward + 233, // 110: w_campaign_userpb.RewardUserRes.One.rewards:type_name -> w_campaign_userpb.RewardUserRes.Reward + 236, // 111: w_campaign_userpb.RankRes.One.conds:type_name -> w_campaign_userpb.RankRes.Cond + 241, // 112: w_campaign_userpb.AnswerHistoryRes.One.options:type_name -> w_campaign_userpb.AnswerHistoryRes.Option + 243, // 113: w_campaign_userpb.TargetRuleRes.One.cond:type_name -> w_campaign_userpb.TargetRuleRes.Cond + 248, // 114: w_campaign_userpb.TaskRes.Custom.cond:type_name -> w_campaign_userpb.TaskRes.Cond + 247, // 115: w_campaign_userpb.TaskRes.Custom.both_all:type_name -> w_campaign_userpb.TaskRes.BothAll + 249, // 116: w_campaign_userpb.TaskRes.BothAll.reward:type_name -> w_campaign_userpb.TaskRes.Reward + 249, // 117: w_campaign_userpb.TaskRes.Cond.reward:type_name -> w_campaign_userpb.TaskRes.Reward + 258, // 118: w_campaign_userpb.GrowRecordRes.One.records:type_name -> w_campaign_userpb.GrowRecordRes.Record + 259, // 119: w_campaign_userpb.GrowRecordRes.Record.var_data:type_name -> w_campaign_userpb.GrowRecordRes.KV + 261, // 120: w_campaign_userpb.LinkContentRes.Qa.options:type_name -> w_campaign_userpb.LinkContentRes.Option + 264, // 121: w_campaign_userpb.LinkContentRes.Chop.rewards:type_name -> w_campaign_userpb.LinkContentRes.ChopReward + 272, // 122: w_campaign_userpb.DiceRecordRes.One.data:type_name -> w_campaign_userpb.DiceRecordRes.Data + 273, // 123: w_campaign_userpb.DiceRecordRes.Data.kv_data:type_name -> w_campaign_userpb.DiceRecordRes.KV + 283, // 124: w_campaign_userpb.ChildRes.Invite.rank_list:type_name -> w_campaign_userpb.ChildRes.RankOne + 288, // 125: w_campaign_userpb.ChildRes.Invite.record:type_name -> w_campaign_userpb.ChildRes.Record + 286, // 126: w_campaign_userpb.ChildRes.Sign.rewards:type_name -> w_campaign_userpb.ChildRes.Reward + 288, // 127: w_campaign_userpb.ChildRes.Sign.record:type_name -> w_campaign_userpb.ChildRes.Record + 286, // 128: w_campaign_userpb.ChildRes.Lucky.rewards:type_name -> w_campaign_userpb.ChildRes.Reward + 288, // 129: w_campaign_userpb.ChildRes.Lucky.record:type_name -> w_campaign_userpb.ChildRes.Record + 288, // 130: w_campaign_userpb.ChildRes.Blind.record:type_name -> w_campaign_userpb.ChildRes.Record + 289, // 131: w_campaign_userpb.ChildRes.Record.kv_data:type_name -> w_campaign_userpb.ChildRes.KV + 291, // 132: w_campaign_userpb.ChildActiveRes.Record.kv_data:type_name -> w_campaign_userpb.ChildActiveRes.KV + 295, // 133: w_campaign_userpb.ChildListRes.One.sign:type_name -> w_campaign_userpb.ChildListRes.Num + 295, // 134: w_campaign_userpb.ChildListRes.One.invite:type_name -> w_campaign_userpb.ChildListRes.Num + 295, // 135: w_campaign_userpb.ChildListRes.One.blind:type_name -> w_campaign_userpb.ChildListRes.Num + 295, // 136: w_campaign_userpb.ChildListRes.One.lottery:type_name -> w_campaign_userpb.ChildListRes.Num + 297, // 137: w_campaign_userpb.ReceiveRewardRes.Reward.kv_data:type_name -> w_campaign_userpb.ReceiveRewardRes.KV + 302, // 138: w_campaign_userpb.ClientRewardRes.Reward.kv_data:type_name -> w_campaign_userpb.ClientRewardRes.KV + 307, // 139: w_campaign_userpb.ScheduleListRes.One.teams:type_name -> w_campaign_userpb.ScheduleListRes.Team + 308, // 140: w_campaign_userpb.ScheduleListRes.One.user_vote:type_name -> w_campaign_userpb.ScheduleListRes.UserVote + 309, // 141: w_campaign_userpb.ScheduleListRes.One.reward:type_name -> w_campaign_userpb.ScheduleListRes.Reward + 306, // 142: w_campaign_userpb.ScheduleListRes.One.votes:type_name -> w_campaign_userpb.ScheduleListRes.Vote + 305, // 143: w_campaign_userpb.ScheduleListRes.One.scores:type_name -> w_campaign_userpb.ScheduleListRes.Score + 310, // 144: w_campaign_userpb.ScheduleListRes.Reward.kv_data:type_name -> w_campaign_userpb.ScheduleListRes.KV + 314, // 145: w_campaign_userpb.VoteListRes.One.teams:type_name -> w_campaign_userpb.VoteListRes.Team + 319, // 146: w_campaign_userpb.EventFirstVisitRes.EventReward.reward:type_name -> w_campaign_userpb.EventFirstVisitRes.Reward + 320, // 147: w_campaign_userpb.EventFirstVisitRes.Reward.kv_data:type_name -> w_campaign_userpb.EventFirstVisitRes.KV + 322, // 148: w_campaign_userpb.TaskTipRes.EventReward.reward:type_name -> w_campaign_userpb.TaskTipRes.Reward + 323, // 149: w_campaign_userpb.TaskTipRes.Reward.kv_data:type_name -> w_campaign_userpb.TaskTipRes.KV + 0, // 150: w_campaign_userpb.WCampaignUser.List:input_type -> w_campaign_userpb.ListReq + 2, // 151: w_campaign_userpb.WCampaignUser.Reward:input_type -> w_campaign_userpb.RewardReq + 4, // 152: w_campaign_userpb.WCampaignUser.Visit:input_type -> w_campaign_userpb.VisitReq + 6, // 153: w_campaign_userpb.WCampaignUser.Play:input_type -> w_campaign_userpb.PlayReq + 8, // 154: w_campaign_userpb.WCampaignUser.RewardUser:input_type -> w_campaign_userpb.RewardUserReq + 10, // 155: w_campaign_userpb.WCampaignUser.Info:input_type -> w_campaign_userpb.InfoReq + 12, // 156: w_campaign_userpb.WCampaignUser.Rank:input_type -> w_campaign_userpb.RankReq + 14, // 157: w_campaign_userpb.WCampaignUser.Lottery:input_type -> w_campaign_userpb.LotteryReq + 16, // 158: w_campaign_userpb.WCampaignUser.Answer:input_type -> w_campaign_userpb.AnswerReq + 18, // 159: w_campaign_userpb.WCampaignUser.AnswerHistory:input_type -> w_campaign_userpb.AnswerHistoryReq + 20, // 160: w_campaign_userpb.WCampaignUser.Vote:input_type -> w_campaign_userpb.VoteReq + 22, // 161: w_campaign_userpb.WCampaignUser.Notify:input_type -> w_campaign_userpb.NotifyReq + 24, // 162: w_campaign_userpb.WCampaignUser.AcceptReward:input_type -> w_campaign_userpb.AcceptRewardReq + 26, // 163: w_campaign_userpb.WCampaignUser.TargetRule:input_type -> w_campaign_userpb.TargetRuleReq + 28, // 164: w_campaign_userpb.WCampaignUser.Task:input_type -> w_campaign_userpb.TaskReq + 30, // 165: w_campaign_userpb.WCampaignUser.Resend:input_type -> w_campaign_userpb.ResendReq + 32, // 166: w_campaign_userpb.WCampaignUser.DynamicLink:input_type -> w_campaign_userpb.DynamicLinkReq + 34, // 167: w_campaign_userpb.WCampaignUser.DylinkShow:input_type -> w_campaign_userpb.DylinkShowReq + 36, // 168: w_campaign_userpb.WCampaignUser.SignIn:input_type -> w_campaign_userpb.SignInReq + 38, // 169: w_campaign_userpb.WCampaignUser.Sign:input_type -> w_campaign_userpb.SignReq + 40, // 170: w_campaign_userpb.WCampaignUser.DiceMap:input_type -> w_campaign_userpb.DiceMapReq + 42, // 171: w_campaign_userpb.WCampaignUser.Dice:input_type -> w_campaign_userpb.DiceReq + 44, // 172: w_campaign_userpb.WCampaignUser.Grow:input_type -> w_campaign_userpb.GrowReq + 46, // 173: w_campaign_userpb.WCampaignUser.GetGrow:input_type -> w_campaign_userpb.GetGrowReq + 48, // 174: w_campaign_userpb.WCampaignUser.Feed:input_type -> w_campaign_userpb.FeedReq + 50, // 175: w_campaign_userpb.WCampaignUser.GetFeed:input_type -> w_campaign_userpb.GetFeedReq + 52, // 176: w_campaign_userpb.WCampaignUser.GrowRecord:input_type -> w_campaign_userpb.GrowRecordReq + 54, // 177: w_campaign_userpb.WCampaignUser.ContentLink:input_type -> w_campaign_userpb.ContentLinkReq + 56, // 178: w_campaign_userpb.WCampaignUser.LinkContent:input_type -> w_campaign_userpb.LinkContentReq + 58, // 179: w_campaign_userpb.WCampaignUser.ChopSelect:input_type -> w_campaign_userpb.ChopSelectReq + 60, // 180: w_campaign_userpb.WCampaignUser.ChopReselect:input_type -> w_campaign_userpb.ChopReselectReq + 62, // 181: w_campaign_userpb.WCampaignUser.ChopHelp:input_type -> w_campaign_userpb.ChopHelpReq + 64, // 182: w_campaign_userpb.WCampaignUser.ProjectList:input_type -> w_campaign_userpb.ProjectListReq + 66, // 183: w_campaign_userpb.WCampaignUser.LevelList:input_type -> w_campaign_userpb.LevelListReq + 68, // 184: w_campaign_userpb.WCampaignUser.LevelStore:input_type -> w_campaign_userpb.LevelStoreReq + 70, // 185: w_campaign_userpb.WCampaignUser.LevelEdit:input_type -> w_campaign_userpb.LevelEditReq + 72, // 186: w_campaign_userpb.WCampaignUser.LevelDestroy:input_type -> w_campaign_userpb.LevelDestroyReq + 74, // 187: w_campaign_userpb.WCampaignUser.MarkLevel:input_type -> w_campaign_userpb.MarkLevelReq + 76, // 188: w_campaign_userpb.WCampaignUser.FinishStep:input_type -> w_campaign_userpb.FinishStepReq + 78, // 189: w_campaign_userpb.WCampaignUser.Spin:input_type -> w_campaign_userpb.SpinReq + 80, // 190: w_campaign_userpb.WCampaignUser.CashRecords:input_type -> w_campaign_userpb.CashRecordsReq + 82, // 191: w_campaign_userpb.WCampaignUser.MixReward:input_type -> w_campaign_userpb.MixRewardReq + 84, // 192: w_campaign_userpb.WCampaignUser.DiceRecord:input_type -> w_campaign_userpb.DiceRecordReq + 86, // 193: w_campaign_userpb.WCampaignUser.RewardForm:input_type -> w_campaign_userpb.RewardFormReq + 88, // 194: w_campaign_userpb.WCampaignUser.SubmitForm:input_type -> w_campaign_userpb.SubmitFormReq + 90, // 195: w_campaign_userpb.WCampaignUser.GetAdsUrl:input_type -> w_campaign_userpb.GetAdsUrlReq + 92, // 196: w_campaign_userpb.WCampaignUser.AdsStay:input_type -> w_campaign_userpb.AdsStayReq + 94, // 197: w_campaign_userpb.WCampaignUser.ClueNotified:input_type -> w_campaign_userpb.ClueNotifiedReq + 96, // 198: w_campaign_userpb.WCampaignUser.ChangeUserLevel:input_type -> w_campaign_userpb.ChangeUserLevelReq + 98, // 199: w_campaign_userpb.WCampaignUser.ChopReward:input_type -> w_campaign_userpb.ChopRewardReq + 100, // 200: w_campaign_userpb.WCampaignUser.HelpPercent:input_type -> w_campaign_userpb.HelpPercentReq + 102, // 201: w_campaign_userpb.WCampaignUser.InvokeCond:input_type -> w_campaign_userpb.InvokeCondReq + 104, // 202: w_campaign_userpb.WCampaignUser.KeepReward:input_type -> w_campaign_userpb.KeepRewardReq + 106, // 203: w_campaign_userpb.WCampaignUser.KeepSelect:input_type -> w_campaign_userpb.KeepSelectReq + 108, // 204: w_campaign_userpb.WCampaignUser.KeepCollect:input_type -> w_campaign_userpb.KeepCollectReq + 110, // 205: w_campaign_userpb.WCampaignUser.KeepFeed:input_type -> w_campaign_userpb.KeepFeedReq + 112, // 206: w_campaign_userpb.WCampaignUser.MachineSave:input_type -> w_campaign_userpb.MachineSaveReq + 114, // 207: w_campaign_userpb.WCampaignUser.MachineRecycle:input_type -> w_campaign_userpb.MachineRecycleReq + 116, // 208: w_campaign_userpb.WCampaignUser.GetPropFeed:input_type -> w_campaign_userpb.GetPropFeedReq + 118, // 209: w_campaign_userpb.WCampaignUser.KeepLog:input_type -> w_campaign_userpb.KeepLogReq + 120, // 210: w_campaign_userpb.WCampaignUser.KeepReselect:input_type -> w_campaign_userpb.KeepReselectReq + 122, // 211: w_campaign_userpb.WCampaignUser.KeepGuide:input_type -> w_campaign_userpb.KeepGuideReq + 124, // 212: w_campaign_userpb.WCampaignUser.KeepFirstInvite:input_type -> w_campaign_userpb.KeepFirstInviteReq + 126, // 213: w_campaign_userpb.WCampaignUser.Child:input_type -> w_campaign_userpb.ChildReq + 128, // 214: w_campaign_userpb.WCampaignUser.ChildActive:input_type -> w_campaign_userpb.ChildActiveReq + 130, // 215: w_campaign_userpb.WCampaignUser.GoldFinishStep:input_type -> w_campaign_userpb.GoldFinishStepReq + 132, // 216: w_campaign_userpb.WCampaignUser.GoldNotify:input_type -> w_campaign_userpb.GoldNotifyReq + 134, // 217: w_campaign_userpb.WCampaignUser.GoldRecord:input_type -> w_campaign_userpb.GoldRecordReq + 136, // 218: w_campaign_userpb.WCampaignUser.Deduct:input_type -> w_campaign_userpb.DeductReq + 138, // 219: w_campaign_userpb.WCampaignUser.Gain:input_type -> w_campaign_userpb.GainReq + 140, // 220: w_campaign_userpb.WCampaignUser.CoinRecord:input_type -> w_campaign_userpb.CoinRecordReq + 142, // 221: w_campaign_userpb.WCampaignUser.ChildList:input_type -> w_campaign_userpb.ChildListReq + 144, // 222: w_campaign_userpb.WCampaignUser.ReceiveReward:input_type -> w_campaign_userpb.ReceiveRewardReq + 146, // 223: w_campaign_userpb.WCampaignUser.LotteryLog:input_type -> w_campaign_userpb.LotteryLogReq + 148, // 224: w_campaign_userpb.WCampaignUser.UserList:input_type -> w_campaign_userpb.UserListReq + 150, // 225: w_campaign_userpb.WCampaignUser.CashAgain:input_type -> w_campaign_userpb.CashAgainReq + 152, // 226: w_campaign_userpb.WCampaignUser.DiceCollect:input_type -> w_campaign_userpb.DiceCollectReq + 154, // 227: w_campaign_userpb.WCampaignUser.ClientReward:input_type -> w_campaign_userpb.ClientRewardReq + 156, // 228: w_campaign_userpb.WCampaignUser.PointsUse:input_type -> w_campaign_userpb.PointsUseReq + 158, // 229: w_campaign_userpb.WCampaignUser.Chat:input_type -> w_campaign_userpb.ChatReq + 160, // 230: w_campaign_userpb.WCampaignUser.ChatList:input_type -> w_campaign_userpb.ChatListReq + 162, // 231: w_campaign_userpb.WCampaignUser.ScheduleList:input_type -> w_campaign_userpb.ScheduleListReq + 164, // 232: w_campaign_userpb.WCampaignUser.MallList:input_type -> w_campaign_userpb.MallListReq + 166, // 233: w_campaign_userpb.WCampaignUser.Exchange:input_type -> w_campaign_userpb.ExchangeReq + 168, // 234: w_campaign_userpb.WCampaignUser.VoteList:input_type -> w_campaign_userpb.VoteListReq + 170, // 235: w_campaign_userpb.WCampaignUser.VsTipReward:input_type -> w_campaign_userpb.VsTipRewardReq + 172, // 236: w_campaign_userpb.WCampaignUser.UnoRandCard:input_type -> w_campaign_userpb.UnoRandCardReq + 174, // 237: w_campaign_userpb.WCampaignUser.UnoClaim:input_type -> w_campaign_userpb.UnoClaimReq + 176, // 238: w_campaign_userpb.WCampaignUser.UnoCard:input_type -> w_campaign_userpb.UnoCardReq + 178, // 239: w_campaign_userpb.WCampaignUser.Show:input_type -> w_campaign_userpb.ShowReq + 180, // 240: w_campaign_userpb.WCampaignUser.EventFirstVisit:input_type -> w_campaign_userpb.EventFirstVisitReq + 182, // 241: w_campaign_userpb.WCampaignUser.FindByUniq:input_type -> w_campaign_userpb.FindByUniqReq + 184, // 242: w_campaign_userpb.WCampaignUser.TaskTip:input_type -> w_campaign_userpb.TaskTipReq + 186, // 243: w_campaign_userpb.WCampaignUser.TaskTipOk:input_type -> w_campaign_userpb.TaskTipOkReq + 188, // 244: w_campaign_userpb.WCampaignUser.CoinLog:input_type -> w_campaign_userpb.CoinLogReq + 1, // 245: w_campaign_userpb.WCampaignUser.List:output_type -> w_campaign_userpb.ListRes + 3, // 246: w_campaign_userpb.WCampaignUser.Reward:output_type -> w_campaign_userpb.RewardRes + 5, // 247: w_campaign_userpb.WCampaignUser.Visit:output_type -> w_campaign_userpb.VisitRes + 7, // 248: w_campaign_userpb.WCampaignUser.Play:output_type -> w_campaign_userpb.PlayRes + 9, // 249: w_campaign_userpb.WCampaignUser.RewardUser:output_type -> w_campaign_userpb.RewardUserRes + 11, // 250: w_campaign_userpb.WCampaignUser.Info:output_type -> w_campaign_userpb.InfoRes + 13, // 251: w_campaign_userpb.WCampaignUser.Rank:output_type -> w_campaign_userpb.RankRes + 15, // 252: w_campaign_userpb.WCampaignUser.Lottery:output_type -> w_campaign_userpb.LotteryRes + 17, // 253: w_campaign_userpb.WCampaignUser.Answer:output_type -> w_campaign_userpb.AnswerRes + 19, // 254: w_campaign_userpb.WCampaignUser.AnswerHistory:output_type -> w_campaign_userpb.AnswerHistoryRes + 21, // 255: w_campaign_userpb.WCampaignUser.Vote:output_type -> w_campaign_userpb.VoteRes + 23, // 256: w_campaign_userpb.WCampaignUser.Notify:output_type -> w_campaign_userpb.NotifyRes + 25, // 257: w_campaign_userpb.WCampaignUser.AcceptReward:output_type -> w_campaign_userpb.AcceptRewardRes + 27, // 258: w_campaign_userpb.WCampaignUser.TargetRule:output_type -> w_campaign_userpb.TargetRuleRes + 29, // 259: w_campaign_userpb.WCampaignUser.Task:output_type -> w_campaign_userpb.TaskRes + 31, // 260: w_campaign_userpb.WCampaignUser.Resend:output_type -> w_campaign_userpb.ResendRes + 33, // 261: w_campaign_userpb.WCampaignUser.DynamicLink:output_type -> w_campaign_userpb.DynamicLinkRes + 35, // 262: w_campaign_userpb.WCampaignUser.DylinkShow:output_type -> w_campaign_userpb.DylinkShowRes + 37, // 263: w_campaign_userpb.WCampaignUser.SignIn:output_type -> w_campaign_userpb.SignInRes + 39, // 264: w_campaign_userpb.WCampaignUser.Sign:output_type -> w_campaign_userpb.SignRes + 41, // 265: w_campaign_userpb.WCampaignUser.DiceMap:output_type -> w_campaign_userpb.DiceMapRes + 43, // 266: w_campaign_userpb.WCampaignUser.Dice:output_type -> w_campaign_userpb.DiceRes + 45, // 267: w_campaign_userpb.WCampaignUser.Grow:output_type -> w_campaign_userpb.GrowRes + 47, // 268: w_campaign_userpb.WCampaignUser.GetGrow:output_type -> w_campaign_userpb.GetGrowRes + 49, // 269: w_campaign_userpb.WCampaignUser.Feed:output_type -> w_campaign_userpb.FeedRes + 51, // 270: w_campaign_userpb.WCampaignUser.GetFeed:output_type -> w_campaign_userpb.GetFeedRes + 53, // 271: w_campaign_userpb.WCampaignUser.GrowRecord:output_type -> w_campaign_userpb.GrowRecordRes + 55, // 272: w_campaign_userpb.WCampaignUser.ContentLink:output_type -> w_campaign_userpb.ContentLinkRes + 57, // 273: w_campaign_userpb.WCampaignUser.LinkContent:output_type -> w_campaign_userpb.LinkContentRes + 59, // 274: w_campaign_userpb.WCampaignUser.ChopSelect:output_type -> w_campaign_userpb.ChopSelectRes + 61, // 275: w_campaign_userpb.WCampaignUser.ChopReselect:output_type -> w_campaign_userpb.ChopReselectRes + 63, // 276: w_campaign_userpb.WCampaignUser.ChopHelp:output_type -> w_campaign_userpb.ChopHelpRes + 65, // 277: w_campaign_userpb.WCampaignUser.ProjectList:output_type -> w_campaign_userpb.ProjectListRes + 67, // 278: w_campaign_userpb.WCampaignUser.LevelList:output_type -> w_campaign_userpb.LevelListRes + 69, // 279: w_campaign_userpb.WCampaignUser.LevelStore:output_type -> w_campaign_userpb.LevelStoreRes + 71, // 280: w_campaign_userpb.WCampaignUser.LevelEdit:output_type -> w_campaign_userpb.LevelEditRes + 73, // 281: w_campaign_userpb.WCampaignUser.LevelDestroy:output_type -> w_campaign_userpb.LevelDestroyRes + 75, // 282: w_campaign_userpb.WCampaignUser.MarkLevel:output_type -> w_campaign_userpb.MarkLevelRes + 77, // 283: w_campaign_userpb.WCampaignUser.FinishStep:output_type -> w_campaign_userpb.FinishStepRes + 79, // 284: w_campaign_userpb.WCampaignUser.Spin:output_type -> w_campaign_userpb.SpinRes + 81, // 285: w_campaign_userpb.WCampaignUser.CashRecords:output_type -> w_campaign_userpb.CashRecordsRes + 83, // 286: w_campaign_userpb.WCampaignUser.MixReward:output_type -> w_campaign_userpb.MixRewardRes + 85, // 287: w_campaign_userpb.WCampaignUser.DiceRecord:output_type -> w_campaign_userpb.DiceRecordRes + 87, // 288: w_campaign_userpb.WCampaignUser.RewardForm:output_type -> w_campaign_userpb.RewardFormRes + 89, // 289: w_campaign_userpb.WCampaignUser.SubmitForm:output_type -> w_campaign_userpb.SubmitFormRes + 91, // 290: w_campaign_userpb.WCampaignUser.GetAdsUrl:output_type -> w_campaign_userpb.GetAdsUrlRes + 93, // 291: w_campaign_userpb.WCampaignUser.AdsStay:output_type -> w_campaign_userpb.AdsStayRes + 95, // 292: w_campaign_userpb.WCampaignUser.ClueNotified:output_type -> w_campaign_userpb.ClueNotifiedRes + 97, // 293: w_campaign_userpb.WCampaignUser.ChangeUserLevel:output_type -> w_campaign_userpb.ChangeUserLevelRes + 99, // 294: w_campaign_userpb.WCampaignUser.ChopReward:output_type -> w_campaign_userpb.ChopRewardRes + 101, // 295: w_campaign_userpb.WCampaignUser.HelpPercent:output_type -> w_campaign_userpb.HelpPercentRes + 103, // 296: w_campaign_userpb.WCampaignUser.InvokeCond:output_type -> w_campaign_userpb.InvokeCondRes + 105, // 297: w_campaign_userpb.WCampaignUser.KeepReward:output_type -> w_campaign_userpb.KeepRewardRes + 107, // 298: w_campaign_userpb.WCampaignUser.KeepSelect:output_type -> w_campaign_userpb.KeepSelectRes + 109, // 299: w_campaign_userpb.WCampaignUser.KeepCollect:output_type -> w_campaign_userpb.KeepCollectRes + 111, // 300: w_campaign_userpb.WCampaignUser.KeepFeed:output_type -> w_campaign_userpb.KeepFeedRes + 113, // 301: w_campaign_userpb.WCampaignUser.MachineSave:output_type -> w_campaign_userpb.MachineSaveRes + 115, // 302: w_campaign_userpb.WCampaignUser.MachineRecycle:output_type -> w_campaign_userpb.MachineRecycleRes + 117, // 303: w_campaign_userpb.WCampaignUser.GetPropFeed:output_type -> w_campaign_userpb.GetPropFeedRes + 119, // 304: w_campaign_userpb.WCampaignUser.KeepLog:output_type -> w_campaign_userpb.KeepLogRes + 121, // 305: w_campaign_userpb.WCampaignUser.KeepReselect:output_type -> w_campaign_userpb.KeepReselectRes + 123, // 306: w_campaign_userpb.WCampaignUser.KeepGuide:output_type -> w_campaign_userpb.KeepGuideRes + 125, // 307: w_campaign_userpb.WCampaignUser.KeepFirstInvite:output_type -> w_campaign_userpb.KeepFirstInviteRes + 127, // 308: w_campaign_userpb.WCampaignUser.Child:output_type -> w_campaign_userpb.ChildRes + 129, // 309: w_campaign_userpb.WCampaignUser.ChildActive:output_type -> w_campaign_userpb.ChildActiveRes + 131, // 310: w_campaign_userpb.WCampaignUser.GoldFinishStep:output_type -> w_campaign_userpb.GoldFinishStepRes + 133, // 311: w_campaign_userpb.WCampaignUser.GoldNotify:output_type -> w_campaign_userpb.GoldNotifyRes + 135, // 312: w_campaign_userpb.WCampaignUser.GoldRecord:output_type -> w_campaign_userpb.GoldRecordRes + 137, // 313: w_campaign_userpb.WCampaignUser.Deduct:output_type -> w_campaign_userpb.DeductRes + 139, // 314: w_campaign_userpb.WCampaignUser.Gain:output_type -> w_campaign_userpb.GainRes + 141, // 315: w_campaign_userpb.WCampaignUser.CoinRecord:output_type -> w_campaign_userpb.CoinRecordRes + 143, // 316: w_campaign_userpb.WCampaignUser.ChildList:output_type -> w_campaign_userpb.ChildListRes + 145, // 317: w_campaign_userpb.WCampaignUser.ReceiveReward:output_type -> w_campaign_userpb.ReceiveRewardRes + 147, // 318: w_campaign_userpb.WCampaignUser.LotteryLog:output_type -> w_campaign_userpb.LotteryLogRes + 149, // 319: w_campaign_userpb.WCampaignUser.UserList:output_type -> w_campaign_userpb.UserListRes + 151, // 320: w_campaign_userpb.WCampaignUser.CashAgain:output_type -> w_campaign_userpb.CashAgainRes + 153, // 321: w_campaign_userpb.WCampaignUser.DiceCollect:output_type -> w_campaign_userpb.DiceCollectRes + 155, // 322: w_campaign_userpb.WCampaignUser.ClientReward:output_type -> w_campaign_userpb.ClientRewardRes + 157, // 323: w_campaign_userpb.WCampaignUser.PointsUse:output_type -> w_campaign_userpb.PointsUseRes + 159, // 324: w_campaign_userpb.WCampaignUser.Chat:output_type -> w_campaign_userpb.ChatRes + 161, // 325: w_campaign_userpb.WCampaignUser.ChatList:output_type -> w_campaign_userpb.ChatListRes + 163, // 326: w_campaign_userpb.WCampaignUser.ScheduleList:output_type -> w_campaign_userpb.ScheduleListRes + 165, // 327: w_campaign_userpb.WCampaignUser.MallList:output_type -> w_campaign_userpb.MallListRes + 167, // 328: w_campaign_userpb.WCampaignUser.Exchange:output_type -> w_campaign_userpb.ExchangeRes + 169, // 329: w_campaign_userpb.WCampaignUser.VoteList:output_type -> w_campaign_userpb.VoteListRes + 171, // 330: w_campaign_userpb.WCampaignUser.VsTipReward:output_type -> w_campaign_userpb.VsTipRewardRes + 173, // 331: w_campaign_userpb.WCampaignUser.UnoRandCard:output_type -> w_campaign_userpb.UnoRandCardRes + 175, // 332: w_campaign_userpb.WCampaignUser.UnoClaim:output_type -> w_campaign_userpb.UnoClaimRes + 177, // 333: w_campaign_userpb.WCampaignUser.UnoCard:output_type -> w_campaign_userpb.UnoCardRes + 179, // 334: w_campaign_userpb.WCampaignUser.Show:output_type -> w_campaign_userpb.ShowRes + 181, // 335: w_campaign_userpb.WCampaignUser.EventFirstVisit:output_type -> w_campaign_userpb.EventFirstVisitRes + 183, // 336: w_campaign_userpb.WCampaignUser.FindByUniq:output_type -> w_campaign_userpb.FindByUniqRes + 185, // 337: w_campaign_userpb.WCampaignUser.TaskTip:output_type -> w_campaign_userpb.TaskTipRes + 187, // 338: w_campaign_userpb.WCampaignUser.TaskTipOk:output_type -> w_campaign_userpb.TaskTipOkRes + 189, // 339: w_campaign_userpb.WCampaignUser.CoinLog:output_type -> w_campaign_userpb.CoinLogRes + 245, // [245:340] is the sub-list for method output_type + 150, // [150:245] is the sub-list for method input_type + 150, // [150:150] is the sub-list for extension type_name + 150, // [150:150] is the sub-list for extension extendee + 0, // [0:150] is the sub-list for field type_name +} + +func init() { file_w_campaign_user_proto_init() } +func file_w_campaign_user_proto_init() { + if File_w_campaign_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_campaign_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisitReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisitRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardUserRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LotteryReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LotteryRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerHistoryReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerHistoryRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcceptRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcceptRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetRuleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetRuleRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResendReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResendRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DynamicLinkReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DynamicLinkRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DylinkShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DylinkShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceMapReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceMapRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGrowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGrowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeedReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeedRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFeedReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFeedRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowRecordReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowRecordRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContentLinkReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContentLinkRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopSelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopSelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopReselectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopReselectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopHelpReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopHelpRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelEditReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelEditRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelDestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelDestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkLevelReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkLevelRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FinishStepReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FinishStepRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SpinReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SpinRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CashRecordsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CashRecordsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MixRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MixRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceRecordReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceRecordRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardFormReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardFormRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitFormReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitFormRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAdsUrlReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAdsUrlRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStayReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsStayRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClueNotifiedReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClueNotifiedRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeUserLevelReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeUserLevelRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelpPercentReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelpPercentRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvokeCondReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvokeCondRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepSelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepSelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepCollectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepCollectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepFeedReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepFeedRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineSaveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineSaveRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineRecycleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MachineRecycleRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPropFeedReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPropFeedRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[120].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepReselectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepReselectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[122].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepGuideReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepGuideRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[124].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepFirstInviteReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[125].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepFirstInviteRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[126].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[127].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[128].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildActiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[129].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildActiveRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[130].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldFinishStepReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[131].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldFinishStepRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[132].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldNotifyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[133].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldNotifyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[134].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldRecordReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[135].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldRecordRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[136].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeductReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[137].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeductRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GainReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GainRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[140].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoinRecordReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[141].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoinRecordRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[142].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[143].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[144].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReceiveRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[145].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReceiveRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[146].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LotteryLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[147].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LotteryLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[148].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[149].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[150].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CashAgainReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[151].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CashAgainRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[152].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceCollectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[153].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceCollectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[154].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[155].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[156].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointsUseReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[157].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointsUseRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[158].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[159].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[160].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[161].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[162].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[163].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[164].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MallListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[165].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MallListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[166].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[167].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[168].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[169].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[170].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsTipRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[171].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VsTipRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[172].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoRandCardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[173].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoRandCardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[174].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoClaimReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[175].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoClaimRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[176].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoCardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[177].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoCardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[178].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[179].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[180].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFirstVisitReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[181].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFirstVisitRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[182].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindByUniqReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[183].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindByUniqRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[184].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[185].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[186].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipOkReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[187].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipOkRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[188].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoinLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[189].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoinLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[190].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[191].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[192].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Vs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[193].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Dice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[194].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Chop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[195].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[196].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Win); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[197].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Keep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[198].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[199].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[200].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[201].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_CoinScene); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[202].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[203].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[204].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[205].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisitReq_Cert); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[206].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Uno); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[207].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_UnoGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[208].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_UnoCard); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[209].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Vs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[210].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Coin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[211].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Clue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[212].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Task); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[213].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Fixed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[214].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Custom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[215].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_BothAll); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[216].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[217].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_ChancePlayer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[218].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Quiz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[219].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[220].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_InvitePalyer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[221].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_NoticeReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[222].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[223].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Dice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[224].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Collect); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[225].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Grow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[226].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Chop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[227].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Cash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[228].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Gold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[229].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_GetReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[230].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_Keep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[231].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayRes_KeepReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[232].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardUserRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[233].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardUserRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[234].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[235].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[236].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[237].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LotteryRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[238].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerReq_Submit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[239].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[240].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerHistoryRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[241].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnswerHistoryRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[242].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetRuleRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[243].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TargetRuleRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[244].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes_Day); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[245].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes_Fixed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[246].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes_Custom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[247].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes_BothAll); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[248].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[249].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[250].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DynamicLinkReq_ImageText); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[251].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DylinkShowRes_ImageText); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[252].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInRes_SignDate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[253].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignInRes_CycleDate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[254].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[255].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceMapRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[256].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeedRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[257].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowRecordRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[258].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowRecordRes_Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[259].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrowRecordRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[260].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentRes_Qa); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[261].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[262].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentRes_Ballot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[263].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentRes_Chop); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[264].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkContentRes_ChopReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[265].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopHelpRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[266].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[267].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LevelListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[268].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkLevelRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[269].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CashRecordsRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[270].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MixRewardRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[271].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceRecordRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[272].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceRecordRes_Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[273].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceRecordRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[274].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardFormRes_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[275].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitFormReq_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[276].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAdsUrlRes_AdG); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[277].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChopRewardRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[278].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvokeCondRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[279].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepRewardRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[280].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepCollectRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[281].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeepLogRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[282].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_Invite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[283].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_RankOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[284].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_Sign); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[285].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_Lucky); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[286].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[287].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_Blind); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[288].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[289].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[290].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildActiveRes_Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[291].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildActiveRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[292].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoldRecordRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[293].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoinRecordRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[294].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[295].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChildListRes_Num); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[296].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReceiveRewardRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[297].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReceiveRewardRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[298].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LotteryLogRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[299].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[300].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DiceCollectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[301].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientRewardRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[302].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientRewardRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[303].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[304].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[305].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_Score); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[306].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_Vote); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[307].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[308].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_UserVote); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[309].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[310].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleListRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[311].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MallListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[312].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[313].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[314].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteListRes_Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[315].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoRandCardRes_Card); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[316].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoClaimRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[317].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnoCardRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[318].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFirstVisitRes_EventReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[319].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFirstVisitRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[320].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFirstVisitRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[321].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipRes_EventReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[322].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[323].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskTipRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_campaign_user_proto_msgTypes[324].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CoinLogRes_One); 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_w_campaign_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 325, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_campaign_user_proto_goTypes, + DependencyIndexes: file_w_campaign_user_proto_depIdxs, + MessageInfos: file_w_campaign_user_proto_msgTypes, + }.Build() + File_w_campaign_user_proto = out.File + file_w_campaign_user_proto_rawDesc = nil + file_w_campaign_user_proto_goTypes = nil + file_w_campaign_user_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_campaign_user/w_campaign_user.pb.micro.go b/proto/go_proto/w_campaign_user/w_campaign_user.pb.micro.go new file mode 100644 index 0000000..0159cdd --- /dev/null +++ b/proto/go_proto/w_campaign_user/w_campaign_user.pb.micro.go @@ -0,0 +1,1875 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_campaign_user.proto + +package w_campaign_userpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WCampaignUser service + +func NewWCampaignUserEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WCampaignUser service + +type WCampaignUserService interface { + // List 用户列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // Reward 用户奖励 + Reward(ctx context.Context, in *RewardReq, opts ...client.CallOption) (*RewardRes, error) + // Visit 访问活动 + Visit(ctx context.Context, in *VisitReq, opts ...client.CallOption) (*VisitRes, error) + // Play 用户活动数据 + Play(ctx context.Context, in *PlayReq, opts ...client.CallOption) (*PlayRes, error) + // RewardUser 中奖用户列表 + RewardUser(ctx context.Context, in *RewardUserReq, opts ...client.CallOption) (*RewardUserRes, error) + // Info 用户信息 + Info(ctx context.Context, in *InfoReq, opts ...client.CallOption) (*InfoRes, error) + // Rank 排行榜 + Rank(ctx context.Context, in *RankReq, opts ...client.CallOption) (*RankRes, error) + // Lottery 活动抽奖 + Lottery(ctx context.Context, in *LotteryReq, opts ...client.CallOption) (*LotteryRes, error) + // Answer 活动答题 + Answer(ctx context.Context, in *AnswerReq, opts ...client.CallOption) (*AnswerRes, error) + // AnswerHistory 答题历史 + AnswerHistory(ctx context.Context, in *AnswerHistoryReq, opts ...client.CallOption) (*AnswerHistoryRes, error) + // Vote 活动投票 + Vote(ctx context.Context, in *VoteReq, opts ...client.CallOption) (*VoteRes, error) + // Notify 客户端回调 + Notify(ctx context.Context, in *NotifyReq, opts ...client.CallOption) (*NotifyRes, error) + // AcceptReward 领取奖品 + AcceptReward(ctx context.Context, in *AcceptRewardReq, opts ...client.CallOption) (*AcceptRewardRes, error) + // TargetRule 达标规则 + TargetRule(ctx context.Context, in *TargetRuleReq, opts ...client.CallOption) (*TargetRuleRes, error) + // Task 我的任务 + Task(ctx context.Context, in *TaskReq, opts ...client.CallOption) (*TaskRes, error) + // Resend 补发奖品 + Resend(ctx context.Context, in *ResendReq, opts ...client.CallOption) (*ResendRes, error) + // DynamicLink 获取用户动态链接 + DynamicLink(ctx context.Context, in *DynamicLinkReq, opts ...client.CallOption) (*DynamicLinkRes, error) + // DylinkShow 获取用户动态链接详情 + DylinkShow(ctx context.Context, in *DylinkShowReq, opts ...client.CallOption) (*DylinkShowRes, error) + // SignIn 我的签到板 + SignIn(ctx context.Context, in *SignInReq, opts ...client.CallOption) (*SignInRes, error) + // Sign 签到 + Sign(ctx context.Context, in *SignReq, opts ...client.CallOption) (*SignRes, error) + // DiceMap 大富翁地图 + DiceMap(ctx context.Context, in *DiceMapReq, opts ...client.CallOption) (*DiceMapRes, error) + // Dice 大富翁骰子 + Dice(ctx context.Context, in *DiceReq, opts ...client.CallOption) (*DiceRes, error) + // Grow 成长生命体 + Grow(ctx context.Context, in *GrowReq, opts ...client.CallOption) (*GrowRes, error) + // GetGrow 成长生命体 + GetGrow(ctx context.Context, in *GetGrowReq, opts ...client.CallOption) (*GetGrowRes, error) + // Feed 饲养生命体 + Feed(ctx context.Context, in *FeedReq, opts ...client.CallOption) (*FeedRes, error) + // GetFeed 领取饲养道具 + GetFeed(ctx context.Context, in *GetFeedReq, opts ...client.CallOption) (*GetFeedRes, error) + // GrowRecord 成长记录 + GrowRecord(ctx context.Context, in *GrowRecordReq, opts ...client.CallOption) (*GrowRecordRes, error) + // ContentLink 内容链接 + ContentLink(ctx context.Context, in *ContentLinkReq, opts ...client.CallOption) (*ContentLinkRes, error) + // LinkContent 链接内容 + LinkContent(ctx context.Context, in *LinkContentReq, opts ...client.CallOption) (*LinkContentRes, error) + // ChopSelect 选择砍一刀奖品 + ChopSelect(ctx context.Context, in *ChopSelectReq, opts ...client.CallOption) (*ChopSelectRes, error) + // ChopReselect 重选砍一刀奖品 + ChopReselect(ctx context.Context, in *ChopReselectReq, opts ...client.CallOption) (*ChopReselectRes, error) + // ChopHelp 砍一刀助力记录 + ChopHelp(ctx context.Context, in *ChopHelpReq, opts ...client.CallOption) (*ChopHelpRes, error) + // ProjectList 项目参与用户列表 + ProjectList(ctx context.Context, in *ProjectListReq, opts ...client.CallOption) (*ProjectListRes, error) + // LevelList 用户等级列表 + LevelList(ctx context.Context, in *LevelListReq, opts ...client.CallOption) (*LevelListRes, error) + // LevelStore 创建用户等级 + LevelStore(ctx context.Context, in *LevelStoreReq, opts ...client.CallOption) (*LevelStoreRes, error) + // LevelEdit 更新用户等级 + LevelEdit(ctx context.Context, in *LevelEditReq, opts ...client.CallOption) (*LevelEditRes, error) + // LevelDestroy 删除用户等级 + LevelDestroy(ctx context.Context, in *LevelDestroyReq, opts ...client.CallOption) (*LevelDestroyRes, error) + // MarkLevel 用户等级标识列表 + MarkLevel(ctx context.Context, in *MarkLevelReq, opts ...client.CallOption) (*MarkLevelRes, error) + // FinishStep 完成现金抽奖阶段 + FinishStep(ctx context.Context, in *FinishStepReq, opts ...client.CallOption) (*FinishStepRes, error) + // Spin 现金转盘抽奖 + Spin(ctx context.Context, in *SpinReq, opts ...client.CallOption) (*SpinRes, error) + // CashRecords 现金转盘记录 + CashRecords(ctx context.Context, in *CashRecordsReq, opts ...client.CallOption) (*CashRecordsRes, error) + // MixReward 合成奖品 + MixReward(ctx context.Context, in *MixRewardReq, opts ...client.CallOption) (*MixRewardRes, error) + // DiceRecord 骰子记录 + DiceRecord(ctx context.Context, in *DiceRecordReq, opts ...client.CallOption) (*DiceRecordRes, error) + // RewardForm 奖品需要填写的表单 + RewardForm(ctx context.Context, in *RewardFormReq, opts ...client.CallOption) (*RewardFormRes, error) + // SubmitForm 提交表单 + SubmitForm(ctx context.Context, in *SubmitFormReq, opts ...client.CallOption) (*SubmitFormRes, error) + // GetAdsUrl 广告停留回传 + GetAdsUrl(ctx context.Context, in *GetAdsUrlReq, opts ...client.CallOption) (*GetAdsUrlRes, error) + // AdsStay 广告停留回传 + AdsStay(ctx context.Context, in *AdsStayReq, opts ...client.CallOption) (*AdsStayRes, error) + // ClueNotified 通知信息已经被接收 + ClueNotified(ctx context.Context, in *ClueNotifiedReq, opts ...client.CallOption) (*ClueNotifiedRes, error) + // ChangeUserLevel 修改用户等级 + ChangeUserLevel(ctx context.Context, in *ChangeUserLevelReq, opts ...client.CallOption) (*ChangeUserLevelRes, error) + // ChopReward 砍一刀可选奖品 + ChopReward(ctx context.Context, in *ChopRewardReq, opts ...client.CallOption) (*ChopRewardRes, error) + // HelpPercent 助力进度 + HelpPercent(ctx context.Context, in *HelpPercentReq, opts ...client.CallOption) (*HelpPercentRes, error) + // InvokeCond 触发前置条件 + InvokeCond(ctx context.Context, in *InvokeCondReq, opts ...client.CallOption) (*InvokeCondRes, error) + // KeepReward 激励养成可选奖品 + KeepReward(ctx context.Context, in *KeepRewardReq, opts ...client.CallOption) (*KeepRewardRes, error) + // KeepSelect 选择激励养成奖品 + KeepSelect(ctx context.Context, in *KeepSelectReq, opts ...client.CallOption) (*KeepSelectRes, error) + // KeepCollect 激励养成收集一级道具 + KeepCollect(ctx context.Context, in *KeepCollectReq, opts ...client.CallOption) (*KeepCollectRes, error) + // KeepFeed 激励养成收集一级道具 + KeepFeed(ctx context.Context, in *KeepFeedReq, opts ...client.CallOption) (*KeepFeedRes, error) + // MachineSave 激励养成保存机器道具 + MachineSave(ctx context.Context, in *MachineSaveReq, opts ...client.CallOption) (*MachineSaveRes, error) + // MachineRecycle 激励养成回收机器道具 + MachineRecycle(ctx context.Context, in *MachineRecycleReq, opts ...client.CallOption) (*MachineRecycleRes, error) + // GetPropFeed 收喂养次数的道具 + GetPropFeed(ctx context.Context, in *GetPropFeedReq, opts ...client.CallOption) (*GetPropFeedRes, error) + // KeepLog 激励养成记录 + KeepLog(ctx context.Context, in *KeepLogReq, opts ...client.CallOption) (*KeepLogRes, error) + // KeepReselect 激励养成重新选择 + KeepReselect(ctx context.Context, in *KeepReselectReq, opts ...client.CallOption) (*KeepReselectRes, error) + // KeepGuide 激励养成指引 + KeepGuide(ctx context.Context, in *KeepGuideReq, opts ...client.CallOption) (*KeepGuideRes, error) + // KeepFirstInvite 激励养成首邀状态 + KeepFirstInvite(ctx context.Context, in *KeepFirstInviteReq, opts ...client.CallOption) (*KeepFirstInviteRes, error) + // Child 子活动信息 + Child(ctx context.Context, in *ChildReq, opts ...client.CallOption) (*ChildRes, error) + // ChildActive 参与子活动 + ChildActive(ctx context.Context, in *ChildActiveReq, opts ...client.CallOption) (*ChildActiveRes, error) + // GoldFinishStep 完成金币任务阶段 + GoldFinishStep(ctx context.Context, in *GoldFinishStepReq, opts ...client.CallOption) (*GoldFinishStepRes, error) + // GoldNotify 金币获取通知 + GoldNotify(ctx context.Context, in *GoldNotifyReq, opts ...client.CallOption) (*GoldNotifyRes, error) + // GoldRecord 金币获取记录 + GoldRecord(ctx context.Context, in *GoldRecordReq, opts ...client.CallOption) (*GoldRecordRes, error) + // Deduct 扣除积分 + Deduct(ctx context.Context, in *DeductReq, opts ...client.CallOption) (*DeductRes, error) + // Gain 领取积分 + Gain(ctx context.Context, in *GainReq, opts ...client.CallOption) (*GainRes, error) + // CoinRecord 金币池记录 + CoinRecord(ctx context.Context, in *CoinRecordReq, opts ...client.CallOption) (*CoinRecordRes, error) + // ChildList 子活动用户列表 + ChildList(ctx context.Context, in *ChildListReq, opts ...client.CallOption) (*ChildListRes, error) + // ReceiveReward 领取奖励 + ReceiveReward(ctx context.Context, in *ReceiveRewardReq, opts ...client.CallOption) (*ReceiveRewardRes, error) + // LotteryLog 抽奖玩法日志 + LotteryLog(ctx context.Context, in *LotteryLogReq, opts ...client.CallOption) (*LotteryLogRes, error) + // UserList 活动用户数据 + UserList(ctx context.Context, in *UserListReq, opts ...client.CallOption) (*UserListRes, error) + // CashAgain 现金大抽奖再玩一次 + CashAgain(ctx context.Context, in *CashAgainReq, opts ...client.CallOption) (*CashAgainRes, error) + // DiceCollect 用户手机碎片 + DiceCollect(ctx context.Context, in *DiceCollectReq, opts ...client.CallOption) (*DiceCollectRes, error) + // ClientReward 客户端奖品 + ClientReward(ctx context.Context, in *ClientRewardReq, opts ...client.CallOption) (*ClientRewardRes, error) + // PointsUse 积分兑换 + PointsUse(ctx context.Context, in *PointsUseReq, opts ...client.CallOption) (*PointsUseRes, error) + // Chat Ai聊天 + Chat(ctx context.Context, in *ChatReq, opts ...client.CallOption) (*ChatRes, error) + // ChatList 聊天信息 + ChatList(ctx context.Context, in *ChatListReq, opts ...client.CallOption) (*ChatListRes, error) + // ScheduleList 赛程信息 + ScheduleList(ctx context.Context, in *ScheduleListReq, opts ...client.CallOption) (*ScheduleListRes, error) + // MallList 用户商城奖品列表 + MallList(ctx context.Context, in *MallListReq, opts ...client.CallOption) (*MallListRes, error) + // Exchange 商城奖品兑换 + Exchange(ctx context.Context, in *ExchangeReq, opts ...client.CallOption) (*ExchangeRes, error) + // VoteList 投票列表 + VoteList(ctx context.Context, in *VoteListReq, opts ...client.CallOption) (*VoteListRes, error) + // VsTipReward 接受投票结果 + VsTipReward(ctx context.Context, in *VsTipRewardReq, opts ...client.CallOption) (*VsTipRewardRes, error) + // UnoRandCard uno随机牌 + UnoRandCard(ctx context.Context, in *UnoRandCardReq, opts ...client.CallOption) (*UnoRandCardRes, error) + // UnoClaim uno领取牌奖励 + UnoClaim(ctx context.Context, in *UnoClaimReq, opts ...client.CallOption) (*UnoClaimRes, error) + // UnoCard uno卡牌 + UnoCard(ctx context.Context, in *UnoCardReq, opts ...client.CallOption) (*UnoCardRes, error) + // Show 用户详情 + Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) + // EventFirstVisit 首次访问活动 + EventFirstVisit(ctx context.Context, in *EventFirstVisitReq, opts ...client.CallOption) (*EventFirstVisitRes, error) + // FindByUniq 通过唯一键找用户id + FindByUniq(ctx context.Context, in *FindByUniqReq, opts ...client.CallOption) (*FindByUniqRes, error) + // TaskTip 任务提示 + TaskTip(ctx context.Context, in *TaskTipReq, opts ...client.CallOption) (*TaskTipRes, error) + // TaskTipOk 任务提示完成 + TaskTipOk(ctx context.Context, in *TaskTipOkReq, opts ...client.CallOption) (*TaskTipOkRes, error) + // CoinLog 金币日志 + CoinLog(ctx context.Context, in *CoinLogReq, opts ...client.CallOption) (*CoinLogRes, error) +} + +type wCampaignUserService struct { + c client.Client + name string +} + +func NewWCampaignUserService(name string, c client.Client) WCampaignUserService { + return &wCampaignUserService{ + c: c, + name: name, + } +} + +func (c *wCampaignUserService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Reward(ctx context.Context, in *RewardReq, opts ...client.CallOption) (*RewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Reward", in) + out := new(RewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Visit(ctx context.Context, in *VisitReq, opts ...client.CallOption) (*VisitRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Visit", in) + out := new(VisitRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Play(ctx context.Context, in *PlayReq, opts ...client.CallOption) (*PlayRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Play", in) + out := new(PlayRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) RewardUser(ctx context.Context, in *RewardUserReq, opts ...client.CallOption) (*RewardUserRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.RewardUser", in) + out := new(RewardUserRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Info(ctx context.Context, in *InfoReq, opts ...client.CallOption) (*InfoRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Info", in) + out := new(InfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Rank(ctx context.Context, in *RankReq, opts ...client.CallOption) (*RankRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Rank", in) + out := new(RankRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Lottery(ctx context.Context, in *LotteryReq, opts ...client.CallOption) (*LotteryRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Lottery", in) + out := new(LotteryRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Answer(ctx context.Context, in *AnswerReq, opts ...client.CallOption) (*AnswerRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Answer", in) + out := new(AnswerRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) AnswerHistory(ctx context.Context, in *AnswerHistoryReq, opts ...client.CallOption) (*AnswerHistoryRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.AnswerHistory", in) + out := new(AnswerHistoryRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Vote(ctx context.Context, in *VoteReq, opts ...client.CallOption) (*VoteRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Vote", in) + out := new(VoteRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Notify(ctx context.Context, in *NotifyReq, opts ...client.CallOption) (*NotifyRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Notify", in) + out := new(NotifyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) AcceptReward(ctx context.Context, in *AcceptRewardReq, opts ...client.CallOption) (*AcceptRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.AcceptReward", in) + out := new(AcceptRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) TargetRule(ctx context.Context, in *TargetRuleReq, opts ...client.CallOption) (*TargetRuleRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.TargetRule", in) + out := new(TargetRuleRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Task(ctx context.Context, in *TaskReq, opts ...client.CallOption) (*TaskRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Task", in) + out := new(TaskRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Resend(ctx context.Context, in *ResendReq, opts ...client.CallOption) (*ResendRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Resend", in) + out := new(ResendRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) DynamicLink(ctx context.Context, in *DynamicLinkReq, opts ...client.CallOption) (*DynamicLinkRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.DynamicLink", in) + out := new(DynamicLinkRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) DylinkShow(ctx context.Context, in *DylinkShowReq, opts ...client.CallOption) (*DylinkShowRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.DylinkShow", in) + out := new(DylinkShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) SignIn(ctx context.Context, in *SignInReq, opts ...client.CallOption) (*SignInRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.SignIn", in) + out := new(SignInRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Sign(ctx context.Context, in *SignReq, opts ...client.CallOption) (*SignRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Sign", in) + out := new(SignRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) DiceMap(ctx context.Context, in *DiceMapReq, opts ...client.CallOption) (*DiceMapRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.DiceMap", in) + out := new(DiceMapRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Dice(ctx context.Context, in *DiceReq, opts ...client.CallOption) (*DiceRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Dice", in) + out := new(DiceRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Grow(ctx context.Context, in *GrowReq, opts ...client.CallOption) (*GrowRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Grow", in) + out := new(GrowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GetGrow(ctx context.Context, in *GetGrowReq, opts ...client.CallOption) (*GetGrowRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GetGrow", in) + out := new(GetGrowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Feed(ctx context.Context, in *FeedReq, opts ...client.CallOption) (*FeedRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Feed", in) + out := new(FeedRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GetFeed(ctx context.Context, in *GetFeedReq, opts ...client.CallOption) (*GetFeedRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GetFeed", in) + out := new(GetFeedRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GrowRecord(ctx context.Context, in *GrowRecordReq, opts ...client.CallOption) (*GrowRecordRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GrowRecord", in) + out := new(GrowRecordRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ContentLink(ctx context.Context, in *ContentLinkReq, opts ...client.CallOption) (*ContentLinkRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ContentLink", in) + out := new(ContentLinkRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) LinkContent(ctx context.Context, in *LinkContentReq, opts ...client.CallOption) (*LinkContentRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.LinkContent", in) + out := new(LinkContentRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChopSelect(ctx context.Context, in *ChopSelectReq, opts ...client.CallOption) (*ChopSelectRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChopSelect", in) + out := new(ChopSelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChopReselect(ctx context.Context, in *ChopReselectReq, opts ...client.CallOption) (*ChopReselectRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChopReselect", in) + out := new(ChopReselectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChopHelp(ctx context.Context, in *ChopHelpReq, opts ...client.CallOption) (*ChopHelpRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChopHelp", in) + out := new(ChopHelpRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ProjectList(ctx context.Context, in *ProjectListReq, opts ...client.CallOption) (*ProjectListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ProjectList", in) + out := new(ProjectListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) LevelList(ctx context.Context, in *LevelListReq, opts ...client.CallOption) (*LevelListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.LevelList", in) + out := new(LevelListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) LevelStore(ctx context.Context, in *LevelStoreReq, opts ...client.CallOption) (*LevelStoreRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.LevelStore", in) + out := new(LevelStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) LevelEdit(ctx context.Context, in *LevelEditReq, opts ...client.CallOption) (*LevelEditRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.LevelEdit", in) + out := new(LevelEditRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) LevelDestroy(ctx context.Context, in *LevelDestroyReq, opts ...client.CallOption) (*LevelDestroyRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.LevelDestroy", in) + out := new(LevelDestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) MarkLevel(ctx context.Context, in *MarkLevelReq, opts ...client.CallOption) (*MarkLevelRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.MarkLevel", in) + out := new(MarkLevelRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) FinishStep(ctx context.Context, in *FinishStepReq, opts ...client.CallOption) (*FinishStepRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.FinishStep", in) + out := new(FinishStepRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Spin(ctx context.Context, in *SpinReq, opts ...client.CallOption) (*SpinRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Spin", in) + out := new(SpinRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) CashRecords(ctx context.Context, in *CashRecordsReq, opts ...client.CallOption) (*CashRecordsRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.CashRecords", in) + out := new(CashRecordsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) MixReward(ctx context.Context, in *MixRewardReq, opts ...client.CallOption) (*MixRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.MixReward", in) + out := new(MixRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) DiceRecord(ctx context.Context, in *DiceRecordReq, opts ...client.CallOption) (*DiceRecordRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.DiceRecord", in) + out := new(DiceRecordRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) RewardForm(ctx context.Context, in *RewardFormReq, opts ...client.CallOption) (*RewardFormRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.RewardForm", in) + out := new(RewardFormRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) SubmitForm(ctx context.Context, in *SubmitFormReq, opts ...client.CallOption) (*SubmitFormRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.SubmitForm", in) + out := new(SubmitFormRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GetAdsUrl(ctx context.Context, in *GetAdsUrlReq, opts ...client.CallOption) (*GetAdsUrlRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GetAdsUrl", in) + out := new(GetAdsUrlRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) AdsStay(ctx context.Context, in *AdsStayReq, opts ...client.CallOption) (*AdsStayRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.AdsStay", in) + out := new(AdsStayRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ClueNotified(ctx context.Context, in *ClueNotifiedReq, opts ...client.CallOption) (*ClueNotifiedRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ClueNotified", in) + out := new(ClueNotifiedRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChangeUserLevel(ctx context.Context, in *ChangeUserLevelReq, opts ...client.CallOption) (*ChangeUserLevelRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChangeUserLevel", in) + out := new(ChangeUserLevelRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChopReward(ctx context.Context, in *ChopRewardReq, opts ...client.CallOption) (*ChopRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChopReward", in) + out := new(ChopRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) HelpPercent(ctx context.Context, in *HelpPercentReq, opts ...client.CallOption) (*HelpPercentRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.HelpPercent", in) + out := new(HelpPercentRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) InvokeCond(ctx context.Context, in *InvokeCondReq, opts ...client.CallOption) (*InvokeCondRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.InvokeCond", in) + out := new(InvokeCondRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepReward(ctx context.Context, in *KeepRewardReq, opts ...client.CallOption) (*KeepRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepReward", in) + out := new(KeepRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepSelect(ctx context.Context, in *KeepSelectReq, opts ...client.CallOption) (*KeepSelectRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepSelect", in) + out := new(KeepSelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepCollect(ctx context.Context, in *KeepCollectReq, opts ...client.CallOption) (*KeepCollectRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepCollect", in) + out := new(KeepCollectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepFeed(ctx context.Context, in *KeepFeedReq, opts ...client.CallOption) (*KeepFeedRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepFeed", in) + out := new(KeepFeedRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) MachineSave(ctx context.Context, in *MachineSaveReq, opts ...client.CallOption) (*MachineSaveRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.MachineSave", in) + out := new(MachineSaveRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) MachineRecycle(ctx context.Context, in *MachineRecycleReq, opts ...client.CallOption) (*MachineRecycleRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.MachineRecycle", in) + out := new(MachineRecycleRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GetPropFeed(ctx context.Context, in *GetPropFeedReq, opts ...client.CallOption) (*GetPropFeedRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GetPropFeed", in) + out := new(GetPropFeedRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepLog(ctx context.Context, in *KeepLogReq, opts ...client.CallOption) (*KeepLogRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepLog", in) + out := new(KeepLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepReselect(ctx context.Context, in *KeepReselectReq, opts ...client.CallOption) (*KeepReselectRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepReselect", in) + out := new(KeepReselectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepGuide(ctx context.Context, in *KeepGuideReq, opts ...client.CallOption) (*KeepGuideRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepGuide", in) + out := new(KeepGuideRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) KeepFirstInvite(ctx context.Context, in *KeepFirstInviteReq, opts ...client.CallOption) (*KeepFirstInviteRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.KeepFirstInvite", in) + out := new(KeepFirstInviteRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Child(ctx context.Context, in *ChildReq, opts ...client.CallOption) (*ChildRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Child", in) + out := new(ChildRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChildActive(ctx context.Context, in *ChildActiveReq, opts ...client.CallOption) (*ChildActiveRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChildActive", in) + out := new(ChildActiveRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GoldFinishStep(ctx context.Context, in *GoldFinishStepReq, opts ...client.CallOption) (*GoldFinishStepRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GoldFinishStep", in) + out := new(GoldFinishStepRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GoldNotify(ctx context.Context, in *GoldNotifyReq, opts ...client.CallOption) (*GoldNotifyRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GoldNotify", in) + out := new(GoldNotifyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) GoldRecord(ctx context.Context, in *GoldRecordReq, opts ...client.CallOption) (*GoldRecordRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.GoldRecord", in) + out := new(GoldRecordRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Deduct(ctx context.Context, in *DeductReq, opts ...client.CallOption) (*DeductRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Deduct", in) + out := new(DeductRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Gain(ctx context.Context, in *GainReq, opts ...client.CallOption) (*GainRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Gain", in) + out := new(GainRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) CoinRecord(ctx context.Context, in *CoinRecordReq, opts ...client.CallOption) (*CoinRecordRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.CoinRecord", in) + out := new(CoinRecordRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChildList(ctx context.Context, in *ChildListReq, opts ...client.CallOption) (*ChildListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChildList", in) + out := new(ChildListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ReceiveReward(ctx context.Context, in *ReceiveRewardReq, opts ...client.CallOption) (*ReceiveRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ReceiveReward", in) + out := new(ReceiveRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) LotteryLog(ctx context.Context, in *LotteryLogReq, opts ...client.CallOption) (*LotteryLogRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.LotteryLog", in) + out := new(LotteryLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) UserList(ctx context.Context, in *UserListReq, opts ...client.CallOption) (*UserListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.UserList", in) + out := new(UserListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) CashAgain(ctx context.Context, in *CashAgainReq, opts ...client.CallOption) (*CashAgainRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.CashAgain", in) + out := new(CashAgainRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) DiceCollect(ctx context.Context, in *DiceCollectReq, opts ...client.CallOption) (*DiceCollectRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.DiceCollect", in) + out := new(DiceCollectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ClientReward(ctx context.Context, in *ClientRewardReq, opts ...client.CallOption) (*ClientRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ClientReward", in) + out := new(ClientRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) PointsUse(ctx context.Context, in *PointsUseReq, opts ...client.CallOption) (*PointsUseRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.PointsUse", in) + out := new(PointsUseRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Chat(ctx context.Context, in *ChatReq, opts ...client.CallOption) (*ChatRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Chat", in) + out := new(ChatRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ChatList(ctx context.Context, in *ChatListReq, opts ...client.CallOption) (*ChatListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ChatList", in) + out := new(ChatListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) ScheduleList(ctx context.Context, in *ScheduleListReq, opts ...client.CallOption) (*ScheduleListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.ScheduleList", in) + out := new(ScheduleListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) MallList(ctx context.Context, in *MallListReq, opts ...client.CallOption) (*MallListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.MallList", in) + out := new(MallListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Exchange(ctx context.Context, in *ExchangeReq, opts ...client.CallOption) (*ExchangeRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Exchange", in) + out := new(ExchangeRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) VoteList(ctx context.Context, in *VoteListReq, opts ...client.CallOption) (*VoteListRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.VoteList", in) + out := new(VoteListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) VsTipReward(ctx context.Context, in *VsTipRewardReq, opts ...client.CallOption) (*VsTipRewardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.VsTipReward", in) + out := new(VsTipRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) UnoRandCard(ctx context.Context, in *UnoRandCardReq, opts ...client.CallOption) (*UnoRandCardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.UnoRandCard", in) + out := new(UnoRandCardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) UnoClaim(ctx context.Context, in *UnoClaimReq, opts ...client.CallOption) (*UnoClaimRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.UnoClaim", in) + out := new(UnoClaimRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) UnoCard(ctx context.Context, in *UnoCardReq, opts ...client.CallOption) (*UnoCardRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.UnoCard", in) + out := new(UnoCardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.Show", in) + out := new(ShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) EventFirstVisit(ctx context.Context, in *EventFirstVisitReq, opts ...client.CallOption) (*EventFirstVisitRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.EventFirstVisit", in) + out := new(EventFirstVisitRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) FindByUniq(ctx context.Context, in *FindByUniqReq, opts ...client.CallOption) (*FindByUniqRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.FindByUniq", in) + out := new(FindByUniqRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) TaskTip(ctx context.Context, in *TaskTipReq, opts ...client.CallOption) (*TaskTipRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.TaskTip", in) + out := new(TaskTipRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) TaskTipOk(ctx context.Context, in *TaskTipOkReq, opts ...client.CallOption) (*TaskTipOkRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.TaskTipOk", in) + out := new(TaskTipOkRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCampaignUserService) CoinLog(ctx context.Context, in *CoinLogReq, opts ...client.CallOption) (*CoinLogRes, error) { + req := c.c.NewRequest(c.name, "WCampaignUser.CoinLog", in) + out := new(CoinLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WCampaignUser service + +type WCampaignUserHandler interface { + // List 用户列表 + List(context.Context, *ListReq, *ListRes) error + // Reward 用户奖励 + Reward(context.Context, *RewardReq, *RewardRes) error + // Visit 访问活动 + Visit(context.Context, *VisitReq, *VisitRes) error + // Play 用户活动数据 + Play(context.Context, *PlayReq, *PlayRes) error + // RewardUser 中奖用户列表 + RewardUser(context.Context, *RewardUserReq, *RewardUserRes) error + // Info 用户信息 + Info(context.Context, *InfoReq, *InfoRes) error + // Rank 排行榜 + Rank(context.Context, *RankReq, *RankRes) error + // Lottery 活动抽奖 + Lottery(context.Context, *LotteryReq, *LotteryRes) error + // Answer 活动答题 + Answer(context.Context, *AnswerReq, *AnswerRes) error + // AnswerHistory 答题历史 + AnswerHistory(context.Context, *AnswerHistoryReq, *AnswerHistoryRes) error + // Vote 活动投票 + Vote(context.Context, *VoteReq, *VoteRes) error + // Notify 客户端回调 + Notify(context.Context, *NotifyReq, *NotifyRes) error + // AcceptReward 领取奖品 + AcceptReward(context.Context, *AcceptRewardReq, *AcceptRewardRes) error + // TargetRule 达标规则 + TargetRule(context.Context, *TargetRuleReq, *TargetRuleRes) error + // Task 我的任务 + Task(context.Context, *TaskReq, *TaskRes) error + // Resend 补发奖品 + Resend(context.Context, *ResendReq, *ResendRes) error + // DynamicLink 获取用户动态链接 + DynamicLink(context.Context, *DynamicLinkReq, *DynamicLinkRes) error + // DylinkShow 获取用户动态链接详情 + DylinkShow(context.Context, *DylinkShowReq, *DylinkShowRes) error + // SignIn 我的签到板 + SignIn(context.Context, *SignInReq, *SignInRes) error + // Sign 签到 + Sign(context.Context, *SignReq, *SignRes) error + // DiceMap 大富翁地图 + DiceMap(context.Context, *DiceMapReq, *DiceMapRes) error + // Dice 大富翁骰子 + Dice(context.Context, *DiceReq, *DiceRes) error + // Grow 成长生命体 + Grow(context.Context, *GrowReq, *GrowRes) error + // GetGrow 成长生命体 + GetGrow(context.Context, *GetGrowReq, *GetGrowRes) error + // Feed 饲养生命体 + Feed(context.Context, *FeedReq, *FeedRes) error + // GetFeed 领取饲养道具 + GetFeed(context.Context, *GetFeedReq, *GetFeedRes) error + // GrowRecord 成长记录 + GrowRecord(context.Context, *GrowRecordReq, *GrowRecordRes) error + // ContentLink 内容链接 + ContentLink(context.Context, *ContentLinkReq, *ContentLinkRes) error + // LinkContent 链接内容 + LinkContent(context.Context, *LinkContentReq, *LinkContentRes) error + // ChopSelect 选择砍一刀奖品 + ChopSelect(context.Context, *ChopSelectReq, *ChopSelectRes) error + // ChopReselect 重选砍一刀奖品 + ChopReselect(context.Context, *ChopReselectReq, *ChopReselectRes) error + // ChopHelp 砍一刀助力记录 + ChopHelp(context.Context, *ChopHelpReq, *ChopHelpRes) error + // ProjectList 项目参与用户列表 + ProjectList(context.Context, *ProjectListReq, *ProjectListRes) error + // LevelList 用户等级列表 + LevelList(context.Context, *LevelListReq, *LevelListRes) error + // LevelStore 创建用户等级 + LevelStore(context.Context, *LevelStoreReq, *LevelStoreRes) error + // LevelEdit 更新用户等级 + LevelEdit(context.Context, *LevelEditReq, *LevelEditRes) error + // LevelDestroy 删除用户等级 + LevelDestroy(context.Context, *LevelDestroyReq, *LevelDestroyRes) error + // MarkLevel 用户等级标识列表 + MarkLevel(context.Context, *MarkLevelReq, *MarkLevelRes) error + // FinishStep 完成现金抽奖阶段 + FinishStep(context.Context, *FinishStepReq, *FinishStepRes) error + // Spin 现金转盘抽奖 + Spin(context.Context, *SpinReq, *SpinRes) error + // CashRecords 现金转盘记录 + CashRecords(context.Context, *CashRecordsReq, *CashRecordsRes) error + // MixReward 合成奖品 + MixReward(context.Context, *MixRewardReq, *MixRewardRes) error + // DiceRecord 骰子记录 + DiceRecord(context.Context, *DiceRecordReq, *DiceRecordRes) error + // RewardForm 奖品需要填写的表单 + RewardForm(context.Context, *RewardFormReq, *RewardFormRes) error + // SubmitForm 提交表单 + SubmitForm(context.Context, *SubmitFormReq, *SubmitFormRes) error + // GetAdsUrl 广告停留回传 + GetAdsUrl(context.Context, *GetAdsUrlReq, *GetAdsUrlRes) error + // AdsStay 广告停留回传 + AdsStay(context.Context, *AdsStayReq, *AdsStayRes) error + // ClueNotified 通知信息已经被接收 + ClueNotified(context.Context, *ClueNotifiedReq, *ClueNotifiedRes) error + // ChangeUserLevel 修改用户等级 + ChangeUserLevel(context.Context, *ChangeUserLevelReq, *ChangeUserLevelRes) error + // ChopReward 砍一刀可选奖品 + ChopReward(context.Context, *ChopRewardReq, *ChopRewardRes) error + // HelpPercent 助力进度 + HelpPercent(context.Context, *HelpPercentReq, *HelpPercentRes) error + // InvokeCond 触发前置条件 + InvokeCond(context.Context, *InvokeCondReq, *InvokeCondRes) error + // KeepReward 激励养成可选奖品 + KeepReward(context.Context, *KeepRewardReq, *KeepRewardRes) error + // KeepSelect 选择激励养成奖品 + KeepSelect(context.Context, *KeepSelectReq, *KeepSelectRes) error + // KeepCollect 激励养成收集一级道具 + KeepCollect(context.Context, *KeepCollectReq, *KeepCollectRes) error + // KeepFeed 激励养成收集一级道具 + KeepFeed(context.Context, *KeepFeedReq, *KeepFeedRes) error + // MachineSave 激励养成保存机器道具 + MachineSave(context.Context, *MachineSaveReq, *MachineSaveRes) error + // MachineRecycle 激励养成回收机器道具 + MachineRecycle(context.Context, *MachineRecycleReq, *MachineRecycleRes) error + // GetPropFeed 收喂养次数的道具 + GetPropFeed(context.Context, *GetPropFeedReq, *GetPropFeedRes) error + // KeepLog 激励养成记录 + KeepLog(context.Context, *KeepLogReq, *KeepLogRes) error + // KeepReselect 激励养成重新选择 + KeepReselect(context.Context, *KeepReselectReq, *KeepReselectRes) error + // KeepGuide 激励养成指引 + KeepGuide(context.Context, *KeepGuideReq, *KeepGuideRes) error + // KeepFirstInvite 激励养成首邀状态 + KeepFirstInvite(context.Context, *KeepFirstInviteReq, *KeepFirstInviteRes) error + // Child 子活动信息 + Child(context.Context, *ChildReq, *ChildRes) error + // ChildActive 参与子活动 + ChildActive(context.Context, *ChildActiveReq, *ChildActiveRes) error + // GoldFinishStep 完成金币任务阶段 + GoldFinishStep(context.Context, *GoldFinishStepReq, *GoldFinishStepRes) error + // GoldNotify 金币获取通知 + GoldNotify(context.Context, *GoldNotifyReq, *GoldNotifyRes) error + // GoldRecord 金币获取记录 + GoldRecord(context.Context, *GoldRecordReq, *GoldRecordRes) error + // Deduct 扣除积分 + Deduct(context.Context, *DeductReq, *DeductRes) error + // Gain 领取积分 + Gain(context.Context, *GainReq, *GainRes) error + // CoinRecord 金币池记录 + CoinRecord(context.Context, *CoinRecordReq, *CoinRecordRes) error + // ChildList 子活动用户列表 + ChildList(context.Context, *ChildListReq, *ChildListRes) error + // ReceiveReward 领取奖励 + ReceiveReward(context.Context, *ReceiveRewardReq, *ReceiveRewardRes) error + // LotteryLog 抽奖玩法日志 + LotteryLog(context.Context, *LotteryLogReq, *LotteryLogRes) error + // UserList 活动用户数据 + UserList(context.Context, *UserListReq, *UserListRes) error + // CashAgain 现金大抽奖再玩一次 + CashAgain(context.Context, *CashAgainReq, *CashAgainRes) error + // DiceCollect 用户手机碎片 + DiceCollect(context.Context, *DiceCollectReq, *DiceCollectRes) error + // ClientReward 客户端奖品 + ClientReward(context.Context, *ClientRewardReq, *ClientRewardRes) error + // PointsUse 积分兑换 + PointsUse(context.Context, *PointsUseReq, *PointsUseRes) error + // Chat Ai聊天 + Chat(context.Context, *ChatReq, *ChatRes) error + // ChatList 聊天信息 + ChatList(context.Context, *ChatListReq, *ChatListRes) error + // ScheduleList 赛程信息 + ScheduleList(context.Context, *ScheduleListReq, *ScheduleListRes) error + // MallList 用户商城奖品列表 + MallList(context.Context, *MallListReq, *MallListRes) error + // Exchange 商城奖品兑换 + Exchange(context.Context, *ExchangeReq, *ExchangeRes) error + // VoteList 投票列表 + VoteList(context.Context, *VoteListReq, *VoteListRes) error + // VsTipReward 接受投票结果 + VsTipReward(context.Context, *VsTipRewardReq, *VsTipRewardRes) error + // UnoRandCard uno随机牌 + UnoRandCard(context.Context, *UnoRandCardReq, *UnoRandCardRes) error + // UnoClaim uno领取牌奖励 + UnoClaim(context.Context, *UnoClaimReq, *UnoClaimRes) error + // UnoCard uno卡牌 + UnoCard(context.Context, *UnoCardReq, *UnoCardRes) error + // Show 用户详情 + Show(context.Context, *ShowReq, *ShowRes) error + // EventFirstVisit 首次访问活动 + EventFirstVisit(context.Context, *EventFirstVisitReq, *EventFirstVisitRes) error + // FindByUniq 通过唯一键找用户id + FindByUniq(context.Context, *FindByUniqReq, *FindByUniqRes) error + // TaskTip 任务提示 + TaskTip(context.Context, *TaskTipReq, *TaskTipRes) error + // TaskTipOk 任务提示完成 + TaskTipOk(context.Context, *TaskTipOkReq, *TaskTipOkRes) error + // CoinLog 金币日志 + CoinLog(context.Context, *CoinLogReq, *CoinLogRes) error +} + +func RegisterWCampaignUserHandler(s server.Server, hdlr WCampaignUserHandler, opts ...server.HandlerOption) error { + type wCampaignUser interface { + List(ctx context.Context, in *ListReq, out *ListRes) error + Reward(ctx context.Context, in *RewardReq, out *RewardRes) error + Visit(ctx context.Context, in *VisitReq, out *VisitRes) error + Play(ctx context.Context, in *PlayReq, out *PlayRes) error + RewardUser(ctx context.Context, in *RewardUserReq, out *RewardUserRes) error + Info(ctx context.Context, in *InfoReq, out *InfoRes) error + Rank(ctx context.Context, in *RankReq, out *RankRes) error + Lottery(ctx context.Context, in *LotteryReq, out *LotteryRes) error + Answer(ctx context.Context, in *AnswerReq, out *AnswerRes) error + AnswerHistory(ctx context.Context, in *AnswerHistoryReq, out *AnswerHistoryRes) error + Vote(ctx context.Context, in *VoteReq, out *VoteRes) error + Notify(ctx context.Context, in *NotifyReq, out *NotifyRes) error + AcceptReward(ctx context.Context, in *AcceptRewardReq, out *AcceptRewardRes) error + TargetRule(ctx context.Context, in *TargetRuleReq, out *TargetRuleRes) error + Task(ctx context.Context, in *TaskReq, out *TaskRes) error + Resend(ctx context.Context, in *ResendReq, out *ResendRes) error + DynamicLink(ctx context.Context, in *DynamicLinkReq, out *DynamicLinkRes) error + DylinkShow(ctx context.Context, in *DylinkShowReq, out *DylinkShowRes) error + SignIn(ctx context.Context, in *SignInReq, out *SignInRes) error + Sign(ctx context.Context, in *SignReq, out *SignRes) error + DiceMap(ctx context.Context, in *DiceMapReq, out *DiceMapRes) error + Dice(ctx context.Context, in *DiceReq, out *DiceRes) error + Grow(ctx context.Context, in *GrowReq, out *GrowRes) error + GetGrow(ctx context.Context, in *GetGrowReq, out *GetGrowRes) error + Feed(ctx context.Context, in *FeedReq, out *FeedRes) error + GetFeed(ctx context.Context, in *GetFeedReq, out *GetFeedRes) error + GrowRecord(ctx context.Context, in *GrowRecordReq, out *GrowRecordRes) error + ContentLink(ctx context.Context, in *ContentLinkReq, out *ContentLinkRes) error + LinkContent(ctx context.Context, in *LinkContentReq, out *LinkContentRes) error + ChopSelect(ctx context.Context, in *ChopSelectReq, out *ChopSelectRes) error + ChopReselect(ctx context.Context, in *ChopReselectReq, out *ChopReselectRes) error + ChopHelp(ctx context.Context, in *ChopHelpReq, out *ChopHelpRes) error + ProjectList(ctx context.Context, in *ProjectListReq, out *ProjectListRes) error + LevelList(ctx context.Context, in *LevelListReq, out *LevelListRes) error + LevelStore(ctx context.Context, in *LevelStoreReq, out *LevelStoreRes) error + LevelEdit(ctx context.Context, in *LevelEditReq, out *LevelEditRes) error + LevelDestroy(ctx context.Context, in *LevelDestroyReq, out *LevelDestroyRes) error + MarkLevel(ctx context.Context, in *MarkLevelReq, out *MarkLevelRes) error + FinishStep(ctx context.Context, in *FinishStepReq, out *FinishStepRes) error + Spin(ctx context.Context, in *SpinReq, out *SpinRes) error + CashRecords(ctx context.Context, in *CashRecordsReq, out *CashRecordsRes) error + MixReward(ctx context.Context, in *MixRewardReq, out *MixRewardRes) error + DiceRecord(ctx context.Context, in *DiceRecordReq, out *DiceRecordRes) error + RewardForm(ctx context.Context, in *RewardFormReq, out *RewardFormRes) error + SubmitForm(ctx context.Context, in *SubmitFormReq, out *SubmitFormRes) error + GetAdsUrl(ctx context.Context, in *GetAdsUrlReq, out *GetAdsUrlRes) error + AdsStay(ctx context.Context, in *AdsStayReq, out *AdsStayRes) error + ClueNotified(ctx context.Context, in *ClueNotifiedReq, out *ClueNotifiedRes) error + ChangeUserLevel(ctx context.Context, in *ChangeUserLevelReq, out *ChangeUserLevelRes) error + ChopReward(ctx context.Context, in *ChopRewardReq, out *ChopRewardRes) error + HelpPercent(ctx context.Context, in *HelpPercentReq, out *HelpPercentRes) error + InvokeCond(ctx context.Context, in *InvokeCondReq, out *InvokeCondRes) error + KeepReward(ctx context.Context, in *KeepRewardReq, out *KeepRewardRes) error + KeepSelect(ctx context.Context, in *KeepSelectReq, out *KeepSelectRes) error + KeepCollect(ctx context.Context, in *KeepCollectReq, out *KeepCollectRes) error + KeepFeed(ctx context.Context, in *KeepFeedReq, out *KeepFeedRes) error + MachineSave(ctx context.Context, in *MachineSaveReq, out *MachineSaveRes) error + MachineRecycle(ctx context.Context, in *MachineRecycleReq, out *MachineRecycleRes) error + GetPropFeed(ctx context.Context, in *GetPropFeedReq, out *GetPropFeedRes) error + KeepLog(ctx context.Context, in *KeepLogReq, out *KeepLogRes) error + KeepReselect(ctx context.Context, in *KeepReselectReq, out *KeepReselectRes) error + KeepGuide(ctx context.Context, in *KeepGuideReq, out *KeepGuideRes) error + KeepFirstInvite(ctx context.Context, in *KeepFirstInviteReq, out *KeepFirstInviteRes) error + Child(ctx context.Context, in *ChildReq, out *ChildRes) error + ChildActive(ctx context.Context, in *ChildActiveReq, out *ChildActiveRes) error + GoldFinishStep(ctx context.Context, in *GoldFinishStepReq, out *GoldFinishStepRes) error + GoldNotify(ctx context.Context, in *GoldNotifyReq, out *GoldNotifyRes) error + GoldRecord(ctx context.Context, in *GoldRecordReq, out *GoldRecordRes) error + Deduct(ctx context.Context, in *DeductReq, out *DeductRes) error + Gain(ctx context.Context, in *GainReq, out *GainRes) error + CoinRecord(ctx context.Context, in *CoinRecordReq, out *CoinRecordRes) error + ChildList(ctx context.Context, in *ChildListReq, out *ChildListRes) error + ReceiveReward(ctx context.Context, in *ReceiveRewardReq, out *ReceiveRewardRes) error + LotteryLog(ctx context.Context, in *LotteryLogReq, out *LotteryLogRes) error + UserList(ctx context.Context, in *UserListReq, out *UserListRes) error + CashAgain(ctx context.Context, in *CashAgainReq, out *CashAgainRes) error + DiceCollect(ctx context.Context, in *DiceCollectReq, out *DiceCollectRes) error + ClientReward(ctx context.Context, in *ClientRewardReq, out *ClientRewardRes) error + PointsUse(ctx context.Context, in *PointsUseReq, out *PointsUseRes) error + Chat(ctx context.Context, in *ChatReq, out *ChatRes) error + ChatList(ctx context.Context, in *ChatListReq, out *ChatListRes) error + ScheduleList(ctx context.Context, in *ScheduleListReq, out *ScheduleListRes) error + MallList(ctx context.Context, in *MallListReq, out *MallListRes) error + Exchange(ctx context.Context, in *ExchangeReq, out *ExchangeRes) error + VoteList(ctx context.Context, in *VoteListReq, out *VoteListRes) error + VsTipReward(ctx context.Context, in *VsTipRewardReq, out *VsTipRewardRes) error + UnoRandCard(ctx context.Context, in *UnoRandCardReq, out *UnoRandCardRes) error + UnoClaim(ctx context.Context, in *UnoClaimReq, out *UnoClaimRes) error + UnoCard(ctx context.Context, in *UnoCardReq, out *UnoCardRes) error + Show(ctx context.Context, in *ShowReq, out *ShowRes) error + EventFirstVisit(ctx context.Context, in *EventFirstVisitReq, out *EventFirstVisitRes) error + FindByUniq(ctx context.Context, in *FindByUniqReq, out *FindByUniqRes) error + TaskTip(ctx context.Context, in *TaskTipReq, out *TaskTipRes) error + TaskTipOk(ctx context.Context, in *TaskTipOkReq, out *TaskTipOkRes) error + CoinLog(ctx context.Context, in *CoinLogReq, out *CoinLogRes) error + } + type WCampaignUser struct { + wCampaignUser + } + h := &wCampaignUserHandler{hdlr} + return s.Handle(s.NewHandler(&WCampaignUser{h}, opts...)) +} + +type wCampaignUserHandler struct { + WCampaignUserHandler +} + +func (h *wCampaignUserHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WCampaignUserHandler.List(ctx, in, out) +} + +func (h *wCampaignUserHandler) Reward(ctx context.Context, in *RewardReq, out *RewardRes) error { + return h.WCampaignUserHandler.Reward(ctx, in, out) +} + +func (h *wCampaignUserHandler) Visit(ctx context.Context, in *VisitReq, out *VisitRes) error { + return h.WCampaignUserHandler.Visit(ctx, in, out) +} + +func (h *wCampaignUserHandler) Play(ctx context.Context, in *PlayReq, out *PlayRes) error { + return h.WCampaignUserHandler.Play(ctx, in, out) +} + +func (h *wCampaignUserHandler) RewardUser(ctx context.Context, in *RewardUserReq, out *RewardUserRes) error { + return h.WCampaignUserHandler.RewardUser(ctx, in, out) +} + +func (h *wCampaignUserHandler) Info(ctx context.Context, in *InfoReq, out *InfoRes) error { + return h.WCampaignUserHandler.Info(ctx, in, out) +} + +func (h *wCampaignUserHandler) Rank(ctx context.Context, in *RankReq, out *RankRes) error { + return h.WCampaignUserHandler.Rank(ctx, in, out) +} + +func (h *wCampaignUserHandler) Lottery(ctx context.Context, in *LotteryReq, out *LotteryRes) error { + return h.WCampaignUserHandler.Lottery(ctx, in, out) +} + +func (h *wCampaignUserHandler) Answer(ctx context.Context, in *AnswerReq, out *AnswerRes) error { + return h.WCampaignUserHandler.Answer(ctx, in, out) +} + +func (h *wCampaignUserHandler) AnswerHistory(ctx context.Context, in *AnswerHistoryReq, out *AnswerHistoryRes) error { + return h.WCampaignUserHandler.AnswerHistory(ctx, in, out) +} + +func (h *wCampaignUserHandler) Vote(ctx context.Context, in *VoteReq, out *VoteRes) error { + return h.WCampaignUserHandler.Vote(ctx, in, out) +} + +func (h *wCampaignUserHandler) Notify(ctx context.Context, in *NotifyReq, out *NotifyRes) error { + return h.WCampaignUserHandler.Notify(ctx, in, out) +} + +func (h *wCampaignUserHandler) AcceptReward(ctx context.Context, in *AcceptRewardReq, out *AcceptRewardRes) error { + return h.WCampaignUserHandler.AcceptReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) TargetRule(ctx context.Context, in *TargetRuleReq, out *TargetRuleRes) error { + return h.WCampaignUserHandler.TargetRule(ctx, in, out) +} + +func (h *wCampaignUserHandler) Task(ctx context.Context, in *TaskReq, out *TaskRes) error { + return h.WCampaignUserHandler.Task(ctx, in, out) +} + +func (h *wCampaignUserHandler) Resend(ctx context.Context, in *ResendReq, out *ResendRes) error { + return h.WCampaignUserHandler.Resend(ctx, in, out) +} + +func (h *wCampaignUserHandler) DynamicLink(ctx context.Context, in *DynamicLinkReq, out *DynamicLinkRes) error { + return h.WCampaignUserHandler.DynamicLink(ctx, in, out) +} + +func (h *wCampaignUserHandler) DylinkShow(ctx context.Context, in *DylinkShowReq, out *DylinkShowRes) error { + return h.WCampaignUserHandler.DylinkShow(ctx, in, out) +} + +func (h *wCampaignUserHandler) SignIn(ctx context.Context, in *SignInReq, out *SignInRes) error { + return h.WCampaignUserHandler.SignIn(ctx, in, out) +} + +func (h *wCampaignUserHandler) Sign(ctx context.Context, in *SignReq, out *SignRes) error { + return h.WCampaignUserHandler.Sign(ctx, in, out) +} + +func (h *wCampaignUserHandler) DiceMap(ctx context.Context, in *DiceMapReq, out *DiceMapRes) error { + return h.WCampaignUserHandler.DiceMap(ctx, in, out) +} + +func (h *wCampaignUserHandler) Dice(ctx context.Context, in *DiceReq, out *DiceRes) error { + return h.WCampaignUserHandler.Dice(ctx, in, out) +} + +func (h *wCampaignUserHandler) Grow(ctx context.Context, in *GrowReq, out *GrowRes) error { + return h.WCampaignUserHandler.Grow(ctx, in, out) +} + +func (h *wCampaignUserHandler) GetGrow(ctx context.Context, in *GetGrowReq, out *GetGrowRes) error { + return h.WCampaignUserHandler.GetGrow(ctx, in, out) +} + +func (h *wCampaignUserHandler) Feed(ctx context.Context, in *FeedReq, out *FeedRes) error { + return h.WCampaignUserHandler.Feed(ctx, in, out) +} + +func (h *wCampaignUserHandler) GetFeed(ctx context.Context, in *GetFeedReq, out *GetFeedRes) error { + return h.WCampaignUserHandler.GetFeed(ctx, in, out) +} + +func (h *wCampaignUserHandler) GrowRecord(ctx context.Context, in *GrowRecordReq, out *GrowRecordRes) error { + return h.WCampaignUserHandler.GrowRecord(ctx, in, out) +} + +func (h *wCampaignUserHandler) ContentLink(ctx context.Context, in *ContentLinkReq, out *ContentLinkRes) error { + return h.WCampaignUserHandler.ContentLink(ctx, in, out) +} + +func (h *wCampaignUserHandler) LinkContent(ctx context.Context, in *LinkContentReq, out *LinkContentRes) error { + return h.WCampaignUserHandler.LinkContent(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChopSelect(ctx context.Context, in *ChopSelectReq, out *ChopSelectRes) error { + return h.WCampaignUserHandler.ChopSelect(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChopReselect(ctx context.Context, in *ChopReselectReq, out *ChopReselectRes) error { + return h.WCampaignUserHandler.ChopReselect(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChopHelp(ctx context.Context, in *ChopHelpReq, out *ChopHelpRes) error { + return h.WCampaignUserHandler.ChopHelp(ctx, in, out) +} + +func (h *wCampaignUserHandler) ProjectList(ctx context.Context, in *ProjectListReq, out *ProjectListRes) error { + return h.WCampaignUserHandler.ProjectList(ctx, in, out) +} + +func (h *wCampaignUserHandler) LevelList(ctx context.Context, in *LevelListReq, out *LevelListRes) error { + return h.WCampaignUserHandler.LevelList(ctx, in, out) +} + +func (h *wCampaignUserHandler) LevelStore(ctx context.Context, in *LevelStoreReq, out *LevelStoreRes) error { + return h.WCampaignUserHandler.LevelStore(ctx, in, out) +} + +func (h *wCampaignUserHandler) LevelEdit(ctx context.Context, in *LevelEditReq, out *LevelEditRes) error { + return h.WCampaignUserHandler.LevelEdit(ctx, in, out) +} + +func (h *wCampaignUserHandler) LevelDestroy(ctx context.Context, in *LevelDestroyReq, out *LevelDestroyRes) error { + return h.WCampaignUserHandler.LevelDestroy(ctx, in, out) +} + +func (h *wCampaignUserHandler) MarkLevel(ctx context.Context, in *MarkLevelReq, out *MarkLevelRes) error { + return h.WCampaignUserHandler.MarkLevel(ctx, in, out) +} + +func (h *wCampaignUserHandler) FinishStep(ctx context.Context, in *FinishStepReq, out *FinishStepRes) error { + return h.WCampaignUserHandler.FinishStep(ctx, in, out) +} + +func (h *wCampaignUserHandler) Spin(ctx context.Context, in *SpinReq, out *SpinRes) error { + return h.WCampaignUserHandler.Spin(ctx, in, out) +} + +func (h *wCampaignUserHandler) CashRecords(ctx context.Context, in *CashRecordsReq, out *CashRecordsRes) error { + return h.WCampaignUserHandler.CashRecords(ctx, in, out) +} + +func (h *wCampaignUserHandler) MixReward(ctx context.Context, in *MixRewardReq, out *MixRewardRes) error { + return h.WCampaignUserHandler.MixReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) DiceRecord(ctx context.Context, in *DiceRecordReq, out *DiceRecordRes) error { + return h.WCampaignUserHandler.DiceRecord(ctx, in, out) +} + +func (h *wCampaignUserHandler) RewardForm(ctx context.Context, in *RewardFormReq, out *RewardFormRes) error { + return h.WCampaignUserHandler.RewardForm(ctx, in, out) +} + +func (h *wCampaignUserHandler) SubmitForm(ctx context.Context, in *SubmitFormReq, out *SubmitFormRes) error { + return h.WCampaignUserHandler.SubmitForm(ctx, in, out) +} + +func (h *wCampaignUserHandler) GetAdsUrl(ctx context.Context, in *GetAdsUrlReq, out *GetAdsUrlRes) error { + return h.WCampaignUserHandler.GetAdsUrl(ctx, in, out) +} + +func (h *wCampaignUserHandler) AdsStay(ctx context.Context, in *AdsStayReq, out *AdsStayRes) error { + return h.WCampaignUserHandler.AdsStay(ctx, in, out) +} + +func (h *wCampaignUserHandler) ClueNotified(ctx context.Context, in *ClueNotifiedReq, out *ClueNotifiedRes) error { + return h.WCampaignUserHandler.ClueNotified(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChangeUserLevel(ctx context.Context, in *ChangeUserLevelReq, out *ChangeUserLevelRes) error { + return h.WCampaignUserHandler.ChangeUserLevel(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChopReward(ctx context.Context, in *ChopRewardReq, out *ChopRewardRes) error { + return h.WCampaignUserHandler.ChopReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) HelpPercent(ctx context.Context, in *HelpPercentReq, out *HelpPercentRes) error { + return h.WCampaignUserHandler.HelpPercent(ctx, in, out) +} + +func (h *wCampaignUserHandler) InvokeCond(ctx context.Context, in *InvokeCondReq, out *InvokeCondRes) error { + return h.WCampaignUserHandler.InvokeCond(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepReward(ctx context.Context, in *KeepRewardReq, out *KeepRewardRes) error { + return h.WCampaignUserHandler.KeepReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepSelect(ctx context.Context, in *KeepSelectReq, out *KeepSelectRes) error { + return h.WCampaignUserHandler.KeepSelect(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepCollect(ctx context.Context, in *KeepCollectReq, out *KeepCollectRes) error { + return h.WCampaignUserHandler.KeepCollect(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepFeed(ctx context.Context, in *KeepFeedReq, out *KeepFeedRes) error { + return h.WCampaignUserHandler.KeepFeed(ctx, in, out) +} + +func (h *wCampaignUserHandler) MachineSave(ctx context.Context, in *MachineSaveReq, out *MachineSaveRes) error { + return h.WCampaignUserHandler.MachineSave(ctx, in, out) +} + +func (h *wCampaignUserHandler) MachineRecycle(ctx context.Context, in *MachineRecycleReq, out *MachineRecycleRes) error { + return h.WCampaignUserHandler.MachineRecycle(ctx, in, out) +} + +func (h *wCampaignUserHandler) GetPropFeed(ctx context.Context, in *GetPropFeedReq, out *GetPropFeedRes) error { + return h.WCampaignUserHandler.GetPropFeed(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepLog(ctx context.Context, in *KeepLogReq, out *KeepLogRes) error { + return h.WCampaignUserHandler.KeepLog(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepReselect(ctx context.Context, in *KeepReselectReq, out *KeepReselectRes) error { + return h.WCampaignUserHandler.KeepReselect(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepGuide(ctx context.Context, in *KeepGuideReq, out *KeepGuideRes) error { + return h.WCampaignUserHandler.KeepGuide(ctx, in, out) +} + +func (h *wCampaignUserHandler) KeepFirstInvite(ctx context.Context, in *KeepFirstInviteReq, out *KeepFirstInviteRes) error { + return h.WCampaignUserHandler.KeepFirstInvite(ctx, in, out) +} + +func (h *wCampaignUserHandler) Child(ctx context.Context, in *ChildReq, out *ChildRes) error { + return h.WCampaignUserHandler.Child(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChildActive(ctx context.Context, in *ChildActiveReq, out *ChildActiveRes) error { + return h.WCampaignUserHandler.ChildActive(ctx, in, out) +} + +func (h *wCampaignUserHandler) GoldFinishStep(ctx context.Context, in *GoldFinishStepReq, out *GoldFinishStepRes) error { + return h.WCampaignUserHandler.GoldFinishStep(ctx, in, out) +} + +func (h *wCampaignUserHandler) GoldNotify(ctx context.Context, in *GoldNotifyReq, out *GoldNotifyRes) error { + return h.WCampaignUserHandler.GoldNotify(ctx, in, out) +} + +func (h *wCampaignUserHandler) GoldRecord(ctx context.Context, in *GoldRecordReq, out *GoldRecordRes) error { + return h.WCampaignUserHandler.GoldRecord(ctx, in, out) +} + +func (h *wCampaignUserHandler) Deduct(ctx context.Context, in *DeductReq, out *DeductRes) error { + return h.WCampaignUserHandler.Deduct(ctx, in, out) +} + +func (h *wCampaignUserHandler) Gain(ctx context.Context, in *GainReq, out *GainRes) error { + return h.WCampaignUserHandler.Gain(ctx, in, out) +} + +func (h *wCampaignUserHandler) CoinRecord(ctx context.Context, in *CoinRecordReq, out *CoinRecordRes) error { + return h.WCampaignUserHandler.CoinRecord(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChildList(ctx context.Context, in *ChildListReq, out *ChildListRes) error { + return h.WCampaignUserHandler.ChildList(ctx, in, out) +} + +func (h *wCampaignUserHandler) ReceiveReward(ctx context.Context, in *ReceiveRewardReq, out *ReceiveRewardRes) error { + return h.WCampaignUserHandler.ReceiveReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) LotteryLog(ctx context.Context, in *LotteryLogReq, out *LotteryLogRes) error { + return h.WCampaignUserHandler.LotteryLog(ctx, in, out) +} + +func (h *wCampaignUserHandler) UserList(ctx context.Context, in *UserListReq, out *UserListRes) error { + return h.WCampaignUserHandler.UserList(ctx, in, out) +} + +func (h *wCampaignUserHandler) CashAgain(ctx context.Context, in *CashAgainReq, out *CashAgainRes) error { + return h.WCampaignUserHandler.CashAgain(ctx, in, out) +} + +func (h *wCampaignUserHandler) DiceCollect(ctx context.Context, in *DiceCollectReq, out *DiceCollectRes) error { + return h.WCampaignUserHandler.DiceCollect(ctx, in, out) +} + +func (h *wCampaignUserHandler) ClientReward(ctx context.Context, in *ClientRewardReq, out *ClientRewardRes) error { + return h.WCampaignUserHandler.ClientReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) PointsUse(ctx context.Context, in *PointsUseReq, out *PointsUseRes) error { + return h.WCampaignUserHandler.PointsUse(ctx, in, out) +} + +func (h *wCampaignUserHandler) Chat(ctx context.Context, in *ChatReq, out *ChatRes) error { + return h.WCampaignUserHandler.Chat(ctx, in, out) +} + +func (h *wCampaignUserHandler) ChatList(ctx context.Context, in *ChatListReq, out *ChatListRes) error { + return h.WCampaignUserHandler.ChatList(ctx, in, out) +} + +func (h *wCampaignUserHandler) ScheduleList(ctx context.Context, in *ScheduleListReq, out *ScheduleListRes) error { + return h.WCampaignUserHandler.ScheduleList(ctx, in, out) +} + +func (h *wCampaignUserHandler) MallList(ctx context.Context, in *MallListReq, out *MallListRes) error { + return h.WCampaignUserHandler.MallList(ctx, in, out) +} + +func (h *wCampaignUserHandler) Exchange(ctx context.Context, in *ExchangeReq, out *ExchangeRes) error { + return h.WCampaignUserHandler.Exchange(ctx, in, out) +} + +func (h *wCampaignUserHandler) VoteList(ctx context.Context, in *VoteListReq, out *VoteListRes) error { + return h.WCampaignUserHandler.VoteList(ctx, in, out) +} + +func (h *wCampaignUserHandler) VsTipReward(ctx context.Context, in *VsTipRewardReq, out *VsTipRewardRes) error { + return h.WCampaignUserHandler.VsTipReward(ctx, in, out) +} + +func (h *wCampaignUserHandler) UnoRandCard(ctx context.Context, in *UnoRandCardReq, out *UnoRandCardRes) error { + return h.WCampaignUserHandler.UnoRandCard(ctx, in, out) +} + +func (h *wCampaignUserHandler) UnoClaim(ctx context.Context, in *UnoClaimReq, out *UnoClaimRes) error { + return h.WCampaignUserHandler.UnoClaim(ctx, in, out) +} + +func (h *wCampaignUserHandler) UnoCard(ctx context.Context, in *UnoCardReq, out *UnoCardRes) error { + return h.WCampaignUserHandler.UnoCard(ctx, in, out) +} + +func (h *wCampaignUserHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error { + return h.WCampaignUserHandler.Show(ctx, in, out) +} + +func (h *wCampaignUserHandler) EventFirstVisit(ctx context.Context, in *EventFirstVisitReq, out *EventFirstVisitRes) error { + return h.WCampaignUserHandler.EventFirstVisit(ctx, in, out) +} + +func (h *wCampaignUserHandler) FindByUniq(ctx context.Context, in *FindByUniqReq, out *FindByUniqRes) error { + return h.WCampaignUserHandler.FindByUniq(ctx, in, out) +} + +func (h *wCampaignUserHandler) TaskTip(ctx context.Context, in *TaskTipReq, out *TaskTipRes) error { + return h.WCampaignUserHandler.TaskTip(ctx, in, out) +} + +func (h *wCampaignUserHandler) TaskTipOk(ctx context.Context, in *TaskTipOkReq, out *TaskTipOkRes) error { + return h.WCampaignUserHandler.TaskTipOk(ctx, in, out) +} + +func (h *wCampaignUserHandler) CoinLog(ctx context.Context, in *CoinLogReq, out *CoinLogRes) error { + return h.WCampaignUserHandler.CoinLog(ctx, in, out) +} diff --git a/proto/go_proto/w_coin/w_coin.pb.go b/proto/go_proto/w_coin/w_coin.pb.go new file mode 100644 index 0000000..1df958e --- /dev/null +++ b/proto/go_proto/w_coin/w_coin.pb.go @@ -0,0 +1,614 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_coin.proto + +package w_coinpb + +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 SaveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //积分标题 + OpenPush int32 `protobuf:"varint,3,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //同步推送(0-关闭,1-开启) + ExpSelect []string `protobuf:"bytes,4,rep,name=exp_select,json=expSelect,proto3" json:"exp_select,omitempty"` //有效期选择['7','30','90', '0'] + Langs []*SaveReq_Lang `protobuf:"bytes,5,rep,name=langs,proto3" json:"langs,omitempty"` //语言配置 +} + +func (x *SaveReq) Reset() { + *x = SaveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_coin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveReq) ProtoMessage() {} + +func (x *SaveReq) ProtoReflect() protoreflect.Message { + mi := &file_w_coin_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 SaveReq.ProtoReflect.Descriptor instead. +func (*SaveReq) Descriptor() ([]byte, []int) { + return file_w_coin_proto_rawDescGZIP(), []int{0} +} + +func (x *SaveReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SaveReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SaveReq) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +func (x *SaveReq) GetExpSelect() []string { + if x != nil { + return x.ExpSelect + } + return nil +} + +func (x *SaveReq) GetLangs() []*SaveReq_Lang { + if x != nil { + return x.Langs + } + return nil +} + +type SaveRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SaveRes) Reset() { + *x = SaveRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_coin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveRes) ProtoMessage() {} + +func (x *SaveRes) ProtoReflect() protoreflect.Message { + mi := &file_w_coin_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 SaveRes.ProtoReflect.Descriptor instead. +func (*SaveRes) Descriptor() ([]byte, []int) { + return file_w_coin_proto_rawDescGZIP(), []int{1} +} + +type ShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + ProjectId int64 `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目ID +} + +func (x *ShowReq) Reset() { + *x = ShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_coin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowReq) ProtoMessage() {} + +func (x *ShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_coin_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 ShowReq.ProtoReflect.Descriptor instead. +func (*ShowReq) Descriptor() ([]byte, []int) { + return file_w_coin_proto_rawDescGZIP(), []int{2} +} + +func (x *ShowReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ShowReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +type ShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //积分标题 + OpenPush int32 `protobuf:"varint,2,opt,name=open_push,json=openPush,proto3" json:"open_push,omitempty"` //同步推送(0-关闭,1-开启) + ExpSelect []string `protobuf:"bytes,3,rep,name=exp_select,json=expSelect,proto3" json:"exp_select,omitempty"` //有效期选择['7','30','90', '0'] + Langs []*ShowRes_Lang `protobuf:"bytes,4,rep,name=langs,proto3" json:"langs,omitempty"` //语言配置 +} + +func (x *ShowRes) Reset() { + *x = ShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_coin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes) ProtoMessage() {} + +func (x *ShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_coin_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 ShowRes.ProtoReflect.Descriptor instead. +func (*ShowRes) Descriptor() ([]byte, []int) { + return file_w_coin_proto_rawDescGZIP(), []int{3} +} + +func (x *ShowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes) GetOpenPush() int32 { + if x != nil { + return x.OpenPush + } + return 0 +} + +func (x *ShowRes) GetExpSelect() []string { + if x != nil { + return x.ExpSelect + } + return nil +} + +func (x *ShowRes) GetLangs() []*ShowRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +type SaveReq_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //展示标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //展示图片 + Rule string `protobuf:"bytes,4,opt,name=rule,proto3" json:"rule,omitempty"` //积分规则 + IsDefault int32 `protobuf:"varint,5,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认(0-否,1-是) +} + +func (x *SaveReq_Lang) Reset() { + *x = SaveReq_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_coin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveReq_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveReq_Lang) ProtoMessage() {} + +func (x *SaveReq_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_coin_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 SaveReq_Lang.ProtoReflect.Descriptor instead. +func (*SaveReq_Lang) Descriptor() ([]byte, []int) { + return file_w_coin_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *SaveReq_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *SaveReq_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SaveReq_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *SaveReq_Lang) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *SaveReq_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +type ShowRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LangMark string `protobuf:"bytes,1,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //展示标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //展示图片 + Rule string `protobuf:"bytes,4,opt,name=rule,proto3" json:"rule,omitempty"` //积分规则 + IsDefault int32 `protobuf:"varint,5,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认(0-否,1-是) +} + +func (x *ShowRes_Lang) Reset() { + *x = ShowRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_coin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Lang) ProtoMessage() {} + +func (x *ShowRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_coin_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 ShowRes_Lang.ProtoReflect.Descriptor instead. +func (*ShowRes_Lang) Descriptor() ([]byte, []int) { + return file_w_coin_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ShowRes_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ShowRes_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_Lang) GetRule() string { + if x != nil { + return x.Rule + } + return "" +} + +func (x *ShowRes_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +var File_w_coin_proto protoreflect.FileDescriptor + +var file_w_coin_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, + 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x70, 0x62, 0x22, 0xb9, 0x02, 0x0a, 0x07, 0x53, 0x61, 0x76, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, 0x73, 0x68, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x2c, + 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, + 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x1a, 0x85, 0x01, 0x0a, + 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, + 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x22, 0x09, 0x0a, 0x07, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x22, + 0x50, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x64, 0x22, 0x91, 0x02, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x75, 0x73, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x50, 0x75, 0x73, 0x68, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, + 0x2c, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x1a, 0x85, 0x01, + 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, + 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x32, 0x67, 0x0a, 0x05, 0x57, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x2e, + 0x0a, 0x04, 0x53, 0x61, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x77, 0x5f, 0x63, 0x6f, + 0x69, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x2e, + 0x0a, 0x04, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x11, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x70, + 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x77, 0x5f, 0x63, 0x6f, + 0x69, 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0d, + 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_coin_proto_rawDescOnce sync.Once + file_w_coin_proto_rawDescData = file_w_coin_proto_rawDesc +) + +func file_w_coin_proto_rawDescGZIP() []byte { + file_w_coin_proto_rawDescOnce.Do(func() { + file_w_coin_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_coin_proto_rawDescData) + }) + return file_w_coin_proto_rawDescData +} + +var file_w_coin_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_w_coin_proto_goTypes = []interface{}{ + (*SaveReq)(nil), // 0: w_coinpb.SaveReq + (*SaveRes)(nil), // 1: w_coinpb.SaveRes + (*ShowReq)(nil), // 2: w_coinpb.ShowReq + (*ShowRes)(nil), // 3: w_coinpb.ShowRes + (*SaveReq_Lang)(nil), // 4: w_coinpb.SaveReq.Lang + (*ShowRes_Lang)(nil), // 5: w_coinpb.ShowRes.Lang +} +var file_w_coin_proto_depIdxs = []int32{ + 4, // 0: w_coinpb.SaveReq.langs:type_name -> w_coinpb.SaveReq.Lang + 5, // 1: w_coinpb.ShowRes.langs:type_name -> w_coinpb.ShowRes.Lang + 0, // 2: w_coinpb.WCoin.Save:input_type -> w_coinpb.SaveReq + 2, // 3: w_coinpb.WCoin.Show:input_type -> w_coinpb.ShowReq + 1, // 4: w_coinpb.WCoin.Save:output_type -> w_coinpb.SaveRes + 3, // 5: w_coinpb.WCoin.Show:output_type -> w_coinpb.ShowRes + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_w_coin_proto_init() } +func file_w_coin_proto_init() { + if File_w_coin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_coin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_coin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_coin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_coin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_coin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveReq_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_coin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Lang); 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_w_coin_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_coin_proto_goTypes, + DependencyIndexes: file_w_coin_proto_depIdxs, + MessageInfos: file_w_coin_proto_msgTypes, + }.Build() + File_w_coin_proto = out.File + file_w_coin_proto_rawDesc = nil + file_w_coin_proto_goTypes = nil + file_w_coin_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_coin/w_coin.pb.micro.go b/proto/go_proto/w_coin/w_coin.pb.micro.go new file mode 100644 index 0000000..9f4ed6e --- /dev/null +++ b/proto/go_proto/w_coin/w_coin.pb.micro.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_coin.proto + +package w_coinpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WCoin service + +func NewWCoinEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WCoin service + +type WCoinService interface { + // Save 积分配置保存 + Save(ctx context.Context, in *SaveReq, opts ...client.CallOption) (*SaveRes, error) + // Show 积分配置展示 + Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) +} + +type wCoinService struct { + c client.Client + name string +} + +func NewWCoinService(name string, c client.Client) WCoinService { + return &wCoinService{ + c: c, + name: name, + } +} + +func (c *wCoinService) Save(ctx context.Context, in *SaveReq, opts ...client.CallOption) (*SaveRes, error) { + req := c.c.NewRequest(c.name, "WCoin.Save", in) + out := new(SaveRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCoinService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) { + req := c.c.NewRequest(c.name, "WCoin.Show", in) + out := new(ShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WCoin service + +type WCoinHandler interface { + // Save 积分配置保存 + Save(context.Context, *SaveReq, *SaveRes) error + // Show 积分配置展示 + Show(context.Context, *ShowReq, *ShowRes) error +} + +func RegisterWCoinHandler(s server.Server, hdlr WCoinHandler, opts ...server.HandlerOption) error { + type wCoin interface { + Save(ctx context.Context, in *SaveReq, out *SaveRes) error + Show(ctx context.Context, in *ShowReq, out *ShowRes) error + } + type WCoin struct { + wCoin + } + h := &wCoinHandler{hdlr} + return s.Handle(s.NewHandler(&WCoin{h}, opts...)) +} + +type wCoinHandler struct { + WCoinHandler +} + +func (h *wCoinHandler) Save(ctx context.Context, in *SaveReq, out *SaveRes) error { + return h.WCoinHandler.Save(ctx, in, out) +} + +func (h *wCoinHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error { + return h.WCoinHandler.Show(ctx, in, out) +} diff --git a/proto/go_proto/w_common/w_common.pb.go b/proto/go_proto/w_common/w_common.pb.go new file mode 100644 index 0000000..d4efb8c --- /dev/null +++ b/proto/go_proto/w_common/w_common.pb.go @@ -0,0 +1,2521 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_common.proto + +package w_commonpb + +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 PolicyTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FileSuffix string `protobuf:"bytes,1,opt,name=file_suffix,json=fileSuffix,proto3" json:"file_suffix,omitempty"` //文件后缀 +} + +func (x *PolicyTokenReq) Reset() { + *x = PolicyTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyTokenReq) ProtoMessage() {} + +func (x *PolicyTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 PolicyTokenReq.ProtoReflect.Descriptor instead. +func (*PolicyTokenReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{0} +} + +func (x *PolicyTokenReq) GetFileSuffix() string { + if x != nil { + return x.FileSuffix + } + return "" +} + +type PolicyTokenRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccessKeyId string `protobuf:"bytes,1,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` //oss accessKeyId + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` //oss访问域名 + UploadUrl string `protobuf:"bytes,3,opt,name=upload_url,json=uploadUrl,proto3" json:"upload_url,omitempty"` //上传地址 + Expire int64 `protobuf:"varint,4,opt,name=expire,proto3" json:"expire,omitempty"` //过期时间,单位(s) + Signature string `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` //验签字符串 + Dir string `protobuf:"bytes,6,opt,name=dir,proto3" json:"dir,omitempty"` //存储文件夹(文件前缀) + Key string `protobuf:"bytes,7,opt,name=key,proto3" json:"key,omitempty"` //文件名称 + Policy string `protobuf:"bytes,8,opt,name=policy,proto3" json:"policy,omitempty"` //验签token +} + +func (x *PolicyTokenRes) Reset() { + *x = PolicyTokenRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyTokenRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyTokenRes) ProtoMessage() {} + +func (x *PolicyTokenRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 PolicyTokenRes.ProtoReflect.Descriptor instead. +func (*PolicyTokenRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{1} +} + +func (x *PolicyTokenRes) GetAccessKeyId() string { + if x != nil { + return x.AccessKeyId + } + return "" +} + +func (x *PolicyTokenRes) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *PolicyTokenRes) GetUploadUrl() string { + if x != nil { + return x.UploadUrl + } + return "" +} + +func (x *PolicyTokenRes) GetExpire() int64 { + if x != nil { + return x.Expire + } + return 0 +} + +func (x *PolicyTokenRes) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +func (x *PolicyTokenRes) GetDir() string { + if x != nil { + return x.Dir + } + return "" +} + +func (x *PolicyTokenRes) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PolicyTokenRes) GetPolicy() string { + if x != nil { + return x.Policy + } + return "" +} + +type WhitelistReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WhitelistReq) Reset() { + *x = WhitelistReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WhitelistReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WhitelistReq) ProtoMessage() {} + +func (x *WhitelistReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 WhitelistReq.ProtoReflect.Descriptor instead. +func (*WhitelistReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{2} +} + +type WhitelistRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ips []string `protobuf:"bytes,1,rep,name=ips,proto3" json:"ips,omitempty"` //服务器列表 +} + +func (x *WhitelistRes) Reset() { + *x = WhitelistRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WhitelistRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WhitelistRes) ProtoMessage() {} + +func (x *WhitelistRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 WhitelistRes.ProtoReflect.Descriptor instead. +func (*WhitelistRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{3} +} + +func (x *WhitelistRes) GetIps() []string { + if x != nil { + return x.Ips + } + return nil +} + +type DownloadReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //下载人id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //campaign_report-活动报表,fission_user-活动用户,fission_reward_record-活动奖品,fission_user_stat-活动排行榜,ads_table-广告报表,new_user_list-新版用户列表 + CampaignReport *DownloadReq_CampaignReport `protobuf:"bytes,3,opt,name=campaign_report,json=campaignReport,proto3" json:"campaign_report,omitempty"` //活动报表条件 + FissionUser *DownloadReq_FissionUser `protobuf:"bytes,4,opt,name=fission_user,json=fissionUser,proto3" json:"fission_user,omitempty"` //活动用户条件 + FissionRewardRecord *DownloadReq_FissionRewardRecord `protobuf:"bytes,5,opt,name=fission_reward_record,json=fissionRewardRecord,proto3" json:"fission_reward_record,omitempty"` //活动奖品条件 + FissionUserStat *DownloadReq_FissionUserStat `protobuf:"bytes,6,opt,name=fission_user_stat,json=fissionUserStat,proto3" json:"fission_user_stat,omitempty"` //活动排行榜条件 + AdsTable *DownloadReq_AdsTable `protobuf:"bytes,7,opt,name=ads_table,json=adsTable,proto3" json:"ads_table,omitempty"` //广告报表条件 + NewUserList *DownloadReq_NewUserList `protobuf:"bytes,8,opt,name=new_user_list,json=newUserList,proto3" json:"new_user_list,omitempty"` //新版用户列表 + CoinRecord *DownloadReq_CoinRecord `protobuf:"bytes,9,opt,name=coin_record,json=coinRecord,proto3" json:"coin_record,omitempty"` //金币池领扣记录 + ChildList *DownloadReq_ChildList `protobuf:"bytes,10,opt,name=child_list,json=childList,proto3" json:"child_list,omitempty"` //子活动用户列表 +} + +func (x *DownloadReq) Reset() { + *x = DownloadReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq) ProtoMessage() {} + +func (x *DownloadReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq.ProtoReflect.Descriptor instead. +func (*DownloadReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4} +} + +func (x *DownloadReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *DownloadReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *DownloadReq) GetCampaignReport() *DownloadReq_CampaignReport { + if x != nil { + return x.CampaignReport + } + return nil +} + +func (x *DownloadReq) GetFissionUser() *DownloadReq_FissionUser { + if x != nil { + return x.FissionUser + } + return nil +} + +func (x *DownloadReq) GetFissionRewardRecord() *DownloadReq_FissionRewardRecord { + if x != nil { + return x.FissionRewardRecord + } + return nil +} + +func (x *DownloadReq) GetFissionUserStat() *DownloadReq_FissionUserStat { + if x != nil { + return x.FissionUserStat + } + return nil +} + +func (x *DownloadReq) GetAdsTable() *DownloadReq_AdsTable { + if x != nil { + return x.AdsTable + } + return nil +} + +func (x *DownloadReq) GetNewUserList() *DownloadReq_NewUserList { + if x != nil { + return x.NewUserList + } + return nil +} + +func (x *DownloadReq) GetCoinRecord() *DownloadReq_CoinRecord { + if x != nil { + return x.CoinRecord + } + return nil +} + +func (x *DownloadReq) GetChildList() *DownloadReq_ChildList { + if x != nil { + return x.ChildList + } + return nil +} + +type DownloadRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //报表id +} + +func (x *DownloadRes) Reset() { + *x = DownloadRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadRes) ProtoMessage() {} + +func (x *DownloadRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadRes.ProtoReflect.Descriptor instead. +func (*DownloadRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{5} +} + +func (x *DownloadRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DownloadStatusReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //报表id +} + +func (x *DownloadStatusReq) Reset() { + *x = DownloadStatusReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadStatusReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadStatusReq) ProtoMessage() {} + +func (x *DownloadStatusReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadStatusReq.ProtoReflect.Descriptor instead. +func (*DownloadStatusReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{6} +} + +func (x *DownloadStatusReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DownloadStatusRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(1-下载中,2-下载完成,3-下载失败,4-已过期) + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` //文件地址 + FailMsg string `protobuf:"bytes,3,opt,name=fail_msg,json=failMsg,proto3" json:"fail_msg,omitempty"` //失败原因 + Progress string `protobuf:"bytes,4,opt,name=progress,proto3" json:"progress,omitempty"` //导出进度 +} + +func (x *DownloadStatusRes) Reset() { + *x = DownloadStatusRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadStatusRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadStatusRes) ProtoMessage() {} + +func (x *DownloadStatusRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadStatusRes.ProtoReflect.Descriptor instead. +func (*DownloadStatusRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{7} +} + +func (x *DownloadStatusRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *DownloadStatusRes) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *DownloadStatusRes) GetFailMsg() string { + if x != nil { + return x.FailMsg + } + return "" +} + +func (x *DownloadStatusRes) GetProgress() string { + if x != nil { + return x.Progress + } + return "" +} + +type OperateLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` //客户端ip地址 + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //操作唯一标识,一种操作对应一个标识,长度不能超过32个字符串 + MarkId string `protobuf:"bytes,4,opt,name=mark_id,json=markId,proto3" json:"mark_id,omitempty"` //操作数据追踪类型id,如:修改某个活动奖品,那这个就是奖品id(其实这个字段为了优化mark索引的,所以不传也可以) + Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` //记录的数据 json格式字符串 +} + +func (x *OperateLogReq) Reset() { + *x = OperateLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperateLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperateLogReq) ProtoMessage() {} + +func (x *OperateLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 OperateLogReq.ProtoReflect.Descriptor instead. +func (*OperateLogReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{8} +} + +func (x *OperateLogReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *OperateLogReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *OperateLogReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *OperateLogReq) GetMarkId() string { + if x != nil { + return x.MarkId + } + return "" +} + +func (x *OperateLogReq) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +type OperateLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OperateLogRes) Reset() { + *x = OperateLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperateLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperateLogRes) ProtoMessage() {} + +func (x *OperateLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 OperateLogRes.ProtoReflect.Descriptor instead. +func (*OperateLogRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{9} +} + +type SaveMaterialReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + MaterialType int32 `protobuf:"varint,2,opt,name=material_type,json=materialType,proto3" json:"material_type,omitempty"` //素材类型(1-图片) + MaterialData string `protobuf:"bytes,3,opt,name=material_data,json=materialData,proto3" json:"material_data,omitempty"` //素材类型的数据(图片类型:地址图片) +} + +func (x *SaveMaterialReq) Reset() { + *x = SaveMaterialReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveMaterialReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveMaterialReq) ProtoMessage() {} + +func (x *SaveMaterialReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 SaveMaterialReq.ProtoReflect.Descriptor instead. +func (*SaveMaterialReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{10} +} + +func (x *SaveMaterialReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SaveMaterialReq) GetMaterialType() int32 { + if x != nil { + return x.MaterialType + } + return 0 +} + +func (x *SaveMaterialReq) GetMaterialData() string { + if x != nil { + return x.MaterialData + } + return "" +} + +type SaveMaterialRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //素材id +} + +func (x *SaveMaterialRes) Reset() { + *x = SaveMaterialRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveMaterialRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveMaterialRes) ProtoMessage() {} + +func (x *SaveMaterialRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 SaveMaterialRes.ProtoReflect.Descriptor instead. +func (*SaveMaterialRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{11} +} + +func (x *SaveMaterialRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type MaterialListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + MaterialType int32 `protobuf:"varint,3,opt,name=material_type,json=materialType,proto3" json:"material_type,omitempty"` //素材类型(1-图片) + ProjectId int64 `protobuf:"varint,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + ProjectHashId string `protobuf:"bytes,5,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *MaterialListReq) Reset() { + *x = MaterialListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MaterialListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterialListReq) ProtoMessage() {} + +func (x *MaterialListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 MaterialListReq.ProtoReflect.Descriptor instead. +func (*MaterialListReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{12} +} + +func (x *MaterialListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *MaterialListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *MaterialListReq) GetMaterialType() int32 { + if x != nil { + return x.MaterialType + } + return 0 +} + +func (x *MaterialListReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *MaterialListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type MaterialListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*MaterialListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //数据集合 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //数据总数 +} + +func (x *MaterialListRes) Reset() { + *x = MaterialListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MaterialListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterialListRes) ProtoMessage() {} + +func (x *MaterialListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 MaterialListRes.ProtoReflect.Descriptor instead. +func (*MaterialListRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{13} +} + +func (x *MaterialListRes) GetList() []*MaterialListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *MaterialListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type CompanyMadeReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业id +} + +func (x *CompanyMadeReq) Reset() { + *x = CompanyMadeReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompanyMadeReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompanyMadeReq) ProtoMessage() {} + +func (x *CompanyMadeReq) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 CompanyMadeReq.ProtoReflect.Descriptor instead. +func (*CompanyMadeReq) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{14} +} + +func (x *CompanyMadeReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +type CompanyMadeRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*CompanyMadeRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //数据集合 +} + +func (x *CompanyMadeRes) Reset() { + *x = CompanyMadeRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompanyMadeRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompanyMadeRes) ProtoMessage() {} + +func (x *CompanyMadeRes) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 CompanyMadeRes.ProtoReflect.Descriptor instead. +func (*CompanyMadeRes) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{15} +} + +func (x *CompanyMadeRes) GetList() []*CompanyMadeRes_One { + if x != nil { + return x.List + } + return nil +} + +type DownloadReq_CampaignReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //统计开始时间时间戳 + EndTime int64 `protobuf:"varint,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //统计结束时间时间戳 +} + +func (x *DownloadReq_CampaignReport) Reset() { + *x = DownloadReq_CampaignReport{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_CampaignReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_CampaignReport) ProtoMessage() {} + +func (x *DownloadReq_CampaignReport) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_CampaignReport.ProtoReflect.Descriptor instead. +func (*DownloadReq_CampaignReport) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *DownloadReq_CampaignReport) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_CampaignReport) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *DownloadReq_CampaignReport) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type DownloadReq_FissionUser struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + UserMark string `protobuf:"bytes,2,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + ParentUserMark string `protobuf:"bytes,5,opt,name=parent_user_mark,json=parentUserMark,proto3" json:"parent_user_mark,omitempty"` //上级用户标识关键字 + Source int32 `protobuf:"varint,6,opt,name=source,proto3" json:"source,omitempty"` //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) +} + +func (x *DownloadReq_FissionUser) Reset() { + *x = DownloadReq_FissionUser{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_FissionUser) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_FissionUser) ProtoMessage() {} + +func (x *DownloadReq_FissionUser) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_FissionUser.ProtoReflect.Descriptor instead. +func (*DownloadReq_FissionUser) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *DownloadReq_FissionUser) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_FissionUser) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *DownloadReq_FissionUser) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DownloadReq_FissionUser) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *DownloadReq_FissionUser) GetParentUserMark() string { + if x != nil { + return x.ParentUserMark + } + return "" +} + +func (x *DownloadReq_FissionUser) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +type DownloadReq_FissionRewardRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + UserMark string `protobuf:"bytes,2,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + Status []int32 `protobuf:"varint,5,rep,packed,name=status,proto3" json:"status,omitempty"` //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发放) + RewardTitle string `protobuf:"bytes,6,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品名称 + TOffset int32 `protobuf:"varint,7,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + IsChild int32 `protobuf:"varint,8,opt,name=is_child,json=isChild,proto3" json:"is_child,omitempty"` //是否子活动奖品 +} + +func (x *DownloadReq_FissionRewardRecord) Reset() { + *x = DownloadReq_FissionRewardRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_FissionRewardRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_FissionRewardRecord) ProtoMessage() {} + +func (x *DownloadReq_FissionRewardRecord) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_FissionRewardRecord.ProtoReflect.Descriptor instead. +func (*DownloadReq_FissionRewardRecord) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 2} +} + +func (x *DownloadReq_FissionRewardRecord) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_FissionRewardRecord) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *DownloadReq_FissionRewardRecord) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DownloadReq_FissionRewardRecord) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *DownloadReq_FissionRewardRecord) GetStatus() []int32 { + if x != nil { + return x.Status + } + return nil +} + +func (x *DownloadReq_FissionRewardRecord) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *DownloadReq_FissionRewardRecord) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *DownloadReq_FissionRewardRecord) GetIsChild() int32 { + if x != nil { + return x.IsChild + } + return 0 +} + +type DownloadReq_FissionUserStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` //数据类型(空-旧报表,invite-下载/注册排行榜,task-用户完成指定事件排行榜,grow-养成排行榜) +} + +func (x *DownloadReq_FissionUserStat) Reset() { + *x = DownloadReq_FissionUserStat{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_FissionUserStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_FissionUserStat) ProtoMessage() {} + +func (x *DownloadReq_FissionUserStat) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_FissionUserStat.ProtoReflect.Descriptor instead. +func (*DownloadReq_FissionUserStat) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 3} +} + +func (x *DownloadReq_FissionUserStat) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_FissionUserStat) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type DownloadReq_AdsTable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //统计开始时间时间戳 + EndTime int64 `protobuf:"varint,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //统计结束时间时间戳 +} + +func (x *DownloadReq_AdsTable) Reset() { + *x = DownloadReq_AdsTable{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_AdsTable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_AdsTable) ProtoMessage() {} + +func (x *DownloadReq_AdsTable) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_AdsTable.ProtoReflect.Descriptor instead. +func (*DownloadReq_AdsTable) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 4} +} + +func (x *DownloadReq_AdsTable) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_AdsTable) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *DownloadReq_AdsTable) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type DownloadReq_NewUserList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + UserMark string `protobuf:"bytes,2,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + ParentUserMark string `protobuf:"bytes,5,opt,name=parent_user_mark,json=parentUserMark,proto3" json:"parent_user_mark,omitempty"` //上级用户标识关键字 + Source int32 `protobuf:"varint,6,opt,name=source,proto3" json:"source,omitempty"` //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + LangMark string `protobuf:"bytes,7,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //上级用户标识关键字 + TOffset int32 `protobuf:"varint,8,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + PidType int32 `protobuf:"varint,9,opt,name=pid_type,json=pidType,proto3" json:"pid_type,omitempty"` //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + JoinType int32 `protobuf:"varint,10,opt,name=join_type,json=joinType,proto3" json:"join_type,omitempty"` //上级用户类型(1-进入过活动的用户,2-没有进入过活动的用户) + UserCond []int32 `protobuf:"varint,11,rep,packed,name=user_cond,json=userCond,proto3" json:"user_cond,omitempty"` //用户条件(1-有安装的用户,2-有注册的用户) +} + +func (x *DownloadReq_NewUserList) Reset() { + *x = DownloadReq_NewUserList{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_NewUserList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_NewUserList) ProtoMessage() {} + +func (x *DownloadReq_NewUserList) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_NewUserList.ProtoReflect.Descriptor instead. +func (*DownloadReq_NewUserList) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 5} +} + +func (x *DownloadReq_NewUserList) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_NewUserList) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *DownloadReq_NewUserList) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DownloadReq_NewUserList) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *DownloadReq_NewUserList) GetParentUserMark() string { + if x != nil { + return x.ParentUserMark + } + return "" +} + +func (x *DownloadReq_NewUserList) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *DownloadReq_NewUserList) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *DownloadReq_NewUserList) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *DownloadReq_NewUserList) GetPidType() int32 { + if x != nil { + return x.PidType + } + return 0 +} + +func (x *DownloadReq_NewUserList) GetJoinType() int32 { + if x != nil { + return x.JoinType + } + return 0 +} + +func (x *DownloadReq_NewUserList) GetUserCond() []int32 { + if x != nil { + return x.UserCond + } + return nil +} + +type DownloadReq_CoinRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //活动用户id + CampaignId int64 `protobuf:"varint,2,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + CampaignHashId string `protobuf:"bytes,3,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + SceneId int64 `protobuf:"varint,4,opt,name=scene_id,json=sceneId,proto3" json:"scene_id,omitempty"` //场次id + Type int32 `protobuf:"varint,5,opt,name=type,proto3" json:"type,omitempty"` //日志类型(1-消耗金币,2-获得金币) + Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"` //来源标识 + TOffset int32 `protobuf:"varint,7,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + Start int64 `protobuf:"varint,8,opt,name=start,proto3" json:"start,omitempty"` //创建时间开始时间戳 + End int64 `protobuf:"varint,9,opt,name=end,proto3" json:"end,omitempty"` //创建时间结束时间戳 + SubUserId string `protobuf:"bytes,10,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户id +} + +func (x *DownloadReq_CoinRecord) Reset() { + *x = DownloadReq_CoinRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_CoinRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_CoinRecord) ProtoMessage() {} + +func (x *DownloadReq_CoinRecord) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_CoinRecord.ProtoReflect.Descriptor instead. +func (*DownloadReq_CoinRecord) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 6} +} + +func (x *DownloadReq_CoinRecord) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_CoinRecord) GetSceneId() int64 { + if x != nil { + return x.SceneId + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *DownloadReq_CoinRecord) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *DownloadReq_CoinRecord) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +type DownloadReq_ChildList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + UserMark string `protobuf:"bytes,2,opt,name=user_mark,json=userMark,proto3" json:"user_mark,omitempty"` //用户标识关键字 + Start int64 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` //参与时间开始时间戳 + End int64 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` //参与时间结束时间戳 + ParentUserMark string `protobuf:"bytes,5,opt,name=parent_user_mark,json=parentUserMark,proto3" json:"parent_user_mark,omitempty"` //上级用户标识关键字 + TOffset int32 `protobuf:"varint,6,opt,name=t_offset,json=tOffset,proto3" json:"t_offset,omitempty"` //时区 + PidType int32 `protobuf:"varint,7,opt,name=pid_type,json=pidType,proto3" json:"pid_type,omitempty"` //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) +} + +func (x *DownloadReq_ChildList) Reset() { + *x = DownloadReq_ChildList{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DownloadReq_ChildList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DownloadReq_ChildList) ProtoMessage() {} + +func (x *DownloadReq_ChildList) ProtoReflect() protoreflect.Message { + mi := &file_w_common_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 DownloadReq_ChildList.ProtoReflect.Descriptor instead. +func (*DownloadReq_ChildList) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{4, 7} +} + +func (x *DownloadReq_ChildList) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *DownloadReq_ChildList) GetUserMark() string { + if x != nil { + return x.UserMark + } + return "" +} + +func (x *DownloadReq_ChildList) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DownloadReq_ChildList) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +func (x *DownloadReq_ChildList) GetParentUserMark() string { + if x != nil { + return x.ParentUserMark + } + return "" +} + +func (x *DownloadReq_ChildList) GetTOffset() int32 { + if x != nil { + return x.TOffset + } + return 0 +} + +func (x *DownloadReq_ChildList) GetPidType() int32 { + if x != nil { + return x.PidType + } + return 0 +} + +type MaterialListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //素材id + MaterialType int32 `protobuf:"varint,2,opt,name=material_type,json=materialType,proto3" json:"material_type,omitempty"` //素材id + MaterialData string `protobuf:"bytes,3,opt,name=material_data,json=materialData,proto3" json:"material_data,omitempty"` //素材数据 +} + +func (x *MaterialListRes_One) Reset() { + *x = MaterialListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MaterialListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MaterialListRes_One) ProtoMessage() {} + +func (x *MaterialListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_common_proto_msgTypes[24] + 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 MaterialListRes_One.ProtoReflect.Descriptor instead. +func (*MaterialListRes_One) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *MaterialListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *MaterialListRes_One) GetMaterialType() int32 { + if x != nil { + return x.MaterialType + } + return 0 +} + +func (x *MaterialListRes_One) GetMaterialData() string { + if x != nil { + return x.MaterialData + } + return "" +} + +type CompanyMadeRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //素材id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //标识(lv_api支持用户类型配置api) + FissionTemp []string `protobuf:"bytes,3,rep,name=fission_temp,json=fissionTemp,proto3" json:"fission_temp,omitempty"` //支持的模版 +} + +func (x *CompanyMadeRes_One) Reset() { + *x = CompanyMadeRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_common_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompanyMadeRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompanyMadeRes_One) ProtoMessage() {} + +func (x *CompanyMadeRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_common_proto_msgTypes[25] + 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 CompanyMadeRes_One.ProtoReflect.Descriptor instead. +func (*CompanyMadeRes_One) Descriptor() ([]byte, []int) { + return file_w_common_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *CompanyMadeRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CompanyMadeRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *CompanyMadeRes_One) GetFissionTemp() []string { + if x != nil { + return x.FissionTemp + } + return nil +} + +var File_w_common_proto protoreflect.FileDescriptor + +var file_w_common_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0a, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x22, 0x31, 0x0a, 0x0e, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1f, + 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x22, + 0xd9, 0x01, 0x0a, 0x0e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, + 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x64, 0x69, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x0e, 0x0a, 0x0c, 0x57, + 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x20, 0x0a, 0x0c, 0x57, + 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, + 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 0x73, 0x22, 0xd0, 0x11, + 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x4f, 0x0a, 0x0f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, + 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x0e, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x46, 0x0a, 0x0c, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, + 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, 0x46, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x5f, 0x0a, 0x15, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, 0x46, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x13, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x53, 0x0a, 0x11, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x52, 0x0f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x12, 0x3d, 0x0a, 0x09, 0x61, 0x64, 0x73, + 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, 0x41, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x08, + 0x61, 0x64, 0x73, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, 0x4e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x43, 0x0a, 0x0b, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x0a, 0x63, 0x6f, 0x69, 0x6e, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x40, 0x0a, 0x0a, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x65, 0x71, 0x2e, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x09, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x74, 0x0a, 0x0e, 0x43, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0xbe, + 0x01, 0x0a, 0x0b, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x28, + 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, + 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x28, 0x0a, + 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, + 0xf5, 0x01, 0x0a, 0x13, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x73, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x69, 0x73, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x1a, 0x4f, 0x0a, 0x0f, 0x46, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x6e, 0x0a, 0x08, 0x41, 0x64, 0x73, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0xcb, 0x02, 0x0a, 0x0b, 0x4e, 0x65, 0x77, + 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, + 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, + 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x69, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x64, 0x1a, 0x9a, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x69, 0x6e, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x63, 0x65, + 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x63, 0x65, + 0x6e, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x1a, 0xda, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, + 0x12, 0x28, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x5f, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x4f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x69, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x69, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x26, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x11, 0x44, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x74, 0x0a, 0x11, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, 0x73, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x4d, 0x73, 0x67, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x79, 0x0a, 0x0d, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, + 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x61, 0x72, + 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x0f, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0f, 0x53, 0x61, 0x76, + 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x22, 0x21, + 0x0a, 0x0f, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x22, 0xac, 0x01, 0x0a, 0x0f, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, + 0x50, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x22, 0xbd, 0x01, 0x0a, 0x0f, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, + 0x5f, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, + 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, + 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, + 0x22, 0x2f, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4d, 0x61, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, + 0x64, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4d, 0x61, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4d, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x4c, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x65, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x32, 0xce, 0x04, 0x0a, 0x07, 0x57, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x0b, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, + 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x57, + 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3e, + 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, + 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x50, + 0x0a, 0x0e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, + 0x1d, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x44, 0x0a, 0x0a, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x19, + 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0c, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x61, + 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, + 0x2e, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0c, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x1b, 0x2e, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x47, + 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4d, 0x61, 0x64, 0x65, 0x12, 0x1a, 0x2e, + 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x4d, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4d, 0x61, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_common_proto_rawDescOnce sync.Once + file_w_common_proto_rawDescData = file_w_common_proto_rawDesc +) + +func file_w_common_proto_rawDescGZIP() []byte { + file_w_common_proto_rawDescOnce.Do(func() { + file_w_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_common_proto_rawDescData) + }) + return file_w_common_proto_rawDescData +} + +var file_w_common_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_w_common_proto_goTypes = []interface{}{ + (*PolicyTokenReq)(nil), // 0: w_commonpb.PolicyTokenReq + (*PolicyTokenRes)(nil), // 1: w_commonpb.PolicyTokenRes + (*WhitelistReq)(nil), // 2: w_commonpb.WhitelistReq + (*WhitelistRes)(nil), // 3: w_commonpb.WhitelistRes + (*DownloadReq)(nil), // 4: w_commonpb.DownloadReq + (*DownloadRes)(nil), // 5: w_commonpb.DownloadRes + (*DownloadStatusReq)(nil), // 6: w_commonpb.DownloadStatusReq + (*DownloadStatusRes)(nil), // 7: w_commonpb.DownloadStatusRes + (*OperateLogReq)(nil), // 8: w_commonpb.OperateLogReq + (*OperateLogRes)(nil), // 9: w_commonpb.OperateLogRes + (*SaveMaterialReq)(nil), // 10: w_commonpb.SaveMaterialReq + (*SaveMaterialRes)(nil), // 11: w_commonpb.SaveMaterialRes + (*MaterialListReq)(nil), // 12: w_commonpb.MaterialListReq + (*MaterialListRes)(nil), // 13: w_commonpb.MaterialListRes + (*CompanyMadeReq)(nil), // 14: w_commonpb.CompanyMadeReq + (*CompanyMadeRes)(nil), // 15: w_commonpb.CompanyMadeRes + (*DownloadReq_CampaignReport)(nil), // 16: w_commonpb.DownloadReq.CampaignReport + (*DownloadReq_FissionUser)(nil), // 17: w_commonpb.DownloadReq.FissionUser + (*DownloadReq_FissionRewardRecord)(nil), // 18: w_commonpb.DownloadReq.FissionRewardRecord + (*DownloadReq_FissionUserStat)(nil), // 19: w_commonpb.DownloadReq.FissionUserStat + (*DownloadReq_AdsTable)(nil), // 20: w_commonpb.DownloadReq.AdsTable + (*DownloadReq_NewUserList)(nil), // 21: w_commonpb.DownloadReq.NewUserList + (*DownloadReq_CoinRecord)(nil), // 22: w_commonpb.DownloadReq.CoinRecord + (*DownloadReq_ChildList)(nil), // 23: w_commonpb.DownloadReq.ChildList + (*MaterialListRes_One)(nil), // 24: w_commonpb.MaterialListRes.One + (*CompanyMadeRes_One)(nil), // 25: w_commonpb.CompanyMadeRes.One +} +var file_w_common_proto_depIdxs = []int32{ + 16, // 0: w_commonpb.DownloadReq.campaign_report:type_name -> w_commonpb.DownloadReq.CampaignReport + 17, // 1: w_commonpb.DownloadReq.fission_user:type_name -> w_commonpb.DownloadReq.FissionUser + 18, // 2: w_commonpb.DownloadReq.fission_reward_record:type_name -> w_commonpb.DownloadReq.FissionRewardRecord + 19, // 3: w_commonpb.DownloadReq.fission_user_stat:type_name -> w_commonpb.DownloadReq.FissionUserStat + 20, // 4: w_commonpb.DownloadReq.ads_table:type_name -> w_commonpb.DownloadReq.AdsTable + 21, // 5: w_commonpb.DownloadReq.new_user_list:type_name -> w_commonpb.DownloadReq.NewUserList + 22, // 6: w_commonpb.DownloadReq.coin_record:type_name -> w_commonpb.DownloadReq.CoinRecord + 23, // 7: w_commonpb.DownloadReq.child_list:type_name -> w_commonpb.DownloadReq.ChildList + 24, // 8: w_commonpb.MaterialListRes.list:type_name -> w_commonpb.MaterialListRes.One + 25, // 9: w_commonpb.CompanyMadeRes.list:type_name -> w_commonpb.CompanyMadeRes.One + 0, // 10: w_commonpb.WCommon.PolicyToken:input_type -> w_commonpb.PolicyTokenReq + 2, // 11: w_commonpb.WCommon.Whitelist:input_type -> w_commonpb.WhitelistReq + 4, // 12: w_commonpb.WCommon.Download:input_type -> w_commonpb.DownloadReq + 6, // 13: w_commonpb.WCommon.DownloadStatus:input_type -> w_commonpb.DownloadStatusReq + 8, // 14: w_commonpb.WCommon.OperateLog:input_type -> w_commonpb.OperateLogReq + 10, // 15: w_commonpb.WCommon.SaveMaterial:input_type -> w_commonpb.SaveMaterialReq + 12, // 16: w_commonpb.WCommon.MaterialList:input_type -> w_commonpb.MaterialListReq + 14, // 17: w_commonpb.WCommon.CompanyMade:input_type -> w_commonpb.CompanyMadeReq + 1, // 18: w_commonpb.WCommon.PolicyToken:output_type -> w_commonpb.PolicyTokenRes + 3, // 19: w_commonpb.WCommon.Whitelist:output_type -> w_commonpb.WhitelistRes + 5, // 20: w_commonpb.WCommon.Download:output_type -> w_commonpb.DownloadRes + 7, // 21: w_commonpb.WCommon.DownloadStatus:output_type -> w_commonpb.DownloadStatusRes + 9, // 22: w_commonpb.WCommon.OperateLog:output_type -> w_commonpb.OperateLogRes + 11, // 23: w_commonpb.WCommon.SaveMaterial:output_type -> w_commonpb.SaveMaterialRes + 13, // 24: w_commonpb.WCommon.MaterialList:output_type -> w_commonpb.MaterialListRes + 15, // 25: w_commonpb.WCommon.CompanyMade:output_type -> w_commonpb.CompanyMadeRes + 18, // [18:26] is the sub-list for method output_type + 10, // [10:18] 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_w_common_proto_init() } +func file_w_common_proto_init() { + if File_w_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolicyTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolicyTokenRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WhitelistReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WhitelistRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadStatusReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadStatusRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperateLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperateLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveMaterialReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveMaterialRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MaterialListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MaterialListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompanyMadeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompanyMadeRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_CampaignReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_FissionUser); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_FissionRewardRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_FissionUserStat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_AdsTable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_NewUserList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_CoinRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DownloadReq_ChildList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MaterialListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_common_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompanyMadeRes_One); 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_w_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 26, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_common_proto_goTypes, + DependencyIndexes: file_w_common_proto_depIdxs, + MessageInfos: file_w_common_proto_msgTypes, + }.Build() + File_w_common_proto = out.File + file_w_common_proto_rawDesc = nil + file_w_common_proto_goTypes = nil + file_w_common_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_common/w_common.pb.micro.go b/proto/go_proto/w_common/w_common.pb.micro.go new file mode 100644 index 0000000..d7a39ad --- /dev/null +++ b/proto/go_proto/w_common/w_common.pb.micro.go @@ -0,0 +1,222 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_common.proto + +package w_commonpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WCommon service + +func NewWCommonEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WCommon service + +type WCommonService interface { + // PolicyToken 获取阿里云token + PolicyToken(ctx context.Context, in *PolicyTokenReq, opts ...client.CallOption) (*PolicyTokenRes, error) + // Whitelist 服务器白名单 + Whitelist(ctx context.Context, in *WhitelistReq, opts ...client.CallOption) (*WhitelistRes, error) + // Download 下载 + Download(ctx context.Context, in *DownloadReq, opts ...client.CallOption) (*DownloadRes, error) + // DownloadStatus 下载状态 + DownloadStatus(ctx context.Context, in *DownloadStatusReq, opts ...client.CallOption) (*DownloadStatusRes, error) + // OperateLog dashboard操作日志 + OperateLog(ctx context.Context, in *OperateLogReq, opts ...client.CallOption) (*OperateLogRes, error) + // SaveMaterial 保存素材 + SaveMaterial(ctx context.Context, in *SaveMaterialReq, opts ...client.CallOption) (*SaveMaterialRes, error) + // MaterialList 素材列表 + MaterialList(ctx context.Context, in *MaterialListReq, opts ...client.CallOption) (*MaterialListRes, error) + // CompanyMade 企业定制组件列表 + CompanyMade(ctx context.Context, in *CompanyMadeReq, opts ...client.CallOption) (*CompanyMadeRes, error) +} + +type wCommonService struct { + c client.Client + name string +} + +func NewWCommonService(name string, c client.Client) WCommonService { + return &wCommonService{ + c: c, + name: name, + } +} + +func (c *wCommonService) PolicyToken(ctx context.Context, in *PolicyTokenReq, opts ...client.CallOption) (*PolicyTokenRes, error) { + req := c.c.NewRequest(c.name, "WCommon.PolicyToken", in) + out := new(PolicyTokenRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) Whitelist(ctx context.Context, in *WhitelistReq, opts ...client.CallOption) (*WhitelistRes, error) { + req := c.c.NewRequest(c.name, "WCommon.Whitelist", in) + out := new(WhitelistRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) Download(ctx context.Context, in *DownloadReq, opts ...client.CallOption) (*DownloadRes, error) { + req := c.c.NewRequest(c.name, "WCommon.Download", in) + out := new(DownloadRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) DownloadStatus(ctx context.Context, in *DownloadStatusReq, opts ...client.CallOption) (*DownloadStatusRes, error) { + req := c.c.NewRequest(c.name, "WCommon.DownloadStatus", in) + out := new(DownloadStatusRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) OperateLog(ctx context.Context, in *OperateLogReq, opts ...client.CallOption) (*OperateLogRes, error) { + req := c.c.NewRequest(c.name, "WCommon.OperateLog", in) + out := new(OperateLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) SaveMaterial(ctx context.Context, in *SaveMaterialReq, opts ...client.CallOption) (*SaveMaterialRes, error) { + req := c.c.NewRequest(c.name, "WCommon.SaveMaterial", in) + out := new(SaveMaterialRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) MaterialList(ctx context.Context, in *MaterialListReq, opts ...client.CallOption) (*MaterialListRes, error) { + req := c.c.NewRequest(c.name, "WCommon.MaterialList", in) + out := new(MaterialListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wCommonService) CompanyMade(ctx context.Context, in *CompanyMadeReq, opts ...client.CallOption) (*CompanyMadeRes, error) { + req := c.c.NewRequest(c.name, "WCommon.CompanyMade", in) + out := new(CompanyMadeRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WCommon service + +type WCommonHandler interface { + // PolicyToken 获取阿里云token + PolicyToken(context.Context, *PolicyTokenReq, *PolicyTokenRes) error + // Whitelist 服务器白名单 + Whitelist(context.Context, *WhitelistReq, *WhitelistRes) error + // Download 下载 + Download(context.Context, *DownloadReq, *DownloadRes) error + // DownloadStatus 下载状态 + DownloadStatus(context.Context, *DownloadStatusReq, *DownloadStatusRes) error + // OperateLog dashboard操作日志 + OperateLog(context.Context, *OperateLogReq, *OperateLogRes) error + // SaveMaterial 保存素材 + SaveMaterial(context.Context, *SaveMaterialReq, *SaveMaterialRes) error + // MaterialList 素材列表 + MaterialList(context.Context, *MaterialListReq, *MaterialListRes) error + // CompanyMade 企业定制组件列表 + CompanyMade(context.Context, *CompanyMadeReq, *CompanyMadeRes) error +} + +func RegisterWCommonHandler(s server.Server, hdlr WCommonHandler, opts ...server.HandlerOption) error { + type wCommon interface { + PolicyToken(ctx context.Context, in *PolicyTokenReq, out *PolicyTokenRes) error + Whitelist(ctx context.Context, in *WhitelistReq, out *WhitelistRes) error + Download(ctx context.Context, in *DownloadReq, out *DownloadRes) error + DownloadStatus(ctx context.Context, in *DownloadStatusReq, out *DownloadStatusRes) error + OperateLog(ctx context.Context, in *OperateLogReq, out *OperateLogRes) error + SaveMaterial(ctx context.Context, in *SaveMaterialReq, out *SaveMaterialRes) error + MaterialList(ctx context.Context, in *MaterialListReq, out *MaterialListRes) error + CompanyMade(ctx context.Context, in *CompanyMadeReq, out *CompanyMadeRes) error + } + type WCommon struct { + wCommon + } + h := &wCommonHandler{hdlr} + return s.Handle(s.NewHandler(&WCommon{h}, opts...)) +} + +type wCommonHandler struct { + WCommonHandler +} + +func (h *wCommonHandler) PolicyToken(ctx context.Context, in *PolicyTokenReq, out *PolicyTokenRes) error { + return h.WCommonHandler.PolicyToken(ctx, in, out) +} + +func (h *wCommonHandler) Whitelist(ctx context.Context, in *WhitelistReq, out *WhitelistRes) error { + return h.WCommonHandler.Whitelist(ctx, in, out) +} + +func (h *wCommonHandler) Download(ctx context.Context, in *DownloadReq, out *DownloadRes) error { + return h.WCommonHandler.Download(ctx, in, out) +} + +func (h *wCommonHandler) DownloadStatus(ctx context.Context, in *DownloadStatusReq, out *DownloadStatusRes) error { + return h.WCommonHandler.DownloadStatus(ctx, in, out) +} + +func (h *wCommonHandler) OperateLog(ctx context.Context, in *OperateLogReq, out *OperateLogRes) error { + return h.WCommonHandler.OperateLog(ctx, in, out) +} + +func (h *wCommonHandler) SaveMaterial(ctx context.Context, in *SaveMaterialReq, out *SaveMaterialRes) error { + return h.WCommonHandler.SaveMaterial(ctx, in, out) +} + +func (h *wCommonHandler) MaterialList(ctx context.Context, in *MaterialListReq, out *MaterialListRes) error { + return h.WCommonHandler.MaterialList(ctx, in, out) +} + +func (h *wCommonHandler) CompanyMade(ctx context.Context, in *CompanyMadeReq, out *CompanyMadeRes) error { + return h.WCommonHandler.CompanyMade(ctx, in, out) +} diff --git a/proto/go_proto/w_fission/w_fission.pb.go b/proto/go_proto/w_fission/w_fission.pb.go new file mode 100644 index 0000000..991f486 --- /dev/null +++ b/proto/go_proto/w_fission/w_fission.pb.go @@ -0,0 +1,2871 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_fission.proto + +package w_fissionpb + +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 ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Lang string `protobuf:"bytes,1,opt,name=lang,proto3" json:"lang,omitempty"` //语言(zh-cn、en) + Target int32 `protobuf:"varint,2,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Targets []int32 `protobuf:"varint,3,rep,packed,name=targets,proto3" json:"targets,omitempty"` //活动目标集合 +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *ListReq) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *ListReq) GetTargets() []int32 { + if x != nil { + return x.Targets + } + return nil +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +type TemplateListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //玩法标识 + Target int32 `protobuf:"varint,2,opt,name=target,proto3" json:"target,omitempty"` //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) +} + +func (x *TemplateListReq) Reset() { + *x = TemplateListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateListReq) ProtoMessage() {} + +func (x *TemplateListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateListReq.ProtoReflect.Descriptor instead. +func (*TemplateListReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{2} +} + +func (x *TemplateListReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *TemplateListReq) GetTarget() int32 { + if x != nil { + return x.Target + } + return 0 +} + +type TemplateListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*TemplateListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *TemplateListRes) Reset() { + *x = TemplateListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateListRes) ProtoMessage() {} + +func (x *TemplateListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateListRes.ProtoReflect.Descriptor instead. +func (*TemplateListRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{3} +} + +func (x *TemplateListRes) GetList() []*TemplateListRes_One { + if x != nil { + return x.List + } + return nil +} + +type TemplateInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板对外ID + Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"` //国际语言标识(ISO 639-1代码) +} + +func (x *TemplateInfoReq) Reset() { + *x = TemplateInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateInfoReq) ProtoMessage() {} + +func (x *TemplateInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateInfoReq.ProtoReflect.Descriptor instead. +func (*TemplateInfoReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{4} +} + +func (x *TemplateInfoReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TemplateInfoReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *TemplateInfoReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +type TemplateInfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板对外ID + TempGroupMark string `protobuf:"bytes,3,opt,name=temp_group_mark,json=tempGroupMark,proto3" json:"temp_group_mark,omitempty"` //模版组标识 + LangType int32 `protobuf:"varint,4,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言(1-中文,2-英文) + TextType int32 `protobuf:"varint,5,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //文字模板(1-汉字模板,2-拉丁语系模板) + Image []*TemplateInfoRes_KV `protobuf:"bytes,6,rep,name=image,proto3" json:"image,omitempty"` //玩法图片数据 + Lang []*TemplateInfoRes_KV `protobuf:"bytes,7,rep,name=lang,proto3" json:"lang,omitempty"` //玩法语言包配置 + FixRewards []*TemplateInfoRes_FixReward `protobuf:"bytes,8,rep,name=fix_rewards,json=fixRewards,proto3" json:"fix_rewards,omitempty"` //玩法语言包配置 +} + +func (x *TemplateInfoRes) Reset() { + *x = TemplateInfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateInfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateInfoRes) ProtoMessage() {} + +func (x *TemplateInfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateInfoRes.ProtoReflect.Descriptor instead. +func (*TemplateInfoRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{5} +} + +func (x *TemplateInfoRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TemplateInfoRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *TemplateInfoRes) GetTempGroupMark() string { + if x != nil { + return x.TempGroupMark + } + return "" +} + +func (x *TemplateInfoRes) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *TemplateInfoRes) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *TemplateInfoRes) GetImage() []*TemplateInfoRes_KV { + if x != nil { + return x.Image + } + return nil +} + +func (x *TemplateInfoRes) GetLang() []*TemplateInfoRes_KV { + if x != nil { + return x.Lang + } + return nil +} + +func (x *TemplateInfoRes) GetFixRewards() []*TemplateInfoRes_FixReward { + if x != nil { + return x.FixRewards + } + return nil +} + +type CreateTempGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FissionId int64 `protobuf:"varint,1,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //模板组标识 + CoverUrl string `protobuf:"bytes,3,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //模版组封面 + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` //排序(越小越前) + LangParts string `protobuf:"bytes,5,opt,name=lang_parts,json=langParts,proto3" json:"lang_parts,omitempty"` //支持玩法组件翻译 + Lang []*CreateTempGroupReq_KV `protobuf:"bytes,6,rep,name=lang,proto3" json:"lang,omitempty"` //玩法语言数据 + LangType []int32 `protobuf:"varint,7,rep,packed,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //支持语言 + ConvertCoverUrl string `protobuf:"bytes,8,opt,name=convert_cover_url,json=convertCoverUrl,proto3" json:"convert_cover_url,omitempty"` //事件转化封面 +} + +func (x *CreateTempGroupReq) Reset() { + *x = CreateTempGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempGroupReq) ProtoMessage() {} + +func (x *CreateTempGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempGroupReq.ProtoReflect.Descriptor instead. +func (*CreateTempGroupReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateTempGroupReq) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *CreateTempGroupReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *CreateTempGroupReq) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *CreateTempGroupReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *CreateTempGroupReq) GetLangParts() string { + if x != nil { + return x.LangParts + } + return "" +} + +func (x *CreateTempGroupReq) GetLang() []*CreateTempGroupReq_KV { + if x != nil { + return x.Lang + } + return nil +} + +func (x *CreateTempGroupReq) GetLangType() []int32 { + if x != nil { + return x.LangType + } + return nil +} + +func (x *CreateTempGroupReq) GetConvertCoverUrl() string { + if x != nil { + return x.ConvertCoverUrl + } + return "" +} + +type CreateTempGroupRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板组id +} + +func (x *CreateTempGroupRes) Reset() { + *x = CreateTempGroupRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempGroupRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempGroupRes) ProtoMessage() {} + +func (x *CreateTempGroupRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempGroupRes.ProtoReflect.Descriptor instead. +func (*CreateTempGroupRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateTempGroupRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type UpdateTempGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板组id + CoverUrl string `protobuf:"bytes,2,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //模版组封面 + Sort int32 `protobuf:"varint,3,opt,name=sort,proto3" json:"sort,omitempty"` //排序(越小越前) + LangParts string `protobuf:"bytes,4,opt,name=lang_parts,json=langParts,proto3" json:"lang_parts,omitempty"` //支持玩法组件翻译 + Lang []*UpdateTempGroupReq_KV `protobuf:"bytes,5,rep,name=lang,proto3" json:"lang,omitempty"` //玩法语言数据 + LangType []int32 `protobuf:"varint,6,rep,packed,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //支持语言 + ConvertCoverUrl string `protobuf:"bytes,7,opt,name=convert_cover_url,json=convertCoverUrl,proto3" json:"convert_cover_url,omitempty"` //事件转化封面 +} + +func (x *UpdateTempGroupReq) Reset() { + *x = UpdateTempGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempGroupReq) ProtoMessage() {} + +func (x *UpdateTempGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 UpdateTempGroupReq.ProtoReflect.Descriptor instead. +func (*UpdateTempGroupReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateTempGroupReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateTempGroupReq) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *UpdateTempGroupReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *UpdateTempGroupReq) GetLangParts() string { + if x != nil { + return x.LangParts + } + return "" +} + +func (x *UpdateTempGroupReq) GetLang() []*UpdateTempGroupReq_KV { + if x != nil { + return x.Lang + } + return nil +} + +func (x *UpdateTempGroupReq) GetLangType() []int32 { + if x != nil { + return x.LangType + } + return nil +} + +func (x *UpdateTempGroupReq) GetConvertCoverUrl() string { + if x != nil { + return x.ConvertCoverUrl + } + return "" +} + +type UpdateTempGroupRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板组id +} + +func (x *UpdateTempGroupRes) Reset() { + *x = UpdateTempGroupRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempGroupRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempGroupRes) ProtoMessage() {} + +func (x *UpdateTempGroupRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 UpdateTempGroupRes.ProtoReflect.Descriptor instead. +func (*UpdateTempGroupRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateTempGroupRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type CreateTempReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId int64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` //玩法组id + LangType int32 `protobuf:"varint,2,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言(1-中文,2-英文) + TextType int32 `protobuf:"varint,3,opt,name=text_type,json=textType,proto3" json:"text_type,omitempty"` //文字模板(1-汉字模板,2-拉丁语系模板) + Image []*CreateTempReq_KV `protobuf:"bytes,4,rep,name=image,proto3" json:"image,omitempty"` //玩法图片数据 + Lang []*CreateTempReq_KV `protobuf:"bytes,5,rep,name=lang,proto3" json:"lang,omitempty"` //玩法语言包配置 +} + +func (x *CreateTempReq) Reset() { + *x = CreateTempReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempReq) ProtoMessage() {} + +func (x *CreateTempReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempReq.ProtoReflect.Descriptor instead. +func (*CreateTempReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{10} +} + +func (x *CreateTempReq) GetGroupId() int64 { + if x != nil { + return x.GroupId + } + return 0 +} + +func (x *CreateTempReq) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *CreateTempReq) GetTextType() int32 { + if x != nil { + return x.TextType + } + return 0 +} + +func (x *CreateTempReq) GetImage() []*CreateTempReq_KV { + if x != nil { + return x.Image + } + return nil +} + +func (x *CreateTempReq) GetLang() []*CreateTempReq_KV { + if x != nil { + return x.Lang + } + return nil +} + +type CreateTempRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板hash_id +} + +func (x *CreateTempRes) Reset() { + *x = CreateTempRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempRes) ProtoMessage() {} + +func (x *CreateTempRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempRes.ProtoReflect.Descriptor instead. +func (*CreateTempRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{11} +} + +func (x *CreateTempRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CreateTempRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type CreateTempImgReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板hash_id + Image []*CreateTempImgReq_KV `protobuf:"bytes,3,rep,name=image,proto3" json:"image,omitempty"` //玩法图片数据 +} + +func (x *CreateTempImgReq) Reset() { + *x = CreateTempImgReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempImgReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempImgReq) ProtoMessage() {} + +func (x *CreateTempImgReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempImgReq.ProtoReflect.Descriptor instead. +func (*CreateTempImgReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{12} +} + +func (x *CreateTempImgReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CreateTempImgReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CreateTempImgReq) GetImage() []*CreateTempImgReq_KV { + if x != nil { + return x.Image + } + return nil +} + +type CreateTempImgRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateTempImgRes) Reset() { + *x = CreateTempImgRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempImgRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempImgRes) ProtoMessage() {} + +func (x *CreateTempImgRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempImgRes.ProtoReflect.Descriptor instead. +func (*CreateTempImgRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{13} +} + +type CreateTempLangReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板hash_id + Lang []*CreateTempLangReq_KV `protobuf:"bytes,3,rep,name=lang,proto3" json:"lang,omitempty"` //玩法语言数据 +} + +func (x *CreateTempLangReq) Reset() { + *x = CreateTempLangReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempLangReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempLangReq) ProtoMessage() {} + +func (x *CreateTempLangReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempLangReq.ProtoReflect.Descriptor instead. +func (*CreateTempLangReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{14} +} + +func (x *CreateTempLangReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CreateTempLangReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CreateTempLangReq) GetLang() []*CreateTempLangReq_KV { + if x != nil { + return x.Lang + } + return nil +} + +type CreateTempLangRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateTempLangRes) Reset() { + *x = CreateTempLangRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempLangRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempLangRes) ProtoMessage() {} + +func (x *CreateTempLangRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 CreateTempLangRes.ProtoReflect.Descriptor instead. +func (*CreateTempLangRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{15} +} + +type UpdateTempImgReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板hash_id + Image []*UpdateTempImgReq_KV `protobuf:"bytes,3,rep,name=image,proto3" json:"image,omitempty"` //玩法图片数据 +} + +func (x *UpdateTempImgReq) Reset() { + *x = UpdateTempImgReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempImgReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempImgReq) ProtoMessage() {} + +func (x *UpdateTempImgReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 UpdateTempImgReq.ProtoReflect.Descriptor instead. +func (*UpdateTempImgReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{16} +} + +func (x *UpdateTempImgReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateTempImgReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateTempImgReq) GetImage() []*UpdateTempImgReq_KV { + if x != nil { + return x.Image + } + return nil +} + +type UpdateTempImgRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateTempImgRes) Reset() { + *x = UpdateTempImgRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempImgRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempImgRes) ProtoMessage() {} + +func (x *UpdateTempImgRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 UpdateTempImgRes.ProtoReflect.Descriptor instead. +func (*UpdateTempImgRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{17} +} + +type UpdateTempLangReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板hash_id + Lang []*UpdateTempLangReq_KV `protobuf:"bytes,3,rep,name=lang,proto3" json:"lang,omitempty"` //玩法语言数据 +} + +func (x *UpdateTempLangReq) Reset() { + *x = UpdateTempLangReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempLangReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempLangReq) ProtoMessage() {} + +func (x *UpdateTempLangReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 UpdateTempLangReq.ProtoReflect.Descriptor instead. +func (*UpdateTempLangReq) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{18} +} + +func (x *UpdateTempLangReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateTempLangReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateTempLangReq) GetLang() []*UpdateTempLangReq_KV { + if x != nil { + return x.Lang + } + return nil +} + +type UpdateTempLangRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateTempLangRes) Reset() { + *x = UpdateTempLangRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempLangRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempLangRes) ProtoMessage() {} + +func (x *UpdateTempLangRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 UpdateTempLangRes.ProtoReflect.Descriptor instead. +func (*UpdateTempLangRes) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{19} +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //玩法id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //标识 + Logo string `protobuf:"bytes,3,opt,name=logo,proto3" json:"logo,omitempty"` //玩法logo图 + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //玩法标题 + CanUse bool `protobuf:"varint,5,opt,name=can_use,json=canUse,proto3" json:"can_use,omitempty"` //是否可以用 + Desc []string `protobuf:"bytes,6,rep,name=desc,proto3" json:"desc,omitempty"` //玩法说明(例如:["说明1", "说明2"] + Color []string `protobuf:"bytes,7,rep,name=color,proto3" json:"color,omitempty"` //颜色值 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *ListRes_One) GetLogo() string { + if x != nil { + return x.Logo + } + return "" +} + +func (x *ListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_One) GetCanUse() bool { + if x != nil { + return x.CanUse + } + return false +} + +func (x *ListRes_One) GetDesc() []string { + if x != nil { + return x.Desc + } + return nil +} + +func (x *ListRes_One) GetColor() []string { + if x != nil { + return x.Color + } + return nil +} + +type TemplateListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //模板组ID + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //模板组唯一标识 + CoverUrl string `protobuf:"bytes,3,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //模板组封面 + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //模板组标题 + Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"` //排序(越小越前) + Temps []*TemplateListRes_Temp `protobuf:"bytes,6,rep,name=temps,proto3" json:"temps,omitempty"` //模版组模版 + IsPrivate int32 `protobuf:"varint,7,opt,name=is_private,json=isPrivate,proto3" json:"is_private,omitempty"` //是否私有模板(0-否,1-是) +} + +func (x *TemplateListRes_One) Reset() { + *x = TemplateListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateListRes_One) ProtoMessage() {} + +func (x *TemplateListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateListRes_One.ProtoReflect.Descriptor instead. +func (*TemplateListRes_One) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *TemplateListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TemplateListRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *TemplateListRes_One) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *TemplateListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TemplateListRes_One) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *TemplateListRes_One) GetTemps() []*TemplateListRes_Temp { + if x != nil { + return x.Temps + } + return nil +} + +func (x *TemplateListRes_One) GetIsPrivate() int32 { + if x != nil { + return x.IsPrivate + } + return 0 +} + +type TemplateListRes_Temp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //模板ID + LangType int32 `protobuf:"varint,2,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言(1-中文,2-英文) +} + +func (x *TemplateListRes_Temp) Reset() { + *x = TemplateListRes_Temp{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateListRes_Temp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateListRes_Temp) ProtoMessage() {} + +func (x *TemplateListRes_Temp) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateListRes_Temp.ProtoReflect.Descriptor instead. +func (*TemplateListRes_Temp) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *TemplateListRes_Temp) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *TemplateListRes_Temp) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +type TemplateInfoRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *TemplateInfoRes_KV) Reset() { + *x = TemplateInfoRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateInfoRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateInfoRes_KV) ProtoMessage() {} + +func (x *TemplateInfoRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_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 TemplateInfoRes_KV.ProtoReflect.Descriptor instead. +func (*TemplateInfoRes_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *TemplateInfoRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *TemplateInfoRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *TemplateInfoRes_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type TemplateInfoRes_FixReward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Langs []*TemplateInfoRes_Lang `protobuf:"bytes,2,rep,name=langs,proto3" json:"langs,omitempty"` //语言对应的数据 +} + +func (x *TemplateInfoRes_FixReward) Reset() { + *x = TemplateInfoRes_FixReward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateInfoRes_FixReward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateInfoRes_FixReward) ProtoMessage() {} + +func (x *TemplateInfoRes_FixReward) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[24] + 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 TemplateInfoRes_FixReward.ProtoReflect.Descriptor instead. +func (*TemplateInfoRes_FixReward) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *TemplateInfoRes_FixReward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TemplateInfoRes_FixReward) GetLangs() []*TemplateInfoRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +type TemplateInfoRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,2,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品名称 + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 +} + +func (x *TemplateInfoRes_Lang) Reset() { + *x = TemplateInfoRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TemplateInfoRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateInfoRes_Lang) ProtoMessage() {} + +func (x *TemplateInfoRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[25] + 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 TemplateInfoRes_Lang.ProtoReflect.Descriptor instead. +func (*TemplateInfoRes_Lang) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{5, 2} +} + +func (x *TemplateInfoRes_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *TemplateInfoRes_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *TemplateInfoRes_Lang) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type CreateTempGroupReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *CreateTempGroupReq_KV) Reset() { + *x = CreateTempGroupReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempGroupReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempGroupReq_KV) ProtoMessage() {} + +func (x *CreateTempGroupReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[26] + 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 CreateTempGroupReq_KV.ProtoReflect.Descriptor instead. +func (*CreateTempGroupReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *CreateTempGroupReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *CreateTempGroupReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *CreateTempGroupReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type UpdateTempGroupReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *UpdateTempGroupReq_KV) Reset() { + *x = UpdateTempGroupReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempGroupReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempGroupReq_KV) ProtoMessage() {} + +func (x *UpdateTempGroupReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[27] + 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 UpdateTempGroupReq_KV.ProtoReflect.Descriptor instead. +func (*UpdateTempGroupReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *UpdateTempGroupReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateTempGroupReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *UpdateTempGroupReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type CreateTempReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *CreateTempReq_KV) Reset() { + *x = CreateTempReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempReq_KV) ProtoMessage() {} + +func (x *CreateTempReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[28] + 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 CreateTempReq_KV.ProtoReflect.Descriptor instead. +func (*CreateTempReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *CreateTempReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *CreateTempReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *CreateTempReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type CreateTempImgReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *CreateTempImgReq_KV) Reset() { + *x = CreateTempImgReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempImgReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempImgReq_KV) ProtoMessage() {} + +func (x *CreateTempImgReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[29] + 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 CreateTempImgReq_KV.ProtoReflect.Descriptor instead. +func (*CreateTempImgReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *CreateTempImgReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *CreateTempImgReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *CreateTempImgReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type CreateTempLangReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *CreateTempLangReq_KV) Reset() { + *x = CreateTempLangReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTempLangReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTempLangReq_KV) ProtoMessage() {} + +func (x *CreateTempLangReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[30] + 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 CreateTempLangReq_KV.ProtoReflect.Descriptor instead. +func (*CreateTempLangReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *CreateTempLangReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *CreateTempLangReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *CreateTempLangReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type UpdateTempImgReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *UpdateTempImgReq_KV) Reset() { + *x = UpdateTempImgReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempImgReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempImgReq_KV) ProtoMessage() {} + +func (x *UpdateTempImgReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[31] + 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 UpdateTempImgReq_KV.ProtoReflect.Descriptor instead. +func (*UpdateTempImgReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *UpdateTempImgReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateTempImgReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *UpdateTempImgReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type UpdateTempLangReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键名称 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //键对应的值 + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` //键描述 +} + +func (x *UpdateTempLangReq_KV) Reset() { + *x = UpdateTempLangReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateTempLangReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateTempLangReq_KV) ProtoMessage() {} + +func (x *UpdateTempLangReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_proto_msgTypes[32] + 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 UpdateTempLangReq_KV.ProtoReflect.Descriptor instead. +func (*UpdateTempLangReq_KV) Descriptor() ([]byte, []int) { + return file_w_fission_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *UpdateTempLangReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateTempLangReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *UpdateTempLangReq_KV) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +var File_w_fission_proto protoreflect.FileDescriptor + +var file_w_fission_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x22, 0x4f, + 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, + 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x16, 0x0a, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x22, + 0xd0, 0x01, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x66, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x96, 0x01, 0x0a, 0x03, 0x4f, 0x6e, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x63, 0x61, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x63, 0x61, 0x6e, 0x55, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, + 0x6f, 0x72, 0x22, 0x3d, 0x0a, 0x0f, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x22, 0xd0, 0x02, 0x0a, 0x0f, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, + 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xc8, 0x01, 0x0a, 0x03, + 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, + 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x37, + 0x0a, 0x05, 0x74, 0x65, 0x6d, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, + 0x52, 0x05, 0x74, 0x65, 0x6d, 0x70, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x1a, 0x3c, 0x0a, 0x04, 0x54, 0x65, 0x6d, 0x70, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x54, 0x79, 0x70, 0x65, 0x22, 0x4e, 0x0a, 0x0f, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6c, 0x61, 0x6e, 0x67, 0x22, 0xbd, 0x04, 0x0a, 0x0f, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, + 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, + 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x2e, 0x4b, 0x56, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x6c, 0x61, + 0x6e, 0x67, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, + 0x47, 0x0a, 0x0b, 0x66, 0x69, 0x78, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x0a, 0x66, 0x69, + 0x78, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x1a, 0x54, 0x0a, 0x09, 0x46, 0x69, + 0x78, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, + 0x1a, 0x52, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x4d, 0x61, 0x72, 0x6b, 0x22, 0xda, 0x02, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1b, + 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x73, 0x12, 0x36, + 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, + 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, + 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x1a, + 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, + 0x63, 0x22, 0x24, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xb7, 0x02, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x73, 0x12, 0x36, + 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x77, + 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, + 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x5f, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x1a, + 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, + 0x63, 0x22, 0x24, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8e, 0x02, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x65, 0x78, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x33, + 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x05, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, + 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x1a, 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x22, 0x38, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x22, 0xb5, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x36, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x4b, + 0x56, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x1a, 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x73, 0x22, 0xb5, + 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x35, 0x0a, + 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x04, + 0x6c, 0x61, 0x6e, 0x67, 0x1a, 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x22, 0xb5, 0x01, 0x0a, 0x10, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x1a, 0x40, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x73, 0x22, 0xb5, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x1a, 0x40, 0x0a, + 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x22, + 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x32, 0x9c, 0x06, 0x0a, 0x08, 0x57, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x34, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x77, 0x5f, 0x66, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x14, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0c, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, + 0x62, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0f, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1f, 0x2e, + 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1f, + 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x46, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x12, + 0x1a, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, + 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x77, + 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, + 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, + 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x12, + 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, + 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x49, 0x6d, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x52, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, + 0x67, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_fission_proto_rawDescOnce sync.Once + file_w_fission_proto_rawDescData = file_w_fission_proto_rawDesc +) + +func file_w_fission_proto_rawDescGZIP() []byte { + file_w_fission_proto_rawDescOnce.Do(func() { + file_w_fission_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_fission_proto_rawDescData) + }) + return file_w_fission_proto_rawDescData +} + +var file_w_fission_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_w_fission_proto_goTypes = []interface{}{ + (*ListReq)(nil), // 0: w_fissionpb.ListReq + (*ListRes)(nil), // 1: w_fissionpb.ListRes + (*TemplateListReq)(nil), // 2: w_fissionpb.TemplateListReq + (*TemplateListRes)(nil), // 3: w_fissionpb.TemplateListRes + (*TemplateInfoReq)(nil), // 4: w_fissionpb.TemplateInfoReq + (*TemplateInfoRes)(nil), // 5: w_fissionpb.TemplateInfoRes + (*CreateTempGroupReq)(nil), // 6: w_fissionpb.CreateTempGroupReq + (*CreateTempGroupRes)(nil), // 7: w_fissionpb.CreateTempGroupRes + (*UpdateTempGroupReq)(nil), // 8: w_fissionpb.UpdateTempGroupReq + (*UpdateTempGroupRes)(nil), // 9: w_fissionpb.UpdateTempGroupRes + (*CreateTempReq)(nil), // 10: w_fissionpb.CreateTempReq + (*CreateTempRes)(nil), // 11: w_fissionpb.CreateTempRes + (*CreateTempImgReq)(nil), // 12: w_fissionpb.CreateTempImgReq + (*CreateTempImgRes)(nil), // 13: w_fissionpb.CreateTempImgRes + (*CreateTempLangReq)(nil), // 14: w_fissionpb.CreateTempLangReq + (*CreateTempLangRes)(nil), // 15: w_fissionpb.CreateTempLangRes + (*UpdateTempImgReq)(nil), // 16: w_fissionpb.UpdateTempImgReq + (*UpdateTempImgRes)(nil), // 17: w_fissionpb.UpdateTempImgRes + (*UpdateTempLangReq)(nil), // 18: w_fissionpb.UpdateTempLangReq + (*UpdateTempLangRes)(nil), // 19: w_fissionpb.UpdateTempLangRes + (*ListRes_One)(nil), // 20: w_fissionpb.ListRes.One + (*TemplateListRes_One)(nil), // 21: w_fissionpb.TemplateListRes.One + (*TemplateListRes_Temp)(nil), // 22: w_fissionpb.TemplateListRes.Temp + (*TemplateInfoRes_KV)(nil), // 23: w_fissionpb.TemplateInfoRes.KV + (*TemplateInfoRes_FixReward)(nil), // 24: w_fissionpb.TemplateInfoRes.FixReward + (*TemplateInfoRes_Lang)(nil), // 25: w_fissionpb.TemplateInfoRes.Lang + (*CreateTempGroupReq_KV)(nil), // 26: w_fissionpb.CreateTempGroupReq.KV + (*UpdateTempGroupReq_KV)(nil), // 27: w_fissionpb.UpdateTempGroupReq.KV + (*CreateTempReq_KV)(nil), // 28: w_fissionpb.CreateTempReq.KV + (*CreateTempImgReq_KV)(nil), // 29: w_fissionpb.CreateTempImgReq.KV + (*CreateTempLangReq_KV)(nil), // 30: w_fissionpb.CreateTempLangReq.KV + (*UpdateTempImgReq_KV)(nil), // 31: w_fissionpb.UpdateTempImgReq.KV + (*UpdateTempLangReq_KV)(nil), // 32: w_fissionpb.UpdateTempLangReq.KV +} +var file_w_fission_proto_depIdxs = []int32{ + 20, // 0: w_fissionpb.ListRes.list:type_name -> w_fissionpb.ListRes.One + 21, // 1: w_fissionpb.TemplateListRes.list:type_name -> w_fissionpb.TemplateListRes.One + 23, // 2: w_fissionpb.TemplateInfoRes.image:type_name -> w_fissionpb.TemplateInfoRes.KV + 23, // 3: w_fissionpb.TemplateInfoRes.lang:type_name -> w_fissionpb.TemplateInfoRes.KV + 24, // 4: w_fissionpb.TemplateInfoRes.fix_rewards:type_name -> w_fissionpb.TemplateInfoRes.FixReward + 26, // 5: w_fissionpb.CreateTempGroupReq.lang:type_name -> w_fissionpb.CreateTempGroupReq.KV + 27, // 6: w_fissionpb.UpdateTempGroupReq.lang:type_name -> w_fissionpb.UpdateTempGroupReq.KV + 28, // 7: w_fissionpb.CreateTempReq.image:type_name -> w_fissionpb.CreateTempReq.KV + 28, // 8: w_fissionpb.CreateTempReq.lang:type_name -> w_fissionpb.CreateTempReq.KV + 29, // 9: w_fissionpb.CreateTempImgReq.image:type_name -> w_fissionpb.CreateTempImgReq.KV + 30, // 10: w_fissionpb.CreateTempLangReq.lang:type_name -> w_fissionpb.CreateTempLangReq.KV + 31, // 11: w_fissionpb.UpdateTempImgReq.image:type_name -> w_fissionpb.UpdateTempImgReq.KV + 32, // 12: w_fissionpb.UpdateTempLangReq.lang:type_name -> w_fissionpb.UpdateTempLangReq.KV + 22, // 13: w_fissionpb.TemplateListRes.One.temps:type_name -> w_fissionpb.TemplateListRes.Temp + 25, // 14: w_fissionpb.TemplateInfoRes.FixReward.langs:type_name -> w_fissionpb.TemplateInfoRes.Lang + 0, // 15: w_fissionpb.WFission.List:input_type -> w_fissionpb.ListReq + 2, // 16: w_fissionpb.WFission.TemplateList:input_type -> w_fissionpb.TemplateListReq + 4, // 17: w_fissionpb.WFission.TemplateInfo:input_type -> w_fissionpb.TemplateInfoReq + 6, // 18: w_fissionpb.WFission.CreateTempGroup:input_type -> w_fissionpb.CreateTempGroupReq + 8, // 19: w_fissionpb.WFission.UpdateTempGroup:input_type -> w_fissionpb.UpdateTempGroupReq + 10, // 20: w_fissionpb.WFission.CreateTemp:input_type -> w_fissionpb.CreateTempReq + 12, // 21: w_fissionpb.WFission.CreateTempImg:input_type -> w_fissionpb.CreateTempImgReq + 14, // 22: w_fissionpb.WFission.CreateTempLang:input_type -> w_fissionpb.CreateTempLangReq + 16, // 23: w_fissionpb.WFission.UpdateTempImg:input_type -> w_fissionpb.UpdateTempImgReq + 18, // 24: w_fissionpb.WFission.UpdateTempLang:input_type -> w_fissionpb.UpdateTempLangReq + 1, // 25: w_fissionpb.WFission.List:output_type -> w_fissionpb.ListRes + 3, // 26: w_fissionpb.WFission.TemplateList:output_type -> w_fissionpb.TemplateListRes + 5, // 27: w_fissionpb.WFission.TemplateInfo:output_type -> w_fissionpb.TemplateInfoRes + 7, // 28: w_fissionpb.WFission.CreateTempGroup:output_type -> w_fissionpb.CreateTempGroupRes + 9, // 29: w_fissionpb.WFission.UpdateTempGroup:output_type -> w_fissionpb.UpdateTempGroupRes + 11, // 30: w_fissionpb.WFission.CreateTemp:output_type -> w_fissionpb.CreateTempRes + 13, // 31: w_fissionpb.WFission.CreateTempImg:output_type -> w_fissionpb.CreateTempImgRes + 15, // 32: w_fissionpb.WFission.CreateTempLang:output_type -> w_fissionpb.CreateTempLangRes + 17, // 33: w_fissionpb.WFission.UpdateTempImg:output_type -> w_fissionpb.UpdateTempImgRes + 19, // 34: w_fissionpb.WFission.UpdateTempLang:output_type -> w_fissionpb.UpdateTempLangRes + 25, // [25:35] is the sub-list for method output_type + 15, // [15:25] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_w_fission_proto_init() } +func file_w_fission_proto_init() { + if File_w_fission_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_fission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateInfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempGroupRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempGroupRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempImgReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempImgRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempLangReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempLangRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempImgReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempImgRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempLangReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempLangRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateListRes_Temp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateInfoRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateInfoRes_FixReward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TemplateInfoRes_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempGroupReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempGroupReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempImgReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTempLangReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempImgReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateTempLangReq_KV); 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_w_fission_proto_rawDesc, + NumEnums: 0, + NumMessages: 33, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_fission_proto_goTypes, + DependencyIndexes: file_w_fission_proto_depIdxs, + MessageInfos: file_w_fission_proto_msgTypes, + }.Build() + File_w_fission_proto = out.File + file_w_fission_proto_rawDesc = nil + file_w_fission_proto_goTypes = nil + file_w_fission_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_fission/w_fission.pb.micro.go b/proto/go_proto/w_fission/w_fission.pb.micro.go new file mode 100644 index 0000000..225def6 --- /dev/null +++ b/proto/go_proto/w_fission/w_fission.pb.micro.go @@ -0,0 +1,260 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_fission.proto + +package w_fissionpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WFission service + +func NewWFissionEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WFission service + +type WFissionService interface { + // List 玩法列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // TemplateList 玩法模版列表 + TemplateList(ctx context.Context, in *TemplateListReq, opts ...client.CallOption) (*TemplateListRes, error) + // TemplateInfo 玩法模版信息 + TemplateInfo(ctx context.Context, in *TemplateInfoReq, opts ...client.CallOption) (*TemplateInfoRes, error) + // CreateTempGroup 创建模板组 + CreateTempGroup(ctx context.Context, in *CreateTempGroupReq, opts ...client.CallOption) (*CreateTempGroupRes, error) + // UpdateTempGroup 更新模板组 + UpdateTempGroup(ctx context.Context, in *UpdateTempGroupReq, opts ...client.CallOption) (*UpdateTempGroupRes, error) + // CreateTemp 创建玩法模版 + CreateTemp(ctx context.Context, in *CreateTempReq, opts ...client.CallOption) (*CreateTempRes, error) + // CreateTempImg 创建玩法图片配置 + CreateTempImg(ctx context.Context, in *CreateTempImgReq, opts ...client.CallOption) (*CreateTempImgRes, error) + // CreateTempLang 创建玩法语言配置 + CreateTempLang(ctx context.Context, in *CreateTempLangReq, opts ...client.CallOption) (*CreateTempLangRes, error) + // UpdateTempImg 更新玩法图片配置 + UpdateTempImg(ctx context.Context, in *UpdateTempImgReq, opts ...client.CallOption) (*UpdateTempImgRes, error) + // UpdateTempLang 更新玩法语言配置 + UpdateTempLang(ctx context.Context, in *UpdateTempLangReq, opts ...client.CallOption) (*UpdateTempLangRes, error) +} + +type wFissionService struct { + c client.Client + name string +} + +func NewWFissionService(name string, c client.Client) WFissionService { + return &wFissionService{ + c: c, + name: name, + } +} + +func (c *wFissionService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WFission.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) TemplateList(ctx context.Context, in *TemplateListReq, opts ...client.CallOption) (*TemplateListRes, error) { + req := c.c.NewRequest(c.name, "WFission.TemplateList", in) + out := new(TemplateListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) TemplateInfo(ctx context.Context, in *TemplateInfoReq, opts ...client.CallOption) (*TemplateInfoRes, error) { + req := c.c.NewRequest(c.name, "WFission.TemplateInfo", in) + out := new(TemplateInfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) CreateTempGroup(ctx context.Context, in *CreateTempGroupReq, opts ...client.CallOption) (*CreateTempGroupRes, error) { + req := c.c.NewRequest(c.name, "WFission.CreateTempGroup", in) + out := new(CreateTempGroupRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) UpdateTempGroup(ctx context.Context, in *UpdateTempGroupReq, opts ...client.CallOption) (*UpdateTempGroupRes, error) { + req := c.c.NewRequest(c.name, "WFission.UpdateTempGroup", in) + out := new(UpdateTempGroupRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) CreateTemp(ctx context.Context, in *CreateTempReq, opts ...client.CallOption) (*CreateTempRes, error) { + req := c.c.NewRequest(c.name, "WFission.CreateTemp", in) + out := new(CreateTempRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) CreateTempImg(ctx context.Context, in *CreateTempImgReq, opts ...client.CallOption) (*CreateTempImgRes, error) { + req := c.c.NewRequest(c.name, "WFission.CreateTempImg", in) + out := new(CreateTempImgRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) CreateTempLang(ctx context.Context, in *CreateTempLangReq, opts ...client.CallOption) (*CreateTempLangRes, error) { + req := c.c.NewRequest(c.name, "WFission.CreateTempLang", in) + out := new(CreateTempLangRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) UpdateTempImg(ctx context.Context, in *UpdateTempImgReq, opts ...client.CallOption) (*UpdateTempImgRes, error) { + req := c.c.NewRequest(c.name, "WFission.UpdateTempImg", in) + out := new(UpdateTempImgRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionService) UpdateTempLang(ctx context.Context, in *UpdateTempLangReq, opts ...client.CallOption) (*UpdateTempLangRes, error) { + req := c.c.NewRequest(c.name, "WFission.UpdateTempLang", in) + out := new(UpdateTempLangRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WFission service + +type WFissionHandler interface { + // List 玩法列表 + List(context.Context, *ListReq, *ListRes) error + // TemplateList 玩法模版列表 + TemplateList(context.Context, *TemplateListReq, *TemplateListRes) error + // TemplateInfo 玩法模版信息 + TemplateInfo(context.Context, *TemplateInfoReq, *TemplateInfoRes) error + // CreateTempGroup 创建模板组 + CreateTempGroup(context.Context, *CreateTempGroupReq, *CreateTempGroupRes) error + // UpdateTempGroup 更新模板组 + UpdateTempGroup(context.Context, *UpdateTempGroupReq, *UpdateTempGroupRes) error + // CreateTemp 创建玩法模版 + CreateTemp(context.Context, *CreateTempReq, *CreateTempRes) error + // CreateTempImg 创建玩法图片配置 + CreateTempImg(context.Context, *CreateTempImgReq, *CreateTempImgRes) error + // CreateTempLang 创建玩法语言配置 + CreateTempLang(context.Context, *CreateTempLangReq, *CreateTempLangRes) error + // UpdateTempImg 更新玩法图片配置 + UpdateTempImg(context.Context, *UpdateTempImgReq, *UpdateTempImgRes) error + // UpdateTempLang 更新玩法语言配置 + UpdateTempLang(context.Context, *UpdateTempLangReq, *UpdateTempLangRes) error +} + +func RegisterWFissionHandler(s server.Server, hdlr WFissionHandler, opts ...server.HandlerOption) error { + type wFission interface { + List(ctx context.Context, in *ListReq, out *ListRes) error + TemplateList(ctx context.Context, in *TemplateListReq, out *TemplateListRes) error + TemplateInfo(ctx context.Context, in *TemplateInfoReq, out *TemplateInfoRes) error + CreateTempGroup(ctx context.Context, in *CreateTempGroupReq, out *CreateTempGroupRes) error + UpdateTempGroup(ctx context.Context, in *UpdateTempGroupReq, out *UpdateTempGroupRes) error + CreateTemp(ctx context.Context, in *CreateTempReq, out *CreateTempRes) error + CreateTempImg(ctx context.Context, in *CreateTempImgReq, out *CreateTempImgRes) error + CreateTempLang(ctx context.Context, in *CreateTempLangReq, out *CreateTempLangRes) error + UpdateTempImg(ctx context.Context, in *UpdateTempImgReq, out *UpdateTempImgRes) error + UpdateTempLang(ctx context.Context, in *UpdateTempLangReq, out *UpdateTempLangRes) error + } + type WFission struct { + wFission + } + h := &wFissionHandler{hdlr} + return s.Handle(s.NewHandler(&WFission{h}, opts...)) +} + +type wFissionHandler struct { + WFissionHandler +} + +func (h *wFissionHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WFissionHandler.List(ctx, in, out) +} + +func (h *wFissionHandler) TemplateList(ctx context.Context, in *TemplateListReq, out *TemplateListRes) error { + return h.WFissionHandler.TemplateList(ctx, in, out) +} + +func (h *wFissionHandler) TemplateInfo(ctx context.Context, in *TemplateInfoReq, out *TemplateInfoRes) error { + return h.WFissionHandler.TemplateInfo(ctx, in, out) +} + +func (h *wFissionHandler) CreateTempGroup(ctx context.Context, in *CreateTempGroupReq, out *CreateTempGroupRes) error { + return h.WFissionHandler.CreateTempGroup(ctx, in, out) +} + +func (h *wFissionHandler) UpdateTempGroup(ctx context.Context, in *UpdateTempGroupReq, out *UpdateTempGroupRes) error { + return h.WFissionHandler.UpdateTempGroup(ctx, in, out) +} + +func (h *wFissionHandler) CreateTemp(ctx context.Context, in *CreateTempReq, out *CreateTempRes) error { + return h.WFissionHandler.CreateTemp(ctx, in, out) +} + +func (h *wFissionHandler) CreateTempImg(ctx context.Context, in *CreateTempImgReq, out *CreateTempImgRes) error { + return h.WFissionHandler.CreateTempImg(ctx, in, out) +} + +func (h *wFissionHandler) CreateTempLang(ctx context.Context, in *CreateTempLangReq, out *CreateTempLangRes) error { + return h.WFissionHandler.CreateTempLang(ctx, in, out) +} + +func (h *wFissionHandler) UpdateTempImg(ctx context.Context, in *UpdateTempImgReq, out *UpdateTempImgRes) error { + return h.WFissionHandler.UpdateTempImg(ctx, in, out) +} + +func (h *wFissionHandler) UpdateTempLang(ctx context.Context, in *UpdateTempLangReq, out *UpdateTempLangRes) error { + return h.WFissionHandler.UpdateTempLang(ctx, in, out) +} diff --git a/proto/go_proto/w_fission_web/w_fission_web.pb.go b/proto/go_proto/w_fission_web/w_fission_web.pb.go new file mode 100644 index 0000000..3bc1d88 --- /dev/null +++ b/proto/go_proto/w_fission_web/w_fission_web.pb.go @@ -0,0 +1,1339 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_fission_web.proto + +package w_fission_webpb + +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 GetWebRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动hash_id + WebId string `protobuf:"bytes,2,opt,name=web_id,json=webId,proto3" json:"web_id,omitempty"` //浏览器唯一id +} + +func (x *GetWebRewardReq) Reset() { + *x = GetWebRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWebRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWebRewardReq) ProtoMessage() {} + +func (x *GetWebRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 GetWebRewardReq.ProtoReflect.Descriptor instead. +func (*GetWebRewardReq) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{0} +} + +func (x *GetWebRewardReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *GetWebRewardReq) GetWebId() string { + if x != nil { + return x.WebId + } + return "" +} + +type GetWebRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id +} + +func (x *GetWebRewardRes) Reset() { + *x = GetWebRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWebRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWebRewardRes) ProtoMessage() {} + +func (x *GetWebRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 GetWebRewardRes.ProtoReflect.Descriptor instead. +func (*GetWebRewardRes) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{1} +} + +func (x *GetWebRewardRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type BindWebReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id + CMark string `protobuf:"bytes,2,opt,name=c_mark,json=cMark,proto3" json:"c_mark,omitempty"` //渠道标识 + WebId string `protobuf:"bytes,3,opt,name=web_id,json=webId,proto3" json:"web_id,omitempty"` //浏览器唯一id + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` //ip地址 +} + +func (x *BindWebReq) Reset() { + *x = BindWebReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BindWebReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindWebReq) ProtoMessage() {} + +func (x *BindWebReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 BindWebReq.ProtoReflect.Descriptor instead. +func (*BindWebReq) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{2} +} + +func (x *BindWebReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *BindWebReq) GetCMark() string { + if x != nil { + return x.CMark + } + return "" +} + +func (x *BindWebReq) GetWebId() string { + if x != nil { + return x.WebId + } + return "" +} + +func (x *BindWebReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type BindWebRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //绑定的用户id,未绑定未0 + DownloadLink string `protobuf:"bytes,3,opt,name=download_link,json=downloadLink,proto3" json:"download_link,omitempty"` //下载也链接 + Submit bool `protobuf:"varint,4,opt,name=submit,proto3" json:"submit,omitempty"` //是否有提交题目 +} + +func (x *BindWebRes) Reset() { + *x = BindWebRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BindWebRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindWebRes) ProtoMessage() {} + +func (x *BindWebRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 BindWebRes.ProtoReflect.Descriptor instead. +func (*BindWebRes) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{3} +} + +func (x *BindWebRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *BindWebRes) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *BindWebRes) GetDownloadLink() string { + if x != nil { + return x.DownloadLink + } + return "" +} + +func (x *BindWebRes) GetSubmit() bool { + if x != nil { + return x.Submit + } + return false +} + +type WebRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id + WebId string `protobuf:"bytes,2,opt,name=web_id,json=webId,proto3" json:"web_id,omitempty"` //浏览器唯一id + Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` //关注用户ID + Lang string `protobuf:"bytes,4,opt,name=lang,proto3" json:"lang,omitempty"` //语种标识 +} + +func (x *WebRewardReq) Reset() { + *x = WebRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebRewardReq) ProtoMessage() {} + +func (x *WebRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 WebRewardReq.ProtoReflect.Descriptor instead. +func (*WebRewardReq) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{4} +} + +func (x *WebRewardReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *WebRewardReq) GetWebId() string { + if x != nil { + return x.WebId + } + return "" +} + +func (x *WebRewardReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *WebRewardReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +type WebRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HasReward bool `protobuf:"varint,1,opt,name=has_reward,json=hasReward,proto3" json:"has_reward,omitempty"` //是否有奖品 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + RewardHashId string `protobuf:"bytes,4,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //领取的用户奖品hash_id + ReceiveType int32 `protobuf:"varint,5,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + IsPush bool `protobuf:"varint,6,opt,name=is_push,json=isPush,proto3" json:"is_push,omitempty"` //是否已经推给客户 + KvData []*WebRewardRes_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值对数据 + RewardId int64 `protobuf:"varint,8,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Contact string `protobuf:"bytes,9,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"` //奖品状态(0-可领奖,1-非新下载用户无法领奖) + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //web端跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //app事件参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc事件参数 +} + +func (x *WebRewardRes) Reset() { + *x = WebRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebRewardRes) ProtoMessage() {} + +func (x *WebRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 WebRewardRes.ProtoReflect.Descriptor instead. +func (*WebRewardRes) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{5} +} + +func (x *WebRewardRes) GetHasReward() bool { + if x != nil { + return x.HasReward + } + return false +} + +func (x *WebRewardRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *WebRewardRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *WebRewardRes) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +func (x *WebRewardRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *WebRewardRes) GetIsPush() bool { + if x != nil { + return x.IsPush + } + return false +} + +func (x *WebRewardRes) GetKvData() []*WebRewardRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *WebRewardRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *WebRewardRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *WebRewardRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *WebRewardRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *WebRewardRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *WebRewardRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type WebAnswerReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id + WebId string `protobuf:"bytes,2,opt,name=web_id,json=webId,proto3" json:"web_id,omitempty"` //浏览器唯一id + Submits []*WebAnswerReq_Submit `protobuf:"bytes,3,rep,name=submits,proto3" json:"submits,omitempty"` //提交的答案 +} + +func (x *WebAnswerReq) Reset() { + *x = WebAnswerReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebAnswerReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebAnswerReq) ProtoMessage() {} + +func (x *WebAnswerReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 WebAnswerReq.ProtoReflect.Descriptor instead. +func (*WebAnswerReq) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{6} +} + +func (x *WebAnswerReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *WebAnswerReq) GetWebId() string { + if x != nil { + return x.WebId + } + return "" +} + +func (x *WebAnswerReq) GetSubmits() []*WebAnswerReq_Submit { + if x != nil { + return x.Submits + } + return nil +} + +type WebAnswerRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id +} + +func (x *WebAnswerRes) Reset() { + *x = WebAnswerRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebAnswerRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebAnswerRes) ProtoMessage() {} + +func (x *WebAnswerRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 WebAnswerRes.ProtoReflect.Descriptor instead. +func (*WebAnswerRes) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{7} +} + +func (x *WebAnswerRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type AdsUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动id + WebId string `protobuf:"bytes,2,opt,name=web_id,json=webId,proto3" json:"web_id,omitempty"` //浏览器唯一id + Cid string `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"` //渠道标识 + Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` //ip地址 +} + +func (x *AdsUserReq) Reset() { + *x = AdsUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUserReq) ProtoMessage() {} + +func (x *AdsUserReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 AdsUserReq.ProtoReflect.Descriptor instead. +func (*AdsUserReq) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{8} +} + +func (x *AdsUserReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *AdsUserReq) GetWebId() string { + if x != nil { + return x.WebId + } + return "" +} + +func (x *AdsUserReq) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *AdsUserReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type AdsUserRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //站外用户id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 +} + +func (x *AdsUserRes) Reset() { + *x = AdsUserRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsUserRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsUserRes) ProtoMessage() {} + +func (x *AdsUserRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 AdsUserRes.ProtoReflect.Descriptor instead. +func (*AdsUserRes) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{9} +} + +func (x *AdsUserRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsUserRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *AdsUserRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsUserRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type AdsLotteryReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //站外用户id + Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` //手机系统 andriod ios web +} + +func (x *AdsLotteryReq) Reset() { + *x = AdsLotteryReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsLotteryReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsLotteryReq) ProtoMessage() {} + +func (x *AdsLotteryReq) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 AdsLotteryReq.ProtoReflect.Descriptor instead. +func (*AdsLotteryReq) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{10} +} + +func (x *AdsLotteryReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AdsLotteryReq) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +type AdsLotteryRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RewardId int64 `protobuf:"varint,1,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 +} + +func (x *AdsLotteryRes) Reset() { + *x = AdsLotteryRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsLotteryRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsLotteryRes) ProtoMessage() {} + +func (x *AdsLotteryRes) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 AdsLotteryRes.ProtoReflect.Descriptor instead. +func (*AdsLotteryRes) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{11} +} + +func (x *AdsLotteryRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *AdsLotteryRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AdsLotteryRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type WebRewardRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 +} + +func (x *WebRewardRes_KV) Reset() { + *x = WebRewardRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebRewardRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebRewardRes_KV) ProtoMessage() {} + +func (x *WebRewardRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 WebRewardRes_KV.ProtoReflect.Descriptor instead. +func (*WebRewardRes_KV) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *WebRewardRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *WebRewardRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type WebAnswerReq_Submit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Qid int64 `protobuf:"varint,1,opt,name=qid,proto3" json:"qid,omitempty"` //题目id + Aid []int64 `protobuf:"varint,2,rep,packed,name=aid,proto3" json:"aid,omitempty"` //答案id +} + +func (x *WebAnswerReq_Submit) Reset() { + *x = WebAnswerReq_Submit{} + if protoimpl.UnsafeEnabled { + mi := &file_w_fission_web_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebAnswerReq_Submit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebAnswerReq_Submit) ProtoMessage() {} + +func (x *WebAnswerReq_Submit) ProtoReflect() protoreflect.Message { + mi := &file_w_fission_web_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 WebAnswerReq_Submit.ProtoReflect.Descriptor instead. +func (*WebAnswerReq_Submit) Descriptor() ([]byte, []int) { + return file_w_fission_web_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *WebAnswerReq_Submit) GetQid() int64 { + if x != nil { + return x.Qid + } + return 0 +} + +func (x *WebAnswerReq_Submit) GetAid() []int64 { + if x != nil { + return x.Aid + } + return nil +} + +var File_w_fission_web_proto protoreflect.FileDescriptor + +var file_w_fission_web_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x22, 0x41, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x57, 0x65, 0x62, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x77, 0x65, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x22, 0x21, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x74, 0x0a, 0x0a, + 0x42, 0x69, 0x6e, 0x64, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x15, 0x0a, 0x06, 0x77, + 0x65, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x77, 0x65, 0x62, + 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x70, 0x22, 0x72, 0x0a, 0x0a, 0x42, 0x69, 0x6e, 0x64, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x22, 0x75, 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x15, 0x0a, 0x06, 0x77, 0x65, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, + 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0xc7, 0x03, + 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x68, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x68, 0x61, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x24, 0x0a, 0x0e, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x70, 0x75, 0x73, 0x68, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, 0x39, + 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, + 0x62, 0x2e, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4b, + 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x2c, 0x0a, 0x02, 0x4b, 0x56, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x41, + 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, + 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x77, 0x65, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x07, 0x73, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x57, 0x65, 0x62, + 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x52, 0x07, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x73, 0x1a, 0x2c, 0x0a, 0x06, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x71, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x03, 0x52, 0x03, 0x61, 0x69, 0x64, 0x22, 0x1e, 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x41, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x6f, 0x0a, 0x0a, 0x41, 0x64, 0x73, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x77, 0x65, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x68, 0x0a, 0x0a, 0x41, 0x64, 0x73, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, + 0x72, 0x6c, 0x22, 0x3b, 0x0a, 0x0d, 0x41, 0x64, 0x73, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, + 0x5b, 0x0a, 0x0d, 0x41, 0x64, 0x73, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x32, 0xdb, 0x03, 0x0a, + 0x0b, 0x57, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x65, 0x62, 0x12, 0x54, 0x0a, 0x0c, + 0x47, 0x65, 0x74, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x2e, 0x77, + 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x20, + 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x45, 0x0a, 0x07, 0x42, 0x69, 0x6e, 0x64, 0x57, 0x65, 0x62, 0x12, 0x1b, 0x2e, + 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, + 0x42, 0x69, 0x6e, 0x64, 0x57, 0x65, 0x62, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x66, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x42, 0x69, 0x6e, + 0x64, 0x57, 0x65, 0x62, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x09, 0x57, 0x65, 0x62, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x57, 0x65, 0x62, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x41, 0x6e, 0x73, + 0x77, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x57, 0x65, 0x62, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, + 0x65, 0x62, 0x70, 0x62, 0x2e, 0x57, 0x65, 0x62, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x07, 0x41, 0x64, 0x73, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, + 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, + 0x2e, 0x41, 0x64, 0x73, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, + 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x41, 0x64, + 0x73, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0a, 0x41, 0x64, + 0x73, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x4c, 0x6f, + 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x66, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x4c, 0x6f, + 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x2f, + 0x3b, 0x77, 0x5f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x65, 0x62, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_fission_web_proto_rawDescOnce sync.Once + file_w_fission_web_proto_rawDescData = file_w_fission_web_proto_rawDesc +) + +func file_w_fission_web_proto_rawDescGZIP() []byte { + file_w_fission_web_proto_rawDescOnce.Do(func() { + file_w_fission_web_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_fission_web_proto_rawDescData) + }) + return file_w_fission_web_proto_rawDescData +} + +var file_w_fission_web_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_w_fission_web_proto_goTypes = []interface{}{ + (*GetWebRewardReq)(nil), // 0: w_fission_webpb.GetWebRewardReq + (*GetWebRewardRes)(nil), // 1: w_fission_webpb.GetWebRewardRes + (*BindWebReq)(nil), // 2: w_fission_webpb.BindWebReq + (*BindWebRes)(nil), // 3: w_fission_webpb.BindWebRes + (*WebRewardReq)(nil), // 4: w_fission_webpb.WebRewardReq + (*WebRewardRes)(nil), // 5: w_fission_webpb.WebRewardRes + (*WebAnswerReq)(nil), // 6: w_fission_webpb.WebAnswerReq + (*WebAnswerRes)(nil), // 7: w_fission_webpb.WebAnswerRes + (*AdsUserReq)(nil), // 8: w_fission_webpb.AdsUserReq + (*AdsUserRes)(nil), // 9: w_fission_webpb.AdsUserRes + (*AdsLotteryReq)(nil), // 10: w_fission_webpb.AdsLotteryReq + (*AdsLotteryRes)(nil), // 11: w_fission_webpb.AdsLotteryRes + (*WebRewardRes_KV)(nil), // 12: w_fission_webpb.WebRewardRes.KV + (*WebAnswerReq_Submit)(nil), // 13: w_fission_webpb.WebAnswerReq.Submit +} +var file_w_fission_web_proto_depIdxs = []int32{ + 12, // 0: w_fission_webpb.WebRewardRes.kv_data:type_name -> w_fission_webpb.WebRewardRes.KV + 13, // 1: w_fission_webpb.WebAnswerReq.submits:type_name -> w_fission_webpb.WebAnswerReq.Submit + 0, // 2: w_fission_webpb.WFissionWeb.GetWebReward:input_type -> w_fission_webpb.GetWebRewardReq + 2, // 3: w_fission_webpb.WFissionWeb.BindWeb:input_type -> w_fission_webpb.BindWebReq + 4, // 4: w_fission_webpb.WFissionWeb.WebReward:input_type -> w_fission_webpb.WebRewardReq + 6, // 5: w_fission_webpb.WFissionWeb.WebAnswer:input_type -> w_fission_webpb.WebAnswerReq + 8, // 6: w_fission_webpb.WFissionWeb.AdsUser:input_type -> w_fission_webpb.AdsUserReq + 10, // 7: w_fission_webpb.WFissionWeb.AdsLottery:input_type -> w_fission_webpb.AdsLotteryReq + 1, // 8: w_fission_webpb.WFissionWeb.GetWebReward:output_type -> w_fission_webpb.GetWebRewardRes + 3, // 9: w_fission_webpb.WFissionWeb.BindWeb:output_type -> w_fission_webpb.BindWebRes + 5, // 10: w_fission_webpb.WFissionWeb.WebReward:output_type -> w_fission_webpb.WebRewardRes + 7, // 11: w_fission_webpb.WFissionWeb.WebAnswer:output_type -> w_fission_webpb.WebAnswerRes + 9, // 12: w_fission_webpb.WFissionWeb.AdsUser:output_type -> w_fission_webpb.AdsUserRes + 11, // 13: w_fission_webpb.WFissionWeb.AdsLottery:output_type -> w_fission_webpb.AdsLotteryRes + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_w_fission_web_proto_init() } +func file_w_fission_web_proto_init() { + if File_w_fission_web_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_fission_web_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWebRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWebRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BindWebReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BindWebRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebAnswerReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebAnswerRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsUserRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsLotteryReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsLotteryRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebRewardRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_fission_web_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebAnswerReq_Submit); 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_w_fission_web_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_fission_web_proto_goTypes, + DependencyIndexes: file_w_fission_web_proto_depIdxs, + MessageInfos: file_w_fission_web_proto_msgTypes, + }.Build() + File_w_fission_web_proto = out.File + file_w_fission_web_proto_rawDesc = nil + file_w_fission_web_proto_goTypes = nil + file_w_fission_web_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_fission_web/w_fission_web.pb.micro.go b/proto/go_proto/w_fission_web/w_fission_web.pb.micro.go new file mode 100644 index 0000000..384b7c9 --- /dev/null +++ b/proto/go_proto/w_fission_web/w_fission_web.pb.micro.go @@ -0,0 +1,184 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_fission_web.proto + +package w_fission_webpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WFissionWeb service + +func NewWFissionWebEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WFissionWeb service + +type WFissionWebService interface { + // GetWebReward 抽取站外奖品 + GetWebReward(ctx context.Context, in *GetWebRewardReq, opts ...client.CallOption) (*GetWebRewardRes, error) + // BindWeb 绑定站外活动 + BindWeb(ctx context.Context, in *BindWebReq, opts ...client.CallOption) (*BindWebRes, error) + // WebReward 用户站外奖 + WebReward(ctx context.Context, in *WebRewardReq, opts ...client.CallOption) (*WebRewardRes, error) + // WebAnswer 用户站外答题 + WebAnswer(ctx context.Context, in *WebAnswerReq, opts ...client.CallOption) (*WebAnswerRes, error) + // AdsUser Ads用户数据 + AdsUser(ctx context.Context, in *AdsUserReq, opts ...client.CallOption) (*AdsUserRes, error) + // AdsLottery Ads抽奖 + AdsLottery(ctx context.Context, in *AdsLotteryReq, opts ...client.CallOption) (*AdsLotteryRes, error) +} + +type wFissionWebService struct { + c client.Client + name string +} + +func NewWFissionWebService(name string, c client.Client) WFissionWebService { + return &wFissionWebService{ + c: c, + name: name, + } +} + +func (c *wFissionWebService) GetWebReward(ctx context.Context, in *GetWebRewardReq, opts ...client.CallOption) (*GetWebRewardRes, error) { + req := c.c.NewRequest(c.name, "WFissionWeb.GetWebReward", in) + out := new(GetWebRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionWebService) BindWeb(ctx context.Context, in *BindWebReq, opts ...client.CallOption) (*BindWebRes, error) { + req := c.c.NewRequest(c.name, "WFissionWeb.BindWeb", in) + out := new(BindWebRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionWebService) WebReward(ctx context.Context, in *WebRewardReq, opts ...client.CallOption) (*WebRewardRes, error) { + req := c.c.NewRequest(c.name, "WFissionWeb.WebReward", in) + out := new(WebRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionWebService) WebAnswer(ctx context.Context, in *WebAnswerReq, opts ...client.CallOption) (*WebAnswerRes, error) { + req := c.c.NewRequest(c.name, "WFissionWeb.WebAnswer", in) + out := new(WebAnswerRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionWebService) AdsUser(ctx context.Context, in *AdsUserReq, opts ...client.CallOption) (*AdsUserRes, error) { + req := c.c.NewRequest(c.name, "WFissionWeb.AdsUser", in) + out := new(AdsUserRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wFissionWebService) AdsLottery(ctx context.Context, in *AdsLotteryReq, opts ...client.CallOption) (*AdsLotteryRes, error) { + req := c.c.NewRequest(c.name, "WFissionWeb.AdsLottery", in) + out := new(AdsLotteryRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WFissionWeb service + +type WFissionWebHandler interface { + // GetWebReward 抽取站外奖品 + GetWebReward(context.Context, *GetWebRewardReq, *GetWebRewardRes) error + // BindWeb 绑定站外活动 + BindWeb(context.Context, *BindWebReq, *BindWebRes) error + // WebReward 用户站外奖 + WebReward(context.Context, *WebRewardReq, *WebRewardRes) error + // WebAnswer 用户站外答题 + WebAnswer(context.Context, *WebAnswerReq, *WebAnswerRes) error + // AdsUser Ads用户数据 + AdsUser(context.Context, *AdsUserReq, *AdsUserRes) error + // AdsLottery Ads抽奖 + AdsLottery(context.Context, *AdsLotteryReq, *AdsLotteryRes) error +} + +func RegisterWFissionWebHandler(s server.Server, hdlr WFissionWebHandler, opts ...server.HandlerOption) error { + type wFissionWeb interface { + GetWebReward(ctx context.Context, in *GetWebRewardReq, out *GetWebRewardRes) error + BindWeb(ctx context.Context, in *BindWebReq, out *BindWebRes) error + WebReward(ctx context.Context, in *WebRewardReq, out *WebRewardRes) error + WebAnswer(ctx context.Context, in *WebAnswerReq, out *WebAnswerRes) error + AdsUser(ctx context.Context, in *AdsUserReq, out *AdsUserRes) error + AdsLottery(ctx context.Context, in *AdsLotteryReq, out *AdsLotteryRes) error + } + type WFissionWeb struct { + wFissionWeb + } + h := &wFissionWebHandler{hdlr} + return s.Handle(s.NewHandler(&WFissionWeb{h}, opts...)) +} + +type wFissionWebHandler struct { + WFissionWebHandler +} + +func (h *wFissionWebHandler) GetWebReward(ctx context.Context, in *GetWebRewardReq, out *GetWebRewardRes) error { + return h.WFissionWebHandler.GetWebReward(ctx, in, out) +} + +func (h *wFissionWebHandler) BindWeb(ctx context.Context, in *BindWebReq, out *BindWebRes) error { + return h.WFissionWebHandler.BindWeb(ctx, in, out) +} + +func (h *wFissionWebHandler) WebReward(ctx context.Context, in *WebRewardReq, out *WebRewardRes) error { + return h.WFissionWebHandler.WebReward(ctx, in, out) +} + +func (h *wFissionWebHandler) WebAnswer(ctx context.Context, in *WebAnswerReq, out *WebAnswerRes) error { + return h.WFissionWebHandler.WebAnswer(ctx, in, out) +} + +func (h *wFissionWebHandler) AdsUser(ctx context.Context, in *AdsUserReq, out *AdsUserRes) error { + return h.WFissionWebHandler.AdsUser(ctx, in, out) +} + +func (h *wFissionWebHandler) AdsLottery(ctx context.Context, in *AdsLotteryReq, out *AdsLotteryRes) error { + return h.WFissionWebHandler.AdsLottery(ctx, in, out) +} diff --git a/proto/go_proto/w_games/w_games.pb.go b/proto/go_proto/w_games/w_games.pb.go new file mode 100644 index 0000000..ceedf77 --- /dev/null +++ b/proto/go_proto/w_games/w_games.pb.go @@ -0,0 +1,1995 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_games.proto + +package w_gamespb + +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 ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +type LinkListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GameId int64 `protobuf:"varint,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` //游戏id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *LinkListReq) Reset() { + *x = LinkListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkListReq) ProtoMessage() {} + +func (x *LinkListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkListReq.ProtoReflect.Descriptor instead. +func (*LinkListReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{2} +} + +func (x *LinkListReq) GetGameId() int64 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *LinkListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type LinkListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*LinkListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //链接列表 +} + +func (x *LinkListRes) Reset() { + *x = LinkListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkListRes) ProtoMessage() {} + +func (x *LinkListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkListRes.ProtoReflect.Descriptor instead. +func (*LinkListRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{3} +} + +func (x *LinkListRes) GetList() []*LinkListRes_One { + if x != nil { + return x.List + } + return nil +} + +type LinkStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GameId int64 `protobuf:"varint,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` //游戏id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //链接标题 +} + +func (x *LinkStoreReq) Reset() { + *x = LinkStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkStoreReq) ProtoMessage() {} + +func (x *LinkStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkStoreReq.ProtoReflect.Descriptor instead. +func (*LinkStoreReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{4} +} + +func (x *LinkStoreReq) GetGameId() int64 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *LinkStoreReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *LinkStoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type LinkStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //链接id + Link string `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"` //游戏链接 +} + +func (x *LinkStoreRes) Reset() { + *x = LinkStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkStoreRes) ProtoMessage() {} + +func (x *LinkStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkStoreRes.ProtoReflect.Descriptor instead. +func (*LinkStoreRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{5} +} + +func (x *LinkStoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkStoreRes) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +type LinkUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //链接id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //链接标题 +} + +func (x *LinkUpdateReq) Reset() { + *x = LinkUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkUpdateReq) ProtoMessage() {} + +func (x *LinkUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkUpdateReq.ProtoReflect.Descriptor instead. +func (*LinkUpdateReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{6} +} + +func (x *LinkUpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkUpdateReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *LinkUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type LinkUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //链接id +} + +func (x *LinkUpdateRes) Reset() { + *x = LinkUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkUpdateRes) ProtoMessage() {} + +func (x *LinkUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkUpdateRes.ProtoReflect.Descriptor instead. +func (*LinkUpdateRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{7} +} + +func (x *LinkUpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type LinkDestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //链接id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *LinkDestroyReq) Reset() { + *x = LinkDestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkDestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkDestroyReq) ProtoMessage() {} + +func (x *LinkDestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkDestroyReq.ProtoReflect.Descriptor instead. +func (*LinkDestroyReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{8} +} + +func (x *LinkDestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkDestroyReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type LinkDestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //链接id +} + +func (x *LinkDestroyRes) Reset() { + *x = LinkDestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkDestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkDestroyRes) ProtoMessage() {} + +func (x *LinkDestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkDestroyRes.ProtoReflect.Descriptor instead. +func (*LinkDestroyRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{9} +} + +func (x *LinkDestroyRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type VisitReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LinkHashId string `protobuf:"bytes,1,opt,name=link_hash_id,json=linkHashId,proto3" json:"link_hash_id,omitempty"` //链接hashid + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` //关注用户ID + Lang string `protobuf:"bytes,4,opt,name=lang,proto3" json:"lang,omitempty"` //语种标识 + Lv string `protobuf:"bytes,5,opt,name=lv,proto3" json:"lv,omitempty"` //用户等级 + Cert *VisitReq_Cert `protobuf:"bytes,6,opt,name=cert,proto3" json:"cert,omitempty"` //验签数据 + Ip string `protobuf:"bytes,7,opt,name=ip,proto3" json:"ip,omitempty"` //客户端ip + Os string `protobuf:"bytes,8,opt,name=os,proto3" json:"os,omitempty"` //系统 + OsVersion string `protobuf:"bytes,9,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` //系统版本 + DeviceModel string `protobuf:"bytes,10,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"` //系统型号 + Mid int64 `protobuf:"varint,11,opt,name=mid,proto3" json:"mid,omitempty"` //用户id +} + +func (x *VisitReq) Reset() { + *x = VisitReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisitReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisitReq) ProtoMessage() {} + +func (x *VisitReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 VisitReq.ProtoReflect.Descriptor instead. +func (*VisitReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{10} +} + +func (x *VisitReq) GetLinkHashId() string { + if x != nil { + return x.LinkHashId + } + return "" +} + +func (x *VisitReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *VisitReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *VisitReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *VisitReq) GetLv() string { + if x != nil { + return x.Lv + } + return "" +} + +func (x *VisitReq) GetCert() *VisitReq_Cert { + if x != nil { + return x.Cert + } + return nil +} + +func (x *VisitReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *VisitReq) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *VisitReq) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *VisitReq) GetDeviceModel() string { + if x != nil { + return x.DeviceModel + } + return "" +} + +func (x *VisitReq) GetMid() int64 { + if x != nil { + return x.Mid + } + return 0 +} + +type VisitRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` //身份token + Expired int64 `protobuf:"varint,4,opt,name=expired,proto3" json:"expired,omitempty"` //token过期时间,单位:秒(s) + IsView int32 `protobuf:"varint,5,opt,name=is_view,json=isView,proto3" json:"is_view,omitempty"` //是否预览用户(1-是,0-否) +} + +func (x *VisitRes) Reset() { + *x = VisitRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisitRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisitRes) ProtoMessage() {} + +func (x *VisitRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 VisitRes.ProtoReflect.Descriptor instead. +func (*VisitRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{11} +} + +func (x *VisitRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *VisitRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *VisitRes) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *VisitRes) GetExpired() int64 { + if x != nil { + return x.Expired + } + return 0 +} + +func (x *VisitRes) GetIsView() int32 { + if x != nil { + return x.IsView + } + return 0 +} + +type TraceReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + LinkId int64 `protobuf:"varint,2,opt,name=link_id,json=linkId,proto3" json:"link_id,omitempty"` //链接id + Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` //埋点类型(2-停留) + StaySec int32 `protobuf:"varint,4,opt,name=stay_sec,json=staySec,proto3" json:"stay_sec,omitempty"` //停留时间,单位:秒(s) +} + +func (x *TraceReq) Reset() { + *x = TraceReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceReq) ProtoMessage() {} + +func (x *TraceReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 TraceReq.ProtoReflect.Descriptor instead. +func (*TraceReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{12} +} + +func (x *TraceReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *TraceReq) GetLinkId() int64 { + if x != nil { + return x.LinkId + } + return 0 +} + +func (x *TraceReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *TraceReq) GetStaySec() int32 { + if x != nil { + return x.StaySec + } + return 0 +} + +type TraceRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TraceRes) Reset() { + *x = TraceRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceRes) ProtoMessage() {} + +func (x *TraceRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 TraceRes.ProtoReflect.Descriptor instead. +func (*TraceRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{13} +} + +type OverviewReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GameId int64 `protobuf:"varint,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` //游戏id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + LinkId int64 `protobuf:"varint,3,opt,name=link_id,json=linkId,proto3" json:"link_id,omitempty"` //链接id +} + +func (x *OverviewReq) Reset() { + *x = OverviewReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OverviewReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OverviewReq) ProtoMessage() {} + +func (x *OverviewReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 OverviewReq.ProtoReflect.Descriptor instead. +func (*OverviewReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{14} +} + +func (x *OverviewReq) GetGameId() int64 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *OverviewReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *OverviewReq) GetLinkId() int64 { + if x != nil { + return x.LinkId + } + return 0 +} + +type OverviewRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*OverviewRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表 +} + +func (x *OverviewRes) Reset() { + *x = OverviewRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OverviewRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OverviewRes) ProtoMessage() {} + +func (x *OverviewRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 OverviewRes.ProtoReflect.Descriptor instead. +func (*OverviewRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{15} +} + +func (x *OverviewRes) GetList() []*OverviewRes_One { + if x != nil { + return x.List + } + return nil +} + +type TrendReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GameId int64 `protobuf:"varint,1,opt,name=game_id,json=gameId,proto3" json:"game_id,omitempty"` //游戏id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + LinkId int64 `protobuf:"varint,3,opt,name=link_id,json=linkId,proto3" json:"link_id,omitempty"` //链接id + StartTime int64 `protobuf:"varint,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间 + EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间 +} + +func (x *TrendReq) Reset() { + *x = TrendReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrendReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrendReq) ProtoMessage() {} + +func (x *TrendReq) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 TrendReq.ProtoReflect.Descriptor instead. +func (*TrendReq) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{16} +} + +func (x *TrendReq) GetGameId() int64 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *TrendReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *TrendReq) GetLinkId() int64 { + if x != nil { + return x.LinkId + } + return 0 +} + +func (x *TrendReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *TrendReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type TrendRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + X []string `protobuf:"bytes,1,rep,name=x,proto3" json:"x,omitempty"` //x轴 + Y []*TrendRes_Y `protobuf:"bytes,2,rep,name=y,proto3" json:"y,omitempty"` //y轴 +} + +func (x *TrendRes) Reset() { + *x = TrendRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrendRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrendRes) ProtoMessage() {} + +func (x *TrendRes) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 TrendRes.ProtoReflect.Descriptor instead. +func (*TrendRes) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{17} +} + +func (x *TrendRes) GetX() []string { + if x != nil { + return x.X + } + return nil +} + +func (x *TrendRes) GetY() []*TrendRes_Y { + if x != nil { + return x.Y + } + return nil +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //游戏id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //游戏标题 + Img string `protobuf:"bytes,3,opt,name=img,proto3" json:"img,omitempty"` //游戏图片 + Link string `protobuf:"bytes,4,opt,name=link,proto3" json:"link,omitempty"` //游戏链接 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_One) GetImg() string { + if x != nil { + return x.Img + } + return "" +} + +func (x *ListRes_One) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +type LinkListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //链接id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //链接标题 + IsDefault int32 `protobuf:"varint,3,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认链接(0-否,1-是) + Link string `protobuf:"bytes,4,opt,name=link,proto3" json:"link,omitempty"` //游戏链接 +} + +func (x *LinkListRes_One) Reset() { + *x = LinkListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinkListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinkListRes_One) ProtoMessage() {} + +func (x *LinkListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 LinkListRes_One.ProtoReflect.Descriptor instead. +func (*LinkListRes_One) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *LinkListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LinkListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *LinkListRes_One) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *LinkListRes_One) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +type VisitReq_Cert struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` //时间戳 + Blackbox string `protobuf:"bytes,2,opt,name=blackbox,proto3" json:"blackbox,omitempty"` //通过blackBox可以在后台查询出 + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` //加解密版本 + Platform string `protobuf:"bytes,4,opt,name=platform,proto3" json:"platform,omitempty"` //平台 + Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` //加密串 +} + +func (x *VisitReq_Cert) Reset() { + *x = VisitReq_Cert{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VisitReq_Cert) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VisitReq_Cert) ProtoMessage() {} + +func (x *VisitReq_Cert) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 VisitReq_Cert.ProtoReflect.Descriptor instead. +func (*VisitReq_Cert) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *VisitReq_Cert) GetTime() int64 { + if x != nil { + return x.Time + } + return 0 +} + +func (x *VisitReq_Cert) GetBlackbox() string { + if x != nil { + return x.Blackbox + } + return "" +} + +func (x *VisitReq_Cert) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *VisitReq_Cert) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *VisitReq_Cert) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type OverviewRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //标识(visit_num-访问数,visit_user_num-访问用户数, total_stay-总停留时长) + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //总数 + Yesterday int64 `protobuf:"varint,3,opt,name=yesterday,proto3" json:"yesterday,omitempty"` //昨日总数 + Avg string `protobuf:"bytes,4,opt,name=avg,proto3" json:"avg,omitempty"` //平均 +} + +func (x *OverviewRes_One) Reset() { + *x = OverviewRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OverviewRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OverviewRes_One) ProtoMessage() {} + +func (x *OverviewRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 OverviewRes_One.ProtoReflect.Descriptor instead. +func (*OverviewRes_One) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *OverviewRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *OverviewRes_One) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *OverviewRes_One) GetYesterday() int64 { + if x != nil { + return x.Yesterday + } + return 0 +} + +func (x *OverviewRes_One) GetAvg() string { + if x != nil { + return x.Avg + } + return "" +} + +type TrendRes_Y struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` //线类型(visit_num-访问数,visit_user_num-访问用户数) + Data []int64 `protobuf:"varint,2,rep,packed,name=data,proto3" json:"data,omitempty"` //y轴数据 +} + +func (x *TrendRes_Y) Reset() { + *x = TrendRes_Y{} + if protoimpl.UnsafeEnabled { + mi := &file_w_games_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrendRes_Y) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrendRes_Y) ProtoMessage() {} + +func (x *TrendRes_Y) ProtoReflect() protoreflect.Message { + mi := &file_w_games_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 TrendRes_Y.ProtoReflect.Descriptor instead. +func (*TrendRes_Y) Descriptor() ([]byte, []int) { + return file_w_games_proto_rawDescGZIP(), []int{17, 0} +} + +func (x *TrendRes_Y) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *TrendRes_Y) GetData() []int64 { + if x != nil { + return x.Data + } + return nil +} + +var File_w_games_proto protoreflect.FileDescriptor + +var file_w_games_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x09, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x22, 0x31, 0x0a, 0x07, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x88, 0x01, + 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x51, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x6d, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x69, 0x6d, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x4e, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64, + 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, + 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, + 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x5e, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x65, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, + 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, + 0x32, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, + 0x69, 0x6e, 0x6b, 0x22, 0x5d, 0x0a, 0x0d, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x22, 0x1f, 0x0a, 0x0d, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x48, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x6b, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x20, 0x0a, + 0x0e, 0x4c, 0x69, 0x6e, 0x6b, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, + 0xb1, 0x03, 0x0a, 0x08, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0c, + 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x26, + 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, + 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x2c, 0x0a, 0x04, + 0x63, 0x65, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x67, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x2e, + 0x43, 0x65, 0x72, 0x74, 0x52, 0x04, 0x63, 0x65, 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, + 0x6d, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x1a, 0x82, + 0x01, 0x0a, 0x04, 0x43, 0x65, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, + 0x6c, 0x61, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, + 0x6c, 0x61, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x7c, 0x0a, 0x08, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x76, + 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x56, 0x69, 0x65, + 0x77, 0x22, 0x6b, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x61, 0x79, 0x53, 0x65, 0x63, 0x22, 0x0a, + 0x0a, 0x08, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x0b, 0x4f, 0x76, + 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, + 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, + 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x69, 0x6e, + 0x6b, 0x49, 0x64, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, + 0x52, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4f, 0x76, + 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x1a, 0x5f, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, + 0x61, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x76, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x61, 0x76, 0x67, 0x22, 0x9e, 0x01, 0x0a, 0x08, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x67, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x6a, 0x0a, 0x08, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, + 0x23, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x77, 0x5f, 0x67, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x2e, + 0x59, 0x52, 0x01, 0x79, 0x1a, 0x2b, 0x0a, 0x01, 0x59, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x32, 0xa1, 0x04, 0x0a, 0x06, 0x57, 0x47, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x04, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3c, + 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x67, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x09, + 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x67, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x42, 0x0a, + 0x0a, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x77, 0x5f, + 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x45, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, + 0x6b, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, + 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x44, 0x65, 0x73, 0x74, + 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x05, 0x56, 0x69, 0x73, 0x69, + 0x74, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x56, 0x69, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x33, 0x0a, + 0x05, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, + 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x08, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x12, 0x16, + 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x76, + 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x62, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x33, 0x0a, 0x05, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x67, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x13, + 0x2e, 0x77, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x67, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_games_proto_rawDescOnce sync.Once + file_w_games_proto_rawDescData = file_w_games_proto_rawDesc +) + +func file_w_games_proto_rawDescGZIP() []byte { + file_w_games_proto_rawDescOnce.Do(func() { + file_w_games_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_games_proto_rawDescData) + }) + return file_w_games_proto_rawDescData +} + +var file_w_games_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_w_games_proto_goTypes = []interface{}{ + (*ListReq)(nil), // 0: w_gamespb.ListReq + (*ListRes)(nil), // 1: w_gamespb.ListRes + (*LinkListReq)(nil), // 2: w_gamespb.LinkListReq + (*LinkListRes)(nil), // 3: w_gamespb.LinkListRes + (*LinkStoreReq)(nil), // 4: w_gamespb.LinkStoreReq + (*LinkStoreRes)(nil), // 5: w_gamespb.LinkStoreRes + (*LinkUpdateReq)(nil), // 6: w_gamespb.LinkUpdateReq + (*LinkUpdateRes)(nil), // 7: w_gamespb.LinkUpdateRes + (*LinkDestroyReq)(nil), // 8: w_gamespb.LinkDestroyReq + (*LinkDestroyRes)(nil), // 9: w_gamespb.LinkDestroyRes + (*VisitReq)(nil), // 10: w_gamespb.VisitReq + (*VisitRes)(nil), // 11: w_gamespb.VisitRes + (*TraceReq)(nil), // 12: w_gamespb.TraceReq + (*TraceRes)(nil), // 13: w_gamespb.TraceRes + (*OverviewReq)(nil), // 14: w_gamespb.OverviewReq + (*OverviewRes)(nil), // 15: w_gamespb.OverviewRes + (*TrendReq)(nil), // 16: w_gamespb.TrendReq + (*TrendRes)(nil), // 17: w_gamespb.TrendRes + (*ListRes_One)(nil), // 18: w_gamespb.ListRes.One + (*LinkListRes_One)(nil), // 19: w_gamespb.LinkListRes.One + (*VisitReq_Cert)(nil), // 20: w_gamespb.VisitReq.Cert + (*OverviewRes_One)(nil), // 21: w_gamespb.OverviewRes.One + (*TrendRes_Y)(nil), // 22: w_gamespb.TrendRes.Y +} +var file_w_games_proto_depIdxs = []int32{ + 18, // 0: w_gamespb.ListRes.list:type_name -> w_gamespb.ListRes.One + 19, // 1: w_gamespb.LinkListRes.list:type_name -> w_gamespb.LinkListRes.One + 20, // 2: w_gamespb.VisitReq.cert:type_name -> w_gamespb.VisitReq.Cert + 21, // 3: w_gamespb.OverviewRes.list:type_name -> w_gamespb.OverviewRes.One + 22, // 4: w_gamespb.TrendRes.y:type_name -> w_gamespb.TrendRes.Y + 0, // 5: w_gamespb.WGames.List:input_type -> w_gamespb.ListReq + 2, // 6: w_gamespb.WGames.LinkList:input_type -> w_gamespb.LinkListReq + 4, // 7: w_gamespb.WGames.LinkStore:input_type -> w_gamespb.LinkStoreReq + 6, // 8: w_gamespb.WGames.LinkUpdate:input_type -> w_gamespb.LinkUpdateReq + 8, // 9: w_gamespb.WGames.LinkDestroy:input_type -> w_gamespb.LinkDestroyReq + 10, // 10: w_gamespb.WGames.Visit:input_type -> w_gamespb.VisitReq + 12, // 11: w_gamespb.WGames.Trace:input_type -> w_gamespb.TraceReq + 14, // 12: w_gamespb.WGames.Overview:input_type -> w_gamespb.OverviewReq + 16, // 13: w_gamespb.WGames.Trend:input_type -> w_gamespb.TrendReq + 1, // 14: w_gamespb.WGames.List:output_type -> w_gamespb.ListRes + 3, // 15: w_gamespb.WGames.LinkList:output_type -> w_gamespb.LinkListRes + 5, // 16: w_gamespb.WGames.LinkStore:output_type -> w_gamespb.LinkStoreRes + 7, // 17: w_gamespb.WGames.LinkUpdate:output_type -> w_gamespb.LinkUpdateRes + 9, // 18: w_gamespb.WGames.LinkDestroy:output_type -> w_gamespb.LinkDestroyRes + 11, // 19: w_gamespb.WGames.Visit:output_type -> w_gamespb.VisitRes + 13, // 20: w_gamespb.WGames.Trace:output_type -> w_gamespb.TraceRes + 15, // 21: w_gamespb.WGames.Overview:output_type -> w_gamespb.OverviewRes + 17, // 22: w_gamespb.WGames.Trend:output_type -> w_gamespb.TrendRes + 14, // [14:23] is the sub-list for method output_type + 5, // [5:14] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_w_games_proto_init() } +func file_w_games_proto_init() { + if File_w_games_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_games_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkDestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkDestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisitReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisitRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OverviewReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OverviewRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrendReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrendRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinkListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VisitReq_Cert); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OverviewRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_games_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrendRes_Y); 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_w_games_proto_rawDesc, + NumEnums: 0, + NumMessages: 23, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_games_proto_goTypes, + DependencyIndexes: file_w_games_proto_depIdxs, + MessageInfos: file_w_games_proto_msgTypes, + }.Build() + File_w_games_proto = out.File + file_w_games_proto_rawDesc = nil + file_w_games_proto_goTypes = nil + file_w_games_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_games/w_games.pb.micro.go b/proto/go_proto/w_games/w_games.pb.micro.go new file mode 100644 index 0000000..fb4a226 --- /dev/null +++ b/proto/go_proto/w_games/w_games.pb.micro.go @@ -0,0 +1,241 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_games.proto + +package w_gamespb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WGames service + +func NewWGamesEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WGames service + +type WGamesService interface { + // List 游戏列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // LinkList 链接列表 + LinkList(ctx context.Context, in *LinkListReq, opts ...client.CallOption) (*LinkListRes, error) + // LinkStore 创建链接 + LinkStore(ctx context.Context, in *LinkStoreReq, opts ...client.CallOption) (*LinkStoreRes, error) + // LinkUpdate 更新链接 + LinkUpdate(ctx context.Context, in *LinkUpdateReq, opts ...client.CallOption) (*LinkUpdateRes, error) + // LinkDestroy 删除链接 + LinkDestroy(ctx context.Context, in *LinkDestroyReq, opts ...client.CallOption) (*LinkDestroyRes, error) + // Visit 访问小游戏 + Visit(ctx context.Context, in *VisitReq, opts ...client.CallOption) (*VisitRes, error) + // Trace 跟踪小游戏 + Trace(ctx context.Context, in *TraceReq, opts ...client.CallOption) (*TraceRes, error) + // Overview 小游戏统计 + Overview(ctx context.Context, in *OverviewReq, opts ...client.CallOption) (*OverviewRes, error) + // Trend 小游戏趋势 + Trend(ctx context.Context, in *TrendReq, opts ...client.CallOption) (*TrendRes, error) +} + +type wGamesService struct { + c client.Client + name string +} + +func NewWGamesService(name string, c client.Client) WGamesService { + return &wGamesService{ + c: c, + name: name, + } +} + +func (c *wGamesService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WGames.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) LinkList(ctx context.Context, in *LinkListReq, opts ...client.CallOption) (*LinkListRes, error) { + req := c.c.NewRequest(c.name, "WGames.LinkList", in) + out := new(LinkListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) LinkStore(ctx context.Context, in *LinkStoreReq, opts ...client.CallOption) (*LinkStoreRes, error) { + req := c.c.NewRequest(c.name, "WGames.LinkStore", in) + out := new(LinkStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) LinkUpdate(ctx context.Context, in *LinkUpdateReq, opts ...client.CallOption) (*LinkUpdateRes, error) { + req := c.c.NewRequest(c.name, "WGames.LinkUpdate", in) + out := new(LinkUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) LinkDestroy(ctx context.Context, in *LinkDestroyReq, opts ...client.CallOption) (*LinkDestroyRes, error) { + req := c.c.NewRequest(c.name, "WGames.LinkDestroy", in) + out := new(LinkDestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) Visit(ctx context.Context, in *VisitReq, opts ...client.CallOption) (*VisitRes, error) { + req := c.c.NewRequest(c.name, "WGames.Visit", in) + out := new(VisitRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) Trace(ctx context.Context, in *TraceReq, opts ...client.CallOption) (*TraceRes, error) { + req := c.c.NewRequest(c.name, "WGames.Trace", in) + out := new(TraceRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) Overview(ctx context.Context, in *OverviewReq, opts ...client.CallOption) (*OverviewRes, error) { + req := c.c.NewRequest(c.name, "WGames.Overview", in) + out := new(OverviewRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wGamesService) Trend(ctx context.Context, in *TrendReq, opts ...client.CallOption) (*TrendRes, error) { + req := c.c.NewRequest(c.name, "WGames.Trend", in) + out := new(TrendRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WGames service + +type WGamesHandler interface { + // List 游戏列表 + List(context.Context, *ListReq, *ListRes) error + // LinkList 链接列表 + LinkList(context.Context, *LinkListReq, *LinkListRes) error + // LinkStore 创建链接 + LinkStore(context.Context, *LinkStoreReq, *LinkStoreRes) error + // LinkUpdate 更新链接 + LinkUpdate(context.Context, *LinkUpdateReq, *LinkUpdateRes) error + // LinkDestroy 删除链接 + LinkDestroy(context.Context, *LinkDestroyReq, *LinkDestroyRes) error + // Visit 访问小游戏 + Visit(context.Context, *VisitReq, *VisitRes) error + // Trace 跟踪小游戏 + Trace(context.Context, *TraceReq, *TraceRes) error + // Overview 小游戏统计 + Overview(context.Context, *OverviewReq, *OverviewRes) error + // Trend 小游戏趋势 + Trend(context.Context, *TrendReq, *TrendRes) error +} + +func RegisterWGamesHandler(s server.Server, hdlr WGamesHandler, opts ...server.HandlerOption) error { + type wGames interface { + List(ctx context.Context, in *ListReq, out *ListRes) error + LinkList(ctx context.Context, in *LinkListReq, out *LinkListRes) error + LinkStore(ctx context.Context, in *LinkStoreReq, out *LinkStoreRes) error + LinkUpdate(ctx context.Context, in *LinkUpdateReq, out *LinkUpdateRes) error + LinkDestroy(ctx context.Context, in *LinkDestroyReq, out *LinkDestroyRes) error + Visit(ctx context.Context, in *VisitReq, out *VisitRes) error + Trace(ctx context.Context, in *TraceReq, out *TraceRes) error + Overview(ctx context.Context, in *OverviewReq, out *OverviewRes) error + Trend(ctx context.Context, in *TrendReq, out *TrendRes) error + } + type WGames struct { + wGames + } + h := &wGamesHandler{hdlr} + return s.Handle(s.NewHandler(&WGames{h}, opts...)) +} + +type wGamesHandler struct { + WGamesHandler +} + +func (h *wGamesHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WGamesHandler.List(ctx, in, out) +} + +func (h *wGamesHandler) LinkList(ctx context.Context, in *LinkListReq, out *LinkListRes) error { + return h.WGamesHandler.LinkList(ctx, in, out) +} + +func (h *wGamesHandler) LinkStore(ctx context.Context, in *LinkStoreReq, out *LinkStoreRes) error { + return h.WGamesHandler.LinkStore(ctx, in, out) +} + +func (h *wGamesHandler) LinkUpdate(ctx context.Context, in *LinkUpdateReq, out *LinkUpdateRes) error { + return h.WGamesHandler.LinkUpdate(ctx, in, out) +} + +func (h *wGamesHandler) LinkDestroy(ctx context.Context, in *LinkDestroyReq, out *LinkDestroyRes) error { + return h.WGamesHandler.LinkDestroy(ctx, in, out) +} + +func (h *wGamesHandler) Visit(ctx context.Context, in *VisitReq, out *VisitRes) error { + return h.WGamesHandler.Visit(ctx, in, out) +} + +func (h *wGamesHandler) Trace(ctx context.Context, in *TraceReq, out *TraceRes) error { + return h.WGamesHandler.Trace(ctx, in, out) +} + +func (h *wGamesHandler) Overview(ctx context.Context, in *OverviewReq, out *OverviewRes) error { + return h.WGamesHandler.Overview(ctx, in, out) +} + +func (h *wGamesHandler) Trend(ctx context.Context, in *TrendReq, out *TrendRes) error { + return h.WGamesHandler.Trend(ctx, in, out) +} diff --git a/proto/go_proto/w_library/w_library.pb.go b/proto/go_proto/w_library/w_library.pb.go new file mode 100644 index 0000000..f319a9e --- /dev/null +++ b/proto/go_proto/w_library/w_library.pb.go @@ -0,0 +1,2861 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_library.proto + +package w_librarypb + +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 QaGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //标题 +} + +func (x *QaGroupReq) Reset() { + *x = QaGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaGroupReq) ProtoMessage() {} + +func (x *QaGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaGroupReq.ProtoReflect.Descriptor instead. +func (*QaGroupReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{0} +} + +func (x *QaGroupReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *QaGroupReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *QaGroupReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *QaGroupReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type QaGroupRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*QaGroupRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *QaGroupRes) Reset() { + *x = QaGroupRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaGroupRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaGroupRes) ProtoMessage() {} + +func (x *QaGroupRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaGroupRes.ProtoReflect.Descriptor instead. +func (*QaGroupRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{1} +} + +func (x *QaGroupRes) GetList() []*QaGroupRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *QaGroupRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type StoreQaGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //标题 +} + +func (x *StoreQaGroupReq) Reset() { + *x = StoreQaGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreQaGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreQaGroupReq) ProtoMessage() {} + +func (x *StoreQaGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 StoreQaGroupReq.ProtoReflect.Descriptor instead. +func (*StoreQaGroupReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{2} +} + +func (x *StoreQaGroupReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *StoreQaGroupReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type StoreQaGroupRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StoreQaGroupRes) Reset() { + *x = StoreQaGroupRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreQaGroupRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreQaGroupRes) ProtoMessage() {} + +func (x *StoreQaGroupRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 StoreQaGroupRes.ProtoReflect.Descriptor instead. +func (*StoreQaGroupRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{3} +} + +type UpdateQaGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //题库对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //标题 +} + +func (x *UpdateQaGroupReq) Reset() { + *x = UpdateQaGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateQaGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQaGroupReq) ProtoMessage() {} + +func (x *UpdateQaGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 UpdateQaGroupReq.ProtoReflect.Descriptor instead. +func (*UpdateQaGroupReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateQaGroupReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UpdateQaGroupReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateQaGroupReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type UpdateQaGroupRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateQaGroupRes) Reset() { + *x = UpdateQaGroupRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateQaGroupRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQaGroupRes) ProtoMessage() {} + +func (x *UpdateQaGroupRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 UpdateQaGroupRes.ProtoReflect.Descriptor instead. +func (*UpdateQaGroupRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{5} +} + +type DestroyQaGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //题库对外id +} + +func (x *DestroyQaGroupReq) Reset() { + *x = DestroyQaGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyQaGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyQaGroupReq) ProtoMessage() {} + +func (x *DestroyQaGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 DestroyQaGroupReq.ProtoReflect.Descriptor instead. +func (*DestroyQaGroupReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{6} +} + +func (x *DestroyQaGroupReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *DestroyQaGroupReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DestroyQaGroupRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DestroyQaGroupRes) Reset() { + *x = DestroyQaGroupRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyQaGroupRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyQaGroupRes) ProtoMessage() {} + +func (x *DestroyQaGroupRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 DestroyQaGroupRes.ProtoReflect.Descriptor instead. +func (*DestroyQaGroupRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{7} +} + +type QaListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupHashId string `protobuf:"bytes,1,opt,name=group_hash_id,json=groupHashId,proto3" json:"group_hash_id,omitempty"` //题库对外id + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //题目 + Mark string `protobuf:"bytes,5,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) +} + +func (x *QaListReq) Reset() { + *x = QaListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaListReq) ProtoMessage() {} + +func (x *QaListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaListReq.ProtoReflect.Descriptor instead. +func (*QaListReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{8} +} + +func (x *QaListReq) GetGroupHashId() string { + if x != nil { + return x.GroupHashId + } + return "" +} + +func (x *QaListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *QaListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *QaListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaListReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +type QaListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*QaListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *QaListRes) Reset() { + *x = QaListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaListRes) ProtoMessage() {} + +func (x *QaListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaListRes.ProtoReflect.Descriptor instead. +func (*QaListRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{9} +} + +func (x *QaListRes) GetList() []*QaListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *QaListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type StoreQaReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupHashId string `protobuf:"bytes,1,opt,name=group_hash_id,json=groupHashId,proto3" json:"group_hash_id,omitempty"` //题库对外id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,4,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,5,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + ExplainText string `protobuf:"bytes,6,opt,name=explain_text,json=explainText,proto3" json:"explain_text,omitempty"` //答案解析 + ExplainImg string `protobuf:"bytes,7,opt,name=explain_img,json=explainImg,proto3" json:"explain_img,omitempty"` //答案解析图 + Options []*StoreQaReq_Option `protobuf:"bytes,8,rep,name=options,proto3" json:"options,omitempty"` //选项 + AnswerMark string `protobuf:"bytes,9,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) +} + +func (x *StoreQaReq) Reset() { + *x = StoreQaReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreQaReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreQaReq) ProtoMessage() {} + +func (x *StoreQaReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 StoreQaReq.ProtoReflect.Descriptor instead. +func (*StoreQaReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{10} +} + +func (x *StoreQaReq) GetGroupHashId() string { + if x != nil { + return x.GroupHashId + } + return "" +} + +func (x *StoreQaReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *StoreQaReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreQaReq) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *StoreQaReq) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *StoreQaReq) GetExplainText() string { + if x != nil { + return x.ExplainText + } + return "" +} + +func (x *StoreQaReq) GetExplainImg() string { + if x != nil { + return x.ExplainImg + } + return "" +} + +func (x *StoreQaReq) GetOptions() []*StoreQaReq_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *StoreQaReq) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +type StoreQaRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StoreQaRes) Reset() { + *x = StoreQaRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreQaRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreQaRes) ProtoMessage() {} + +func (x *StoreQaRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 StoreQaRes.ProtoReflect.Descriptor instead. +func (*StoreQaRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{11} +} + +type UpdateQaReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,4,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,5,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + ExplainText string `protobuf:"bytes,6,opt,name=explain_text,json=explainText,proto3" json:"explain_text,omitempty"` //答案解析 + ExplainImg string `protobuf:"bytes,7,opt,name=explain_img,json=explainImg,proto3" json:"explain_img,omitempty"` //答案解析图 + Options []*UpdateQaReq_Option `protobuf:"bytes,8,rep,name=options,proto3" json:"options,omitempty"` //选项 + AnswerMark string `protobuf:"bytes,9,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) +} + +func (x *UpdateQaReq) Reset() { + *x = UpdateQaReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateQaReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQaReq) ProtoMessage() {} + +func (x *UpdateQaReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 UpdateQaReq.ProtoReflect.Descriptor instead. +func (*UpdateQaReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{12} +} + +func (x *UpdateQaReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateQaReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UpdateQaReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateQaReq) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *UpdateQaReq) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *UpdateQaReq) GetExplainText() string { + if x != nil { + return x.ExplainText + } + return "" +} + +func (x *UpdateQaReq) GetExplainImg() string { + if x != nil { + return x.ExplainImg + } + return "" +} + +func (x *UpdateQaReq) GetOptions() []*UpdateQaReq_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *UpdateQaReq) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +type UpdateQaRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateQaRes) Reset() { + *x = UpdateQaRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateQaRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQaRes) ProtoMessage() {} + +func (x *UpdateQaRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 UpdateQaRes.ProtoReflect.Descriptor instead. +func (*UpdateQaRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{13} +} + +type DestroyQaReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id +} + +func (x *DestroyQaReq) Reset() { + *x = DestroyQaReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyQaReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyQaReq) ProtoMessage() {} + +func (x *DestroyQaReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 DestroyQaReq.ProtoReflect.Descriptor instead. +func (*DestroyQaReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{14} +} + +func (x *DestroyQaReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DestroyQaRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DestroyQaRes) Reset() { + *x = DestroyQaRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyQaRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyQaRes) ProtoMessage() {} + +func (x *DestroyQaRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 DestroyQaRes.ProtoReflect.Descriptor instead. +func (*DestroyQaRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{15} +} + +type QaGroupSelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) +} + +func (x *QaGroupSelectReq) Reset() { + *x = QaGroupSelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaGroupSelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaGroupSelectReq) ProtoMessage() {} + +func (x *QaGroupSelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaGroupSelectReq.ProtoReflect.Descriptor instead. +func (*QaGroupSelectReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{16} +} + +func (x *QaGroupSelectReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *QaGroupSelectReq) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +type QaGroupSelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*QaGroupSelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *QaGroupSelectRes) Reset() { + *x = QaGroupSelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaGroupSelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaGroupSelectRes) ProtoMessage() {} + +func (x *QaGroupSelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaGroupSelectRes.ProtoReflect.Descriptor instead. +func (*QaGroupSelectRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{17} +} + +func (x *QaGroupSelectRes) GetList() []*QaGroupSelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type QaRandReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignId int64 `protobuf:"varint,1,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //活动id + GroupHashId string `protobuf:"bytes,2,opt,name=group_hash_id,json=groupHashId,proto3" json:"group_hash_id,omitempty"` //题库对外id + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //用户语言 + UserId int64 `protobuf:"varint,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //获得取题库的用户id +} + +func (x *QaRandReq) Reset() { + *x = QaRandReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaRandReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaRandReq) ProtoMessage() {} + +func (x *QaRandReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaRandReq.ProtoReflect.Descriptor instead. +func (*QaRandReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{18} +} + +func (x *QaRandReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +func (x *QaRandReq) GetGroupHashId() string { + if x != nil { + return x.GroupHashId + } + return "" +} + +func (x *QaRandReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *QaRandReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type QaRandRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*QaRandRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *QaRandRes) Reset() { + *x = QaRandRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaRandRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaRandRes) ProtoMessage() {} + +func (x *QaRandRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaRandRes.ProtoReflect.Descriptor instead. +func (*QaRandRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{19} +} + +func (x *QaRandRes) GetList() []*QaRandRes_One { + if x != nil { + return x.List + } + return nil +} + +type QaShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //题目对外id +} + +func (x *QaShowReq) Reset() { + *x = QaShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaShowReq) ProtoMessage() {} + +func (x *QaShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaShowReq.ProtoReflect.Descriptor instead. +func (*QaShowReq) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{20} +} + +func (x *QaShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type QaShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //问题ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,5,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,6,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + ExplainText string `protobuf:"bytes,7,opt,name=explain_text,json=explainText,proto3" json:"explain_text,omitempty"` //答案解析 + ExplainImg string `protobuf:"bytes,8,opt,name=explain_img,json=explainImg,proto3" json:"explain_img,omitempty"` //答案解析图 + Options []*QaShowRes_Option `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` //选项 + CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + AnswerMark string `protobuf:"bytes,11,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) +} + +func (x *QaShowRes) Reset() { + *x = QaShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaShowRes) ProtoMessage() {} + +func (x *QaShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaShowRes.ProtoReflect.Descriptor instead. +func (*QaShowRes) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{21} +} + +func (x *QaShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaShowRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *QaShowRes) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *QaShowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaShowRes) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *QaShowRes) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *QaShowRes) GetExplainText() string { + if x != nil { + return x.ExplainText + } + return "" +} + +func (x *QaShowRes) GetExplainImg() string { + if x != nil { + return x.ExplainImg + } + return "" +} + +func (x *QaShowRes) GetOptions() []*QaShowRes_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *QaShowRes) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *QaShowRes) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +type QaGroupRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //题库ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //题库对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //标题 + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + QaCount int64 `protobuf:"varint,5,opt,name=qa_count,json=qaCount,proto3" json:"qa_count,omitempty"` //问题数量 +} + +func (x *QaGroupRes_One) Reset() { + *x = QaGroupRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaGroupRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaGroupRes_One) ProtoMessage() {} + +func (x *QaGroupRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaGroupRes_One.ProtoReflect.Descriptor instead. +func (*QaGroupRes_One) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *QaGroupRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaGroupRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *QaGroupRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaGroupRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *QaGroupRes_One) GetQaCount() int64 { + if x != nil { + return x.QaCount + } + return 0 +} + +type QaListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //问题ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,5,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,6,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + ExplainText string `protobuf:"bytes,7,opt,name=explain_text,json=explainText,proto3" json:"explain_text,omitempty"` //答案解析 + ExplainImg string `protobuf:"bytes,8,opt,name=explain_img,json=explainImg,proto3" json:"explain_img,omitempty"` //答案解析图 + Options []*QaListRes_Option `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` //选项 + CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + AnswerMark string `protobuf:"bytes,11,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) +} + +func (x *QaListRes_One) Reset() { + *x = QaListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaListRes_One) ProtoMessage() {} + +func (x *QaListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_library_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 QaListRes_One.ProtoReflect.Descriptor instead. +func (*QaListRes_One) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *QaListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *QaListRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *QaListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaListRes_One) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *QaListRes_One) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *QaListRes_One) GetExplainText() string { + if x != nil { + return x.ExplainText + } + return "" +} + +func (x *QaListRes_One) GetExplainImg() string { + if x != nil { + return x.ExplainImg + } + return "" +} + +func (x *QaListRes_One) GetOptions() []*QaListRes_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *QaListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *QaListRes_One) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +type QaListRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *QaListRes_Option) Reset() { + *x = QaListRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaListRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaListRes_Option) ProtoMessage() {} + +func (x *QaListRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[24] + 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 QaListRes_Option.ProtoReflect.Descriptor instead. +func (*QaListRes_Option) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *QaListRes_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaListRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaListRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *QaListRes_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type StoreQaReq_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,2,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 + IsRight int32 `protobuf:"varint,3,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *StoreQaReq_Option) Reset() { + *x = StoreQaReq_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreQaReq_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreQaReq_Option) ProtoMessage() {} + +func (x *StoreQaReq_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[25] + 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 StoreQaReq_Option.ProtoReflect.Descriptor instead. +func (*StoreQaReq_Option) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *StoreQaReq_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreQaReq_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *StoreQaReq_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type UpdateQaReq_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *UpdateQaReq_Option) Reset() { + *x = UpdateQaReq_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateQaReq_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateQaReq_Option) ProtoMessage() {} + +func (x *UpdateQaReq_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[26] + 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 UpdateQaReq_Option.ProtoReflect.Descriptor instead. +func (*UpdateQaReq_Option) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *UpdateQaReq_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateQaReq_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateQaReq_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UpdateQaReq_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type QaGroupSelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //题库ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //题库对外id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //标题 + QaNum int64 `protobuf:"varint,4,opt,name=qa_num,json=qaNum,proto3" json:"qa_num,omitempty"` //题目数量 +} + +func (x *QaGroupSelectRes_One) Reset() { + *x = QaGroupSelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaGroupSelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaGroupSelectRes_One) ProtoMessage() {} + +func (x *QaGroupSelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[27] + 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 QaGroupSelectRes_One.ProtoReflect.Descriptor instead. +func (*QaGroupSelectRes_One) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{17, 0} +} + +func (x *QaGroupSelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaGroupSelectRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *QaGroupSelectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaGroupSelectRes_One) GetQaNum() int64 { + if x != nil { + return x.QaNum + } + return 0 +} + +type QaRandRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //问题ID + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //问题对外id + Mark string `protobuf:"bytes,3,opt,name=mark,proto3" json:"mark,omitempty"` //问题类型(image_text-图文,video-视频,audio-音频) + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //题目 + CoverUrl string `protobuf:"bytes,5,opt,name=cover_url,json=coverUrl,proto3" json:"cover_url,omitempty"` //封面图 + LinkUrl string `protobuf:"bytes,6,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //附件地址 + ExplainText string `protobuf:"bytes,7,opt,name=explain_text,json=explainText,proto3" json:"explain_text,omitempty"` //答案解析 + ExplainImg string `protobuf:"bytes,8,opt,name=explain_img,json=explainImg,proto3" json:"explain_img,omitempty"` //答案解析图 + Options []*QaRandRes_Option `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` //选项 + CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + AnswerMark string `protobuf:"bytes,11,opt,name=answer_mark,json=answerMark,proto3" json:"answer_mark,omitempty"` //答案类型(image_text-图文,text-文本) +} + +func (x *QaRandRes_One) Reset() { + *x = QaRandRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaRandRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaRandRes_One) ProtoMessage() {} + +func (x *QaRandRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[28] + 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 QaRandRes_One.ProtoReflect.Descriptor instead. +func (*QaRandRes_One) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{19, 0} +} + +func (x *QaRandRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaRandRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *QaRandRes_One) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *QaRandRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaRandRes_One) GetCoverUrl() string { + if x != nil { + return x.CoverUrl + } + return "" +} + +func (x *QaRandRes_One) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *QaRandRes_One) GetExplainText() string { + if x != nil { + return x.ExplainText + } + return "" +} + +func (x *QaRandRes_One) GetExplainImg() string { + if x != nil { + return x.ExplainImg + } + return "" +} + +func (x *QaRandRes_One) GetOptions() []*QaRandRes_Option { + if x != nil { + return x.Options + } + return nil +} + +func (x *QaRandRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *QaRandRes_One) GetAnswerMark() string { + if x != nil { + return x.AnswerMark + } + return "" +} + +type QaRandRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *QaRandRes_Option) Reset() { + *x = QaRandRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaRandRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaRandRes_Option) ProtoMessage() {} + +func (x *QaRandRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[29] + 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 QaRandRes_Option.ProtoReflect.Descriptor instead. +func (*QaRandRes_Option) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{19, 1} +} + +func (x *QaRandRes_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaRandRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaRandRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *QaRandRes_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +type QaShowRes_Option struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //选项id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //答案内容 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //答案图片 + IsRight int32 `protobuf:"varint,4,opt,name=is_right,json=isRight,proto3" json:"is_right,omitempty"` //是否正确答案(1-是,0-否) +} + +func (x *QaShowRes_Option) Reset() { + *x = QaShowRes_Option{} + if protoimpl.UnsafeEnabled { + mi := &file_w_library_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QaShowRes_Option) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QaShowRes_Option) ProtoMessage() {} + +func (x *QaShowRes_Option) ProtoReflect() protoreflect.Message { + mi := &file_w_library_proto_msgTypes[30] + 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 QaShowRes_Option.ProtoReflect.Descriptor instead. +func (*QaShowRes_Option) Descriptor() ([]byte, []int) { + return file_w_library_proto_rawDescGZIP(), []int{21, 0} +} + +func (x *QaShowRes_Option) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *QaShowRes_Option) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *QaShowRes_Option) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *QaShowRes_Option) GetIsRight() int32 { + if x != nil { + return x.IsRight + } + return 0 +} + +var File_w_library_proto protoreflect.FileDescriptor + +var file_w_library_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x22, 0x79, + 0x0a, 0x0a, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, + 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, + 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xd3, 0x01, 0x0a, 0x0a, 0x51, 0x61, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, + 0x7e, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x71, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x71, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x4f, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x12, + 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x73, 0x22, 0x54, 0x0a, 0x11, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x65, 0x73, 0x74, + 0x72, 0x6f, 0x79, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, 0x88, 0x01, + 0x0a, 0x09, 0x51, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0d, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x85, 0x04, 0x0a, 0x09, 0x51, 0x61, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x70, 0x62, 0x2e, 0x51, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, + 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xcd, 0x02, 0x0a, + 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, + 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x12, + 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x54, 0x65, + 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, + 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x49, 0x6d, 0x67, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x70, 0x62, 0x2e, 0x51, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x61, + 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x1a, 0x62, 0x0a, 0x06, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, + 0x22, 0x85, 0x03, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x52, 0x65, 0x71, 0x12, + 0x22, 0x0a, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, + 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, + 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x6c, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, + 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x6c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, + 0x52, 0x65, 0x71, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x6d, 0x61, + 0x72, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, + 0x4d, 0x61, 0x72, 0x6b, 0x1a, 0x52, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, 0x74, 0x22, 0x0c, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x51, 0x61, 0x52, 0x65, 0x73, 0x22, 0x8c, 0x03, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x51, 0x61, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, + 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x54, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, + 0x69, 0x6d, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x6c, 0x61, + 0x69, 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x52, 0x65, 0x71, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4d, 0x61, 0x72, + 0x6b, 0x1a, 0x62, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, + 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, + 0x52, 0x69, 0x67, 0x68, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, + 0x61, 0x52, 0x65, 0x73, 0x22, 0x27, 0x0a, 0x0c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x51, + 0x61, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x0e, 0x0a, + 0x0c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x52, 0x65, 0x73, 0x22, 0x4e, 0x0a, + 0x10, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xa6, 0x01, + 0x0a, 0x10, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x12, 0x35, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, + 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x5b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x15, 0x0a, 0x06, 0x71, 0x61, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x71, 0x61, 0x4e, 0x75, 0x6d, 0x22, 0x86, 0x01, 0x0a, 0x09, 0x51, 0x61, 0x52, 0x61, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, + 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, + 0xef, 0x03, 0x0a, 0x09, 0x51, 0x61, 0x52, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x12, 0x2e, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, + 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x52, 0x61, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xcd, 0x02, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, + 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x54, + 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x52, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x1a, 0x62, 0x0a, + 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, + 0x74, 0x22, 0x24, 0x0a, 0x09, 0x51, 0x61, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xb7, 0x03, 0x0a, 0x09, 0x51, 0x61, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, + 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, + 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x54, + 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x6d, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x49, 0x6d, 0x67, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x1a, 0x62, 0x0a, + 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x72, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x73, 0x52, 0x69, 0x67, 0x68, + 0x74, 0x32, 0x87, 0x06, 0x0a, 0x08, 0x57, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x3d, + 0x0a, 0x07, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x6c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, + 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, + 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x2e, + 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, + 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, + 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0d, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1d, 0x2e, 0x77, + 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, + 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0e, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1e, + 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, + 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1e, + 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, + 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x3a, 0x0a, 0x06, 0x51, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x6c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, + 0x2e, 0x51, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x07, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x52, 0x65, 0x71, + 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x51, 0x61, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x08, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x52, 0x65, + 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x51, 0x61, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x43, 0x0a, + 0x09, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x6c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x51, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x51, 0x61, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0d, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, + 0x62, 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, + 0x2e, 0x51, 0x61, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x06, 0x51, 0x61, 0x52, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, + 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x52, 0x61, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x52, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x3a, 0x0a, 0x06, 0x51, 0x61, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x6c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x51, 0x61, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x2e, + 0x51, 0x61, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, 0x2e, + 0x2f, 0x3b, 0x77, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_library_proto_rawDescOnce sync.Once + file_w_library_proto_rawDescData = file_w_library_proto_rawDesc +) + +func file_w_library_proto_rawDescGZIP() []byte { + file_w_library_proto_rawDescOnce.Do(func() { + file_w_library_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_library_proto_rawDescData) + }) + return file_w_library_proto_rawDescData +} + +var file_w_library_proto_msgTypes = make([]protoimpl.MessageInfo, 31) +var file_w_library_proto_goTypes = []interface{}{ + (*QaGroupReq)(nil), // 0: w_librarypb.QaGroupReq + (*QaGroupRes)(nil), // 1: w_librarypb.QaGroupRes + (*StoreQaGroupReq)(nil), // 2: w_librarypb.StoreQaGroupReq + (*StoreQaGroupRes)(nil), // 3: w_librarypb.StoreQaGroupRes + (*UpdateQaGroupReq)(nil), // 4: w_librarypb.UpdateQaGroupReq + (*UpdateQaGroupRes)(nil), // 5: w_librarypb.UpdateQaGroupRes + (*DestroyQaGroupReq)(nil), // 6: w_librarypb.DestroyQaGroupReq + (*DestroyQaGroupRes)(nil), // 7: w_librarypb.DestroyQaGroupRes + (*QaListReq)(nil), // 8: w_librarypb.QaListReq + (*QaListRes)(nil), // 9: w_librarypb.QaListRes + (*StoreQaReq)(nil), // 10: w_librarypb.StoreQaReq + (*StoreQaRes)(nil), // 11: w_librarypb.StoreQaRes + (*UpdateQaReq)(nil), // 12: w_librarypb.UpdateQaReq + (*UpdateQaRes)(nil), // 13: w_librarypb.UpdateQaRes + (*DestroyQaReq)(nil), // 14: w_librarypb.DestroyQaReq + (*DestroyQaRes)(nil), // 15: w_librarypb.DestroyQaRes + (*QaGroupSelectReq)(nil), // 16: w_librarypb.QaGroupSelectReq + (*QaGroupSelectRes)(nil), // 17: w_librarypb.QaGroupSelectRes + (*QaRandReq)(nil), // 18: w_librarypb.QaRandReq + (*QaRandRes)(nil), // 19: w_librarypb.QaRandRes + (*QaShowReq)(nil), // 20: w_librarypb.QaShowReq + (*QaShowRes)(nil), // 21: w_librarypb.QaShowRes + (*QaGroupRes_One)(nil), // 22: w_librarypb.QaGroupRes.One + (*QaListRes_One)(nil), // 23: w_librarypb.QaListRes.One + (*QaListRes_Option)(nil), // 24: w_librarypb.QaListRes.Option + (*StoreQaReq_Option)(nil), // 25: w_librarypb.StoreQaReq.Option + (*UpdateQaReq_Option)(nil), // 26: w_librarypb.UpdateQaReq.Option + (*QaGroupSelectRes_One)(nil), // 27: w_librarypb.QaGroupSelectRes.One + (*QaRandRes_One)(nil), // 28: w_librarypb.QaRandRes.One + (*QaRandRes_Option)(nil), // 29: w_librarypb.QaRandRes.Option + (*QaShowRes_Option)(nil), // 30: w_librarypb.QaShowRes.Option +} +var file_w_library_proto_depIdxs = []int32{ + 22, // 0: w_librarypb.QaGroupRes.list:type_name -> w_librarypb.QaGroupRes.One + 23, // 1: w_librarypb.QaListRes.list:type_name -> w_librarypb.QaListRes.One + 25, // 2: w_librarypb.StoreQaReq.options:type_name -> w_librarypb.StoreQaReq.Option + 26, // 3: w_librarypb.UpdateQaReq.options:type_name -> w_librarypb.UpdateQaReq.Option + 27, // 4: w_librarypb.QaGroupSelectRes.list:type_name -> w_librarypb.QaGroupSelectRes.One + 28, // 5: w_librarypb.QaRandRes.list:type_name -> w_librarypb.QaRandRes.One + 30, // 6: w_librarypb.QaShowRes.options:type_name -> w_librarypb.QaShowRes.Option + 24, // 7: w_librarypb.QaListRes.One.options:type_name -> w_librarypb.QaListRes.Option + 29, // 8: w_librarypb.QaRandRes.One.options:type_name -> w_librarypb.QaRandRes.Option + 0, // 9: w_librarypb.WLibrary.QaGroup:input_type -> w_librarypb.QaGroupReq + 2, // 10: w_librarypb.WLibrary.StoreQaGroup:input_type -> w_librarypb.StoreQaGroupReq + 4, // 11: w_librarypb.WLibrary.UpdateQaGroup:input_type -> w_librarypb.UpdateQaGroupReq + 6, // 12: w_librarypb.WLibrary.DestroyQaGroup:input_type -> w_librarypb.DestroyQaGroupReq + 8, // 13: w_librarypb.WLibrary.QaList:input_type -> w_librarypb.QaListReq + 10, // 14: w_librarypb.WLibrary.StoreQa:input_type -> w_librarypb.StoreQaReq + 12, // 15: w_librarypb.WLibrary.UpdateQa:input_type -> w_librarypb.UpdateQaReq + 14, // 16: w_librarypb.WLibrary.DestroyQa:input_type -> w_librarypb.DestroyQaReq + 16, // 17: w_librarypb.WLibrary.QaGroupSelect:input_type -> w_librarypb.QaGroupSelectReq + 18, // 18: w_librarypb.WLibrary.QaRand:input_type -> w_librarypb.QaRandReq + 20, // 19: w_librarypb.WLibrary.QaShow:input_type -> w_librarypb.QaShowReq + 1, // 20: w_librarypb.WLibrary.QaGroup:output_type -> w_librarypb.QaGroupRes + 3, // 21: w_librarypb.WLibrary.StoreQaGroup:output_type -> w_librarypb.StoreQaGroupRes + 5, // 22: w_librarypb.WLibrary.UpdateQaGroup:output_type -> w_librarypb.UpdateQaGroupRes + 7, // 23: w_librarypb.WLibrary.DestroyQaGroup:output_type -> w_librarypb.DestroyQaGroupRes + 9, // 24: w_librarypb.WLibrary.QaList:output_type -> w_librarypb.QaListRes + 11, // 25: w_librarypb.WLibrary.StoreQa:output_type -> w_librarypb.StoreQaRes + 13, // 26: w_librarypb.WLibrary.UpdateQa:output_type -> w_librarypb.UpdateQaRes + 15, // 27: w_librarypb.WLibrary.DestroyQa:output_type -> w_librarypb.DestroyQaRes + 17, // 28: w_librarypb.WLibrary.QaGroupSelect:output_type -> w_librarypb.QaGroupSelectRes + 19, // 29: w_librarypb.WLibrary.QaRand:output_type -> w_librarypb.QaRandRes + 21, // 30: w_librarypb.WLibrary.QaShow:output_type -> w_librarypb.QaShowRes + 20, // [20:31] is the sub-list for method output_type + 9, // [9:20] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_w_library_proto_init() } +func file_w_library_proto_init() { + if File_w_library_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_library_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaGroupRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreQaGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreQaGroupRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateQaGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateQaGroupRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyQaGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyQaGroupRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreQaReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreQaRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateQaReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateQaRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyQaReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyQaRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaGroupSelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaGroupSelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaRandReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaRandRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaGroupRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaListRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreQaReq_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateQaReq_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaGroupSelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaRandRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaRandRes_Option); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_library_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QaShowRes_Option); 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_w_library_proto_rawDesc, + NumEnums: 0, + NumMessages: 31, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_library_proto_goTypes, + DependencyIndexes: file_w_library_proto_depIdxs, + MessageInfos: file_w_library_proto_msgTypes, + }.Build() + File_w_library_proto = out.File + file_w_library_proto_rawDesc = nil + file_w_library_proto_goTypes = nil + file_w_library_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_library/w_library.pb.micro.go b/proto/go_proto/w_library/w_library.pb.micro.go new file mode 100644 index 0000000..259deab --- /dev/null +++ b/proto/go_proto/w_library/w_library.pb.micro.go @@ -0,0 +1,279 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_library.proto + +package w_librarypb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WLibrary service + +func NewWLibraryEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WLibrary service + +type WLibraryService interface { + // QaGroup 题库列表 + QaGroup(ctx context.Context, in *QaGroupReq, opts ...client.CallOption) (*QaGroupRes, error) + // StoreQaGroup 创建题库 + StoreQaGroup(ctx context.Context, in *StoreQaGroupReq, opts ...client.CallOption) (*StoreQaGroupRes, error) + // UpdateQaGroup 更新题库 + UpdateQaGroup(ctx context.Context, in *UpdateQaGroupReq, opts ...client.CallOption) (*UpdateQaGroupRes, error) + // DestroyQaGroup 删除题库 + DestroyQaGroup(ctx context.Context, in *DestroyQaGroupReq, opts ...client.CallOption) (*DestroyQaGroupRes, error) + // QaList 问题列表 + QaList(ctx context.Context, in *QaListReq, opts ...client.CallOption) (*QaListRes, error) + // StoreQa 问题列表 + StoreQa(ctx context.Context, in *StoreQaReq, opts ...client.CallOption) (*StoreQaRes, error) + // UpdateQa 问题列表 + UpdateQa(ctx context.Context, in *UpdateQaReq, opts ...client.CallOption) (*UpdateQaRes, error) + // DestroyQa 问题列表 + DestroyQa(ctx context.Context, in *DestroyQaReq, opts ...client.CallOption) (*DestroyQaRes, error) + // QaGroupSelect 题库选项 + QaGroupSelect(ctx context.Context, in *QaGroupSelectReq, opts ...client.CallOption) (*QaGroupSelectRes, error) + // QaRand 随机问题 + QaRand(ctx context.Context, in *QaRandReq, opts ...client.CallOption) (*QaRandRes, error) + // QaShow 问题详情 + QaShow(ctx context.Context, in *QaShowReq, opts ...client.CallOption) (*QaShowRes, error) +} + +type wLibraryService struct { + c client.Client + name string +} + +func NewWLibraryService(name string, c client.Client) WLibraryService { + return &wLibraryService{ + c: c, + name: name, + } +} + +func (c *wLibraryService) QaGroup(ctx context.Context, in *QaGroupReq, opts ...client.CallOption) (*QaGroupRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.QaGroup", in) + out := new(QaGroupRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) StoreQaGroup(ctx context.Context, in *StoreQaGroupReq, opts ...client.CallOption) (*StoreQaGroupRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.StoreQaGroup", in) + out := new(StoreQaGroupRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) UpdateQaGroup(ctx context.Context, in *UpdateQaGroupReq, opts ...client.CallOption) (*UpdateQaGroupRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.UpdateQaGroup", in) + out := new(UpdateQaGroupRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) DestroyQaGroup(ctx context.Context, in *DestroyQaGroupReq, opts ...client.CallOption) (*DestroyQaGroupRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.DestroyQaGroup", in) + out := new(DestroyQaGroupRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) QaList(ctx context.Context, in *QaListReq, opts ...client.CallOption) (*QaListRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.QaList", in) + out := new(QaListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) StoreQa(ctx context.Context, in *StoreQaReq, opts ...client.CallOption) (*StoreQaRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.StoreQa", in) + out := new(StoreQaRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) UpdateQa(ctx context.Context, in *UpdateQaReq, opts ...client.CallOption) (*UpdateQaRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.UpdateQa", in) + out := new(UpdateQaRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) DestroyQa(ctx context.Context, in *DestroyQaReq, opts ...client.CallOption) (*DestroyQaRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.DestroyQa", in) + out := new(DestroyQaRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) QaGroupSelect(ctx context.Context, in *QaGroupSelectReq, opts ...client.CallOption) (*QaGroupSelectRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.QaGroupSelect", in) + out := new(QaGroupSelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) QaRand(ctx context.Context, in *QaRandReq, opts ...client.CallOption) (*QaRandRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.QaRand", in) + out := new(QaRandRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wLibraryService) QaShow(ctx context.Context, in *QaShowReq, opts ...client.CallOption) (*QaShowRes, error) { + req := c.c.NewRequest(c.name, "WLibrary.QaShow", in) + out := new(QaShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WLibrary service + +type WLibraryHandler interface { + // QaGroup 题库列表 + QaGroup(context.Context, *QaGroupReq, *QaGroupRes) error + // StoreQaGroup 创建题库 + StoreQaGroup(context.Context, *StoreQaGroupReq, *StoreQaGroupRes) error + // UpdateQaGroup 更新题库 + UpdateQaGroup(context.Context, *UpdateQaGroupReq, *UpdateQaGroupRes) error + // DestroyQaGroup 删除题库 + DestroyQaGroup(context.Context, *DestroyQaGroupReq, *DestroyQaGroupRes) error + // QaList 问题列表 + QaList(context.Context, *QaListReq, *QaListRes) error + // StoreQa 问题列表 + StoreQa(context.Context, *StoreQaReq, *StoreQaRes) error + // UpdateQa 问题列表 + UpdateQa(context.Context, *UpdateQaReq, *UpdateQaRes) error + // DestroyQa 问题列表 + DestroyQa(context.Context, *DestroyQaReq, *DestroyQaRes) error + // QaGroupSelect 题库选项 + QaGroupSelect(context.Context, *QaGroupSelectReq, *QaGroupSelectRes) error + // QaRand 随机问题 + QaRand(context.Context, *QaRandReq, *QaRandRes) error + // QaShow 问题详情 + QaShow(context.Context, *QaShowReq, *QaShowRes) error +} + +func RegisterWLibraryHandler(s server.Server, hdlr WLibraryHandler, opts ...server.HandlerOption) error { + type wLibrary interface { + QaGroup(ctx context.Context, in *QaGroupReq, out *QaGroupRes) error + StoreQaGroup(ctx context.Context, in *StoreQaGroupReq, out *StoreQaGroupRes) error + UpdateQaGroup(ctx context.Context, in *UpdateQaGroupReq, out *UpdateQaGroupRes) error + DestroyQaGroup(ctx context.Context, in *DestroyQaGroupReq, out *DestroyQaGroupRes) error + QaList(ctx context.Context, in *QaListReq, out *QaListRes) error + StoreQa(ctx context.Context, in *StoreQaReq, out *StoreQaRes) error + UpdateQa(ctx context.Context, in *UpdateQaReq, out *UpdateQaRes) error + DestroyQa(ctx context.Context, in *DestroyQaReq, out *DestroyQaRes) error + QaGroupSelect(ctx context.Context, in *QaGroupSelectReq, out *QaGroupSelectRes) error + QaRand(ctx context.Context, in *QaRandReq, out *QaRandRes) error + QaShow(ctx context.Context, in *QaShowReq, out *QaShowRes) error + } + type WLibrary struct { + wLibrary + } + h := &wLibraryHandler{hdlr} + return s.Handle(s.NewHandler(&WLibrary{h}, opts...)) +} + +type wLibraryHandler struct { + WLibraryHandler +} + +func (h *wLibraryHandler) QaGroup(ctx context.Context, in *QaGroupReq, out *QaGroupRes) error { + return h.WLibraryHandler.QaGroup(ctx, in, out) +} + +func (h *wLibraryHandler) StoreQaGroup(ctx context.Context, in *StoreQaGroupReq, out *StoreQaGroupRes) error { + return h.WLibraryHandler.StoreQaGroup(ctx, in, out) +} + +func (h *wLibraryHandler) UpdateQaGroup(ctx context.Context, in *UpdateQaGroupReq, out *UpdateQaGroupRes) error { + return h.WLibraryHandler.UpdateQaGroup(ctx, in, out) +} + +func (h *wLibraryHandler) DestroyQaGroup(ctx context.Context, in *DestroyQaGroupReq, out *DestroyQaGroupRes) error { + return h.WLibraryHandler.DestroyQaGroup(ctx, in, out) +} + +func (h *wLibraryHandler) QaList(ctx context.Context, in *QaListReq, out *QaListRes) error { + return h.WLibraryHandler.QaList(ctx, in, out) +} + +func (h *wLibraryHandler) StoreQa(ctx context.Context, in *StoreQaReq, out *StoreQaRes) error { + return h.WLibraryHandler.StoreQa(ctx, in, out) +} + +func (h *wLibraryHandler) UpdateQa(ctx context.Context, in *UpdateQaReq, out *UpdateQaRes) error { + return h.WLibraryHandler.UpdateQa(ctx, in, out) +} + +func (h *wLibraryHandler) DestroyQa(ctx context.Context, in *DestroyQaReq, out *DestroyQaRes) error { + return h.WLibraryHandler.DestroyQa(ctx, in, out) +} + +func (h *wLibraryHandler) QaGroupSelect(ctx context.Context, in *QaGroupSelectReq, out *QaGroupSelectRes) error { + return h.WLibraryHandler.QaGroupSelect(ctx, in, out) +} + +func (h *wLibraryHandler) QaRand(ctx context.Context, in *QaRandReq, out *QaRandRes) error { + return h.WLibraryHandler.QaRand(ctx, in, out) +} + +func (h *wLibraryHandler) QaShow(ctx context.Context, in *QaShowReq, out *QaShowRes) error { + return h.WLibraryHandler.QaShow(ctx, in, out) +} diff --git a/proto/go_proto/w_mall/w_mall.pb.go b/proto/go_proto/w_mall/w_mall.pb.go new file mode 100644 index 0000000..5b26195 --- /dev/null +++ b/proto/go_proto/w_mall/w_mall.pb.go @@ -0,0 +1,3273 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_mall.proto + +package w_mallpb + +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 ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ProjectHashId string `protobuf:"bytes,3,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //商城标题 + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` //状态(1-使用中,2-暂未使用) + OrderBy []int32 `protobuf:"varint,6,rep,packed,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` //排序字段(1-创建最晚优先,2-创建最早优先,3-使用中优先,4-暂未使用优先) +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ListReq) GetOrderBy() []int32 { + if x != nil { + return x.OrderBy + } + return nil +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //总数 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type StoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //商城标题 +} + +func (x *StoreReq) Reset() { + *x = StoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq) ProtoMessage() {} + +func (x *StoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 StoreReq.ProtoReflect.Descriptor instead. +func (*StoreReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{2} +} + +func (x *StoreReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *StoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type StoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城id +} + +func (x *StoreRes) Reset() { + *x = StoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreRes) ProtoMessage() {} + +func (x *StoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 StoreRes.ProtoReflect.Descriptor instead. +func (*StoreRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{3} +} + +func (x *StoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type UpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //商城id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //商城标题 +} + +func (x *UpdateReq) Reset() { + *x = UpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq) ProtoMessage() {} + +func (x *UpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 UpdateReq.ProtoReflect.Descriptor instead. +func (*UpdateReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type UpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城id +} + +func (x *UpdateRes) Reset() { + *x = UpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRes) ProtoMessage() {} + +func (x *UpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 UpdateRes.ProtoReflect.Descriptor instead. +func (*UpdateRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //商城id +} + +func (x *DestroyReq) Reset() { + *x = DestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyReq) ProtoMessage() {} + +func (x *DestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 DestroyReq.ProtoReflect.Descriptor instead. +func (*DestroyReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{6} +} + +func (x *DestroyReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *DestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城id +} + +func (x *DestroyRes) Reset() { + *x = DestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyRes) ProtoMessage() {} + +func (x *DestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 DestroyRes.ProtoReflect.Descriptor instead. +func (*DestroyRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{7} +} + +func (x *DestroyRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ItemListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MallId int64 `protobuf:"varint,1,opt,name=mall_id,json=mallId,proto3" json:"mall_id,omitempty"` //商城ID + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` //状态(1-上架,2-下架) +} + +func (x *ItemListReq) Reset() { + *x = ItemListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemListReq) ProtoMessage() {} + +func (x *ItemListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemListReq.ProtoReflect.Descriptor instead. +func (*ItemListReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{8} +} + +func (x *ItemListReq) GetMallId() int64 { + if x != nil { + return x.MallId + } + return 0 +} + +func (x *ItemListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ItemListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ItemListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *ItemListRes) Reset() { + *x = ItemListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemListRes) ProtoMessage() {} + +func (x *ItemListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemListRes.ProtoReflect.Descriptor instead. +func (*ItemListRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{9} +} + +func (x *ItemListRes) GetList() []*ItemListRes_One { + if x != nil { + return x.List + } + return nil +} + +type ItemStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MallId int64 `protobuf:"varint,1,opt,name=mall_id,json=mallId,proto3" json:"mall_id,omitempty"` //商城ID + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + CoinNum int32 `protobuf:"varint,3,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //奖品金币数量 + Stock int64 `protobuf:"varint,4,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + UpType int32 `protobuf:"varint,5,opt,name=up_type,json=upType,proto3" json:"up_type,omitempty"` //上架类型(1-立即上架,2-指定时间) + UpCustom int64 `protobuf:"varint,6,opt,name=up_custom,json=upCustom,proto3" json:"up_custom,omitempty"` //自定义上架时间 + UpShow []string `protobuf:"bytes,7,rep,name=up_show,json=upShow,proto3" json:"up_show,omitempty"` //指定上架展示配置 + DownType int32 `protobuf:"varint,8,opt,name=down_type,json=downType,proto3" json:"down_type,omitempty"` //下架类型(1-永久上架,2-指定时间) + DownCustom int64 `protobuf:"varint,9,opt,name=down_custom,json=downCustom,proto3" json:"down_custom,omitempty"` //自定义下架时间 + DownShow []string `protobuf:"bytes,10,rep,name=down_show,json=downShow,proto3" json:"down_show,omitempty"` //指定下架展示配置 +} + +func (x *ItemStoreReq) Reset() { + *x = ItemStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemStoreReq) ProtoMessage() {} + +func (x *ItemStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemStoreReq.ProtoReflect.Descriptor instead. +func (*ItemStoreReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{10} +} + +func (x *ItemStoreReq) GetMallId() int64 { + if x != nil { + return x.MallId + } + return 0 +} + +func (x *ItemStoreReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ItemStoreReq) GetCoinNum() int32 { + if x != nil { + return x.CoinNum + } + return 0 +} + +func (x *ItemStoreReq) GetStock() int64 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ItemStoreReq) GetUpType() int32 { + if x != nil { + return x.UpType + } + return 0 +} + +func (x *ItemStoreReq) GetUpCustom() int64 { + if x != nil { + return x.UpCustom + } + return 0 +} + +func (x *ItemStoreReq) GetUpShow() []string { + if x != nil { + return x.UpShow + } + return nil +} + +func (x *ItemStoreReq) GetDownType() int32 { + if x != nil { + return x.DownType + } + return 0 +} + +func (x *ItemStoreReq) GetDownCustom() int64 { + if x != nil { + return x.DownCustom + } + return 0 +} + +func (x *ItemStoreReq) GetDownShow() []string { + if x != nil { + return x.DownShow + } + return nil +} + +type ItemStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id +} + +func (x *ItemStoreRes) Reset() { + *x = ItemStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemStoreRes) ProtoMessage() {} + +func (x *ItemStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemStoreRes.ProtoReflect.Descriptor instead. +func (*ItemStoreRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{11} +} + +func (x *ItemStoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ItemUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + CoinNum int32 `protobuf:"varint,3,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //奖品金币数量 + Stock int64 `protobuf:"varint,4,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + UpType int32 `protobuf:"varint,5,opt,name=up_type,json=upType,proto3" json:"up_type,omitempty"` //上架类型(1-立即上架,2-指定时间) + UpCustom int64 `protobuf:"varint,6,opt,name=up_custom,json=upCustom,proto3" json:"up_custom,omitempty"` //自定义上架时间 + UpShow []string `protobuf:"bytes,7,rep,name=up_show,json=upShow,proto3" json:"up_show,omitempty"` //指定上架展示配置 ["client","countdown"] + DownType int32 `protobuf:"varint,8,opt,name=down_type,json=downType,proto3" json:"down_type,omitempty"` //下架类型(1-永久上架,2-指定时间) + DownCustom int64 `protobuf:"varint,9,opt,name=down_custom,json=downCustom,proto3" json:"down_custom,omitempty"` //自定义下架时间 + DownShow []string `protobuf:"bytes,10,rep,name=down_show,json=downShow,proto3" json:"down_show,omitempty"` //指定下架展示配置 ["countdown"] +} + +func (x *ItemUpdateReq) Reset() { + *x = ItemUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemUpdateReq) ProtoMessage() {} + +func (x *ItemUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemUpdateReq.ProtoReflect.Descriptor instead. +func (*ItemUpdateReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{12} +} + +func (x *ItemUpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ItemUpdateReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ItemUpdateReq) GetCoinNum() int32 { + if x != nil { + return x.CoinNum + } + return 0 +} + +func (x *ItemUpdateReq) GetStock() int64 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ItemUpdateReq) GetUpType() int32 { + if x != nil { + return x.UpType + } + return 0 +} + +func (x *ItemUpdateReq) GetUpCustom() int64 { + if x != nil { + return x.UpCustom + } + return 0 +} + +func (x *ItemUpdateReq) GetUpShow() []string { + if x != nil { + return x.UpShow + } + return nil +} + +func (x *ItemUpdateReq) GetDownType() int32 { + if x != nil { + return x.DownType + } + return 0 +} + +func (x *ItemUpdateReq) GetDownCustom() int64 { + if x != nil { + return x.DownCustom + } + return 0 +} + +func (x *ItemUpdateReq) GetDownShow() []string { + if x != nil { + return x.DownShow + } + return nil +} + +type ItemUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id +} + +func (x *ItemUpdateRes) Reset() { + *x = ItemUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemUpdateRes) ProtoMessage() {} + +func (x *ItemUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemUpdateRes.ProtoReflect.Descriptor instead. +func (*ItemUpdateRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{13} +} + +func (x *ItemUpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ItemStatusReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` //状态(1-上架,2-下架,3-删除) +} + +func (x *ItemStatusReq) Reset() { + *x = ItemStatusReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemStatusReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemStatusReq) ProtoMessage() {} + +func (x *ItemStatusReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemStatusReq.ProtoReflect.Descriptor instead. +func (*ItemStatusReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{14} +} + +func (x *ItemStatusReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ItemStatusReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type ItemStatusRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id +} + +func (x *ItemStatusRes) Reset() { + *x = ItemStatusRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemStatusRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemStatusRes) ProtoMessage() {} + +func (x *ItemStatusRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemStatusRes.ProtoReflect.Descriptor instead. +func (*ItemStatusRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{15} +} + +func (x *ItemStatusRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ItemSortReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` //奖品id列表 +} + +func (x *ItemSortReq) Reset() { + *x = ItemSortReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemSortReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemSortReq) ProtoMessage() {} + +func (x *ItemSortReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemSortReq.ProtoReflect.Descriptor instead. +func (*ItemSortReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{16} +} + +func (x *ItemSortReq) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +type ItemSortRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ItemSortRes) Reset() { + *x = ItemSortRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemSortRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemSortRes) ProtoMessage() {} + +func (x *ItemSortRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 ItemSortRes.ProtoReflect.Descriptor instead. +func (*ItemSortRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{17} +} + +type SelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *SelectReq) Reset() { + *x = SelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectReq) ProtoMessage() {} + +func (x *SelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 SelectReq.ProtoReflect.Descriptor instead. +func (*SelectReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{18} +} + +func (x *SelectReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type SelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*SelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *SelectRes) Reset() { + *x = SelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes) ProtoMessage() {} + +func (x *SelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 SelectRes.ProtoReflect.Descriptor instead. +func (*SelectRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{19} +} + +func (x *SelectRes) GetList() []*SelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type RelateMallReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + Source int32 `protobuf:"varint,2,opt,name=source,proto3" json:"source,omitempty"` //来源(1-任务中心,2-活动) + RelateId int64 `protobuf:"varint,3,opt,name=relate_id,json=relateId,proto3" json:"relate_id,omitempty"` //关联id + RelateTable string `protobuf:"bytes,4,opt,name=relate_table,json=relateTable,proto3" json:"relate_table,omitempty"` //关联表名字,如果不是dplk_db库,建议带上库名字如dbname.relate_table_name + MallIds []int64 `protobuf:"varint,5,rep,packed,name=mall_ids,json=mallIds,proto3" json:"mall_ids,omitempty"` //关联的商城id集合 +} + +func (x *RelateMallReq) Reset() { + *x = RelateMallReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelateMallReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelateMallReq) ProtoMessage() {} + +func (x *RelateMallReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 RelateMallReq.ProtoReflect.Descriptor instead. +func (*RelateMallReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{20} +} + +func (x *RelateMallReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *RelateMallReq) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *RelateMallReq) GetRelateId() int64 { + if x != nil { + return x.RelateId + } + return 0 +} + +func (x *RelateMallReq) GetRelateTable() string { + if x != nil { + return x.RelateTable + } + return "" +} + +func (x *RelateMallReq) GetMallIds() []int64 { + if x != nil { + return x.MallIds + } + return nil +} + +type RelateMallRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RelateMallRes) Reset() { + *x = RelateMallRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelateMallRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelateMallRes) ProtoMessage() {} + +func (x *RelateMallRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 RelateMallRes.ProtoReflect.Descriptor instead. +func (*RelateMallRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{21} +} + +type UserItemListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MallId int64 `protobuf:"varint,1,opt,name=mall_id,json=mallId,proto3" json:"mall_id,omitempty"` //商城ID + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标记 + Source int32 `protobuf:"varint,4,opt,name=source,proto3" json:"source,omitempty"` //来源(1-任务中心,2-活动) + SourceId int64 `protobuf:"varint,5,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` //来源id +} + +func (x *UserItemListReq) Reset() { + *x = UserItemListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserItemListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserItemListReq) ProtoMessage() {} + +func (x *UserItemListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 UserItemListReq.ProtoReflect.Descriptor instead. +func (*UserItemListReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{22} +} + +func (x *UserItemListReq) GetMallId() int64 { + if x != nil { + return x.MallId + } + return 0 +} + +func (x *UserItemListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserItemListReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *UserItemListReq) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *UserItemListReq) GetSourceId() int64 { + if x != nil { + return x.SourceId + } + return 0 +} + +type UserItemListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UserItemListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *UserItemListRes) Reset() { + *x = UserItemListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserItemListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserItemListRes) ProtoMessage() {} + +func (x *UserItemListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_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 UserItemListRes.ProtoReflect.Descriptor instead. +func (*UserItemListRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{23} +} + +func (x *UserItemListRes) GetList() []*UserItemListRes_One { + if x != nil { + return x.List + } + return nil +} + +type ExchangeItemReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + MallItemId int64 `protobuf:"varint,2,opt,name=mall_item_id,json=mallItemId,proto3" json:"mall_item_id,omitempty"` //商城商品id + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + LangMark string `protobuf:"bytes,4,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标记 + PointSource int32 `protobuf:"varint,5,opt,name=point_source,json=pointSource,proto3" json:"point_source,omitempty"` //积分来源(0-应用内部,1-系统自带) + UrlId int64 `protobuf:"varint,6,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //请求地址id + Source int32 `protobuf:"varint,7,opt,name=source,proto3" json:"source,omitempty"` //来源(1-任务中心,2-活动) + SourceData *ExchangeItemReq_SourceData `protobuf:"bytes,8,opt,name=source_data,json=sourceData,proto3" json:"source_data,omitempty"` //来源数据 +} + +func (x *ExchangeItemReq) Reset() { + *x = ExchangeItemReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeItemReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemReq) ProtoMessage() {} + +func (x *ExchangeItemReq) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[24] + 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 ExchangeItemReq.ProtoReflect.Descriptor instead. +func (*ExchangeItemReq) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{24} +} + +func (x *ExchangeItemReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *ExchangeItemReq) GetMallItemId() int64 { + if x != nil { + return x.MallItemId + } + return 0 +} + +func (x *ExchangeItemReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ExchangeItemReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ExchangeItemReq) GetPointSource() int32 { + if x != nil { + return x.PointSource + } + return 0 +} + +func (x *ExchangeItemReq) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *ExchangeItemReq) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *ExchangeItemReq) GetSourceData() *ExchangeItemReq_SourceData { + if x != nil { + return x.SourceData + } + return nil +} + +type ExchangeItemRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-成功,1-库存不足,2-兑换上限,3-商品已下架) + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //兑换记录id + RewardId int64 `protobuf:"varint,3,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,5,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //图片地址 + KvData []*ExchangeItemRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //奖品对应的键值数据 + ReceiveType int32 `protobuf:"varint,7,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + Contact string `protobuf:"bytes,8,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + OpenToUse int32 `protobuf:"varint,9,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + CustomRewardVal string `protobuf:"bytes,10,opt,name=custom_reward_val,json=customRewardVal,proto3" json:"custom_reward_val,omitempty"` //自定义数据 + WebUrl string `protobuf:"bytes,11,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,12,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,13,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 + FailType string `protobuf:"bytes,14,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败类型 + FailMsg string `protobuf:"bytes,15,opt,name=fail_msg,json=failMsg,proto3" json:"fail_msg,omitempty"` //失败具体原因 +} + +func (x *ExchangeItemRes) Reset() { + *x = ExchangeItemRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeItemRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemRes) ProtoMessage() {} + +func (x *ExchangeItemRes) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[25] + 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 ExchangeItemRes.ProtoReflect.Descriptor instead. +func (*ExchangeItemRes) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{25} +} + +func (x *ExchangeItemRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ExchangeItemRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ExchangeItemRes) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ExchangeItemRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ExchangeItemRes) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ExchangeItemRes) GetKvData() []*ExchangeItemRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ExchangeItemRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ExchangeItemRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ExchangeItemRes) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ExchangeItemRes) GetCustomRewardVal() string { + if x != nil { + return x.CustomRewardVal + } + return "" +} + +func (x *ExchangeItemRes) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ExchangeItemRes) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ExchangeItemRes) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +func (x *ExchangeItemRes) GetFailType() string { + if x != nil { + return x.FailType + } + return "" +} + +func (x *ExchangeItemRes) GetFailMsg() string { + if x != nil { + return x.FailMsg + } + return "" +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //商城标题 + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //状态(1-使用中,2-暂未使用) + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Relates []*ListRes_Relate `protobuf:"bytes,5,rep,name=relates,proto3" json:"relates,omitempty"` //关联使用数据 + Rewards []*ListRes_Reward `protobuf:"bytes,6,rep,name=rewards,proto3" json:"rewards,omitempty"` //商城上架奖品 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[26] + 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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ListRes_One) GetRelates() []*ListRes_Relate { + if x != nil { + return x.Relates + } + return nil +} + +func (x *ListRes_One) GetRewards() []*ListRes_Reward { + if x != nil { + return x.Rewards + } + return nil +} + +type ListRes_Relate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //关系ID + Source int32 `protobuf:"varint,2,opt,name=source,proto3" json:"source,omitempty"` //来源(1-任务中心,2-活动) + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //来源标题 +} + +func (x *ListRes_Relate) Reset() { + *x = ListRes_Relate{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Relate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Relate) ProtoMessage() {} + +func (x *ListRes_Relate) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[27] + 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 ListRes_Relate.ProtoReflect.Descriptor instead. +func (*ListRes_Relate) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *ListRes_Relate) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_Relate) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *ListRes_Relate) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type ListRes_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片URL +} + +func (x *ListRes_Reward) Reset() { + *x = ListRes_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Reward) ProtoMessage() {} + +func (x *ListRes_Reward) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[28] + 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 ListRes_Reward.ProtoReflect.Descriptor instead. +func (*ListRes_Reward) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *ListRes_Reward) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_Reward) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_Reward) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +type ItemListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片URL + Stock int64 `protobuf:"varint,5,opt,name=stock,proto3" json:"stock,omitempty"` //奖品库存 + Remain int64 `protobuf:"varint,6,opt,name=remain,proto3" json:"remain,omitempty"` //剩余库存 + UpType int32 `protobuf:"varint,7,opt,name=up_type,json=upType,proto3" json:"up_type,omitempty"` //上架类型(1-立即上架,2-指定时间) + UpCustom int64 `protobuf:"varint,8,opt,name=up_custom,json=upCustom,proto3" json:"up_custom,omitempty"` //自定义上架时间 + UpAt int64 `protobuf:"varint,9,opt,name=up_at,json=upAt,proto3" json:"up_at,omitempty"` //上架时间 + UpFrom string `protobuf:"bytes,10,opt,name=up_from,json=upFrom,proto3" json:"up_from,omitempty"` //上架来源(auto-自定上架,manual-手动上架) + UpShow []string `protobuf:"bytes,11,rep,name=up_show,json=upShow,proto3" json:"up_show,omitempty"` //指定上架展示配置 + DownType int32 `protobuf:"varint,12,opt,name=down_type,json=downType,proto3" json:"down_type,omitempty"` //下架类型(1-永久上架,2-指定时间) + DownCustom int64 `protobuf:"varint,13,opt,name=down_custom,json=downCustom,proto3" json:"down_custom,omitempty"` //自定义下架时间 + DownAt int64 `protobuf:"varint,14,opt,name=down_at,json=downAt,proto3" json:"down_at,omitempty"` //下架时间 + DownFrom string `protobuf:"bytes,15,opt,name=down_from,json=downFrom,proto3" json:"down_from,omitempty"` //下架来源(auto-自定下架,manual-手动下架) + DownShow []string `protobuf:"bytes,16,rep,name=down_show,json=downShow,proto3" json:"down_show,omitempty"` //指定下架展示配置 + Status int32 `protobuf:"varint,17,opt,name=status,proto3" json:"status,omitempty"` //状态(1-上架,2-待上架,3-下架,4-删除) + CoinNum int32 `protobuf:"varint,18,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //奖品金币数量 + UseStock int64 `protobuf:"varint,19,opt,name=use_stock,json=useStock,proto3" json:"use_stock,omitempty"` //发放库存 +} + +func (x *ItemListRes_One) Reset() { + *x = ItemListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemListRes_One) ProtoMessage() {} + +func (x *ItemListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[29] + 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 ItemListRes_One.ProtoReflect.Descriptor instead. +func (*ItemListRes_One) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *ItemListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ItemListRes_One) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *ItemListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ItemListRes_One) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ItemListRes_One) GetStock() int64 { + if x != nil { + return x.Stock + } + return 0 +} + +func (x *ItemListRes_One) GetRemain() int64 { + if x != nil { + return x.Remain + } + return 0 +} + +func (x *ItemListRes_One) GetUpType() int32 { + if x != nil { + return x.UpType + } + return 0 +} + +func (x *ItemListRes_One) GetUpCustom() int64 { + if x != nil { + return x.UpCustom + } + return 0 +} + +func (x *ItemListRes_One) GetUpAt() int64 { + if x != nil { + return x.UpAt + } + return 0 +} + +func (x *ItemListRes_One) GetUpFrom() string { + if x != nil { + return x.UpFrom + } + return "" +} + +func (x *ItemListRes_One) GetUpShow() []string { + if x != nil { + return x.UpShow + } + return nil +} + +func (x *ItemListRes_One) GetDownType() int32 { + if x != nil { + return x.DownType + } + return 0 +} + +func (x *ItemListRes_One) GetDownCustom() int64 { + if x != nil { + return x.DownCustom + } + return 0 +} + +func (x *ItemListRes_One) GetDownAt() int64 { + if x != nil { + return x.DownAt + } + return 0 +} + +func (x *ItemListRes_One) GetDownFrom() string { + if x != nil { + return x.DownFrom + } + return "" +} + +func (x *ItemListRes_One) GetDownShow() []string { + if x != nil { + return x.DownShow + } + return nil +} + +func (x *ItemListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ItemListRes_One) GetCoinNum() int32 { + if x != nil { + return x.CoinNum + } + return 0 +} + +func (x *ItemListRes_One) GetUseStock() int64 { + if x != nil { + return x.UseStock + } + return 0 +} + +type SelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //商城标题 +} + +func (x *SelectRes_One) Reset() { + *x = SelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes_One) ProtoMessage() {} + +func (x *SelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[30] + 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 SelectRes_One.ProtoReflect.Descriptor instead. +func (*SelectRes_One) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{19, 0} +} + +func (x *SelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SelectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type UserItemListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //商城奖品id + RewardId int64 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //奖品id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品标题 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片URL + Remain int64 `protobuf:"varint,5,opt,name=remain,proto3" json:"remain,omitempty"` //剩余库存 + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` //状态(1-上架,2-待上架,3-下架,4-删除) + UpRemain int64 `protobuf:"varint,7,opt,name=up_remain,json=upRemain,proto3" json:"up_remain,omitempty"` //上架剩余时间 + CoinNum int32 `protobuf:"varint,8,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //奖品金币数量 +} + +func (x *UserItemListRes_One) Reset() { + *x = UserItemListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserItemListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserItemListRes_One) ProtoMessage() {} + +func (x *UserItemListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[31] + 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 UserItemListRes_One.ProtoReflect.Descriptor instead. +func (*UserItemListRes_One) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{23, 0} +} + +func (x *UserItemListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserItemListRes_One) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *UserItemListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UserItemListRes_One) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UserItemListRes_One) GetRemain() int64 { + if x != nil { + return x.Remain + } + return 0 +} + +func (x *UserItemListRes_One) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *UserItemListRes_One) GetUpRemain() int64 { + if x != nil { + return x.UpRemain + } + return 0 +} + +func (x *UserItemListRes_One) GetCoinNum() int32 { + if x != nil { + return x.CoinNum + } + return 0 +} + +type ExchangeItemReq_SourceData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CenterId int64 `protobuf:"varint,1,opt,name=center_id,json=centerId,proto3" json:"center_id,omitempty"` //任务中心id + CenterHashId string `protobuf:"bytes,2,opt,name=center_hash_id,json=centerHashId,proto3" json:"center_hash_id,omitempty"` //任务中心hash_id + CenterTitle string `protobuf:"bytes,3,opt,name=center_title,json=centerTitle,proto3" json:"center_title,omitempty"` //任务中心标题 + UserPlatform string `protobuf:"bytes,4,opt,name=user_platform,json=userPlatform,proto3" json:"user_platform,omitempty"` //用户平台 + ParentUserId string `protobuf:"bytes,5,opt,name=parent_user_id,json=parentUserId,proto3" json:"parent_user_id,omitempty"` //父用户id + ParentUserPlatform string `protobuf:"bytes,6,opt,name=parent_user_platform,json=parentUserPlatform,proto3" json:"parent_user_platform,omitempty"` //父用户平台 + ModuleId int64 `protobuf:"varint,7,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"` //模块id + RelateId int64 `protobuf:"varint,8,opt,name=relate_id,json=relateId,proto3" json:"relate_id,omitempty"` //关联id +} + +func (x *ExchangeItemReq_SourceData) Reset() { + *x = ExchangeItemReq_SourceData{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeItemReq_SourceData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemReq_SourceData) ProtoMessage() {} + +func (x *ExchangeItemReq_SourceData) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[32] + 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 ExchangeItemReq_SourceData.ProtoReflect.Descriptor instead. +func (*ExchangeItemReq_SourceData) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{24, 0} +} + +func (x *ExchangeItemReq_SourceData) GetCenterId() int64 { + if x != nil { + return x.CenterId + } + return 0 +} + +func (x *ExchangeItemReq_SourceData) GetCenterHashId() string { + if x != nil { + return x.CenterHashId + } + return "" +} + +func (x *ExchangeItemReq_SourceData) GetCenterTitle() string { + if x != nil { + return x.CenterTitle + } + return "" +} + +func (x *ExchangeItemReq_SourceData) GetUserPlatform() string { + if x != nil { + return x.UserPlatform + } + return "" +} + +func (x *ExchangeItemReq_SourceData) GetParentUserId() string { + if x != nil { + return x.ParentUserId + } + return "" +} + +func (x *ExchangeItemReq_SourceData) GetParentUserPlatform() string { + if x != nil { + return x.ParentUserPlatform + } + return "" +} + +func (x *ExchangeItemReq_SourceData) GetModuleId() int64 { + if x != nil { + return x.ModuleId + } + return 0 +} + +func (x *ExchangeItemReq_SourceData) GetRelateId() int64 { + if x != nil { + return x.RelateId + } + return 0 +} + +type ExchangeItemRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //对应字段名 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //对应字段值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ExchangeItemRes_KV) Reset() { + *x = ExchangeItemRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_mall_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeItemRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemRes_KV) ProtoMessage() {} + +func (x *ExchangeItemRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_mall_proto_msgTypes[33] + 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 ExchangeItemRes_KV.ProtoReflect.Descriptor instead. +func (*ExchangeItemRes_KV) Descriptor() ([]byte, []int) { + return file_w_mall_proto_rawDescGZIP(), []int{25, 0} +} + +func (x *ExchangeItemRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ExchangeItemRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ExchangeItemRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +var File_w_mall_proto protoreflect.FileDescriptor + +var file_w_mall_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, + 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x22, 0xa9, 0x01, 0x0a, 0x07, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, + 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, + 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x42, 0x79, 0x22, 0xa8, 0x03, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x12, 0x29, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x1a, 0xca, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, + 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x46, + 0x0a, 0x06, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0x47, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x22, + 0x48, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x59, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x22, 0x1b, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x44, 0x0a, + 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x3e, 0x0a, 0x0b, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0xac, 0x04, 0x0a, 0x0b, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, + 0x1a, 0xed, 0x03, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, + 0x67, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, + 0x69, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, + 0x70, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x75, 0x70, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x13, 0x0a, 0x05, 0x75, 0x70, 0x5f, 0x61, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x75, 0x70, 0x41, 0x74, 0x12, 0x17, 0x0a, + 0x07, 0x75, 0x70, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x75, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x70, 0x5f, 0x73, 0x68, 0x6f, + 0x77, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x75, 0x70, 0x53, 0x68, 0x6f, 0x77, 0x12, + 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x17, 0x0a, + 0x07, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x64, 0x6f, 0x77, 0x6e, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x66, + 0x72, 0x6f, 0x6d, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x46, + 0x72, 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x73, 0x68, 0x6f, 0x77, + 0x18, 0x10, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x68, 0x6f, 0x77, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, + 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x63, 0x6b, + 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, + 0x22, 0x9f, 0x02, 0x0a, 0x0c, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x4e, + 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x70, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x70, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x70, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x70, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x70, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x73, 0x68, + 0x6f, 0x77, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x68, + 0x6f, 0x77, 0x22, 0x1e, 0x0a, 0x0c, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x97, 0x02, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x6f, + 0x63, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, + 0x70, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x75, 0x70, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x70, 0x5f, 0x73, + 0x68, 0x6f, 0x77, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x75, 0x70, 0x53, 0x68, 0x6f, + 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, + 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x1f, 0x0a, 0x0d, + 0x49, 0x74, 0x65, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, + 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1f, 0x0a, 0x0b, 0x49, 0x74, 0x65, 0x6d, 0x53, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x49, 0x74, 0x65, 0x6d, + 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x22, 0x33, 0x0a, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x65, 0x0a, 0x09, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, + 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, + 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x2b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x4d, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, + 0x6d, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x4d, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, + 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, + 0x22, 0x90, 0x02, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xc9, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, + 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x6d, + 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75, + 0x70, 0x5f, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x75, 0x70, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, + 0x4e, 0x75, 0x6d, 0x22, 0xcd, 0x04, 0x0a, 0x0f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x61, 0x6c, 0x6c, 0x5f, 0x69, + 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, + 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x45, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, + 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, + 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x1a, 0xa9, 0x02, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x49, 0x64, 0x22, 0x95, 0x04, 0x0a, 0x0f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x35, 0x0a, 0x07, 0x6b, + 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, + 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, + 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x77, + 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, + 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, + 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x66, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x61, 0x69, + 0x6c, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x69, + 0x6c, 0x4d, 0x73, 0x67, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x32, 0x9c, 0x06, 0x0a, 0x05, + 0x57, 0x4d, 0x61, 0x6c, 0x6c, 0x12, 0x2e, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, + 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x11, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x12, + 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x37, + 0x0a, 0x07, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x14, 0x2e, 0x77, 0x5f, 0x6d, 0x61, + 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x14, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, + 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x6d, + 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, + 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x6d, 0x61, + 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, + 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, + 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x08, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6f, + 0x72, 0x74, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, + 0x65, 0x6d, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x6d, 0x61, + 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x34, 0x0a, 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x13, 0x2e, 0x77, + 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0a, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x6c, 0x6c, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, + 0x17, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x4d, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0c, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x6d, + 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x45, 0x78, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, + 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, + 0x3b, 0x77, 0x5f, 0x6d, 0x61, 0x6c, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_w_mall_proto_rawDescOnce sync.Once + file_w_mall_proto_rawDescData = file_w_mall_proto_rawDesc +) + +func file_w_mall_proto_rawDescGZIP() []byte { + file_w_mall_proto_rawDescOnce.Do(func() { + file_w_mall_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_mall_proto_rawDescData) + }) + return file_w_mall_proto_rawDescData +} + +var file_w_mall_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_w_mall_proto_goTypes = []interface{}{ + (*ListReq)(nil), // 0: w_mallpb.ListReq + (*ListRes)(nil), // 1: w_mallpb.ListRes + (*StoreReq)(nil), // 2: w_mallpb.StoreReq + (*StoreRes)(nil), // 3: w_mallpb.StoreRes + (*UpdateReq)(nil), // 4: w_mallpb.UpdateReq + (*UpdateRes)(nil), // 5: w_mallpb.UpdateRes + (*DestroyReq)(nil), // 6: w_mallpb.DestroyReq + (*DestroyRes)(nil), // 7: w_mallpb.DestroyRes + (*ItemListReq)(nil), // 8: w_mallpb.ItemListReq + (*ItemListRes)(nil), // 9: w_mallpb.ItemListRes + (*ItemStoreReq)(nil), // 10: w_mallpb.ItemStoreReq + (*ItemStoreRes)(nil), // 11: w_mallpb.ItemStoreRes + (*ItemUpdateReq)(nil), // 12: w_mallpb.ItemUpdateReq + (*ItemUpdateRes)(nil), // 13: w_mallpb.ItemUpdateRes + (*ItemStatusReq)(nil), // 14: w_mallpb.ItemStatusReq + (*ItemStatusRes)(nil), // 15: w_mallpb.ItemStatusRes + (*ItemSortReq)(nil), // 16: w_mallpb.ItemSortReq + (*ItemSortRes)(nil), // 17: w_mallpb.ItemSortRes + (*SelectReq)(nil), // 18: w_mallpb.SelectReq + (*SelectRes)(nil), // 19: w_mallpb.SelectRes + (*RelateMallReq)(nil), // 20: w_mallpb.RelateMallReq + (*RelateMallRes)(nil), // 21: w_mallpb.RelateMallRes + (*UserItemListReq)(nil), // 22: w_mallpb.UserItemListReq + (*UserItemListRes)(nil), // 23: w_mallpb.UserItemListRes + (*ExchangeItemReq)(nil), // 24: w_mallpb.ExchangeItemReq + (*ExchangeItemRes)(nil), // 25: w_mallpb.ExchangeItemRes + (*ListRes_One)(nil), // 26: w_mallpb.ListRes.One + (*ListRes_Relate)(nil), // 27: w_mallpb.ListRes.Relate + (*ListRes_Reward)(nil), // 28: w_mallpb.ListRes.Reward + (*ItemListRes_One)(nil), // 29: w_mallpb.ItemListRes.One + (*SelectRes_One)(nil), // 30: w_mallpb.SelectRes.One + (*UserItemListRes_One)(nil), // 31: w_mallpb.UserItemListRes.One + (*ExchangeItemReq_SourceData)(nil), // 32: w_mallpb.ExchangeItemReq.SourceData + (*ExchangeItemRes_KV)(nil), // 33: w_mallpb.ExchangeItemRes.KV +} +var file_w_mall_proto_depIdxs = []int32{ + 26, // 0: w_mallpb.ListRes.list:type_name -> w_mallpb.ListRes.One + 29, // 1: w_mallpb.ItemListRes.list:type_name -> w_mallpb.ItemListRes.One + 30, // 2: w_mallpb.SelectRes.list:type_name -> w_mallpb.SelectRes.One + 31, // 3: w_mallpb.UserItemListRes.list:type_name -> w_mallpb.UserItemListRes.One + 32, // 4: w_mallpb.ExchangeItemReq.source_data:type_name -> w_mallpb.ExchangeItemReq.SourceData + 33, // 5: w_mallpb.ExchangeItemRes.kv_data:type_name -> w_mallpb.ExchangeItemRes.KV + 27, // 6: w_mallpb.ListRes.One.relates:type_name -> w_mallpb.ListRes.Relate + 28, // 7: w_mallpb.ListRes.One.rewards:type_name -> w_mallpb.ListRes.Reward + 0, // 8: w_mallpb.WMall.List:input_type -> w_mallpb.ListReq + 2, // 9: w_mallpb.WMall.Store:input_type -> w_mallpb.StoreReq + 4, // 10: w_mallpb.WMall.Update:input_type -> w_mallpb.UpdateReq + 6, // 11: w_mallpb.WMall.Destroy:input_type -> w_mallpb.DestroyReq + 8, // 12: w_mallpb.WMall.ItemList:input_type -> w_mallpb.ItemListReq + 10, // 13: w_mallpb.WMall.ItemStore:input_type -> w_mallpb.ItemStoreReq + 12, // 14: w_mallpb.WMall.ItemUpdate:input_type -> w_mallpb.ItemUpdateReq + 14, // 15: w_mallpb.WMall.ItemStatus:input_type -> w_mallpb.ItemStatusReq + 16, // 16: w_mallpb.WMall.ItemSort:input_type -> w_mallpb.ItemSortReq + 18, // 17: w_mallpb.WMall.Select:input_type -> w_mallpb.SelectReq + 20, // 18: w_mallpb.WMall.RelateMall:input_type -> w_mallpb.RelateMallReq + 22, // 19: w_mallpb.WMall.UserItemList:input_type -> w_mallpb.UserItemListReq + 24, // 20: w_mallpb.WMall.ExchangeItem:input_type -> w_mallpb.ExchangeItemReq + 1, // 21: w_mallpb.WMall.List:output_type -> w_mallpb.ListRes + 3, // 22: w_mallpb.WMall.Store:output_type -> w_mallpb.StoreRes + 5, // 23: w_mallpb.WMall.Update:output_type -> w_mallpb.UpdateRes + 7, // 24: w_mallpb.WMall.Destroy:output_type -> w_mallpb.DestroyRes + 9, // 25: w_mallpb.WMall.ItemList:output_type -> w_mallpb.ItemListRes + 11, // 26: w_mallpb.WMall.ItemStore:output_type -> w_mallpb.ItemStoreRes + 13, // 27: w_mallpb.WMall.ItemUpdate:output_type -> w_mallpb.ItemUpdateRes + 15, // 28: w_mallpb.WMall.ItemStatus:output_type -> w_mallpb.ItemStatusRes + 17, // 29: w_mallpb.WMall.ItemSort:output_type -> w_mallpb.ItemSortRes + 19, // 30: w_mallpb.WMall.Select:output_type -> w_mallpb.SelectRes + 21, // 31: w_mallpb.WMall.RelateMall:output_type -> w_mallpb.RelateMallRes + 23, // 32: w_mallpb.WMall.UserItemList:output_type -> w_mallpb.UserItemListRes + 25, // 33: w_mallpb.WMall.ExchangeItem:output_type -> w_mallpb.ExchangeItemRes + 21, // [21:34] is the sub-list for method output_type + 8, // [8:21] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_w_mall_proto_init() } +func file_w_mall_proto_init() { + if File_w_mall_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_mall_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemStatusReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemStatusRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemSortReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemSortRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelateMallReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelateMallRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserItemListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserItemListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeItemReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeItemRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Relate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserItemListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeItemReq_SourceData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_mall_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeItemRes_KV); 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_w_mall_proto_rawDesc, + NumEnums: 0, + NumMessages: 34, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_mall_proto_goTypes, + DependencyIndexes: file_w_mall_proto_depIdxs, + MessageInfos: file_w_mall_proto_msgTypes, + }.Build() + File_w_mall_proto = out.File + file_w_mall_proto_rawDesc = nil + file_w_mall_proto_goTypes = nil + file_w_mall_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_mall/w_mall.pb.micro.go b/proto/go_proto/w_mall/w_mall.pb.micro.go new file mode 100644 index 0000000..5a8a53b --- /dev/null +++ b/proto/go_proto/w_mall/w_mall.pb.micro.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_mall.proto + +package w_mallpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WMall service + +func NewWMallEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WMall service + +type WMallService interface { + // List 商城列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // Store 商城创建 + Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) + // Update 商城更新 + Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) + // Destroy 商城删除 + Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) + // ItemList 商城奖品列表 + ItemList(ctx context.Context, in *ItemListReq, opts ...client.CallOption) (*ItemListRes, error) + // ItemStore 商城奖品创建 + ItemStore(ctx context.Context, in *ItemStoreReq, opts ...client.CallOption) (*ItemStoreRes, error) + // ItemUpdate 商城奖品更新 + ItemUpdate(ctx context.Context, in *ItemUpdateReq, opts ...client.CallOption) (*ItemUpdateRes, error) + // ItemStatus 商城奖品状态修改 + ItemStatus(ctx context.Context, in *ItemStatusReq, opts ...client.CallOption) (*ItemStatusRes, error) + // ItemSort 商城奖品排序 + ItemSort(ctx context.Context, in *ItemSortReq, opts ...client.CallOption) (*ItemSortRes, error) + // Select 商城选择 + Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) + // RelateMall 关联商城 + RelateMall(ctx context.Context, in *RelateMallReq, opts ...client.CallOption) (*RelateMallRes, error) + // UserItemList 用户商城奖品列表 + UserItemList(ctx context.Context, in *UserItemListReq, opts ...client.CallOption) (*UserItemListRes, error) + // ExchangeItem 商城奖品兑换 + ExchangeItem(ctx context.Context, in *ExchangeItemReq, opts ...client.CallOption) (*ExchangeItemRes, error) +} + +type wMallService struct { + c client.Client + name string +} + +func NewWMallService(name string, c client.Client) WMallService { + return &wMallService{ + c: c, + name: name, + } +} + +func (c *wMallService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WMall.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) { + req := c.c.NewRequest(c.name, "WMall.Store", in) + out := new(StoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) { + req := c.c.NewRequest(c.name, "WMall.Update", in) + out := new(UpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) { + req := c.c.NewRequest(c.name, "WMall.Destroy", in) + out := new(DestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) ItemList(ctx context.Context, in *ItemListReq, opts ...client.CallOption) (*ItemListRes, error) { + req := c.c.NewRequest(c.name, "WMall.ItemList", in) + out := new(ItemListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) ItemStore(ctx context.Context, in *ItemStoreReq, opts ...client.CallOption) (*ItemStoreRes, error) { + req := c.c.NewRequest(c.name, "WMall.ItemStore", in) + out := new(ItemStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) ItemUpdate(ctx context.Context, in *ItemUpdateReq, opts ...client.CallOption) (*ItemUpdateRes, error) { + req := c.c.NewRequest(c.name, "WMall.ItemUpdate", in) + out := new(ItemUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) ItemStatus(ctx context.Context, in *ItemStatusReq, opts ...client.CallOption) (*ItemStatusRes, error) { + req := c.c.NewRequest(c.name, "WMall.ItemStatus", in) + out := new(ItemStatusRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) ItemSort(ctx context.Context, in *ItemSortReq, opts ...client.CallOption) (*ItemSortRes, error) { + req := c.c.NewRequest(c.name, "WMall.ItemSort", in) + out := new(ItemSortRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) { + req := c.c.NewRequest(c.name, "WMall.Select", in) + out := new(SelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) RelateMall(ctx context.Context, in *RelateMallReq, opts ...client.CallOption) (*RelateMallRes, error) { + req := c.c.NewRequest(c.name, "WMall.RelateMall", in) + out := new(RelateMallRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) UserItemList(ctx context.Context, in *UserItemListReq, opts ...client.CallOption) (*UserItemListRes, error) { + req := c.c.NewRequest(c.name, "WMall.UserItemList", in) + out := new(UserItemListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wMallService) ExchangeItem(ctx context.Context, in *ExchangeItemReq, opts ...client.CallOption) (*ExchangeItemRes, error) { + req := c.c.NewRequest(c.name, "WMall.ExchangeItem", in) + out := new(ExchangeItemRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WMall service + +type WMallHandler interface { + // List 商城列表 + List(context.Context, *ListReq, *ListRes) error + // Store 商城创建 + Store(context.Context, *StoreReq, *StoreRes) error + // Update 商城更新 + Update(context.Context, *UpdateReq, *UpdateRes) error + // Destroy 商城删除 + Destroy(context.Context, *DestroyReq, *DestroyRes) error + // ItemList 商城奖品列表 + ItemList(context.Context, *ItemListReq, *ItemListRes) error + // ItemStore 商城奖品创建 + ItemStore(context.Context, *ItemStoreReq, *ItemStoreRes) error + // ItemUpdate 商城奖品更新 + ItemUpdate(context.Context, *ItemUpdateReq, *ItemUpdateRes) error + // ItemStatus 商城奖品状态修改 + ItemStatus(context.Context, *ItemStatusReq, *ItemStatusRes) error + // ItemSort 商城奖品排序 + ItemSort(context.Context, *ItemSortReq, *ItemSortRes) error + // Select 商城选择 + Select(context.Context, *SelectReq, *SelectRes) error + // RelateMall 关联商城 + RelateMall(context.Context, *RelateMallReq, *RelateMallRes) error + // UserItemList 用户商城奖品列表 + UserItemList(context.Context, *UserItemListReq, *UserItemListRes) error + // ExchangeItem 商城奖品兑换 + ExchangeItem(context.Context, *ExchangeItemReq, *ExchangeItemRes) error +} + +func RegisterWMallHandler(s server.Server, hdlr WMallHandler, opts ...server.HandlerOption) error { + type wMall interface { + List(ctx context.Context, in *ListReq, out *ListRes) error + Store(ctx context.Context, in *StoreReq, out *StoreRes) error + Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error + Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error + ItemList(ctx context.Context, in *ItemListReq, out *ItemListRes) error + ItemStore(ctx context.Context, in *ItemStoreReq, out *ItemStoreRes) error + ItemUpdate(ctx context.Context, in *ItemUpdateReq, out *ItemUpdateRes) error + ItemStatus(ctx context.Context, in *ItemStatusReq, out *ItemStatusRes) error + ItemSort(ctx context.Context, in *ItemSortReq, out *ItemSortRes) error + Select(ctx context.Context, in *SelectReq, out *SelectRes) error + RelateMall(ctx context.Context, in *RelateMallReq, out *RelateMallRes) error + UserItemList(ctx context.Context, in *UserItemListReq, out *UserItemListRes) error + ExchangeItem(ctx context.Context, in *ExchangeItemReq, out *ExchangeItemRes) error + } + type WMall struct { + wMall + } + h := &wMallHandler{hdlr} + return s.Handle(s.NewHandler(&WMall{h}, opts...)) +} + +type wMallHandler struct { + WMallHandler +} + +func (h *wMallHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WMallHandler.List(ctx, in, out) +} + +func (h *wMallHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error { + return h.WMallHandler.Store(ctx, in, out) +} + +func (h *wMallHandler) Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error { + return h.WMallHandler.Update(ctx, in, out) +} + +func (h *wMallHandler) Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error { + return h.WMallHandler.Destroy(ctx, in, out) +} + +func (h *wMallHandler) ItemList(ctx context.Context, in *ItemListReq, out *ItemListRes) error { + return h.WMallHandler.ItemList(ctx, in, out) +} + +func (h *wMallHandler) ItemStore(ctx context.Context, in *ItemStoreReq, out *ItemStoreRes) error { + return h.WMallHandler.ItemStore(ctx, in, out) +} + +func (h *wMallHandler) ItemUpdate(ctx context.Context, in *ItemUpdateReq, out *ItemUpdateRes) error { + return h.WMallHandler.ItemUpdate(ctx, in, out) +} + +func (h *wMallHandler) ItemStatus(ctx context.Context, in *ItemStatusReq, out *ItemStatusRes) error { + return h.WMallHandler.ItemStatus(ctx, in, out) +} + +func (h *wMallHandler) ItemSort(ctx context.Context, in *ItemSortReq, out *ItemSortRes) error { + return h.WMallHandler.ItemSort(ctx, in, out) +} + +func (h *wMallHandler) Select(ctx context.Context, in *SelectReq, out *SelectRes) error { + return h.WMallHandler.Select(ctx, in, out) +} + +func (h *wMallHandler) RelateMall(ctx context.Context, in *RelateMallReq, out *RelateMallRes) error { + return h.WMallHandler.RelateMall(ctx, in, out) +} + +func (h *wMallHandler) UserItemList(ctx context.Context, in *UserItemListReq, out *UserItemListRes) error { + return h.WMallHandler.UserItemList(ctx, in, out) +} + +func (h *wMallHandler) ExchangeItem(ctx context.Context, in *ExchangeItemReq, out *ExchangeItemRes) error { + return h.WMallHandler.ExchangeItem(ctx, in, out) +} diff --git a/proto/go_proto/w_open_platform/w_open_platform.pb.go b/proto/go_proto/w_open_platform/w_open_platform.pb.go new file mode 100644 index 0000000..b580a35 --- /dev/null +++ b/proto/go_proto/w_open_platform/w_open_platform.pb.go @@ -0,0 +1,1209 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_open_platform.proto + +package w_open_platformpb + +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 UserListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ProjectHashId string `protobuf:"bytes,3,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + CampaignHashId string `protobuf:"bytes,4,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + LastRecordId int64 `protobuf:"varint,5,opt,name=last_record_id,json=lastRecordId,proto3" json:"last_record_id,omitempty"` //最后一条记录id +} + +func (x *UserListReq) Reset() { + *x = UserListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListReq) ProtoMessage() {} + +func (x *UserListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 UserListReq.ProtoReflect.Descriptor instead. +func (*UserListReq) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{0} +} + +func (x *UserListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *UserListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *UserListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UserListReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *UserListReq) GetLastRecordId() int64 { + if x != nil { + return x.LastRecordId + } + return 0 +} + +type UserListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UserListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 + Lave int64 `protobuf:"varint,3,opt,name=lave,proto3" json:"lave,omitempty"` //剩余多少条数据没有拉取 +} + +func (x *UserListRes) Reset() { + *x = UserListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListRes) ProtoMessage() {} + +func (x *UserListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 UserListRes.ProtoReflect.Descriptor instead. +func (*UserListRes) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{1} +} + +func (x *UserListRes) GetList() []*UserListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *UserListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *UserListRes) GetLave() int64 { + if x != nil { + return x.Lave + } + return 0 +} + +type CampaignInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *CampaignInfoReq) Reset() { + *x = CampaignInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignInfoReq) ProtoMessage() {} + +func (x *CampaignInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 CampaignInfoReq.ProtoReflect.Descriptor instead. +func (*CampaignInfoReq) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{2} +} + +func (x *CampaignInfoReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *CampaignInfoReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type CampaignInfoRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //活动对外id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //活动标题 + Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` //活动地址 + Langs []*CampaignInfoRes_Lang `protobuf:"bytes,4,rep,name=langs,proto3" json:"langs,omitempty"` //语言内容 +} + +func (x *CampaignInfoRes) Reset() { + *x = CampaignInfoRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignInfoRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignInfoRes) ProtoMessage() {} + +func (x *CampaignInfoRes) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 CampaignInfoRes.ProtoReflect.Descriptor instead. +func (*CampaignInfoRes) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{3} +} + +func (x *CampaignInfoRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CampaignInfoRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CampaignInfoRes) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +func (x *CampaignInfoRes) GetLangs() []*CampaignInfoRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +type PlayerReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户id + StartTime int64 `protobuf:"varint,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` //开始时间 + EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` //结束时间 +} + +func (x *PlayerReq) Reset() { + *x = PlayerReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayerReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayerReq) ProtoMessage() {} + +func (x *PlayerReq) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 PlayerReq.ProtoReflect.Descriptor instead. +func (*PlayerReq) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{4} +} + +func (x *PlayerReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *PlayerReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *PlayerReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PlayerReq) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *PlayerReq) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +type PlayerRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` //状态(0-正常,1-未参与活动) + FissionId int64 `protobuf:"varint,2,opt,name=fission_id,json=fissionId,proto3" json:"fission_id,omitempty"` //玩法id + Keep *PlayerRes_Keep `protobuf:"bytes,3,opt,name=keep,proto3" json:"keep,omitempty"` //激励养成玩家数据 +} + +func (x *PlayerRes) Reset() { + *x = PlayerRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayerRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayerRes) ProtoMessage() {} + +func (x *PlayerRes) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 PlayerRes.ProtoReflect.Descriptor instead. +func (*PlayerRes) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{5} +} + +func (x *PlayerRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *PlayerRes) GetFissionId() int64 { + if x != nil { + return x.FissionId + } + return 0 +} + +func (x *PlayerRes) GetKeep() *PlayerRes_Keep { + if x != nil { + return x.Keep + } + return nil +} + +type UserListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //活动用户ID + DeviceId string `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //用户设备id + SubUserId string `protobuf:"bytes,3,opt,name=sub_user_id,json=subUserId,proto3" json:"sub_user_id,omitempty"` //用户 + Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"` //用户上级 + ChildNum int64 `protobuf:"varint,5,opt,name=child_num,json=childNum,proto3" json:"child_num,omitempty"` //下级数量 + IndirectNum int64 `protobuf:"varint,6,opt,name=indirect_num,json=indirectNum,proto3" json:"indirect_num,omitempty"` //间接裂变 + EffectNum int64 `protobuf:"varint,7,opt,name=effect_num,json=effectNum,proto3" json:"effect_num,omitempty"` //有效拉新人数 + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //参与时间 + SourceTitle string `protobuf:"bytes,9,opt,name=source_title,json=sourceTitle,proto3" json:"source_title,omitempty"` //来源说明 + Platform string `protobuf:"bytes,10,opt,name=platform,proto3" json:"platform,omitempty"` //操作系统 + ChannelTitle string `protobuf:"bytes,11,opt,name=channel_title,json=channelTitle,proto3" json:"channel_title,omitempty"` //渠道名称 + JoinAt int64 `protobuf:"varint,12,opt,name=join_at,json=joinAt,proto3" json:"join_at,omitempty"` //首次访问活动时间 + Conds []*UserListRes_Cond `protobuf:"bytes,13,rep,name=conds,proto3" json:"conds,omitempty"` //任务数据 +} + +func (x *UserListRes_One) Reset() { + *x = UserListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListRes_One) ProtoMessage() {} + +func (x *UserListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 UserListRes_One.ProtoReflect.Descriptor instead. +func (*UserListRes_One) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *UserListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserListRes_One) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *UserListRes_One) GetSubUserId() string { + if x != nil { + return x.SubUserId + } + return "" +} + +func (x *UserListRes_One) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *UserListRes_One) GetChildNum() int64 { + if x != nil { + return x.ChildNum + } + return 0 +} + +func (x *UserListRes_One) GetIndirectNum() int64 { + if x != nil { + return x.IndirectNum + } + return 0 +} + +func (x *UserListRes_One) GetEffectNum() int64 { + if x != nil { + return x.EffectNum + } + return 0 +} + +func (x *UserListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *UserListRes_One) GetSourceTitle() string { + if x != nil { + return x.SourceTitle + } + return "" +} + +func (x *UserListRes_One) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *UserListRes_One) GetChannelTitle() string { + if x != nil { + return x.ChannelTitle + } + return "" +} + +func (x *UserListRes_One) GetJoinAt() int64 { + if x != nil { + return x.JoinAt + } + return 0 +} + +func (x *UserListRes_One) GetConds() []*UserListRes_Cond { + if x != nil { + return x.Conds + } + return nil +} + +type UserListRes_Cond struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Desc string `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` //标题 + Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` //数量 + IfCond int32 `protobuf:"varint,3,opt,name=if_cond,json=ifCond,proto3" json:"if_cond,omitempty"` //等式(0-等于,1-大于等于,2-累计) + EventType int32 `protobuf:"varint,4,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` //事件类型(1-自定义事件,2-广告事件,3-标准事件) + Event string `protobuf:"bytes,5,opt,name=event,proto3" json:"event,omitempty"` //事件关键字 + EventKey string `protobuf:"bytes,6,opt,name=event_key,json=eventKey,proto3" json:"event_key,omitempty"` //事件key + EventVal string `protobuf:"bytes,7,opt,name=event_val,json=eventVal,proto3" json:"event_val,omitempty"` //事件值 +} + +func (x *UserListRes_Cond) Reset() { + *x = UserListRes_Cond{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserListRes_Cond) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListRes_Cond) ProtoMessage() {} + +func (x *UserListRes_Cond) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 UserListRes_Cond.ProtoReflect.Descriptor instead. +func (*UserListRes_Cond) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *UserListRes_Cond) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UserListRes_Cond) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *UserListRes_Cond) GetIfCond() int32 { + if x != nil { + return x.IfCond + } + return 0 +} + +func (x *UserListRes_Cond) GetEventType() int32 { + if x != nil { + return x.EventType + } + return 0 +} + +func (x *UserListRes_Cond) GetEvent() string { + if x != nil { + return x.Event + } + return "" +} + +func (x *UserListRes_Cond) GetEventKey() string { + if x != nil { + return x.EventKey + } + return "" +} + +func (x *UserListRes_Cond) GetEventVal() string { + if x != nil { + return x.EventVal + } + return "" +} + +type CampaignInfoRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + PageTitle string `protobuf:"bytes,2,opt,name=page_title,json=pageTitle,proto3" json:"page_title,omitempty"` //页面标题 + ShareText string `protobuf:"bytes,3,opt,name=share_text,json=shareText,proto3" json:"share_text,omitempty"` //分享文案 + ShareImg string `protobuf:"bytes,4,opt,name=share_img,json=shareImg,proto3" json:"share_img,omitempty"` //缩略图 +} + +func (x *CampaignInfoRes_Lang) Reset() { + *x = CampaignInfoRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CampaignInfoRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CampaignInfoRes_Lang) ProtoMessage() {} + +func (x *CampaignInfoRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 CampaignInfoRes_Lang.ProtoReflect.Descriptor instead. +func (*CampaignInfoRes_Lang) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *CampaignInfoRes_Lang) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *CampaignInfoRes_Lang) GetPageTitle() string { + if x != nil { + return x.PageTitle + } + return "" +} + +func (x *CampaignInfoRes_Lang) GetShareText() string { + if x != nil { + return x.ShareText + } + return "" +} + +func (x *CampaignInfoRes_Lang) GetShareImg() string { + if x != nil { + return x.ShareImg + } + return "" +} + +type PlayerRes_Keep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LoveNum int64 `protobuf:"varint,1,opt,name=love_num,json=loveNum,proto3" json:"love_num,omitempty"` //当前养成宠物已经收集爱心数 + RemainFood int64 `protobuf:"varint,2,opt,name=remain_food,json=remainFood,proto3" json:"remain_food,omitempty"` //当前养成宠物剩余的食物数 + Action *PlayerRes_KeepAction `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` //用户行为 +} + +func (x *PlayerRes_Keep) Reset() { + *x = PlayerRes_Keep{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayerRes_Keep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayerRes_Keep) ProtoMessage() {} + +func (x *PlayerRes_Keep) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 PlayerRes_Keep.ProtoReflect.Descriptor instead. +func (*PlayerRes_Keep) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *PlayerRes_Keep) GetLoveNum() int64 { + if x != nil { + return x.LoveNum + } + return 0 +} + +func (x *PlayerRes_Keep) GetRemainFood() int64 { + if x != nil { + return x.RemainFood + } + return 0 +} + +func (x *PlayerRes_Keep) GetAction() *PlayerRes_KeepAction { + if x != nil { + return x.Action + } + return nil +} + +type PlayerRes_KeepAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GrowPet int64 `protobuf:"varint,1,opt,name=grow_pet,json=growPet,proto3" json:"grow_pet,omitempty"` //领养次数 + FeedNum int64 `protobuf:"varint,2,opt,name=feed_num,json=feedNum,proto3" json:"feed_num,omitempty"` //喂养次数 + CollectNum int64 `protobuf:"varint,3,opt,name=collect_num,json=collectNum,proto3" json:"collect_num,omitempty"` //收集爱心次数 +} + +func (x *PlayerRes_KeepAction) Reset() { + *x = PlayerRes_KeepAction{} + if protoimpl.UnsafeEnabled { + mi := &file_w_open_platform_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayerRes_KeepAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayerRes_KeepAction) ProtoMessage() {} + +func (x *PlayerRes_KeepAction) ProtoReflect() protoreflect.Message { + mi := &file_w_open_platform_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 PlayerRes_KeepAction.ProtoReflect.Descriptor instead. +func (*PlayerRes_KeepAction) Descriptor() ([]byte, []int) { + return file_w_open_platform_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *PlayerRes_KeepAction) GetGrowPet() int64 { + if x != nil { + return x.GrowPet + } + return 0 +} + +func (x *PlayerRes_KeepAction) GetFeedNum() int64 { + if x != nil { + return x.FeedNum + } + return 0 +} + +func (x *PlayerRes_KeepAction) GetCollectNum() int64 { + if x != nil { + return x.CollectNum + } + return 0 +} + +var File_w_open_platform_proto protoreflect.FileDescriptor + +var file_w_open_platform_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x22, 0xb4, 0x01, 0x0a, 0x0b, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, + 0x64, 0x22, 0xc9, 0x05, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x12, 0x36, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, + 0x61, 0x76, 0x65, 0x1a, 0xa0, 0x03, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x75, 0x62, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x21, 0x0a, + 0x0c, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, + 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x12, + 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x6a, 0x6f, 0x69, 0x6e, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x05, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x52, + 0x05, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xb4, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x65, 0x73, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x66, 0x43, 0x6f, 0x6e, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x22, 0x5a, 0x0a, + 0x0f, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x8a, 0x02, 0x0a, 0x0f, 0x43, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, + 0x12, 0x3d, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x1a, + 0x75, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x54, 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x5f, 0x69, 0x6d, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x49, 0x6d, 0x67, 0x22, 0xb0, 0x01, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe4, 0x02, 0x0a, 0x09, 0x50, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x35, + 0x0a, 0x04, 0x6b, 0x65, 0x65, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, + 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, + 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x52, + 0x04, 0x6b, 0x65, 0x65, 0x70, 0x1a, 0x83, 0x01, 0x0a, 0x04, 0x4b, 0x65, 0x65, 0x70, 0x12, 0x19, + 0x0a, 0x08, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x6c, 0x6f, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x6d, + 0x61, 0x69, 0x6e, 0x5f, 0x66, 0x6f, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x46, 0x6f, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x06, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x77, 0x5f, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x2e, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x63, 0x0a, 0x0a, 0x4b, + 0x65, 0x65, 0x70, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x77, 0x5f, 0x70, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x77, 0x50, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x64, 0x5f, 0x6e, 0x75, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x66, 0x65, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, + 0x32, 0xff, 0x01, 0x0a, 0x0d, 0x57, 0x4f, 0x70, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x12, 0x4c, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, + 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, + 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x58, 0x0a, 0x0c, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x22, 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x06, 0x50, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x42, 0x16, 0x5a, 0x14, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_w_open_platform_proto_rawDescOnce sync.Once + file_w_open_platform_proto_rawDescData = file_w_open_platform_proto_rawDesc +) + +func file_w_open_platform_proto_rawDescGZIP() []byte { + file_w_open_platform_proto_rawDescOnce.Do(func() { + file_w_open_platform_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_open_platform_proto_rawDescData) + }) + return file_w_open_platform_proto_rawDescData +} + +var file_w_open_platform_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_w_open_platform_proto_goTypes = []interface{}{ + (*UserListReq)(nil), // 0: w_open_platformpb.UserListReq + (*UserListRes)(nil), // 1: w_open_platformpb.UserListRes + (*CampaignInfoReq)(nil), // 2: w_open_platformpb.CampaignInfoReq + (*CampaignInfoRes)(nil), // 3: w_open_platformpb.CampaignInfoRes + (*PlayerReq)(nil), // 4: w_open_platformpb.PlayerReq + (*PlayerRes)(nil), // 5: w_open_platformpb.PlayerRes + (*UserListRes_One)(nil), // 6: w_open_platformpb.UserListRes.One + (*UserListRes_Cond)(nil), // 7: w_open_platformpb.UserListRes.Cond + (*CampaignInfoRes_Lang)(nil), // 8: w_open_platformpb.CampaignInfoRes.Lang + (*PlayerRes_Keep)(nil), // 9: w_open_platformpb.PlayerRes.Keep + (*PlayerRes_KeepAction)(nil), // 10: w_open_platformpb.PlayerRes.KeepAction +} +var file_w_open_platform_proto_depIdxs = []int32{ + 6, // 0: w_open_platformpb.UserListRes.list:type_name -> w_open_platformpb.UserListRes.One + 8, // 1: w_open_platformpb.CampaignInfoRes.langs:type_name -> w_open_platformpb.CampaignInfoRes.Lang + 9, // 2: w_open_platformpb.PlayerRes.keep:type_name -> w_open_platformpb.PlayerRes.Keep + 7, // 3: w_open_platformpb.UserListRes.One.conds:type_name -> w_open_platformpb.UserListRes.Cond + 10, // 4: w_open_platformpb.PlayerRes.Keep.action:type_name -> w_open_platformpb.PlayerRes.KeepAction + 0, // 5: w_open_platformpb.WOpenPlatform.UserList:input_type -> w_open_platformpb.UserListReq + 2, // 6: w_open_platformpb.WOpenPlatform.CampaignInfo:input_type -> w_open_platformpb.CampaignInfoReq + 4, // 7: w_open_platformpb.WOpenPlatform.Player:input_type -> w_open_platformpb.PlayerReq + 1, // 8: w_open_platformpb.WOpenPlatform.UserList:output_type -> w_open_platformpb.UserListRes + 3, // 9: w_open_platformpb.WOpenPlatform.CampaignInfo:output_type -> w_open_platformpb.CampaignInfoRes + 5, // 10: w_open_platformpb.WOpenPlatform.Player:output_type -> w_open_platformpb.PlayerRes + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_w_open_platform_proto_init() } +func file_w_open_platform_proto_init() { + if File_w_open_platform_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_open_platform_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignInfoRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayerReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayerRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserListRes_Cond); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CampaignInfoRes_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayerRes_Keep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_open_platform_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayerRes_KeepAction); 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_w_open_platform_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_open_platform_proto_goTypes, + DependencyIndexes: file_w_open_platform_proto_depIdxs, + MessageInfos: file_w_open_platform_proto_msgTypes, + }.Build() + File_w_open_platform_proto = out.File + file_w_open_platform_proto_rawDesc = nil + file_w_open_platform_proto_goTypes = nil + file_w_open_platform_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_open_platform/w_open_platform.pb.micro.go b/proto/go_proto/w_open_platform/w_open_platform.pb.micro.go new file mode 100644 index 0000000..6fb75de --- /dev/null +++ b/proto/go_proto/w_open_platform/w_open_platform.pb.micro.go @@ -0,0 +1,127 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_open_platform.proto + +package w_open_platformpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WOpenPlatform service + +func NewWOpenPlatformEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WOpenPlatform service + +type WOpenPlatformService interface { + // UserList 开放平台用户列表 + UserList(ctx context.Context, in *UserListReq, opts ...client.CallOption) (*UserListRes, error) + // CampaignInfo 开发平台活动信息 + CampaignInfo(ctx context.Context, in *CampaignInfoReq, opts ...client.CallOption) (*CampaignInfoRes, error) + // Player 用户在活动中的玩家数据 + Player(ctx context.Context, in *PlayerReq, opts ...client.CallOption) (*PlayerRes, error) +} + +type wOpenPlatformService struct { + c client.Client + name string +} + +func NewWOpenPlatformService(name string, c client.Client) WOpenPlatformService { + return &wOpenPlatformService{ + c: c, + name: name, + } +} + +func (c *wOpenPlatformService) UserList(ctx context.Context, in *UserListReq, opts ...client.CallOption) (*UserListRes, error) { + req := c.c.NewRequest(c.name, "WOpenPlatform.UserList", in) + out := new(UserListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wOpenPlatformService) CampaignInfo(ctx context.Context, in *CampaignInfoReq, opts ...client.CallOption) (*CampaignInfoRes, error) { + req := c.c.NewRequest(c.name, "WOpenPlatform.CampaignInfo", in) + out := new(CampaignInfoRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wOpenPlatformService) Player(ctx context.Context, in *PlayerReq, opts ...client.CallOption) (*PlayerRes, error) { + req := c.c.NewRequest(c.name, "WOpenPlatform.Player", in) + out := new(PlayerRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WOpenPlatform service + +type WOpenPlatformHandler interface { + // UserList 开放平台用户列表 + UserList(context.Context, *UserListReq, *UserListRes) error + // CampaignInfo 开发平台活动信息 + CampaignInfo(context.Context, *CampaignInfoReq, *CampaignInfoRes) error + // Player 用户在活动中的玩家数据 + Player(context.Context, *PlayerReq, *PlayerRes) error +} + +func RegisterWOpenPlatformHandler(s server.Server, hdlr WOpenPlatformHandler, opts ...server.HandlerOption) error { + type wOpenPlatform interface { + UserList(ctx context.Context, in *UserListReq, out *UserListRes) error + CampaignInfo(ctx context.Context, in *CampaignInfoReq, out *CampaignInfoRes) error + Player(ctx context.Context, in *PlayerReq, out *PlayerRes) error + } + type WOpenPlatform struct { + wOpenPlatform + } + h := &wOpenPlatformHandler{hdlr} + return s.Handle(s.NewHandler(&WOpenPlatform{h}, opts...)) +} + +type wOpenPlatformHandler struct { + WOpenPlatformHandler +} + +func (h *wOpenPlatformHandler) UserList(ctx context.Context, in *UserListReq, out *UserListRes) error { + return h.WOpenPlatformHandler.UserList(ctx, in, out) +} + +func (h *wOpenPlatformHandler) CampaignInfo(ctx context.Context, in *CampaignInfoReq, out *CampaignInfoRes) error { + return h.WOpenPlatformHandler.CampaignInfo(ctx, in, out) +} + +func (h *wOpenPlatformHandler) Player(ctx context.Context, in *PlayerReq, out *PlayerRes) error { + return h.WOpenPlatformHandler.Player(ctx, in, out) +} diff --git a/proto/go_proto/w_project/w_project.pb.go b/proto/go_proto/w_project/w_project.pb.go new file mode 100644 index 0000000..835109f --- /dev/null +++ b/proto/go_proto/w_project/w_project.pb.go @@ -0,0 +1,3308 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_project.proto + +package w_projectpb + +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 SelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业id + ShowUser bool `protobuf:"varint,2,opt,name=show_user,json=showUser,proto3" json:"show_user,omitempty"` //是否值显示员工可展示,如果否,表示返回企业内所有项目 + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id +} + +func (x *SelectReq) Reset() { + *x = SelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectReq) ProtoMessage() {} + +func (x *SelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 SelectReq.ProtoReflect.Descriptor instead. +func (*SelectReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{0} +} + +func (x *SelectReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *SelectReq) GetShowUser() bool { + if x != nil { + return x.ShowUser + } + return false +} + +func (x *SelectReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type SelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*SelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *SelectRes) Reset() { + *x = SelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes) ProtoMessage() {} + +func (x *SelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 SelectRes.ProtoReflect.Descriptor instead. +func (*SelectRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{1} +} + +func (x *SelectRes) GetList() []*SelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业id + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ShowUser bool `protobuf:"varint,4,opt,name=show_user,json=showUser,proto3" json:"show_user,omitempty"` //是否值显示员工可展示,如果否,表示返回企业内所有项目 + UserId int64 `protobuf:"varint,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{2} +} + +func (x *ListReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ListReq) GetShowUser() bool { + if x != nil { + return x.ShowUser + } + return false +} + +func (x *ListReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{3} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type ShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id +} + +func (x *ShowReq) Reset() { + *x = ShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowReq) ProtoMessage() {} + +func (x *ShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ShowReq.ProtoReflect.Descriptor instead. +func (*ShowReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{4} +} + +func (x *ShowReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"` //域名前缀 + CompanyId int64 `protobuf:"varint,5,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业id + NotifyToken string `protobuf:"bytes,6,opt,name=notify_token,json=notifyToken,proto3" json:"notify_token,omitempty"` //项目回调token + EncryptStr string `protobuf:"bytes,7,opt,name=encrypt_str,json=encryptStr,proto3" json:"encrypt_str,omitempty"` //数据加密字符串 + Scene int32 `protobuf:"varint,8,opt,name=scene,proto3" json:"scene,omitempty"` //项目应用场景(1-app,2-web) + ThirdSecret string `protobuf:"bytes,9,opt,name=third_secret,json=thirdSecret,proto3" json:"third_secret,omitempty"` //第三方开放平台密钥 + FissionCertType int32 `protobuf:"varint,10,opt,name=fission_cert_type,json=fissionCertType,proto3" json:"fission_cert_type,omitempty"` //活动用户认证方式(0-不认证,1-加密认证) + ThirdUrl string `protobuf:"bytes,11,opt,name=third_url,json=thirdUrl,proto3" json:"third_url,omitempty"` //开放平台回调地址 + ThirdReboostUrl string `protobuf:"bytes,12,opt,name=third_reboost_url,json=thirdReboostUrl,proto3" json:"third_reboost_url,omitempty"` //开放平台reboot回调地址 +} + +func (x *ShowRes) Reset() { + *x = ShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes) ProtoMessage() {} + +func (x *ShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ShowRes.ProtoReflect.Descriptor instead. +func (*ShowRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{5} +} + +func (x *ShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ShowRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *ShowRes) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *ShowRes) GetNotifyToken() string { + if x != nil { + return x.NotifyToken + } + return "" +} + +func (x *ShowRes) GetEncryptStr() string { + if x != nil { + return x.EncryptStr + } + return "" +} + +func (x *ShowRes) GetScene() int32 { + if x != nil { + return x.Scene + } + return 0 +} + +func (x *ShowRes) GetThirdSecret() string { + if x != nil { + return x.ThirdSecret + } + return "" +} + +func (x *ShowRes) GetFissionCertType() int32 { + if x != nil { + return x.FissionCertType + } + return 0 +} + +func (x *ShowRes) GetThirdUrl() string { + if x != nil { + return x.ThirdUrl + } + return "" +} + +func (x *ShowRes) GetThirdReboostUrl() string { + if x != nil { + return x.ThirdReboostUrl + } + return "" +} + +type StoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业id + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //企业id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"` //域名前缀 + UserIds []string `protobuf:"bytes,5,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"` //关联的员工id + IsAll bool `protobuf:"varint,6,opt,name=is_all,json=isAll,proto3" json:"is_all,omitempty"` //是否所有员工都可看 + Scene int32 `protobuf:"varint,7,opt,name=scene,proto3" json:"scene,omitempty"` //项目应用场景(1-app,2-web) + LogoUrl string `protobuf:"bytes,8,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty"` //项目logo地址 +} + +func (x *StoreReq) Reset() { + *x = StoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq) ProtoMessage() {} + +func (x *StoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 StoreReq.ProtoReflect.Descriptor instead. +func (*StoreReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{6} +} + +func (x *StoreReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *StoreReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *StoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *StoreReq) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +func (x *StoreReq) GetIsAll() bool { + if x != nil { + return x.IsAll + } + return false +} + +func (x *StoreReq) GetScene() int32 { + if x != nil { + return x.Scene + } + return 0 +} + +func (x *StoreReq) GetLogoUrl() string { + if x != nil { + return x.LogoUrl + } + return "" +} + +type StoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StoreRes) Reset() { + *x = StoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreRes) ProtoMessage() {} + +func (x *StoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 StoreRes.ProtoReflect.Descriptor instead. +func (*StoreRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{7} +} + +type UpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + UserIds []string `protobuf:"bytes,4,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"` //关联的员工id + IsAll bool `protobuf:"varint,5,opt,name=is_all,json=isAll,proto3" json:"is_all,omitempty"` //是否所有员工都可看 + LogoUrl string `protobuf:"bytes,6,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty"` //项目logo地址 +} + +func (x *UpdateReq) Reset() { + *x = UpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq) ProtoMessage() {} + +func (x *UpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 UpdateReq.ProtoReflect.Descriptor instead. +func (*UpdateReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +func (x *UpdateReq) GetIsAll() bool { + if x != nil { + return x.IsAll + } + return false +} + +func (x *UpdateReq) GetLogoUrl() string { + if x != nil { + return x.LogoUrl + } + return "" +} + +type UpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateRes) Reset() { + *x = UpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRes) ProtoMessage() {} + +func (x *UpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 UpdateRes.ProtoReflect.Descriptor instead. +func (*UpdateRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{9} +} + +type DestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id +} + +func (x *DestroyReq) Reset() { + *x = DestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyReq) ProtoMessage() {} + +func (x *DestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 DestroyReq.ProtoReflect.Descriptor instead. +func (*DestroyReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{10} +} + +func (x *DestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DestroyReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DestroyRes) Reset() { + *x = DestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyRes) ProtoMessage() {} + +func (x *DestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 DestroyRes.ProtoReflect.Descriptor instead. +func (*DestroyRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{11} +} + +type CertReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"` //项目私钥 +} + +func (x *CertReq) Reset() { + *x = CertReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertReq) ProtoMessage() {} + +func (x *CertReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 CertReq.ProtoReflect.Descriptor instead. +func (*CertReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{12} +} + +func (x *CertReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CertReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CertReq) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type CertRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + EncryptStr string `protobuf:"bytes,4,opt,name=encrypt_str,json=encryptStr,proto3" json:"encrypt_str,omitempty"` //数据加密字符串 + Scene int32 `protobuf:"varint,5,opt,name=scene,proto3" json:"scene,omitempty"` //项目应用场景(1-app,2-web) + CertSecrets []*CertRes_CertSecret `protobuf:"bytes,6,rep,name=cert_secrets,json=certSecrets,proto3" json:"cert_secrets,omitempty"` //可认证的密钥 +} + +func (x *CertRes) Reset() { + *x = CertRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertRes) ProtoMessage() {} + +func (x *CertRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 CertRes.ProtoReflect.Descriptor instead. +func (*CertRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{13} +} + +func (x *CertRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CertRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *CertRes) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CertRes) GetEncryptStr() string { + if x != nil { + return x.EncryptStr + } + return "" +} + +func (x *CertRes) GetScene() int32 { + if x != nil { + return x.Scene + } + return 0 +} + +func (x *CertRes) GetCertSecrets() []*CertRes_CertSecret { + if x != nil { + return x.CertSecrets + } + return nil +} + +type ProjectSecretReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id +} + +func (x *ProjectSecretReq) Reset() { + *x = ProjectSecretReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectSecretReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectSecretReq) ProtoMessage() {} + +func (x *ProjectSecretReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ProjectSecretReq.ProtoReflect.Descriptor instead. +func (*ProjectSecretReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{14} +} + +func (x *ProjectSecretReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ProjectSecretReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ProjectSecretRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` //项目私钥 +} + +func (x *ProjectSecretRes) Reset() { + *x = ProjectSecretRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectSecretRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectSecretRes) ProtoMessage() {} + +func (x *ProjectSecretRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ProjectSecretRes.ProtoReflect.Descriptor instead. +func (*ProjectSecretRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{15} +} + +func (x *ProjectSecretRes) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type ChangeSecretReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //创建的员工id + Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` //管理账号 + Passwd string `protobuf:"bytes,5,opt,name=passwd,proto3" json:"passwd,omitempty"` //管理员密码 +} + +func (x *ChangeSecretReq) Reset() { + *x = ChangeSecretReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeSecretReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeSecretReq) ProtoMessage() {} + +func (x *ChangeSecretReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ChangeSecretReq.ProtoReflect.Descriptor instead. +func (*ChangeSecretReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{16} +} + +func (x *ChangeSecretReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChangeSecretReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChangeSecretReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChangeSecretReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ChangeSecretReq) GetPasswd() string { + if x != nil { + return x.Passwd + } + return "" +} + +type ChangeSecretRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` //项目私钥 +} + +func (x *ChangeSecretRes) Reset() { + *x = ChangeSecretRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeSecretRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeSecretRes) ProtoMessage() {} + +func (x *ChangeSecretRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ChangeSecretRes.ProtoReflect.Descriptor instead. +func (*ChangeSecretRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{17} +} + +func (x *ChangeSecretRes) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type ChangeOplatformReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + ThirdUrl string `protobuf:"bytes,3,opt,name=third_url,json=thirdUrl,proto3" json:"third_url,omitempty"` //开放平台回调地址 +} + +func (x *ChangeOplatformReq) Reset() { + *x = ChangeOplatformReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeOplatformReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeOplatformReq) ProtoMessage() {} + +func (x *ChangeOplatformReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ChangeOplatformReq.ProtoReflect.Descriptor instead. +func (*ChangeOplatformReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{18} +} + +func (x *ChangeOplatformReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChangeOplatformReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChangeOplatformReq) GetThirdUrl() string { + if x != nil { + return x.ThirdUrl + } + return "" +} + +type ChangeOplatformRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeOplatformRes) Reset() { + *x = ChangeOplatformRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeOplatformRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeOplatformRes) ProtoMessage() {} + +func (x *ChangeOplatformRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 ChangeOplatformRes.ProtoReflect.Descriptor instead. +func (*ChangeOplatformRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{19} +} + +type DomainListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` //项目域名 +} + +func (x *DomainListReq) Reset() { + *x = DomainListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DomainListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DomainListReq) ProtoMessage() {} + +func (x *DomainListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 DomainListReq.ProtoReflect.Descriptor instead. +func (*DomainListReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{20} +} + +func (x *DomainListReq) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +type DomainListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DomainListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *DomainListRes) Reset() { + *x = DomainListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DomainListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DomainListRes) ProtoMessage() {} + +func (x *DomainListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 DomainListRes.ProtoReflect.Descriptor instead. +func (*DomainListRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{21} +} + +func (x *DomainListRes) GetList() []*DomainListRes_One { + if x != nil { + return x.List + } + return nil +} + +type SaveAdsConfigReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + OpenAd int32 `protobuf:"varint,2,opt,name=open_ad,json=openAd,proto3" json:"open_ad,omitempty"` //开启广告模块(0-不开启,1-开启) + CampaignAd int32 `protobuf:"varint,3,opt,name=campaign_ad,json=campaignAd,proto3" json:"campaign_ad,omitempty"` //开启活动广告(0-不开启,1-开启) + UserId int64 `protobuf:"varint,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id( + Ip string `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"` //操作的ip地址 +} + +func (x *SaveAdsConfigReq) Reset() { + *x = SaveAdsConfigReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveAdsConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveAdsConfigReq) ProtoMessage() {} + +func (x *SaveAdsConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 SaveAdsConfigReq.ProtoReflect.Descriptor instead. +func (*SaveAdsConfigReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{22} +} + +func (x *SaveAdsConfigReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SaveAdsConfigReq) GetOpenAd() int32 { + if x != nil { + return x.OpenAd + } + return 0 +} + +func (x *SaveAdsConfigReq) GetCampaignAd() int32 { + if x != nil { + return x.CampaignAd + } + return 0 +} + +func (x *SaveAdsConfigReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *SaveAdsConfigReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type SaveAdsConfigRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SaveAdsConfigRes) Reset() { + *x = SaveAdsConfigRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveAdsConfigRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveAdsConfigRes) ProtoMessage() {} + +func (x *SaveAdsConfigRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_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 SaveAdsConfigRes.ProtoReflect.Descriptor instead. +func (*SaveAdsConfigRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{23} +} + +type AdsConfigReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *AdsConfigReq) Reset() { + *x = AdsConfigReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsConfigReq) ProtoMessage() {} + +func (x *AdsConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[24] + 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 AdsConfigReq.ProtoReflect.Descriptor instead. +func (*AdsConfigReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{24} +} + +func (x *AdsConfigReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type AdsConfigRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenAd int32 `protobuf:"varint,1,opt,name=open_ad,json=openAd,proto3" json:"open_ad,omitempty"` //开启广告模块(0-不开启,1-开启) + CampaignAd int32 `protobuf:"varint,2,opt,name=campaign_ad,json=campaignAd,proto3" json:"campaign_ad,omitempty"` //开启广告模块(0-不开启,1-开启) + AdCustomUrl int32 `protobuf:"varint,3,opt,name=ad_custom_url,json=adCustomUrl,proto3" json:"ad_custom_url,omitempty"` //开启广告自定义链接配置(0-不开启,1-开启) +} + +func (x *AdsConfigRes) Reset() { + *x = AdsConfigRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdsConfigRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdsConfigRes) ProtoMessage() {} + +func (x *AdsConfigRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[25] + 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 AdsConfigRes.ProtoReflect.Descriptor instead. +func (*AdsConfigRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{25} +} + +func (x *AdsConfigRes) GetOpenAd() int32 { + if x != nil { + return x.OpenAd + } + return 0 +} + +func (x *AdsConfigRes) GetCampaignAd() int32 { + if x != nil { + return x.CampaignAd + } + return 0 +} + +func (x *AdsConfigRes) GetAdCustomUrl() int32 { + if x != nil { + return x.AdCustomUrl + } + return 0 +} + +type ChangeRebootUrlReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + ThirdReboostUrl string `protobuf:"bytes,3,opt,name=third_reboost_url,json=thirdReboostUrl,proto3" json:"third_reboost_url,omitempty"` //开放平台回调地址 +} + +func (x *ChangeRebootUrlReq) Reset() { + *x = ChangeRebootUrlReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeRebootUrlReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeRebootUrlReq) ProtoMessage() {} + +func (x *ChangeRebootUrlReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[26] + 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 ChangeRebootUrlReq.ProtoReflect.Descriptor instead. +func (*ChangeRebootUrlReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{26} +} + +func (x *ChangeRebootUrlReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChangeRebootUrlReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ChangeRebootUrlReq) GetThirdReboostUrl() string { + if x != nil { + return x.ThirdReboostUrl + } + return "" +} + +type ChangeRebootUrlRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeRebootUrlRes) Reset() { + *x = ChangeRebootUrlRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeRebootUrlRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeRebootUrlRes) ProtoMessage() {} + +func (x *ChangeRebootUrlRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[27] + 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 ChangeRebootUrlRes.ProtoReflect.Descriptor instead. +func (*ChangeRebootUrlRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{27} +} + +type FissionConfigReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *FissionConfigReq) Reset() { + *x = FissionConfigReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FissionConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FissionConfigReq) ProtoMessage() {} + +func (x *FissionConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[28] + 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 FissionConfigReq.ProtoReflect.Descriptor instead. +func (*FissionConfigReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{28} +} + +func (x *FissionConfigReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type FissionConfigRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PushVisit int32 `protobuf:"varint,1,opt,name=push_visit,json=pushVisit,proto3" json:"push_visit,omitempty"` //用户访问推送(0-否,1-是) + PushCampaignTask int32 `protobuf:"varint,2,opt,name=push_campaign_task,json=pushCampaignTask,proto3" json:"push_campaign_task,omitempty"` //活动任务完成推送(0-否,1-是) +} + +func (x *FissionConfigRes) Reset() { + *x = FissionConfigRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FissionConfigRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FissionConfigRes) ProtoMessage() {} + +func (x *FissionConfigRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[29] + 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 FissionConfigRes.ProtoReflect.Descriptor instead. +func (*FissionConfigRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{29} +} + +func (x *FissionConfigRes) GetPushVisit() int32 { + if x != nil { + return x.PushVisit + } + return 0 +} + +func (x *FissionConfigRes) GetPushCampaignTask() int32 { + if x != nil { + return x.PushCampaignTask + } + return 0 +} + +type SetPushVisitReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + PushVisit int32 `protobuf:"varint,2,opt,name=push_visit,json=pushVisit,proto3" json:"push_visit,omitempty"` //用户访问推送(0-否,1-是) +} + +func (x *SetPushVisitReq) Reset() { + *x = SetPushVisitReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetPushVisitReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPushVisitReq) ProtoMessage() {} + +func (x *SetPushVisitReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[30] + 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 SetPushVisitReq.ProtoReflect.Descriptor instead. +func (*SetPushVisitReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{30} +} + +func (x *SetPushVisitReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SetPushVisitReq) GetPushVisit() int32 { + if x != nil { + return x.PushVisit + } + return 0 +} + +type SetPushVisitRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetPushVisitRes) Reset() { + *x = SetPushVisitRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetPushVisitRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPushVisitRes) ProtoMessage() {} + +func (x *SetPushVisitRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[31] + 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 SetPushVisitRes.ProtoReflect.Descriptor instead. +func (*SetPushVisitRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{31} +} + +type SetPushCampaignTaskReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + PushCampaignTask int32 `protobuf:"varint,2,opt,name=push_campaign_task,json=pushCampaignTask,proto3" json:"push_campaign_task,omitempty"` //活动任务完成推送(0-否,1-是) +} + +func (x *SetPushCampaignTaskReq) Reset() { + *x = SetPushCampaignTaskReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetPushCampaignTaskReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPushCampaignTaskReq) ProtoMessage() {} + +func (x *SetPushCampaignTaskReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[32] + 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 SetPushCampaignTaskReq.ProtoReflect.Descriptor instead. +func (*SetPushCampaignTaskReq) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{32} +} + +func (x *SetPushCampaignTaskReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SetPushCampaignTaskReq) GetPushCampaignTask() int32 { + if x != nil { + return x.PushCampaignTask + } + return 0 +} + +type SetPushCampaignTaskRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetPushCampaignTaskRes) Reset() { + *x = SetPushCampaignTaskRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetPushCampaignTaskRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPushCampaignTaskRes) ProtoMessage() {} + +func (x *SetPushCampaignTaskRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[33] + 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 SetPushCampaignTaskRes.ProtoReflect.Descriptor instead. +func (*SetPushCampaignTaskRes) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{33} +} + +type SelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + Scene int32 `protobuf:"varint,4,opt,name=scene,proto3" json:"scene,omitempty"` //项目应用场景(1-app,2-web) + LogoUrl string `protobuf:"bytes,5,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty"` //项目logo地址 + IsTest int32 `protobuf:"varint,6,opt,name=is_test,json=isTest,proto3" json:"is_test,omitempty"` //是否测试项目(0-否,1-是) +} + +func (x *SelectRes_One) Reset() { + *x = SelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes_One) ProtoMessage() {} + +func (x *SelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[34] + 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 SelectRes_One.ProtoReflect.Descriptor instead. +func (*SelectRes_One) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *SelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SelectRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *SelectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SelectRes_One) GetScene() int32 { + if x != nil { + return x.Scene + } + return 0 +} + +func (x *SelectRes_One) GetLogoUrl() string { + if x != nil { + return x.LogoUrl + } + return "" +} + +func (x *SelectRes_One) GetIsTest() int32 { + if x != nil { + return x.IsTest + } + return 0 +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain,omitempty"` //域名前缀 + CreatedTime int64 `protobuf:"varint,5,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //创建时间时间戳 + UserRelate []*ListRes_UserRelate `protobuf:"bytes,6,rep,name=user_relate,json=userRelate,proto3" json:"user_relate,omitempty"` //关联的员工 + Scene int32 `protobuf:"varint,7,opt,name=scene,proto3" json:"scene,omitempty"` //项目应用场景(1-app,2-web) + LogoUrl string `protobuf:"bytes,8,opt,name=logo_url,json=logoUrl,proto3" json:"logo_url,omitempty"` //项目logo地址 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[35] + 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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_One) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *ListRes_One) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +func (x *ListRes_One) GetUserRelate() []*ListRes_UserRelate { + if x != nil { + return x.UserRelate + } + return nil +} + +func (x *ListRes_One) GetScene() int32 { + if x != nil { + return x.Scene + } + return 0 +} + +func (x *ListRes_One) GetLogoUrl() string { + if x != nil { + return x.LogoUrl + } + return "" +} + +type ListRes_UserRelate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //员工id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外员工id + ShowName string `protobuf:"bytes,3,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` //员工显示的名称 +} + +func (x *ListRes_UserRelate) Reset() { + *x = ListRes_UserRelate{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_UserRelate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_UserRelate) ProtoMessage() {} + +func (x *ListRes_UserRelate) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[36] + 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 ListRes_UserRelate.ProtoReflect.Descriptor instead. +func (*ListRes_UserRelate) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *ListRes_UserRelate) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ListRes_UserRelate) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ListRes_UserRelate) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +type CertRes_CertSecret struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` //密钥 + ExpiredAt int64 `protobuf:"varint,2,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` //密钥过期时间,0为不过期 +} + +func (x *CertRes_CertSecret) Reset() { + *x = CertRes_CertSecret{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertRes_CertSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertRes_CertSecret) ProtoMessage() {} + +func (x *CertRes_CertSecret) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[37] + 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 CertRes_CertSecret.ProtoReflect.Descriptor instead. +func (*CertRes_CertSecret) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *CertRes_CertSecret) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +func (x *CertRes_CertSecret) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +type DomainListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + CompanyId int64 `protobuf:"varint,3,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //项目名称 + Domain string `protobuf:"bytes,5,opt,name=domain,proto3" json:"domain,omitempty"` //域名前缀 + CreatedTime int64 `protobuf:"varint,6,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` //创建时间时间戳 +} + +func (x *DomainListRes_One) Reset() { + *x = DomainListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DomainListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DomainListRes_One) ProtoMessage() {} + +func (x *DomainListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_project_proto_msgTypes[38] + 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 DomainListRes_One.ProtoReflect.Descriptor instead. +func (*DomainListRes_One) Descriptor() ([]byte, []int) { + return file_w_project_proto_rawDescGZIP(), []int{21, 0} +} + +func (x *DomainListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DomainListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *DomainListRes_One) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *DomainListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *DomainListRes_One) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *DomainListRes_One) GetCreatedTime() int64 { + if x != nil { + return x.CreatedTime + } + return 0 +} + +var File_w_project_proto protoreflect.FileDescriptor + +var file_w_project_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x22, 0x60, + 0x0a, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, + 0x6f, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, + 0x68, 0x6f, 0x77, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x22, 0xcc, 0x01, 0x0a, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2e, + 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, + 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x8e, + 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, + 0x6f, 0x67, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, + 0x6f, 0x67, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x74, 0x65, 0x73, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x54, 0x65, 0x73, 0x74, 0x22, + 0x8d, 0x01, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, + 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x68, + 0x6f, 0x77, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x9f, 0x03, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, + 0xf2, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x21, + 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, + 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, + 0x6f, 0x55, 0x72, 0x6c, 0x1a, 0x5b, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x32, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xf1, 0x02, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x53, 0x74, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x63, 0x65, 0x6e, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x65, 0x6e, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x68, 0x69, 0x72, 0x64, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x63, 0x65, 0x72, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0f, 0x66, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x68, 0x69, 0x72, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x2a, 0x0a, + 0x11, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x52, + 0x65, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x55, 0x72, 0x6c, 0x22, 0xd3, 0x01, 0x0a, 0x08, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, + 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x19, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x61, 0x6c, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, + 0x63, 0x65, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x6f, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x6f, 0x55, 0x72, 0x6c, 0x22, + 0x0a, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x09, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, + 0x67, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, + 0x67, 0x6f, 0x55, 0x72, 0x6c, 0x22, 0x0b, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x22, 0x35, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x65, 0x73, + 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x4a, 0x0a, 0x07, 0x43, 0x65, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x22, 0x88, 0x02, 0x0a, 0x07, 0x43, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x53, 0x74, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x73, 0x63, 0x65, 0x6e, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x0b, 0x63, 0x65, + 0x72, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x43, 0x0a, 0x0a, 0x43, 0x65, 0x72, + 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x22, 0x3b, + 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x10, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x87, 0x01, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, + 0x73, 0x77, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x64, 0x22, 0x29, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x5a, 0x0a, 0x12, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x68, 0x69, 0x72, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x68, 0x69, 0x72, 0x64, 0x55, 0x72, 0x6c, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x4f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x22, 0x27, + 0x0a, 0x0d, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x0d, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x9e, 0x01, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x9d, + 0x01, 0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, 0x41, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70, + 0x65, 0x6e, 0x41, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x41, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x12, + 0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, 0x41, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x73, 0x22, 0x36, 0x0a, 0x0c, 0x41, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x6c, 0x0a, 0x0c, 0x41, 0x64, + 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6f, 0x70, + 0x65, 0x6e, 0x5f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x70, 0x65, + 0x6e, 0x41, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, + 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x41, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x61, 0x64, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x55, 0x72, 0x6c, 0x22, 0x69, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x68, 0x69, 0x72, 0x64, + 0x5f, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x73, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x73, 0x74, + 0x55, 0x72, 0x6c, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x62, + 0x6f, 0x6f, 0x74, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x3a, 0x0a, 0x10, 0x46, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, + 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x10, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x73, + 0x68, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, + 0x75, 0x73, 0x68, 0x56, 0x69, 0x73, 0x69, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x75, 0x73, 0x68, + 0x5f, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x70, 0x75, 0x73, 0x68, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x58, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, + 0x68, 0x56, 0x69, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x75, 0x73, 0x68, 0x56, 0x69, 0x73, 0x69, 0x74, + 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, 0x68, 0x56, 0x69, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x16, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, 0x68, 0x43, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, + 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x10, 0x70, 0x75, 0x73, 0x68, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, + 0x61, 0x73, 0x6b, 0x22, 0x18, 0x0a, 0x16, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, 0x68, 0x43, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x32, 0xc9, 0x09, + 0x0a, 0x08, 0x57, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, + 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, + 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x04, + 0x53, 0x68, 0x6f, 0x77, 0x12, 0x14, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x77, 0x5f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x37, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x15, 0x2e, 0x77, 0x5f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x06, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, + 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, + 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, + 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x04, 0x43, 0x65, 0x72, 0x74, 0x12, 0x14, + 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x70, 0x62, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0d, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1d, 0x2e, + 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, + 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, + 0x0c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1c, 0x2e, + 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0f, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1f, + 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x1a, + 0x1f, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0a, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, + 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0d, 0x53, 0x61, + 0x76, 0x65, 0x41, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x2e, 0x77, 0x5f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x41, 0x64, + 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x41, 0x64, 0x73, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x09, 0x41, + 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, + 0x62, 0x2e, 0x41, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, + 0x12, 0x55, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, + 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x55, 0x72, + 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x55, + 0x72, 0x6c, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0d, 0x46, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x50, + 0x75, 0x73, 0x68, 0x56, 0x69, 0x73, 0x69, 0x74, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, 0x68, 0x56, 0x69, + 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, 0x68, 0x56, 0x69, 0x73, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, + 0x68, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x23, 0x2e, + 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x50, + 0x75, 0x73, 0x68, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, + 0x2e, 0x53, 0x65, 0x74, 0x50, 0x75, 0x73, 0x68, 0x43, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x3b, + 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_w_project_proto_rawDescOnce sync.Once + file_w_project_proto_rawDescData = file_w_project_proto_rawDesc +) + +func file_w_project_proto_rawDescGZIP() []byte { + file_w_project_proto_rawDescOnce.Do(func() { + file_w_project_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_project_proto_rawDescData) + }) + return file_w_project_proto_rawDescData +} + +var file_w_project_proto_msgTypes = make([]protoimpl.MessageInfo, 39) +var file_w_project_proto_goTypes = []interface{}{ + (*SelectReq)(nil), // 0: w_projectpb.SelectReq + (*SelectRes)(nil), // 1: w_projectpb.SelectRes + (*ListReq)(nil), // 2: w_projectpb.ListReq + (*ListRes)(nil), // 3: w_projectpb.ListRes + (*ShowReq)(nil), // 4: w_projectpb.ShowReq + (*ShowRes)(nil), // 5: w_projectpb.ShowRes + (*StoreReq)(nil), // 6: w_projectpb.StoreReq + (*StoreRes)(nil), // 7: w_projectpb.StoreRes + (*UpdateReq)(nil), // 8: w_projectpb.UpdateReq + (*UpdateRes)(nil), // 9: w_projectpb.UpdateRes + (*DestroyReq)(nil), // 10: w_projectpb.DestroyReq + (*DestroyRes)(nil), // 11: w_projectpb.DestroyRes + (*CertReq)(nil), // 12: w_projectpb.CertReq + (*CertRes)(nil), // 13: w_projectpb.CertRes + (*ProjectSecretReq)(nil), // 14: w_projectpb.ProjectSecretReq + (*ProjectSecretRes)(nil), // 15: w_projectpb.ProjectSecretRes + (*ChangeSecretReq)(nil), // 16: w_projectpb.ChangeSecretReq + (*ChangeSecretRes)(nil), // 17: w_projectpb.ChangeSecretRes + (*ChangeOplatformReq)(nil), // 18: w_projectpb.ChangeOplatformReq + (*ChangeOplatformRes)(nil), // 19: w_projectpb.ChangeOplatformRes + (*DomainListReq)(nil), // 20: w_projectpb.DomainListReq + (*DomainListRes)(nil), // 21: w_projectpb.DomainListRes + (*SaveAdsConfigReq)(nil), // 22: w_projectpb.SaveAdsConfigReq + (*SaveAdsConfigRes)(nil), // 23: w_projectpb.SaveAdsConfigRes + (*AdsConfigReq)(nil), // 24: w_projectpb.AdsConfigReq + (*AdsConfigRes)(nil), // 25: w_projectpb.AdsConfigRes + (*ChangeRebootUrlReq)(nil), // 26: w_projectpb.ChangeRebootUrlReq + (*ChangeRebootUrlRes)(nil), // 27: w_projectpb.ChangeRebootUrlRes + (*FissionConfigReq)(nil), // 28: w_projectpb.FissionConfigReq + (*FissionConfigRes)(nil), // 29: w_projectpb.FissionConfigRes + (*SetPushVisitReq)(nil), // 30: w_projectpb.SetPushVisitReq + (*SetPushVisitRes)(nil), // 31: w_projectpb.SetPushVisitRes + (*SetPushCampaignTaskReq)(nil), // 32: w_projectpb.SetPushCampaignTaskReq + (*SetPushCampaignTaskRes)(nil), // 33: w_projectpb.SetPushCampaignTaskRes + (*SelectRes_One)(nil), // 34: w_projectpb.SelectRes.One + (*ListRes_One)(nil), // 35: w_projectpb.ListRes.One + (*ListRes_UserRelate)(nil), // 36: w_projectpb.ListRes.UserRelate + (*CertRes_CertSecret)(nil), // 37: w_projectpb.CertRes.CertSecret + (*DomainListRes_One)(nil), // 38: w_projectpb.DomainListRes.One +} +var file_w_project_proto_depIdxs = []int32{ + 34, // 0: w_projectpb.SelectRes.list:type_name -> w_projectpb.SelectRes.One + 35, // 1: w_projectpb.ListRes.list:type_name -> w_projectpb.ListRes.One + 37, // 2: w_projectpb.CertRes.cert_secrets:type_name -> w_projectpb.CertRes.CertSecret + 38, // 3: w_projectpb.DomainListRes.list:type_name -> w_projectpb.DomainListRes.One + 36, // 4: w_projectpb.ListRes.One.user_relate:type_name -> w_projectpb.ListRes.UserRelate + 0, // 5: w_projectpb.WProject.Select:input_type -> w_projectpb.SelectReq + 2, // 6: w_projectpb.WProject.List:input_type -> w_projectpb.ListReq + 4, // 7: w_projectpb.WProject.Show:input_type -> w_projectpb.ShowReq + 6, // 8: w_projectpb.WProject.Store:input_type -> w_projectpb.StoreReq + 8, // 9: w_projectpb.WProject.Update:input_type -> w_projectpb.UpdateReq + 10, // 10: w_projectpb.WProject.Destroy:input_type -> w_projectpb.DestroyReq + 12, // 11: w_projectpb.WProject.Cert:input_type -> w_projectpb.CertReq + 14, // 12: w_projectpb.WProject.ProjectSecret:input_type -> w_projectpb.ProjectSecretReq + 16, // 13: w_projectpb.WProject.ChangeSecret:input_type -> w_projectpb.ChangeSecretReq + 18, // 14: w_projectpb.WProject.ChangeOplatform:input_type -> w_projectpb.ChangeOplatformReq + 20, // 15: w_projectpb.WProject.DomainList:input_type -> w_projectpb.DomainListReq + 22, // 16: w_projectpb.WProject.SaveAdsConfig:input_type -> w_projectpb.SaveAdsConfigReq + 24, // 17: w_projectpb.WProject.AdsConfig:input_type -> w_projectpb.AdsConfigReq + 26, // 18: w_projectpb.WProject.ChangeRebootUrl:input_type -> w_projectpb.ChangeRebootUrlReq + 28, // 19: w_projectpb.WProject.FissionConfig:input_type -> w_projectpb.FissionConfigReq + 30, // 20: w_projectpb.WProject.SetPushVisit:input_type -> w_projectpb.SetPushVisitReq + 32, // 21: w_projectpb.WProject.SetPushCampaignTask:input_type -> w_projectpb.SetPushCampaignTaskReq + 1, // 22: w_projectpb.WProject.Select:output_type -> w_projectpb.SelectRes + 3, // 23: w_projectpb.WProject.List:output_type -> w_projectpb.ListRes + 5, // 24: w_projectpb.WProject.Show:output_type -> w_projectpb.ShowRes + 7, // 25: w_projectpb.WProject.Store:output_type -> w_projectpb.StoreRes + 9, // 26: w_projectpb.WProject.Update:output_type -> w_projectpb.UpdateRes + 11, // 27: w_projectpb.WProject.Destroy:output_type -> w_projectpb.DestroyRes + 13, // 28: w_projectpb.WProject.Cert:output_type -> w_projectpb.CertRes + 15, // 29: w_projectpb.WProject.ProjectSecret:output_type -> w_projectpb.ProjectSecretRes + 17, // 30: w_projectpb.WProject.ChangeSecret:output_type -> w_projectpb.ChangeSecretRes + 19, // 31: w_projectpb.WProject.ChangeOplatform:output_type -> w_projectpb.ChangeOplatformRes + 21, // 32: w_projectpb.WProject.DomainList:output_type -> w_projectpb.DomainListRes + 23, // 33: w_projectpb.WProject.SaveAdsConfig:output_type -> w_projectpb.SaveAdsConfigRes + 25, // 34: w_projectpb.WProject.AdsConfig:output_type -> w_projectpb.AdsConfigRes + 27, // 35: w_projectpb.WProject.ChangeRebootUrl:output_type -> w_projectpb.ChangeRebootUrlRes + 29, // 36: w_projectpb.WProject.FissionConfig:output_type -> w_projectpb.FissionConfigRes + 31, // 37: w_projectpb.WProject.SetPushVisit:output_type -> w_projectpb.SetPushVisitRes + 33, // 38: w_projectpb.WProject.SetPushCampaignTask:output_type -> w_projectpb.SetPushCampaignTaskRes + 22, // [22:39] is the sub-list for method output_type + 5, // [5:22] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_w_project_proto_init() } +func file_w_project_proto_init() { + if File_w_project_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_project_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectSecretReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectSecretRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeSecretReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeSecretRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeOplatformReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeOplatformRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DomainListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DomainListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveAdsConfigReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveAdsConfigRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsConfigReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdsConfigRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeRebootUrlReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeRebootUrlRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FissionConfigReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FissionConfigRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetPushVisitReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetPushVisitRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetPushCampaignTaskReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetPushCampaignTaskRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_UserRelate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertRes_CertSecret); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DomainListRes_One); 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_w_project_proto_rawDesc, + NumEnums: 0, + NumMessages: 39, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_project_proto_goTypes, + DependencyIndexes: file_w_project_proto_depIdxs, + MessageInfos: file_w_project_proto_msgTypes, + }.Build() + File_w_project_proto = out.File + file_w_project_proto_rawDesc = nil + file_w_project_proto_goTypes = nil + file_w_project_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_project/w_project.pb.micro.go b/proto/go_proto/w_project/w_project.pb.micro.go new file mode 100644 index 0000000..026c77d --- /dev/null +++ b/proto/go_proto/w_project/w_project.pb.micro.go @@ -0,0 +1,393 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_project.proto + +package w_projectpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WProject service + +func NewWProjectEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WProject service + +type WProjectService interface { + // Select 项目选择列表 + Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) + // List 项目列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // Show 项目详情 + Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) + // Store 创建项目 + Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) + // Update 更新项目 + Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) + // Destroy 删除项目 + Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) + // Cert 项目认证 + Cert(ctx context.Context, in *CertReq, opts ...client.CallOption) (*CertRes, error) + // ProjectSecret 项目私钥 + ProjectSecret(ctx context.Context, in *ProjectSecretReq, opts ...client.CallOption) (*ProjectSecretRes, error) + // ChangeSecret 修改密钥 + ChangeSecret(ctx context.Context, in *ChangeSecretReq, opts ...client.CallOption) (*ChangeSecretRes, error) + // ChangeOplatform 修改开放平台 + ChangeOplatform(ctx context.Context, in *ChangeOplatformReq, opts ...client.CallOption) (*ChangeOplatformRes, error) + // DomainList 获取项目域名绑定的项目 + DomainList(ctx context.Context, in *DomainListReq, opts ...client.CallOption) (*DomainListRes, error) + // SaveAdsConfig 保存广告配置 + SaveAdsConfig(ctx context.Context, in *SaveAdsConfigReq, opts ...client.CallOption) (*SaveAdsConfigRes, error) + // AdsConfig 获取广告配置 + AdsConfig(ctx context.Context, in *AdsConfigReq, opts ...client.CallOption) (*AdsConfigRes, error) + // ChangeRebootUrl 修改开放平台的活动回调地址 + ChangeRebootUrl(ctx context.Context, in *ChangeRebootUrlReq, opts ...client.CallOption) (*ChangeRebootUrlRes, error) + // FissionConfig 获取广告配置 + FissionConfig(ctx context.Context, in *FissionConfigReq, opts ...client.CallOption) (*FissionConfigRes, error) + // SetPushVisit 设置活动访问推送开关 + SetPushVisit(ctx context.Context, in *SetPushVisitReq, opts ...client.CallOption) (*SetPushVisitRes, error) + // SetPushCampaignTask 设置活动任务完成推送开关 + SetPushCampaignTask(ctx context.Context, in *SetPushCampaignTaskReq, opts ...client.CallOption) (*SetPushCampaignTaskRes, error) +} + +type wProjectService struct { + c client.Client + name string +} + +func NewWProjectService(name string, c client.Client) WProjectService { + return &wProjectService{ + c: c, + name: name, + } +} + +func (c *wProjectService) Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) { + req := c.c.NewRequest(c.name, "WProject.Select", in) + out := new(SelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WProject.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) { + req := c.c.NewRequest(c.name, "WProject.Show", in) + out := new(ShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) { + req := c.c.NewRequest(c.name, "WProject.Store", in) + out := new(StoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) { + req := c.c.NewRequest(c.name, "WProject.Update", in) + out := new(UpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) { + req := c.c.NewRequest(c.name, "WProject.Destroy", in) + out := new(DestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) Cert(ctx context.Context, in *CertReq, opts ...client.CallOption) (*CertRes, error) { + req := c.c.NewRequest(c.name, "WProject.Cert", in) + out := new(CertRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) ProjectSecret(ctx context.Context, in *ProjectSecretReq, opts ...client.CallOption) (*ProjectSecretRes, error) { + req := c.c.NewRequest(c.name, "WProject.ProjectSecret", in) + out := new(ProjectSecretRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) ChangeSecret(ctx context.Context, in *ChangeSecretReq, opts ...client.CallOption) (*ChangeSecretRes, error) { + req := c.c.NewRequest(c.name, "WProject.ChangeSecret", in) + out := new(ChangeSecretRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) ChangeOplatform(ctx context.Context, in *ChangeOplatformReq, opts ...client.CallOption) (*ChangeOplatformRes, error) { + req := c.c.NewRequest(c.name, "WProject.ChangeOplatform", in) + out := new(ChangeOplatformRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) DomainList(ctx context.Context, in *DomainListReq, opts ...client.CallOption) (*DomainListRes, error) { + req := c.c.NewRequest(c.name, "WProject.DomainList", in) + out := new(DomainListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) SaveAdsConfig(ctx context.Context, in *SaveAdsConfigReq, opts ...client.CallOption) (*SaveAdsConfigRes, error) { + req := c.c.NewRequest(c.name, "WProject.SaveAdsConfig", in) + out := new(SaveAdsConfigRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) AdsConfig(ctx context.Context, in *AdsConfigReq, opts ...client.CallOption) (*AdsConfigRes, error) { + req := c.c.NewRequest(c.name, "WProject.AdsConfig", in) + out := new(AdsConfigRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) ChangeRebootUrl(ctx context.Context, in *ChangeRebootUrlReq, opts ...client.CallOption) (*ChangeRebootUrlRes, error) { + req := c.c.NewRequest(c.name, "WProject.ChangeRebootUrl", in) + out := new(ChangeRebootUrlRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) FissionConfig(ctx context.Context, in *FissionConfigReq, opts ...client.CallOption) (*FissionConfigRes, error) { + req := c.c.NewRequest(c.name, "WProject.FissionConfig", in) + out := new(FissionConfigRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) SetPushVisit(ctx context.Context, in *SetPushVisitReq, opts ...client.CallOption) (*SetPushVisitRes, error) { + req := c.c.NewRequest(c.name, "WProject.SetPushVisit", in) + out := new(SetPushVisitRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectService) SetPushCampaignTask(ctx context.Context, in *SetPushCampaignTaskReq, opts ...client.CallOption) (*SetPushCampaignTaskRes, error) { + req := c.c.NewRequest(c.name, "WProject.SetPushCampaignTask", in) + out := new(SetPushCampaignTaskRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WProject service + +type WProjectHandler interface { + // Select 项目选择列表 + Select(context.Context, *SelectReq, *SelectRes) error + // List 项目列表 + List(context.Context, *ListReq, *ListRes) error + // Show 项目详情 + Show(context.Context, *ShowReq, *ShowRes) error + // Store 创建项目 + Store(context.Context, *StoreReq, *StoreRes) error + // Update 更新项目 + Update(context.Context, *UpdateReq, *UpdateRes) error + // Destroy 删除项目 + Destroy(context.Context, *DestroyReq, *DestroyRes) error + // Cert 项目认证 + Cert(context.Context, *CertReq, *CertRes) error + // ProjectSecret 项目私钥 + ProjectSecret(context.Context, *ProjectSecretReq, *ProjectSecretRes) error + // ChangeSecret 修改密钥 + ChangeSecret(context.Context, *ChangeSecretReq, *ChangeSecretRes) error + // ChangeOplatform 修改开放平台 + ChangeOplatform(context.Context, *ChangeOplatformReq, *ChangeOplatformRes) error + // DomainList 获取项目域名绑定的项目 + DomainList(context.Context, *DomainListReq, *DomainListRes) error + // SaveAdsConfig 保存广告配置 + SaveAdsConfig(context.Context, *SaveAdsConfigReq, *SaveAdsConfigRes) error + // AdsConfig 获取广告配置 + AdsConfig(context.Context, *AdsConfigReq, *AdsConfigRes) error + // ChangeRebootUrl 修改开放平台的活动回调地址 + ChangeRebootUrl(context.Context, *ChangeRebootUrlReq, *ChangeRebootUrlRes) error + // FissionConfig 获取广告配置 + FissionConfig(context.Context, *FissionConfigReq, *FissionConfigRes) error + // SetPushVisit 设置活动访问推送开关 + SetPushVisit(context.Context, *SetPushVisitReq, *SetPushVisitRes) error + // SetPushCampaignTask 设置活动任务完成推送开关 + SetPushCampaignTask(context.Context, *SetPushCampaignTaskReq, *SetPushCampaignTaskRes) error +} + +func RegisterWProjectHandler(s server.Server, hdlr WProjectHandler, opts ...server.HandlerOption) error { + type wProject interface { + Select(ctx context.Context, in *SelectReq, out *SelectRes) error + List(ctx context.Context, in *ListReq, out *ListRes) error + Show(ctx context.Context, in *ShowReq, out *ShowRes) error + Store(ctx context.Context, in *StoreReq, out *StoreRes) error + Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error + Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error + Cert(ctx context.Context, in *CertReq, out *CertRes) error + ProjectSecret(ctx context.Context, in *ProjectSecretReq, out *ProjectSecretRes) error + ChangeSecret(ctx context.Context, in *ChangeSecretReq, out *ChangeSecretRes) error + ChangeOplatform(ctx context.Context, in *ChangeOplatformReq, out *ChangeOplatformRes) error + DomainList(ctx context.Context, in *DomainListReq, out *DomainListRes) error + SaveAdsConfig(ctx context.Context, in *SaveAdsConfigReq, out *SaveAdsConfigRes) error + AdsConfig(ctx context.Context, in *AdsConfigReq, out *AdsConfigRes) error + ChangeRebootUrl(ctx context.Context, in *ChangeRebootUrlReq, out *ChangeRebootUrlRes) error + FissionConfig(ctx context.Context, in *FissionConfigReq, out *FissionConfigRes) error + SetPushVisit(ctx context.Context, in *SetPushVisitReq, out *SetPushVisitRes) error + SetPushCampaignTask(ctx context.Context, in *SetPushCampaignTaskReq, out *SetPushCampaignTaskRes) error + } + type WProject struct { + wProject + } + h := &wProjectHandler{hdlr} + return s.Handle(s.NewHandler(&WProject{h}, opts...)) +} + +type wProjectHandler struct { + WProjectHandler +} + +func (h *wProjectHandler) Select(ctx context.Context, in *SelectReq, out *SelectRes) error { + return h.WProjectHandler.Select(ctx, in, out) +} + +func (h *wProjectHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WProjectHandler.List(ctx, in, out) +} + +func (h *wProjectHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error { + return h.WProjectHandler.Show(ctx, in, out) +} + +func (h *wProjectHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error { + return h.WProjectHandler.Store(ctx, in, out) +} + +func (h *wProjectHandler) Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error { + return h.WProjectHandler.Update(ctx, in, out) +} + +func (h *wProjectHandler) Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error { + return h.WProjectHandler.Destroy(ctx, in, out) +} + +func (h *wProjectHandler) Cert(ctx context.Context, in *CertReq, out *CertRes) error { + return h.WProjectHandler.Cert(ctx, in, out) +} + +func (h *wProjectHandler) ProjectSecret(ctx context.Context, in *ProjectSecretReq, out *ProjectSecretRes) error { + return h.WProjectHandler.ProjectSecret(ctx, in, out) +} + +func (h *wProjectHandler) ChangeSecret(ctx context.Context, in *ChangeSecretReq, out *ChangeSecretRes) error { + return h.WProjectHandler.ChangeSecret(ctx, in, out) +} + +func (h *wProjectHandler) ChangeOplatform(ctx context.Context, in *ChangeOplatformReq, out *ChangeOplatformRes) error { + return h.WProjectHandler.ChangeOplatform(ctx, in, out) +} + +func (h *wProjectHandler) DomainList(ctx context.Context, in *DomainListReq, out *DomainListRes) error { + return h.WProjectHandler.DomainList(ctx, in, out) +} + +func (h *wProjectHandler) SaveAdsConfig(ctx context.Context, in *SaveAdsConfigReq, out *SaveAdsConfigRes) error { + return h.WProjectHandler.SaveAdsConfig(ctx, in, out) +} + +func (h *wProjectHandler) AdsConfig(ctx context.Context, in *AdsConfigReq, out *AdsConfigRes) error { + return h.WProjectHandler.AdsConfig(ctx, in, out) +} + +func (h *wProjectHandler) ChangeRebootUrl(ctx context.Context, in *ChangeRebootUrlReq, out *ChangeRebootUrlRes) error { + return h.WProjectHandler.ChangeRebootUrl(ctx, in, out) +} + +func (h *wProjectHandler) FissionConfig(ctx context.Context, in *FissionConfigReq, out *FissionConfigRes) error { + return h.WProjectHandler.FissionConfig(ctx, in, out) +} + +func (h *wProjectHandler) SetPushVisit(ctx context.Context, in *SetPushVisitReq, out *SetPushVisitRes) error { + return h.WProjectHandler.SetPushVisit(ctx, in, out) +} + +func (h *wProjectHandler) SetPushCampaignTask(ctx context.Context, in *SetPushCampaignTaskReq, out *SetPushCampaignTaskRes) error { + return h.WProjectHandler.SetPushCampaignTask(ctx, in, out) +} diff --git a/proto/go_proto/w_project_user/w_project_user.pb.go b/proto/go_proto/w_project_user/w_project_user.pb.go new file mode 100644 index 0000000..fa85129 --- /dev/null +++ b/proto/go_proto/w_project_user/w_project_user.pb.go @@ -0,0 +1,555 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_project_user.proto + +package w_project_userpb + +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 PointReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目ID + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //第三方用户ID + PointSource int32 `protobuf:"varint,3,opt,name=point_source,json=pointSource,proto3" json:"point_source,omitempty"` //积分来源(0-应用内部,1-系统自带) + UrlId int64 `protobuf:"varint,4,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //请求地址id + LangMark string `protobuf:"bytes,5,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 +} + +func (x *PointReq) Reset() { + *x = PointReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointReq) ProtoMessage() {} + +func (x *PointReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_user_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 PointReq.ProtoReflect.Descriptor instead. +func (*PointReq) Descriptor() ([]byte, []int) { + return file_w_project_user_proto_rawDescGZIP(), []int{0} +} + +func (x *PointReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *PointReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PointReq) GetPointSource() int32 { + if x != nil { + return x.PointSource + } + return 0 +} + +func (x *PointReq) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *PointReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type PointRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目用户ID + CoinNum int64 `protobuf:"varint,2,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //积分数量 +} + +func (x *PointRes) Reset() { + *x = PointRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointRes) ProtoMessage() {} + +func (x *PointRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_user_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 PointRes.ProtoReflect.Descriptor instead. +func (*PointRes) Descriptor() ([]byte, []int) { + return file_w_project_user_proto_rawDescGZIP(), []int{1} +} + +func (x *PointRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PointRes) GetCoinNum() int64 { + if x != nil { + return x.CoinNum + } + return 0 +} + +type EarnCoinReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目ID + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //第三方用户ID + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 + Earns []*EarnCoinReq_Earn `protobuf:"bytes,4,rep,name=earns,proto3" json:"earns,omitempty"` //获得的积分 +} + +func (x *EarnCoinReq) Reset() { + *x = EarnCoinReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EarnCoinReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EarnCoinReq) ProtoMessage() {} + +func (x *EarnCoinReq) ProtoReflect() protoreflect.Message { + mi := &file_w_project_user_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 EarnCoinReq.ProtoReflect.Descriptor instead. +func (*EarnCoinReq) Descriptor() ([]byte, []int) { + return file_w_project_user_proto_rawDescGZIP(), []int{2} +} + +func (x *EarnCoinReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *EarnCoinReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *EarnCoinReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *EarnCoinReq) GetEarns() []*EarnCoinReq_Earn { + if x != nil { + return x.Earns + } + return nil +} + +type EarnCoinRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录ID +} + +func (x *EarnCoinRes) Reset() { + *x = EarnCoinRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EarnCoinRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EarnCoinRes) ProtoMessage() {} + +func (x *EarnCoinRes) ProtoReflect() protoreflect.Message { + mi := &file_w_project_user_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 EarnCoinRes.ProtoReflect.Descriptor instead. +func (*EarnCoinRes) Descriptor() ([]byte, []int) { + return file_w_project_user_proto_rawDescGZIP(), []int{3} +} + +func (x *EarnCoinRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type EarnCoinReq_Earn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CoinNum int32 `protobuf:"varint,1,opt,name=coin_num,json=coinNum,proto3" json:"coin_num,omitempty"` //积分数量 + ExpiredAt int64 `protobuf:"varint,2,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` //期时间 + IsExpired int32 `protobuf:"varint,3,opt,name=is_expired,json=isExpired,proto3" json:"is_expired,omitempty"` //是否过期(0-否,1-是) + Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` //来源(center-任务中心,campaign-活动) + SourceId int64 `protobuf:"varint,5,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` //来源ID + SourceData map[string]string `protobuf:"bytes,6,rep,name=source_data,json=sourceData,proto3" json:"source_data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //来源数据 + Operate string `protobuf:"bytes,7,opt,name=operate,proto3" json:"operate,omitempty"` //操作 +} + +func (x *EarnCoinReq_Earn) Reset() { + *x = EarnCoinReq_Earn{} + if protoimpl.UnsafeEnabled { + mi := &file_w_project_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EarnCoinReq_Earn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EarnCoinReq_Earn) ProtoMessage() {} + +func (x *EarnCoinReq_Earn) ProtoReflect() protoreflect.Message { + mi := &file_w_project_user_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 EarnCoinReq_Earn.ProtoReflect.Descriptor instead. +func (*EarnCoinReq_Earn) Descriptor() ([]byte, []int) { + return file_w_project_user_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *EarnCoinReq_Earn) GetCoinNum() int32 { + if x != nil { + return x.CoinNum + } + return 0 +} + +func (x *EarnCoinReq_Earn) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +func (x *EarnCoinReq_Earn) GetIsExpired() int32 { + if x != nil { + return x.IsExpired + } + return 0 +} + +func (x *EarnCoinReq_Earn) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *EarnCoinReq_Earn) GetSourceId() int64 { + if x != nil { + return x.SourceId + } + return 0 +} + +func (x *EarnCoinReq_Earn) GetSourceData() map[string]string { + if x != nil { + return x.SourceData + } + return nil +} + +func (x *EarnCoinReq_Earn) GetOperate() string { + if x != nil { + return x.Operate + } + return "" +} + +var File_w_project_user_proto protoreflect.FileDescriptor + +var file_w_project_user_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x22, 0x99, 0x01, 0x0a, 0x08, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x4d, 0x61, 0x72, 0x6b, 0x22, 0x35, 0x0a, 0x08, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x22, 0xe1, 0x03, 0x0a, 0x0b, + 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, + 0x12, 0x38, 0x0a, 0x05, 0x65, 0x61, 0x72, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x45, + 0x61, 0x72, 0x6e, 0x52, 0x05, 0x65, 0x61, 0x72, 0x6e, 0x73, 0x1a, 0xc2, 0x02, 0x0a, 0x04, 0x45, + 0x61, 0x72, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x69, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x53, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x1a, 0x3d, 0x0a, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x1d, 0x0a, 0x0b, 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x32, 0x9d, + 0x01, 0x0a, 0x0c, 0x57, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x41, 0x0a, 0x05, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x08, 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1d, + 0x2e, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, + 0x62, 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, + 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x45, 0x61, 0x72, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x15, + 0x5a, 0x13, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_project_user_proto_rawDescOnce sync.Once + file_w_project_user_proto_rawDescData = file_w_project_user_proto_rawDesc +) + +func file_w_project_user_proto_rawDescGZIP() []byte { + file_w_project_user_proto_rawDescOnce.Do(func() { + file_w_project_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_project_user_proto_rawDescData) + }) + return file_w_project_user_proto_rawDescData +} + +var file_w_project_user_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_w_project_user_proto_goTypes = []interface{}{ + (*PointReq)(nil), // 0: w_project_userpb.PointReq + (*PointRes)(nil), // 1: w_project_userpb.PointRes + (*EarnCoinReq)(nil), // 2: w_project_userpb.EarnCoinReq + (*EarnCoinRes)(nil), // 3: w_project_userpb.EarnCoinRes + (*EarnCoinReq_Earn)(nil), // 4: w_project_userpb.EarnCoinReq.Earn + nil, // 5: w_project_userpb.EarnCoinReq.Earn.SourceDataEntry +} +var file_w_project_user_proto_depIdxs = []int32{ + 4, // 0: w_project_userpb.EarnCoinReq.earns:type_name -> w_project_userpb.EarnCoinReq.Earn + 5, // 1: w_project_userpb.EarnCoinReq.Earn.source_data:type_name -> w_project_userpb.EarnCoinReq.Earn.SourceDataEntry + 0, // 2: w_project_userpb.WProjectUser.Point:input_type -> w_project_userpb.PointReq + 2, // 3: w_project_userpb.WProjectUser.EarnCoin:input_type -> w_project_userpb.EarnCoinReq + 1, // 4: w_project_userpb.WProjectUser.Point:output_type -> w_project_userpb.PointRes + 3, // 5: w_project_userpb.WProjectUser.EarnCoin:output_type -> w_project_userpb.EarnCoinRes + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_w_project_user_proto_init() } +func file_w_project_user_proto_init() { + if File_w_project_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_project_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EarnCoinReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EarnCoinRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_project_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EarnCoinReq_Earn); 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_w_project_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_project_user_proto_goTypes, + DependencyIndexes: file_w_project_user_proto_depIdxs, + MessageInfos: file_w_project_user_proto_msgTypes, + }.Build() + File_w_project_user_proto = out.File + file_w_project_user_proto_rawDesc = nil + file_w_project_user_proto_goTypes = nil + file_w_project_user_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_project_user/w_project_user.pb.micro.go b/proto/go_proto/w_project_user/w_project_user.pb.micro.go new file mode 100644 index 0000000..76b946a --- /dev/null +++ b/proto/go_proto/w_project_user/w_project_user.pb.micro.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_project_user.proto + +package w_project_userpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WProjectUser service + +func NewWProjectUserEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WProjectUser service + +type WProjectUserService interface { + // Point 积分 + Point(ctx context.Context, in *PointReq, opts ...client.CallOption) (*PointRes, error) + // EarnCoin 获取积分 + EarnCoin(ctx context.Context, in *EarnCoinReq, opts ...client.CallOption) (*EarnCoinRes, error) +} + +type wProjectUserService struct { + c client.Client + name string +} + +func NewWProjectUserService(name string, c client.Client) WProjectUserService { + return &wProjectUserService{ + c: c, + name: name, + } +} + +func (c *wProjectUserService) Point(ctx context.Context, in *PointReq, opts ...client.CallOption) (*PointRes, error) { + req := c.c.NewRequest(c.name, "WProjectUser.Point", in) + out := new(PointRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wProjectUserService) EarnCoin(ctx context.Context, in *EarnCoinReq, opts ...client.CallOption) (*EarnCoinRes, error) { + req := c.c.NewRequest(c.name, "WProjectUser.EarnCoin", in) + out := new(EarnCoinRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WProjectUser service + +type WProjectUserHandler interface { + // Point 积分 + Point(context.Context, *PointReq, *PointRes) error + // EarnCoin 获取积分 + EarnCoin(context.Context, *EarnCoinReq, *EarnCoinRes) error +} + +func RegisterWProjectUserHandler(s server.Server, hdlr WProjectUserHandler, opts ...server.HandlerOption) error { + type wProjectUser interface { + Point(ctx context.Context, in *PointReq, out *PointRes) error + EarnCoin(ctx context.Context, in *EarnCoinReq, out *EarnCoinRes) error + } + type WProjectUser struct { + wProjectUser + } + h := &wProjectUserHandler{hdlr} + return s.Handle(s.NewHandler(&WProjectUser{h}, opts...)) +} + +type wProjectUserHandler struct { + WProjectUserHandler +} + +func (h *wProjectUserHandler) Point(ctx context.Context, in *PointReq, out *PointRes) error { + return h.WProjectUserHandler.Point(ctx, in, out) +} + +func (h *wProjectUserHandler) EarnCoin(ctx context.Context, in *EarnCoinReq, out *EarnCoinRes) error { + return h.WProjectUserHandler.EarnCoin(ctx, in, out) +} diff --git a/proto/go_proto/w_register/w_register.pb.go b/proto/go_proto/w_register/w_register.pb.go new file mode 100644 index 0000000..ab40cfe --- /dev/null +++ b/proto/go_proto/w_register/w_register.pb.go @@ -0,0 +1,259 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_register.proto + +package w_registerpb + +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 StoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` //注册账号(申请通过后超级管理员登陆的账号) + ShortName string `protobuf:"bytes,2,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` //申请通过后公司显示的简称 + Passwd string `protobuf:"bytes,3,opt,name=passwd,proto3" json:"passwd,omitempty"` //申请通过后超级管理员登陆的密码 + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` //注册邮箱 + Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` //手机号 + AppName string `protobuf:"bytes,6,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` //站点名称 +} + +func (x *StoreReq) Reset() { + *x = StoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_register_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq) ProtoMessage() {} + +func (x *StoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_register_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 StoreReq.ProtoReflect.Descriptor instead. +func (*StoreReq) Descriptor() ([]byte, []int) { + return file_w_register_proto_rawDescGZIP(), []int{0} +} + +func (x *StoreReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *StoreReq) GetShortName() string { + if x != nil { + return x.ShortName + } + return "" +} + +func (x *StoreReq) GetPasswd() string { + if x != nil { + return x.Passwd + } + return "" +} + +func (x *StoreReq) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *StoreReq) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *StoreReq) GetAppName() string { + if x != nil { + return x.AppName + } + return "" +} + +type StoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //记录id +} + +func (x *StoreRes) Reset() { + *x = StoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_register_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreRes) ProtoMessage() {} + +func (x *StoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_register_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 StoreRes.ProtoReflect.Descriptor instead. +func (*StoreRes) Descriptor() ([]byte, []int) { + return file_w_register_proto_rawDescGZIP(), []int{1} +} + +func (x *StoreRes) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +var File_w_register_proto protoreflect.FileDescriptor + +var file_w_register_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x77, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0c, 0x77, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, + 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, + 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x68, 0x6f, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x02, 0x69, 0x64, 0x32, 0x46, 0x0a, 0x09, 0x57, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x39, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, 0x2e, + 0x2f, 0x3b, 0x77, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_register_proto_rawDescOnce sync.Once + file_w_register_proto_rawDescData = file_w_register_proto_rawDesc +) + +func file_w_register_proto_rawDescGZIP() []byte { + file_w_register_proto_rawDescOnce.Do(func() { + file_w_register_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_register_proto_rawDescData) + }) + return file_w_register_proto_rawDescData +} + +var file_w_register_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_w_register_proto_goTypes = []interface{}{ + (*StoreReq)(nil), // 0: w_registerpb.StoreReq + (*StoreRes)(nil), // 1: w_registerpb.StoreRes +} +var file_w_register_proto_depIdxs = []int32{ + 0, // 0: w_registerpb.WRegister.Store:input_type -> w_registerpb.StoreReq + 1, // 1: w_registerpb.WRegister.Store:output_type -> w_registerpb.StoreRes + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_w_register_proto_init() } +func file_w_register_proto_init() { + if File_w_register_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_register_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_register_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreRes); 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_w_register_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_register_proto_goTypes, + DependencyIndexes: file_w_register_proto_depIdxs, + MessageInfos: file_w_register_proto_msgTypes, + }.Build() + File_w_register_proto = out.File + file_w_register_proto_rawDesc = nil + file_w_register_proto_goTypes = nil + file_w_register_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_register/w_register.pb.micro.go b/proto/go_proto/w_register/w_register.pb.micro.go new file mode 100644 index 0000000..a18fbfc --- /dev/null +++ b/proto/go_proto/w_register/w_register.pb.micro.go @@ -0,0 +1,89 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_register.proto + +package w_registerpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WRegister service + +func NewWRegisterEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WRegister service + +type WRegisterService interface { + // Store 添加注册申请 + Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) +} + +type wRegisterService struct { + c client.Client + name string +} + +func NewWRegisterService(name string, c client.Client) WRegisterService { + return &wRegisterService{ + c: c, + name: name, + } +} + +func (c *wRegisterService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) { + req := c.c.NewRequest(c.name, "WRegister.Store", in) + out := new(StoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WRegister service + +type WRegisterHandler interface { + // Store 添加注册申请 + Store(context.Context, *StoreReq, *StoreRes) error +} + +func RegisterWRegisterHandler(s server.Server, hdlr WRegisterHandler, opts ...server.HandlerOption) error { + type wRegister interface { + Store(ctx context.Context, in *StoreReq, out *StoreRes) error + } + type WRegister struct { + wRegister + } + h := &wRegisterHandler{hdlr} + return s.Handle(s.NewHandler(&WRegister{h}, opts...)) +} + +type wRegisterHandler struct { + WRegisterHandler +} + +func (h *wRegisterHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error { + return h.WRegisterHandler.Store(ctx, in, out) +} diff --git a/proto/go_proto/w_reward/w_reward.pb.go b/proto/go_proto/w_reward/w_reward.pb.go new file mode 100644 index 0000000..d6d61bb --- /dev/null +++ b/proto/go_proto/w_reward/w_reward.pb.go @@ -0,0 +1,6543 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_reward.proto + +package w_rewardpb + +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 ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + PageLang string `protobuf:"bytes,3,opt,name=page_lang,json=pageLang,proto3" json:"page_lang,omitempty"` //页面语言 + ProjectHashId string `protobuf:"bytes,4,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + LangMark string `protobuf:"bytes,6,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //奖品语言,多个用逗号分开 + RewardTitle string `protobuf:"bytes,7,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + OrderType int32 `protobuf:"varint,8,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"` //排序类型(1-创建时间升序),其他默认 +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{0} +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *ListReq) GetPageLang() string { + if x != nil { + return x.PageLang + } + return "" +} + +func (x *ListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *ListReq) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *ListReq) GetOrderType() int32 { + if x != nil { + return x.OrderType + } + return 0 +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type SelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + LangMark string `protobuf:"bytes,2,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //奖品语言 + ReceiveType int32 `protobuf:"varint,3,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) +} + +func (x *SelectReq) Reset() { + *x = SelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectReq) ProtoMessage() {} + +func (x *SelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 SelectReq.ProtoReflect.Descriptor instead. +func (*SelectReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{2} +} + +func (x *SelectReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *SelectReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *SelectReq) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +type SelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*SelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *SelectRes) Reset() { + *x = SelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes) ProtoMessage() {} + +func (x *SelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 SelectRes.ProtoReflect.Descriptor instead. +func (*SelectRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{3} +} + +func (x *SelectRes) GetList() []*SelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type ShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //奖品id +} + +func (x *ShowReq) Reset() { + *x = ShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowReq) ProtoMessage() {} + +func (x *ShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 ShowReq.ProtoReflect.Descriptor instead. +func (*ShowReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{4} +} + +func (x *ShowReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ShowReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + ReceiveType int32 `protobuf:"varint,3,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + UrlId int64 `protobuf:"varint,4,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + Contact string `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + KvData []*ShowRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Langs []*ShowRes_Lang `protobuf:"bytes,7,rep,name=langs,proto3" json:"langs,omitempty"` //语言数据 + FormId int64 `protobuf:"varint,8,opt,name=form_id,json=formId,proto3" json:"form_id,omitempty"` //表单Id + RelateNum int64 `protobuf:"varint,9,opt,name=relate_num,json=relateNum,proto3" json:"relate_num,omitempty"` //关联使用的数量 + DyRewardType int32 `protobuf:"varint,10,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) +} + +func (x *ShowRes) Reset() { + *x = ShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes) ProtoMessage() {} + +func (x *ShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 ShowRes.ProtoReflect.Descriptor instead. +func (*ShowRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{5} +} + +func (x *ShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *ShowRes) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ShowRes) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *ShowRes) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ShowRes) GetKvData() []*ShowRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ShowRes) GetLangs() []*ShowRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *ShowRes) GetFormId() int64 { + if x != nil { + return x.FormId + } + return 0 +} + +func (x *ShowRes) GetRelateNum() int64 { + if x != nil { + return x.RelateNum + } + return 0 +} + +func (x *ShowRes) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +type StoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + ReceiveType int32 `protobuf:"varint,3,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + UrlId int64 `protobuf:"varint,4,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + Contact string `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + KvData []*StoreReq_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Langs []*StoreReq_Lang `protobuf:"bytes,7,rep,name=langs,proto3" json:"langs,omitempty"` //语言数据 + FormId int64 `protobuf:"varint,8,opt,name=form_id,json=formId,proto3" json:"form_id,omitempty"` //表单id + DyRewardType int32 `protobuf:"varint,9,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) + Source int32 `protobuf:"varint,10,opt,name=source,proto3" json:"source,omitempty"` //数据来源(0-后台创建,1-奖品数据迁移,2-api创建) +} + +func (x *StoreReq) Reset() { + *x = StoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq) ProtoMessage() {} + +func (x *StoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 StoreReq.ProtoReflect.Descriptor instead. +func (*StoreReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{6} +} + +func (x *StoreReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *StoreReq) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *StoreReq) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *StoreReq) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *StoreReq) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *StoreReq) GetKvData() []*StoreReq_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *StoreReq) GetLangs() []*StoreReq_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *StoreReq) GetFormId() int64 { + if x != nil { + return x.FormId + } + return 0 +} + +func (x *StoreReq) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +func (x *StoreReq) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +type StoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id +} + +func (x *StoreRes) Reset() { + *x = StoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreRes) ProtoMessage() {} + +func (x *StoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 StoreRes.ProtoReflect.Descriptor instead. +func (*StoreRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{7} +} + +func (x *StoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type UpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,3,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + ReceiveType int32 `protobuf:"varint,4,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + UrlId int64 `protobuf:"varint,5,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + Contact string `protobuf:"bytes,6,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + KvData []*UpdateReq_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Langs []*UpdateReq_Lang `protobuf:"bytes,8,rep,name=langs,proto3" json:"langs,omitempty"` //语言数据 + FormId int64 `protobuf:"varint,9,opt,name=form_id,json=formId,proto3" json:"form_id,omitempty"` //表单id + DyRewardType int32 `protobuf:"varint,10,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) +} + +func (x *UpdateReq) Reset() { + *x = UpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq) ProtoMessage() {} + +func (x *UpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UpdateReq.ProtoReflect.Descriptor instead. +func (*UpdateReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *UpdateReq) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *UpdateReq) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *UpdateReq) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *UpdateReq) GetKvData() []*UpdateReq_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *UpdateReq) GetLangs() []*UpdateReq_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *UpdateReq) GetFormId() int64 { + if x != nil { + return x.FormId + } + return 0 +} + +func (x *UpdateReq) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +type UpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id +} + +func (x *UpdateRes) Reset() { + *x = UpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRes) ProtoMessage() {} + +func (x *UpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UpdateRes.ProtoReflect.Descriptor instead. +func (*UpdateRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Ids string `protobuf:"bytes,2,opt,name=ids,proto3" json:"ids,omitempty"` //奖品id,多个用逗号分割 +} + +func (x *DestroyReq) Reset() { + *x = DestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyReq) ProtoMessage() {} + +func (x *DestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 DestroyReq.ProtoReflect.Descriptor instead. +func (*DestroyReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{10} +} + +func (x *DestroyReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *DestroyReq) GetIds() string { + if x != nil { + return x.Ids + } + return "" +} + +type DestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` //还关联活动的奖品id +} + +func (x *DestroyRes) Reset() { + *x = DestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyRes) ProtoMessage() {} + +func (x *DestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 DestroyRes.ProtoReflect.Descriptor instead. +func (*DestroyRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{11} +} + +func (x *DestroyRes) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +type UrlListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + OrderType int32 `protobuf:"varint,2,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"` //排序类型(1-创建时间升序),其他默认 +} + +func (x *UrlListReq) Reset() { + *x = UrlListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlListReq) ProtoMessage() {} + +func (x *UrlListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlListReq.ProtoReflect.Descriptor instead. +func (*UrlListReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{12} +} + +func (x *UrlListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UrlListReq) GetOrderType() int32 { + if x != nil { + return x.OrderType + } + return 0 +} + +type UrlListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UrlListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *UrlListRes) Reset() { + *x = UrlListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlListRes) ProtoMessage() {} + +func (x *UrlListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlListRes.ProtoReflect.Descriptor instead. +func (*UrlListRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{13} +} + +func (x *UrlListRes) GetList() []*UrlListRes_One { + if x != nil { + return x.List + } + return nil +} + +type UrlStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //回调地址说明 + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + Source int32 `protobuf:"varint,4,opt,name=source,proto3" json:"source,omitempty"` //数据来源(0-后台创建,1-奖品数据迁移,2-api创建) + Headers []*UrlStoreReq_Header `protobuf:"bytes,5,rep,name=headers,proto3" json:"headers,omitempty"` //头信息 +} + +func (x *UrlStoreReq) Reset() { + *x = UrlStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlStoreReq) ProtoMessage() {} + +func (x *UrlStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlStoreReq.ProtoReflect.Descriptor instead. +func (*UrlStoreReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{14} +} + +func (x *UrlStoreReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UrlStoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UrlStoreReq) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *UrlStoreReq) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *UrlStoreReq) GetHeaders() []*UrlStoreReq_Header { + if x != nil { + return x.Headers + } + return nil +} + +type UrlStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //地址id +} + +func (x *UrlStoreRes) Reset() { + *x = UrlStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlStoreRes) ProtoMessage() {} + +func (x *UrlStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlStoreRes.ProtoReflect.Descriptor instead. +func (*UrlStoreRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{15} +} + +func (x *UrlStoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type UrlUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //地址id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //回调地址说明 + Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + Headers []*UrlUpdateReq_Header `protobuf:"bytes,5,rep,name=headers,proto3" json:"headers,omitempty"` //头信息 +} + +func (x *UrlUpdateReq) Reset() { + *x = UrlUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlUpdateReq) ProtoMessage() {} + +func (x *UrlUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlUpdateReq.ProtoReflect.Descriptor instead. +func (*UrlUpdateReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{16} +} + +func (x *UrlUpdateReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UrlUpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UrlUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UrlUpdateReq) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *UrlUpdateReq) GetHeaders() []*UrlUpdateReq_Header { + if x != nil { + return x.Headers + } + return nil +} + +type UrlUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //地址id +} + +func (x *UrlUpdateRes) Reset() { + *x = UrlUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlUpdateRes) ProtoMessage() {} + +func (x *UrlUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlUpdateRes.ProtoReflect.Descriptor instead. +func (*UrlUpdateRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{17} +} + +func (x *UrlUpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type UrlDestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //地址id +} + +func (x *UrlDestroyReq) Reset() { + *x = UrlDestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlDestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlDestroyReq) ProtoMessage() {} + +func (x *UrlDestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlDestroyReq.ProtoReflect.Descriptor instead. +func (*UrlDestroyReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{18} +} + +func (x *UrlDestroyReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UrlDestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type UrlDestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UrlDestroyRes) Reset() { + *x = UrlDestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlDestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlDestroyRes) ProtoMessage() {} + +func (x *UrlDestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 UrlDestroyRes.ProtoReflect.Descriptor instead. +func (*UrlDestroyRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{19} +} + +type FormListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + ProjectHashId string `protobuf:"bytes,3,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` //表单标题 +} + +func (x *FormListReq) Reset() { + *x = FormListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormListReq) ProtoMessage() {} + +func (x *FormListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 FormListReq.ProtoReflect.Descriptor instead. +func (*FormListReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{20} +} + +func (x *FormListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *FormListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *FormListReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *FormListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type FormListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*FormListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *FormListRes) Reset() { + *x = FormListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormListRes) ProtoMessage() {} + +func (x *FormListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 FormListRes.ProtoReflect.Descriptor instead. +func (*FormListRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{21} +} + +func (x *FormListRes) GetList() []*FormListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *FormListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type FormSelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *FormSelectReq) Reset() { + *x = FormSelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormSelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormSelectReq) ProtoMessage() {} + +func (x *FormSelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 FormSelectReq.ProtoReflect.Descriptor instead. +func (*FormSelectReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{22} +} + +func (x *FormSelectReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type FormSelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*FormSelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *FormSelectRes) Reset() { + *x = FormSelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormSelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormSelectRes) ProtoMessage() {} + +func (x *FormSelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_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 FormSelectRes.ProtoReflect.Descriptor instead. +func (*FormSelectRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{23} +} + +func (x *FormSelectRes) GetList() []*FormSelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type FormStoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //表单标题 + Items []*FormStoreReq_Item `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` //表单项 +} + +func (x *FormStoreReq) Reset() { + *x = FormStoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormStoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormStoreReq) ProtoMessage() {} + +func (x *FormStoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[24] + 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 FormStoreReq.ProtoReflect.Descriptor instead. +func (*FormStoreReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{24} +} + +func (x *FormStoreReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *FormStoreReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *FormStoreReq) GetItems() []*FormStoreReq_Item { + if x != nil { + return x.Items + } + return nil +} + +type FormStoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单id +} + +func (x *FormStoreRes) Reset() { + *x = FormStoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormStoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormStoreRes) ProtoMessage() {} + +func (x *FormStoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[25] + 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 FormStoreRes.ProtoReflect.Descriptor instead. +func (*FormStoreRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{25} +} + +func (x *FormStoreRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type FormUpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //表单标题 + Items []*FormUpdateReq_Item `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` //表单项 +} + +func (x *FormUpdateReq) Reset() { + *x = FormUpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormUpdateReq) ProtoMessage() {} + +func (x *FormUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[26] + 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 FormUpdateReq.ProtoReflect.Descriptor instead. +func (*FormUpdateReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{26} +} + +func (x *FormUpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *FormUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *FormUpdateReq) GetItems() []*FormUpdateReq_Item { + if x != nil { + return x.Items + } + return nil +} + +type FormUpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单id +} + +func (x *FormUpdateRes) Reset() { + *x = FormUpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormUpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormUpdateRes) ProtoMessage() {} + +func (x *FormUpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[27] + 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 FormUpdateRes.ProtoReflect.Descriptor instead. +func (*FormUpdateRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{27} +} + +func (x *FormUpdateRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type FormDestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //表单ID +} + +func (x *FormDestroyReq) Reset() { + *x = FormDestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormDestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormDestroyReq) ProtoMessage() {} + +func (x *FormDestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[28] + 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 FormDestroyReq.ProtoReflect.Descriptor instead. +func (*FormDestroyReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{28} +} + +func (x *FormDestroyReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *FormDestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type FormDestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单id +} + +func (x *FormDestroyRes) Reset() { + *x = FormDestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormDestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormDestroyRes) ProtoMessage() {} + +func (x *FormDestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[29] + 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 FormDestroyRes.ProtoReflect.Descriptor instead. +func (*FormDestroyRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{29} +} + +func (x *FormDestroyRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type FormsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + Ids []int64 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids,omitempty"` //表单id +} + +func (x *FormsReq) Reset() { + *x = FormsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormsReq) ProtoMessage() {} + +func (x *FormsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[30] + 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 FormsReq.ProtoReflect.Descriptor instead. +func (*FormsReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{30} +} + +func (x *FormsReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *FormsReq) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +type FormsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*FormsRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *FormsRes) Reset() { + *x = FormsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormsRes) ProtoMessage() {} + +func (x *FormsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[31] + 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 FormsRes.ProtoReflect.Descriptor instead. +func (*FormsRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{31} +} + +func (x *FormsRes) GetList() []*FormsRes_One { + if x != nil { + return x.List + } + return nil +} + +type UrlsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + Ids []int64 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids,omitempty"` //地址id +} + +func (x *UrlsReq) Reset() { + *x = UrlsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlsReq) ProtoMessage() {} + +func (x *UrlsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[32] + 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 UrlsReq.ProtoReflect.Descriptor instead. +func (*UrlsReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{32} +} + +func (x *UrlsReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *UrlsReq) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +type UrlsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*UrlsRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *UrlsRes) Reset() { + *x = UrlsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlsRes) ProtoMessage() {} + +func (x *UrlsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[33] + 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 UrlsRes.ProtoReflect.Descriptor instead. +func (*UrlsRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{33} +} + +func (x *UrlsRes) GetList() []*UrlsRes_One { + if x != nil { + return x.List + } + return nil +} + +type RewardsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + Ids []int64 `protobuf:"varint,2,rep,packed,name=ids,proto3" json:"ids,omitempty"` //奖品id + LangMark string `protobuf:"bytes,3,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //语言标识 +} + +func (x *RewardsReq) Reset() { + *x = RewardsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardsReq) ProtoMessage() {} + +func (x *RewardsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[34] + 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 RewardsReq.ProtoReflect.Descriptor instead. +func (*RewardsReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{34} +} + +func (x *RewardsReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *RewardsReq) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +func (x *RewardsReq) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +type RewardsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*RewardsRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *RewardsRes) Reset() { + *x = RewardsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardsRes) ProtoMessage() {} + +func (x *RewardsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[35] + 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 RewardsRes.ProtoReflect.Descriptor instead. +func (*RewardsRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{35} +} + +func (x *RewardsRes) GetList() []*RewardsRes_One { + if x != nil { + return x.List + } + return nil +} + +type RelateRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + RelateId int64 `protobuf:"varint,2,opt,name=relate_id,json=relateId,proto3" json:"relate_id,omitempty"` //关联id + RelateTable string `protobuf:"bytes,3,opt,name=relate_table,json=relateTable,proto3" json:"relate_table,omitempty"` //关联表名字,如果不是dplk_db库,建议带上库名字如dbname.relate_table_name + RewardIds []int64 `protobuf:"varint,4,rep,packed,name=reward_ids,json=rewardIds,proto3" json:"reward_ids,omitempty"` //关联的奖品id集合 +} + +func (x *RelateRewardReq) Reset() { + *x = RelateRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelateRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelateRewardReq) ProtoMessage() {} + +func (x *RelateRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[36] + 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 RelateRewardReq.ProtoReflect.Descriptor instead. +func (*RelateRewardReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{36} +} + +func (x *RelateRewardReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *RelateRewardReq) GetRelateId() int64 { + if x != nil { + return x.RelateId + } + return 0 +} + +func (x *RelateRewardReq) GetRelateTable() string { + if x != nil { + return x.RelateTable + } + return "" +} + +func (x *RelateRewardReq) GetRewardIds() []int64 { + if x != nil { + return x.RewardIds + } + return nil +} + +type RelateRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RelateRewardRes) Reset() { + *x = RelateRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelateRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelateRewardRes) ProtoMessage() {} + +func (x *RelateRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[37] + 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 RelateRewardRes.ProtoReflect.Descriptor instead. +func (*RelateRewardRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{37} +} + +type PushRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` //来源标识,wall-积分墙,center-任务中心 + SourceId int64 `protobuf:"varint,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` //来源id,如:来源是campaign,这个就写campaign_id,没有填写0 + SourceHashId string `protobuf:"bytes,3,opt,name=source_hash_id,json=sourceHashId,proto3" json:"source_hash_id,omitempty"` //来源hash_id,推送 + SourceSecondId int64 `protobuf:"varint,4,opt,name=source_second_id,json=sourceSecondId,proto3" json:"source_second_id,omitempty"` //来源第二级id,如:来源是任务中心,奖品任务中心的某个模块发放,这里就是模块id,没有填写0 + RelateId int64 `protobuf:"varint,5,opt,name=relate_id,json=relateId,proto3" json:"relate_id,omitempty"` //关联id,用于后续对比查询,如:发放记录的ID + RelateHashId string `protobuf:"bytes,6,opt,name=relate_hash_id,json=relateHashId,proto3" json:"relate_hash_id,omitempty"` //推送时给第三方的id + Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` //关联id,用于后续对比查询,如:发放记录的ID + RewardId int64 `protobuf:"varint,8,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` //推送的奖品库存id + Num int32 `protobuf:"varint,9,opt,name=num,proto3" json:"num,omitempty"` //奖品发放数量 + UserId string `protobuf:"bytes,10,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //第三方应用的用户id + UserPlatform string `protobuf:"bytes,11,opt,name=user_platform,json=userPlatform,proto3" json:"user_platform,omitempty"` //活动用户设备平台 + ParentUserId string `protobuf:"bytes,12,opt,name=parent_user_id,json=parentUserId,proto3" json:"parent_user_id,omitempty"` //上级用户id + ParentPlatform string `protobuf:"bytes,13,opt,name=parent_platform,json=parentPlatform,proto3" json:"parent_platform,omitempty"` //活动用户的上级用户设备平台 + Lang string `protobuf:"bytes,14,opt,name=lang,proto3" json:"lang,omitempty"` //用户语言标识 + Sync int32 `protobuf:"varint,15,opt,name=sync,proto3" json:"sync,omitempty"` //是否同步请求(0-否,1-是) + RewardType int32 `protobuf:"varint,16,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"` //发放类型(1-活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励,7-子活动奖励,8-兑换奖励),没有合适的要加 + CampaignId int64 `protobuf:"varint,17,opt,name=campaign_id,json=campaignId,proto3" json:"campaign_id,omitempty"` //推送的活动id +} + +func (x *PushRewardReq) Reset() { + *x = PushRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushRewardReq) ProtoMessage() {} + +func (x *PushRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[38] + 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 PushRewardReq.ProtoReflect.Descriptor instead. +func (*PushRewardReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{38} +} + +func (x *PushRewardReq) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *PushRewardReq) GetSourceId() int64 { + if x != nil { + return x.SourceId + } + return 0 +} + +func (x *PushRewardReq) GetSourceHashId() string { + if x != nil { + return x.SourceHashId + } + return "" +} + +func (x *PushRewardReq) GetSourceSecondId() int64 { + if x != nil { + return x.SourceSecondId + } + return 0 +} + +func (x *PushRewardReq) GetRelateId() int64 { + if x != nil { + return x.RelateId + } + return 0 +} + +func (x *PushRewardReq) GetRelateHashId() string { + if x != nil { + return x.RelateHashId + } + return "" +} + +func (x *PushRewardReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *PushRewardReq) GetRewardId() int64 { + if x != nil { + return x.RewardId + } + return 0 +} + +func (x *PushRewardReq) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *PushRewardReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PushRewardReq) GetUserPlatform() string { + if x != nil { + return x.UserPlatform + } + return "" +} + +func (x *PushRewardReq) GetParentUserId() string { + if x != nil { + return x.ParentUserId + } + return "" +} + +func (x *PushRewardReq) GetParentPlatform() string { + if x != nil { + return x.ParentPlatform + } + return "" +} + +func (x *PushRewardReq) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *PushRewardReq) GetSync() int32 { + if x != nil { + return x.Sync + } + return 0 +} + +func (x *PushRewardReq) GetRewardType() int32 { + if x != nil { + return x.RewardType + } + return 0 +} + +func (x *PushRewardReq) GetCampaignId() int64 { + if x != nil { + return x.CampaignId + } + return 0 +} + +type PushRewardRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` //当前发放任务id,固定20位字符串 + RewardVal string `protobuf:"bytes,2,opt,name=reward_val,json=rewardVal,proto3" json:"reward_val,omitempty"` //回调后接收到的数据 + Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` //状态(1-推送中,2-完成,3-失败) + FailType string `protobuf:"bytes,4,opt,name=fail_type,json=failType,proto3" json:"fail_type,omitempty"` //失败类型,system-系统出错,client-客户的错误,undefined-未知错误 + FailMsg string `protobuf:"bytes,5,opt,name=fail_msg,json=failMsg,proto3" json:"fail_msg,omitempty"` //错误信息 +} + +func (x *PushRewardRes) Reset() { + *x = PushRewardRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushRewardRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushRewardRes) ProtoMessage() {} + +func (x *PushRewardRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[39] + 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 PushRewardRes.ProtoReflect.Descriptor instead. +func (*PushRewardRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{39} +} + +func (x *PushRewardRes) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *PushRewardRes) GetRewardVal() string { + if x != nil { + return x.RewardVal + } + return "" +} + +func (x *PushRewardRes) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *PushRewardRes) GetFailType() string { + if x != nil { + return x.FailType + } + return "" +} + +func (x *PushRewardRes) GetFailMsg() string { + if x != nil { + return x.FailMsg + } + return "" +} + +type RewardIdsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId int64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` //项目id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //获取奖品标题 +} + +func (x *RewardIdsReq) Reset() { + *x = RewardIdsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardIdsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardIdsReq) ProtoMessage() {} + +func (x *RewardIdsReq) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[40] + 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 RewardIdsReq.ProtoReflect.Descriptor instead. +func (*RewardIdsReq) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{40} +} + +func (x *RewardIdsReq) GetProjectId() int64 { + if x != nil { + return x.ProjectId + } + return 0 +} + +func (x *RewardIdsReq) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +type RewardIdsRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` //列表数据 +} + +func (x *RewardIdsRes) Reset() { + *x = RewardIdsRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardIdsRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardIdsRes) ProtoMessage() {} + +func (x *RewardIdsRes) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[41] + 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 RewardIdsRes.ProtoReflect.Descriptor instead. +func (*RewardIdsRes) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{41} +} + +func (x *RewardIdsRes) GetIds() []int64 { + if x != nil { + return x.Ids + } + return nil +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + ReceiveType int32 `protobuf:"varint,5,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + RelatedNum int64 `protobuf:"varint,6,opt,name=related_num,json=relatedNum,proto3" json:"related_num,omitempty"` //关联数量 + KvData []*ListRes_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Langs []*ListRes_Lang `protobuf:"bytes,8,rep,name=langs,proto3" json:"langs,omitempty"` //语言数据 + DyRewardType int32 `protobuf:"varint,9,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) + CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Contact string `protobuf:"bytes,11,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + UrlId int64 `protobuf:"varint,12,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[42] + 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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *ListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_One) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ListRes_One) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *ListRes_One) GetRelatedNum() int64 { + if x != nil { + return x.RelatedNum + } + return 0 +} + +func (x *ListRes_One) GetKvData() []*ListRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *ListRes_One) GetLangs() []*ListRes_Lang { + if x != nil { + return x.Langs + } + return nil +} + +func (x *ListRes_One) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +func (x *ListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ListRes_One) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *ListRes_One) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +type ListRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ListRes_KV) Reset() { + *x = ListRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_KV) ProtoMessage() {} + +func (x *ListRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[43] + 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 ListRes_KV.ProtoReflect.Descriptor instead. +func (*ListRes_KV) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *ListRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ListRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ListRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type ListRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + IsDefault int32 `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认语言(0-否,1-是) + LangType int32 `protobuf:"varint,5,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言数字标识 + ImgId int64 `protobuf:"varint,6,opt,name=img_id,json=imgId,proto3" json:"img_id,omitempty"` //奖品图片id +} + +func (x *ListRes_Lang) Reset() { + *x = ListRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Lang) ProtoMessage() {} + +func (x *ListRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[44] + 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 ListRes_Lang.ProtoReflect.Descriptor instead. +func (*ListRes_Lang) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *ListRes_Lang) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *ListRes_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListRes_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ListRes_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *ListRes_Lang) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *ListRes_Lang) GetImgId() int64 { + if x != nil { + return x.ImgId + } + return 0 +} + +type SelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,4,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + LangMark string `protobuf:"bytes,5,opt,name=lang_mark,json=langMark,proto3" json:"lang_mark,omitempty"` //奖品语言 + ReceiveType int32 `protobuf:"varint,6,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + KvData []*SelectRes_KV `protobuf:"bytes,7,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Contact string `protobuf:"bytes,8,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + Url string `protobuf:"bytes,9,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + FormTitle string `protobuf:"bytes,10,opt,name=form_title,json=formTitle,proto3" json:"form_title,omitempty"` //表单标题 +} + +func (x *SelectRes_One) Reset() { + *x = SelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes_One) ProtoMessage() {} + +func (x *SelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[45] + 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 SelectRes_One.ProtoReflect.Descriptor instead. +func (*SelectRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *SelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SelectRes_One) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *SelectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *SelectRes_One) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *SelectRes_One) GetLangMark() string { + if x != nil { + return x.LangMark + } + return "" +} + +func (x *SelectRes_One) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *SelectRes_One) GetKvData() []*SelectRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *SelectRes_One) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *SelectRes_One) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *SelectRes_One) GetFormTitle() string { + if x != nil { + return x.FormTitle + } + return "" +} + +type SelectRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *SelectRes_KV) Reset() { + *x = SelectRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes_KV) ProtoMessage() {} + +func (x *SelectRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[46] + 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 SelectRes_KV.ProtoReflect.Descriptor instead. +func (*SelectRes_KV) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *SelectRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *SelectRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *SelectRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type ShowRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *ShowRes_KV) Reset() { + *x = ShowRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_KV) ProtoMessage() {} + +func (x *ShowRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[47] + 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 ShowRes_KV.ProtoReflect.Descriptor instead. +func (*ShowRes_KV) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ShowRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ShowRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ShowRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type ShowRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + IsDefault int32 `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认语言(0-否,1-是) + LangType int32 `protobuf:"varint,5,opt,name=lang_type,json=langType,proto3" json:"lang_type,omitempty"` //语言数字标识 + OpenToUse int32 `protobuf:"varint,6,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,7,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,8,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //App端的跳转参数 +} + +func (x *ShowRes_Lang) Reset() { + *x = ShowRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes_Lang) ProtoMessage() {} + +func (x *ShowRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[48] + 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 ShowRes_Lang.ProtoReflect.Descriptor instead. +func (*ShowRes_Lang) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *ShowRes_Lang) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *ShowRes_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ShowRes_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *ShowRes_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *ShowRes_Lang) GetLangType() int32 { + if x != nil { + return x.LangType + } + return 0 +} + +func (x *ShowRes_Lang) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *ShowRes_Lang) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *ShowRes_Lang) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *ShowRes_Lang) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type StoreReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *StoreReq_KV) Reset() { + *x = StoreReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_KV) ProtoMessage() {} + +func (x *StoreReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[49] + 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 StoreReq_KV.ProtoReflect.Descriptor instead. +func (*StoreReq_KV) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *StoreReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *StoreReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *StoreReq_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type StoreReq_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + IsDefault int32 `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认语言(0-否,1-是) + OpenToUse int32 `protobuf:"varint,5,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,6,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,7,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ImageId int64 `protobuf:"varint,8,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` //图片id + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //App端的跳转参数 +} + +func (x *StoreReq_Lang) Reset() { + *x = StoreReq_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq_Lang) ProtoMessage() {} + +func (x *StoreReq_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[50] + 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 StoreReq_Lang.ProtoReflect.Descriptor instead. +func (*StoreReq_Lang) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *StoreReq_Lang) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *StoreReq_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StoreReq_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *StoreReq_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *StoreReq_Lang) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *StoreReq_Lang) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *StoreReq_Lang) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *StoreReq_Lang) GetImageId() int64 { + if x != nil { + return x.ImageId + } + return 0 +} + +func (x *StoreReq_Lang) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type UpdateReq_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *UpdateReq_KV) Reset() { + *x = UpdateReq_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_KV) ProtoMessage() {} + +func (x *UpdateReq_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[51] + 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 UpdateReq_KV.ProtoReflect.Descriptor instead. +func (*UpdateReq_KV) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *UpdateReq_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateReq_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *UpdateReq_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type UpdateReq_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + IsDefault int32 `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认语言(0-否,1-是) + OpenToUse int32 `protobuf:"varint,5,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,6,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,7,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + ImageId int64 `protobuf:"varint,8,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` //图片id + PcParam string `protobuf:"bytes,9,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //App端的跳转参数 +} + +func (x *UpdateReq_Lang) Reset() { + *x = UpdateReq_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq_Lang) ProtoMessage() {} + +func (x *UpdateReq_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[52] + 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 UpdateReq_Lang.ProtoReflect.Descriptor instead. +func (*UpdateReq_Lang) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{8, 1} +} + +func (x *UpdateReq_Lang) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UpdateReq_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UpdateReq_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *UpdateReq_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *UpdateReq_Lang) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *UpdateReq_Lang) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *UpdateReq_Lang) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *UpdateReq_Lang) GetImageId() int64 { + if x != nil { + return x.ImageId + } + return 0 +} + +func (x *UpdateReq_Lang) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +type UrlListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //回调地址id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //回调地址说明 + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + Num int64 `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"` //关联奖品数量 + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Headers []*UrlListRes_Header `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty"` //头信息 +} + +func (x *UrlListRes_One) Reset() { + *x = UrlListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlListRes_One) ProtoMessage() {} + +func (x *UrlListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[53] + 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 UrlListRes_One.ProtoReflect.Descriptor instead. +func (*UrlListRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *UrlListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UrlListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UrlListRes_One) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *UrlListRes_One) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *UrlListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *UrlListRes_One) GetHeaders() []*UrlListRes_Header { + if x != nil { + return x.Headers + } + return nil +} + +type UrlListRes_Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //回调头键 + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //特殊键标识 + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //回调数值 +} + +func (x *UrlListRes_Header) Reset() { + *x = UrlListRes_Header{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlListRes_Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlListRes_Header) ProtoMessage() {} + +func (x *UrlListRes_Header) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[54] + 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 UrlListRes_Header.ProtoReflect.Descriptor instead. +func (*UrlListRes_Header) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{13, 1} +} + +func (x *UrlListRes_Header) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UrlListRes_Header) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UrlListRes_Header) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type UrlStoreReq_Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //回调头键 + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //特殊键标识 + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //回调数值 +} + +func (x *UrlStoreReq_Header) Reset() { + *x = UrlStoreReq_Header{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlStoreReq_Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlStoreReq_Header) ProtoMessage() {} + +func (x *UrlStoreReq_Header) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[55] + 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 UrlStoreReq_Header.ProtoReflect.Descriptor instead. +func (*UrlStoreReq_Header) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *UrlStoreReq_Header) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UrlStoreReq_Header) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UrlStoreReq_Header) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type UrlUpdateReq_Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //回调头键 + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //特殊键标识 + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //回调数值 +} + +func (x *UrlUpdateReq_Header) Reset() { + *x = UrlUpdateReq_Header{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlUpdateReq_Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlUpdateReq_Header) ProtoMessage() {} + +func (x *UrlUpdateReq_Header) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[56] + 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 UrlUpdateReq_Header.ProtoReflect.Descriptor instead. +func (*UrlUpdateReq_Header) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *UrlUpdateReq_Header) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UrlUpdateReq_Header) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UrlUpdateReq_Header) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type FormListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //表单标题 + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Items []*FormListRes_Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` //表单项 + Num int64 `protobuf:"varint,5,opt,name=num,proto3" json:"num,omitempty"` //关联奖品数量 +} + +func (x *FormListRes_One) Reset() { + *x = FormListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormListRes_One) ProtoMessage() {} + +func (x *FormListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[57] + 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 FormListRes_One.ProtoReflect.Descriptor instead. +func (*FormListRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{21, 0} +} + +func (x *FormListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *FormListRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *FormListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *FormListRes_One) GetItems() []*FormListRes_Item { + if x != nil { + return x.Items + } + return nil +} + +func (x *FormListRes_One) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + +type FormListRes_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //表单项名称 +} + +func (x *FormListRes_Item) Reset() { + *x = FormListRes_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormListRes_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormListRes_Item) ProtoMessage() {} + +func (x *FormListRes_Item) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[58] + 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 FormListRes_Item.ProtoReflect.Descriptor instead. +func (*FormListRes_Item) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{21, 1} +} + +func (x *FormListRes_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type FormSelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //表单标题 +} + +func (x *FormSelectRes_One) Reset() { + *x = FormSelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormSelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormSelectRes_One) ProtoMessage() {} + +func (x *FormSelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[59] + 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 FormSelectRes_One.ProtoReflect.Descriptor instead. +func (*FormSelectRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{23, 0} +} + +func (x *FormSelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *FormSelectRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type FormStoreReq_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //表单项名称 + Trans []*FormStoreReq_Tran `protobuf:"bytes,2,rep,name=trans,proto3" json:"trans,omitempty"` //字段语言翻译 +} + +func (x *FormStoreReq_Item) Reset() { + *x = FormStoreReq_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormStoreReq_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormStoreReq_Item) ProtoMessage() {} + +func (x *FormStoreReq_Item) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[60] + 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 FormStoreReq_Item.ProtoReflect.Descriptor instead. +func (*FormStoreReq_Item) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{24, 0} +} + +func (x *FormStoreReq_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FormStoreReq_Item) GetTrans() []*FormStoreReq_Tran { + if x != nil { + return x.Trans + } + return nil +} + +type FormStoreReq_Tran struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //字段对应语言的名称 + IsDefault int32 `protobuf:"varint,3,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //字段语言翻译 +} + +func (x *FormStoreReq_Tran) Reset() { + *x = FormStoreReq_Tran{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormStoreReq_Tran) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormStoreReq_Tran) ProtoMessage() {} + +func (x *FormStoreReq_Tran) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[61] + 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 FormStoreReq_Tran.ProtoReflect.Descriptor instead. +func (*FormStoreReq_Tran) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{24, 1} +} + +func (x *FormStoreReq_Tran) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *FormStoreReq_Tran) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FormStoreReq_Tran) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +type FormUpdateReq_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //表单项名称 + Trans []*FormUpdateReq_Tran `protobuf:"bytes,2,rep,name=trans,proto3" json:"trans,omitempty"` //字段语言翻译 +} + +func (x *FormUpdateReq_Item) Reset() { + *x = FormUpdateReq_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormUpdateReq_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormUpdateReq_Item) ProtoMessage() {} + +func (x *FormUpdateReq_Item) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[62] + 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 FormUpdateReq_Item.ProtoReflect.Descriptor instead. +func (*FormUpdateReq_Item) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{26, 0} +} + +func (x *FormUpdateReq_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FormUpdateReq_Item) GetTrans() []*FormUpdateReq_Tran { + if x != nil { + return x.Trans + } + return nil +} + +type FormUpdateReq_Tran struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` //字段对应语言的名称 + IsDefault int32 `protobuf:"varint,3,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //字段语言翻译 +} + +func (x *FormUpdateReq_Tran) Reset() { + *x = FormUpdateReq_Tran{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormUpdateReq_Tran) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormUpdateReq_Tran) ProtoMessage() {} + +func (x *FormUpdateReq_Tran) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[63] + 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 FormUpdateReq_Tran.ProtoReflect.Descriptor instead. +func (*FormUpdateReq_Tran) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{26, 1} +} + +func (x *FormUpdateReq_Tran) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *FormUpdateReq_Tran) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FormUpdateReq_Tran) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +type FormsRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //表单ID + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //表单标题 + CreatedAt int64 `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Items []*FormsRes_Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` //表单项 +} + +func (x *FormsRes_One) Reset() { + *x = FormsRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormsRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormsRes_One) ProtoMessage() {} + +func (x *FormsRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[64] + 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 FormsRes_One.ProtoReflect.Descriptor instead. +func (*FormsRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{31, 0} +} + +func (x *FormsRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *FormsRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *FormsRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *FormsRes_One) GetItems() []*FormsRes_Item { + if x != nil { + return x.Items + } + return nil +} + +type FormsRes_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //表单项名称 +} + +func (x *FormsRes_Item) Reset() { + *x = FormsRes_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormsRes_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormsRes_Item) ProtoMessage() {} + +func (x *FormsRes_Item) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[65] + 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 FormsRes_Item.ProtoReflect.Descriptor instead. +func (*FormsRes_Item) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{31, 1} +} + +func (x *FormsRes_Item) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type UrlsRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //回调地址id + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //回调地址说明 + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` //回调地址 + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Headers []*UrlsRes_Header `protobuf:"bytes,5,rep,name=headers,proto3" json:"headers,omitempty"` //头信息 +} + +func (x *UrlsRes_One) Reset() { + *x = UrlsRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlsRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlsRes_One) ProtoMessage() {} + +func (x *UrlsRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[66] + 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 UrlsRes_One.ProtoReflect.Descriptor instead. +func (*UrlsRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{33, 0} +} + +func (x *UrlsRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UrlsRes_One) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *UrlsRes_One) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *UrlsRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *UrlsRes_One) GetHeaders() []*UrlsRes_Header { + if x != nil { + return x.Headers + } + return nil +} + +type UrlsRes_Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //回调头键 + Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark,omitempty"` //特殊键标识 + Val string `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"` //回调数值 +} + +func (x *UrlsRes_Header) Reset() { + *x = UrlsRes_Header{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UrlsRes_Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UrlsRes_Header) ProtoMessage() {} + +func (x *UrlsRes_Header) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[67] + 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 UrlsRes_Header.ProtoReflect.Descriptor instead. +func (*UrlsRes_Header) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{33, 1} +} + +func (x *UrlsRes_Header) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UrlsRes_Header) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *UrlsRes_Header) GetVal() string { + if x != nil { + return x.Val + } + return "" +} + +type RewardsRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //奖品id + RewardTitle string `protobuf:"bytes,2,opt,name=reward_title,json=rewardTitle,proto3" json:"reward_title,omitempty"` //奖品标题 + ReceiveType int32 `protobuf:"varint,3,opt,name=receive_type,json=receiveType,proto3" json:"receive_type,omitempty"` //发放类型(1-系统发放,2-联系客服,4-提交表单) + UrlId int64 `protobuf:"varint,4,opt,name=url_id,json=urlId,proto3" json:"url_id,omitempty"` //回调地址id + Contact string `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` //联系方式 + KvData []*RewardsRes_KV `protobuf:"bytes,6,rep,name=kv_data,json=kvData,proto3" json:"kv_data,omitempty"` //键值数据 + Lang *RewardsRes_Lang `protobuf:"bytes,7,opt,name=lang,proto3" json:"lang,omitempty"` //语言数据 + FormId int64 `protobuf:"varint,8,opt,name=form_id,json=formId,proto3" json:"form_id,omitempty"` //表单Id + DyRewardType int32 `protobuf:"varint,9,opt,name=dy_reward_type,json=dyRewardType,proto3" json:"dy_reward_type,omitempty"` //动态奖品内容类型(0-无,1-兑换码) +} + +func (x *RewardsRes_One) Reset() { + *x = RewardsRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardsRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardsRes_One) ProtoMessage() {} + +func (x *RewardsRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[68] + 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 RewardsRes_One.ProtoReflect.Descriptor instead. +func (*RewardsRes_One) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{35, 0} +} + +func (x *RewardsRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardsRes_One) GetRewardTitle() string { + if x != nil { + return x.RewardTitle + } + return "" +} + +func (x *RewardsRes_One) GetReceiveType() int32 { + if x != nil { + return x.ReceiveType + } + return 0 +} + +func (x *RewardsRes_One) GetUrlId() int64 { + if x != nil { + return x.UrlId + } + return 0 +} + +func (x *RewardsRes_One) GetContact() string { + if x != nil { + return x.Contact + } + return "" +} + +func (x *RewardsRes_One) GetKvData() []*RewardsRes_KV { + if x != nil { + return x.KvData + } + return nil +} + +func (x *RewardsRes_One) GetLang() *RewardsRes_Lang { + if x != nil { + return x.Lang + } + return nil +} + +func (x *RewardsRes_One) GetFormId() int64 { + if x != nil { + return x.FormId + } + return 0 +} + +func (x *RewardsRes_One) GetDyRewardType() int32 { + if x != nil { + return x.DyRewardType + } + return 0 +} + +type RewardsRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 + IsShow int32 `protobuf:"varint,3,opt,name=is_show,json=isShow,proto3" json:"is_show,omitempty"` //是否展示(0-否,1-是) +} + +func (x *RewardsRes_KV) Reset() { + *x = RewardsRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardsRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardsRes_KV) ProtoMessage() {} + +func (x *RewardsRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[69] + 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 RewardsRes_KV.ProtoReflect.Descriptor instead. +func (*RewardsRes_KV) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{35, 1} +} + +func (x *RewardsRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *RewardsRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *RewardsRes_KV) GetIsShow() int32 { + if x != nil { + return x.IsShow + } + return 0 +} + +type RewardsRes_Lang struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark,omitempty"` //语言标识 + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` //奖品名称 + ImgUrl string `protobuf:"bytes,3,opt,name=img_url,json=imgUrl,proto3" json:"img_url,omitempty"` //奖品图片 + IsDefault int32 `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` //是否默认语言(0-否,1-是) + OpenToUse int32 `protobuf:"varint,5,opt,name=open_to_use,json=openToUse,proto3" json:"open_to_use,omitempty"` //开启去使用(0-否,1-是) + WebUrl string `protobuf:"bytes,6,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"` //Web端的跳转地址 + AppParam string `protobuf:"bytes,7,opt,name=app_param,json=appParam,proto3" json:"app_param,omitempty"` //App端的跳转参数 + PcParam string `protobuf:"bytes,8,opt,name=pc_param,json=pcParam,proto3" json:"pc_param,omitempty"` //pc端的跳转参数 +} + +func (x *RewardsRes_Lang) Reset() { + *x = RewardsRes_Lang{} + if protoimpl.UnsafeEnabled { + mi := &file_w_reward_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardsRes_Lang) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardsRes_Lang) ProtoMessage() {} + +func (x *RewardsRes_Lang) ProtoReflect() protoreflect.Message { + mi := &file_w_reward_proto_msgTypes[70] + 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 RewardsRes_Lang.ProtoReflect.Descriptor instead. +func (*RewardsRes_Lang) Descriptor() ([]byte, []int) { + return file_w_reward_proto_rawDescGZIP(), []int{35, 2} +} + +func (x *RewardsRes_Lang) GetMark() string { + if x != nil { + return x.Mark + } + return "" +} + +func (x *RewardsRes_Lang) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *RewardsRes_Lang) GetImgUrl() string { + if x != nil { + return x.ImgUrl + } + return "" +} + +func (x *RewardsRes_Lang) GetIsDefault() int32 { + if x != nil { + return x.IsDefault + } + return 0 +} + +func (x *RewardsRes_Lang) GetOpenToUse() int32 { + if x != nil { + return x.OpenToUse + } + return 0 +} + +func (x *RewardsRes_Lang) GetWebUrl() string { + if x != nil { + return x.WebUrl + } + return "" +} + +func (x *RewardsRes_Lang) GetAppParam() string { + if x != nil { + return x.AppParam + } + return "" +} + +func (x *RewardsRes_Lang) GetPcParam() string { + if x != nil { + return x.PcParam + } + return "" +} + +var File_w_reward_proto protoreflect.FileDescriptor + +var file_w_reward_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0a, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x22, 0xf2, 0x01, 0x0a, + 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, + 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x22, 0xb7, 0x05, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2b, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x77, 0x5f, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x1a, 0x82, 0x03, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x2f, + 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x2e, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x12, + 0x24, 0x0a, 0x0e, 0x64, 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x15, + 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x75, 0x72, 0x6c, 0x49, 0x64, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0x9c, 0x01, 0x0a, + 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x6d, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6d, 0x67, 0x49, 0x64, 0x22, 0x73, 0x0a, 0x09, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x22, 0xa9, 0x03, 0x0a, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2d, + 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, + 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xa5, 0x02, + 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, + 0x54, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x41, 0x0a, 0x07, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x8f, 0x05, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, + 0x6e, 0x67, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x64, + 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0xf6, 0x01, 0x0a, 0x04, 0x4c, 0x61, 0x6e, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, + 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, + 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x22, 0xa1, 0x05, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, + 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, + 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x72, + 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x30, 0x0a, + 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x2f, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, + 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x79, 0x5f, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0xf4, + 0x01, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, + 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, + 0x19, 0x0a, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x1a, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x9c, 0x05, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, + 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, + 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, + 0x72, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x31, + 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4b, 0x56, 0x52, 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x30, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x67, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x4c, 0x61, 0x6e, 0x67, 0x52, 0x05, 0x6c, 0x61, + 0x6e, 0x67, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, + 0x64, 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x79, + 0x70, 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0xf4, 0x01, 0x0a, 0x04, 0x4c, 0x61, + 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, + 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, + 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x54, + 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, + 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x22, 0x1b, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x46, 0x0a, + 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x1e, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x52, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x53, 0x0a, 0x0a, 0x55, 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0xa8, 0x02, 0x0a, 0x0a, 0x55, + 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, + 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xa7, 0x01, 0x0a, 0x03, 0x4f, 0x6e, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, + 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x55, 0x72, 0x6c, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x38, 0x0a, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x1d, 0x0a, 0x0b, 0x55, 0x72, 0x6c, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xeb, 0x01, 0x0a, 0x0c, 0x55, 0x72, 0x6c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x39, 0x0a, 0x07, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x1e, 0x0a, 0x0c, 0x55, 0x72, 0x6c, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x47, 0x0a, 0x0d, 0x55, 0x72, 0x6c, 0x44, 0x65, 0x73, + 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x0f, 0x0a, 0x0d, 0x55, 0x72, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, + 0x22, 0x7a, 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x26, + 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x83, 0x02, 0x0a, + 0x0b, 0x46, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x1a, 0x90, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x1a, 0x1a, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x37, 0x0a, 0x0d, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x6f, 0x0a, 0x0d, 0x46, + 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, + 0x2b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xa1, 0x02, 0x0a, + 0x0c, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, + 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x1a, 0x4f, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x77, 0x5f, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x52, 0x05, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x1a, 0x4d, 0x0a, 0x04, 0x54, 0x72, 0x61, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x22, 0x1e, 0x0a, 0x0c, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x8c, 0x02, 0x0a, 0x0d, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x50, + 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x77, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x52, 0x05, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x1a, 0x4d, 0x0a, 0x04, 0x54, 0x72, 0x61, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, + 0x1f, 0x0a, 0x0d, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x48, 0x0a, 0x0e, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, + 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x20, 0x0a, 0x0e, 0x46, 0x6f, + 0x72, 0x6d, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x08, + 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x08, 0x46, 0x6f, + 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, + 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x7b, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x1a, 0x1a, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, + 0x07, 0x55, 0x72, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x8d, 0x02, 0x0a, 0x07, 0x55, 0x72, + 0x6c, 0x73, 0x52, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, + 0x2e, 0x55, 0x72, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x1a, 0x92, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x34, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x55, 0x72, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x40, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x22, 0x5a, 0x0a, 0x0a, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x6e, 0x67, + 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, + 0x67, 0x4d, 0x61, 0x72, 0x6b, 0x22, 0x92, 0x05, 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x52, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xb0, 0x02, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x75, 0x72, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x75, 0x72, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x6b, 0x76, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, + 0x06, 0x6b, 0x76, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x2e, 0x4c, 0x61, + 0x6e, 0x67, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x6d, + 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x49, + 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x64, 0x79, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x79, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x1a, 0x45, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0xd9, + 0x01, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x6d, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x6d, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, + 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, + 0x19, 0x0a, 0x08, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x8f, 0x01, 0x0a, 0x0f, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x03, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x22, 0x11, 0x0a, 0x0f, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, + 0x93, 0x04, 0x0a, 0x0d, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x24, 0x0a, 0x0e, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6c, + 0x61, 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, + 0x79, 0x6e, 0x63, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x49, 0x64, 0x22, 0x97, 0x01, 0x0a, 0x0d, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x56, 0x61, 0x6c, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x61, 0x69, 0x6c, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x61, 0x69, 0x6c, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6d, 0x73, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x4d, 0x73, 0x67, 0x22, + 0x50, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x22, 0x20, 0x0a, 0x0c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x52, 0x65, + 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, + 0x69, 0x64, 0x73, 0x32, 0xb4, 0x0a, 0x0a, 0x07, 0x57, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x32, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, + 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x15, 0x2e, + 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, + 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x32, 0x0a, + 0x04, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x35, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x14, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x07, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x16, 0x2e, + 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x3b, 0x0a, 0x07, 0x55, 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x55, 0x72, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x08, + 0x55, 0x72, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, + 0x72, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, + 0x55, 0x72, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, + 0x2e, 0x55, 0x72, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x44, 0x0a, 0x0a, 0x55, 0x72, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x19, 0x2e, + 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x44, 0x65, + 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x08, 0x46, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x17, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, + 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, + 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x19, + 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x46, + 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x46, 0x6f, 0x72, 0x6d, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x44, + 0x0a, 0x0a, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x77, + 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x65, 0x73, 0x74, + 0x72, 0x6f, 0x79, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, + 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x1a, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, + 0x6d, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x35, 0x0a, + 0x05, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x12, 0x14, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x77, + 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x04, 0x55, 0x72, 0x6c, 0x73, 0x12, 0x13, 0x2e, 0x77, + 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, 0x72, 0x6c, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x55, + 0x72, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x77, 0x5f, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, + 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x19, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, + 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x73, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, + 0x2e, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, + 0x3b, 0x77, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_w_reward_proto_rawDescOnce sync.Once + file_w_reward_proto_rawDescData = file_w_reward_proto_rawDesc +) + +func file_w_reward_proto_rawDescGZIP() []byte { + file_w_reward_proto_rawDescOnce.Do(func() { + file_w_reward_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_reward_proto_rawDescData) + }) + return file_w_reward_proto_rawDescData +} + +var file_w_reward_proto_msgTypes = make([]protoimpl.MessageInfo, 71) +var file_w_reward_proto_goTypes = []interface{}{ + (*ListReq)(nil), // 0: w_rewardpb.ListReq + (*ListRes)(nil), // 1: w_rewardpb.ListRes + (*SelectReq)(nil), // 2: w_rewardpb.SelectReq + (*SelectRes)(nil), // 3: w_rewardpb.SelectRes + (*ShowReq)(nil), // 4: w_rewardpb.ShowReq + (*ShowRes)(nil), // 5: w_rewardpb.ShowRes + (*StoreReq)(nil), // 6: w_rewardpb.StoreReq + (*StoreRes)(nil), // 7: w_rewardpb.StoreRes + (*UpdateReq)(nil), // 8: w_rewardpb.UpdateReq + (*UpdateRes)(nil), // 9: w_rewardpb.UpdateRes + (*DestroyReq)(nil), // 10: w_rewardpb.DestroyReq + (*DestroyRes)(nil), // 11: w_rewardpb.DestroyRes + (*UrlListReq)(nil), // 12: w_rewardpb.UrlListReq + (*UrlListRes)(nil), // 13: w_rewardpb.UrlListRes + (*UrlStoreReq)(nil), // 14: w_rewardpb.UrlStoreReq + (*UrlStoreRes)(nil), // 15: w_rewardpb.UrlStoreRes + (*UrlUpdateReq)(nil), // 16: w_rewardpb.UrlUpdateReq + (*UrlUpdateRes)(nil), // 17: w_rewardpb.UrlUpdateRes + (*UrlDestroyReq)(nil), // 18: w_rewardpb.UrlDestroyReq + (*UrlDestroyRes)(nil), // 19: w_rewardpb.UrlDestroyRes + (*FormListReq)(nil), // 20: w_rewardpb.FormListReq + (*FormListRes)(nil), // 21: w_rewardpb.FormListRes + (*FormSelectReq)(nil), // 22: w_rewardpb.FormSelectReq + (*FormSelectRes)(nil), // 23: w_rewardpb.FormSelectRes + (*FormStoreReq)(nil), // 24: w_rewardpb.FormStoreReq + (*FormStoreRes)(nil), // 25: w_rewardpb.FormStoreRes + (*FormUpdateReq)(nil), // 26: w_rewardpb.FormUpdateReq + (*FormUpdateRes)(nil), // 27: w_rewardpb.FormUpdateRes + (*FormDestroyReq)(nil), // 28: w_rewardpb.FormDestroyReq + (*FormDestroyRes)(nil), // 29: w_rewardpb.FormDestroyRes + (*FormsReq)(nil), // 30: w_rewardpb.FormsReq + (*FormsRes)(nil), // 31: w_rewardpb.FormsRes + (*UrlsReq)(nil), // 32: w_rewardpb.UrlsReq + (*UrlsRes)(nil), // 33: w_rewardpb.UrlsRes + (*RewardsReq)(nil), // 34: w_rewardpb.RewardsReq + (*RewardsRes)(nil), // 35: w_rewardpb.RewardsRes + (*RelateRewardReq)(nil), // 36: w_rewardpb.RelateRewardReq + (*RelateRewardRes)(nil), // 37: w_rewardpb.RelateRewardRes + (*PushRewardReq)(nil), // 38: w_rewardpb.PushRewardReq + (*PushRewardRes)(nil), // 39: w_rewardpb.PushRewardRes + (*RewardIdsReq)(nil), // 40: w_rewardpb.RewardIdsReq + (*RewardIdsRes)(nil), // 41: w_rewardpb.RewardIdsRes + (*ListRes_One)(nil), // 42: w_rewardpb.ListRes.One + (*ListRes_KV)(nil), // 43: w_rewardpb.ListRes.KV + (*ListRes_Lang)(nil), // 44: w_rewardpb.ListRes.Lang + (*SelectRes_One)(nil), // 45: w_rewardpb.SelectRes.One + (*SelectRes_KV)(nil), // 46: w_rewardpb.SelectRes.KV + (*ShowRes_KV)(nil), // 47: w_rewardpb.ShowRes.KV + (*ShowRes_Lang)(nil), // 48: w_rewardpb.ShowRes.Lang + (*StoreReq_KV)(nil), // 49: w_rewardpb.StoreReq.KV + (*StoreReq_Lang)(nil), // 50: w_rewardpb.StoreReq.Lang + (*UpdateReq_KV)(nil), // 51: w_rewardpb.UpdateReq.KV + (*UpdateReq_Lang)(nil), // 52: w_rewardpb.UpdateReq.Lang + (*UrlListRes_One)(nil), // 53: w_rewardpb.UrlListRes.One + (*UrlListRes_Header)(nil), // 54: w_rewardpb.UrlListRes.Header + (*UrlStoreReq_Header)(nil), // 55: w_rewardpb.UrlStoreReq.Header + (*UrlUpdateReq_Header)(nil), // 56: w_rewardpb.UrlUpdateReq.Header + (*FormListRes_One)(nil), // 57: w_rewardpb.FormListRes.One + (*FormListRes_Item)(nil), // 58: w_rewardpb.FormListRes.Item + (*FormSelectRes_One)(nil), // 59: w_rewardpb.FormSelectRes.One + (*FormStoreReq_Item)(nil), // 60: w_rewardpb.FormStoreReq.Item + (*FormStoreReq_Tran)(nil), // 61: w_rewardpb.FormStoreReq.Tran + (*FormUpdateReq_Item)(nil), // 62: w_rewardpb.FormUpdateReq.Item + (*FormUpdateReq_Tran)(nil), // 63: w_rewardpb.FormUpdateReq.Tran + (*FormsRes_One)(nil), // 64: w_rewardpb.FormsRes.One + (*FormsRes_Item)(nil), // 65: w_rewardpb.FormsRes.Item + (*UrlsRes_One)(nil), // 66: w_rewardpb.UrlsRes.One + (*UrlsRes_Header)(nil), // 67: w_rewardpb.UrlsRes.Header + (*RewardsRes_One)(nil), // 68: w_rewardpb.RewardsRes.One + (*RewardsRes_KV)(nil), // 69: w_rewardpb.RewardsRes.KV + (*RewardsRes_Lang)(nil), // 70: w_rewardpb.RewardsRes.Lang +} +var file_w_reward_proto_depIdxs = []int32{ + 42, // 0: w_rewardpb.ListRes.list:type_name -> w_rewardpb.ListRes.One + 45, // 1: w_rewardpb.SelectRes.list:type_name -> w_rewardpb.SelectRes.One + 47, // 2: w_rewardpb.ShowRes.kv_data:type_name -> w_rewardpb.ShowRes.KV + 48, // 3: w_rewardpb.ShowRes.langs:type_name -> w_rewardpb.ShowRes.Lang + 49, // 4: w_rewardpb.StoreReq.kv_data:type_name -> w_rewardpb.StoreReq.KV + 50, // 5: w_rewardpb.StoreReq.langs:type_name -> w_rewardpb.StoreReq.Lang + 51, // 6: w_rewardpb.UpdateReq.kv_data:type_name -> w_rewardpb.UpdateReq.KV + 52, // 7: w_rewardpb.UpdateReq.langs:type_name -> w_rewardpb.UpdateReq.Lang + 53, // 8: w_rewardpb.UrlListRes.list:type_name -> w_rewardpb.UrlListRes.One + 55, // 9: w_rewardpb.UrlStoreReq.headers:type_name -> w_rewardpb.UrlStoreReq.Header + 56, // 10: w_rewardpb.UrlUpdateReq.headers:type_name -> w_rewardpb.UrlUpdateReq.Header + 57, // 11: w_rewardpb.FormListRes.list:type_name -> w_rewardpb.FormListRes.One + 59, // 12: w_rewardpb.FormSelectRes.list:type_name -> w_rewardpb.FormSelectRes.One + 60, // 13: w_rewardpb.FormStoreReq.items:type_name -> w_rewardpb.FormStoreReq.Item + 62, // 14: w_rewardpb.FormUpdateReq.items:type_name -> w_rewardpb.FormUpdateReq.Item + 64, // 15: w_rewardpb.FormsRes.list:type_name -> w_rewardpb.FormsRes.One + 66, // 16: w_rewardpb.UrlsRes.list:type_name -> w_rewardpb.UrlsRes.One + 68, // 17: w_rewardpb.RewardsRes.list:type_name -> w_rewardpb.RewardsRes.One + 43, // 18: w_rewardpb.ListRes.One.kv_data:type_name -> w_rewardpb.ListRes.KV + 44, // 19: w_rewardpb.ListRes.One.langs:type_name -> w_rewardpb.ListRes.Lang + 46, // 20: w_rewardpb.SelectRes.One.kv_data:type_name -> w_rewardpb.SelectRes.KV + 54, // 21: w_rewardpb.UrlListRes.One.headers:type_name -> w_rewardpb.UrlListRes.Header + 58, // 22: w_rewardpb.FormListRes.One.items:type_name -> w_rewardpb.FormListRes.Item + 61, // 23: w_rewardpb.FormStoreReq.Item.trans:type_name -> w_rewardpb.FormStoreReq.Tran + 63, // 24: w_rewardpb.FormUpdateReq.Item.trans:type_name -> w_rewardpb.FormUpdateReq.Tran + 65, // 25: w_rewardpb.FormsRes.One.items:type_name -> w_rewardpb.FormsRes.Item + 67, // 26: w_rewardpb.UrlsRes.One.headers:type_name -> w_rewardpb.UrlsRes.Header + 69, // 27: w_rewardpb.RewardsRes.One.kv_data:type_name -> w_rewardpb.RewardsRes.KV + 70, // 28: w_rewardpb.RewardsRes.One.lang:type_name -> w_rewardpb.RewardsRes.Lang + 0, // 29: w_rewardpb.WReward.List:input_type -> w_rewardpb.ListReq + 2, // 30: w_rewardpb.WReward.Select:input_type -> w_rewardpb.SelectReq + 4, // 31: w_rewardpb.WReward.Show:input_type -> w_rewardpb.ShowReq + 6, // 32: w_rewardpb.WReward.Store:input_type -> w_rewardpb.StoreReq + 8, // 33: w_rewardpb.WReward.Update:input_type -> w_rewardpb.UpdateReq + 10, // 34: w_rewardpb.WReward.Destroy:input_type -> w_rewardpb.DestroyReq + 12, // 35: w_rewardpb.WReward.UrlList:input_type -> w_rewardpb.UrlListReq + 14, // 36: w_rewardpb.WReward.UrlStore:input_type -> w_rewardpb.UrlStoreReq + 16, // 37: w_rewardpb.WReward.UrlUpdate:input_type -> w_rewardpb.UrlUpdateReq + 18, // 38: w_rewardpb.WReward.UrlDestroy:input_type -> w_rewardpb.UrlDestroyReq + 20, // 39: w_rewardpb.WReward.FormList:input_type -> w_rewardpb.FormListReq + 22, // 40: w_rewardpb.WReward.FormSelect:input_type -> w_rewardpb.FormSelectReq + 24, // 41: w_rewardpb.WReward.FormStore:input_type -> w_rewardpb.FormStoreReq + 26, // 42: w_rewardpb.WReward.FormUpdate:input_type -> w_rewardpb.FormUpdateReq + 28, // 43: w_rewardpb.WReward.FormDestroy:input_type -> w_rewardpb.FormDestroyReq + 30, // 44: w_rewardpb.WReward.Forms:input_type -> w_rewardpb.FormsReq + 32, // 45: w_rewardpb.WReward.Urls:input_type -> w_rewardpb.UrlsReq + 34, // 46: w_rewardpb.WReward.Rewards:input_type -> w_rewardpb.RewardsReq + 36, // 47: w_rewardpb.WReward.RelateReward:input_type -> w_rewardpb.RelateRewardReq + 38, // 48: w_rewardpb.WReward.PushReward:input_type -> w_rewardpb.PushRewardReq + 40, // 49: w_rewardpb.WReward.RewardIds:input_type -> w_rewardpb.RewardIdsReq + 1, // 50: w_rewardpb.WReward.List:output_type -> w_rewardpb.ListRes + 3, // 51: w_rewardpb.WReward.Select:output_type -> w_rewardpb.SelectRes + 5, // 52: w_rewardpb.WReward.Show:output_type -> w_rewardpb.ShowRes + 7, // 53: w_rewardpb.WReward.Store:output_type -> w_rewardpb.StoreRes + 9, // 54: w_rewardpb.WReward.Update:output_type -> w_rewardpb.UpdateRes + 11, // 55: w_rewardpb.WReward.Destroy:output_type -> w_rewardpb.DestroyRes + 13, // 56: w_rewardpb.WReward.UrlList:output_type -> w_rewardpb.UrlListRes + 15, // 57: w_rewardpb.WReward.UrlStore:output_type -> w_rewardpb.UrlStoreRes + 17, // 58: w_rewardpb.WReward.UrlUpdate:output_type -> w_rewardpb.UrlUpdateRes + 19, // 59: w_rewardpb.WReward.UrlDestroy:output_type -> w_rewardpb.UrlDestroyRes + 21, // 60: w_rewardpb.WReward.FormList:output_type -> w_rewardpb.FormListRes + 23, // 61: w_rewardpb.WReward.FormSelect:output_type -> w_rewardpb.FormSelectRes + 25, // 62: w_rewardpb.WReward.FormStore:output_type -> w_rewardpb.FormStoreRes + 27, // 63: w_rewardpb.WReward.FormUpdate:output_type -> w_rewardpb.FormUpdateRes + 29, // 64: w_rewardpb.WReward.FormDestroy:output_type -> w_rewardpb.FormDestroyRes + 31, // 65: w_rewardpb.WReward.Forms:output_type -> w_rewardpb.FormsRes + 33, // 66: w_rewardpb.WReward.Urls:output_type -> w_rewardpb.UrlsRes + 35, // 67: w_rewardpb.WReward.Rewards:output_type -> w_rewardpb.RewardsRes + 37, // 68: w_rewardpb.WReward.RelateReward:output_type -> w_rewardpb.RelateRewardRes + 39, // 69: w_rewardpb.WReward.PushReward:output_type -> w_rewardpb.PushRewardRes + 41, // 70: w_rewardpb.WReward.RewardIds:output_type -> w_rewardpb.RewardIdsRes + 50, // [50:71] is the sub-list for method output_type + 29, // [29:50] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name +} + +func init() { file_w_reward_proto_init() } +func file_w_reward_proto_init() { + if File_w_reward_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_reward_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlDestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlDestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormSelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormSelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormStoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormStoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormUpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormUpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormDestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormDestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelateRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelateRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushRewardRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardIdsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardIdsRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq_Lang); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlListRes_Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlStoreReq_Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlUpdateReq_Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormListRes_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormSelectRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormStoreReq_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormStoreReq_Tran); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormUpdateReq_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormUpdateReq_Tran); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormsRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FormsRes_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlsRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UrlsRes_Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardsRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardsRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_reward_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardsRes_Lang); 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_w_reward_proto_rawDesc, + NumEnums: 0, + NumMessages: 71, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_reward_proto_goTypes, + DependencyIndexes: file_w_reward_proto_depIdxs, + MessageInfos: file_w_reward_proto_msgTypes, + }.Build() + File_w_reward_proto = out.File + file_w_reward_proto_rawDesc = nil + file_w_reward_proto_goTypes = nil + file_w_reward_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_reward/w_reward.pb.micro.go b/proto/go_proto/w_reward/w_reward.pb.micro.go new file mode 100644 index 0000000..082365f --- /dev/null +++ b/proto/go_proto/w_reward/w_reward.pb.micro.go @@ -0,0 +1,469 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_reward.proto + +package w_rewardpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WReward service + +func NewWRewardEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WReward service + +type WRewardService interface { + // List 奖品列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // Select 奖品选择 + Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) + // Show 奖品详情 + Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) + // Store 创建奖品 + Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) + // Update 更新奖品 + Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) + // Destroy 删除奖品 + Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) + // UrlList 回调地址列表 + UrlList(ctx context.Context, in *UrlListReq, opts ...client.CallOption) (*UrlListRes, error) + // UrlStore 创建回调地址 + UrlStore(ctx context.Context, in *UrlStoreReq, opts ...client.CallOption) (*UrlStoreRes, error) + // UrlUpdate 更新回调地址 + UrlUpdate(ctx context.Context, in *UrlUpdateReq, opts ...client.CallOption) (*UrlUpdateRes, error) + // UrlDestroy 删除回调地址 + UrlDestroy(ctx context.Context, in *UrlDestroyReq, opts ...client.CallOption) (*UrlDestroyRes, error) + // FormList 表单列表 + FormList(ctx context.Context, in *FormListReq, opts ...client.CallOption) (*FormListRes, error) + // FormSelect 表单选择 + FormSelect(ctx context.Context, in *FormSelectReq, opts ...client.CallOption) (*FormSelectRes, error) + // FormStore 创建表单 + FormStore(ctx context.Context, in *FormStoreReq, opts ...client.CallOption) (*FormStoreRes, error) + // FormUpdate 更新表单 + FormUpdate(ctx context.Context, in *FormUpdateReq, opts ...client.CallOption) (*FormUpdateRes, error) + // FormDestroy 删除表单 + FormDestroy(ctx context.Context, in *FormDestroyReq, opts ...client.CallOption) (*FormDestroyRes, error) + // Forms 表单数据 + Forms(ctx context.Context, in *FormsReq, opts ...client.CallOption) (*FormsRes, error) + // Urls 回调地址数据 + Urls(ctx context.Context, in *UrlsReq, opts ...client.CallOption) (*UrlsRes, error) + // Rewards 奖品详情 + Rewards(ctx context.Context, in *RewardsReq, opts ...client.CallOption) (*RewardsRes, error) + // RelateReward 关联奖品 + RelateReward(ctx context.Context, in *RelateRewardReq, opts ...client.CallOption) (*RelateRewardRes, error) + // PushReward 奖品推送 + PushReward(ctx context.Context, in *PushRewardReq, opts ...client.CallOption) (*PushRewardRes, error) + // RewardIds 查询奖品id + RewardIds(ctx context.Context, in *RewardIdsReq, opts ...client.CallOption) (*RewardIdsRes, error) +} + +type wRewardService struct { + c client.Client + name string +} + +func NewWRewardService(name string, c client.Client) WRewardService { + return &wRewardService{ + c: c, + name: name, + } +} + +func (c *wRewardService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WReward.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) { + req := c.c.NewRequest(c.name, "WReward.Select", in) + out := new(SelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) { + req := c.c.NewRequest(c.name, "WReward.Show", in) + out := new(ShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) { + req := c.c.NewRequest(c.name, "WReward.Store", in) + out := new(StoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) { + req := c.c.NewRequest(c.name, "WReward.Update", in) + out := new(UpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) { + req := c.c.NewRequest(c.name, "WReward.Destroy", in) + out := new(DestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) UrlList(ctx context.Context, in *UrlListReq, opts ...client.CallOption) (*UrlListRes, error) { + req := c.c.NewRequest(c.name, "WReward.UrlList", in) + out := new(UrlListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) UrlStore(ctx context.Context, in *UrlStoreReq, opts ...client.CallOption) (*UrlStoreRes, error) { + req := c.c.NewRequest(c.name, "WReward.UrlStore", in) + out := new(UrlStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) UrlUpdate(ctx context.Context, in *UrlUpdateReq, opts ...client.CallOption) (*UrlUpdateRes, error) { + req := c.c.NewRequest(c.name, "WReward.UrlUpdate", in) + out := new(UrlUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) UrlDestroy(ctx context.Context, in *UrlDestroyReq, opts ...client.CallOption) (*UrlDestroyRes, error) { + req := c.c.NewRequest(c.name, "WReward.UrlDestroy", in) + out := new(UrlDestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) FormList(ctx context.Context, in *FormListReq, opts ...client.CallOption) (*FormListRes, error) { + req := c.c.NewRequest(c.name, "WReward.FormList", in) + out := new(FormListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) FormSelect(ctx context.Context, in *FormSelectReq, opts ...client.CallOption) (*FormSelectRes, error) { + req := c.c.NewRequest(c.name, "WReward.FormSelect", in) + out := new(FormSelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) FormStore(ctx context.Context, in *FormStoreReq, opts ...client.CallOption) (*FormStoreRes, error) { + req := c.c.NewRequest(c.name, "WReward.FormStore", in) + out := new(FormStoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) FormUpdate(ctx context.Context, in *FormUpdateReq, opts ...client.CallOption) (*FormUpdateRes, error) { + req := c.c.NewRequest(c.name, "WReward.FormUpdate", in) + out := new(FormUpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) FormDestroy(ctx context.Context, in *FormDestroyReq, opts ...client.CallOption) (*FormDestroyRes, error) { + req := c.c.NewRequest(c.name, "WReward.FormDestroy", in) + out := new(FormDestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Forms(ctx context.Context, in *FormsReq, opts ...client.CallOption) (*FormsRes, error) { + req := c.c.NewRequest(c.name, "WReward.Forms", in) + out := new(FormsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Urls(ctx context.Context, in *UrlsReq, opts ...client.CallOption) (*UrlsRes, error) { + req := c.c.NewRequest(c.name, "WReward.Urls", in) + out := new(UrlsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) Rewards(ctx context.Context, in *RewardsReq, opts ...client.CallOption) (*RewardsRes, error) { + req := c.c.NewRequest(c.name, "WReward.Rewards", in) + out := new(RewardsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) RelateReward(ctx context.Context, in *RelateRewardReq, opts ...client.CallOption) (*RelateRewardRes, error) { + req := c.c.NewRequest(c.name, "WReward.RelateReward", in) + out := new(RelateRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) PushReward(ctx context.Context, in *PushRewardReq, opts ...client.CallOption) (*PushRewardRes, error) { + req := c.c.NewRequest(c.name, "WReward.PushReward", in) + out := new(PushRewardRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wRewardService) RewardIds(ctx context.Context, in *RewardIdsReq, opts ...client.CallOption) (*RewardIdsRes, error) { + req := c.c.NewRequest(c.name, "WReward.RewardIds", in) + out := new(RewardIdsRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WReward service + +type WRewardHandler interface { + // List 奖品列表 + List(context.Context, *ListReq, *ListRes) error + // Select 奖品选择 + Select(context.Context, *SelectReq, *SelectRes) error + // Show 奖品详情 + Show(context.Context, *ShowReq, *ShowRes) error + // Store 创建奖品 + Store(context.Context, *StoreReq, *StoreRes) error + // Update 更新奖品 + Update(context.Context, *UpdateReq, *UpdateRes) error + // Destroy 删除奖品 + Destroy(context.Context, *DestroyReq, *DestroyRes) error + // UrlList 回调地址列表 + UrlList(context.Context, *UrlListReq, *UrlListRes) error + // UrlStore 创建回调地址 + UrlStore(context.Context, *UrlStoreReq, *UrlStoreRes) error + // UrlUpdate 更新回调地址 + UrlUpdate(context.Context, *UrlUpdateReq, *UrlUpdateRes) error + // UrlDestroy 删除回调地址 + UrlDestroy(context.Context, *UrlDestroyReq, *UrlDestroyRes) error + // FormList 表单列表 + FormList(context.Context, *FormListReq, *FormListRes) error + // FormSelect 表单选择 + FormSelect(context.Context, *FormSelectReq, *FormSelectRes) error + // FormStore 创建表单 + FormStore(context.Context, *FormStoreReq, *FormStoreRes) error + // FormUpdate 更新表单 + FormUpdate(context.Context, *FormUpdateReq, *FormUpdateRes) error + // FormDestroy 删除表单 + FormDestroy(context.Context, *FormDestroyReq, *FormDestroyRes) error + // Forms 表单数据 + Forms(context.Context, *FormsReq, *FormsRes) error + // Urls 回调地址数据 + Urls(context.Context, *UrlsReq, *UrlsRes) error + // Rewards 奖品详情 + Rewards(context.Context, *RewardsReq, *RewardsRes) error + // RelateReward 关联奖品 + RelateReward(context.Context, *RelateRewardReq, *RelateRewardRes) error + // PushReward 奖品推送 + PushReward(context.Context, *PushRewardReq, *PushRewardRes) error + // RewardIds 查询奖品id + RewardIds(context.Context, *RewardIdsReq, *RewardIdsRes) error +} + +func RegisterWRewardHandler(s server.Server, hdlr WRewardHandler, opts ...server.HandlerOption) error { + type wReward interface { + List(ctx context.Context, in *ListReq, out *ListRes) error + Select(ctx context.Context, in *SelectReq, out *SelectRes) error + Show(ctx context.Context, in *ShowReq, out *ShowRes) error + Store(ctx context.Context, in *StoreReq, out *StoreRes) error + Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error + Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error + UrlList(ctx context.Context, in *UrlListReq, out *UrlListRes) error + UrlStore(ctx context.Context, in *UrlStoreReq, out *UrlStoreRes) error + UrlUpdate(ctx context.Context, in *UrlUpdateReq, out *UrlUpdateRes) error + UrlDestroy(ctx context.Context, in *UrlDestroyReq, out *UrlDestroyRes) error + FormList(ctx context.Context, in *FormListReq, out *FormListRes) error + FormSelect(ctx context.Context, in *FormSelectReq, out *FormSelectRes) error + FormStore(ctx context.Context, in *FormStoreReq, out *FormStoreRes) error + FormUpdate(ctx context.Context, in *FormUpdateReq, out *FormUpdateRes) error + FormDestroy(ctx context.Context, in *FormDestroyReq, out *FormDestroyRes) error + Forms(ctx context.Context, in *FormsReq, out *FormsRes) error + Urls(ctx context.Context, in *UrlsReq, out *UrlsRes) error + Rewards(ctx context.Context, in *RewardsReq, out *RewardsRes) error + RelateReward(ctx context.Context, in *RelateRewardReq, out *RelateRewardRes) error + PushReward(ctx context.Context, in *PushRewardReq, out *PushRewardRes) error + RewardIds(ctx context.Context, in *RewardIdsReq, out *RewardIdsRes) error + } + type WReward struct { + wReward + } + h := &wRewardHandler{hdlr} + return s.Handle(s.NewHandler(&WReward{h}, opts...)) +} + +type wRewardHandler struct { + WRewardHandler +} + +func (h *wRewardHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WRewardHandler.List(ctx, in, out) +} + +func (h *wRewardHandler) Select(ctx context.Context, in *SelectReq, out *SelectRes) error { + return h.WRewardHandler.Select(ctx, in, out) +} + +func (h *wRewardHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error { + return h.WRewardHandler.Show(ctx, in, out) +} + +func (h *wRewardHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error { + return h.WRewardHandler.Store(ctx, in, out) +} + +func (h *wRewardHandler) Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error { + return h.WRewardHandler.Update(ctx, in, out) +} + +func (h *wRewardHandler) Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error { + return h.WRewardHandler.Destroy(ctx, in, out) +} + +func (h *wRewardHandler) UrlList(ctx context.Context, in *UrlListReq, out *UrlListRes) error { + return h.WRewardHandler.UrlList(ctx, in, out) +} + +func (h *wRewardHandler) UrlStore(ctx context.Context, in *UrlStoreReq, out *UrlStoreRes) error { + return h.WRewardHandler.UrlStore(ctx, in, out) +} + +func (h *wRewardHandler) UrlUpdate(ctx context.Context, in *UrlUpdateReq, out *UrlUpdateRes) error { + return h.WRewardHandler.UrlUpdate(ctx, in, out) +} + +func (h *wRewardHandler) UrlDestroy(ctx context.Context, in *UrlDestroyReq, out *UrlDestroyRes) error { + return h.WRewardHandler.UrlDestroy(ctx, in, out) +} + +func (h *wRewardHandler) FormList(ctx context.Context, in *FormListReq, out *FormListRes) error { + return h.WRewardHandler.FormList(ctx, in, out) +} + +func (h *wRewardHandler) FormSelect(ctx context.Context, in *FormSelectReq, out *FormSelectRes) error { + return h.WRewardHandler.FormSelect(ctx, in, out) +} + +func (h *wRewardHandler) FormStore(ctx context.Context, in *FormStoreReq, out *FormStoreRes) error { + return h.WRewardHandler.FormStore(ctx, in, out) +} + +func (h *wRewardHandler) FormUpdate(ctx context.Context, in *FormUpdateReq, out *FormUpdateRes) error { + return h.WRewardHandler.FormUpdate(ctx, in, out) +} + +func (h *wRewardHandler) FormDestroy(ctx context.Context, in *FormDestroyReq, out *FormDestroyRes) error { + return h.WRewardHandler.FormDestroy(ctx, in, out) +} + +func (h *wRewardHandler) Forms(ctx context.Context, in *FormsReq, out *FormsRes) error { + return h.WRewardHandler.Forms(ctx, in, out) +} + +func (h *wRewardHandler) Urls(ctx context.Context, in *UrlsReq, out *UrlsRes) error { + return h.WRewardHandler.Urls(ctx, in, out) +} + +func (h *wRewardHandler) Rewards(ctx context.Context, in *RewardsReq, out *RewardsRes) error { + return h.WRewardHandler.Rewards(ctx, in, out) +} + +func (h *wRewardHandler) RelateReward(ctx context.Context, in *RelateRewardReq, out *RelateRewardRes) error { + return h.WRewardHandler.RelateReward(ctx, in, out) +} + +func (h *wRewardHandler) PushReward(ctx context.Context, in *PushRewardReq, out *PushRewardRes) error { + return h.WRewardHandler.PushReward(ctx, in, out) +} + +func (h *wRewardHandler) RewardIds(ctx context.Context, in *RewardIdsReq, out *RewardIdsRes) error { + return h.WRewardHandler.RewardIds(ctx, in, out) +} diff --git a/proto/go_proto/w_script/w_script.pb.go b/proto/go_proto/w_script/w_script.pb.go new file mode 100644 index 0000000..e964999 --- /dev/null +++ b/proto/go_proto/w_script/w_script.pb.go @@ -0,0 +1,2380 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_script.proto + +package w_scriptpb + +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 BootReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scene string `protobuf:"bytes,1,opt,name=scene,proto3" json:"scene,omitempty"` //处理场景 + JsonData string `protobuf:"bytes,2,opt,name=json_data,json=jsonData,proto3" json:"json_data,omitempty"` //文件后缀 +} + +func (x *BootReq) Reset() { + *x = BootReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BootReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootReq) ProtoMessage() {} + +func (x *BootReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 BootReq.ProtoReflect.Descriptor instead. +func (*BootReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{0} +} + +func (x *BootReq) GetScene() string { + if x != nil { + return x.Scene + } + return "" +} + +func (x *BootReq) GetJsonData() string { + if x != nil { + return x.JsonData + } + return "" +} + +type BootRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` //任务id +} + +func (x *BootRes) Reset() { + *x = BootRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BootRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootRes) ProtoMessage() {} + +func (x *BootRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 BootRes.ProtoReflect.Descriptor instead. +func (*BootRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{1} +} + +func (x *BootRes) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +type RefreshDayLimitReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户hash_id + CampaignHashId string `protobuf:"bytes,2,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *RefreshDayLimitReq) Reset() { + *x = RefreshDayLimitReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshDayLimitReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshDayLimitReq) ProtoMessage() {} + +func (x *RefreshDayLimitReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 RefreshDayLimitReq.ProtoReflect.Descriptor instead. +func (*RefreshDayLimitReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{2} +} + +func (x *RefreshDayLimitReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *RefreshDayLimitReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type RefreshDayLimitRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RefreshDayLimitRes) Reset() { + *x = RefreshDayLimitRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshDayLimitRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshDayLimitRes) ProtoMessage() {} + +func (x *RefreshDayLimitRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 RefreshDayLimitRes.ProtoReflect.Descriptor instead. +func (*RefreshDayLimitRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{3} +} + +type NotifyListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignHashId string `protobuf:"bytes,3,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //项目hash_id + RewardHashId string `protobuf:"bytes,4,opt,name=reward_hash_id,json=rewardHashId,proto3" json:"reward_hash_id,omitempty"` //奖品记录hash_id +} + +func (x *NotifyListReq) Reset() { + *x = NotifyListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyListReq) ProtoMessage() {} + +func (x *NotifyListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 NotifyListReq.ProtoReflect.Descriptor instead. +func (*NotifyListReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{4} +} + +func (x *NotifyListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *NotifyListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *NotifyListReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +func (x *NotifyListReq) GetRewardHashId() string { + if x != nil { + return x.RewardHashId + } + return "" +} + +type NotifyListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*NotifyListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *NotifyListRes) Reset() { + *x = NotifyListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyListRes) ProtoMessage() {} + +func (x *NotifyListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 NotifyListRes.ProtoReflect.Descriptor instead. +func (*NotifyListRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{5} +} + +func (x *NotifyListRes) GetList() []*NotifyListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *NotifyListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type EtcdKeyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` //前缀 +} + +func (x *EtcdKeyReq) Reset() { + *x = EtcdKeyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EtcdKeyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EtcdKeyReq) ProtoMessage() {} + +func (x *EtcdKeyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 EtcdKeyReq.ProtoReflect.Descriptor instead. +func (*EtcdKeyReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{6} +} + +func (x *EtcdKeyReq) GetPrefix() string { + if x != nil { + return x.Prefix + } + return "" +} + +type EtcdKeyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kvs []*EtcdKeyRes_KV `protobuf:"bytes,1,rep,name=kvs,proto3" json:"kvs,omitempty"` //数据 +} + +func (x *EtcdKeyRes) Reset() { + *x = EtcdKeyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EtcdKeyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EtcdKeyRes) ProtoMessage() {} + +func (x *EtcdKeyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 EtcdKeyRes.ProtoReflect.Descriptor instead. +func (*EtcdKeyRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{7} +} + +func (x *EtcdKeyRes) GetKvs() []*EtcdKeyRes_KV { + if x != nil { + return x.Kvs + } + return nil +} + +type EventFlowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectHashId string `protobuf:"bytes,1,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id +} + +func (x *EventFlowReq) Reset() { + *x = EventFlowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFlowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFlowReq) ProtoMessage() {} + +func (x *EventFlowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 EventFlowReq.ProtoReflect.Descriptor instead. +func (*EventFlowReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{8} +} + +func (x *EventFlowReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +type EventFlowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*EventFlowRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //数据 +} + +func (x *EventFlowRes) Reset() { + *x = EventFlowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFlowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFlowRes) ProtoMessage() {} + +func (x *EventFlowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 EventFlowRes.ProtoReflect.Descriptor instead. +func (*EventFlowRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{9} +} + +func (x *EventFlowRes) GetList() []*EventFlowRes_One { + if x != nil { + return x.List + } + return nil +} + +type ClearDeviceReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户hash_id + ProjectHashId string `protobuf:"bytes,2,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + CampaignHashId string `protobuf:"bytes,3,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *ClearDeviceReq) Reset() { + *x = ClearDeviceReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearDeviceReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearDeviceReq) ProtoMessage() {} + +func (x *ClearDeviceReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 ClearDeviceReq.ProtoReflect.Descriptor instead. +func (*ClearDeviceReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{10} +} + +func (x *ClearDeviceReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ClearDeviceReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *ClearDeviceReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type ClearDeviceRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClearDeviceRes) Reset() { + *x = ClearDeviceRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClearDeviceRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearDeviceRes) ProtoMessage() {} + +func (x *ClearDeviceRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 ClearDeviceRes.ProtoReflect.Descriptor instead. +func (*ClearDeviceRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{11} +} + +type RefreshViewReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CampaignHashId string `protobuf:"bytes,1,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *RefreshViewReq) Reset() { + *x = RefreshViewReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshViewReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshViewReq) ProtoMessage() {} + +func (x *RefreshViewReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 RefreshViewReq.ProtoReflect.Descriptor instead. +func (*RefreshViewReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{12} +} + +func (x *RefreshViewReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type RefreshViewRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RefreshViewRes) Reset() { + *x = RefreshViewRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshViewRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshViewRes) ProtoMessage() {} + +func (x *RefreshViewRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 RefreshViewRes.ProtoReflect.Descriptor instead. +func (*RefreshViewRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{13} +} + +type ErrLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiUrl string `protobuf:"bytes,1,opt,name=api_url,json=apiUrl,proto3" json:"api_url,omitempty"` //请求的接口 + Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` //请求数据 + LinkUrl string `protobuf:"bytes,3,opt,name=link_url,json=linkUrl,proto3" json:"link_url,omitempty"` //当前页面地址 + Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` //返回数据 +} + +func (x *ErrLogReq) Reset() { + *x = ErrLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ErrLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ErrLogReq) ProtoMessage() {} + +func (x *ErrLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 ErrLogReq.ProtoReflect.Descriptor instead. +func (*ErrLogReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{14} +} + +func (x *ErrLogReq) GetApiUrl() string { + if x != nil { + return x.ApiUrl + } + return "" +} + +func (x *ErrLogReq) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +func (x *ErrLogReq) GetLinkUrl() string { + if x != nil { + return x.LinkUrl + } + return "" +} + +func (x *ErrLogReq) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type ErrLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ErrLogRes) Reset() { + *x = ErrLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ErrLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ErrLogRes) ProtoMessage() {} + +func (x *ErrLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 ErrLogRes.ProtoReflect.Descriptor instead. +func (*ErrLogRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{15} +} + +type PointsLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + CampaignHashId string `protobuf:"bytes,3,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //项目hash_id +} + +func (x *PointsLogReq) Reset() { + *x = PointsLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointsLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointsLogReq) ProtoMessage() {} + +func (x *PointsLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 PointsLogReq.ProtoReflect.Descriptor instead. +func (*PointsLogReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{16} +} + +func (x *PointsLogReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *PointsLogReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *PointsLogReq) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type PointsLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*PointsLogRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *PointsLogRes) Reset() { + *x = PointsLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointsLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointsLogRes) ProtoMessage() {} + +func (x *PointsLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 PointsLogRes.ProtoReflect.Descriptor instead. +func (*PointsLogRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{17} +} + +func (x *PointsLogRes) GetList() []*PointsLogRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *PointsLogRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type UserBehaviorReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiUrl string `protobuf:"bytes,1,opt,name=api_url,json=apiUrl,proto3" json:"api_url,omitempty"` //请求的接口 + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` //接口描述 + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //登陆用户id + CompanyId int64 `protobuf:"varint,4,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //登陆用户id + ProjectHashId string `protobuf:"bytes,5,opt,name=project_hash_id,json=projectHashId,proto3" json:"project_hash_id,omitempty"` //项目hash_id + Ip string `protobuf:"bytes,6,opt,name=ip,proto3" json:"ip,omitempty"` //操作ip + UaData string `protobuf:"bytes,7,opt,name=ua_data,json=uaData,proto3" json:"ua_data,omitempty"` //部分ua头数据 + Req string `protobuf:"bytes,8,opt,name=req,proto3" json:"req,omitempty"` //请求数据 + Res string `protobuf:"bytes,9,opt,name=res,proto3" json:"res,omitempty"` //操作结果 +} + +func (x *UserBehaviorReq) Reset() { + *x = UserBehaviorReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserBehaviorReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBehaviorReq) ProtoMessage() {} + +func (x *UserBehaviorReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 UserBehaviorReq.ProtoReflect.Descriptor instead. +func (*UserBehaviorReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{18} +} + +func (x *UserBehaviorReq) GetApiUrl() string { + if x != nil { + return x.ApiUrl + } + return "" +} + +func (x *UserBehaviorReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *UserBehaviorReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UserBehaviorReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *UserBehaviorReq) GetProjectHashId() string { + if x != nil { + return x.ProjectHashId + } + return "" +} + +func (x *UserBehaviorReq) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *UserBehaviorReq) GetUaData() string { + if x != nil { + return x.UaData + } + return "" +} + +func (x *UserBehaviorReq) GetReq() string { + if x != nil { + return x.Req + } + return "" +} + +func (x *UserBehaviorReq) GetRes() string { + if x != nil { + return x.Res + } + return "" +} + +type UserBehaviorRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UserBehaviorRes) Reset() { + *x = UserBehaviorRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserBehaviorRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBehaviorRes) ProtoMessage() {} + +func (x *UserBehaviorRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 UserBehaviorRes.ProtoReflect.Descriptor instead. +func (*UserBehaviorRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{19} +} + +type RewardPushLogReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,2,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` //来源 + FirstId int64 `protobuf:"varint,4,opt,name=first_id,json=firstId,proto3" json:"first_id,omitempty"` //来源一级id + SecondId int64 `protobuf:"varint,5,opt,name=second_id,json=secondId,proto3" json:"second_id,omitempty"` //来源二级id + RelateId int64 `protobuf:"varint,6,opt,name=relate_id,json=relateId,proto3" json:"relate_id,omitempty"` //关联记录id +} + +func (x *RewardPushLogReq) Reset() { + *x = RewardPushLogReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardPushLogReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardPushLogReq) ProtoMessage() {} + +func (x *RewardPushLogReq) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 RewardPushLogReq.ProtoReflect.Descriptor instead. +func (*RewardPushLogReq) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{20} +} + +func (x *RewardPushLogReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *RewardPushLogReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +func (x *RewardPushLogReq) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *RewardPushLogReq) GetFirstId() int64 { + if x != nil { + return x.FirstId + } + return 0 +} + +func (x *RewardPushLogReq) GetSecondId() int64 { + if x != nil { + return x.SecondId + } + return 0 +} + +func (x *RewardPushLogReq) GetRelateId() int64 { + if x != nil { + return x.RelateId + } + return 0 +} + +type RewardPushLogRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*RewardPushLogRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *RewardPushLogRes) Reset() { + *x = RewardPushLogRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardPushLogRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardPushLogRes) ProtoMessage() {} + +func (x *RewardPushLogRes) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 RewardPushLogRes.ProtoReflect.Descriptor instead. +func (*RewardPushLogRes) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{21} +} + +func (x *RewardPushLogRes) GetList() []*RewardPushLogRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *RewardPushLogRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type NotifyListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashId string `protobuf:"bytes,1,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //任务ID + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + LastPush int64 `protobuf:"varint,3,opt,name=last_push,json=lastPush,proto3" json:"last_push,omitempty"` //最后推送时间 + Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` //请求数据 + NotifyUrl string `protobuf:"bytes,5,opt,name=notify_url,json=notifyUrl,proto3" json:"notify_url,omitempty"` //请求地址 + Resp []string `protobuf:"bytes,6,rep,name=resp,proto3" json:"resp,omitempty"` //请求结果 +} + +func (x *NotifyListRes_One) Reset() { + *x = NotifyListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyListRes_One) ProtoMessage() {} + +func (x *NotifyListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 NotifyListRes_One.ProtoReflect.Descriptor instead. +func (*NotifyListRes_One) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *NotifyListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *NotifyListRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *NotifyListRes_One) GetLastPush() int64 { + if x != nil { + return x.LastPush + } + return 0 +} + +func (x *NotifyListRes_One) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *NotifyListRes_One) GetNotifyUrl() string { + if x != nil { + return x.NotifyUrl + } + return "" +} + +func (x *NotifyListRes_One) GetResp() []string { + if x != nil { + return x.Resp + } + return nil +} + +type EtcdKeyRes_KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` //键 + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` //值 +} + +func (x *EtcdKeyRes_KV) Reset() { + *x = EtcdKeyRes_KV{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EtcdKeyRes_KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EtcdKeyRes_KV) ProtoMessage() {} + +func (x *EtcdKeyRes_KV) ProtoReflect() protoreflect.Message { + mi := &file_w_script_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 EtcdKeyRes_KV.ProtoReflect.Descriptor instead. +func (*EtcdKeyRes_KV) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *EtcdKeyRes_KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EtcdKeyRes_KV) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type EventFlowRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LinkHashId string `protobuf:"bytes,1,opt,name=link_hash_id,json=linkHashId,proto3" json:"link_hash_id,omitempty"` //深度链接hash_id + DeviceId string `protobuf:"bytes,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` //设备id + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` //用户ID + EventTitle string `protobuf:"bytes,4,opt,name=event_title,json=eventTitle,proto3" json:"event_title,omitempty"` //事件名称 + IpAddress string `protobuf:"bytes,5,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` //ip + Os string `protobuf:"bytes,6,opt,name=os,proto3" json:"os,omitempty"` //os + OsVersion string `protobuf:"bytes,7,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` //os_version + DeviceModel string `protobuf:"bytes,8,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"` //device_model + EventData string `protobuf:"bytes,9,opt,name=event_data,json=eventData,proto3" json:"event_data,omitempty"` //event_data + CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Source int32 `protobuf:"varint,11,opt,name=source,proto3" json:"source,omitempty"` //来源(1-自然流量,2-深度链接,3-活动) + CampaignHashId string `protobuf:"bytes,12,opt,name=campaign_hash_id,json=campaignHashId,proto3" json:"campaign_hash_id,omitempty"` //活动hash_id +} + +func (x *EventFlowRes_One) Reset() { + *x = EventFlowRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventFlowRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventFlowRes_One) ProtoMessage() {} + +func (x *EventFlowRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_script_proto_msgTypes[24] + 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 EventFlowRes_One.ProtoReflect.Descriptor instead. +func (*EventFlowRes_One) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *EventFlowRes_One) GetLinkHashId() string { + if x != nil { + return x.LinkHashId + } + return "" +} + +func (x *EventFlowRes_One) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *EventFlowRes_One) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *EventFlowRes_One) GetEventTitle() string { + if x != nil { + return x.EventTitle + } + return "" +} + +func (x *EventFlowRes_One) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +func (x *EventFlowRes_One) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *EventFlowRes_One) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *EventFlowRes_One) GetDeviceModel() string { + if x != nil { + return x.DeviceModel + } + return "" +} + +func (x *EventFlowRes_One) GetEventData() string { + if x != nil { + return x.EventData + } + return "" +} + +func (x *EventFlowRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *EventFlowRes_One) GetSource() int32 { + if x != nil { + return x.Source + } + return 0 +} + +func (x *EventFlowRes_One) GetCampaignHashId() string { + if x != nil { + return x.CampaignHashId + } + return "" +} + +type PointsLogRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //请求id + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Req string `protobuf:"bytes,3,opt,name=req,proto3" json:"req,omitempty"` //请求数据 + ReqUrl string `protobuf:"bytes,4,opt,name=req_url,json=reqUrl,proto3" json:"req_url,omitempty"` //请求地址 + Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` //请求token + ReqHeader string `protobuf:"bytes,6,opt,name=req_header,json=reqHeader,proto3" json:"req_header,omitempty"` //请求头 + Resp string `protobuf:"bytes,7,opt,name=resp,proto3" json:"resp,omitempty"` //返回数据 + ErrMsg string `protobuf:"bytes,8,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"` //错误信息 +} + +func (x *PointsLogRes_One) Reset() { + *x = PointsLogRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PointsLogRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PointsLogRes_One) ProtoMessage() {} + +func (x *PointsLogRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_script_proto_msgTypes[25] + 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 PointsLogRes_One.ProtoReflect.Descriptor instead. +func (*PointsLogRes_One) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{17, 0} +} + +func (x *PointsLogRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PointsLogRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *PointsLogRes_One) GetReq() string { + if x != nil { + return x.Req + } + return "" +} + +func (x *PointsLogRes_One) GetReqUrl() string { + if x != nil { + return x.ReqUrl + } + return "" +} + +func (x *PointsLogRes_One) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *PointsLogRes_One) GetReqHeader() string { + if x != nil { + return x.ReqHeader + } + return "" +} + +func (x *PointsLogRes_One) GetResp() string { + if x != nil { + return x.Resp + } + return "" +} + +func (x *PointsLogRes_One) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +type RewardPushLogRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //请求id + CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` //创建时间 + Req string `protobuf:"bytes,3,opt,name=req,proto3" json:"req,omitempty"` //请求数据 + ReqUrl string `protobuf:"bytes,4,opt,name=req_url,json=reqUrl,proto3" json:"req_url,omitempty"` //请求地址 + Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` //请求token + ReqHeader string `protobuf:"bytes,6,opt,name=req_header,json=reqHeader,proto3" json:"req_header,omitempty"` //请求头 + Resp string `protobuf:"bytes,7,opt,name=resp,proto3" json:"resp,omitempty"` //返回数据 + ErrMsg string `protobuf:"bytes,8,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"` //错误信息 + ReqTime int64 `protobuf:"varint,9,opt,name=req_time,json=reqTime,proto3" json:"req_time,omitempty"` //请求时长(单位:ms) +} + +func (x *RewardPushLogRes_One) Reset() { + *x = RewardPushLogRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_script_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardPushLogRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardPushLogRes_One) ProtoMessage() {} + +func (x *RewardPushLogRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_script_proto_msgTypes[26] + 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 RewardPushLogRes_One.ProtoReflect.Descriptor instead. +func (*RewardPushLogRes_One) Descriptor() ([]byte, []int) { + return file_w_script_proto_rawDescGZIP(), []int{21, 0} +} + +func (x *RewardPushLogRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RewardPushLogRes_One) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *RewardPushLogRes_One) GetReq() string { + if x != nil { + return x.Req + } + return "" +} + +func (x *RewardPushLogRes_One) GetReqUrl() string { + if x != nil { + return x.ReqUrl + } + return "" +} + +func (x *RewardPushLogRes_One) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *RewardPushLogRes_One) GetReqHeader() string { + if x != nil { + return x.ReqHeader + } + return "" +} + +func (x *RewardPushLogRes_One) GetResp() string { + if x != nil { + return x.Resp + } + return "" +} + +func (x *RewardPushLogRes_One) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *RewardPushLogRes_One) GetReqTime() int64 { + if x != nil { + return x.ReqTime + } + return 0 +} + +var File_w_script_proto protoreflect.FileDescriptor + +var file_w_script_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0a, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x22, 0x3c, 0x0a, 0x07, + 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x22, 0x0a, 0x07, 0x42, 0x6f, + 0x6f, 0x74, 0x52, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x57, + 0x0a, 0x12, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x44, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, + 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, + 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x52, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x44, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x22, 0x8e, 0x01, + 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x28, + 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, + 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0xfc, + 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x12, 0x31, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xa1, 0x01, 0x0a, 0x03, 0x4f, 0x6e, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, + 0x73, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 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, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x73, + 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x72, 0x65, 0x73, 0x70, 0x22, 0x24, 0x0a, + 0x0a, 0x45, 0x74, 0x63, 0x64, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x22, 0x67, 0x0a, 0x0a, 0x45, 0x74, 0x63, 0x64, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x6b, 0x76, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x74, 0x63, 0x64, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x2e, 0x4b, 0x56, 0x52, 0x03, 0x6b, 0x76, 0x73, 0x1a, 0x2c, + 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x0c, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0f, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x22, 0xb2, 0x03, 0x0a, 0x0c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x6c, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, + 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0xef, 0x02, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, + 0x20, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x70, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x70, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, + 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x7b, 0x0a, 0x0e, 0x43, 0x6c, 0x65, + 0x61, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x68, + 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, + 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x22, 0x3a, 0x0a, 0x0e, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, + 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x56, + 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x22, 0x65, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, + 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x0b, 0x0a, + 0x09, 0x45, 0x72, 0x72, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x0c, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x63, 0x61, 0x6d, + 0x70, 0x61, 0x69, 0x67, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x61, 0x6d, 0x70, 0x61, 0x69, 0x67, 0x6e, 0x48, 0x61, 0x73, + 0x68, 0x49, 0x64, 0x22, 0x9a, 0x02, 0x0a, 0x0c, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, + 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xc1, 0x01, 0x0a, + 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x71, 0x55, 0x72, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x72, 0x65, 0x73, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, + 0x73, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, + 0x22, 0xeb, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, + 0x63, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x49, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x70, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, + 0x71, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, + 0x72, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x73, 0x22, 0x11, + 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x65, + 0x73, 0x22, 0xae, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x75, 0x73, 0x68, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, + 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, + 0x72, 0x50, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x66, 0x69, 0x72, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x22, 0xbd, 0x02, 0x0a, 0x10, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x75, 0x73, + 0x68, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x75, 0x73, 0x68, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x1a, 0xdc, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, + 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, + 0x72, 0x65, 0x71, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, + 0x65, 0x71, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x71, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, + 0x73, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x65, 0x73, 0x70, 0x12, 0x17, + 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, 0x71, 0x54, 0x69, + 0x6d, 0x65, 0x32, 0x82, 0x06, 0x0a, 0x07, 0x57, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x32, + 0x0a, 0x04, 0x42, 0x6f, 0x6f, 0x74, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x53, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x44, 0x61, 0x79, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x44, 0x61, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x44, 0x61, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x19, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x19, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3b, 0x0a, + 0x07, 0x45, 0x74, 0x63, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x74, 0x63, 0x64, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x1a, 0x16, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x74, + 0x63, 0x64, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, + 0x71, 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x47, 0x0a, + 0x0b, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x77, + 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0b, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x56, 0x69, 0x65, 0x77, 0x12, 0x1a, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, + 0x71, 0x1a, 0x1a, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, + 0x38, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x15, 0x2e, 0x77, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, + 0x1a, 0x15, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x72, + 0x72, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, + 0x1a, 0x18, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0c, + 0x55, 0x73, 0x65, 0x72, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1b, 0x2e, 0x77, + 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x77, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x65, 0x68, 0x61, 0x76, + 0x69, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0d, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x50, 0x75, 0x73, 0x68, 0x4c, 0x6f, 0x67, 0x12, 0x1c, 0x2e, 0x77, 0x5f, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x75, 0x73, + 0x68, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x77, 0x5f, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x75, 0x73, 0x68, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_script_proto_rawDescOnce sync.Once + file_w_script_proto_rawDescData = file_w_script_proto_rawDesc +) + +func file_w_script_proto_rawDescGZIP() []byte { + file_w_script_proto_rawDescOnce.Do(func() { + file_w_script_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_script_proto_rawDescData) + }) + return file_w_script_proto_rawDescData +} + +var file_w_script_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_w_script_proto_goTypes = []interface{}{ + (*BootReq)(nil), // 0: w_scriptpb.BootReq + (*BootRes)(nil), // 1: w_scriptpb.BootRes + (*RefreshDayLimitReq)(nil), // 2: w_scriptpb.RefreshDayLimitReq + (*RefreshDayLimitRes)(nil), // 3: w_scriptpb.RefreshDayLimitRes + (*NotifyListReq)(nil), // 4: w_scriptpb.NotifyListReq + (*NotifyListRes)(nil), // 5: w_scriptpb.NotifyListRes + (*EtcdKeyReq)(nil), // 6: w_scriptpb.EtcdKeyReq + (*EtcdKeyRes)(nil), // 7: w_scriptpb.EtcdKeyRes + (*EventFlowReq)(nil), // 8: w_scriptpb.EventFlowReq + (*EventFlowRes)(nil), // 9: w_scriptpb.EventFlowRes + (*ClearDeviceReq)(nil), // 10: w_scriptpb.ClearDeviceReq + (*ClearDeviceRes)(nil), // 11: w_scriptpb.ClearDeviceRes + (*RefreshViewReq)(nil), // 12: w_scriptpb.RefreshViewReq + (*RefreshViewRes)(nil), // 13: w_scriptpb.RefreshViewRes + (*ErrLogReq)(nil), // 14: w_scriptpb.ErrLogReq + (*ErrLogRes)(nil), // 15: w_scriptpb.ErrLogRes + (*PointsLogReq)(nil), // 16: w_scriptpb.PointsLogReq + (*PointsLogRes)(nil), // 17: w_scriptpb.PointsLogRes + (*UserBehaviorReq)(nil), // 18: w_scriptpb.UserBehaviorReq + (*UserBehaviorRes)(nil), // 19: w_scriptpb.UserBehaviorRes + (*RewardPushLogReq)(nil), // 20: w_scriptpb.RewardPushLogReq + (*RewardPushLogRes)(nil), // 21: w_scriptpb.RewardPushLogRes + (*NotifyListRes_One)(nil), // 22: w_scriptpb.NotifyListRes.One + (*EtcdKeyRes_KV)(nil), // 23: w_scriptpb.EtcdKeyRes.KV + (*EventFlowRes_One)(nil), // 24: w_scriptpb.EventFlowRes.One + (*PointsLogRes_One)(nil), // 25: w_scriptpb.PointsLogRes.One + (*RewardPushLogRes_One)(nil), // 26: w_scriptpb.RewardPushLogRes.One +} +var file_w_script_proto_depIdxs = []int32{ + 22, // 0: w_scriptpb.NotifyListRes.list:type_name -> w_scriptpb.NotifyListRes.One + 23, // 1: w_scriptpb.EtcdKeyRes.kvs:type_name -> w_scriptpb.EtcdKeyRes.KV + 24, // 2: w_scriptpb.EventFlowRes.list:type_name -> w_scriptpb.EventFlowRes.One + 25, // 3: w_scriptpb.PointsLogRes.list:type_name -> w_scriptpb.PointsLogRes.One + 26, // 4: w_scriptpb.RewardPushLogRes.list:type_name -> w_scriptpb.RewardPushLogRes.One + 0, // 5: w_scriptpb.WScript.Boot:input_type -> w_scriptpb.BootReq + 2, // 6: w_scriptpb.WScript.RefreshDayLimit:input_type -> w_scriptpb.RefreshDayLimitReq + 4, // 7: w_scriptpb.WScript.NotifyList:input_type -> w_scriptpb.NotifyListReq + 6, // 8: w_scriptpb.WScript.EtcdKey:input_type -> w_scriptpb.EtcdKeyReq + 8, // 9: w_scriptpb.WScript.EventFlow:input_type -> w_scriptpb.EventFlowReq + 10, // 10: w_scriptpb.WScript.ClearDevice:input_type -> w_scriptpb.ClearDeviceReq + 12, // 11: w_scriptpb.WScript.RefreshView:input_type -> w_scriptpb.RefreshViewReq + 14, // 12: w_scriptpb.WScript.ErrLog:input_type -> w_scriptpb.ErrLogReq + 16, // 13: w_scriptpb.WScript.PointsLog:input_type -> w_scriptpb.PointsLogReq + 18, // 14: w_scriptpb.WScript.UserBehavior:input_type -> w_scriptpb.UserBehaviorReq + 20, // 15: w_scriptpb.WScript.RewardPushLog:input_type -> w_scriptpb.RewardPushLogReq + 1, // 16: w_scriptpb.WScript.Boot:output_type -> w_scriptpb.BootRes + 3, // 17: w_scriptpb.WScript.RefreshDayLimit:output_type -> w_scriptpb.RefreshDayLimitRes + 5, // 18: w_scriptpb.WScript.NotifyList:output_type -> w_scriptpb.NotifyListRes + 7, // 19: w_scriptpb.WScript.EtcdKey:output_type -> w_scriptpb.EtcdKeyRes + 9, // 20: w_scriptpb.WScript.EventFlow:output_type -> w_scriptpb.EventFlowRes + 11, // 21: w_scriptpb.WScript.ClearDevice:output_type -> w_scriptpb.ClearDeviceRes + 13, // 22: w_scriptpb.WScript.RefreshView:output_type -> w_scriptpb.RefreshViewRes + 15, // 23: w_scriptpb.WScript.ErrLog:output_type -> w_scriptpb.ErrLogRes + 17, // 24: w_scriptpb.WScript.PointsLog:output_type -> w_scriptpb.PointsLogRes + 19, // 25: w_scriptpb.WScript.UserBehavior:output_type -> w_scriptpb.UserBehaviorRes + 21, // 26: w_scriptpb.WScript.RewardPushLog:output_type -> w_scriptpb.RewardPushLogRes + 16, // [16:27] is the sub-list for method output_type + 5, // [5:16] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_w_script_proto_init() } +func file_w_script_proto_init() { + if File_w_script_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_script_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshDayLimitReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshDayLimitRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EtcdKeyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EtcdKeyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFlowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFlowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearDeviceReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClearDeviceRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshViewReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshViewRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ErrLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ErrLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointsLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointsLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserBehaviorReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserBehaviorRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardPushLogReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardPushLogRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EtcdKeyRes_KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventFlowRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PointsLogRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_script_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardPushLogRes_One); 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_w_script_proto_rawDesc, + NumEnums: 0, + NumMessages: 27, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_script_proto_goTypes, + DependencyIndexes: file_w_script_proto_depIdxs, + MessageInfos: file_w_script_proto_msgTypes, + }.Build() + File_w_script_proto = out.File + file_w_script_proto_rawDesc = nil + file_w_script_proto_goTypes = nil + file_w_script_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_script/w_script.pb.micro.go b/proto/go_proto/w_script/w_script.pb.micro.go new file mode 100644 index 0000000..7598991 --- /dev/null +++ b/proto/go_proto/w_script/w_script.pb.micro.go @@ -0,0 +1,279 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_script.proto + +package w_scriptpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WScript service + +func NewWScriptEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WScript service + +type WScriptService interface { + // Boot 运行脚本 + Boot(ctx context.Context, in *BootReq, opts ...client.CallOption) (*BootRes, error) + // RefreshDayLimit 刷新每日限制 + RefreshDayLimit(ctx context.Context, in *RefreshDayLimitReq, opts ...client.CallOption) (*RefreshDayLimitRes, error) + // NotifyList 奖品回调列表 + NotifyList(ctx context.Context, in *NotifyListReq, opts ...client.CallOption) (*NotifyListRes, error) + // EtcdKey 查看etcd的key + EtcdKey(ctx context.Context, in *EtcdKeyReq, opts ...client.CallOption) (*EtcdKeyRes, error) + // EventFlow 查看事件记录 + EventFlow(ctx context.Context, in *EventFlowReq, opts ...client.CallOption) (*EventFlowRes, error) + // ClearDevice 清除设备信息 + ClearDevice(ctx context.Context, in *ClearDeviceReq, opts ...client.CallOption) (*ClearDeviceRes, error) + // RefreshView 重新体验玩法 + RefreshView(ctx context.Context, in *RefreshViewReq, opts ...client.CallOption) (*RefreshViewRes, error) + // ErrLog 错误日志记录 + ErrLog(ctx context.Context, in *ErrLogReq, opts ...client.CallOption) (*ErrLogRes, error) + // PointsLog 领扣积分请求 + PointsLog(ctx context.Context, in *PointsLogReq, opts ...client.CallOption) (*PointsLogRes, error) + // UserBehavior 用户行为日志 + UserBehavior(ctx context.Context, in *UserBehaviorReq, opts ...client.CallOption) (*UserBehaviorRes, error) + // RewardPushLog 奖品推送日志 + RewardPushLog(ctx context.Context, in *RewardPushLogReq, opts ...client.CallOption) (*RewardPushLogRes, error) +} + +type wScriptService struct { + c client.Client + name string +} + +func NewWScriptService(name string, c client.Client) WScriptService { + return &wScriptService{ + c: c, + name: name, + } +} + +func (c *wScriptService) Boot(ctx context.Context, in *BootReq, opts ...client.CallOption) (*BootRes, error) { + req := c.c.NewRequest(c.name, "WScript.Boot", in) + out := new(BootRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) RefreshDayLimit(ctx context.Context, in *RefreshDayLimitReq, opts ...client.CallOption) (*RefreshDayLimitRes, error) { + req := c.c.NewRequest(c.name, "WScript.RefreshDayLimit", in) + out := new(RefreshDayLimitRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) NotifyList(ctx context.Context, in *NotifyListReq, opts ...client.CallOption) (*NotifyListRes, error) { + req := c.c.NewRequest(c.name, "WScript.NotifyList", in) + out := new(NotifyListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) EtcdKey(ctx context.Context, in *EtcdKeyReq, opts ...client.CallOption) (*EtcdKeyRes, error) { + req := c.c.NewRequest(c.name, "WScript.EtcdKey", in) + out := new(EtcdKeyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) EventFlow(ctx context.Context, in *EventFlowReq, opts ...client.CallOption) (*EventFlowRes, error) { + req := c.c.NewRequest(c.name, "WScript.EventFlow", in) + out := new(EventFlowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) ClearDevice(ctx context.Context, in *ClearDeviceReq, opts ...client.CallOption) (*ClearDeviceRes, error) { + req := c.c.NewRequest(c.name, "WScript.ClearDevice", in) + out := new(ClearDeviceRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) RefreshView(ctx context.Context, in *RefreshViewReq, opts ...client.CallOption) (*RefreshViewRes, error) { + req := c.c.NewRequest(c.name, "WScript.RefreshView", in) + out := new(RefreshViewRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) ErrLog(ctx context.Context, in *ErrLogReq, opts ...client.CallOption) (*ErrLogRes, error) { + req := c.c.NewRequest(c.name, "WScript.ErrLog", in) + out := new(ErrLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) PointsLog(ctx context.Context, in *PointsLogReq, opts ...client.CallOption) (*PointsLogRes, error) { + req := c.c.NewRequest(c.name, "WScript.PointsLog", in) + out := new(PointsLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) UserBehavior(ctx context.Context, in *UserBehaviorReq, opts ...client.CallOption) (*UserBehaviorRes, error) { + req := c.c.NewRequest(c.name, "WScript.UserBehavior", in) + out := new(UserBehaviorRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wScriptService) RewardPushLog(ctx context.Context, in *RewardPushLogReq, opts ...client.CallOption) (*RewardPushLogRes, error) { + req := c.c.NewRequest(c.name, "WScript.RewardPushLog", in) + out := new(RewardPushLogRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WScript service + +type WScriptHandler interface { + // Boot 运行脚本 + Boot(context.Context, *BootReq, *BootRes) error + // RefreshDayLimit 刷新每日限制 + RefreshDayLimit(context.Context, *RefreshDayLimitReq, *RefreshDayLimitRes) error + // NotifyList 奖品回调列表 + NotifyList(context.Context, *NotifyListReq, *NotifyListRes) error + // EtcdKey 查看etcd的key + EtcdKey(context.Context, *EtcdKeyReq, *EtcdKeyRes) error + // EventFlow 查看事件记录 + EventFlow(context.Context, *EventFlowReq, *EventFlowRes) error + // ClearDevice 清除设备信息 + ClearDevice(context.Context, *ClearDeviceReq, *ClearDeviceRes) error + // RefreshView 重新体验玩法 + RefreshView(context.Context, *RefreshViewReq, *RefreshViewRes) error + // ErrLog 错误日志记录 + ErrLog(context.Context, *ErrLogReq, *ErrLogRes) error + // PointsLog 领扣积分请求 + PointsLog(context.Context, *PointsLogReq, *PointsLogRes) error + // UserBehavior 用户行为日志 + UserBehavior(context.Context, *UserBehaviorReq, *UserBehaviorRes) error + // RewardPushLog 奖品推送日志 + RewardPushLog(context.Context, *RewardPushLogReq, *RewardPushLogRes) error +} + +func RegisterWScriptHandler(s server.Server, hdlr WScriptHandler, opts ...server.HandlerOption) error { + type wScript interface { + Boot(ctx context.Context, in *BootReq, out *BootRes) error + RefreshDayLimit(ctx context.Context, in *RefreshDayLimitReq, out *RefreshDayLimitRes) error + NotifyList(ctx context.Context, in *NotifyListReq, out *NotifyListRes) error + EtcdKey(ctx context.Context, in *EtcdKeyReq, out *EtcdKeyRes) error + EventFlow(ctx context.Context, in *EventFlowReq, out *EventFlowRes) error + ClearDevice(ctx context.Context, in *ClearDeviceReq, out *ClearDeviceRes) error + RefreshView(ctx context.Context, in *RefreshViewReq, out *RefreshViewRes) error + ErrLog(ctx context.Context, in *ErrLogReq, out *ErrLogRes) error + PointsLog(ctx context.Context, in *PointsLogReq, out *PointsLogRes) error + UserBehavior(ctx context.Context, in *UserBehaviorReq, out *UserBehaviorRes) error + RewardPushLog(ctx context.Context, in *RewardPushLogReq, out *RewardPushLogRes) error + } + type WScript struct { + wScript + } + h := &wScriptHandler{hdlr} + return s.Handle(s.NewHandler(&WScript{h}, opts...)) +} + +type wScriptHandler struct { + WScriptHandler +} + +func (h *wScriptHandler) Boot(ctx context.Context, in *BootReq, out *BootRes) error { + return h.WScriptHandler.Boot(ctx, in, out) +} + +func (h *wScriptHandler) RefreshDayLimit(ctx context.Context, in *RefreshDayLimitReq, out *RefreshDayLimitRes) error { + return h.WScriptHandler.RefreshDayLimit(ctx, in, out) +} + +func (h *wScriptHandler) NotifyList(ctx context.Context, in *NotifyListReq, out *NotifyListRes) error { + return h.WScriptHandler.NotifyList(ctx, in, out) +} + +func (h *wScriptHandler) EtcdKey(ctx context.Context, in *EtcdKeyReq, out *EtcdKeyRes) error { + return h.WScriptHandler.EtcdKey(ctx, in, out) +} + +func (h *wScriptHandler) EventFlow(ctx context.Context, in *EventFlowReq, out *EventFlowRes) error { + return h.WScriptHandler.EventFlow(ctx, in, out) +} + +func (h *wScriptHandler) ClearDevice(ctx context.Context, in *ClearDeviceReq, out *ClearDeviceRes) error { + return h.WScriptHandler.ClearDevice(ctx, in, out) +} + +func (h *wScriptHandler) RefreshView(ctx context.Context, in *RefreshViewReq, out *RefreshViewRes) error { + return h.WScriptHandler.RefreshView(ctx, in, out) +} + +func (h *wScriptHandler) ErrLog(ctx context.Context, in *ErrLogReq, out *ErrLogRes) error { + return h.WScriptHandler.ErrLog(ctx, in, out) +} + +func (h *wScriptHandler) PointsLog(ctx context.Context, in *PointsLogReq, out *PointsLogRes) error { + return h.WScriptHandler.PointsLog(ctx, in, out) +} + +func (h *wScriptHandler) UserBehavior(ctx context.Context, in *UserBehaviorReq, out *UserBehaviorRes) error { + return h.WScriptHandler.UserBehavior(ctx, in, out) +} + +func (h *wScriptHandler) RewardPushLog(ctx context.Context, in *RewardPushLogReq, out *RewardPushLogRes) error { + return h.WScriptHandler.RewardPushLog(ctx, in, out) +} diff --git a/proto/go_proto/w_user/w_user.pb.go b/proto/go_proto/w_user/w_user.pb.go new file mode 100644 index 0000000..a6ab728 --- /dev/null +++ b/proto/go_proto/w_user/w_user.pb.go @@ -0,0 +1,1523 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v5.29.1 +// source: w_user.proto + +package w_userpb + +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 LoginReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` //账号 + Passwd string `protobuf:"bytes,2,opt,name=passwd,proto3" json:"passwd,omitempty"` //密码 + Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` //授权码 +} + +func (x *LoginReq) Reset() { + *x = LoginReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginReq) ProtoMessage() {} + +func (x *LoginReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 LoginReq.ProtoReflect.Descriptor instead. +func (*LoginReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{0} +} + +func (x *LoginReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginReq) GetPasswd() string { + if x != nil { + return x.Passwd + } + return "" +} + +func (x *LoginReq) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type LoginRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsAdmin bool `protobuf:"varint,1,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"` //是否超级管理员 + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,3,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + CompanyId int64 `protobuf:"varint,4,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //用户企业id + Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` //身份token + Expired int64 `protobuf:"varint,6,opt,name=expired,proto3" json:"expired,omitempty"` //token过期时间,单位:秒(s) + Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` //显示的名称 + Email string `protobuf:"bytes,8,opt,name=email,proto3" json:"email,omitempty"` //邮箱 + Username string `protobuf:"bytes,9,opt,name=username,proto3" json:"username,omitempty"` //账号 + RoleName string `protobuf:"bytes,10,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` //角色名称 +} + +func (x *LoginRes) Reset() { + *x = LoginRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRes) ProtoMessage() {} + +func (x *LoginRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 LoginRes.ProtoReflect.Descriptor instead. +func (*LoginRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginRes) GetIsAdmin() bool { + if x != nil { + return x.IsAdmin + } + return false +} + +func (x *LoginRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LoginRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *LoginRes) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *LoginRes) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *LoginRes) GetExpired() int64 { + if x != nil { + return x.Expired + } + return 0 +} + +func (x *LoginRes) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LoginRes) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *LoginRes) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginRes) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +type ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业Id + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` //当前页 + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` //每页条数 +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{2} +} + +func (x *ListReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +type ListRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*ListRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` //列表总数 +} + +func (x *ListRes) Reset() { + *x = ListRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes) ProtoMessage() {} + +func (x *ListRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 ListRes.ProtoReflect.Descriptor instead. +func (*ListRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{3} +} + +func (x *ListRes) GetList() []*ListRes_One { + if x != nil { + return x.List + } + return nil +} + +func (x *ListRes) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type SelectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业Id +} + +func (x *SelectReq) Reset() { + *x = SelectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectReq) ProtoMessage() {} + +func (x *SelectReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 SelectReq.ProtoReflect.Descriptor instead. +func (*SelectReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{4} +} + +func (x *SelectReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +type SelectRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*SelectRes_One `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` //列表数据 +} + +func (x *SelectRes) Reset() { + *x = SelectRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes) ProtoMessage() {} + +func (x *SelectRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 SelectRes.ProtoReflect.Descriptor instead. +func (*SelectRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{5} +} + +func (x *SelectRes) GetList() []*SelectRes_One { + if x != nil { + return x.List + } + return nil +} + +type ShowReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id +} + +func (x *ShowReq) Reset() { + *x = ShowReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowReq) ProtoMessage() {} + +func (x *ShowReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 ShowReq.ProtoReflect.Descriptor instead. +func (*ShowReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{6} +} + +func (x *ShowReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type ShowRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + ShowName string `protobuf:"bytes,3,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` //列表总数 + Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` //用户名 + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` //用户邮箱 + IsAdmin bool `protobuf:"varint,6,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"` //是否超级管理员 +} + +func (x *ShowRes) Reset() { + *x = ShowRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShowRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShowRes) ProtoMessage() {} + +func (x *ShowRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 ShowRes.ProtoReflect.Descriptor instead. +func (*ShowRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{7} +} + +func (x *ShowRes) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ShowRes) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ShowRes) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +func (x *ShowRes) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ShowRes) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ShowRes) GetIsAdmin() bool { + if x != nil { + return x.IsAdmin + } + return false +} + +type StoreReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CompanyId int64 `protobuf:"varint,1,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` //企业ID + ShowName string `protobuf:"bytes,2,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` //显示名称 + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` //用户名 + Passwd string `protobuf:"bytes,4,opt,name=passwd,proto3" json:"passwd,omitempty"` //用户密码 + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` //用户邮箱 + ProjectHashIds []string `protobuf:"bytes,6,rep,name=project_hash_ids,json=projectHashIds,proto3" json:"project_hash_ids,omitempty"` //项目hash_id +} + +func (x *StoreReq) Reset() { + *x = StoreReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreReq) ProtoMessage() {} + +func (x *StoreReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 StoreReq.ProtoReflect.Descriptor instead. +func (*StoreReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{8} +} + +func (x *StoreReq) GetCompanyId() int64 { + if x != nil { + return x.CompanyId + } + return 0 +} + +func (x *StoreReq) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +func (x *StoreReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *StoreReq) GetPasswd() string { + if x != nil { + return x.Passwd + } + return "" +} + +func (x *StoreReq) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *StoreReq) GetProjectHashIds() []string { + if x != nil { + return x.ProjectHashIds + } + return nil +} + +type StoreRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StoreRes) Reset() { + *x = StoreRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoreRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoreRes) ProtoMessage() {} + +func (x *StoreRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 StoreRes.ProtoReflect.Descriptor instead. +func (*StoreRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{9} +} + +type UpdateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + ShowName string `protobuf:"bytes,3,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` //显示名称 + Passwd string `protobuf:"bytes,4,opt,name=passwd,proto3" json:"passwd,omitempty"` //用户密码 +} + +func (x *UpdateReq) Reset() { + *x = UpdateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReq) ProtoMessage() {} + +func (x *UpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 UpdateReq.ProtoReflect.Descriptor instead. +func (*UpdateReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{10} +} + +func (x *UpdateReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *UpdateReq) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +func (x *UpdateReq) GetPasswd() string { + if x != nil { + return x.Passwd + } + return "" +} + +type UpdateRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateRes) Reset() { + *x = UpdateRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRes) ProtoMessage() {} + +func (x *UpdateRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 UpdateRes.ProtoReflect.Descriptor instead. +func (*UpdateRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{11} +} + +type DestroyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id +} + +func (x *DestroyReq) Reset() { + *x = DestroyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyReq) ProtoMessage() {} + +func (x *DestroyReq) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 DestroyReq.ProtoReflect.Descriptor instead. +func (*DestroyReq) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{12} +} + +func (x *DestroyReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DestroyReq) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +type DestroyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DestroyRes) Reset() { + *x = DestroyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DestroyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyRes) ProtoMessage() {} + +func (x *DestroyRes) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 DestroyRes.ProtoReflect.Descriptor instead. +func (*DestroyRes) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{13} +} + +type ListRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + ShowName string `protobuf:"bytes,3,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` //列表总数 + Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` //用户名 + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` //用户邮箱 + RoleName string `protobuf:"bytes,6,opt,name=role_name,json=roleName,proto3" json:"role_name,omitempty"` //用户角色 + Projects []*ListRes_Project `protobuf:"bytes,7,rep,name=projects,proto3" json:"projects,omitempty"` //用户关联项目 +} + +func (x *ListRes_One) Reset() { + *x = ListRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_One) ProtoMessage() {} + +func (x *ListRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 ListRes_One.ProtoReflect.Descriptor instead. +func (*ListRes_One) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *ListRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ListRes_One) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +func (x *ListRes_One) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListRes_One) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListRes_One) GetRoleName() string { + if x != nil { + return x.RoleName + } + return "" +} + +func (x *ListRes_One) GetProjects() []*ListRes_Project { + if x != nil { + return x.Projects + } + return nil +} + +type ListRes_Project struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //项目id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //对外项目id + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` //项目名称 +} + +func (x *ListRes_Project) Reset() { + *x = ListRes_Project{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRes_Project) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRes_Project) ProtoMessage() {} + +func (x *ListRes_Project) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 ListRes_Project.ProtoReflect.Descriptor instead. +func (*ListRes_Project) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *ListRes_Project) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ListRes_Project) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *ListRes_Project) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +type SelectRes_One struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //用户id + HashId string `protobuf:"bytes,2,opt,name=hash_id,json=hashId,proto3" json:"hash_id,omitempty"` //用户对外id + ShowName string `protobuf:"bytes,3,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` //列表总数 +} + +func (x *SelectRes_One) Reset() { + *x = SelectRes_One{} + if protoimpl.UnsafeEnabled { + mi := &file_w_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelectRes_One) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelectRes_One) ProtoMessage() {} + +func (x *SelectRes_One) ProtoReflect() protoreflect.Message { + mi := &file_w_user_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 SelectRes_One.ProtoReflect.Descriptor instead. +func (*SelectRes_One) Descriptor() ([]byte, []int) { + return file_w_user_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *SelectRes_One) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *SelectRes_One) GetHashId() string { + if x != nil { + return x.HashId + } + return "" +} + +func (x *SelectRes_One) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +var File_w_user_proto protoreflect.FileDescriptor + +var file_w_user_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, + 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x22, 0x52, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x80, 0x02, 0x0a, + 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, + 0x57, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, + 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x22, 0xe8, 0x02, 0x0a, 0x07, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x1a, 0xd1, 0x01, 0x0a, 0x03, 0x4f, 0x6e, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x1a, 0x48, 0x0a, 0x07, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x22, 0x2a, 0x0a, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x22, + 0x85, 0x01, 0x0a, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x2b, 0x0a, + 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x77, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, + 0x2e, 0x4f, 0x6e, 0x65, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x1a, 0x4b, 0x0a, 0x03, 0x4f, 0x6e, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, + 0x6f, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, + 0x68, 0x6f, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x32, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x77, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x07, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0xba, 0x01, 0x0a, 0x08, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, 0x0a, + 0x10, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x49, 0x64, 0x73, 0x22, 0x0a, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x52, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, + 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, + 0x6f, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x73, 0x73, 0x77, 0x64, 0x22, 0x0b, + 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x0a, 0x44, + 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x73, + 0x32, 0xf2, 0x02, 0x0a, 0x05, 0x57, 0x55, 0x73, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x12, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x2e, 0x0a, + 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, + 0x06, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x04, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x11, 0x2e, 0x77, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x11, + 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, + 0x73, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x2e, 0x77, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x12, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x13, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x07, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x14, 0x2e, 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, + 0x77, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, + 0x52, 0x65, 0x73, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x77, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_w_user_proto_rawDescOnce sync.Once + file_w_user_proto_rawDescData = file_w_user_proto_rawDesc +) + +func file_w_user_proto_rawDescGZIP() []byte { + file_w_user_proto_rawDescOnce.Do(func() { + file_w_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_w_user_proto_rawDescData) + }) + return file_w_user_proto_rawDescData +} + +var file_w_user_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_w_user_proto_goTypes = []interface{}{ + (*LoginReq)(nil), // 0: w_userpb.LoginReq + (*LoginRes)(nil), // 1: w_userpb.LoginRes + (*ListReq)(nil), // 2: w_userpb.ListReq + (*ListRes)(nil), // 3: w_userpb.ListRes + (*SelectReq)(nil), // 4: w_userpb.SelectReq + (*SelectRes)(nil), // 5: w_userpb.SelectRes + (*ShowReq)(nil), // 6: w_userpb.ShowReq + (*ShowRes)(nil), // 7: w_userpb.ShowRes + (*StoreReq)(nil), // 8: w_userpb.StoreReq + (*StoreRes)(nil), // 9: w_userpb.StoreRes + (*UpdateReq)(nil), // 10: w_userpb.UpdateReq + (*UpdateRes)(nil), // 11: w_userpb.UpdateRes + (*DestroyReq)(nil), // 12: w_userpb.DestroyReq + (*DestroyRes)(nil), // 13: w_userpb.DestroyRes + (*ListRes_One)(nil), // 14: w_userpb.ListRes.One + (*ListRes_Project)(nil), // 15: w_userpb.ListRes.Project + (*SelectRes_One)(nil), // 16: w_userpb.SelectRes.One +} +var file_w_user_proto_depIdxs = []int32{ + 14, // 0: w_userpb.ListRes.list:type_name -> w_userpb.ListRes.One + 16, // 1: w_userpb.SelectRes.list:type_name -> w_userpb.SelectRes.One + 15, // 2: w_userpb.ListRes.One.projects:type_name -> w_userpb.ListRes.Project + 0, // 3: w_userpb.WUser.Login:input_type -> w_userpb.LoginReq + 2, // 4: w_userpb.WUser.List:input_type -> w_userpb.ListReq + 4, // 5: w_userpb.WUser.Select:input_type -> w_userpb.SelectReq + 6, // 6: w_userpb.WUser.Show:input_type -> w_userpb.ShowReq + 8, // 7: w_userpb.WUser.Store:input_type -> w_userpb.StoreReq + 10, // 8: w_userpb.WUser.Update:input_type -> w_userpb.UpdateReq + 12, // 9: w_userpb.WUser.Destroy:input_type -> w_userpb.DestroyReq + 1, // 10: w_userpb.WUser.Login:output_type -> w_userpb.LoginRes + 3, // 11: w_userpb.WUser.List:output_type -> w_userpb.ListRes + 5, // 12: w_userpb.WUser.Select:output_type -> w_userpb.SelectRes + 7, // 13: w_userpb.WUser.Show:output_type -> w_userpb.ShowRes + 9, // 14: w_userpb.WUser.Store:output_type -> w_userpb.StoreRes + 11, // 15: w_userpb.WUser.Update:output_type -> w_userpb.UpdateRes + 13, // 16: w_userpb.WUser.Destroy:output_type -> w_userpb.DestroyRes + 10, // [10:17] is the sub-list for method output_type + 3, // [3:10] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_w_user_proto_init() } +func file_w_user_proto_init() { + if File_w_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_w_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShowRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DestroyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_One); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRes_Project); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_w_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelectRes_One); 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_w_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 17, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_w_user_proto_goTypes, + DependencyIndexes: file_w_user_proto_depIdxs, + MessageInfos: file_w_user_proto_msgTypes, + }.Build() + File_w_user_proto = out.File + file_w_user_proto_rawDesc = nil + file_w_user_proto_goTypes = nil + file_w_user_proto_depIdxs = nil +} diff --git a/proto/go_proto/w_user/w_user.pb.micro.go b/proto/go_proto/w_user/w_user.pb.micro.go new file mode 100644 index 0000000..ae63065 --- /dev/null +++ b/proto/go_proto/w_user/w_user.pb.micro.go @@ -0,0 +1,203 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: w_user.proto + +package w_userpb + +import ( + fmt "fmt" + proto "google.golang.org/protobuf/proto" + math "math" +) + +import ( + context "context" + api "go-micro.dev/v4/api" + client "go-micro.dev/v4/client" + server "go-micro.dev/v4/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Reference imports to suppress errors if they are not otherwise used. +var _ api.Endpoint +var _ context.Context +var _ client.Option +var _ server.Option + +// Api Endpoints for WUser service + +func NewWUserEndpoints() []*api.Endpoint { + return []*api.Endpoint{} +} + +// Client API for WUser service + +type WUserService interface { + // Login 登陆 + Login(ctx context.Context, in *LoginReq, opts ...client.CallOption) (*LoginRes, error) + // List 用户列表 + List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) + // Select 用户选择列表 + Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) + // Show 员工详情 + Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) + // Store 创建员工 + Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) + // Update 更新员工 + Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) + // Destroy 删除员工 + Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) +} + +type wUserService struct { + c client.Client + name string +} + +func NewWUserService(name string, c client.Client) WUserService { + return &wUserService{ + c: c, + name: name, + } +} + +func (c *wUserService) Login(ctx context.Context, in *LoginReq, opts ...client.CallOption) (*LoginRes, error) { + req := c.c.NewRequest(c.name, "WUser.Login", in) + out := new(LoginRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wUserService) List(ctx context.Context, in *ListReq, opts ...client.CallOption) (*ListRes, error) { + req := c.c.NewRequest(c.name, "WUser.List", in) + out := new(ListRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wUserService) Select(ctx context.Context, in *SelectReq, opts ...client.CallOption) (*SelectRes, error) { + req := c.c.NewRequest(c.name, "WUser.Select", in) + out := new(SelectRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wUserService) Show(ctx context.Context, in *ShowReq, opts ...client.CallOption) (*ShowRes, error) { + req := c.c.NewRequest(c.name, "WUser.Show", in) + out := new(ShowRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wUserService) Store(ctx context.Context, in *StoreReq, opts ...client.CallOption) (*StoreRes, error) { + req := c.c.NewRequest(c.name, "WUser.Store", in) + out := new(StoreRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wUserService) Update(ctx context.Context, in *UpdateReq, opts ...client.CallOption) (*UpdateRes, error) { + req := c.c.NewRequest(c.name, "WUser.Update", in) + out := new(UpdateRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wUserService) Destroy(ctx context.Context, in *DestroyReq, opts ...client.CallOption) (*DestroyRes, error) { + req := c.c.NewRequest(c.name, "WUser.Destroy", in) + out := new(DestroyRes) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for WUser service + +type WUserHandler interface { + // Login 登陆 + Login(context.Context, *LoginReq, *LoginRes) error + // List 用户列表 + List(context.Context, *ListReq, *ListRes) error + // Select 用户选择列表 + Select(context.Context, *SelectReq, *SelectRes) error + // Show 员工详情 + Show(context.Context, *ShowReq, *ShowRes) error + // Store 创建员工 + Store(context.Context, *StoreReq, *StoreRes) error + // Update 更新员工 + Update(context.Context, *UpdateReq, *UpdateRes) error + // Destroy 删除员工 + Destroy(context.Context, *DestroyReq, *DestroyRes) error +} + +func RegisterWUserHandler(s server.Server, hdlr WUserHandler, opts ...server.HandlerOption) error { + type wUser interface { + Login(ctx context.Context, in *LoginReq, out *LoginRes) error + List(ctx context.Context, in *ListReq, out *ListRes) error + Select(ctx context.Context, in *SelectReq, out *SelectRes) error + Show(ctx context.Context, in *ShowReq, out *ShowRes) error + Store(ctx context.Context, in *StoreReq, out *StoreRes) error + Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error + Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error + } + type WUser struct { + wUser + } + h := &wUserHandler{hdlr} + return s.Handle(s.NewHandler(&WUser{h}, opts...)) +} + +type wUserHandler struct { + WUserHandler +} + +func (h *wUserHandler) Login(ctx context.Context, in *LoginReq, out *LoginRes) error { + return h.WUserHandler.Login(ctx, in, out) +} + +func (h *wUserHandler) List(ctx context.Context, in *ListReq, out *ListRes) error { + return h.WUserHandler.List(ctx, in, out) +} + +func (h *wUserHandler) Select(ctx context.Context, in *SelectReq, out *SelectRes) error { + return h.WUserHandler.Select(ctx, in, out) +} + +func (h *wUserHandler) Show(ctx context.Context, in *ShowReq, out *ShowRes) error { + return h.WUserHandler.Show(ctx, in, out) +} + +func (h *wUserHandler) Store(ctx context.Context, in *StoreReq, out *StoreRes) error { + return h.WUserHandler.Store(ctx, in, out) +} + +func (h *wUserHandler) Update(ctx context.Context, in *UpdateReq, out *UpdateRes) error { + return h.WUserHandler.Update(ctx, in, out) +} + +func (h *wUserHandler) Destroy(ctx context.Context, in *DestroyReq, out *DestroyRes) error { + return h.WUserHandler.Destroy(ctx, in, out) +} diff --git a/proto/go_proto/workerr/1_user.go b/proto/go_proto/workerr/1_user.go new file mode 100644 index 0000000..484f7da --- /dev/null +++ b/proto/go_proto/workerr/1_user.go @@ -0,0 +1,13 @@ +package workerr + +const ( + LoginErrorCode = 100100 //登陆错误 + UserExistErrorCode = 100101 //账号已存在 + UserDelErrorCode = 100102 //账号不可删除 +) + +var ( + LoginError = New("账号或密码不正确", LoginErrorCode) + UserExistError = New("创建的帐户名已存在", UserExistErrorCode) + UserDelError = New("当前账号不可删除", UserDelErrorCode) +) diff --git a/proto/go_proto/workerr/2_project.go b/proto/go_proto/workerr/2_project.go new file mode 100644 index 0000000..81bc57f --- /dev/null +++ b/proto/go_proto/workerr/2_project.go @@ -0,0 +1,11 @@ +package workerr + +const ( + DomainExistErrorCode = 100200 //域名已存在 + ChangAuthErrorCode = 100201 //无权修改密钥 +) + +var ( + DomainExistError = New("域名不可用", DomainExistErrorCode) + ChangAuthError = New("无权修改密钥", ChangAuthErrorCode) +) diff --git a/proto/go_proto/workerr/3_campaign.go b/proto/go_proto/workerr/3_campaign.go new file mode 100644 index 0000000..07424ad --- /dev/null +++ b/proto/go_proto/workerr/3_campaign.go @@ -0,0 +1,30 @@ +package workerr + +const ( + CWaitCancelErrorCode = 100300 //活动未发布下线 + CPubWaitErrorCode = 100301 //活动发布改成待 + CChanelExistErrorCode = 100302 //渠道已存在 + CChanelNotSetErrorCode = 100303 //渠道不可编辑 + CEndErrorCode = 100304 //活动已结束 + CStartErrorCode = 100305 //活动未开始 + CChanceNoneErrorCode = 100306 //次数不足 + CVoteEndErrorCode = 100307 //投票已结束 + DynamicNotRelatedErrorCode = 100308 //没有关联动态下载页的活动 + CNotRunErrorCode = 100309 //活动没有开始 + DeviceOnceErrorCode = 100310 //设备只能绑定一个用户 + +) + +var ( + CWaitCancelError = New("活动未发布无法下线", CWaitCancelErrorCode) + CPubWaitError = New("非预发布活动不能手动上线", CPubWaitErrorCode) + CChanelExistError = New("渠道已存在", CChanelExistErrorCode) + CChanelNotSetError = New("渠道不可编辑", CChanelNotSetErrorCode) + CEndError = New("活动已结束", CEndErrorCode) + CStartError = New("活动未开始", CStartErrorCode) + CChanceNoneError = New("次数不足", CChanceNoneErrorCode) + CVoteEndError = New("投票已结束", CVoteEndErrorCode) + DynamicNotRelatedError = New("没有关联动态下载页的活动", DynamicNotRelatedErrorCode) + CNotRunError = New("活动还没有开始", CNotRunErrorCode) + DeviceOnceError = New("设备只能绑定一个用户", DeviceOnceErrorCode) +) diff --git a/proto/go_proto/workerr/4_reward.go b/proto/go_proto/workerr/4_reward.go new file mode 100644 index 0000000..cd3b9f7 --- /dev/null +++ b/proto/go_proto/workerr/4_reward.go @@ -0,0 +1,11 @@ +package workerr + +const ( + RewardKvExistCode = 100400 //键值数据已存在 + RewardImageInvalidCode = 100401 //存着无效小的code +) + +var ( + RewardKvExistError = New("已存在当前键值数据的奖品", RewardKvExistCode) + RewardImageInvalidError = New("存在无效图片", RewardImageInvalidCode) +) diff --git a/proto/go_proto/workerr/work_err.go b/proto/go_proto/workerr/work_err.go new file mode 100644 index 0000000..6a28ad1 --- /dev/null +++ b/proto/go_proto/workerr/work_err.go @@ -0,0 +1,67 @@ +package workerr + +import ( + "net/http" + + "go-micro.dev/v4/errors" +) + +const serviceName = "joybuywork" + +var ( + OnceLockError = New("There is currently a request of the same type being processed", TooManyRequestsErrorCode) //单次操作 + UnauthorizedError = New("Authorization Failed", http.StatusUnauthorized) //授权不成功 + ServerError = InternalServerError("Data processing failed, please try again") //服务异常 + BusyError = New("There are too many requests to process, please wait", BusyErrorCode) //服务繁忙,请重试 + ExportError = New("The export task processing is abnormal, please export again", ExportErrorCode) //导出任务处理异常 + S2SUnableToParseError = New("Please refer to the API integration documentation for relevant API integration methods", UnableToParseErrorCode) //无法解析数据 + S2SNotSuccessError = New("Please confirm that the returned API response status code is correct.[data.code=200?]", S2SNotSuccessErrorCode) //s2s请求处理不成功 +) + +const ( + MysqlErrorCode = 100000 //mysql错误 + RedisErrorCode = 100001 //Redis错误 + CacheErrorCode = 100002 //cache错误 + BusyErrorCode = 100003 //服务繁忙错误 + VerifyErrorCode = 100004 //参数错误 + ExportErrorCode = 100005 //导出错误 + TooManyRequestsErrorCode = 100006 //当前有一个同类型请求在处理 + UnableToParseErrorCode = 100007 //无法被解析的数据 + S2SNotSuccessErrorCode = 100008 //s2s无法成功 +) + +// MysqlError mysql 组件错误 +func MysqlError(err error) error { + return New(err.Error(), MysqlErrorCode) +} + +// RedisError redis 组件错误 +func RedisError(err error) error { + return New(err.Error(), RedisErrorCode) +} + +// CacheError cache 组件错误 +func CacheError(err error) error { + return New(err.Error(), CacheErrorCode) +} + +// VerifyError 参数错误 +func VerifyError(tip string) error { + return New(tip, VerifyErrorCode) +} + +func BadRequest(format string, a ...any) error { + return errors.BadRequest(serviceName, format, a...) +} + +func InternalServerError(format string, a ...any) error { + return errors.InternalServerError(serviceName, format, a...) +} + +func NotFound(format string, a ...any) error { + return errors.NotFound(serviceName, format, a...) +} + +func New(detail string, code int32) error { + return errors.New(serviceName, detail, code) +} diff --git a/proto/proto/w_campaign.proto b/proto/proto/w_campaign.proto new file mode 100644 index 0000000..b7d788e --- /dev/null +++ b/proto/proto/w_campaign.proto @@ -0,0 +1,3573 @@ +syntax = "proto3"; + +package w_campaignpb; +option go_package = './;w_campaignpb'; + +//活动服务 +service WCampaign { + +// List 活动列表 +rpc List(ListReq) returns (ListRes) {} +// Share 社媒选项 +rpc Share(ShareReq) returns (ShareRes) {} +// Status 修改状态 +rpc Status(StatusReq) returns (StatusRes) {} +// Destroy 删除活动 +rpc Destroy(DestroyReq) returns (DestroyRes) {} +// Store 创建活动 +rpc Store(StoreReq) returns (StoreRes) {} +// Update 更新活动 +rpc Update(UpdateReq) returns (UpdateRes) {} +// Show 活动详情 +rpc Show(ShowReq) returns (ShowRes) {} +// ChannelList 渠道列表 +rpc ChannelList(ChannelListReq) returns (ChannelListRes) {} +// ChannelCreate 渠道创建 +rpc ChannelCreate(ChannelCreateReq) returns (ChannelCreateRes) {} +// ChannelUpdate 渠道创建 +rpc ChannelUpdate(ChannelUpdateReq) returns (ChannelUpdateRes) {} +// ChannelDestroy 渠道创建 +rpc ChannelDestroy(ChannelDestroyReq) returns (ChannelDestroyRes) {} +// KvData 获取活动键值对 +rpc KvData(KvDataReq) returns (KvDataRes) {} +// Cert 认证活动信息 +rpc Cert(CertReq) returns (CertRes) {} +// Barrage 活动弹幕 +rpc Barrage(BarrageReq) returns (BarrageRes) {} +// Option 投票选项 +rpc Option(OptionReq) returns (OptionRes) {} +// RelateDdl 活动关联动态下载页 +rpc RelateDdl(RelateDdlReq) returns (RelateDdlRes) {} +// DdlCampaign 关联动态下载页的活动 +rpc DdlCampaign(DdlCampaignReq) returns (DdlCampaignRes) {} +// Langs 活动多语言配置信息 +rpc Langs(LangsReq) returns (LangsRes) {} +// Lang 活动语言信息 +rpc Lang(LangReq) returns (LangRes) {} +// SaveLang 保存活动多语言配置信息 +rpc SaveLang(SaveLangReq) returns (SaveLangRes) {} +// DestroyLang 删除活动语言配置信息 +rpc DestroyLang(DestroyLangReq) returns (DestroyLangRes) {} +// LangSelect 活动语言选择 +rpc LangSelect(LangSelectReq) returns (LangSelectRes) {} +// CampaignInfo 活动信息 +rpc CampaignInfo(CampaignInfoReq) returns (CampaignInfoRes) {} +// ShowReward 显示的奖品数据 +rpc ShowReward(ShowRewardReq) returns (ShowRewardRes) {} +// AdsStore 创建Ads活动 +rpc AdsStore(AdsStoreReq) returns (AdsStoreRes) {} +// AdsUpdate 更新Ads活动 +rpc AdsUpdate(AdsUpdateReq) returns (AdsUpdateRes) {} +// AdsShow Ads活动详情 +rpc AdsShow(AdsShowReq) returns (AdsShowRes) {} +// CampaignSelect 活动选择列表 +rpc CampaignSelect(CampaignSelectReq) returns (CampaignSelectRes) {} +// RewardDetail 奖品详情 +rpc RewardDetail(RewardDetailReq) returns (RewardDetailRes) {} +// UpdateStock 修改奖品库存 +rpc UpdateStock(UpdateStockReq) returns (UpdateStockRes) {} +// CampaignTz 活动时区数据 +rpc CampaignTz(CampaignTzReq) returns (CampaignTzRes) {} +// CampaignRewardType 活动奖品类型 +rpc CampaignRewardType(CampaignRewardTypeReq) returns (CampaignRewardTypeRes) {} +// ChildList 子活动列表 +rpc ChildList(ChildListReq) returns (ChildListRes) {} +// ChildStore 子活动列表 +rpc ChildStore(ChildStoreReq) returns (ChildStoreRes) {} +// ChildUpdate 更新子活动 +rpc ChildUpdate(ChildUpdateReq) returns (ChildUpdateRes) {} +// ChildShow 子活动活动 +rpc ChildShow(ChildShowReq) returns (ChildShowRes) {} +// TaskCenterJump 任务中心活动跳转地址 +rpc TaskCenterJump(TaskCenterJumpReq) returns (TaskCenterJumpRes) {} +// CondList 活动任务数据 +rpc CondList(CondListReq) returns (CondListRes) {} +// Campaigns 获取活动数据 +rpc Campaigns(CampaignsReq) returns (CampaignsRes) {} +// SetLvApi 设置动态用户等级动态api +rpc SetLvApi(SetLvApiReq) returns (SetLvApiRes) {} +// GetLvApi 获取动态用户等级动态api +rpc GetLvApi(GetLvApiReq) returns (GetLvApiRes) {} +// VsSettlement 赛事竞猜结算 +rpc VsSettlement(VsSettlementReq) returns (VsSettlementRes) {} +// VsSettlementInfo 赛事竞猜结算 +rpc VsSettlementInfo(VsSettlementInfoReq) returns (VsSettlementInfoRes) {} +// ActionList 行为列表 +rpc ActionList(ActionListReq) returns (ActionListRes) {} + +} + +message ListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 project_id = 3; //项目id + string project_hash_id = 4; //项目hash_id + string title = 5; //活动标题筛选 + string link = 6; //活动链接筛选 + repeated int32 status = 7; //活动状态(1-待发布,2-已发布,3-已下线,4-预发布) + repeated int64 fission_id = 8; //活动类型标识 + int64 start = 9; //活动时间开始时间戳 + int64 end = 10; //活动时间结束时间戳 + bool order_by_id = 11; //是否id升序 + repeated int32 targets = 12; //活动目标集合 + int64 updated_start = 13; //最后更新时间开始时间戳 + int64 updated_end = 14; //最后更新时间结束时间戳 +} + +message ListRes { + message One { + int64 id = 1; //活动ID + string hash_id = 2; //活动对外id + string title = 3; //活动标题 + string cover_url = 4; //活动封面 + string temp_group_mark = 5; //模版组标识 + string temp_hash_id = 6; //模版hash_id + int64 fission_id = 7; //玩法ID + string fission_mark = 8; //活动类型玩法标识 + int64 start_time = 9; //开始时间时间戳 + int64 end_time = 10; //结束时间时间戳 + string share_link = 11; //分享链接 + int64 visitor_num = 12; //访问人数 + int64 download_num = 13; //新增下载数 + int32 status = 14; //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + string view_link = 15; //预览地址 + int32 t_offset = 16; //时间偏移量 + repeated int32 lang_types = 17; //支持的语种 + int32 temp_lang_type = 18; //模版支持语言 + int32 target = 19; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告) + int32 has_web = 20; //是否有站外活动(0-否,1-是) + int32 has_warm_up = 21; //是否开启预热(0-否,1-是) + int64 pre_run_time = 22; //预发布转正式发布时间戳 + int32 ads_type = 23; //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + bool new_report = 24; //是否使用新报表 + repeated LangTz lang_tz = 25; //语言时区数据是 + int64 created_at = 26; //创建时间 + repeated string while_list = 27; //白名单用户id列表 + int64 updated_at = 28; //更新时间 + repeated Channel channel_list = 29; //渠道列表 + repeated Cond cond_list = 30; //任务列表 + string creator_name = 31; //活动创建者在后台的名称 + string creator_account = 32; //活动创建者在后台的登陆账号 + } + message LangTz { + string lang_mark = 1; //对应语言标识 + int32 t_offset = 2; //时间偏移量 + int32 status = 3; //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + int32 lang_type = 4; //语言数字标识 + } + message Channel { + string title = 1; //渠道标题 + string url = 2; //渠道链接 + int32 c_type = 3; //渠道类型(1-站内渠道,2-站外渠道) + } + message Cond { + string event = 1; //事件 + string key = 2; //事件key + string val = 3; //事件key对应的值 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message ShareReq { +} + +message ShareRes { + message One { + int64 id = 1; //活动ID + string title = 2; //标题 + string logo = 3; //图标 + string scheme = 4; //Scheme + string ios_scheme = 5; //ios Scheme + } + repeated One loc = 1; //国内 + repeated One over_sea = 2; //国外 +} + +message StatusReq { + int64 id = 1; //活动ID + string hash_id = 2; //活动对外id + int32 status = 3; //发布状态(2-已发布,3-已下线,4-预发布) + int64 pre_run_time = 4; //预发布转正式发布时间戳 +} + +message StatusRes { +} + +message DestroyReq { + int64 id = 1; //活动ID + string hash_id = 2; //活动对外id + int32 status = 3; //发布状态(2-已发布,3-已下线) +} + +message DestroyRes { +} + +message StoreReq { + message GashaponStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string machine_img = 4; //机器图 + string play_img = 5; //Go按钮图 + int32 egg_type = 6; //类型 + repeated string egg_imgs = 7; //扭蛋素材 + } + message Event { + EventOne first_visit = 1; //首次访问 + } + message EventOne { + int32 open = 1; //是否开启 + repeated EventReward rewards = 2; //奖励 + } + message EventReward { + string prop_mark = 1; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward reward = 2; //奖品 + int32 chance = 3; //道具数量 + string expired_day = 4; //过期天数 + } + message Uno { + int32 init_chance = 1; //初始抽奖次数 + repeated string prop_marks = 2; //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌) + UnoGroup red = 3; //红牌配置 + UnoGroup yellow = 4; //黄牌配置 + UnoGroup blue = 5; //黑牌配置 + UnoGroup green = 6; //绿牌配置 + } + message UnoGroup { + string odds = 1; //获得牌型概率 + Reward reward = 2; //奖品 + int32 open_rule = 3; //是否开启得牌规则(0-否,1-是) + UnoLimitRule limit_rule = 4; //得牌规则 + int32 custom_card = 5; //自定义卡牌(0-否,1-是) + repeated UnoCard cards = 6; //自定义卡牌 + } + message UnoLimitRule { + int32 init_num = 1; //初始的最大可获得牌型数 + int32 sign_day = 2; //签到天数 + int32 add_num = 3; //完成条件可获得最大牌型数 + int32 reset_type = 4; //重置规则(1-不重置,2-获奖后重置) + } + message UnoCard { + string title = 1; //跳转按钮文案 + string img_url = 2; //图片地址 + string web_url = 3; //Web跳转地址 + string app_param = 4; //App跳转参数 + string pc_param = 5; //pc跳转参数 + } + message Vs { + int32 init_chance = 1; //初始投票次数 + int32 each_limit_num = 2; //每场可投票次数 + int32 open_point = 3; //是否开启积分(0-否,1-是) + int32 points_num = 4; //投票扣除积分数 + int32 mall_open = 5; //是否使用积分商城(0-否,1-是) + int64 mall_id = 6; //兑换商城id + int32 vs_tz = 7; //比赛时区 + int32 claim_type = 8; //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + repeated Schedule schedules = 9; //赛事时间表 + string icon_mall = 10; //商城图标 + string icon_reward = 11; //奖励记录图标 + string icon_schedule = 12; //赛程图标 + } + message Schedule { + repeated PkTeam pk_teams = 1; //队伍 + } + message PkTeam { + repeated Team teams = 1; //队伍 + string vote_start = 2; //开始时间 + string vote_end = 3; //结束时间 + string vs_date = 4; //比赛开始时间 + string vs_img = 5; //比赛图 + string desc = 6; //标题描述 + string prop_mark = 7; //奖励的道具类型(reward-奖品,point-积分) + int64 reward_id = 8; //奖品库奖品id + int32 prop_num = 9; //道具数量 + string expired_day = 10; //过期天数 + repeated string other_vote = 11; //其他投票方式 + int32 open_odds = 12; //是否开启赔率(0-否,1-是) + string odds_left = 13; //左边赔率 + string odds_right = 14; //右边赔率 + string odds_draw = 15; //平局赔率 + } + message Team { + string name = 1; //队伍名称 + string logo_img = 2; //队伍图标 + } + message Chat { + int32 open = 1; //开启ai陪伴(0-关闭,1-开启) + string header_img = 2; //宠物头像 + string chat_bg = 3; //聊天背景 + int32 day_limit = 4; //每日聊天上限 + } + message PointsUse { + int32 open = 1; //是否开启积分消耗(0-否,1-是) + string icon = 2; //积分icon图 + int64 url_id = 3; //回调地址id + int32 use_num = 4; //单次兑换使用积分数量 + int32 day_limit = 5; //每日可兑换次数 + int32 total_limit = 6; //总兑换次数 + } + message FlipStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string button_color = 4; //按钮颜色 + string play_img = 5; //Go按钮图 + string card_img = 6; //卡片素材 + } + message GridStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string button_color = 4; //按钮颜色 + string play_img = 5; //Go按钮图 + string disable_play_img = 6; //Go按钮禁用 + string machine_img = 7; //机器图 + string grid_img = 8; //方格图 + string activate_img = 9; //方格激活图 + } + message WheelStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string bottom1 = 4; //底部颜色1 + string bottom2 = 5; //底部颜色2 + string bottom3 = 6; //底部颜色3 + string pointer = 7; //指针图片 + string play_btn = 8; //玩法按钮图片 + string border_img = 9; //边框图片 + string button_color = 10; //按钮颜色 + string wheel_text_color = 11; //转盘文字颜色 + } + message Child { + string hash_id = 1; //活动hash_id + int32 child_type = 2; //子活动类型 + } + message Config { + string rule_text_color = 1; //规则文字颜色 + string rule_bg_color = 2; //规则背景颜色 + string share_text = 3; //分享文案 + string share_img = 4; //分享图片 + int32 has_rank = 5; //是否展示中奖纪录(1-是,0-否) + string rank_background_color = 6; //排行榜背景颜色 + string rank_text_color = 7; //排行榜背景颜色 + string download_page_image = 8; //下载引导页的图片 + int32 is_default_download = 9; //是否使用默认下载图(1-是,0-否) + string wechat_page_image = 10; //微信引导页的图片 + int32 is_default_wechat = 11; //是否使用默认微信引导图(1-是,0-否) + string image_main = 12; //活动主图 + int32 is_default_main = 13; //是否使用默认活动主图(1-是,0-否) + string image_preview = 14; //问题页背景图 + string link_btn_text_color = 15; //分享链接按钮文字颜色 + string link_btn_bg_color = 16; //分享链接按钮背景颜色 + string link_text_color = 17; //分享链接文字颜色 + int32 show_share = 18; //是否显示分享社交媒体(0-否,1-是) + repeated int64 share = 19; //要分享的社交媒体,例如[1,2,3] + string play_rule = 20; //玩法规则 + string page_title = 21; //页面标题 + int32 dm_show = 22; //是否显示弹幕(0-否,1-是) + string web_bg_img = 23; //站外活动背景图 + int32 has_warm_up = 24; //是否预热(0-否,1-是) + string warm_up_img = 25; //预热海报图 + int32 warm_up_end = 26; //活动开始前多少分钟结束预热 + int32 icon_type = 27; //活动挂件类型(用于前端挂件选用判断) + string icon_bg_color = 28; //活动挂件背景色 + int32 dl_type = 29; //下载引导页类型(1-通用,2-自定义多媒体) + int32 dl_banner_type = 30; //下载页横幅类型(1-默认,2-自定义) + string dl_banner_img = 31; //下载页横幅自定义图 + string dl_banner_app_logo = 32; //下载页横幅applogo图片 + string dl_banner_app_name = 33; //下载页横幅app名称 + string dl_banner_app_btn = 34; //下载页横幅app按钮文案 + int32 dl_banner_position = 35; //下载页横幅位置(1-顶部,2-底部) + string topic_color = 36; //主题色 + int32 window_cover = 37; //是否显示弹幕(0-否,1-是) + repeated int32 icon_open = 38; //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3] + int32 has_white = 39; //是否开启白名单(0-否,1-是) + string white_list = 40; //白名单列表(多个用英文;分割) + string pc_bg = 41; //pc适配背景图 + int32 ads_type = 42; //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + string link_temp_id = 43; //链接模板id + int32 rule_time_open = 44; //是否展示规则中的活动时间(0-否,1-是) + int32 outside_task = 45; //是否外显任务(0-否,1-是) + string icon_text_color = 46; //活动挂件字体色 + int32 open_share = 47; //是否启用分享模块(0-否,1-是) + int32 show_to_use = 48; //是否展示奖品弹窗的去使用(0-不展示,1-展示) + int32 rule_type = 49; //规则展示类型(0-文本,1-图片) + string rule_img = 50; //规则展示图 + int32 rule_outside = 51; //规则是否外显(0-否,1-是) + int32 device_once = 52; //设备唯一(0-否,1-是) + } + message LongImg { + string img_url = 1; //图片地址 + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + int32 click_type = 4; //点击类型(1-整图点击,2-区域点击) + repeated HotZone hot_zone = 5; //点击区域 + int32 target_type = 6; //跳转目标(1-指定地址,2-活动) + int64 target_id = 7; //目标id + string pc_param = 8; //pc端的跳转参数 + } + message HotZone { + string web_url = 1; //Web端的跳转地址 + string app_param = 2; //App端的跳转参数 + double click_x = 3; //点击区域x + double click_y = 4; //点击区域y + double click_w = 5; //点击区域w + double click_h = 6; //点击区域h + int32 target_type = 7; //跳转目标(1-指定地址,2-活动) + int64 target_id = 8; //目标id + string pc_param = 9; //pc端的跳转参数 + } + message Target { + int32 target = 1; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + int32 option = 2; //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + int32 app_event = 3; //目标选择类型为1(option=1)的选项(1-安装;2-注册) + int32 both_type = 4; //满足条件(1-所有条件满足,2-任一条件满足) + repeated Cond cond = 5; //达标条件 + BothAll both_all = 6; //满足条件为所有条件满足要提交的数据 + NormalData normal_data = 7; //通用事件的数据 + } + message Cond { + string event = 1; //事件关键字 + string event_key = 2; //事件key + string event_val = 3; //事件值 + string desc = 4; //条件描述 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 task_limit = 6; //任务次数限制 + int32 chance = 7; //完成任务获得的数量(如:骰子数) + int32 trigger_type = 8; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 day_limit = 9; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 10; //限制的用户类型id集合 + int32 event_type = 11; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 12; //广告观看路径(1-APP内,2-APP外) + repeated string lang_marks = 13; //限制的语言集合 + int32 watch_sec = 14; //观看秒数 + int32 week_limit = 15; //广告观看次数 + int32 week_num = 16; //观看秒数 + int32 open_jump = 17; //开启活动跳转(0-否,1-是) + string web_url = 18; //web端url长度 + string extra_param = 19; //附加参数 + int32 go_show = 20; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 21; //策略id + int32 is_super = 22; //是否超级任务(0-否,1-是) + int32 has_pre = 23; //是否有前置条件(0-否,1-是) + int32 pre_cond = 24; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + int32 expired_min = 25; //过期分钟数 + Reward reward = 26; //奖品 + string prop_mark = 27; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + int32 sort = 28; //排序 + int32 open_push = 29; //是否开启完成推送(0-否,1-是) + string pc_param = 30; //pc端附加参数 + int32 award_mode = 31; //领奖模式(1-自动领奖,2-手动领奖) + string go_text = 32; //去完成文案 + int32 click_effect_open = 33; //是否开启点击有效(0-否,1-是) + int32 click_effect = 34; //点击有效值 + string click_effect_unit = 35; //点击有效单位(min-分钟,hour-小时,day-天) + string expired_day = 36; //过期天数 + int32 pull_invite = 37; //是否拉起邀请(0-否,1-是) + } + message BothAll { + int32 task_limit = 1; //任务次数限制 + int32 chance = 2; //完成任务获得的数量(如:骰子数) + int32 day_limit = 3; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 4; //限制的用户类型id集合 + repeated string lang_marks = 5; //限制的语言集合 + int32 week_limit = 6; //广告观看次数 + int32 week_num = 7; //观看秒数 + Reward reward = 8; //奖品 + string prop_mark = 9; //奖励的道具类型(chance-道具数量,reward-奖品) + string expired_day = 10; //过期天数 + } + message NormalData { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 chance = 2; //达标获得的数量(如:骰子数) + int32 chance_limit = 3; //最大获得数量(如:最大骰子数) + } + message TargetOption { + int32 target = 1; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Fixed fixed = 2; //固定事件 + Custom custom = 3; //自定义事件 + } + message Fixed { + int32 open = 1; //是否开启(0-否,1-是) + int32 app_event = 2; //固定事件类型(1-安装;2-注册) + int32 target_num = 3; //达标条件需要的新用户个数 + int32 chance = 4; //达标获得的数量(如:骰子数) + int32 chance_limit = 5; //最大获得数量(如:最大骰子数) + double percent = 6; //百分比值(如:获得的能量点) + } + message Custom { + int32 open = 1; //是否开启(0-否,1-是) + int32 both_type = 2; //满足条件(1-所有条件满足,2-任一条件满足) + repeated Cond cond = 3; //达标条件 + BothAll both_all = 4; //满足条件为所有条件满足要提交的数据 + int32 pre_event = 5; //自定义事件前置事件(0-任意事件;1-安装;2-注册) + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + message Reward { + int64 reward_id = 1; //奖品库的奖品id + int32 stock = 2; //奖品库存 + int32 invite_num = 3; //需要邀请的人数 + int32 reward_num = 4; //获得的奖品数量 + int32 is_thank = 5; //是否谢谢参与(0-否,1-是) + int32 score = 6; //领取奖品的分数 + int32 sign_day = 7; //签到天数 + int32 collect_num = 8; //收集碎片数 + int32 is_super = 9; //是否超级大奖(0-否,1-是) + int32 help = 10; //开启下载助力(0-否,1-是) + double help_percent = 11; //每个下载获得的进度比率 + int32 click = 12; //开启点击助力(0-否,1-是) + double click_percent = 13; //每个点击助力获得的进度比率 + double click_percent_limit = 14; //可获得的最大点击助力获得的进度比率 + int32 open = 15; //开启拉日活(0-否,1-是) + double open_percent = 16; //每个拉日活力获得的进度比率 + double open_percent_limit = 17; //可获得的最大拉日活获得的进度比率 + int32 odds = 18; //中奖率 + string jump_url = 19; //跳转地址 + int32 campaign_limit = 20; //活动内单个用户可获取该奖品次数 + int32 register = 21; //开启注册助力(0-否,1-是) + double register_percent = 22; //每个注册获得的进度比率 + double init_percent = 23; //初始助力进度 + CollectRule collect_rule = 24; //收集规则 + string expired_day = 25; //过期天数 + OpenAdd open_add = 26; //库存增加规则 + RewardTask reward_task = 27; //解锁任务 + } + message RewardTask { + int32 open = 1; //是否开启(0-否,1-是) + string event = 2; //事件关键字 + string event_key = 3; //事件key + string event_val = 4; //事件值 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 trigger_type = 6; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 event_type = 7; //事件来源(1-自定义事件,2-广告事件) + int32 open_push = 8; //是否开启完成推送(0-否,1-是) + } + message OpenAdd { + int32 open = 1; //开启动态库存规则(0-否,1-是) + int64 start = 2; //开始时间 + int64 end = 3; //结束时间 + int32 day_num = 4; //天数 + int32 day_add = 5; //增加的库存量 + } + message CollectRule { + int32 open = 1; //开启碎片规则(0-否,1-是) + int32 init_collect = 2; //初始的最大可获得碎片数 + int32 sign_day = 3; //签到天数 + int32 add_collect = 4; //完成条件可获得最大碎片数 + int32 reset_type = 5; //重置碎片规则(1-不重置,2-获奖后重置) + } + message Rewards { + int32 reward_group = 1; //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + repeated Reward normal = 2; //常规奖品 + UserLevel user_level = 3; //用户类型奖品 + repeated Lang langs = 4; //语言奖品 + repeated LangUserLevel lang_user_level = 5; //语言+用户类型奖品 + Country country = 6; //国家奖品 + } + message UserLevel { + int64 default_level_id = 1; //默认用户类型id + repeated UserLevelOne level_list = 2; //用户类型奖品 + } + message UserLevelOne { + int64 level_id = 1; //用户类型id + repeated Reward rewards = 2; //奖品 + } + message Lang { + string lang_mark = 1; //语言标识 + repeated Reward rewards = 2; //奖品 + } + message LangUserLevel { + string lang_mark = 1; //语言标识 + int64 default_level_id = 2; //默认用户类型id + repeated UserLevelOne level_list = 3; //用户类型奖品 + } + message Country { + string default_country_mark = 1; //默认国家 + repeated CountryOne country_list = 2; //国家的奖品 + } + message CountryOne { + string country_mark = 1; //国家标识 + repeated Reward rewards = 2; //奖品 + } + message QaQuestion { + string title = 1; //题目 + int32 score = 2; //得分 + repeated QaOption options = 3; //选项 + } + message QaOption { + string title = 1; //答案内容 + int32 is_right = 2; //是否正确答案(1-是,0-否) + } + message QuizOption { + string title = 1; //选项标题 + string img_url = 2; //选项图片 + int32 is_right = 3; //是否正确选项(1-是,0-否) + } + message Quiz { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 init_chance = 2; //初始答题机会次数 + int32 chance = 3; //达标获得的答题机会次数 + int32 reward_rule = 4; //奖励规则(1-投票结果排名,2-自定义竞猜结果) + int64 open_prize = 5; //开奖时间 + string title = 6; //选择标题 + repeated QuizOption options = 7; //有奖竞猜选项 + } + message QuestionAnswer { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 chance = 2; //达标条件后可获取的答题次数 + int32 init_chance = 3; //初始答题机会次数 + int32 question_ask_time = 4; //答题时间限制(单位:S,如:1 就是1秒) + repeated QaQuestion questions = 5; //题目 + string group_hash_id = 6; //题库对外id + int32 qa_num = 7; //题库选取数量 + int32 day_chance = 8; //每日签到获得的答题数 + int32 open_guide = 9; //是否开启引导(0-否,1-是) + string guide_group_hash_id = 10; //引导组hash_id + } + message LotteryConfig { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 init_chance = 2; //初始抽奖机会次数 + int32 chance = 3; //达标获得的抽奖机会次数 + int32 day_chance = 4; //每日获得的抽奖机会次数 + } + message InviteConfig { + int32 reward_limit = 1; //活动总奖励上限 + int32 reward_rule = 2; //用户奖励规则(1-阶梯,2-非阶梯) + int32 invite_limit = 3; //邀请超过多少人不能再获得奖励 + int32 newcomer_cond = 4; //新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + int32 step_loop = 5; //阶梯是否支持循环(0-不支持,1-支持) + } + message Sign { + int32 sign_type = 1; //签到类型(1-普通签到,2-阶梯签到) + int32 is_continue = 2; //是否连续签到(1-是,0-否) + int32 has_card = 3; //是否开启签到卡(1-开启,0-不开启) + int32 invite_num = 4; //邀请好友数可获得的1张签到卡 + int32 limit_card_num = 5; //可获得幸运卡的最大张数 + int32 is_loop = 6; //是否支持循环(0-否,1-是) + int32 sign_cycle = 7; //签到周期 + int32 recycle_type = 8; //重新签到模式(1-断签重签,2-周期重签) + string color = 9; //签到主题颜色 + } + message Dice { + int32 init_chance = 1; //初始骰子数 + int32 day_chance = 2; //每日获得的骰子数 + int32 fix_dice = 3; //开启固定骰子(0-不开启,1-开启) + int32 fix_dice_target = 4; //获得固定骰子需要邀请的人数 + int32 fix_dice_limit = 5; //固定骰子限制获取数 + string custom_dice = 6; //自定义骰子图片 + int32 open_map_point = 7; //开启自定义底座(0-不开启,1-开启) + MapPoint map_point = 8; //自定义底座数据 + int32 award_type = 9; //奖品碎片收集方式(1-随机收集,2-概率收集) + int32 open_invite = 10; //开启邀请挂件(0-关闭,1-开启) + int32 roll_again = 11; //开启再摇一次(0-关闭,1-开启) + int32 fix_dice_cond = 12; //邀请事件(1-安装,2-注册) + int32 odds = 13; //概率收集方式的中奖概率 + string play_img = 14; //play按钮图 + string cloud_img = 15; //云朵图 + } + message MapPoint { + string blank = 1; //空白底座 + string again = 2; //再摇一次底座 + string normal = 3; //普通奖品底座 + string supper = 4; //超级大奖底座 + } + message Grow { + int32 auto_hour = 1; //自动生产成长道具小时数 + int32 auto_num = 2; //生产的成长道具数 + int32 grow_num = 3; //邀请可获得的成长道具数量 + int32 target_num = 4; //获得成长道具需要邀请的人数 + int32 revive = 5; //是否支持复活(0-否,1-是) + int32 revive_num = 6; //复活需要邀请的好友数 + int32 die_hour = 7; //未获得成长道具导致的死亡时间 + repeated GrowStep steps = 8; //成长阶段 + int32 init_num = 9; //初始成长道具数量 + } + message GrowStep { + int32 num = 1; //需要的养成道具数量 + } + message Ballot { + int32 init_chance = 1; //初始抽签数 + int32 day_chance = 2; //每日获得的抽签数 + } + message Chop { + int32 show_bar = 1; //是否展示进度条(0-否,1-是) + } + message Cash { + int32 expired_day = 1; //任务重置天数 + int32 price = 2; //单位奖品总价值 + int32 price_num = 3; //奖品总份额 + int32 currency = 4; //货币id标识 + int32 loop_num = 5; //支持循环次数 + } + message Flip { + int32 init_chance = 1; //初始抽奖机会次数 + string card_img = 2; //卡牌图片 + int32 day_chance = 3; //每日获得的抽奖机会次数 + } + message Keep { + int32 collect = 1; //获得最终奖品需要的总收集数 + int32 collect_second = 2; //单个收集需要的二级资源数 + int32 open_invite = 3; //开启邀请(0-关闭,1-开启) + Invite invite = 4; //拉新配置 + int32 init_get = 5; //初始道具数 + double sec_get = 6; //每秒获得道具数 + int32 feed_num = 7; //每次使用道具数 + int32 feed_cycle = 8; //喂养周期(单位:天) + int32 max_feed = 9; //最大可领养次数 + int32 feed_get = 10; //喂养能得到的道具数 + int32 feed_get_num = 11; //得到喂养道具需要的喂养次数 + repeated Talk talk_text = 12; //对话文案 + repeated KeepStep steps = 13; //养成阶梯 + double sec_get_day_limit = 14; //每秒获得道具每日上限 + int32 machine_type = 15; //狗粮机类型(1-在线收益,2-离线收益) + int32 offline_min = 16; //离线分钟时长 + int32 offline_get = 17; //离线收益最大值 + int32 offline_limit = 18; //离线收益最大领取次数 + } + message Invite { + int32 invite_type = 1; //邀请类型(1-下载,2-安装) + int32 invite_get = 2; //邀请可获得的道具数量 + int32 reward_selected = 3; //选择礼品可获得的道具数 + int32 feed_third = 4; //喂养3次可获得的道具数 + int32 day_first_invite = 5; //是否开启每日首次拉新(0-否,1-是) + int32 day_first_get = 6; //每日首次拉新可获得的道具数 + int32 day_first_selected = 7; //每日首日选择礼物可获得的道具数 + int32 day_first_third = 8; //每日首次喂养三次可获得的道具数 + int32 invite_max_get = 9; //邀请人可获得的最大道具数 + } + message Talk { + int32 text_type = 1; //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + string content = 2; //内容 + } + message KeepStep { + int32 step = 1; //阶段 + int32 percent = 2; //对应的进度条数值 + int32 reward_type = 3; //奖品类型(1-成长道具,2-奖品) + Reward reward = 4; //奖品数据时 + int32 reward_num = 5; //发放道具数量 + } + message Push { + PushOne task_reset = 1; //重制提醒 + PushOne active = 2; //活跃提醒 + PushOne offline = 3; //离线提醒 + PushOne visit = 4; //访问提醒 + } + message PushOne { + int32 open = 1; //是否开启 + repeated PushCond push_cond = 2; //条件内容 + } + message PushCond { + string mark = 1; //条件标识 + string val = 2; //标识值 + } + message Gold { + int32 gold_num = 1; //任务重置天数 + int32 expired_day = 2; //任务重置天数 + double price = 3; //单位奖品总价值 + int32 price_num = 4; //奖品总份额 + int32 currency = 5; //货币id标识 + } + message Coin { + string coin_img = 1; //金币图片 + int32 open_days = 2; //开奖天数 + int32 open_limit = 3; //开奖次数限制 + int32 init_coin = 4; //初始金币数 + int32 init_use = 5; //初始投放次数 + int32 use_coin = 6; //单次投放消耗金币数 + int32 use_limit = 7; //单次瓜分最多投放次数 + int64 url_id = 8; //回调地址id + repeated int32 lack_btn = 9; //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2] + string custom_btn_text = 10; //自定义按钮文案 + string custom_web_url = 11; //自定义web端url + string custom_extra_param = 12; //自定义app附加参数 + string custom_pc_param = 13; //自定义pc附加参数 + } + string project_id = 1; //项目id + string template_id = 2; //模版id + int64 user_id = 3; //员工id + string title = 4; //活动标题 + int64 start_time = 5; //开始时间时间戳 + int64 end_time = 6; //结束时间时间戳 + string cover_url = 7; //活动封面图 + Config config = 8; //活动基础配置 + repeated KV campaign_data = 9; //前端组件位置偏移数据 + LotteryConfig prize_wheel = 10; //大转盘配置(大转盘玩法必传) + LotteryConfig slot = 11; //老虎机配置(老虎机玩法必传) + LotteryConfig blind = 12; //盲盒配置(盲盒玩法必传) + LotteryConfig grid = 13; //九宫格配置(九宫格玩法必传) + InviteConfig referral = 14; //老带新配置(老带新玩法必传) + QuestionAnswer question_answer = 15; //趣味问答配置(趣味问答玩法必传) + Quiz quiz = 16; //有奖竞猜配置(有奖竞猜玩法必传) + InviteConfig win = 17; //一起赢配置(一起赢玩法必传) + int32 t_offset = 18; //时间偏移量 + Target target = 19; //活动目标 + Sign sign = 20; //签到配置(签到玩法必传) + Dice dice = 21; //大富翁配置(大富翁玩法必传) + Grow grow = 22; //农场配置(农场玩法必传) + Ballot ballot = 23; //抽签配置(抽签玩法必传) + Chop chop = 24; //砍一刀配置(砍一刀玩法必传) + repeated KV delay_link_data = 25; //延迟深度链接自定义键值数据 + Rewards rewards = 26; //站内奖品 + repeated Reward rewards_web = 27; //站外奖品 + repeated Reward rewards_extra = 28; //额外奖品 + repeated Reward rewards_newcomer = 29; //新人奖 + TargetOption target_option = 30; //目标配置选项 + Cash cash = 31; //现金抽奖配置(现金抽奖玩法必传) + repeated LongImg long_imgs = 32; //长图配置 + Flip flip = 33; //翻牌配置(翻牌玩法必传) + string copy_campaign_id = 34; //复制的活动id + Keep keep_dog = 35; //养狗(养狗配置必传) + string ip = 36; //操作ip + Push push = 37; //推送配置 + repeated Child child = 38; //关联的子活动 + WheelStyle wheel_style = 39; //转盘自定义样式 + Gold gold = 40; //金币任务配置(金币任务玩法必传) + Coin coin = 41; //金币池配置(金币池玩法必传) + GridStyle grid_style = 42; //九宫格自定义样式 + FlipStyle flip_style = 43; //翻牌自定义样式 + PointsUse points_use = 44; //积分消耗 + Chat chat = 45; //ai陪伴 + Vs vs = 46; //赛事竞猜配置(赛事竞猜玩法必传) + Uno uno = 47; //uno卡牌配置(uno卡牌玩法必传) + Event event = 48; //事件配置(活动事件) + LotteryConfig gashapon = 49; //扭蛋机配置(扭蛋机玩法必传) + GashaponStyle gashapon_style = 50; //扭蛋机自定义样式 +} + +message StoreRes { + int64 id = 1; //id + string hash_id = 2; //活动id +} + +message UpdateReq { + message GashaponStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string machine_img = 4; //机器图 + string play_img = 5; //Go按钮图 + int32 egg_type = 6; //类型 + repeated string egg_imgs = 7; //扭蛋素材 + } + message Event { + EventOne first_visit = 1; //首次访问 + } + message EventOne { + int32 open = 1; //是否开启 + repeated EventReward rewards = 2; //奖励 + } + message EventReward { + int64 id = 1; //id + string prop_mark = 2; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward reward = 3; //奖品 + int32 chance = 4; //道具数量 + string expired_day = 5; //过期天数 + } + message Uno { + int32 init_chance = 1; //初始抽奖次数 + repeated string prop_marks = 2; //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌) + UnoGroup red = 3; //红牌配置 + UnoGroup yellow = 4; //黄牌配置 + UnoGroup blue = 5; //黑牌配置 + UnoGroup green = 6; //绿牌配置 + } + message UnoGroup { + int64 id = 1; //牌型id + string odds = 2; //获得牌型概率 + Reward reward = 3; //奖品 + int32 open_rule = 4; //是否开启得牌规则(0-否,1-是) + UnoLimitRule limit_rule = 5; //得牌规则 + int32 custom_card = 6; //自定义卡牌(0-否,1-是) + repeated UnoCard cards = 7; //自定义卡牌 + } + message UnoLimitRule { + int32 init_num = 1; //初始的最大可获得牌型数 + int32 sign_day = 2; //签到天数 + int32 add_num = 3; //完成条件可获得最大牌型数 + int32 reset_type = 4; //重置规则(1-不重置,2-获奖后重置) + } + message UnoCard { + int64 id = 1; //牌id + string title = 2; //跳转按钮文案 + string img_url = 3; //图片地址 + string web_url = 4; //Web跳转地址 + string app_param = 5; //App跳转参数 + string pc_param = 6; //pc跳转参数 + } + message Vs { + int32 init_chance = 1; //初始投票次数 + int32 each_limit_num = 2; //每场可投票次数 + int32 open_point = 3; //是否开启积分(0-否,1-是) + int32 points_num = 4; //投票扣除积分数 + int32 mall_open = 5; //是否使用积分商城(0-否,1-是) + int64 mall_id = 6; //兑换商城id + int32 vs_tz = 7; //比赛时区 + int32 claim_type = 8; //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + repeated Schedule schedules = 9; //赛事时间表 + string icon_mall = 10; //商城图标 + string icon_reward = 11; //奖励记录图标 + string icon_schedule = 12; //赛程图标 + } + message Schedule { + repeated PkTeam pk_teams = 1; //队伍 + } + message PkTeam { + int64 id = 1; //赛程id + repeated Team teams = 2; //队伍 + string vote_start = 3; //开始时间 + string vote_end = 4; //结束时间 + string vs_date = 5; //比赛开始时间 + string vs_img = 6; //比赛图 + string desc = 7; //标题描述 + string prop_mark = 8; //奖励的道具类型(reward-奖品,point-积分) + int64 reward_id = 9; //奖品库奖品id + int32 prop_num = 10; //道具数量 + string expired_day = 11; //过期天数 + repeated string other_vote = 12; //其他投票方式 + int32 open_odds = 13; //是否开启赔率(0-否,1-是) + string odds_left = 14; //左边赔率 + string odds_right = 15; //右边赔率 + string odds_draw = 16; //平局赔率 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + message Chat { + int32 open = 1; //开启ai陪伴(0-关闭,1-开启) + string header_img = 2; //宠物头像 + string chat_bg = 3; //聊天背景 + int32 day_limit = 4; //每日聊天上限 + } + message PointsUse { + int32 open = 1; //是否开启积分消耗(0-否,1-是) + string icon = 2; //积分icon图 + int64 url_id = 3; //回调地址id + int32 use_num = 4; //单次兑换使用积分数量 + int32 day_limit = 5; //每日可兑换次数 + int32 total_limit = 6; //总兑换次数 + } + message FlipStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string button_color = 4; //按钮颜色 + string play_img = 5; //Go按钮图 + string card_img = 6; //卡片素材 + } + message GridStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string button_color = 4; //按钮颜色 + string play_img = 5; //Go按钮图 + string disable_play_img = 6; //Go按钮禁用 + string machine_img = 7; //机器图 + string grid_img = 8; //方格图 + string activate_img = 9; //方格激活图 + } + message WheelStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string bottom1 = 4; //底部颜色1 + string bottom2 = 5; //底部颜色2 + string bottom3 = 6; //底部颜色3 + string pointer = 7; //指针图片 + string play_btn = 8; //玩法按钮图片 + string border_img = 9; //边框图片 + string button_color = 10; //按钮颜色 + string wheel_text_color = 11; //转盘文字颜色 + } + message Child { + string hash_id = 1; //活动hash_id + int32 child_type = 2; //子活动类型 + } + message Config { + string rule_text_color = 1; //规则文字颜色 + string rule_bg_color = 2; //规则背景颜色 + string share_text = 3; //分享文案 + string share_img = 4; //分享图片 + int32 has_rank = 5; //是否展示中奖纪录(1-是,0-否) + string rank_background_color = 6; //排行榜背景颜色 + string rank_text_color = 7; //排行榜背景颜色 + string download_page_image = 8; //下载引导页的图片 + int32 is_default_download = 9; //是否使用默认下载图(1-是,0-否) + string wechat_page_image = 10; //微信引导页的图片 + int32 is_default_wechat = 11; //是否使用默认微信引导图(1-是,0-否) + string image_main = 12; //活动主图 + int32 is_default_main = 13; //是否使用默认活动主图(1-是,0-否) + string image_preview = 14; //问题页背景图 + string link_btn_text_color = 15; //分享链接按钮文字颜色 + string link_btn_bg_color = 16; //分享链接按钮背景颜色 + string link_text_color = 17; //分享链接文字颜色 + int32 show_share = 18; //是否显示分享社交媒体(0-否,1-是) + repeated int64 share = 19; //要分享的社交媒体,例如[1,2,3] + string play_rule = 20; //玩法规则 + string page_title = 21; //页面标题 + int32 dm_show = 22; //是否显示弹幕(0-否,1-是) + string web_bg_img = 23; //站外活动背景图 + int32 has_warm_up = 24; //是否预热(0-否,1-是) + string warm_up_img = 25; //预热海报图 + int32 warm_up_end = 26; //活动开始前多少分钟结束预热 + int32 icon_type = 27; //活动挂件类型(用于前端挂件选用判断) + string icon_bg_color = 28; //活动挂件背景色 + int32 dl_type = 29; //下载引导页类型(1-通用,2-自定义多媒体) + int32 dl_banner_type = 30; //下载页横幅类型(1-默认,2-自定义) + string dl_banner_img = 31; //下载页横幅自定义图 + string dl_banner_app_logo = 32; //下载页横幅applogo图片 + string dl_banner_app_name = 33; //下载页横幅app名称 + string dl_banner_app_btn = 34; //下载页横幅app按钮文案 + int32 dl_banner_position = 35; //下载页横幅位置(1-顶部,2-底部) + string topic_color = 36; //主题色 + int32 window_cover = 37; //是否显示弹幕(0-否,1-是) + repeated int32 icon_open = 38; //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3] + int32 has_white = 39; //是否开启白名单(0-否,1-是) + string white_list = 40; //白名单列表(多个用英文;分割) + string pc_bg = 41; //pc适配背景图 + int32 ads_type = 42; //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + repeated int64 level_ids = 43; //限制的用户类型id集合 + string link_temp_id = 44; //链接模板id + int32 rule_time_open = 45; //是否展示规则中的活动时间(0-否,1-是) + int32 outside_task = 46; //是否外显任务(0-否,1-是) + string icon_text_color = 47; //活动挂件字体色 + int32 open_share = 48; //是否启用分享模块(0-否,1-是) + int32 show_to_use = 49; //是否展示奖品弹窗的去使用(0-不展示,1-展示) + int32 rule_type = 50; //规则展示类型(0-文本,1-图片) + string rule_img = 51; //规则展示图 + int32 rule_outside = 52; //规则是否外显(0-否,1-是) + int32 device_once = 53; //设备唯一(0-否,1-是) + } + message LongImg { + string img_url = 1; //图片地址 + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + int64 id = 4; //长图id + int32 click_type = 5; //点击类型(1-整图点击,2-区域点击) + repeated HotZone hot_zone = 6; //点击区域 + int32 target_type = 7; //跳转目标(1-指定地址,2-活动) + int64 target_id = 8; //目标id + string pc_param = 9; //pc端的跳转参数 + } + message HotZone { + int64 id = 1; //热区id + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + double click_x = 4; //点击区域x + double click_y = 5; //点击区域y + double click_w = 6; //点击区域w + double click_h = 7; //点击区域h + int32 target_type = 8; //跳转目标(1-指定地址,2-活动) + int64 target_id = 9; //目标id + string pc_param = 10; //pc端的跳转参数 + } + message Target { + int32 target = 1; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + int32 option = 2; //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + int32 app_event = 3; //目标选择类型为1(option=1)的选项(1-安装;2-注册) + int32 both_type = 4; //满足条件(1-所有条件满足,2-任一条件满足) + repeated Cond cond = 5; //达标条件 + BothAll both_all = 6; //满足条件为所有条件满足要提交的数据 + NormalData normal_data = 7; //通用事件的数据 + } + message Cond { + int64 id = 1; //条件id + string event = 2; //事件关键字 + string event_key = 3; //事件key + string event_val = 4; //事件值 + string desc = 5; //条件描述 + int32 if_cond = 6; //等式(0-等于,1-大于等于,2-累计) + int32 task_limit = 7; //任务次数限制 + int32 chance = 8; //完成任务获得的数量(如:骰子数) + int32 trigger_type = 9; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 day_limit = 10; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 11; //限制的用户类型id集合 + int32 event_type = 12; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 13; //广告观看路径(1-APP内,2-APP外) + repeated string lang_marks = 14; //限制的语言集合 + int32 watch_sec = 15; //观看秒数 + int32 week_limit = 16; //广告观看次数 + int32 week_num = 17; //观看秒数 + int32 open_jump = 18; //开启活动跳转(0-否,1-是) + string web_url = 19; //web端url长度 + string extra_param = 20; //附加参数 + int32 go_show = 21; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 22; //策略id + int32 is_super = 23; //是否超级任务(0-否,1-是) + int32 has_pre = 24; //是否有前置条件(0-否,1-是) + int32 pre_cond = 25; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + int32 expired_min = 26; //过期分钟数 + Reward reward = 27; //奖品 + string prop_mark = 28; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + int32 sort = 29; //排序 + int32 open_push = 30; //是否开启完成推送(0-否,1-是) + string pc_param = 31; //pc端附加参数 + int32 award_mode = 32; //领奖模式(1-自动领奖,2-手动领奖) + string go_text = 33; //去完成文案 + int32 click_effect_open = 34; //是否开启点击有效(0-否,1-是) + int32 click_effect = 35; //点击有效值 + string click_effect_unit = 36; //点击有效单位(min-分钟,hour-小时,day-天) + string expired_day = 37; //过期天数 + int32 pull_invite = 38; //是否拉起邀请(0-否,1-是) + } + message BothAll { + int32 task_limit = 1; //任务次数限制 + int32 chance = 2; //完成任务获得的数量(如:骰子数) + int32 day_limit = 3; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 4; //限制的用户类型id集合 + repeated string lang_marks = 5; //限制的语言集合 + int32 week_limit = 6; //广告观看次数 + int32 week_num = 7; //观看秒数 + Reward reward = 8; //奖品 + string prop_mark = 9; //奖励的道具类型(chance-道具数量,reward-奖品) + string expired_day = 10; //过期天数 + } + message NormalData { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 chance = 2; //达标获得的数量(如:骰子数) + int32 chance_limit = 3; //最大获得数量(如:最大骰子数) + } + message TargetOption { + int32 target = 1; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Fixed fixed = 2; //固定事件 + Custom custom = 3; //自定义事件 + } + message Fixed { + int32 open = 1; //是否开启(0-否,1-是) + int32 app_event = 2; //固定事件类型(1-安装;2-注册) + int32 target_num = 3; //达标条件需要的新用户个数 + int32 chance = 4; //达标获得的数量(如:骰子数) + int32 chance_limit = 5; //最大获得数量(如:最大骰子数) + double percent = 6; //百分比值(如:获得的能量点) + } + message Custom { + int32 open = 1; //是否开启(0-否,1-是) + int32 both_type = 2; //满足条件(1-所有条件满足,2-任一条件满足) + repeated Cond cond = 3; //达标条件 + BothAll both_all = 4; //满足条件为所有条件满足要提交的数据 + int32 pre_event = 5; //自定义事件前置事件(0-任意事件;1-安装;2-注册) + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + message Reward { + int64 id = 1; //活动奖品id + int64 reward_id = 2; //奖品库的奖品id + int32 stock = 3; //奖品库存 + int32 invite_num = 4; //需要邀请的人数 + int32 reward_num = 5; //获得的奖品数量 + int32 is_thank = 6; //是否谢谢参与(0-否,1-是) + int32 score = 7; //领取奖品的分数 + int32 sign_day = 8; //签到天数 + int32 collect_num = 9; //收集碎片数 + int32 is_super = 10; //是否超级大奖(0-否,1-是) + int32 help = 11; //开启下载助力(0-否,1-是) + double help_percent = 12; //每个下载获得的进度比率 + int32 click = 13; //开启点击助力(0-否,1-是) + double click_percent = 14; //每个点击助力获得的进度比率 + double click_percent_limit = 15; //可获得的最大点击助力获得的进度比率 + int32 open = 16; //开启拉日活(0-否,1-是) + double open_percent = 17; //每个拉日活力获得的进度比率 + double open_percent_limit = 18; //可获得的最大拉日活获得的进度比率 + int32 odds = 19; //中奖率 + string jump_url = 20; //跳转地址 + int32 campaign_limit = 21; //活动内单个用户可获取该奖品次数 + int32 register = 22; //开启注册助力(0-否,1-是) + double register_percent = 23; //每个注册获得的进度比率 + double init_percent = 24; //初始助力进度 + CollectRule collect_rule = 25; //收集规则 + string expired_day = 26; //过期天数 + OpenAdd open_add = 27; //库存增加规则 + RewardTask reward_task = 28; //解锁任务 + } + message RewardTask { + int32 open = 1; //是否开启(0-否,1-是) + string event = 2; //事件关键字 + string event_key = 3; //事件key + string event_val = 4; //事件值 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 trigger_type = 6; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 event_type = 7; //事件来源(1-自定义事件,2-广告事件) + int32 open_push = 8; //是否开启完成推送(0-否,1-是) + } + message OpenAdd { + int32 open = 1; //开启动态库存规则(0-否,1-是) + int64 start = 2; //开始时间 + int64 end = 3; //结束时间 + int32 day_num = 4; //天数 + int32 day_add = 5; //增加的库存量 + } + message CollectRule { + int32 open = 1; //开启碎片规则(0-否,1-是) + int32 init_collect = 2; //初始的最大可获得碎片数 + int32 sign_day = 3; //签到天数 + int32 add_collect = 4; //完成条件可获得最大碎片数 + int32 reset_type = 5; //重置碎片规则(1-不重置,2-获奖后重置) + } + message Rewards { + int32 reward_group = 1; //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + repeated Reward normal = 2; //常规奖品 + UserLevel user_level = 3; //用户类型奖品 + repeated Lang langs = 4; //语言奖品 + repeated LangUserLevel lang_user_level = 5; //语言+用户类型奖品 + Country country = 6; //国家奖品 + } + message UserLevel { + int64 default_level_id = 1; //默认用户类型id + repeated UserLevelOne level_list = 2; //用户类型奖品 + } + message UserLevelOne { + int64 level_id = 1; //用户类型id + repeated Reward rewards = 2; //奖品 + } + message Lang { + string lang_mark = 1; //语言标识 + repeated Reward rewards = 2; //奖品 + } + message LangUserLevel { + string lang_mark = 1; //语言标识 + int64 default_level_id = 2; //默认用户类型id + repeated UserLevelOne level_list = 3; //用户类型奖品 + } + message Country { + string default_country_mark = 1; //默认国家 + repeated CountryOne country_list = 2; //国家的奖品 + } + message CountryOne { + string country_mark = 1; //国家标识 + repeated Reward rewards = 2; //奖品 + } + message QaQuestion { + int64 id = 1; //题目id + string title = 2; //题目 + int32 score = 3; //得分 + repeated QaOption options = 4; //选项 + } + message QaOption { + int64 id = 1; //答案id + string title = 2; //答案内容 + int32 is_right = 3; //是否正确答案(1-是,0-否) + } + message QuizOption { + int64 id = 1; //选项id + string title = 2; //选项标题 + string img_url = 3; //选项图片 + int32 is_right = 4; //是否正确选项(1-是,0-否) + } + message Quiz { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 init_chance = 2; //初始答题机会次数 + int32 chance = 3; //达标获得的答题机会次数 + int32 reward_rule = 4; //奖励规则(1-投票结果排名,2-自定义竞猜结果) + int64 open_prize = 5; //开奖时间 + string title = 6; //选项标题 + repeated QuizOption options = 7; //有奖竞猜选项 + } + message QuestionAnswer { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 chance = 2; //达标条件后可获取的答题次数 + int32 init_chance = 3; //初始答题机会次数 + int32 question_ask_time = 4; //答题时间限制(单位:S,如:1 就是1秒) + repeated QaQuestion questions = 5; //题目 + string group_hash_id = 6; //题库对外id + int32 qa_num = 7; //题库选取数量 + int32 day_chance = 8; //每日签到获得的答题数 + int32 open_guide = 9; //是否开启引导(0-否,1-是) + string guide_group_hash_id = 10; //引导组hash_id + } + message LotteryConfig { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 init_chance = 2; //初始抽奖机会次数 + int32 chance = 3; //达标获得的抽奖机会次数 + int32 day_chance = 4; //每日获得的抽奖机会次数 + } + message InviteConfig { + int32 reward_limit = 1; //活动总奖励上限 + int32 reward_rule = 2; //用户奖励规则(1-阶梯,2-非阶梯) + int32 invite_limit = 3; //邀请超过多少人不能再获得奖励 + int32 newcomer_cond = 4; //新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + int32 step_loop = 5; //阶梯是否支持循环(0-不支持,1-支持) + } + message Sign { + int32 sign_type = 1; //签到类型(1-普通签到,2-阶梯签到) + int32 is_continue = 2; //是否连续签到(1-是,0-否) + int32 has_card = 3; //是否开启签到卡(1-开启,0-不开启) + int32 invite_num = 4; //邀请好友数可获得的1张签到卡 + int32 limit_card_num = 5; //可获得幸运卡的最大张数 + int32 is_loop = 6; //是否支持循环(0-否,1-是) + int32 sign_cycle = 7; //签到周期 + int32 recycle_type = 8; //重新签到模式(1-断签重签,2-周期重签) + string color = 9; //签到主题颜色 + } + message Dice { + int32 init_chance = 1; //初始骰子数 + int32 day_chance = 2; //每日获得的骰子数 + int32 fix_dice = 3; //开启固定骰子(0-不开启,1-开启) + int32 fix_dice_target = 4; //获得固定骰子需要邀请的人数 + int32 fix_dice_limit = 5; //固定骰子限制获取数 + string custom_dice = 6; //自定义骰子图片 + int32 open_map_point = 7; //开启自定义底座(0-不开启,1-开启) + MapPoint map_point = 8; //自定义底座数据 + int32 award_type = 9; //奖品碎片收集方式(1-随机收集,2-概率收集) + int32 open_invite = 10; //开启邀请挂件(0-关闭,1-开启) + int32 roll_again = 11; //开启再摇一次(0-关闭,1-开启) + int32 fix_dice_cond = 12; //邀请事件(1-安装,2-注册) + int32 odds = 13; //概率收集方式的中奖概率 + string play_img = 14; //play按钮图 + string cloud_img = 15; //云朵图 + } + message MapPoint { + string blank = 1; //空白底座 + string again = 2; //再摇一次底座 + string normal = 3; //普通奖品底座 + string supper = 4; //超级大奖底座 + } + message Grow { + int32 auto_hour = 1; //自动生产成长道具小时数 + int32 auto_num = 2; //生产的成长道具数 + int32 grow_num = 3; //邀请可获得的成长道具数量 + int32 target_num = 4; //获得成长道具需要邀请的人数 + int32 revive = 5; //是否支持复活(0-否,1-是) + int32 revive_num = 6; //复活需要邀请的好友数 + int32 die_hour = 7; //未获得成长道具导致的死亡时间 + repeated GrowStep steps = 8; //成长阶段 + int32 init_num = 9; //初始成长道具数量 + } + message GrowStep { + int64 id = 1; //奖品id + int32 num = 2; //需要的养成道具数量 + } + message Ballot { + int32 init_chance = 1; //初始抽签数 + int32 day_chance = 2; //每日获得的抽签数 + } + message Chop { + int32 show_bar = 1; //是否展示进度条(0-否,1-是) + } + message Cash { + int32 expired_day = 1; //任务重置天数 + int32 price = 2; //单位奖品总价值 + int32 price_num = 3; //奖品总份额 + int32 currency = 4; //货币id标识 + int32 loop_num = 5; //支持循环次数 + } + message Flip { + int32 init_chance = 1; //初始抽奖机会次数 + string card_img = 2; //卡牌图片 + int32 day_chance = 3; //每日获得的抽奖机会次数 + } + message Keep { + int32 collect = 1; //获得最终奖品需要的总收集数 + int32 collect_second = 2; //单个收集需要的二级资源数 + int32 open_invite = 3; //开启邀请(0-关闭,1-开启) + Invite invite = 4; //拉新配置 + int32 init_get = 5; //初始道具数 + double sec_get = 6; //每秒获得道具数 + int32 feed_num = 7; //每次使用道具数 + int32 feed_cycle = 8; //喂养周期(单位:天) + int32 max_feed = 9; //最大可领养次数 + int32 feed_get = 10; //喂养能得到的道具数 + int32 feed_get_num = 11; //得到喂养道具需要的喂养次数 + repeated Talk talk_text = 12; //对话文案 + repeated KeepStep steps = 13; //养成阶梯 + double sec_get_day_limit = 14; //每秒获得道具每日上限 + int32 machine_type = 15; //狗粮机类型(1-在线收益,2-离线收益) + int32 offline_min = 16; //离线分钟时长 + int32 offline_get = 17; //离线收益最大值 + int32 offline_limit = 18; //离线收益最大领取次数 + } + message Invite { + int32 invite_type = 1; //邀请类型(1-下载,2-安装) + int32 invite_get = 2; //邀请可获得的道具数量 + int32 reward_selected = 3; //选择礼品可获得的道具数 + int32 feed_third = 4; //喂养3次可获得的道具数 + int32 day_first_invite = 5; //是否开启每日首次拉新(0-否,1-是) + int32 day_first_get = 6; //每日首次拉新可获得的道具数 + int32 day_first_selected = 7; //每日首日选择礼物可获得的道具数 + int32 day_first_third = 8; //每日首次喂养三次可获得的道具数 + int32 invite_max_get = 9; //邀请人可获得的最大道具数 + } + message Talk { + int32 text_type = 1; //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + string content = 2; //内容 + } + message KeepStep { + int32 step = 1; //阶段 + int32 percent = 2; //对应的进度条数值 + int32 reward_type = 3; //奖品类型(1-成长道具,2-奖品) + Reward reward = 4; //奖品数据时 + int32 reward_num = 5; //发放道具数量 + } + message Push { + PushOne task_reset = 1; //重制提醒 + PushOne active = 2; //活跃提醒 + PushOne offline = 3; //离线提醒 + PushOne visit = 4; //访问提醒 + } + message PushOne { + int32 open = 1; //是否开启 + repeated PushCond push_cond = 2; //条件内容 + } + message PushCond { + string mark = 1; //条件标识 + string val = 2; //标识值 + } + message Gold { + int32 gold_num = 1; //任务重置天数 + int32 expired_day = 2; //任务重置天数 + double price = 3; //单位奖品总价值 + int32 price_num = 4; //奖品总份额 + int32 currency = 5; //货币id标识 + } + message Coin { + string coin_img = 1; //金币图片 + int32 open_days = 2; //开奖天数 + int32 open_limit = 3; //开奖次数限制 + int32 init_coin = 4; //初始金币数 + int32 init_use = 5; //初始投放次数 + int32 use_coin = 6; //单次投放消耗金币数 + int32 use_limit = 7; //单次瓜分最多投放次数 + int64 url_id = 8; //回调地址id + repeated int32 lack_btn = 9; //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2] + string custom_btn_text = 10; //自定义按钮文案 + string custom_web_url = 11; //自定义web端url + string custom_extra_param = 12; //自定义app附加参数 + string custom_pc_param = 13; //自定义pc附加参数 + } + int64 id = 1; //id + string hash_id = 2; //活动id + string title = 3; //活动标题 + int64 start_time = 4; //开始时间时间戳 + int64 end_time = 5; //结束时间时间戳 + string cover_url = 6; //活动封面图 + Config config = 7; //活动基础配置 + repeated KV campaign_data = 8; //前端组件位置偏移数据 + LotteryConfig prize_wheel = 9; //大转盘配置(大转盘玩法必传) + LotteryConfig slot = 10; //老虎机配置(老虎机玩法必传) + LotteryConfig blind = 11; //盲盒配置(盲盒玩法必传) + LotteryConfig grid = 12; //九宫格配置(九宫格玩法必传) + InviteConfig referral = 13; //老带新配置(老带新玩法必传) + QuestionAnswer question_answer = 14; //趣味问答配置(趣味问答玩法必传) + Quiz quiz = 15; //有奖竞猜配置(有奖竞猜玩法必传) + InviteConfig win = 16; //一起赢配置(一起赢玩法必传) + int32 t_offset = 17; //时间偏移量 + Target target = 18; //活动目标 + Sign sign = 19; //签到配置(签到玩法必传) + Dice dice = 20; //大富翁配置(大富翁玩法必传) + Grow grow = 21; //农场配置(农场玩法必传) + Ballot ballot = 22; //抽签配置(抽签玩法必传) + Chop chop = 23; //砍一刀配置(砍一刀玩法必传) + repeated KV delay_link_data = 24; //延迟深度链接自定义键值数据 + Rewards rewards = 25; //站内奖品 + repeated Reward rewards_web = 26; //站外奖品 + repeated Reward rewards_extra = 27; //额外奖品 + repeated Reward rewards_newcomer = 28; //新人奖 + int64 user_id = 29; //id + string ip = 30; //操作ip + TargetOption target_option = 31; //目标配置选项 + Cash cash = 32; //现金抽奖配置(现金抽奖玩法必传) + repeated LongImg long_imgs = 33; //长图配置 + Flip flip = 34; //翻牌配置(翻牌玩法必传) + Keep keep_dog = 35; //养狗(养狗配置必传) + Push push = 36; //推送配置 + repeated Child child = 37; //关联的子活动 + WheelStyle wheel_style = 38; //转盘自定义样式 + Gold gold = 39; //金币任务配置(金币任务玩法必传) + Coin coin = 40; //金币池配置(金币池玩法必传) + GridStyle grid_style = 41; //九宫格自定义样式 + FlipStyle flip_style = 42; //翻牌自定义样式 + PointsUse points_use = 43; //积分消耗 + Chat chat = 44; //ai陪伴 + Vs vs = 45; //赛事竞猜配置(赛事竞猜玩法必传) + Uno uno = 46; //uno卡牌配置(uno卡牌玩法必传) + Event event = 47; //事件配置(活动事件) + LotteryConfig gashapon = 48; //扭蛋机配置(扭蛋机玩法必传) + GashaponStyle gashapon_style = 49; //扭蛋机自定义样式 +} + +message UpdateRes { + int64 id = 1; //id + string hash_id = 2; //活动id + bool add_task = 3; //新加了任务 +} + +message ShowReq { + int64 id = 1; //活动gid + string hash_id = 2; //活动hash_id + bool not_reward = 3; //不需要奖品 +} + +message ShowRes { + message GashaponStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string machine_img = 4; //机器图 + string play_img = 5; //Go按钮图 + int32 egg_type = 6; //类型 + repeated string egg_imgs = 7; //扭蛋素材 + } + message Event { + EventOne first_visit = 1; //首次访问 + } + message EventOne { + int32 open = 1; //是否开启 + repeated EventReward rewards = 2; //奖励 + } + message EventReward { + int64 id = 1; //id + string prop_mark = 2; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward reward = 3; //奖品 + int32 chance = 4; //道具数量 + string expired_day = 5; //过期天数 + } + message Uno { + int32 init_chance = 1; //初始抽奖次数 + repeated string prop_marks = 2; //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌) + UnoGroup red = 3; //红牌配置 + UnoGroup yellow = 4; //黄牌配置 + UnoGroup blue = 5; //黑牌配置 + UnoGroup green = 6; //绿牌配置 + } + message UnoGroup { + int64 id = 1; //牌型id + string odds = 2; //获得牌型概率 + Reward reward = 3; //奖品 + int32 open_rule = 4; //是否开启得牌规则(0-否,1-是) + UnoLimitRule limit_rule = 5; //得牌规则 + int32 custom_card = 6; //自定义卡牌(0-否,1-是) + repeated UnoCard cards = 7; //自定义卡牌 + } + message UnoLimitRule { + int32 init_num = 1; //初始的最大可获得牌型数 + int32 sign_day = 2; //签到天数 + int32 add_num = 3; //完成条件可获得最大牌型数 + int32 reset_type = 4; //重置规则(1-不重置,2-获奖后重置) + } + message UnoCard { + int64 id = 1; //牌id + string title = 2; //跳转按钮文案 + string img_url = 3; //图片地址 + string web_url = 4; //Web跳转地址 + string app_param = 5; //App跳转参数 + string pc_param = 6; //pc跳转参数 + int32 card_no = 7; //牌号 + } + message Vs { + int32 init_chance = 1; //初始投票次数 + int32 each_limit_num = 2; //每场可投票次数 + int32 open_point = 3; //是否开启积分(0-否,1-是) + int32 points_num = 4; //投票扣除积分数 + int32 mall_open = 5; //是否使用积分商城(0-否,1-是) + int64 mall_id = 6; //兑换商城id + int32 vs_tz = 7; //比赛时区 + int32 claim_type = 8; //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖) + repeated Schedule schedules = 9; //赛事时间表 + string icon_mall = 10; //商城图标 + string icon_reward = 11; //奖励记录图标 + string icon_schedule = 12; //赛程图标 + } + message Schedule { + int32 id = 1; //id + repeated PkTeam pk_teams = 2; //队伍 + } + message PkTeam { + int64 id = 1; //赛程id + repeated Team teams = 2; //队伍 + int64 vote_start = 3; //开始时间 + int64 vote_end = 4; //结束时间 + int64 vs_at = 5; //比赛开始时间 + string vs_img = 6; //比赛图 + string desc = 7; //标题描述 + string prop_mark = 8; //奖励的道具类型(reward-奖品,point-积分) + int64 reward_id = 9; //奖品库奖品id + int32 prop_num = 10; //道具数量 + string expired_day = 11; //过期天数 + int32 is_settlement = 12; //是否结算(0-否,1-是) + repeated string other_vote = 13; //其他投票方式 + int32 open_odds = 14; //是否开启赔率(0-否,1-是) + string odds_left = 15; //左边赔率 + string odds_right = 16; //右边赔率 + string odds_draw = 17; //平局赔率 + int32 status = 18; //投票状态(1-即将投票,2-投票中,3-待结算,4-已结算) + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + message Chat { + int32 open = 1; //开启ai陪伴(0-关闭,1-开启) + string header_img = 2; //宠物头像 + string chat_bg = 3; //聊天背景 + int32 day_limit = 4; //每日聊天上限 + } + message PointsUse { + int32 open = 1; //是否开启积分消耗(0-否,1-是) + string icon = 2; //积分icon图 + int64 url_id = 3; //回调地址id + int32 use_num = 4; //单次兑换使用积分数量 + int32 day_limit = 5; //每日可兑换次数 + int32 total_limit = 6; //总兑换次数 + } + message FlipStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string button_color = 4; //按钮颜色 + string play_img = 5; //Go按钮图 + string card_img = 6; //卡片素材 + } + message GridStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string button_color = 4; //按钮颜色 + string play_img = 5; //Go按钮图 + string disable_play_img = 6; //Go按钮禁用 + string machine_img = 7; //机器图 + string grid_img = 8; //方格图 + string activate_img = 9; //方格激活图 + } + message WheelStyle { + string topic_mark = 1; //主题标识 + string main_img = 2; //活动背景图 + string bg_color = 3; //背景颜色 + string bottom1 = 4; //底部颜色1 + string bottom2 = 5; //底部颜色2 + string bottom3 = 6; //底部颜色3 + string pointer = 7; //指针图片 + string play_btn = 8; //玩法按钮图片 + string border_img = 9; //边框图片 + string button_color = 10; //按钮颜色 + string wheel_text_color = 11; //转盘文字颜色 + } + message Child { + string hash_id = 1; //活动hash_id + int32 child_type = 2; //子活动类型 + } + message Share { + int64 id = 1; //活动ID + string title = 2; //标题 + string logo = 3; //图标 + string scheme = 4; //Scheme + string ios_scheme = 5; //ios Scheme + } + message Config { + string rule_text_color = 1; //规则文字颜色 + string rule_bg_color = 2; //规则背景颜色 + string share_text = 3; //分享文案 + string share_img = 4; //分享图片 + int32 has_rank = 5; //是否展示中奖纪录(1-是,0-否) + string rank_background_color = 6; //排行榜背景颜色 + string rank_text_color = 7; //排行榜背景颜色 + string download_page_image = 8; //下载引导页的图片 + int32 is_default_download = 9; //是否使用默认下载图(1-是,0-否) + string wechat_page_image = 10; //微信引导页的图片 + int32 is_default_wechat = 11; //是否使用默认微信引导图(1-是,0-否) + string image_main = 12; //活动主图 + int32 is_default_main = 13; //是否使用默认活动主图(1-是,0-否) + string image_preview = 14; //问题页背景图 + string link_btn_text_color = 15; //分享链接按钮文字颜色 + string link_btn_bg_color = 16; //分享链接按钮背景颜色 + string link_text_color = 17; //分享链接文字颜色 + int32 show_share = 18; //是否显示分享社交媒体(0-否,1-是) + repeated int64 share = 19; //要分享的社交媒体,例如[1,2,3] + string play_rule = 20; //玩法规则 + string page_title = 21; //页面标题 + int32 dm_show = 22; //是否显示弹幕(0-否,1-是) + string web_bg_img = 23; //站外活动背景图 + int32 has_web = 24; //是否有站外活动(0-否,1-是) + int32 has_warm_up = 25; //是否预热(0-否,1-是) + string warm_up_img = 26; //预热海报图 + int32 warm_up_end = 27; //活动开始前多少分钟结束预热 + int32 icon_type = 28; //活动挂件类型(用于前端挂件选用判断) + string icon_bg_color = 29; //活动挂件背景色 + int32 dl_type = 30; //下载引导页类型(1-通用,2-自定义多媒体) + int32 dl_banner_type = 31; //下载页横幅类型(1-默认,2-自定义) + string dl_banner_img = 32; //下载页横幅自定义图 + string dl_banner_app_logo = 33; //下载页横幅applogo图片 + string dl_banner_app_name = 34; //下载页横幅app名称 + string dl_banner_app_btn = 35; //下载页横幅app按钮文案 + int32 dl_banner_position = 36; //下载页横幅位置(1-顶部,2-底部) + string topic_color = 37; //主题色 + int32 window_cover = 38; //是否全屏展示(0-否,1-是) + int32 open_ad = 39; //是否开启广告(0-否,1-是) + int32 close_copy_share = 40; //关闭复制分享文案(0-否,1-是) + repeated int32 icon_open = 41; //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3] + int32 has_white = 42; //是否开启白名单(0-否,1-是) + string white_list = 43; //白名单列表(多个用英文;分割) + string pc_bg = 44; //pc适配背景图 + int32 ads_type = 45; //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启) + string link_temp_id = 46; //链接模板id + int32 rule_time_open = 47; //是否展示规则中的活动时间(0-否,1-是) + int32 outside_task = 48; //是否外显任务(0-否,1-是) + string icon_text_color = 49; //活动挂件字体色 + int32 open_share = 50; //是否启用分享模块(0-否,1-是) + int32 show_to_use = 51; //是否展示奖品弹窗的去使用(0-不展示,1-展示) + int32 rule_type = 52; //规则展示类型(0-文本,1-图片) + string rule_img = 53; //规则展示图 + int32 rule_outside = 54; //规则是否外显(0-否,1-是) + int32 device_once = 55; //设备唯一(0-否,1-是) + } + message LongImg { + string img_url = 1; //图片地址 + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + int64 id = 4; //长图id + int32 click_type = 5; //点击类型(1-整图点击,2-区域点击) + repeated HotZone hot_zone = 6; //点击区域 + int32 target_type = 7; //跳转目标(1-指定地址,2-活动) + int64 target_id = 8; //目标id + string target_url = 9; //目标地址 + string pc_param = 10; //pc端的跳转参数 + } + message HotZone { + int64 id = 1; //热区id + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + double click_x = 4; //点击区域x + double click_y = 5; //点击区域y + double click_w = 6; //点击区域w + double click_h = 7; //点击区域h + int32 target_type = 8; //跳转目标(1-指定地址,2-活动) + int64 target_id = 9; //目标id + string target_url = 10; //目标地址 + string pc_param = 11; //pc端的跳转参数 + } + message Target { + int32 target = 1; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + int32 option = 2; //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + int32 app_event = 3; //目标选择类型为1(option=1)的选项(1-安装;2-注册) + int32 both_type = 4; //满足条件(1-所有条件满足,2-任一条件满足) + repeated Cond cond = 5; //达标条件 + BothAll both_all = 6; //满足条件为所有条件满足要提交的数据 + NormalData normal_data = 7; //通用事件的数据 + } + message Cond { + int64 id = 1; //条件id + string event = 2; //事件关键字 + string event_key = 3; //事件key + string event_val = 4; //事件值 + string desc = 5; //条件描述 + int32 if_cond = 6; //等式(0-等于,1-大于等于,2-累计) + int32 task_limit = 7; //任务次数限制 + int32 chance = 8; //完成任务获得的数量(如:骰子数) + int32 trigger_type = 9; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 day_limit = 10; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 11; //限制的用户类型id集合 + int32 event_type = 12; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 13; //广告观看路径(1-APP内,2-APP外) + repeated string lang_marks = 14; //限制的语言集合 + int32 watch_sec = 15; //观看秒数 + int32 week_limit = 16; //广告观看次数 + int32 week_num = 17; //观看秒数 + int32 open_jump = 18; //开启活动跳转(0-否,1-是) + string web_url = 19; //web端url长度 + string extra_param = 20; //附加参数 + int32 go_show = 21; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 22; //策略id + string ads_strategy_title = 23; //策略标题 + int32 is_super = 24; //是否超级任务(0-否,1-是) + int32 has_pre = 25; //是否有前置条件(0-否,1-是) + int32 pre_cond = 26; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + int32 expired_min = 27; //过期分钟数 + Reward reward = 28; //奖品 + string prop_mark = 29; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + int32 sort = 30; //排序 + int32 open_push = 31; //是否开启完成推送(0-否,1-是) + string pc_param = 32; //pc端附加参数 + int32 award_mode = 33; //领奖模式(1-自动领奖,2-手动领奖) + string go_text = 34; //去完成文案 + int32 click_effect_open = 35; //是否开启点击有效(0-否,1-是) + int32 click_effect = 36; //点击有效值 + string click_effect_unit = 37; //点击有效单位(min-分钟,hour-小时,day-天) + string expired_day = 38; //过期天数 + int32 pull_invite = 39; //是否拉起邀请(0-否,1-是) + } + message BothAll { + int32 task_limit = 1; //任务次数限制 + int32 chance = 2; //完成任务获得的数量(如:骰子数) + int32 day_limit = 3; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 4; //限制的用户类型id集合 + repeated string lang_marks = 5; //限制的语言集合 + int32 week_limit = 6; //广告观看次数 + int32 week_num = 7; //观看秒数 + Reward reward = 8; //奖品 + string prop_mark = 9; //奖励的道具类型(chance-道具数量,reward-奖品) + string expired_day = 10; //过期天数 + } + message NormalData { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 chance = 2; //达标获得的数量(如:骰子数) + int32 chance_limit = 3; //最大获得数量(如:最大骰子数) + } + message TargetOption { + int32 target = 1; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + Fixed fixed = 2; //固定事件 + Custom custom = 3; //自定义事件 + int32 option = 4; //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标) + } + message Fixed { + int32 open = 1; //是否开启(0-否,1-是) + int32 app_event = 2; //固定事件类型(1-安装;2-注册) + int32 target_num = 3; //达标条件需要的新用户个数 + int32 chance = 4; //达标获得的数量(如:骰子数) + int32 chance_limit = 5; //最大获得数量(如:最大骰子数) + double percent = 6; //百分比值(如:获得的能量点) + } + message Custom { + int32 open = 1; //是否开启(0-否,1-是) + int32 both_type = 2; //满足条件(1-所有条件满足,2-任一条件满足) + repeated Cond cond = 3; //达标条件 + BothAll both_all = 4; //满足条件为所有条件满足要提交的数据 + int32 pre_event = 5; //自定义事件前置事件(0-任意事件;1-安装;2-注册) + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + message WebReward { + int64 id = 1; //奖品id + string title = 2; //奖品名称 + string img_url = 3; //奖品图片(相对路径) + repeated KV kv_data = 4; //奖品自定义参数数据 + } + message Reward { + int64 id = 1; //活动奖品id + int64 reward_id = 2; //奖品库的奖品id + int32 stock = 3; //奖品库存 + int32 invite_num = 4; //需要邀请的人数 + int32 reward_num = 5; //获得的奖品数量 + int32 is_thank = 6; //是否谢谢参与(0-否,1-是) + int32 score = 7; //领取奖品的分数 + int32 sign_day = 8; //签到天数 + int32 collect_num = 9; //收集碎片数 + int32 is_super = 10; //是否超级大奖(0-否,1-是) + repeated KV kv_data = 11; //奖品自定义参数数据 + string title = 12; //奖品名称 + string img_url = 13; //奖品图片 + int32 receive_type = 14; //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-提交表单) + string contact = 15; //联系方式 + string url = 16; //回调地址 + int32 help = 17; //开启下载助力(0-否,1-是) + double help_percent = 18; //每个下载获得的进度比率 + int32 click = 19; //开启点击助力(0-否,1-是) + double click_percent = 20; //每个点击助力获得的进度比率 + double click_percent_limit = 21; //可获得的最大点击助力获得的进度比率 + int32 open = 22; //开启拉日活(0-否,1-是) + double open_percent = 23; //每个拉日活力获得的进度比率 + double open_percent_limit = 24; //可获得的最大拉日活获得的进度比率 + string lang_mark = 25; //奖品语言标识 + int32 odds = 26; //中奖率 + string jump_url = 27; //跳转地址 + string form_title = 28; //表单标题 + int32 campaign_limit = 29; //活动内单个用户可获取该奖品次数 + int32 register = 30; //开启注册助力(0-否,1-是) + double register_percent = 31; //每个注册获得的进度比率 + double init_percent = 32; //初始助力进度 + CollectRule collect_rule = 33; //收集规则 + string expired_day = 34; //过期天数 + OpenAdd open_add = 35; //库存增加规则 + RewardTask reward_task = 36; //解锁任务 + } + message RewardTask { + int32 open = 1; //是否开启(0-否,1-是) + string event = 2; //事件关键字 + string event_key = 3; //事件key + string event_val = 4; //事件值 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 trigger_type = 6; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 event_type = 7; //事件来源(1-自定义事件,2-广告事件) + int32 open_push = 8; //是否开启完成推送(0-否,1-是) + } + message OpenAdd { + int32 open = 1; //开启动态库存规则(0-否,1-是) + int64 start = 2; //开始时间 + int64 end = 3; //结束时间 + int32 day_num = 4; //天数 + int32 day_add = 5; //增加的库存量 + } + message CollectRule { + int32 open = 1; //开启碎片规则(0-否,1-是) + int32 init_collect = 2; //初始的最大可获得碎片数 + int32 sign_day = 3; //签到天数 + int32 add_collect = 4; //完成条件可获得最大碎片数 + int32 reset_type = 5; //重置碎片规则(1-不重置,2-获奖后重置) + } + message Rewards { + int32 reward_group = 1; //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + repeated Reward normal = 2; //常规奖品 + UserLevel user_level = 3; //用户类型奖品 + repeated Lang langs = 4; //语言奖品 + repeated LangUserLevel lang_user_level = 5; //语言+用户类型奖品 + Country country = 6; //国家奖品 + } + message UserLevel { + int64 default_level_id = 1; //默认用户类型id + string default_level_title = 2; //默认用户类型标题 + repeated UserLevelOne level_list = 3; //用户类型奖品 + } + message UserLevelOne { + int64 level_id = 1; //用户类型id + string level_title = 2; //用户类型标题 + repeated Reward rewards = 3; //奖品 + } + message Lang { + int32 lang_type = 1; //语言标识数字 + string lang_mark = 2; //语言标识 + bool default_lang = 3; //是否默认语言 + repeated Reward rewards = 4; //奖品 + } + message LangUserLevel { + string lang_mark = 1; //语言标识 + int32 lang_type = 2; //语言标识数字 + bool default_lang = 3; //是否默认语言 + int64 default_level_id = 4; //默认用户类型id + string default_level_title = 5; //默认用户类型标题 + repeated UserLevelOne level_list = 6; //用户类型奖品 + } + message Country { + string default_country_mark = 1; //默认国家 + repeated CountryOne country_list = 2; //国家的奖品 + } + message CountryOne { + string country_mark = 1; //国家标识 + repeated Reward rewards = 2; //奖品 + } + message QaQuestion { + int64 id = 1; //题目id + string title = 2; //题目 + int32 score = 3; //得分 + repeated QaOption options = 4; //选项 + } + message QaOption { + int64 id = 1; //答案id + string title = 2; //答案内容 + int32 is_right = 3; //是否正确答案(1-是,0-否) + } + message QuizOption { + int64 id = 1; //选项id + string title = 2; //选项标题 + string img_url = 3; //选项图片 + int32 is_right = 4; //是否正确选项(1-是,0-否) + int64 vote_num = 5; //投票人数 + } + message Quiz { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 init_chance = 2; //初始答题机会次数 + int32 chance = 3; //达标获得的答题机会次数 + int32 reward_rule = 4; //奖励规则(1-投票结果排名,2-自定义竞猜结果) + int64 open_prize = 5; //开奖时间 + string title = 6; //选择标题 + int32 open_type = 7; //开奖状态(1-未开奖,2-已开奖,3-不开奖) + repeated QuizOption options = 8; //有奖竞猜选项 + int64 t_open = 9; //偏移对比的开奖北京时间 + } + message QuestionAnswer { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 chance = 2; //达标条件后可获取的答题次数 + int32 init_chance = 3; //初始答题机会次数 + int32 question_ask_time = 4; //答题时间限制(单位:S,如:1 就是1秒) + repeated QaQuestion questions = 5; //题目 + string group_hash_id = 6; //题库对外id + int32 qa_num = 7; //题库选取数量 + int32 day_chance = 8; //每日签到获得的答题数 + int32 open_guide = 9; //是否开启引导(0-否,1-是) + string guide_group_hash_id = 10; //引导组hash_id + } + message LotteryConfig { + int32 target_num = 1; //达标条件需要的新用户个数 + int32 init_chance = 2; //初始抽奖机会次数 + int32 chance = 3; //达标获得的抽奖机会次数 + int32 day_chance = 4; //每日获得的抽奖机会次数 + } + message InviteConfig { + int32 reward_limit = 1; //活动总奖励上限 + int32 reward_rule = 2; //用户奖励规则(1-阶梯,2-非阶梯) + int32 invite_limit = 3; //邀请超过多少人不能再获得奖励 + int32 newcomer_cond = 4; //新人条件(1-新安装,2-助力成功,3-新安装且助力成功) + int32 step_loop = 5; //阶梯是否支持循环(0-不支持,1-支持) + } + message Sign { + int32 sign_type = 1; //签到类型(1-普通签到,2-阶梯签到) + int32 is_continue = 2; //是否连续签到(1-是,0-否) + int32 has_card = 3; //是否开启签到卡(1-开启,0-不开启) + int32 invite_num = 4; //邀请好友数可获得的1张签到卡 + int32 limit_card_num = 5; //可获得幸运卡的最大张数 + int32 is_loop = 6; //是否支持循环(0-否,1-是) + int32 sign_cycle = 7; //签到周期 + int32 recycle_type = 8; //重新签到模式(1-断签重签,2-周期重签) + string color = 9; //签到主题颜色 + } + message Dice { + int32 init_chance = 1; //初始骰子数 + int32 day_chance = 2; //每日获得的骰子数 + int32 fix_dice = 3; //开启固定骰子(0-不开启,1-开启) + int32 fix_dice_target = 4; //获得固定骰子需要邀请的人数 + int32 fix_dice_limit = 5; //固定骰子限制获取数 + string custom_dice = 6; //自定义骰子图片 + int32 open_map_point = 7; //开启自定义底座(0-不开启,1-开启) + MapPoint map_point = 8; //自定义底座数据 + int32 award_type = 9; //奖品碎片收集方式(1-随机收集,2-概率收集) + int32 open_invite = 10; //开启邀请挂件(0-关闭,1-开启) + int32 roll_again = 11; //开启再摇一次(0-关闭,1-开启) + int32 fix_dice_cond = 12; //邀请事件(1-安装,2-注册) + int32 odds = 13; //概率收集方式的中奖概率 + string play_img = 14; //play按钮图 + string cloud_img = 15; //云朵图 + } + message MapPoint { + string blank = 1; //空白底座 + string again = 2; //再摇一次底座 + string normal = 3; //普通奖品底座 + string supper = 4; //超级大奖底座 + } + message Grow { + int32 auto_hour = 1; //自动生产成长道具小时数 + int32 auto_num = 2; //生产的成长道具数 + int32 grow_num = 3; //邀请可获得的成长道具数量 + int32 target_num = 4; //获得成长道具需要邀请的人数 + int32 revive = 5; //是否支持复活(0-否,1-是) + int32 revive_num = 6; //复活需要邀请的好友数 + int32 die_hour = 7; //未获得成长道具导致的死亡时间 + repeated GrowStep steps = 8; //成长阶段 + int32 init_num = 9; //初始成长道具数量 + } + message GrowStep { + int64 id = 1; //奖品id + int32 num = 2; //需要的养成道具数量 + } + message Ballot { + int32 init_chance = 1; //初始抽签数 + int32 day_chance = 2; //每日获得的抽签数 + } + message Chop { + int32 show_bar = 1; //是否展示进度条(0-否,1-是) + } + message Cash { + int32 expired_day = 1; //任务重置天数 + int32 price = 2; //单位奖品总价值 + int32 price_num = 3; //奖品总份额 + repeated SpinCash spin_cash = 4; //金额 + int32 lack = 5; //是否缺乏库存(0-否,1-是) + int32 currency = 6; //货币id标识 + int32 loop_num = 7; //支持循环次数 + } + message SpinCash { + int64 id = 1; //唯一id + double cash = 2; //单位奖品总价值 + } + message Flip { + int32 init_chance = 1; //初始抽奖机会次数 + string card_img = 2; //卡牌图片 + int32 day_chance = 3; //每日获得的抽奖机会次数 + } + message Keep { + int32 collect = 1; //获得最终奖品需要的总收集数 + int32 collect_second = 2; //单个收集需要的二级资源数 + int32 open_invite = 3; //开启邀请(0-关闭,1-开启) + Invite invite = 4; //拉新配置 + int32 init_get = 5; //初始道具数 + double sec_get = 6; //每秒获得道具数 + int32 feed_num = 7; //每次使用道具数 + int32 feed_cycle = 8; //喂养周期(单位:天) + int32 max_feed = 9; //最大可领养次数 + int32 feed_get = 10; //喂养能得到的道具数 + int32 feed_get_num = 11; //得到喂养道具需要的喂养次数 + repeated Talk talk_text = 12; //对话文案 + repeated KeepStep steps = 13; //养成阶梯 + double sec_get_day_limit = 14; //每秒获得道具每日上限 + int32 machine_type = 15; //狗粮机类型(1-在线收益,2-离线收益) + int32 offline_min = 16; //离线分钟时长 + int32 offline_get = 17; //离线收益最大值 + int32 offline_limit = 18; //离线收益最大领取次数 + } + message Invite { + int32 invite_type = 1; //邀请类型(1-下载,2-安装) + int32 invite_get = 2; //邀请可获得的道具数量 + int32 reward_selected = 3; //选择礼品可获得的道具数 + int32 feed_third = 4; //喂养3次可获得的道具数 + int32 day_first_invite = 5; //是否开启每日首次拉新(0-否,1-是) + int32 day_first_get = 6; //每日首次拉新可获得的道具数 + int32 day_first_selected = 7; //每日首日选择礼物可获得的道具数 + int32 day_first_third = 8; //每日首次喂养三次可获得的道具数 + int32 invite_max_get = 9; //邀请人可获得的最大道具数 + } + message Talk { + int32 text_type = 1; //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + string content = 2; //内容 + } + message KeepStep { + int32 step = 1; //阶段 + int32 percent = 2; //对应的进度条数值 + int32 reward_type = 3; //奖品类型(1-成长道具,2-奖品) + Reward reward = 4; //奖品数据时 + int32 reward_num = 5; //发放道具数量 + } + message Push { + PushOne task_reset = 1; //重制提醒 + PushOne active = 2; //活跃提醒 + PushOne offline = 3; //离线提醒 + PushOne visit = 4; //访问提醒 + } + message PushOne { + int32 open = 1; //是否开启 + repeated PushCond push_cond = 2; //条件内容 + } + message PushCond { + string mark = 1; //条件标识 + string val = 2; //标识值 + } + message Gold { + int32 gold_num = 1; //任务重置天数 + int32 expired_day = 2; //任务重置天数 + double price = 3; //单位奖品总价值 + int32 price_num = 4; //奖品总份额 + int32 currency = 5; //货币id标识 + repeated SpinCash spin_cash = 6; //金额 + int32 lack = 7; //是否缺乏库存(0-否,1-是) + } + message Coin { + string coin_img = 1; //金币图片 + int32 open_days = 2; //开奖天数 + int32 open_limit = 3; //开奖次数限制 + int32 init_coin = 4; //初始金币数 + int32 init_use = 5; //初始投放次数 + int32 use_coin = 6; //单次投放消耗金币数 + int32 use_limit = 7; //单次瓜分最多投放次数 + int64 url_id = 8; //回调地址id + repeated int32 lack_btn = 9; //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2] + string custom_btn_text = 10; //自定义按钮文案 + string custom_web_url = 11; //自定义web端url + string custom_extra_param = 12; //自定义app附加参数 + int64 custom_btn_id = 13; //自定义按钮ID + string custom_pc_param = 14; //自定义pc附加参数 + } + int64 id = 1; //活动gid + string hash_id = 2; //活动hash_id + string title = 3; //活动标题 + int64 start_time = 4; //开始时间时间戳 + int64 end_time = 5; //结束时间时间戳 + int32 status = 6; //发布状态(1-待发布,2-已发布,3-已下线) + string fission_mark = 7; //活动类型玩法标识 + int64 temp_id = 8; //模版id + int64 project_id = 9; //模版id + string cover_url = 10; //活动封面图 + Config config = 11; //活动基础配置 + repeated Share share = 12; //选择的社媒 + repeated KV campaign_data = 13; //前端组件位置偏移数据 + LotteryConfig prize_wheel = 14; //大转盘配置(大转盘玩法必传) + LotteryConfig slot = 15; //老虎机配置(老虎机玩法必传) + LotteryConfig blind = 16; //盲盒配置(盲盒玩法必传) + LotteryConfig grid = 17; //九宫格配置(九宫格玩法必传) + InviteConfig referral = 18; //老带新配置(老带新玩法必传) + QuestionAnswer question_answer = 19; //趣味问答配置(趣味问答玩法必传) + Quiz quiz = 20; //有奖竞猜配置(有奖竞猜玩法必传) + InviteConfig win = 21; //一起赢配置(一起赢玩法必传) + int32 t_offset = 22; //时间偏移量 + int64 t_start = 23; //展示的开始时间时间戳 + int64 t_end = 24; //展示的结束时间时间戳 + Target target = 25; //活动目标 + Sign sign = 26; //签到配置(签到玩法必传) + Dice dice = 27; //大富翁配置(大富翁玩法必传) + Grow grow = 28; //农场配置(农场玩法必传) + Ballot ballot = 29; //抽签配置(抽签玩法必传) + Chop chop = 30; //砍一刀配置(砍一刀玩法必传) + repeated KV delay_link_data = 31; //延迟深度链接自定义键值数据 + Rewards rewards = 32; //站内奖品 + repeated Reward rewards_web = 33; //站外奖品 + repeated Reward rewards_extra = 34; //额外奖品 + repeated Reward rewards_newcomer = 35; //新人奖 + repeated string lang_marks = 36; //支持的语种 + TargetOption target_option = 37; //目标配置选项 + Cash cash = 38; //现金抽奖配置(现金抽奖玩法必传) + repeated LongImg long_imgs = 39; //长图配置 + Flip flip = 40; //翻牌配置(翻牌玩法必传) + Keep keep_dog = 41; //养狗(养狗配置必传) + Push push = 42; //推送配置 + repeated Child child = 43; //关联的子活动 + WheelStyle wheel_style = 44; //转盘自定义样式 + Gold gold = 45; //金币任务配置(金币任务玩法必传) + int64 fission_id = 46; //玩法id + Coin coin = 47; //金币池配置(金币池玩法必传) + GridStyle grid_style = 48; //九宫格自定义样式 + FlipStyle flip_style = 49; //翻牌自定义样式 + PointsUse points_use = 50; //积分消耗 + Chat chat = 51; //ai陪伴 + Vs vs = 52; //赛事竞猜配置(赛事竞猜玩法必传) + Uno uno = 53; //uno卡牌配置(uno卡牌玩法必传) + Event event = 54; //事件配置(活动事件) + LotteryConfig gashapon = 55; //扭蛋机配置(扭蛋机玩法必传) + GashaponStyle gashapon_style = 56; //扭蛋机自定义样式 +} + +message ChannelListReq { + int64 campaign_id = 1; //活动id + string campaign_hash_id = 2; //活动对外id +} + +message ChannelListRes { + message One { + int64 id = 1; //渠道id + string title = 2; //渠道标题 + int32 is_default = 3; //是否是默认值(0-否,1-是) + string url = 4; //渠道链接 + string code = 5; //口令码 + } + repeated One list = 1; //站内渠道列表数据 + repeated One web_list = 2; //站外渠道列表数据 +} + +message ChannelCreateReq { + int64 campaign_id = 1; //活动id + string campaign_hash_id = 2; //活动对外id + string title = 3; //渠道名称 + int32 c_type = 4; //渠道类型(1-站内渠道,2-站外渠道) +} + +message ChannelCreateRes { + int64 id = 1; //渠道id + string url = 2; //渠道链接 +} + +message ChannelUpdateReq { + int64 id = 1; //渠道id + string title = 2; //渠道名称 +} + +message ChannelUpdateRes { +} + +message ChannelDestroyReq { + int64 id = 1; //渠道id +} + +message ChannelDestroyRes { +} + +message KvDataReq { + int64 id = 1; //活动id +} + +message KvDataRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + repeated KV kv = 1; //活动键值对 +} + +message CertReq { + int64 id = 1; //活动id + string hash_id = 2; //活动 + int64 project_id = 3; //项目id + string project_hash_id = 4; //项目hash_id +} + +message CertRes { + bool cert = 1; //认证失败 + int64 id = 2; //活动id + string hash_id = 3; //活动 + int64 project_id = 4; //项目id + string project_hash_id = 5; //项目hash_id + string title = 6; //活动标题 +} + +message BarrageReq { + int64 id = 1; //活动id + string hash_id = 2; //活动 + string lang_mark = 3; //语种标识 + string lv = 4; //用户等级标识 + string show_lang = 5; //展示的语种 + string country_mark = 6; //国家标识 + int64 user_id = 7; //用户id +} + +message BarrageRes { + message TranContent { + string mark = 1; //语言包标识 + repeated KV replace_kv = 2; //是否是默认值(0-否,1-是) + string reward_img = 3; //奖品图片 + } + message KV { + string key = 1; //语言包中变量的替换关键字 + string value = 2; //replace的值 + } + repeated string content = 1; //内容 + repeated TranContent tran_content = 2; //内容 +} + +message OptionReq { + int64 id = 1; //活动id + string hash_id = 2; //活动 +} + +message OptionRes { + message Option { + int64 id = 1; //选项id + string title = 2; //选项标题 + string img_url = 3; //选项图片 + int32 is_right = 4; //是否正确选项(1-是,0-否) + int64 vote_num = 5; //投票人数 + } + repeated Option options = 1; //内容 + int64 right_id = 2; //开奖后正确选项,只有开奖后才有数据 +} + +message RelateDdlReq { + string hash_id = 1; //活动hash_id + string project_hash_id = 2; //项目hash_id + bool close = 3; //是否关闭 +} + +message RelateDdlRes { +} + +message DdlCampaignReq { + string project_hash_id = 1; //项目hash_id +} + +message DdlCampaignRes { + string hash_id = 1; //活动对外id + string title = 2; //活动标题 + int32 status = 3; //发布状态(1-待发布,2-已发布,3-已下线) +} + +message LangsReq { + string campaign_hash_id = 1; //活动hash_id +} + +message LangsRes { + message Lang { + string hash_id = 1; //语言配置信息ID + bool is_default = 2; //是否默认配置语言 + string lang_mark = 3; //语言对应的唯一标识 + int32 lang_type = 4; //语言数字类型唯一标识 + string page_title = 5; //页面标题 + string image_main = 6; //活动主图 + string download_page_image = 7; //下载引导页的图片 + string wechat_page_image = 8; //微信引导页的图片 + string content_img = 9; //内容背景图 + string web_bg_img = 10; //站外背景图地址 + string warm_up_img = 11; //预热海报图 + string dl_bg_img = 12; //引导页背景图 + string dl_banner_img = 13; //下载页横幅自定义图 + string dl_banner_app_logo = 14; //下载页横幅applogo图片 + string dl_banner_app_name = 15; //下载页横幅app名称 + string dl_banner_app_btn = 16; //下载页横幅app按钮文案 + string share_text = 17; //分享文案 + string share_img = 18; //分享图片 + string rule = 19; //活动规则 + repeated Cond conds = 20; //事件驱动的条件描述 + Quit quit = 21; //赛事竞猜选项翻译 + repeated Question questions = 22; //问题翻译 + bool wait = 23; //是否待配置 + Rewards rewards = 24; //站内奖品 + repeated Reward rewards_web = 25; //站外奖品 + repeated Reward rewards_extra = 26; //额外奖品 + repeated Reward rewards_newcomer = 27; //新人奖 + repeated LongImg long_imgs = 28; //长图配置 + Cash cash = 29; //现金抽奖配置 + int32 t_offset = 30; //时区偏移值 + int64 t_start = 31; //开始时间 + int64 t_end = 32; //结束时间 + QaGroup qa_group = 33; //题库数据 + repeated Talk talk_text = 34; //对话文案 + Gold gold = 35; //金币任务配置 + Coin coin = 36; //金币池配置 + string topic_color = 37; //主题色 + string pc_bg = 38; //pc背景 + string rule_img = 39; //规则展示图 + repeated Schedule schedules = 40; //赛事时间表 + Uno uno = 41; //uno卡牌配置 + } + message Uno { + repeated UnoCard red = 1; //红牌配置 + repeated UnoCard yellow = 2; //黄牌配置 + repeated UnoCard blue = 3; //黑牌配置 + repeated UnoCard green = 4; //绿牌配置 + } + message UnoCard { + int64 id = 1; //牌id + string title = 2; //跳转按钮文案 + string img_url = 3; //图片地址 + string web_url = 4; //Web跳转地址 + string app_param = 5; //App跳转参数 + string pc_param = 6; //pc跳转参数 + } + message Schedule { + int32 id = 1; //id + repeated PkTeam pk_teams = 2; //队伍 + } + message PkTeam { + int64 id = 1; //赛程id + repeated Team teams = 2; //队伍 + string vs_img = 3; //比赛图 + string desc = 4; //标题描述 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + message QaGroup { + string qa_group_id = 1; //题库hash_id + int32 qa_num = 2; //题库选取数量 + string title = 3; //题库标题 + int32 open_guide = 4; //是否开启引导(0-否,1-是) + string guide_group_id = 5; //引导组hash_id + } + message Talk { + int32 text_type = 1; //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + string content = 2; //内容 + } + message Cash { + int32 price = 1; //单位奖品总价值 + int32 currency = 2; //货币id标识 + } + message Gold { + double price = 1; //单位奖品总价值 + int32 currency = 2; //货币id标识 + } + message Coin { + string custom_btn_text = 1; //自定义按钮文案 + string custom_web_url = 2; //自定义web端url + string custom_extra_param = 3; //自定义app附加参数 + string custom_pc_param = 4; //自定义pc附加参数 + } + message LongImg { + string img_url = 1; //图片地址 + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + int64 id = 4; //长图id + int32 click_type = 5; //点击类型(1-整图点击,2-区域点击) + repeated HotZone hot_zone = 6; //点击区域 + int32 target_type = 7; //跳转目标(1-指定地址,2-活动) + int64 target_id = 8; //目标id + string pc_param = 9; //pc端的跳转参数 + int64 lang_source_id = 10; //语言长图源ID + } + message HotZone { + int64 id = 1; //热区id + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + double click_x = 4; //点击区域x + double click_y = 5; //点击区域y + double click_w = 6; //点击区域w + double click_h = 7; //点击区域h + int32 target_type = 8; //跳转目标(1-指定地址,2-活动) + int64 target_id = 9; //目标id + string pc_param = 10; //pc端的跳转参数 + } + message Rewards { + repeated Reward normal = 1; //常规奖品 + repeated UserLevelOne user_level = 2; //用户类型奖品 + repeated Reward langs = 3; //语言奖品 + repeated UserLevelOne lang_user_level = 4; //语言+用户类型奖品 + repeated CountryOne country = 5; //国家奖品 + } + message Reward { + int64 reward_id = 1; //奖品库奖品id + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + bool find_default = 4; //是否只能显示默认奖品 + } + message UserLevelOne { + int64 level_id = 1; //用户类型id + string level_title = 2; //用户等级名称 + repeated Reward rewards = 3; //奖品 + } + message CountryOne { + string country_mark = 1; //国家类型标识 + repeated Reward rewards = 2; //奖品 + } + message Quit { + string title = 1; //标题 + repeated Option options = 2; //选项集合 + } + message Option { + int64 option_id = 1; //选项id + string title = 2; //选项标题 + string img_url = 3; //选项图片 + } + message Question { + int64 qa_id = 1; //问题id + string title = 2; //题目 + repeated Option options = 3; //选项集合 + } + message Cond { + int64 cond_id = 1; //条件id + string desc = 2; //对应的语言描述 + int32 open_jump = 3; //开启活动跳转(0-否,1-是) + string web_url = 4; //web端url长度 + string extra_param = 5; //附加参数 + string pc_param = 6; //pc端附加参数 + string go_text = 7; //去完成文案 + } + bool has_web = 1; //是否开启站外 + bool has_warn = 2; //是否开启预热 + int32 dl_type = 3; //下载引导页类型(1-通用,2-自定义多媒体) + int32 dl_banner_type = 4; //下载页横幅类型(1-默认,2-自定义) + int32 window_cover = 5; //是否开启全屏封面(0-关闭,1-开启) + int32 reward_group = 6; //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品) + repeated Lang langs = 7; //语言列表 + repeated Lang not_support = 8; //不支持的语言列表 + string fission_mark = 9; //玩法标识 + string temp_group_mark = 10; //模版组标识 + bool has_long_img = 11; //是否开启长图 + int32 rule_type = 12; //规则展示类型(0-文本,1-图片) + string title = 13; //活动标题 + string fission_mark_title = 14; //玩法标识说明 +} + +message LangReq { + int64 campaign_id = 1; //活动id + string lang_mark = 2; //语言对应的唯一标识 +} + +message LangRes { + message Uno { + repeated UnoCard red = 1; //红牌配置 + repeated UnoCard yellow = 2; //黄牌配置 + repeated UnoCard blue = 3; //黑牌配置 + repeated UnoCard green = 4; //绿牌配置 + } + message UnoCard { + int32 card_no = 1; //牌号 + string title = 2; //跳转按钮文案 + string img_url = 3; //图片地址 + string web_url = 4; //Web跳转地址 + string app_param = 5; //App跳转参数 + string pc_param = 6; //pc跳转参数 + } + message Schedule { + int32 id = 1; //id + repeated PkTeam pk_teams = 2; //队伍 + } + message PkTeam { + int64 id = 1; //赛程id + repeated Team teams = 2; //队伍 + string vs_img = 3; //比赛图 + string desc = 4; //标题描述 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + message Talk { + int32 text_type = 1; //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + string content = 2; //内容 + } + message QaGroup { + string qa_group_id = 1; //题库hash_id + int32 qa_num = 2; //题库选取数量 + string title = 3; //题库标题 + string guide_group_id = 4; //引导组hash_id + } + message Quit { + string title = 1; //标题 + repeated Option options = 2; //选项集合 + } + message Option { + int64 option_id = 1; //选项id + string title = 2; //选项标题 + string img_url = 3; //选项图片 + } + message Question { + int64 qa_id = 1; //问题id + string title = 2; //题目 + repeated Option options = 3; //选项集合 + } + message Cond { + int64 cond_id = 1; //条件id + string desc = 2; //对应的语言描述 + string web_url = 3; //web端url长度 + string extra_param = 4; //附加参数 + string pc_param = 5; //pc端附加参数 + string go_text = 6; //去完成文案 + } + message LongImg { + string img_url = 1; //图片地址 + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + int64 id = 4; //长图id + int32 click_type = 5; //点击类型(1-整图点击,2-区域点击) + repeated HotZone hot_zone = 6; //点击区域 + int32 target_type = 7; //跳转目标(1-指定地址,2-活动) + int64 target_id = 8; //目标id + string target_url = 9; //目标地址 + string pc_param = 10; //pc端的跳转参数 + } + message HotZone { + int64 id = 1; //热区id + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + double click_x = 4; //点击区域x + double click_y = 5; //点击区域y + double click_w = 6; //点击区域w + double click_h = 7; //点击区域h + int32 target_type = 8; //跳转目标(1-指定地址,2-活动) + int64 target_id = 9; //目标id + string target_url = 10; //目标地址 + string pc_param = 11; //pc端的跳转参数 + } + message Cash { + int32 price = 1; //单位奖品总价值 + int32 currency = 2; //货币id标识 + } + message Gold { + double price = 1; //单位奖品总价值 + int32 currency = 2; //货币id标识 + } + message Coin { + string custom_btn_text = 1; //自定义按钮文案 + string custom_web_url = 2; //自定义web端url + string custom_extra_param = 3; //自定义app附加参数 + string custom_pc_param = 4; //自定义pc附加参数 + } + string hash_id = 1; //语言配置信息ID + string page_title = 2; //页面标题 + string image_main = 3; //活动主图 + string download_page_image = 4; //下载引导页的图片 + string wechat_page_image = 5; //微信引导页的图片 + string content_img = 6; //内容背景图 + string web_bg_img = 7; //站外背景图地址 + string warm_up_img = 8; //预热海报图 + string dl_bg_img = 9; //引导页背景图 + string dl_banner_img = 10; //下载页横幅自定义图 + string dl_banner_app_logo = 11; //下载页横幅applogo图片 + string dl_banner_app_name = 12; //下载页横幅app名称 + string dl_banner_app_btn = 13; //下载页横幅app按钮文案 + string share_text = 14; //分享文案 + string share_img = 15; //分享图片 + string rule = 16; //活动规则 + repeated Cond conds = 17; //事件驱动的条件描述 + Quit quit = 18; //赛事竞猜选项翻译 + repeated Question questions = 19; //问题翻译 + repeated LongImg long_imgs = 20; //长图配置 + Cash cash = 21; //现金抽奖配置 + int32 t_offset = 22; //时区偏移值 + QaGroup qa_group = 23; //题库数据 + repeated Talk talk_text = 24; //对话文案 + Gold gold = 25; //金币任务配置 + Coin coin = 26; //金币池配置 + string topic_color = 27; //主题色 + string pc_bg = 28; //pc背景 + string rule_img = 29; //规则展示图 + repeated Schedule schedules = 30; //赛事时间表 + Uno uno = 31; //uno卡牌配置 +} + +message SaveLangReq { + message Uno { + repeated UnoCard red = 1; //红牌配置 + repeated UnoCard yellow = 2; //黄牌配置 + repeated UnoCard blue = 3; //黑牌配置 + repeated UnoCard green = 4; //绿牌配置 + } + message UnoCard { + int32 card_no = 1; //牌号 + string title = 2; //跳转按钮文案 + string img_url = 3; //图片地址 + string web_url = 4; //Web跳转地址 + string app_param = 5; //App跳转参数 + string pc_param = 6; //pc跳转参数 + } + message Schedule { + int32 id = 1; //id + repeated PkTeam pk_teams = 2; //队伍 + } + message PkTeam { + int64 id = 1; //赛程id + repeated Team teams = 2; //队伍 + string vs_img = 3; //比赛图 + string desc = 4; //标题描述 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + message Talk { + int32 text_type = 1; //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时) + string content = 2; //内容 + } + message QaGroup { + string qa_group_id = 1; //题库hash_id + int32 qa_num = 2; //题库选取数量 + string guide_group_id = 3; //引导组hash_id + } + message Cash { + int32 price = 1; //单位奖品总价值 + int32 currency = 2; //货币id标识 + } + message Gold { + double price = 1; //单位奖品总价值 + int32 currency = 2; //货币id标识 + } + message Coin { + string custom_btn_text = 1; //自定义按钮文案 + string custom_web_url = 2; //自定义web端url + string custom_extra_param = 3; //自定义app附加参数 + string custom_pc_param = 4; //自定义pc附加参数 + } + message Quit { + string title = 1; //标题 + repeated Option options = 2; //选项集合 + } + message Option { + int64 option_id = 1; //选项id + string title = 2; //选项标题 + string img_url = 3; //选项图片 + } + message Question { + int64 qa_id = 1; //问题id + string title = 2; //题目 + repeated Option options = 3; //选项集合 + } + message Cond { + int64 cond_id = 1; //条件id + string desc = 2; //对应的语言描述 + string web_url = 3; //web端url长度 + string extra_param = 4; //附加参数 + string pc_param = 5; //pc端附加参数 + string go_text = 6; //去完成文案 + } + message LongImg { + string img_url = 1; //图片地址 + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + int64 id = 4; //长图id + int32 click_type = 5; //点击类型(1-整图点击,2-区域点击) + repeated HotZone hot_zone = 6; //点击区域 + int32 target_type = 7; //跳转目标(1-指定地址,2-活动) + int64 target_id = 8; //目标id + string pc_param = 9; //pc端的跳转参数 + int64 lang_source_id = 10; //语言长图源ID + } + message HotZone { + int64 id = 1; //热区id + string web_url = 2; //Web端的跳转地址 + string app_param = 3; //App端的跳转参数 + double click_x = 4; //点击区域x + double click_y = 5; //点击区域y + double click_w = 6; //点击区域w + double click_h = 7; //点击区域h + int32 target_type = 8; //跳转目标(1-指定地址,2-活动) + int64 target_id = 9; //目标id + string pc_param = 10; //pc端的跳转参数 + } + bool to_view = 1; //是否需要去预览页 + string campaign_hash_id = 2; //活动hash_id + string lang_mark = 3; //语言对应的唯一标识 + string page_title = 4; //页面标题 + string image_main = 5; //活动主图 + string download_page_image = 6; //下载引导页的图片 + string wechat_page_image = 7; //微信引导页的图片 + string content_img = 8; //内容背景图 + string web_bg_img = 9; //站外背景图地址 + string warm_up_img = 10; //预热海报图 + string dl_bg_img = 11; //引导页背景图 + string dl_banner_img = 12; //下载页横幅自定义图 + string dl_banner_app_logo = 13; //下载页横幅applogo图片 + string dl_banner_app_name = 14; //下载页横幅app名称 + string dl_banner_app_btn = 15; //下载页横幅app按钮文案 + string share_text = 16; //分享文案 + string share_img = 17; //分享图片 + string rule = 18; //活动规则 + repeated Cond conds = 19; //事件驱动的条件描述 + Quit quit = 20; //赛事竞猜选项翻译 + repeated Question questions = 21; //问题翻译 + repeated LongImg long_imgs = 22; //长图配置 + Cash cash = 23; //现金抽奖配置 + int32 t_offset = 24; //时区偏移值 + QaGroup qa_group = 25; //题库数据 + repeated Talk talk_text = 26; //对话文案 + Gold gold = 27; //金币任务配置 + Coin coin = 28; //金币池配置 + string topic_color = 29; //主题色 + string pc_bg = 30; //pc背景 + string rule_img = 31; //规则展示图 + repeated Schedule schedules = 32; //赛事时间表 + Uno uno = 33; //uno卡牌配置 +} + +message SaveLangRes { + string view_link = 1; //预览地址 +} + +message DestroyLangReq { + string hash_id = 1; //语言配置信息ID +} + +message DestroyLangRes { +} + +message LangSelectReq { + string campaign_hash_id = 1; //活动hash_id +} + +message LangSelectRes { + message One { + int32 lang_type = 1; //语言数字类型 + string lang_mark = 2; //语言iso标准 + bool selected = 3; //是否已经被使用 + } + repeated One list = 1; //选择 +} + +message CampaignInfoReq { + int64 project_id = 1; //项目id + string campaign_hash_id = 2; //活动hash_id + int64 campaign_id = 3; //活动id + string lang = 4; //语言标识 +} + +message CampaignInfoRes { + int64 id = 1; //活动ID + string hash_id = 2; //活动对外id + string title = 3; //活动标题 + string page_title = 4; //页面标题 + string fission_mark = 5; //玩法标识 + string fission_title = 6; //活动类型说明 + int64 start_time = 7; //提交的开始时间(+8时区算出来的时间戳) + int64 end_time = 8; //提交的结束时间(+8时区算出来的时间戳) + int32 status = 9; //发布状态(1-待发布,2-已发布,3-已下线) + int32 t_offset = 10; //时间偏移量 + repeated string lang_types = 11; //支持的语种 + string share_img = 12; //分享图片 + string link = 13; //活动地址 + string img_host = 14; //图片全球地址 + string pc_bg = 15; //pc适配背景 + int32 target = 16; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告) + int64 start_at = 17; //开始时间戳 + int64 end_at = 18; //结束时间戳 + int64 project_id = 19; //项目id +} + +message ShowRewardReq { + int64 campaign_id = 1; //活动id + string lang_mark = 2; //语言标识 + string level_mark = 3; //用户标识 + string show_lang = 4; //奖品展示的语言标识 + string country_mark = 5; //国家标识 +} + +message ShowRewardRes { + message Reward { + int64 id = 1; //奖品id + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + int32 stock = 4; //奖品库存 + int32 invite_num = 5; //需要邀请的人数 + int32 reward_num = 6; //获得的奖品数量 + int32 is_thank = 7; //是否谢谢参与(0-否,1-是) + int32 score = 8; //领取奖品的分数 + int32 sign_day = 9; //签到天数 + int32 collect_num = 10; //收集碎片数 + int32 is_super = 11; //是否超级大奖(0-否,1-是) + int32 receive_type = 12; //发放类型(1-系统发放,2-联系客服) + repeated KV kv_data = 13; //键值数据 + string contact = 14; //联系方式 + string url = 15; //回调地址 + int32 help = 16; //开启下载助力(0-否,1-是) + double help_percent = 17; //每个下载获得的进度比率 + int32 click = 18; //开启点击助力(0-否,1-是) + double click_percent = 19; //每个点击助力获得的进度比率 + double click_percent_limit = 20; //可获得的最大点击助力获得的进度比率 + int32 open = 21; //开启拉日活(0-否,1-是) + double open_percent = 22; //每个拉日活力获得的进度比率 + double open_percent_limit = 23; //可获得的最大拉日活获得的进度比率 + string jump_url = 24; //跳转地址 + int64 reward_id = 25; //奖品库奖品id + int32 register = 26; //开启下载助力(0-否,1-是) + double register_percent = 27; //每个下载获得的进度比率 + } + message KV { + string key = 1; //键 + string value = 2; //值 + } + repeated Reward rewards = 1; //站内奖品 + repeated Reward rewards_web = 2; //站外奖品 + repeated Reward rewards_extra = 3; //额外奖品 + repeated Reward rewards_newcomer = 4; //新人奖 +} + +message AdsStoreReq { + message KV { + string key = 1; //键 + string value = 2; //值 + } + message Reward { + int64 reward_id = 1; //奖品库的奖品id + int32 odds = 2; //中奖率 + } + message Flip { + string card_img = 1; //卡牌图片 + } + string template_id = 1; //玩法模板ID + string project_id = 2; //项目ID + string title = 3; //活动标题 + string page_title = 4; //页面标题 + string bg_img = 5; //活动背景图 + repeated KV delay_link_data = 6; //延迟深度链接自定义参数 + repeated Reward rewards = 7; //奖品 + int64 user_id = 8; //创建人id + int32 countdown = 9; //倒计时 + Flip flip = 10; //翻牌配置(翻牌玩法必传) +} + +message AdsStoreRes { + int64 id = 1; //活动id + string hash_id = 2; //活动hash_id +} + +message AdsUpdateReq { + message KV { + string key = 1; //键 + string value = 2; //值 + } + message Reward { + int64 id = 1; //奖品id + int64 reward_id = 2; //奖品库的奖品id + int32 odds = 3; //中奖率 + } + message Flip { + string card_img = 1; //卡牌图片 + } + string hash_id = 1; //活动hash_id + string title = 2; //活动标题 + string page_title = 3; //页面标题 + string bg_img = 4; //活动背景图 + repeated KV delay_link_data = 5; //延迟深度链接自定义参数 + repeated Reward rewards = 6; //奖品 + int32 countdown = 7; //倒计时 + Flip flip = 8; //翻牌配置(翻牌玩法必传) +} + +message AdsUpdateRes { + int64 id = 1; //活动id + string hash_id = 2; //活动hash_id +} + +message AdsShowReq { + string hash_id = 1; //活动hash_id +} + +message AdsShowRes { + message KV { + string key = 1; //键 + string value = 2; //值 + } + message Reward { + int64 id = 1; //奖品id + int64 reward_id = 2; //奖品库的奖品id + int32 odds = 3; //中奖率 + string title = 4; //奖品名称 + string img_url = 5; //奖品图片 + repeated KV kv_data = 6; //奖品自定义参数数据 + int32 receive_type = 7; //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-实物) + string contact = 8; //联系方式 + string url = 9; //回调地址 + } + message Flip { + string card_img = 1; //卡牌图片 + } + int64 id = 1; //活动ID + string hash_id = 2; //活动hash_id + int64 project_id = 3; //模版id + int64 temp_id = 4; //模版id + int32 t_offset = 5; //时间偏移量 + int32 target = 6; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告) + int64 t_start = 7; //展示的开始时间时间戳 + int64 t_end = 8; //展示的结束时间时间戳 + string fission_mark = 9; //活动类型玩法标识 + string title = 10; //活动标题 + string cover_url = 11; //封面地址 + string page_title = 12; //页面标题 + string bg_img = 13; //活动背景图 + int32 status = 14; //发布状态(1-待发布,2-已发布,3-已下线) + repeated KV delay_link_data = 15; //延迟深度链接自定义参数 + repeated Reward rewards = 16; //奖品 + int32 countdown = 17; //倒计时 + int64 fission_id = 18; //玩法id + Flip flip = 19; //翻牌配置(翻牌玩法必传) +} + +message CampaignSelectReq { + int64 project_id = 1; //项目id + string project_hash_id = 2; //项目hash_id + repeated int32 targets = 3; //活动目标集合 + bool child = 4; //子活动 + string child_with = 5; //绑定子活动的活动id + int32 child_type = 6; //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务) + string temp_hash_id = 7; //模版hash_id + repeated int32 status = 8; //活动状态(1-待发布,2-已发布,3-已下线,4-预发布) +} + +message CampaignSelectRes { + message One { + int64 id = 1; //活动ID + string hash_id = 2; //活动对外id + string title = 3; //活动标题 + int32 status = 4; //发布状态(1-待发布,2-已发布,3-已下线) + int32 child_type = 5; //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务) + } + repeated One list = 1; //列表数据 +} + +message RewardDetailReq { + string hash_id = 1; //活动hash_id +} + +message RewardDetailRes { + message UnoCard { + int64 id = 1; //牌组id + string mark = 2; //牌组标识 + string title = 3; //奖品标题 + int64 stock = 4; //奖品库存 + int64 remain = 5; //剩余库存 + int64 pre_intact_num = 6; //待合成奖品数 + int64 intact_num = 7; //完整奖品数 + } + message Schedule { + int64 id = 1; //赛程id + int64 vs_at = 2; //开赛时间 + int64 vote_start = 3; //投票开始时间 + int64 vote_end = 4; //投票结束时间 + repeated Team teams = 5; //队伍数据 + repeated Vote votes = 6; //投票数据 + int32 win_type = 7; //结算获奖类型(1-队伍胜利,2-平局) + int64 win_team_id = 8; //胜利队伍id + int64 pre_reward_num = 9; //预计发放奖励数 + int64 reward_num = 10; //实际领取奖励数 + int32 tz = 11; //时区 + } + message Vote { + int32 win_type = 1; //结算获奖类型(1-队伍胜利,2-平局) + int64 win_team_id = 2; //队伍id + int64 vote_num = 3; //投票数 + int64 vote_user_num = 4; //投票数 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + message Pool { + int64 id = 1; //id标识 + string title = 2; //场次说明 + int32 status = 3; //状态(1-进行中 2-领奖中,3-已结算) + int32 init_coin = 4; //奖池初始金额 + int64 user_coin = 5; //用户投放金币数 + int32 init_use = 6; //初始投放次数 + int64 join_num = 7; //投放次数 + int64 one_use_coin = 8; //用户单次可领取的金币数 + int64 join_user_num = 9; //投放人数 + int64 get_num = 10; //领奖总人数 + int64 join_avg = 11; //平均每人发放金币数 + int64 get_coin = 12; //领取的总金币数 + } + message Reward { + int64 id = 1; //奖品id + string title = 2; //奖品标题 + int64 stock = 3; //奖品库存 + int64 remain = 4; //剩余库存 + int64 given = 5; //已发放奖品数 + bool can_up = 6; //是否可更新库存 + int32 is_thank = 7; //是否谢谢参与(0-否,1-是) + int64 select_num = 8; //选择数 + string task_title = 9; //任务标题 + int32 sign_day = 10; //签到天数 + } + message UserLevelOne { + int64 level_id = 1; //用户类型id + string level_title = 2; //用户类型标题 + repeated Reward rewards = 3; //奖品 + } + message LangOne { + string lang_mark = 1; //语言标识 + repeated Reward rewards = 2; //奖品 + } + message LangUserLevelOne { + string lang_mark = 1; //语言标识 + repeated UserLevelOne level_list = 2; //奖品 + } + message CountryOne { + string country_mark = 1; //国家标识 + repeated Reward rewards = 2; //奖品 + } + int32 reward_group = 1; //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品) + repeated Reward normal = 2; //常规奖品 + repeated UserLevelOne user_level = 3; //用户类型奖品 + repeated LangOne langs = 4; //语言奖品 + repeated LangUserLevelOne lang_user_level = 5; //语言+用户类型奖品 + repeated CountryOne country = 6; //国家奖品 + repeated Reward step_reward = 7; //阶梯奖品 + repeated Reward extra_reward = 8; //额外奖品 + repeated Reward newcomer_reward = 9; //新人奖品 + int64 all = 10; //活动总预算 + int64 all_use = 11; //已使用的活动预算 + repeated string reward_type = 12; //奖品tab集合(app-活动主奖品,app_sign-签到活动主奖品,extra-额外奖品,step-阶梯奖,newcomer-新人奖,pool-奖池记录,task-任务奖励) + int32 show_all = 13; //是否展示总预算模块(0-否,1-是) + int32 show_select = 14; //是否显示选择数(0-否,1-是) + repeated Reward task_reward = 15; //任务奖品 + repeated Pool pools = 16; //奖池记录 + repeated Schedule schedules = 17; //赛程记录 + repeated UnoCard uno_cards = 18; //uno卡牌奖励 +} + +message UpdateStockReq { + int64 id = 1; //奖品id + int32 stock = 2; //修改的库存值 + int64 user_id = 3; //修改的 + string ip = 4; //ip地址 +} + +message UpdateStockRes { +} + +message CampaignTzReq { + int64 id = 1; //活动id +} + +message CampaignTzRes { + message One { + string mark = 1; //语言标识 + int32 t_offset = 2; //语言对应的时区 + } + repeated One list = 1; //语言数据 +} + +message CampaignRewardTypeReq { + int64 id = 1; //活动id +} + +message CampaignRewardTypeRes { + message One { + int64 id = 1; //奖品id + int32 reward_type = 2; //奖品类型 + } + repeated One list = 1; //语言数据 +} + +message ChildListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 project_id = 3; //项目id + string project_hash_id = 4; //项目hash_id + string title = 5; //活动标题筛选 + repeated int32 status = 6; //活动状态(1-待发布,2-已发布,3-已下线) + repeated int32 child_type = 7; //子活动类型 + repeated int64 fission_id = 8; //活动类型标识 + repeated int64 campaign_id = 9; //绑定的活动id + int64 start = 10; //活动时间开始时间戳 + int64 end = 11; //活动时间结束时间戳 + repeated int64 pids = 12; //上级活动id +} + +message ChildListRes { + message One { + int64 id = 1; //活动ID + string hash_id = 2; //活动对外id + string title = 3; //活动标题 + int64 fission_id = 4; //玩法ID + string fission_mark = 5; //活动类型玩法标识 + int64 start_time = 6; //开始时间时间戳 + int64 end_time = 7; //结束时间时间戳 + int32 status = 8; //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + int32 child_type = 9; //子活动类型 + string bind_campaign = 10; //绑定的活动名称 + int32 has_report = 11; //是否有报表 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message ChildStoreReq { + message TaskGroup { + int32 open = 1; //是否开启 + int32 chance = 2; //完成任务获得的数量(如:骰子数) + Reward reward = 3; //奖品 + string prop_mark = 4; //奖励的道具类型(chance-道具数量,reward-奖品) + repeated Cond conds = 5; //任务 + } + message Reward { + int64 reward_id = 1; //奖品库的奖品id + int32 stock = 2; //奖品库存 + int32 invite_num = 3; //需要邀请的人数 + int32 reward_num = 4; //获得的奖品数量 + int32 is_thank = 5; //是否谢谢参与(0-否,1-是) + int32 score = 6; //领取奖品的分数 + int32 sign_day = 7; //签到天数 + int32 collect_num = 8; //收集碎片数 + int32 is_super = 9; //是否超级大奖(0-否,1-是) + int32 help = 10; //开启下载助力(0-否,1-是) + double help_percent = 11; //每个下载获得的进度比率 + int32 click = 12; //开启点击助力(0-否,1-是) + double click_percent = 13; //每个点击助力获得的进度比率 + double click_percent_limit = 14; //可获得的最大点击助力获得的进度比率 + int32 open = 15; //开启拉日活(0-否,1-是) + double open_percent = 16; //每个拉日活力获得的进度比率 + double open_percent_limit = 17; //可获得的最大拉日活获得的进度比率 + int32 odds = 18; //中奖率 + string jump_url = 19; //跳转地址 + int32 campaign_limit = 20; //活动内单个用户可获取该奖品次数 + int32 register = 21; //开启注册助力(0-否,1-是) + double register_percent = 22; //每个注册获得的进度比率 + double init_percent = 23; //初始助力进度 + string prop_mark = 24; //奖励的道具类型(chance-道具数量,reward-奖品) + } + message Cond { + string event = 1; //事件关键字 + string event_key = 2; //事件key + string event_val = 3; //事件值 + string desc = 4; //条件描述 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 task_limit = 6; //任务次数限制 + int32 chance = 7; //完成任务获得的数量(如:骰子数) + int32 trigger_type = 8; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 day_limit = 9; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 10; //限制的用户类型id集合 + int32 event_type = 11; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 12; //广告观看路径(1-APP内,2-APP外) + repeated string lang_marks = 13; //限制的语言集合 + int32 watch_sec = 14; //观看秒数 + int32 week_limit = 15; //广告观看次数 + int32 week_num = 16; //观看秒数 + int32 open_jump = 17; //开启活动跳转(0-否,1-是) + string web_url = 18; //web端url长度 + string extra_param = 19; //附加参数 + int32 go_show = 20; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 21; //策略id + int32 is_super = 22; //是否超级任务(0-否,1-是) + int32 has_pre = 23; //是否有前置条件(0-否,1-是) + int32 pre_cond = 24; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + int32 expired_min = 25; //过期分钟数 + Reward reward = 26; //奖品 + string prop_mark = 27; //奖励的道具类型(chance-道具数量,reward-奖品) + int32 sort = 28; //排序 + string pc_param = 29; //pc端附加参数 + } + string project_id = 1; //项目id + int64 user_id = 2; //员工id + string ip = 3; //操作ip + string title = 4; //活动标题 + int64 fission_id = 5; //玩法id + int64 start_time = 6; //开始时间时间戳 + int64 end_time = 7; //结束时间时间戳 + int32 child_type = 8; //子活动类型 + int32 play_type = 9; //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率) + repeated Reward rewards = 10; //奖品 + TaskGroup win_1 = 11; //任务组1 + TaskGroup win_2 = 12; //任务组2 + TaskGroup win_3 = 13; //任务组3 +} + +message ChildStoreRes { + int64 id = 1; //id + string hash_id = 2; //活动id +} + +message ChildUpdateReq { + message TaskGroup { + int32 open = 1; //是否开启 + int32 chance = 2; //完成任务获得的数量(如:骰子数) + Reward reward = 3; //奖品 + string prop_mark = 4; //奖励的道具类型(chance-道具数量,reward-奖品) + repeated Cond conds = 5; //任务 + } + message Reward { + int64 id = 1; //奖品id + int64 reward_id = 2; //奖品库的奖品id + int32 stock = 3; //奖品库存 + int32 invite_num = 4; //需要邀请的人数 + int32 reward_num = 5; //获得的奖品数量 + int32 is_thank = 6; //是否谢谢参与(0-否,1-是) + int32 score = 7; //领取奖品的分数 + int32 sign_day = 8; //签到天数 + int32 collect_num = 9; //收集碎片数 + int32 is_super = 10; //是否超级大奖(0-否,1-是) + int32 help = 11; //开启下载助力(0-否,1-是) + double help_percent = 12; //每个下载获得的进度比率 + int32 click = 13; //开启点击助力(0-否,1-是) + double click_percent = 14; //每个点击助力获得的进度比率 + double click_percent_limit = 15; //可获得的最大点击助力获得的进度比率 + int32 open = 16; //开启拉日活(0-否,1-是) + double open_percent = 17; //每个拉日活力获得的进度比率 + double open_percent_limit = 18; //可获得的最大拉日活获得的进度比率 + int32 odds = 19; //中奖率 + string jump_url = 20; //跳转地址 + int32 campaign_limit = 21; //活动内单个用户可获取该奖品次数 + int32 register = 22; //开启注册助力(0-否,1-是) + double register_percent = 23; //每个注册获得的进度比率 + double init_percent = 24; //初始助力进度 + string prop_mark = 25; //奖励的道具类型(chance-道具数量,reward-奖品) + } + message Cond { + string event = 1; //事件关键字 + string event_key = 2; //事件key + string event_val = 3; //事件值 + string desc = 4; //条件描述 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 task_limit = 6; //任务次数限制 + int32 chance = 7; //完成任务获得的数量(如:骰子数) + int32 trigger_type = 8; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 day_limit = 9; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 10; //限制的用户类型id集合 + int32 event_type = 11; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 12; //广告观看路径(1-APP内,2-APP外) + repeated string lang_marks = 13; //限制的语言集合 + int32 watch_sec = 14; //观看秒数 + int32 week_limit = 15; //广告观看次数 + int32 week_num = 16; //观看秒数 + int32 open_jump = 17; //开启活动跳转(0-否,1-是) + string web_url = 18; //web端url长度 + string extra_param = 19; //附加参数 + int32 go_show = 20; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 21; //策略id + int32 is_super = 22; //是否超级任务(0-否,1-是) + int32 has_pre = 23; //是否有前置条件(0-否,1-是) + int32 pre_cond = 24; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + int32 expired_min = 25; //过期分钟数 + Reward reward = 26; //奖品 + string prop_mark = 27; //奖励的道具类型(chance-道具数量,reward-奖品) + int32 sort = 28; //排序 + string pc_param = 29; //pc端附加参数 + } + int64 id = 1; //活动id + string hash_id = 2; //活动id + int64 user_id = 3; //员工id + string ip = 4; //操作ip + string title = 5; //活动标题 + int64 fission_id = 6; //玩法id + int64 start_time = 7; //开始时间时间戳 + int64 end_time = 8; //结束时间时间戳 + int32 child_type = 9; //子活动类型 + int32 play_type = 10; //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率) + repeated Reward rewards = 11; //奖品 + TaskGroup win_1 = 12; //任务组1 + TaskGroup win_2 = 13; //任务组2 + TaskGroup win_3 = 14; //任务组3 +} + +message ChildUpdateRes { + int64 id = 1; //id + string hash_id = 2; //活动id +} + +message ChildShowReq { + int64 id = 1; //id + string hash_id = 2; //活动id +} + +message ChildShowRes { + message TaskGroup { + int32 open = 1; //是否开启 + int32 chance = 2; //完成任务获得的数量(如:骰子数) + Reward reward = 3; //奖品 + string prop_mark = 4; //奖励的道具类型(chance-道具数量,reward-奖品) + repeated Cond conds = 5; //任务 + } + message Reward { + int64 id = 1; //活动奖品id + int64 reward_id = 2; //奖品库的奖品id + int32 stock = 3; //奖品库存 + int32 invite_num = 4; //需要邀请的人数 + int32 reward_num = 5; //获得的奖品数量 + int32 is_thank = 6; //是否谢谢参与(0-否,1-是) + int32 score = 7; //领取奖品的分数 + int32 sign_day = 8; //签到天数 + int32 collect_num = 9; //收集碎片数 + int32 is_super = 10; //是否超级大奖(0-否,1-是) + repeated KV kv_data = 11; //奖品自定义参数数据 + string title = 12; //奖品名称 + string img_url = 13; //奖品图片 + int32 receive_type = 14; //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-提交表单) + string contact = 15; //联系方式 + string url = 16; //回调地址 + int32 help = 17; //开启下载助力(0-否,1-是) + double help_percent = 18; //每个下载获得的进度比率 + int32 click = 19; //开启点击助力(0-否,1-是) + double click_percent = 20; //每个点击助力获得的进度比率 + double click_percent_limit = 21; //可获得的最大点击助力获得的进度比率 + int32 open = 22; //开启拉日活(0-否,1-是) + double open_percent = 23; //每个拉日活力获得的进度比率 + double open_percent_limit = 24; //可获得的最大拉日活获得的进度比率 + string lang_mark = 25; //奖品语言标识 + int32 odds = 26; //中奖率 + string jump_url = 27; //跳转地址 + string form_title = 28; //表单标题 + int32 campaign_limit = 29; //活动内单个用户可获取该奖品次数 + int32 register = 30; //开启注册助力(0-否,1-是) + double register_percent = 31; //每个注册获得的进度比率 + double init_percent = 32; //初始助力进度 + string prop_mark = 33; //奖励的道具类型(chance-道具数量,reward-奖品) + } + message Cond { + string event = 1; //事件关键字 + string event_key = 2; //事件key + string event_val = 3; //事件值 + string desc = 4; //条件描述 + int32 if_cond = 5; //等式(0-等于,1-大于等于,2-累计) + int32 task_limit = 6; //任务次数限制 + int32 chance = 7; //完成任务获得的数量(如:骰子数) + int32 trigger_type = 8; //事件触发条件(1-点击去完成按钮,2-全局监听) + int32 day_limit = 9; //每日任务次数限制(0为不限制) + repeated int64 level_ids = 10; //限制的用户类型id集合 + int32 event_type = 11; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 12; //广告观看路径(1-APP内,2-APP外) + repeated string lang_marks = 13; //限制的语言集合 + int32 watch_sec = 14; //观看秒数 + int32 week_limit = 15; //广告观看次数 + int32 week_num = 16; //观看秒数 + int32 open_jump = 17; //开启活动跳转(0-否,1-是) + string web_url = 18; //web端url长度 + string extra_param = 19; //附加参数 + int32 go_show = 20; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 21; //策略id + int32 is_super = 22; //是否超级任务(0-否,1-是) + int32 has_pre = 23; //是否有前置条件(0-否,1-是) + int32 pre_cond = 24; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) + int32 expired_min = 25; //过期分钟数 + Reward reward = 26; //奖品 + string prop_mark = 27; //奖励的道具类型(chance-道具数量,reward-奖品) + int32 sort = 28; //排序 + string pc_param = 29; //pc端附加参数 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + string title = 1; //活动标题 + int64 fission_id = 2; //玩法id + int64 t_start = 3; //开始时间时间戳 + int64 t_end = 4; //结束时间时间戳 + int32 child_type = 5; //子活动类型 + int32 play_type = 6; //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率) + repeated Reward rewards = 7; //奖品 + TaskGroup win_1 = 8; //任务组1 + TaskGroup win_2 = 9; //任务组2 + TaskGroup win_3 = 10; //任务组3 +} + +message TaskCenterJumpReq { + string center_hash_id = 1; //任务中心hash_id + int64 module_id = 2; //模块id + repeated int64 cpn_ids = 3; //活动id +} + +message TaskCenterJumpRes { + message One { + int64 id = 1; //活动ID + string jump_url = 2; //跳转地址 + } + repeated One list = 1; //列表数据 +} + +message CondListReq { + repeated int64 ids = 1; //任务id +} + +message CondListRes { + message One { + int64 id = 1; //任务id + string desc = 2; //条件描述 + string event = 3; //事件关键字 + repeated Cond conds = 4; //事件key + } + message Cond { + string event_key = 1; //事件key + string event_val = 2; //事件值 + int32 if_cond = 3; //等式(0-等于,1-大于等于,2-累计) + } + repeated One list = 1; //数据集合 +} + +message CampaignsReq { + int64 project_id = 1; //项目id + repeated int64 campaign_ids = 2; //活动集合 +} + +message CampaignsRes { + message One { + int64 id = 1; //活动id + string title = 2; //活动标题 + } + repeated One list = 1; //列表数据 +} + +message SetLvApiReq { + string project_hash_id = 1; //项目hash_id + int64 url_id = 2; //地址id +} + +message SetLvApiRes { +} + +message GetLvApiReq { + string project_hash_id = 1; //项目hash_id +} + +message GetLvApiRes { + int64 url_id = 1; //地址id + string title = 2; //地址备注 +} + +message VsSettlementReq { + message Score { + int64 team_id = 1; //队伍id + string score = 2; //胜利得分 + } + string campaign_hash_id = 1; //活动hash_id + int64 schedule_id = 2; //赛事id + int64 win_team_id = 3; //胜利队伍id + repeated Score scores = 4; //队伍得分 +} + +message VsSettlementRes { + message PkTeam { + int64 id = 1; //比赛id + repeated Team teams = 2; //队伍集合 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + int32 schedule_id = 1; //赛程id + PkTeam pk_team = 2; //比赛数据 +} + +message VsSettlementInfoReq { + string campaign_hash_id = 1; //活动hash_id + int64 schedule_id = 2; //赛事id +} + +message VsSettlementInfoRes { + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + string score = 4; //胜利得分 + } + int32 win_type = 1; //结算获奖类型(1-队伍胜利,2-平局) + int64 win_team_id = 2; //胜利队伍id + repeated Team teams = 3; //队伍数据 +} + +message ActionListReq { + int64 campaign_id = 1; //活动id +} + +message ActionListRes { + repeated int32 action_types = 1; //行为集合 +} diff --git a/proto/proto/w_campaign_stat.proto b/proto/proto/w_campaign_stat.proto new file mode 100644 index 0000000..6a08080 --- /dev/null +++ b/proto/proto/w_campaign_stat.proto @@ -0,0 +1,526 @@ +syntax = "proto3"; + +package w_campaign_statpb; +option go_package = './;w_campaign_statpb'; + +//活动统计服务 +service WCampaignStat { + +// Summary 活动概览数据 +rpc Summary(SummaryReq) returns (SummaryRes) {} +// Campaign 活动数据 +rpc Campaign(CampaignReq) returns (CampaignRes) {} +// Related 裂变数据 +rpc Related(RelatedReq) returns (RelatedRes) {} +// Stat 统计事件数据 +rpc Stat(StatReq) returns (StatRes) {} +// Channel 渠道统计 +rpc Channel(ChannelReq) returns (ChannelRes) {} +// AdsSummary Ads总揽数据 +rpc AdsSummary(AdsSummaryReq) returns (AdsSummaryRes) {} +// AdsTable Ads报表 +rpc AdsTable(AdsTableReq) returns (AdsTableRes) {} +// AdsReward Ads奖品 +rpc AdsReward(AdsRewardReq) returns (AdsRewardRes) {} +// InAppBP 应用内埋点 +rpc InAppBP(InAppBPReq) returns (InAppBPRes) {} +// ChildBP 应用内埋点 +rpc ChildBP(ChildBPReq) returns (ChildBPRes) {} +// OutAppBP 应用外埋点 +rpc OutAppBP(OutAppBPReq) returns (OutAppBPRes) {} +// ReportInfo 报表信息 +rpc ReportInfo(ReportInfoReq) returns (ReportInfoRes) {} +// StatEvent 活动统计的维度 +rpc StatEvent(StatEventReq) returns (StatEventRes) {} +// DemTitle 维度标题数据 +rpc DemTitle(DemTitleReq) returns (DemTitleRes) {} +// TopTen 活动前十排行榜 +rpc TopTen(TopTenReq) returns (TopTenRes) {} +// UserCycle 用户明细占比数据 +rpc UserCycle(UserCycleReq) returns (UserCycleRes) {} +// Active 用户活跃 +rpc Active(ActiveReq) returns (ActiveRes) {} +// ChildReportInfo 子活动报表信息 +rpc ChildReportInfo(ChildReportInfoReq) returns (ChildReportInfoRes) {} + +} + +message SummaryReq { + int64 campaign_id = 1; //活动id + string campaign_hash_id = 2; //活动hash_id +} + +message SummaryRes { + message EventData { + int64 target_num = 1; //达标次数 + int64 target_user_num = 2; //达标人数 + repeated Cond conds = 3; //事件数据 + } + message Cond { + string event = 1; //事件关键字 + string event_key = 2; //标识说明 + int64 num = 3; //触发次数 + int64 user_num = 4; //触发人数 + double total = 5; //累计总值 + int32 if_cond = 6; //等式(0-等于,1-大于等于,2-累计) + } + message Grow { + int64 total = 1; //总养成人数 + int64 today = 2; //今日养成人数 + } + string title = 1; //列表数据 + int64 start_time = 2; //活动开始时间时间戳 + int64 end_time = 3; //活动结束时间时间戳 + int32 status = 4; //活动状态(1-待发布,2-已发布,3-下线) + int64 install_num = 5; //下载次数|注册次数 + int64 share_user_num = 6; //邀请按钮点击人数 + int64 view_num = 7; //访问总次数 + int64 view_user_num = 8; //访问总人数 + int64 max_deep = 9; //最高裂变层级 + int64 today_view_num = 10; //今日访问次数 + int64 today_user_num = 11; //今日参与人数 + string cover_url = 12; //活动名称 + int32 target = 13; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + EventData event_data = 14; //事件统计数据 + int32 option = 15; //目标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗) + int32 type = 16; //报表类型(1-下载,2-注册,3-事件,4-报表,5-养成) + int64 sign_num = 17; //总签到人数 + int64 sign_target_num = 18; //总签到达标人数 + int64 today_sign_num = 19; //今日总签到人数 + int64 today_sign_target_num = 20; //今日总签到达标人数 + Grow grow = 21; //养成类型特定统计参数 +} + +message CampaignReq { + int64 campaign_id = 1; //活动id + string campaign_hash_id = 2; //活动hash_id + int64 start_time = 3; //统计开始时间时间戳 + int64 end_time = 4; //统计结束时间时间戳 +} + +message CampaignRes { + message Y { + int32 type = 1; //线类型 + string name = 2; //标识说明 + repeated int64 data = 3; //数据 + } + message Report { + int64 view_num = 1; //活动页面访问人数 + string fun = 2; //活动兴趣度,如(2.5) + string change = 3; //活动转化率,如(2.5) + repeated Y y = 4; //展示的线数据 + string target = 5; //活动达标率,如(2.5) + int64 target_num = 6; //活动达标数 + string sign = 7; //签到达标率,如(2.5) + int64 sign_num = 8; //签到数 + string grow = 9; //养成达标率,如(2.5) + } + repeated string x = 1; //x轴 + Report report_user = 2; //人数报告 + Report report_num = 3; //次数报告 + int32 show_type = 4; //展示类型(1-活动访问,2-达标条件,3-签到,4-养成) +} + +message RelatedReq { + int64 campaign_id = 1; //活动id + string campaign_hash_id = 2; //活动hash_id + int64 start_time = 3; //统计开始时间时间戳 + int64 end_time = 4; //统计结束时间时间戳 +} + +message RelatedRes { + message Y { + int32 type = 1; //线类型 + string name = 2; //标识说明 + repeated int64 data = 3; //数据 + } + message Report { + string share = 1; //邀请链接曝光转化,如(2.5) + string wechat = 2; //微信页转化率,如(2.5) + string download = 3; //下载页转化率,如(2.5) + repeated Y y = 4; //展示的线数据 + string media = 5; //社媒分享转化率,如(2.5) + int64 media_num = 6; //社媒总数 + repeated MediaData media_data = 7; //社媒数据 + } + message MediaData { + string name = 1; //社媒名称 + int64 total = 2; //总数 + } + repeated string x = 1; //x轴 + Report report_user = 2; //人数报告 + Report report_num = 3; //次数报告 +} + +message StatReq { + string campaign_hash_id = 1; //活动hash_id + int32 behavior_type = 2; //用户行为类型 + int64 behavior_time = 3; //用户行为时间 + string ip = 4; //用户ip + string os = 5; //系统 + string os_ver = 6; //用户版本 + string device_model = 7; //设备型号 + string sub_user_id = 8; //活动用户外部id + string parent_user_id = 9; //用户上级用户外部id + int64 media_id = 10; //社媒id + string c_mark = 11; //渠道标识 + string icon = 12; //图标标识(invite-邀请框icon) + string wid = 13; //浏览器id +} + +message StatRes { +} + +message ChannelReq { + string campaign_hash_id = 1; //活动hash_id + int32 c_type = 2; //渠道类型(1-站内渠道,2-站外渠道) + int64 start_time = 3; //统计开始时间时间戳 + int64 end_time = 4; //统计结束时间时间戳 + int32 page = 5; //当前页 + int32 per_page = 6; //每页条数 +} + +message ChannelRes { + message One { + int64 id = 1; //渠道id + string title = 2; //渠道名称 + string url = 3; //渠道链接 + int64 click_num = 4; //点击次数 + int64 click_user_num = 5; //点击人数 + int64 install_num = 6; //安装数 + int64 open_num = 7; //打开app次数 + int64 open_user_num = 8; //打开app人数 + int64 install_user_num = 9; //安装人数 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message AdsSummaryReq { + string campaign_hash_id = 1; //活动hash_id +} + +message AdsSummaryRes { + int64 visitor_num = 1; //访问量 + int64 visitor_num_today = 2; //今日访问量 + int64 visitor_num_yesterday = 3; //昨日访问量 + int64 visitor_user = 4; //访问人数 + int64 visitor_user_today = 5; //今日访问人数 + int64 visitor_user_yesterday = 6; //昨日访问人数 + string visitor_user_day_compare = 7; //访问人数日坏比 + int32 visitor_user_day_compare_up = 8; //访问人数日坏比趋势,0-无变化,1-上涨,2-下降 + int64 install_num = 9; //下载量 + int64 install_num_today = 10; //今日下载量 + int64 install_num_yesterday = 11; //昨日下载量 + int64 install_user = 12; //下载人数 + int64 install_user_today = 13; //今日下载人数 + int64 install_user_yesterday = 14; //昨日下载人数 + string install_user_day_compare = 15; //下载人数日坏比 + int32 install_user_day_compare_up = 16; //下载人数日坏比趋势,0-无变化,1-上涨,2-下降 + int64 reward_user_app_today = 17; //今日领奖人数 +} + +message AdsTableReq { + string campaign_hash_id = 1; //活动hash_id + int64 start_time = 2; //统计开始时间时间戳 + int64 end_time = 3; //统计结束时间时间戳 +} + +message AdsTableRes { + message Y { + string type = 1; //线类型(app_install-安装,view-访问) + repeated int64 data = 2; //y轴数据 + } + int64 visitor_user = 1; //区间访问人数 + int64 install_user = 2; //区间下载人数 + string install_user_compare = 3; //下载转化率 + repeated string x = 4; //x轴 + repeated Y y = 5; //x轴 +} + +message AdsRewardReq { + string campaign_hash_id = 1; //活动hash_id +} + +message AdsRewardRes { + message Reward { + int64 id = 1; //活动奖品id + string title = 2; //奖品标题 + int64 web_num = 3; //奖品发放总数 + string web_compare = 4; //奖品发放占比 + int64 app_num = 5; //奖品领取总数 + string app_compare = 6; //奖品领取占比 + string compare = 7; //领奖率 + } + int64 web_num = 1; //奖品发放总数 + int64 app_num = 2; //奖品领取总数 + repeated Reward rewards = 3; //奖品列表 +} + +message InAppBPReq { + int32 type = 1; //埋点类型(1-访问活动,5-活动按钮点击,6-点击分享按钮,10-点击去完成,18-点击去使用,19-点击长图) + int64 user_id = 2; //用户id + int64 media_id = 3; //社媒id + int64 cond_id = 4; //条件ID + int64 reward_id = 5; //奖品id + string ip = 6; //访问ip + string img_url = 7; //图片地址 + string from = 8; //埋点类型来源 + string form_show_status = 9; //展示的表单状态 + int64 reward_record_id = 10; //奖品领取记录id + string os = 11; //系统 + string os_version = 12; //系统版本 + string device_model = 13; //系统型号 + int64 campaigin_id = 14; //活动id + int64 qa_id = 15; //题目id + int64 qa_option_id = 16; //选择的选项id + int32 is_right = 17; //是否正确答案(-1:不正确,1:正确) + int64 img_id = 18; //长图id + int64 zone_id = 19; //热区id + string click_flip_status = 20; //点击立即翻牌状态(有抽奖机会 - has_lucky,没有抽奖机会 - none_lucky) + int64 custom_btn_id = 21; //自定义按钮id + string chat_from = 22; //进入ai对话来源(icon-图标,tip-宠物文案) + string chat_tip_msg = 23; //tip宠物文案内容 + string color_mark = 24; //uno颜色 + string card_no = 25; //uno牌型 + int64 uno_card_id = 26; //uno卡Id +} + +message InAppBPRes { +} + +message ChildBPReq { + int64 user_id = 1; //用户id + int64 campaigin_id = 2; //活动id + string child_hash_id = 3; //子活动id + int32 type = 4; //埋点类型(43-打开子活动入口) +} + +message ChildBPRes { +} + +message OutAppBPReq { + int32 type = 1; //埋点类型(12-访问站外链接,13-站外活动按钮点击,7-浏览下载页行为, 8-点击下载按钮,9-浏览微信页行为) + string campaign_hash_id = 2; //活动hash_id + string web_id = 3; //用户id + string download_from = 4; //下载页来源 + string parent_user_id = 5; //上级用户id + string lang = 6; //语言标识 + string ip = 7; //访问ip + string cid = 8; //渠道标识 + string platform = 9; //平台 + string os = 10; //系统 + string os_version = 11; //系统版本 + string device_model = 12; //系统型号 + string blackbox = 13; //黑盒数据 + string uid = 14; //第三方用户id +} + +message OutAppBPRes { +} + +message ReportInfoReq { + string hash_id = 1; //活动hash_id +} + +message ReportInfoRes { + message LangOffset { + int32 t_offset = 1; //语言标识 + string lang_mark = 2; //时区偏移值 + } + message Event { + int32 type = 1; //活动奖品id + repeated Dimension dimensions = 2; //维度数据 + } + message Dimension { + string key = 1; //活动奖品id + } + string hash_id = 1; //活动对外id + string title = 2; //活动标题 + string cover_url = 3; //活动封面 + string fission_mark = 4; //玩法标识 + int64 start_time = 5; //开始时间时间戳 + int64 end_time = 6; //结束时间时间戳 + int32 status = 7; //发布状态(1-待发布,2-已发布,3-已下线) + int32 t_offset = 8; //时间偏移量 + int32 target = 9; //活动目标 + repeated Event events = 10; //支持的埋点事件 + repeated Dimension fix_dimensions = 11; //固定维度 + repeated LangOffset lang_offset = 12; //语言时区 + int32 open_fixed = 13; //开始固定事件(0-否,1-是) + int32 open_custom = 14; //开始自定义事件(0-否,1-是) + repeated string reward_type = 15; //奖品tab集合(app-活动主奖品,extra-额外奖品,step-阶梯奖,newcomer-新人奖) + int32 show_all = 16; //是否展示总预算模块(0-否,1-是) + int32 show_select = 17; //是否显示选择数(0-否,1-是) +} + +message StatEventReq { + string campaign_hash_id = 1; //活动hash_id + int64 campaign_id = 2; //活动id + string lang_mark = 3; //活动hash_id +} + +message StatEventRes { + message Task { + int64 id = 1; //任务id + string title = 2; //任务名称 + } + int64 campaign_id = 1; //活动id + int32 t_offect = 2; //时区 + repeated int32 event_ids = 3; //事件ids + repeated Task tasks = 4; //任务数据 + repeated string help_event = 5; //助力事件 +} + +message DemTitleReq { + string campaign_hash_id = 1; //活动hash_id + repeated int64 reward_ids = 2; //奖品id集合 + repeated int64 cond_ids = 3; //任务id集合 + repeated int64 media_ids = 4; //社媒id集合 + repeated int64 channel_ids = 5; //渠道id集合 + repeated int64 level_ids = 6; //用户类型id集合 + repeated int64 qa_ids = 7; //题库题目id集合 + repeated int64 qa_option_ids = 8; //题库题目选项id集合 + repeated int64 qa_group_ids = 9; //题库id集合 + repeated int64 scene_ids = 10; //场次集合 + repeated int64 custom_btn_ids = 11; //自定义按钮id集合 + repeated int64 taskIds = 12; //任务id集合 + repeated int64 parent_ids = 13; //上级用户id集合 + int64 campaign_id = 14; //活动id + repeated int64 img_ids = 15; //长图id集合 + repeated int64 zone_ids = 16; //热区id集合 + repeated int64 cpn_ids = 17; //活动id集合 + repeated int64 schedule_ids = 18; //活动时间id集合 + repeated int64 mall_ids = 19; //商城id集合 + repeated int64 mall_item_ids = 20; //商城商品id集合 + repeated int64 uno_card_ids = 21; //uno卡id集合 +} + +message DemTitleRes { + message Title { + string mark = 1; //字符串标识 + int64 id = 2; //标识 + string title = 3; //说明 + int64 second_id = 4; //二级标识 + } + message Schedule { + int64 id = 1; //赛程id + string title = 2; //说明 + repeated Team teams = 3; //队伍数据 + } + message Team { + int64 id = 1; //标识 + string title = 2; //说明 + } + int64 campaign_id = 1; //活动id + int32 t_offect = 2; //时区 + repeated Title conds = 3; //任务数据 + repeated Title media = 4; //社媒数据 + repeated Title channel = 5; //渠道数据 + repeated Title rewards = 6; //奖品数据 + repeated Title user_lv = 7; //用户等级 + repeated Title qa = 8; //题库题目 + repeated Title qa_option = 9; //题库题目选项 + repeated Title qa_group = 10; //题库题目选项 + repeated Title scenes = 11; //场次 + repeated Title custom_btn = 12; //按钮文案 + repeated Title tasks = 13; //任务文案 + repeated Title parents = 14; //上级用户 + repeated Title imgs = 15; //长图参数 + repeated Title zones = 16; //热区 + repeated Title cpns = 17; //活动 + repeated Schedule schedules = 18; //活动时间 + repeated Title malls = 19; //商城 + repeated Title mall_items = 20; //商城商品 + repeated Title uno_cards = 21; //uno卡 +} + +message TopTenReq { + string campaign_hash_id = 1; //活动hash_id +} + +message TopTenRes { + message Invite { + int32 rank = 1; //排名 + string user_id = 2; //用户id + int64 effect_num = 3; //有效邀请人数 + int64 invite_num = 4; //邀请总人数 + } + message Event { + int32 rank = 1; //排名 + string user_id = 2; //用户id + int64 num = 3; //数量 + repeated Cond conds = 4; //具体达标条件数据 + } + message Cond { + string desc = 1; //条件说明 + int64 num = 2; //数量 + } + message Grow { + int32 rank = 1; //排名 + string user_id = 2; //用户id + int64 grow_num = 3; //领养数量 + int64 grow_reward_num = 4; //养成数量 + } + message Help { + int32 rank = 1; //排名 + string user_id = 2; //用户id + int64 num = 3; //助力数量 + repeated Detail detail = 4; //领养详情 + } + message Detail { + string title = 1; //标题 + int64 num = 2; //数量 + } + message Sign { + int32 rank = 1; //排名 + string user_id = 2; //用户id + int64 sign_day = 3; //签到天数 + int64 sign_reward_num = 4; //签到达标数 + } + int64 max_lv = 1; //最高裂变层级 + repeated Invite invite = 2; //邀请人数 + repeated Event event = 3; //任务数据 + repeated Grow grow = 4; //领养数据 + repeated Help help = 5; //助力数据 + repeated Sign sign = 6; //签到排行榜 +} + +message UserCycleReq { + string campaign_hash_id = 1; //活动hash_id +} + +message UserCycleRes { + message One { + string mark = 1; //占比标识(platform-平台占比,channel-渠道占比,media-社媒占比) + repeated Part parts = 2; //占比数据 + } + message Part { + string title = 1; //标题 + int64 num = 2; //数量 + } + repeated One list = 1; //最高裂变层级 +} + +message ActiveReq { + int64 user_id = 1; //用户id + int64 campaign_id = 2; //活动id +} + +message ActiveRes { +} + +message ChildReportInfoReq { + string hash_id = 1; //活动hash_id +} + +message ChildReportInfoRes { + string hash_id = 1; //活动对外id + string title = 2; //活动标题 + int64 start_time = 3; //开始时间时间戳 + int64 end_time = 4; //结束时间时间戳 + int32 status = 5; //发布状态(1-待发布,2-已发布,3-已下线) + int32 t_offset = 6; //时间偏移量 + int32 child_type = 7; //子活动类型 + string p_title = 8; //父活动标题 +} diff --git a/proto/proto/w_campaign_user.proto b/proto/proto/w_campaign_user.proto new file mode 100644 index 0000000..586a7eb --- /dev/null +++ b/proto/proto/w_campaign_user.proto @@ -0,0 +1,2504 @@ +syntax = "proto3"; + +package w_campaign_userpb; +option go_package = './;w_campaign_userpb'; + +//活动用户服务 +service WCampaignUser { + +// List 用户列表 +rpc List(ListReq) returns (ListRes) {} +// Reward 用户奖励 +rpc Reward(RewardReq) returns (RewardRes) {} +// Visit 访问活动 +rpc Visit(VisitReq) returns (VisitRes) {} +// Play 用户活动数据 +rpc Play(PlayReq) returns (PlayRes) {} +// RewardUser 中奖用户列表 +rpc RewardUser(RewardUserReq) returns (RewardUserRes) {} +// Info 用户信息 +rpc Info(InfoReq) returns (InfoRes) {} +// Rank 排行榜 +rpc Rank(RankReq) returns (RankRes) {} +// Lottery 活动抽奖 +rpc Lottery(LotteryReq) returns (LotteryRes) {} +// Answer 活动答题 +rpc Answer(AnswerReq) returns (AnswerRes) {} +// AnswerHistory 答题历史 +rpc AnswerHistory(AnswerHistoryReq) returns (AnswerHistoryRes) {} +// Vote 活动投票 +rpc Vote(VoteReq) returns (VoteRes) {} +// Notify 客户端回调 +rpc Notify(NotifyReq) returns (NotifyRes) {} +// AcceptReward 领取奖品 +rpc AcceptReward(AcceptRewardReq) returns (AcceptRewardRes) {} +// TargetRule 达标规则 +rpc TargetRule(TargetRuleReq) returns (TargetRuleRes) {} +// Task 我的任务 +rpc Task(TaskReq) returns (TaskRes) {} +// Resend 补发奖品 +rpc Resend(ResendReq) returns (ResendRes) {} +// DynamicLink 获取用户动态链接 +rpc DynamicLink(DynamicLinkReq) returns (DynamicLinkRes) {} +// DylinkShow 获取用户动态链接详情 +rpc DylinkShow(DylinkShowReq) returns (DylinkShowRes) {} +// SignIn 我的签到板 +rpc SignIn(SignInReq) returns (SignInRes) {} +// Sign 签到 +rpc Sign(SignReq) returns (SignRes) {} +// DiceMap 大富翁地图 +rpc DiceMap(DiceMapReq) returns (DiceMapRes) {} +// Dice 大富翁骰子 +rpc Dice(DiceReq) returns (DiceRes) {} +// Grow 成长生命体 +rpc Grow(GrowReq) returns (GrowRes) {} +// GetGrow 成长生命体 +rpc GetGrow(GetGrowReq) returns (GetGrowRes) {} +// Feed 饲养生命体 +rpc Feed(FeedReq) returns (FeedRes) {} +// GetFeed 领取饲养道具 +rpc GetFeed(GetFeedReq) returns (GetFeedRes) {} +// GrowRecord 成长记录 +rpc GrowRecord(GrowRecordReq) returns (GrowRecordRes) {} +// ContentLink 内容链接 +rpc ContentLink(ContentLinkReq) returns (ContentLinkRes) {} +// LinkContent 链接内容 +rpc LinkContent(LinkContentReq) returns (LinkContentRes) {} +// ChopSelect 选择砍一刀奖品 +rpc ChopSelect(ChopSelectReq) returns (ChopSelectRes) {} +// ChopReselect 重选砍一刀奖品 +rpc ChopReselect(ChopReselectReq) returns (ChopReselectRes) {} +// ChopHelp 砍一刀助力记录 +rpc ChopHelp(ChopHelpReq) returns (ChopHelpRes) {} +// ProjectList 项目参与用户列表 +rpc ProjectList(ProjectListReq) returns (ProjectListRes) {} +// LevelList 用户等级列表 +rpc LevelList(LevelListReq) returns (LevelListRes) {} +// LevelStore 创建用户等级 +rpc LevelStore(LevelStoreReq) returns (LevelStoreRes) {} +// LevelEdit 更新用户等级 +rpc LevelEdit(LevelEditReq) returns (LevelEditRes) {} +// LevelDestroy 删除用户等级 +rpc LevelDestroy(LevelDestroyReq) returns (LevelDestroyRes) {} +// MarkLevel 用户等级标识列表 +rpc MarkLevel(MarkLevelReq) returns (MarkLevelRes) {} +// FinishStep 完成现金抽奖阶段 +rpc FinishStep(FinishStepReq) returns (FinishStepRes) {} +// Spin 现金转盘抽奖 +rpc Spin(SpinReq) returns (SpinRes) {} +// CashRecords 现金转盘记录 +rpc CashRecords(CashRecordsReq) returns (CashRecordsRes) {} +// MixReward 合成奖品 +rpc MixReward(MixRewardReq) returns (MixRewardRes) {} +// DiceRecord 骰子记录 +rpc DiceRecord(DiceRecordReq) returns (DiceRecordRes) {} +// RewardForm 奖品需要填写的表单 +rpc RewardForm(RewardFormReq) returns (RewardFormRes) {} +// SubmitForm 提交表单 +rpc SubmitForm(SubmitFormReq) returns (SubmitFormRes) {} +// GetAdsUrl 广告停留回传 +rpc GetAdsUrl(GetAdsUrlReq) returns (GetAdsUrlRes) {} +// AdsStay 广告停留回传 +rpc AdsStay(AdsStayReq) returns (AdsStayRes) {} +// ClueNotified 通知信息已经被接收 +rpc ClueNotified(ClueNotifiedReq) returns (ClueNotifiedRes) {} +// ChangeUserLevel 修改用户等级 +rpc ChangeUserLevel(ChangeUserLevelReq) returns (ChangeUserLevelRes) {} +// ChopReward 砍一刀可选奖品 +rpc ChopReward(ChopRewardReq) returns (ChopRewardRes) {} +// HelpPercent 助力进度 +rpc HelpPercent(HelpPercentReq) returns (HelpPercentRes) {} +// InvokeCond 触发前置条件 +rpc InvokeCond(InvokeCondReq) returns (InvokeCondRes) {} +// KeepReward 激励养成可选奖品 +rpc KeepReward(KeepRewardReq) returns (KeepRewardRes) {} +// KeepSelect 选择激励养成奖品 +rpc KeepSelect(KeepSelectReq) returns (KeepSelectRes) {} +// KeepCollect 激励养成收集一级道具 +rpc KeepCollect(KeepCollectReq) returns (KeepCollectRes) {} +// KeepFeed 激励养成收集一级道具 +rpc KeepFeed(KeepFeedReq) returns (KeepFeedRes) {} +// MachineSave 激励养成保存机器道具 +rpc MachineSave(MachineSaveReq) returns (MachineSaveRes) {} +// MachineRecycle 激励养成回收机器道具 +rpc MachineRecycle(MachineRecycleReq) returns (MachineRecycleRes) {} +// GetPropFeed 收喂养次数的道具 +rpc GetPropFeed(GetPropFeedReq) returns (GetPropFeedRes) {} +// KeepLog 激励养成记录 +rpc KeepLog(KeepLogReq) returns (KeepLogRes) {} +// KeepReselect 激励养成重新选择 +rpc KeepReselect(KeepReselectReq) returns (KeepReselectRes) {} +// KeepGuide 激励养成指引 +rpc KeepGuide(KeepGuideReq) returns (KeepGuideRes) {} +// KeepFirstInvite 激励养成首邀状态 +rpc KeepFirstInvite(KeepFirstInviteReq) returns (KeepFirstInviteRes) {} +// Child 子活动信息 +rpc Child(ChildReq) returns (ChildRes) {} +// ChildActive 参与子活动 +rpc ChildActive(ChildActiveReq) returns (ChildActiveRes) {} +// GoldFinishStep 完成金币任务阶段 +rpc GoldFinishStep(GoldFinishStepReq) returns (GoldFinishStepRes) {} +// GoldNotify 金币获取通知 +rpc GoldNotify(GoldNotifyReq) returns (GoldNotifyRes) {} +// GoldRecord 金币获取记录 +rpc GoldRecord(GoldRecordReq) returns (GoldRecordRes) {} +// Deduct 扣除积分 +rpc Deduct(DeductReq) returns (DeductRes) {} +// Gain 领取积分 +rpc Gain(GainReq) returns (GainRes) {} +// CoinRecord 金币池记录 +rpc CoinRecord(CoinRecordReq) returns (CoinRecordRes) {} +// ChildList 子活动用户列表 +rpc ChildList(ChildListReq) returns (ChildListRes) {} +// ReceiveReward 领取奖励 +rpc ReceiveReward(ReceiveRewardReq) returns (ReceiveRewardRes) {} +// LotteryLog 抽奖玩法日志 +rpc LotteryLog(LotteryLogReq) returns (LotteryLogRes) {} +// UserList 活动用户数据 +rpc UserList(UserListReq) returns (UserListRes) {} +// CashAgain 现金大抽奖再玩一次 +rpc CashAgain(CashAgainReq) returns (CashAgainRes) {} +// DiceCollect 用户手机碎片 +rpc DiceCollect(DiceCollectReq) returns (DiceCollectRes) {} +// ClientReward 客户端奖品 +rpc ClientReward(ClientRewardReq) returns (ClientRewardRes) {} +// PointsUse 积分兑换 +rpc PointsUse(PointsUseReq) returns (PointsUseRes) {} +// Chat Ai聊天 +rpc Chat(ChatReq) returns (ChatRes) {} +// ChatList 聊天信息 +rpc ChatList(ChatListReq) returns (ChatListRes) {} +// ScheduleList 赛程信息 +rpc ScheduleList(ScheduleListReq) returns (ScheduleListRes) {} +// MallList 用户商城奖品列表 +rpc MallList(MallListReq) returns (MallListRes) {} +// Exchange 商城奖品兑换 +rpc Exchange(ExchangeReq) returns (ExchangeRes) {} +// VoteList 投票列表 +rpc VoteList(VoteListReq) returns (VoteListRes) {} +// VsTipReward 接受投票结果 +rpc VsTipReward(VsTipRewardReq) returns (VsTipRewardRes) {} +// UnoRandCard uno随机牌 +rpc UnoRandCard(UnoRandCardReq) returns (UnoRandCardRes) {} +// UnoClaim uno领取牌奖励 +rpc UnoClaim(UnoClaimReq) returns (UnoClaimRes) {} +// UnoCard uno卡牌 +rpc UnoCard(UnoCardReq) returns (UnoCardRes) {} +// Show 用户详情 +rpc Show(ShowReq) returns (ShowRes) {} +// EventFirstVisit 首次访问活动 +rpc EventFirstVisit(EventFirstVisitReq) returns (EventFirstVisitRes) {} +// FindByUniq 通过唯一键找用户id +rpc FindByUniq(FindByUniqReq) returns (FindByUniqRes) {} +// TaskTip 任务提示 +rpc TaskTip(TaskTipReq) returns (TaskTipRes) {} +// TaskTipOk 任务提示完成 +rpc TaskTipOk(TaskTipOkReq) returns (TaskTipOkRes) {} +// CoinLog 金币日志 +rpc CoinLog(CoinLogReq) returns (CoinLogRes) {} + +} + +message ListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 campaign_id = 3; //活动id + string campaign_hash_id = 4; //活动hash_id + int64 pid = 5; //父级id + string user_mark = 6; //用户标识关键字 + int64 start = 7; //参与时间开始时间戳 + int64 end = 8; //参与时间结束时间戳 + bool order_by_time_asc = 9; //根据参与时间升序 + string parent_user_mark = 10; //上级用户标识关键字 + int32 source = 11; //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + string lang_mark = 12; //语言标识 + int32 t_offset = 13; //时区 + int32 pid_type = 14; //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + int32 join_type = 15; //上级用户类型(1-进入过活动的用户,2-没有进入过活动的用户) + repeated int32 user_cond = 16; //用户条件(1-有安装的用户,2-有注册的用户) +} + +message ListRes { + message One { + int64 id = 1; //活动用户ID + string hash_id = 2; //活动用户对外id + string sub_user_id = 3; //用户 + string parent = 4; //用户上级 + int64 child_num = 5; //下级数量 + int64 indirect_num = 6; //间接裂变 + int32 is_new = 7; //是否新安装用户(1-是,0-否) + int64 created_at = 8; //创建时间 + int32 chance = 9; //剩余的抽奖次数|答题次数|投票票数 + int32 is_help = 10; //助力状态(0-无此状态,1-助力成功,2-助力失败) + Dice dice = 11; //大富翁数据 + string channel_title = 12; //渠道名称 + int32 source = 13; //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + int64 effect_num = 14; //有效拉新人数 + string lang_mark = 15; //用户语种标识 + string country_mark = 16; //国家标识 + string lv_title = 17; //用户等级 + string platform = 18; //操作系统 + string user_mark = 19; //用户标识 + int32 user_mark_source = 20; //用户标识来源(1-设备id,2-用户id) + repeated Cond conds = 21; //用户完成的任务详情 + Chop chop = 22; //砍一刀数据 + string fail_mark = 23; //助力失败原因 + Win win = 24; //一起赢奖励特有参数 + Keep keep_dog = 25; //养狗数据 + Cash cash = 26; //现金抽奖数据 + string device_id = 27; //设备id + Gold gold = 28; //现金抽奖数据 + Coin coin = 29; //金币池数据 + Sign sign = 30; //签到数据 + int64 join_at = 31; //访问活动时间 + int64 install_at = 32; //安装时间 + int64 register_at = 33; //注册时间 + Vs vs = 34; //投票数据 + Uno uno = 35; //uno卡牌数据 + } + message Uno { + int32 chance = 1; //剩余投票次数 + int32 three_num = 2; //+3道具牌数量 + int32 five_num = 3; //+5道具牌数量 + int32 fix_num = 4; //固定颜色道具牌数量 + } + message Vs { + int32 chance = 1; //剩余投票次数 + int32 vote_num = 2; //投票次数 + int32 coin_get = 3; //积分获取数 + int32 coin_use = 4; //积分消耗数 + } + message Dice { + int32 chance = 1; //骰子次数 + int32 lucky_chance = 2; //幸运骰次数 + } + message Chop { + int64 chop_reward_id = 1; //选中的奖品id + string reward_title = 2; //奖品标题 + string percent = 3; //当前进度 + } + message Cond { + string desc = 1; //标题 + int64 num = 2; //数量 + } + message Win { + int32 is_newcomer = 1; //是否是新人用户 + } + message Keep { + int32 collect_num = 1; //已收集爱心数 + string reward_title = 2; //奖品标题 + int32 chance = 3; //剩余狗粮数 + } + message Cash { + int64 expired_at = 1; //任务重制时间 + } + message Gold { + int32 gold_num = 1; //金币数量 + int64 expired_at = 2; //任务重制时间 + } + message Coin { + int32 total_use = 1; //投放总次数 + int32 total_num = 2; //总收益 + repeated CoinScene scenes = 3; //场次明细 + } + message CoinScene { + string title = 1; //开奖时间 + int32 use_num = 2; //投放次数 + int32 get_coin = 3; //获得金币数 + } + message Sign { + int32 sign_day = 1; //签到天数 + int32 max_continue = 2; //连续签到天数 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 + int32 t_offset = 3; //时区 + int64 fission_id = 4; //玩法id + string fission_mark = 5; //活动类型玩法标识 + int32 fix_dice = 6; //开启固定骰子(0-不开启,1-开启) +} + +message RewardReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 campaign_id = 3; //活动id + string campaign_hash_id = 4; //活动hash_id + int64 fuser_id = 5; //活动用户id + string user_mark = 6; //用户标识关键字 + int64 start = 7; //参与时间开始时间戳 + int64 end = 8; //参与时间结束时间戳 + repeated int32 status = 9; //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发放) + string reward_title = 10; //奖品名称 + int32 t_offset = 11; //时区 + int32 is_child = 12; //是否子活动奖品 +} + +message RewardRes { + message One { + string sub_user_id = 1; //活动用户对外id + int64 created_time = 2; //奖励时间时间戳 + string title = 3; //奖励内容 + repeated KV kv_data = 4; //键值对 + string img = 5; //奖品图片 + string jump_url = 6; //跳转地址 + int32 receive_type = 7; //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + bool is_push = 8; //是否已经推给客户 + int64 id = 9; //奖品记录int型id + string hash_id = 10; //奖品记录string型hash_id + int32 status = 11; //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发送) + string fail_type = 12; //失败原因标识(system-自己系统的问题,client-对方系统的问题,undefined-没有分析到的问题) + string fail_msg = 13; //失败具体原因说明 + string reward_title = 14; //奖品标题 + string contact = 15; //联系方式 + int32 open_to_use = 16; //开启去使用(0-否,1-是) + string web_url = 17; //Web端的跳转地址 + string app_param = 18; //App端的跳转参数 + int64 reward_id = 19; //活动奖品id + int32 dy_reward_type = 20; //动态奖品内容类型(0-无,1-兑换码) + string custom_reward_val = 21; //自定义的奖品值 + int32 reward_type = 22; //奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励) + string child_title = 23; //子活动标题 + string prop_mark = 24; //奖励的道具类型(chance-道具数量,reward-奖品) + string chance_mark = 25; //道具标识(dog_food-狗粮) + int32 reward_num = 26; //奖励数量 + string pc_param = 27; //pc端的跳转参数 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 + int32 t_offset = 3; //时区 +} + +message VisitReq { + message Cert { + int64 time = 1; //时间戳 + string blackbox = 2; //通过blackBox可以在后台查询出 + string version = 3; //加解密版本 + string platform = 4; //平台 + string token = 5; //加密串 + } + string hid = 1; //活动hash_id + string uid = 2; //关注用户ID + string cid = 3; //渠道ID + string wid = 4; //浏览器唯一id + string lang = 5; //语种标识 + string lv = 6; //用户等级 + Cert cert = 7; //验签数据 + string ip = 8; //客户端ip + string platform = 9; //平台 + string os = 10; //系统 + string os_version = 11; //系统版本 + string device_model = 12; //系统型号 + string custom_param = 13; //额外信息 + string center_id = 14; //任务中心ID + string module_id = 15; //任务中心模块ID +} + +message VisitRes { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id + string token = 3; //身份token + int64 expired = 4; //token过期时间,单位:秒(s) + int32 is_view = 5; //是否预览用户(1-是,0-否) + bool has_parent = 6; //是否有上级 +} + +message PlayReq { + int64 id = 1; //用户id + int64 campaign_id = 2; //活动ID +} + +message PlayRes { + message Uno { + int32 chance = 1; //抽奖机会数 + int32 three_num = 2; //+3道具牌数量 + int32 five_num = 3; //+5道具牌数量 + int32 fix_num = 4; //固定颜色道具牌数量 + UnoGroup red = 5; //红牌信息 + UnoGroup blue = 6; //蓝牌信息 + UnoGroup green = 7; //绿牌信息 + UnoGroup yellow = 8; //黄牌信息 + } + message UnoGroup { + int32 collect_num = 1; //收集数量 + repeated UnoCard cards = 2; //牌号 + } + message UnoCard { + int32 card_no = 1; //牌号 + int32 card_num = 2; //获得的牌数量 + } + message Vs { + int64 coin_num = 1; //积分数 + string coin_title = 2; //积分标题 + string coin_img = 3; //积分图片 + int32 chance = 4; //投票机会数 + repeated GetReward win_rewards = 5; //投票奖励 + } + message Coin { + int64 get_coin = 1; //获得的金币数 + int64 all_coin = 2; //总奖池金额 + int64 open_sec = 3; //剩余开奖时间(秒) + int32 use_num = 4; //投放次数 + int32 can_get = 5; //是否可以领取瓜分了 + int32 end = 6; //是否没有下一场了 + } + message Clue { + int32 type = 1; //通知类型(1-获得抽奖机会通知,2-完成前置任务) + int64 chance = 2; //获得的抽奖机会次数 + int32 pre_cond = 3; //完成的前置任务标识 + } + message Task { + Fixed fixed = 1; //固定任务 + Custom custom = 2; //自定义任务 + } + message Fixed { + int32 open = 1; //是否开启(0-否,1-是) + int32 app_event = 2; //固定事件类型(1-安装;2-注册) + int32 target_num = 3; //达标条件需要的新用户个数 + int32 chance = 4; //达标获得的数量(如:骰子数) + int32 chance_limit = 5; //最大获得数量(如:最大骰子数) + } + message Custom { + int32 open = 1; //是否开启(0-否,1-是) + int32 both_type = 2; //满足条件(1-所有条件满足,2-任一条件满足) + int32 chance = 3; //总发放的数(如:骰子数) + repeated Cond cond = 4; //达标条件 + BothAll both_all = 5; //满足条件为所有条件满足要提交的数据 + } + message BothAll { + int32 task_chance = 1; //完成任务获得的次数(如:骰子数) + int32 task_limit = 2; //任务最大可完成次数(0不限制) + int64 finish = 3; //完成任务的次数 + } + message Cond { + int64 id = 1; //达标条件ID + string desc = 2; //达标条件 + int64 num = 3; //完成次数 + int32 if_cond = 4; //等式(0-等于,1-大于等于,2-累计) + string total = 5; //累计值 + string event = 6; //事件关键字 + string event_key = 7; //事件key + string event_val = 8; //事件值 + int32 task_chance = 9; //完成发放的次数(如:骰子数) + int32 task_limit = 10; //任务最大可完成次数(0不限制) + } + message ChancePlayer { + int64 id = 1; //大转盘用户数据id + int32 chance = 2; //抽奖机会数 + int64 invite_num = 3; //已邀请人数 + } + message Quiz { + int64 id = 1; //有奖竞猜用户数据id + int32 chance = 2; //投票机会次数 + int64 option_id = 3; //选择的选项id + bool win = 4; //是否已经赢得奖励 + string title = 5; //奖品名称 + string img_url = 6; //奖品图片 + int64 invite_num = 7; //已邀请人数 + string reward_hash_id = 8; //领取的用户奖品hash_id + int32 receive_type = 9; //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + bool is_push = 10; //是否已经推给客户 + repeated KV kv_data = 11; //键值对数据 + int32 open_type = 12; //1-为开奖,2-已开奖,3-不开奖 + int64 reward_id = 13; //奖品id + string contact = 14; //联系方式 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否显示 + } + message InvitePalyer { + int64 id = 1; //老带新用户数据id + int64 invite_num = 2; //已邀请人数 + int64 need_num = 3; //还需要邀请人数 + int32 limit_status = 4; //任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制) + string title = 5; //将要获得的奖品名称|已获得的奖品名称 + int64 reward_num = 6; //将要获得的奖品数量|已获得的奖品数量 + int32 reward_rule = 7; //用户奖励规则(1-阶梯,2-非阶梯) + string extra_title = 8; //额外奖品名称 + int64 extra_reward_num = 9; //额外奖品数量 + int64 reward_id = 10; //奖品id + int64 extra_reward_id = 11; //奖品id + NoticeReward notice_reward = 12; //需要通知的奖品(没有的时候为空) + bool has_newcomer_reward = 13; //是否可以领取新人奖 + bool has_help_task = 14; //是否有助力任务 + } + message NoticeReward { + string hash_id = 1; //奖品对外id + string title = 2; //奖品名称 + int32 reward_num = 3; //奖品数量 + int32 receive_type = 4; //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + repeated KV kv_data = 5; //键值对数据 + int64 reward_id = 6; //奖品id + string contact = 7; //联系方式 + } + message Sign { + int64 id = 1; //签到用户数据id + int32 sign_day = 2; //签到天数 + int32 continue_day = 3; //连续签到天数 + int64 invite_num = 4; //已邀请人数 + int32 card_num = 5; //补签卡数量 + int32 max_continue = 6; //最大连续签到天数 + int32 today_sign = 7; //今天是否有签到 (0-否,1-是) + int32 cycle_day = 8; //周期签到天数 + } + message Dice { + int64 id = 1; //签到用户数据id + int32 chance = 2; //骰子数 + string map_hash_id = 3; //当前所在地图位置 + int32 props_chance = 4; //再摇一次道具可用次数 + int32 props_fixed_roll = 5; //幸运骰子可用次数 + repeated Collect collects = 6; //奖品碎片 + int64 invite_num = 7; //已邀请人数 + int64 fixed_roll_task_finish = 8; //幸运骰子任务完成次数 + int64 dmg_id = 9; //地图id + } + message Collect { + int64 id = 1; //奖品id + int32 num = 2; //当前拥有碎片数 + int32 collect_num = 3; //收集碎片总数 + string reward_title = 4; //奖品名称 + string img_url = 5; //奖品图片(相对路径) + int32 is_super = 6; //是否超级奖品(0-否,1-是) + } + message Grow { + int64 id = 1; //签到用户数据id + int32 grow_num = 2; //成长道具数量 + int64 invite_num = 3; //已邀请人数 + bool has_props = 4; //是否可以领取道具 + int64 next_props = 5; //多少秒后可以领取道具 + } + message Chop { + int64 id = 1; //用户数据id + int64 chop_reward_id = 2; //选择的奖品id,没有选择的时候为0 + string title = 3; //奖品名称 + string img_url = 4; //奖品图片(相对路径) + double percent = 5; //进度百分比 + bool finish = 6; //是否完成进度任务 + int64 reward_id = 7; //奖品id + bool reward_none = 8; //是否没有可选奖品了 + } + message Cash { + int64 id = 1; //用户数据id + string next_step = 2; //进度节点 + int32 energy = 3; //剩余能量数 + int32 lottery_num = 4; //抽奖次数 + double show_price = 5; //当前累计金额 + int64 expired_in = 6; //任务重置剩余时间(单位:s) + repeated GetReward rewards = 7; //领取的现金抽奖奖品 + bool has_again = 8; //是否可以再玩一次 + } + message Gold { + int64 id = 1; //用户数据id + string next_step = 2; //进度节点(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, trigger_share-赠送能量) + int32 energy = 3; //剩余能量数 + double show_price = 4; //当前累计金额 + int64 expired_in = 5; //任务重置剩余时间(单位:s) + int32 gold_num = 6; //获得的金币数 + repeated GetReward rewards = 7; //领取的现金抽奖奖品 + int32 add_num = 8; //追加的金币数 + int32 hide_coins = 9; //是否隐藏金币(0-否,1-是) + } + message GetReward { + string hash_id = 1; //领奖记录hash_id + string title = 2; //奖品名称 + string img = 3; //奖品图片 + string jump_url = 4; //跳转地址 + repeated KV kv_data = 5; //奖品自定义参数数据 + int32 receive_type = 6; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + string contact = 7; //联系方式 + int64 created_at = 8; //创建时间 + int32 open_to_use = 9; //开启去使用(0-否,1-是) + string web_url = 10; //Web端的跳转地址 + string app_param = 11; //App端的跳转参数 + string pc_param = 12; //pc端的跳转参数 + string prop_mark = 13; //道具标记 + int32 reward_num = 14; //奖品数量 + int64 reward_id = 15; //活动奖品id + } + message Keep { + int64 id = 1; //用户数据id + string percent = 2; //进度 + int32 num = 3; //剩余总道具数 + double machine_num = 4; //机器产生的道具数 + int32 feed_lack = 5; //还差多次喂养能获得狗粮 + int32 collect = 6; //当前可收集的数量 + int32 second_percent = 7; //收集需要的二级资源进度 + int64 expired_sec = 8; //养成过期剩余秒数 + KeepReward Reward = 9; //选择的奖品 + int32 left_collect = 10; //还差的爱一级道具数 + int32 guided = 11; //是否出现了指引 + int32 day_first_invite = 12; //当天是否还没完成第一次邀请(0-否,1-是) + int64 day_first_expired_sec = 13; //首邀任务过期剩余秒数 + int32 machine_limit = 14; //机器被限制(0-正常,1-每日限制) + int64 offline_full = 15; //离线狗粮机填满剩余秒数 + } + message KeepReward { + int64 id = 1; //活动奖品id + string title = 2; //奖品标题 + string img_url = 3; //奖品图片 + int64 record_id = 4; //记录id + } + string sub_user_id = 1; //关注用户ID + string parent_user_id = 2; //用户上级用户外部id + string device_id = 3; //设备ID + string share_link = 4; //分享链接 + ChancePlayer chance_player = 5; //大转盘,九宫格,老虎机,盲盒,趣味问答,抽签 + InvitePalyer invite_player = 6; //老带新,一起赢 + Quiz quiz = 7; //有奖竞猜(有奖竞猜活动才有) + Sign sign = 8; //签到(签到活动才有) + Dice dice = 9; //大富翁(大富翁活动才有) + Grow grow = 10; //农场(农场活动才有) + Chop chop = 11; //砍一刀(砍一刀活动才有) + int64 fission_id = 12; //玩法Id + Task task = 13; //用户任务 + Cash cash = 14; //现金抽奖(现金抽奖才有) + repeated Clue clue = 15; //通知数据 + Keep keep_dog = 16; //养狗数据 + Gold gold = 17; //金币任务 + Coin coin = 18; //瓜分金币 + Vs vs = 19; //赛事竞猜 + Uno uno = 20; //Uno卡牌 +} + +message RewardUserReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 campaign_id = 3; //活动id + string campaign_hash_id = 4; //活动hash_id +} + +message RewardUserRes { + message One { + string sub_user_id = 1; //活动用户外部id + string psu_id = 2; //上级用户id + int64 direct_num = 3; //直接裂变 + int64 indirect_num = 4; //间接裂变 + repeated Reward rewards = 5; //中奖奖品 + } + message Reward { + int64 created_time = 1; //奖励时间时间戳 + string title = 2; //奖励内容 + string reward_hash_id = 3; //领取的用户奖品hash_id + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message InfoReq { + int64 campaign_id = 1; //活动id + string campaign_hash_id = 2; //活动hash_id + string sub_user_id = 3; //活动用户外部id +} + +message InfoRes { + message Reward { + int64 created_time = 1; //奖励时间时间戳 + string title = 2; //奖励内容 + } + string sub_user_id = 1; //活动用户外部id + string psu_id = 2; //上级用户id + int64 direct_num = 3; //直接裂变 + int64 indirect_num = 4; //间接裂变 + repeated Reward rewards = 5; //中奖奖品 +} + +message RankReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 campaign_id = 3; //活动id + string campaign_hash_id = 4; //活动hash_id +} + +message RankRes { + message One { + string sub_user_id = 1; //活动用户外部id + int64 direct_num = 2; //直接下载数|注册数|达标数|签到达标数 + int64 indirect_num = 3; //间接下载数|注册数|达标数|签到数 + repeated Cond conds = 4; //具体达标条件数据 仅当type=3时候有值 + } + message Cond { + string desc = 1; //条件说明 + int64 num = 2; //完成次数 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 + int32 type = 3; //类型(1-下载,2-注册,3-达标,4-邀请好友达标) +} + +message LotteryReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动ID +} + +message LotteryRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + int64 id = 1; //奖品id + string title = 2; //奖品名称 + bool win = 3; //是否中奖 + string img = 4; //奖品图片 + string jump_url = 5; //跳转地址 + repeated KV kv_data = 6; //奖品自定义参数数据 + int32 receive_type = 7; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器,4-提交表单) + string reward_hash_id = 8; //领取的用户奖品hash_id + string contact = 9; //联系方式 + int32 open_to_use = 10; //开启去使用(0-否,1-是) + string web_url = 11; //Web端的跳转地址 + string app_param = 12; //App端的跳转参数 + string pc_param = 13; //pc端的跳转参数 +} + +message AnswerReq { + message Submit { + int64 qid = 1; //题目id + repeated int64 aid = 2; //答案id + } + int64 user_id = 1; //活动用户id + repeated Submit submits = 2; //提交的答案 + int64 campaign_id = 3; //活动ID + string lang_mark = 4; //活动语言 +} + +message AnswerRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + int64 id = 1; //奖品id + string title = 2; //奖品名称 + bool win = 3; //是否中奖 + string img = 4; //奖品图片 + repeated KV kv_data = 5; //奖品自定义参数数据 + int32 receive_type = 6; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + int32 score = 7; //获得的分数 + string reward_hash_id = 8; //领取的用户奖品hash_id + string contact = 9; //联系方式 + int32 open_to_use = 10; //开启去使用(0-否,1-是) + string web_url = 11; //Web端的跳转地址 + string app_param = 12; //App端的跳转参数 + string pc_param = 13; //pc端的跳转参数 + int32 qa_num = 14; //答题数 + int32 qa_right_num = 15; //正确数 +} + +message AnswerHistoryReq { + int64 campaign_id = 1; //活动ID + string reward_hash_id = 2; //领取的用户奖品hash_id +} + +message AnswerHistoryRes { + message One { + int64 id = 1; //问题ID + string hash_id = 2; //问题对外id + string mark = 3; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 4; //题目 + string cover_url = 5; //封面图 + string link_url = 6; //附件地址 + string explain_text = 7; //答案解析 + string explain_img = 8; //答案解析图 + repeated Option options = 9; //选项 + string answer_mark = 10; //答案类型(image_text-图文,text-文本) + repeated int64 select_option_id = 11; //选择的选项id + } + message Option { + int64 id = 1; //选项id + string title = 2; //答案内容 + string img_url = 3; //答案图片 + int32 is_right = 4; //是否正确 + } + repeated One list = 1; //列表数据 +} + +message VoteReq { + int64 user_id = 1; //活动用户id + int64 option_id = 2; //选项id + int32 vote_num = 3; //投票数 + int64 campaign_id = 4; //活动ID + int64 schedule_id = 5; //赛程id + int64 team_id = 6; //队伍id +} + +message VoteRes { + int32 status = 1; //状态(0-正常,1-非投票时间无法投票,2-投票机会不足,3-积分不足,4-投票已达最大次数,5-投票失败) +} + +message NotifyReq { + int64 user_id = 1; //活动用户id + string reward_hash_id = 2; //领取的用户奖品hash_id + string body = 3; //推送的数据 + string resp = 4; //客户端返回的内容 + int64 campaign_id = 5; //活动id +} + +message NotifyRes { +} + +message AcceptRewardReq { + int64 campaign_id = 1; //活动id + string reward_hash_id = 2; //领取的用户奖品hash_id +} + +message AcceptRewardRes { +} + +message TargetRuleReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 campaign_id = 3; //活动id + int64 user_id = 4; //用户id +} + +message TargetRuleRes { + message One { + string sub_user_id = 1; //用户id + repeated Cond cond = 2; //条件 + } + message Cond { + string desc = 1; //达标条件 + int64 num = 2; //完成次数 + int64 cond_id = 3; //达标条件ID + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 + int64 target_num = 3; //达标次数 +} + +message TaskReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message TaskRes { + message Day { + int32 open = 1; //是否开启(0-否,1-是) + int32 chance = 2; //每日访问活动(如:骰子数) + bool can_do = 3; //是否可完成 + } + message Fixed { + int32 open = 1; //是否开启(0-否,1-是) + int32 app_event = 2; //固定事件类型(1-安装;2-注册) + int32 target_num = 3; //达标条件需要的新用户个数 + int32 chance = 4; //达标获得的数量(如:骰子数) + int32 chance_limit = 5; //最大获得数量(如:最大骰子数) + bool can_do = 6; //是否可完成 + } + message Custom { + int32 open = 1; //是否开启(0-否,1-是) + int32 both_type = 2; //满足条件(1-所有条件满足,2-任一条件满足) + int32 chance = 3; //总发放的数(如:骰子数) + repeated Cond cond = 4; //达标条件 + BothAll both_all = 5; //满足条件为所有条件满足要提交的数据 + } + message BothAll { + int32 task_chance = 1; //完成任务获得的次数(如:骰子数) + int32 task_limit = 2; //任务最大可完成次数(0不限制) + int64 finish = 3; //完成任务的次数 + Reward reward = 4; //奖品 + string prop_mark = 5; //奖励的道具类型(chance-道具数量,reward-奖品) + int64 task_id = 6; //任务id + } + message Cond { + int64 id = 1; //达标条件ID + string desc = 2; //达标条件 + int64 num = 3; //完成次数 + int32 if_cond = 4; //等式(0-等于,1-大于等于,2-累计) + string total = 5; //累计值 + string event = 6; //事件关键字 + string event_key = 7; //事件key + string event_val = 8; //事件值 + int32 task_chance = 9; //完成发放的次数(如:骰子数) + int32 task_limit = 10; //任务最大可完成次数(0不限制) + bool can_do = 11; //是否可完成 + string web_url = 12; //web端跳转地址 + string app_param = 13; //app事件参数 + bool tomorrow_can_do = 14; //是否显示明天再来 + int32 event_type = 15; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 16; //广告观看路径(1-APP内,2-APP外) + int32 week_can_do = 17; //周状态(0-可做,1-下周再来,2-周几再来) + int32 week_num = 18; //周几 + int32 go_show = 19; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 20; //策略id + int32 is_super = 21; //是否超级任务(0-否,1-是) + int32 has_pre = 22; //是否有前置任务(0-否,1-是) + Reward reward = 23; //奖品 + string prop_mark = 24; //奖励的道具类型(chance-道具数量,reward-奖品) + int64 expired_sec = 25; //前置条件过期剩余的秒数 + string pc_param = 26; //app事件参数 + int64 task_id = 27; //任务id + int32 has_receive = 28; //是否有可领取奖品(0-否,1-是) + int32 trigger_type = 29; //事件触发条件(1-点击去完成按钮,2-全局监听) + string go_text = 30; //去完成文案 + int32 click_effect_open = 31; //是否开启点击有效(0-否,1-是) + int32 click_effect = 32; //点击有效值 + string click_effect_unit = 33; //点击有效单位(min-分钟,hour-小时,day-天) + int32 pull_invite = 34; //是否拉取邀请(0-否,1-是) + } + message Reward { + int64 id = 1; //活动奖品id + string title = 2; //奖品标题 + string img_url = 3; //奖品图片 + } + Day fix_day = 1; //固定的每日任务 + Fixed fixed = 2; //固定任务 + Custom custom = 3; //自定义任务 + repeated int32 pre_cond = 4; //用户可触发的前置任务 +} + +message ResendReq { + string reward_hash_id = 1; //奖品hash_id + string campaign_hash_id = 2; //活动id +} + +message ResendRes { + int32 status = 1; //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发送) + string fail_type = 2; //失败原因标识(system-自己系统的问题,client-对方系统的问题,undefined-没有分析到的问题 + string fail_msg = 3; //失败具体原因说明 +} + +message DynamicLinkReq { + message ImageText { + string nick_name = 1; //用户昵称 + string avatar = 2; //用户头像 + string title = 3; //内容标题 + string desc = 4; //内容描述 + string image = 5; //内容封面 + } + string project_hash_id = 1; //项目 + string sub_user_id = 2; //第三方用户id + string media_type = 3; //动态数据类型(1-图文) + repeated ImageText image_text = 4; //图文消息 + string campaign_hash_id = 5; //活动id +} + +message DynamicLinkRes { + string link_url = 1; //链接地址 +} + +message DylinkShowReq { + string hash_id = 1; //动态链接hash_id +} + +message DylinkShowRes { + message ImageText { + string nick_name = 1; //用户昵称 + string avatar = 2; //用户头像 + string title = 3; //内容标题 + string desc = 4; //内容描述 + string image = 5; //内容封面 + } + string media_type = 1; //媒体类型 ImageText(图文) + repeated ImageText image_text = 2; //图文消息 +} + +message SignInReq { + int64 user_id = 1; //用户id + string now_mouth = 2; //当前月 + int32 page_type = 3; //页面类型(0-当前月,1-下一个月,2-上一个月) + int64 campaign_id = 4; //活动ID +} + +message SignInRes { + message SignDate { + string y = 1; //年 + string m = 2; //月 + string d = 3; //日 + int32 sign_in = 4; //签到类型(0-未签,1-已签,2-漏签) + bool ban = 5; //是否非签到日期 + int64 reward_id = 6; //奖品id,0即没有礼物 + bool open = 7; //是否已经领奖 + bool now_week = 8; //是否本周 + bool now_day = 9; //是否今天 + bool last_miss = 10; //是否最后一个漏签 + bool now_mouth = 11; //是否本月 + } + message CycleDate { + int64 sign_time = 1; //签到时间 + int32 sign_in = 2; //签到类型(0-未签,1-已签,2-漏签) + bool now_day = 3; //是否今天 + int64 reward_id = 4; //奖品id,0即没有礼物 + string reward_img = 5; //奖品图片 + string reward_title = 6; //奖品标题 + int32 is_super = 7; //是否超级大奖(0-否,1-是) + string y = 8; //年 + string m = 9; //月 + string d = 10; //日 + } + repeated SignDate sign_date = 1; //签到板信息 + string now_mouth = 2; //当前月 + repeated CycleDate cycle_date = 3; //周期签到板信息 +} + +message SignReq { + int64 user_id = 1; //用户id + int64 sign_date = 2; //签到日期时间戳 + int64 campaign_id = 3; //活动ID +} + +message SignRes { + message KV { + string key = 1; //键 + string value = 2; //值 + } + int32 fail_type = 1; //失败状态(0-签到成功,1-签到失败,2-补签卡不足,3-已签到,4-补签签到,5-活动未开启) + bool has_reward = 2; //是否有礼物 + string reward_title = 3; //奖品名称 + int32 reward_num = 4; //获得的奖品数量 + string img_url = 5; //奖品图片 + int64 reward_id = 6; //奖品id + int32 receive_type = 7; //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + repeated KV kv_data = 8; //键值数据 + string contact = 9; //联系方式 +} + +message DiceMapReq { + int64 user_id = 1; //用户id + string map_hash_id = 2; //渲染地图的最后一格id,不传是当前用户所在位置外后54格 + int32 prefix_step = 3; //返回前面的格子数字 + int64 go_show_step = 4; //用户多少步之前都要返回GO这格子 + int64 campaign_id = 5; //活动ID +} + +message DiceMapRes { + message One { + string map_hash_id = 1; //地图id + int32 mark_type = 2; //格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几)) + string reward_title = 3; //奖品名称 + string img_url = 4; //奖品图片 + int64 reward_id = 5; //奖品Id + } + repeated One list = 1; //奖品图片 +} + +message DiceReq { + int64 user_id = 1; //用户id + string mark = 2; //道具标识(chance-再来一次,fixed_roll-固定点数) + string val = 3; //道具值 + int64 campaign_id = 4; //活动ID +} + +message DiceRes { + int32 fail_type = 1; //失败状态(0-成功,1-骰子不足,2-道具不足) + string map_hash_id = 2; //地图id + int32 roll_num = 3; //点数 + int32 mark_type = 4; //格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几) + string reward_title = 5; //奖品名称 + string img_url = 6; //奖品图片 + bool is_intact = 7; //是否是完整奖品 + bool lack = 8; //奖品无库存 + int64 reward_id = 9; //奖品ID +} + +message GrowReq { + int64 user_id = 1; //用户id + int64 campaign_id = 2; //活动ID + string lang_mark = 3; //语言标识 +} + +message GrowRes { + bool get_grow = 1; //是否需要领取生命体 + string title = 2; //名称 + int32 step = 3; //当前等级 + int32 num = 4; //当前拥有道具值 + int32 lv_up_num = 5; //升级需要的道具值 + string diff_p = 6; //剩余进度(36.9%) + bool will_die = 7; //是否将要死亡 + bool is_die = 8; //是否已死亡 + bool max_lv = 9; //是否最高等级 + string reward_title = 10; //奖品名称 + string reward_url = 11; //奖品图片 + bool lack = 12; //奖品是否没有库存的 + int64 reward_id = 13; //奖品Id +} + +message GetGrowReq { + int64 user_id = 1; //用户id + string title = 2; //生命体名称 + int64 campaign_id = 3; //活动ID +} + +message GetGrowRes { +} + +message FeedReq { + int64 user_id = 1; //用户id + int32 num = 2; //饲养道具数量 +} + +message FeedRes { + message KV { + string key = 1; //键 + string value = 2; //值 + } + int32 fail_type = 1; //失败类型(0-饲养成功,1-道具不足,2-不能继续升级,3-生命体死亡) + bool lv_up = 2; //是否升级 + int32 step = 3; //当前等级 + int32 up_step = 4; //升级后的等级 + int32 has_reward = 5; //可领奖类型(0-无奖品,1-领奖,2-库存不足) + string reward_title = 6; //奖品名称 + string reward_url = 7; //奖品图片 + int64 reward_id = 8; //奖品Id + int32 receive_type = 9; //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + repeated KV kv_data = 10; //键值数据 + string contact = 11; //联系方式 +} + +message GetFeedReq { + int64 user_id = 1; //用户id + string mark = 2; //领取饲养道具标识(auto-自动产生的道具) + int64 campaign_id = 3; //活动ID +} + +message GetFeedRes { +} + +message GrowRecordReq { + int64 user_id = 1; //用户id + string date = 2; //最后一组数据的日期 + int64 campaign_id = 3; //活动ID +} + +message GrowRecordRes { + message One { + string date = 1; //日期 + repeated Record records = 2; //记录 + } + message Record { + string mark = 1; //标识(feed-喂养,get_grow-领取生命体,lv_up-升级,get_reward-领奖) + string his = 2; //时分秒 + repeated KV var_data = 3; //变量数据 + } + message KV { + string key = 1; //对应语言包的关键字,如:{{num}} + string value = 2; //关键字替换的值 + int64 id_mark = 3; //数字id标识 + } + repeated One list = 1; //列表数据 +} + +message ContentLinkReq { + int64 user_id = 1; //用户id + string mark = 2; //内容标识(qa-问题类型,ballot-抽签,chop-砍一刀) + int64 mark_id = 3; //id标识(qa-题目id,ballot-奖品id,chop-奖品id) + int64 campaign_id = 4; //活动ID +} + +message ContentLinkRes { + string link_url = 1; //分享链接 +} + +message LinkContentReq { + string ct_id = 1; //内容hash_id +} + +message LinkContentRes { + message Qa { + int64 id = 1; //问题ID + string hash_id = 2; //问题对外id + string mark = 3; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 4; //题目 + string cover_url = 5; //封面图 + string link_url = 6; //附件地址 + repeated Option options = 7; //选项 + string answer_mark = 8; //答案类型(image_text-图文,text-文本) + bool home_share = 9; //是否首页分享 + } + message Option { + int64 id = 1; //选项id + string title = 2; //答案内容 + string img_url = 3; //答案图片 + } + message Ballot { + int64 id = 1; //奖品id + string title = 2; //奖品名称 + string img_url = 3; //奖品图片(相对路径) + } + message Chop { + repeated ChopReward rewards = 1; //奖品列表 + } + message ChopReward { + string title = 1; //奖品名称 + string img_url = 2; //奖品图片(相对路径) + bool selected = 3; //是否选中 + int64 id = 4; //奖品id + } + string mark = 1; //内容标识(qa-问题类型,ballot-抽签,chop-砍一刀) + Qa qa = 2; //问题内容 + Ballot ballot = 3; //抽签内容 + Chop chop = 4; //砍一刀内容 +} + +message ChopSelectReq { + int64 reward_id = 1; //奖品id + int64 user_id = 2; //用户id + int64 campaign_id = 3; //活动ID +} + +message ChopSelectRes { +} + +message ChopReselectReq { + int64 chop_reward_id = 1; //选择的奖品id + int64 user_id = 2; //用户id + int64 campaign_id = 3; //活动ID +} + +message ChopReselectRes { + bool reward_none = 1; //是否没有可选奖品了 +} + +message ChopHelpReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 user_id = 3; //用户id + int64 campaign_id = 4; //活动ID +} + +message ChopHelpRes { + message One { + int64 id = 1; //活动ID + string mark = 2; //助力标识 + double percent = 3; //助力百分比 + int64 created_time = 4; //助力时间戳 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message ProjectListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string project_hash_id = 3; //活动id + int64 start = 4; //参与时间开始时间戳 + int64 end = 5; //参与时间结束时间戳 +} + +message ProjectListRes { + message One { + int64 id = 1; //活动用户ID + string sub_user_id = 2; //第三方用户的user_id + string hash_id = 3; //活动用户对外id + string campaign_title = 4; //活动标题 + string campaign_hash_id = 5; //活动hash_id + int64 created_at = 6; //创建时间 + int64 effect_num = 7; //有效拉新人数 + int32 is_new = 8; //是否新用户(0-否,1-是) + int32 help_status = 9; //助力状态(0-无此状态,1-助力成功,2-助力失败) + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message LevelListReq { + string project_hash_id = 1; //项目hash_id +} + +message LevelListRes { + message One { + int64 id = 1; //用户等级ID + string title = 2; //用户等级 + string mark = 3; //用户等级标识 + int64 created_at = 4; //创建时间 + int64 num = 5; //关联数量 + } + repeated One list = 1; //列表数据 +} + +message LevelStoreReq { + string project_hash_id = 1; //项目hash_id + string title = 2; //用户等级 + string mark = 3; //用户等级标识 +} + +message LevelStoreRes { +} + +message LevelEditReq { + int64 id = 1; //用户等级ID + string title = 2; //用户等级 + string mark = 3; //用户等级标识 +} + +message LevelEditRes { +} + +message LevelDestroyReq { + int64 id = 1; //用户等级ID +} + +message LevelDestroyRes { +} + +message MarkLevelReq { + int64 project_id = 1; //项目id + repeated string marks = 2; //用不标识集合 +} + +message MarkLevelRes { + message One { + int64 id = 1; //用户等级ID + string title = 2; //用户等级 + string mark = 3; //用户等级标识 + } + repeated One list = 1; //列表数据 +} + +message FinishStepReq { + int64 user_id = 1; //用户id + string step = 2; //进度节点(open_gift-开奖奖品盒子,trigger_share-触发分享) + int64 campaign_id = 3; //活动id +} + +message FinishStepRes { + int32 open_box = 1; //开奖金额 + int32 left_box = 2; //左边的盒子金额 + int32 right_box = 3; //右边的盒子金额 +} + +message SpinReq { + int64 user_id = 1; //用户id + int64 campaign_id = 2; //活动id +} + +message SpinRes { + int32 fail_type = 1; //失败类型(0-正常,1-缺乏能量,2-库存不足) + int64 id = 2; //转盘id +} + +message CashRecordsReq { + int64 user_id = 1; //用户id + int32 page = 2; //当前页 + int32 per_page = 3; //每页条数 + int32 type = 4; //记录类型(1-邀请,2-金额情况,3-能量情况,4-奖品记录) + int64 campaign_id = 5; //活动id +} + +message CashRecordsRes { + message One { + string sub_user_id = 1; //被邀请人的第三方用户ID + string title_mark = 2; //语言包对应的翻译标识 + int64 created_at = 3; //创建时间 + string dec_or_add = 4; //减或者加(dec-减,add-加) + double val = 5; //减或者加的值 + bool is_help = 6; //是否助力成功 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message MixRewardReq { + int64 user_id = 1; //用户id + int64 reward_id = 2; //奖品id + int64 campaign_id = 3; //活动ID +} + +message MixRewardRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + bool lack = 1; //奖品无库存 + int64 reward_id = 2; //奖品ID + string reward_title = 3; //奖品名称 + string img_url = 4; //奖品图片 + int32 receive_type = 5; //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送) + repeated KV kv_data = 6; //键值数据 + string contact = 7; //联系方式 + string reward_hash_id = 8; //领取的用户奖品hash_id + int32 open_to_use = 9; //开启去使用(0-否,1-是) + string web_url = 10; //Web端的跳转地址 + string app_param = 11; //App端的跳转参数 + string pc_param = 12; //pc端的跳转参数 +} + +message DiceRecordReq { + int64 user_id = 1; //用户id + string user_hash_id = 2; //用户hash_id + int32 record_type = 3; //记录类型(1-骰子记录,2-奖品记录) + string mark = 4; //记录标识 + int32 page = 5; //当前页 + int32 per_page = 6; //每页条数 + int64 campaign_id = 7; //活动ID + string campaign_hash_id = 8; //活动hash_id + repeated int32 conds = 9; //过滤条件(1-获得骰子;2-获得奖品;3-获得碎片;4-获得幸运骰;5-掷骰子;6-使用幸运骰子;7-完成任务;8-获得奖品) +} + +message DiceRecordRes { + message One { + int64 id = 1; //记录id + string mark = 2; //记录标识(roll-掷骰子,get_roll_all-完成所有任务获得骰子,get_roll_task-完成任务获得骰子,roll_collect-获得碎片,roll_chance-再摇一次,lucky-使用幸运骰,get_lucky-获得幸运骰,normal_reward-普通奖品,supper_reward-超级大奖) + int64 created_time = 3; //记录时间 + Data data = 4; //数据 + } + message Data { + int32 point = 1; //掷骰子的点数 + string title = 2; //奖品标题 + string reward_title = 3; //奖品名称 + string reward_url = 4; //奖品图片 + int32 is_supper = 5; //是否超级大奖 + int32 chance = 6; //获得的骰子个数 + int32 lucky_chance = 7; //获得的幸运骰个数 + string task_title = 8; //完成任务的标题 + int32 receive_type = 9; //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送,4-提交表单) + repeated KV kv_data = 10; //键值数据 + string contact = 11; //联系方式 + string reward_hash_id = 12; //领取的用户奖品hash_id + int32 open_to_use = 13; //开启去使用(0-否,1-是) + string web_url = 14; //Web端的跳转地址 + string app_param = 15; //App端的跳转参数 + bool lack = 16; //是否没有库存 + int32 dy_reward_type = 17; //动态奖品内容类型(0-无,1-兑换码) + string custom_reward_val = 18; //自定义的奖品值 + string pc_param = 19; //pc端的跳转参数 + int64 reward_id = 20; //活动奖品id + int32 points_use_num = 21; //消耗的积分 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message RewardFormReq { + string reward_hash_id = 1; //领取的用户奖品hash_id + string lang_mark = 2; //展示的语言 + int64 reward_id = 3; //活动奖品id + int64 user_id = 4; //用户id + int64 campaign_id = 5; //活动ID + string campaign_hash_id = 6; //活动hash_id +} + +message RewardFormRes { + message Item { + string name = 1; //表单项展示的名称 + string key = 2; //表单项需要提交的key + string value = 3; //表单项填写的值 + } + bool is_submit = 1; //是否已经填写表单 + string title = 2; //表单标题 + repeated Item items = 3; //表单项 + int64 id = 4; //奖品记录id + int64 reward_id = 5; //活动奖品id +} + +message SubmitFormReq { + message Item { + string name = 1; //表单项展示的名称 + string key = 2; //表单项需要提交的key + string value = 3; //表单项填写的值 + } + string reward_hash_id = 1; //领取的用户奖品hash_id + repeated Item items = 2; //表单项 + int64 campaign_id = 3; //活动ID +} + +message SubmitFormRes { + int32 fail_type = 1; //提交失败状态(0-提交成功,1-不能重复提交,2-表单参数异常,需要刷新表单,3-非需要填写表单奖品) +} + +message GetAdsUrlReq { + int64 cond_id = 1; //条件id + int64 user_id = 2; //条件id +} + +message GetAdsUrlRes { + message AdG { + string adc = 1; //谷歌账号id + string ga_show_id = 2; //谷歌展示广告id + string ga_embed_id = 3; //谷歌内嵌广告id + string ga_double_id = 4; //谷歌多重广告id + } + string url = 1; //广告地址 + string token = 2; //token + string user_hash_id = 3; //用户hash_id + string event = 4; //事件关键字 + string event_key = 5; //事件key + string event_val = 6; //事件值 + int64 jump_time = 7; //跳转到时间 + AdG ad_g = 8; //谷歌账号信息 +} + +message AdsStayReq { + string token = 1; //token + string user_hash_id = 2; //用户hash_id + string event = 3; //事件关键字 + string event_key = 4; //事件key + string event_val = 5; //事件值 + int64 jump_time = 6; //跳转到时间 +} + +message AdsStayRes { + int32 stay_lave = 1; //剩余时长(单位:s) + bool done = 2; //是否完成任务 +} + +message ClueNotifiedReq { + int64 user_id = 1; //跳转到时间 +} + +message ClueNotifiedRes { +} + +message ChangeUserLevelReq { + int64 project_id = 1; //项目id + string sub_user_id = 2; //第三方的用户id + string user_level = 3; //用户等级,多个用逗号分隔 +} + +message ChangeUserLevelRes { +} + +message ChopRewardReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message ChopRewardRes { + message Reward { + int64 id = 1; //活动奖品id + string title = 2; //奖品标题 + string img_url = 3; //奖品图片 + } + repeated Reward rewards = 1; //奖品列表 +} + +message HelpPercentReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message HelpPercentRes { + bool is_fix = 1; //是否是默认赠送的 + double old_percent = 2; //追加前的进度 + double add_percent = 3; //追加进度 +} + +message InvokeCondReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int32 pre_cond = 3; //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后) +} + +message InvokeCondRes { + message Reward { + int64 id = 1; //活动奖品id + string title = 2; //奖品标题 + string img_url = 3; //奖品图片 + } + int64 id = 1; //达标条件ID + string desc = 2; //达标条件 + int32 if_cond = 3; //等式(0-等于,1-大于等于,2-累计) + string event = 4; //事件关键字 + string event_key = 5; //事件key + string event_val = 6; //事件值 + int32 task_chance = 7; //完成发放的次数(如:骰子数) + string web_url = 8; //web端跳转地址 + string app_param = 9; //app事件参数 + int32 event_type = 10; //事件来源(1-自定义事件,2-广告事件) + int32 view_type = 11; //广告观看路径(1-APP内,2-APP外) + int32 go_show = 12; //是否显示“去完成按钮”(0-否,1-是) + string ads_strategy_id = 13; //策略id + int32 is_super = 14; //是否超级任务(0-否,1-是) + int32 has_pre = 15; //是否有前置任务(0-否,1-是) + Reward reward = 16; //奖品 + string prop_mark = 17; //奖励的道具类型(chance-道具数量,reward-奖品) + int64 expired_sec = 18; //距离过期还有多少秒 + string pc_param = 19; //pc事件参数 +} + +message KeepRewardReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message KeepRewardRes { + message Reward { + int64 id = 1; //活动奖品id + string title = 2; //奖品标题 + string img_url = 3; //奖品图片 + int64 num = 4; //被选择的数量 + int32 status = 5; //奖品状态(0-正常,1-无库存,2-超过可获取上限) + } + repeated Reward rewards = 1; //奖品列表 +} + +message KeepSelectReq { + int64 reward_id = 1; //奖品id + int64 campaign_id = 2; //活动id + int64 user_id = 3; //用户id +} + +message KeepSelectRes { + int32 status = 1; //状态(0-正常,1-奖品下架,2-库存不足,3-超过获取上限) +} + +message KeepCollectReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message KeepCollectRes { + message Reward { + int32 reward_type = 1; //奖励类型(1-道具,2-奖品) + int32 chance = 2; //道具数量 + int64 reward_id = 3; //奖品id + string reward_title = 4; //奖品名称 + string reward_img = 5; //奖品图片 + bool lack = 6; //奖品没有库存 + bool last_reward = 7; //是否最终奖品 + int32 receive_type = 8; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-监听器,4-提交表单) + } + repeated Reward gets = 1; //获得的奖励 + int32 num = 2; //收集的爱心数 +} + +message KeepFeedReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message KeepFeedRes { + int32 status = 1; //状态(0-正常,1-请收爱心,2-狗粮不足) + int32 add_percent = 2; //获得的奖励 +} + +message MachineSaveReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id + double num = 3; //道具数量 +} + +message MachineSaveRes { +} + +message MachineRecycleReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id + double num = 3; //道具数量 +} + +message MachineRecycleRes { + int32 machine_limit = 1; //机器被限制(0-正常,1-每日限制) + int64 next_full = 2; //离线狗粮机填满剩余秒数 + int32 get_num = 3; //进入粮食袋的狗粮 +} + +message GetPropFeedReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message GetPropFeedRes { + int32 num = 1; //道具数量 +} + +message KeepLogReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int64 campaign_id = 3; //活动id + int64 user_id = 4; //用户id + repeated int32 type = 5; //类型 +} + +message KeepLogRes { + message One { + int32 type = 1; //日志类型(1-收集爱心,2-获得狗粮,3-喂养狗粮) + string source = 2; //来源标识 + string val = 3; //数值 + int64 created_at = 4; //创建时间 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message KeepReselectReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message KeepReselectRes { + int32 status = 1; //状态(0-正常,1-超过最大养成次数,2-当前宠物还能养) +} + +message KeepGuideReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message KeepGuideRes { + int32 reward_type = 1; //奖励类型(1-道具,2-奖品) + int32 chance = 2; //道具数量 + int64 reward_id = 3; //奖品id + string reward_title = 4; //奖品名称 + string reward_img = 5; //奖品图片 + bool lack = 6; //奖品没有库存 + int32 receive_type = 7; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-监听器,4-提交表单) +} + +message KeepFirstInviteReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message KeepFirstInviteRes { + int32 open_invite = 1; //开启邀请(0-关闭,1-开启) + int32 day_first_invite = 2; //当天是否还没完成第一次邀请(0-否,1-是) + int32 day_first_feed = 3; //当天是否还没完成第一次喂养(0-否,1-是) + int64 expired_sec = 4; //过期剩余秒数 +} + +message ChildReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message ChildRes { + message Invite { + int32 open = 1; //是否开启(0-否,1-是) + int32 status = 2; //状态(1-待完成,2-已完成) + int64 start = 3; //开始时间 + int64 end = 4; //结束时间 + int64 invite_num = 5; //邀请数 + string rank = 6; //排名 + repeated RankOne rank_list = 7; //排行榜列表 + Record record = 8; //奖品信息 + string child_hash_id = 9; //子活动hash_id + } + message RankOne { + string sub_user_id = 1; //用户id + int64 invite_num = 2; //邀请人数 + int64 reward_id = 3; //活动奖品id + string title = 4; //奖励内容 + string img = 5; //奖品图片 + string prop_mark = 6; //道具类型(reward-奖品,chance-活动道具) + int32 reward_num = 7; //发放奖品数量 + } + message Sign { + int32 open = 1; //是否开启(0-否,1-是) + int32 status = 2; //状态(1-待完成,2-已完成) + repeated Reward rewards = 3; //签到板数据 + Record record = 4; //奖品信息 + int64 reward_id = 5; //上一次中奖的活动奖品id + string child_hash_id = 6; //子活动hash_id + } + message Lucky { + int32 open = 1; //是否开启(0-否,1-是) + int32 status = 2; //状态(1-待完成,2-已完成) + repeated Reward rewards = 3; //奖品列表 + Record record = 4; //奖品信息 + string child_hash_id = 5; //子活动hash_id + } + message Reward { + int64 reward_id = 1; //活动奖品id + string title = 2; //奖励内容 + string img = 3; //奖品图片 + string prop_mark = 4; //道具类型(reward-奖品,chance-活动道具) + int32 reward_num = 5; //发放奖品数量 + int32 is_super = 6; //是否超级大奖(0-否,1-是) + int32 is_get = 7; //是否被领取(0-否,1-是) + } + message Blind { + int32 open = 1; //是否开启(0-否,1-是) + int32 status = 2; //状态(1-待完成,2-已完成) + Record record = 3; //奖品信息 + string child_hash_id = 4; //子活动hash_id + } + message Record { + int64 id = 1; //奖品记录int型id + string hash_id = 2; //奖品记录string型hash_id + int64 reward_id = 3; //活动奖品id + string title = 4; //奖励内容 + repeated KV kv_data = 5; //键值对 + string img = 6; //奖品图片 + string contact = 7; //联系方式 + int32 open_to_use = 8; //开启去使用(0-否,1-是) + string web_url = 9; //Web端的跳转地址 + string app_param = 10; //App端的跳转参数 + int32 dy_reward_type = 11; //动态奖品内容类型(0-无,1-兑换码) + string custom_reward_val = 12; //自定义的奖品值 + string prop_mark = 13; //道具类型(reward-奖品,chance-活动道具) + int32 reward_num = 14; //发放奖品数量 + int32 is_super = 15; //是否超级大奖(0-否,1-是) + string pc_param = 16; //pc端的跳转参数 + int32 receive_type = 17; //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + Blind blind = 1; //每日盲盒 + Lucky lucky = 2; //每日抽奖 + Sign sign = 3; //签到抽奖 + Invite invite = 4; //竞赛抽奖 +} + +message ChildActiveReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id + int32 child_type = 3; //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务) +} + +message ChildActiveRes { + message Record { + int64 reward_id = 1; //活动奖品id + string prop_mark = 2; //道具类型(reward-奖品,chance-活动道具) + int32 reward_num = 3; //发放奖品数量 + int32 is_super = 4; //是否超级大奖(0-否,1-是) + string title = 5; //奖励内容 + repeated KV kv_data = 6; //键值对 + string img = 7; //奖品图片 + string contact = 8; //联系方式 + int32 open_to_use = 9; //开启去使用(0-否,1-是) + string web_url = 10; //Web端的跳转地址 + string app_param = 11; //App端的跳转参数 + int32 dy_reward_type = 12; //动态奖品内容类型(0-无,1-兑换码) + int64 id = 13; //奖品记录int型id + string hash_id = 14; //奖品记录string型hash_id + string custom_reward_val = 15; //自定义的奖品值 + string pc_param = 16; //pc端的跳转参数 + int32 receive_type = 17; //领取类型(1-服务端推送,2-监听器,3-客户自主发放) + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + int32 status = 1; //状态(0-正常,1-尚未结算) + Record record = 2; //奖品信息 +} + +message GoldFinishStepReq { + int64 user_id = 1; //用户id + string step = 2; //进度节点(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, trigger_share-赠送能量) + int64 campaign_id = 3; //活动id +} + +message GoldFinishStepRes { + double open_box = 1; //开奖金额 + double left_box = 2; //左边的盒子金额 + double right_box = 3; //右边的盒子金额 +} + +message GoldNotifyReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message GoldNotifyRes { + int32 old_gold = 1; //追加前的进度 + int32 add_gold = 2; //追加进度 +} + +message GoldRecordReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int32 page = 3; //当前页 + int32 per_page = 4; //每页条数 +} + +message GoldRecordRes { + message One { + string title = 1; //任务标题 + int32 gold_num = 2; //金币数量 + int64 created_at = 3; //创建时间 + string mark = 4; //语言包标识 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message DeductReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message DeductRes { + int32 status = 1; //扣除状态(0-正常,1-缺积分,2-达到上限,3-当前场次已经结束,无法参加) + int64 total = 2; //总奖池金币数 + int32 use_num = 3; //参与了几次 + int64 get_coin = 4; //获得的金币数 + int64 open_sec = 5; //距离开奖的秒数 +} + +message GainReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message GainRes { + int32 status = 1; //状态(0-正常;1-没到开奖时间;2-参与次数不足;3-领奖超时;4-已领取不能再领) + int64 get_coin = 2; //领取的积分数量 +} + +message CoinRecordReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + string campaign_hash_id = 3; //活动hash_id + int32 page = 4; //当前页 + int32 per_page = 5; //每页条数 + int64 scene_id = 6; //场次id + repeated int32 type = 7; //日志类型(1-消耗金币,2-获得金币,3-奖励) + string source = 8; //来源标识 + int32 t_offset = 9; //时区 + int64 start = 10; //创建时间开始时间戳 + int64 end = 11; //创建时间结束时间戳 + string sub_user_id = 12; //用户id +} + +message CoinRecordRes { + message One { + int64 id = 1; //记录id + int32 type = 2; //日志类型(1-消耗金币,2-获得金币) + int64 created_at = 3; //创建时间 + string source = 4; //来源标识 + int64 num = 5; //数量 + string sub_user_id = 6; //第三方用户id + string title = 7; //场次说明 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message ChildListReq { + string campaign_hash_id = 1; //活动hash_id + int32 page = 2; //当前页 + int32 per_page = 3; //每页条数 + string user_mark = 4; //用户标识关键字 + int64 start = 5; //参与时间开始时间戳 + int64 end = 6; //参与时间结束时间戳 + int32 t_offset = 7; //时区 + int32 pid_type = 8; //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + string parent_user_mark = 9; //上级用户标识关键字 +} + +message ChildListRes { + message One { + int64 id = 1; //记录id + int64 join_at = 2; //参与时间 + string sub_user_id = 3; //用户 + string parent = 4; //用户上级 + Num sign = 5; //签到数据 + Num invite = 6; //邀请数据 + Num blind = 7; //盲盒数据 + Num lottery = 8; //抽奖数据 + } + message Num { + int64 num = 1; //签到天数,邀请人数,开盒次数,抽奖次数 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 + int32 child_type = 3; //子活动类型 + int32 t_offset = 4; //时区 +} + +message ReceiveRewardReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id + int64 task_id = 3; //任务id +} + +message ReceiveRewardRes { + message Reward { + string hash_id = 1; //领奖记录hash_id + string title = 2; //奖品名称 + string img = 3; //奖品图片 + string jump_url = 4; //跳转地址 + repeated KV kv_data = 5; //奖品自定义参数数据 + int32 receive_type = 6; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + string contact = 7; //联系方式 + int64 created_at = 8; //创建时间 + int32 open_to_use = 9; //开启去使用(0-否,1-是) + string web_url = 10; //Web端的跳转地址 + string app_param = 11; //App端的跳转参数 + string pc_param = 12; //pc端的跳转参数 + int32 lack = 13; //是否缺乏库存(1-是,0-否) + int32 reward_num = 14; //奖励数量 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + string prop_mark = 1; //任务道具 + int32 chance = 2; //获得道具的数量 + Reward reward = 3; //奖品信息 +} + +message LotteryLogReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string campaign_hash_id = 3; //活动id + string user_hash_id = 4; //用户id + string sub_user_id = 5; //用户id + repeated string source = 6; //记录标识(sign-每日签到,install-安装拉新任务,register-注册拉新任务,cond_all-完成配置任务,cond_one-完成指定任务,manual_cond_all-手动领取完成配置任务,manual_cond_one-手动领取完成的指定任务,lottery-抽奖) +} + +message LotteryLogRes { + message One { + int64 id = 1; //记录id + int64 created_at = 2; //创建时间 + int32 type = 3; //日志类型(1-获得抽奖机会,2-消耗抽奖机会) + string source = 4; //记录标识(sign-每日签到,install-安装拉新任务,register-注册拉新任务,cond_all-完成配置任务,cond_one-完成指定任务,manual_cond_all-手动领取完成配置任务,manual_cond_one-手动领取完成的指定任务,lottery-抽奖) + string task_title = 5; //奖品图片 + string reward_title = 6; //奖品标题 + int32 chance = 7; //消耗或者获得的抽奖机会次数 + int32 points_use_num = 8; //消耗的积分 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message UserListReq { + repeated int64 ids = 1; //用户id + int64 campaign_id = 2; //活动id +} + +message UserListRes { + message One { + int64 id = 1; //活动用户ID + string hash_id = 2; //活动用户对外id + string sub_user_id = 3; //用户 + string device_id = 4; //用户 + } + repeated One list = 1; //数据集合 +} + +message CashAgainReq { + int64 campaign_id = 1; //活动id + int64 user_id = 2; //用户id +} + +message CashAgainRes { +} + +message DiceCollectReq { + string campaign_hash_id = 1; //活动id + string hash_id = 2; //用户id +} + +message DiceCollectRes { + message One { + int64 reward_id = 1; //奖品id + int32 num = 2; //当前拥有碎片数 + int32 collect_num = 3; //收集碎片总数 + string title = 4; //奖品名称 + int32 mix_num = 5; //合成次数 + int32 max_num = 6; //可获得碎片上限 + } + repeated One list = 1; //数据集合 +} + +message ClientRewardReq { + string user_id = 1; //第三方用户id + string porject_hash_id = 2; //项目id + int64 campaign_id = 3; //活动id + int64 campaign_user_id = 4; //活动用户id +} + +message ClientRewardRes { + message Reward { + string hash_id = 1; //发奖记录hash_id + int64 created_at = 2; //发奖时间 + repeated KV kv_data = 3; //键值对 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + repeated Reward rewards = 1; //奖品集合 +} + +message PointsUseReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message PointsUseRes { + int32 status = 1; //状态(0-成功,1-积分不足,2-积分使用关闭,3-积分每日使用次数超限额,4-积分使用次数超限额) +} + +message ChatReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + string input = 3; //发送信息 +} + +message ChatRes { + int32 status = 1; //状态(0-成功,1-token不足,2-每日限制) + string content = 2; //内容 + string source = 3; //来源(input-输入,output-输出,system-系统) + int32 msg_type = 4; //消息类型(1-文本,2-固定文案,3-系统通知) + int64 created_at = 5; //创建时间 + int64 msg_id = 6; //消息id +} + +message ChatListReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int64 last_id = 3; //最后一条记录id + int32 per_page = 4; //每页条数 +} + +message ChatListRes { + message One { + string content = 1; //内容 + string source = 2; //来源(input-输入,output-输出,system-系统) + int32 msg_type = 3; //消息类型(1-文本,2-固定文案,3-系统通知) + int64 created_at = 4; //创建时间 + int64 msg_id = 5; //消息id + } + repeated One list = 1; //列表数据 +} + +message ScheduleListReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int32 tab_type = 3; //赛程类型(1-进行赛事,2-全部,3-已参与) +} + +message ScheduleListRes { + message One { + int64 id = 1; //赛程id + string desc = 2; //赛程标题 + string vs_img = 3; //赛程图片 + string vs_date = 4; //开赛日期 + int32 vs_tz = 5; //开赛时区 + int64 vote_countdown = 6; //投票倒计时 + int32 status = 7; //投票状态(1-即将投票,2-投票中,3-待结算,4-已结算) + int32 win_type = 8; //结算获奖类型(1-队伍胜利,2-平局) + int64 win_team_id = 9; //结算获胜队伍id + repeated Team teams = 10; //队伍集合 + UserVote user_vote = 11; //用户状态 + Reward reward = 12; //奖励 + repeated Vote votes = 13; //用户投票 + repeated string other_vote = 14; //其他投票选项 + repeated Score scores = 15; //队伍分数 + int32 open_odds = 16; //是否开启赔率(0-否,1-是) + string odds_left = 17; //队伍1赔率 + string odds_right = 18; //队伍2赔率 + string odds_draw = 19; //平局赔率 + } + message Score { + int64 team_id = 1; //队伍id + string score = 2; //队伍分数 + } + message Vote { + int32 win_type = 1; //获奖类型(1-队伍胜利,2-平局) + int64 win_team_id = 2; //获胜队伍id + int64 num = 3; //投票次数 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍logo + string score = 4; //队伍分数 + } + message UserVote { + int32 user_win_type = 1; //用户选择的获奖类型(1-队伍胜利,2-平局) + int64 user_win_team_id = 2; //用户选择的获胜队伍id + bool is_win = 3; //是否赢得奖励 + int32 vote_num = 4; //投票次数 + } + message Reward { + int64 reward_id = 1; //活动奖励id + string prop_mark = 2; //奖品类型(reward-奖品,point-积分) + string title = 3; //奖品名称 + string img = 4; //奖品图片 + repeated KV kv_data = 5; //奖品自定义参数数据 + int32 receive_type = 6; //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器) + string contact = 7; //联系方式 + int32 open_to_use = 8; //开启去使用(0-否,1-是) + string web_url = 9; //Web端的跳转地址 + string app_param = 10; //App端的跳转参数 + string pc_param = 11; //pc端的跳转参数 + int32 prop_num = 12; //道具数量 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + repeated One list = 1; //列表数据 +} + +message MallListReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message MallListRes { + message One { + int64 id = 1; //商城奖品id + int64 reward_id = 2; //奖品id + string title = 3; //奖品标题 + string img_url = 4; //奖品图片URL + int64 remain = 5; //剩余库存 + int32 status = 6; //状态(1-上架,2-待上架,3-下架,4-删除) + int64 up_remain = 7; //上架剩余时间 + int32 coin_num = 8; //奖品金币数量 + } + repeated One list = 1; //列表数据 +} + +message ExchangeReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int64 mall_item_id = 3; //商城商品id +} + +message ExchangeRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + int32 status = 1; //状态(0-成功,1-库存不足,2-兑换上限,3-商品已下架) + int64 id = 2; //兑换记录id + int64 reward_id = 3; //奖品id + string title = 4; //奖品名称 + string img_url = 5; //图片地址 + repeated KV kv_data = 6; //奖品对应的键值数据 + int32 receive_type = 7; //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + string contact = 8; //联系方式 + int32 open_to_use = 9; //开启去使用(0-否,1-是) + string custom_reward_val = 10; //自定义数据 + string web_url = 11; //Web端的跳转地址 + string app_param = 12; //App端的跳转参数 + string pc_param = 13; //pc端的跳转参数 + string fail_type = 14; //失败类型 + string fail_msg = 15; //失败具体原因 +} + +message VoteListReq { + string user_hash_id = 1; //活动用户id + string campaign_hash_id = 2; //活动id +} + +message VoteListRes { + message One { + int64 id = 1; //投票id + repeated Team teams = 2; //队伍 + int32 win_type = 3; //获奖类型(1-队伍胜利,2-平局) + int64 win_team_id = 4; //获胜队伍id + int32 free_vote = 5; //免费投票次数 + int32 point_vote = 6; //积分投票次数 + } + message Team { + int64 id = 1; //队伍id + string name = 2; //队伍名称 + string logo_img = 3; //队伍图标 + } + repeated One list = 1; //投票列表 +} + +message VsTipRewardReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message VsTipRewardRes { +} + +message UnoRandCardReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + string prop_mark = 3; //道具类型(three- +3道具,five- +5道具, fix-固定道具) + string color_mark = 4; //道具颜色类型(red-红,green-绿,blue-蓝,yellow-黄) +} + +message UnoRandCardRes { + message Card { + string mark = 1; //卡颜色标识 + int32 card_no = 2; //卡编号 + } + int32 status = 1; //状态(0-成功,1- 抽奖次数不足,2-道具不足,3-道具不存在) + repeated Card cards = 2; //获得的牌牌 +} + +message UnoClaimReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + string color_mark = 3; //道具颜色类型(red-红,green-绿,blue-蓝,yellow-黄) +} + +message UnoClaimRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + int32 status = 1; //状态(0-成功,1-正在收集中,2-已经收集过了) + int64 id = 2; //记录id + string hash_id = 3; //记录hash_id + int64 reward_id = 4; //奖品id + string title = 5; //奖品名称 + string img_url = 6; //图片地址 + repeated KV kv_data = 7; //奖品对应的键值数据 + int32 receive_type = 8; //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + string contact = 9; //联系方式 + int32 open_to_use = 10; //开启去使用(0-否,1-是) + string custom_reward_val = 11; //自定义数据 + string web_url = 12; //Web端的跳转地址 + string app_param = 13; //App端的跳转参数 + string pc_param = 14; //pc端的跳转参数 +} + +message UnoCardReq { + string user_hash_id = 1; //活动用户id + string campaign_hash_id = 2; //活动id +} + +message UnoCardRes { + message One { + int64 id = 1; //卡组id + string mark = 2; //颜色标识 + repeated int32 card_info = 3; //卡牌信息 + int32 pre_intact_num = 4; //待合成奖品数 + int32 intact_num = 5; //完整奖品数 + int32 limit_num = 6; //上限奖品数 + } + repeated One list = 1; //投票列表 +} + +message ShowReq { + string user_hash_id = 1; //活动用户id + string campaign_hash_id = 2; //活动id +} + +message ShowRes { + int64 id = 1; //用户id + string hash_id = 2; //用户列表对外id + string user_id = 3; //第三方用户id + string device_id = 4; //设备id + int64 created_at = 5; //参与时间 + int32 source = 6; //参与来源 + string lang_mark = 7; //语言标识 + repeated string lang_marks = 8; //历史关联语言 + string lv_mark = 9; //用户标签 + string lv_marks = 10; //历史用户标签 + string os = 11; //操作系统 + string oss = 12; //历史操作系统 + int64 join_at = 13; //首次访问时间 + int64 join_at_last = 14; //最后访问时间 + int32 tz = 15; //所属时区 +} + +message EventFirstVisitReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message EventFirstVisitRes { + message EventReward { + string prop_mark = 1; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward reward = 2; //奖品 + int32 chance = 3; //道具数量 + } + message Reward { + int64 id = 1; //记录id + string hash_id = 2; //记录hash_id + int64 reward_id = 3; //奖品id + int32 reward_num = 4; //奖品数量 + string title = 5; //奖品名称 + string img_url = 6; //图片地址 + repeated KV kv_data = 7; //奖品对应的键值数据 + int32 receive_type = 8; //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + string contact = 9; //联系方式 + string custom_reward_val = 10; //自定义数据 + string web_url = 11; //Web端的跳转地址 + string app_param = 12; //App端的跳转参数 + string pc_param = 13; //pc端的跳转参数 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + repeated EventReward rewards = 1; //奖励 +} + +message FindByUniqReq { + int64 campaign_id = 1; //活动id + string sub_user_id = 2; //用户id + string device_id = 3; //设备id +} + +message FindByUniqRes { + int64 id = 1; //用户id +} + +message TaskTipReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id +} + +message TaskTipRes { + message EventReward { + string prop_mark = 1; //奖励的道具类型(chance-道具数量,reward-奖品,point-积分) + Reward reward = 2; //奖品 + int32 chance = 3; //道具数量 + } + message Reward { + int64 id = 1; //记录id + string hash_id = 2; //记录hash_id + int64 reward_id = 3; //奖品id + int32 reward_num = 4; //奖品数量 + string title = 5; //奖品名称 + string img_url = 6; //图片地址 + repeated KV kv_data = 7; //奖品对应的键值数据 + int32 receive_type = 8; //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + string contact = 9; //联系方式 + string custom_reward_val = 10; //自定义数据 + string web_url = 11; //Web端的跳转地址 + string app_param = 12; //App端的跳转参数 + string pc_param = 13; //pc端的跳转参数 + } + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + repeated EventReward rewards = 1; //奖励 + int32 l = 2; //长度 +} + +message TaskTipOkReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int32 l = 3; //长度 +} + +message TaskTipOkRes { +} + +message CoinLogReq { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + int32 page = 3; //当前页 + int32 per_page = 4; //每页条数 + int32 type = 5; //每页条数 +} + +message CoinLogRes { + message One { + int64 created_at = 1; //创建时间 + string mark = 2; //标识 + int32 num = 3; //数量 + int32 type = 4; //类型 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} diff --git a/proto/proto/w_coin.proto b/proto/proto/w_coin.proto new file mode 100644 index 0000000..0126d2f --- /dev/null +++ b/proto/proto/w_coin.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; + +package w_coinpb; +option go_package = './;w_coinpb'; + +//积分服务 +service WCoin { + +// Save 积分配置保存 +rpc Save(SaveReq) returns (SaveRes) {} +// Show 积分配置展示 +rpc Show(ShowReq) returns (ShowRes) {} + +} + +message SaveReq { + message Lang { + string lang_mark = 1; //语言标识 + string title = 2; //展示标题 + string img_url = 3; //展示图片 + string rule = 4; //积分规则 + int32 is_default = 5; //是否默认(0-否,1-是) + } + string project_hash_id = 1; //项目hash_id + string title = 2; //积分标题 + int32 open_push = 3; //同步推送(0-关闭,1-开启) + repeated string exp_select = 4; //有效期选择['7','30','90', '0'] + repeated Lang langs = 5; //语言配置 +} + +message SaveRes { +} + +message ShowReq { + string project_hash_id = 1; //项目hash_id + int64 project_id = 2; //项目ID +} + +message ShowRes { + message Lang { + string lang_mark = 1; //语言标识 + string title = 2; //展示标题 + string img_url = 3; //展示图片 + string rule = 4; //积分规则 + int32 is_default = 5; //是否默认(0-否,1-是) + } + string title = 1; //积分标题 + int32 open_push = 2; //同步推送(0-关闭,1-开启) + repeated string exp_select = 3; //有效期选择['7','30','90', '0'] + repeated Lang langs = 4; //语言配置 +} diff --git a/proto/proto/w_common.proto b/proto/proto/w_common.proto new file mode 100644 index 0000000..c5746e9 --- /dev/null +++ b/proto/proto/w_common.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; + +package w_commonpb; +option go_package = './;w_commonpb'; + +//通用服务 +service WCommon { + +// PolicyToken 获取阿里云token +rpc PolicyToken(PolicyTokenReq) returns (PolicyTokenRes) {} +// Whitelist 服务器白名单 +rpc Whitelist(WhitelistReq) returns (WhitelistRes) {} +// Download 下载 +rpc Download(DownloadReq) returns (DownloadRes) {} +// DownloadStatus 下载状态 +rpc DownloadStatus(DownloadStatusReq) returns (DownloadStatusRes) {} +// OperateLog dashboard操作日志 +rpc OperateLog(OperateLogReq) returns (OperateLogRes) {} +// SaveMaterial 保存素材 +rpc SaveMaterial(SaveMaterialReq) returns (SaveMaterialRes) {} +// MaterialList 素材列表 +rpc MaterialList(MaterialListReq) returns (MaterialListRes) {} +// CompanyMade 企业定制组件列表 +rpc CompanyMade(CompanyMadeReq) returns (CompanyMadeRes) {} + +} + +message PolicyTokenReq { + string file_suffix = 1; //文件后缀 +} + +message PolicyTokenRes { + string access_key_id = 1; //oss accessKeyId + string host = 2; //oss访问域名 + string upload_url = 3; //上传地址 + int64 expire = 4; //过期时间,单位(s) + string signature = 5; //验签字符串 + string dir = 6; //存储文件夹(文件前缀) + string key = 7; //文件名称 + string policy = 8; //验签token +} + +message WhitelistReq { +} + +message WhitelistRes { + repeated string ips = 1; //服务器列表 +} + +message DownloadReq { + message CampaignReport { + string campaign_hash_id = 1; //活动hash_id + int64 start_time = 2; //统计开始时间时间戳 + int64 end_time = 3; //统计结束时间时间戳 + } + message FissionUser { + string campaign_hash_id = 1; //活动hash_id + string user_mark = 2; //用户标识关键字 + int64 start = 3; //参与时间开始时间戳 + int64 end = 4; //参与时间结束时间戳 + string parent_user_mark = 5; //上级用户标识关键字 + int32 source = 6; //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + } + message FissionRewardRecord { + string campaign_hash_id = 1; //活动hash_id + string user_mark = 2; //用户标识关键字 + int64 start = 3; //参与时间开始时间戳 + int64 end = 4; //参与时间结束时间戳 + repeated int32 status = 5; //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发放) + string reward_title = 6; //奖品名称 + int32 t_offset = 7; //时区 + int32 is_child = 8; //是否子活动奖品 + } + message FissionUserStat { + string campaign_hash_id = 1; //活动hash_id + string type = 2; //数据类型(空-旧报表,invite-下载/注册排行榜,task-用户完成指定事件排行榜,grow-养成排行榜) + } + message AdsTable { + string campaign_hash_id = 1; //活动hash_id + int64 start_time = 2; //统计开始时间时间戳 + int64 end_time = 3; //统计结束时间时间戳 + } + message NewUserList { + string campaign_hash_id = 1; //活动hash_id + string user_mark = 2; //用户标识关键字 + int64 start = 3; //参与时间开始时间戳 + int64 end = 4; //参与时间结束时间戳 + string parent_user_mark = 5; //上级用户标识关键字 + int32 source = 6; //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件) + string lang_mark = 7; //上级用户标识关键字 + int32 t_offset = 8; //时区 + int32 pid_type = 9; //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + int32 join_type = 10; //上级用户类型(1-进入过活动的用户,2-没有进入过活动的用户) + repeated int32 user_cond = 11; //用户条件(1-有安装的用户,2-有注册的用户) + } + message CoinRecord { + int64 user_id = 1; //活动用户id + int64 campaign_id = 2; //活动id + string campaign_hash_id = 3; //活动hash_id + int64 scene_id = 4; //场次id + int32 type = 5; //日志类型(1-消耗金币,2-获得金币) + string source = 6; //来源标识 + int32 t_offset = 7; //时区 + int64 start = 8; //创建时间开始时间戳 + int64 end = 9; //创建时间结束时间戳 + string sub_user_id = 10; //用户id + } + message ChildList { + string campaign_hash_id = 1; //活动hash_id + string user_mark = 2; //用户标识关键字 + int64 start = 3; //参与时间开始时间戳 + int64 end = 4; //参与时间结束时间戳 + string parent_user_mark = 5; //上级用户标识关键字 + int32 t_offset = 6; //时区 + int32 pid_type = 7; //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户) + } + int64 user_id = 1; //下载人id + string mark = 2; //campaign_report-活动报表,fission_user-活动用户,fission_reward_record-活动奖品,fission_user_stat-活动排行榜,ads_table-广告报表,new_user_list-新版用户列表 + CampaignReport campaign_report = 3; //活动报表条件 + FissionUser fission_user = 4; //活动用户条件 + FissionRewardRecord fission_reward_record = 5; //活动奖品条件 + FissionUserStat fission_user_stat = 6; //活动排行榜条件 + AdsTable ads_table = 7; //广告报表条件 + NewUserList new_user_list = 8; //新版用户列表 + CoinRecord coin_record = 9; //金币池领扣记录 + ChildList child_list = 10; //子活动用户列表 +} + +message DownloadRes { + string hash_id = 1; //报表id +} + +message DownloadStatusReq { + string hash_id = 1; //报表id +} + +message DownloadStatusRes { + int32 status = 1; //状态(1-下载中,2-下载完成,3-下载失败,4-已过期) + string url = 2; //文件地址 + string fail_msg = 3; //失败原因 + string progress = 4; //导出进度 +} + +message OperateLogReq { + int64 user_id = 1; //员工id + string ip = 2; //客户端ip地址 + string mark = 3; //操作唯一标识,一种操作对应一个标识,长度不能超过32个字符串 + string mark_id = 4; //操作数据追踪类型id,如:修改某个活动奖品,那这个就是奖品id(其实这个字段为了优化mark索引的,所以不传也可以) + string data = 5; //记录的数据 json格式字符串 +} + +message OperateLogRes { +} + +message SaveMaterialReq { + string project_hash_id = 1; //项目hash_id + int32 material_type = 2; //素材类型(1-图片) + string material_data = 3; //素材类型的数据(图片类型:地址图片) +} + +message SaveMaterialRes { + int64 id = 1; //素材id +} + +message MaterialListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + int32 material_type = 3; //素材类型(1-图片) + int64 project_id = 4; //项目id + string project_hash_id = 5; //项目hash_id +} + +message MaterialListRes { + message One { + int64 id = 1; //素材id + int32 material_type = 2; //素材id + string material_data = 3; //素材数据 + } + repeated One list = 1; //数据集合 + int64 total = 2; //数据总数 +} + +message CompanyMadeReq { + int64 company_id = 1; //企业id +} + +message CompanyMadeRes { + message One { + int64 id = 1; //素材id + string mark = 2; //标识(lv_api支持用户类型配置api) + repeated string fission_temp = 3; //支持的模版 + } + repeated One list = 1; //数据集合 +} diff --git a/proto/proto/w_fission.proto b/proto/proto/w_fission.proto new file mode 100644 index 0000000..37041de --- /dev/null +++ b/proto/proto/w_fission.proto @@ -0,0 +1,215 @@ +syntax = "proto3"; + +package w_fissionpb; +option go_package = './;w_fissionpb'; + +//玩法服务 +service WFission { + +// List 玩法列表 +rpc List(ListReq) returns (ListRes) {} +// TemplateList 玩法模版列表 +rpc TemplateList(TemplateListReq) returns (TemplateListRes) {} +// TemplateInfo 玩法模版信息 +rpc TemplateInfo(TemplateInfoReq) returns (TemplateInfoRes) {} +// CreateTempGroup 创建模板组 +rpc CreateTempGroup(CreateTempGroupReq) returns (CreateTempGroupRes) {} +// UpdateTempGroup 更新模板组 +rpc UpdateTempGroup(UpdateTempGroupReq) returns (UpdateTempGroupRes) {} +// CreateTemp 创建玩法模版 +rpc CreateTemp(CreateTempReq) returns (CreateTempRes) {} +// CreateTempImg 创建玩法图片配置 +rpc CreateTempImg(CreateTempImgReq) returns (CreateTempImgRes) {} +// CreateTempLang 创建玩法语言配置 +rpc CreateTempLang(CreateTempLangReq) returns (CreateTempLangRes) {} +// UpdateTempImg 更新玩法图片配置 +rpc UpdateTempImg(UpdateTempImgReq) returns (UpdateTempImgRes) {} +// UpdateTempLang 更新玩法语言配置 +rpc UpdateTempLang(UpdateTempLangReq) returns (UpdateTempLangRes) {} + +} + +message ListReq { + string lang = 1; //语言(zh-cn、en) + int32 target = 2; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) + repeated int32 targets = 3; //活动目标集合 +} + +message ListRes { + message One { + int64 id = 1; //玩法id + string mark = 2; //标识 + string logo = 3; //玩法logo图 + string title = 4; //玩法标题 + bool can_use = 5; //是否可以用 + repeated string desc = 6; //玩法说明(例如:["说明1", "说明2"] + repeated string color = 7; //颜色值 + } + repeated One list = 1; //列表数据 +} + +message TemplateListReq { + string mark = 1; //玩法标识 + int32 target = 2; //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存) +} + +message TemplateListRes { + message One { + int64 id = 1; //模板组ID + string mark = 2; //模板组唯一标识 + string cover_url = 3; //模板组封面 + string title = 4; //模板组标题 + int32 sort = 5; //排序(越小越前) + repeated Temp temps = 6; //模版组模版 + int32 is_private = 7; //是否私有模板(0-否,1-是) + } + message Temp { + string hash_id = 1; //模板ID + int32 lang_type = 2; //语言(1-中文,2-英文) + } + repeated One list = 1; //列表数据 +} + +message TemplateInfoReq { + int64 id = 1; //模板ID + string hash_id = 2; //模板对外ID + string lang = 3; //国际语言标识(ISO 639-1代码) +} + +message TemplateInfoRes { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + message FixReward { + int64 id = 1; //奖品id + repeated Lang langs = 2; //语言对应的数据 + } + message Lang { + string title = 1; //奖品名称 + string img_url = 2; //奖品名称 + string lang_mark = 3; //语言标识 + } + int64 id = 1; //模板ID + string hash_id = 2; //模板对外ID + string temp_group_mark = 3; //模版组标识 + int32 lang_type = 4; //语言(1-中文,2-英文) + int32 text_type = 5; //文字模板(1-汉字模板,2-拉丁语系模板) + repeated KV image = 6; //玩法图片数据 + repeated KV lang = 7; //玩法语言包配置 + repeated FixReward fix_rewards = 8; //玩法语言包配置 +} + +message CreateTempGroupReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 fission_id = 1; //玩法id + string mark = 2; //模板组标识 + string cover_url = 3; //模版组封面 + int32 sort = 4; //排序(越小越前) + string lang_parts = 5; //支持玩法组件翻译 + repeated KV lang = 6; //玩法语言数据 + repeated int32 lang_type = 7; //支持语言 + string convert_cover_url = 8; //事件转化封面 +} + +message CreateTempGroupRes { + int64 id = 1; //模板组id +} + +message UpdateTempGroupReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 id = 1; //模板组id + string cover_url = 2; //模版组封面 + int32 sort = 3; //排序(越小越前) + string lang_parts = 4; //支持玩法组件翻译 + repeated KV lang = 5; //玩法语言数据 + repeated int32 lang_type = 6; //支持语言 + string convert_cover_url = 7; //事件转化封面 +} + +message UpdateTempGroupRes { + int64 id = 1; //模板组id +} + +message CreateTempReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 group_id = 1; //玩法组id + int32 lang_type = 2; //语言(1-中文,2-英文) + int32 text_type = 3; //文字模板(1-汉字模板,2-拉丁语系模板) + repeated KV image = 4; //玩法图片数据 + repeated KV lang = 5; //玩法语言包配置 +} + +message CreateTempRes { + int64 id = 1; //模板id + string hash_id = 2; //模板hash_id +} + +message CreateTempImgReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 id = 1; //模板id + string hash_id = 2; //模板hash_id + repeated KV image = 3; //玩法图片数据 +} + +message CreateTempImgRes { +} + +message CreateTempLangReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 id = 1; //模板id + string hash_id = 2; //模板hash_id + repeated KV lang = 3; //玩法语言数据 +} + +message CreateTempLangRes { +} + +message UpdateTempImgReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 id = 1; //模板id + string hash_id = 2; //模板hash_id + repeated KV image = 3; //玩法图片数据 +} + +message UpdateTempImgRes { +} + +message UpdateTempLangReq { + message KV { + string key = 1; //键名称 + string value = 2; //键对应的值 + string desc = 3; //键描述 + } + int64 id = 1; //模板id + string hash_id = 2; //模板hash_id + repeated KV lang = 3; //玩法语言数据 +} + +message UpdateTempLangRes { +} diff --git a/proto/proto/w_fission_web.proto b/proto/proto/w_fission_web.proto new file mode 100644 index 0000000..5fe3b1f --- /dev/null +++ b/proto/proto/w_fission_web.proto @@ -0,0 +1,111 @@ +syntax = "proto3"; + +package w_fission_webpb; +option go_package = './;w_fission_webpb'; + +//活动站外服务 +service WFissionWeb { + +// GetWebReward 抽取站外奖品 +rpc GetWebReward(GetWebRewardReq) returns (GetWebRewardRes) {} +// BindWeb 绑定站外活动 +rpc BindWeb(BindWebReq) returns (BindWebRes) {} +// WebReward 用户站外奖 +rpc WebReward(WebRewardReq) returns (WebRewardRes) {} +// WebAnswer 用户站外答题 +rpc WebAnswer(WebAnswerReq) returns (WebAnswerRes) {} +// AdsUser Ads用户数据 +rpc AdsUser(AdsUserReq) returns (AdsUserRes) {} +// AdsLottery Ads抽奖 +rpc AdsLottery(AdsLotteryReq) returns (AdsLotteryRes) {} + +} + +message GetWebRewardReq { + string hash_id = 1; //活动hash_id + string web_id = 2; //浏览器唯一id +} + +message GetWebRewardRes { + int64 id = 1; //奖品id +} + +message BindWebReq { + string campaign_hash_id = 1; //活动id + string c_mark = 2; //渠道标识 + string web_id = 3; //浏览器唯一id + string ip = 4; //ip地址 +} + +message BindWebRes { + int64 id = 1; //记录id + int64 user_id = 2; //绑定的用户id,未绑定未0 + string download_link = 3; //下载也链接 + bool submit = 4; //是否有提交题目 +} + +message WebRewardReq { + string campaign_hash_id = 1; //活动id + string web_id = 2; //浏览器唯一id + string uid = 3; //关注用户ID + string lang = 4; //语种标识 +} + +message WebRewardRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + } + bool has_reward = 1; //是否有奖品 + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + string reward_hash_id = 4; //领取的用户奖品hash_id + int32 receive_type = 5; //发放类型(1-系统发放,2-联系客服,4-提交表单) + bool is_push = 6; //是否已经推给客户 + repeated KV kv_data = 7; //键值对数据 + int64 reward_id = 8; //奖品id + string contact = 9; //联系方式 + int32 status = 10; //奖品状态(0-可领奖,1-非新下载用户无法领奖) + string web_url = 11; //web端跳转地址 + string app_param = 12; //app事件参数 + string pc_param = 13; //pc事件参数 +} + +message WebAnswerReq { + message Submit { + int64 qid = 1; //题目id + repeated int64 aid = 2; //答案id + } + string campaign_hash_id = 1; //活动id + string web_id = 2; //浏览器唯一id + repeated Submit submits = 3; //提交的答案 +} + +message WebAnswerRes { + int64 id = 1; //奖品id +} + +message AdsUserReq { + string campaign_hash_id = 1; //活动id + string web_id = 2; //浏览器唯一id + string cid = 3; //渠道标识 + string ip = 4; //ip地址 +} + +message AdsUserRes { + int64 id = 1; //站外用户id + int64 reward_id = 2; //奖品id + string title = 3; //奖品名称 + string img_url = 4; //奖品图片 +} + +message AdsLotteryReq { + int64 id = 1; //站外用户id + string platform = 2; //手机系统 andriod ios web +} + +message AdsLotteryRes { + int64 reward_id = 1; //奖品id + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 +} diff --git a/proto/proto/w_games.proto b/proto/proto/w_games.proto new file mode 100644 index 0000000..4d32d8a --- /dev/null +++ b/proto/proto/w_games.proto @@ -0,0 +1,159 @@ +syntax = "proto3"; + +package w_gamespb; +option go_package = './;w_gamespb'; + +//小游戏服务 +service WGames { + +// List 游戏列表 +rpc List(ListReq) returns (ListRes) {} +// LinkList 链接列表 +rpc LinkList(LinkListReq) returns (LinkListRes) {} +// LinkStore 创建链接 +rpc LinkStore(LinkStoreReq) returns (LinkStoreRes) {} +// LinkUpdate 更新链接 +rpc LinkUpdate(LinkUpdateReq) returns (LinkUpdateRes) {} +// LinkDestroy 删除链接 +rpc LinkDestroy(LinkDestroyReq) returns (LinkDestroyRes) {} +// Visit 访问小游戏 +rpc Visit(VisitReq) returns (VisitRes) {} +// Trace 跟踪小游戏 +rpc Trace(TraceReq) returns (TraceRes) {} +// Overview 小游戏统计 +rpc Overview(OverviewReq) returns (OverviewRes) {} +// Trend 小游戏趋势 +rpc Trend(TrendReq) returns (TrendRes) {} + +} + +message ListReq { + string project_hash_id = 1; //项目hash_id +} + +message ListRes { + message One { + int64 id = 1; //游戏id + string title = 2; //游戏标题 + string img = 3; //游戏图片 + string link = 4; //游戏链接 + } + repeated One list = 1; //列表 +} + +message LinkListReq { + int64 game_id = 1; //游戏id + string project_hash_id = 2; //项目hash_id +} + +message LinkListRes { + message One { + int64 id = 1; //链接id + string title = 2; //链接标题 + int32 is_default = 3; //是否默认链接(0-否,1-是) + string link = 4; //游戏链接 + } + repeated One list = 1; //链接列表 +} + +message LinkStoreReq { + int64 game_id = 1; //游戏id + string project_hash_id = 2; //项目hash_id + string title = 3; //链接标题 +} + +message LinkStoreRes { + int64 id = 1; //链接id + string link = 2; //游戏链接 +} + +message LinkUpdateReq { + int64 id = 1; //链接id + string project_hash_id = 2; //项目hash_id + string title = 3; //链接标题 +} + +message LinkUpdateRes { + int64 id = 1; //链接id +} + +message LinkDestroyReq { + int64 id = 1; //链接id + string project_hash_id = 2; //项目hash_id +} + +message LinkDestroyRes { + int64 id = 1; //链接id +} + +message VisitReq { + message Cert { + int64 time = 1; //时间戳 + string blackbox = 2; //通过blackBox可以在后台查询出 + string version = 3; //加解密版本 + string platform = 4; //平台 + string token = 5; //加密串 + } + string link_hash_id = 1; //链接hashid + string project_hash_id = 2; //项目hash_id + string uid = 3; //关注用户ID + string lang = 4; //语种标识 + string lv = 5; //用户等级 + Cert cert = 6; //验签数据 + string ip = 7; //客户端ip + string os = 8; //系统 + string os_version = 9; //系统版本 + string device_model = 10; //系统型号 + int64 mid = 11; //用户id +} + +message VisitRes { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id + string token = 3; //身份token + int64 expired = 4; //token过期时间,单位:秒(s) + int32 is_view = 5; //是否预览用户(1-是,0-否) +} + +message TraceReq { + int64 user_id = 1; //用户id + int64 link_id = 2; //链接id + int32 type = 3; //埋点类型(2-停留) + int32 stay_sec = 4; //停留时间,单位:秒(s) +} + +message TraceRes { +} + +message OverviewReq { + int64 game_id = 1; //游戏id + string project_hash_id = 2; //项目hash_id + int64 link_id = 3; //链接id +} + +message OverviewRes { + message One { + string mark = 1; //标识(visit_num-访问数,visit_user_num-访问用户数, total_stay-总停留时长) + int64 total = 2; //总数 + int64 yesterday = 3; //昨日总数 + string avg = 4; //平均 + } + repeated One list = 1; //列表 +} + +message TrendReq { + int64 game_id = 1; //游戏id + string project_hash_id = 2; //项目hash_id + int64 link_id = 3; //链接id + int64 start_time = 4; //开始时间 + int64 end_time = 5; //结束时间 +} + +message TrendRes { + message Y { + string type = 1; //线类型(visit_num-访问数,visit_user_num-访问用户数) + repeated int64 data = 2; //y轴数据 + } + repeated string x = 1; //x轴 + repeated Y y = 2; //y轴 +} diff --git a/proto/proto/w_library.proto b/proto/proto/w_library.proto new file mode 100644 index 0000000..8b480d9 --- /dev/null +++ b/proto/proto/w_library.proto @@ -0,0 +1,225 @@ +syntax = "proto3"; + +package w_librarypb; +option go_package = './;w_librarypb'; + +//素材库服务 +service WLibrary { + +// QaGroup 题库列表 +rpc QaGroup(QaGroupReq) returns (QaGroupRes) {} +// StoreQaGroup 创建题库 +rpc StoreQaGroup(StoreQaGroupReq) returns (StoreQaGroupRes) {} +// UpdateQaGroup 更新题库 +rpc UpdateQaGroup(UpdateQaGroupReq) returns (UpdateQaGroupRes) {} +// DestroyQaGroup 删除题库 +rpc DestroyQaGroup(DestroyQaGroupReq) returns (DestroyQaGroupRes) {} +// QaList 问题列表 +rpc QaList(QaListReq) returns (QaListRes) {} +// StoreQa 问题列表 +rpc StoreQa(StoreQaReq) returns (StoreQaRes) {} +// UpdateQa 问题列表 +rpc UpdateQa(UpdateQaReq) returns (UpdateQaRes) {} +// DestroyQa 问题列表 +rpc DestroyQa(DestroyQaReq) returns (DestroyQaRes) {} +// QaGroupSelect 题库选项 +rpc QaGroupSelect(QaGroupSelectReq) returns (QaGroupSelectRes) {} +// QaRand 随机问题 +rpc QaRand(QaRandReq) returns (QaRandRes) {} +// QaShow 问题详情 +rpc QaShow(QaShowReq) returns (QaShowRes) {} + +} + +message QaGroupReq { + string project_hash_id = 1; //项目hash_id + int32 page = 2; //当前页 + int32 per_page = 3; //每页条数 + string title = 4; //标题 +} + +message QaGroupRes { + message One { + int64 id = 1; //题库ID + string hash_id = 2; //题库对外id + string title = 3; //标题 + int64 created_at = 4; //创建时间 + int64 qa_count = 5; //问题数量 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message StoreQaGroupReq { + string project_hash_id = 1; //项目hash_id + string title = 2; //标题 +} + +message StoreQaGroupRes { +} + +message UpdateQaGroupReq { + string project_hash_id = 1; //项目hash_id + string hash_id = 2; //题库对外id + string title = 3; //标题 +} + +message UpdateQaGroupRes { +} + +message DestroyQaGroupReq { + string project_hash_id = 1; //项目hash_id + string hash_id = 2; //题库对外id +} + +message DestroyQaGroupRes { +} + +message QaListReq { + string group_hash_id = 1; //题库对外id + int32 page = 2; //当前页 + int32 per_page = 3; //每页条数 + string title = 4; //题目 + string mark = 5; //问题类型(image_text-图文,video-视频,audio-音频) +} + +message QaListRes { + message One { + int64 id = 1; //问题ID + string hash_id = 2; //问题对外id + string mark = 3; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 4; //题目 + string cover_url = 5; //封面图 + string link_url = 6; //附件地址 + string explain_text = 7; //答案解析 + string explain_img = 8; //答案解析图 + repeated Option options = 9; //选项 + int64 created_at = 10; //创建时间 + string answer_mark = 11; //答案类型(image_text-图文,text-文本) + } + message Option { + int64 id = 1; //选项id + string title = 2; //答案内容 + string img_url = 3; //答案图片 + int32 is_right = 4; //是否正确答案(1-是,0-否) + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message StoreQaReq { + message Option { + string title = 1; //答案内容 + string img_url = 2; //答案图片 + int32 is_right = 3; //是否正确答案(1-是,0-否) + } + string group_hash_id = 1; //题库对外id + string mark = 2; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 3; //题目 + string cover_url = 4; //封面图 + string link_url = 5; //附件地址 + string explain_text = 6; //答案解析 + string explain_img = 7; //答案解析图 + repeated Option options = 8; //选项 + string answer_mark = 9; //答案类型(image_text-图文,text-文本) +} + +message StoreQaRes { +} + +message UpdateQaReq { + message Option { + int64 id = 1; //选项id + string title = 2; //答案内容 + string img_url = 3; //答案图片 + int32 is_right = 4; //是否正确答案(1-是,0-否) + } + string hash_id = 1; //问题对外id + string mark = 2; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 3; //题目 + string cover_url = 4; //封面图 + string link_url = 5; //附件地址 + string explain_text = 6; //答案解析 + string explain_img = 7; //答案解析图 + repeated Option options = 8; //选项 + string answer_mark = 9; //答案类型(image_text-图文,text-文本) +} + +message UpdateQaRes { +} + +message DestroyQaReq { + string hash_id = 1; //问题对外id +} + +message DestroyQaRes { +} + +message QaGroupSelectReq { + string project_hash_id = 1; //项目hash_id + string mark = 2; //问题类型(image_text-图文,video-视频,audio-音频) +} + +message QaGroupSelectRes { + message One { + int64 id = 1; //题库ID + string hash_id = 2; //题库对外id + string title = 3; //标题 + int64 qa_num = 4; //题目数量 + } + repeated One list = 1; //列表数据 +} + +message QaRandReq { + int64 campaign_id = 1; //活动id + string group_hash_id = 2; //题库对外id + string lang_mark = 3; //用户语言 + int64 user_id = 4; //获得取题库的用户id +} + +message QaRandRes { + message One { + int64 id = 1; //问题ID + string hash_id = 2; //问题对外id + string mark = 3; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 4; //题目 + string cover_url = 5; //封面图 + string link_url = 6; //附件地址 + string explain_text = 7; //答案解析 + string explain_img = 8; //答案解析图 + repeated Option options = 9; //选项 + int64 created_at = 10; //创建时间 + string answer_mark = 11; //答案类型(image_text-图文,text-文本) + } + message Option { + int64 id = 1; //选项id + string title = 2; //答案内容 + string img_url = 3; //答案图片 + int32 is_right = 4; //是否正确答案(1-是,0-否) + } + repeated One list = 1; //列表数据 +} + +message QaShowReq { + string hash_id = 1; //题目对外id +} + +message QaShowRes { + message Option { + int64 id = 1; //选项id + string title = 2; //答案内容 + string img_url = 3; //答案图片 + int32 is_right = 4; //是否正确答案(1-是,0-否) + } + int64 id = 1; //问题ID + string hash_id = 2; //问题对外id + string mark = 3; //问题类型(image_text-图文,video-视频,audio-音频) + string title = 4; //题目 + string cover_url = 5; //封面图 + string link_url = 6; //附件地址 + string explain_text = 7; //答案解析 + string explain_img = 8; //答案解析图 + repeated Option options = 9; //选项 + int64 created_at = 10; //创建时间 + string answer_mark = 11; //答案类型(image_text-图文,text-文本) +} diff --git a/proto/proto/w_mall.proto b/proto/proto/w_mall.proto new file mode 100644 index 0000000..beb2b10 --- /dev/null +++ b/proto/proto/w_mall.proto @@ -0,0 +1,265 @@ +syntax = "proto3"; + +package w_mallpb; +option go_package = './;w_mallpb'; + +//商城服务 +service WMall { + +// List 商城列表 +rpc List(ListReq) returns (ListRes) {} +// Store 商城创建 +rpc Store(StoreReq) returns (StoreRes) {} +// Update 商城更新 +rpc Update(UpdateReq) returns (UpdateRes) {} +// Destroy 商城删除 +rpc Destroy(DestroyReq) returns (DestroyRes) {} +// ItemList 商城奖品列表 +rpc ItemList(ItemListReq) returns (ItemListRes) {} +// ItemStore 商城奖品创建 +rpc ItemStore(ItemStoreReq) returns (ItemStoreRes) {} +// ItemUpdate 商城奖品更新 +rpc ItemUpdate(ItemUpdateReq) returns (ItemUpdateRes) {} +// ItemStatus 商城奖品状态修改 +rpc ItemStatus(ItemStatusReq) returns (ItemStatusRes) {} +// ItemSort 商城奖品排序 +rpc ItemSort(ItemSortReq) returns (ItemSortRes) {} +// Select 商城选择 +rpc Select(SelectReq) returns (SelectRes) {} +// RelateMall 关联商城 +rpc RelateMall(RelateMallReq) returns (RelateMallRes) {} +// UserItemList 用户商城奖品列表 +rpc UserItemList(UserItemListReq) returns (UserItemListRes) {} +// ExchangeItem 商城奖品兑换 +rpc ExchangeItem(ExchangeItemReq) returns (ExchangeItemRes) {} + +} + +message ListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string project_hash_id = 3; //项目hash_id + string title = 4; //商城标题 + int32 status = 5; //状态(1-使用中,2-暂未使用) + repeated int32 order_by = 6; //排序字段(1-创建最晚优先,2-创建最早优先,3-使用中优先,4-暂未使用优先) +} + +message ListRes { + message One { + int64 id = 1; //商城ID + string title = 2; //商城标题 + int32 status = 3; //状态(1-使用中,2-暂未使用) + int64 created_at = 4; //创建时间 + repeated Relate relates = 5; //关联使用数据 + repeated Reward rewards = 6; //商城上架奖品 + } + message Relate { + int64 id = 1; //关系ID + int32 source = 2; //来源(1-任务中心,2-活动) + string title = 3; //来源标题 + } + message Reward { + int64 id = 1; //商城奖品id + string title = 2; //奖品标题 + string img_url = 3; //奖品图片URL + } + repeated One list = 1; //列表数据 + int64 total = 2; //总数 +} + +message StoreReq { + string project_hash_id = 1; //项目hash_id + string title = 2; //商城标题 +} + +message StoreRes { + int64 id = 1; //商城id +} + +message UpdateReq { + string project_hash_id = 1; //项目hash_id + int64 id = 2; //商城id + string title = 3; //商城标题 +} + +message UpdateRes { + int64 id = 1; //商城id +} + +message DestroyReq { + string project_hash_id = 1; //项目hash_id + int64 id = 2; //商城id +} + +message DestroyRes { + int64 id = 1; //商城id +} + +message ItemListReq { + int64 mall_id = 1; //商城ID + int32 status = 2; //状态(1-上架,2-下架) +} + +message ItemListRes { + message One { + int64 id = 1; //商城奖品id + int64 reward_id = 2; //奖品id + string title = 3; //奖品标题 + string img_url = 4; //奖品图片URL + int64 stock = 5; //奖品库存 + int64 remain = 6; //剩余库存 + int32 up_type = 7; //上架类型(1-立即上架,2-指定时间) + int64 up_custom = 8; //自定义上架时间 + int64 up_at = 9; //上架时间 + string up_from = 10; //上架来源(auto-自定上架,manual-手动上架) + repeated string up_show = 11; //指定上架展示配置 + int32 down_type = 12; //下架类型(1-永久上架,2-指定时间) + int64 down_custom = 13; //自定义下架时间 + int64 down_at = 14; //下架时间 + string down_from = 15; //下架来源(auto-自定下架,manual-手动下架) + repeated string down_show = 16; //指定下架展示配置 + int32 status = 17; //状态(1-上架,2-待上架,3-下架,4-删除) + int32 coin_num = 18; //奖品金币数量 + int64 use_stock = 19; //发放库存 + } + repeated One list = 1; //列表数据 +} + +message ItemStoreReq { + int64 mall_id = 1; //商城ID + int64 reward_id = 2; //奖品id + int32 coin_num = 3; //奖品金币数量 + int64 stock = 4; //奖品库存 + int32 up_type = 5; //上架类型(1-立即上架,2-指定时间) + int64 up_custom = 6; //自定义上架时间 + repeated string up_show = 7; //指定上架展示配置 + int32 down_type = 8; //下架类型(1-永久上架,2-指定时间) + int64 down_custom = 9; //自定义下架时间 + repeated string down_show = 10; //指定下架展示配置 +} + +message ItemStoreRes { + int64 id = 1; //商城奖品id +} + +message ItemUpdateReq { + int64 id = 1; //奖品id + int64 reward_id = 2; //奖品id + int32 coin_num = 3; //奖品金币数量 + int64 stock = 4; //奖品库存 + int32 up_type = 5; //上架类型(1-立即上架,2-指定时间) + int64 up_custom = 6; //自定义上架时间 + repeated string up_show = 7; //指定上架展示配置 ["client","countdown"] + int32 down_type = 8; //下架类型(1-永久上架,2-指定时间) + int64 down_custom = 9; //自定义下架时间 + repeated string down_show = 10; //指定下架展示配置 ["countdown"] +} + +message ItemUpdateRes { + int64 id = 1; //商城奖品id +} + +message ItemStatusReq { + int64 id = 1; //奖品id + int32 status = 2; //状态(1-上架,2-下架,3-删除) +} + +message ItemStatusRes { + int64 id = 1; //商城奖品id +} + +message ItemSortReq { + repeated int64 ids = 1; //奖品id列表 +} + +message ItemSortRes { +} + +message SelectReq { + string project_hash_id = 1; //项目hash_id +} + +message SelectRes { + message One { + int64 id = 1; //商城ID + string title = 2; //商城标题 + } + repeated One list = 1; //列表数据 +} + +message RelateMallReq { + int64 project_id = 1; //项目id + int32 source = 2; //来源(1-任务中心,2-活动) + int64 relate_id = 3; //关联id + string relate_table = 4; //关联表名字,如果不是dplk_db库,建议带上库名字如dbname.relate_table_name + repeated int64 mall_ids = 5; //关联的商城id集合 +} + +message RelateMallRes { +} + +message UserItemListReq { + int64 mall_id = 1; //商城ID + string user_id = 2; //用户id + string lang_mark = 3; //语言标记 + int32 source = 4; //来源(1-任务中心,2-活动) + int64 source_id = 5; //来源id +} + +message UserItemListRes { + message One { + int64 id = 1; //商城奖品id + int64 reward_id = 2; //奖品id + string title = 3; //奖品标题 + string img_url = 4; //奖品图片URL + int64 remain = 5; //剩余库存 + int32 status = 6; //状态(1-上架,2-待上架,3-下架,4-删除) + int64 up_remain = 7; //上架剩余时间 + int32 coin_num = 8; //奖品金币数量 + } + repeated One list = 1; //列表数据 +} + +message ExchangeItemReq { + message SourceData { + int64 center_id = 1; //任务中心id + string center_hash_id = 2; //任务中心hash_id + string center_title = 3; //任务中心标题 + string user_platform = 4; //用户平台 + string parent_user_id = 5; //父用户id + string parent_user_platform = 6; //父用户平台 + int64 module_id = 7; //模块id + int64 relate_id = 8; //关联id + } + int64 project_id = 1; //项目id + int64 mall_item_id = 2; //商城商品id + string user_id = 3; //用户id + string lang_mark = 4; //语言标记 + int32 point_source = 5; //积分来源(0-应用内部,1-系统自带) + int64 url_id = 6; //请求地址id + int32 source = 7; //来源(1-任务中心,2-活动) + SourceData source_data = 8; //来源数据 +} + +message ExchangeItemRes { + message KV { + string key = 1; //对应字段名 + string value = 2; //对应字段值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + int32 status = 1; //状态(0-成功,1-库存不足,2-兑换上限,3-商品已下架) + int64 id = 2; //兑换记录id + int64 reward_id = 3; //奖品id + string title = 4; //奖品名称 + string img_url = 5; //图片地址 + repeated KV kv_data = 6; //奖品对应的键值数据 + int32 receive_type = 7; //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器) + string contact = 8; //联系方式 + int32 open_to_use = 9; //开启去使用(0-否,1-是) + string custom_reward_val = 10; //自定义数据 + string web_url = 11; //Web端的跳转地址 + string app_param = 12; //App端的跳转参数 + string pc_param = 13; //pc端的跳转参数 + string fail_type = 14; //失败类型 + string fail_msg = 15; //失败具体原因 +} diff --git a/proto/proto/w_open_platform.proto b/proto/proto/w_open_platform.proto new file mode 100644 index 0000000..6ff8e25 --- /dev/null +++ b/proto/proto/w_open_platform.proto @@ -0,0 +1,96 @@ +syntax = "proto3"; + +package w_open_platformpb; +option go_package = './;w_open_platformpb'; + +//开放平台接口提供服务 +service WOpenPlatform { + +// UserList 开放平台用户列表 +rpc UserList(UserListReq) returns (UserListRes) {} +// CampaignInfo 开发平台活动信息 +rpc CampaignInfo(CampaignInfoReq) returns (CampaignInfoRes) {} +// Player 用户在活动中的玩家数据 +rpc Player(PlayerReq) returns (PlayerRes) {} + +} + +message UserListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string project_hash_id = 3; //项目hash_id + string campaign_hash_id = 4; //活动hash_id + int64 last_record_id = 5; //最后一条记录id +} + +message UserListRes { + message One { + int64 id = 1; //活动用户ID + string device_id = 2; //用户设备id + string sub_user_id = 3; //用户 + string parent = 4; //用户上级 + int64 child_num = 5; //下级数量 + int64 indirect_num = 6; //间接裂变 + int64 effect_num = 7; //有效拉新人数 + int64 created_at = 8; //参与时间 + string source_title = 9; //来源说明 + string platform = 10; //操作系统 + string channel_title = 11; //渠道名称 + int64 join_at = 12; //首次访问活动时间 + repeated Cond conds = 13; //任务数据 + } + message Cond { + string desc = 1; //标题 + int64 num = 2; //数量 + int32 if_cond = 3; //等式(0-等于,1-大于等于,2-累计) + int32 event_type = 4; //事件类型(1-自定义事件,2-广告事件,3-标准事件) + string event = 5; //事件关键字 + string event_key = 6; //事件key + string event_val = 7; //事件值 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 + int64 lave = 3; //剩余多少条数据没有拉取 +} + +message CampaignInfoReq { + int64 project_id = 1; //项目id + string campaign_hash_id = 2; //活动hash_id +} + +message CampaignInfoRes { + message Lang { + string mark = 1; //语言标识 + string page_title = 2; //页面标题 + string share_text = 3; //分享文案 + string share_img = 4; //缩略图 + } + string hash_id = 1; //活动对外id + string title = 2; //活动标题 + string link = 3; //活动地址 + repeated Lang langs = 4; //语言内容 +} + +message PlayerReq { + string project_hash_id = 1; //项目hash_id + string campaign_hash_id = 2; //活动hash_id + string user_id = 3; //用户id + int64 start_time = 4; //开始时间 + int64 end_time = 5; //结束时间 +} + +message PlayerRes { + message Keep { + int64 love_num = 1; //当前养成宠物已经收集爱心数 + int64 remain_food = 2; //当前养成宠物剩余的食物数 + KeepAction action = 3; //用户行为 + } + message KeepAction { + int64 grow_pet = 1; //领养次数 + int64 feed_num = 2; //喂养次数 + int64 collect_num = 3; //收集爱心次数 + } + int32 status = 1; //状态(0-正常,1-未参与活动) + int64 fission_id = 2; //玩法id + Keep keep = 3; //激励养成玩家数据 +} diff --git a/proto/proto/w_project.proto b/proto/proto/w_project.proto new file mode 100644 index 0000000..c1babfd --- /dev/null +++ b/proto/proto/w_project.proto @@ -0,0 +1,264 @@ +syntax = "proto3"; + +package w_projectpb; +option go_package = './;w_projectpb'; + +//项目服务 +service WProject { + +// Select 项目选择列表 +rpc Select(SelectReq) returns (SelectRes) {} +// List 项目列表 +rpc List(ListReq) returns (ListRes) {} +// Show 项目详情 +rpc Show(ShowReq) returns (ShowRes) {} +// Store 创建项目 +rpc Store(StoreReq) returns (StoreRes) {} +// Update 更新项目 +rpc Update(UpdateReq) returns (UpdateRes) {} +// Destroy 删除项目 +rpc Destroy(DestroyReq) returns (DestroyRes) {} +// Cert 项目认证 +rpc Cert(CertReq) returns (CertRes) {} +// ProjectSecret 项目私钥 +rpc ProjectSecret(ProjectSecretReq) returns (ProjectSecretRes) {} +// ChangeSecret 修改密钥 +rpc ChangeSecret(ChangeSecretReq) returns (ChangeSecretRes) {} +// ChangeOplatform 修改开放平台 +rpc ChangeOplatform(ChangeOplatformReq) returns (ChangeOplatformRes) {} +// DomainList 获取项目域名绑定的项目 +rpc DomainList(DomainListReq) returns (DomainListRes) {} +// SaveAdsConfig 保存广告配置 +rpc SaveAdsConfig(SaveAdsConfigReq) returns (SaveAdsConfigRes) {} +// AdsConfig 获取广告配置 +rpc AdsConfig(AdsConfigReq) returns (AdsConfigRes) {} +// ChangeRebootUrl 修改开放平台的活动回调地址 +rpc ChangeRebootUrl(ChangeRebootUrlReq) returns (ChangeRebootUrlRes) {} +// FissionConfig 获取广告配置 +rpc FissionConfig(FissionConfigReq) returns (FissionConfigRes) {} +// SetPushVisit 设置活动访问推送开关 +rpc SetPushVisit(SetPushVisitReq) returns (SetPushVisitRes) {} +// SetPushCampaignTask 设置活动任务完成推送开关 +rpc SetPushCampaignTask(SetPushCampaignTaskReq) returns (SetPushCampaignTaskRes) {} + +} + +message SelectReq { + int64 company_id = 1; //企业id + bool show_user = 2; //是否值显示员工可展示,如果否,表示返回企业内所有项目 + int64 user_id = 3; //员工id +} + +message SelectRes { + message One { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string title = 3; //项目名称 + int32 scene = 4; //项目应用场景(1-app,2-web) + string logo_url = 5; //项目logo地址 + int32 is_test = 6; //是否测试项目(0-否,1-是) + } + repeated One list = 1; //列表数据 +} + +message ListReq { + int64 company_id = 1; //企业id + int32 page = 2; //当前页 + int32 per_page = 3; //每页条数 + bool show_user = 4; //是否值显示员工可展示,如果否,表示返回企业内所有项目 + int64 user_id = 5; //员工id +} + +message ListRes { + message One { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string title = 3; //项目名称 + string domain = 4; //域名前缀 + int64 created_time = 5; //创建时间时间戳 + repeated UserRelate user_relate = 6; //关联的员工 + int32 scene = 7; //项目应用场景(1-app,2-web) + string logo_url = 8; //项目logo地址 + } + message UserRelate { + int64 user_id = 1; //员工id + string hash_id = 2; //对外员工id + string show_name = 3; //员工显示的名称 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message ShowReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id +} + +message ShowRes { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string title = 3; //项目名称 + string domain = 4; //域名前缀 + int64 company_id = 5; //企业id + string notify_token = 6; //项目回调token + string encrypt_str = 7; //数据加密字符串 + int32 scene = 8; //项目应用场景(1-app,2-web) + string third_secret = 9; //第三方开放平台密钥 + int32 fission_cert_type = 10; //活动用户认证方式(0-不认证,1-加密认证) + string third_url = 11; //开放平台回调地址 + string third_reboost_url = 12; //开放平台reboot回调地址 +} + +message StoreReq { + int64 company_id = 1; //企业id + int64 user_id = 2; //企业id + string title = 3; //项目名称 + string domain = 4; //域名前缀 + repeated string user_ids = 5; //关联的员工id + bool is_all = 6; //是否所有员工都可看 + int32 scene = 7; //项目应用场景(1-app,2-web) + string logo_url = 8; //项目logo地址 +} + +message StoreRes { +} + +message UpdateReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string title = 3; //项目名称 + repeated string user_ids = 4; //关联的员工id + bool is_all = 5; //是否所有员工都可看 + string logo_url = 6; //项目logo地址 +} + +message UpdateRes { +} + +message DestroyReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id +} + +message DestroyRes { +} + +message CertReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string secret = 3; //项目私钥 +} + +message CertRes { + message CertSecret { + string secret = 1; //密钥 + int64 expired_at = 2; //密钥过期时间,0为不过期 + } + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string title = 3; //项目名称 + string encrypt_str = 4; //数据加密字符串 + int32 scene = 5; //项目应用场景(1-app,2-web) + repeated CertSecret cert_secrets = 6; //可认证的密钥 +} + +message ProjectSecretReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id +} + +message ProjectSecretRes { + string secret = 1; //项目私钥 +} + +message ChangeSecretReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + int64 user_id = 3; //创建的员工id + string username = 4; //管理账号 + string passwd = 5; //管理员密码 +} + +message ChangeSecretRes { + string secret = 1; //项目私钥 +} + +message ChangeOplatformReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string third_url = 3; //开放平台回调地址 +} + +message ChangeOplatformRes { +} + +message DomainListReq { + string domain = 1; //项目域名 +} + +message DomainListRes { + message One { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + int64 company_id = 3; //企业id + string title = 4; //项目名称 + string domain = 5; //域名前缀 + int64 created_time = 6; //创建时间时间戳 + } + repeated One list = 1; //列表数据 +} + +message SaveAdsConfigReq { + string project_hash_id = 1; //项目hash_id + int32 open_ad = 2; //开启广告模块(0-不开启,1-开启) + int32 campaign_ad = 3; //开启活动广告(0-不开启,1-开启) + int64 user_id = 4; //员工id( + string ip = 5; //操作的ip地址 +} + +message SaveAdsConfigRes { +} + +message AdsConfigReq { + string project_hash_id = 1; //项目hash_id +} + +message AdsConfigRes { + int32 open_ad = 1; //开启广告模块(0-不开启,1-开启) + int32 campaign_ad = 2; //开启广告模块(0-不开启,1-开启) + int32 ad_custom_url = 3; //开启广告自定义链接配置(0-不开启,1-开启) +} + +message ChangeRebootUrlReq { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string third_reboost_url = 3; //开放平台回调地址 +} + +message ChangeRebootUrlRes { +} + +message FissionConfigReq { + string project_hash_id = 1; //项目hash_id +} + +message FissionConfigRes { + int32 push_visit = 1; //用户访问推送(0-否,1-是) + int32 push_campaign_task = 2; //活动任务完成推送(0-否,1-是) +} + +message SetPushVisitReq { + string project_hash_id = 1; //项目hash_id + int32 push_visit = 2; //用户访问推送(0-否,1-是) +} + +message SetPushVisitRes { +} + +message SetPushCampaignTaskReq { + string project_hash_id = 1; //项目hash_id + int32 push_campaign_task = 2; //活动任务完成推送(0-否,1-是) +} + +message SetPushCampaignTaskRes { +} diff --git a/proto/proto/w_project_user.proto b/proto/proto/w_project_user.proto new file mode 100644 index 0000000..49d9844 --- /dev/null +++ b/proto/proto/w_project_user.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package w_project_userpb; +option go_package = './;w_project_userpb'; + +//项目用户 +service WProjectUser { + +// Point 积分 +rpc Point(PointReq) returns (PointRes) {} +// EarnCoin 获取积分 +rpc EarnCoin(EarnCoinReq) returns (EarnCoinRes) {} + +} + +message PointReq { + int64 project_id = 1; //项目ID + string user_id = 2; //第三方用户ID + int32 point_source = 3; //积分来源(0-应用内部,1-系统自带) + int64 url_id = 4; //请求地址id + string lang_mark = 5; //语言标识 +} + +message PointRes { + int64 id = 1; //项目用户ID + int64 coin_num = 2; //积分数量 +} + +message EarnCoinReq { + message Earn { + int32 coin_num = 1; //积分数量 + int64 expired_at = 2; //期时间 + int32 is_expired = 3; //是否过期(0-否,1-是) + string source = 4; //来源(center-任务中心,campaign-活动) + int64 source_id = 5; //来源ID + map source_data = 6; //来源数据 + string operate = 7; //操作 + } + int64 project_id = 1; //项目ID + string user_id = 2; //第三方用户ID + string lang_mark = 3; //语言标识 + repeated Earn earns = 4; //获得的积分 +} + +message EarnCoinRes { + int64 id = 1; //记录ID +} diff --git a/proto/proto/w_register.proto b/proto/proto/w_register.proto new file mode 100644 index 0000000..1a635ab --- /dev/null +++ b/proto/proto/w_register.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package w_registerpb; +option go_package = './;w_registerpb'; + +//企业注册服务 +service WRegister { + +// Store 添加注册申请 +rpc Store(StoreReq) returns (StoreRes) {} + +} + +message StoreReq { + string username = 1; //注册账号(申请通过后超级管理员登陆的账号) + string short_name = 2; //申请通过后公司显示的简称 + string passwd = 3; //申请通过后超级管理员登陆的密码 + string email = 4; //注册邮箱 + string phone = 5; //手机号 + string app_name = 6; //站点名称 +} + +message StoreRes { + uint64 id = 1; //记录id +} diff --git a/proto/proto/w_reward.proto b/proto/proto/w_reward.proto new file mode 100644 index 0000000..36a04fc --- /dev/null +++ b/proto/proto/w_reward.proto @@ -0,0 +1,498 @@ +syntax = "proto3"; + +package w_rewardpb; +option go_package = './;w_rewardpb'; + +//奖品服务 +service WReward { + +// List 奖品列表 +rpc List(ListReq) returns (ListRes) {} +// Select 奖品选择 +rpc Select(SelectReq) returns (SelectRes) {} +// Show 奖品详情 +rpc Show(ShowReq) returns (ShowRes) {} +// Store 创建奖品 +rpc Store(StoreReq) returns (StoreRes) {} +// Update 更新奖品 +rpc Update(UpdateReq) returns (UpdateRes) {} +// Destroy 删除奖品 +rpc Destroy(DestroyReq) returns (DestroyRes) {} +// UrlList 回调地址列表 +rpc UrlList(UrlListReq) returns (UrlListRes) {} +// UrlStore 创建回调地址 +rpc UrlStore(UrlStoreReq) returns (UrlStoreRes) {} +// UrlUpdate 更新回调地址 +rpc UrlUpdate(UrlUpdateReq) returns (UrlUpdateRes) {} +// UrlDestroy 删除回调地址 +rpc UrlDestroy(UrlDestroyReq) returns (UrlDestroyRes) {} +// FormList 表单列表 +rpc FormList(FormListReq) returns (FormListRes) {} +// FormSelect 表单选择 +rpc FormSelect(FormSelectReq) returns (FormSelectRes) {} +// FormStore 创建表单 +rpc FormStore(FormStoreReq) returns (FormStoreRes) {} +// FormUpdate 更新表单 +rpc FormUpdate(FormUpdateReq) returns (FormUpdateRes) {} +// FormDestroy 删除表单 +rpc FormDestroy(FormDestroyReq) returns (FormDestroyRes) {} +// Forms 表单数据 +rpc Forms(FormsReq) returns (FormsRes) {} +// Urls 回调地址数据 +rpc Urls(UrlsReq) returns (UrlsRes) {} +// Rewards 奖品详情 +rpc Rewards(RewardsReq) returns (RewardsRes) {} +// RelateReward 关联奖品 +rpc RelateReward(RelateRewardReq) returns (RelateRewardRes) {} +// PushReward 奖品推送 +rpc PushReward(PushRewardReq) returns (PushRewardRes) {} +// RewardIds 查询奖品id +rpc RewardIds(RewardIdsReq) returns (RewardIdsRes) {} + +} + +message ListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string page_lang = 3; //页面语言 + string project_hash_id = 4; //项目hash_id + string title = 5; //奖品名称 + string lang_mark = 6; //奖品语言,多个用逗号分开 + string reward_title = 7; //奖品标题 + int32 order_type = 8; //排序类型(1-创建时间升序),其他默认 +} + +message ListRes { + message One { + int64 id = 1; //奖品id + string reward_title = 2; //奖品标题 + string title = 3; //奖品名称 + string img_url = 4; //奖品图片 + int32 receive_type = 5; //发放类型(1-系统发放,2-联系客服,4-提交表单) + int64 related_num = 6; //关联数量 + repeated KV kv_data = 7; //键值数据 + repeated Lang langs = 8; //语言数据 + int32 dy_reward_type = 9; //动态奖品内容类型(0-无,1-兑换码) + int64 created_at = 10; //创建时间 + string contact = 11; //联系方式 + int64 url_id = 12; //回调地址id + } + message KV { + string key = 1; //键 + string value = 2; //值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + message Lang { + string mark = 1; //语言标识 + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + int32 is_default = 4; //是否默认语言(0-否,1-是) + int32 lang_type = 5; //语言数字标识 + int64 img_id = 6; //奖品图片id + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message SelectReq { + string project_hash_id = 1; //项目hash_id + string lang_mark = 2; //奖品语言 + int32 receive_type = 3; //发放类型(1-系统发放,2-联系客服,4-提交表单) +} + +message SelectRes { + message One { + int64 id = 1; //奖品id + string reward_title = 2; //奖品标题 + string title = 3; //奖品名称 + string img_url = 4; //奖品图片 + string lang_mark = 5; //奖品语言 + int32 receive_type = 6; //发放类型(1-系统发放,2-联系客服,4-提交表单) + repeated KV kv_data = 7; //键值数据 + string contact = 8; //联系方式 + string url = 9; //回调地址 + string form_title = 10; //表单标题 + } + message KV { + string key = 1; //键 + string value = 2; //值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + repeated One list = 1; //列表数据 +} + +message ShowReq { + string project_hash_id = 1; //项目hash_id + int64 id = 2; //奖品id +} + +message ShowRes { + message KV { + string key = 1; //键 + string value = 2; //值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + message Lang { + string mark = 1; //语言标识 + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + int32 is_default = 4; //是否默认语言(0-否,1-是) + int32 lang_type = 5; //语言数字标识 + int32 open_to_use = 6; //开启去使用(0-否,1-是) + string web_url = 7; //Web端的跳转地址 + string app_param = 8; //App端的跳转参数 + string pc_param = 9; //App端的跳转参数 + } + int64 id = 1; //奖品id + string reward_title = 2; //奖品标题 + int32 receive_type = 3; //发放类型(1-系统发放,2-联系客服,4-提交表单) + int64 url_id = 4; //回调地址id + string contact = 5; //联系方式 + repeated KV kv_data = 6; //键值数据 + repeated Lang langs = 7; //语言数据 + int64 form_id = 8; //表单Id + int64 relate_num = 9; //关联使用的数量 + int32 dy_reward_type = 10; //动态奖品内容类型(0-无,1-兑换码) +} + +message StoreReq { + message KV { + string key = 1; //键 + string value = 2; //值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + message Lang { + string mark = 1; //语言标识 + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + int32 is_default = 4; //是否默认语言(0-否,1-是) + int32 open_to_use = 5; //开启去使用(0-否,1-是) + string web_url = 6; //Web端的跳转地址 + string app_param = 7; //App端的跳转参数 + int64 image_id = 8; //图片id + string pc_param = 9; //App端的跳转参数 + } + string project_hash_id = 1; //项目hash_id + string reward_title = 2; //奖品标题 + int32 receive_type = 3; //发放类型(1-系统发放,2-联系客服,4-提交表单) + int64 url_id = 4; //回调地址id + string contact = 5; //联系方式 + repeated KV kv_data = 6; //键值数据 + repeated Lang langs = 7; //语言数据 + int64 form_id = 8; //表单id + int32 dy_reward_type = 9; //动态奖品内容类型(0-无,1-兑换码) + int32 source = 10; //数据来源(0-后台创建,1-奖品数据迁移,2-api创建) +} + +message StoreRes { + int64 id = 1; //奖品id +} + +message UpdateReq { + message KV { + string key = 1; //键 + string value = 2; //值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + message Lang { + string mark = 1; //语言标识 + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + int32 is_default = 4; //是否默认语言(0-否,1-是) + int32 open_to_use = 5; //开启去使用(0-否,1-是) + string web_url = 6; //Web端的跳转地址 + string app_param = 7; //App端的跳转参数 + int64 image_id = 8; //图片id + string pc_param = 9; //App端的跳转参数 + } + string project_hash_id = 1; //项目hash_id + int64 id = 2; //奖品id + string reward_title = 3; //奖品标题 + int32 receive_type = 4; //发放类型(1-系统发放,2-联系客服,4-提交表单) + int64 url_id = 5; //回调地址id + string contact = 6; //联系方式 + repeated KV kv_data = 7; //键值数据 + repeated Lang langs = 8; //语言数据 + int64 form_id = 9; //表单id + int32 dy_reward_type = 10; //动态奖品内容类型(0-无,1-兑换码) +} + +message UpdateRes { + int64 id = 1; //奖品id +} + +message DestroyReq { + string project_hash_id = 1; //项目hash_id + string ids = 2; //奖品id,多个用逗号分割 +} + +message DestroyRes { + repeated string ids = 1; //还关联活动的奖品id +} + +message UrlListReq { + string project_hash_id = 1; //项目hash_id + int32 order_type = 2; //排序类型(1-创建时间升序),其他默认 +} + +message UrlListRes { + message One { + int64 id = 1; //回调地址id + string title = 2; //回调地址说明 + string url = 3; //回调地址 + int64 num = 4; //关联奖品数量 + int64 created_at = 5; //创建时间 + repeated Header headers = 6; //头信息 + } + message Header { + string key = 1; //回调头键 + string mark = 2; //特殊键标识 + string val = 3; //回调数值 + } + repeated One list = 1; //列表数据 +} + +message UrlStoreReq { + message Header { + string key = 1; //回调头键 + string mark = 2; //特殊键标识 + string val = 3; //回调数值 + } + string project_hash_id = 1; //项目hash_id + string title = 2; //回调地址说明 + string url = 3; //回调地址 + int32 source = 4; //数据来源(0-后台创建,1-奖品数据迁移,2-api创建) + repeated Header headers = 5; //头信息 +} + +message UrlStoreRes { + int64 id = 1; //地址id +} + +message UrlUpdateReq { + message Header { + string key = 1; //回调头键 + string mark = 2; //特殊键标识 + string val = 3; //回调数值 + } + string project_hash_id = 1; //项目hash_id + int64 id = 2; //地址id + string title = 3; //回调地址说明 + string url = 4; //回调地址 + repeated Header headers = 5; //头信息 +} + +message UrlUpdateRes { + int64 id = 1; //地址id +} + +message UrlDestroyReq { + string project_hash_id = 1; //项目hash_id + int64 id = 2; //地址id +} + +message UrlDestroyRes { +} + +message FormListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string project_hash_id = 3; //项目hash_id + string title = 4; //表单标题 +} + +message FormListRes { + message One { + int64 id = 1; //表单ID + string title = 2; //表单标题 + int64 created_at = 3; //创建时间 + repeated Item items = 4; //表单项 + int64 num = 5; //关联奖品数量 + } + message Item { + string name = 1; //表单项名称 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message FormSelectReq { + string project_hash_id = 1; //项目hash_id +} + +message FormSelectRes { + message One { + int64 id = 1; //表单ID + string title = 2; //表单标题 + } + repeated One list = 1; //列表数据 +} + +message FormStoreReq { + message Item { + string name = 1; //表单项名称 + repeated Tran trans = 2; //字段语言翻译 + } + message Tran { + string mark = 1; //语言标识 + string name = 2; //字段对应语言的名称 + int32 is_default = 3; //字段语言翻译 + } + string project_hash_id = 1; //项目hash_id + string title = 2; //表单标题 + repeated Item items = 3; //表单项 +} + +message FormStoreRes { + int64 id = 1; //表单id +} + +message FormUpdateReq { + message Item { + string name = 1; //表单项名称 + repeated Tran trans = 2; //字段语言翻译 + } + message Tran { + string mark = 1; //语言标识 + string name = 2; //字段对应语言的名称 + int32 is_default = 3; //字段语言翻译 + } + int64 id = 1; //表单ID + string title = 2; //表单标题 + repeated Item items = 3; //表单项 +} + +message FormUpdateRes { + int64 id = 1; //表单id +} + +message FormDestroyReq { + string project_hash_id = 1; //项目hash_id + int64 id = 2; //表单ID +} + +message FormDestroyRes { + int64 id = 1; //表单id +} + +message FormsReq { + int64 project_id = 1; //项目id + repeated int64 ids = 2; //表单id +} + +message FormsRes { + message One { + int64 id = 1; //表单ID + string title = 2; //表单标题 + int64 created_at = 3; //创建时间 + repeated Item items = 4; //表单项 + } + message Item { + string name = 1; //表单项名称 + } + repeated One list = 1; //列表数据 +} + +message UrlsReq { + int64 project_id = 1; //项目id + repeated int64 ids = 2; //地址id +} + +message UrlsRes { + message One { + int64 id = 1; //回调地址id + string title = 2; //回调地址说明 + string url = 3; //回调地址 + int64 created_at = 4; //创建时间 + repeated Header headers = 5; //头信息 + } + message Header { + string key = 1; //回调头键 + string mark = 2; //特殊键标识 + string val = 3; //回调数值 + } + repeated One list = 1; //列表数据 +} + +message RewardsReq { + int64 project_id = 1; //项目id + repeated int64 ids = 2; //奖品id + string lang_mark = 3; //语言标识 +} + +message RewardsRes { + message One { + int64 id = 1; //奖品id + string reward_title = 2; //奖品标题 + int32 receive_type = 3; //发放类型(1-系统发放,2-联系客服,4-提交表单) + int64 url_id = 4; //回调地址id + string contact = 5; //联系方式 + repeated KV kv_data = 6; //键值数据 + Lang lang = 7; //语言数据 + int64 form_id = 8; //表单Id + int32 dy_reward_type = 9; //动态奖品内容类型(0-无,1-兑换码) + } + message KV { + string key = 1; //键 + string value = 2; //值 + int32 is_show = 3; //是否展示(0-否,1-是) + } + message Lang { + string mark = 1; //语言标识 + string title = 2; //奖品名称 + string img_url = 3; //奖品图片 + int32 is_default = 4; //是否默认语言(0-否,1-是) + int32 open_to_use = 5; //开启去使用(0-否,1-是) + string web_url = 6; //Web端的跳转地址 + string app_param = 7; //App端的跳转参数 + string pc_param = 8; //pc端的跳转参数 + } + repeated One list = 1; //列表数据 +} + +message RelateRewardReq { + int64 project_id = 1; //项目id + int64 relate_id = 2; //关联id + string relate_table = 3; //关联表名字,如果不是dplk_db库,建议带上库名字如dbname.relate_table_name + repeated int64 reward_ids = 4; //关联的奖品id集合 +} + +message RelateRewardRes { +} + +message PushRewardReq { + string source = 1; //来源标识,wall-积分墙,center-任务中心 + int64 source_id = 2; //来源id,如:来源是campaign,这个就写campaign_id,没有填写0 + string source_hash_id = 3; //来源hash_id,推送 + int64 source_second_id = 4; //来源第二级id,如:来源是任务中心,奖品任务中心的某个模块发放,这里就是模块id,没有填写0 + int64 relate_id = 5; //关联id,用于后续对比查询,如:发放记录的ID + string relate_hash_id = 6; //推送时给第三方的id + string title = 7; //关联id,用于后续对比查询,如:发放记录的ID + int64 reward_id = 8; //推送的奖品库存id + int32 num = 9; //奖品发放数量 + string user_id = 10; //第三方应用的用户id + string user_platform = 11; //活动用户设备平台 + string parent_user_id = 12; //上级用户id + string parent_platform = 13; //活动用户的上级用户设备平台 + string lang = 14; //用户语言标识 + int32 sync = 15; //是否同步请求(0-否,1-是) + int32 reward_type = 16; //发放类型(1-活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励,7-子活动奖励,8-兑换奖励),没有合适的要加 + int64 campaign_id = 17; //推送的活动id +} + +message PushRewardRes { + string task_id = 1; //当前发放任务id,固定20位字符串 + string reward_val = 2; //回调后接收到的数据 + int32 status = 3; //状态(1-推送中,2-完成,3-失败) + string fail_type = 4; //失败类型,system-系统出错,client-客户的错误,undefined-未知错误 + string fail_msg = 5; //错误信息 +} + +message RewardIdsReq { + int64 project_id = 1; //项目id + string reward_title = 2; //获取奖品标题 +} + +message RewardIdsRes { + repeated int64 ids = 1; //列表数据 +} diff --git a/proto/proto/w_script.proto b/proto/proto/w_script.proto new file mode 100644 index 0000000..8683c4d --- /dev/null +++ b/proto/proto/w_script.proto @@ -0,0 +1,190 @@ +syntax = "proto3"; + +package w_scriptpb; +option go_package = './;w_scriptpb'; + +//脚本服务 +service WScript { + +// Boot 运行脚本 +rpc Boot(BootReq) returns (BootRes) {} +// RefreshDayLimit 刷新每日限制 +rpc RefreshDayLimit(RefreshDayLimitReq) returns (RefreshDayLimitRes) {} +// NotifyList 奖品回调列表 +rpc NotifyList(NotifyListReq) returns (NotifyListRes) {} +// EtcdKey 查看etcd的key +rpc EtcdKey(EtcdKeyReq) returns (EtcdKeyRes) {} +// EventFlow 查看事件记录 +rpc EventFlow(EventFlowReq) returns (EventFlowRes) {} +// ClearDevice 清除设备信息 +rpc ClearDevice(ClearDeviceReq) returns (ClearDeviceRes) {} +// RefreshView 重新体验玩法 +rpc RefreshView(RefreshViewReq) returns (RefreshViewRes) {} +// ErrLog 错误日志记录 +rpc ErrLog(ErrLogReq) returns (ErrLogRes) {} +// PointsLog 领扣积分请求 +rpc PointsLog(PointsLogReq) returns (PointsLogRes) {} +// UserBehavior 用户行为日志 +rpc UserBehavior(UserBehaviorReq) returns (UserBehaviorRes) {} +// RewardPushLog 奖品推送日志 +rpc RewardPushLog(RewardPushLogReq) returns (RewardPushLogRes) {} + +} + +message BootReq { + string scene = 1; //处理场景 + string json_data = 2; //文件后缀 +} + +message BootRes { + string task_id = 1; //任务id +} + +message RefreshDayLimitReq { + string hash_id = 1; //用户hash_id + string campaign_hash_id = 2; //活动hash_id +} + +message RefreshDayLimitRes { +} + +message NotifyListReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string campaign_hash_id = 3; //项目hash_id + string reward_hash_id = 4; //奖品记录hash_id +} + +message NotifyListRes { + message One { + string hash_id = 1; //任务ID + int64 created_at = 2; //创建时间 + int64 last_push = 3; //最后推送时间 + string body = 4; //请求数据 + string notify_url = 5; //请求地址 + repeated string resp = 6; //请求结果 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message EtcdKeyReq { + string prefix = 1; //前缀 +} + +message EtcdKeyRes { + message KV { + string key = 1; //键 + string value = 2; //值 + } + repeated KV kvs = 1; //数据 +} + +message EventFlowReq { + string project_hash_id = 1; //项目hash_id +} + +message EventFlowRes { + message One { + string link_hash_id = 1; //深度链接hash_id + string device_id = 2; //设备id + string user_id = 3; //用户ID + string event_title = 4; //事件名称 + string ip_address = 5; //ip + string os = 6; //os + string os_version = 7; //os_version + string device_model = 8; //device_model + string event_data = 9; //event_data + int64 created_at = 10; //创建时间 + int32 source = 11; //来源(1-自然流量,2-深度链接,3-活动) + string campaign_hash_id = 12; //活动hash_id + } + repeated One list = 1; //数据 +} + +message ClearDeviceReq { + string hash_id = 1; //用户hash_id + string project_hash_id = 2; //项目hash_id + string campaign_hash_id = 3; //活动hash_id +} + +message ClearDeviceRes { +} + +message RefreshViewReq { + string campaign_hash_id = 1; //活动hash_id +} + +message RefreshViewRes { +} + +message ErrLogReq { + string api_url = 1; //请求的接口 + string data = 2; //请求数据 + string link_url = 3; //当前页面地址 + string msg = 4; //返回数据 +} + +message ErrLogRes { +} + +message PointsLogReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string campaign_hash_id = 3; //项目hash_id +} + +message PointsLogRes { + message One { + int64 id = 1; //请求id + int64 created_at = 2; //创建时间 + string req = 3; //请求数据 + string req_url = 4; //请求地址 + string token = 5; //请求token + string req_header = 6; //请求头 + string resp = 7; //返回数据 + string err_msg = 8; //错误信息 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message UserBehaviorReq { + string api_url = 1; //请求的接口 + string desc = 2; //接口描述 + int64 user_id = 3; //登陆用户id + int64 company_id = 4; //登陆用户id + string project_hash_id = 5; //项目hash_id + string ip = 6; //操作ip + string ua_data = 7; //部分ua头数据 + string req = 8; //请求数据 + string res = 9; //操作结果 +} + +message UserBehaviorRes { +} + +message RewardPushLogReq { + int32 page = 1; //当前页 + int32 per_page = 2; //每页条数 + string source = 3; //来源 + int64 first_id = 4; //来源一级id + int64 second_id = 5; //来源二级id + int64 relate_id = 6; //关联记录id +} + +message RewardPushLogRes { + message One { + int64 id = 1; //请求id + int64 created_at = 2; //创建时间 + string req = 3; //请求数据 + string req_url = 4; //请求地址 + string token = 5; //请求token + string req_header = 6; //请求头 + string resp = 7; //返回数据 + string err_msg = 8; //错误信息 + int64 req_time = 9; //请求时长(单位:ms) + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} diff --git a/proto/proto/w_user.proto b/proto/proto/w_user.proto new file mode 100644 index 0000000..ac26520 --- /dev/null +++ b/proto/proto/w_user.proto @@ -0,0 +1,125 @@ +syntax = "proto3"; + +package w_userpb; +option go_package = './;w_userpb'; + +//员工服务 +service WUser { + +// Login 登陆 +rpc Login(LoginReq) returns (LoginRes) {} +// List 用户列表 +rpc List(ListReq) returns (ListRes) {} +// Select 用户选择列表 +rpc Select(SelectReq) returns (SelectRes) {} +// Show 员工详情 +rpc Show(ShowReq) returns (ShowRes) {} +// Store 创建员工 +rpc Store(StoreReq) returns (StoreRes) {} +// Update 更新员工 +rpc Update(UpdateReq) returns (UpdateRes) {} +// Destroy 删除员工 +rpc Destroy(DestroyReq) returns (DestroyRes) {} + +} + +message LoginReq { + string username = 1; //账号 + string passwd = 2; //密码 + string code = 3; //授权码 +} + +message LoginRes { + bool is_admin = 1; //是否超级管理员 + int64 id = 2; //用户id + string hash_id = 3; //用户对外id + int64 company_id = 4; //用户企业id + string token = 5; //身份token + int64 expired = 6; //token过期时间,单位:秒(s) + string name = 7; //显示的名称 + string email = 8; //邮箱 + string username = 9; //账号 + string role_name = 10; //角色名称 +} + +message ListReq { + int64 company_id = 1; //企业Id + int32 page = 2; //当前页 + int32 per_page = 3; //每页条数 +} + +message ListRes { + message One { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id + string show_name = 3; //列表总数 + string username = 4; //用户名 + string email = 5; //用户邮箱 + string role_name = 6; //用户角色 + repeated Project projects = 7; //用户关联项目 + } + message Project { + int64 id = 1; //项目id + string hash_id = 2; //对外项目id + string title = 3; //项目名称 + } + repeated One list = 1; //列表数据 + int64 total = 2; //列表总数 +} + +message SelectReq { + int64 company_id = 1; //企业Id +} + +message SelectRes { + message One { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id + string show_name = 3; //列表总数 + } + repeated One list = 1; //列表数据 +} + +message ShowReq { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id +} + +message ShowRes { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id + string show_name = 3; //列表总数 + string username = 4; //用户名 + string email = 5; //用户邮箱 + bool is_admin = 6; //是否超级管理员 +} + +message StoreReq { + int64 company_id = 1; //企业ID + string show_name = 2; //显示名称 + string username = 3; //用户名 + string passwd = 4; //用户密码 + string email = 5; //用户邮箱 + repeated string project_hash_ids = 6; //项目hash_id +} + +message StoreRes { +} + +message UpdateReq { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id + string show_name = 3; //显示名称 + string passwd = 4; //用户密码 +} + +message UpdateRes { +} + +message DestroyReq { + int64 id = 1; //用户id + string hash_id = 2; //用户对外id +} + +message DestroyRes { +} diff --git a/proto/toml/w_campaign.toml b/proto/toml/w_campaign.toml new file mode 100644 index 0000000..09096ca --- /dev/null +++ b/proto/toml/w_campaign.toml @@ -0,0 +1,4499 @@ +[service] +name = "WCampaign" +desc = "活动服务" + +[[method]] +name = "List" +desc = "活动列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 project_id //项目id", + "string project_hash_id //项目hash_id", + "string title //活动标题筛选", + "string link //活动链接筛选", + "repeated int32 status //活动状态(1-待发布,2-已发布,3-已下线,4-预发布)", + "repeated int64 fission_id //活动类型标识", + "int64 start //活动时间开始时间戳", + "int64 end //活动时间结束时间戳", + "bool order_by_id //是否id升序", + "repeated int32 targets //活动目标集合", + "int64 updated_start //最后更新时间开始时间戳", + "int64 updated_end //最后更新时间结束时间戳", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动ID", + "string hash_id //活动对外id", + "string title //活动标题", + "string cover_url //活动封面", + "string temp_group_mark //模版组标识", + "string temp_hash_id //模版hash_id", + "int64 fission_id //玩法ID", + "string fission_mark //活动类型玩法标识", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "string share_link //分享链接", + "int64 visitor_num //访问人数", + "int64 download_num //新增下载数", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线,4-预发布)", + "string view_link //预览地址", + "int32 t_offset //时间偏移量", + "repeated int32 lang_types //支持的语种", + "int32 temp_lang_type //模版支持语言", + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告)", + "int32 has_web //是否有站外活动(0-否,1-是)", + "int32 has_warm_up //是否开启预热(0-否,1-是)", + "int64 pre_run_time //预发布转正式发布时间戳", + "int32 ads_type //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启)", + "bool new_report //是否使用新报表", + "repeated LangTz lang_tz //语言时区数据是", + "int64 created_at //创建时间", + "repeated string while_list //白名单用户id列表", + "int64 updated_at //更新时间", + "repeated Channel channel_list //渠道列表", + "repeated Cond cond_list //任务列表", + "string creator_name //活动创建者在后台的名称", + "string creator_account //活动创建者在后台的登陆账号", +] +[[method.res.message]] +name = "LangTz" +field = [ + "string lang_mark //对应语言标识", + "int32 t_offset //时间偏移量", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线,4-预发布)", + "int32 lang_type //语言数字标识", +] +[[method.res.message]] +name = "Channel" +field = [ + "string title // 渠道标题", + "string url // 渠道链接", + "int32 c_type // 渠道类型(1-站内渠道,2-站外渠道)", +] +[[method.res.message]] +name = "Cond" +field = [ + "string event //事件", + "string key //事件key", + "string val //事件key对应的值", +] + +[[method]] +name = "Share" +desc = "社媒选项" +[method.req] +[method.res] +field = [ + "repeated One loc //国内", + "repeated One over_sea //国外", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动ID", + "string title //标题", + "string logo //图标", + "string scheme //Scheme", + "string ios_scheme //ios Scheme", +] + +[[method]] +name = "Status" +desc = "修改状态" +[method.req] +field = [ + "int64 id //活动ID", + "string hash_id //活动对外id", + "int32 status //发布状态(2-已发布,3-已下线,4-预发布)", + "int64 pre_run_time //预发布转正式发布时间戳", +] + +[method.res] + +[[method]] +name = "Destroy" +desc = "删除活动" +[method.req] +field = [ + "int64 id //活动ID", + "string hash_id //活动对外id", + "int32 status //发布状态(2-已发布,3-已下线)", +] + +[method.res] + +[[method]] +name = "Store" +desc = "创建活动" +[method.req] +field = [ + "string project_id //项目id", + "string template_id //模版id", + "int64 user_id //员工id", + "string title //活动标题", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "string cover_url //活动封面图", + "Config config //活动基础配置", + "repeated KV campaign_data //前端组件位置偏移数据", + "LotteryConfig prize_wheel //大转盘配置(大转盘玩法必传)", + "LotteryConfig slot //老虎机配置(老虎机玩法必传)", + "LotteryConfig blind //盲盒配置(盲盒玩法必传)", + "LotteryConfig grid //九宫格配置(九宫格玩法必传)", + "InviteConfig referral //老带新配置(老带新玩法必传)", + "QuestionAnswer question_answer //趣味问答配置(趣味问答玩法必传)", + "Quiz quiz //有奖竞猜配置(有奖竞猜玩法必传)", + "InviteConfig win //一起赢配置(一起赢玩法必传)", + "int32 t_offset //时间偏移量", + "Target target //活动目标", + "Sign sign //签到配置(签到玩法必传)", + "Dice dice //大富翁配置(大富翁玩法必传)", + "Grow grow //农场配置(农场玩法必传)", + "Ballot ballot //抽签配置(抽签玩法必传)", + "Chop chop //砍一刀配置(砍一刀玩法必传)", + "repeated KV delay_link_data //延迟深度链接自定义键值数据", + "Rewards rewards //站内奖品", + "repeated Reward rewards_web //站外奖品", + "repeated Reward rewards_extra //额外奖品", + "repeated Reward rewards_newcomer //新人奖", + "TargetOption target_option //目标配置选项", + "Cash cash //现金抽奖配置(现金抽奖玩法必传)", + "repeated LongImg long_imgs //长图配置", + "Flip flip //翻牌配置(翻牌玩法必传)", + "string copy_campaign_id //复制的活动id", + "Keep keep_dog //养狗(养狗配置必传)", + "string ip //操作ip", + "Push push //推送配置", + "repeated Child child //关联的子活动", + "WheelStyle wheel_style //转盘自定义样式", + "Gold gold //金币任务配置(金币任务玩法必传)", + "Coin coin //金币池配置(金币池玩法必传)", + "GridStyle grid_style //九宫格自定义样式", + "FlipStyle flip_style //翻牌自定义样式", + "PointsUse points_use //积分消耗", + "Chat chat //ai陪伴", + "Vs vs //赛事竞猜配置(赛事竞猜玩法必传)", + "Uno uno //uno卡牌配置(uno卡牌玩法必传)", + "Event event //事件配置(活动事件)", + "LotteryConfig gashapon //扭蛋机配置(扭蛋机玩法必传)", + "GashaponStyle gashapon_style //扭蛋机自定义样式", +] + +[[method.req.message]] +name = "GashaponStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string machine_img //机器图", + "string play_img //Go按钮图", + "int32 egg_type //类型", + "repeated string egg_imgs //扭蛋素材", +] + +[[method.req.message]] +name = "Event" +field = [ + "EventOne first_visit //首次访问", +] +[[method.req.message]] +name = "EventOne" +field = [ + "int32 open //是否开启", + "repeated EventReward rewards //奖励" +] +[[method.req.message]] +name = "EventReward" +field = [ + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "Reward reward //奖品", + "int32 chance //道具数量", + "string expired_day //过期天数", +] + +[[method.req.message]] +name = "Uno" +field = [ + "int32 init_chance //初始抽奖次数", + "repeated string prop_marks //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌)", + "UnoGroup red //红牌配置", + "UnoGroup yellow //黄牌配置", + "UnoGroup blue //黑牌配置", + "UnoGroup green //绿牌配置", +] +[[method.req.message]] +name = "UnoGroup" +field = [ + "string odds //获得牌型概率", + "Reward reward //奖品", + "int32 open_rule //是否开启得牌规则(0-否,1-是)", + "UnoLimitRule limit_rule //得牌规则", + "int32 custom_card //自定义卡牌(0-否,1-是)", + "repeated UnoCard cards //自定义卡牌", +] +[[method.req.message]] +name = "UnoLimitRule" +field = [ + "int32 init_num //初始的最大可获得牌型数", + "int32 sign_day //签到天数", + "int32 add_num //完成条件可获得最大牌型数", + "int32 reset_type //重置规则(1-不重置,2-获奖后重置)", +] +[[method.req.message]] +name = "UnoCard" +field = [ + "string title //跳转按钮文案", + "string img_url //图片地址", + "string web_url //Web跳转地址", + "string app_param //App跳转参数", + "string pc_param //pc跳转参数", +] + +[[method.req.message]] +name = "Vs" +field = [ + "int32 init_chance //初始投票次数", + "int32 each_limit_num //每场可投票次数", + "int32 open_point //是否开启积分(0-否,1-是)", + "int32 points_num //投票扣除积分数", + "int32 mall_open //是否使用积分商城(0-否,1-是)", + "int64 mall_id //兑换商城id", + "int32 vs_tz //比赛时区", + "int32 claim_type //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖)", + "repeated Schedule schedules //赛事时间表", + "string icon_mall //商城图标", + "string icon_reward //奖励记录图标", + "string icon_schedule //赛程图标", +] +[[method.req.message]] +name = "Schedule" +field = [ + "repeated PkTeam pk_teams //队伍", +] +[[method.req.message]] +name = "PkTeam" +field = [ + "repeated Team teams //队伍", + "string vote_start //开始时间", + "string vote_end //结束时间", + "string vs_date //比赛开始时间", + "string vs_img //比赛图", + "string desc //标题描述", + "string prop_mark //奖励的道具类型(reward-奖品,point-积分)", + "int64 reward_id //奖品库奖品id", + "int32 prop_num //道具数量", + "string expired_day //过期天数", + "repeated string other_vote //其他投票方式", + "int32 open_odds //是否开启赔率(0-否,1-是)", + "string odds_left //左边赔率", + "string odds_right //右边赔率", + "string odds_draw //平局赔率", +] +[[method.req.message]] +name = "Team" +field = [ + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method.req.message]] +name = "Chat" +field = [ + "int32 open //开启ai陪伴(0-关闭,1-开启)", + "string header_img //宠物头像", + "string chat_bg //聊天背景", + "int32 day_limit //每日聊天上限", +] + +[[method.req.message]] +name = "PointsUse" +field = [ + "int32 open //是否开启积分消耗(0-否,1-是)", + "string icon //积分icon图", + "int64 url_id //回调地址id", + "int32 use_num //单次兑换使用积分数量", + "int32 day_limit //每日可兑换次数", + "int32 total_limit //总兑换次数", +] + +[[method.req.message]] +name = "FlipStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string button_color //按钮颜色", + "string play_img //Go按钮图", + "string card_img //卡片素材", +] + +[[method.req.message]] +name = "GridStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string button_color //按钮颜色", + "string play_img //Go按钮图", + "string disable_play_img //Go按钮禁用", + "string machine_img //机器图", + "string grid_img //方格图", + "string activate_img //方格激活图", +] + +[[method.req.message]] +name = "WheelStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string bottom1 //底部颜色1", + "string bottom2 //底部颜色2", + "string bottom3 //底部颜色3", + "string pointer //指针图片", + "string play_btn //玩法按钮图片", + "string border_img //边框图片", + "string button_color //按钮颜色", + "string wheel_text_color //转盘文字颜色", +] + +[[method.req.message]] +name = "Child" +field = [ + "string hash_id //活动hash_id", + "int32 child_type //子活动类型", +] + +[[method.req.message]] +name = "Config" +field = [ + "string rule_text_color //规则文字颜色", + "string rule_bg_color //规则背景颜色", + "string share_text //分享文案", + "string share_img //分享图片", + "int32 has_rank //是否展示中奖纪录(1-是,0-否)", + "string rank_background_color //排行榜背景颜色", + "string rank_text_color //排行榜背景颜色", + "string download_page_image //下载引导页的图片", + "int32 is_default_download //是否使用默认下载图(1-是,0-否)", + "string wechat_page_image //微信引导页的图片", + "int32 is_default_wechat //是否使用默认微信引导图(1-是,0-否)", + "string image_main //活动主图", + "int32 is_default_main //是否使用默认活动主图(1-是,0-否)", + "string image_preview //问题页背景图", + "string link_btn_text_color //分享链接按钮文字颜色", + "string link_btn_bg_color //分享链接按钮背景颜色", + "string link_text_color //分享链接文字颜色", + "int32 show_share //是否显示分享社交媒体(0-否,1-是)", + "repeated int64 share //要分享的社交媒体,例如[1,2,3]", + "string play_rule //玩法规则", + "string page_title //页面标题", + "int32 dm_show //是否显示弹幕(0-否,1-是)", + "string web_bg_img //站外活动背景图", + "int32 has_warm_up //是否预热(0-否,1-是)", + "string warm_up_img //预热海报图", + "int32 warm_up_end //活动开始前多少分钟结束预热", + "int32 icon_type //活动挂件类型(用于前端挂件选用判断)", + "string icon_bg_color //活动挂件背景色", + "int32 dl_type //下载引导页类型(1-通用,2-自定义多媒体)", + "int32 dl_banner_type //下载页横幅类型(1-默认,2-自定义)", + "string dl_banner_img //下载页横幅自定义图", + "string dl_banner_app_logo //下载页横幅applogo图片", + "string dl_banner_app_name //下载页横幅app名称", + "string dl_banner_app_btn //下载页横幅app按钮文案", + "int32 dl_banner_position //下载页横幅位置(1-顶部,2-底部)", + "string topic_color //主题色", + "int32 window_cover //是否显示弹幕(0-否,1-是)", + "repeated int32 icon_open //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3]", + "int32 has_white //是否开启白名单(0-否,1-是)", + "string white_list //白名单列表(多个用英文;分割)", + "string pc_bg //pc适配背景图", + "int32 ads_type //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启)", + "string link_temp_id //链接模板id", + "int32 rule_time_open //是否展示规则中的活动时间(0-否,1-是)", + "int32 outside_task //是否外显任务(0-否,1-是)", + "string icon_text_color //活动挂件字体色", + "int32 open_share //是否启用分享模块(0-否,1-是)", + "int32 show_to_use //是否展示奖品弹窗的去使用(0-不展示,1-展示)", + "int32 rule_type //规则展示类型(0-文本,1-图片)", + "string rule_img //规则展示图", + "int32 rule_outside //规则是否外显(0-否,1-是)", + "int32 device_once //设备唯一(0-否,1-是)", +] + +[[method.req.message]] +name = "LongImg" +field = [ + "string img_url //图片地址", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int32 click_type //点击类型(1-整图点击,2-区域点击)", + "repeated HotZone hot_zone //点击区域", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", +] + +[[method.req.message]] +name = "HotZone" +field = [ + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "double click_x //点击区域x", + "double click_y //点击区域y", + "double click_w //点击区域w", + "double click_h //点击区域h", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", +] + +[[method.req.message]] +name = "Target" +field = [ + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "int32 option //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标)", + "int32 app_event //目标选择类型为1(option=1)的选项(1-安装;2-注册)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", + "NormalData normal_data //通用事件的数据", +] + +[[method.req.message]] +name = "Cond" +field = [ + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "string desc //条件描述", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "repeated string lang_marks //限制的语言集合", + "int32 watch_sec //观看秒数", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置条件(0-否,1-是)", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", + "int32 expired_min //过期分钟数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "int32 sort //排序", + "int32 open_push //是否开启完成推送(0-否,1-是)", + "string pc_param //pc端附加参数", + "int32 award_mode //领奖模式(1-自动领奖,2-手动领奖)", + "string go_text //去完成文案", + "int32 click_effect_open //是否开启点击有效(0-否,1-是)", + "int32 click_effect //点击有效值", + "string click_effect_unit //点击有效单位(min-分钟,hour-小时,day-天)", + "string expired_day //过期天数", + "int32 pull_invite //是否拉起邀请(0-否,1-是)", +] + +[[method.req.message]] +name = "BothAll" +field = [ + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "repeated string lang_marks //限制的语言集合", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "string expired_day //过期天数", +] + +[[method.req.message]] +name = "NormalData" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", +] + +[[method.req.message]] +name = "TargetOption" +field = [ + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "Fixed fixed //固定事件", + "Custom custom //自定义事件", +] + +[[method.req.message]] +name = "Fixed" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 app_event //固定事件类型(1-安装;2-注册)", + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", + "double percent //百分比值(如:获得的能量点)", +] + +[[method.req.message]] +name = "Custom" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", + "int32 pre_event //自定义事件前置事件(0-任意事件;1-安装;2-注册)", +] + +[[method.req.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method.req.message]] +name = "Reward" +field = [ + "int64 reward_id //奖品库的奖品id", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "int32 odds //中奖率", + "string jump_url //跳转地址", + "int32 campaign_limit //活动内单个用户可获取该奖品次数", + "int32 register //开启注册助力(0-否,1-是)", + "double register_percent //每个注册获得的进度比率", + "double init_percent //初始助力进度", + "CollectRule collect_rule //收集规则", + "string expired_day //过期天数", + "OpenAdd open_add //库存增加规则", + "RewardTask reward_task //解锁任务", +] + +[[method.req.message]] +name = "RewardTask" +field = [ + "int32 open //是否开启(0-否,1-是)", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 open_push //是否开启完成推送(0-否,1-是)", +] + +[[method.req.message]] +name = "OpenAdd" +field = [ + "int32 open //开启动态库存规则(0-否,1-是)", + "int64 start //开始时间", + "int64 end //结束时间", + "int32 day_num //天数", + "int32 day_add //增加的库存量", +] + +[[method.req.message]] +name = "CollectRule" +field = [ + "int32 open //开启碎片规则(0-否,1-是)", + "int32 init_collect //初始的最大可获得碎片数", + "int32 sign_day //签到天数", + "int32 add_collect //完成条件可获得最大碎片数", + "int32 reset_type //重置碎片规则(1-不重置,2-获奖后重置)", +] + +[[method.req.message]] +name = "Rewards" +field = [ + "int32 reward_group //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品)", + "repeated Reward normal //常规奖品", + "UserLevel user_level //用户类型奖品", + "repeated Lang langs //语言奖品", + "repeated LangUserLevel lang_user_level //语言+用户类型奖品", + "Country country //国家奖品", +] + +[[method.req.message]] +name = "UserLevel" +field = [ + "int64 default_level_id //默认用户类型id", + "repeated UserLevelOne level_list //用户类型奖品", +] + +[[method.req.message]] +name = "UserLevelOne" +field = [ + "int64 level_id //用户类型id", + "repeated Reward rewards //奖品", +] + +[[method.req.message]] +name = "Lang" +field = [ + "string lang_mark //语言标识", + "repeated Reward rewards //奖品", +] + +[[method.req.message]] +name = "LangUserLevel" +field = [ + "string lang_mark //语言标识", + "int64 default_level_id //默认用户类型id", + "repeated UserLevelOne level_list //用户类型奖品", +] + +[[method.req.message]] +name = "Country" +field = [ + "string default_country_mark //默认国家", + "repeated CountryOne country_list //国家的奖品", +] + +[[method.req.message]] +name = "CountryOne" +field = [ + "string country_mark //国家标识", + "repeated Reward rewards //奖品", +] + +[[method.req.message]] +name = "QaQuestion" +field = [ + "string title //题目", + "int32 score //得分", + "repeated QaOption options //选项", +] + +[[method.req.message]] +name = "QaOption" +field = [ + "string title //答案内容", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[[method.req.message]] +name = "QuizOption" +field = [ + "string title //选项标题", + "string img_url //选项图片", + "int32 is_right //是否正确选项(1-是,0-否)", +] + +[[method.req.message]] +name = "Quiz" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 init_chance //初始答题机会次数", + "int32 chance //达标获得的答题机会次数", + "int32 reward_rule //奖励规则(1-投票结果排名,2-自定义竞猜结果)", + "int64 open_prize //开奖时间", + "string title //选择标题", + "repeated QuizOption options //有奖竞猜选项", +] + +[[method.req.message]] +name = "QuestionAnswer" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标条件后可获取的答题次数", + "int32 init_chance //初始答题机会次数", + "int32 question_ask_time //答题时间限制(单位:S,如:1 就是1秒)", + "repeated QaQuestion questions //题目", + "string group_hash_id //题库对外id", + "int32 qa_num //题库选取数量", + "int32 day_chance //每日签到获得的答题数", + "int32 open_guide //是否开启引导(0-否,1-是)", + "string guide_group_hash_id //引导组hash_id", +] + +[[method.req.message]] +name = "LotteryConfig" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 init_chance //初始抽奖机会次数", + "int32 chance //达标获得的抽奖机会次数", + "int32 day_chance //每日获得的抽奖机会次数", +] + +[[method.req.message]] +name = "InviteConfig" +field = [ + "int32 reward_limit //活动总奖励上限", + "int32 reward_rule //用户奖励规则(1-阶梯,2-非阶梯)", + "int32 invite_limit //邀请超过多少人不能再获得奖励", + "int32 newcomer_cond //新人条件(1-新安装,2-助力成功,3-新安装且助力成功)", + "int32 step_loop //阶梯是否支持循环(0-不支持,1-支持)", +] + +[[method.req.message]] +name = "Sign" +field = [ + "int32 sign_type //签到类型(1-普通签到,2-阶梯签到)", + "int32 is_continue //是否连续签到(1-是,0-否)", + "int32 has_card //是否开启签到卡(1-开启,0-不开启)", + "int32 invite_num //邀请好友数可获得的1张签到卡", + "int32 limit_card_num //可获得幸运卡的最大张数", + "int32 is_loop //是否支持循环(0-否,1-是)", + "int32 sign_cycle //签到周期", + "int32 recycle_type //重新签到模式(1-断签重签,2-周期重签)", + "string color //签到主题颜色", +] + +[[method.req.message]] +name = "Dice" +field = [ + "int32 init_chance //初始骰子数", + "int32 day_chance //每日获得的骰子数", + "int32 fix_dice //开启固定骰子(0-不开启,1-开启)", + "int32 fix_dice_target //获得固定骰子需要邀请的人数", + "int32 fix_dice_limit //固定骰子限制获取数", + "string custom_dice //自定义骰子图片", + "int32 open_map_point //开启自定义底座(0-不开启,1-开启)", + "MapPoint map_point //自定义底座数据", + "int32 award_type //奖品碎片收集方式(1-随机收集,2-概率收集)", + "int32 open_invite //开启邀请挂件(0-关闭,1-开启)", + "int32 roll_again //开启再摇一次(0-关闭,1-开启)", + "int32 fix_dice_cond //邀请事件(1-安装,2-注册)", + "int32 odds //概率收集方式的中奖概率", + "string play_img //play按钮图", + "string cloud_img //云朵图", +] +[[method.req.message]] +name = "MapPoint" +field = [ + "string blank //空白底座", + "string again //再摇一次底座", + "string normal //普通奖品底座", + "string supper //超级大奖底座", +] + +[[method.req.message]] +name = "Grow" +field = [ + "int32 auto_hour //自动生产成长道具小时数", + "int32 auto_num //生产的成长道具数", + "int32 grow_num //邀请可获得的成长道具数量", + "int32 target_num //获得成长道具需要邀请的人数", + "int32 revive //是否支持复活(0-否,1-是)", + "int32 revive_num //复活需要邀请的好友数", + "int32 die_hour //未获得成长道具导致的死亡时间", + "repeated GrowStep steps //成长阶段", + "int32 init_num //初始成长道具数量", +] + +[[method.req.message]] +name = "GrowStep" +field = [ + "int32 num //需要的养成道具数量", +] + +[[method.req.message]] +name = "Ballot" +field = [ + "int32 init_chance //初始抽签数", + "int32 day_chance //每日获得的抽签数", +] + +[[method.req.message]] +name = "Chop" +field = [ + "int32 show_bar //是否展示进度条(0-否,1-是)", +] + +[[method.req.message]] +name = "Cash" +field = [ + "int32 expired_day //任务重置天数", + "int32 price //单位奖品总价值", + "int32 price_num //奖品总份额", + "int32 currency //货币id标识", + "int32 loop_num //支持循环次数", +] + +[[method.req.message]] +name = "Flip" +field = [ + "int32 init_chance //初始抽奖机会次数", + "string card_img //卡牌图片", + "int32 day_chance //每日获得的抽奖机会次数", +] + +[[method.req.message]] +name = "Keep" +field = [ + "int32 collect //获得最终奖品需要的总收集数", + "int32 collect_second //单个收集需要的二级资源数", + "int32 open_invite //开启邀请(0-关闭,1-开启)", + "Invite invite //拉新配置", + "int32 init_get //初始道具数", + "double sec_get //每秒获得道具数", + "int32 feed_num //每次使用道具数", + "int32 feed_cycle //喂养周期(单位:天)", + "int32 max_feed //最大可领养次数", + "int32 feed_get //喂养能得到的道具数", + "int32 feed_get_num //得到喂养道具需要的喂养次数", + "repeated Talk talk_text //对话文案", + "repeated KeepStep steps //养成阶梯", + "double sec_get_day_limit //每秒获得道具每日上限", + "int32 machine_type //狗粮机类型(1-在线收益,2-离线收益)", + "int32 offline_min //离线分钟时长", + "int32 offline_get //离线收益最大值", + "int32 offline_limit //离线收益最大领取次数", +] +[[method.req.message]] +name = "Invite" +field = [ + "int32 invite_type //邀请类型(1-下载,2-安装)", + "int32 invite_get //邀请可获得的道具数量", + "int32 reward_selected //选择礼品可获得的道具数", + "int32 feed_third //喂养3次可获得的道具数", + "int32 day_first_invite //是否开启每日首次拉新(0-否,1-是)", + "int32 day_first_get //每日首次拉新可获得的道具数", + "int32 day_first_selected //每日首日选择礼物可获得的道具数", + "int32 day_first_third //每日首次喂养三次可获得的道具数", + "int32 invite_max_get //邀请人可获得的最大道具数", +] +[[method.req.message]] +name = "Talk" +field = [ + "int32 text_type //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时)", + "string content //内容", +] +[[method.req.message]] +name = "KeepStep" +field = [ + "int32 step //阶段", + "int32 percent //对应的进度条数值", + "int32 reward_type //奖品类型(1-成长道具,2-奖品)", + "Reward reward //奖品数据时", + "int32 reward_num //发放道具数量", +] +[[method.req.message]] +name = "Push" +field = [ + "PushOne task_reset // 重制提醒", + "PushOne active //活跃提醒", + "PushOne offline //离线提醒", + "PushOne visit //访问提醒", +] +[[method.req.message]] +name = "PushOne" +field = [ + "int32 open //是否开启", + "repeated PushCond push_cond //条件内容" +] +[[method.req.message]] +name = "PushCond" +field = [ + "string mark //条件标识", + "string val // 标识值 " +] + +[[method.req.message]] +name = "Gold" +field = [ + "int32 gold_num //任务重置天数", + "int32 expired_day //任务重置天数", + "double price //单位奖品总价值", + "int32 price_num //奖品总份额", + "int32 currency //货币id标识", +] + +[[method.req.message]] +name = "Coin" +field = [ + "string coin_img //金币图片", + "int32 open_days //开奖天数", + "int32 open_limit //开奖次数限制", + "int32 init_coin //初始金币数", + "int32 init_use //初始投放次数", + "int32 use_coin //单次投放消耗金币数", + "int32 use_limit //单次瓜分最多投放次数", + "int64 url_id //回调地址id", + "repeated int32 lack_btn //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2]", + "string custom_btn_text //自定义按钮文案", + "string custom_web_url //自定义web端url", + "string custom_extra_param //自定义app附加参数", + "string custom_pc_param //自定义pc附加参数", +] + +[method.res] +field = [ + "int64 id //id", + "string hash_id //活动id", +] + +[[method]] +name = "Update" +desc = "更新活动" +[method.req] +field = [ + "int64 id //id", + "string hash_id //活动id", + "string title //活动标题", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "string cover_url //活动封面图", + "Config config //活动基础配置", + "repeated KV campaign_data //前端组件位置偏移数据", + "LotteryConfig prize_wheel //大转盘配置(大转盘玩法必传)", + "LotteryConfig slot //老虎机配置(老虎机玩法必传)", + "LotteryConfig blind //盲盒配置(盲盒玩法必传)", + "LotteryConfig grid //九宫格配置(九宫格玩法必传)", + "InviteConfig referral //老带新配置(老带新玩法必传)", + "QuestionAnswer question_answer //趣味问答配置(趣味问答玩法必传)", + "Quiz quiz //有奖竞猜配置(有奖竞猜玩法必传)", + "InviteConfig win //一起赢配置(一起赢玩法必传)", + "int32 t_offset //时间偏移量", + "Target target //活动目标", + "Sign sign //签到配置(签到玩法必传)", + "Dice dice //大富翁配置(大富翁玩法必传)", + "Grow grow //农场配置(农场玩法必传)", + "Ballot ballot //抽签配置(抽签玩法必传)", + "Chop chop //砍一刀配置(砍一刀玩法必传)", + "repeated KV delay_link_data //延迟深度链接自定义键值数据", + "Rewards rewards //站内奖品", + "repeated Reward rewards_web //站外奖品", + "repeated Reward rewards_extra //额外奖品", + "repeated Reward rewards_newcomer //新人奖", + "int64 user_id //id", + "string ip //操作ip", + "TargetOption target_option //目标配置选项", + "Cash cash //现金抽奖配置(现金抽奖玩法必传)", + "repeated LongImg long_imgs //长图配置", + "Flip flip //翻牌配置(翻牌玩法必传)", + "Keep keep_dog //养狗(养狗配置必传)", + "Push push //推送配置", + "repeated Child child //关联的子活动", + "WheelStyle wheel_style //转盘自定义样式", + "Gold gold //金币任务配置(金币任务玩法必传)", + "Coin coin //金币池配置(金币池玩法必传)", + "GridStyle grid_style //九宫格自定义样式", + "FlipStyle flip_style //翻牌自定义样式", + "PointsUse points_use //积分消耗", + "Chat chat //ai陪伴", + "Vs vs //赛事竞猜配置(赛事竞猜玩法必传)", + "Uno uno //uno卡牌配置(uno卡牌玩法必传)", + "Event event //事件配置(活动事件)", + "LotteryConfig gashapon //扭蛋机配置(扭蛋机玩法必传)", + "GashaponStyle gashapon_style //扭蛋机自定义样式", +] + +[[method.req.message]] +name = "GashaponStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string machine_img //机器图", + "string play_img //Go按钮图", + "int32 egg_type //类型", + "repeated string egg_imgs //扭蛋素材", +] + +[[method.req.message]] +name = "Event" +field = [ + "EventOne first_visit //首次访问", +] +[[method.req.message]] +name = "EventOne" +field = [ + "int32 open //是否开启", + "repeated EventReward rewards //奖励" +] +[[method.req.message]] +name = "EventReward" +field = [ + "int64 id //id", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "Reward reward //奖品", + "int32 chance //道具数量", + "string expired_day //过期天数", +] + +[[method.req.message]] +name = "Uno" +field = [ + "int32 init_chance //初始抽奖次数", + "repeated string prop_marks //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌)", + "UnoGroup red //红牌配置", + "UnoGroup yellow //黄牌配置", + "UnoGroup blue //黑牌配置", + "UnoGroup green //绿牌配置", +] +[[method.req.message]] +name = "UnoGroup" +field = [ + "int64 id //牌型id", + "string odds //获得牌型概率", + "Reward reward //奖品", + "int32 open_rule //是否开启得牌规则(0-否,1-是)", + "UnoLimitRule limit_rule //得牌规则", + "int32 custom_card //自定义卡牌(0-否,1-是)", + "repeated UnoCard cards //自定义卡牌", +] +[[method.req.message]] +name = "UnoLimitRule" +field = [ + "int32 init_num //初始的最大可获得牌型数", + "int32 sign_day //签到天数", + "int32 add_num //完成条件可获得最大牌型数", + "int32 reset_type //重置规则(1-不重置,2-获奖后重置)", +] +[[method.req.message]] +name = "UnoCard" +field = [ + "int64 id //牌id", + "string title //跳转按钮文案", + "string img_url //图片地址", + "string web_url //Web跳转地址", + "string app_param //App跳转参数", + "string pc_param //pc跳转参数", +] + +[[method.req.message]] +name = "Vs" +field = [ + "int32 init_chance //初始投票次数", + "int32 each_limit_num //每场可投票次数", + "int32 open_point //是否开启积分(0-否,1-是)", + "int32 points_num //投票扣除积分数", + "int32 mall_open //是否使用积分商城(0-否,1-是)", + "int64 mall_id //兑换商城id", + "int32 vs_tz //比赛时区", + "int32 claim_type //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖)", + "repeated Schedule schedules //赛事时间表", + "string icon_mall //商城图标", + "string icon_reward //奖励记录图标", + "string icon_schedule //赛程图标", +] +[[method.req.message]] +name = "Schedule" +field = [ + "repeated PkTeam pk_teams //队伍", +] +[[method.req.message]] +name = "PkTeam" +field = [ + "int64 id //赛程id", + "repeated Team teams //队伍", + "string vote_start //开始时间", + "string vote_end //结束时间", + "string vs_date //比赛开始时间", + "string vs_img //比赛图", + "string desc //标题描述", + "string prop_mark //奖励的道具类型(reward-奖品,point-积分)", + "int64 reward_id //奖品库奖品id", + "int32 prop_num //道具数量", + "string expired_day //过期天数", + "repeated string other_vote //其他投票方式", + "int32 open_odds //是否开启赔率(0-否,1-是)", + "string odds_left //左边赔率", + "string odds_right //右边赔率", + "string odds_draw //平局赔率", +] +[[method.req.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method.req.message]] +name = "Chat" +field = [ + "int32 open //开启ai陪伴(0-关闭,1-开启)", + "string header_img //宠物头像", + "string chat_bg //聊天背景", + "int32 day_limit //每日聊天上限", +] + +[[method.req.message]] +name = "PointsUse" +field = [ + "int32 open //是否开启积分消耗(0-否,1-是)", + "string icon //积分icon图", + "int64 url_id //回调地址id", + "int32 use_num //单次兑换使用积分数量", + "int32 day_limit //每日可兑换次数", + "int32 total_limit //总兑换次数", +] + +[[method.req.message]] +name = "FlipStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string button_color //按钮颜色", + "string play_img //Go按钮图", + "string card_img //卡片素材", +] + +[[method.req.message]] +name = "GridStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string button_color //按钮颜色", + "string play_img //Go按钮图", + "string disable_play_img //Go按钮禁用", + "string machine_img //机器图", + "string grid_img //方格图", + "string activate_img //方格激活图", +] + +[[method.req.message]] +name = "WheelStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string bottom1 //底部颜色1", + "string bottom2 //底部颜色2", + "string bottom3 //底部颜色3", + "string pointer //指针图片", + "string play_btn //玩法按钮图片", + "string border_img //边框图片", + "string button_color //按钮颜色", + "string wheel_text_color //转盘文字颜色", +] + +[[method.req.message]] +name = "Child" +field = [ + "string hash_id //活动hash_id", + "int32 child_type //子活动类型", +] + +[[method.req.message]] +name = "Config" +field = [ + "string rule_text_color //规则文字颜色", + "string rule_bg_color //规则背景颜色", + "string share_text //分享文案", + "string share_img //分享图片", + "int32 has_rank //是否展示中奖纪录(1-是,0-否)", + "string rank_background_color //排行榜背景颜色", + "string rank_text_color //排行榜背景颜色", + "string download_page_image //下载引导页的图片", + "int32 is_default_download //是否使用默认下载图(1-是,0-否)", + "string wechat_page_image //微信引导页的图片", + "int32 is_default_wechat //是否使用默认微信引导图(1-是,0-否)", + "string image_main //活动主图", + "int32 is_default_main //是否使用默认活动主图(1-是,0-否)", + "string image_preview //问题页背景图", + "string link_btn_text_color //分享链接按钮文字颜色", + "string link_btn_bg_color //分享链接按钮背景颜色", + "string link_text_color //分享链接文字颜色", + "int32 show_share //是否显示分享社交媒体(0-否,1-是)", + "repeated int64 share //要分享的社交媒体,例如[1,2,3]", + "string play_rule //玩法规则", + "string page_title //页面标题", + "int32 dm_show //是否显示弹幕(0-否,1-是)", + "string web_bg_img //站外活动背景图", + "int32 has_warm_up //是否预热(0-否,1-是)", + "string warm_up_img //预热海报图", + "int32 warm_up_end //活动开始前多少分钟结束预热", + "int32 icon_type //活动挂件类型(用于前端挂件选用判断)", + "string icon_bg_color //活动挂件背景色", + "int32 dl_type //下载引导页类型(1-通用,2-自定义多媒体)", + "int32 dl_banner_type //下载页横幅类型(1-默认,2-自定义)", + "string dl_banner_img //下载页横幅自定义图", + "string dl_banner_app_logo //下载页横幅applogo图片", + "string dl_banner_app_name //下载页横幅app名称", + "string dl_banner_app_btn //下载页横幅app按钮文案", + "int32 dl_banner_position //下载页横幅位置(1-顶部,2-底部)", + "string topic_color //主题色", + "int32 window_cover //是否显示弹幕(0-否,1-是)", + "repeated int32 icon_open //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3]", + "int32 has_white //是否开启白名单(0-否,1-是)", + "string white_list //白名单列表(多个用英文;分割)", + "string pc_bg //pc适配背景图", + "int32 ads_type //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启)", + "repeated int64 level_ids //限制的用户类型id集合", + "string link_temp_id //链接模板id", + "int32 rule_time_open //是否展示规则中的活动时间(0-否,1-是)", + "int32 outside_task //是否外显任务(0-否,1-是)", + "string icon_text_color //活动挂件字体色", + "int32 open_share //是否启用分享模块(0-否,1-是)", + "int32 show_to_use //是否展示奖品弹窗的去使用(0-不展示,1-展示)", + "int32 rule_type //规则展示类型(0-文本,1-图片)", + "string rule_img //规则展示图", + "int32 rule_outside //规则是否外显(0-否,1-是)", + "int32 device_once //设备唯一(0-否,1-是)", +] + +[[method.req.message]] +name = "LongImg" +field = [ + "string img_url //图片地址", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 id //长图id", + "int32 click_type //点击类型(1-整图点击,2-区域点击)", + "repeated HotZone hot_zone //点击区域", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", +] + +[[method.req.message]] +name = "HotZone" +field = [ + "int64 id //热区id", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "double click_x //点击区域x", + "double click_y //点击区域y", + "double click_w //点击区域w", + "double click_h //点击区域h", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", +] + +[[method.req.message]] +name = "Target" +field = [ + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "int32 option //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标)", + "int32 app_event //目标选择类型为1(option=1)的选项(1-安装;2-注册)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", + "NormalData normal_data //通用事件的数据", +] + +[[method.req.message]] +name = "Cond" +field = [ + "int64 id //条件id", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "string desc //条件描述", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "repeated string lang_marks //限制的语言集合", + "int32 watch_sec //观看秒数", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置条件(0-否,1-是)", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", + "int32 expired_min //过期分钟数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "int32 sort //排序", + "int32 open_push //是否开启完成推送(0-否,1-是)", + "string pc_param //pc端附加参数", + "int32 award_mode //领奖模式(1-自动领奖,2-手动领奖)", + "string go_text //去完成文案", + "int32 click_effect_open //是否开启点击有效(0-否,1-是)", + "int32 click_effect //点击有效值", + "string click_effect_unit //点击有效单位(min-分钟,hour-小时,day-天)", + "string expired_day //过期天数", + "int32 pull_invite //是否拉起邀请(0-否,1-是)", +] + +[[method.req.message]] +name = "BothAll" +field = [ + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "repeated string lang_marks //限制的语言集合", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "string expired_day //过期天数", +] + +[[method.req.message]] +name = "NormalData" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", +] + +[[method.req.message]] +name = "TargetOption" +field = [ + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "Fixed fixed //固定事件", + "Custom custom //自定义事件", +] + +[[method.req.message]] +name = "Fixed" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 app_event //固定事件类型(1-安装;2-注册)", + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", + "double percent //百分比值(如:获得的能量点)", +] + +[[method.req.message]] +name = "Custom" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", + "int32 pre_event //自定义事件前置事件(0-任意事件;1-安装;2-注册)", +] + +[[method.req.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method.req.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "int64 reward_id //奖品库的奖品id", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "int32 odds //中奖率", + "string jump_url //跳转地址", + "int32 campaign_limit //活动内单个用户可获取该奖品次数", + "int32 register //开启注册助力(0-否,1-是)", + "double register_percent //每个注册获得的进度比率", + "double init_percent //初始助力进度", + "CollectRule collect_rule //收集规则", + "string expired_day //过期天数", + "OpenAdd open_add //库存增加规则", + "RewardTask reward_task //解锁任务", +] + +[[method.req.message]] +name = "RewardTask" +field = [ + "int32 open //是否开启(0-否,1-是)", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 open_push //是否开启完成推送(0-否,1-是)", +] + +[[method.req.message]] +name = "OpenAdd" +field = [ + "int32 open //开启动态库存规则(0-否,1-是)", + "int64 start //开始时间", + "int64 end //结束时间", + "int32 day_num //天数", + "int32 day_add //增加的库存量", +] + +[[method.req.message]] +name = "CollectRule" +field = [ + "int32 open //开启碎片规则(0-否,1-是)", + "int32 init_collect //初始的最大可获得碎片数", + "int32 sign_day //签到天数", + "int32 add_collect //完成条件可获得最大碎片数", + "int32 reset_type //重置碎片规则(1-不重置,2-获奖后重置)", +] + +[[method.req.message]] +name = "Rewards" +field = [ + "int32 reward_group //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品)", + "repeated Reward normal //常规奖品", + "UserLevel user_level //用户类型奖品", + "repeated Lang langs //语言奖品", + "repeated LangUserLevel lang_user_level //语言+用户类型奖品", + "Country country //国家奖品", +] + +[[method.req.message]] +name = "UserLevel" +field = [ + "int64 default_level_id //默认用户类型id", + "repeated UserLevelOne level_list //用户类型奖品", +] + +[[method.req.message]] +name = "UserLevelOne" +field = [ + "int64 level_id //用户类型id", + "repeated Reward rewards //奖品", +] + +[[method.req.message]] +name = "Lang" +field = [ + "string lang_mark //语言标识", + "repeated Reward rewards //奖品", +] + +[[method.req.message]] +name = "LangUserLevel" +field = [ + "string lang_mark //语言标识", + "int64 default_level_id //默认用户类型id", + "repeated UserLevelOne level_list //用户类型奖品", +] + +[[method.req.message]] +name = "Country" +field = [ + "string default_country_mark //默认国家", + "repeated CountryOne country_list //国家的奖品", +] + +[[method.req.message]] +name = "CountryOne" +field = [ + "string country_mark //国家标识", + "repeated Reward rewards //奖品", +] + +[[method.req.message]] +name = "QaQuestion" +field = [ + "int64 id //题目id", + "string title //题目", + "int32 score //得分", + "repeated QaOption options //选项", +] + +[[method.req.message]] +name = "QaOption" +field = [ + "int64 id //答案id", + "string title //答案内容", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[[method.req.message]] +name = "QuizOption" +field = [ + "int64 id //选项id", + "string title //选项标题", + "string img_url //选项图片", + "int32 is_right //是否正确选项(1-是,0-否)", +] + +[[method.req.message]] +name = "Quiz" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 init_chance //初始答题机会次数", + "int32 chance //达标获得的答题机会次数", + "int32 reward_rule //奖励规则(1-投票结果排名,2-自定义竞猜结果)", + "int64 open_prize //开奖时间", + "string title //选项标题", + "repeated QuizOption options //有奖竞猜选项", +] + +[[method.req.message]] +name = "QuestionAnswer" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标条件后可获取的答题次数", + "int32 init_chance //初始答题机会次数", + "int32 question_ask_time //答题时间限制(单位:S,如:1 就是1秒)", + "repeated QaQuestion questions //题目", + "string group_hash_id //题库对外id", + "int32 qa_num //题库选取数量", + "int32 day_chance //每日签到获得的答题数", + "int32 open_guide //是否开启引导(0-否,1-是)", + "string guide_group_hash_id //引导组hash_id", +] + +[[method.req.message]] +name = "LotteryConfig" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 init_chance //初始抽奖机会次数", + "int32 chance //达标获得的抽奖机会次数", + "int32 day_chance //每日获得的抽奖机会次数", +] + +[[method.req.message]] +name = "InviteConfig" +field = [ + "int32 reward_limit //活动总奖励上限", + "int32 reward_rule //用户奖励规则(1-阶梯,2-非阶梯)", + "int32 invite_limit //邀请超过多少人不能再获得奖励", + "int32 newcomer_cond //新人条件(1-新安装,2-助力成功,3-新安装且助力成功)", + "int32 step_loop //阶梯是否支持循环(0-不支持,1-支持)", +] + +[[method.req.message]] +name = "Sign" +field = [ + "int32 sign_type //签到类型(1-普通签到,2-阶梯签到)", + "int32 is_continue //是否连续签到(1-是,0-否)", + "int32 has_card //是否开启签到卡(1-开启,0-不开启)", + "int32 invite_num //邀请好友数可获得的1张签到卡", + "int32 limit_card_num //可获得幸运卡的最大张数", + "int32 is_loop //是否支持循环(0-否,1-是)", + "int32 sign_cycle //签到周期", + "int32 recycle_type //重新签到模式(1-断签重签,2-周期重签)", + "string color //签到主题颜色", +] + +[[method.req.message]] +name = "Dice" +field = [ + "int32 init_chance //初始骰子数", + "int32 day_chance //每日获得的骰子数", + "int32 fix_dice //开启固定骰子(0-不开启,1-开启)", + "int32 fix_dice_target //获得固定骰子需要邀请的人数", + "int32 fix_dice_limit //固定骰子限制获取数", + "string custom_dice //自定义骰子图片", + "int32 open_map_point //开启自定义底座(0-不开启,1-开启)", + "MapPoint map_point //自定义底座数据", + "int32 award_type //奖品碎片收集方式(1-随机收集,2-概率收集)", + "int32 open_invite //开启邀请挂件(0-关闭,1-开启)", + "int32 roll_again //开启再摇一次(0-关闭,1-开启)", + "int32 fix_dice_cond //邀请事件(1-安装,2-注册)", + "int32 odds //概率收集方式的中奖概率", + "string play_img //play按钮图", + "string cloud_img //云朵图", +] +[[method.req.message]] +name = "MapPoint" +field = [ + "string blank //空白底座", + "string again //再摇一次底座", + "string normal //普通奖品底座", + "string supper //超级大奖底座", +] + +[[method.req.message]] +name = "Grow" +field = [ + "int32 auto_hour //自动生产成长道具小时数", + "int32 auto_num //生产的成长道具数", + "int32 grow_num //邀请可获得的成长道具数量", + "int32 target_num //获得成长道具需要邀请的人数", + "int32 revive //是否支持复活(0-否,1-是)", + "int32 revive_num //复活需要邀请的好友数", + "int32 die_hour //未获得成长道具导致的死亡时间", + "repeated GrowStep steps //成长阶段", + "int32 init_num //初始成长道具数量", +] + +[[method.req.message]] +name = "GrowStep" +field = [ + "int64 id //奖品id", + "int32 num //需要的养成道具数量", +] + +[[method.req.message]] +name = "Ballot" +field = [ + "int32 init_chance //初始抽签数", + "int32 day_chance //每日获得的抽签数", +] + +[[method.req.message]] +name = "Chop" +field = [ + "int32 show_bar //是否展示进度条(0-否,1-是)", +] + +[[method.req.message]] +name = "Cash" +field = [ + "int32 expired_day //任务重置天数", + "int32 price //单位奖品总价值", + "int32 price_num //奖品总份额", + "int32 currency //货币id标识", + "int32 loop_num //支持循环次数", +] + +[[method.req.message]] +name = "Flip" +field = [ + "int32 init_chance //初始抽奖机会次数", + "string card_img //卡牌图片", + "int32 day_chance //每日获得的抽奖机会次数", +] + +[[method.req.message]] +name = "Keep" +field = [ + "int32 collect //获得最终奖品需要的总收集数", + "int32 collect_second //单个收集需要的二级资源数", + "int32 open_invite //开启邀请(0-关闭,1-开启)", + "Invite invite //拉新配置", + "int32 init_get //初始道具数", + "double sec_get //每秒获得道具数", + "int32 feed_num //每次使用道具数", + "int32 feed_cycle //喂养周期(单位:天)", + "int32 max_feed //最大可领养次数", + "int32 feed_get //喂养能得到的道具数", + "int32 feed_get_num //得到喂养道具需要的喂养次数", + "repeated Talk talk_text //对话文案", + "repeated KeepStep steps //养成阶梯", + "double sec_get_day_limit //每秒获得道具每日上限", + "int32 machine_type //狗粮机类型(1-在线收益,2-离线收益)", + "int32 offline_min //离线分钟时长", + "int32 offline_get //离线收益最大值", + "int32 offline_limit //离线收益最大领取次数", +] +[[method.req.message]] +name = "Invite" +field = [ + "int32 invite_type //邀请类型(1-下载,2-安装)", + "int32 invite_get //邀请可获得的道具数量", + "int32 reward_selected //选择礼品可获得的道具数", + "int32 feed_third //喂养3次可获得的道具数", + "int32 day_first_invite //是否开启每日首次拉新(0-否,1-是)", + "int32 day_first_get //每日首次拉新可获得的道具数", + "int32 day_first_selected //每日首日选择礼物可获得的道具数", + "int32 day_first_third //每日首次喂养三次可获得的道具数", + "int32 invite_max_get //邀请人可获得的最大道具数", +] +[[method.req.message]] +name = "Talk" +field = [ + "int32 text_type //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时)", + "string content //内容", +] +[[method.req.message]] +name = "KeepStep" +field = [ + "int32 step //阶段", + "int32 percent //对应的进度条数值", + "int32 reward_type //奖品类型(1-成长道具,2-奖品)", + "Reward reward //奖品数据时", + "int32 reward_num //发放道具数量", +] +[[method.req.message]] +name = "Push" +field = [ + "PushOne task_reset // 重制提醒", + "PushOne active //活跃提醒", + "PushOne offline //离线提醒", + "PushOne visit //访问提醒", +] +[[method.req.message]] +name = "PushOne" +field = [ + "int32 open //是否开启", + "repeated PushCond push_cond //条件内容" +] +[[method.req.message]] +name = "PushCond" +field = [ + "string mark //条件标识", + "string val // 标识值 " +] + +[[method.req.message]] +name = "Gold" +field = [ + "int32 gold_num //任务重置天数", + "int32 expired_day //任务重置天数", + "double price //单位奖品总价值", + "int32 price_num //奖品总份额", + "int32 currency //货币id标识", +] + +[[method.req.message]] +name = "Coin" +field = [ + "string coin_img //金币图片", + "int32 open_days //开奖天数", + "int32 open_limit //开奖次数限制", + "int32 init_coin //初始金币数", + "int32 init_use //初始投放次数", + "int32 use_coin //单次投放消耗金币数", + "int32 use_limit //单次瓜分最多投放次数", + "int64 url_id //回调地址id", + "repeated int32 lack_btn //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2]", + "string custom_btn_text //自定义按钮文案", + "string custom_web_url //自定义web端url", + "string custom_extra_param //自定义app附加参数", + "string custom_pc_param //自定义pc附加参数", +] + +[method.res] +field = [ + "int64 id //id", + "string hash_id //活动id", + "bool add_task //新加了任务" +] + +[[method]] +name = "Show" +desc = "活动详情" +[method.req] +field = [ + "int64 id //活动gid", + "string hash_id //活动hash_id", + "bool not_reward //不需要奖品" +] + +[method.res] +field = [ + "int64 id //活动gid", + "string hash_id //活动hash_id", + "string title //活动标题", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", + "string fission_mark //活动类型玩法标识", + "int64 temp_id //模版id", + "int64 project_id //模版id", + "string cover_url //活动封面图", + "Config config //活动基础配置", + "repeated Share share //选择的社媒", + "repeated KV campaign_data //前端组件位置偏移数据", + "LotteryConfig prize_wheel //大转盘配置(大转盘玩法必传)", + "LotteryConfig slot //老虎机配置(老虎机玩法必传)", + "LotteryConfig blind //盲盒配置(盲盒玩法必传)", + "LotteryConfig grid //九宫格配置(九宫格玩法必传)", + "InviteConfig referral //老带新配置(老带新玩法必传)", + "QuestionAnswer question_answer //趣味问答配置(趣味问答玩法必传)", + "Quiz quiz //有奖竞猜配置(有奖竞猜玩法必传)", + "InviteConfig win //一起赢配置(一起赢玩法必传)", + "int32 t_offset //时间偏移量", + "int64 t_start //展示的开始时间时间戳", + "int64 t_end //展示的结束时间时间戳", + "Target target //活动目标", + "Sign sign //签到配置(签到玩法必传)", + "Dice dice //大富翁配置(大富翁玩法必传)", + "Grow grow //农场配置(农场玩法必传)", + "Ballot ballot //抽签配置(抽签玩法必传)", + "Chop chop //砍一刀配置(砍一刀玩法必传)", + "repeated KV delay_link_data //延迟深度链接自定义键值数据", + "Rewards rewards //站内奖品", + "repeated Reward rewards_web //站外奖品", + "repeated Reward rewards_extra //额外奖品", + "repeated Reward rewards_newcomer //新人奖", + "repeated string lang_marks //支持的语种", + "TargetOption target_option //目标配置选项", + "Cash cash //现金抽奖配置(现金抽奖玩法必传)", + "repeated LongImg long_imgs //长图配置", + "Flip flip //翻牌配置(翻牌玩法必传)", + "Keep keep_dog //养狗(养狗配置必传)", + "Push push //推送配置", + "repeated Child child //关联的子活动", + "WheelStyle wheel_style //转盘自定义样式", + "Gold gold //金币任务配置(金币任务玩法必传)", + "int64 fission_id //玩法id", + "Coin coin //金币池配置(金币池玩法必传)", + "GridStyle grid_style //九宫格自定义样式", + "FlipStyle flip_style //翻牌自定义样式", + "PointsUse points_use //积分消耗", + "Chat chat //ai陪伴", + "Vs vs //赛事竞猜配置(赛事竞猜玩法必传)", + "Uno uno //uno卡牌配置(uno卡牌玩法必传)", + "Event event //事件配置(活动事件)", + "LotteryConfig gashapon //扭蛋机配置(扭蛋机玩法必传)", + "GashaponStyle gashapon_style //扭蛋机自定义样式", +] + +[[method.res.message]] +name = "GashaponStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string machine_img //机器图", + "string play_img //Go按钮图", + "int32 egg_type //类型", + "repeated string egg_imgs //扭蛋素材", +] + +[[method.res.message]] +name = "Event" +field = [ + "EventOne first_visit //首次访问", +] +[[method.res.message]] +name = "EventOne" +field = [ + "int32 open //是否开启", + "repeated EventReward rewards //奖励" +] +[[method.res.message]] +name = "EventReward" +field = [ + "int64 id //id", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "Reward reward //奖品", + "int32 chance //道具数量", + "string expired_day //过期天数", +] + +[[method.res.message]] +name = "Uno" +field = [ + "int32 init_chance //初始抽奖次数", + "repeated string prop_marks //道具类型(three - +3道具牌,five - +5道具牌,fix - 固定颜色道具牌)", + "UnoGroup red //红牌配置", + "UnoGroup yellow //黄牌配置", + "UnoGroup blue //黑牌配置", + "UnoGroup green //绿牌配置", +] +[[method.res.message]] +name = "UnoGroup" +field = [ + "int64 id //牌型id", + "string odds //获得牌型概率", + "Reward reward //奖品", + "int32 open_rule //是否开启得牌规则(0-否,1-是)", + "UnoLimitRule limit_rule //得牌规则", + "int32 custom_card //自定义卡牌(0-否,1-是)", + "repeated UnoCard cards //自定义卡牌", +] +[[method.res.message]] +name = "UnoLimitRule" +field = [ + "int32 init_num //初始的最大可获得牌型数", + "int32 sign_day //签到天数", + "int32 add_num //完成条件可获得最大牌型数", + "int32 reset_type //重置规则(1-不重置,2-获奖后重置)", +] +[[method.res.message]] +name = "UnoCard" +field = [ + "int64 id //牌id", + "string title //跳转按钮文案", + "string img_url //图片地址", + "string web_url //Web跳转地址", + "string app_param //App跳转参数", + "string pc_param //pc跳转参数", + "int32 card_no //牌号", +] + +[[method.res.message]] +name = "Vs" +field = [ + "int32 init_chance //初始投票次数", + "int32 each_limit_num //每场可投票次数", + "int32 open_point //是否开启积分(0-否,1-是)", + "int32 points_num //投票扣除积分数", + "int32 mall_open //是否使用积分商城(0-否,1-是)", + "int64 mall_id //兑换商城id", + "int32 vs_tz //比赛时区", + "int32 claim_type //领奖方式(1-结算后自动发奖,2-结算后进入活动后发奖,3-结算后手动领奖)", + "repeated Schedule schedules //赛事时间表", + "string icon_mall //商城图标", + "string icon_reward //奖励记录图标", + "string icon_schedule //赛程图标", +] +[[method.res.message]] +name = "Schedule" +field = [ + "int32 id //id", + "repeated PkTeam pk_teams //队伍", +] +[[method.res.message]] +name = "PkTeam" +field = [ + "int64 id //赛程id", + "repeated Team teams //队伍", + "int64 vote_start //开始时间", + "int64 vote_end //结束时间", + "int64 vs_at //比赛开始时间", + "string vs_img //比赛图", + "string desc //标题描述", + "string prop_mark //奖励的道具类型(reward-奖品,point-积分)", + "int64 reward_id //奖品库奖品id", + "int32 prop_num //道具数量", + "string expired_day //过期天数", + "int32 is_settlement //是否结算(0-否,1-是)", + "repeated string other_vote //其他投票方式", + "int32 open_odds //是否开启赔率(0-否,1-是)", + "string odds_left //左边赔率", + "string odds_right //右边赔率", + "string odds_draw //平局赔率", + "int32 status //投票状态(1-即将投票,2-投票中,3-待结算,4-已结算)", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method.res.message]] +name = "Chat" +field = [ + "int32 open //开启ai陪伴(0-关闭,1-开启)", + "string header_img //宠物头像", + "string chat_bg //聊天背景", + "int32 day_limit //每日聊天上限", +] + +[[method.res.message]] +name = "PointsUse" +field = [ + "int32 open //是否开启积分消耗(0-否,1-是)", + "string icon //积分icon图", + "int64 url_id //回调地址id", + "int32 use_num //单次兑换使用积分数量", + "int32 day_limit //每日可兑换次数", + "int32 total_limit //总兑换次数", +] + +[[method.res.message]] +name = "FlipStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string button_color //按钮颜色", + "string play_img //Go按钮图", + "string card_img //卡片素材", +] + +[[method.res.message]] +name = "GridStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string button_color //按钮颜色", + "string play_img //Go按钮图", + "string disable_play_img //Go按钮禁用", + "string machine_img //机器图", + "string grid_img //方格图", + "string activate_img //方格激活图", +] + +[[method.res.message]] +name = "WheelStyle" +field = [ + "string topic_mark //主题标识", + "string main_img //活动背景图", + "string bg_color //背景颜色", + "string bottom1 //底部颜色1", + "string bottom2 //底部颜色2", + "string bottom3 //底部颜色3", + "string pointer //指针图片", + "string play_btn //玩法按钮图片", + "string border_img //边框图片", + "string button_color //按钮颜色", + "string wheel_text_color //转盘文字颜色", +] + +[[method.res.message]] +name = "Child" +field = [ + "string hash_id //活动hash_id", + "int32 child_type //子活动类型", +] + +[[method.res.message]] +name = "Share" +field = [ + "int64 id //活动ID", + "string title //标题", + "string logo //图标", + "string scheme //Scheme", + "string ios_scheme //ios Scheme", +] + +[[method.res.message]] +name = "Config" +field = [ + "string rule_text_color //规则文字颜色", + "string rule_bg_color //规则背景颜色", + "string share_text //分享文案", + "string share_img //分享图片", + "int32 has_rank //是否展示中奖纪录(1-是,0-否)", + "string rank_background_color //排行榜背景颜色", + "string rank_text_color //排行榜背景颜色", + "string download_page_image //下载引导页的图片", + "int32 is_default_download //是否使用默认下载图(1-是,0-否)", + "string wechat_page_image //微信引导页的图片", + "int32 is_default_wechat //是否使用默认微信引导图(1-是,0-否)", + "string image_main //活动主图", + "int32 is_default_main //是否使用默认活动主图(1-是,0-否)", + "string image_preview //问题页背景图", + "string link_btn_text_color //分享链接按钮文字颜色", + "string link_btn_bg_color //分享链接按钮背景颜色", + "string link_text_color //分享链接文字颜色", + "int32 show_share //是否显示分享社交媒体(0-否,1-是)", + "repeated int64 share //要分享的社交媒体,例如[1,2,3]", + "string play_rule //玩法规则", + "string page_title //页面标题", + "int32 dm_show //是否显示弹幕(0-否,1-是)", + "string web_bg_img //站外活动背景图", + "int32 has_web //是否有站外活动(0-否,1-是)", + "int32 has_warm_up //是否预热(0-否,1-是)", + "string warm_up_img //预热海报图", + "int32 warm_up_end //活动开始前多少分钟结束预热", + "int32 icon_type //活动挂件类型(用于前端挂件选用判断)", + "string icon_bg_color //活动挂件背景色", + "int32 dl_type //下载引导页类型(1-通用,2-自定义多媒体)", + "int32 dl_banner_type //下载页横幅类型(1-默认,2-自定义)", + "string dl_banner_img //下载页横幅自定义图", + "string dl_banner_app_logo //下载页横幅applogo图片", + "string dl_banner_app_name //下载页横幅app名称", + "string dl_banner_app_btn //下载页横幅app按钮文案", + "int32 dl_banner_position //下载页横幅位置(1-顶部,2-底部)", + "string topic_color //主题色", + "int32 window_cover //是否全屏展示(0-否,1-是)", + "int32 open_ad //是否开启广告(0-否,1-是)", + "int32 close_copy_share //关闭复制分享文案(0-否,1-是)", + "repeated int32 icon_open //开启的挂件(1-奖品列表,2-邀请记录,3-奖励记录,4-邀请好友),例如[1,3]", + "int32 has_white //是否开启白名单(0-否,1-是)", + "string white_list //白名单列表(多个用英文;分割)", + "string pc_bg //pc适配背景图", + "int32 ads_type //广告状态(0-不启用广告,1-跟随项目配置,2-活动开启)", + "string link_temp_id //链接模板id", + "int32 rule_time_open //是否展示规则中的活动时间(0-否,1-是)", + "int32 outside_task //是否外显任务(0-否,1-是)", + "string icon_text_color //活动挂件字体色", + "int32 open_share //是否启用分享模块(0-否,1-是)", + "int32 show_to_use //是否展示奖品弹窗的去使用(0-不展示,1-展示)", + "int32 rule_type //规则展示类型(0-文本,1-图片)", + "string rule_img //规则展示图", + "int32 rule_outside //规则是否外显(0-否,1-是)", + "int32 device_once //设备唯一(0-否,1-是)", +] + +[[method.res.message]] +name = "LongImg" +field = [ + "string img_url //图片地址", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 id //长图id", + "int32 click_type //点击类型(1-整图点击,2-区域点击)", + "repeated HotZone hot_zone //点击区域", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string target_url // 目标地址", + "string pc_param //pc端的跳转参数", +] + +[[method.res.message]] +name = "HotZone" +field = [ + "int64 id //热区id", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "double click_x //点击区域x", + "double click_y //点击区域y", + "double click_w //点击区域w", + "double click_h //点击区域h", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string target_url // 目标地址", + "string pc_param //pc端的跳转参数", +] + +[[method.res.message]] +name = "Target" +field = [ + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "int32 option //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标)", + "int32 app_event //目标选择类型为1(option=1)的选项(1-安装;2-注册)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", + "NormalData normal_data //通用事件的数据", +] + +[[method.res.message]] +name = "Cond" +field = [ + "int64 id //条件id", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "string desc //条件描述", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "repeated string lang_marks //限制的语言集合", + "int32 watch_sec //观看秒数", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "string ads_strategy_title //策略标题", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置条件(0-否,1-是)", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", + "int32 expired_min //过期分钟数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "int32 sort //排序", + "int32 open_push //是否开启完成推送(0-否,1-是)", + "string pc_param //pc端附加参数", + "int32 award_mode //领奖模式(1-自动领奖,2-手动领奖)", + "string go_text //去完成文案", + "int32 click_effect_open //是否开启点击有效(0-否,1-是)", + "int32 click_effect //点击有效值", + "string click_effect_unit //点击有效单位(min-分钟,hour-小时,day-天)", + "string expired_day //过期天数", + "int32 pull_invite //是否拉起邀请(0-否,1-是)", +] + +[[method.res.message]] +name = "BothAll" +field = [ + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "repeated string lang_marks //限制的语言集合", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "string expired_day //过期天数", +] + +[[method.res.message]] +name = "NormalData" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", +] + +[[method.res.message]] +name = "TargetOption" +field = [ + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "Fixed fixed //固定事件", + "Custom custom //自定义事件", + "int32 option //标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗;5-用户指定事件达标)", +] + +[[method.res.message]] +name = "Fixed" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 app_event //固定事件类型(1-安装;2-注册)", + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", + "double percent //百分比值(如:获得的能量点)", +] + +[[method.res.message]] +name = "Custom" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", + "int32 pre_event //自定义事件前置事件(0-任意事件;1-安装;2-注册)", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method.res.message]] +name = "WebReward" +field = [ + "int64 id //奖品id", + "string title //奖品名称", + "string img_url //奖品图片(相对路径)", + "repeated KV kv_data //奖品自定义参数数据", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "int64 reward_id //奖品库的奖品id", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "repeated KV kv_data //奖品自定义参数数据", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-提交表单)", + "string contact //联系方式", + "string url //回调地址", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "string lang_mark //奖品语言标识", + "int32 odds //中奖率", + "string jump_url //跳转地址", + "string form_title //表单标题", + "int32 campaign_limit //活动内单个用户可获取该奖品次数", + "int32 register //开启注册助力(0-否,1-是)", + "double register_percent //每个注册获得的进度比率", + "double init_percent //初始助力进度", + "CollectRule collect_rule //收集规则", + "string expired_day //过期天数", + "OpenAdd open_add //库存增加规则", + "RewardTask reward_task //解锁任务", +] + +[[method.res.message]] +name = "RewardTask" +field = [ + "int32 open //是否开启(0-否,1-是)", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 open_push //是否开启完成推送(0-否,1-是)", +] + +[[method.res.message]] +name = "OpenAdd" +field = [ + "int32 open //开启动态库存规则(0-否,1-是)", + "int64 start //开始时间", + "int64 end //结束时间", + "int32 day_num //天数", + "int32 day_add //增加的库存量", +] + +[[method.res.message]] +name = "CollectRule" +field = [ + "int32 open //开启碎片规则(0-否,1-是)", + "int32 init_collect //初始的最大可获得碎片数", + "int32 sign_day //签到天数", + "int32 add_collect //完成条件可获得最大碎片数", + "int32 reset_type //重置碎片规则(1-不重置,2-获奖后重置)", +] + +[[method.res.message]] +name = "Rewards" +field = [ + "int32 reward_group //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品)", + "repeated Reward normal //常规奖品", + "UserLevel user_level //用户类型奖品", + "repeated Lang langs //语言奖品", + "repeated LangUserLevel lang_user_level //语言+用户类型奖品", + "Country country //国家奖品", + +] + +[[method.res.message]] +name = "UserLevel" +field = [ + "int64 default_level_id //默认用户类型id", + "string default_level_title //默认用户类型标题", + "repeated UserLevelOne level_list //用户类型奖品", +] + +[[method.res.message]] +name = "UserLevelOne" +field = [ + "int64 level_id //用户类型id", + "string level_title //用户类型标题", + "repeated Reward rewards //奖品", +] + +[[method.res.message]] +name = "Lang" +field = [ + "int32 lang_type //语言标识数字", + "string lang_mark //语言标识", + "bool default_lang //是否默认语言", + "repeated Reward rewards //奖品", +] + +[[method.res.message]] +name = "LangUserLevel" +field = [ + "string lang_mark //语言标识", + "int32 lang_type //语言标识数字", + "bool default_lang //是否默认语言", + "int64 default_level_id //默认用户类型id", + "string default_level_title //默认用户类型标题", + "repeated UserLevelOne level_list //用户类型奖品", +] + +[[method.res.message]] +name = "Country" +field = [ + "string default_country_mark //默认国家", + "repeated CountryOne country_list //国家的奖品", +] + +[[method.res.message]] +name = "CountryOne" +field = [ + "string country_mark //国家标识", + "repeated Reward rewards //奖品", +] + +[[method.res.message]] +name = "QaQuestion" +field = [ + "int64 id //题目id", + "string title //题目", + "int32 score //得分", + "repeated QaOption options //选项", +] + +[[method.res.message]] +name = "QaOption" +field = [ + "int64 id //答案id", + "string title //答案内容", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[[method.res.message]] +name = "QuizOption" +field = [ + "int64 id //选项id", + "string title //选项标题", + "string img_url //选项图片", + "int32 is_right //是否正确选项(1-是,0-否)", + "int64 vote_num //投票人数", +] + +[[method.res.message]] +name = "Quiz" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 init_chance //初始答题机会次数", + "int32 chance //达标获得的答题机会次数", + "int32 reward_rule //奖励规则(1-投票结果排名,2-自定义竞猜结果)", + "int64 open_prize //开奖时间", + "string title //选择标题", + "int32 open_type //开奖状态(1-未开奖,2-已开奖,3-不开奖)", + "repeated QuizOption options //有奖竞猜选项", + "int64 t_open //偏移对比的开奖北京时间", +] + +[[method.res.message]] +name = "QuestionAnswer" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标条件后可获取的答题次数", + "int32 init_chance //初始答题机会次数", + "int32 question_ask_time //答题时间限制(单位:S,如:1 就是1秒)", + "repeated QaQuestion questions //题目", + "string group_hash_id //题库对外id", + "int32 qa_num //题库选取数量", + "int32 day_chance //每日签到获得的答题数", + "int32 open_guide //是否开启引导(0-否,1-是)", + "string guide_group_hash_id //引导组hash_id", +] + +[[method.res.message]] +name = "LotteryConfig" +field = [ + "int32 target_num //达标条件需要的新用户个数", + "int32 init_chance //初始抽奖机会次数", + "int32 chance //达标获得的抽奖机会次数", + "int32 day_chance //每日获得的抽奖机会次数", +] + +[[method.res.message]] +name = "InviteConfig" +field = [ + "int32 reward_limit //活动总奖励上限", + "int32 reward_rule //用户奖励规则(1-阶梯,2-非阶梯)", + "int32 invite_limit //邀请超过多少人不能再获得奖励", + "int32 newcomer_cond //新人条件(1-新安装,2-助力成功,3-新安装且助力成功)", + "int32 step_loop //阶梯是否支持循环(0-不支持,1-支持)", +] + +[[method.res.message]] +name = "Sign" +field = [ + "int32 sign_type //签到类型(1-普通签到,2-阶梯签到)", + "int32 is_continue //是否连续签到(1-是,0-否)", + "int32 has_card //是否开启签到卡(1-开启,0-不开启)", + "int32 invite_num //邀请好友数可获得的1张签到卡", + "int32 limit_card_num //可获得幸运卡的最大张数", + "int32 is_loop //是否支持循环(0-否,1-是)", + "int32 sign_cycle //签到周期", + "int32 recycle_type //重新签到模式(1-断签重签,2-周期重签)", + "string color //签到主题颜色", +] + +[[method.res.message]] +name = "Dice" +field = [ + "int32 init_chance //初始骰子数", + "int32 day_chance //每日获得的骰子数", + "int32 fix_dice //开启固定骰子(0-不开启,1-开启)", + "int32 fix_dice_target //获得固定骰子需要邀请的人数", + "int32 fix_dice_limit //固定骰子限制获取数", + "string custom_dice //自定义骰子图片", + "int32 open_map_point //开启自定义底座(0-不开启,1-开启)", + "MapPoint map_point //自定义底座数据", + "int32 award_type //奖品碎片收集方式(1-随机收集,2-概率收集)", + "int32 open_invite //开启邀请挂件(0-关闭,1-开启)", + "int32 roll_again //开启再摇一次(0-关闭,1-开启)", + "int32 fix_dice_cond //邀请事件(1-安装,2-注册)", + "int32 odds //概率收集方式的中奖概率", + "string play_img //play按钮图", + "string cloud_img //云朵图", +] +[[method.res.message]] +name = "MapPoint" +field = [ + "string blank //空白底座", + "string again //再摇一次底座", + "string normal //普通奖品底座", + "string supper //超级大奖底座", +] + +[[method.res.message]] +name = "Grow" +field = [ + "int32 auto_hour //自动生产成长道具小时数", + "int32 auto_num //生产的成长道具数", + "int32 grow_num //邀请可获得的成长道具数量", + "int32 target_num //获得成长道具需要邀请的人数", + "int32 revive //是否支持复活(0-否,1-是)", + "int32 revive_num //复活需要邀请的好友数", + "int32 die_hour //未获得成长道具导致的死亡时间", + "repeated GrowStep steps //成长阶段", + "int32 init_num //初始成长道具数量", +] + +[[method.res.message]] +name = "GrowStep" +field = [ + "int64 id //奖品id", + "int32 num //需要的养成道具数量", +] + +[[method.res.message]] +name = "Ballot" +field = [ + "int32 init_chance //初始抽签数", + "int32 day_chance //每日获得的抽签数", +] + +[[method.res.message]] +name = "Chop" +field = [ + "int32 show_bar //是否展示进度条(0-否,1-是)", +] + +[[method.res.message]] +name = "Cash" +field = [ + "int32 expired_day //任务重置天数", + "int32 price //单位奖品总价值", + "int32 price_num //奖品总份额", + "repeated SpinCash spin_cash //金额", + "int32 lack //是否缺乏库存(0-否,1-是)", + "int32 currency //货币id标识", + "int32 loop_num //支持循环次数", +] + +[[method.res.message]] +name = "SpinCash" +field = [ + "int64 id //唯一id", + "double cash //单位奖品总价值", +] + +[[method.res.message]] +name = "Flip" +field = [ + "int32 init_chance //初始抽奖机会次数", + "string card_img //卡牌图片", + "int32 day_chance //每日获得的抽奖机会次数", +] + +[[method.res.message]] +name = "Keep" +field = [ + "int32 collect //获得最终奖品需要的总收集数", + "int32 collect_second //单个收集需要的二级资源数", + "int32 open_invite //开启邀请(0-关闭,1-开启)", + "Invite invite //拉新配置", + "int32 init_get //初始道具数", + "double sec_get //每秒获得道具数", + "int32 feed_num //每次使用道具数", + "int32 feed_cycle //喂养周期(单位:天)", + "int32 max_feed //最大可领养次数", + "int32 feed_get //喂养能得到的道具数", + "int32 feed_get_num //得到喂养道具需要的喂养次数", + "repeated Talk talk_text //对话文案", + "repeated KeepStep steps //养成阶梯", + "double sec_get_day_limit //每秒获得道具每日上限", + "int32 machine_type //狗粮机类型(1-在线收益,2-离线收益)", + "int32 offline_min //离线分钟时长", + "int32 offline_get //离线收益最大值", + "int32 offline_limit //离线收益最大领取次数", +] +[[method.res.message]] +name = "Invite" +field = [ + "int32 invite_type //邀请类型(1-下载,2-安装)", + "int32 invite_get //邀请可获得的道具数量", + "int32 reward_selected //选择礼品可获得的道具数", + "int32 feed_third //喂养3次可获得的道具数", + "int32 day_first_invite //是否开启每日首次拉新(0-否,1-是)", + "int32 day_first_get //每日首次拉新可获得的道具数", + "int32 day_first_selected //每日首日选择礼物可获得的道具数", + "int32 day_first_third //每日首次喂养三次可获得的道具数", + "int32 invite_max_get //邀请人可获得的最大道具数", +] +[[method.res.message]] +name = "Talk" +field = [ + "int32 text_type //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时)", + "string content //内容", +] +[[method.res.message]] +name = "KeepStep" +field = [ + "int32 step //阶段", + "int32 percent //对应的进度条数值", + "int32 reward_type //奖品类型(1-成长道具,2-奖品)", + "Reward reward //奖品数据时", + "int32 reward_num //发放道具数量", +] +[[method.res.message]] +name = "Push" +field = [ + "PushOne task_reset // 重制提醒", + "PushOne active //活跃提醒", + "PushOne offline //离线提醒", + "PushOne visit //访问提醒", +] +[[method.res.message]] +name = "PushOne" +field = [ + "int32 open //是否开启", + "repeated PushCond push_cond //条件内容" +] +[[method.res.message]] +name = "PushCond" +field = [ + "string mark //条件标识", + "string val // 标识值 " +] + +[[method.res.message]] +name = "Gold" +field = [ + "int32 gold_num //任务重置天数", + "int32 expired_day //任务重置天数", + "double price //单位奖品总价值", + "int32 price_num //奖品总份额", + "int32 currency //货币id标识", + "repeated SpinCash spin_cash //金额", + "int32 lack //是否缺乏库存(0-否,1-是)", +] + +[[method.res.message]] +name = "Coin" +field = [ + "string coin_img //金币图片", + "int32 open_days //开奖天数", + "int32 open_limit //开奖次数限制", + "int32 init_coin //初始金币数", + "int32 init_use //初始投放次数", + "int32 use_coin //单次投放消耗金币数", + "int32 use_limit //单次瓜分最多投放次数", + "int64 url_id //回调地址id", + "repeated int32 lack_btn //金币不足展示的按钮(1-做任务,2-自定义按钮)[1,2]", + "string custom_btn_text //自定义按钮文案", + "string custom_web_url //自定义web端url", + "string custom_extra_param //自定义app附加参数", + "int64 custom_btn_id //自定义按钮ID", + "string custom_pc_param //自定义pc附加参数", +] + +[[method]] +name = "ChannelList" +desc = "渠道列表" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string campaign_hash_id //活动对外id", +] +[method.res] +field = [ + "repeated One list //站内渠道列表数据", + "repeated One web_list //站外渠道列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //渠道id", + "string title //渠道标题", + "int32 is_default //是否是默认值(0-否,1-是)", + "string url //渠道链接", + "string code //口令码", +] + +[[method]] +name = "ChannelCreate" +desc = "渠道创建" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string campaign_hash_id //活动对外id", + "string title //渠道名称", + "int32 c_type //渠道类型(1-站内渠道,2-站外渠道)", +] +[method.res] +field = [ + "int64 id //渠道id", + "string url //渠道链接", +] + +[[method]] +name = "ChannelUpdate" +desc = "渠道创建" +[method.req] +field = [ + "int64 id //渠道id", + "string title //渠道名称" +] +[method.res] + +[[method]] +name = "ChannelDestroy" +desc = "渠道创建" +[method.req] +field = [ + "int64 id //渠道id", +] +[method.res] + +[[method]] +name = "KvData" +desc = "获取活动键值对" +[method.req] +field = [ + "int64 id //活动id", +] +[method.res] +field = [ + "repeated KV kv //活动键值对" +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method]] +name = "Cert" +desc = "认证活动信息" +[method.req] +field = [ + "int64 id //活动id", + "string hash_id //活动", + "int64 project_id //项目id", + "string project_hash_id //项目hash_id", +] +[method.res] +field = [ + "bool cert //认证失败", + "int64 id //活动id", + "string hash_id //活动", + "int64 project_id //项目id", + "string project_hash_id //项目hash_id", + "string title //活动标题", +] + +[[method]] +name = "Barrage" +desc = "活动弹幕" +[method.req] +field = [ + "int64 id //活动id", + "string hash_id //活动", + "string lang_mark //语种标识", + "string lv //用户等级标识", + "string show_lang //展示的语种", + "string country_mark //国家标识", + "int64 user_id //用户id", +] +[method.res] +field = [ + "repeated string content //内容", + "repeated TranContent tran_content //内容", +] + +[[method.res.message]] +name = "TranContent" +field = [ + "string mark //语言包标识", + "repeated KV replace_kv //是否是默认值(0-否,1-是)", + "string reward_img //奖品图片", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //语言包中变量的替换关键字", + "string value //replace的值", +] + +[[method]] +name = "Option" +desc = "投票选项" +[method.req] +field = [ + "int64 id //活动id", + "string hash_id //活动", +] +[method.res] +field = [ + "repeated Option options //内容", + "int64 right_id //开奖后正确选项,只有开奖后才有数据" +] + +[[method.res.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //选项标题", + "string img_url //选项图片", + "int32 is_right //是否正确选项(1-是,0-否)", + "int64 vote_num //投票人数", +] + +[[method]] +name = "RelateDdl" +desc = "活动关联动态下载页" +[method.req] +field = [ + "string hash_id //活动hash_id", + "string project_hash_id //项目hash_id", + "bool close //是否关闭", +] +[method.res] + + +[[method]] +name = "DdlCampaign" +desc = "关联动态下载页的活动" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] +[method.res] +field = [ + "string hash_id //活动对外id", + "string title //活动标题", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", +] + + +[[method]] +name = "Langs" +desc = "活动多语言配置信息" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] +[method.res] +field = [ + "bool has_web //是否开启站外", + "bool has_warn //是否开启预热", + "int32 dl_type //下载引导页类型(1-通用,2-自定义多媒体)", + "int32 dl_banner_type //下载页横幅类型(1-默认,2-自定义)", + "int32 window_cover //是否开启全屏封面(0-关闭,1-开启)", + "int32 reward_group //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品)", + "repeated Lang langs //语言列表", + "repeated Lang not_support //不支持的语言列表", + "string fission_mark //玩法标识", + "string temp_group_mark //模版组标识", + "bool has_long_img //是否开启长图", + "int32 rule_type //规则展示类型(0-文本,1-图片)", + "string title //活动标题", + "string fission_mark_title //玩法标识说明", +] + +[[method.res.message]] +name = "Lang" +field = [ + "string hash_id //语言配置信息ID", + "bool is_default //是否默认配置语言", + "string lang_mark //语言对应的唯一标识", + "int32 lang_type //语言数字类型唯一标识", + "string page_title //页面标题", + "string image_main //活动主图", + "string download_page_image //下载引导页的图片", + "string wechat_page_image //微信引导页的图片", + "string content_img //内容背景图", + "string web_bg_img //站外背景图地址", + "string warm_up_img //预热海报图", + "string dl_bg_img //引导页背景图", + "string dl_banner_img //下载页横幅自定义图", + "string dl_banner_app_logo //下载页横幅applogo图片", + "string dl_banner_app_name //下载页横幅app名称", + "string dl_banner_app_btn //下载页横幅app按钮文案", + "string share_text //分享文案", + "string share_img //分享图片", + "string rule //活动规则", + "repeated Cond conds //事件驱动的条件描述", + "Quit quit //赛事竞猜选项翻译", + "repeated Question questions //问题翻译", + "bool wait //是否待配置", + "Rewards rewards //站内奖品", + "repeated Reward rewards_web //站外奖品", + "repeated Reward rewards_extra //额外奖品", + "repeated Reward rewards_newcomer //新人奖", + "repeated LongImg long_imgs //长图配置", + "Cash cash //现金抽奖配置", + "int32 t_offset //时区偏移值", + "int64 t_start //开始时间", + "int64 t_end //结束时间", + "QaGroup qa_group //题库数据", + "repeated Talk talk_text //对话文案", + "Gold gold //金币任务配置", + "Coin coin //金币池配置", + "string topic_color //主题色", + "string pc_bg //pc背景", + "string rule_img //规则展示图", + "repeated Schedule schedules //赛事时间表", + "Uno uno //uno卡牌配置", +] + +[[method.res.message]] +name = "Uno" +field = [ + "repeated UnoCard red //红牌配置", + "repeated UnoCard yellow //黄牌配置", + "repeated UnoCard blue //黑牌配置", + "repeated UnoCard green //绿牌配置", +] +[[method.res.message]] +name = "UnoCard" +field = [ + "int64 id //牌id", + "string title //跳转按钮文案", + "string img_url //图片地址", + "string web_url //Web跳转地址", + "string app_param //App跳转参数", + "string pc_param //pc跳转参数", +] + +[[method.res.message]] +name = "Schedule" +field = [ + "int32 id //id", + "repeated PkTeam pk_teams //队伍", +] +[[method.res.message]] +name = "PkTeam" +field = [ + "int64 id //赛程id", + "repeated Team teams //队伍", + "string vs_img //比赛图", + "string desc //标题描述", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method.res.message]] +name = "QaGroup" +field = [ + "string qa_group_id //题库hash_id", + "int32 qa_num //题库选取数量", + "string title //题库标题", + "int32 open_guide //是否开启引导(0-否,1-是)", + "string guide_group_id //引导组hash_id", +] + +[[method.res.message]] +name = "Talk" +field = [ + "int32 text_type //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时)", + "string content //内容", +] + +[[method.res.message]] +name = "Cash" +field = [ + "int32 price //单位奖品总价值", + "int32 currency //货币id标识", +] + +[[method.res.message]] +name = "Gold" +field = [ + "double price //单位奖品总价值", + "int32 currency //货币id标识", +] + +[[method.res.message]] +name = "Coin" +field = [ + "string custom_btn_text //自定义按钮文案", + "string custom_web_url //自定义web端url", + "string custom_extra_param //自定义app附加参数", + "string custom_pc_param //自定义pc附加参数", +] + +[[method.res.message]] +name = "LongImg" +field = [ + "string img_url //图片地址", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 id //长图id", + "int32 click_type //点击类型(1-整图点击,2-区域点击)", + "repeated HotZone hot_zone //点击区域", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", + "int64 lang_source_id //语言长图源ID", +] + +[[method.res.message]] +name = "HotZone" +field = [ + "int64 id //热区id", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "double click_x //点击区域x", + "double click_y //点击区域y", + "double click_w //点击区域w", + "double click_h //点击区域h", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", +] + +[[method.res.message]] +name = "Rewards" +field = [ + "repeated Reward normal //常规奖品", + "repeated UserLevelOne user_level //用户类型奖品", + "repeated Reward langs //语言奖品", + "repeated UserLevelOne lang_user_level //语言+用户类型奖品", + "repeated CountryOne country //国家奖品", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 reward_id //奖品库奖品id", + "string title //奖品名称", + "string img_url //奖品图片", + "bool find_default //是否只能显示默认奖品", +] + +[[method.res.message]] +name = "UserLevelOne" +field = [ + "int64 level_id //用户类型id", + "string level_title //用户等级名称", + "repeated Reward rewards //奖品", +] + +[[method.res.message]] +name = "CountryOne" +field = [ + "string country_mark//国家类型标识", + "repeated Reward rewards //奖品", +] + +[[method.res.message]] +name = "Quit" +field = [ + "string title //标题", + "repeated Option options //选项集合", +] +[[method.res.message]] +name = "Option" +field = [ + "int64 option_id //选项id", + "string title //选项标题", + "string img_url //选项图片", +] +[[method.res.message]] +name = "Question" +field = [ + "int64 qa_id //问题id", + "string title //题目", + "repeated Option options //选项集合", +] +[[method.res.message]] +name = "Cond" +field = [ + "int64 cond_id //条件id", + "string desc //对应的语言描述", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "string pc_param //pc端附加参数", + "string go_text //去完成文案", +] + +[[method]] +name = "Lang" +desc = "活动语言信息" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string lang_mark //语言对应的唯一标识", +] +[method.res] +field = [ + "string hash_id //语言配置信息ID", + "string page_title //页面标题", + "string image_main //活动主图", + "string download_page_image //下载引导页的图片", + "string wechat_page_image //微信引导页的图片", + "string content_img //内容背景图", + "string web_bg_img //站外背景图地址", + "string warm_up_img //预热海报图", + "string dl_bg_img //引导页背景图", + "string dl_banner_img //下载页横幅自定义图", + "string dl_banner_app_logo //下载页横幅applogo图片", + "string dl_banner_app_name //下载页横幅app名称", + "string dl_banner_app_btn //下载页横幅app按钮文案", + "string share_text //分享文案", + "string share_img //分享图片", + "string rule //活动规则", + "repeated Cond conds //事件驱动的条件描述", + "Quit quit //赛事竞猜选项翻译", + "repeated Question questions //问题翻译", + "repeated LongImg long_imgs //长图配置", + "Cash cash //现金抽奖配置", + "int32 t_offset //时区偏移值", + "QaGroup qa_group //题库数据", + "repeated Talk talk_text //对话文案", + "Gold gold //金币任务配置", + "Coin coin //金币池配置", + "string topic_color //主题色", + "string pc_bg //pc背景", + "string rule_img //规则展示图", + "repeated Schedule schedules //赛事时间表", + "Uno uno //uno卡牌配置", +] + +[[method.res.message]] +name = "Uno" +field = [ + "repeated UnoCard red //红牌配置", + "repeated UnoCard yellow //黄牌配置", + "repeated UnoCard blue //黑牌配置", + "repeated UnoCard green //绿牌配置", +] +[[method.res.message]] +name = "UnoCard" +field = [ + "int32 card_no //牌号", + "string title //跳转按钮文案", + "string img_url //图片地址", + "string web_url //Web跳转地址", + "string app_param //App跳转参数", + "string pc_param //pc跳转参数", +] + +[[method.res.message]] +name = "Schedule" +field = [ + "int32 id //id", + "repeated PkTeam pk_teams //队伍", +] +[[method.res.message]] +name = "PkTeam" +field = [ + "int64 id //赛程id", + "repeated Team teams //队伍", + "string vs_img //比赛图", + "string desc //标题描述", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method.res.message]] +name = "Talk" +field = [ + "int32 text_type //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时)", + "string content //内容", +] + +[[method.res.message]] +name = "QaGroup" +field = [ + "string qa_group_id //题库hash_id", + "int32 qa_num //题库选取数量", + "string title //题库标题", + "string guide_group_id //引导组hash_id", +] +[[method.res.message]] +name = "Quit" +field = [ + "string title //标题", + "repeated Option options //选项集合", +] +[[method.res.message]] +name = "Option" +field = [ + "int64 option_id //选项id", + "string title //选项标题", + "string img_url //选项图片", +] +[[method.res.message]] +name = "Question" +field = [ + "int64 qa_id //问题id", + "string title //题目", + "repeated Option options //选项集合", +] +[[method.res.message]] +name = "Cond" +field = [ + "int64 cond_id //条件id", + "string desc //对应的语言描述", + "string web_url //web端url长度", + "string extra_param //附加参数", + "string pc_param //pc端附加参数", + "string go_text //去完成文案", +] +[[method.res.message]] +name = "LongImg" +field = [ + "string img_url //图片地址", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 id //长图id", + "int32 click_type //点击类型(1-整图点击,2-区域点击)", + "repeated HotZone hot_zone //点击区域", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string target_url // 目标地址", + "string pc_param //pc端的跳转参数", +] + +[[method.res.message]] +name = "HotZone" +field = [ + "int64 id //热区id", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "double click_x //点击区域x", + "double click_y //点击区域y", + "double click_w //点击区域w", + "double click_h //点击区域h", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string target_url // 目标地址", + "string pc_param //pc端的跳转参数", +] +[[method.res.message]] +name = "Cash" +field = [ + "int32 price //单位奖品总价值", + "int32 currency //货币id标识", +] + +[[method.res.message]] +name = "Gold" +field = [ + "double price //单位奖品总价值", + "int32 currency //货币id标识", +] + +[[method.res.message]] +name = "Coin" +field = [ + "string custom_btn_text //自定义按钮文案", + "string custom_web_url //自定义web端url", + "string custom_extra_param //自定义app附加参数", + "string custom_pc_param //自定义pc附加参数", +] + +[[method]] +name = "SaveLang" +desc = "保存活动多语言配置信息" +[method.req] +field = [ + "bool to_view //是否需要去预览页", + "string campaign_hash_id //活动hash_id", + "string lang_mark //语言对应的唯一标识", + "string page_title //页面标题", + "string image_main //活动主图", + "string download_page_image //下载引导页的图片", + "string wechat_page_image //微信引导页的图片", + "string content_img //内容背景图", + "string web_bg_img //站外背景图地址", + "string warm_up_img //预热海报图", + "string dl_bg_img //引导页背景图", + "string dl_banner_img //下载页横幅自定义图", + "string dl_banner_app_logo //下载页横幅applogo图片", + "string dl_banner_app_name //下载页横幅app名称", + "string dl_banner_app_btn //下载页横幅app按钮文案", + "string share_text //分享文案", + "string share_img //分享图片", + "string rule //活动规则", + "repeated Cond conds //事件驱动的条件描述", + "Quit quit //赛事竞猜选项翻译", + "repeated Question questions //问题翻译", + "repeated LongImg long_imgs //长图配置", + "Cash cash //现金抽奖配置", + "int32 t_offset //时区偏移值", + "QaGroup qa_group //题库数据", + "repeated Talk talk_text //对话文案", + "Gold gold //金币任务配置", + "Coin coin //金币池配置", + "string topic_color //主题色", + "string pc_bg //pc背景", + "string rule_img //规则展示图", + "repeated Schedule schedules //赛事时间表", + "Uno uno //uno卡牌配置", +] + +[[method.req.message]] +name = "Uno" +field = [ + "repeated UnoCard red //红牌配置", + "repeated UnoCard yellow //黄牌配置", + "repeated UnoCard blue //黑牌配置", + "repeated UnoCard green //绿牌配置", +] +[[method.req.message]] +name = "UnoCard" +field = [ + "int32 card_no //牌号", + "string title //跳转按钮文案", + "string img_url //图片地址", + "string web_url //Web跳转地址", + "string app_param //App跳转参数", + "string pc_param //pc跳转参数", +] + +[[method.req.message]] +name = "Schedule" +field = [ + "int32 id //id", + "repeated PkTeam pk_teams //队伍", +] +[[method.req.message]] +name = "PkTeam" +field = [ + "int64 id //赛程id", + "repeated Team teams //队伍", + "string vs_img //比赛图", + "string desc //标题描述", +] +[[method.req.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method.req.message]] +name = "Talk" +field = [ + "int32 text_type //话术逻辑(1-进入活动时,2-20秒没有投喂时,3-50秒没有投喂时,4-存储的狗粮能投喂5次时)", + "string content //内容", +] + +[[method.req.message]] +name = "QaGroup" +field = [ + "string qa_group_id //题库hash_id", + "int32 qa_num //题库选取数量", + "string guide_group_id //引导组hash_id", +] + +[[method.req.message]] +name = "Cash" +field = [ + "int32 price //单位奖品总价值", + "int32 currency //货币id标识", +] + +[[method.req.message]] +name = "Gold" +field = [ + "double price //单位奖品总价值", + "int32 currency //货币id标识", +] + +[[method.req.message]] +name = "Coin" +field = [ + "string custom_btn_text //自定义按钮文案", + "string custom_web_url //自定义web端url", + "string custom_extra_param //自定义app附加参数", + "string custom_pc_param //自定义pc附加参数", +] + +[[method.req.message]] +name = "Quit" +field = [ + "string title //标题", + "repeated Option options //选项集合", +] +[[method.req.message]] +name = "Option" +field = [ + "int64 option_id //选项id", + "string title //选项标题", + "string img_url //选项图片", +] +[[method.req.message]] +name = "Question" +field = [ + "int64 qa_id //问题id", + "string title //题目", + "repeated Option options //选项集合", +] + +[[method.req.message]] +name = "Cond" +field = [ + "int64 cond_id //条件id", + "string desc //对应的语言描述", + "string web_url //web端url长度", + "string extra_param //附加参数", + "string pc_param //pc端附加参数", + "string go_text //去完成文案", +] + +[[method.req.message]] +name = "LongImg" +field = [ + "string img_url //图片地址", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 id //长图id", + "int32 click_type //点击类型(1-整图点击,2-区域点击)", + "repeated HotZone hot_zone //点击区域", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", + "int64 lang_source_id //语言长图源ID", +] + +[[method.req.message]] +name = "HotZone" +field = [ + "int64 id //热区id", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "double click_x //点击区域x", + "double click_y //点击区域y", + "double click_w //点击区域w", + "double click_h //点击区域h", + "int32 target_type //跳转目标(1-指定地址,2-活动)", + "int64 target_id // 目标id", + "string pc_param //pc端的跳转参数", +] + +[method.res] +field = [ + "string view_link //预览地址", +] + + +[[method]] +name = "DestroyLang" +desc = "删除活动语言配置信息" +[method.req] +field = [ + "string hash_id //语言配置信息ID", +] + +[method.res] +field = [ +] + + +[[method]] +name = "LangSelect" +desc = "活动语言选择" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "repeated One list //选择", +] + +[[method.res.message]] +name = "One" +field = [ + "int32 lang_type //语言数字类型", + "string lang_mark //语言iso标准", + "bool selected //是否已经被使用", +] + +[[method]] +name = "CampaignInfo" +desc = "活动信息" +[method.req] +field = [ + "int64 project_id //项目id", + "string campaign_hash_id //活动hash_id", + "int64 campaign_id //活动id", + "string lang //语言标识", +] + +[method.res] +field = [ + "int64 id //活动ID", + "string hash_id //活动对外id", + "string title //活动标题", + "string page_title //页面标题", + "string fission_mark //玩法标识", + "string fission_title //活动类型说明", + "int64 start_time //提交的开始时间(+8时区算出来的时间戳)", + "int64 end_time //提交的结束时间(+8时区算出来的时间戳)", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", + "int32 t_offset //时间偏移量", + "repeated string lang_types //支持的语种", + "string share_img //分享图片", + "string link //活动地址", + "string img_host //图片全球地址", + "string pc_bg //pc适配背景", + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告)", + "int64 start_at //开始时间戳", + "int64 end_at //结束时间戳", + "int64 project_id //项目id", +] + +[[method]] +name = "ShowReward" +desc = "显示的奖品数据" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string lang_mark //语言标识", + "string level_mark //用户标识", + "string show_lang //奖品展示的语言标识", + "string country_mark //国家标识", +] + +[method.res] +field = [ + "repeated Reward rewards //站内奖品", + "repeated Reward rewards_web //站外奖品", + "repeated Reward rewards_extra //额外奖品", + "repeated Reward rewards_newcomer //新人奖", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //奖品id", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "int32 receive_type //发放类型(1-系统发放,2-联系客服)", + "repeated KV kv_data //键值数据", + "string contact //联系方式", + "string url //回调地址", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "string jump_url //跳转地址", + "int64 reward_id //奖品库奖品id", + "int32 register //开启下载助力(0-否,1-是)", + "double register_percent //每个下载获得的进度比率", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method]] +name = "AdsStore" +desc = "创建Ads活动" +[method.req] +field = [ + "string template_id //玩法模板ID", + "string project_id //项目ID", + "string title //活动标题", + "string page_title //页面标题", + "string bg_img //活动背景图", + "repeated KV delay_link_data //延迟深度链接自定义参数", + "repeated Reward rewards //奖品", + "int64 user_id //创建人id", + "int32 countdown //倒计时", + "Flip flip //翻牌配置(翻牌玩法必传)", +] + +[[method.req.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method.req.message]] +name = "Reward" +field = [ + "int64 reward_id //奖品库的奖品id", + "int32 odds //中奖率", +] + +[[method.req.message]] +name = "Flip" +field = [ + "string card_img //卡牌图片", +] + +[method.res] +field = [ + "int64 id //活动id", + "string hash_id //活动hash_id", +] + +[[method]] +name = "AdsUpdate" +desc = "更新Ads活动" +[method.req] +field = [ + "string hash_id //活动hash_id", + "string title //活动标题", + "string page_title //页面标题", + "string bg_img //活动背景图", + "repeated KV delay_link_data //延迟深度链接自定义参数", + "repeated Reward rewards //奖品", + "int32 countdown //倒计时", + "Flip flip //翻牌配置(翻牌玩法必传)", +] + +[[method.req.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method.req.message]] +name = "Reward" +field = [ + "int64 id //奖品id", + "int64 reward_id //奖品库的奖品id", + "int32 odds //中奖率", +] + +[[method.req.message]] +name = "Flip" +field = [ + "string card_img //卡牌图片", +] + +[method.res] +field = [ + "int64 id //活动id", + "string hash_id //活动hash_id", +] + +[[method]] +name = "AdsShow" +desc = "Ads活动详情" +[method.req] +field = [ + "string hash_id //活动hash_id", +] + +[method.res] +field = [ + "int64 id //活动ID", + "string hash_id //活动hash_id", + "int64 project_id //模版id", + "int64 temp_id //模版id", + "int32 t_offset //时间偏移量", + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存;4-w2a互动广告)", + "int64 t_start //展示的开始时间时间戳", + "int64 t_end //展示的结束时间时间戳", + "string fission_mark //活动类型玩法标识", + "string title //活动标题", + "string cover_url //封面地址", + "string page_title //页面标题", + "string bg_img //活动背景图", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", + "repeated KV delay_link_data //延迟深度链接自定义参数", + "repeated Reward rewards //奖品", + "int32 countdown //倒计时", + "int64 fission_id //玩法id", + "Flip flip //翻牌配置(翻牌玩法必传)", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //奖品id", + "int64 reward_id //奖品库的奖品id", + "int32 odds //中奖率", + "string title //奖品名称", + "string img_url //奖品图片", + "repeated KV kv_data //奖品自定义参数数据", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-实物)", + "string contact //联系方式", + "string url //回调地址", +] + +[[method.res.message]] +name = "Flip" +field = [ + "string card_img //卡牌图片", +] + +[[method]] +name = "CampaignSelect" +desc = "活动选择列表" +[method.req] +field = [ + "int64 project_id //项目id", + "string project_hash_id //项目hash_id", + "repeated int32 targets //活动目标集合", + "bool child //子活动", + "string child_with //绑定子活动的活动id", + "int32 child_type //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务)", + "string temp_hash_id //模版hash_id", + "repeated int32 status //活动状态(1-待发布,2-已发布,3-已下线,4-预发布)", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动ID", + "string hash_id //活动对外id", + "string title //活动标题", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", + "int32 child_type //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务)", +] + +[[method]] +name = "RewardDetail" +desc = "奖品详情" +[method.req] +field = [ + "string hash_id //活动hash_id", +] + +[method.res] +field = [ + "int32 reward_group //奖品分组类型(1-常规奖品,2-用户类型奖品,3-语言奖品,4-语言+用户类型奖品,5-国家奖品)", + "repeated Reward normal //常规奖品", + "repeated UserLevelOne user_level //用户类型奖品", + "repeated LangOne langs //语言奖品", + "repeated LangUserLevelOne lang_user_level //语言+用户类型奖品", + "repeated CountryOne country //国家奖品", + "repeated Reward step_reward //阶梯奖品", + "repeated Reward extra_reward //额外奖品", + "repeated Reward newcomer_reward //新人奖品", + "int64 all //活动总预算", + "int64 all_use //已使用的活动预算", + "repeated string reward_type //奖品tab集合(app-活动主奖品,app_sign-签到活动主奖品,extra-额外奖品,step-阶梯奖,newcomer-新人奖,pool-奖池记录,task-任务奖励)", + "int32 show_all //是否展示总预算模块(0-否,1-是)", + "int32 show_select //是否显示选择数(0-否,1-是)", + "repeated Reward task_reward //任务奖品", + "repeated Pool pools //奖池记录", + "repeated Schedule schedules //赛程记录", + "repeated UnoCard uno_cards //uno卡牌奖励", +] +[[method.res.message]] +name = "UnoCard" +field = [ + "int64 id //牌组id", + "string mark //牌组标识", + "string title //奖品标题", + "int64 stock //奖品库存", + "int64 remain //剩余库存", + "int64 pre_intact_num //待合成奖品数", + "int64 intact_num //完整奖品数", +] +[[method.res.message]] +name = "Schedule" +field = [ + "int64 id //赛程id", + "int64 vs_at //开赛时间", + "int64 vote_start //投票开始时间", + "int64 vote_end //投票结束时间", + "repeated Team teams //队伍数据", + "repeated Vote votes //投票数据", + "int32 win_type //结算获奖类型(1-队伍胜利,2-平局)", + "int64 win_team_id //胜利队伍id", + "int64 pre_reward_num //预计发放奖励数", + "int64 reward_num //实际领取奖励数", + "int32 tz //时区", +] +[[method.res.message]] +name = "Vote" +field = [ + "int32 win_type //结算获奖类型(1-队伍胜利,2-平局)", + "int64 win_team_id //队伍id", + "int64 vote_num //投票数", + "int64 vote_user_num //投票数", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] +[[method.res.message]] +name = "Pool" +field = [ + "int64 id //id标识", + "string title //场次说明", + "int32 status //状态(1-进行中 2-领奖中,3-已结算)", + "int32 init_coin //奖池初始金额", + "int64 user_coin //用户投放金币数", + "int32 init_use //初始投放次数", + "int64 join_num //投放次数", + "int64 one_use_coin //用户单次可领取的金币数", + "int64 join_user_num //投放人数", + "int64 get_num //领奖总人数", + "int64 join_avg //平均每人发放金币数", + "int64 get_coin //领取的总金币数", +] +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //奖品id", + "string title //奖品标题", + "int64 stock //奖品库存", + "int64 remain //剩余库存", + "int64 given //已发放奖品数", + "bool can_up //是否可更新库存", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int64 select_num //选择数", + "string task_title //任务标题", + "int32 sign_day //签到天数", +] +[[method.res.message]] +name = "UserLevelOne" +field = [ + "int64 level_id //用户类型id", + "string level_title //用户类型标题", + "repeated Reward rewards //奖品", +] +[[method.res.message]] +name = "LangOne" +field = [ + "string lang_mark //语言标识", + "repeated Reward rewards //奖品", +] +[[method.res.message]] +name = "LangUserLevelOne" +field = [ + "string lang_mark //语言标识", + "repeated UserLevelOne level_list //奖品", +] +[[method.res.message]] +name = "CountryOne" +field = [ + "string country_mark //国家标识", + "repeated Reward rewards //奖品", +] + +[[method]] +name = "UpdateStock" +desc = "修改奖品库存" +[method.req] +field = [ + "int64 id //奖品id", + "int32 stock //修改的库存值", + "int64 user_id //修改的", + "string ip //ip地址", +] + +[method.res] + + +[[method]] +name = "CampaignTz" +desc = "活动时区数据" +[method.req] +field = [ + "int64 id //活动id", +] + +[method.res] +field = [ + "repeated One list //语言数据", +] +[[method.res.message]] +name = "One" +field = [ + "string mark //语言标识", + "int32 t_offset //语言对应的时区", +] + + +[[method]] +name = "CampaignRewardType" +desc = "活动奖品类型" +[method.req] +field = [ + "int64 id //活动id", +] + +[method.res] +field = [ + "repeated One list //语言数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //奖品id", + "int32 reward_type //奖品类型", +] + +[[method]] +name = "ChildList" +desc = "子活动列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 project_id //项目id", + "string project_hash_id //项目hash_id", + "string title //活动标题筛选", + "repeated int32 status //活动状态(1-待发布,2-已发布,3-已下线)", + "repeated int32 child_type //子活动类型", + "repeated int64 fission_id //活动类型标识", + "repeated int64 campaign_id //绑定的活动id", + "int64 start //活动时间开始时间戳", + "int64 end //活动时间结束时间戳", + "repeated int64 pids //上级活动id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动ID", + "string hash_id //活动对外id", + "string title //活动标题", + "int64 fission_id //玩法ID", + "string fission_mark //活动类型玩法标识", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线,4-预发布)", + "int32 child_type //子活动类型", + "string bind_campaign //绑定的活动名称", + "int32 has_report //是否有报表", +] + +[[method]] +name = "ChildStore" +desc = "子活动列表" +[method.req] +field = [ + "string project_id //项目id", + "int64 user_id //员工id", + "string ip //操作ip", + "string title //活动标题", + "int64 fission_id //玩法id", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "int32 child_type //子活动类型", + "int32 play_type //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率)", + "repeated Reward rewards //奖品", + "TaskGroup win_1 //任务组1", + "TaskGroup win_2 //任务组2", + "TaskGroup win_3 //任务组3", +] + +[[method.req.message]] +name = "TaskGroup" +field = [ + "int32 open //是否开启", + "int32 chance //完成任务获得的数量(如:骰子数)", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "repeated Cond conds //任务", +] + +[[method.req.message]] +name = "Reward" +field = [ + "int64 reward_id //奖品库的奖品id", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "int32 odds //中奖率", + "string jump_url //跳转地址", + "int32 campaign_limit //活动内单个用户可获取该奖品次数", + "int32 register //开启注册助力(0-否,1-是)", + "double register_percent //每个注册获得的进度比率", + "double init_percent //初始助力进度", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", +] +[[method.req.message]] +name = "Cond" +field = [ + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "string desc //条件描述", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "repeated string lang_marks //限制的语言集合", + "int32 watch_sec //观看秒数", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置条件(0-否,1-是)", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", + "int32 expired_min //过期分钟数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "int32 sort //排序", + "string pc_param //pc端附加参数", +] + +[method.res] +field = [ + "int64 id //id", + "string hash_id //活动id", +] + +[[method]] +name = "ChildUpdate" +desc = "更新子活动" +[method.req] +field = [ + "int64 id //活动id", + "string hash_id //活动id", + "int64 user_id //员工id", + "string ip //操作ip", + "string title //活动标题", + "int64 fission_id //玩法id", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "int32 child_type //子活动类型", + "int32 play_type //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率)", + "repeated Reward rewards //奖品", + "TaskGroup win_1 //任务组1", + "TaskGroup win_2 //任务组2", + "TaskGroup win_3 //任务组3", +] + +[[method.req.message]] +name = "TaskGroup" +field = [ + "int32 open //是否开启", + "int32 chance //完成任务获得的数量(如:骰子数)", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "repeated Cond conds //任务", +] + +[[method.req.message]] +name = "Reward" +field = [ + "int64 id //奖品id", + "int64 reward_id //奖品库的奖品id", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "int32 odds //中奖率", + "string jump_url //跳转地址", + "int32 campaign_limit //活动内单个用户可获取该奖品次数", + "int32 register //开启注册助力(0-否,1-是)", + "double register_percent //每个注册获得的进度比率", + "double init_percent //初始助力进度", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", +] +[[method.req.message]] +name = "Cond" +field = [ + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "string desc //条件描述", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "repeated string lang_marks //限制的语言集合", + "int32 watch_sec //观看秒数", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置条件(0-否,1-是)", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", + "int32 expired_min //过期分钟数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "int32 sort //排序", + "string pc_param //pc端附加参数", +] + +[method.res] +field = [ + "int64 id //id", + "string hash_id //活动id", +] + +[[method]] +name = "ChildShow" +desc = "子活动活动" +[method.req] +field = [ + "int64 id //id", + "string hash_id //活动id", +] + +[method.res] +field = [ + "string title //活动标题", + "int64 fission_id //玩法id", + "int64 t_start //开始时间时间戳", + "int64 t_end //结束时间时间戳", + "int32 child_type //子活动类型", + "int32 play_type //子活动玩法类型(1-连续签到/随机,2-次数签到/按概率)", + "repeated Reward rewards //奖品", + "TaskGroup win_1 //任务组1", + "TaskGroup win_2 //任务组2", + "TaskGroup win_3 //任务组3", +] + +[[method.res.message]] +name = "TaskGroup" +field = [ + "int32 open //是否开启", + "int32 chance //完成任务获得的数量(如:骰子数)", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "repeated Cond conds //任务", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "int64 reward_id //奖品库的奖品id", + "int32 stock //奖品库存", + "int32 invite_num //需要邀请的人数", + "int32 reward_num //获得的奖品数量", + "int32 is_thank //是否谢谢参与(0-否,1-是)", + "int32 score //领取奖品的分数", + "int32 sign_day //签到天数", + "int32 collect_num //收集碎片数", + "int32 is_super //是否超级大奖(0-否,1-是)", + "repeated KV kv_data //奖品自定义参数数据", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,3-客户端发放,4-提交表单)", + "string contact //联系方式", + "string url //回调地址", + "int32 help //开启下载助力(0-否,1-是)", + "double help_percent //每个下载获得的进度比率", + "int32 click //开启点击助力(0-否,1-是)", + "double click_percent //每个点击助力获得的进度比率", + "double click_percent_limit //可获得的最大点击助力获得的进度比率", + "int32 open //开启拉日活(0-否,1-是)", + "double open_percent //每个拉日活力获得的进度比率", + "double open_percent_limit //可获得的最大拉日活获得的进度比率", + "string lang_mark //奖品语言标识", + "int32 odds //中奖率", + "string jump_url //跳转地址", + "string form_title //表单标题", + "int32 campaign_limit //活动内单个用户可获取该奖品次数", + "int32 register //开启注册助力(0-否,1-是)", + "double register_percent //每个注册获得的进度比率", + "double init_percent //初始助力进度", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", +] +[[method.res.message]] +name = "Cond" +field = [ + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "string desc //条件描述", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 task_limit //任务次数限制", + "int32 chance //完成任务获得的数量(如:骰子数)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "int32 day_limit //每日任务次数限制(0为不限制)", + "repeated int64 level_ids //限制的用户类型id集合", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "repeated string lang_marks //限制的语言集合", + "int32 watch_sec //观看秒数", + "int32 week_limit //广告观看次数", + "int32 week_num //观看秒数", + "int32 open_jump //开启活动跳转(0-否,1-是)", + "string web_url //web端url长度", + "string extra_param //附加参数", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置条件(0-否,1-是)", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", + "int32 expired_min //过期分钟数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "int32 sort //排序", + "string pc_param //pc端附加参数", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method]] +name = "TaskCenterJump" +desc = "任务中心活动跳转地址" +[method.req] +field = [ + "string center_hash_id //任务中心hash_id", + "int64 module_id //模块id", + "repeated int64 cpn_ids //活动id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动ID", + "string jump_url //跳转地址", +] + +[[method]] +name = "CondList" +desc = "活动任务数据" +[method.req] +field = [ + "repeated int64 ids //任务id", +] + +[method.res] +field = [ + "repeated One list //数据集合", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //任务id", + "string desc //条件描述", + "string event //事件关键字", + "repeated Cond conds //事件key", +] + +[[method.res.message]] +name = "Cond" +field = [ + "string event_key //事件key", + "string event_val //事件值", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", +] + +[[method]] +name = "Campaigns" +desc = "获取活动数据" +[method.req] +field = [ + "int64 project_id //项目id", + "repeated int64 campaign_ids //活动集合", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动id", + "string title //活动标题", +] + +[[method]] +name = "SetLvApi" +desc = "设置动态用户等级动态api" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 url_id //地址id", +] + +[method.res] + +[[method]] +name = "GetLvApi" +desc = "获取动态用户等级动态api" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "int64 url_id //地址id", + "string title //地址备注", +] + +[[method]] +name = "VsSettlement" +desc = "赛事竞猜结算" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int64 schedule_id //赛事id", + "int64 win_team_id //胜利队伍id", + "repeated Score scores //队伍得分", +] + +[[method.req.message]] +name = "Score" +field = [ + "int64 team_id //队伍id", + "string score //胜利得分", +] + +[method.res] +field = [ + "int32 schedule_id //赛程id", + "PkTeam pk_team //比赛数据", +] +[[method.res.message]] +name = "PkTeam" +field = [ + "int64 id //比赛id", + "repeated Team teams //队伍集合", +] + +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method]] +name = "VsSettlementInfo" +desc = "赛事竞猜结算" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int64 schedule_id //赛事id", +] + +[method.res] +field = [ + "int32 win_type //结算获奖类型(1-队伍胜利,2-平局)", + "int64 win_team_id //胜利队伍id", + "repeated Team teams //队伍数据", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", + "string score //胜利得分", +] + +[[method]] +name = "ActionList" +desc = "行为列表" +[method.req] +field = [ + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated int32 action_types //行为集合", +] diff --git a/proto/toml/w_campaign_stat.toml b/proto/toml/w_campaign_stat.toml new file mode 100644 index 0000000..920b972 --- /dev/null +++ b/proto/toml/w_campaign_stat.toml @@ -0,0 +1,628 @@ +[service] +name = "WCampaignStat" +desc = "活动统计服务" + +[[method]] +name = "Summary" +desc = "活动概览数据" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "string title //列表数据", + "int64 start_time //活动开始时间时间戳", + "int64 end_time //活动结束时间时间戳", + "int32 status //活动状态(1-待发布,2-已发布,3-下线)", + "int64 install_num //下载次数|注册次数", + "int64 share_user_num //邀请按钮点击人数", + "int64 view_num //访问总次数", + "int64 view_user_num //访问总人数", + "int64 max_deep //最高裂变层级", + "int64 today_view_num //今日访问次数", + "int64 today_user_num //今日参与人数", + "string cover_url //活动名称", + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "EventData event_data //事件统计数据", + "int32 option //目标选择类型(1-app下载/注册;2-好友完成指定事件;3-指定事件达标;4-拉充值/积分消耗)", + "int32 type //报表类型(1-下载,2-注册,3-事件,4-报表,5-养成)", + "int64 sign_num //总签到人数", + "int64 sign_target_num //总签到达标人数", + "int64 today_sign_num //今日总签到人数", + "int64 today_sign_target_num //今日总签到达标人数", + "Grow grow //养成类型特定统计参数", +] +[[method.res.message]] +name = "EventData" +field = [ + "int64 target_num //达标次数", + "int64 target_user_num //达标人数", + "repeated Cond conds //事件数据", +] +[[method.res.message]] +name = "Cond" +field = [ + "string event //事件关键字", + "string event_key //标识说明", + "int64 num //触发次数", + "int64 user_num //触发人数", + "double total //累计总值", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", +] +[[method.res.message]] +name = "Grow" +field = [ + "int64 total //总养成人数", + "int64 today //今日养成人数", +] + +[[method]] +name = "Campaign" +desc = "活动数据" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "int64 start_time //统计开始时间时间戳", + "int64 end_time //统计结束时间时间戳", +] + +[method.res] +field = [ + "repeated string x //x轴", + "Report report_user //人数报告", + "Report report_num //次数报告", + "int32 show_type //展示类型(1-活动访问,2-达标条件,3-签到,4-养成)", +] +[[method.res.message]] +name = "Y" +field = [ + "int32 type //线类型", + "string name //标识说明", + "repeated int64 data //数据", +] +[[method.res.message]] +name = "Report" +field = [ + "int64 view_num //活动页面访问人数", + "string fun //活动兴趣度,如(2.5)", + "string change //活动转化率,如(2.5)", + "repeated Y y //展示的线数据", + "string target //活动达标率,如(2.5)", + "int64 target_num //活动达标数", + "string sign //签到达标率,如(2.5)", + "int64 sign_num //签到数", + "string grow //养成达标率,如(2.5)", +] + +[[method]] +name = "Related" +desc = "裂变数据" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "int64 start_time //统计开始时间时间戳", + "int64 end_time //统计结束时间时间戳", +] + +[method.res] +field = [ + "repeated string x //x轴", + "Report report_user //人数报告", + "Report report_num //次数报告", +] +[[method.res.message]] +name = "Y" +field = [ + "int32 type //线类型", + "string name //标识说明", + "repeated int64 data //数据", +] +[[method.res.message]] +name = "Report" +field = [ + "string share //邀请链接曝光转化,如(2.5)", + "string wechat //微信页转化率,如(2.5)", + "string download //下载页转化率,如(2.5)", + "repeated Y y //展示的线数据", + "string media //社媒分享转化率,如(2.5)", + "int64 media_num //社媒总数", + "repeated MediaData media_data //社媒数据", +] +[[method.res.message]] +name = "MediaData" +field = [ + "string name //社媒名称", + "int64 total //总数", +] + +[[method]] +name = "Stat" +desc = "统计事件数据" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int32 behavior_type //用户行为类型", + "int64 behavior_time //用户行为时间", + "string ip //用户ip", + "string os //系统", + "string os_ver //用户版本", + "string device_model //设备型号", + "string sub_user_id //活动用户外部id", + "string parent_user_id //用户上级用户外部id", + "int64 media_id //社媒id", + "string c_mark //渠道标识", + "string icon //图标标识(invite-邀请框icon)", + "string wid //浏览器id", +] + +[method.res] + + +[[method]] +name = "Channel" +desc = "渠道统计" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int32 c_type //渠道类型(1-站内渠道,2-站外渠道)", + "int64 start_time //统计开始时间时间戳", + "int64 end_time //统计结束时间时间戳", + "int32 page //当前页", + "int32 per_page //每页条数", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //渠道id", + "string title //渠道名称", + "string url //渠道链接", + "int64 click_num //点击次数", + "int64 click_user_num //点击人数", + "int64 install_num //安装数", + "int64 open_num //打开app次数", + "int64 open_user_num //打开app人数", + "int64 install_user_num //安装人数", +] + +[[method]] +name = "AdsSummary" +desc = "Ads总揽数据" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "int64 visitor_num //访问量", + "int64 visitor_num_today //今日访问量", + "int64 visitor_num_yesterday //昨日访问量", + "int64 visitor_user //访问人数", + "int64 visitor_user_today //今日访问人数", + "int64 visitor_user_yesterday //昨日访问人数", + "string visitor_user_day_compare //访问人数日坏比", + "int32 visitor_user_day_compare_up //访问人数日坏比趋势,0-无变化,1-上涨,2-下降", + "int64 install_num //下载量", + "int64 install_num_today //今日下载量", + "int64 install_num_yesterday //昨日下载量", + "int64 install_user //下载人数", + "int64 install_user_today //今日下载人数", + "int64 install_user_yesterday //昨日下载人数", + "string install_user_day_compare //下载人数日坏比", + "int32 install_user_day_compare_up //下载人数日坏比趋势,0-无变化,1-上涨,2-下降", + "int64 reward_user_app_today //今日领奖人数", +] + +[[method]] +name = "AdsTable" +desc = "Ads报表" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int64 start_time //统计开始时间时间戳", + "int64 end_time //统计结束时间时间戳", +] + +[method.res] +field = [ + "int64 visitor_user //区间访问人数", + "int64 install_user //区间下载人数", + "string install_user_compare //下载转化率", + "repeated string x //x轴", + "repeated Y y //x轴", +] +[[method.res.message]] +name = "Y" +field = [ + "string type //线类型(app_install-安装,view-访问)", + "repeated int64 data //y轴数据", +] + +[[method]] +name = "AdsReward" +desc = "Ads奖品" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "int64 web_num //奖品发放总数", + "int64 app_num //奖品领取总数", + "repeated Reward rewards //奖品列表", +] +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "string title //奖品标题", + "int64 web_num //奖品发放总数", + "string web_compare //奖品发放占比", + "int64 app_num //奖品领取总数", + "string app_compare //奖品领取占比", + "string compare //领奖率", +] + +[[method]] +name = "InAppBP" +desc = "应用内埋点" +[method.req] +field = [ + "int32 type //埋点类型(1-访问活动,5-活动按钮点击,6-点击分享按钮,10-点击去完成,18-点击去使用,19-点击长图)", + "int64 user_id //用户id", + "int64 media_id //社媒id", + "int64 cond_id //条件ID", + "int64 reward_id //奖品id", + "string ip //访问ip", + "string img_url //图片地址", + "string from //埋点类型来源", + "string form_show_status //展示的表单状态", + "int64 reward_record_id //奖品领取记录id", + "string os //系统", + "string os_version //系统版本", + "string device_model //系统型号", + "int64 campaigin_id //活动id", + "int64 qa_id //题目id", + "int64 qa_option_id //选择的选项id", + "int32 is_right //是否正确答案(-1:不正确,1:正确)", + "int64 img_id //长图id", + "int64 zone_id //热区id", + "string click_flip_status //点击立即翻牌状态(有抽奖机会 - has_lucky,没有抽奖机会 - none_lucky)", + "int64 custom_btn_id //自定义按钮id", + "string chat_from //进入ai对话来源(icon-图标,tip-宠物文案)", + "string chat_tip_msg //tip宠物文案内容", + "string color_mark //uno颜色", + "string card_no //uno牌型", + "int64 uno_card_id //uno卡Id", +] + +[method.res] +field = [ +] + +[[method]] +name = "ChildBP" +desc = "应用内埋点" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 campaigin_id //活动id", + "string child_hash_id //子活动id", + "int32 type //埋点类型(43-打开子活动入口)", +] + +[method.res] +field = [ +] + +[[method]] +name = "OutAppBP" +desc = "应用外埋点" +[method.req] +field = [ + "int32 type //埋点类型(12-访问站外链接,13-站外活动按钮点击,7-浏览下载页行为, 8-点击下载按钮,9-浏览微信页行为)", + "string campaign_hash_id //活动hash_id", + "string web_id //用户id", + "string download_from //下载页来源", + "string parent_user_id //上级用户id", + "string lang //语言标识", + "string ip //访问ip", + "string cid //渠道标识", + "string platform //平台", + "string os //系统", + "string os_version //系统版本", + "string device_model //系统型号", + "string blackbox //黑盒数据", + "string uid //第三方用户id", +] + +[method.res] +field = [ +] + +[[method]] +name = "ReportInfo" +desc = "报表信息" +[method.req] +field = [ + "string hash_id //活动hash_id", +] + +[method.res] +field = [ + "string hash_id //活动对外id", + "string title //活动标题", + "string cover_url //活动封面", + "string fission_mark //玩法标识", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", + "int32 t_offset //时间偏移量", + "int32 target //活动目标", + "repeated Event events //支持的埋点事件", + "repeated Dimension fix_dimensions //固定维度", + "repeated LangOffset lang_offset //语言时区", + "int32 open_fixed //开始固定事件(0-否,1-是)", + "int32 open_custom //开始自定义事件(0-否,1-是)", + "repeated string reward_type //奖品tab集合(app-活动主奖品,extra-额外奖品,step-阶梯奖,newcomer-新人奖)", + "int32 show_all //是否展示总预算模块(0-否,1-是)", + "int32 show_select //是否显示选择数(0-否,1-是)", +] + +[[method.res.message]] +name = "LangOffset" +field = [ + "int32 t_offset //语言标识", + "string lang_mark //时区偏移值", +] + +[[method.res.message]] +name = "Event" +field = [ + "int32 type //活动奖品id", + "repeated Dimension dimensions //维度数据", +] + +[[method.res.message]] +name = "Dimension" +field = [ + "string key //活动奖品id", +] + +[[method]] +name = "StatEvent" +desc = "活动统计的维度" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int64 campaign_id // 活动id", + "string lang_mark //活动hash_id", +] + +[method.res] +field = [ + "int64 campaign_id // 活动id", + "int32 t_offect // 时区", + "repeated int32 event_ids // 事件ids", + "repeated Task tasks // 任务数据", + "repeated string help_event // 助力事件" +] +[[method.res.message]] +name = "Task" +field = [ + "int64 id //任务id", + "string title //任务名称", +] + +[[method]] +name = "DemTitle" +desc = "维度标题数据" +[method.req] +field = [ + "string campaign_hash_id // 活动hash_id", + "repeated int64 reward_ids // 奖品id集合", + "repeated int64 cond_ids // 任务id集合", + "repeated int64 media_ids // 社媒id集合", + "repeated int64 channel_ids // 渠道id集合", + "repeated int64 level_ids // 用户类型id集合", + "repeated int64 qa_ids // 题库题目id集合", + "repeated int64 qa_option_ids // 题库题目选项id集合", + "repeated int64 qa_group_ids // 题库id集合", + "repeated int64 scene_ids // 场次集合", + "repeated int64 custom_btn_ids // 自定义按钮id集合", + "repeated int64 taskIds // 任务id集合", + "repeated int64 parent_ids // 上级用户id集合", + "int64 campaign_id // 活动id", + "repeated int64 img_ids // 长图id集合", + "repeated int64 zone_ids // 热区id集合", + "repeated int64 cpn_ids // 活动id集合", + "repeated int64 schedule_ids // 活动时间id集合", + "repeated int64 mall_ids // 商城id集合", + "repeated int64 mall_item_ids // 商城商品id集合", + "repeated int64 uno_card_ids // uno卡id集合", +] + +[method.res] +field = [ + "int64 campaign_id // 活动id", + "int32 t_offect // 时区", + "repeated Title conds // 任务数据", + "repeated Title media // 社媒数据", + "repeated Title channel // 渠道数据", + "repeated Title rewards // 奖品数据", + "repeated Title user_lv // 用户等级", + "repeated Title qa // 题库题目", + "repeated Title qa_option // 题库题目选项", + "repeated Title qa_group // 题库题目选项", + "repeated Title scenes // 场次", + "repeated Title custom_btn // 按钮文案", + "repeated Title tasks // 任务文案", + "repeated Title parents // 上级用户", + "repeated Title imgs // 长图参数", + "repeated Title zones // 热区", + "repeated Title cpns // 活动", + "repeated Schedule schedules // 活动时间", + "repeated Title malls // 商城", + "repeated Title mall_items // 商城商品", + "repeated Title uno_cards // uno卡", +] + +[[method.res.message]] +name = "Title" +field = [ + "string mark //字符串标识", + "int64 id //标识", + "string title //说明", + "int64 second_id //二级标识", +] +[[method.res.message]] +name = "Schedule" +field = [ + "int64 id //赛程id", + "string title //说明", + "repeated Team teams //队伍数据", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //标识", + "string title //说明", +] + +[[method]] +name = "TopTen" +desc = "活动前十排行榜" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "int64 max_lv // 最高裂变层级", + "repeated Invite invite // 邀请人数", + "repeated Event event // 任务数据", + "repeated Grow grow // 领养数据", + "repeated Help help // 助力数据", + "repeated Sign sign // 签到排行榜", +] +[[method.res.message]] +name = "Invite" +field = [ + "int32 rank //排名", + "string user_id //用户id", + "int64 effect_num //有效邀请人数", + "int64 invite_num //邀请总人数", +] +[[method.res.message]] +name = "Event" +field = [ + "int32 rank //排名", + "string user_id //用户id", + "int64 num //数量", + "repeated Cond conds //具体达标条件数据" +] +[[method.res.message]] +name = "Cond" +field = [ + "string desc //条件说明", + "int64 num //数量", +] +[[method.res.message]] +name = "Grow" +field = [ + "int32 rank //排名", + "string user_id //用户id", + "int64 grow_num //领养数量", + "int64 grow_reward_num //养成数量", +] +[[method.res.message]] +name = "Help" +field = [ + "int32 rank //排名", + "string user_id //用户id", + "int64 num //助力数量", + "repeated Detail detail //领养详情", +] +[[method.res.message]] +name = "Detail" +field = [ + "string title //标题", + "int64 num //数量", +] +[[method.res.message]] +name = "Sign" +field = [ + "int32 rank //排名", + "string user_id //用户id", + "int64 sign_day //签到天数", + "int64 sign_reward_num //签到达标数", +] + +[[method]] +name = "UserCycle" +desc = "用户明细占比数据" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "repeated One list // 最高裂变层级", +] +[[method.res.message]] +name = "One" +field = [ + "string mark //占比标识(platform-平台占比,channel-渠道占比,media-社媒占比)", + "repeated Part parts //占比数据", +] +[[method.res.message]] +name = "Part" +field = [ + "string title //标题", + "int64 num //数量", +] + +[[method]] +name = "Active" +desc = "用户活跃" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 campaign_id //活动id", +] + +[method.res] + +[[method]] +name = "ChildReportInfo" +desc = "子活动报表信息" +[method.req] +field = [ + "string hash_id //活动hash_id", +] + +[method.res] +field = [ + "string hash_id //活动对外id", + "string title //活动标题", + "int64 start_time //开始时间时间戳", + "int64 end_time //结束时间时间戳", + "int32 status //发布状态(1-待发布,2-已发布,3-已下线)", + "int32 t_offset //时间偏移量", + "int32 child_type //子活动类型", + "string p_title //父活动标题", +] diff --git a/proto/toml/w_campaign_user.toml b/proto/toml/w_campaign_user.toml new file mode 100644 index 0000000..32b8120 --- /dev/null +++ b/proto/toml/w_campaign_user.toml @@ -0,0 +1,3117 @@ +[service] +name = "WCampaignUser" +desc = "活动用户服务" + +[[method]] +name = "List" +desc = "用户列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "int64 pid //父级id", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "bool order_by_time_asc //根据参与时间升序", + "string parent_user_mark //上级用户标识关键字", + "int32 source //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件)", + "string lang_mark //语言标识", + "int32 t_offset //时区", + "int32 pid_type //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户)", + "int32 join_type //上级用户类型(1-进入过活动的用户,2-没有进入过活动的用户)", + "repeated int32 user_cond //用户条件(1-有安装的用户,2-有注册的用户)", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", + "int32 t_offset //时区", + "int64 fission_id //玩法id", + "string fission_mark //活动类型玩法标识", + "int32 fix_dice //开启固定骰子(0-不开启,1-开启)", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动用户ID", + "string hash_id //活动用户对外id", + "string sub_user_id //用户", + "string parent //用户上级", + "int64 child_num //下级数量", + "int64 indirect_num //间接裂变", + "int32 is_new //是否新安装用户(1-是,0-否)", + "int64 created_at //创建时间", + "int32 chance //剩余的抽奖次数|答题次数|投票票数", + "int32 is_help //助力状态(0-无此状态,1-助力成功,2-助力失败)", + "Dice dice //大富翁数据", + "string channel_title //渠道名称", + "int32 source //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件)", + "int64 effect_num //有效拉新人数", + "string lang_mark //用户语种标识", + "string country_mark //国家标识", + "string lv_title //用户等级", + "string platform //操作系统", + "string user_mark //用户标识", + "int32 user_mark_source //用户标识来源(1-设备id,2-用户id)", + "repeated Cond conds //用户完成的任务详情", + "Chop chop //砍一刀数据", + "string fail_mark //助力失败原因", + "Win win //一起赢奖励特有参数", + "Keep keep_dog //养狗数据", + "Cash cash //现金抽奖数据", + "string device_id //设备id", + "Gold gold //现金抽奖数据", + "Coin coin //金币池数据", + "Sign sign //签到数据", + "int64 join_at //访问活动时间", + "int64 install_at //安装时间", + "int64 register_at //注册时间", + "Vs vs //投票数据", + "Uno uno //uno卡牌数据", +] + +[[method.res.message]] +name = "Uno" +field = [ + "int32 chance //剩余投票次数", + "int32 three_num //+3道具牌数量", + "int32 five_num //+5道具牌数量", + "int32 fix_num //固定颜色道具牌数量", +] + +[[method.res.message]] +name = "Vs" +field = [ + "int32 chance //剩余投票次数", + "int32 vote_num //投票次数", + "int32 coin_get //积分获取数", + "int32 coin_use //积分消耗数", +] + +[[method.res.message]] +name = "Dice" +field = [ + "int32 chance //骰子次数", + "int32 lucky_chance //幸运骰次数", +] +[[method.res.message]] +name = "Chop" +field = [ + "int64 chop_reward_id //选中的奖品id", + "string reward_title //奖品标题", + "string percent //当前进度", +] + +[[method.res.message]] +name = "Cond" +field = [ + "string desc //标题", + "int64 num //数量", +] + +[[method.res.message]] +name = "Win" +field = [ + "int32 is_newcomer //是否是新人用户", +] + +[[method.res.message]] +name = "Keep" +field = [ + "int32 collect_num //已收集爱心数", + "string reward_title //奖品标题", + "int32 chance //剩余狗粮数", +] + +[[method.res.message]] +name = "Cash" +field = [ + "int64 expired_at //任务重制时间", +] + +[[method.res.message]] +name = "Gold" +field = [ + "int32 gold_num //金币数量", + "int64 expired_at //任务重制时间", +] + +[[method.res.message]] +name = "Coin" +field = [ + "int32 total_use //投放总次数", + "int32 total_num //总收益", + "repeated CoinScene scenes //场次明细", +] +[[method.res.message]] +name = "CoinScene" +field = [ + "string title //开奖时间", + "int32 use_num //投放次数", + "int32 get_coin //获得金币数", +] + +[[method.res.message]] +name = "Sign" +field = [ + "int32 sign_day //签到天数", + "int32 max_continue //连续签到天数", +] + +[[method]] +name = "Reward" +desc = "用户奖励" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "int64 fuser_id //活动用户id", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "repeated int32 status //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发放)", + "string reward_title //奖品名称", + "int32 t_offset //时区", + "int32 is_child //是否子活动奖品", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", + "int32 t_offset //时区", +] +[[method.res.message]] +name = "One" +field = [ + "string sub_user_id //活动用户对外id", + "int64 created_time //奖励时间时间戳", + "string title //奖励内容", + "repeated KV kv_data //键值对", + "string img //奖品图片", + "string jump_url //跳转地址", + "int32 receive_type //领取类型(1-服务端推送,2-监听器,3-客户自主发放)", + "bool is_push //是否已经推给客户", + "int64 id //奖品记录int型id", + "string hash_id //奖品记录string型hash_id", + "int32 status //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发送)", + "string fail_type //失败原因标识(system-自己系统的问题,client-对方系统的问题,undefined-没有分析到的问题)", + "string fail_msg //失败具体原因说明", + "string reward_title //奖品标题", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 reward_id //活动奖品id", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", + "string custom_reward_val //自定义的奖品值", + "int32 reward_type //奖品类型(1-站内活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励)", + "string child_title //子活动标题", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "string chance_mark //道具标识(dog_food-狗粮)", + "int32 reward_num //奖励数量", + "string pc_param //pc端的跳转参数", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "Visit" +desc = "访问活动" +[method.req] +field = [ + "string hid //活动hash_id", + "string uid //关注用户ID", + "string cid //渠道ID", + "string wid //浏览器唯一id", + "string lang //语种标识", + "string lv //用户等级", + "Cert cert //验签数据", + "string ip //客户端ip", + "string platform //平台", + "string os //系统", + "string os_version //系统版本", + "string device_model //系统型号", + "string custom_param //额外信息", + "string center_id //任务中心ID", + "string module_id //任务中心模块ID", +] + +[[method.req.message]] +name = "Cert" +field = [ + "int64 time //时间戳", + "string blackbox //通过blackBox可以在后台查询出", + "string version //加解密版本", + "string platform //平台", + "string token //加密串", +] + +[method.res] +field = [ + "int64 id //用户id", + "string hash_id //用户对外id", + "string token //身份token", + "int64 expired //token过期时间,单位:秒(s)", + "int32 is_view //是否预览用户(1-是,0-否)", + "bool has_parent //是否有上级", +] + +[[method]] +name = "Play" +desc = "用户活动数据" +[method.req] +field = [ + "int64 id //用户id", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "string sub_user_id //关注用户ID", + "string parent_user_id //用户上级用户外部id", + "string device_id //设备ID", + "string share_link //分享链接", + "ChancePlayer chance_player //大转盘,九宫格,老虎机,盲盒,趣味问答,抽签", + "InvitePalyer invite_player //老带新,一起赢", + "Quiz quiz //有奖竞猜(有奖竞猜活动才有)", + "Sign sign //签到(签到活动才有)", + "Dice dice //大富翁(大富翁活动才有)", + "Grow grow //农场(农场活动才有)", + "Chop chop //砍一刀(砍一刀活动才有)", + "int64 fission_id //玩法Id", + "Task task //用户任务", + "Cash cash //现金抽奖(现金抽奖才有)", + "repeated Clue clue //通知数据", + "Keep keep_dog //养狗数据", + "Gold gold //金币任务", + "Coin coin //瓜分金币", + "Vs vs //赛事竞猜", + "Uno uno //Uno卡牌", +] + +[[method.res.message]] +name = "Uno" +field = [ + "int32 chance //抽奖机会数", + "int32 three_num //+3道具牌数量", + "int32 five_num //+5道具牌数量", + "int32 fix_num //固定颜色道具牌数量", + "UnoGroup red //红牌信息", + "UnoGroup blue //蓝牌信息", + "UnoGroup green //绿牌信息", + "UnoGroup yellow //黄牌信息", +] + +[[method.res.message]] +name = "UnoGroup" +field = [ + "int32 collect_num //收集数量", + "repeated UnoCard cards //牌号", +] + +[[method.res.message]] +name = "UnoCard" +field = [ + "int32 card_no //牌号", + "int32 card_num //获得的牌数量", +] + +[[method.res.message]] +name = "Vs" +field = [ + "int64 coin_num //积分数", + "string coin_title //积分标题", + "string coin_img //积分图片", + "int32 chance //投票机会数", + "repeated GetReward win_rewards //投票奖励", +] + +[[method.res.message]] +name = "Coin" +field = [ + "int64 get_coin //获得的金币数", + "int64 all_coin //总奖池金额", + "int64 open_sec //剩余开奖时间(秒)", + "int32 use_num //投放次数", + "int32 can_get //是否可以领取瓜分了", + "int32 end //是否没有下一场了", +] + +[[method.res.message]] +name = "Clue" +field = [ + "int32 type //通知类型(1-获得抽奖机会通知,2-完成前置任务)", + "int64 chance //获得的抽奖机会次数", + "int32 pre_cond //完成的前置任务标识", +] + +[[method.res.message]] +name = "Task" +field = [ + "Fixed fixed //固定任务", + "Custom custom //自定义任务", +] + +[[method.res.message]] +name = "Fixed" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 app_event //固定事件类型(1-安装;2-注册)", + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", +] + +[[method.res.message]] +name = "Custom" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "int32 chance //总发放的数(如:骰子数)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", +] + +[[method.res.message]] +name = "BothAll" +field = [ + "int32 task_chance //完成任务获得的次数(如:骰子数)", + "int32 task_limit //任务最大可完成次数(0不限制)", + "int64 finish //完成任务的次数", +] + +[[method.res.message]] +name = "Cond" +field = [ + "int64 id //达标条件ID", + "string desc //达标条件", + "int64 num //完成次数", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "string total //累计值", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int32 task_chance //完成发放的次数(如:骰子数)", + "int32 task_limit //任务最大可完成次数(0不限制)", +] + +[[method.res.message]] +name = "ChancePlayer" +field = [ + "int64 id //大转盘用户数据id", + "int32 chance //抽奖机会数", + "int64 invite_num //已邀请人数", +] +[[method.res.message]] +name = "Quiz" +field = [ + "int64 id //有奖竞猜用户数据id", + "int32 chance //投票机会次数", + "int64 option_id //选择的选项id", + "bool win //是否已经赢得奖励", + "string title //奖品名称", + "string img_url //奖品图片", + "int64 invite_num //已邀请人数", + "string reward_hash_id //领取的用户奖品hash_id", + "int32 receive_type //领取类型(1-服务端推送,2-监听器,3-客户自主发放)", + "bool is_push //是否已经推给客户", + "repeated KV kv_data //键值对数据", + "int32 open_type //1-为开奖,2-已开奖,3-不开奖", + "int64 reward_id //奖品id", + "string contact //联系方式", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否显示", +] +[[method.res.message]] +name = "InvitePalyer" +field = [ + "int64 id //老带新用户数据id", + "int64 invite_num //已邀请人数", + "int64 need_num //还需要邀请人数", + "int32 limit_status //任务限制状态(0-无限制,1-完成所有阶段任务,2-总预算限制,3-总邀请人数限制)", + "string title //将要获得的奖品名称|已获得的奖品名称", + "int64 reward_num //将要获得的奖品数量|已获得的奖品数量", + "int32 reward_rule //用户奖励规则(1-阶梯,2-非阶梯)", + "string extra_title //额外奖品名称", + "int64 extra_reward_num //额外奖品数量", + "int64 reward_id //奖品id", + "int64 extra_reward_id //奖品id", + "NoticeReward notice_reward //需要通知的奖品(没有的时候为空)", + "bool has_newcomer_reward //是否可以领取新人奖", + "bool has_help_task //是否有助力任务" +] +[[method.res.message]] +name = "NoticeReward" +field = [ + "string hash_id //奖品对外id", + "string title //奖品名称", + "int32 reward_num //奖品数量", + "int32 receive_type //领取类型(1-服务端推送,2-监听器,3-客户自主发放)", + "repeated KV kv_data //键值对数据", + "int64 reward_id //奖品id", + "string contact //联系方式", +] + +[[method.res.message]] +name = "Sign" +field = [ + "int64 id //签到用户数据id", + "int32 sign_day //签到天数", + "int32 continue_day //连续签到天数", + "int64 invite_num //已邀请人数", + "int32 card_num //补签卡数量", + "int32 max_continue //最大连续签到天数", + "int32 today_sign //今天是否有签到 (0-否,1-是)", + "int32 cycle_day //周期签到天数", +] + +[[method.res.message]] +name = "Dice" +field = [ + "int64 id //签到用户数据id", + "int32 chance //骰子数", + "string map_hash_id //当前所在地图位置", + "int32 props_chance //再摇一次道具可用次数", + "int32 props_fixed_roll //幸运骰子可用次数", + "repeated Collect collects //奖品碎片", + "int64 invite_num //已邀请人数", + "int64 fixed_roll_task_finish //幸运骰子任务完成次数", + "int64 dmg_id //地图id", +] + +[[method.res.message]] +name = "Collect" +field = [ + "int64 id //奖品id", + "int32 num //当前拥有碎片数", + "int32 collect_num //收集碎片总数", + "string reward_title //奖品名称", + "string img_url //奖品图片(相对路径)", + "int32 is_super //是否超级奖品(0-否,1-是)", +] + +[[method.res.message]] +name = "Grow" +field = [ + "int64 id //签到用户数据id", + "int32 grow_num //成长道具数量", + "int64 invite_num //已邀请人数", + "bool has_props //是否可以领取道具", + "int64 next_props //多少秒后可以领取道具", +] + +[[method.res.message]] +name = "Chop" +field = [ + "int64 id //用户数据id", + "int64 chop_reward_id //选择的奖品id,没有选择的时候为0", + "string title //奖品名称", + "string img_url //奖品图片(相对路径)", + "double percent //进度百分比", + "bool finish //是否完成进度任务", + "int64 reward_id //奖品id", + "bool reward_none //是否没有可选奖品了", +] + +[[method.res.message]] +name = "Cash" +field = [ + "int64 id //用户数据id", + "string next_step //进度节点", + "int32 energy //剩余能量数", + "int32 lottery_num //抽奖次数", + "double show_price //当前累计金额", + "int64 expired_in //任务重置剩余时间(单位:s)", + "repeated GetReward rewards //领取的现金抽奖奖品", + "bool has_again //是否可以再玩一次", +] + +[[method.res.message]] +name = "Gold" +field = [ + "int64 id //用户数据id", + "string next_step //进度节点(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, trigger_share-赠送能量)", + "int32 energy //剩余能量数", + "double show_price //当前累计金额", + "int64 expired_in //任务重置剩余时间(单位:s)", + "int32 gold_num //获得的金币数", + "repeated GetReward rewards //领取的现金抽奖奖品", + "int32 add_num //追加的金币数", + "int32 hide_coins //是否隐藏金币(0-否,1-是)", +] + +[[method.res.message]] +name = "GetReward" +field = [ + "string hash_id //领奖记录hash_id", + "string title //奖品名称", + "string img //奖品图片", + "string jump_url //跳转地址", + "repeated KV kv_data //奖品自定义参数数据", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器)", + "string contact //联系方式", + "int64 created_at //创建时间", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", + "string prop_mark //道具标记", + "int32 reward_num //奖品数量", + "int64 reward_id //活动奖品id", +] + +[[method.res.message]] +name = "Keep" +field = [ + "int64 id //用户数据id", + "string percent //进度", + "int32 num //剩余总道具数", + "double machine_num //机器产生的道具数", + "int32 feed_lack //还差多次喂养能获得狗粮", + "int32 collect //当前可收集的数量", + "int32 second_percent //收集需要的二级资源进度", + "int64 expired_sec //养成过期剩余秒数", + "KeepReward Reward //选择的奖品", + "int32 left_collect //还差的爱一级道具数", + "int32 guided //是否出现了指引", + "int32 day_first_invite //当天是否还没完成第一次邀请(0-否,1-是)", + "int64 day_first_expired_sec //首邀任务过期剩余秒数", + "int32 machine_limit //机器被限制(0-正常,1-每日限制)", + "int64 offline_full //离线狗粮机填满剩余秒数", +] +[[method.res.message]] +name = "KeepReward" +field = [ + "int64 id //活动奖品id", + "string title //奖品标题", + "string img_url //奖品图片", + "int64 record_id //记录id", +] + +[[method]] +name = "RewardUser" +desc = "中奖用户列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", +] +[[method.res.message]] +name = "One" +field = [ + "string sub_user_id //活动用户外部id", + "string psu_id //上级用户id", + "int64 direct_num //直接裂变", + "int64 indirect_num //间接裂变", + "repeated Reward rewards //中奖奖品" +] +[[method.res.message]] +name = "Reward" +field = [ + "int64 created_time //奖励时间时间戳", + "string title //奖励内容", + "string reward_hash_id //领取的用户奖品hash_id", +] + +[[method]] +name = "Info" +desc = "用户信息" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "string sub_user_id //活动用户外部id", +] + +[method.res] +field = [ + "string sub_user_id //活动用户外部id", + "string psu_id //上级用户id", + "int64 direct_num //直接裂变", + "int64 indirect_num //间接裂变", + "repeated Reward rewards //中奖奖品" + +] +[[method.res.message]] +name = "Reward" +field = [ + "int64 created_time //奖励时间时间戳", + "string title //奖励内容", +] + +[[method]] +name = "Rank" +desc = "排行榜" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", + "int32 type //类型(1-下载,2-注册,3-达标,4-邀请好友达标)", +] +[[method.res.message]] +name = "One" +field = [ + "string sub_user_id //活动用户外部id", + "int64 direct_num //直接下载数|注册数|达标数|签到达标数", + "int64 indirect_num //间接下载数|注册数|达标数|签到数", + "repeated Cond conds //具体达标条件数据 仅当type=3时候有值" +] +[[method.res.message]] +name = "Cond" +field = [ + "string desc //条件说明", + "int64 num //完成次数", +] + +[[method]] +name = "Lottery" +desc = "活动抽奖" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "int64 id //奖品id", + "string title //奖品名称", + "bool win //是否中奖", + "string img //奖品图片", + "string jump_url //跳转地址", + "repeated KV kv_data //奖品自定义参数数据", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器,4-提交表单)", + "string reward_hash_id //领取的用户奖品hash_id", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "Answer" +desc = "活动答题" +[method.req] +field = [ + "int64 user_id //活动用户id", + "repeated Submit submits //提交的答案", + "int64 campaign_id //活动ID", + "string lang_mark //活动语言", +] + +[[method.req.message]] +name = "Submit" +field = [ + "int64 qid //题目id", + "repeated int64 aid //答案id", +] + +[method.res] +field = [ + "int64 id //奖品id", + "string title //奖品名称", + "bool win //是否中奖", + "string img //奖品图片", + "repeated KV kv_data //奖品自定义参数数据", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器)", + "int32 score //获得的分数", + "string reward_hash_id //领取的用户奖品hash_id", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", + "int32 qa_num //答题数", + "int32 qa_right_num //正确数", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "AnswerHistory" +desc = "答题历史" +[method.req] +field = [ + "int64 campaign_id //活动ID", + "string reward_hash_id //领取的用户奖品hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //问题ID", + "string hash_id //问题对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "string explain_text //答案解析", + "string explain_img //答案解析图", + "repeated Option options //选项", + "string answer_mark //答案类型(image_text-图文,text-文本)", + "repeated int64 select_option_id //选择的选项id", +] + +[[method.res.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //答案内容", + "string img_url //答案图片", + "int32 is_right //是否正确", +] + +[[method]] +name = "Vote" +desc = "活动投票" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 option_id //选项id", + "int32 vote_num //投票数", + "int64 campaign_id //活动ID", + "int64 schedule_id //赛程id", + "int64 team_id //队伍id", +] + +[method.res] +field = [ + "int32 status // 状态(0-正常,1-非投票时间无法投票,2-投票机会不足,3-积分不足,4-投票已达最大次数,5-投票失败)" +] + + +[[method]] +name = "Notify" +desc = "客户端回调" +[method.req] +field = [ + "int64 user_id //活动用户id", + "string reward_hash_id //领取的用户奖品hash_id", + "string body //推送的数据", + "string resp //客户端返回的内容", + "int64 campaign_id //活动id", +] + +[method.res] + +[[method]] +name = "AcceptReward" +desc = "领取奖品" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string reward_hash_id //领取的用户奖品hash_id", +] + +[method.res] + +[[method]] +name = "TargetRule" +desc = "达标规则" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", + "int64 target_num //达标次数", +] + +[[method.res.message]] +name = "One" +field = [ + "string sub_user_id //用户id", + "repeated Cond cond //条件", +] + +[[method.res.message]] +name = "Cond" +field = [ + "string desc //达标条件", + "int64 num //完成次数", + "int64 cond_id //达标条件ID", +] + +[[method]] +name = "Task" +desc = "我的任务" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "Day fix_day //固定的每日任务", + "Fixed fixed //固定任务", + "Custom custom //自定义任务", + "repeated int32 pre_cond //用户可触发的前置任务", +] + +[[method.res.message]] +name = "Day" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 chance //每日访问活动(如:骰子数)", + "bool can_do //是否可完成", +] + +[[method.res.message]] +name = "Fixed" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 app_event //固定事件类型(1-安装;2-注册)", + "int32 target_num //达标条件需要的新用户个数", + "int32 chance //达标获得的数量(如:骰子数)", + "int32 chance_limit //最大获得数量(如:最大骰子数)", + "bool can_do //是否可完成", +] + +[[method.res.message]] +name = "Custom" +field = [ + "int32 open //是否开启(0-否,1-是)", + "int32 both_type //满足条件(1-所有条件满足,2-任一条件满足)", + "int32 chance //总发放的数(如:骰子数)", + "repeated Cond cond //达标条件", + "BothAll both_all //满足条件为所有条件满足要提交的数据", +] + +[[method.res.message]] +name = "BothAll" +field = [ + "int32 task_chance //完成任务获得的次数(如:骰子数)", + "int32 task_limit //任务最大可完成次数(0不限制)", + "int64 finish //完成任务的次数", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "int64 task_id //任务id", +] + +[[method.res.message]] +name = "Cond" +field = [ + "int64 id //达标条件ID", + "string desc //达标条件", + "int64 num //完成次数", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "string total //累计值", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int32 task_chance //完成发放的次数(如:骰子数)", + "int32 task_limit //任务最大可完成次数(0不限制)", + "bool can_do //是否可完成", + "string web_url //web端跳转地址", + "string app_param //app事件参数", + "bool tomorrow_can_do //是否显示明天再来", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "int32 week_can_do //周状态(0-可做,1-下周再来,2-周几再来)", + "int32 week_num //周几", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置任务(0-否,1-是)", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "int64 expired_sec //前置条件过期剩余的秒数", + "string pc_param //app事件参数", + "int64 task_id //任务id", + "int32 has_receive //是否有可领取奖品(0-否,1-是)", + "int32 trigger_type //事件触发条件(1-点击去完成按钮,2-全局监听)", + "string go_text //去完成文案", + "int32 click_effect_open //是否开启点击有效(0-否,1-是)", + "int32 click_effect //点击有效值", + "string click_effect_unit //点击有效单位(min-分钟,hour-小时,day-天)", + "int32 pull_invite //是否拉取邀请(0-否,1-是)", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "string title //奖品标题", + "string img_url //奖品图片", +] + +[[method]] +name = "Resend" +desc = "补发奖品" +[method.req] +field = [ + "string reward_hash_id //奖品hash_id", + "string campaign_hash_id //活动id", +] + +[method.res] +field = [ + "int32 status //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发送)", + "string fail_type //失败原因标识(system-自己系统的问题,client-对方系统的问题,undefined-没有分析到的问题", + "string fail_msg //失败具体原因说明", +] + + +[[method]] +name = "DynamicLink" +desc = "获取用户动态链接" +[method.req] +field = [ + "string project_hash_id //项目", + "string sub_user_id //第三方用户id", + "string media_type //动态数据类型(1-图文)", + "repeated ImageText image_text //图文消息", + "string campaign_hash_id //活动id", +] + +[[method.req.message]] +name = "ImageText" +field = [ + "string nick_name //用户昵称", + "string avatar //用户头像", + "string title //内容标题", + "string desc //内容描述", + "string image //内容封面", +] + +[method.res] +field = [ + "string link_url //链接地址", +] + +[[method]] +name = "DylinkShow" +desc = "获取用户动态链接详情" +[method.req] +field = [ + "string hash_id //动态链接hash_id", +] + +[method.res] +field = [ + "string media_type //媒体类型 ImageText(图文)", + "repeated ImageText image_text //图文消息", +] + +[[method.res.message]] +name = "ImageText" +field = [ + "string nick_name //用户昵称", + "string avatar //用户头像", + "string title //内容标题", + "string desc //内容描述", + "string image //内容封面", +] + +[[method]] +name = "SignIn" +desc = "我的签到板" +[method.req] +field = [ + "int64 user_id //用户id", + "string now_mouth //当前月", + "int32 page_type //页面类型(0-当前月,1-下一个月,2-上一个月)", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "repeated SignDate sign_date //签到板信息", + "string now_mouth //当前月", + "repeated CycleDate cycle_date //周期签到板信息", +] + +[[method.res.message]] +name = "SignDate" +field = [ + "string y //年", + "string m //月", + "string d //日", + "int32 sign_in //签到类型(0-未签,1-已签,2-漏签)", + "bool ban //是否非签到日期", + "int64 reward_id //奖品id,0即没有礼物", + "bool open //是否已经领奖", + "bool now_week //是否本周", + "bool now_day //是否今天", + "bool last_miss //是否最后一个漏签", + "bool now_mouth //是否本月", +] + +[[method.res.message]] +name = "CycleDate" +field = [ + "int64 sign_time //签到时间", + "int32 sign_in //签到类型(0-未签,1-已签,2-漏签)", + "bool now_day //是否今天", + "int64 reward_id //奖品id,0即没有礼物", + "string reward_img //奖品图片", + "string reward_title //奖品标题", + "int32 is_super //是否超级大奖(0-否,1-是)", + "string y //年", + "string m //月", + "string d //日", +] + +[[method]] +name = "Sign" +desc = "签到" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 sign_date //签到日期时间戳", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "int32 fail_type //失败状态(0-签到成功,1-签到失败,2-补签卡不足,3-已签到,4-补签签到,5-活动未开启)", + "bool has_reward //是否有礼物", + "string reward_title //奖品名称", + "int32 reward_num //获得的奖品数量", + "string img_url //奖品图片", + "int64 reward_id //奖品id", + "int32 receive_type //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送)", + "repeated KV kv_data //键值数据", + "string contact //联系方式", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method]] +name = "DiceMap" +desc = "大富翁地图" +[method.req] +field = [ + "int64 user_id //用户id", + "string map_hash_id //渲染地图的最后一格id,不传是当前用户所在位置外后54格", + "int32 prefix_step //返回前面的格子数字", + "int64 go_show_step //用户多少步之前都要返回GO这格子", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "repeated One list //奖品图片", +] + +[[method.res.message]] +name = "One" +field = [ + "string map_hash_id //地图id", + "int32 mark_type //格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几))", + "string reward_title //奖品名称", + "string img_url //奖品图片", + "int64 reward_id //奖品Id", +] + +[[method]] +name = "Dice" +desc = "大富翁骰子" +[method.req] +field = [ + "int64 user_id //用户id", + "string mark //道具标识(chance-再来一次,fixed_roll-固定点数)", + "string val //道具值", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "int32 fail_type //失败状态(0-成功,1-骰子不足,2-道具不足)", + "string map_hash_id //地图id", + "int32 roll_num //点数", + "int32 mark_type //格子标识类型(0-什么都没有,1-普通奖品,2-超级奖品,3-再次来一次,4-摇几得几)", + "string reward_title //奖品名称", + "string img_url //奖品图片", + "bool is_intact //是否是完整奖品", + "bool lack //奖品无库存", + "int64 reward_id //奖品ID", +] + +[[method]] +name = "Grow" +desc = "成长生命体" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 campaign_id //活动ID", + "string lang_mark //语言标识", +] + +[method.res] +field = [ + "bool get_grow //是否需要领取生命体", + "string title //名称", + "int32 step //当前等级", + "int32 num //当前拥有道具值", + "int32 lv_up_num //升级需要的道具值", + "string diff_p //剩余进度(36.9%)", + "bool will_die //是否将要死亡", + "bool is_die //是否已死亡", + "bool max_lv //是否最高等级", + "string reward_title //奖品名称", + "string reward_url //奖品图片", + "bool lack //奖品是否没有库存的", + "int64 reward_id //奖品Id", +] + +[[method]] +name = "GetGrow" +desc = "成长生命体" +[method.req] +field = [ + "int64 user_id //用户id", + "string title //生命体名称", + "int64 campaign_id //活动ID", +] + +[method.res] + +[[method]] +name = "Feed" +desc = "饲养生命体" +[method.req] +field = [ + "int64 user_id //用户id", + "int32 num //饲养道具数量", +] + +[method.res] +field = [ + "int32 fail_type //失败类型(0-饲养成功,1-道具不足,2-不能继续升级,3-生命体死亡)", + "bool lv_up //是否升级", + "int32 step //当前等级", + "int32 up_step //升级后的等级", + "int32 has_reward //可领奖类型(0-无奖品,1-领奖,2-库存不足)", + "string reward_title //奖品名称", + "string reward_url //奖品图片", + "int64 reward_id //奖品Id", + "int32 receive_type //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送)", + "repeated KV kv_data //键值数据", + "string contact //联系方式", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method]] +name = "GetFeed" +desc = "领取饲养道具" +[method.req] +field = [ + "int64 user_id //用户id", + "string mark //领取饲养道具标识(auto-自动产生的道具)", + "int64 campaign_id //活动ID", +] + +[method.res] + +[[method]] +name = "GrowRecord" +desc = "成长记录" +[method.req] +field = [ + "int64 user_id //用户id", + "string date //最后一组数据的日期", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "string date //日期", + "repeated Record records //记录", +] + +[[method.res.message]] +name = "Record" +field = [ + "string mark //标识(feed-喂养,get_grow-领取生命体,lv_up-升级,get_reward-领奖)", + "string his //时分秒", + "repeated KV var_data //变量数据", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应语言包的关键字,如:{{num}}", + "string value //关键字替换的值", + "int64 id_mark //数字id标识", +] + +[[method]] +name = "ContentLink" +desc = "内容链接" +[method.req] +field = [ + "int64 user_id //用户id", + "string mark //内容标识(qa-问题类型,ballot-抽签,chop-砍一刀)", + "int64 mark_id //id标识(qa-题目id,ballot-奖品id,chop-奖品id)", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "string link_url //分享链接", +] + +[[method]] +name = "LinkContent" +desc = "链接内容" +[method.req] +field = [ + "string ct_id //内容hash_id", +] + +[method.res] +field = [ + "string mark //内容标识(qa-问题类型,ballot-抽签,chop-砍一刀)", + "Qa qa //问题内容", + "Ballot ballot //抽签内容", + "Chop chop //砍一刀内容", +] + +[[method.res.message]] +name = "Qa" +field = [ + "int64 id //问题ID", + "string hash_id //问题对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "repeated Option options //选项", + "string answer_mark //答案类型(image_text-图文,text-文本)", + "bool home_share //是否首页分享" +] + +[[method.res.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //答案内容", + "string img_url //答案图片", +] + +[[method.res.message]] +name = "Ballot" +field = [ + "int64 id //奖品id", + "string title //奖品名称", + "string img_url //奖品图片(相对路径)", +] + +[[method.res.message]] +name = "Chop" +field = [ + "repeated ChopReward rewards //奖品列表", +] + +[[method.res.message]] +name = "ChopReward" +field = [ + "string title //奖品名称", + "string img_url //奖品图片(相对路径)", + "bool selected //是否选中", + "int64 id //奖品id", +] + +[[method]] +name = "ChopSelect" +desc = "选择砍一刀奖品" +[method.req] +field = [ + "int64 reward_id //奖品id", + "int64 user_id //用户id", + "int64 campaign_id //活动ID", +] + +[method.res] + +[[method]] +name = "ChopReselect" +desc = "重选砍一刀奖品" +[method.req] +field = [ + "int64 chop_reward_id //选择的奖品id", + "int64 user_id //用户id", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "bool reward_none //是否没有可选奖品了", +] + +[[method]] +name = "ChopHelp" +desc = "砍一刀助力记录" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 user_id //用户id", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动ID", + "string mark //助力标识", + "double percent //助力百分比", + "int64 created_time //助力时间戳", +] + +[[method]] +name = "ProjectList" +desc = "项目参与用户列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string project_hash_id //活动id", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动用户ID", + "string sub_user_id //第三方用户的user_id", + "string hash_id //活动用户对外id", + "string campaign_title //活动标题", + "string campaign_hash_id //活动hash_id", + "int64 created_at //创建时间", + "int64 effect_num //有效拉新人数", + "int32 is_new //是否新用户(0-否,1-是)", + "int32 help_status //助力状态(0-无此状态,1-助力成功,2-助力失败)", +] + +[[method]] +name = "LevelList" +desc = "用户等级列表" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //用户等级ID", + "string title //用户等级", + "string mark //用户等级标识", + "int64 created_at //创建时间", + "int64 num //关联数量", +] + +[[method]] +name = "LevelStore" +desc = "创建用户等级" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string title //用户等级", + "string mark //用户等级标识", +] + +[method.res] + +[[method]] +name = "LevelEdit" +desc = "更新用户等级" +[method.req] +field = [ + "int64 id //用户等级ID", + "string title //用户等级", + "string mark //用户等级标识", +] + +[method.res] + +[[method]] +name = "LevelDestroy" +desc = "删除用户等级" +[method.req] +field = [ + "int64 id //用户等级ID", +] + +[method.res] + +[[method]] +name = "MarkLevel" +desc = "用户等级标识列表" +[method.req] +field = [ + "int64 project_id //项目id", + "repeated string marks //用不标识集合", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //用户等级ID", + "string title //用户等级", + "string mark //用户等级标识", +] + +[[method]] +name = "FinishStep" +desc = "完成现金抽奖阶段" +[method.req] +field = [ + "int64 user_id //用户id", + "string step //进度节点(open_gift-开奖奖品盒子,trigger_share-触发分享)", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "int32 open_box //开奖金额", + "int32 left_box //左边的盒子金额", + "int32 right_box //右边的盒子金额", +] + +[[method]] +name = "Spin" +desc = "现金转盘抽奖" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "int32 fail_type //失败类型(0-正常,1-缺乏能量,2-库存不足)", + "int64 id //转盘id", +] + +[[method]] +name = "CashRecords" +desc = "现金转盘记录" +[method.req] +field = [ + "int64 user_id //用户id", + "int32 page //当前页", + "int32 per_page //每页条数", + "int32 type //记录类型(1-邀请,2-金额情况,3-能量情况,4-奖品记录)", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "string sub_user_id //被邀请人的第三方用户ID", + "string title_mark //语言包对应的翻译标识", + "int64 created_at //创建时间", + "string dec_or_add //减或者加(dec-减,add-加)", + "double val //减或者加的值", + "bool is_help //是否助力成功", +] + +[[method]] +name = "MixReward" +desc = "合成奖品" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 reward_id //奖品id", + "int64 campaign_id //活动ID", +] + +[method.res] +field = [ + "bool lack //奖品无库存", + "int64 reward_id //奖品ID", + "string reward_title //奖品名称", + "string img_url //奖品图片", + "int32 receive_type //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送)", + "repeated KV kv_data //键值数据", + "string contact //联系方式", + "string reward_hash_id //领取的用户奖品hash_id", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method]] +name = "DiceRecord" +desc = "骰子记录" +[method.req] +field = [ + "int64 user_id //用户id", + "string user_hash_id //用户hash_id", + "int32 record_type //记录类型(1-骰子记录,2-奖品记录)", + "string mark //记录标识", + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动ID", + "string campaign_hash_id //活动hash_id", + "repeated int32 conds //过滤条件(1-获得骰子;2-获得奖品;3-获得碎片;4-获得幸运骰;5-掷骰子;6-使用幸运骰子;7-完成任务;8-获得奖品)", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //记录id", + "string mark //记录标识(roll-掷骰子,get_roll_all-完成所有任务获得骰子,get_roll_task-完成任务获得骰子,roll_collect-获得碎片,roll_chance-再摇一次,lucky-使用幸运骰,get_lucky-获得幸运骰,normal_reward-普通奖品,supper_reward-超级大奖)", + "int64 created_time //记录时间", + "Data data //数据", +] +[[method.res.message]] +name = "Data" +field = [ + "int32 point //掷骰子的点数", + "string title //奖品标题", + "string reward_title //奖品名称", + "string reward_url //奖品图片", + "int32 is_supper //是否超级大奖", + "int32 chance //获得的骰子个数", + "int32 lucky_chance //获得的幸运骰个数", + "string task_title //完成任务的标题", + "int32 receive_type //发放类型(0-无操作,1-系统发放,2-联系客服,3-客户端推送,4-提交表单)", + "repeated KV kv_data //键值数据", + "string contact //联系方式", + "string reward_hash_id //领取的用户奖品hash_id", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "bool lack //是否没有库存", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", + "string custom_reward_val //自定义的奖品值", + "string pc_param //pc端的跳转参数", + "int64 reward_id //活动奖品id", + "int32 points_use_num //消耗的积分", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "RewardForm" +desc = "奖品需要填写的表单" +[method.req] +field = [ + "string reward_hash_id //领取的用户奖品hash_id", + "string lang_mark //展示的语言", + "int64 reward_id //活动奖品id", + "int64 user_id //用户id", + "int64 campaign_id //活动ID", + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "bool is_submit //是否已经填写表单", + "string title //表单标题", + "repeated Item items //表单项", + "int64 id //奖品记录id", + "int64 reward_id //活动奖品id", +] + +[[method.res.message]] +name = "Item" +field = [ + "string name //表单项展示的名称", + "string key //表单项需要提交的key", + "string value //表单项填写的值", +] + +[[method]] +name = "SubmitForm" +desc = "提交表单" +[method.req] +field = [ + "string reward_hash_id //领取的用户奖品hash_id", + "repeated Item items //表单项", + "int64 campaign_id //活动ID", +] + +[[method.req.message]] +name = "Item" +field = [ + "string name //表单项展示的名称", + "string key //表单项需要提交的key", + "string value //表单项填写的值", +] + +[method.res] +field = [ + "int32 fail_type //提交失败状态(0-提交成功,1-不能重复提交,2-表单参数异常,需要刷新表单,3-非需要填写表单奖品)", +] + + +[[method]] +name = "GetAdsUrl" +desc = "广告停留回传" +[method.req] +field = [ + "int64 cond_id //条件id", + "int64 user_id //条件id", +] + +[method.res] +field = [ + "string url //广告地址", + "string token //token", + "string user_hash_id //用户hash_id", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int64 jump_time //跳转到时间", + "AdG ad_g //谷歌账号信息" +] + +[[method.res.message]] +name = "AdG" +field = [ + "string adc //谷歌账号id", + "string ga_show_id //谷歌展示广告id", + "string ga_embed_id //谷歌内嵌广告id", + "string ga_double_id //谷歌多重广告id", +] + + +[[method]] +name = "AdsStay" +desc = "广告停留回传" +[method.req] +field = [ + "string token //token", + "string user_hash_id //用户hash_id", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int64 jump_time //跳转到时间", +] + +[method.res] +field = [ + "int32 stay_lave //剩余时长(单位:s)", + "bool done //是否完成任务", +] + +[[method]] +name = "ClueNotified" +desc = "通知信息已经被接收" +[method.req] +field = [ + "int64 user_id //跳转到时间", +] + +[method.res] + +[[method]] +name = "ChangeUserLevel" +desc = "修改用户等级" +[method.req] +field = [ + "int64 project_id //项目id", + "string sub_user_id //第三方的用户id", + "string user_level //用户等级,多个用逗号分隔", +] + +[method.res] + +[[method]] +name = "ChopReward" +desc = "砍一刀可选奖品" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated Reward rewards //奖品列表", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "string title //奖品标题", + "string img_url //奖品图片", +] + +[[method]] +name = "HelpPercent" +desc = "助力进度" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "bool is_fix //是否是默认赠送的", + "double old_percent //追加前的进度", + "double add_percent //追加进度", +] + +[[method]] +name = "InvokeCond" +desc = "触发前置条件" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int32 pre_cond //前置任务(1-点击任务icon,2-完成1个任务后,3-完成2个任务后,4-进入活动30秒后)", +] + +[method.res] +field = [ + "int64 id //达标条件ID", + "string desc //达标条件", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", + "int32 task_chance //完成发放的次数(如:骰子数)", + "string web_url //web端跳转地址", + "string app_param //app事件参数", + "int32 event_type //事件来源(1-自定义事件,2-广告事件)", + "int32 view_type //广告观看路径(1-APP内,2-APP外)", + "int32 go_show //是否显示“去完成按钮”(0-否,1-是)", + "string ads_strategy_id //策略id", + "int32 is_super //是否超级任务(0-否,1-是)", + "int32 has_pre //是否有前置任务(0-否,1-是)", + "Reward reward //奖品", + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品)", + "int64 expired_sec //距离过期还有多少秒", + "string pc_param //pc事件参数", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "string title //奖品标题", + "string img_url //奖品图片", +] + +[[method]] +name = "KeepReward" +desc = "激励养成可选奖品" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated Reward rewards //奖品列表", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //活动奖品id", + "string title //奖品标题", + "string img_url //奖品图片", + "int64 num //被选择的数量", + "int32 status //奖品状态(0-正常,1-无库存,2-超过可获取上限)", +] + +[[method]] +name = "KeepSelect" +desc = "选择激励养成奖品" +[method.req] +field = [ + "int64 reward_id //奖品id", + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "int32 status //状态(0-正常,1-奖品下架,2-库存不足,3-超过获取上限)", +] + +[[method]] +name = "KeepCollect" +desc = "激励养成收集一级道具" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "repeated Reward gets //获得的奖励", + "int32 num // 收集的爱心数", +] +[[method.res.message]] +name = "Reward" +field = [ + "int32 reward_type //奖励类型(1-道具,2-奖品)", + "int32 chance //道具数量", + "int64 reward_id //奖品id", + "string reward_title //奖品名称", + "string reward_img //奖品图片", + "bool lack //奖品没有库存", + "bool last_reward //是否最终奖品", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-监听器,4-提交表单)", +] + +[[method]] +name = "KeepFeed" +desc = "激励养成收集一级道具" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "int32 status //状态(0-正常,1-请收爱心,2-狗粮不足)", + "int32 add_percent //获得的奖励", +] + +[[method]] +name = "MachineSave" +desc = "激励养成保存机器道具" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", + "double num //道具数量", +] + +[method.res] + +[[method]] +name = "MachineRecycle" +desc = "激励养成回收机器道具" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", + "double num //道具数量", +] + +[method.res] +field = [ + "int32 machine_limit //机器被限制(0-正常,1-每日限制)", + "int64 next_full //离线狗粮机填满剩余秒数", + "int32 get_num //进入粮食袋的狗粮", +] + + +[[method]] +name = "GetPropFeed" +desc = "收喂养次数的道具" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "int32 num //道具数量", +] + +[[method]] +name = "KeepLog" +desc = "激励养成记录" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 campaign_id //活动id", + "int64 user_id //用户id", + "repeated int32 type //类型", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", +] +[[method.res.message]] +name = "One" +field = [ + "int32 type //日志类型(1-收集爱心,2-获得狗粮,3-喂养狗粮)", + "string source //来源标识", + "string val //数值", + "int64 created_at //创建时间", +] + +[[method]] +name = "KeepReselect" +desc = "激励养成重新选择" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "int32 status //状态(0-正常,1-超过最大养成次数,2-当前宠物还能养)", +] + +[[method]] +name = "KeepGuide" +desc = "激励养成指引" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "int32 reward_type //奖励类型(1-道具,2-奖品)", + "int32 chance //道具数量", + "int64 reward_id //奖品id", + "string reward_title //奖品名称", + "string reward_img //奖品图片", + "bool lack //奖品没有库存", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-监听器,4-提交表单)", +] + +[[method]] +name = "KeepFirstInvite" +desc = "激励养成首邀状态" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "int32 open_invite //开启邀请(0-关闭,1-开启)", + "int32 day_first_invite //当天是否还没完成第一次邀请(0-否,1-是)", + "int32 day_first_feed //当天是否还没完成第一次喂养(0-否,1-是)", + "int64 expired_sec //过期剩余秒数", +] + +[[method]] +name = "Child" +desc = "子活动信息" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] +field = [ + "Blind blind //每日盲盒", + "Lucky lucky //每日抽奖", + "Sign sign //签到抽奖", + "Invite invite //竞赛抽奖", +] + +[[method.res.message]] +name = "Invite" +field = [ + "int32 open // 是否开启(0-否,1-是)", + "int32 status //状态(1-待完成,2-已完成)", + "int64 start //开始时间", + "int64 end //结束时间", + "int64 invite_num //邀请数", + "string rank // 排名", + "repeated RankOne rank_list //排行榜列表", + "Record record //奖品信息", + "string child_hash_id //子活动hash_id", +] + +[[method.res.message]] +name = "RankOne" +field = [ + "string sub_user_id //用户id", + "int64 invite_num //邀请人数", + "int64 reward_id //活动奖品id", + "string title //奖励内容", + "string img //奖品图片", + "string prop_mark //道具类型(reward-奖品,chance-活动道具)", + "int32 reward_num //发放奖品数量", +] + +[[method.res.message]] +name = "Sign" +field = [ + "int32 open // 是否开启(0-否,1-是)", + "int32 status //状态(1-待完成,2-已完成)", + "repeated Reward rewards //签到板数据", + "Record record //奖品信息", + "int64 reward_id //上一次中奖的活动奖品id", + "string child_hash_id //子活动hash_id", +] + +[[method.res.message]] +name = "Lucky" +field = [ + "int32 open // 是否开启(0-否,1-是)", + "int32 status //状态(1-待完成,2-已完成)", + "repeated Reward rewards //奖品列表", + "Record record //奖品信息", + "string child_hash_id //子活动hash_id", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 reward_id //活动奖品id", + "string title //奖励内容", + "string img //奖品图片", + "string prop_mark //道具类型(reward-奖品,chance-活动道具)", + "int32 reward_num //发放奖品数量", + "int32 is_super //是否超级大奖(0-否,1-是)", + "int32 is_get //是否被领取(0-否,1-是)", +] + +[[method.res.message]] +name = "Blind" +field = [ + "int32 open // 是否开启(0-否,1-是)", + "int32 status //状态(1-待完成,2-已完成)", + "Record record //奖品信息", + "string child_hash_id //子活动hash_id", +] + +[[method.res.message]] +name = "Record" +field = [ + "int64 id //奖品记录int型id", + "string hash_id //奖品记录string型hash_id", + "int64 reward_id //活动奖品id", + "string title //奖励内容", + "repeated KV kv_data //键值对", + "string img //奖品图片", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", + "string custom_reward_val //自定义的奖品值", + "string prop_mark //道具类型(reward-奖品,chance-活动道具)", + "int32 reward_num //发放奖品数量", + "int32 is_super //是否超级大奖(0-否,1-是)", + "string pc_param //pc端的跳转参数", + "int32 receive_type //领取类型(1-服务端推送,2-监听器,3-客户自主发放)", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "ChildActive" +desc = "参与子活动" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", + "int32 child_type //子活动类型(1-邀新竞赛,2-签到,3-抽奖,4-盲盒,5-超级任务)", +] + +[method.res] +field = [ + "int32 status //状态(0-正常,1-尚未结算)", + "Record record //奖品信息", +] + +[[method.res.message]] +name = "Record" +field = [ + "int64 reward_id //活动奖品id", + "string prop_mark //道具类型(reward-奖品,chance-活动道具)", + "int32 reward_num //发放奖品数量", + "int32 is_super //是否超级大奖(0-否,1-是)", + "string title //奖励内容", + "repeated KV kv_data //键值对", + "string img //奖品图片", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", + "int64 id //奖品记录int型id", + "string hash_id //奖品记录string型hash_id", + "string custom_reward_val //自定义的奖品值", + "string pc_param //pc端的跳转参数", + "int32 receive_type //领取类型(1-服务端推送,2-监听器,3-客户自主发放)", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "GoldFinishStep" +desc = "完成金币任务阶段" +[method.req] +field = [ + "int64 user_id //用户id", + "string step //进度节点(open_gift-开礼品盒,show_reward-需要弹出奖品窗口,last_spin-提示最后一次抽奖获得奖品, trigger_share-赠送能量)", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "double open_box //开奖金额", + "double left_box //左边的盒子金额", + "double right_box //右边的盒子金额", +] + +[[method]] +name = "GoldNotify" +desc = "金币获取通知" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "int32 old_gold //追加前的进度", + "int32 add_gold //追加进度", +] + +[[method]] +name = "GoldRecord" +desc = "金币获取记录" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int32 page //当前页", + "int32 per_page //每页条数", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "string title //任务标题", + "int32 gold_num //金币数量", + "int64 created_at //创建时间", + "string mark //语言包标识", +] + +[[method]] +name = "Deduct" +desc = "扣除积分" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "int32 status //扣除状态(0-正常,1-缺积分,2-达到上限,3-当前场次已经结束,无法参加)", + "int64 total //总奖池金币数", + "int32 use_num //参与了几次", + "int64 get_coin //获得的金币数", + "int64 open_sec //距离开奖的秒数", +] + +[[method]] +name = "Gain" +desc = "领取积分" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "int32 status //状态(0-正常;1-没到开奖时间;2-参与次数不足;3-领奖超时;4-已领取不能再领)", + "int64 get_coin //领取的积分数量" +] + +[[method]] +name = "CoinRecord" +desc = "金币池记录" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "int32 page //当前页", + "int32 per_page //每页条数", + "int64 scene_id //场次id", + "repeated int32 type //日志类型(1-消耗金币,2-获得金币,3-奖励)", + "string source //来源标识", + "int32 t_offset //时区", + "int64 start //创建时间开始时间戳", + "int64 end //创建时间结束时间戳", + "string sub_user_id //用户id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //记录id", + "int32 type //日志类型(1-消耗金币,2-获得金币)", + "int64 created_at //创建时间", + "string source //来源标识", + "int64 num //数量", + "string sub_user_id //第三方用户id", + "string title //场次说明", +] + +[[method]] +name = "ChildList" +desc = "子活动用户列表" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", + "int32 page //当前页", + "int32 per_page //每页条数", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "int32 t_offset //时区", + "int32 pid_type //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户)", + "string parent_user_mark //上级用户标识关键字", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", + "int32 child_type //子活动类型", + "int32 t_offset //时区", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //记录id", + "int64 join_at //参与时间", + "string sub_user_id //用户", + "string parent //用户上级", + "Num sign //签到数据", + "Num invite //邀请数据", + "Num blind //盲盒数据", + "Num lottery //抽奖数据", +] +[[method.res.message]] +name = "Num" +field = [ + "int64 num //签到天数,邀请人数,开盒次数,抽奖次数", +] + +[[method]] +name = "ReceiveReward" +desc = "领取奖励" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", + "int64 task_id //任务id", +] + +[method.res] +field = [ + "string prop_mark //任务道具", + "int32 chance //获得道具的数量", + "Reward reward //奖品信息", +] +[[method.res.message]] +name = "Reward" +field = [ + "string hash_id //领奖记录hash_id", + "string title //奖品名称", + "string img //奖品图片", + "string jump_url //跳转地址", + "repeated KV kv_data //奖品自定义参数数据", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器)", + "string contact //联系方式", + "int64 created_at //创建时间", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", + "int32 lack //是否缺乏库存(1-是,0-否)", + "int32 reward_num //奖励数量", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "LotteryLog" +desc = "抽奖玩法日志" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string campaign_hash_id //活动id", + "string user_hash_id //用户id", + "string sub_user_id //用户id", + "repeated string source //记录标识(sign-每日签到,install-安装拉新任务,register-注册拉新任务,cond_all-完成配置任务,cond_one-完成指定任务,manual_cond_all-手动领取完成配置任务,manual_cond_one-手动领取完成的指定任务,lottery-抽奖)", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //记录id", + "int64 created_at //创建时间", + "int32 type //日志类型(1-获得抽奖机会,2-消耗抽奖机会)", + "string source //记录标识(sign-每日签到,install-安装拉新任务,register-注册拉新任务,cond_all-完成配置任务,cond_one-完成指定任务,manual_cond_all-手动领取完成配置任务,manual_cond_one-手动领取完成的指定任务,lottery-抽奖)", + "string task_title //奖品图片", + "string reward_title //奖品标题", + "int32 chance //消耗或者获得的抽奖机会次数", + "int32 points_use_num //消耗的积分", +] + +[[method]] +name = "UserList" +desc = "活动用户数据" +[method.req] +field = [ + "repeated int64 ids //用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated One list //数据集合", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动用户ID", + "string hash_id //活动用户对外id", + "string sub_user_id //用户", + "string device_id //用户", +] + +[[method]] +name = "CashAgain" +desc = "现金大抽奖再玩一次" +[method.req] +field = [ + "int64 campaign_id //活动id", + "int64 user_id //用户id", +] + +[method.res] + +[[method]] +name = "DiceCollect" +desc = "用户手机碎片" +[method.req] +field = [ + "string campaign_hash_id //活动id", + "string hash_id //用户id", +] + +[method.res] +field = [ + "repeated One list //数据集合", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 reward_id //奖品id", + "int32 num //当前拥有碎片数", + "int32 collect_num //收集碎片总数", + "string title //奖品名称", + "int32 mix_num //合成次数", + "int32 max_num //可获得碎片上限", +] + +[[method]] +name = "ClientReward" +desc = "客户端奖品" +[method.req] +field = [ + "string user_id //第三方用户id", + "string porject_hash_id //项目id", + "int64 campaign_id //活动id", + "int64 campaign_user_id //活动用户id", +] + +[method.res] +field = [ + "repeated Reward rewards //奖品集合", +] + +[[method.res.message]] +name = "Reward" +field = [ + "string hash_id //发奖记录hash_id", + "int64 created_at //发奖时间", + "repeated KV kv_data //键值对", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method]] +name = "PointsUse" +desc = "积分兑换" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "int32 status //状态(0-成功,1-积分不足,2-积分使用关闭,3-积分每日使用次数超限额,4-积分使用次数超限额)", +] + +[[method]] +name = "Chat" +desc = "Ai聊天" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "string input //发送信息", +] + +[method.res] +field = [ + "int32 status //状态(0-成功,1-token不足,2-每日限制)", + "string content //内容", + "string source //来源(input-输入,output-输出,system-系统)", + "int32 msg_type //消息类型(1-文本,2-固定文案,3-系统通知)", + "int64 created_at //创建时间", + "int64 msg_id //消息id", +] + +[[method]] +name = "ChatList" +desc = "聊天信息" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int64 last_id //最后一条记录id", + "int32 per_page //每页条数", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "string content //内容", + "string source //来源(input-输入,output-输出,system-系统)", + "int32 msg_type //消息类型(1-文本,2-固定文案,3-系统通知)", + "int64 created_at //创建时间", + "int64 msg_id //消息id", +] + +[[method]] +name = "ScheduleList" +desc = "赛程信息" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int32 tab_type //赛程类型(1-进行赛事,2-全部,3-已参与)", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //赛程id", + "string desc //赛程标题", + "string vs_img //赛程图片", + "string vs_date //开赛日期", + "int32 vs_tz //开赛时区", + "int64 vote_countdown //投票倒计时", + "int32 status //投票状态(1-即将投票,2-投票中,3-待结算,4-已结算)", + "int32 win_type //结算获奖类型(1-队伍胜利,2-平局)", + "int64 win_team_id //结算获胜队伍id", + "repeated Team teams //队伍集合", + "UserVote user_vote //用户状态", + "Reward reward //奖励", + "repeated Vote votes //用户投票", + "repeated string other_vote //其他投票选项", + "repeated Score scores //队伍分数", + "int32 open_odds //是否开启赔率(0-否,1-是)", + "string odds_left //队伍1赔率", + "string odds_right //队伍2赔率", + "string odds_draw //平局赔率", +] +[[method.res.message]] +name = "Score" +field = [ + "int64 team_id //队伍id", + "string score //队伍分数", +] +[[method.res.message]] +name = "Vote" +field = [ + "int32 win_type //获奖类型(1-队伍胜利,2-平局)", + "int64 win_team_id //获胜队伍id", + "int64 num //投票次数", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍logo", + "string score //队伍分数", +] +[[method.res.message]] +name = "UserVote" +field = [ + "int32 user_win_type //用户选择的获奖类型(1-队伍胜利,2-平局)", + "int64 user_win_team_id //用户选择的获胜队伍id", + "bool is_win //是否赢得奖励", + "int32 vote_num //投票次数", +] +[[method.res.message]] +name = "Reward" +field = [ + "int64 reward_id //活动奖励id", + "string prop_mark //奖品类型(reward-奖品,point-积分)", + "string title //奖品名称", + "string img //奖品图片", + "repeated KV kv_data //奖品自定义参数数据", + "int32 receive_type //领取类型(0-无需处理,1-服务端推送,2-客户自主发放,3-客户端监听器)", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", + "int32 prop_num //道具数量", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "MallList" +desc = "用户商城奖品列表" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //商城奖品id", + "int64 reward_id //奖品id", + "string title //奖品标题", + "string img_url //奖品图片URL", + "int64 remain //剩余库存", + "int32 status //状态(1-上架,2-待上架,3-下架,4-删除)", + "int64 up_remain //上架剩余时间", + "int32 coin_num //奖品金币数量", +] + +[[method]] +name = "Exchange" +desc = "商城奖品兑换" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int64 mall_item_id //商城商品id", +] + +[method.res] +field = [ + "int32 status //状态(0-成功,1-库存不足,2-兑换上限,3-商品已下架)", + "int64 id //兑换记录id", + "int64 reward_id //奖品id", + "string title //奖品名称", + "string img_url //图片地址", + "repeated KV kv_data //奖品对应的键值数据", + "int32 receive_type //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器)", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string custom_reward_val //自定义数据", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", + "string fail_type //失败类型", + "string fail_msg //失败具体原因", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "VoteList" +desc = "投票列表" +[method.req] +field = [ + "string user_hash_id //活动用户id", + "string campaign_hash_id //活动id", +] + +[method.res] +field = [ + "repeated One list //投票列表", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //投票id", + "repeated Team teams //队伍", + "int32 win_type //获奖类型(1-队伍胜利,2-平局)", + "int64 win_team_id //获胜队伍id", + "int32 free_vote //免费投票次数", + "int32 point_vote //积分投票次数", +] +[[method.res.message]] +name = "Team" +field = [ + "int64 id //队伍id", + "string name //队伍名称", + "string logo_img //队伍图标", +] + +[[method]] +name = "VsTipReward" +desc = "接受投票结果" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] + +[[method]] +name = "UnoRandCard" +desc = "uno随机牌" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "string prop_mark //道具类型(three- +3道具,five- +5道具, fix-固定道具)", + "string color_mark //道具颜色类型(red-红,green-绿,blue-蓝,yellow-黄)", +] + +[method.res] +field = [ + "int32 status //状态(0-成功,1- 抽奖次数不足,2-道具不足,3-道具不存在)", + "repeated Card cards //获得的牌牌", +] +[[method.res.message]] +name = "Card" +field = [ + "string mark //卡颜色标识", + "int32 card_no //卡编号", +] + +[[method]] +name = "UnoClaim" +desc = "uno领取牌奖励" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "string color_mark //道具颜色类型(red-红,green-绿,blue-蓝,yellow-黄)", +] + +[method.res] +field = [ + "int32 status //状态(0-成功,1-正在收集中,2-已经收集过了)", + "int64 id //记录id", + "string hash_id //记录hash_id", + "int64 reward_id //奖品id", + "string title //奖品名称", + "string img_url //图片地址", + "repeated KV kv_data //奖品对应的键值数据", + "int32 receive_type //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器)", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string custom_reward_val //自定义数据", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "UnoCard" +desc = "uno卡牌" +[method.req] +field = [ + "string user_hash_id //活动用户id", + "string campaign_hash_id //活动id", +] + +[method.res] +field = [ + "repeated One list //投票列表", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //卡组id", + "string mark //颜色标识", + "repeated int32 card_info //卡牌信息", + "int32 pre_intact_num //待合成奖品数", + "int32 intact_num //完整奖品数", + "int32 limit_num //上限奖品数", +] + +[[method]] +name = "Show" +desc = "用户详情" +[method.req] +field = [ + "string user_hash_id //活动用户id", + "string campaign_hash_id //活动id", +] + +[method.res] +field = [ + "int64 id //用户id", + "string hash_id //用户列表对外id", + "string user_id //第三方用户id", + "string device_id //设备id", + "int64 created_at //参与时间", + "int32 source //参与来源", + "string lang_mark //语言标识", + "repeated string lang_marks //历史关联语言", + "string lv_mark //用户标签", + "string lv_marks //历史用户标签", + "string os //操作系统", + "string oss //历史操作系统", + "int64 join_at //首次访问时间", + "int64 join_at_last //最后访问时间", + "int32 tz //所属时区", +] + +[[method]] +name = "EventFirstVisit" +desc = "首次访问活动" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated EventReward rewards //奖励" +] + +[[method.res.message]] +name = "EventReward" +field = [ + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "Reward reward //奖品", + "int32 chance //道具数量", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //记录id", + "string hash_id //记录hash_id", + "int64 reward_id //奖品id", + "int32 reward_num //奖品数量", + "string title //奖品名称", + "string img_url //图片地址", + "repeated KV kv_data //奖品对应的键值数据", + "int32 receive_type //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器)", + "string contact //联系方式", + "string custom_reward_val //自定义数据", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "FindByUniq" +desc = "通过唯一键找用户id" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string sub_user_id //用户id", + "string device_id //设备id", +] + +[method.res] +field = [ + "int64 id //用户id", +] + +[[method]] +name = "TaskTip" +desc = "任务提示" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", +] + +[method.res] +field = [ + "repeated EventReward rewards //奖励", + "int32 l //长度", +] + +[[method.res.message]] +name = "EventReward" +field = [ + "string prop_mark //奖励的道具类型(chance-道具数量,reward-奖品,point-积分)", + "Reward reward //奖品", + "int32 chance //道具数量", +] + +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //记录id", + "string hash_id //记录hash_id", + "int64 reward_id //奖品id", + "int32 reward_num //奖品数量", + "string title //奖品名称", + "string img_url //图片地址", + "repeated KV kv_data //奖品对应的键值数据", + "int32 receive_type //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器)", + "string contact //联系方式", + "string custom_reward_val //自定义数据", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "TaskTipOk" +desc = "任务提示完成" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int32 l //长度", +] + +[method.res] + +[[method]] +name = "CoinLog" +desc = "金币日志" +[method.req] +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "int32 page //当前页", + "int32 per_page //每页条数", + "int32 type //每页条数", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 created_at //创建时间", + "string mark //标识", + "int32 num //数量", + "int32 type //类型", +] diff --git a/proto/toml/w_coin.toml b/proto/toml/w_coin.toml new file mode 100644 index 0000000..adf4e2b --- /dev/null +++ b/proto/toml/w_coin.toml @@ -0,0 +1,54 @@ +[service] +name = "WCoin" +desc = "积分服务" + +[[method]] +name = "Save" +desc = "积分配置保存" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string title //积分标题", + "int32 open_push //同步推送(0-关闭,1-开启)", + "repeated string exp_select //有效期选择['7','30','90', '0']", + "repeated Lang langs //语言配置", +] + +[[method.req.message]] +name = "Lang" +field = [ + "string lang_mark //语言标识", + "string title //展示标题", + "string img_url //展示图片", + "string rule //积分规则", + "int32 is_default //是否默认(0-否,1-是)", +] +[method.res] + +[[method]] +name = "Show" +desc = "积分配置展示" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 project_id //项目ID", +] + +[method.res] +field = [ + "string title //积分标题", + "int32 open_push //同步推送(0-关闭,1-开启)", + "repeated string exp_select //有效期选择['7','30','90', '0']", + "repeated Lang langs //语言配置", +] + +[[method.res.message]] +name = "Lang" +field = [ + "string lang_mark //语言标识", + "string title //展示标题", + "string img_url //展示图片", + "string rule //积分规则", + "int32 is_default //是否默认(0-否,1-是)", +] + diff --git a/proto/toml/w_common.toml b/proto/toml/w_common.toml new file mode 100644 index 0000000..57770c5 --- /dev/null +++ b/proto/toml/w_common.toml @@ -0,0 +1,237 @@ +[service] +name = "WCommon" +desc = "通用服务" + +[[method]] +name = "PolicyToken" +desc = "获取阿里云token" +[method.req] +field = [ + "string file_suffix //文件后缀", +] + +[method.res] +field = [ + "string access_key_id //oss accessKeyId", + "string host //oss访问域名", + "string upload_url //上传地址", + "int64 expire //过期时间,单位(s)", + "string signature //验签字符串", + "string dir //存储文件夹(文件前缀)", + "string key //文件名称", + "string policy //验签token", +] + +[[method]] +name = "Whitelist" +desc = "服务器白名单" +[method.req] + +[method.res] +field = [ + "repeated string ips //服务器列表", +] + +[[method]] +name = "Download" +desc = "下载" +[method.req] +field = [ + "int64 user_id //下载人id", + "string mark //campaign_report-活动报表,fission_user-活动用户,fission_reward_record-活动奖品,fission_user_stat-活动排行榜,ads_table-广告报表,new_user_list-新版用户列表", + "CampaignReport campaign_report //活动报表条件", + "FissionUser fission_user //活动用户条件", + "FissionRewardRecord fission_reward_record //活动奖品条件", + "FissionUserStat fission_user_stat //活动排行榜条件", + "AdsTable ads_table //广告报表条件", + "NewUserList new_user_list //新版用户列表", + "CoinRecord coin_record //金币池领扣记录", + "ChildList child_list //子活动用户列表", +] + +[[method.req.message]] +name = "CampaignReport" +field = [ + "string campaign_hash_id //活动hash_id", + "int64 start_time //统计开始时间时间戳", + "int64 end_time //统计结束时间时间戳", +] + +[[method.req.message]] +name = "FissionUser" +field = [ + "string campaign_hash_id //活动hash_id", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "string parent_user_mark //上级用户标识关键字", + "int32 source //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件)", +] + +[[method.req.message]] +name = "FissionRewardRecord" +field = [ + "string campaign_hash_id //活动hash_id", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "repeated int32 status //奖品状态(1-发送成功,2-待发送,3-发送失败,4-手动发放)", + "string reward_title //奖品名称", + "int32 t_offset //时区", + "int32 is_child //是否子活动奖品", +] + +[[method.req.message]] +name = "FissionUserStat" +field = [ + "string campaign_hash_id //活动hash_id", + "string type //数据类型(空-旧报表,invite-下载/注册排行榜,task-用户完成指定事件排行榜,grow-养成排行榜)", +] + +[[method.req.message]] +name = "AdsTable" +field = [ + "string campaign_hash_id //活动hash_id", + "int64 start_time //统计开始时间时间戳", + "int64 end_time //统计结束时间时间戳", +] + +[[method.req.message]] +name = "NewUserList" +field = [ + "string campaign_hash_id //活动hash_id", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "string parent_user_mark //上级用户标识关键字", + "int32 source //来源(1-直接访问,2-打开事件,3-安装事件,4-注册事件,5-自定义事件)", + "string lang_mark //上级用户标识关键字", + "int32 t_offset //时区", + "int32 pid_type //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户)", + "int32 join_type //上级用户类型(1-进入过活动的用户,2-没有进入过活动的用户)", + "repeated int32 user_cond //用户条件(1-有安装的用户,2-有注册的用户)", +] + +[[method.req.message]] +name = "CoinRecord" +field = [ + "int64 user_id //活动用户id", + "int64 campaign_id //活动id", + "string campaign_hash_id //活动hash_id", + "int64 scene_id //场次id", + "int32 type //日志类型(1-消耗金币,2-获得金币)", + "string source //来源标识", + "int32 t_offset //时区", + "int64 start //创建时间开始时间戳", + "int64 end //创建时间结束时间戳", + "string sub_user_id //用户id", +] + +[[method.req.message]] +name = "ChildList" +field = [ + "string campaign_hash_id //活动hash_id", + "string user_mark //用户标识关键字", + "int64 start //参与时间开始时间戳", + "int64 end //参与时间结束时间戳", + "string parent_user_mark //上级用户标识关键字", + "int32 t_offset //时区", + "int32 pid_type //上级用户类型(0-指定上级用户id,1-仅有上级的用户,2-仅无上级的用户)", +] + +[method.res] +field = [ + "string hash_id //报表id", +] + +[[method]] +name = "DownloadStatus" +desc = "下载状态" +[method.req] +field = [ + "string hash_id //报表id", +] + +[method.res] +field = [ + "int32 status //状态(1-下载中,2-下载完成,3-下载失败,4-已过期)", + "string url //文件地址", + "string fail_msg //失败原因", + "string progress //导出进度", +] + +[[method]] +name = "OperateLog" +desc = "dashboard操作日志" +[method.req] +field = [ + "int64 user_id //员工id", + "string ip //客户端ip地址", + "string mark //操作唯一标识,一种操作对应一个标识,长度不能超过32个字符串", + "string mark_id //操作数据追踪类型id,如:修改某个活动奖品,那这个就是奖品id(其实这个字段为了优化mark索引的,所以不传也可以)", + "string data //记录的数据 json格式字符串", +] + +[method.res] + +[[method]] +name = "SaveMaterial" +desc = "保存素材" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int32 material_type //素材类型(1-图片)", + "string material_data //素材类型的数据(图片类型:地址图片)", +] + +[method.res] +field = [ + "int64 id //素材id", +] + +[[method]] +name = "MaterialList" +desc = "素材列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "int32 material_type //素材类型(1-图片)", + "int64 project_id //项目id", + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //数据集合", + "int64 total //数据总数", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //素材id", + "int32 material_type //素材id", + "string material_data //素材数据", +] + +[[method]] +name = "CompanyMade" +desc = "企业定制组件列表" +[method.req] +field = [ + "int64 company_id //企业id", +] + +[method.res] +field = [ + "repeated One list //数据集合", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //素材id", + "string mark //标识(lv_api支持用户类型配置api)", + "repeated string fission_temp //支持的模版" +] diff --git a/proto/toml/w_fission.toml b/proto/toml/w_fission.toml new file mode 100644 index 0000000..6c20f36 --- /dev/null +++ b/proto/toml/w_fission.toml @@ -0,0 +1,259 @@ +[service] +name = "WFission" +desc = "玩法服务" + +[[method]] +name = "List" +desc = "玩法列表" +[method.req] +field = [ + "string lang //语言(zh-cn、en)", + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", + "repeated int32 targets //活动目标集合", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //玩法id", + "string mark //标识", + "string logo //玩法logo图", + "string title //玩法标题", + "bool can_use //是否可以用", + "repeated string desc //玩法说明(例如:[\"说明1\", \"说明2\"]", + "repeated string color //颜色值" +] + +[[method]] +name = "TemplateList" +desc = "玩法模版列表" +[method.req] +field = [ + "string mark //玩法标识", + "int32 target //活动目标(1-app下载/注册;2-提升关键指标转换率;3-app活跃/留存)", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //模板组ID", + "string mark //模板组唯一标识", + "string cover_url //模板组封面", + "string title //模板组标题", + "int32 sort //排序(越小越前)", + "repeated Temp temps //模版组模版", + "int32 is_private //是否私有模板(0-否,1-是)", +] + +[[method.res.message]] +name = "Temp" +field = [ + "string hash_id //模板ID", + "int32 lang_type //语言(1-中文,2-英文)", +] + +[[method]] +name = "TemplateInfo" +desc = "玩法模版信息" +[method.req] +field = [ + "int64 id //模板ID", + "string hash_id //模板对外ID", + "string lang // 国际语言标识(ISO 639-1代码)", +] + +[method.res] +field = [ + "int64 id //模板ID", + "string hash_id //模板对外ID", + "string temp_group_mark //模版组标识", + "int32 lang_type //语言(1-中文,2-英文)", + "int32 text_type //文字模板(1-汉字模板,2-拉丁语系模板)", + "repeated KV image //玩法图片数据", + "repeated KV lang //玩法语言包配置", + "repeated FixReward fix_rewards //玩法语言包配置", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[[method.res.message]] +name = "FixReward" +field = [ + "int64 id //奖品id", + "repeated Lang langs //语言对应的数据", +] +[[method.res.message]] +name = "Lang" +field = [ + "string title //奖品名称", + "string img_url //奖品名称", + "string lang_mark //语言标识", +] + +[[method]] +name = "CreateTempGroup" +desc = "创建模板组" +[method.req] +field = [ + "int64 fission_id //玩法id", + "string mark //模板组标识", + "string cover_url //模版组封面", + "int32 sort //排序(越小越前)", + "string lang_parts //支持玩法组件翻译", + "repeated KV lang //玩法语言数据", + "repeated int32 lang_type //支持语言", + "string convert_cover_url //事件转化封面", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] +field = [ + "int64 id //模板组id", +] + +[[method]] +name = "UpdateTempGroup" +desc = "更新模板组" +[method.req] +field = [ + "int64 id //模板组id", + "string cover_url //模版组封面", + "int32 sort //排序(越小越前)", + "string lang_parts //支持玩法组件翻译", + "repeated KV lang //玩法语言数据", + "repeated int32 lang_type //支持语言", + "string convert_cover_url //事件转化封面", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] +field = [ + "int64 id //模板组id", +] + +[[method]] +name = "CreateTemp" +desc = "创建玩法模版" +[method.req] +field = [ + "int64 group_id //玩法组id", + "int32 lang_type //语言(1-中文,2-英文)", + "int32 text_type //文字模板(1-汉字模板,2-拉丁语系模板)", + "repeated KV image //玩法图片数据", + "repeated KV lang //玩法语言包配置", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] +field = [ + "int64 id //模板id", + "string hash_id //模板hash_id", +] + +[[method]] +name = "CreateTempImg" +desc = "创建玩法图片配置" +[method.req] +field = [ + "int64 id //模板id", + "string hash_id //模板hash_id", + "repeated KV image //玩法图片数据", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] + +[[method]] +name = "CreateTempLang" +desc = "创建玩法语言配置" +[method.req] +field = [ + "int64 id //模板id", + "string hash_id //模板hash_id", + "repeated KV lang //玩法语言数据", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] + +[[method]] +name = "UpdateTempImg" +desc = "更新玩法图片配置" +[method.req] +field = [ + "int64 id //模板id", + "string hash_id //模板hash_id", + "repeated KV image //玩法图片数据", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] + +[[method]] +name = "UpdateTempLang" +desc = "更新玩法语言配置" +[method.req] +field = [ + "int64 id //模板id", + "string hash_id //模板hash_id", + "repeated KV lang //玩法语言数据", +] +[[method.req.message]] +name = "KV" +field = [ + "string key //键名称", + "string value //键对应的值", + "string desc //键描述", +] + +[method.res] diff --git a/proto/toml/w_fission_web.toml b/proto/toml/w_fission_web.toml new file mode 100644 index 0000000..1bce546 --- /dev/null +++ b/proto/toml/w_fission_web.toml @@ -0,0 +1,131 @@ +[service] +name = "WFissionWeb" +desc = "活动站外服务" + + +[[method]] +name = "GetWebReward" +desc = "抽取站外奖品" +[method.req] +field = [ + "string hash_id //活动hash_id", + "string web_id //浏览器唯一id", +] +[method.res] +field = [ + "int64 id //奖品id" +] + +[[method]] +name = "BindWeb" +desc = "绑定站外活动" +[method.req] +field = [ + "string campaign_hash_id //活动id", + "string c_mark //渠道标识", + "string web_id //浏览器唯一id", + "string ip //ip地址", +] + +[method.res] +field = [ + "int64 id //记录id", + "int64 user_id //绑定的用户id,未绑定未0", + "string download_link //下载也链接", + "bool submit //是否有提交题目", +] + +[[method]] +name = "WebReward" +desc = "用户站外奖" +[method.req] +field = [ + "string campaign_hash_id //活动id", + "string web_id //浏览器唯一id", + "string uid //关注用户ID", + "string lang //语种标识", +] + +[method.res] +field = [ + "bool has_reward //是否有奖品", + "string title //奖品名称", + "string img_url //奖品图片", + "string reward_hash_id //领取的用户奖品hash_id", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "bool is_push //是否已经推给客户", + "repeated KV kv_data //键值对数据", + "int64 reward_id //奖品id", + "string contact //联系方式", + "int32 status //奖品状态(0-可领奖,1-非新下载用户无法领奖)", + "string web_url //web端跳转地址", + "string app_param //app事件参数", + "string pc_param //pc事件参数", + +] +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", +] + +[[method]] +name = "WebAnswer" +desc = "用户站外答题" + +[method.req] +field = [ + "string campaign_hash_id //活动id", + "string web_id //浏览器唯一id", + "repeated Submit submits //提交的答案" +] + +[[method.req.message]] +name = "Submit" +field = [ + "int64 qid //题目id", + "repeated int64 aid //答案id", +] + +[method.res] +field = [ + "int64 id //奖品id" +] + +[[method]] +name = "AdsUser" +desc = "Ads用户数据" + +[method.req] +field = [ + "string campaign_hash_id //活动id", + "string web_id //浏览器唯一id", + "string cid //渠道标识", + "string ip //ip地址", +] + +[method.res] +field = [ + "int64 id //站外用户id", + "int64 reward_id //奖品id", + "string title //奖品名称", + "string img_url //奖品图片", +] + +[[method]] +name = "AdsLottery" +desc = "Ads抽奖" + +[method.req] +field = [ + "int64 id //站外用户id", + "string platform // 手机系统 andriod ios web" +] + +[method.res] +field = [ + "int64 reward_id //奖品id", + "string title //奖品名称", + "string img_url //奖品图片", +] diff --git a/proto/toml/w_games.toml b/proto/toml/w_games.toml new file mode 100644 index 0000000..334880a --- /dev/null +++ b/proto/toml/w_games.toml @@ -0,0 +1,184 @@ +[service] +name = "WGames" +desc = "小游戏服务" + +[[method]] +name = "List" +desc = "游戏列表" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //列表", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //游戏id", + "string title //游戏标题", + "string img //游戏图片", + "string link //游戏链接", +] + +[[method]] +name = "LinkList" +desc = "链接列表" +[method.req] +field = [ + "int64 game_id //游戏id", + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //链接列表", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //链接id", + "string title //链接标题", + "int32 is_default //是否默认链接(0-否,1-是)", + "string link //游戏链接", +] + +[[method]] +name = "LinkStore" +desc = "创建链接" +[method.req] +field = [ + "int64 game_id //游戏id", + "string project_hash_id //项目hash_id", + "string title //链接标题", +] + +[method.res] +field = [ + "int64 id //链接id", + "string link //游戏链接", +] + +[[method]] +name = "LinkUpdate" +desc = "更新链接" +[method.req] +field = [ + "int64 id //链接id", + "string project_hash_id //项目hash_id", + "string title //链接标题", +] + +[method.res] +field = [ + "int64 id //链接id", +] + +[[method]] +name = "LinkDestroy" +desc = "删除链接" +[method.req] +field = [ + "int64 id //链接id", + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "int64 id //链接id", +] + +[[method]] +name = "Visit" +desc = "访问小游戏" +[method.req] +field = [ + "string link_hash_id //链接hashid", + "string project_hash_id //项目hash_id", + "string uid //关注用户ID", + "string lang //语种标识", + "string lv //用户等级", + "Cert cert //验签数据", + "string ip //客户端ip", + "string os //系统", + "string os_version //系统版本", + "string device_model //系统型号", + "int64 mid //用户id", +] +[[method.req.message]] +name = "Cert" +field = [ + "int64 time //时间戳", + "string blackbox //通过blackBox可以在后台查询出", + "string version //加解密版本", + "string platform //平台", + "string token //加密串", +] + +[method.res] +field = [ + "int64 id //用户id", + "string hash_id //用户对外id", + "string token //身份token", + "int64 expired //token过期时间,单位:秒(s)", + "int32 is_view //是否预览用户(1-是,0-否)", +] + +[[method]] +name = "Trace" +desc = "跟踪小游戏" +[method.req] +field = [ + "int64 user_id //用户id", + "int64 link_id //链接id", + "int32 type //埋点类型(2-停留)", + "int32 stay_sec //停留时间,单位:秒(s)", +] +[method.res] + +[[method]] +name = "Overview" +desc = "小游戏统计" +[method.req] +field = [ + "int64 game_id //游戏id", + "string project_hash_id //项目hash_id", + "int64 link_id //链接id", +] +[method.res] +field = [ + "repeated One list //列表", +] +[[method.res.message]] +name = "One" +field = [ + "string mark //标识(visit_num-访问数,visit_user_num-访问用户数, total_stay-总停留时长)", + "int64 total //总数", + "int64 yesterday //昨日总数", + "string avg //平均", +] + +[[method]] +name = "Trend" +desc = "小游戏趋势" +[method.req] +field = [ + "int64 game_id //游戏id", + "string project_hash_id //项目hash_id", + "int64 link_id //链接id", + "int64 start_time //开始时间", + "int64 end_time //结束时间", +] +[method.res] +field = [ + "repeated string x //x轴", + "repeated Y y //y轴", +] +[[method.res.message]] +name = "Y" +field = [ + "string type //线类型(visit_num-访问数,visit_user_num-访问用户数)", + "repeated int64 data //y轴数据", +] diff --git a/proto/toml/w_library.toml b/proto/toml/w_library.toml new file mode 100644 index 0000000..27fa48d --- /dev/null +++ b/proto/toml/w_library.toml @@ -0,0 +1,268 @@ +[service] +name = "WLibrary" +desc = "素材库服务" + + +[[method]] +name = "QaGroup" +desc = "题库列表" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int32 page //当前页", + "int32 per_page //每页条数", + "string title //标题", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //题库ID", + "string hash_id //题库对外id", + "string title //标题", + "int64 created_at //创建时间", + "int64 qa_count //问题数量", +] + +[[method]] +name = "StoreQaGroup" +desc = "创建题库" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string title //标题", +] + +[method.res] + +[[method]] +name = "UpdateQaGroup" +desc = "更新题库" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string hash_id //题库对外id", + "string title //标题", +] + +[method.res] + +[[method]] +name = "DestroyQaGroup" +desc = "删除题库" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string hash_id //题库对外id", +] + +[method.res] + +[[method]] +name = "QaList" +desc = "问题列表" +[method.req] +field = [ + "string group_hash_id //题库对外id", + "int32 page //当前页", + "int32 per_page //每页条数", + "string title //题目", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //问题ID", + "string hash_id //问题对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "string explain_text //答案解析", + "string explain_img //答案解析图", + "repeated Option options //选项", + "int64 created_at //创建时间", + "string answer_mark //答案类型(image_text-图文,text-文本)", +] + +[[method.res.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //答案内容", + "string img_url //答案图片", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[[method]] +name = "StoreQa" +desc = "问题列表" +[method.req] +field = [ + "string group_hash_id //题库对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "string explain_text //答案解析", + "string explain_img //答案解析图", + "repeated Option options //选项", + "string answer_mark //答案类型(image_text-图文,text-文本)", +] + +[[method.req.message]] +name = "Option" +field = [ + "string title //答案内容", + "string img_url //答案图片", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[method.res] + +[[method]] +name = "UpdateQa" +desc = "问题列表" +[method.req] +field = [ + "string hash_id //问题对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "string explain_text //答案解析", + "string explain_img //答案解析图", + "repeated Option options //选项", + "string answer_mark //答案类型(image_text-图文,text-文本)", +] + +[[method.req.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //答案内容", + "string img_url //答案图片", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[method.res] + +[[method]] +name = "DestroyQa" +desc = "问题列表" +[method.req] +field = [ + "string hash_id //问题对外id", +] + +[method.res] + + +[[method]] +name = "QaGroupSelect" +desc = "题库选项" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //题库ID", + "string hash_id //题库对外id", + "string title //标题", + "int64 qa_num //题目数量", +] + +[[method]] +name = "QaRand" +desc = "随机问题" +[method.req] +field = [ + "int64 campaign_id //活动id", + "string group_hash_id //题库对外id", + "string lang_mark //用户语言", + "int64 user_id //获得取题库的用户id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //问题ID", + "string hash_id //问题对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "string explain_text //答案解析", + "string explain_img //答案解析图", + "repeated Option options //选项", + "int64 created_at //创建时间", + "string answer_mark //答案类型(image_text-图文,text-文本)", +] + +[[method.res.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //答案内容", + "string img_url //答案图片", + "int32 is_right //是否正确答案(1-是,0-否)", +] + +[[method]] +name = "QaShow" +desc = "问题详情" +[method.req] +field = [ + "string hash_id //题目对外id", +] + +[method.res] +field = [ + "int64 id //问题ID", + "string hash_id //问题对外id", + "string mark //问题类型(image_text-图文,video-视频,audio-音频)", + "string title //题目", + "string cover_url //封面图", + "string link_url //附件地址", + "string explain_text //答案解析", + "string explain_img //答案解析图", + "repeated Option options //选项", + "int64 created_at //创建时间", + "string answer_mark //答案类型(image_text-图文,text-文本)", +] + +[[method.res.message]] +name = "Option" +field = [ + "int64 id //选项id", + "string title //答案内容", + "string img_url //答案图片", + "int32 is_right //是否正确答案(1-是,0-否)", +] diff --git a/proto/toml/w_mall.toml b/proto/toml/w_mall.toml new file mode 100644 index 0000000..455a3dd --- /dev/null +++ b/proto/toml/w_mall.toml @@ -0,0 +1,312 @@ +[service] +name = "WMall" +desc = "商城服务" + +[[method]] +name = "List" +desc = "商城列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string project_hash_id //项目hash_id", + "string title //商城标题", + "int32 status //状态(1-使用中,2-暂未使用)", + "repeated int32 order_by //排序字段(1-创建最晚优先,2-创建最早优先,3-使用中优先,4-暂未使用优先)", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //总数", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //商城ID", + "string title //商城标题", + "int32 status //状态(1-使用中,2-暂未使用)", + "int64 created_at //创建时间", + "repeated Relate relates //关联使用数据", + "repeated Reward rewards //商城上架奖品", +] +[[method.res.message]] +name = "Relate" +field = [ + "int64 id //关系ID", + "int32 source //来源(1-任务中心,2-活动)", + "string title //来源标题", +] +[[method.res.message]] +name = "Reward" +field = [ + "int64 id //商城奖品id", + "string title //奖品标题", + "string img_url //奖品图片URL", +] + +[[method]] +name = "Store" +desc = "商城创建" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string title //商城标题", +] + +[method.res] +field = [ + "int64 id //商城id", +] + +[[method]] +name = "Update" +desc = "商城更新" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //商城id", + "string title //商城标题", +] + +[method.res] +field = [ + "int64 id //商城id", +] + +[[method]] +name = "Destroy" +desc = "商城删除" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //商城id", +] + +[method.res] +field = [ + "int64 id //商城id", +] + +[[method]] +name = "ItemList" +desc = "商城奖品列表" +[method.req] +field = [ + "int64 mall_id //商城ID", + "int32 status //状态(1-上架,2-下架)", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //商城奖品id", + "int64 reward_id //奖品id", + "string title //奖品标题", + "string img_url //奖品图片URL", + "int64 stock //奖品库存", + "int64 remain //剩余库存", + "int32 up_type //上架类型(1-立即上架,2-指定时间)", + "int64 up_custom //自定义上架时间", + "int64 up_at //上架时间", + "string up_from //上架来源(auto-自定上架,manual-手动上架)", + "repeated string up_show //指定上架展示配置", + "int32 down_type //下架类型(1-永久上架,2-指定时间)", + "int64 down_custom //自定义下架时间", + "int64 down_at //下架时间", + "string down_from //下架来源(auto-自定下架,manual-手动下架)", + "repeated string down_show //指定下架展示配置", + "int32 status //状态(1-上架,2-待上架,3-下架,4-删除)", + "int32 coin_num //奖品金币数量", + "int64 use_stock //发放库存", +] + +[[method]] +name = "ItemStore" +desc = "商城奖品创建" +[method.req] +field = [ + "int64 mall_id //商城ID", + "int64 reward_id //奖品id", + "int32 coin_num //奖品金币数量", + "int64 stock //奖品库存", + "int32 up_type //上架类型(1-立即上架,2-指定时间)", + "int64 up_custom //自定义上架时间", + "repeated string up_show //指定上架展示配置", + "int32 down_type //下架类型(1-永久上架,2-指定时间)", + "int64 down_custom //自定义下架时间", + "repeated string down_show //指定下架展示配置", +] + +[method.res] +field = [ + "int64 id //商城奖品id", +] + +[[method]] +name = "ItemUpdate" +desc = "商城奖品更新" +[method.req] +field = [ + "int64 id //奖品id", + "int64 reward_id //奖品id", + "int32 coin_num //奖品金币数量", + "int64 stock //奖品库存", + "int32 up_type //上架类型(1-立即上架,2-指定时间)", + "int64 up_custom //自定义上架时间", + "repeated string up_show //指定上架展示配置 [\"client\",\"countdown\"]", + "int32 down_type //下架类型(1-永久上架,2-指定时间)", + "int64 down_custom //自定义下架时间", + "repeated string down_show //指定下架展示配置 [\"countdown\"]", +] + +[method.res] +field = [ + "int64 id //商城奖品id", +] + +[[method]] +name = "ItemStatus" +desc = "商城奖品状态修改" + +[method.req] +field = [ + "int64 id //奖品id", + "int32 status //状态(1-上架,2-下架,3-删除)", +] + +[method.res] +field = [ + "int64 id //商城奖品id", +] + +[[method]] +name = "ItemSort" +desc = "商城奖品排序" +[method.req] +field = [ + "repeated int64 ids //奖品id列表", +] + +[method.res] + +[[method]] +name = "Select" +desc = "商城选择" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //商城ID", + "string title //商城标题", +] + +[[method]] +name = "RelateMall" +desc = "关联商城" +[method.req] +field = [ + "int64 project_id //项目id", + "int32 source //来源(1-任务中心,2-活动)", + "int64 relate_id //关联id", + "string relate_table //关联表名字,如果不是dplk_db库,建议带上库名字如dbname.relate_table_name", + "repeated int64 mall_ids //关联的商城id集合", +] + +[method.res] + +[[method]] +name = "UserItemList" +desc = "用户商城奖品列表" +[method.req] +field = [ + "int64 mall_id //商城ID", + "string user_id //用户id", + "string lang_mark //语言标记", + "int32 source //来源(1-任务中心,2-活动)", + "int64 source_id //来源id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //商城奖品id", + "int64 reward_id //奖品id", + "string title //奖品标题", + "string img_url //奖品图片URL", + "int64 remain //剩余库存", + "int32 status //状态(1-上架,2-待上架,3-下架,4-删除)", + "int64 up_remain //上架剩余时间", + "int32 coin_num //奖品金币数量", +] + +[[method]] +name = "ExchangeItem" +desc = "商城奖品兑换" +[method.req] +field = [ + "int64 project_id //项目id", + "int64 mall_item_id //商城商品id", + "string user_id //用户id", + "string lang_mark //语言标记", + "int32 point_source //积分来源(0-应用内部,1-系统自带)", + "int64 url_id //请求地址id", + "int32 source //来源(1-任务中心,2-活动)", + "SourceData source_data //来源数据", +] +[[method.req.message]] +name = "SourceData" +field = [ + "int64 center_id //任务中心id", + "string center_hash_id //任务中心hash_id", + "string center_title //任务中心标题", + "string user_platform //用户平台", + "string parent_user_id //父用户id", + "string parent_user_platform //父用户平台", + "int64 module_id //模块id", + "int64 relate_id //关联id", +] + +[method.res] +field = [ + "int32 status //状态(0-成功,1-库存不足,2-兑换上限,3-商品已下架)", + "int64 id //兑换记录id", + "int64 reward_id //奖品id", + "string title //奖品名称", + "string img_url //图片地址", + "repeated KV kv_data //奖品对应的键值数据", + "int32 receive_type //领取类型(0-不需要处理,1-服务端推送,2-客户自主发放,3-监听器)", + "string contact //联系方式", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string custom_reward_val //自定义数据", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", + "string fail_type //失败类型", + "string fail_msg //失败具体原因", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //对应字段名", + "string value //对应字段值", + "int32 is_show //是否展示(0-否,1-是)", +] + diff --git a/proto/toml/w_open_platform.toml b/proto/toml/w_open_platform.toml new file mode 100644 index 0000000..02858bb --- /dev/null +++ b/proto/toml/w_open_platform.toml @@ -0,0 +1,111 @@ +[service] +name = "WOpenPlatform" +desc = "开放平台接口提供服务" + +[[method]] +name = "UserList" +desc = "开放平台用户列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string project_hash_id //项目hash_id", + "string campaign_hash_id //活动hash_id", + "int64 last_record_id //最后一条记录id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", + "int64 lave //剩余多少条数据没有拉取", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //活动用户ID", + "string device_id //用户设备id", + "string sub_user_id //用户", + "string parent //用户上级", + "int64 child_num //下级数量", + "int64 indirect_num //间接裂变", + "int64 effect_num //有效拉新人数", + "int64 created_at //参与时间", + "string source_title //来源说明", + "string platform //操作系统", + "string channel_title //渠道名称", + "int64 join_at //首次访问活动时间", + "repeated Cond conds //任务数据", +] + +[[method.res.message]] +name = "Cond" +field = [ + "string desc //标题", + "int64 num //数量", + "int32 if_cond //等式(0-等于,1-大于等于,2-累计)", + "int32 event_type //事件类型(1-自定义事件,2-广告事件,3-标准事件)", + "string event //事件关键字", + "string event_key //事件key", + "string event_val //事件值", +] + +[[method]] +name = "CampaignInfo" +desc = "开发平台活动信息" +[method.req] +field = [ + "int64 project_id //项目id", + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [ + "string hash_id //活动对外id", + "string title //活动标题", + "string link //活动地址", + "repeated Lang langs //语言内容" +] + +[[method.res.message]] +name = "Lang" +field = [ + "string mark //语言标识", + "string page_title //页面标题", + "string share_text //分享文案", + "string share_img //缩略图", +] + +[[method]] +name = "Player" +desc = "用户在活动中的玩家数据" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string campaign_hash_id //活动hash_id", + "string user_id //用户id", + "int64 start_time //开始时间", + "int64 end_time //结束时间", +] + +[method.res] +field = [ + "int32 status //状态(0-正常,1-未参与活动)", + "int64 fission_id //玩法id", + "Keep keep //激励养成玩家数据", +] + +[[method.res.message]] +name = "Keep" +field = [ + "int64 love_num //当前养成宠物已经收集爱心数", + "int64 remain_food //当前养成宠物剩余的食物数", + "KeepAction action //用户行为", +] +[[method.res.message]] +name = "KeepAction" +field = [ + "int64 grow_pet //领养次数", + "int64 feed_num //喂养次数", + "int64 collect_num //收集爱心次数", +] diff --git a/proto/toml/w_project.toml b/proto/toml/w_project.toml new file mode 100644 index 0000000..2b76cb4 --- /dev/null +++ b/proto/toml/w_project.toml @@ -0,0 +1,265 @@ +[service] +name = "WProject" +desc = "项目服务" + +[[method]] +name = "Select" +desc = "项目选择列表" +[method.req] +field = [ + "int64 company_id//企业id", + "bool show_user //是否值显示员工可展示,如果否,表示返回企业内所有项目", + "int64 user_id //员工id", +] + +[method.res] +field = ["repeated One list //列表数据"] +[[method.res.message]] +name = "One" +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string title //项目名称", + "int32 scene //项目应用场景(1-app,2-web)", + "string logo_url //项目logo地址", + "int32 is_test //是否测试项目(0-否,1-是)", +] + +[[method]] +name = "List" +desc = "项目列表" +[method.req] +field = [ + "int64 company_id//企业id", + "int32 page //当前页", + "int32 per_page //每页条数", + "bool show_user //是否值显示员工可展示,如果否,表示返回企业内所有项目", + "int64 user_id //员工id", +] +[method.res] +field = ["repeated One list //列表数据", "int64 total //列表总数"] +[[method.res.message]] +name = "One" +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string title //项目名称", + "string domain //域名前缀", + "int64 created_time //创建时间时间戳", + "repeated UserRelate user_relate //关联的员工", + "int32 scene //项目应用场景(1-app,2-web)", + "string logo_url //项目logo地址", +] +[[method.res.message]] +name = "UserRelate" +field = [ + "int64 user_id //员工id", + "string hash_id //对外员工id", + "string show_name //员工显示的名称", +] + +[[method]] +name = "Show" +desc = "项目详情" +[method.req] +field = ["int64 id //项目id", "string hash_id //对外项目id"] +[method.res] +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string title //项目名称", + "string domain //域名前缀", + "int64 company_id //企业id", + "string notify_token //项目回调token", + "string encrypt_str //数据加密字符串", + "int32 scene //项目应用场景(1-app,2-web)", + "string third_secret //第三方开放平台密钥", + "int32 fission_cert_type //活动用户认证方式(0-不认证,1-加密认证)", + "string third_url //开放平台回调地址", + "string third_reboost_url //开放平台reboot回调地址", +] + +[[method]] +name = "Store" +desc = "创建项目" +[method.req] +field = [ + "int64 company_id //企业id", + "int64 user_id //企业id", + "string title //项目名称", + "string domain //域名前缀", + "repeated string user_ids //关联的员工id", + "bool is_all //是否所有员工都可看", + "int32 scene //项目应用场景(1-app,2-web)", + "string logo_url //项目logo地址", +] +[method.res] + +[[method]] +name = "Update" +desc = "更新项目" +[method.req] +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string title //项目名称", + "repeated string user_ids //关联的员工id", + "bool is_all //是否所有员工都可看", + "string logo_url //项目logo地址", +] +[method.res] + +[[method]] +name = "Destroy" +desc = "删除项目" +[method.req] +field = ["int64 id //项目id", "string hash_id //对外项目id"] +[method.res] + + +[[method]] +name = "Cert" +desc = "项目认证" +[method.req] +field = ["int64 id //项目id", "string hash_id //对外项目id", "string secret //项目私钥"] +[method.res] +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string title //项目名称", + "string encrypt_str //数据加密字符串", + "int32 scene //项目应用场景(1-app,2-web)", + "repeated CertSecret cert_secrets //可认证的密钥", +] + +[[method.res.message]] +name = "CertSecret" +field = ["string secret //密钥", "int64 expired_at //密钥过期时间,0为不过期"] + +[[method]] +name = "ProjectSecret" +desc = "项目私钥" +[method.req] +field = ["int64 id //项目id", "string hash_id //对外项目id"] +[method.res] +field = ["string secret //项目私钥"] + +[[method]] +name = "ChangeSecret" +desc = "修改密钥" +[method.req] +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "int64 user_id //创建的员工id", + "string username //管理账号", + "string passwd //管理员密码", +] +[method.res] +field = ["string secret //项目私钥"] + +[[method]] +name = "ChangeOplatform" +desc = "修改开放平台" +[method.req] +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string third_url //开放平台回调地址", +] +[method.res] +field = [] + + +[[method]] +name = "DomainList" +desc = "获取项目域名绑定的项目" +[method.req] +field = ["string domain //项目域名"] +[method.res] +field = ["repeated One list //列表数据"] +[[method.res.message]] +name = "One" +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "int64 company_id //企业id", + "string title //项目名称", + "string domain //域名前缀", + "int64 created_time //创建时间时间戳", +] + + +[[method]] +name = "SaveAdsConfig" +desc = "保存广告配置" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int32 open_ad //开启广告模块(0-不开启,1-开启)", + "int32 campaign_ad //开启活动广告(0-不开启,1-开启)", + "int64 user_id //员工id(", + "string ip //操作的ip地址", +] +[method.res] +field = [ + +] + +[[method]] +name = "AdsConfig" +desc = "获取广告配置" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] +[method.res] +field = [ + "int32 open_ad //开启广告模块(0-不开启,1-开启)", + "int32 campaign_ad //开启广告模块(0-不开启,1-开启)", + "int32 ad_custom_url //开启广告自定义链接配置(0-不开启,1-开启)", +] + +[[method]] +name = "ChangeRebootUrl" +desc = "修改开放平台的活动回调地址" +[method.req] +field = [ + "int64 id //项目id", + "string hash_id //对外项目id", + "string third_reboost_url //开放平台回调地址", +] +[method.res] + +[[method]] +name = "FissionConfig" +desc = "获取广告配置" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] +[method.res] +field = [ + "int32 push_visit //用户访问推送(0-否,1-是)", + "int32 push_campaign_task //活动任务完成推送(0-否,1-是)", +] + +[[method]] +name = "SetPushVisit" +desc = "设置活动访问推送开关" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int32 push_visit //用户访问推送(0-否,1-是)", +] +[method.res] + +[[method]] +name = "SetPushCampaignTask" +desc = "设置活动任务完成推送开关" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int32 push_campaign_task //活动任务完成推送(0-否,1-是)", +] +[method.res] diff --git a/proto/toml/w_project_user.toml b/proto/toml/w_project_user.toml new file mode 100644 index 0000000..78682cb --- /dev/null +++ b/proto/toml/w_project_user.toml @@ -0,0 +1,50 @@ +[service] +name = "WProjectUser" +desc = "项目用户" + +[[method]] +name = "Point" +desc = "积分" +[method.req] +field = [ + "int64 project_id //项目ID", + "string user_id //第三方用户ID", + "int32 point_source //积分来源(0-应用内部,1-系统自带)", + "int64 url_id //请求地址id", + "string lang_mark //语言标识", +] + +[method.res] +field = [ + "int64 id //项目用户ID", + "int64 coin_num //积分数量", +] + +[[method]] +name = "EarnCoin" +desc = "获取积分" +[method.req] +field = [ + "int64 project_id //项目ID", + "string user_id //第三方用户ID", + "string lang_mark //语言标识", + "repeated Earn earns //获得的积分", +] + +[[method.req.message]] +name = "Earn" +field = [ + "int32 coin_num //积分数量", + "int64 expired_at //期时间", + "int32 is_expired //是否过期(0-否,1-是)", + "string source //来源(center-任务中心,campaign-活动)", + "int64 source_id //来源ID", + "map source_data //来源数据", + "string operate //操作", +] + +[method.res] +field = [ + "int64 id //记录ID", +] + diff --git a/proto/toml/w_register.toml b/proto/toml/w_register.toml new file mode 100644 index 0000000..a980fc1 --- /dev/null +++ b/proto/toml/w_register.toml @@ -0,0 +1,20 @@ +[service] +name = "WRegister" +desc = "企业注册服务" + +[[method]] +name = "Store" +desc = "添加注册申请" +[method.req] +field = [ + "string username //注册账号(申请通过后超级管理员登陆的账号)", + "string short_name //申请通过后公司显示的简称", + "string passwd //申请通过后超级管理员登陆的密码", + "string email //注册邮箱", + "string phone //手机号", + "string app_name //站点名称", +] +[method.res] +field = [ + "uint64 id //记录id" +] diff --git a/proto/toml/w_reward.toml b/proto/toml/w_reward.toml new file mode 100644 index 0000000..671bbb1 --- /dev/null +++ b/proto/toml/w_reward.toml @@ -0,0 +1,625 @@ +[service] +name = "WReward" +desc = "奖品服务" + +[[method]] +name = "List" +desc = "奖品列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string page_lang //页面语言", + "string project_hash_id //项目hash_id", + "string title //奖品名称", + "string lang_mark //奖品语言,多个用逗号分开", + "string reward_title //奖品标题", + "int32 order_type //排序类型(1-创建时间升序),其他默认", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //奖品id", + "string reward_title //奖品标题", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "int64 related_num //关联数量", + "repeated KV kv_data //键值数据", + "repeated Lang langs //语言数据", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", + "int64 created_at //创建时间", + "string contact //联系方式", + "int64 url_id //回调地址id", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method.res.message]] +name = "Lang" +field = [ + "string mark //语言标识", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 is_default //是否默认语言(0-否,1-是)", + "int32 lang_type //语言数字标识", + "int64 img_id //奖品图片id", +] + +[[method]] +name = "Select" +desc = "奖品选择" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string lang_mark //奖品语言", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //奖品id", + "string reward_title //奖品标题", + "string title //奖品名称", + "string img_url //奖品图片", + "string lang_mark //奖品语言", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "repeated KV kv_data //键值数据", + "string contact //联系方式", + "string url //回调地址", + "string form_title //表单标题", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method]] +name = "Show" +desc = "奖品详情" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //奖品id", +] + +[method.res] +field = [ + "int64 id //奖品id", + "string reward_title //奖品标题", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "int64 url_id //回调地址id", + "string contact //联系方式", + "repeated KV kv_data //键值数据", + "repeated Lang langs //语言数据", + "int64 form_id //表单Id", + "int64 relate_num //关联使用的数量", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method.res.message]] +name = "Lang" +field = [ + "string mark //语言标识", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 is_default //是否默认语言(0-否,1-是)", + "int32 lang_type //语言数字标识", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //App端的跳转参数", +] + +[[method]] +name = "Store" +desc = "创建奖品" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string reward_title //奖品标题", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "int64 url_id //回调地址id", + "string contact //联系方式", + "repeated KV kv_data //键值数据", + "repeated Lang langs //语言数据", + "int64 form_id //表单id", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", + "int32 source //数据来源(0-后台创建,1-奖品数据迁移,2-api创建)", +] + +[[method.req.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method.req.message]] +name = "Lang" +field = [ + "string mark //语言标识", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 is_default //是否默认语言(0-否,1-是)", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 image_id //图片id", + "string pc_param //App端的跳转参数", +] + +[method.res] +field = [ + "int64 id //奖品id", +] + +[[method]] +name = "Update" +desc = "更新奖品" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //奖品id", + "string reward_title //奖品标题", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "int64 url_id //回调地址id", + "string contact //联系方式", + "repeated KV kv_data //键值数据", + "repeated Lang langs //语言数据", + "int64 form_id //表单id", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", +] + +[[method.req.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method.req.message]] +name = "Lang" +field = [ + "string mark //语言标识", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 is_default //是否默认语言(0-否,1-是)", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "int64 image_id //图片id", + "string pc_param //App端的跳转参数", +] + +[method.res] +field = [ + "int64 id //奖品id", +] + +[[method]] +name = "Destroy" +desc = "删除奖品" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string ids //奖品id,多个用逗号分割", +] + +[method.res] +field = [ + "repeated string ids // 还关联活动的奖品id", +] + +[[method]] +name = "UrlList" +desc = "回调地址列表" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int32 order_type //排序类型(1-创建时间升序),其他默认", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //回调地址id", + "string title //回调地址说明", + "string url //回调地址", + "int64 num //关联奖品数量", + "int64 created_at //创建时间", + "repeated Header headers //头信息", +] + +[[method.res.message]] +name = "Header" +field = [ + "string key //回调头键", + "string mark //特殊键标识", + "string val //回调数值", +] + +[[method]] +name = "UrlStore" +desc = "创建回调地址" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string title //回调地址说明", + "string url //回调地址", + "int32 source //数据来源(0-后台创建,1-奖品数据迁移,2-api创建)", + "repeated Header headers //头信息", +] + +[[method.req.message]] +name = "Header" +field = [ + "string key //回调头键", + "string mark //特殊键标识", + "string val //回调数值", +] + +[method.res] +field = [ + "int64 id //地址id", +] + +[[method]] +name = "UrlUpdate" +desc = "更新回调地址" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //地址id", + "string title //回调地址说明", + "string url //回调地址", + "repeated Header headers //头信息", +] + +[[method.req.message]] +name = "Header" +field = [ + "string key //回调头键", + "string mark //特殊键标识", + "string val //回调数值", +] + +[method.res] +field = [ + "int64 id //地址id", +] + +[[method]] +name = "UrlDestroy" +desc = "删除回调地址" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //地址id", +] + +[method.res] + +[[method]] +name = "FormList" +desc = "表单列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string project_hash_id //项目hash_id", + "string title //表单标题", +] +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //表单ID", + "string title //表单标题", + "int64 created_at //创建时间", + "repeated Item items //表单项", + "int64 num //关联奖品数量", +] +[[method.res.message]] +name = "Item" +field = [ + "string name //表单项名称", +] + +[[method]] +name = "FormSelect" +desc = "表单选择" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] +[method.res] +field = [ + "repeated One list //列表数据", +] +[[method.res.message]] +name = "One" +field = [ + "int64 id //表单ID", + "string title //表单标题", +] + +[[method]] +name = "FormStore" +desc = "创建表单" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "string title //表单标题", + "repeated Item items //表单项", +] +[[method.req.message]] +name = "Item" +field = [ + "string name //表单项名称", + "repeated Tran trans //字段语言翻译", +] +[[method.req.message]] +name = "Tran" +field = [ + "string mark //语言标识", + "string name //字段对应语言的名称", + "int32 is_default //字段语言翻译", +] + +[method.res] +field = [ + "int64 id //表单id" +] + +[[method]] +name = "FormUpdate" +desc = "更新表单" +[method.req] +field = [ + "int64 id //表单ID", + "string title //表单标题", + "repeated Item items //表单项", +] +[[method.req.message]] +name = "Item" +field = [ + "string name //表单项名称", + "repeated Tran trans //字段语言翻译", +] +[[method.req.message]] +name = "Tran" +field = [ + "string mark //语言标识", + "string name //字段对应语言的名称", + "int32 is_default //字段语言翻译", +] + +[method.res] +field = [ + "int64 id //表单id" +] + +[[method]] +name = "FormDestroy" +desc = "删除表单" +[method.req] +field = [ + "string project_hash_id //项目hash_id", + "int64 id //表单ID", +] +[method.res] +field = [ + "int64 id //表单id" +] + +[[method]] +name = "Forms" +desc = "表单数据" +[method.req] +field = [ + "int64 project_id //项目id", + "repeated int64 ids //表单id", +] +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //表单ID", + "string title //表单标题", + "int64 created_at //创建时间", + "repeated Item items //表单项", +] +[[method.res.message]] +name = "Item" +field = [ + "string name //表单项名称", +] + +[[method]] +name = "Urls" +desc = "回调地址数据" +[method.req] +field = [ + "int64 project_id //项目id", + "repeated int64 ids //地址id", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //回调地址id", + "string title //回调地址说明", + "string url //回调地址", + "int64 created_at //创建时间", + "repeated Header headers //头信息", +] + +[[method.res.message]] +name = "Header" +field = [ + "string key //回调头键", + "string mark //特殊键标识", + "string val //回调数值", +] + +[[method]] +name = "Rewards" +desc = "奖品详情" +[method.req] +field = [ + "int64 project_id //项目id", + "repeated int64 ids //奖品id", + "string lang_mark //语言标识", +] + +[method.res] +field = [ + "repeated One list //列表数据", +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //奖品id", + "string reward_title //奖品标题", + "int32 receive_type //发放类型(1-系统发放,2-联系客服,4-提交表单)", + "int64 url_id //回调地址id", + "string contact //联系方式", + "repeated KV kv_data //键值数据", + "Lang lang //语言数据", + "int64 form_id //表单Id", + "int32 dy_reward_type //动态奖品内容类型(0-无,1-兑换码)", +] + +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", + "int32 is_show //是否展示(0-否,1-是)", +] + +[[method.res.message]] +name = "Lang" +field = [ + "string mark //语言标识", + "string title //奖品名称", + "string img_url //奖品图片", + "int32 is_default //是否默认语言(0-否,1-是)", + "int32 open_to_use //开启去使用(0-否,1-是)", + "string web_url //Web端的跳转地址", + "string app_param //App端的跳转参数", + "string pc_param //pc端的跳转参数", +] + +[[method]] +name = "RelateReward" +desc = "关联奖品" +[method.req] +field = [ + "int64 project_id //项目id", + "int64 relate_id //关联id", + "string relate_table //关联表名字,如果不是dplk_db库,建议带上库名字如dbname.relate_table_name", + "repeated int64 reward_ids //关联的奖品id集合", +] + +[method.res] + +[[method]] +name = "PushReward" +desc = "奖品推送" +[method.req] +field = [ + "string source //来源标识,wall-积分墙,center-任务中心", + "int64 source_id //来源id,如:来源是campaign,这个就写campaign_id,没有填写0", + "string source_hash_id //来源hash_id,推送", + "int64 source_second_id //来源第二级id,如:来源是任务中心,奖品任务中心的某个模块发放,这里就是模块id,没有填写0", + "int64 relate_id //关联id,用于后续对比查询,如:发放记录的ID", + "string relate_hash_id //推送时给第三方的id", + "string title //关联id,用于后续对比查询,如:发放记录的ID", + "int64 reward_id //推送的奖品库存id", + "int32 num //奖品发放数量", + "string user_id //第三方应用的用户id", + "string user_platform //活动用户设备平台", + "string parent_user_id //上级用户id", + "string parent_platform //活动用户的上级用户设备平台", + "string lang //用户语言标识", + "int32 sync //是否同步请求(0-否,1-是)", + "int32 reward_type //发放类型(1-活动奖品,2-站外活动奖品,3-额外奖品,4-新人奖品,5-养成阶段奖励,6-任务奖励,7-子活动奖励,8-兑换奖励),没有合适的要加", + "int64 campaign_id //推送的活动id", +] + +[method.res] +field = [ + "string task_id //当前发放任务id,固定20位字符串", + "string reward_val //回调后接收到的数据", + "int32 status //状态(1-推送中,2-完成,3-失败)", + "string fail_type // 失败类型,system-系统出错,client-客户的错误,undefined-未知错误", + "string fail_msg // 错误信息", +] + +[[method]] +name = "RewardIds" +desc = "查询奖品id" +[method.req] +field = [ + "int64 project_id //项目id", + "string reward_title //获取奖品标题", +] + +[method.res] +field = [ + "repeated int64 ids //列表数据", +] diff --git a/proto/toml/w_script.toml b/proto/toml/w_script.toml new file mode 100644 index 0000000..d1795f0 --- /dev/null +++ b/proto/toml/w_script.toml @@ -0,0 +1,220 @@ +[service] +name = "WScript" +desc = "脚本服务" + +[[method]] +name = "Boot" +desc = "运行脚本" +[method.req] +field = [ + "string scene //处理场景", + "string json_data //文件后缀", +] + +[method.res] +field = [ + "string task_id //任务id", +] + +[[method]] +name = "RefreshDayLimit" +desc = "刷新每日限制" +[method.req] +field = [ + "string hash_id //用户hash_id", + "string campaign_hash_id //活动hash_id", +] + +[method.res] +field = [] + +[[method]] +name = "NotifyList" +desc = "奖品回调列表" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string campaign_hash_id //项目hash_id", + "string reward_hash_id //奖品记录hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] + +[[method.res.message]] +name = "One" +field = [ + "string hash_id //任务ID", + "int64 created_at //创建时间", + "int64 last_push //最后推送时间", + "string body //请求数据", + "string notify_url //请求地址", + "repeated string resp //请求结果", +] + +[[method]] +name = "EtcdKey" +desc = "查看etcd的key" +[method.req] +field = [ + "string prefix //前缀", +] + +[method.res] +field = [ + "repeated KV kvs //数据", +] +[[method.res.message]] +name = "KV" +field = [ + "string key //键", + "string value //值", +] + +[[method]] +name = "EventFlow" +desc = "查看事件记录" +[method.req] +field = [ + "string project_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //数据", +] +[[method.res.message]] +name = "One" +field = [ + "string link_hash_id //深度链接hash_id", + "string device_id //设备id", + "string user_id //用户ID", + "string event_title //事件名称", + "string ip_address //ip", + "string os //os", + "string os_version //os_version", + "string device_model //device_model", + "string event_data //event_data", + "int64 created_at //创建时间", + "int32 source //来源(1-自然流量,2-深度链接,3-活动)", + "string campaign_hash_id //活动hash_id", +] + +[[method]] +name = "ClearDevice" +desc = "清除设备信息" +[method.req] +field = [ + "string hash_id //用户hash_id", + "string project_hash_id //项目hash_id", + "string campaign_hash_id //活动hash_id", +] + +[method.res] + +[[method]] +name = "RefreshView" +desc = "重新体验玩法" +[method.req] +field = [ + "string campaign_hash_id //活动hash_id", +] + +[method.res] + +[[method]] +name = "ErrLog" +desc = "错误日志记录" +[method.req] +field = [ + "string api_url //请求的接口", + "string data //请求数据", + "string link_url //当前页面地址", + "string msg //返回数据", +] + +[method.res] + +[[method]] +name = "PointsLog" +desc = "领扣积分请求" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string campaign_hash_id //项目hash_id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //请求id", + "int64 created_at //创建时间", + "string req //请求数据", + "string req_url //请求地址", + "string token //请求token", + "string req_header //请求头", + "string resp //返回数据", + "string err_msg //错误信息", +] + +[[method]] +name = "UserBehavior" +desc = "用户行为日志" +[method.req] +field = [ + "string api_url //请求的接口", + "string desc //接口描述", + "int64 user_id //登陆用户id", + "int64 company_id //登陆用户id", + "string project_hash_id //项目hash_id", + "string ip //操作ip", + "string ua_data //部分ua头数据", + "string req //请求数据", + "string res //操作结果", +] + +[method.res] + +[[method]] +name = "RewardPushLog" +desc = "奖品推送日志" +[method.req] +field = [ + "int32 page //当前页", + "int32 per_page //每页条数", + "string source //来源", + "int64 first_id //来源一级id", + "int64 second_id //来源二级id", + "int64 relate_id //关联记录id", +] + +[method.res] +field = [ + "repeated One list //列表数据", + "int64 total //列表总数" +] + +[[method.res.message]] +name = "One" +field = [ + "int64 id //请求id", + "int64 created_at //创建时间", + "string req //请求数据", + "string req_url //请求地址", + "string token //请求token", + "string req_header //请求头", + "string resp //返回数据", + "string err_msg //错误信息", + "int64 req_time //请求时长(单位:ms)", +] diff --git a/proto/toml/w_user.toml b/proto/toml/w_user.toml new file mode 100644 index 0000000..044d1e9 --- /dev/null +++ b/proto/toml/w_user.toml @@ -0,0 +1,110 @@ +[service] +name = "WUser" +desc = "员工服务" + +[[method]] +name = "Login" +desc = "登陆" +[method.req] +field = ["string username //账号", "string passwd //密码", "string code //授权码"] +[method.res] +field = [ + "bool is_admin //是否超级管理员", + "int64 id //用户id", + "string hash_id //用户对外id", + "int64 company_id //用户企业id", + "string token //身份token", + "int64 expired //token过期时间,单位:秒(s)", + "string name //显示的名称", + "string email //邮箱", + "string username //账号", + "string role_name //角色名称", +] + +[[method]] +name = "List" +desc = "用户列表" +[method.req] +field = ["int64 company_id //企业Id", "int32 page //当前页", "int32 per_page //每页条数"] +[method.res] +field = ["repeated One list //列表数据", "int64 total //列表总数"] +[[method.res.message]] +name = "One" +field = [ + "int64 id //用户id", + "string hash_id //用户对外id", + "string show_name //列表总数", + "string username //用户名", + "string email //用户邮箱", + "string role_name //用户角色", + "repeated Project projects //用户关联项目", +] +[[method.res.message]] +name = "Project" +field = ["int64 id //项目id", "string hash_id //对外项目id", "string title //项目名称"] + +[[method]] +name = "Select" +desc = "用户选择列表" +[method.req] +field = ["int64 company_id //企业Id"] +[method.res] +field = ["repeated One list //列表数据"] +[[method.res.message]] +name = "One" +field = [ + "int64 id //用户id", + "string hash_id //用户对外id", + "string show_name //列表总数", +] + +[[method]] +name = "Show" +desc = "员工详情" +[method.req] +field = ["int64 id //用户id", "string hash_id //用户对外id"] +[method.res] +field = [ + "int64 id //用户id", + "string hash_id //用户对外id", + "string show_name //列表总数", + "string username //用户名", + "string email //用户邮箱", + "bool is_admin //是否超级管理员", +] + + +[[method]] +name = "Store" +desc = "创建员工" +[method.req] +field = [ + "int64 company_id //企业ID", + "string show_name //显示名称", + "string username //用户名", + "string passwd //用户密码", + "string email //用户邮箱", + "repeated string project_hash_ids //项目hash_id", +] +[method.res] +field = [] + +[[method]] +name = "Update" +desc = "更新员工" +[method.req] +field = [ + "int64 id //用户id", + "string hash_id //用户对外id", + "string show_name //显示名称", + "string passwd //用户密码", +] +[method.res] +field = [] + +[[method]] +name = "Destroy" +desc = "删除员工" +[method.req] +field = ["int64 id //用户id", "string hash_id //用户对外id"] +[method.res] diff --git a/test/do_test.go b/test/do_test.go new file mode 100644 index 0000000..f55235f --- /dev/null +++ b/test/do_test.go @@ -0,0 +1,425 @@ +package test + +import ( + "context" + "crypto/md5" + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/plugins/jsonm" + "joybuywork/internal/repository/dao" + "joybuywork/internal/repository/model" + "joybuywork/internal/repository/withdefault" + "joybuywork/internal/utils" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "log" + "math/rand" + "os" + "os/signal" + "strings" + "sync" + "syscall" + "testing" + "time" + "unicode" + + "github.com/rs/xid" + "github.com/sony/sonyflake" + "github.com/valyala/fasthttp" + "gits.branchcn.com/backend/microcode/plugins/alert/webhook" + "go.etcd.io/etcd/api/v3/mvccpb" + "go.etcd.io/etcd/client/v3" +) + +var key = "/test" + +var cli *clientv3.Client + +func init() { + cli, _ = clientv3.New(clientv3.Config{ + Endpoints: []string{"127.0.0.1:2379"}, + DialTimeout: 5 * time.Second, + }) +} + +func TestName(t *testing.T) { + + for i := 0; i < 1; i++ { + // 监听配置变化 + go func() { + + ctx := context.Background() + for { + ch, ok := <-cli.Watch(ctx, key, clientv3.WithPrefix()) + if !ok { + t.Logf("监听通道有问题") + return + } + + if ch.Canceled { + t.Logf("退出") + return + } + + t.Logf("Created:%v, Header: %+v, CompactRevision: %d, IsProgressNotify: %v", ch.Created, ch.Header, ch.CompactRevision, ch.IsProgressNotify()) + + for _, ev := range ch.Events { + switch ev.Type { + case mvccpb.PUT: + fmt.Println(string(ev.Kv.Key), string(ev.Kv.Value)) + } + } + + } + }() + } + + //监听程序退出 + ch := make(chan os.Signal, 1) + signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGKILL) + + select { + case <-ch: + defer close(ch) + } +} + +func TestName2(t *testing.T) { + + ctx, _ := context.Background(), time.Second + + cli.Put(ctx, "/test/ddd", xid.New().String()) + cli.Put(ctx, "/test/your_key", xid.New().String()) + + resp, err := cli.Get(ctx, "/test", clientv3.WithPrefix()) + if err != nil { + t.Fatal(err) + return + } + + for _, ev := range resp.Kvs { + fmt.Println(string(ev.Key), string(ev.Value)) + } + +} + +func Test_GG(t *testing.T) { + webhook.NewFeiShu(config.Config.Alert.Scenes[0].Url, config.Config.Alert.Scenes[0].Secret).SendText("123123") +} + +type R struct { + Code int32 + Msg string + Data ListRes +} + +type ListRes struct { + List []*ListOne `json:"list"` //列表数据 + Total int64 `json:"total"` //数据总条数 +} + +type ListOne struct { + Id string `json:"id"` //活动ID + Title string `json:"title"` //活动标题 + StartDate string `json:"start_date"` //开始时间,如:2023-05-25 15:18:00 + EndDate string `json:"end_date"` //结束时间,如:2023-05-25 15:18:00 + Status int32 `json:"status"` //发布状态(1-待发布,2-已发布,3-已下线,4-预发布) + CreatedTime int64 `json:"created_time"` //创建时间时间戳 + Langs []*ListOneLang `json:"langs"` + Link string `json:"link"` //活动链接 +} + +type ListOneLang struct { + LangMark string `json:"lang_mark"` //语言标识 + TOffset int32 `json:"t_offset"` //时区 + Start int64 `json:"start"` //当前语种的开始时间 + End int64 `json:"end"` //当前语种的结束时间 +} + +func TestOpReq(t *testing.T) { + ctx := context.Background() + var data = map[string]interface{}{ + "page": 6, + "page_size": 10, + } + + body, _ := json.Marshal(data) + token := Md5String(fmt.Sprintf("%s %s", "283c771ced982154abb4dc56828e169fee034bbc", Md5String(string(body)))) + + req := fasthttp.AcquireRequest() + resp := fasthttp.AcquireResponse() + defer fasthttp.ReleaseRequest(req) + defer fasthttp.ReleaseResponse(resp) + + req.Header.SetMethod(fasthttp.MethodPost) + req.Header.Set(fasthttp.HeaderContentType, "application/json") + req.Header.Set("X-Message-Id", fmt.Sprint(ctx.Value(consts.TraceIdKey))) + req.Header.Set(fasthttp.HeaderAuthorization, fmt.Sprintf("Bearer %s", token)) + req.SetRequestURI("https://test-tls2s.allapp.link/manage/campaign/campaign_list?project_id=coeeaf6rdj7ie31dgad0") + req.SetBody(body) + + client := &fasthttp.Client{ + ReadTimeout: 15 * time.Second, + WriteTimeout: 15 * time.Second, + } + + err := client.Do(req, resp) + t.Log(err) + t.Log(resp.StatusCode(), string(resp.Body())) + + var res R + err = json.Unmarshal(resp.Body(), &res) + + t.Log(len(res.Data.List)) + + for i := range res.Data.List { + t.Log(i) + } + +} + +type RewardStoreKV struct { + Key string `json:"key" form:"key"` //键 + Value string `json:"value" form:"value"` //值 + IsShow int32 `json:"is_show" form:"is_show"` //是否展示(0-否,1-是) +} + +type RewardStoreLang struct { + Mark string `json:"mark" form:"mark" validate:"required"` //语言标识 + Title string `json:"title" form:"title" validate:"required"` //奖品名称 + ImageId string `json:"image_id" form:"image_id" validate:"required"` //奖品图片ID + IsDefault int32 `json:"is_default" form:"is_default" validate:"oneof=0 1"` //是否默认语言 + WebUrl string `json:"web_url" form:"web_url"` //Web端的跳转地址 + AppParam string `json:"app_param" form:"app_param"` //App端的跳转参数 +} + +func TestOpRewardReq(t *testing.T) { + ctx := context.Background() + var data = map[string]interface{}{ + "receive_type": 1, + "url_id": "1", + "kv_data": []*RewardStoreKV{ + { + Key: "1", + Value: "3", + IsShow: 0, + }, + }, + "langs": []*RewardStoreLang{ + { + Mark: "en", + Title: "ddfdf", + ImageId: "208663058222764032", + IsDefault: 1, + WebUrl: "", + AppParam: "", + }, + }, + } + + body, _ := json.Marshal(data) + token := Md5String(fmt.Sprintf("%s %s", "283c771ced982154abb4dc56828e169fee034bbc", Md5String(string(body)))) + + req := fasthttp.AcquireRequest() + resp := fasthttp.AcquireResponse() + defer fasthttp.ReleaseRequest(req) + defer fasthttp.ReleaseResponse(resp) + + req.Header.SetMethod(fasthttp.MethodPost) + req.Header.Set(fasthttp.HeaderContentType, "application/json") + req.Header.Set("X-Message-Id", fmt.Sprint(ctx.Value(consts.TraceIdKey))) + req.Header.Set(fasthttp.HeaderAuthorization, fmt.Sprintf("Bearer %s", token)) + req.SetRequestURI("https://test-tls2s.allapp.link/manage/campaign/reward_store?project_id=coeeaf6rdj7ie31dgad0") + req.SetBody(body) + + client := &fasthttp.Client{ + ReadTimeout: 15 * time.Second, + WriteTimeout: 15 * time.Second, + } + + err := client.Do(req, resp) + t.Log(err) + t.Log(resp.StatusCode(), string(resp.Body())) + +} + +func Test343(t *testing.T) { + a := sonyflake.NewSonyflake(sonyflake.Settings{}) + id, _ := a.NextID() + + id2 := app.SnowFlakeNode.Generate().Int64() + + id3 := app.SnowFlake11Node.ID() + id4 := app.SnowFlake11Node.ID() + t.Log(id, id2, id3, id4) + +} + +// Md5String md5字符串 +func Md5String(v string) string { + hash := md5.New() + hash.Write([]byte(v)) + b := hash.Sum(nil) + + return hex.EncodeToString(b) +} + +func Test111(t *testing.T) { + fz := time.FixedZone("GMT", int(6)*3600) + fz8 := time.FixedZone("GMT", int(8)*3600) + + t.Log(time.Unix(1733846400, 0).In(fz).Unix()) + + aa, _ := time.ParseInLocation(time.DateTime, "2024-12-18 14:00:00", fz) + bb, _ := time.ParseInLocation(time.DateTime, "2024-12-18 14:00:00", fz8) + t.Log(aa.Unix(), bb.Unix()) +} + +func Test23(t *testing.T) { + var a = "/manage/fission/create-group" + var upper bool + b := strings.Map(func(r rune) rune { + if r == '/' || r == '-' { + upper = true + return -1 + } + + if upper { + upper = false + return unicode.ToUpper(r) + } + + return r + }, a) + + t.Log(b) +} + +type Ads struct { + lc sync.RWMutex + Ad Ad +} + +type Ad struct { + Webs []*Web `json:"webs"` + Accounts struct { + Test string `json:"test"` + Prod string `json:"prod"` + } `json:"accounts"` +} + +type Web struct { + Host string `json:"host"` + Uris []struct { + Uri string `json:"uri"` + } `json:"uris"` +} + +// jr +var ids1 = []int64{143, 374} +var ads1 = &Ads{} +var j1 = "{\"accounts\": {\"test\": \"ca-pub-2821871715805907\",\"prod\": \"ca-pub-2821871715805907\"},\"webs\": [{\"host\": \"https://moads-r.allapp.link\",\"uris\": [{\"uri\": \"/business/helldivers-2-and-dead-island-2-support-studio-toadman-interactive-confirms-layoffs/\"},{\"uri\": \"/business/report-until-dawn-remake-developer-ballistic-moon-is-making-layoffs/\"},{\"uri\": \"/business/creative-uks-latest-fund-offers-up-to-25k-to-north-east-teams/\"},{\"uri\": \"/business/new-steam-tweaks-let-devs-highlight-related-games-and-dlc-on-store-pages/\"},{\"uri\": \"/business/mental-health-in-games-charity-take-this-is-facing-extinction/\"},{\"uri\": \"/finance/yes-network-msg-networks-to-launch-combined-new-york-regional-sports-app/\"},{\"uri\": \"/finance/nvidia-announces-50-billion-stock-buyback/\"},{\"uri\": \"/finance/nvidia-reports-122-revenue-growth-on-surging-demand-for-data-center-chips/\"},{\"uri\": \"/finance/ford-joins-list-of-companies-walking-back-dei-policies/\"},{\"uri\": \"/finance/lego-revenue-jumps-13-in-first-half-of-2024-boosted-by-lego-fortnite-and-diverse-brick-sets/\"},{\"uri\": \"/finance/nordstrom-shares-climb-5-as-earnings-top-estimates-but-retailer-issues-cautious-guidance/\"},{\"uri\": \"/news/civilization-7-interview-firaxis-answers-all-of-our-questions-about-the-anticipated-sequel-gamescom-2024/\"},{\"uri\": \"/news/crimson-desert-is-like-god-of-war-and-dragons-dogma-had-a-baby-gamescom-2024/\"},{\"uri\": \"/news/borderlands-4-announced-with-teaser-trailer-at-opening-night-live-gamescom-2024/\"},{\"uri\": \"/news/indiana-jones-and-the-great-circle-finally-gets-a-release-date-for-xboxand-playstation-gamescom-2024/\"},{\"uri\": \"/news/secret-level-every-video-game-in-the-new-gamescom-trailer/\"},{\"uri\": \"/news/ign-uk-podcast-762-the-best-of-gamescom-2024/\"}]}]}" + +// dhg +var ids2 = []int64{361} +var ads2 = &Ads{} +var j2 = "{\"accounts\": {\"test\": \"ca-pub-2821871715805907\",\"prod\": \"ca-pub-2821871715805907\"},\"webs\": [{\"host\": \"https://moads-dh.branchcn.com\",\"uris\": [{\"uri\": \"/post/the-cost-of-temptation/\"},{\"uri\": \"/post/the-temptation-within-a-tale-of-infidelity/\"},{\"uri\": \"/unexpected-encounter/sweet-deceptions-the-story-of-athena-and-dax/\"}]}]}" + +func Test2345(t *testing.T) { + err1 := jsonm.Unmarshal([]byte(j1), &ads1.Ad) + err2 := jsonm.Unmarshal([]byte(j2), &ads2.Ad) + t.Log(err1) + t.Log(err2) +} + +func Test233445(t *testing.T) { + t.Log(fmt.Sprintf("[%s]的mysql连接使用已经超过设置90%%(%d/%d)", utils.GetIp(), 1, 2)) +} + +func TestLL(t *testing.T) { + var err error + defer func() { + ll(err) + }() + + err = errors.New("test error") +} + +func ll(err error) { + var aaa map[string]map[int64]interface{} + + _, ok := aaa["dfsdf"][0] + if !ok { + log.Print(123132) + aaa["dfsdf"] = make(map[int64]interface{}) + } + +} + +func TestFissionUser(t *testing.T) { + for i := 0; i < 50; i++ { + var add = make([]*model.FissionUser, 0, 200) + var add2 = make([]*model.FissionUserStat, 0, 200) + for j := 0; j < 100; j++ { + userId := xid.New().String() + one := withdefault.FissionUser(&model.FissionUser{ + HashID: xid.New().String(), + CampaignID: 5186, + SubUserID: userId, + UserMark: userId, + UserType: 2, + Source: 1, + }) + + add = append(add, one) + + add2 = append(add2, withdefault.FissionUserStat(&model.FissionUserStat{ + UserID: one.ID, + CampaignID: one.CampaignID, + HelpNum: rand.Int63n(100), + })) + } + dao.FissionUser.SubTable(5186).WithContext(context.Background()).Create(add...) + dao.FissionUserStat.WithContext(context.Background()).Create(add2...) + + } + +} + +type StcMap struct { + A int + B int +} + +type G struct { + dataMap map[int]*StcMap +} + +func (g *G) name() { + c := g.dataMap[1] + g.add(c) +} + +func (g *G) add(c *StcMap) { + c.B++ +} + +func TestUnoCards(t *testing.T) { + + g := &G{ + dataMap: make(map[int]*StcMap), + } + + g.dataMap[1] = &StcMap{ + A: 1, + B: 2, + } + + g.name() + + t.Log(g.dataMap[1].B) + +} diff --git a/test/finder_test.go b/test/finder_test.go new file mode 100644 index 0000000..aa0b081 --- /dev/null +++ b/test/finder_test.go @@ -0,0 +1,105 @@ +package test + +import ( + "context" + "joybuywork/internal/repository/cache" + "joybuywork/internal/repository/finder" + "runtime" + "sync" + "testing" + "time" +) + +func TestFinder(t *testing.T) { + + t.Run("func", func(t *testing.T) { + + var m1, m2 runtime.MemStats + + runtime.ReadMemStats(&m1) + + data, _ := cache.NewProject(context.Background()).FindById(143) + + t.Logf("%+v", data) + + runtime.ReadMemStats(&m2) + + t.Logf("Alloc: %v B, TotalAlloc: %v B, HeapAlloc: %v B", + m2.Alloc-m1.Alloc, + m2.TotalAlloc-m1.TotalAlloc, + m2.HeapAlloc-m1.HeapAlloc) + }) + + t.Run("call", func(t *testing.T) { + var m1, m2 runtime.MemStats + + runtime.ReadMemStats(&m1) + + data, _ := finder.Project(context.Background(), int64(143)) + + t.Logf("%+v", data) + + runtime.ReadMemStats(&m2) + + t.Logf("Alloc: %v, TotalAlloc: %v, HeapAlloc: %v", + m2.Alloc-m1.Alloc, + m2.TotalAlloc-m1.TotalAlloc, + m2.HeapAlloc-m1.HeapAlloc) + }) + + var ms runtime.MemStats + runtime.ReadMemStats(&ms) + t.Logf("堆内存: %d MiB, map size: %d MiB, 总申请:%d Mib\n", ms.Alloc/1024/1024, ms.Sys/1024/1024, ms.TotalAlloc/1024/1024) + t.Run("wait", func(t *testing.T) { + + go func() { + t1 := time.NewTicker(time.Second) + for { + select { + case <-t1.C: + + wg := sync.WaitGroup{} + for i := 0; i < 10; i++ { + wg.Add(1) + go func() { + defer wg.Done() + cache.NewProject(context.Background()).FindById(143) + + }() + } + + wg.Wait() + } + } + }() + + }) + + t.Run("wait2", func(t *testing.T) { + t2 := time.NewTicker(time.Second) + for { + select { + case <-t2.C: + runtime.ReadMemStats(&ms) + t.Logf("堆内存: %d MiB, map size: %d MiB, 总申请:%d Mib\n", ms.Alloc/1024/1024, ms.Sys/1024/1024, ms.TotalAlloc/1024/1024) + } + } + }) + +} + +func TestAllocations(t *testing.T) { + allocs := testing.AllocsPerRun(100, func() { + finder.Project(context.Background(), 143) + }) + if allocs > 0 { + t.Errorf("代码发生了 %v 次内存分配", allocs) + } +} + +func BenchmarkSomething(b *testing.B) { + b.ReportAllocs() // 报告内存分配情况 + for i := 0; i < b.N; i++ { + finder.Project(context.Background(), int64(143)) + } +} diff --git a/test/rpc_test.go b/test/rpc_test.go new file mode 100644 index 0000000..3515d54 --- /dev/null +++ b/test/rpc_test.go @@ -0,0 +1,100 @@ +package test + +import ( + "context" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/server" + "joybuywork/internal/server/depend" + "errors" + "fmt" + "github.com/valyala/fasthttp" + "gits.branchcn.com/backend/microcode/micro" + "go-micro.dev/v4/client" + "io" + "net/http" + "os" + "sync" + "testing" + "time" +) + +func rpc() { + os.Args = []string{} + + depend.M = micro.Grpc(micro.GrpcConfig{ + ServerName: "test", + EtcdAddress: config.Config.Etcd.Address, + CallWrapper: []client.CallWrapper{ + server.CallWrapper(), + }, + }) +} + +func TestSignIn(t *testing.T) { + rpc() + + ctx := context.Background() + + //ser := w_campaign_userpb.NewWCampaignUserService(consts.ServiceName, depend.M.Client()) + + timer := time.NewTicker(time.Second) + defer timer.Stop() + wg := sync.WaitGroup{} + + for { + select { + //case <-timer.C: + // for i := 0; i < 100; i++ { + // wg.Add(1) + // go func() { + // defer wg.Done() + // res, err := ser.SignIn(ctx, &w_campaign_userpb.SignInReq{ + // UserId: 238719644948271104, + // NowMouth: "2025-4", + // PageType: 0, + // CampaignId: 4295, + // }) + // + // t.Logf("%v, %v", err, res) + // }() + // } + + case <-timer.C: + for i := 0; i < 100; i++ { + wg.Add(1) + go func() { + defer wg.Done() + cli := &http.Client{} + + // 创建请求 + req, err := http.NewRequest("GET", "http://127.0.0.1:13100/deep-view/fission-user/sign-in?now_mouth=&page_type=0", nil) + if err != nil { + err = errors.New(fmt.Sprintf("创建请求失败: %v", err)) + return + } + + req.Header.Set(fasthttp.HeaderContentType, "application/json") + req.Header.Set("X-Message-Id", fmt.Sprint(ctx.Value(consts.TraceIdKey))) + req.Header.Set(fasthttp.HeaderAuthorization, "Bearer eyJhbGciOiJIUzI1NiIsInNhbHQiOiJ5eXRCdXoiLCJzaWduIjoiNzFmYTIxYjBjMGZmYzAwOWRhYjNmOTcxMzdmMTVjZWMiLCJ0eXAiOiJKV1QiLCJ2ZXIiOiJ2MSJ9.eyJiaWQiOiIyMzg3MTk2NDQ5NDgyNzExMDQiLCJjYW1wYWlnbl9pZCI6NDI5NSwiY2hhbm5lbF9pZCI6ODIyOCwicGlkIjoyMzg3MTk2NDQ5NDgyNzExMDQsImxhbmciOiJ6aCIsInNob3dfbGFuZyI6InpoIiwidHoiOiJHTVQiLCJ0el9vZmZzZXQiOjgsImlzcyI6ImNlcnRpZmllZCIsImV4cCI6MTc0NDE3Mzk1OCwibmJmIjoxNzQ0MTY2NzU4LCJpYXQiOjE3NDQxNjY3NTgsImp0aSI6ImN2cXR1cG1yZGo3b2VtM3JxbGxnIn0.dC6bDlOfXmNpHdRQmPU68c4GOgFf9vIYI1d0kjQ5JMA") + + // 发送请求 + resp, err := cli.Do(req) + if err != nil { + err = errors.New(fmt.Sprintf("请求失败: %v", err)) + return + } + defer resp.Body.Close() + + // 可以通过 resp.Body 获取响应内容 + data, _ := io.ReadAll(resp.Body) + + t.Logf("%v, %s", err, string(data)) + + }() + } + } + } + + wg.Wait() +} diff --git a/test/test.go b/test/test.go new file mode 100644 index 0000000..e3d4546 --- /dev/null +++ b/test/test.go @@ -0,0 +1,101 @@ +package test + +import ( + "joybuywork/internal/app" + "joybuywork/internal/config" + "joybuywork/internal/consts" + "joybuywork/internal/repository/dao" + "joybuywork/internal/service/queue/producer" + "fmt" + "os" + "path/filepath" +) + +func init() { + configPath, err := findConfigPath() + if err != nil { + panic(err) + } + + var filePath = config.FilePath{ + ConfigName: "config-dev", + ConfigType: "yaml", + ConfigPath: configPath, + } + + err = config.LoadConfig(filePath) + if err != nil { + panic(err) + } + + err = app.InitFeiShu() + if err != nil { + panic(err) + } + + app.InitLogger() + + err = app.InitDB() + if err != nil { + panic(err) + } + + // 设置dao的数据库 + dao.SetDefault(app.DB.Client) + + err = app.InitRedis() + if err != nil { + panic(err) + } + + app.InitSubLock() + + err = app.InitEtcdCli() + if err != nil { + return + } + + //kafka + err = app.InitKafka() + if err != nil { + panic(err) + } + + //队列生产者 + producer.SetUp() + + err = app.InitNode() + if err != nil { + panic(err) + } + + consts.RunTest = true + + // 固定的奖品数据 + err = app.LangDataInit() + if err != nil { + panic(err) + } +} + +// findConfigPath 从当前测试包目录向上查找项目配置目录。 +// go test 会把工作目录设为被测包目录,因此不能依赖固定层级或 os.Args。 +func findConfigPath() (string, error) { + dir, err := os.Getwd() + if err != nil { + return "", fmt.Errorf("get working directory: %w", err) + } + + for { + configPath := filepath.Join(dir, "etc", "config-dev.yaml") + if info, statErr := os.Stat(configPath); statErr == nil && !info.IsDir() { + return filepath.Dir(configPath), nil + } + + parent := filepath.Dir(dir) + if parent == dir { + return "", fmt.Errorf("etc/config-dev.yaml not found from %s", dir) + } + dir = parent + } +} diff --git a/tools/bqueue/main.go b/tools/bqueue/main.go new file mode 100644 index 0000000..df58fd1 --- /dev/null +++ b/tools/bqueue/main.go @@ -0,0 +1,242 @@ +package main + +import ( + "bytes" + "flag" + "fmt" + "html/template" + "os" + "strings" +) + +var Auto = &AutoApi{} + +type AutoApi struct { + Topic string + Key string +} + +func main() { + fs := flag.NewFlagSet("service", flag.ExitOnError) + fs.StringVar(&Auto.Topic, "t", "", "set topic") + fs.StringVar(&Auto.Key, "k", "", "set key") + + // 解析命令行参数 + if err := fs.Parse(os.Args[1:]); err != nil { + _, _ = fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } + + if Auto.Key == "" || Auto.Topic == "" { + fmt.Fprintf(os.Stderr, "Error: must set -k or -t\n") + return + } + + path, _ := os.Getwd() + basePath := fmt.Sprintf("%s/internal/service/queue/", path) + + c := basePath + "consumer/" + p := basePath + "producer/" + t := basePath + "types/" + + name := camelString(Auto.Key) + topic := camelString(Auto.Topic) + + tt := T{ + Name: name, + Key: Auto.Key, + } + + var err error + defer func() { + if err != nil { + _, _ = fmt.Fprintf(os.Stderr, "Error: %v\n", err) + } + }() + + tc, err := createTmp(tt, tTemp) + if err != nil { + return + } + err = appendFile(fmt.Sprintf("%s%s.go", t, Auto.Topic), tc) + if err != nil { + return + } + + pt := P{ + Name: name, + Topic: topic, + } + + pc, err := createTmp(pt, pTemp) + if err != nil { + return + } + + err = appendFile(fmt.Sprintf("%s%s.go", p, Auto.Topic), pc) + if err != nil { + return + } + + pkg := strings.ReplaceAll(Auto.Topic, "_", "") + ct := C{ + Name: name, + Pkg: pkg, + } + + cc, err := createTmp(ct, cTemp) + if err != nil { + return + } + + err = createFile(fmt.Sprintf("%s%s/%s.go", c, pkg, Auto.Key), cc) + if err != nil { + return + } + + at := A{ + Name: name, + FName: strings.ToLower(string(name[0])) + name[1:], + } + + ac, err := createTmp(at, aTemp) + if err != nil { + return + } + + err = appendFile(fmt.Sprintf("%s%s/consume.go", c, pkg), ac) + if err != nil { + return + } + +} + +type T struct { + Name string + Key string +} + +var tTemp = ` +const {{ .UserId }}Key = "{{ .Key }}" +type {{ .UserId }} struct { + +}` + +type P struct { + Name string + Topic string +} + +var pTemp = ` +func (p {{ .Topic }}) {{ .UserId }}(data types.{{ .UserId }}) { + _ = AP.Produce(p.ctx, p.topic, types.{{ .UserId }}Key, data) +}` + +type C struct { + Name string + Pkg string +} + +var cTemp = `package {{ .Pkg }} + +import ( + "joybuywork/internal/service/queue/types" + "joybuywork/internal/utils/logic" +) + +type {{ .UserId }} struct { + logic.Logic + + Req *types.{{ .UserId }} +} + +func (s *{{ .UserId }}) Exec() (err error) { + return +}` + +type A struct { + Name string + FName string +} + +var aTemp = ` +func {{ .FName }}(ctx *consumer.Ctx) (err error) { + var val types.{{ .UserId }} + err = ctx.Parse(&val) + if err != nil { + return + } + + var container = new({{ .UserId }}) + { + container.Init(ctx.Context()) + container.Req = &val + } + + return logic.Run(container) +} +` + +// 蛇形转驼峰 +func camelString(s string) string { + data := make([]byte, 0, len(s)) + j := false + k := false + num := len(s) - 1 + for i := 0; i <= num; i++ { + d := s[i] + if k == false && d >= 'A' && d <= 'Z' { + k = true + } + if d >= 'a' && d <= 'z' && (j || k == false) { + d = d - 32 + j = false + k = true + } + if k && d == '_' && num > i && s[i+1] >= 'a' && s[i+1] <= 'z' { + j = true + continue + } + data = append(data, d) + } + return string(data[:]) +} + +func createTmp(content any, parse string) (text string, err error) { + t, err := template.New("tmp.tpl").Parse(parse) + if err != nil { + return + } + + var buf bytes.Buffer + err = t.Execute(&buf, content) + if err != nil { + return + } + + return buf.String(), nil +} + +func appendFile(filename, content string) (err error) { + file, err := os.OpenFile(filename, os.O_APPEND|os.O_RDWR, 0777) + defer file.Close() + if err != nil { + return err + } + + _, err = file.WriteString(content) + + return +} + +func createFile(filename, content string) (err error) { + file, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0777) + defer file.Close() + if err != nil { + return err + } + + _, err = file.WriteString(content) + + return +}